>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(b[t])return b[t];var e;if("k256"===t)e=new E;else if("p224"===t)e=new S;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new A}return b[t]=e,e},I.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},I.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},I.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(c(t,t.umod(this.m)._forceRed(this)),t)},I.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},I.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},I.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},I.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},I.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},I.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},I.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},I.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},I.prototype.isqr=function(t){return this.imul(t,t.clone())},I.prototype.sqr=function(t){return this.mul(t,t)},I.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,h).cmp(u);)c.redIAdd(u);for(var l=this.pow(c,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var g=d,m=0;0!==g.cmp(a);m++)g=g.redSqr();n(m=0;n--){for(var h=e.words[n],c=u-1;c>=0;c--){var l=h>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==s?(s<<=1,s|=l,(4===++a||0===n&&0===c)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},I.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},I.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new C(t)},i(C,I),C.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},C.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},C.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},C.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},C.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},8462:(t,e,r)=>{var n;function i(t){this.rand=t}if(t.exports=function(t){return n||(n=new i(null)),n.generate(t)},t.exports.Rand=i,i.prototype.generate=function(t){return this._rand(t)},i.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r{var n=r(9966).Buffer;function i(t){n.isBuffer(t)||(t=n.from(t));for(var e=t.length/4|0,r=new Array(e),i=0;i>>24]^c[p>>>16&255]^l[g>>>8&255]^f[255&m]^e[y++],s=h[p>>>24]^c[g>>>16&255]^l[m>>>8&255]^f[255&d]^e[y++],a=h[g>>>24]^c[m>>>16&255]^l[d>>>8&255]^f[255&p]^e[y++],u=h[m>>>24]^c[d>>>16&255]^l[p>>>8&255]^f[255&g]^e[y++],d=o,p=s,g=a,m=u;return o=(n[d>>>24]<<24|n[p>>>16&255]<<16|n[g>>>8&255]<<8|n[255&m])^e[y++],s=(n[p>>>24]<<24|n[g>>>16&255]<<16|n[m>>>8&255]<<8|n[255&d])^e[y++],a=(n[g>>>24]<<24|n[m>>>16&255]<<16|n[d>>>8&255]<<8|n[255&p])^e[y++],u=(n[m>>>24]<<24|n[d>>>16&255]<<16|n[p>>>8&255]<<8|n[255&g])^e[y++],[o>>>=0,s>>>=0,a>>>=0,u>>>=0]}var a=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],s=0,a=0,u=0;u<256;++u){var h=a^a<<1^a<<2^a<<3^a<<4;h=h>>>8^255&h^99,r[s]=h,n[h]=s;var c=t[s],l=t[c],f=t[l],d=257*t[h]^16843008*h;i[0][s]=d<<24|d>>>8,i[1][s]=d<<16|d>>>16,i[2][s]=d<<8|d>>>24,i[3][s]=d,d=16843009*f^65537*l^257*c^16843008*s,o[0][h]=d<<24|d>>>8,o[1][h]=d<<16|d>>>16,o[2][h]=d<<8|d>>>24,o[3][h]=d,0===s?s=a=1:(s=c^t[t[t[f^c]]],a^=t[t[a]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function h(t){this._key=i(t),this._reset()}h.blockSize=16,h.keySize=32,h.prototype.blockSize=h.blockSize,h.prototype.keySize=h.keySize,h.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,n=4*(r+1),i=[],o=0;o>>24,s=u.SBOX[s>>>24]<<24|u.SBOX[s>>>16&255]<<16|u.SBOX[s>>>8&255]<<8|u.SBOX[255&s],s^=a[o/e|0]<<24):e>6&&o%e===4&&(s=u.SBOX[s>>>24]<<24|u.SBOX[s>>>16&255]<<16|u.SBOX[s>>>8&255]<<8|u.SBOX[255&s]),i[o]=i[o-e]^s}for(var h=[],c=0;c>>24]]^u.INV_SUB_MIX[1][u.SBOX[f>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[f>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&f]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=h},h.prototype.encryptBlockRaw=function(t){return s(t=i(t),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},h.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=n.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r},h.prototype.decryptBlock=function(t){var e=(t=i(t))[1];t[1]=t[3],t[3]=e;var r=s(t,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),o=n.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},h.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},t.exports.AES=h},5787:(t,e,r)=>{var n=r(4279),i=r(9966).Buffer,o=r(6239),s=r(6329),a=r(8525),u=r(8586),h=r(3277);function c(t,e,r,s){o.call(this);var u=i.alloc(4,0);this._cipher=new n.AES(e);var c=this._cipher.encryptBlock(u);this._ghash=new a(c),r=function(t,e,r){if(12===e.length)return t._finID=i.concat([e,i.from([0,0,0,1])]),i.concat([e,i.from([0,0,0,2])]);var n=new a(r),o=e.length,s=o%16;n.update(e),s&&(s=16-s,n.update(i.alloc(s,0))),n.update(i.alloc(8,0));var u=8*o,c=i.alloc(8);c.writeUIntBE(u,0,8),n.update(c),t._finID=n.state;var l=i.from(t._finID);return h(l),l}(this,r,c),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=s,this._alen=0,this._len=0,this._mode=t,this._authTag=null,this._called=!1}s(c,o),c.prototype._update=function(t){if(!this._called&&this._alen){var e=16-this._alen%16;e<16&&(e=i.alloc(e,0),this._ghash.update(e))}this._called=!0;var r=this._mode.encrypt(this,t);return this._decrypt?this._ghash.update(t):this._ghash.update(r),this._len+=t.length,r},c.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var t=u(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(t,e){var r=0;t.length!==e.length&&r++;for(var n=Math.min(t.length,e.length),i=0;i{var n=r(9454),i=r(5190),o=r(3219);e.createCipher=e.Cipher=n.createCipher,e.createCipheriv=e.Cipheriv=n.createCipheriv,e.createDecipher=e.Decipher=i.createDecipher,e.createDecipheriv=e.Decipheriv=i.createDecipheriv,e.listCiphers=e.getCiphers=function(){return Object.keys(o)}},5190:(t,e,r)=>{var n=r(5787),i=r(9966).Buffer,o=r(1735),s=r(2301),a=r(6239),u=r(4279),h=r(8451);function c(t,e,r){a.call(this),this._cache=new l,this._last=void 0,this._cipher=new u.AES(e),this._prev=i.from(r),this._mode=t,this._autopadding=!0}function l(){this.cache=i.allocUnsafe(0)}function f(t,e,r){var a=o[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"===typeof r&&(r=i.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);if("string"===typeof e&&(e=i.from(e)),e.length!==a.key/8)throw new TypeError("invalid key length "+e.length);return"stream"===a.type?new s(a.module,e,r,!0):"auth"===a.type?new n(a.module,e,r,!0):new c(a.module,e,r)}r(6329)(c,a),c.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,e),n.push(r);return i.concat(n)},c.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return function(t){var e=t[15];if(e<1||e>16)throw new Error("unable to decrypt data");var r=-1;for(;++r16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},l.prototype.flush=function(){if(this.cache.length)return this.cache},e.createDecipher=function(t,e){var r=o[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=h(e,!1,r.key,r.iv);return f(t,n.key,n.iv)},e.createDecipheriv=f},9454:(t,e,r)=>{var n=r(1735),i=r(5787),o=r(9966).Buffer,s=r(2301),a=r(6239),u=r(4279),h=r(8451);function c(t,e,r){a.call(this),this._cache=new f,this._cipher=new u.AES(e),this._prev=o.from(r),this._mode=t,this._autopadding=!0}r(6329)(c,a),c.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get();)r=this._mode.encrypt(this,e),n.push(r);return o.concat(n)};var l=o.alloc(16,16);function f(){this.cache=o.allocUnsafe(0)}function d(t,e,r){var a=n[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"===typeof e&&(e=o.from(e)),e.length!==a.key/8)throw new TypeError("invalid key length "+e.length);if("string"===typeof r&&(r=o.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===a.type?new s(a.module,e,r):"auth"===a.type?new i(a.module,e,r):new c(a.module,e,r)}c.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if(!t.equals(l))throw this._cipher.scrub(),new Error("data not multiple of block length")},c.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},f.prototype.add=function(t){this.cache=o.concat([this.cache,t])},f.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},f.prototype.flush=function(){for(var t=16-this.cache.length,e=o.allocUnsafe(t),r=-1;++r{var n=r(9966).Buffer,i=n.alloc(16,0);function o(t){var e=n.allocUnsafe(16);return e.writeUInt32BE(t[0]>>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function s(t){this.h=t,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}s.prototype.ghash=function(t){for(var e=-1;++e0;e--)n[e]=n[e]>>>1|(1&n[e-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=o(i)},s.prototype.update=function(t){var e;for(this.cache=n.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},s.prototype.final=function(t,e){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(o([0,t,0,e])),this.state},t.exports=s},3277:t=>{t.exports=function(t){for(var e,r=t.length;r--;){if(255!==(e=t.readUInt8(r))){e++,t.writeUInt8(e,r);break}t.writeUInt8(0,r)}}},4645:(t,e,r)=>{var n=r(8586);e.encrypt=function(t,e){var r=n(e,t._prev);return t._prev=t._cipher.encryptBlock(r),t._prev},e.decrypt=function(t,e){var r=t._prev;t._prev=e;var i=t._cipher.decryptBlock(e);return n(i,r)}},6210:(t,e,r)=>{var n=r(9966).Buffer,i=r(8586);function o(t,e,r){var o=e.length,s=i(e,t._cache);return t._cache=t._cache.slice(o),t._prev=n.concat([t._prev,r?e:s]),s}e.encrypt=function(t,e,r){for(var i,s=n.allocUnsafe(0);e.length;){if(0===t._cache.length&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=n.allocUnsafe(0)),!(t._cache.length<=e.length)){s=n.concat([s,o(t,e,r)]);break}i=t._cache.length,s=n.concat([s,o(t,e.slice(0,i),r)]),e=e.slice(i)}return s}},7071:(t,e,r)=>{var n=r(9966).Buffer;function i(t,e,r){for(var n,i,s=-1,a=0;++s<8;)n=e&1<<7-s?128:0,a+=(128&(i=t._cipher.encryptBlock(t._prev)[0]^n))>>s%8,t._prev=o(t._prev,r?n:i);return a}function o(t,e){var r=t.length,i=-1,o=n.allocUnsafe(t.length);for(t=n.concat([t,n.from([e])]);++i>7;return o}e.encrypt=function(t,e,r){for(var o=e.length,s=n.allocUnsafe(o),a=-1;++a{var n=r(9966).Buffer;function i(t,e,r){var i=t._cipher.encryptBlock(t._prev)[0]^e;return t._prev=n.concat([t._prev.slice(1),n.from([r?e:i])]),i}e.encrypt=function(t,e,r){for(var o=e.length,s=n.allocUnsafe(o),a=-1;++a{var n=r(8586),i=r(9966).Buffer,o=r(3277);function s(t){var e=t._cipher.encryptBlockRaw(t._prev);return o(t._prev),e}e.encrypt=function(t,e){var r=Math.ceil(e.length/16),o=t._cache.length;t._cache=i.concat([t._cache,i.allocUnsafe(16*r)]);for(var a=0;a{e.encrypt=function(t,e){return t._cipher.encryptBlock(e)},e.decrypt=function(t,e){return t._cipher.decryptBlock(e)}},1735:(t,e,r)=>{var n={ECB:r(7257),CBC:r(4645),CFB:r(6210),CFB8:r(8528),CFB1:r(7071),OFB:r(3542),CTR:r(5536),GCM:r(5536)},i=r(3219);for(var o in i)i[o].module=n[i[o].mode];t.exports=i},3542:(t,e,r)=>{var n=r(6382).Buffer,i=r(8586);function o(t){return t._prev=t._cipher.encryptBlock(t._prev),t._prev}e.encrypt=function(t,e){for(;t._cache.length{var n=r(4279),i=r(9966).Buffer,o=r(6239);function s(t,e,r,s){o.call(this),this._cipher=new n.AES(e),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=s,this._mode=t}r(6329)(s,o),s.prototype._update=function(t){return this._mode.encrypt(this,t,this._decrypt)},s.prototype._final=function(){this._cipher.scrub()},t.exports=s},4014:(t,e,r)=>{var n=r(6951),i=r(2428),o=r(1735),s=r(5491),a=r(8451);function u(t,e,r){if(t=t.toLowerCase(),o[t])return i.createCipheriv(t,e,r);if(s[t])return new n({key:e,iv:r,mode:t});throw new TypeError("invalid suite type")}function h(t,e,r){if(t=t.toLowerCase(),o[t])return i.createDecipheriv(t,e,r);if(s[t])return new n({key:e,iv:r,mode:t,decrypt:!0});throw new TypeError("invalid suite type")}e.createCipher=e.Cipher=function(t,e){var r,n;if(t=t.toLowerCase(),o[t])r=o[t].key,n=o[t].iv;else{if(!s[t])throw new TypeError("invalid suite type");r=8*s[t].key,n=s[t].iv}var i=a(e,!1,r,n);return u(t,i.key,i.iv)},e.createCipheriv=e.Cipheriv=u,e.createDecipher=e.Decipher=function(t,e){var r,n;if(t=t.toLowerCase(),o[t])r=o[t].key,n=o[t].iv;else{if(!s[t])throw new TypeError("invalid suite type");r=8*s[t].key,n=s[t].iv}var i=a(e,!1,r,n);return h(t,i.key,i.iv)},e.createDecipheriv=e.Decipheriv=h,e.listCiphers=e.getCiphers=function(){return Object.keys(s).concat(i.getCiphers())}},6951:(t,e,r)=>{var n=r(6239),i=r(3325),o=r(6329),s=r(9966).Buffer,a={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function u(t){n.call(this);var e,r=t.mode.toLowerCase(),i=a[r];e=t.decrypt?"decrypt":"encrypt";var o=t.key;s.isBuffer(o)||(o=s.from(o)),"des-ede"!==r&&"des-ede-cbc"!==r||(o=s.concat([o,o.slice(0,8)]));var u=t.iv;s.isBuffer(u)||(u=s.from(u)),this._des=i.create({key:o,iv:u,type:e})}a.des=a["des-cbc"],a.des3=a["des-ede3-cbc"],t.exports=u,o(u,n),u.prototype._update=function(t){return s.from(this._des.update(t))},u.prototype._final=function(){return s.from(this._des.final())}},5491:(t,e)=>{e["des-ecb"]={key:8,iv:0},e["des-cbc"]=e.des={key:8,iv:8},e["des-ede3-cbc"]=e.des3={key:24,iv:8},e["des-ede3"]={key:24,iv:0},e["des-ede-cbc"]={key:16,iv:8},e["des-ede"]={key:16,iv:0}},5721:(t,e,r)=>{var n=r(6382).Buffer,i=r(6373),o=r(5838);function s(t){var e,r=t.modulus.byteLength();do{e=new i(o(r))}while(e.cmp(t.modulus)>=0||!e.umod(t.prime1)||!e.umod(t.prime2));return e}function a(t,e){var r=function(t){var e=s(t);return{blinder:e.toRed(i.mont(t.modulus)).redPow(new i(t.publicExponent)).fromRed(),unblinder:e.invm(t.modulus)}}(e),o=e.modulus.byteLength(),a=new i(t).mul(r.blinder).umod(e.modulus),u=a.toRed(i.mont(e.prime1)),h=a.toRed(i.mont(e.prime2)),c=e.coefficient,l=e.prime1,f=e.prime2,d=u.redPow(e.exponent1).fromRed(),p=h.redPow(e.exponent2).fromRed(),g=d.isub(p).imul(c).umod(l).imul(f);return p.iadd(g).imul(r.unblinder).umod(e.modulus).toArrayLike(n,"be",o)}a.getr=s,t.exports=a},9096:(t,e,r)=>{"use strict";t.exports=r(2951)},7207:(t,e,r)=>{"use strict";var n=r(9966).Buffer,i=r(6059),o=r(3486),s=r(6329),a=r(2478),u=r(8818),h=r(2951);function c(t){o.Writable.call(this);var e=h[t];if(!e)throw new Error("Unknown message digest");this._hashType=e.hash,this._hash=i(e.hash),this._tag=e.id,this._signType=e.sign}function l(t){o.Writable.call(this);var e=h[t];if(!e)throw new Error("Unknown message digest");this._hash=i(e.hash),this._tag=e.id,this._signType=e.sign}function f(t){return new c(t)}function d(t){return new l(t)}Object.keys(h).forEach((function(t){h[t].id=n.from(h[t].id,"hex"),h[t.toLowerCase()]=h[t]})),s(c,o.Writable),c.prototype._write=function(t,e,r){this._hash.update(t),r()},c.prototype.update=function(t,e){return this._hash.update("string"===typeof t?n.from(t,e):t),this},c.prototype.sign=function(t,e){this.end();var r=this._hash.digest(),n=a(r,t,this._hashType,this._signType,this._tag);return e?n.toString(e):n},s(l,o.Writable),l.prototype._write=function(t,e,r){this._hash.update(t),r()},l.prototype.update=function(t,e){return this._hash.update("string"===typeof t?n.from(t,e):t),this},l.prototype.verify=function(t,e,r){var i="string"===typeof e?n.from(e,r):e;this.end();var o=this._hash.digest();return u(i,o,t,this._signType,this._tag)},t.exports={Sign:f,Verify:d,createSign:f,createVerify:d}},2478:(t,e,r)=>{"use strict";var n=r(9966).Buffer,i=r(2080),o=r(5721),s=r(8086).ec,a=r(6373),u=r(4496),h=r(4589);function c(t,e,r,o){if((t=n.from(t.toArray())).length0&&r.ishrn(n),r}function f(t,e,r){var o,s;do{for(o=n.alloc(0);8*o.length{"use strict";var n=r(9966).Buffer,i=r(6373),o=r(8086).ec,s=r(4496),a=r(4589);function u(t,e){if(t.cmpn(0)<=0)throw new Error("invalid sig");if(t.cmp(e)>=0)throw new Error("invalid sig")}t.exports=function(t,e,r,h,c){var l=s(r);if("ec"===l.type){if("ecdsa"!==h&&"ecdsa/rsa"!==h)throw new Error("wrong public key type");return function(t,e,r){var n=a[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var i=new o(n),s=r.data.subjectPrivateKey.data;return i.verify(e,t,s)}(t,e,l)}if("dsa"===l.type){if("dsa"!==h)throw new Error("wrong public key type");return function(t,e,r){var n=r.data.p,o=r.data.q,a=r.data.g,h=r.data.pub_key,c=s.signature.decode(t,"der"),l=c.s,f=c.r;u(l,o),u(f,o);var d=i.mont(n),p=l.invm(o),g=a.toRed(d).redPow(new i(e).mul(p).mod(o)).fromRed().mul(h.toRed(d).redPow(f.mul(p).mod(o)).fromRed()).mod(n).mod(o);return 0===g.cmp(f)}(t,e,l)}if("rsa"!==h&&"ecdsa/rsa"!==h)throw new Error("wrong public key type");e=n.concat([c,e]);for(var f=l.modulus.byteLength(),d=[1],p=0;e.length+d.length+2{var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},6211:(t,e,r)=>{"use strict";var n=r(6600),i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=l;var o=Object.create(r(3525));o.inherits=r(6329);var s=r(1137),a=r(9873);o.inherits(l,s);for(var u=i(a.prototype),h=0;h{"use strict";t.exports=o;var n=r(981),i=Object.create(r(3525));function o(t){if(!(this instanceof o))return new o(t);n.call(this,t)}i.inherits=r(6329),i.inherits(o,n),o.prototype._transform=function(t,e,r){r(null,t)}},1137:(t,e,r)=>{"use strict";var n=r(2285),i=r(6600);t.exports=v;var o,s=r(9101);v.ReadableState=w;r(7284).EventEmitter;var a=function(t,e){return t.listeners(e).length},u=r(4526),h=r(39).Buffer,c=("undefined"!==typeof r.g?r.g:"undefined"!==typeof window?window:"undefined"!==typeof self?self:{}).Uint8Array||function(){};var l=Object.create(r(3525));l.inherits=r(6329);var f=r(2668),d=void 0;d=f&&f.debuglog?f.debuglog("stream"):function(){};var p,g=r(2249),m=r(6269);l.inherits(v,u);var y=["error","close","destroy","pause","resume"];function w(t,e){t=t||{};var n=e instanceof(o=o||r(6211));this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,s=t.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(s||0===s)?s:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(p||(p=r(2942).I),this.decoder=new p(t.encoding),this.encoding=t.encoding)}function v(t){if(o=o||r(6211),!(this instanceof v))return new v(t);this._readableState=new w(t,this),this.readable=!0,t&&("function"===typeof t.read&&(this._read=t.read),"function"===typeof t.destroy&&(this._destroy=t.destroy)),u.call(this)}function b(t,e,r,n,i){var o,s=t._readableState;null===e?(s.reading=!1,function(t,e){if(e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,M(t)}(t,s)):(i||(o=function(t,e){var r;n=e,h.isBuffer(n)||n instanceof c||"string"===typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(s,e)),o?t.emit("error",o):s.objectMode||e&&e.length>0?("string"===typeof e||s.objectMode||Object.getPrototypeOf(e)===h.prototype||(e=function(t){return h.from(t)}(e)),n?s.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):_(t,s,e,!0):s.ended?t.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?_(t,s,e,!1):I(t,s)):_(t,s,e,!1))):n||(s.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=E?t=E:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function M(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(d("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(A,t):A(t))}function A(t){d("emit readable"),t.emit("readable"),T(t)}function I(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(C,t,e))}function C(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var n;to.length?o.length:t;if(s===o.length?i+=o:i+=o.slice(0,t),0===(t-=s)){s===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++n}return e.length-=n,i}(t,e):function(t,e){var r=h.allocUnsafe(t),n=e.head,i=1;n.data.copy(r),t-=n.data.length;for(;n=n.next;){var o=n.data,s=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,s),0===(t-=s)){s===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(s));break}++i}return e.length-=i,r}(t,e);return n}(t,e.buffer,e.decoder),r);var r}function N(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i.nextTick(B,e,t))}function B(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function R(t,e){for(var r=0,n=t.length;r=e.highWaterMark||e.ended))return d("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?N(this):M(this),null;if(0===(t=S(t,e))&&e.ended)return 0===e.length&&N(this),null;var n,i=e.needReadable;return d("need readable",i),(0===e.length||e.length-t0?O(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&N(this)),null!==n&&this.emit("data",n),n},v.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},v.prototype.pipe=function(t,e){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,e);var u=(!e||!1!==e.end)&&t!==n.stdout&&t!==n.stderr?c:v;function h(e,n){d("onunpipe"),e===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,d("cleanup"),t.removeListener("close",y),t.removeListener("finish",w),t.removeListener("drain",l),t.removeListener("error",m),t.removeListener("unpipe",h),r.removeListener("end",c),r.removeListener("end",v),r.removeListener("data",g),f=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||l())}function c(){d("onend"),t.end()}o.endEmitted?i.nextTick(u):r.once("end",u),t.on("unpipe",h);var l=function(t){return function(){var e=t._readableState;d("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,T(t))}}(r);t.on("drain",l);var f=!1;var p=!1;function g(e){d("ondata"),p=!1,!1!==t.write(e)||p||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==R(o.pipes,t))&&!f&&(d("false write response, pause",o.awaitDrain),o.awaitDrain++,p=!0),r.pause())}function m(e){d("onerror",e),v(),t.removeListener("error",m),0===a(t,"error")&&t.emit("error",e)}function y(){t.removeListener("finish",w),v()}function w(){d("onfinish"),t.removeListener("close",y),v()}function v(){d("unpipe"),r.unpipe(t)}return r.on("data",g),function(t,e,r){if("function"===typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?s(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",m),t.once("close",y),t.once("finish",w),t.emit("pipe",r),o.flowing||(d("pipe resume"),r.resume()),t},v.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o{"use strict";t.exports=s;var n=r(6211),i=Object.create(r(3525));function o(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length{"use strict";var n=r(2285),i=r(6600);function o(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;t.entry=null;for(;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}t.exports=y;var s,a=!n.browser&&["v0.10","v0.9."].indexOf(n.version.slice(0,5))>-1?setImmediate:i.nextTick;y.WritableState=m;var u=Object.create(r(3525));u.inherits=r(6329);var h={deprecate:r(2390)},c=r(4526),l=r(39).Buffer,f=("undefined"!==typeof r.g?r.g:"undefined"!==typeof window?window:"undefined"!==typeof self?self:{}).Uint8Array||function(){};var d,p=r(6269);function g(){}function m(t,e){s=s||r(6211),t=t||{};var n=e instanceof s;this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var u=t.highWaterMark,h=t.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=u||0===u?u:n&&(h||0===h)?h:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===t.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,o=r.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,o){--e.pendingcb,r?(i.nextTick(o,n),i.nextTick(S,t,e),t._writableState.errorEmitted=!0,t.emit("error",n)):(o(n),t._writableState.errorEmitted=!0,t.emit("error",n),S(t,e))}(t,r,n,e,o);else{var s=_(r);s||r.corked||r.bufferProcessing||!r.bufferedRequest||b(t,r),n?a(v,t,r,s,o):v(t,r,s,o)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function y(t){if(s=s||r(6211),!d.call(y,this)&&!(this instanceof s))return new y(t);this._writableState=new m(t,this),this.writable=!0,t&&("function"===typeof t.write&&(this._write=t.write),"function"===typeof t.writev&&(this._writev=t.writev),"function"===typeof t.destroy&&(this._destroy=t.destroy),"function"===typeof t.final&&(this._final=t.final)),c.call(this)}function w(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function v(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),S(t,e)}function b(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),s=e.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)i[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;i.allBuffers=u,w(t,e,!0,e.length,i,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new o(e),e.bufferedRequestCount=0}else{for(;r;){var h=r.chunk,c=r.encoding,l=r.callback;if(w(t,e,!1,e.objectMode?1:h.length,h,c,l),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function _(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function E(t,e){t._final((function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),S(t,e)}))}function S(t,e){var r=_(e);return r&&(!function(t,e){e.prefinished||e.finalCalled||("function"===typeof t._final?(e.pendingcb++,e.finalCalled=!0,i.nextTick(E,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),r}u.inherits(y,c),m.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(m.prototype,"buffer",{get:h.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"===typeof Symbol&&Symbol.hasInstance&&"function"===typeof Function.prototype[Symbol.hasInstance]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(t){return!!d.call(this,t)||this===y&&(t&&t._writableState instanceof m)}})):d=function(t){return t instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(t,e,r){var n,o=this._writableState,s=!1,a=!o.objectMode&&(n=t,l.isBuffer(n)||n instanceof f);return a&&!l.isBuffer(t)&&(t=function(t){return l.from(t)}(t)),"function"===typeof e&&(r=e,e=null),a?e="buffer":e||(e=o.defaultEncoding),"function"!==typeof r&&(r=g),o.ended?function(t,e){var r=new Error("write after end");t.emit("error",r),i.nextTick(e,r)}(this,r):(a||function(t,e,r,n){var o=!0,s=!1;return null===r?s=new TypeError("May not write null values to stream"):"string"===typeof r||void 0===r||e.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(t.emit("error",s),i.nextTick(n,s),o=!1),o}(this,o,t,r))&&(o.pendingcb++,s=function(t,e,r,n,i,o){if(!r){var s=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!==typeof e||(e=l.from(e,r));return e}(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(t,e,r){var n=this._writableState;"function"===typeof t?(r=t,t=null,e=null):"function"===typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,S(t,e),r&&(e.finished?i.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),y.prototype.destroy=p.destroy,y.prototype._undestroy=p.undestroy,y.prototype._destroy=function(t,e){this.end(),e(t)}},2249:(t,e,r)=>{"use strict";var n=r(39).Buffer,i=r(1638);t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return n.alloc(0);for(var e,r,i,o=n.allocUnsafe(t>>>0),s=this.head,a=0;s;)e=s.data,r=o,i=a,e.copy(r,i),a+=s.data.length,s=s.next;return o},t}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+" "+t})},6269:(t,e,r)=>{"use strict";var n=r(6600);function i(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var r=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(i,this,t)):n.nextTick(i,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?r._writableState?r._writableState.errorEmitted||(r._writableState.errorEmitted=!0,n.nextTick(i,r,t)):n.nextTick(i,r,t):e&&e(t)})),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)}}},4526:(t,e,r)=>{t.exports=r(7284).EventEmitter},39:(t,e,r)=>{var n=r(6382),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),o(i,s),s.from=function(t,e,r){if("number"===typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!==typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"===typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!==typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!==typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},3486:(t,e,r)=>{(e=t.exports=r(1137)).Stream=e,e.Readable=e,e.Writable=r(9873),e.Duplex=r(6211),e.Transform=r(981),e.PassThrough=r(9135)},2942:(t,e,r)=>{"use strict";var n=r(2888).Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!==typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=h,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=c,this.end=l,e=3;break;default:return this.write=f,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function s(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!==(192&e[0]))return t.lastNeed=0,"\ufffd";if(t.lastNeed>1&&e.length>1){if(128!==(192&e[1]))return t.lastNeed=1,"\ufffd";if(t.lastNeed>2&&e.length>2&&128!==(192&e[2]))return t.lastNeed=2,"\ufffd"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function h(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function c(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function f(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.I=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(t.lastNeed=i-1),i;if(--n=0)return i>0&&(t.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},2888:(t,e,r)=>{var n=r(6382),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),o(i,s),s.from=function(t,e,r){if("number"===typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!==typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"===typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!==typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!==typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},462:(t,e,r)=>{const n=r(6281);t.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},597:(t,e,r)=>{"use strict";var n=r(462);t.exports=function(t){function e(e){var r=e.slice(0,-4),n=e.slice(-4),i=t(r);if(!(n[0]^i[0]|n[1]^i[1]|n[2]^i[2]|n[3]^i[3]))return r}return{encode:function(e){var r=Uint8Array.from(e),i=t(r),o=r.length+4,s=new Uint8Array(o);return s.set(r,0),s.set(i.subarray(0,4),r.length),n.encode(s,o)},decode:function(t){var r=e(n.decode(t));if(!r)throw new Error("Invalid checksum");return r},decodeUnsafe:function(t){var r=n.decodeUnsafe(t);if(r)return e(r)}}}},3630:(t,e,r)=>{"use strict";var{sha256:n}=r(1678),i=r(597);t.exports=i((function(t){return n(n(t))}))},5284:t=>{"use strict";class e extends Error{constructor(t){"string"===typeof t&&(t={message:t}),null!==t&&"object"===typeof t||(t={});let e=null,r="fail",n=Boolean(t.generatedMessage),i=null;var o;if(null!=t.message&&(e="string"===typeof(o=t.message)?o:b(o)?f(o):l(o)),"string"===typeof t.operator&&(r=t.operator),null==e){if("fail"===r)e="Assertion failed.";else{const n=l(t.actual),i=l(t.expected);e="".concat(n," ").concat(r," ").concat(i)}n=!0}"function"===typeof t.stackStartFunction?i=t.stackStartFunction:"function"===typeof t.stackStartFn&&(i=t.stackStartFn),super(e),this.generatedMessage=n,this.code="ERR_ASSERTION",this.actual=t.actual,this.expected=t.expected,this.operator=r,Object.defineProperty(this,"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),Error.captureStackTrace&&null!=i&&Error.captureStackTrace(this,i),this.stack,this.name="AssertionError"}toString(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}}function r(t,n){if(!t){let i=!1;if(0===arguments.length)n="No value argument passed to `assert()`.",i=!0;else if(null==n)n="Assertion failed.",i=!0;else if(b(n))throw n;throw new e({message:n,actual:t,expected:!0,operator:"==",generatedMessage:i,stackStartFn:r})}}function n(t,r,i){if(!Object.is(t,r)){if(b(i))throw i;throw new e({message:i,actual:t,expected:r,operator:"strictEqual",stackStartFn:n})}}function i(t,r,n){if(Object.is(t,r)){if(b(n))throw n;throw new e({message:n,actual:t,expected:r,operator:"notStrictEqual",stackStartFn:i})}}function o(t,r,n){"string"===typeof r&&(n=r,r=void 0);let i=!1,s=null;c("function"===typeof t,"func","function");try{t()}catch(a){i=!0,s=a}if(i){if(d(s,r,n,o)){let t=!1;throw null==n&&(n="Got unwanted exception.",t=!0),new e({message:n,actual:s,expected:r,operator:"doesNotThrow",generatedMessage:t,stackStartFn:o})}throw s}}async function s(t,r,n){"string"===typeof r&&(n=r,r=void 0);let i=!1,o=null;"function"!==typeof t&&c(E(t),"func","promise");try{E(t)?await t:await t()}catch(a){i=!0,o=a}if(!i){let t=!1;throw null==n&&(n="Missing expected rejection.",t=!0),new e({message:n,actual:void 0,expected:r,operator:"rejects",generatedMessage:t,stackStartFn:s})}if(!d(o,r,n,s))throw o}async function a(t,r,n){"string"===typeof r&&(n=r,r=void 0);let i=!1,o=null;"function"!==typeof t&&c(E(t),"func","promise");try{E(t)?await t:await t()}catch(s){i=!0,o=s}if(i){if(d(o,r,n,a)){let t=!1;throw null==n&&(n="Got unwanted rejection.",t=!0),new e({message:n,actual:void 0,expected:r,operator:"doesNotReject",generatedMessage:t,stackStartFn:a})}throw o}}function u(t,r,n){if(!g(t,r,!1)){if(b(n))throw n;throw new e({message:n,actual:t,expected:r,operator:"deepStrictEqual",stackStartFn:u})}}function h(t,r,n){if(g(t,r,!0)){if(b(n))throw n;throw new e({message:n,actual:t,expected:r,operator:"notDeepStrictEqual",stackStartFn:h})}}function c(t,e,r){if(!t){let t;t=null==e?"Invalid type for parameter.":null==r?'Invalid type for "'.concat(e,'".'):'"'.concat(e,'" must be a(n) ').concat(r,".");const n=new TypeError(t);throw Error.captureStackTrace&&Error.captureStackTrace(n,c),n}}function l(t){switch(typeof t){case"undefined":return"undefined";case"object":return null===t?"null":"[".concat(function(t){const e=function(t){return w(t).slice(8,-1)}(t);if(null==t)return e;if("Object"!==e&&"Error"!==e)return e;let r,n;try{r=t.constructor}catch(i){}if(null==r)return e;try{n=r.name}catch(i){return e}return"string"!==typeof n||0===n.length?e:n}(t),"]");case"boolean":case"number":return"".concat(t);case"string":return t.length>80&&(t="".concat(t.substring(0,77),"...")),JSON.stringify(t);case"symbol":return f(t);case"function":return"[".concat(function(t){let e;try{e=t.name}catch(r){}return"string"!==typeof e||0===e.length?"Function":"Function: ".concat(e)}(t),"]");case"bigint":return"".concat(t,"n");default:return"[".concat(typeof t,"]")}}function f(t){try{return String(t)}catch(e){return"Object"}}function d(t,r,n,i){if(null==r)return!0;if(S(r))return r.test(t);if("function"!==typeof r){if(i===o||i===a)throw new TypeError('"expected" must not be an object.');if("object"!==typeof r)throw new TypeError('"expected" must be an object.');let u=!1;if(null==n){n="Missing expected ".concat(i===s?"rejection":"exception","."),u=!0}if(null==t||"object"!==typeof t)throw new e({actual:t,expected:r,message:n,operator:i.name,generatedMessage:u,stackStartFn:i});const h=Object.keys(r);if(b(r)&&h.push("name","message"),0===h.length)throw new TypeError('"expected" may not be an empty object.');for(const o of h){const s=r[o],a=t[o];if(("string"!==typeof a||!S(s)||!s.test(a))&&(!(o in t)||!g(a,s,!1)))throw new e({actual:t,expected:r,message:n,operator:i.name,generatedMessage:u,stackStartFn:i})}return!0}return void 0!==r.prototype&&t instanceof r||!Error.isPrototypeOf(r)&&!0===r.call({},t)}function p(t,r,n,i,o){if(c("string"===typeof t,"string","string"),c(S(r),"regexp","RegExp"),r.test(t)!==o){if(b(n))throw n;let s=!1;throw null==n&&(n="The input ".concat(o?"did":"was expected to"," ")+"not match the regular expression ".concat(r,". ")+"Input:\n\n".concat(l(t),"\n"),s=!0),new e({actual:t,expected:r,message:n,operator:i.name,generatedMessage:s,stackStartFn:i})}}function g(t,e,r){try{return m(t,e,null)}catch(n){return r}}function m(t,e,r){if(Object.is(t,e))return!0;if(!_(t)||!_(e))return!1;if(w(t)!==w(e))return!1;if(Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;if(v(t)&&v(e))return t.equals(e);if(t instanceof Date)return Object.is(t.getTime(),e.getTime());if(S(t))return t.source===e.source&&t.flags===e.flags;if(b(t)&&t.message!==e.message)return!1;if(function(t){return t instanceof ArrayBuffer}(t)&&(t=new Uint8Array(t),e=new Uint8Array(e)),function(t){return ArrayBuffer.isView(t)}(t)&&!v(t)){if(v(e))return!1;const r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(r.length!==n.length)return!1;for(let t=0;t9)return!1;switch(t.toLowerCase()){case"ascii":case"binary":case"base64":case"base64url":case"hex":case"latin1":case"ucs2":case"utf8":case"utf16le":case"ucs-2":case"utf-8":case"utf-16le":return!0}return!1}function A(t,e,r){if("string"===typeof e){if(!v(t))return null;const{constructor:n}=t;if(!n||"function"!==typeof n.from)return null;if(!M(r))return null;const i=n.from(e,r);return 3===r.length&&2*i.length!==e.length?null:i}return e}e.prototype.name="AssertionError",e.prototype.type="AssertionError",r.AssertionError=e,r.assert=r,r.strict=r,r.ok=r,r.equal=n,r.notEqual=i,r.strictEqual=n,r.notStrictEqual=i,r.fail=function t(r){let n=!1;if(b(r))throw r;throw null==r&&(r="Assertion failed.",n=!0),new e({message:r,actual:!1,expected:!0,operator:"fail",generatedMessage:n,stackStartFn:t})},r.throws=function t(r,n,i){"string"===typeof n&&(i=n,n=void 0);let o=!1,s=null;c("function"===typeof r,"func","function");try{r()}catch(a){o=!0,s=a}if(!o){let r=!1;throw null==i&&(i="Missing expected exception.",r=!0),new e({message:i,actual:void 0,expected:n,operator:"throws",generatedMessage:r,stackStartFn:t})}if(!d(s,n,i,t))throw s},r.doesNotThrow=o,r.rejects=s,r.doesNotReject=a,r.ifError=function t(r){if(null!=r){let n="ifError got unwanted exception: ";throw"object"===typeof r&&"string"===typeof r.message?0===r.message.length&&r.constructor?n+=r.constructor.name:n+=r.message:n+=l(r),new e({message:n,actual:r,expected:null,operator:"ifError",generatedMessage:!0,stackStartFn:t})}},r.match=function t(e,r,n){p(e,r,n,t,!0)},r.doesNotMatch=function t(e,r,n){p(e,r,n,t,!1)},r.deepEqual=u,r.notDeepEqual=h,r.deepStrictEqual=u,r.notDeepStrictEqual=h,r.bufferEqual=function t(r,n,i,o){if(M(i)||(o=i,i=null),null==i&&(i="hex"),n=A(r,n,i),c(v(r),"actual","buffer"),c(v(n),"expected","buffer"),r!==n&&!r.equals(n)){if(b(o))throw o;throw new e({message:o,actual:r.toString(i),expected:n.toString(i),operator:"bufferEqual",stackStartFn:t})}},r.notBufferEqual=function t(r,n,i,o){if(M(i)||(o=i,i=null),null==i&&(i="hex"),n=A(r,n,i),c(v(r),"actual","buffer"),c(v(n),"expected","buffer"),r===n||r.equals(n)){if(b(o))throw o;throw new e({message:o,actual:r.toString(i),expected:n.toString(i),operator:"notBufferEqual",stackStartFn:t})}},r.enforce=c,r.range=function t(e,r){if(!e){const e=null!=r?'"'.concat(r,'" is out of range.'):"Parameter is out of range.",n=new RangeError(e);throw Error.captureStackTrace&&Error.captureStackTrace(n,t),n}},t.exports=r},8586:(t,e,r)=>{var n=r(6382).Buffer;t.exports=function(t,e){for(var r=Math.min(t.length,e.length),i=new n(r),o=0;o{"use strict";const n=r(4445),i=r(6900),o="function"===typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50;const s=2147483647;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(t,e,r){if("number"===typeof t){if("string"===typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return l(t)}return h(t,e,r)}function h(t,e,r){if("string"===typeof t)return function(t,e){"string"===typeof e&&""!==e||(e="utf8");if(!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|g(t,e);let n=a(r);const i=n.write(t,e);i!==r&&(n=n.slice(0,i));return n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(Z(t,Uint8Array)){const e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return f(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Z(t,ArrayBuffer)||t&&Z(t.buffer,ArrayBuffer))return d(t,e,r);if("undefined"!==typeof SharedArrayBuffer&&(Z(t,SharedArrayBuffer)||t&&Z(t.buffer,SharedArrayBuffer)))return d(t,e,r);if("number"===typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return u.from(n,e,r);const i=function(t){if(u.isBuffer(t)){const e=0|p(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return"number"!==typeof t.length||Y(t.length)?a(0):f(t);if("Buffer"===t.type&&Array.isArray(t.data))return f(t.data)}(t);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function c(t){if("number"!==typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function l(t){return c(t),a(t<0?0:0|p(t))}function f(t){const e=t.length<0?0:0|p(t.length),r=a(e);for(let n=0;n=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function g(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Z(t,ArrayBuffer))return t.byteLength;if("string"!==typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(t).length;default:if(i)return n?-1:K(t).length;e=(""+e).toLowerCase(),i=!0}}function m(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return T(this,e,r);case"utf8":case"utf-8":return I(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return x(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function y(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function w(t,e,r,n,i){if(0===t.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"===typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"===typeof e)return e&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){let o,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function h(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;ni&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function A(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function I(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128===(192&r)&&(u=(31&e)<<6|63&r,u>127&&(o=u));break;case 3:r=t[i+1],n=t[i+2],128===(192&r)&&128===(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128===(192&r)&&128===(192&n)&&128===(192&a)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){const e=t.length;if(e<=C)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},u.byteLength=g,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;er&&(t+=" ... "),""},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,i){if(Z(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0);const a=Math.min(o,s),h=this.slice(n,i),c=t.slice(e,r);for(let u=0;u>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return b(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":case"latin1":case"binary":return E(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const C=4096;function k(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;in)&&(r=n);let i="";for(let o=e;or)throw new RangeError("Trying to access beyond buffer length")}function B(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function R(t,e,r,n,i){z(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function P(t,e,r,n,i){z(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function L(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,r,n,o){return e=+e,r>>>=0,o||L(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function U(t,e,r,n,o){return e=+e,r>>>=0,o||L(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||N(t,e,this.length);let n=this[t],i=1,o=0;for(;++o>>=0,e>>>=0,r||N(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||N(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||N(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||N(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||N(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||N(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=J((function(t){V(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||q(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||q(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<>>=0,e>>>=0,r||N(t,e,this.length);let n=this[t],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||N(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return t>>>=0,e||N(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||N(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||N(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||N(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||N(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=J((function(t){V(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||q(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||q(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<>>=0,e||N(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||N(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||N(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||N(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){B(this,t,e,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,!n){B(this,t,e,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigUInt64LE=J((function(t){return R(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=J((function(t){return P(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);B(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i>>=0,!n){const n=Math.pow(2,8*r-1);B(this,t,e,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o|0)-s&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigInt64LE=J((function(t){return R(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=J((function(t){return P(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return U(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return U(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"===typeof t)for(i=e;i=n+4;r-=3)e="_".concat(t.slice(r-3,r)).concat(e);return"".concat(t.slice(0,r)).concat(e)}function z(t,e,r,n,i,o){if(t>r||t3?0===e||e===BigInt(0)?">= 0".concat(n," and < 2").concat(n," ** ").concat(8*(o+1)).concat(n):">= -(2".concat(n," ** ").concat(8*(o+1)-1).concat(n,") and < 2 ** ")+"".concat(8*(o+1)-1).concat(n):">= ".concat(e).concat(n," and <= ").concat(r).concat(n),new j.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){V(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||q(e,t.length-(r+1))}(n,i,o)}function V(t,e){if("number"!==typeof t)throw new j.ERR_INVALID_ARG_TYPE(e,"number",t)}function q(t,e,r){if(Math.floor(t)!==t)throw V(t,r),new j.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(e),t)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?"".concat(t," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(t,e){return'The "'.concat(t,'" argument must be of type number. Received type ').concat(typeof e)}),TypeError),F("ERR_OUT_OF_RANGE",(function(t,e,r){let n='The value of "'.concat(t,'" is out of range.'),i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=H(String(r)):"bigint"===typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=H(i)),i+="n"),n+=" It must be ".concat(e,". Received ").concat(i),n}),RangeError);const W=/[^+/0-9A-Za-z-_]/g;function K(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;t.length%4!==0;)t+="=";return t}(t))}function X(t,e,r,n){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Z(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(t){return t!==t}const Q=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function J(t){return"undefined"===typeof BigInt?$:t}function $(){throw new Error("BigInt not supported")}},1760:(t,e,r)=>{"use strict";var n=r(6382).Buffer;const i=r(6923),o=r(5544),s=r(6671),a=r(419),u=r(2342),h=r(1334),c=r(6636),l=r(8508);function f(t,e){return function(r,i){if(s(n.isBuffer(r),"data","buffer"),s(i>>>0===i,"off","integer"),i+e>r.length)throw new a(i,"Out of bounds read");return t(r,i)}}function d(t){return function(e,r,i){if(s(n.isBuffer(e),"data","buffer"),s(r>>>0===r,"off","integer"),s(i>>>0===i,"len","integer"),r+i>e.length)throw new a(r,"Out of bounds read");return t(e,r,i)}}function p(t){return function(e,r){return s(n.isBuffer(e),"data","buffer"),s(r>>>0===r,"off","integer"),t(e,r)}}function g(t,e){return function(r,i,o){if(s(n.isBuffer(r),"data","buffer"),s(o>>>0===o,"off","integer"),o+e>r.length)throw new a(o,"Out of bounds write");return t(r,i,o)}}function m(t){return function(e,r,i,o){if(s(n.isBuffer(e),"data","buffer"),s(i>>>0===i,"off","integer"),s(o>>>0===o,"len","integer"),i+o>e.length)throw new a(i,"Out of bounds write");return t(e,r,i,o)}}function y(t,e){return function(r,i,o){if(s(n.isBuffer(r),"data","buffer"),s(o>>>0===o,"off","integer"),o+e(i)>r.length)throw new a(o,"Out of bounds write");return t(r,i,o)}}e.custom=i,e.encoding=o,e.EncodingError=a,e.BufferReader=u,e.BufferWriter=h,e.StaticWriter=c,e.Struct=l,e.read=function(t,e){return new u(t,e)},e.write=function(t){return null!=t?new c(t):new h},e.pool=function(t){return c.pool(t)},e.readU=d(o.readU),e.readU64=f(o.readU64,8),e.readU56=f(o.readU56,7),e.readU48=f(o.readU48,6),e.readU40=f(o.readU40,5),e.readU32=f(o.readU32,4),e.readU24=f(o.readU24,3),e.readU16=f(o.readU16,2),e.readU8=f(o.readU8,1),e.readUBE=d(o.readUBE),e.readU64BE=f(o.readU64BE,8),e.readU56BE=f(o.readU56BE,7),e.readU48BE=f(o.readU48BE,6),e.readU40BE=f(o.readU40BE,5),e.readU32BE=f(o.readU32BE,4),e.readU24BE=f(o.readU24BE,3),e.readU16BE=f(o.readU16BE,2),e.readI=d(o.readI),e.readI64=f(o.readI64,8),e.readI56=f(o.readI56,7),e.readI48=f(o.readI48,6),e.readI40=f(o.readI40,5),e.readI32=f(o.readI32,4),e.readI24=f(o.readI24,3),e.readI16=f(o.readI16,2),e.readI8=f(o.readI8,1),e.readIBE=d(o.readIBE),e.readI64BE=f(o.readI64BE,8),e.readI56BE=f(o.readI56BE,7),e.readI48BE=f(o.readI48BE,6),e.readI40BE=f(o.readI40BE,5),e.readI32BE=f(o.readI32BE,4),e.readI24BE=f(o.readI24BE,3),e.readI16BE=f(o.readI16BE,2),e.readFloat=f(o.readFloat,4),e.readFloatBE=f(o.readFloatBE,4),e.readDouble=f(o.readDouble,8),e.readDoubleBE=f(o.readDoubleBE,8),e.writeU=m(o.writeU),e.writeU64=g(o.writeU64,8),e.writeU56=g(o.writeU56,7),e.writeU48=g(o.writeU48,6),e.writeU40=g(o.writeU40,5),e.writeU32=g(o.writeU32,4),e.writeU24=g(o.writeU24,3),e.writeU16=g(o.writeU16,2),e.writeU8=g(o.writeU8,1),e.writeUBE=m(o.writeUBE),e.writeU64BE=g(o.writeU64BE,8),e.writeU56BE=g(o.writeU56BE,7),e.writeU48BE=g(o.writeU48BE,6),e.writeU40BE=g(o.writeU40BE,5),e.writeU32BE=g(o.writeU32BE,4),e.writeU24BE=g(o.writeU24BE,3),e.writeU16BE=g(o.writeU16BE,2),e.writeI=m(o.writeI),e.writeI64=g(o.writeI64,8),e.writeI56=g(o.writeI56,7),e.writeI48=g(o.writeI48,6),e.writeI40=g(o.writeI40,5),e.writeI32=g(o.writeI32,4),e.writeI24=g(o.writeI24,3),e.writeI16=g(o.writeI16,2),e.writeI8=g(o.writeI8,1),e.writeIBE=m(o.writeIBE),e.writeI64BE=g(o.writeI64BE,8),e.writeI56BE=g(o.writeI56BE,7),e.writeI48BE=g(o.writeI48BE,6),e.writeI40BE=g(o.writeI40BE,5),e.writeI32BE=g(o.writeI32BE,4),e.writeI24BE=g(o.writeI24BE,3),e.writeI16BE=g(o.writeI16BE,2),e.writeFloat=g(o.writeFloat,4),e.writeFloatBE=g(o.writeFloatBE,4),e.writeDouble=g(o.writeDouble,8),e.writeDoubleBE=g(o.writeDoubleBE,8),e.readVarint=p(o.readVarint),e.writeVarint=y(o.writeVarint,o.sizeVarint),e.sizeVarint=o.sizeVarint,e.readVarint2=p(o.readVarint2),e.writeVarint2=y(o.writeVarint2,o.sizeVarint2),e.sizeVarint2=o.sizeVarint2,e.sliceBytes=o.sliceBytes,e.readBytes=o.readBytes,e.writeBytes=o.writeBytes,e.readString=o.readString,e.writeString=o.writeString,e.realloc=o.realloc,e.copy=o.copy,e.concat=o.concat,e.sizeVarBytes=o.sizeVarBytes,e.sizeVarlen=o.sizeVarlen,e.sizeVarString=o.sizeVarString},6923:(t,e)=>{"use strict";e.custom="inspect"},5544:(t,e,r)=>{"use strict";var n=r(6382).Buffer;const i=r(6671),o=r(419),s=1/4294967296,{MAX_SAFE_INTEGER:a}=Number,u=new Float32Array(1),h=new Uint8Array(u.buffer),c=new Float64Array(1),l=new Uint8Array(c.buffer);u[0]=-1;const f=0===h[3];function d(t,e){const r=y(t,e+4),n=y(t,e);return Nt(0===(4292870144&r),e,"Number exceeds 2^53-1"),4294967296*r+n}function p(t,e){const r=w(t,e+4),n=y(t,e);return Nt(0===(4292870144&r),e,"Number exceeds 2^53-1"),4294967296*r+n}function g(t,e){return t[e++]+256*t[e++]+65536*t[e++]+16777216*t[e++]+4294967296*t[e++]+1099511627776*t[e]}function m(t,e){return t[e++]+256*t[e++]+65536*t[e++]+16777216*t[e++]+4294967296*t[e]}function y(t,e){return t[e++]+256*t[e++]+65536*t[e++]+16777216*t[e]}function w(t,e){return t[e++]+256*t[e++]+65536*t[e]}function v(t,e){return t[e++]+256*t[e]}function b(t,e){return t[e]}function _(t,e){const r=A(t,e),n=A(t,e+4);return Nt(0===(4292870144&r),e,"Number exceeds 2^53-1"),4294967296*r+n}function E(t,e){const r=I(t,e),n=A(t,e+3);return Nt(0===(4292870144&r),e,"Number exceeds 2^53-1"),4294967296*r+n}function S(t,e){return 1099511627776*t[e++]+4294967296*t[e++]+16777216*t[e++]+65536*t[e++]+256*t[e++]+t[e]}function M(t,e){return 4294967296*t[e++]+16777216*t[e++]+65536*t[e++]+256*t[e++]+t[e]}function A(t,e){return 16777216*t[e++]+65536*t[e++]+256*t[e++]+t[e]}function I(t,e){return 65536*t[e++]+256*t[e++]+t[e]}function C(t,e){return 256*t[e++]+t[e]}function k(t,e){const r=N(t,e+4),n=y(t,e);return Nt(It(r,n),"Number exceeds 2^53-1"),4294967296*r+n}function x(t,e){const r=B(t,e+4),n=y(t,e);return Nt(It(r,n),"Number exceeds 2^53-1"),4294967296*r+n}function T(t,e){const r=t[e+4]+256*t[e+5];return t[e++]+256*t[e++]+65536*t[e++]+16777216*t[e]+4294967296*(r|131070*(32768&r))}function O(t,e){return t[e++]+256*t[e++]+65536*t[e++]+16777216*t[e++]+4294967296*(t[e]|33554430*(128&t[e]))}function N(t,e){return t[e++]+256*t[e++]+65536*t[e++]+(t[e]<<24)}function B(t,e){const r=t[e++]+256*t[e++]+65536*t[e];return r|510*(8388608&r)}function R(t,e){const r=t[e++]+256*t[e];return r|131070*(32768&r)}function P(t,e){const r=t[e];return r|33554430*(128&r)}function L(t,e){const r=F(t,e),n=A(t,e+4);return Nt(It(r,n),"Number exceeds 2^53-1"),4294967296*r+n}function D(t,e){const r=H(t,e),n=A(t,e+3);return Nt(It(r,n),"Number exceeds 2^53-1"),4294967296*r+n}function U(t,e){const r=256*t[e++]+t[e++];return 4294967296*(r|131070*(32768&r))+16777216*t[e++]+65536*t[e++]+256*t[e++]+t[e]}function j(t,e){const r=t[e++];return 4294967296*(r|33554430*(128&r))+16777216*t[e++]+65536*t[e++]+256*t[e++]+t[e]}function F(t,e){return(t[e++]<<24)+65536*t[e++]+256*t[e++]+t[e]}function H(t,e){const r=65536*t[e++]+256*t[e++]+t[e];return r|510*(8388608&r)}function z(t,e){const r=256*t[e++]+t[e];return r|131070*(32768&r)}function V(t,e){return h[3]=t[e++],h[2]=t[e++],h[1]=t[e++],h[0]=t[e],u[0]}function q(t,e){return h[0]=t[e++],h[1]=t[e++],h[2]=t[e++],h[3]=t[e],u[0]}function W(t,e){return l[7]=t[e++],l[6]=t[e++],l[5]=t[e++],l[4]=t[e++],l[3]=t[e++],l[2]=t[e++],l[1]=t[e++],l[0]=t[e],c[0]}function K(t,e){return l[0]=t[e++],l[1]=t[e++],l[2]=t[e++],l[3]=t[e++],l[4]=t[e++],l[5]=t[e++],l[6]=t[e++],l[7]=t[e],c[0]}const G=f?V:q,X=f?q:V,Z=f?W:K,Y=f?K:W;function Q(t,e,r){return i(Number.isSafeInteger(e),"num","integer"),Ct(t,e,r,!1)}function J(t,e,r){return i(Number.isSafeInteger(e),"num","integer"),kt(t,e,r,!1)}function $(t,e,r){i(Number.isSafeInteger(e),"num","integer");const n=e*s|0;return t[r++]=e,e>>>=8,t[r++]=e,e>>>=8,t[r++]=e,e>>>=8,t[r++]=e,t[r++]=n,t[r++]=n>>>8,r}function tt(t,e,r){i(Number.isSafeInteger(e),"num","integer");const n=e*s|0;return t[r++]=e,e>>>=8,t[r++]=e,e>>>=8,t[r++]=e,e>>>=8,t[r++]=e,t[r++]=n,r}function et(t,e,r){return i(Number.isSafeInteger(e),"num","integer"),t[r++]=e,e>>>=8,t[r++]=e,e>>>=8,t[r++]=e,e>>>=8,t[r++]=e,r}function rt(t,e,r){return i(Number.isSafeInteger(e),"num","integer"),t[r++]=e,e>>>=8,t[r++]=e,e>>>=8,t[r++]=e,r}function nt(t,e,r){return i(Number.isSafeInteger(e),"num","integer"),t[r++]=e,t[r++]=e>>>8,r}function it(t,e,r){return i(Number.isSafeInteger(e),"num","integer"),t[r]=e,r+1}function ot(t,e,r){return i(Number.isSafeInteger(e),"num","integer"),Ct(t,e,r,!0)}function st(t,e,r){return i(Number.isSafeInteger(e),"num","integer"),kt(t,e,r,!0)}function at(t,e,r){i(Number.isSafeInteger(e),"num","integer");const n=e*s|0;return t[r++]=n>>>8,t[r++]=n,t[r+3]=e,e>>>=8,t[r+2]=e,e>>>=8,t[r+1]=e,e>>>=8,t[r]=e,r+4}function ut(t,e,r){i(Number.isSafeInteger(e),"num","integer");const n=e*s|0;return t[r++]=n,t[r+3]=e,e>>>=8,t[r+2]=e,e>>>=8,t[r+1]=e,e>>>=8,t[r]=e,r+4}function ht(t,e,r){return i(Number.isSafeInteger(e),"num","integer"),t[r+3]=e,e>>>=8,t[r+2]=e,e>>>=8,t[r+1]=e,e>>>=8,t[r]=e,r+4}function ct(t,e,r){return i(Number.isSafeInteger(e),"num","integer"),t[r+2]=e,e>>>=8,t[r+1]=e,e>>>=8,t[r]=e,r+3}function lt(t,e,r){return i(Number.isSafeInteger(e),"num","integer"),t[r++]=e>>>8,t[r++]=e,r}function ft(t,e,r){return et(t,e,r)}function dt(t,e,r){return rt(t,e,r)}function pt(t,e,r){return ht(t,e,r)}function gt(t,e,r){return ct(t,e,r)}function mt(t,e,r){return i(Tt(e),"num","number"),c[0]=e,t[r++]=l[0],t[r++]=l[1],t[r++]=l[2],t[r++]=l[3],t[r++]=l[4],t[r++]=l[5],t[r++]=l[6],t[r++]=l[7],r}function yt(t,e,r){return i(Tt(e),"num","number"),c[0]=e,t[r++]=l[7],t[r++]=l[6],t[r++]=l[5],t[r++]=l[4],t[r++]=l[3],t[r++]=l[2],t[r++]=l[1],t[r++]=l[0],r}function wt(t,e,r){return i(Tt(e),"num","number"),u[0]=e,t[r++]=h[0],t[r++]=h[1],t[r++]=h[2],t[r++]=h[3],r}function vt(t,e,r){return i(Tt(e),"num","number"),u[0]=e,t[r++]=h[3],t[r++]=h[2],t[r++]=h[1],t[r++]=h[0],r}const bt=f?vt:wt,_t=f?wt:vt,Et=f?yt:mt,St=f?mt:yt;function Mt(t){return i(Number.isSafeInteger(t),"num","integer"),t<253?1:t<=65535?3:t<=4294967295?5:9}function At(t,e){i(n.isBuffer(t),"data","buffer");const r=n.allocUnsafeSlow(e);return t.copy(r,0),r}function It(t,e){return t<0&&(t=~t,0===e&&(t+=1)),0===(4292870144&t)}function Ct(t,e,r,n){let i=!1;e<0&&(e=-e,i=!0);let o=e*s|0,a=0|e;return i&&(0===a?o=1+~o|0:(o=~o,a=1+~a)),n?(r=pt(t,o,r),r=pt(t,a,r)):(r=ft(t,a,r),r=ft(t,o,r)),r}function kt(t,e,r,n){let i=!1;e<0&&(e=-e,i=!0);let o=e*s|0,a=0|e;return i&&(0===a?o=1+~o|0:(o=~o,a=1+~a)),r=n?pt(t,a,r=gt(t,o,r)):dt(t,o,r=ft(t,a,r))}class xt{constructor(t,e){this.size=t,this.value=e}}function Tt(t){return"number"===typeof t&&isFinite(t)}function Ot(t,e){if(!t)throw new o(e,"Out of bounds read",Ot)}function Nt(t,e,r){if(!t)throw new o(e,r,Nt)}e.readU=function(t,e,r){switch(r){case 8:return d(t,e);case 7:return p(t,e);case 6:return g(t,e);case 5:return m(t,e);case 4:return y(t,e);case 3:return w(t,e);case 2:return v(t,e);case 1:return b(t,e);default:throw new o(e,"Invalid read length")}},e.readU64=d,e.readU56=p,e.readU48=g,e.readU40=m,e.readU32=y,e.readU24=w,e.readU16=v,e.readU8=b,e.readUBE=function(t,e,r){switch(r){case 8:return _(t,e);case 7:return E(t,e);case 6:return S(t,e);case 5:return M(t,e);case 4:return A(t,e);case 3:return I(t,e);case 2:return C(t,e);case 1:return b(t,e);default:throw new o(e,"Invalid read length")}},e.readU64BE=_,e.readU56BE=E,e.readU48BE=S,e.readU40BE=M,e.readU32BE=A,e.readU24BE=I,e.readU16BE=C,e.readI=function(t,e,r){switch(r){case 8:return k(t,e);case 7:return x(t,e);case 6:return T(t,e);case 5:return O(t,e);case 4:return N(t,e);case 3:return B(t,e);case 2:return R(t,e);case 1:return P(t,e);default:throw new o(e,"Invalid read length")}},e.readI64=k,e.readI56=x,e.readI48=T,e.readI40=O,e.readI32=N,e.readI24=B,e.readI16=R,e.readI8=P,e.readIBE=function(t,e,r){switch(r){case 8:return L(t,e);case 7:return D(t,e);case 6:return U(t,e);case 5:return j(t,e);case 4:return F(t,e);case 3:return H(t,e);case 2:return z(t,e);case 1:return P(t,e);default:throw new o(e,"Invalid read length")}},e.readI64BE=L,e.readI56BE=D,e.readI48BE=U,e.readI40BE=j,e.readI32BE=F,e.readI24BE=H,e.readI16BE=z,e.readFloat=G,e.readFloatBE=X,e.readDouble=Z,e.readDoubleBE=Y,e.writeU=function(t,e,r,n){switch(n){case 8:return Q(t,e,r);case 7:return J(t,e,r);case 6:return $(t,e,r);case 5:return tt(t,e,r);case 4:return et(t,e,r);case 3:return rt(t,e,r);case 2:return nt(t,e,r);case 1:return it(t,e,r);default:throw new o(r,"Invalid write length")}},e.writeU64=Q,e.writeU56=J,e.writeU48=$,e.writeU40=tt,e.writeU32=et,e.writeU24=rt,e.writeU16=nt,e.writeU8=it,e.writeUBE=function(t,e,r,n){switch(n){case 8:return ot(t,e,r);case 7:return st(t,e,r);case 6:return at(t,e,r);case 5:return ut(t,e,r);case 4:return ht(t,e,r);case 3:return ct(t,e,r);case 2:return lt(t,e,r);case 1:return it(t,e,r);default:throw new o(r,"Invalid write length")}},e.writeU64BE=ot,e.writeU56BE=st,e.writeU48BE=at,e.writeU40BE=ut,e.writeU32BE=ht,e.writeU24BE=ct,e.writeU16BE=lt,e.writeI=function(t,e,r,n){switch(n){case 8:return Q(t,e,r);case 7:return J(t,e,r);case 6:return $(t,e,r);case 5:return tt(t,e,r);case 4:return rt(t,e,r);case 3:return et(t,e,r);case 2:return nt(t,e,r);case 1:return it(t,e,r);default:throw new o(r,"Invalid write length")}},e.writeI64=function(t,e,r){return Q(t,e,r)},e.writeI56=function(t,e,r){return J(t,e,r)},e.writeI48=function(t,e,r){return $(t,e,r)},e.writeI40=function(t,e,r){return tt(t,e,r)},e.writeI32=ft,e.writeI24=dt,e.writeI16=function(t,e,r){return nt(t,e,r)},e.writeI8=function(t,e,r){return it(t,e,r)},e.writeIBE=function(t,e,r,n){switch(n){case 8:return ot(t,e,r);case 7:return st(t,e,r);case 6:return at(t,e,r);case 5:return ut(t,e,r);case 4:return ht(t,e,r);case 3:return ct(t,e,r);case 2:return lt(t,e,r);case 1:return it(t,e,r);default:throw new o(r,"Invalid write length")}},e.writeI64BE=function(t,e,r){return ot(t,e,r)},e.writeI56BE=function(t,e,r){return st(t,e,r)},e.writeI48BE=function(t,e,r){return at(t,e,r)},e.writeI40BE=function(t,e,r){return ut(t,e,r)},e.writeI32BE=pt,e.writeI24BE=gt,e.writeI16BE=function(t,e,r){return lt(t,e,r)},e.writeFloat=bt,e.writeFloatBE=_t,e.writeDouble=Et,e.writeDoubleBE=St,e.readVarint=function(t,e){let r,n;switch(Ot(e4294967295,e,"Non-canonical varint");break;case 254:n=5,Ot(e+n<=t.length,e),r=y(t,e+1),Nt(r>65535,e,"Non-canonical varint");break;case 253:n=3,Ot(e+n<=t.length,e),r=v(t,e+1),Nt(r>=253,e,"Non-canonical varint");break;default:n=1,r=t[e]}return new xt(n,r)},e.writeVarint=function(t,e,r){return i(Number.isSafeInteger(e),"num","integer"),e<253?(t[r++]=e,r):e<=65535?(t[r++]=253,nt(t,e,r)):e<=4294967295?(t[r++]=254,et(t,e,r)):(t[r++]=255,Q(t,e,r))},e.sizeVarint=Mt,e.readVarint2=function(t,e){let r=0,n=0;for(;;){Ot(e>>0===e,"off","integer"),i(r>>>0===r,"size","integer"),e+r>t.length)throw new o(e,"Out of bounds read");return t.slice(e,e+r)},e.readBytes=function(t,e,r){if(i(n.isBuffer(t),"data","buffer"),i(e>>>0===e,"off","integer"),i(r>>>0===r,"size","integer"),e+r>t.length)throw new o(e,"Out of bounds read");const s=n.allocUnsafeSlow(r);return t.copy(s,0,e,e+r),s},e.writeBytes=function(t,e,r){if(i(n.isBuffer(t),"data","buffer"),i(n.isBuffer(e),"value","buffer"),i(r>>>0===r,"off","integer"),r+e.length>t.length)throw new o(r,"Out of bounds write");return e.copy(t,r,0,e.length)},e.readString=function(t,e,r,s){if(null==s&&(s="binary"),i(n.isBuffer(t),"data","buffer"),i(e>>>0===e,"off","integer"),i(r>>>0===r,"size","integer"),i("string"===typeof s,"enc","string"),e+r>t.length)throw new o(e,"Out of bounds read");return t.toString(s,e,e+r)},e.writeString=function(t,e,r,s){if(null==s&&(s="binary"),i(n.isBuffer(t),"data","buffer"),i("string"===typeof e,"str","string"),i(r>>>0===r,"off","integer"),i("string"===typeof s,"enc","string"),0===e.length)return 0;if(r+n.byteLength(e,s)>t.length)throw new o(r,"Out of bounds write");return t.write(e,r,s)},e.realloc=At,e.copy=function(t){return i(n.isBuffer(t),"data","buffer"),At(t,t.length)},e.concat=function(t,e){i(n.isBuffer(t),"a","buffer"),i(n.isBuffer(e),"b","buffer");const r=t.length+e.length,o=n.allocUnsafeSlow(r);return t.copy(o,0),e.copy(o,t.length),o},e.sizeVarBytes=function(t){return i(n.isBuffer(t),"data","buffer"),Mt(t.length)+t.length},e.sizeVarlen=function(t){return Mt(t)+t},e.sizeVarString=function(t,e){if(null==e&&(e="binary"),i("string"===typeof t,"str","string"),i("string"===typeof e,"enc","string"),0===t.length)return 1;const r=n.byteLength(t,e);return Mt(r)+r}},6671:t=>{"use strict";t.exports=function t(e,r,n){if(!e){const e=new TypeError("'".concat(r,"' must be a(n) ").concat(n,"."));throw Error.captureStackTrace&&Error.captureStackTrace(e,t),e}}},419:t=>{"use strict";class e extends Error{constructor(t,r,n){super(),this.type="EncodingError",this.name="EncodingError",this.code="ERR_ENCODING",this.message="".concat(r," (offset=").concat(t,")."),Error.captureStackTrace&&Error.captureStackTrace(this,n||e)}}t.exports=e},2342:(t,e,r)=>{"use strict";var n=r(6382).Buffer;const i=r(6671),o=r(5544),s=r(419),a=n.alloc(0);t.exports=class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];i(n.isBuffer(t),"data","buffer"),i("boolean"===typeof e,"zeroCopy","boolean"),this.data=t,this.offset=0,this.zeroCopy=e,this.stack=[]}check(t){if(this.offset+t>this.data.length)throw new s(this.offset,"Out of bounds read",this.check)}getSize(){return this.data.length}left(){return this.check(0),this.data.length-this.offset}seek(t){if(i(Number.isSafeInteger(t),"off","integer"),this.offset+t<0)throw new s(this.offset,"Out of bounds read");return this.check(t),this.offset+=t,this}start(){return this.stack.push(this.offset),this.offset}end(){if(0===this.stack.length)throw new Error("Cannot end without a stack item.");const t=this.stack.pop();return this.offset-t}endData(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(i("boolean"===typeof t,"zeroCopy","boolean"),0===this.stack.length)throw new Error("Cannot end without a stack item.");const e=this.stack.pop(),r=this.offset,o=r-e,s=this.data;if(o===s.length)return s;if(this.zeroCopy||t)return s.slice(e,r);const a=n.allocUnsafeSlow(o);return s.copy(a,0,e,r),a}destroy(){return this.data=a,this.offset=0,this.stack.length=0,this}readU8(){this.check(1);const t=this.data[this.offset];return this.offset+=1,t}readU16(){this.check(2);const t=o.readU16(this.data,this.offset);return this.offset+=2,t}readU16BE(){this.check(2);const t=o.readU16BE(this.data,this.offset);return this.offset+=2,t}readU24(){this.check(3);const t=o.readU24(this.data,this.offset);return this.offset+=3,t}readU24BE(){this.check(3);const t=o.readU24BE(this.data,this.offset);return this.offset+=3,t}readU32(){this.check(4);const t=o.readU32(this.data,this.offset);return this.offset+=4,t}readU32BE(){this.check(4);const t=o.readU32BE(this.data,this.offset);return this.offset+=4,t}readU40(){this.check(5);const t=o.readU40(this.data,this.offset);return this.offset+=5,t}readU40BE(){this.check(5);const t=o.readU40BE(this.data,this.offset);return this.offset+=5,t}readU48(){this.check(6);const t=o.readU48(this.data,this.offset);return this.offset+=6,t}readU48BE(){this.check(6);const t=o.readU48BE(this.data,this.offset);return this.offset+=6,t}readU56(){this.check(7);const t=o.readU56(this.data,this.offset);return this.offset+=7,t}readU56BE(){this.check(7);const t=o.readU56BE(this.data,this.offset);return this.offset+=7,t}readU64(){this.check(8);const t=o.readU64(this.data,this.offset);return this.offset+=8,t}readU64BE(){this.check(8);const t=o.readU64BE(this.data,this.offset);return this.offset+=8,t}readI8(){this.check(1);const t=o.readI8(this.data,this.offset);return this.offset+=1,t}readI16(){this.check(2);const t=o.readI16(this.data,this.offset);return this.offset+=2,t}readI16BE(){this.check(2);const t=o.readI16BE(this.data,this.offset);return this.offset+=2,t}readI24(){this.check(3);const t=o.readI24(this.data,this.offset);return this.offset+=3,t}readI24BE(){this.check(3);const t=o.readI24BE(this.data,this.offset);return this.offset+=3,t}readI32(){this.check(4);const t=o.readI32(this.data,this.offset);return this.offset+=4,t}readI32BE(){this.check(4);const t=o.readI32BE(this.data,this.offset);return this.offset+=4,t}readI40(){this.check(5);const t=o.readI40(this.data,this.offset);return this.offset+=5,t}readI40BE(){this.check(5);const t=o.readI40BE(this.data,this.offset);return this.offset+=5,t}readI48(){this.check(6);const t=o.readI48(this.data,this.offset);return this.offset+=6,t}readI48BE(){this.check(6);const t=o.readI48BE(this.data,this.offset);return this.offset+=6,t}readI56(){this.check(7);const t=o.readI56(this.data,this.offset);return this.offset+=7,t}readI56BE(){this.check(7);const t=o.readI56BE(this.data,this.offset);return this.offset+=7,t}readI64(){this.check(8);const t=o.readI64(this.data,this.offset);return this.offset+=8,t}readI64BE(){this.check(8);const t=o.readI64BE(this.data,this.offset);return this.offset+=8,t}readFloat(){this.check(4);const t=o.readFloat(this.data,this.offset);return this.offset+=4,t}readFloatBE(){this.check(4);const t=o.readFloatBE(this.data,this.offset);return this.offset+=4,t}readDouble(){this.check(8);const t=o.readDouble(this.data,this.offset);return this.offset+=8,t}readDoubleBE(){this.check(8);const t=o.readDoubleBE(this.data,this.offset);return this.offset+=8,t}readVarint(){const{size:t,value:e}=o.readVarint(this.data,this.offset);return this.offset+=t,e}readVarint2(){const{size:t,value:e}=o.readVarint2(this.data,this.offset);return this.offset+=t,e}readBytes(t){let e,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return i(t>>>0===t,"size","integer"),i("boolean"===typeof r,"zeroCopy","boolean"),this.check(t),this.zeroCopy||r?e=this.data.slice(this.offset,this.offset+t):(e=n.allocUnsafeSlow(t),this.data.copy(e,0,this.offset,this.offset+t)),this.offset+=t,e}readVarBytes(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.readBytes(this.readVarint(),t)}readChild(t){i(t>>>0===t,"size","integer"),this.check(t);const e=this.data.slice(0,this.offset+t),r=new this.constructor(e);return r.offset=this.offset,this.offset+=t,r}readString(t,e){null==e&&(e="binary"),i(t>>>0===t,"size","integer"),i("string"===typeof e,"enc","string"),this.check(t);const r=this.data.toString(e,this.offset,this.offset+t);return this.offset+=t,r}readHash(t){return t?this.readString(32,t):this.readBytes(32)}readVarString(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;null==t&&(t="binary"),i("string"===typeof t,"enc","string"),i(e>>>0===e,"limit","integer");const r=this.readVarint();if(0!==e&&r>e)throw new s(this.offset,"String exceeds limit");return this.readString(r,t)}readNullString(t){null==t&&(t="binary"),i("string"===typeof t,"enc","string");let e=this.offset;for(;e0&&(e=this.stack[this.stack.length-1]);const r=this.data.slice(e,this.offset),n=t.digest?t.digest(r):t(r);return o.readU32(n,0)}verifyChecksum(t){const e=this.createChecksum(t);if(e!==this.readU32())throw new s(this.offset,"Checksum mismatch");return e}}},6636:(t,e,r)=>{"use strict";var n=r(6382).Buffer;const i=r(6671),o=r(5544),s=r(419),a=n.alloc(0),u=102400;let h=null;class c{constructor(t){this.data=a,this.offset=0,null!=t&&this.init(t)}check(t){if(this.offset+t>this.data.length)throw new s(this.offset,"Out of bounds write",this.check)}init(t){return n.isBuffer(t)?(this.data=t,this.offset=0,this):(i(t>>>0===t,"size","integer"),this.data=n.allocUnsafeSlow(t),this.offset=0,this)}static pool(t){if(i(t>>>0===t,"size","integer"),t<=u){h||(h=n.allocUnsafeSlow(u));const e=new c;return e.data=h.slice(0,t),e}return new c(t)}render(){const{data:t,offset:e}=this;if(e!==t.length)throw new s(e,"Out of bounds write");return this.destroy(),t}slice(){const{data:t,offset:e}=this;if(e>t.length)throw new s(e,"Out of bounds write");return this.destroy(),t.slice(0,e)}getSize(){return this.offset}seek(t){if(i(Number.isSafeInteger(t),"off","integer"),this.offset+t<0)throw new s(this.offset,"Out of bounds write");return this.check(t),this.offset+=t,this}destroy(){return this.data=a,this.offset=0,this}writeU8(t){return this.check(1),this.offset=o.writeU8(this.data,t,this.offset),this}writeU16(t){return this.check(2),this.offset=o.writeU16(this.data,t,this.offset),this}writeU16BE(t){return this.check(2),this.offset=o.writeU16BE(this.data,t,this.offset),this}writeU24(t){return this.check(3),this.offset=o.writeU24(this.data,t,this.offset),this}writeU24BE(t){return this.check(3),this.offset=o.writeU24BE(this.data,t,this.offset),this}writeU32(t){return this.check(4),this.offset=o.writeU32(this.data,t,this.offset),this}writeU32BE(t){return this.check(4),this.offset=o.writeU32BE(this.data,t,this.offset),this}writeU40(t){return this.check(5),this.offset=o.writeU40(this.data,t,this.offset),this}writeU40BE(t){return this.check(5),this.offset=o.writeU40BE(this.data,t,this.offset),this}writeU48(t){return this.check(6),this.offset=o.writeU48(this.data,t,this.offset),this}writeU48BE(t){return this.check(6),this.offset=o.writeU48BE(this.data,t,this.offset),this}writeU56(t){return this.check(7),this.offset=o.writeU56(this.data,t,this.offset),this}writeU56BE(t){return this.check(7),this.offset=o.writeU56BE(this.data,t,this.offset),this}writeU64(t){return this.check(8),this.offset=o.writeU64(this.data,t,this.offset),this}writeU64BE(t){return this.check(8),this.offset=o.writeU64BE(this.data,t,this.offset),this}writeI8(t){return this.check(1),this.offset=o.writeI8(this.data,t,this.offset),this}writeI16(t){return this.check(2),this.offset=o.writeI16(this.data,t,this.offset),this}writeI16BE(t){return this.check(2),this.offset=o.writeI16BE(this.data,t,this.offset),this}writeI24(t){return this.check(3),this.offset=o.writeI24(this.data,t,this.offset),this}writeI24BE(t){return this.check(3),this.offset=o.writeI24BE(this.data,t,this.offset),this}writeI32(t){return this.check(4),this.offset=o.writeI32(this.data,t,this.offset),this}writeI32BE(t){return this.check(4),this.offset=o.writeI32BE(this.data,t,this.offset),this}writeI40(t){return this.check(5),this.offset=o.writeI40(this.data,t,this.offset),this}writeI40BE(t){return this.check(5),this.offset=o.writeI40BE(this.data,t,this.offset),this}writeI48(t){return this.check(6),this.offset=o.writeI48(this.data,t,this.offset),this}writeI48BE(t){return this.check(6),this.offset=o.writeI48BE(this.data,t,this.offset),this}writeI56(t){return this.check(7),this.offset=o.writeI56(this.data,t,this.offset),this}writeI56BE(t){return this.check(7),this.offset=o.writeI56BE(this.data,t,this.offset),this}writeI64(t){return this.check(8),this.offset=o.writeI64(this.data,t,this.offset),this}writeI64BE(t){return this.check(8),this.offset=o.writeI64BE(this.data,t,this.offset),this}writeFloat(t){return this.check(4),this.offset=o.writeFloat(this.data,t,this.offset),this}writeFloatBE(t){return this.check(4),this.offset=o.writeFloatBE(this.data,t,this.offset),this}writeDouble(t){return this.check(8),this.offset=o.writeDouble(this.data,t,this.offset),this}writeDoubleBE(t){return this.check(8),this.offset=o.writeDoubleBE(this.data,t,this.offset),this}writeVarint(t){return this.offset=o.writeVarint(this.data,t,this.offset),this}writeVarint2(t){return this.offset=o.writeVarint2(this.data,t,this.offset),this}writeBytes(t){return i(n.isBuffer(t),"value","buffer"),this.check(t.length),this.offset+=t.copy(this.data,this.offset),this}writeVarBytes(t){return i(n.isBuffer(t),"value","buffer"),this.writeVarint(t.length),this.writeBytes(t),this}copy(t,e,r){return i(n.isBuffer(t),"value","buffer"),i(e>>>0===e,"start","integer"),i(r>>>0===r,"end","integer"),i(r>=e,"start","integer"),this.check(r-e),this.offset+=t.copy(this.data,this.offset,e,r),this}writeString(t,e){if(null==e&&(e="binary"),i("string"===typeof t,"value","string"),i("string"===typeof e,"enc","string"),0===t.length)return this;const r=n.byteLength(t,e);return this.check(r),this.offset+=this.data.write(t,this.offset,e),this}writeHash(t){return"string"!==typeof t?(i(n.isBuffer(t),"value","buffer"),i(32===t.length,"value","32-byte hash"),this.writeBytes(t),this):(i(64===t.length,"value","32-byte hash"),this.check(32),this.offset+=this.data.write(t,this.offset,"hex"),this)}writeVarString(t,e){if(null==e&&(e="binary"),i("string"===typeof t,"value","string"),i("string"===typeof e,"enc","string"),0===t.length)return this.writeVarint(0),this;const r=n.byteLength(t,e);return this.writeVarint(r),this.check(r),this.offset+=this.data.write(t,this.offset,e),this}writeNullString(t,e){return this.writeString(t,e),this.writeU8(0),this}writeChecksum(t){t&&"function"===typeof t.digest||i("function"===typeof t,"hash","function"),this.check(4);const e=this.data.slice(0,this.offset);return(t.digest?t.digest(e):t(e)).copy(this.data,this.offset,0,4),this.offset+=4,this}fill(t,e){return i((255&t)===t,"value","byte"),i(e>>>0===e,"size","integer"),this.check(e),this.data.fill(t,this.offset,this.offset+e),this.offset+=e,this}}t.exports=c},8508:(t,e,r)=>{"use strict";var n=r(6382).Buffer;const i=r(6671),o=r(2342),s=r(1334),a=r(6636),{custom:u}=r(6923);t.exports=class{constructor(){}inject(t){return i(t instanceof this.constructor,"obj","struct"),this.decode(t.encode())}clone(){return(new this.constructor).inject(this)}getSize(t){return-1}write(t,e){return t}read(t,e){return this}toString(){return Object.prototype.toString.call(this)}fromString(t,e){return this}getJSON(){return this}fromJSON(t,e){return this}fromOptions(t,e){return this}from(t,e){return this.fromOptions(t,e)}format(){return this.getJSON()}encode(t){const e=this.getSize(t),r=-1===e?new s:new a(e);return this.write(r,t),r.render()}decode(t,e){const r=new o(t);return this.read(r,e),this}toHex(t){return this.encode(t).toString("hex")}fromHex(t,e){i("string"===typeof t,"str","string");const r=t.length>>>1,o=n.from(t,"hex");if(o.length!==r)throw new Error("Invalid hex string.");return this.decode(o,e)}toBase64(t){return this.encode(t).toString("base64")}fromBase64(t,e){i("string"===typeof t,"str","string");const r=n.from(t,"base64");if(t.length>(4*r.length/3+3&-4)>>>0)throw new Error("Invalid base64 string.");return this.decode(r,e)}toJSON(){return this.getJSON()}[u](){return this.format()}static read(t,e){return(new this).read(t,e)}static decode(t,e){return(new this).decode(t,e)}static fromHex(t,e){return(new this).fromHex(t,e)}static fromBase64(t,e){return(new this).fromBase64(t,e)}static fromString(t,e){return(new this).fromString(t,e)}static fromJSON(t,e){return(new this).fromJSON(t,e)}static fromOptions(t,e){return(new this).fromOptions(t,e)}static from(t,e){return(new this).from(t,e)}toWriter(t,e){return this.write(t,e)}fromReader(t,e){return this.read(t,e)}toRaw(t){return this.encode(t)}fromRaw(t,e){return this.decode(t,e)}static fromReader(t,e){return this.read(t,e)}static fromRaw(t,e){return this.decode(t,e)}}},1334:(t,e,r)=>{"use strict";var n=r(6382).Buffer;const i=r(6671),o=r(5544),s=r(419);class a{constructor(t){this.type=t}}class u extends a{constructor(t,e){super(t),this.value=e}}class h extends a{constructor(t,e){super(t),this.data=e}}class c extends a{constructor(t,e,r){super(t),this.value=e,this.enc=r}}class l extends a{constructor(t,e){super(t),this.func=e}}class f extends a{constructor(t,e,r){super(t),this.value=e,this.size=r}}t.exports=class{constructor(){this.ops=[],this.offset=0}render(){const t=n.allocUnsafeSlow(this.offset);let e=0;for(const r of this.ops)switch(r.type){case 0:e+=r.value;break;case 1:e=o.writeU8(t,r.value,e);break;case 2:e=o.writeU16(t,r.value,e);break;case 3:e=o.writeU16BE(t,r.value,e);break;case 4:e=o.writeU24(t,r.value,e);break;case 5:e=o.writeU24BE(t,r.value,e);break;case 6:e=o.writeU32(t,r.value,e);break;case 7:e=o.writeU32BE(t,r.value,e);break;case 8:e=o.writeU40(t,r.value,e);break;case 9:e=o.writeU40BE(t,r.value,e);break;case 10:e=o.writeU48(t,r.value,e);break;case 11:e=o.writeU48BE(t,r.value,e);break;case 12:e=o.writeU56(t,r.value,e);break;case 13:e=o.writeU56BE(t,r.value,e);break;case 14:e=o.writeU64(t,r.value,e);break;case 15:e=o.writeU64BE(t,r.value,e);break;case 16:e=o.writeI8(t,r.value,e);break;case 17:e=o.writeI16(t,r.value,e);break;case 18:e=o.writeI16BE(t,r.value,e);break;case 19:e=o.writeI24(t,r.value,e);break;case 20:e=o.writeI24BE(t,r.value,e);break;case 21:e=o.writeI32(t,r.value,e);break;case 22:e=o.writeI32BE(t,r.value,e);break;case 23:e=o.writeI40(t,r.value,e);break;case 24:e=o.writeI40BE(t,r.value,e);break;case 25:e=o.writeI48(t,r.value,e);break;case 26:e=o.writeI48BE(t,r.value,e);break;case 27:e=o.writeI56(t,r.value,e);break;case 28:e=o.writeI56BE(t,r.value,e);break;case 29:e=o.writeI64(t,r.value,e);break;case 30:e=o.writeI64BE(t,r.value,e);break;case 31:e=o.writeFloat(t,r.value,e);break;case 32:e=o.writeFloatBE(t,r.value,e);break;case 33:e=o.writeDouble(t,r.value,e);break;case 34:e=o.writeDoubleBE(t,r.value,e);break;case 35:e=o.writeVarint(t,r.value,e);break;case 36:e=o.writeVarint2(t,r.value,e);break;case 37:e+=r.data.copy(t,e);break;case 38:e+=t.write(r.value,e,r.enc);break;case 39:e+=r.func(t.slice(0,e)).copy(t,e,0,4);break;case 40:t.fill(r.value,e,e+r.size),e+=r.size;break;default:throw new Error("Invalid type.")}if(e!==t.length)throw new s(e,"Out of bounds write");return this.destroy(),t}getSize(){return this.offset}seek(t){if(i(Number.isSafeInteger(t),"off","integer"),this.offset+t<0)throw new s(this.offset,"Out of bounds write");return this.offset+=t,this.ops.push(new u(0,t)),this}destroy(){return this.ops.length=0,this.offset=0,this}writeU8(t){return this.offset+=1,this.ops.push(new u(1,t)),this}writeU16(t){return this.offset+=2,this.ops.push(new u(2,t)),this}writeU16BE(t){return this.offset+=2,this.ops.push(new u(3,t)),this}writeU24(t){return this.offset+=3,this.ops.push(new u(4,t)),this}writeU24BE(t){return this.offset+=3,this.ops.push(new u(5,t)),this}writeU32(t){return this.offset+=4,this.ops.push(new u(6,t)),this}writeU32BE(t){return this.offset+=4,this.ops.push(new u(7,t)),this}writeU40(t){return this.offset+=5,this.ops.push(new u(8,t)),this}writeU40BE(t){return this.offset+=5,this.ops.push(new u(9,t)),this}writeU48(t){return this.offset+=6,this.ops.push(new u(10,t)),this}writeU48BE(t){return this.offset+=6,this.ops.push(new u(11,t)),this}writeU56(t){return this.offset+=7,this.ops.push(new u(12,t)),this}writeU56BE(t){return this.offset+=7,this.ops.push(new u(13,t)),this}writeU64(t){return this.offset+=8,this.ops.push(new u(14,t)),this}writeU64BE(t){return this.offset+=8,this.ops.push(new u(15,t)),this}writeI8(t){return this.offset+=1,this.ops.push(new u(16,t)),this}writeI16(t){return this.offset+=2,this.ops.push(new u(17,t)),this}writeI16BE(t){return this.offset+=2,this.ops.push(new u(18,t)),this}writeI24(t){return this.offset+=3,this.ops.push(new u(19,t)),this}writeI24BE(t){return this.offset+=3,this.ops.push(new u(20,t)),this}writeI32(t){return this.offset+=4,this.ops.push(new u(21,t)),this}writeI32BE(t){return this.offset+=4,this.ops.push(new u(22,t)),this}writeI40(t){return this.offset+=5,this.ops.push(new u(23,t)),this}writeI40BE(t){return this.offset+=5,this.ops.push(new u(24,t)),this}writeI48(t){return this.offset+=6,this.ops.push(new u(25,t)),this}writeI48BE(t){return this.offset+=6,this.ops.push(new u(26,t)),this}writeI56(t){return this.offset+=7,this.ops.push(new u(27,t)),this}writeI56BE(t){return this.offset+=7,this.ops.push(new u(28,t)),this}writeI64(t){return this.offset+=8,this.ops.push(new u(29,t)),this}writeI64BE(t){return this.offset+=8,this.ops.push(new u(30,t)),this}writeFloat(t){return this.offset+=4,this.ops.push(new u(31,t)),this}writeFloatBE(t){return this.offset+=4,this.ops.push(new u(32,t)),this}writeDouble(t){return this.offset+=8,this.ops.push(new u(33,t)),this}writeDoubleBE(t){return this.offset+=8,this.ops.push(new u(34,t)),this}writeVarint(t){return this.offset+=o.sizeVarint(t),this.ops.push(new u(35,t)),this}writeVarint2(t){return this.offset+=o.sizeVarint2(t),this.ops.push(new u(36,t)),this}writeBytes(t){return i(n.isBuffer(t),"value","buffer"),0===t.length||(this.offset+=t.length,this.ops.push(new h(37,t))),this}writeVarBytes(t){return i(n.isBuffer(t),"value","buffer"),this.offset+=o.sizeVarint(t.length),this.ops.push(new u(35,t.length)),0===t.length||(this.offset+=t.length,this.ops.push(new h(37,t))),this}copy(t,e,r){i(n.isBuffer(t),"value","buffer"),i(e>>>0===e,"start","integer"),i(r>>>0===r,"end","integer"),i(r>=e,"start","integer");const o=t.slice(e,r);return this.writeBytes(o),this}writeString(t,e){return null==e&&(e="binary"),i("string"===typeof t,"value","string"),i("string"===typeof e,"enc","string"),0===t.length||(this.offset+=n.byteLength(t,e),this.ops.push(new c(38,t,e))),this}writeHash(t){return"string"!==typeof t?(i(n.isBuffer(t),"value","buffer"),i(32===t.length,"value","32-byte hash"),this.writeBytes(t),this):(i(64===t.length,"value","32-byte hash"),this.writeString(t,"hex"),this)}writeVarString(t,e){if(null==e&&(e="binary"),i("string"===typeof t,"value","string"),i("string"===typeof e,"enc","string"),0===t.length)return this.ops.push(new u(35,0)),this;const r=n.byteLength(t,e);return this.offset+=o.sizeVarint(r),this.offset+=r,this.ops.push(new u(35,r)),this.ops.push(new c(38,t,e)),this}writeNullString(t,e){return this.writeString(t,e),this.writeU8(0),this}writeChecksum(t){return t&&"function"===typeof t.digest&&(t=t.digest.bind(t)),i("function"===typeof t,"hash","function"),this.offset+=4,this.ops.push(new l(39,t)),this}fill(t,e){return i((255&t)===t,"value","byte"),i(e>>>0===e,"size","integer"),0===e||(this.offset+=e,this.ops.push(new f(40,t,e))),this}}},6239:(t,e,r)=>{var n=r(9966).Buffer,i=r(1781).Transform,o=r(8694).I;function s(t){i.call(this),this.hashMode="string"===typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(6329)(s,i),s.prototype.update=function(t,e,r){"string"===typeof t&&(t=n.from(t,e));var i=this._update(t);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(i){n=i}finally{r(n)}},s.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(r){e=r}t(e)},s.prototype._finalOrDigest=function(t){var e=this.__final()||n.alloc(0);return t&&(e=this._toString(e,t,!0)),e},s.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n},t.exports=s},3525:(t,e,r)=>{function n(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===n(t)},e.isBoolean=function(t){return"boolean"===typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return"number"===typeof t},e.isString=function(t){return"string"===typeof t},e.isSymbol=function(t){return"symbol"===typeof t},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return"[object RegExp]"===n(t)},e.isObject=function(t){return"object"===typeof t&&null!==t},e.isDate=function(t){return"[object Date]"===n(t)},e.isError=function(t){return"[object Error]"===n(t)||t instanceof Error},e.isFunction=function(t){return"function"===typeof t},e.isPrimitive=function(t){return null===t||"boolean"===typeof t||"number"===typeof t||"string"===typeof t||"symbol"===typeof t||"undefined"===typeof t},e.isBuffer=r(6382).Buffer.isBuffer},8231:(t,e,r)=>{var n=r(6382).Buffer,i=r(8086),o=r(1894);t.exports=function(t){return new a(t)};var s={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function a(t){this.curveType=s[t],this.curveType||(this.curveType={name:t}),this.curve=new i.ec(this.curveType.name),this.keys=void 0}function u(t,e,r){Array.isArray(t)||(t=t.toArray());var i=new n(t);if(r&&i.length=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function h(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s