diff --git a/docs/assets/js/ganache/ganache.min.js b/docs/assets/js/ganache/ganache.min.js index 2d88161905..c384b512c9 100644 --- a/docs/assets/js/ganache/ganache.min.js +++ b/docs/assets/js/ganache/ganache.min.js @@ -1,3 +1,3 @@ /*! For license information please see ganache.min.js.LICENSE.txt */ -!function webpackUniversalModuleDefinition(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Ganache=t():e.Ganache=t()}(self,(function(){return(()=>{var __webpack_modules__=[(e,t,a)=>{"use strict";var r=a(471),n=a(472),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=Buffer,t.SlowBuffer=function SlowBuffer(e){+e!=e&&(e=0);return Buffer.alloc(+e)},t.INSPECT_MAX_BYTES=50;var c=2147483647;function createBuffer(e){if(e>c)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,Buffer.prototype),t}function Buffer(e,t,a){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(e)}return from(e,t,a)}function from(e,t,a){if("string"==typeof e)return function fromString(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!Buffer.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var a=0|byteLength(e,t),r=createBuffer(a),n=r.write(e,t);n!==a&&(r=r.slice(0,n));return r}(e,t);if(ArrayBuffer.isView(e))return function fromArrayView(e){if(isInstance(e,Uint8Array)){var t=new Uint8Array(e);return fromArrayBuffer(t.buffer,t.byteOffset,t.byteLength)}return fromArrayLike(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(isInstance(e,ArrayBuffer)||e&&isInstance(e.buffer,ArrayBuffer))return fromArrayBuffer(e,t,a);if("undefined"!=typeof SharedArrayBuffer&&(isInstance(e,SharedArrayBuffer)||e&&isInstance(e.buffer,SharedArrayBuffer)))return fromArrayBuffer(e,t,a);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return Buffer.from(r,t,a);var n=function fromObject(e){if(Buffer.isBuffer(e)){var t=0|checked(e.length),a=createBuffer(t);return 0===a.length||e.copy(a,0,0,t),a}if(void 0!==e.length)return"number"!=typeof e.length||numberIsNaN(e.length)?createBuffer(0):fromArrayLike(e);if("Buffer"===e.type&&Array.isArray(e.data))return fromArrayLike(e.data)}(e);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return Buffer.from(e[Symbol.toPrimitive]("string"),t,a);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function assertSize(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function allocUnsafe(e){return assertSize(e),createBuffer(e<0?0:0|checked(e))}function fromArrayLike(e){for(var t=e.length<0?0:0|checked(e.length),a=createBuffer(t),r=0;r=c)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+c.toString(16)+" bytes");return 0|e}function byteLength(e,t){if(Buffer.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||isInstance(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var a=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===a)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return a;case"utf8":case"utf-8":return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*a;case"hex":return a>>>1;case"base64":return base64ToBytes(e).length;default:if(n)return r?-1:utf8ToBytes(e).length;t=(""+t).toLowerCase(),n=!0}}function slowToString(e,t,a){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===a||a>this.length)&&(a=this.length),a<=0)return"";if((a>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return hexSlice(this,t,a);case"utf8":case"utf-8":return utf8Slice(this,t,a);case"ascii":return asciiSlice(this,t,a);case"latin1":case"binary":return latin1Slice(this,t,a);case"base64":return base64Slice(this,t,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,t,a);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function swap(e,t,a){var r=e[t];e[t]=e[a],e[a]=r}function bidirectionalIndexOf(e,t,a,r,n){if(0===e.length)return-1;if("string"==typeof a?(r=a,a=0):a>2147483647?a=2147483647:a<-2147483648&&(a=-2147483648),numberIsNaN(a=+a)&&(a=n?0:e.length-1),a<0&&(a=e.length+a),a>=e.length){if(n)return-1;a=e.length-1}else if(a<0){if(!n)return-1;a=0}if("string"==typeof t&&(t=Buffer.from(t,r)),Buffer.isBuffer(t))return 0===t.length?-1:arrayIndexOf(e,t,a,r,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,a):Uint8Array.prototype.lastIndexOf.call(e,t,a):arrayIndexOf(e,[t],a,r,n);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(e,t,a,r,n){var o,c=1,d=e.length,s=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;c=2,d/=2,s/=2,a/=2}function read(e,t){return 1===c?e[t]:e.readUInt16BE(t*c)}if(n){var b=-1;for(o=a;od&&(a=d-s),o=a;o>=0;o--){for(var u=!0,h=0;hn&&(r=n):r=n;var o=t.length;r>o/2&&(r=o/2);for(var c=0;c>8,n=a%256,o.push(n),o.push(r);return o}(t,e.length-a),e,a,r)}function base64Slice(e,t,a){return 0===t&&a===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,a))}function utf8Slice(e,t,a){a=Math.min(e.length,a);for(var r=[],n=t;n239?4:u>223?3:u>191?2:1;if(n+l<=a)switch(l){case 1:u<128&&(h=u);break;case 2:128==(192&(o=e[n+1]))&&(b=(31&u)<<6|63&o)>127&&(h=b);break;case 3:o=e[n+1],c=e[n+2],128==(192&o)&&128==(192&c)&&(b=(15&u)<<12|(63&o)<<6|63&c)>2047&&(b<55296||b>57343)&&(h=b);break;case 4:o=e[n+1],c=e[n+2],s=e[n+3],128==(192&o)&&128==(192&c)&&128==(192&s)&&(b=(15&u)<<18|(63&o)<<12|(63&c)<<6|63&s)>65535&&b<1114112&&(h=b)}null===h?(h=65533,l=1):h>65535&&(h-=65536,r.push(h>>>10&1023|55296),h=56320|1023&h),r.push(h),n+=l}return function decodeCodePointsArray(e){var t=e.length;if(t<=d)return String.fromCharCode.apply(String,e);var a="",r=0;for(;rr.length?Buffer.from(o).copy(r,n):Uint8Array.prototype.set.call(r,o,n);else{if(!Buffer.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,n)}n+=o.length}return r},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function swap16(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;ta&&(e+=" ... "),""},o&&(Buffer.prototype[o]=Buffer.prototype.inspect),Buffer.prototype.compare=function compare(e,t,a,r,n){if(isInstance(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),!Buffer.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===a&&(a=e?e.length:0),void 0===r&&(r=0),void 0===n&&(n=this.length),t<0||a>e.length||r<0||n>this.length)throw new RangeError("out of range index");if(r>=n&&t>=a)return 0;if(r>=n)return-1;if(t>=a)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(r>>>=0),c=(a>>>=0)-(t>>>=0),d=Math.min(o,c),s=this.slice(r,n),b=e.slice(t,a),u=0;u>>=0,isFinite(a)?(a>>>=0,void 0===r&&(r="utf8")):(r=a,a=void 0)}var n=this.length-t;if((void 0===a||a>n)&&(a=n),e.length>0&&(a<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return hexWrite(this,e,t,a);case"utf8":case"utf-8":return utf8Write(this,e,t,a);case"ascii":case"latin1":case"binary":return asciiWrite(this,e,t,a);case"base64":return base64Write(this,e,t,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,e,t,a);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var d=4096;function asciiSlice(e,t,a){var r="";a=Math.min(e.length,a);for(var n=t;nr)&&(a=r);for(var n="",o=t;oa)throw new RangeError("Trying to access beyond buffer length")}function checkInt(e,t,a,r,n,o){if(!Buffer.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||te.length)throw new RangeError("Index out of range")}function checkIEEE754(e,t,a,r,n,o){if(a+r>e.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("Index out of range")}function writeFloat(e,t,a,r,o){return t=+t,a>>>=0,o||checkIEEE754(e,0,a,4),n.write(e,t,a,r,23,4),a+4}function writeDouble(e,t,a,r,o){return t=+t,a>>>=0,o||checkIEEE754(e,0,a,8),n.write(e,t,a,r,52,8),a+8}Buffer.prototype.slice=function slice(e,t){var a=this.length;(e=~~e)<0?(e+=a)<0&&(e=0):e>a&&(e=a),(t=void 0===t?a:~~t)<0?(t+=a)<0&&(t=0):t>a&&(t=a),t>>=0,t>>>=0,a||checkOffset(e,t,this.length);for(var r=this[e],n=1,o=0;++o>>=0,t>>>=0,a||checkOffset(e,t,this.length);for(var r=this[e+--t],n=1;t>0&&(n*=256);)r+=this[e+--t]*n;return r},Buffer.prototype.readUint8=Buffer.prototype.readUInt8=function readUInt8(e,t){return e>>>=0,t||checkOffset(e,1,this.length),this[e]},Buffer.prototype.readUint16LE=Buffer.prototype.readUInt16LE=function readUInt16LE(e,t){return e>>>=0,t||checkOffset(e,2,this.length),this[e]|this[e+1]<<8},Buffer.prototype.readUint16BE=Buffer.prototype.readUInt16BE=function readUInt16BE(e,t){return e>>>=0,t||checkOffset(e,2,this.length),this[e]<<8|this[e+1]},Buffer.prototype.readUint32LE=Buffer.prototype.readUInt32LE=function readUInt32LE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Buffer.prototype.readUint32BE=Buffer.prototype.readUInt32BE=function readUInt32BE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Buffer.prototype.readIntLE=function readIntLE(e,t,a){e>>>=0,t>>>=0,a||checkOffset(e,t,this.length);for(var r=this[e],n=1,o=0;++o=(n*=128)&&(r-=Math.pow(2,8*t)),r},Buffer.prototype.readIntBE=function readIntBE(e,t,a){e>>>=0,t>>>=0,a||checkOffset(e,t,this.length);for(var r=t,n=1,o=this[e+--r];r>0&&(n*=256);)o+=this[e+--r]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*t)),o},Buffer.prototype.readInt8=function readInt8(e,t){return e>>>=0,t||checkOffset(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Buffer.prototype.readInt16LE=function readInt16LE(e,t){e>>>=0,t||checkOffset(e,2,this.length);var a=this[e]|this[e+1]<<8;return 32768&a?4294901760|a:a},Buffer.prototype.readInt16BE=function readInt16BE(e,t){e>>>=0,t||checkOffset(e,2,this.length);var a=this[e+1]|this[e]<<8;return 32768&a?4294901760|a:a},Buffer.prototype.readInt32LE=function readInt32LE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Buffer.prototype.readInt32BE=function readInt32BE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Buffer.prototype.readFloatLE=function readFloatLE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),n.read(this,e,!0,23,4)},Buffer.prototype.readFloatBE=function readFloatBE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),n.read(this,e,!1,23,4)},Buffer.prototype.readDoubleLE=function readDoubleLE(e,t){return e>>>=0,t||checkOffset(e,8,this.length),n.read(this,e,!0,52,8)},Buffer.prototype.readDoubleBE=function readDoubleBE(e,t){return e>>>=0,t||checkOffset(e,8,this.length),n.read(this,e,!1,52,8)},Buffer.prototype.writeUintLE=Buffer.prototype.writeUIntLE=function writeUIntLE(e,t,a,r){(e=+e,t>>>=0,a>>>=0,r)||checkInt(this,e,t,a,Math.pow(2,8*a)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,a>>>=0,r)||checkInt(this,e,t,a,Math.pow(2,8*a)-1,0);var n=a-1,o=1;for(this[t+n]=255&e;--n>=0&&(o*=256);)this[t+n]=e/o&255;return t+a},Buffer.prototype.writeUint8=Buffer.prototype.writeUInt8=function writeUInt8(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,1,255,0),this[t]=255&e,t+1},Buffer.prototype.writeUint16LE=Buffer.prototype.writeUInt16LE=function writeUInt16LE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeUint16BE=Buffer.prototype.writeUInt16BE=function writeUInt16BE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeUint32LE=Buffer.prototype.writeUInt32LE=function writeUInt32LE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},Buffer.prototype.writeUint32BE=Buffer.prototype.writeUInt32BE=function writeUInt32BE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeIntLE=function writeIntLE(e,t,a,r){if(e=+e,t>>>=0,!r){var n=Math.pow(2,8*a-1);checkInt(this,e,t,a,n-1,-n)}var o=0,c=1,d=0;for(this[t]=255&e;++o>0)-d&255;return t+a},Buffer.prototype.writeIntBE=function writeIntBE(e,t,a,r){if(e=+e,t>>>=0,!r){var n=Math.pow(2,8*a-1);checkInt(this,e,t,a,n-1,-n)}var o=a-1,c=1,d=0;for(this[t+o]=255&e;--o>=0&&(c*=256);)e<0&&0===d&&0!==this[t+o+1]&&(d=1),this[t+o]=(e/c>>0)-d&255;return t+a},Buffer.prototype.writeInt8=function writeInt8(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},Buffer.prototype.writeInt16LE=function writeInt16LE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeInt16BE=function writeInt16BE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeInt32LE=function writeInt32LE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},Buffer.prototype.writeInt32BE=function writeInt32BE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeFloatLE=function writeFloatLE(e,t,a){return writeFloat(this,e,t,!0,a)},Buffer.prototype.writeFloatBE=function writeFloatBE(e,t,a){return writeFloat(this,e,t,!1,a)},Buffer.prototype.writeDoubleLE=function writeDoubleLE(e,t,a){return writeDouble(this,e,t,!0,a)},Buffer.prototype.writeDoubleBE=function writeDoubleBE(e,t,a){return writeDouble(this,e,t,!1,a)},Buffer.prototype.copy=function copy(e,t,a,r){if(!Buffer.isBuffer(e))throw new TypeError("argument should be a Buffer");if(a||(a=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,a=void 0===a?this.length:a>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&a<57344){if(!n){if(a>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(c+1===r){(t-=3)>-1&&o.push(239,191,189);continue}n=a;continue}if(a<56320){(t-=3)>-1&&o.push(239,191,189),n=a;continue}a=65536+(n-55296<<10|a-56320)}else n&&(t-=3)>-1&&o.push(239,191,189);if(n=null,a<128){if((t-=1)<0)break;o.push(a)}else if(a<2048){if((t-=2)<0)break;o.push(a>>6|192,63&a|128)}else if(a<65536){if((t-=3)<0)break;o.push(a>>12|224,a>>6&63|128,63&a|128)}else{if(!(a<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(a>>18|240,a>>12&63|128,a>>6&63|128,63&a|128)}}return o}function base64ToBytes(e){return r.toByteArray(function base64clean(e){if((e=(e=e.split("=")[0]).trim().replace(s,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function blitBuffer(e,t,a,r){for(var n=0;n=t.length||n>=e.length);++n)t[n+a]=e[n];return n}function isInstance(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function numberIsNaN(e){return e!=e}var b=function(){for(var e="0123456789abcdef",t=new Array(256),a=0;a<16;++a)for(var r=16*a,n=0;n<16;++n)t[r+n]=e[a]+e[n];return t}()},function(e,t,a){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a);var n=Object.getOwnPropertyDescriptor(t,a);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,r,n)}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),n=this&&this.__exportStar||function(e,t){for(var a in e)"default"===a||Object.prototype.hasOwnProperty.call(t,a)||r(t,e,a)};Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,n(a(352),t),n(a(328),t),n(a(750),t),n(a(209),t),n(a(1584),t),n(a(83),t),n(a(751),t),n(a(58),t),n(a(271),t);var o=a(134);Object.defineProperty(t,"isHexPrefixed",{enumerable:!0,get:function(){return o.isHexPrefixed}}),Object.defineProperty(t,"stripHexPrefix",{enumerable:!0,get:function(){return o.stripHexPrefix}}),Object.defineProperty(t,"padToEven",{enumerable:!0,get:function(){return o.padToEven}}),Object.defineProperty(t,"getBinarySize",{enumerable:!0,get:function(){return o.getBinarySize}}),Object.defineProperty(t,"arrayContainsArray",{enumerable:!0,get:function(){return o.arrayContainsArray}}),Object.defineProperty(t,"toAscii",{enumerable:!0,get:function(){return o.toAscii}}),Object.defineProperty(t,"fromUtf8",{enumerable:!0,get:function(){return o.fromUtf8}}),Object.defineProperty(t,"fromAscii",{enumerable:!0,get:function(){return o.fromAscii}}),Object.defineProperty(t,"getKeys",{enumerable:!0,get:function(){return o.getKeys}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return o.isHexString}})},(e,t,a)=>{"use strict";const r=a(1400),n=a(1401),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=Buffer,t.SlowBuffer=function SlowBuffer(e){+e!=e&&(e=0);return Buffer.alloc(+e)},t.INSPECT_MAX_BYTES=50;const c=2147483647;function createBuffer(e){if(e>c)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,Buffer.prototype),t}function Buffer(e,t,a){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(e)}return from(e,t,a)}function from(e,t,a){if("string"==typeof e)return function fromString(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!Buffer.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const a=0|byteLength(e,t);let r=createBuffer(a);const n=r.write(e,t);n!==a&&(r=r.slice(0,n));return r}(e,t);if(ArrayBuffer.isView(e))return function fromArrayView(e){if(isInstance(e,Uint8Array)){const t=new Uint8Array(e);return fromArrayBuffer(t.buffer,t.byteOffset,t.byteLength)}return fromArrayLike(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(isInstance(e,ArrayBuffer)||e&&isInstance(e.buffer,ArrayBuffer))return fromArrayBuffer(e,t,a);if("undefined"!=typeof SharedArrayBuffer&&(isInstance(e,SharedArrayBuffer)||e&&isInstance(e.buffer,SharedArrayBuffer)))return fromArrayBuffer(e,t,a);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return Buffer.from(r,t,a);const n=function fromObject(e){if(Buffer.isBuffer(e)){const t=0|checked(e.length),a=createBuffer(t);return 0===a.length||e.copy(a,0,0,t),a}if(void 0!==e.length)return"number"!=typeof e.length||numberIsNaN(e.length)?createBuffer(0):fromArrayLike(e);if("Buffer"===e.type&&Array.isArray(e.data))return fromArrayLike(e.data)}(e);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return Buffer.from(e[Symbol.toPrimitive]("string"),t,a);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function assertSize(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function allocUnsafe(e){return assertSize(e),createBuffer(e<0?0:0|checked(e))}function fromArrayLike(e){const t=e.length<0?0:0|checked(e.length),a=createBuffer(t);for(let r=0;r=c)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+c.toString(16)+" bytes");return 0|e}function byteLength(e,t){if(Buffer.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||isInstance(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const a=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===a)return 0;let n=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return a;case"utf8":case"utf-8":return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*a;case"hex":return a>>>1;case"base64":return base64ToBytes(e).length;default:if(n)return r?-1:utf8ToBytes(e).length;t=(""+t).toLowerCase(),n=!0}}function slowToString(e,t,a){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===a||a>this.length)&&(a=this.length),a<=0)return"";if((a>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return hexSlice(this,t,a);case"utf8":case"utf-8":return utf8Slice(this,t,a);case"ascii":return asciiSlice(this,t,a);case"latin1":case"binary":return latin1Slice(this,t,a);case"base64":return base64Slice(this,t,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,t,a);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function swap(e,t,a){const r=e[t];e[t]=e[a],e[a]=r}function bidirectionalIndexOf(e,t,a,r,n){if(0===e.length)return-1;if("string"==typeof a?(r=a,a=0):a>2147483647?a=2147483647:a<-2147483648&&(a=-2147483648),numberIsNaN(a=+a)&&(a=n?0:e.length-1),a<0&&(a=e.length+a),a>=e.length){if(n)return-1;a=e.length-1}else if(a<0){if(!n)return-1;a=0}if("string"==typeof t&&(t=Buffer.from(t,r)),Buffer.isBuffer(t))return 0===t.length?-1:arrayIndexOf(e,t,a,r,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,a):Uint8Array.prototype.lastIndexOf.call(e,t,a):arrayIndexOf(e,[t],a,r,n);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(e,t,a,r,n){let o,c=1,d=e.length,s=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;c=2,d/=2,s/=2,a/=2}function read(e,t){return 1===c?e[t]:e.readUInt16BE(t*c)}if(n){let r=-1;for(o=a;od&&(a=d-s),o=a;o>=0;o--){let a=!0;for(let r=0;rn&&(r=n):r=n;const o=t.length;let c;for(r>o/2&&(r=o/2),c=0;c>8,n=a%256,o.push(n),o.push(r);return o}(t,e.length-a),e,a,r)}function base64Slice(e,t,a){return 0===t&&a===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,a))}function utf8Slice(e,t,a){a=Math.min(e.length,a);const r=[];let n=t;for(;n239?4:t>223?3:t>191?2:1;if(n+c<=a){let a,r,d,s;switch(c){case 1:t<128&&(o=t);break;case 2:a=e[n+1],128==(192&a)&&(s=(31&t)<<6|63&a,s>127&&(o=s));break;case 3:a=e[n+1],r=e[n+2],128==(192&a)&&128==(192&r)&&(s=(15&t)<<12|(63&a)<<6|63&r,s>2047&&(s<55296||s>57343)&&(o=s));break;case 4:a=e[n+1],r=e[n+2],d=e[n+3],128==(192&a)&&128==(192&r)&&128==(192&d)&&(s=(15&t)<<18|(63&a)<<12|(63&r)<<6|63&d,s>65535&&s<1114112&&(o=s))}}null===o?(o=65533,c=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),n+=c}return function decodeCodePointsArray(e){const t=e.length;if(t<=d)return String.fromCharCode.apply(String,e);let a="",r=0;for(;rr.length?(Buffer.isBuffer(t)||(t=Buffer.from(t)),t.copy(r,n)):Uint8Array.prototype.set.call(r,t,n);else{if(!Buffer.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,n)}n+=t.length}return r},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function swap16(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;ta&&(e+=" ... "),""},o&&(Buffer.prototype[o]=Buffer.prototype.inspect),Buffer.prototype.compare=function compare(e,t,a,r,n){if(isInstance(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),!Buffer.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===a&&(a=e?e.length:0),void 0===r&&(r=0),void 0===n&&(n=this.length),t<0||a>e.length||r<0||n>this.length)throw new RangeError("out of range index");if(r>=n&&t>=a)return 0;if(r>=n)return-1;if(t>=a)return 1;if(this===e)return 0;let o=(n>>>=0)-(r>>>=0),c=(a>>>=0)-(t>>>=0);const d=Math.min(o,c),s=this.slice(r,n),b=e.slice(t,a);for(let e=0;e>>=0,isFinite(a)?(a>>>=0,void 0===r&&(r="utf8")):(r=a,a=void 0)}const n=this.length-t;if((void 0===a||a>n)&&(a=n),e.length>0&&(a<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let o=!1;for(;;)switch(r){case"hex":return hexWrite(this,e,t,a);case"utf8":case"utf-8":return utf8Write(this,e,t,a);case"ascii":case"latin1":case"binary":return asciiWrite(this,e,t,a);case"base64":return base64Write(this,e,t,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,e,t,a);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const d=4096;function asciiSlice(e,t,a){let r="";a=Math.min(e.length,a);for(let n=t;nr)&&(a=r);let n="";for(let r=t;ra)throw new RangeError("Trying to access beyond buffer length")}function checkInt(e,t,a,r,n,o){if(!Buffer.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||te.length)throw new RangeError("Index out of range")}function wrtBigUInt64LE(e,t,a,r,n){checkIntBI(t,r,n,e,a,7);let o=Number(t&BigInt(4294967295));e[a++]=o,o>>=8,e[a++]=o,o>>=8,e[a++]=o,o>>=8,e[a++]=o;let c=Number(t>>BigInt(32)&BigInt(4294967295));return e[a++]=c,c>>=8,e[a++]=c,c>>=8,e[a++]=c,c>>=8,e[a++]=c,a}function wrtBigUInt64BE(e,t,a,r,n){checkIntBI(t,r,n,e,a,7);let o=Number(t&BigInt(4294967295));e[a+7]=o,o>>=8,e[a+6]=o,o>>=8,e[a+5]=o,o>>=8,e[a+4]=o;let c=Number(t>>BigInt(32)&BigInt(4294967295));return e[a+3]=c,c>>=8,e[a+2]=c,c>>=8,e[a+1]=c,c>>=8,e[a]=c,a+8}function checkIEEE754(e,t,a,r,n,o){if(a+r>e.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("Index out of range")}function writeFloat(e,t,a,r,o){return t=+t,a>>>=0,o||checkIEEE754(e,0,a,4),n.write(e,t,a,r,23,4),a+4}function writeDouble(e,t,a,r,o){return t=+t,a>>>=0,o||checkIEEE754(e,0,a,8),n.write(e,t,a,r,52,8),a+8}Buffer.prototype.slice=function slice(e,t){const a=this.length;(e=~~e)<0?(e+=a)<0&&(e=0):e>a&&(e=a),(t=void 0===t?a:~~t)<0?(t+=a)<0&&(t=0):t>a&&(t=a),t>>=0,t>>>=0,a||checkOffset(e,t,this.length);let r=this[e],n=1,o=0;for(;++o>>=0,t>>>=0,a||checkOffset(e,t,this.length);let r=this[e+--t],n=1;for(;t>0&&(n*=256);)r+=this[e+--t]*n;return r},Buffer.prototype.readUint8=Buffer.prototype.readUInt8=function readUInt8(e,t){return e>>>=0,t||checkOffset(e,1,this.length),this[e]},Buffer.prototype.readUint16LE=Buffer.prototype.readUInt16LE=function readUInt16LE(e,t){return e>>>=0,t||checkOffset(e,2,this.length),this[e]|this[e+1]<<8},Buffer.prototype.readUint16BE=Buffer.prototype.readUInt16BE=function readUInt16BE(e,t){return e>>>=0,t||checkOffset(e,2,this.length),this[e]<<8|this[e+1]},Buffer.prototype.readUint32LE=Buffer.prototype.readUInt32LE=function readUInt32LE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Buffer.prototype.readUint32BE=Buffer.prototype.readUInt32BE=function readUInt32BE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Buffer.prototype.readBigUInt64LE=defineBigIntMethod((function readBigUInt64LE(e){validateNumber(e>>>=0,"offset");const t=this[e],a=this[e+7];void 0!==t&&void 0!==a||boundsError(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,n=this[++e]+256*this[++e]+65536*this[++e]+a*2**24;return BigInt(r)+(BigInt(n)<>>=0,"offset");const t=this[e],a=this[e+7];void 0!==t&&void 0!==a||boundsError(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],n=this[++e]*2**24+65536*this[++e]+256*this[++e]+a;return(BigInt(r)<>>=0,t>>>=0,a||checkOffset(e,t,this.length);let r=this[e],n=1,o=0;for(;++o=n&&(r-=Math.pow(2,8*t)),r},Buffer.prototype.readIntBE=function readIntBE(e,t,a){e>>>=0,t>>>=0,a||checkOffset(e,t,this.length);let r=t,n=1,o=this[e+--r];for(;r>0&&(n*=256);)o+=this[e+--r]*n;return n*=128,o>=n&&(o-=Math.pow(2,8*t)),o},Buffer.prototype.readInt8=function readInt8(e,t){return e>>>=0,t||checkOffset(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Buffer.prototype.readInt16LE=function readInt16LE(e,t){e>>>=0,t||checkOffset(e,2,this.length);const a=this[e]|this[e+1]<<8;return 32768&a?4294901760|a:a},Buffer.prototype.readInt16BE=function readInt16BE(e,t){e>>>=0,t||checkOffset(e,2,this.length);const a=this[e+1]|this[e]<<8;return 32768&a?4294901760|a:a},Buffer.prototype.readInt32LE=function readInt32LE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Buffer.prototype.readInt32BE=function readInt32BE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Buffer.prototype.readBigInt64LE=defineBigIntMethod((function readBigInt64LE(e){validateNumber(e>>>=0,"offset");const t=this[e],a=this[e+7];void 0!==t&&void 0!==a||boundsError(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(a<<24);return(BigInt(r)<>>=0,"offset");const t=this[e],a=this[e+7];void 0!==t&&void 0!==a||boundsError(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<>>=0,t||checkOffset(e,4,this.length),n.read(this,e,!0,23,4)},Buffer.prototype.readFloatBE=function readFloatBE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),n.read(this,e,!1,23,4)},Buffer.prototype.readDoubleLE=function readDoubleLE(e,t){return e>>>=0,t||checkOffset(e,8,this.length),n.read(this,e,!0,52,8)},Buffer.prototype.readDoubleBE=function readDoubleBE(e,t){return e>>>=0,t||checkOffset(e,8,this.length),n.read(this,e,!1,52,8)},Buffer.prototype.writeUintLE=Buffer.prototype.writeUIntLE=function writeUIntLE(e,t,a,r){if(e=+e,t>>>=0,a>>>=0,!r){checkInt(this,e,t,a,Math.pow(2,8*a)-1,0)}let n=1,o=0;for(this[t]=255&e;++o>>=0,a>>>=0,!r){checkInt(this,e,t,a,Math.pow(2,8*a)-1,0)}let n=a-1,o=1;for(this[t+n]=255&e;--n>=0&&(o*=256);)this[t+n]=e/o&255;return t+a},Buffer.prototype.writeUint8=Buffer.prototype.writeUInt8=function writeUInt8(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,1,255,0),this[t]=255&e,t+1},Buffer.prototype.writeUint16LE=Buffer.prototype.writeUInt16LE=function writeUInt16LE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeUint16BE=Buffer.prototype.writeUInt16BE=function writeUInt16BE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeUint32LE=Buffer.prototype.writeUInt32LE=function writeUInt32LE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},Buffer.prototype.writeUint32BE=Buffer.prototype.writeUInt32BE=function writeUInt32BE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeBigUInt64LE=defineBigIntMethod((function writeBigUInt64LE(e,t=0){return wrtBigUInt64LE(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),Buffer.prototype.writeBigUInt64BE=defineBigIntMethod((function writeBigUInt64BE(e,t=0){return wrtBigUInt64BE(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),Buffer.prototype.writeIntLE=function writeIntLE(e,t,a,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*a-1);checkInt(this,e,t,a,r-1,-r)}let n=0,o=1,c=0;for(this[t]=255&e;++n>0)-c&255;return t+a},Buffer.prototype.writeIntBE=function writeIntBE(e,t,a,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*a-1);checkInt(this,e,t,a,r-1,-r)}let n=a-1,o=1,c=0;for(this[t+n]=255&e;--n>=0&&(o*=256);)e<0&&0===c&&0!==this[t+n+1]&&(c=1),this[t+n]=(e/o>>0)-c&255;return t+a},Buffer.prototype.writeInt8=function writeInt8(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},Buffer.prototype.writeInt16LE=function writeInt16LE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeInt16BE=function writeInt16BE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeInt32LE=function writeInt32LE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},Buffer.prototype.writeInt32BE=function writeInt32BE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeBigInt64LE=defineBigIntMethod((function writeBigInt64LE(e,t=0){return wrtBigUInt64LE(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),Buffer.prototype.writeBigInt64BE=defineBigIntMethod((function writeBigInt64BE(e,t=0){return wrtBigUInt64BE(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),Buffer.prototype.writeFloatLE=function writeFloatLE(e,t,a){return writeFloat(this,e,t,!0,a)},Buffer.prototype.writeFloatBE=function writeFloatBE(e,t,a){return writeFloat(this,e,t,!1,a)},Buffer.prototype.writeDoubleLE=function writeDoubleLE(e,t,a){return writeDouble(this,e,t,!0,a)},Buffer.prototype.writeDoubleBE=function writeDoubleBE(e,t,a){return writeDouble(this,e,t,!1,a)},Buffer.prototype.copy=function copy(e,t,a,r){if(!Buffer.isBuffer(e))throw new TypeError("argument should be a Buffer");if(a||(a=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,a=void 0===a?this.length:a>>>0,e||(e=0),"number"==typeof e)for(n=t;n=r+4;a-=3)t=`_${e.slice(a-3,a)}${t}`;return`${e.slice(0,a)}${t}`}function checkIntBI(e,t,a,r,n,o){if(e>a||e3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** ${8*(o+1)-1}${r}`:`>= ${t}${r} and <= ${a}${r}`,new s.ERR_OUT_OF_RANGE("value",n,e)}!function checkBounds(e,t,a){validateNumber(t,"offset"),void 0!==e[t]&&void 0!==e[t+a]||boundsError(t,e.length-(a+1))}(r,n,o)}function validateNumber(e,t){if("number"!=typeof e)throw new s.ERR_INVALID_ARG_TYPE(t,"number",e)}function boundsError(e,t,a){if(Math.floor(e)!==e)throw validateNumber(e,a),new s.ERR_OUT_OF_RANGE(a||"offset","an integer",e);if(t<0)throw new s.ERR_BUFFER_OUT_OF_BOUNDS;throw new s.ERR_OUT_OF_RANGE(a||"offset",`>= ${a?1:0} and <= ${t}`,e)}E("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),E("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),E("ERR_OUT_OF_RANGE",(function(e,t,a){let r=`The value of "${e}" is out of range.`,n=a;return Number.isInteger(a)&&Math.abs(a)>2**32?n=addNumericalSeparator(String(a)):"bigint"==typeof a&&(n=String(a),(a>BigInt(2)**BigInt(32)||a<-(BigInt(2)**BigInt(32)))&&(n=addNumericalSeparator(n)),n+="n"),r+=` It must be ${t}. Received ${n}`,r}),RangeError);const b=/[^+/0-9A-Za-z-_]/g;function utf8ToBytes(e,t){let a;t=t||1/0;const r=e.length;let n=null;const o=[];for(let c=0;c55295&&a<57344){if(!n){if(a>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(c+1===r){(t-=3)>-1&&o.push(239,191,189);continue}n=a;continue}if(a<56320){(t-=3)>-1&&o.push(239,191,189),n=a;continue}a=65536+(n-55296<<10|a-56320)}else n&&(t-=3)>-1&&o.push(239,191,189);if(n=null,a<128){if((t-=1)<0)break;o.push(a)}else if(a<2048){if((t-=2)<0)break;o.push(a>>6|192,63&a|128)}else if(a<65536){if((t-=3)<0)break;o.push(a>>12|224,a>>6&63|128,63&a|128)}else{if(!(a<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(a>>18|240,a>>12&63|128,a>>6&63|128,63&a|128)}}return o}function base64ToBytes(e){return r.toByteArray(function base64clean(e){if((e=(e=e.split("=")[0]).trim().replace(b,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function blitBuffer(e,t,a,r){let n;for(n=0;n=t.length||n>=e.length);++n)t[n+a]=e[n];return n}function isInstance(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function numberIsNaN(e){return e!=e}const u=function(){const e="0123456789abcdef",t=new Array(256);for(let a=0;a<16;++a){const r=16*a;for(let n=0;n<16;++n)t[r+n]=e[a]+e[n]}return t}();function defineBigIntMethod(e){return"undefined"==typeof BigInt?BufferBigIntNotDefined:e}function BufferBigIntNotDefined(){throw new Error("BigInt not supported")}},e=>{var t,a,r=e.exports={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(e){if(t===setTimeout)return setTimeout(e,0);if((t===defaultSetTimout||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(a){try{return t.call(null,e,0)}catch(a){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){t=defaultSetTimout}try{a="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){a=defaultClearTimeout}}();var n,o=[],c=!1,d=-1;function cleanUpNextTick(){c&&n&&(c=!1,n.length?o=n.concat(o):d=-1,o.length&&drainQueue())}function drainQueue(){if(!c){var e=runTimeout(cleanUpNextTick);c=!0;for(var t=o.length;t;){for(n=o,o=[];++d1)for(var a=1;a{"use strict";var r=a(3);function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(e){return typeof e}:function _typeof(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}var n,o,c=a(916).codes,d=c.ERR_AMBIGUOUS_ARGUMENT,s=c.ERR_INVALID_ARG_TYPE,b=c.ERR_INVALID_ARG_VALUE,u=c.ERR_INVALID_RETURN_VALUE,h=c.ERR_MISSING_ARGS,l=a(925),g=a(98).inspect,p=a(98).types,B=p.isPromise,x=p.isRegExp,m=Object.assign?Object.assign:a(926).assign,I=Object.is?Object.is:a(420);new Map;function lazyLoadComparison(){var e=a(930);n=e.isDeepEqual,o=e.isDeepStrictEqual}var y=!1,C=e.exports=ok,w={};function innerFail(e){if(e.message instanceof Error)throw e.message;throw new l(e)}function innerOk(e,t,a,r){if(!a){var n=!1;if(0===t)n=!0,r="No value argument passed to `assert.ok()`";else if(r instanceof Error)throw r;var o=new l({actual:a,expected:!0,message:r,operator:"==",stackStartFn:e});throw o.generatedMessage=n,o}}function ok(){for(var e=arguments.length,t=new Array(e),a=0;a1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r{"function"==typeof Object.create?e.exports=function inherits(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function inherits(e,t){if(t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype,e.prototype=new TempCtor,e.prototype.constructor=e}}},(e,t,a)=>{var r=a(2),n=r.Buffer;function copyProps(e,t){for(var a in e)t[a]=e[a]}function SafeBuffer(e,t,a){return n(e,t,a)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(copyProps(r,t),t.Buffer=SafeBuffer),SafeBuffer.prototype=Object.create(n.prototype),copyProps(n,SafeBuffer),SafeBuffer.from=function(e,t,a){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,a)},SafeBuffer.alloc=function(e,t,a){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=n(e);return void 0!==t?"string"==typeof a?r.fill(t,a):r.fill(t):r.fill(0),r},SafeBuffer.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},SafeBuffer.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},(e,t,a)=>{"use strict";var r=a(1452),n=a(1453),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=Buffer,t.SlowBuffer=function SlowBuffer(e){+e!=e&&(e=0);return Buffer.alloc(+e)},t.INSPECT_MAX_BYTES=50;var c=2147483647;function createBuffer(e){if(e>c)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,Buffer.prototype),t}function Buffer(e,t,a){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(e)}return from(e,t,a)}function from(e,t,a){if("string"==typeof e)return function fromString(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!Buffer.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var a=0|byteLength(e,t),r=createBuffer(a),n=r.write(e,t);n!==a&&(r=r.slice(0,n));return r}(e,t);if(ArrayBuffer.isView(e))return function fromArrayView(e){if(isInstance(e,Uint8Array)){var t=new Uint8Array(e);return fromArrayBuffer(t.buffer,t.byteOffset,t.byteLength)}return fromArrayLike(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(isInstance(e,ArrayBuffer)||e&&isInstance(e.buffer,ArrayBuffer))return fromArrayBuffer(e,t,a);if("undefined"!=typeof SharedArrayBuffer&&(isInstance(e,SharedArrayBuffer)||e&&isInstance(e.buffer,SharedArrayBuffer)))return fromArrayBuffer(e,t,a);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return Buffer.from(r,t,a);var n=function fromObject(e){if(Buffer.isBuffer(e)){var t=0|checked(e.length),a=createBuffer(t);return 0===a.length||e.copy(a,0,0,t),a}if(void 0!==e.length)return"number"!=typeof e.length||numberIsNaN(e.length)?createBuffer(0):fromArrayLike(e);if("Buffer"===e.type&&Array.isArray(e.data))return fromArrayLike(e.data)}(e);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return Buffer.from(e[Symbol.toPrimitive]("string"),t,a);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function assertSize(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function allocUnsafe(e){return assertSize(e),createBuffer(e<0?0:0|checked(e))}function fromArrayLike(e){for(var t=e.length<0?0:0|checked(e.length),a=createBuffer(t),r=0;r=c)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+c.toString(16)+" bytes");return 0|e}function byteLength(e,t){if(Buffer.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||isInstance(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var a=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===a)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return a;case"utf8":case"utf-8":return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*a;case"hex":return a>>>1;case"base64":return base64ToBytes(e).length;default:if(n)return r?-1:utf8ToBytes(e).length;t=(""+t).toLowerCase(),n=!0}}function slowToString(e,t,a){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===a||a>this.length)&&(a=this.length),a<=0)return"";if((a>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return hexSlice(this,t,a);case"utf8":case"utf-8":return utf8Slice(this,t,a);case"ascii":return asciiSlice(this,t,a);case"latin1":case"binary":return latin1Slice(this,t,a);case"base64":return base64Slice(this,t,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,t,a);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function swap(e,t,a){var r=e[t];e[t]=e[a],e[a]=r}function bidirectionalIndexOf(e,t,a,r,n){if(0===e.length)return-1;if("string"==typeof a?(r=a,a=0):a>2147483647?a=2147483647:a<-2147483648&&(a=-2147483648),numberIsNaN(a=+a)&&(a=n?0:e.length-1),a<0&&(a=e.length+a),a>=e.length){if(n)return-1;a=e.length-1}else if(a<0){if(!n)return-1;a=0}if("string"==typeof t&&(t=Buffer.from(t,r)),Buffer.isBuffer(t))return 0===t.length?-1:arrayIndexOf(e,t,a,r,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,a):Uint8Array.prototype.lastIndexOf.call(e,t,a):arrayIndexOf(e,[t],a,r,n);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(e,t,a,r,n){var o,c=1,d=e.length,s=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;c=2,d/=2,s/=2,a/=2}function read(e,t){return 1===c?e[t]:e.readUInt16BE(t*c)}if(n){var b=-1;for(o=a;od&&(a=d-s),o=a;o>=0;o--){for(var u=!0,h=0;hn&&(r=n):r=n;var o=t.length;r>o/2&&(r=o/2);for(var c=0;c>8,n=a%256,o.push(n),o.push(r);return o}(t,e.length-a),e,a,r)}function base64Slice(e,t,a){return 0===t&&a===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,a))}function utf8Slice(e,t,a){a=Math.min(e.length,a);for(var r=[],n=t;n239?4:u>223?3:u>191?2:1;if(n+l<=a)switch(l){case 1:u<128&&(h=u);break;case 2:128==(192&(o=e[n+1]))&&(b=(31&u)<<6|63&o)>127&&(h=b);break;case 3:o=e[n+1],c=e[n+2],128==(192&o)&&128==(192&c)&&(b=(15&u)<<12|(63&o)<<6|63&c)>2047&&(b<55296||b>57343)&&(h=b);break;case 4:o=e[n+1],c=e[n+2],s=e[n+3],128==(192&o)&&128==(192&c)&&128==(192&s)&&(b=(15&u)<<18|(63&o)<<12|(63&c)<<6|63&s)>65535&&b<1114112&&(h=b)}null===h?(h=65533,l=1):h>65535&&(h-=65536,r.push(h>>>10&1023|55296),h=56320|1023&h),r.push(h),n+=l}return function decodeCodePointsArray(e){var t=e.length;if(t<=d)return String.fromCharCode.apply(String,e);var a="",r=0;for(;rr.length?Buffer.from(o).copy(r,n):Uint8Array.prototype.set.call(r,o,n);else{if(!Buffer.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,n)}n+=o.length}return r},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function swap16(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;ta&&(e+=" ... "),""},o&&(Buffer.prototype[o]=Buffer.prototype.inspect),Buffer.prototype.compare=function compare(e,t,a,r,n){if(isInstance(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),!Buffer.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===a&&(a=e?e.length:0),void 0===r&&(r=0),void 0===n&&(n=this.length),t<0||a>e.length||r<0||n>this.length)throw new RangeError("out of range index");if(r>=n&&t>=a)return 0;if(r>=n)return-1;if(t>=a)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(r>>>=0),c=(a>>>=0)-(t>>>=0),d=Math.min(o,c),s=this.slice(r,n),b=e.slice(t,a),u=0;u>>=0,isFinite(a)?(a>>>=0,void 0===r&&(r="utf8")):(r=a,a=void 0)}var n=this.length-t;if((void 0===a||a>n)&&(a=n),e.length>0&&(a<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return hexWrite(this,e,t,a);case"utf8":case"utf-8":return utf8Write(this,e,t,a);case"ascii":case"latin1":case"binary":return asciiWrite(this,e,t,a);case"base64":return base64Write(this,e,t,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,e,t,a);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var d=4096;function asciiSlice(e,t,a){var r="";a=Math.min(e.length,a);for(var n=t;nr)&&(a=r);for(var n="",o=t;oa)throw new RangeError("Trying to access beyond buffer length")}function checkInt(e,t,a,r,n,o){if(!Buffer.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||te.length)throw new RangeError("Index out of range")}function checkIEEE754(e,t,a,r,n,o){if(a+r>e.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("Index out of range")}function writeFloat(e,t,a,r,o){return t=+t,a>>>=0,o||checkIEEE754(e,0,a,4),n.write(e,t,a,r,23,4),a+4}function writeDouble(e,t,a,r,o){return t=+t,a>>>=0,o||checkIEEE754(e,0,a,8),n.write(e,t,a,r,52,8),a+8}Buffer.prototype.slice=function slice(e,t){var a=this.length;(e=~~e)<0?(e+=a)<0&&(e=0):e>a&&(e=a),(t=void 0===t?a:~~t)<0?(t+=a)<0&&(t=0):t>a&&(t=a),t>>=0,t>>>=0,a||checkOffset(e,t,this.length);for(var r=this[e],n=1,o=0;++o>>=0,t>>>=0,a||checkOffset(e,t,this.length);for(var r=this[e+--t],n=1;t>0&&(n*=256);)r+=this[e+--t]*n;return r},Buffer.prototype.readUint8=Buffer.prototype.readUInt8=function readUInt8(e,t){return e>>>=0,t||checkOffset(e,1,this.length),this[e]},Buffer.prototype.readUint16LE=Buffer.prototype.readUInt16LE=function readUInt16LE(e,t){return e>>>=0,t||checkOffset(e,2,this.length),this[e]|this[e+1]<<8},Buffer.prototype.readUint16BE=Buffer.prototype.readUInt16BE=function readUInt16BE(e,t){return e>>>=0,t||checkOffset(e,2,this.length),this[e]<<8|this[e+1]},Buffer.prototype.readUint32LE=Buffer.prototype.readUInt32LE=function readUInt32LE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Buffer.prototype.readUint32BE=Buffer.prototype.readUInt32BE=function readUInt32BE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Buffer.prototype.readIntLE=function readIntLE(e,t,a){e>>>=0,t>>>=0,a||checkOffset(e,t,this.length);for(var r=this[e],n=1,o=0;++o=(n*=128)&&(r-=Math.pow(2,8*t)),r},Buffer.prototype.readIntBE=function readIntBE(e,t,a){e>>>=0,t>>>=0,a||checkOffset(e,t,this.length);for(var r=t,n=1,o=this[e+--r];r>0&&(n*=256);)o+=this[e+--r]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*t)),o},Buffer.prototype.readInt8=function readInt8(e,t){return e>>>=0,t||checkOffset(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Buffer.prototype.readInt16LE=function readInt16LE(e,t){e>>>=0,t||checkOffset(e,2,this.length);var a=this[e]|this[e+1]<<8;return 32768&a?4294901760|a:a},Buffer.prototype.readInt16BE=function readInt16BE(e,t){e>>>=0,t||checkOffset(e,2,this.length);var a=this[e+1]|this[e]<<8;return 32768&a?4294901760|a:a},Buffer.prototype.readInt32LE=function readInt32LE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Buffer.prototype.readInt32BE=function readInt32BE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Buffer.prototype.readFloatLE=function readFloatLE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),n.read(this,e,!0,23,4)},Buffer.prototype.readFloatBE=function readFloatBE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),n.read(this,e,!1,23,4)},Buffer.prototype.readDoubleLE=function readDoubleLE(e,t){return e>>>=0,t||checkOffset(e,8,this.length),n.read(this,e,!0,52,8)},Buffer.prototype.readDoubleBE=function readDoubleBE(e,t){return e>>>=0,t||checkOffset(e,8,this.length),n.read(this,e,!1,52,8)},Buffer.prototype.writeUintLE=Buffer.prototype.writeUIntLE=function writeUIntLE(e,t,a,r){(e=+e,t>>>=0,a>>>=0,r)||checkInt(this,e,t,a,Math.pow(2,8*a)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,a>>>=0,r)||checkInt(this,e,t,a,Math.pow(2,8*a)-1,0);var n=a-1,o=1;for(this[t+n]=255&e;--n>=0&&(o*=256);)this[t+n]=e/o&255;return t+a},Buffer.prototype.writeUint8=Buffer.prototype.writeUInt8=function writeUInt8(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,1,255,0),this[t]=255&e,t+1},Buffer.prototype.writeUint16LE=Buffer.prototype.writeUInt16LE=function writeUInt16LE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeUint16BE=Buffer.prototype.writeUInt16BE=function writeUInt16BE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeUint32LE=Buffer.prototype.writeUInt32LE=function writeUInt32LE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},Buffer.prototype.writeUint32BE=Buffer.prototype.writeUInt32BE=function writeUInt32BE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeIntLE=function writeIntLE(e,t,a,r){if(e=+e,t>>>=0,!r){var n=Math.pow(2,8*a-1);checkInt(this,e,t,a,n-1,-n)}var o=0,c=1,d=0;for(this[t]=255&e;++o>0)-d&255;return t+a},Buffer.prototype.writeIntBE=function writeIntBE(e,t,a,r){if(e=+e,t>>>=0,!r){var n=Math.pow(2,8*a-1);checkInt(this,e,t,a,n-1,-n)}var o=a-1,c=1,d=0;for(this[t+o]=255&e;--o>=0&&(c*=256);)e<0&&0===d&&0!==this[t+o+1]&&(d=1),this[t+o]=(e/c>>0)-d&255;return t+a},Buffer.prototype.writeInt8=function writeInt8(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},Buffer.prototype.writeInt16LE=function writeInt16LE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeInt16BE=function writeInt16BE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeInt32LE=function writeInt32LE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},Buffer.prototype.writeInt32BE=function writeInt32BE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeFloatLE=function writeFloatLE(e,t,a){return writeFloat(this,e,t,!0,a)},Buffer.prototype.writeFloatBE=function writeFloatBE(e,t,a){return writeFloat(this,e,t,!1,a)},Buffer.prototype.writeDoubleLE=function writeDoubleLE(e,t,a){return writeDouble(this,e,t,!0,a)},Buffer.prototype.writeDoubleBE=function writeDoubleBE(e,t,a){return writeDouble(this,e,t,!1,a)},Buffer.prototype.copy=function copy(e,t,a,r){if(!Buffer.isBuffer(e))throw new TypeError("argument should be a Buffer");if(a||(a=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,a=void 0===a?this.length:a>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&a<57344){if(!n){if(a>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(c+1===r){(t-=3)>-1&&o.push(239,191,189);continue}n=a;continue}if(a<56320){(t-=3)>-1&&o.push(239,191,189),n=a;continue}a=65536+(n-55296<<10|a-56320)}else n&&(t-=3)>-1&&o.push(239,191,189);if(n=null,a<128){if((t-=1)<0)break;o.push(a)}else if(a<2048){if((t-=2)<0)break;o.push(a>>6|192,63&a|128)}else if(a<65536){if((t-=3)<0)break;o.push(a>>12|224,a>>6&63|128,63&a|128)}else{if(!(a<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(a>>18|240,a>>12&63|128,a>>6&63|128,63&a|128)}}return o}function base64ToBytes(e){return r.toByteArray(function base64clean(e){if((e=(e=e.split("=")[0]).trim().replace(s,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function blitBuffer(e,t,a,r){for(var n=0;n=t.length||n>=e.length);++n)t[n+a]=e[n];return n}function isInstance(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function numberIsNaN(e){return e!=e}var b=function(){for(var e="0123456789abcdef",t=new Array(256),a=0;a<16;++a)for(var r=16*a,n=0;n<16;++n)t[r+n]=e[a]+e[n];return t}()},e=>{"function"==typeof Object.create?e.exports=function inherits(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function inherits(e,t){if(t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype,e.prototype=new TempCtor,e.prototype.constructor=e}}},(e,t,a)=>{"use strict";var r=a(1481),n=a(1482),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=Buffer,t.SlowBuffer=function SlowBuffer(e){+e!=e&&(e=0);return Buffer.alloc(+e)},t.INSPECT_MAX_BYTES=50;var c=2147483647;function createBuffer(e){if(e>c)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,Buffer.prototype),t}function Buffer(e,t,a){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(e)}return from(e,t,a)}function from(e,t,a){if("string"==typeof e)return function fromString(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!Buffer.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var a=0|byteLength(e,t),r=createBuffer(a),n=r.write(e,t);n!==a&&(r=r.slice(0,n));return r}(e,t);if(ArrayBuffer.isView(e))return function fromArrayView(e){if(isInstance(e,Uint8Array)){var t=new Uint8Array(e);return fromArrayBuffer(t.buffer,t.byteOffset,t.byteLength)}return fromArrayLike(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(isInstance(e,ArrayBuffer)||e&&isInstance(e.buffer,ArrayBuffer))return fromArrayBuffer(e,t,a);if("undefined"!=typeof SharedArrayBuffer&&(isInstance(e,SharedArrayBuffer)||e&&isInstance(e.buffer,SharedArrayBuffer)))return fromArrayBuffer(e,t,a);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return Buffer.from(r,t,a);var n=function fromObject(e){if(Buffer.isBuffer(e)){var t=0|checked(e.length),a=createBuffer(t);return 0===a.length||e.copy(a,0,0,t),a}if(void 0!==e.length)return"number"!=typeof e.length||numberIsNaN(e.length)?createBuffer(0):fromArrayLike(e);if("Buffer"===e.type&&Array.isArray(e.data))return fromArrayLike(e.data)}(e);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return Buffer.from(e[Symbol.toPrimitive]("string"),t,a);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function assertSize(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function allocUnsafe(e){return assertSize(e),createBuffer(e<0?0:0|checked(e))}function fromArrayLike(e){for(var t=e.length<0?0:0|checked(e.length),a=createBuffer(t),r=0;r=c)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+c.toString(16)+" bytes");return 0|e}function byteLength(e,t){if(Buffer.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||isInstance(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var a=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===a)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return a;case"utf8":case"utf-8":return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*a;case"hex":return a>>>1;case"base64":return base64ToBytes(e).length;default:if(n)return r?-1:utf8ToBytes(e).length;t=(""+t).toLowerCase(),n=!0}}function slowToString(e,t,a){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===a||a>this.length)&&(a=this.length),a<=0)return"";if((a>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return hexSlice(this,t,a);case"utf8":case"utf-8":return utf8Slice(this,t,a);case"ascii":return asciiSlice(this,t,a);case"latin1":case"binary":return latin1Slice(this,t,a);case"base64":return base64Slice(this,t,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,t,a);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function swap(e,t,a){var r=e[t];e[t]=e[a],e[a]=r}function bidirectionalIndexOf(e,t,a,r,n){if(0===e.length)return-1;if("string"==typeof a?(r=a,a=0):a>2147483647?a=2147483647:a<-2147483648&&(a=-2147483648),numberIsNaN(a=+a)&&(a=n?0:e.length-1),a<0&&(a=e.length+a),a>=e.length){if(n)return-1;a=e.length-1}else if(a<0){if(!n)return-1;a=0}if("string"==typeof t&&(t=Buffer.from(t,r)),Buffer.isBuffer(t))return 0===t.length?-1:arrayIndexOf(e,t,a,r,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,a):Uint8Array.prototype.lastIndexOf.call(e,t,a):arrayIndexOf(e,[t],a,r,n);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(e,t,a,r,n){var o,c=1,d=e.length,s=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;c=2,d/=2,s/=2,a/=2}function read(e,t){return 1===c?e[t]:e.readUInt16BE(t*c)}if(n){var b=-1;for(o=a;od&&(a=d-s),o=a;o>=0;o--){for(var u=!0,h=0;hn&&(r=n):r=n;var o=t.length;r>o/2&&(r=o/2);for(var c=0;c>8,n=a%256,o.push(n),o.push(r);return o}(t,e.length-a),e,a,r)}function base64Slice(e,t,a){return 0===t&&a===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,a))}function utf8Slice(e,t,a){a=Math.min(e.length,a);for(var r=[],n=t;n239?4:u>223?3:u>191?2:1;if(n+l<=a)switch(l){case 1:u<128&&(h=u);break;case 2:128==(192&(o=e[n+1]))&&(b=(31&u)<<6|63&o)>127&&(h=b);break;case 3:o=e[n+1],c=e[n+2],128==(192&o)&&128==(192&c)&&(b=(15&u)<<12|(63&o)<<6|63&c)>2047&&(b<55296||b>57343)&&(h=b);break;case 4:o=e[n+1],c=e[n+2],s=e[n+3],128==(192&o)&&128==(192&c)&&128==(192&s)&&(b=(15&u)<<18|(63&o)<<12|(63&c)<<6|63&s)>65535&&b<1114112&&(h=b)}null===h?(h=65533,l=1):h>65535&&(h-=65536,r.push(h>>>10&1023|55296),h=56320|1023&h),r.push(h),n+=l}return function decodeCodePointsArray(e){var t=e.length;if(t<=d)return String.fromCharCode.apply(String,e);var a="",r=0;for(;rr.length?Buffer.from(o).copy(r,n):Uint8Array.prototype.set.call(r,o,n);else{if(!Buffer.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,n)}n+=o.length}return r},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function swap16(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;ta&&(e+=" ... "),""},o&&(Buffer.prototype[o]=Buffer.prototype.inspect),Buffer.prototype.compare=function compare(e,t,a,r,n){if(isInstance(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),!Buffer.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===a&&(a=e?e.length:0),void 0===r&&(r=0),void 0===n&&(n=this.length),t<0||a>e.length||r<0||n>this.length)throw new RangeError("out of range index");if(r>=n&&t>=a)return 0;if(r>=n)return-1;if(t>=a)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(r>>>=0),c=(a>>>=0)-(t>>>=0),d=Math.min(o,c),s=this.slice(r,n),b=e.slice(t,a),u=0;u>>=0,isFinite(a)?(a>>>=0,void 0===r&&(r="utf8")):(r=a,a=void 0)}var n=this.length-t;if((void 0===a||a>n)&&(a=n),e.length>0&&(a<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return hexWrite(this,e,t,a);case"utf8":case"utf-8":return utf8Write(this,e,t,a);case"ascii":case"latin1":case"binary":return asciiWrite(this,e,t,a);case"base64":return base64Write(this,e,t,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,e,t,a);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var d=4096;function asciiSlice(e,t,a){var r="";a=Math.min(e.length,a);for(var n=t;nr)&&(a=r);for(var n="",o=t;oa)throw new RangeError("Trying to access beyond buffer length")}function checkInt(e,t,a,r,n,o){if(!Buffer.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||te.length)throw new RangeError("Index out of range")}function checkIEEE754(e,t,a,r,n,o){if(a+r>e.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("Index out of range")}function writeFloat(e,t,a,r,o){return t=+t,a>>>=0,o||checkIEEE754(e,0,a,4),n.write(e,t,a,r,23,4),a+4}function writeDouble(e,t,a,r,o){return t=+t,a>>>=0,o||checkIEEE754(e,0,a,8),n.write(e,t,a,r,52,8),a+8}Buffer.prototype.slice=function slice(e,t){var a=this.length;(e=~~e)<0?(e+=a)<0&&(e=0):e>a&&(e=a),(t=void 0===t?a:~~t)<0?(t+=a)<0&&(t=0):t>a&&(t=a),t>>=0,t>>>=0,a||checkOffset(e,t,this.length);for(var r=this[e],n=1,o=0;++o>>=0,t>>>=0,a||checkOffset(e,t,this.length);for(var r=this[e+--t],n=1;t>0&&(n*=256);)r+=this[e+--t]*n;return r},Buffer.prototype.readUint8=Buffer.prototype.readUInt8=function readUInt8(e,t){return e>>>=0,t||checkOffset(e,1,this.length),this[e]},Buffer.prototype.readUint16LE=Buffer.prototype.readUInt16LE=function readUInt16LE(e,t){return e>>>=0,t||checkOffset(e,2,this.length),this[e]|this[e+1]<<8},Buffer.prototype.readUint16BE=Buffer.prototype.readUInt16BE=function readUInt16BE(e,t){return e>>>=0,t||checkOffset(e,2,this.length),this[e]<<8|this[e+1]},Buffer.prototype.readUint32LE=Buffer.prototype.readUInt32LE=function readUInt32LE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Buffer.prototype.readUint32BE=Buffer.prototype.readUInt32BE=function readUInt32BE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Buffer.prototype.readIntLE=function readIntLE(e,t,a){e>>>=0,t>>>=0,a||checkOffset(e,t,this.length);for(var r=this[e],n=1,o=0;++o=(n*=128)&&(r-=Math.pow(2,8*t)),r},Buffer.prototype.readIntBE=function readIntBE(e,t,a){e>>>=0,t>>>=0,a||checkOffset(e,t,this.length);for(var r=t,n=1,o=this[e+--r];r>0&&(n*=256);)o+=this[e+--r]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*t)),o},Buffer.prototype.readInt8=function readInt8(e,t){return e>>>=0,t||checkOffset(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Buffer.prototype.readInt16LE=function readInt16LE(e,t){e>>>=0,t||checkOffset(e,2,this.length);var a=this[e]|this[e+1]<<8;return 32768&a?4294901760|a:a},Buffer.prototype.readInt16BE=function readInt16BE(e,t){e>>>=0,t||checkOffset(e,2,this.length);var a=this[e+1]|this[e]<<8;return 32768&a?4294901760|a:a},Buffer.prototype.readInt32LE=function readInt32LE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Buffer.prototype.readInt32BE=function readInt32BE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Buffer.prototype.readFloatLE=function readFloatLE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),n.read(this,e,!0,23,4)},Buffer.prototype.readFloatBE=function readFloatBE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),n.read(this,e,!1,23,4)},Buffer.prototype.readDoubleLE=function readDoubleLE(e,t){return e>>>=0,t||checkOffset(e,8,this.length),n.read(this,e,!0,52,8)},Buffer.prototype.readDoubleBE=function readDoubleBE(e,t){return e>>>=0,t||checkOffset(e,8,this.length),n.read(this,e,!1,52,8)},Buffer.prototype.writeUintLE=Buffer.prototype.writeUIntLE=function writeUIntLE(e,t,a,r){(e=+e,t>>>=0,a>>>=0,r)||checkInt(this,e,t,a,Math.pow(2,8*a)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,a>>>=0,r)||checkInt(this,e,t,a,Math.pow(2,8*a)-1,0);var n=a-1,o=1;for(this[t+n]=255&e;--n>=0&&(o*=256);)this[t+n]=e/o&255;return t+a},Buffer.prototype.writeUint8=Buffer.prototype.writeUInt8=function writeUInt8(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,1,255,0),this[t]=255&e,t+1},Buffer.prototype.writeUint16LE=Buffer.prototype.writeUInt16LE=function writeUInt16LE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeUint16BE=Buffer.prototype.writeUInt16BE=function writeUInt16BE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeUint32LE=Buffer.prototype.writeUInt32LE=function writeUInt32LE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},Buffer.prototype.writeUint32BE=Buffer.prototype.writeUInt32BE=function writeUInt32BE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeIntLE=function writeIntLE(e,t,a,r){if(e=+e,t>>>=0,!r){var n=Math.pow(2,8*a-1);checkInt(this,e,t,a,n-1,-n)}var o=0,c=1,d=0;for(this[t]=255&e;++o>0)-d&255;return t+a},Buffer.prototype.writeIntBE=function writeIntBE(e,t,a,r){if(e=+e,t>>>=0,!r){var n=Math.pow(2,8*a-1);checkInt(this,e,t,a,n-1,-n)}var o=a-1,c=1,d=0;for(this[t+o]=255&e;--o>=0&&(c*=256);)e<0&&0===d&&0!==this[t+o+1]&&(d=1),this[t+o]=(e/c>>0)-d&255;return t+a},Buffer.prototype.writeInt8=function writeInt8(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},Buffer.prototype.writeInt16LE=function writeInt16LE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeInt16BE=function writeInt16BE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeInt32LE=function writeInt32LE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},Buffer.prototype.writeInt32BE=function writeInt32BE(e,t,a){return e=+e,t>>>=0,a||checkInt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeFloatLE=function writeFloatLE(e,t,a){return writeFloat(this,e,t,!0,a)},Buffer.prototype.writeFloatBE=function writeFloatBE(e,t,a){return writeFloat(this,e,t,!1,a)},Buffer.prototype.writeDoubleLE=function writeDoubleLE(e,t,a){return writeDouble(this,e,t,!0,a)},Buffer.prototype.writeDoubleBE=function writeDoubleBE(e,t,a){return writeDouble(this,e,t,!1,a)},Buffer.prototype.copy=function copy(e,t,a,r){if(!Buffer.isBuffer(e))throw new TypeError("argument should be a Buffer");if(a||(a=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,a=void 0===a?this.length:a>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&a<57344){if(!n){if(a>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(c+1===r){(t-=3)>-1&&o.push(239,191,189);continue}n=a;continue}if(a<56320){(t-=3)>-1&&o.push(239,191,189),n=a;continue}a=65536+(n-55296<<10|a-56320)}else n&&(t-=3)>-1&&o.push(239,191,189);if(n=null,a<128){if((t-=1)<0)break;o.push(a)}else if(a<2048){if((t-=2)<0)break;o.push(a>>6|192,63&a|128)}else if(a<65536){if((t-=3)<0)break;o.push(a>>12|224,a>>6&63|128,63&a|128)}else{if(!(a<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(a>>18|240,a>>12&63|128,a>>6&63|128,63&a|128)}}return o}function base64ToBytes(e){return r.toByteArray(function base64clean(e){if((e=(e=e.split("=")[0]).trim().replace(s,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function blitBuffer(e,t,a,r){for(var n=0;n=t.length||n>=e.length);++n)t[n+a]=e[n];return n}function isInstance(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function numberIsNaN(e){return e!=e}var b=function(){for(var e="0123456789abcdef",t=new Array(256),a=0;a<16;++a)for(var r=16*a,n=0;n<16;++n)t[r+n]=e[a]+e[n];return t}()},(e,t,a)=>{"use strict";var r,n=SyntaxError,o=Function,c=TypeError,getEvalledConstructor=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(e){}},d=Object.getOwnPropertyDescriptor;if(d)try{d({},"")}catch(e){d=null}var throwTypeError=function(){throw new c},s=d?function(){try{return throwTypeError}catch(e){try{return d(arguments,"callee").get}catch(e){return throwTypeError}}}():throwTypeError,b=a(315)(),u=Object.getPrototypeOf||function(e){return e.__proto__},h={},l="undefined"==typeof Uint8Array?r:u(Uint8Array),g={"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":b?u([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":h,"%AsyncGenerator%":h,"%AsyncGeneratorFunction%":h,"%AsyncIteratorPrototype%":h,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":h,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":b?u(u([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&b?u((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&b?u((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":b?u(""[Symbol.iterator]()):r,"%Symbol%":b?Symbol:r,"%SyntaxError%":n,"%ThrowTypeError%":s,"%TypedArray%":l,"%TypeError%":c,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet},p=function doEval(e){var t;if("%AsyncFunction%"===e)t=getEvalledConstructor("async function () {}");else if("%GeneratorFunction%"===e)t=getEvalledConstructor("function* () {}");else if("%AsyncGeneratorFunction%"===e)t=getEvalledConstructor("async function* () {}");else if("%AsyncGenerator%"===e){var a=doEval("%AsyncGeneratorFunction%");a&&(t=a.prototype)}else if("%AsyncIteratorPrototype%"===e){var r=doEval("%AsyncGenerator%");r&&(t=u(r.prototype))}return g[e]=t,t},B={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},x=a(314),m=a(96),I=x.call(Function.call,Array.prototype.concat),y=x.call(Function.apply,Array.prototype.splice),C=x.call(Function.call,String.prototype.replace),w=x.call(Function.call,String.prototype.slice),v=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Q=/\\(\\)?/g,_=function stringToPath(e){var t=w(e,0,1),a=w(e,-1);if("%"===t&&"%"!==a)throw new n("invalid intrinsic syntax, expected closing `%`");if("%"===a&&"%"!==t)throw new n("invalid intrinsic syntax, expected opening `%`");var r=[];return C(e,v,(function(e,t,a,n){r[r.length]=a?C(n,Q,"$1"):t||e})),r},k=function getBaseIntrinsic(e,t){var a,r=e;if(m(B,r)&&(r="%"+(a=B[r])[0]+"%"),m(g,r)){var o=g[r];if(o===h&&(o=p(r)),void 0===o&&!t)throw new c("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:a,name:r,value:o}}throw new n("intrinsic "+e+" does not exist!")};e.exports=function GetIntrinsic(e,t){if("string"!=typeof e||0===e.length)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new c('"allowMissing" argument must be a boolean');var a=_(e),r=a.length>0?a[0]:"",o=k("%"+r+"%",t),s=o.name,b=o.value,u=!1,h=o.alias;h&&(r=h[0],y(a,I([0,1],h)));for(var l=1,p=!0;l=a.length){var v=d(b,B);b=(p=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:b[B]}else p=m(b,B),b=b[B];p&&!u&&(g[s]=b)}}return b}},function(e,t,a){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a);var n=Object.getOwnPropertyDescriptor(t,a);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,r,n)}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),n=this&&this.__exportStar||function(e,t){for(var a in e)"default"===a||Object.prototype.hasOwnProperty.call(t,a)||r(t,e,a)};Object.defineProperty(t,"__esModule",{value:!0}),n(a(605),t)},e=>{"use strict";var t,a="object"==typeof Reflect?Reflect:null,r=a&&"function"==typeof a.apply?a.apply:function ReflectApply(e,t,a){return Function.prototype.apply.call(e,t,a)};t=a&&"function"==typeof a.ownKeys?a.ownKeys:Object.getOwnPropertySymbols?function ReflectOwnKeys(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function ReflectOwnKeys(e){return Object.getOwnPropertyNames(e)};var n=Number.isNaN||function NumberIsNaN(e){return e!=e};function EventEmitter(){EventEmitter.init.call(this)}e.exports=EventEmitter,e.exports.once=function once(e,t){return new Promise((function(a,r){function errorListener(a){e.removeListener(t,resolver),r(a)}function resolver(){"function"==typeof e.removeListener&&e.removeListener("error",errorListener),a([].slice.call(arguments))}eventTargetAgnosticAddListener(e,t,resolver,{once:!0}),"error"!==t&&function addErrorHandlerIfEventEmitter(e,t,a){"function"==typeof e.on&&eventTargetAgnosticAddListener(e,"error",t,a)}(e,errorListener,{once:!0})}))},EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._eventsCount=0,EventEmitter.prototype._maxListeners=void 0;var o=10;function checkListener(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function _getMaxListeners(e){return void 0===e._maxListeners?EventEmitter.defaultMaxListeners:e._maxListeners}function _addListener(e,t,a,r){var n,o,c;if(checkListener(a),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,a.listener?a.listener:a),o=e._events),c=o[t]),void 0===c)c=o[t]=a,++e._eventsCount;else if("function"==typeof c?c=o[t]=r?[a,c]:[c,a]:r?c.unshift(a):c.push(a),(n=_getMaxListeners(e))>0&&c.length>n&&!c.warned){c.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=c.length,function ProcessEmitWarning(e){console&&console.warn&&console.warn(e)}(d)}return e}function onceWrapper(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _onceWrap(e,t,a){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:a},n=onceWrapper.bind(r);return n.listener=a,r.wrapFn=n,n}function _listeners(e,t,a){var r=e._events;if(void 0===r)return[];var n=r[t];return void 0===n?[]:"function"==typeof n?a?[n.listener||n]:[n]:a?function unwrapListeners(e){for(var t=new Array(e.length),a=0;a0&&(c=t[0]),c instanceof Error)throw c;var d=new Error("Unhandled error."+(c?" ("+c.message+")":""));throw d.context=c,d}var s=o[e];if(void 0===s)return!1;if("function"==typeof s)r(s,this,t);else{var b=s.length,u=arrayClone(s,b);for(a=0;a=0;o--)if(a[o]===t||a[o].listener===t){c=a[o].listener,n=o;break}if(n<0)return this;0===n?a.shift():function spliceOne(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},EventEmitter.prototype.listeners=function listeners(e){return _listeners(this,e,!0)},EventEmitter.prototype.rawListeners=function rawListeners(e){return _listeners(this,e,!1)},EventEmitter.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):listenerCount.call(e,t)},EventEmitter.prototype.listenerCount=listenerCount,EventEmitter.prototype.eventNames=function eventNames(){return this._eventsCount>0?t(this._events):[]}},function(e,t,a){"use strict";var r=a(0).Buffer,n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,a=1,r=arguments.length;a0&&n[n.length-1])||6!==o[0]&&2!==o[0])){c=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]this._vm._common.param("vm","maxInitCodeSize")?[2,{gasUsed:e.gasLimit,createdAddress:e.to,execResult:{returnValue:r.alloc(0),exceptionError:new p.VmError(p.ERROR.INITCODE_SIZE_VIOLATION),gasUsed:e.gasLimit}}]:(e.code=e.data,e.data=r.alloc(0),a=e,[4,this._generateAddress(e)]);case 3:return a.to=b.sent(),this._vm.DEBUG&&C("Generated CREATE contract address ".concat(e.to)),[4,this._state.getAccount(e.to)];case 4:return(o=b.sent()).nonce&&o.nonce.gtn(0)||!o.codeHash.equals(l.KECCAK256_NULL)?(this._vm.DEBUG&&C("Returning on address collision"),[2,{gasUsed:e.gasLimit,createdAddress:e.to,execResult:{returnValue:r.alloc(0),exceptionError:new p.VmError(p.ERROR.CREATE_COLLISION),gasUsed:e.gasLimit}}]):[4,this._state.clearContractStorage(e.to)];case 5:return b.sent(),c={address:e.to,code:e.code},[4,this._vm._emit("newContract",c)];case 6:return b.sent(),[4,this._state.getAccount(e.to)];case 7:o=b.sent(),this._vm._common.gteHardfork("spuriousDragon")&&o.nonce.iaddn(1),b.label=8;case 8:return b.trys.push([8,10,,11]),[4,this._addToBalance(o,e)];case 9:return b.sent(),[3,11];case 10:return s=b.sent(),d=s,[3,11];case 11:return u=!1,e.code&&0!==e.code.length||(u=!0,this._vm.DEBUG&&C("Exit early on no code")),d&&(u=!0,this._vm.DEBUG&&C("Exit early on value transfer overflowed")),u?[2,{gasUsed:new l.BN(0),createdAddress:e.to,execResult:{gasUsed:new l.BN(0),exceptionError:d,returnValue:r.alloc(0)}}]:(this._vm.DEBUG&&C("Start bytecode processing..."),[4,this.runInterpreter(e)]);case 12:return h=b.sent(),g=h.gasUsed,B=new l.BN(0),h.exceptionError||(B=new l.BN(h.returnValue.length).imuln(this._vm._common.param("gasPrices","createData")),g=g.add(B),this._vm.DEBUG&&w("Add return value size fee (".concat(B," to gas used (-> ").concat(g,"))"))),x=!0,!h.exceptionError&&this._vm._common.gteHardfork("spuriousDragon")&&h.returnValue.length>this._vm._common.param("vm","maxCodeSize")&&(x=!1),I=!1,g.lte(e.gasLimit)&&(this._vm._allowUnlimitedContractSize||x)?this._vm._common.isActivatedEIP(3541)&&h.returnValue[0]===m.FORMAT?(this._vm._common.isActivatedEIP(3540)||(h=n(n({},h),INVALID_BYTECODE_RESULT(e.gasLimit))),(null==(y=m.codeAnalysis(h.returnValue))?void 0:y.code)?this._vm._common.isActivatedEIP(3670)&&(v=y.data>0?10:7,m.validOpcodes(h.returnValue.slice(v,v+y.code))?h.gasUsed=g:h=n(n({},h),INVALID_EOF_RESULT(e.gasLimit))):h=n(n({},h),INVALID_EOF_RESULT(e.gasLimit))):h.gasUsed=g:this._vm._common.gteHardfork("homestead")?(this._vm.DEBUG&&C("Not enough gas or code size not allowed (>= Homestead)"),h=n(n({},h),OOGResult(e.gasLimit))):(this._vm.DEBUG&&C("Not enough gas or code size not allowed (Frontier)"),g.sub(B).lte(e.gasLimit)?(h=n(n({},h),COOGResult(g.sub(B))),I=!0):h=n(n({},h),OOGResult(e.gasLimit))),h.exceptionError||!h.returnValue||""===h.returnValue.toString()?[3,14]:[4,this._state.putContractCode(e.to,h.returnValue)];case 13:return b.sent(),this._vm.DEBUG&&C("Code saved on new contract creation"),[3,17];case 14:return I?this._vm._common.gteHardfork("homestead")?[3,17]:[4,this._state.getAccount(e.to)]:[3,17];case 15:return Q=b.sent(),[4,this._state.putAccount(e.to,Q)];case 16:b.sent(),b.label=17;case 17:return[2,{gasUsed:h.gasUsed,createdAddress:e.to,execResult:h}]}}))}))},EVM.prototype.runInterpreter=function(e,t){return void 0===t&&(t={}),s(this,void 0,void 0,(function(){var a,o,c,d,s,u;return b(this,(function(b){switch(b.label){case 0:return u={blockchain:this._vm.blockchain,address:e.to||l.Address.zero(),caller:e.caller||l.Address.zero(),callData:e.data||r.from([0]),callValue:e.value||new l.BN(0),code:e.code,isStatic:e.isStatic||!1,depth:e.depth||0,gasPrice:this._tx.gasPrice,origin:this._tx.origin||e.caller||l.Address.zero(),block:this._block||new g.Block},[4,this._state.getAccount(e.to||l.Address.zero())];case 1:return u.contract=b.sent(),u.codeAddress=e.codeAddress,a=u,o=new B.default(a,this._state,this,this._vm._common,e.gasLimit.clone(),this._transientStorage),e.selfdestruct&&(o._result.selfdestruct=e.selfdestruct),[4,new I.default(this._vm,o).run(e.code,t)];case 2:return c=b.sent(),d=o._result,s=e.gasLimit.sub(o._gasLeft),c.exceptionError&&(c.exceptionError.error!==p.ERROR.REVERT&&c.exceptionError.error!==p.ERROR.INVALID_EOF_FORMAT&&(s=e.gasLimit),d=n(n({},d),{logs:[],selfdestruct:{}})),[2,n(n({},d),{runState:n(n(n({},c.runState),d),o._env),exceptionError:c.exceptionError,gas:o._gasLeft,gasUsed:s,returnValue:d.returnValue?d.returnValue:r.alloc(0)})]}}))}))},EVM.prototype.getPrecompile=function(e){return this._vm.precompiles.get(e.buf.toString("hex"))},EVM.prototype.runPrecompile=function(e,t,a){if("function"!=typeof e)throw new Error("Invalid precompile");return e({data:t,gasLimit:a,_common:this._vm._common,_VM:this._vm})},EVM.prototype._loadCode=function(e){return s(this,void 0,void 0,(function(){var t,a;return b(this,(function(r){switch(r.label){case 0:return e.code?[3,3]:(t=this.getPrecompile(e.codeAddress))?(e.code=t,e.isCompiled=!0,[3,3]):[3,1];case 1:return a=e,[4,this._state.getContractCode(e.codeAddress)];case 2:a.code=r.sent(),e.isCompiled=!1,r.label=3;case 3:return[2]}}))}))},EVM.prototype._generateAddress=function(e){return s(this,void 0,void 0,(function(){var t,a,n;return b(this,(function(o){switch(o.label){case 0:return e.salt?(t=(0,l.generateAddress2)(e.caller.buf,e.salt,e.code),[3,3]):[3,1];case 1:return[4,this._state.getAccount(e.caller)];case 2:a=o.sent(),n=a.nonce.subn(1),t=(0,l.generateAddress)(e.caller.buf,n.toArrayLike(r)),o.label=3;case 3:return[2,new l.Address(t)]}}))}))},EVM.prototype._reduceSenderBalance=function(e,t){return s(this,void 0,void 0,(function(){var a;return b(this,(function(r){return e.balance.isub(t.value),a=this._state.putAccount(t.caller,e),this._vm.DEBUG&&C("Reduced sender (".concat(t.caller,") balance (-> ").concat(e.balance,")")),[2,a]}))}))},EVM.prototype._addToBalance=function(e,t){return s(this,void 0,void 0,(function(){var a,r;return b(this,(function(n){if((a=e.balance.add(t.value)).gt(l.MAX_INTEGER))throw new p.VmError(p.ERROR.VALUE_OVERFLOW);return e.balance=a,r=this._state.putAccount(t.to,e),this._vm.DEBUG&&C("Added toAccount (".concat(t.to,") balance (-> ").concat(e.balance,")")),[2,r]}))}))},EVM.prototype._touchAccount=function(e){return s(this,void 0,void 0,(function(){var t;return b(this,(function(a){switch(a.label){case 0:return[4,this._state.getAccount(e)];case 1:return t=a.sent(),[2,this._state.putAccount(e,t)]}}))}))},EVM}();t.default=v},e=>{"function"==typeof Object.create?e.exports=function inherits(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function inherits(e,t){if(t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype,e.prototype=new TempCtor,e.prototype.constructor=e}}},e=>{"function"==typeof Object.create?e.exports=function inherits(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function inherits(e,t){if(t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype,e.prototype=new TempCtor,e.prototype.constructor=e}}},e=>{"function"==typeof Object.create?e.exports=function inherits(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function inherits(e,t){if(t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype,e.prototype=new TempCtor,e.prototype.constructor=e}}},e=>{"function"==typeof Object.create?e.exports=function inherits(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function inherits(e,t){if(t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype,e.prototype=new TempCtor,e.prototype.constructor=e}}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VmError=t.ERROR=void 0,function(e){e.OUT_OF_GAS="out of gas",e.CODESTORE_OUT_OF_GAS="code store out of gas",e.STACK_UNDERFLOW="stack underflow",e.STACK_OVERFLOW="stack overflow",e.INVALID_JUMP="invalid JUMP",e.INVALID_OPCODE="invalid opcode",e.OUT_OF_RANGE="value out of range",e.REVERT="revert",e.STATIC_STATE_CHANGE="static state change",e.INTERNAL_ERROR="internal error",e.CREATE_COLLISION="create collision",e.STOP="stop",e.REFUND_EXHAUSTED="refund exhausted",e.VALUE_OVERFLOW="value overflow",e.INVALID_BEGINSUB="invalid BEGINSUB",e.INVALID_RETURNSUB="invalid RETURNSUB",e.INVALID_JUMPSUB="invalid JUMPSUB",e.INVALID_BYTECODE_RESULT="invalid bytecode deployed",e.INVALID_EOF_FORMAT="invalid EOF format",e.INITCODE_SIZE_VIOLATION="initcode exceeds max initcode size",e.BLS_12_381_INVALID_INPUT_LENGTH="invalid input length",e.BLS_12_381_POINT_NOT_ON_CURVE="point not on curve",e.BLS_12_381_INPUT_EMPTY="input is empty",e.BLS_12_381_FP_NOT_IN_FIELD="fp point not in field"}(t.ERROR||(t.ERROR={}));t.VmError=class VmError{constructor(e){this.error=e,this.errorType="VmError"}}},e=>{var t,a,r=e.exports={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(e){if(t===setTimeout)return setTimeout(e,0);if((t===defaultSetTimout||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(a){try{return t.call(null,e,0)}catch(a){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){t=defaultSetTimout}try{a="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){a=defaultClearTimeout}}();var n,o=[],c=!1,d=-1;function cleanUpNextTick(){c&&n&&(c=!1,n.length?o=n.concat(o):d=-1,o.length&&drainQueue())}function drainQueue(){if(!c){var e=runTimeout(cleanUpNextTick);c=!0;for(var t=o.length;t;){for(n=o,o=[];++d1)for(var a=1;athis._vm._common.param("vm","maxInitCodeSize"))return{gasUsed:e.gasLimit,createdAddress:e.to,execResult:{returnValue:r.alloc(0),exceptionError:new h.VmError(h.ERROR.INITCODE_SIZE_VIOLATION),gasUsed:e.gasLimit}};e.code=e.data,e.data=r.alloc(0),e.to=await this._generateAddress(e),this._vm.DEBUG&&m(`Generated CREATE contract address ${e.to}`);let a=await this._state.getAccount(e.to);if(a.nonce&&a.nonce.gtn(0)||!a.codeHash.equals(b.KECCAK256_NULL))return this._vm.DEBUG&&m("Returning on address collision"),{gasUsed:e.gasLimit,createdAddress:e.to,execResult:{returnValue:r.alloc(0),exceptionError:new h.VmError(h.ERROR.CREATE_COLLISION),gasUsed:e.gasLimit}};await this._state.clearContractStorage(e.to);const n={address:e.to,code:e.code};let o;await this._vm._emit("newContract",n),a=await this._state.getAccount(e.to),this._vm._common.gteHardfork("spuriousDragon")&&a.nonce.iaddn(1);try{await this._addToBalance(a,e)}catch(e){o=e}let c=!1;if(e.code&&0!==e.code.length||(c=!0,this._vm.DEBUG&&m("Exit early on no code")),o&&(c=!0,this._vm.DEBUG&&m("Exit early on value transfer overflowed")),c)return{gasUsed:new b.BN(0),createdAddress:e.to,execResult:{gasUsed:new b.BN(0),exceptionError:o,returnValue:r.alloc(0)}};this._vm.DEBUG&&m("Start bytecode processing...");let d=await this.runInterpreter(e),s=d.gasUsed,u=new b.BN(0);d.exceptionError||(u=new b.BN(d.returnValue.length).imuln(this._vm._common.param("gasPrices","createData")),s=s.add(u),this._vm.DEBUG&&I(`Add return value size fee (${u} to gas used (-> ${s}))`));let l=!0;!d.exceptionError&&this._vm._common.gteHardfork("spuriousDragon")&&d.returnValue.length>this._vm._common.param("vm","maxCodeSize")&&(l=!1);let g=!1;if(s.lte(e.gasLimit)&&(this._vm._allowUnlimitedContractSize||l))if(this._vm._common.isActivatedEIP(3541)&&d.returnValue[0]===p.FORMAT){this._vm._common.isActivatedEIP(3540)||(d=Object.assign(Object.assign({},d),INVALID_BYTECODE_RESULT(e.gasLimit)));const t=p.codeAnalysis(d.returnValue);if(null==t?void 0:t.code){if(this._vm._common.isActivatedEIP(3670)){const a=t.data>0?10:7;p.validOpcodes(d.returnValue.slice(a,a+t.code))?d.gasUsed=s:d=Object.assign(Object.assign({},d),INVALID_EOF_RESULT(e.gasLimit))}}else d=Object.assign(Object.assign({},d),INVALID_EOF_RESULT(e.gasLimit))}else d.gasUsed=s;else this._vm._common.gteHardfork("homestead")?(this._vm.DEBUG&&m("Not enough gas or code size not allowed (>= Homestead)"),d=Object.assign(Object.assign({},d),OOGResult(e.gasLimit))):(this._vm.DEBUG&&m("Not enough gas or code size not allowed (Frontier)"),s.sub(u).lte(e.gasLimit)?(d=Object.assign(Object.assign({},d),COOGResult(s.sub(u))),g=!0):d=Object.assign(Object.assign({},d),OOGResult(e.gasLimit)));if(!d.exceptionError&&d.returnValue&&""!==d.returnValue.toString())await this._state.putContractCode(e.to,d.returnValue),this._vm.DEBUG&&m("Code saved on new contract creation");else if(g&&!this._vm._common.gteHardfork("homestead")){const t=await this._state.getAccount(e.to);await this._state.putAccount(e.to,t)}return{gasUsed:d.gasUsed,createdAddress:e.to,execResult:d}}async runInterpreter(e,t={}){const a={blockchain:this._vm.blockchain,address:e.to||b.Address.zero(),caller:e.caller||b.Address.zero(),callData:e.data||r.from([0]),callValue:e.value||new b.BN(0),code:e.code,isStatic:e.isStatic||!1,depth:e.depth||0,gasPrice:this._tx.gasPrice,origin:this._tx.origin||e.caller||b.Address.zero(),block:this._block||new u.Block,contract:await this._state.getAccount(e.to||b.Address.zero()),codeAddress:e.codeAddress},n=new l.default(a,this._state,this,this._vm._common,e.gasLimit.clone(),this._transientStorage);e.selfdestruct&&(n._result.selfdestruct=e.selfdestruct);const o=new B.default(this._vm,n),c=await o.run(e.code,t);let d=n._result,s=e.gasLimit.sub(n._gasLeft);return c.exceptionError&&(c.exceptionError.error!==h.ERROR.REVERT&&c.exceptionError.error!==h.ERROR.INVALID_EOF_FORMAT&&(s=e.gasLimit),d=Object.assign(Object.assign({},d),{logs:[],selfdestruct:{}})),Object.assign(Object.assign({},d),{runState:Object.assign(Object.assign(Object.assign({},c.runState),d),n._env),exceptionError:c.exceptionError,gas:n._gasLeft,gasUsed:s,returnValue:d.returnValue?d.returnValue:r.alloc(0)})}getPrecompile(e){return this._vm.precompiles.get(e.buf.toString("hex"))}runPrecompile(e,t,a){if("function"!=typeof e)throw new Error("Invalid precompile");return e({data:t,gasLimit:a,_common:this._vm._common,_VM:this._vm})}async _loadCode(e){if(!e.code){const t=this.getPrecompile(e.codeAddress);t?(e.code=t,e.isCompiled=!0):(e.code=await this._state.getContractCode(e.codeAddress),e.isCompiled=!1)}}async _generateAddress(e){let t;if(e.salt)t=(0,b.generateAddress2)(e.caller.buf,e.salt,e.code);else{const a=(await this._state.getAccount(e.caller)).nonce.subn(1);t=(0,b.generateAddress)(e.caller.buf,a.toArrayLike(r))}return new b.Address(t)}async _reduceSenderBalance(e,t){e.balance.isub(t.value);const a=this._state.putAccount(t.caller,e);return this._vm.DEBUG&&m(`Reduced sender (${t.caller}) balance (-> ${e.balance})`),a}async _addToBalance(e,t){const a=e.balance.add(t.value);if(a.gt(b.MAX_INTEGER))throw new h.VmError(h.ERROR.VALUE_OVERFLOW);e.balance=a;const r=this._state.putAccount(t.to,e);return this._vm.DEBUG&&m(`Added toAccount (${t.to}) balance (-> ${e.balance})`),r}async _touchAccount(e){const t=await this._state.getAccount(e);return this._state.putAccount(e,t)}}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VmError=t.ERROR=void 0,function(e){e.OUT_OF_GAS="out of gas",e.CODESTORE_OUT_OF_GAS="code store out of gas",e.STACK_UNDERFLOW="stack underflow",e.STACK_OVERFLOW="stack overflow",e.INVALID_JUMP="invalid JUMP",e.INVALID_OPCODE="invalid opcode",e.OUT_OF_RANGE="value out of range",e.REVERT="revert",e.STATIC_STATE_CHANGE="static state change",e.INTERNAL_ERROR="internal error",e.CREATE_COLLISION="create collision",e.STOP="stop",e.REFUND_EXHAUSTED="refund exhausted",e.VALUE_OVERFLOW="value overflow",e.INVALID_BEGINSUB="invalid BEGINSUB",e.INVALID_RETURNSUB="invalid RETURNSUB",e.INVALID_JUMPSUB="invalid JUMPSUB",e.INVALID_BYTECODE_RESULT="invalid bytecode deployed",e.INVALID_EOF_FORMAT="invalid EOF format",e.INITCODE_SIZE_VIOLATION="initcode exceeds max initcode size",e.BLS_12_381_INVALID_INPUT_LENGTH="invalid input length",e.BLS_12_381_POINT_NOT_ON_CURVE="point not on curve",e.BLS_12_381_INPUT_EMPTY="input is empty",e.BLS_12_381_FP_NOT_IN_FIELD="fp point not in field"}(t.ERROR||(t.ERROR={}));var a=function a(e){this.error=e,this.errorType="VmError"};t.VmError=a},(e,t,a)=>{var r=a(0),n=r.Buffer;function copyProps(e,t){for(var a in e)t[a]=e[a]}function SafeBuffer(e,t,a){return n(e,t,a)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(copyProps(r,t),t.Buffer=SafeBuffer),SafeBuffer.prototype=Object.create(n.prototype),copyProps(n,SafeBuffer),SafeBuffer.from=function(e,t,a){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,a)},SafeBuffer.alloc=function(e,t,a){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=n(e);return void 0!==t?"string"==typeof a?r.fill(t,a):r.fill(t):r.fill(0),r},SafeBuffer.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},SafeBuffer.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Address=void 0;const r=a(5);class Address extends r.Data{constructor(e){super(e,Address.ByteLength)}static from(e){return new Address(e)}static toBuffer(e){return Address.from(e).toBuffer()}static toString(e){return Address.from(e).toString()}}t.Address=Address,Address.ByteLength=20},(e,t,a)=>{"use strict";var r=a(2).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.createDecipheriv=t.createCipheriv=t.randomBytes=t.pseudoRandomBytes=t.createHash=t.createHmac=t.scrypt=void 0;const n=a(226);Object.defineProperty(t,"createCipheriv",{enumerable:!0,get:function(){return n.createCipheriv}}),Object.defineProperty(t,"createDecipheriv",{enumerable:!0,get:function(){return n.createDecipheriv}});const o=a(719),scrypt=(e,t,a,n,c)=>{(0,o.scrypt)(r.from(e,"utf8"),r.from(t,"utf8"),n.N,n.r,n.p,a).then((e=>{c(null,r.from(e))})).catch((e=>c(e,void 0)))};t.scrypt=scrypt;const c=a(1419);Object.defineProperty(t,"createHmac",{enumerable:!0,get:function(){return c.createHmac}}),Object.defineProperty(t,"createHash",{enumerable:!0,get:function(){return c.createHash}}),Object.defineProperty(t,"pseudoRandomBytes",{enumerable:!0,get:function(){return c.pseudoRandomBytes}}),Object.defineProperty(t,"randomBytes",{enumerable:!0,get:function(){return c.randomBytes}}),t.default={scrypt,createHmac:c.createHmac,createHash:c.createHash,pseudoRandomBytes:c.pseudoRandomBytes,randomBytes:c.randomBytes,createCipheriv:n.createCipheriv,createDecipheriv:n.createDecipheriv}},e=>{"function"==typeof Object.create?e.exports=function inherits(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function inherits(e,t){if(t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype,e.prototype=new TempCtor,e.prototype.constructor=e}}},(e,t,a)=>{"use strict";var r=a(2).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.decode=t.encodeLength=t.encode=t.digest=t.encodeRange=t.getLength=void 0;const n=a(731);Object.defineProperty(t,"getLength",{enumerable:!0,get:function(){return n.getLength}});const o=a(5);function encode(e){if(Array.isArray(e)){let t=0;const a=[];for(let r=0,n=e.length;r{e.exports=function(e){return"function"==typeof e}},function(e,t,a){!function(e,t){"use strict";function assert(e,t){if(!e)throw new Error(t||"Assertion failed")}function inherits(e,t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype,e.prototype=new TempCtor,e.prototype.constructor=e}function BN(e,t,a){if(BN.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(a=t,t=10),this._init(e||0,t||10,a||"be"))}var r;"object"==typeof e?e.exports=BN:t.BN=BN,BN.BN=BN,BN.wordSize=26;try{r="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:a(1576).Buffer}catch(e){}function parseHex4Bits(e,t){var a=e.charCodeAt(t);return a>=65&&a<=70?a-55:a>=97&&a<=102?a-87:a-48&15}function parseHexByte(e,t,a){var r=parseHex4Bits(e,a);return a-1>=t&&(r|=parseHex4Bits(e,a-1)<<4),r}function parseBase(e,t,a,r){for(var n=0,o=Math.min(e.length,a),c=t;c=49?d-49+10:d>=17?d-17+10:d}return n}BN.isBN=function isBN(e){return e instanceof BN||null!==e&&"object"==typeof e&&e.constructor.wordSize===BN.wordSize&&Array.isArray(e.words)},BN.max=function max(e,t){return e.cmp(t)>0?e:t},BN.min=function min(e,t){return e.cmp(t)<0?e:t},BN.prototype._init=function init(e,t,a){if("number"==typeof e)return this._initNumber(e,t,a);if("object"==typeof e)return this._initArray(e,t,a);"hex"===t&&(t=16),assert(t===(0|t)&&t>=2&&t<=36);var r=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(r++,this.negative=1),r=0;r-=3)o=e[r]|e[r-1]<<8|e[r-2]<<16,this.words[n]|=o<>>26-c&67108863,(c+=24)>=26&&(c-=26,n++);else if("le"===a)for(r=0,n=0;r>>26-c&67108863,(c+=24)>=26&&(c-=26,n++);return this.strip()},BN.prototype._parseHex=function _parseHex(e,t,a){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)n=parseHexByte(e,t,r)<=18?(o-=18,c+=1,this.words[c]|=n>>>26):o+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(o-=18,c+=1,this.words[c]|=n>>>26):o+=8;this.strip()},BN.prototype._parseBase=function _parseBase(e,t,a){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var o=e.length-a,c=o%r,d=Math.min(o,o-c)+a,s=0,b=a;b1&&0===this.words[this.length-1];)this.length--;return this._normSign()},BN.prototype._normSign=function _normSign(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},BN.prototype.inspect=function inspect(){return(this.red?""};var n=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],o=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function smallMulTo(e,t,a){a.negative=t.negative^e.negative;var r=e.length+t.length|0;a.length=r,r=r-1|0;var n=0|e.words[0],o=0|t.words[0],c=n*o,d=67108863&c,s=c/67108864|0;a.words[0]=d;for(var b=1;b>>26,h=67108863&s,l=Math.min(b,t.length-1),g=Math.max(0,b-e.length+1);g<=l;g++){var p=b-g|0;u+=(c=(n=0|e.words[p])*(o=0|t.words[g])+h)/67108864|0,h=67108863&c}a.words[b]=0|h,s=0|u}return 0!==s?a.words[b]=0|s:a.length--,a.strip()}BN.prototype.toString=function toString(e,t){var a;if(t=0|t||1,16===(e=e||10)||"hex"===e){a="";for(var r=0,d=0,s=0;s>>24-r&16777215)||s!==this.length-1?n[6-u.length]+u+a:u+a,(r+=2)>=26&&(r-=26,s--)}for(0!==d&&(a=d.toString(16)+a);a.length%t!=0;)a="0"+a;return 0!==this.negative&&(a="-"+a),a}if(e===(0|e)&&e>=2&&e<=36){var h=o[e],l=c[e];a="";var g=this.clone();for(g.negative=0;!g.isZero();){var p=g.modn(l).toString(e);a=(g=g.idivn(l)).isZero()?p+a:n[h-p.length]+p+a}for(this.isZero()&&(a="0"+a);a.length%t!=0;)a="0"+a;return 0!==this.negative&&(a="-"+a),a}assert(!1,"Base should be between 2 and 36")},BN.prototype.toNumber=function toNumber(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&assert(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},BN.prototype.toJSON=function toJSON(){return this.toString(16)},BN.prototype.toBuffer=function toBuffer(e,t){return assert(void 0!==r),this.toArrayLike(r,e,t)},BN.prototype.toArray=function toArray(e,t){return this.toArrayLike(Array,e,t)},BN.prototype.toArrayLike=function toArrayLike(e,t,a){var r=this.byteLength(),n=a||Math.max(1,r);assert(r<=n,"byte array longer than desired length"),assert(n>0,"Requested array length <= 0"),this.strip();var o,c,d="le"===t,s=new e(n),b=this.clone();if(d){for(c=0;!b.isZero();c++)o=b.andln(255),b.iushrn(8),s[c]=o;for(;c=4096&&(a+=13,t>>>=13),t>=64&&(a+=7,t>>>=7),t>=8&&(a+=4,t>>>=4),t>=2&&(a+=2,t>>>=2),a+t},BN.prototype._zeroBits=function _zeroBits(e){if(0===e)return 26;var t=e,a=0;return 0==(8191&t)&&(a+=13,t>>>=13),0==(127&t)&&(a+=7,t>>>=7),0==(15&t)&&(a+=4,t>>>=4),0==(3&t)&&(a+=2,t>>>=2),0==(1&t)&&a++,a},BN.prototype.bitLength=function bitLength(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},BN.prototype.uor=function uor(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},BN.prototype.iuand=function iuand(e){var t;t=this.length>e.length?e:this;for(var a=0;ae.length?this.clone().iand(e):e.clone().iand(this)},BN.prototype.uand=function uand(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},BN.prototype.iuxor=function iuxor(e){var t,a;this.length>e.length?(t=this,a=e):(t=e,a=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},BN.prototype.uxor=function uxor(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},BN.prototype.inotn=function inotn(e){assert("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),a=e%26;this._expand(t),a>0&&t--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-a),this.strip()},BN.prototype.notn=function notn(e){return this.clone().inotn(e)},BN.prototype.setn=function setn(e,t){assert("number"==typeof e&&e>=0);var a=e/26|0,r=e%26;return this._expand(a+1),this.words[a]=t?this.words[a]|1<e.length?(a=this,r=e):(a=e,r=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=a.length,0!==n)this.words[this.length]=n,this.length++;else if(a!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},BN.prototype.isub=function isub(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var a,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(a=this,r=e):(a=e,r=this);for(var o=0,c=0;c>26,this.words[c]=67108863&t;for(;0!==o&&c>26,this.words[c]=67108863&t;if(0===o&&c>>13,g=0|c[1],p=8191&g,B=g>>>13,x=0|c[2],m=8191&x,I=x>>>13,y=0|c[3],C=8191&y,w=y>>>13,v=0|c[4],Q=8191&v,_=v>>>13,k=0|c[5],N=8191&k,D=k>>>13,G=0|c[6],T=8191&G,L=G>>>13,P=0|c[7],U=8191&P,q=P>>>13,O=0|c[8],H=8191&O,z=O>>>13,j=0|c[9],J=8191&j,Y=j>>>13,W=0|d[0],V=8191&W,X=W>>>13,$=0|d[1],et=8191&$,tt=$>>>13,at=0|d[2],rt=8191&at,it=at>>>13,nt=0|d[3],ot=8191&nt,ct=nt>>>13,dt=0|d[4],st=8191&dt,At=dt>>>13,bt=0|d[5],ut=8191&bt,ht=bt>>>13,pt=0|d[6],Bt=8191&pt,xt=pt>>>13,mt=0|d[7],It=8191&mt,Et=mt>>>13,yt=0|d[8],Ct=8191&yt,wt=yt>>>13,vt=0|d[9],Qt=8191&vt,Mt=vt>>>13;a.negative=e.negative^t.negative,a.length=19;var _t=(b+(r=Math.imul(h,V))|0)+((8191&(n=(n=Math.imul(h,X))+Math.imul(l,V)|0))<<13)|0;b=((o=Math.imul(l,X))+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(p,V),n=(n=Math.imul(p,X))+Math.imul(B,V)|0,o=Math.imul(B,X);var kt=(b+(r=r+Math.imul(h,et)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(l,et)|0))<<13)|0;b=((o=o+Math.imul(l,tt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(m,V),n=(n=Math.imul(m,X))+Math.imul(I,V)|0,o=Math.imul(I,X),r=r+Math.imul(p,et)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(B,et)|0,o=o+Math.imul(B,tt)|0;var St=(b+(r=r+Math.imul(h,rt)|0)|0)+((8191&(n=(n=n+Math.imul(h,it)|0)+Math.imul(l,rt)|0))<<13)|0;b=((o=o+Math.imul(l,it)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(C,V),n=(n=Math.imul(C,X))+Math.imul(w,V)|0,o=Math.imul(w,X),r=r+Math.imul(m,et)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(I,et)|0,o=o+Math.imul(I,tt)|0,r=r+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,it)|0;var Nt=(b+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,ct)|0)+Math.imul(l,ot)|0))<<13)|0;b=((o=o+Math.imul(l,ct)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,r=Math.imul(Q,V),n=(n=Math.imul(Q,X))+Math.imul(_,V)|0,o=Math.imul(_,X),r=r+Math.imul(C,et)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(w,et)|0,o=o+Math.imul(w,tt)|0,r=r+Math.imul(m,rt)|0,n=(n=n+Math.imul(m,it)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,it)|0,r=r+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,ct)|0;var Dt=(b+(r=r+Math.imul(h,st)|0)|0)+((8191&(n=(n=n+Math.imul(h,At)|0)+Math.imul(l,st)|0))<<13)|0;b=((o=o+Math.imul(l,At)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,r=Math.imul(N,V),n=(n=Math.imul(N,X))+Math.imul(D,V)|0,o=Math.imul(D,X),r=r+Math.imul(Q,et)|0,n=(n=n+Math.imul(Q,tt)|0)+Math.imul(_,et)|0,o=o+Math.imul(_,tt)|0,r=r+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(w,rt)|0,o=o+Math.imul(w,it)|0,r=r+Math.imul(m,ot)|0,n=(n=n+Math.imul(m,ct)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,ct)|0,r=r+Math.imul(p,st)|0,n=(n=n+Math.imul(p,At)|0)+Math.imul(B,st)|0,o=o+Math.imul(B,At)|0;var Rt=(b+(r=r+Math.imul(h,ut)|0)|0)+((8191&(n=(n=n+Math.imul(h,ht)|0)+Math.imul(l,ut)|0))<<13)|0;b=((o=o+Math.imul(l,ht)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(T,V),n=(n=Math.imul(T,X))+Math.imul(L,V)|0,o=Math.imul(L,X),r=r+Math.imul(N,et)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(D,et)|0,o=o+Math.imul(D,tt)|0,r=r+Math.imul(Q,rt)|0,n=(n=n+Math.imul(Q,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0,r=r+Math.imul(C,ot)|0,n=(n=n+Math.imul(C,ct)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,ct)|0,r=r+Math.imul(m,st)|0,n=(n=n+Math.imul(m,At)|0)+Math.imul(I,st)|0,o=o+Math.imul(I,At)|0,r=r+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ht)|0;var Ft=(b+(r=r+Math.imul(h,Bt)|0)|0)+((8191&(n=(n=n+Math.imul(h,xt)|0)+Math.imul(l,Bt)|0))<<13)|0;b=((o=o+Math.imul(l,xt)|0)+(n>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,r=Math.imul(U,V),n=(n=Math.imul(U,X))+Math.imul(q,V)|0,o=Math.imul(q,X),r=r+Math.imul(T,et)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(L,et)|0,o=o+Math.imul(L,tt)|0,r=r+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(D,rt)|0,o=o+Math.imul(D,it)|0,r=r+Math.imul(Q,ot)|0,n=(n=n+Math.imul(Q,ct)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,ct)|0,r=r+Math.imul(C,st)|0,n=(n=n+Math.imul(C,At)|0)+Math.imul(w,st)|0,o=o+Math.imul(w,At)|0,r=r+Math.imul(m,ut)|0,n=(n=n+Math.imul(m,ht)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ht)|0,r=r+Math.imul(p,Bt)|0,n=(n=n+Math.imul(p,xt)|0)+Math.imul(B,Bt)|0,o=o+Math.imul(B,xt)|0;var Gt=(b+(r=r+Math.imul(h,It)|0)|0)+((8191&(n=(n=n+Math.imul(h,Et)|0)+Math.imul(l,It)|0))<<13)|0;b=((o=o+Math.imul(l,Et)|0)+(n>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,r=Math.imul(H,V),n=(n=Math.imul(H,X))+Math.imul(z,V)|0,o=Math.imul(z,X),r=r+Math.imul(U,et)|0,n=(n=n+Math.imul(U,tt)|0)+Math.imul(q,et)|0,o=o+Math.imul(q,tt)|0,r=r+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,r=r+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,ct)|0,r=r+Math.imul(Q,st)|0,n=(n=n+Math.imul(Q,At)|0)+Math.imul(_,st)|0,o=o+Math.imul(_,At)|0,r=r+Math.imul(C,ut)|0,n=(n=n+Math.imul(C,ht)|0)+Math.imul(w,ut)|0,o=o+Math.imul(w,ht)|0,r=r+Math.imul(m,Bt)|0,n=(n=n+Math.imul(m,xt)|0)+Math.imul(I,Bt)|0,o=o+Math.imul(I,xt)|0,r=r+Math.imul(p,It)|0,n=(n=n+Math.imul(p,Et)|0)+Math.imul(B,It)|0,o=o+Math.imul(B,Et)|0;var Tt=(b+(r=r+Math.imul(h,Ct)|0)|0)+((8191&(n=(n=n+Math.imul(h,wt)|0)+Math.imul(l,Ct)|0))<<13)|0;b=((o=o+Math.imul(l,wt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(J,V),n=(n=Math.imul(J,X))+Math.imul(Y,V)|0,o=Math.imul(Y,X),r=r+Math.imul(H,et)|0,n=(n=n+Math.imul(H,tt)|0)+Math.imul(z,et)|0,o=o+Math.imul(z,tt)|0,r=r+Math.imul(U,rt)|0,n=(n=n+Math.imul(U,it)|0)+Math.imul(q,rt)|0,o=o+Math.imul(q,it)|0,r=r+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,ct)|0,r=r+Math.imul(N,st)|0,n=(n=n+Math.imul(N,At)|0)+Math.imul(D,st)|0,o=o+Math.imul(D,At)|0,r=r+Math.imul(Q,ut)|0,n=(n=n+Math.imul(Q,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,r=r+Math.imul(C,Bt)|0,n=(n=n+Math.imul(C,xt)|0)+Math.imul(w,Bt)|0,o=o+Math.imul(w,xt)|0,r=r+Math.imul(m,It)|0,n=(n=n+Math.imul(m,Et)|0)+Math.imul(I,It)|0,o=o+Math.imul(I,Et)|0,r=r+Math.imul(p,Ct)|0,n=(n=n+Math.imul(p,wt)|0)+Math.imul(B,Ct)|0,o=o+Math.imul(B,wt)|0;var Lt=(b+(r=r+Math.imul(h,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(h,Mt)|0)+Math.imul(l,Qt)|0))<<13)|0;b=((o=o+Math.imul(l,Mt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,r=Math.imul(J,et),n=(n=Math.imul(J,tt))+Math.imul(Y,et)|0,o=Math.imul(Y,tt),r=r+Math.imul(H,rt)|0,n=(n=n+Math.imul(H,it)|0)+Math.imul(z,rt)|0,o=o+Math.imul(z,it)|0,r=r+Math.imul(U,ot)|0,n=(n=n+Math.imul(U,ct)|0)+Math.imul(q,ot)|0,o=o+Math.imul(q,ct)|0,r=r+Math.imul(T,st)|0,n=(n=n+Math.imul(T,At)|0)+Math.imul(L,st)|0,o=o+Math.imul(L,At)|0,r=r+Math.imul(N,ut)|0,n=(n=n+Math.imul(N,ht)|0)+Math.imul(D,ut)|0,o=o+Math.imul(D,ht)|0,r=r+Math.imul(Q,Bt)|0,n=(n=n+Math.imul(Q,xt)|0)+Math.imul(_,Bt)|0,o=o+Math.imul(_,xt)|0,r=r+Math.imul(C,It)|0,n=(n=n+Math.imul(C,Et)|0)+Math.imul(w,It)|0,o=o+Math.imul(w,Et)|0,r=r+Math.imul(m,Ct)|0,n=(n=n+Math.imul(m,wt)|0)+Math.imul(I,Ct)|0,o=o+Math.imul(I,wt)|0;var Pt=(b+(r=r+Math.imul(p,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(p,Mt)|0)+Math.imul(B,Qt)|0))<<13)|0;b=((o=o+Math.imul(B,Mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,r=Math.imul(J,rt),n=(n=Math.imul(J,it))+Math.imul(Y,rt)|0,o=Math.imul(Y,it),r=r+Math.imul(H,ot)|0,n=(n=n+Math.imul(H,ct)|0)+Math.imul(z,ot)|0,o=o+Math.imul(z,ct)|0,r=r+Math.imul(U,st)|0,n=(n=n+Math.imul(U,At)|0)+Math.imul(q,st)|0,o=o+Math.imul(q,At)|0,r=r+Math.imul(T,ut)|0,n=(n=n+Math.imul(T,ht)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ht)|0,r=r+Math.imul(N,Bt)|0,n=(n=n+Math.imul(N,xt)|0)+Math.imul(D,Bt)|0,o=o+Math.imul(D,xt)|0,r=r+Math.imul(Q,It)|0,n=(n=n+Math.imul(Q,Et)|0)+Math.imul(_,It)|0,o=o+Math.imul(_,Et)|0,r=r+Math.imul(C,Ct)|0,n=(n=n+Math.imul(C,wt)|0)+Math.imul(w,Ct)|0,o=o+Math.imul(w,wt)|0;var Ut=(b+(r=r+Math.imul(m,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(m,Mt)|0)+Math.imul(I,Qt)|0))<<13)|0;b=((o=o+Math.imul(I,Mt)|0)+(n>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,r=Math.imul(J,ot),n=(n=Math.imul(J,ct))+Math.imul(Y,ot)|0,o=Math.imul(Y,ct),r=r+Math.imul(H,st)|0,n=(n=n+Math.imul(H,At)|0)+Math.imul(z,st)|0,o=o+Math.imul(z,At)|0,r=r+Math.imul(U,ut)|0,n=(n=n+Math.imul(U,ht)|0)+Math.imul(q,ut)|0,o=o+Math.imul(q,ht)|0,r=r+Math.imul(T,Bt)|0,n=(n=n+Math.imul(T,xt)|0)+Math.imul(L,Bt)|0,o=o+Math.imul(L,xt)|0,r=r+Math.imul(N,It)|0,n=(n=n+Math.imul(N,Et)|0)+Math.imul(D,It)|0,o=o+Math.imul(D,Et)|0,r=r+Math.imul(Q,Ct)|0,n=(n=n+Math.imul(Q,wt)|0)+Math.imul(_,Ct)|0,o=o+Math.imul(_,wt)|0;var qt=(b+(r=r+Math.imul(C,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(C,Mt)|0)+Math.imul(w,Qt)|0))<<13)|0;b=((o=o+Math.imul(w,Mt)|0)+(n>>>13)|0)+(qt>>>26)|0,qt&=67108863,r=Math.imul(J,st),n=(n=Math.imul(J,At))+Math.imul(Y,st)|0,o=Math.imul(Y,At),r=r+Math.imul(H,ut)|0,n=(n=n+Math.imul(H,ht)|0)+Math.imul(z,ut)|0,o=o+Math.imul(z,ht)|0,r=r+Math.imul(U,Bt)|0,n=(n=n+Math.imul(U,xt)|0)+Math.imul(q,Bt)|0,o=o+Math.imul(q,xt)|0,r=r+Math.imul(T,It)|0,n=(n=n+Math.imul(T,Et)|0)+Math.imul(L,It)|0,o=o+Math.imul(L,Et)|0,r=r+Math.imul(N,Ct)|0,n=(n=n+Math.imul(N,wt)|0)+Math.imul(D,Ct)|0,o=o+Math.imul(D,wt)|0;var Ot=(b+(r=r+Math.imul(Q,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(Q,Mt)|0)+Math.imul(_,Qt)|0))<<13)|0;b=((o=o+Math.imul(_,Mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(J,ut),n=(n=Math.imul(J,ht))+Math.imul(Y,ut)|0,o=Math.imul(Y,ht),r=r+Math.imul(H,Bt)|0,n=(n=n+Math.imul(H,xt)|0)+Math.imul(z,Bt)|0,o=o+Math.imul(z,xt)|0,r=r+Math.imul(U,It)|0,n=(n=n+Math.imul(U,Et)|0)+Math.imul(q,It)|0,o=o+Math.imul(q,Et)|0,r=r+Math.imul(T,Ct)|0,n=(n=n+Math.imul(T,wt)|0)+Math.imul(L,Ct)|0,o=o+Math.imul(L,wt)|0;var Ht=(b+(r=r+Math.imul(N,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(N,Mt)|0)+Math.imul(D,Qt)|0))<<13)|0;b=((o=o+Math.imul(D,Mt)|0)+(n>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,r=Math.imul(J,Bt),n=(n=Math.imul(J,xt))+Math.imul(Y,Bt)|0,o=Math.imul(Y,xt),r=r+Math.imul(H,It)|0,n=(n=n+Math.imul(H,Et)|0)+Math.imul(z,It)|0,o=o+Math.imul(z,Et)|0,r=r+Math.imul(U,Ct)|0,n=(n=n+Math.imul(U,wt)|0)+Math.imul(q,Ct)|0,o=o+Math.imul(q,wt)|0;var zt=(b+(r=r+Math.imul(T,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(T,Mt)|0)+Math.imul(L,Qt)|0))<<13)|0;b=((o=o+Math.imul(L,Mt)|0)+(n>>>13)|0)+(zt>>>26)|0,zt&=67108863,r=Math.imul(J,It),n=(n=Math.imul(J,Et))+Math.imul(Y,It)|0,o=Math.imul(Y,Et),r=r+Math.imul(H,Ct)|0,n=(n=n+Math.imul(H,wt)|0)+Math.imul(z,Ct)|0,o=o+Math.imul(z,wt)|0;var Kt=(b+(r=r+Math.imul(U,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(U,Mt)|0)+Math.imul(q,Qt)|0))<<13)|0;b=((o=o+Math.imul(q,Mt)|0)+(n>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,r=Math.imul(J,Ct),n=(n=Math.imul(J,wt))+Math.imul(Y,Ct)|0,o=Math.imul(Y,wt);var jt=(b+(r=r+Math.imul(H,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(H,Mt)|0)+Math.imul(z,Qt)|0))<<13)|0;b=((o=o+Math.imul(z,Mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Jt=(b+(r=Math.imul(J,Qt))|0)+((8191&(n=(n=Math.imul(J,Mt))+Math.imul(Y,Qt)|0))<<13)|0;return b=((o=Math.imul(Y,Mt))+(n>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,s[0]=_t,s[1]=kt,s[2]=St,s[3]=Nt,s[4]=Dt,s[5]=Rt,s[6]=Ft,s[7]=Gt,s[8]=Tt,s[9]=Lt,s[10]=Pt,s[11]=Ut,s[12]=qt,s[13]=Ot,s[14]=Ht,s[15]=zt,s[16]=Kt,s[17]=jt,s[18]=Jt,0!==b&&(s[19]=b,a.length++),a};function jumboMulTo(e,t,a){return(new FFTM).mulp(e,t,a)}function FFTM(e,t){this.x=e,this.y=t}Math.imul||(d=smallMulTo),BN.prototype.mulTo=function mulTo(e,t){var a,r=this.length+e.length;return a=10===this.length&&10===e.length?d(this,e,t):r<63?smallMulTo(this,e,t):r<1024?function bigMulTo(e,t,a){a.negative=t.negative^e.negative,a.length=e.length+t.length;for(var r=0,n=0,o=0;o>>26)|0)>>>26,c&=67108863}a.words[o]=d,r=c,c=n}return 0!==r?a.words[o]=r:a.length--,a.strip()}(this,e,t):jumboMulTo(this,e,t),a},FFTM.prototype.makeRBT=function makeRBT(e){for(var t=new Array(e),a=BN.prototype._countBits(e)-1,r=0;r>=1;return r},FFTM.prototype.permute=function permute(e,t,a,r,n,o){for(var c=0;c>>=1)n++;return 1<>>=13,a[2*o+1]=8191&n,n>>>=13;for(o=2*t;o>=26,t+=r/67108864|0,t+=n>>>26,this.words[a]=67108863&n}return 0!==t&&(this.words[a]=t,this.length++),this},BN.prototype.muln=function muln(e){return this.clone().imuln(e)},BN.prototype.sqr=function sqr(){return this.mul(this)},BN.prototype.isqr=function isqr(){return this.imul(this.clone())},BN.prototype.pow=function pow(e){var t=function toBitArray(e){for(var t=new Array(e.bitLength()),a=0;a>>n}return t}(e);if(0===t.length)return new BN(1);for(var a=this,r=0;r=0);var t,a=e%26,r=(e-a)/26,n=67108863>>>26-a<<26-a;if(0!==a){var o=0;for(t=0;t>>26-a}o&&(this.words[t]=o,this.length++)}if(0!==r){for(t=this.length-1;t>=0;t--)this.words[t+r]=this.words[t];for(t=0;t=0),r=t?(t-t%26)/26:0;var n=e%26,o=Math.min((e-n)/26,this.length),c=67108863^67108863>>>n<o)for(this.length-=o,s=0;s=0&&(0!==b||s>=r);s--){var u=0|this.words[s];this.words[s]=b<<26-n|u>>>n,b=u&c}return d&&0!==b&&(d.words[d.length++]=b),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},BN.prototype.ishrn=function ishrn(e,t,a){return assert(0===this.negative),this.iushrn(e,t,a)},BN.prototype.shln=function shln(e){return this.clone().ishln(e)},BN.prototype.ushln=function ushln(e){return this.clone().iushln(e)},BN.prototype.shrn=function shrn(e){return this.clone().ishrn(e)},BN.prototype.ushrn=function ushrn(e){return this.clone().iushrn(e)},BN.prototype.testn=function testn(e){assert("number"==typeof e&&e>=0);var t=e%26,a=(e-t)/26,r=1<=0);var t=e%26,a=(e-t)/26;if(assert(0===this.negative,"imaskn works only with positive numbers"),this.length<=a)return this;if(0!==t&&a++,this.length=Math.min(a,this.length),0!==t){var r=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},BN.prototype.isubn=function isubn(e){if(assert("number"==typeof e),assert(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(d/67108864|0),this.words[r+a]=67108863&n}for(;r>26,this.words[r+a]=67108863&n;if(0===c)return this.strip();for(assert(-1===c),c=0,r=0;r>26,this.words[r]=67108863&n;return this.negative=1,this.strip()},BN.prototype._wordDiv=function _wordDiv(e,t){var a=(this.length,e.length),r=this.clone(),n=e,o=0|n.words[n.length-1];0!==(a=26-this._countBits(o))&&(n=n.ushln(a),r.iushln(a),o=0|n.words[n.length-1]);var c,d=r.length-n.length;if("mod"!==t){(c=new BN(null)).length=d+1,c.words=new Array(c.length);for(var s=0;s=0;u--){var h=67108864*(0|r.words[n.length+u])+(0|r.words[n.length+u-1]);for(h=Math.min(h/o|0,67108863),r._ishlnsubmul(n,h,u);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(n,1,u),r.isZero()||(r.negative^=1);c&&(c.words[u]=h)}return c&&c.strip(),r.strip(),"div"!==t&&0!==a&&r.iushrn(a),{div:c||null,mod:r}},BN.prototype.divmod=function divmod(e,t,a){return assert(!e.isZero()),this.isZero()?{div:new BN(0),mod:new BN(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(r=o.div.neg()),"div"!==t&&(n=o.mod.neg(),a&&0!==n.negative&&n.iadd(e)),{div:r,mod:n}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(r=o.div.neg()),{div:r,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(n=o.mod.neg(),a&&0!==n.negative&&n.isub(e)),{div:o.div,mod:n}):e.length>this.length||this.cmp(e)<0?{div:new BN(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new BN(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new BN(this.modn(e.words[0]))}:this._wordDiv(e,t);var r,n,o},BN.prototype.div=function div(e){return this.divmod(e,"div",!1).div},BN.prototype.mod=function mod(e){return this.divmod(e,"mod",!1).mod},BN.prototype.umod=function umod(e){return this.divmod(e,"mod",!0).mod},BN.prototype.divRound=function divRound(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var a=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),o=a.cmp(r);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},BN.prototype.modn=function modn(e){assert(e<=67108863);for(var t=(1<<26)%e,a=0,r=this.length-1;r>=0;r--)a=(t*a+(0|this.words[r]))%e;return a},BN.prototype.idivn=function idivn(e){assert(e<=67108863);for(var t=0,a=this.length-1;a>=0;a--){var r=(0|this.words[a])+67108864*t;this.words[a]=r/e|0,t=r%e}return this.strip()},BN.prototype.divn=function divn(e){return this.clone().idivn(e)},BN.prototype.egcd=function egcd(e){assert(0===e.negative),assert(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r=new BN(1),n=new BN(0),o=new BN(0),c=new BN(1),d=0;t.isEven()&&a.isEven();)t.iushrn(1),a.iushrn(1),++d;for(var s=a.clone(),b=t.clone();!t.isZero();){for(var u=0,h=1;0==(t.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(t.iushrn(u);u-- >0;)(r.isOdd()||n.isOdd())&&(r.iadd(s),n.isub(b)),r.iushrn(1),n.iushrn(1);for(var l=0,g=1;0==(a.words[0]&g)&&l<26;++l,g<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(o.isOdd()||c.isOdd())&&(o.iadd(s),c.isub(b)),o.iushrn(1),c.iushrn(1);t.cmp(a)>=0?(t.isub(a),r.isub(o),n.isub(c)):(a.isub(t),o.isub(r),c.isub(n))}return{a:o,b:c,gcd:a.iushln(d)}},BN.prototype._invmp=function _invmp(e){assert(0===e.negative),assert(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r,n=new BN(1),o=new BN(0),c=a.clone();t.cmpn(1)>0&&a.cmpn(1)>0;){for(var d=0,s=1;0==(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0)for(t.iushrn(d);d-- >0;)n.isOdd()&&n.iadd(c),n.iushrn(1);for(var b=0,u=1;0==(a.words[0]&u)&&b<26;++b,u<<=1);if(b>0)for(a.iushrn(b);b-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);t.cmp(a)>=0?(t.isub(a),n.isub(o)):(a.isub(t),o.isub(n))}return(r=0===t.cmpn(1)?n:o).cmpn(0)<0&&r.iadd(e),r},BN.prototype.gcd=function gcd(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),a=e.clone();t.negative=0,a.negative=0;for(var r=0;t.isEven()&&a.isEven();r++)t.iushrn(1),a.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;a.isEven();)a.iushrn(1);var n=t.cmp(a);if(n<0){var o=t;t=a,a=o}else if(0===n||0===a.cmpn(1))break;t.isub(a)}return a.iushln(r)},BN.prototype.invm=function invm(e){return this.egcd(e).a.umod(e)},BN.prototype.isEven=function isEven(){return 0==(1&this.words[0])},BN.prototype.isOdd=function isOdd(){return 1==(1&this.words[0])},BN.prototype.andln=function andln(e){return this.words[0]&e},BN.prototype.bincn=function bincn(e){assert("number"==typeof e);var t=e%26,a=(e-t)/26,r=1<>>26,c&=67108863,this.words[o]=c}return 0!==n&&(this.words[o]=n,this.length++),this},BN.prototype.isZero=function isZero(){return 1===this.length&&0===this.words[0]},BN.prototype.cmpn=function cmpn(e){var t,a=e<0;if(0!==this.negative&&!a)return-1;if(0===this.negative&&a)return 1;if(this.strip(),this.length>1)t=1;else{a&&(e=-e),assert(e<=67108863,"Number is too big");var r=0|this.words[0];t=r===e?0:re.length)return 1;if(this.length=0;a--){var r=0|this.words[a],n=0|e.words[a];if(r!==n){rn&&(t=1);break}}return t},BN.prototype.gtn=function gtn(e){return 1===this.cmpn(e)},BN.prototype.gt=function gt(e){return 1===this.cmp(e)},BN.prototype.gten=function gten(e){return this.cmpn(e)>=0},BN.prototype.gte=function gte(e){return this.cmp(e)>=0},BN.prototype.ltn=function ltn(e){return-1===this.cmpn(e)},BN.prototype.lt=function lt(e){return-1===this.cmp(e)},BN.prototype.lten=function lten(e){return this.cmpn(e)<=0},BN.prototype.lte=function lte(e){return this.cmp(e)<=0},BN.prototype.eqn=function eqn(e){return 0===this.cmpn(e)},BN.prototype.eq=function eq(e){return 0===this.cmp(e)},BN.red=function red(e){return new Red(e)},BN.prototype.toRed=function toRed(e){return assert(!this.red,"Already a number in reduction context"),assert(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},BN.prototype.fromRed=function fromRed(){return assert(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},BN.prototype._forceRed=function _forceRed(e){return this.red=e,this},BN.prototype.forceRed=function forceRed(e){return assert(!this.red,"Already a number in reduction context"),this._forceRed(e)},BN.prototype.redAdd=function redAdd(e){return assert(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},BN.prototype.redIAdd=function redIAdd(e){return assert(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},BN.prototype.redSub=function redSub(e){return assert(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},BN.prototype.redISub=function redISub(e){return assert(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},BN.prototype.redShl=function redShl(e){return assert(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},BN.prototype.redMul=function redMul(e){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},BN.prototype.redIMul=function redIMul(e){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},BN.prototype.redSqr=function redSqr(){return assert(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},BN.prototype.redISqr=function redISqr(){return assert(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},BN.prototype.redSqrt=function redSqrt(){return assert(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},BN.prototype.redInvm=function redInvm(){return assert(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},BN.prototype.redNeg=function redNeg(){return assert(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},BN.prototype.redPow=function redPow(e){return assert(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var s={k256:null,p224:null,p192:null,p25519:null};function MPrime(e,t){this.name=e,this.p=new BN(t,16),this.n=this.p.bitLength(),this.k=new BN(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function Red(e){if("string"==typeof e){var t=BN._prime(e);this.m=t.p,this.prime=t}else assert(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function Mont(e){Red.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new BN(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}MPrime.prototype._tmp=function _tmp(){var e=new BN(null);return e.words=new Array(Math.ceil(this.n/13)),e},MPrime.prototype.ireduce=function ireduce(e){var t,a=e;do{this.split(a,this.tmp),t=(a=(a=this.imulK(a)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?a.isub(this.p):void 0!==a.strip?a.strip():a._strip(),a},MPrime.prototype.split=function split(e,t){e.iushrn(this.n,0,t)},MPrime.prototype.imulK=function imulK(e){return e.imul(this.k)},inherits(K256,MPrime),K256.prototype.split=function split(e,t){for(var a=4194303,r=Math.min(e.length,9),n=0;n>>22,o=c}o>>>=22,e.words[n-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},K256.prototype.imulK=function imulK(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,a=0;a>>=26,e.words[a]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},BN._prime=function prime(e){if(s[e])return s[e];var prime;if("k256"===e)prime=new K256;else if("p224"===e)prime=new P224;else if("p192"===e)prime=new P192;else{if("p25519"!==e)throw new Error("Unknown prime "+e);prime=new P25519}return s[e]=prime,prime},Red.prototype._verify1=function _verify1(e){assert(0===e.negative,"red works only with positives"),assert(e.red,"red works only with red numbers")},Red.prototype._verify2=function _verify2(e,t){assert(0==(e.negative|t.negative),"red works only with positives"),assert(e.red&&e.red===t.red,"red works only with red numbers")},Red.prototype.imod=function imod(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},Red.prototype.neg=function neg(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},Red.prototype.add=function add(e,t){this._verify2(e,t);var a=e.add(t);return a.cmp(this.m)>=0&&a.isub(this.m),a._forceRed(this)},Red.prototype.iadd=function iadd(e,t){this._verify2(e,t);var a=e.iadd(t);return a.cmp(this.m)>=0&&a.isub(this.m),a},Red.prototype.sub=function sub(e,t){this._verify2(e,t);var a=e.sub(t);return a.cmpn(0)<0&&a.iadd(this.m),a._forceRed(this)},Red.prototype.isub=function isub(e,t){this._verify2(e,t);var a=e.isub(t);return a.cmpn(0)<0&&a.iadd(this.m),a},Red.prototype.shl=function shl(e,t){return this._verify1(e),this.imod(e.ushln(t))},Red.prototype.imul=function imul(e,t){return this._verify2(e,t),this.imod(e.imul(t))},Red.prototype.mul=function mul(e,t){return this._verify2(e,t),this.imod(e.mul(t))},Red.prototype.isqr=function isqr(e){return this.imul(e,e.clone())},Red.prototype.sqr=function sqr(e){return this.mul(e,e)},Red.prototype.sqrt=function sqrt(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(assert(t%2==1),3===t){var a=this.m.add(new BN(1)).iushrn(2);return this.pow(e,a)}for(var r=this.m.subn(1),n=0;!r.isZero()&&0===r.andln(1);)n++,r.iushrn(1);assert(!r.isZero());var o=new BN(1).toRed(this),c=o.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new BN(2*s*s).toRed(this);0!==this.pow(s,d).cmp(c);)s.redIAdd(c);for(var b=this.pow(s,r),u=this.pow(e,r.addn(1).iushrn(1)),h=this.pow(e,r),l=n;0!==h.cmp(o);){for(var g=h,p=0;0!==g.cmp(o);p++)g=g.redSqr();assert(p=0;r--){for(var s=t.words[r],b=d-1;b>=0;b--){var u=s>>b&1;n!==a[0]&&(n=this.sqr(n)),0!==u||0!==o?(o<<=1,o|=u,(4===++c||0===r&&0===b)&&(n=this.mul(n,a[o]),c=0,o=0)):c=0}d=26}return n},Red.prototype.convertTo=function convertTo(e){var t=e.umod(this.m);return t===e?t.clone():t},Red.prototype.convertFrom=function convertFrom(e){var t=e.clone();return t.red=null,t},BN.mont=function mont(e){return new Mont(e)},inherits(Mont,Red),Mont.prototype.convertTo=function convertTo(e){return this.imod(e.ushln(this.shift))},Mont.prototype.convertFrom=function convertFrom(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},Mont.prototype.imul=function imul(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var a=e.imul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},Mont.prototype.mul=function mul(e,t){if(e.isZero()||t.isZero())return new BN(0)._forceRed(this);var a=e.mul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},Mont.prototype.invm=function invm(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=a.nmd(e),this)},(e,t,a)=>{var r=a(2),n=r.Buffer;function copyProps(e,t){for(var a in e)t[a]=e[a]}function SafeBuffer(e,t,a){return n(e,t,a)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(copyProps(r,t),t.Buffer=SafeBuffer),SafeBuffer.prototype=Object.create(n.prototype),copyProps(n,SafeBuffer),SafeBuffer.from=function(e,t,a){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,a)},SafeBuffer.alloc=function(e,t,a){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=n(e);return void 0!==t?"string"==typeof a?r.fill(t,a):r.fill(t):r.fill(0),r},SafeBuffer.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},SafeBuffer.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},(e,t,a)=>{var r=a(184),n=Function.prototype,o=n.bind,c=n.call,d=r&&o.bind(c,c);e.exports=r?function(e){return e&&d(e)}:function(e){return e&&function(){return c.apply(e,arguments)}}},function(e,t,a){"use strict";var r,n=a(0).Buffer,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),c=this&&this.__assign||function(){return c=Object.assign||function(e){for(var t,a=1,r=arguments.length;a=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.ConsensusAlgorithm=t.ConsensusType=t.Hardfork=t.Chain=t.CustomChain=void 0;var s,b,u=a(13),h=a(1233),l=a(1),g=a(677),p=a(1672),B=a(1690);!function(e){e.PolygonMainnet="polygon-mainnet",e.PolygonMumbai="polygon-mumbai",e.ArbitrumRinkebyTestnet="arbitrum-rinkeby-testnet",e.xDaiChain="x-dai-chain",e.OptimisticKovan="optimistic-kovan",e.OptimisticEthereum="optimistic-ethereum"}(s=t.CustomChain||(t.CustomChain={})),function(e){e[e.Mainnet=1]="Mainnet",e[e.Ropsten=3]="Ropsten",e[e.Rinkeby=4]="Rinkeby",e[e.Kovan=42]="Kovan",e[e.Goerli=5]="Goerli",e[e.Sepolia=11155111]="Sepolia"}(t.Chain||(t.Chain={})),function(e){e.Chainstart="chainstart",e.Homestead="homestead",e.Dao="dao",e.TangerineWhistle="tangerineWhistle",e.SpuriousDragon="spuriousDragon",e.Byzantium="byzantium",e.Constantinople="constantinople",e.Petersburg="petersburg",e.Istanbul="istanbul",e.MuirGlacier="muirGlacier",e.Berlin="berlin",e.London="london",e.ArrowGlacier="arrowGlacier",e.GrayGlacier="grayGlacier",e.MergeForkIdTransition="mergeForkIdTransition",e.Merge="merge",e.Shanghai="shanghai"}(b=t.Hardfork||(t.Hardfork={})),function(e){e.ProofOfStake="pos",e.ProofOfWork="pow",e.ProofOfAuthority="poa"}(t.ConsensusType||(t.ConsensusType={})),function(e){e.Ethash="ethash",e.Clique="clique",e.Casper="casper"}(t.ConsensusAlgorithm||(t.ConsensusAlgorithm={}));var x=function(e){function Common(t){var a,r,n,o,c=this;(c=e.call(this)||this)._supportedHardforks=[],c._eips=[],c._customChains=null!==(n=t.customChains)&&void 0!==n?n:[],c._chainParams=c.setChain(t.chain),c.DEFAULT_HARDFORK=null!==(o=c._chainParams.defaultHardfork)&&void 0!==o?o:b.Istanbul;try{for(var s=d(c._chainParams.hardforks),u=s.next();!u.done;u=s.next()){var h=u.value;h.forkHash||(h.forkHash=c._calcForkHash(h.name))}}catch(e){a={error:e}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(a)throw a.error}}return c._hardfork=c.DEFAULT_HARDFORK,t.supportedHardforks&&(c._supportedHardforks=t.supportedHardforks),t.hardfork&&c.setHardfork(t.hardfork),t.eips&&c.setEIPs(t.eips),c}return o(Common,e),Common.custom=function(e,t){var a;void 0===t&&(t={});var r=null!==(a=t.baseChain)&&void 0!==a?a:"mainnet",n=c({},Common._getChainParams(r));if(n.name="custom-chain","string"!=typeof e)return new Common(c({chain:c(c({},n),e)},t));if(e===s.PolygonMainnet)return Common.custom({name:s.PolygonMainnet,chainId:137,networkId:137},t);if(e===s.PolygonMumbai)return Common.custom({name:s.PolygonMumbai,chainId:80001,networkId:80001},t);if(e===s.ArbitrumRinkebyTestnet)return Common.custom({name:s.ArbitrumRinkebyTestnet,chainId:421611,networkId:421611},t);if(e===s.xDaiChain)return Common.custom({name:s.xDaiChain,chainId:100,networkId:100},t);if(e===s.OptimisticKovan)return Common.custom({name:s.OptimisticKovan,chainId:69,networkId:69},c({hardfork:b.Berlin},t));if(e===s.OptimisticEthereum)return Common.custom({name:s.OptimisticEthereum,chainId:10,networkId:10},c({hardfork:b.Berlin},t));throw new Error("Custom chain ".concat(e," not supported"))},Common.forCustomChain=function(e,t,a,r){var n=Common._getChainParams(e);return new Common({chain:c(c({},n),t),hardfork:a,supportedHardforks:r})},Common.isSupportedChainId=function(e){var t=(0,g._getInitializedChains)();return Boolean(t.names[e.toString()])},Common._getChainParams=function(e,t){var a=(0,g._getInitializedChains)(t);if("number"==typeof e||l.BN.isBN(e)){if(e=e.toString(),a.names[e])return a[a.names[e]];throw new Error("Chain with ID ".concat(e," not supported"))}if(a[e])return a[e];throw new Error("Chain with name ".concat(e," not supported"))},Common.prototype.setChain=function(e){var t,a;if("number"==typeof e||"string"==typeof e||l.BN.isBN(e)){var r=void 0;r=this._customChains&&this._customChains.length>0&&Array.isArray(this._customChains[0])?this._customChains.map((function(e){return e[0]})):this._customChains,this._chainParams=Common._getChainParams(e,r)}else{if("object"!=typeof e)throw new Error("Wrong input format");if(this._customChains.length>0)throw new Error("Chain must be a string, number, or BN when initialized with customChains passed in");try{for(var n=d(["networkId","genesis","hardforks","bootstrapNodes"]),o=n.next();!o.done;o=n.next()){var c=o.value;if(void 0===e[c])throw new Error("Missing required chain parameter: ".concat(c))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(a=n.return)&&a.call(n)}finally{if(t)throw t.error}}this._chainParams=e}return this._chainParams},Common.prototype.setHardfork=function(e){var t,a;if(!this._isSupportedHardfork(e))throw new Error("Hardfork ".concat(e," not set as supported in supportedHardforks"));var r=!1;try{for(var n=d(p.hardforks),o=n.next();!o.done;o=n.next()){o.value[0]===e&&(this._hardfork!==e&&(this._hardfork=e,this.emit("hardforkChanged",e)),r=!0)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(a=n.return)&&a.call(n)}finally{if(t)throw t.error}}if(!r)throw new Error("Hardfork with name ".concat(e," not supported"))},Common.prototype.getHardforkByBlockNumber=function(e,t){var a,r;e=(0,l.toType)(e,l.TypeOutput.BN),t=(0,l.toType)(t,l.TypeOutput.BN);var n,o,c,s=b.Chainstart;try{for(var u=d(this.hardforks()),h=u.next();!h.done;h=u.next()){var g=h.value;if(null!==g.block)e.gte(new l.BN(g.block))&&(s=g.name),t&&g.td&&(t.gte(new l.BN(g.td))?n=g.name:o=c),c=g.name;else if(null!=t&&void 0!==g.td&&null!==g.td&&t.gte(new l.BN(g.td)))return g.name}}catch(e){a={error:e}}finally{try{h&&!h.done&&(r=u.return)&&r.call(u)}finally{if(a)throw a.error}}if(t){var p="block number: ".concat(e," (-> ").concat(s,"), ");if(n&&!this.hardforkGteHardfork(s,n)){var B="HF determined by block number is lower than the minimum total difficulty HF";throw p+="total difficulty: ".concat(t," (-> ").concat(n,")"),new Error("".concat(B,": ").concat(p))}if(o&&!this.hardforkGteHardfork(o,s)){B="Maximum HF determined by total difficulty is lower than the block number HF";throw p+="total difficulty: ".concat(t," (-> ").concat(o,")"),new Error("".concat(B,": ").concat(p))}}return s},Common.prototype.setHardforkByBlockNumber=function(e,t){var a=this.getHardforkByBlockNumber(e,t);return this.setHardfork(a),a},Common.prototype._chooseHardfork=function(e,t){if(void 0===t&&(t=!0),e){if(t&&!this._isSupportedHardfork(e))throw new Error("Hardfork ".concat(e," not set as supported in supportedHardforks"))}else e=this._hardfork;return e},Common.prototype._getHardfork=function(e){var t,a,r=this.hardforks();try{for(var n=d(r),o=n.next();!o.done;o=n.next()){var c=o.value;if(c.name===e)return c}}catch(e){t={error:e}}finally{try{o&&!o.done&&(a=n.return)&&a.call(n)}finally{if(t)throw t.error}}throw new Error("Hardfork ".concat(e," not defined for chain ").concat(this.chainName()))},Common.prototype._isSupportedHardfork=function(e){var t,a;if(!(this._supportedHardforks.length>0))return!0;try{for(var r=d(this._supportedHardforks),n=r.next();!n.done;n=r.next()){if(e===n.value)return!0}}catch(e){t={error:e}}finally{try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(t)throw t.error}}return!1},Common.prototype.setEIPs=function(e){var t,a,r=this;void 0===e&&(e=[]);var _loop_1=function(t){if(!(t in B.EIPs))throw new Error("".concat(t," not supported"));var a=n.gteHardfork(B.EIPs[t].minimumHardfork);if(!a)throw new Error("".concat(t," cannot be activated on hardfork ").concat(n.hardfork(),", minimumHardfork: ").concat(a));B.EIPs[t].requiredEIPs&&B.EIPs[t].requiredEIPs.forEach((function(a){if(!e.includes(a)&&!r.isActivatedEIP(a))throw new Error("".concat(t," requires EIP ").concat(a,", but is not included in the EIP list"))}))},n=this;try{for(var o=d(e),c=o.next();!c.done;c=o.next()){_loop_1(c.value)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(a=o.return)&&a.call(o)}finally{if(t)throw t.error}}this._eips=e},Common.prototype.param=function(e,t){var a,r,n=null;try{for(var o=d(this._eips),c=o.next();!c.done;c=o.next()){var s=c.value;if(null!==(n=this.paramByEIP(e,t,s)))return n}}catch(e){a={error:e}}finally{try{c&&!c.done&&(r=o.return)&&r.call(o)}finally{if(a)throw a.error}}return this.paramByHardfork(e,t,this._hardfork)},Common.prototype.paramByHardfork=function(e,t,a){var r,n,o,c;a=this._chooseHardfork(a);var s=null;try{for(var b=d(p.hardforks),u=b.next();!u.done;u=b.next()){var h=u.value;if("eips"in h[1]){var l=h[1].eips;try{for(var g=(o=void 0,d(l)),B=g.next();!B.done;B=g.next()){var x=B.value,m=this.paramByEIP(e,t,x);s=null!==m?m:s}}catch(e){o={error:e}}finally{try{B&&!B.done&&(c=g.return)&&c.call(g)}finally{if(o)throw o.error}}}else{if(!h[1][e])throw new Error("Topic ".concat(e," not defined"));void 0!==h[1][e][t]&&(s=h[1][e][t].v)}if(h[0]===a)break}}catch(e){r={error:e}}finally{try{u&&!u.done&&(n=b.return)&&n.call(b)}finally{if(r)throw r.error}}return s},Common.prototype.paramByEIP=function(e,t,a){if(!(a in B.EIPs))throw new Error("".concat(a," not supported"));var r=B.EIPs[a];if(!(e in r))throw new Error("Topic ".concat(e," not defined"));return void 0===r[e][t]?null:r[e][t].v},Common.prototype.paramByBlock=function(e,t,a){var r=this.activeHardforks(a),n=r[r.length-1].name;return this.paramByHardfork(e,t,n)},Common.prototype.isActivatedEIP=function(e){var t,a;if(this.eips().includes(e))return!0;try{for(var r=d(p.hardforks),n=r.next();!n.done;n=r.next()){var o=n.value[1];if(this.gteHardfork(o.name)&&"eips"in o&&o.eips.includes(e))return!0}}catch(e){t={error:e}}finally{try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(t)throw t.error}}return!1},Common.prototype.hardforkIsActiveOnBlock=function(e,t,a){var r;void 0===a&&(a={}),t=(0,l.toType)(t,l.TypeOutput.BN);var n=null!==(r=a.onlySupported)&&void 0!==r&&r;e=this._chooseHardfork(e,n);var o=this.hardforkBlockBN(e);return!(!o||!t.gte(o))},Common.prototype.activeOnBlock=function(e,t){return this.hardforkIsActiveOnBlock(null,e,t)},Common.prototype.hardforkGteHardfork=function(e,t,a){var r,n;void 0===a&&(a={});var o,c=void 0!==a.onlyActive&&a.onlyActive;e=this._chooseHardfork(e,a.onlySupported),o=c?this.activeHardforks(null,a):this.hardforks();var s=-1,b=-1,u=0;try{for(var h=d(o),l=h.next();!l.done;l=h.next()){var g=l.value;g.name===e&&(s=u),g.name===t&&(b=u),u+=1}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}return s>=b&&-1!==b},Common.prototype.gteHardfork=function(e,t){return this.hardforkGteHardfork(null,e,t)},Common.prototype.hardforkIsActiveOnChain=function(e,t){var a,r,n;void 0===t&&(t={});var o=null!==(n=t.onlySupported)&&void 0!==n&&n;e=this._chooseHardfork(e,o);try{for(var c=d(this.hardforks()),s=c.next();!s.done;s=c.next()){var b=s.value;if(b.name===e&&null!==b.block)return!0}}catch(e){a={error:e}}finally{try{s&&!s.done&&(r=c.return)&&r.call(c)}finally{if(a)throw a.error}}return!1},Common.prototype.activeHardforks=function(e,t){var a,r;void 0===t&&(t={});var n=[],o=this.hardforks();try{for(var c=d(o),s=c.next();!s.done;s=c.next()){var b=s.value;if(null!==b.block){if(null!=e&&e0)return a[a.length-1].name;throw new Error("No (supported) active hardfork found")},Common.prototype.hardforkBlock=function(e){var t=this.hardforkBlockBN(e);return(0,l.toType)(t,l.TypeOutput.Number)},Common.prototype.hardforkBlockBN=function(e){e=this._chooseHardfork(e,!1);var t=this._getHardfork(e).block;return null==t?null:new l.BN(t)},Common.prototype.hardforkTD=function(e){e=this._chooseHardfork(e,!1);var t=this._getHardfork(e).td;return null==t?null:new l.BN(t)},Common.prototype.isHardforkBlock=function(e,t){e=(0,l.toType)(e,l.TypeOutput.BN),t=this._chooseHardfork(t,!1);var a=this.hardforkBlockBN(t);return!!a&&a.eq(e)},Common.prototype.nextHardforkBlock=function(e){var t=this.nextHardforkBlockBN(e);return(0,l.toType)(t,l.TypeOutput.Number)},Common.prototype.nextHardforkBlockBN=function(e){e=this._chooseHardfork(e,!1);var t=this.hardforkBlockBN(e);return null===t?null:this.hardforks().reduce((function(e,a){var r=new l.BN(a.block);return r.gt(t)&&null===e?r:e}),null)},Common.prototype.isNextHardforkBlock=function(e,t){e=(0,l.toType)(e,l.TypeOutput.BN),t=this._chooseHardfork(t,!1);var a=this.nextHardforkBlockBN(t);return null!==a&&a.eq(e)},Common.prototype._calcForkHash=function(e){var t,a,r=n.from(this.genesis().hash.substr(2),"hex"),o=n.alloc(0),c=0;try{for(var s=d(this.hardforks()),b=s.next();!b.done;b=s.next()){var u=b.value,g=u.block;if(0!==g&&null!==g&&g!==c){var p=n.from(g.toString(16).padStart(16,"0"),"hex");o=n.concat([o,p])}if(u.name===e)break;null!==g&&(c=g)}}catch(e){t={error:e}}finally{try{b&&!b.done&&(a=s.return)&&a.call(s)}finally{if(t)throw t.error}}var B=n.concat([r,o]),x=(0,l.intToBuffer)((0,h.buf)(B)>>>0).toString("hex");return"0x".concat(x)},Common.prototype.forkHash=function(e){e=this._chooseHardfork(e,!1);var t=this._getHardfork(e);if(null===t.block&&void 0===t.td){throw new Error("No fork hash calculation possible for future hardfork")}return void 0!==t.forkHash?t.forkHash:this._calcForkHash(e)},Common.prototype.hardforkForForkHash=function(e){var t=this.hardforks().filter((function(t){return t.forkHash===e}));return t.length>=1?t[t.length-1]:null},Common.prototype.genesis=function(){return this._chainParams.genesis},Common.prototype.genesisState=function(){var e,t;switch(this.chainName()){case"mainnet":return a(1713);case"ropsten":return a(1714);case"rinkeby":return a(1715);case"kovan":return a(1716);case"goerli":return a(1717);case"sepolia":return a(1718)}if(this._customChains&&this._customChains.length>0&&Array.isArray(this._customChains[0]))try{for(var r=d(this._customChains),n=r.next();!n.done;n=r.next()){var o=n.value;if(o[0].name===this.chainName())return o[1]}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return{}},Common.prototype.hardforks=function(){return this._chainParams.hardforks},Common.prototype.bootstrapNodes=function(){return this._chainParams.bootstrapNodes},Common.prototype.dnsNetworks=function(){return this._chainParams.dnsNetworks},Common.prototype.hardfork=function(){return this._hardfork},Common.prototype.chainId=function(){return(0,l.toType)(this.chainIdBN(),l.TypeOutput.Number)},Common.prototype.chainIdBN=function(){return new l.BN(this._chainParams.chainId)},Common.prototype.chainName=function(){return this._chainParams.name},Common.prototype.networkId=function(){return(0,l.toType)(this.networkIdBN(),l.TypeOutput.Number)},Common.prototype.networkIdBN=function(){return new l.BN(this._chainParams.networkId)},Common.prototype.eips=function(){return this._eips},Common.prototype.consensusType=function(){var e,t,a,r=this.hardfork();try{for(var n=d(p.hardforks),o=n.next();!o.done;o=n.next()){var c=o.value;if("consensus"in c[1]&&(a=c[1].consensus.type),c[0]===r)break}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return a||this._chainParams.consensus.type},Common.prototype.consensusAlgorithm=function(){var e,t,a,r=this.hardfork();try{for(var n=d(p.hardforks),o=n.next();!o.done;o=n.next()){var c=o.value;if("consensus"in c[1]&&(a=c[1].consensus.algorithm),c[0]===r)break}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return a||this._chainParams.consensus.algorithm},Common.prototype.consensusConfig=function(){var e,t,a,r=this.hardfork();try{for(var n=d(p.hardforks),o=n.next();!o.done;o=n.next()){var c=o.value;if("consensus"in c[1]&&(a=c[1].consensus[c[1].consensus.algorithm]),c[0]===r)break}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}if(a)return a;var s=this.consensusAlgorithm();return this._chainParams.consensus[s]},Common.prototype.copy=function(){var e=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return e.removeAllListeners(),e},Common}(u.EventEmitter);t.default=x},e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},(e,t,a)=>{var r=a(8),n=r.Buffer;function copyProps(e,t){for(var a in e)t[a]=e[a]}function SafeBuffer(e,t,a){return n(e,t,a)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(copyProps(r,t),t.Buffer=SafeBuffer),SafeBuffer.prototype=Object.create(n.prototype),copyProps(n,SafeBuffer),SafeBuffer.from=function(e,t,a){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,a)},SafeBuffer.alloc=function(e,t,a){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=n(e);return void 0!==t?"string"==typeof a?r.fill(t,a):r.fill(t):r.fill(0),r},SafeBuffer.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},SafeBuffer.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},(e,t,a)=>{var r=a(10),n=r.Buffer;function copyProps(e,t){for(var a in e)t[a]=e[a]}function SafeBuffer(e,t,a){return n(e,t,a)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(copyProps(r,t),t.Buffer=SafeBuffer),SafeBuffer.prototype=Object.create(n.prototype),copyProps(n,SafeBuffer),SafeBuffer.from=function(e,t,a){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,a)},SafeBuffer.alloc=function(e,t,a){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=n(e);return void 0!==t?"string"==typeof a?r.fill(t,a):r.fill(t):r.fill(0),r},SafeBuffer.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},SafeBuffer.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},(e,t,a)=>{var r=a(2),n=r.Buffer;function copyProps(e,t){for(var a in e)t[a]=e[a]}function SafeBuffer(e,t,a){return n(e,t,a)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(copyProps(r,t),t.Buffer=SafeBuffer),SafeBuffer.prototype=Object.create(n.prototype),copyProps(n,SafeBuffer),SafeBuffer.from=function(e,t,a){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,a)},SafeBuffer.alloc=function(e,t,a){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=n(e);return void 0!==t?"string"==typeof a?r.fill(t,a):r.fill(t):r.fill(0),r},SafeBuffer.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},SafeBuffer.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},(e,t,a)=>{var r=a(2),n=r.Buffer;function copyProps(e,t){for(var a in e)t[a]=e[a]}function SafeBuffer(e,t,a){return n(e,t,a)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(copyProps(r,t),t.Buffer=SafeBuffer),SafeBuffer.prototype=Object.create(n.prototype),copyProps(n,SafeBuffer),SafeBuffer.from=function(e,t,a){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,a)},SafeBuffer.alloc=function(e,t,a){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=n(e);return void 0!==t?"string"==typeof a?r.fill(t,a):r.fill(t):r.fill(0),r},SafeBuffer.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},SafeBuffer.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},e=>{function assert(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=assert,assert.equal=function assertEqual(e,t,a){if(e!=t)throw new Error(a||"Assertion failed: "+e+" != "+t)}},(e,t,a)=>{"use strict";var r=t,n=a(60),o=a(38),c=a(393);r.assert=o,r.toArray=c.toArray,r.zero2=c.zero2,r.toHex=c.toHex,r.encode=c.encode,r.getNAF=function getNAF(e,t,a){var r=new Array(Math.max(e.bitLength(),a)+1);r.fill(0);for(var n=1<(n>>1)-1?(n>>1)-s:s,o.isubn(d)):d=0,r[c]=d,o.iushrn(1)}return r},r.getJSF=function getJSF(e,t){var a=[[],[]];e=e.clone(),t=t.clone();for(var r,n=0,o=0;e.cmpn(-n)>0||t.cmpn(-o)>0;){var c,d,s=e.andln(3)+n&3,b=t.andln(3)+o&3;3===s&&(s=-1),3===b&&(b=-1),c=0==(1&s)?0:3!==(r=e.andln(7)+n&7)&&5!==r||2!==b?s:-s,a[0].push(c),d=0==(1&b)?0:3!==(r=t.andln(7)+o&7)&&5!==r||2!==s?b:-b,a[1].push(d),2*n===c+1&&(n=1-n),2*o===d+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return a},r.cachedProperty=function cachedProperty(e,t,a){var r="_"+t;e.prototype[t]=function cachedProperty(){return void 0!==this[r]?this[r]:this[r]=a.call(this)}},r.parseBytes=function parseBytes(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function intFromLE(e){return new n(e,"hex","le")}},(e,t,a)=>{"use strict";var r=t,n=a(61),o=a(87),c=a(409);r.assert=o,r.toArray=c.toArray,r.zero2=c.zero2,r.toHex=c.toHex,r.encode=c.encode,r.getNAF=function getNAF(e,t,a){var r=new Array(Math.max(e.bitLength(),a)+1);r.fill(0);for(var n=1<(n>>1)-1?(n>>1)-s:s,o.isubn(d)):d=0,r[c]=d,o.iushrn(1)}return r},r.getJSF=function getJSF(e,t){var a=[[],[]];e=e.clone(),t=t.clone();for(var r,n=0,o=0;e.cmpn(-n)>0||t.cmpn(-o)>0;){var c,d,s=e.andln(3)+n&3,b=t.andln(3)+o&3;3===s&&(s=-1),3===b&&(b=-1),c=0==(1&s)?0:3!==(r=e.andln(7)+n&7)&&5!==r||2!==b?s:-s,a[0].push(c),d=0==(1&b)?0:3!==(r=t.andln(7)+o&7)&&5!==r||2!==s?b:-b,a[1].push(d),2*n===c+1&&(n=1-n),2*o===d+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return a},r.cachedProperty=function cachedProperty(e,t,a){var r="_"+t;e.prototype[t]=function cachedProperty(){return void 0!==this[r]?this[r]:this[r]=a.call(this)}},r.parseBytes=function parseBytes(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function intFromLE(e){return new n(e,"hex","le")}},(e,t,a)=>{"use strict";var r=t,n=a(62),o=a(88),c=a(436);r.assert=o,r.toArray=c.toArray,r.zero2=c.zero2,r.toHex=c.toHex,r.encode=c.encode,r.getNAF=function getNAF(e,t,a){var r=new Array(Math.max(e.bitLength(),a)+1);r.fill(0);for(var n=1<(n>>1)-1?(n>>1)-s:s,o.isubn(d)):d=0,r[c]=d,o.iushrn(1)}return r},r.getJSF=function getJSF(e,t){var a=[[],[]];e=e.clone(),t=t.clone();for(var r,n=0,o=0;e.cmpn(-n)>0||t.cmpn(-o)>0;){var c,d,s=e.andln(3)+n&3,b=t.andln(3)+o&3;3===s&&(s=-1),3===b&&(b=-1),c=0==(1&s)?0:3!==(r=e.andln(7)+n&7)&&5!==r||2!==b?s:-s,a[0].push(c),d=0==(1&b)?0:3!==(r=t.andln(7)+o&7)&&5!==r||2!==s?b:-b,a[1].push(d),2*n===c+1&&(n=1-n),2*o===d+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return a},r.cachedProperty=function cachedProperty(e,t,a){var r="_"+t;e.prototype[t]=function cachedProperty(){return void 0!==this[r]?this[r]:this[r]=a.call(this)}},r.parseBytes=function parseBytes(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function intFromLE(e){return new n(e,"hex","le")}},(e,t,a)=>{"use strict";var r=t,n=a(63),o=a(89),c=a(453);r.assert=o,r.toArray=c.toArray,r.zero2=c.zero2,r.toHex=c.toHex,r.encode=c.encode,r.getNAF=function getNAF(e,t,a){var r=new Array(Math.max(e.bitLength(),a)+1);r.fill(0);for(var n=1<(n>>1)-1?(n>>1)-s:s,o.isubn(d)):d=0,r[c]=d,o.iushrn(1)}return r},r.getJSF=function getJSF(e,t){var a=[[],[]];e=e.clone(),t=t.clone();for(var r,n=0,o=0;e.cmpn(-n)>0||t.cmpn(-o)>0;){var c,d,s=e.andln(3)+n&3,b=t.andln(3)+o&3;3===s&&(s=-1),3===b&&(b=-1),c=0==(1&s)?0:3!==(r=e.andln(7)+n&7)&&5!==r||2!==b?s:-s,a[0].push(c),d=0==(1&b)?0:3!==(r=t.andln(7)+o&7)&&5!==r||2!==s?b:-b,a[1].push(d),2*n===c+1&&(n=1-n),2*o===d+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return a},r.cachedProperty=function cachedProperty(e,t,a){var r="_"+t;e.prototype[t]=function cachedProperty(){return void 0!==this[r]?this[r]:this[r]=a.call(this)}},r.parseBytes=function parseBytes(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function intFromLE(e){return new n(e,"hex","le")}},(e,t,a)=>{"use strict";var r=t,n=a(64),o=a(90),c=a(458);r.assert=o,r.toArray=c.toArray,r.zero2=c.zero2,r.toHex=c.toHex,r.encode=c.encode,r.getNAF=function getNAF(e,t,a){var r=new Array(Math.max(e.bitLength(),a)+1);r.fill(0);for(var n=1<(n>>1)-1?(n>>1)-s:s,o.isubn(d)):d=0,r[c]=d,o.iushrn(1)}return r},r.getJSF=function getJSF(e,t){var a=[[],[]];e=e.clone(),t=t.clone();for(var r,n=0,o=0;e.cmpn(-n)>0||t.cmpn(-o)>0;){var c,d,s=e.andln(3)+n&3,b=t.andln(3)+o&3;3===s&&(s=-1),3===b&&(b=-1),c=0==(1&s)?0:3!==(r=e.andln(7)+n&7)&&5!==r||2!==b?s:-s,a[0].push(c),d=0==(1&b)?0:3!==(r=t.andln(7)+o&7)&&5!==r||2!==s?b:-b,a[1].push(d),2*n===c+1&&(n=1-n),2*o===d+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return a},r.cachedProperty=function cachedProperty(e,t,a){var r="_"+t;e.prototype[t]=function cachedProperty(){return void 0!==this[r]?this[r]:this[r]=a.call(this)}},r.parseBytes=function parseBytes(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function intFromLE(e){return new n(e,"hex","le")}},(e,t,a)=>{"use strict";var r=t,n=a(29),o=a(91),c=a(473);r.assert=o,r.toArray=c.toArray,r.zero2=c.zero2,r.toHex=c.toHex,r.encode=c.encode,r.getNAF=function getNAF(e,t,a){var r=new Array(Math.max(e.bitLength(),a)+1);r.fill(0);for(var n=1<(n>>1)-1?(n>>1)-s:s,o.isubn(d)):d=0,r[c]=d,o.iushrn(1)}return r},r.getJSF=function getJSF(e,t){var a=[[],[]];e=e.clone(),t=t.clone();for(var r,n=0,o=0;e.cmpn(-n)>0||t.cmpn(-o)>0;){var c,d,s=e.andln(3)+n&3,b=t.andln(3)+o&3;3===s&&(s=-1),3===b&&(b=-1),c=0==(1&s)?0:3!==(r=e.andln(7)+n&7)&&5!==r||2!==b?s:-s,a[0].push(c),d=0==(1&b)?0:3!==(r=t.andln(7)+o&7)&&5!==r||2!==s?b:-b,a[1].push(d),2*n===c+1&&(n=1-n),2*o===d+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return a},r.cachedProperty=function cachedProperty(e,t,a){var r="_"+t;e.prototype[t]=function cachedProperty(){return void 0!==this[r]?this[r]:this[r]=a.call(this)}},r.parseBytes=function parseBytes(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function intFromLE(e){return new n(e,"hex","le")}},(e,t,a)=>{"use strict";var r=t,n=a(65),o=a(93),c=a(512);r.assert=o,r.toArray=c.toArray,r.zero2=c.zero2,r.toHex=c.toHex,r.encode=c.encode,r.getNAF=function getNAF(e,t,a){var r=new Array(Math.max(e.bitLength(),a)+1);r.fill(0);for(var n=1<(n>>1)-1?(n>>1)-s:s,o.isubn(d)):d=0,r[c]=d,o.iushrn(1)}return r},r.getJSF=function getJSF(e,t){var a=[[],[]];e=e.clone(),t=t.clone();for(var r,n=0,o=0;e.cmpn(-n)>0||t.cmpn(-o)>0;){var c,d,s=e.andln(3)+n&3,b=t.andln(3)+o&3;3===s&&(s=-1),3===b&&(b=-1),c=0==(1&s)?0:3!==(r=e.andln(7)+n&7)&&5!==r||2!==b?s:-s,a[0].push(c),d=0==(1&b)?0:3!==(r=t.andln(7)+o&7)&&5!==r||2!==s?b:-b,a[1].push(d),2*n===c+1&&(n=1-n),2*o===d+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return a},r.cachedProperty=function cachedProperty(e,t,a){var r="_"+t;e.prototype[t]=function cachedProperty(){return void 0!==this[r]?this[r]:this[r]=a.call(this)}},r.parseBytes=function parseBytes(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function intFromLE(e){return new n(e,"hex","le")}},(e,t,a)=>{"use strict";var r=a(1333);e.exports=function Type(e){return"symbol"==typeof e?"Symbol":"bigint"==typeof e?"BigInt":r(e)}},function(e,t,a){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a);var n=Object.getOwnPropertyDescriptor(t,a);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,r,n)}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),n=this&&this.__exportStar||function(e,t){for(var a in e)"default"===a||Object.prototype.hasOwnProperty.call(t,a)||r(t,e,a)};Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,n(a(350),t),n(a(326),t),n(a(738),t),n(a(207),t),n(a(1494),t),n(a(81),t),n(a(739),t),n(a(56),t),n(a(257),t);var o=a(129);Object.defineProperty(t,"isHexPrefixed",{enumerable:!0,get:function(){return o.isHexPrefixed}}),Object.defineProperty(t,"stripHexPrefix",{enumerable:!0,get:function(){return o.stripHexPrefix}}),Object.defineProperty(t,"padToEven",{enumerable:!0,get:function(){return o.padToEven}}),Object.defineProperty(t,"getBinarySize",{enumerable:!0,get:function(){return o.getBinarySize}}),Object.defineProperty(t,"arrayContainsArray",{enumerable:!0,get:function(){return o.arrayContainsArray}}),Object.defineProperty(t,"toAscii",{enumerable:!0,get:function(){return o.toAscii}}),Object.defineProperty(t,"fromUtf8",{enumerable:!0,get:function(){return o.fromUtf8}}),Object.defineProperty(t,"fromAscii",{enumerable:!0,get:function(){return o.fromAscii}}),Object.defineProperty(t,"getKeys",{enumerable:!0,get:function(){return o.getKeys}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return o.isHexString}})},function(e,t,a){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a);var n=Object.getOwnPropertyDescriptor(t,a);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,r,n)}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),n=this&&this.__exportStar||function(e,t){for(var a in e)"default"===a||Object.prototype.hasOwnProperty.call(t,a)||r(t,e,a)};Object.defineProperty(t,"__esModule",{value:!0}),t.BlockHeader=t.Block=void 0;var o=a(624);Object.defineProperty(t,"Block",{enumerable:!0,get:function(){return o.Block}});var c=a(321);Object.defineProperty(t,"BlockHeader",{enumerable:!0,get:function(){return c.BlockHeader}}),n(a(1721),t)},(e,t,a)=>{e.exports=Stream;var r=a(13).EventEmitter;function Stream(){r.call(this)}a(6)(Stream,r),Stream.Readable=a(229),Stream.Writable=a(230),Stream.Duplex=a(119),Stream.Transform=a(231),Stream.PassThrough=a(378),Stream.finished=a(159),Stream.pipeline=a(379),Stream.Stream=Stream,Stream.prototype.pipe=function(e,t){var a=this;function ondata(t){e.writable&&!1===e.write(t)&&a.pause&&a.pause()}function ondrain(){a.readable&&a.resume&&a.resume()}a.on("data",ondata),e.on("drain",ondrain),e._isStdio||t&&!1===t.end||(a.on("end",onend),a.on("close",onclose));var n=!1;function onend(){n||(n=!0,e.end())}function onclose(){n||(n=!0,"function"==typeof e.destroy&&e.destroy())}function onerror(e){if(cleanup(),0===r.listenerCount(this,"error"))throw e}function cleanup(){a.removeListener("data",ondata),e.removeListener("drain",ondrain),a.removeListener("end",onend),a.removeListener("close",onclose),a.removeListener("error",onerror),e.removeListener("error",onerror),a.removeListener("end",cleanup),a.removeListener("close",cleanup),e.removeListener("close",cleanup)}return a.on("error",onerror),e.on("error",onerror),a.on("end",cleanup),a.on("close",cleanup),e.on("close",cleanup),e.emit("pipe",a),e}},(e,t,a)=>{var r=a(33);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debug=void 0;t.debug=()=>()=>{}},(e,t,a)=>{var check=function(e){return e&&e.Math==Math&&e};e.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof a.g&&a.g)||function(){return this}()||Function("return this")()},(e,t,a)=>{var r=a(52),n=a(566),o=a(74),c=a(301),d=a(565),s=a(564),b=n("wks"),u=r.Symbol,h=u&&u.for,l=s?u:u&&u.withoutSetter||c;e.exports=function(e){if(!o(b,e)||!d&&"string"!=typeof b[e]){var t="Symbol."+e;d&&o(u,e)?b[e]=u[e]:b[e]=s&&h?h(t):l(t)}return b[e]}},(e,t,a)=>{"use strict";var r=a(11),n=a(121),o=n(r("String.prototype.indexOf"));e.exports=function callBoundIntrinsic(e,t){var a=r(e,!!t);return"function"==typeof a&&o(e,".prototype.")>-1?n(a):a}},function(e,t,a){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a);var n=Object.getOwnPropertyDescriptor(t,a);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,r,n)}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&r(t,e,a);return n(t,e),t},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var d=c(a(728));t.BN=d.default;var s=o(a(246));t.rlp=s},function(e,t,a){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a);var n=Object.getOwnPropertyDescriptor(t,a);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,r,n)}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&r(t,e,a);return n(t,e),t},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var d=c(a(358));t.BN=d.default;var s=o(a(734));t.rlp=s},function(e,t,a){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a);var n=Object.getOwnPropertyDescriptor(t,a);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,r,n)}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&r(t,e,a);return n(t,e),t},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var d=c(a(360));t.BN=d.default;var s=o(a(740));t.rlp=s},function(e,t,a){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a);var n=Object.getOwnPropertyDescriptor(t,a);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,r,n)}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&r(t,e,a);return n(t,e),t},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var d=c(a(746));t.BN=d.default;var s=o(a(158));t.rlp=s},function(e,t,a){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a);var n=Object.getOwnPropertyDescriptor(t,a);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,r,n)}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&r(t,e,a);return n(t,e),t},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var d=c(a(363));t.BN=d.default;var s=o(a(764));t.rlp=s},function(e,t,a){!function(e,t){"use strict";function assert(e,t){if(!e)throw new Error(t||"Assertion failed")}function inherits(e,t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype,e.prototype=new TempCtor,e.prototype.constructor=e}function BN(e,t,a){if(BN.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(a=t,t=10),this._init(e||0,t||10,a||"be"))}var r;"object"==typeof e?e.exports=BN:t.BN=BN,BN.BN=BN,BN.wordSize=26;try{r="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:a(1431).Buffer}catch(e){}function parseHex4Bits(e,t){var a=e.charCodeAt(t);return a>=65&&a<=70?a-55:a>=97&&a<=102?a-87:a-48&15}function parseHexByte(e,t,a){var r=parseHex4Bits(e,a);return a-1>=t&&(r|=parseHex4Bits(e,a-1)<<4),r}function parseBase(e,t,a,r){for(var n=0,o=Math.min(e.length,a),c=t;c=49?d-49+10:d>=17?d-17+10:d}return n}BN.isBN=function isBN(e){return e instanceof BN||null!==e&&"object"==typeof e&&e.constructor.wordSize===BN.wordSize&&Array.isArray(e.words)},BN.max=function max(e,t){return e.cmp(t)>0?e:t},BN.min=function min(e,t){return e.cmp(t)<0?e:t},BN.prototype._init=function init(e,t,a){if("number"==typeof e)return this._initNumber(e,t,a);if("object"==typeof e)return this._initArray(e,t,a);"hex"===t&&(t=16),assert(t===(0|t)&&t>=2&&t<=36);var r=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(r++,this.negative=1),r=0;r-=3)o=e[r]|e[r-1]<<8|e[r-2]<<16,this.words[n]|=o<>>26-c&67108863,(c+=24)>=26&&(c-=26,n++);else if("le"===a)for(r=0,n=0;r>>26-c&67108863,(c+=24)>=26&&(c-=26,n++);return this.strip()},BN.prototype._parseHex=function _parseHex(e,t,a){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)n=parseHexByte(e,t,r)<=18?(o-=18,c+=1,this.words[c]|=n>>>26):o+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(o-=18,c+=1,this.words[c]|=n>>>26):o+=8;this.strip()},BN.prototype._parseBase=function _parseBase(e,t,a){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var o=e.length-a,c=o%r,d=Math.min(o,o-c)+a,s=0,b=a;b1&&0===this.words[this.length-1];)this.length--;return this._normSign()},BN.prototype._normSign=function _normSign(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},BN.prototype.inspect=function inspect(){return(this.red?""};var n=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],o=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function smallMulTo(e,t,a){a.negative=t.negative^e.negative;var r=e.length+t.length|0;a.length=r,r=r-1|0;var n=0|e.words[0],o=0|t.words[0],c=n*o,d=67108863&c,s=c/67108864|0;a.words[0]=d;for(var b=1;b>>26,h=67108863&s,l=Math.min(b,t.length-1),g=Math.max(0,b-e.length+1);g<=l;g++){var p=b-g|0;u+=(c=(n=0|e.words[p])*(o=0|t.words[g])+h)/67108864|0,h=67108863&c}a.words[b]=0|h,s=0|u}return 0!==s?a.words[b]=0|s:a.length--,a.strip()}BN.prototype.toString=function toString(e,t){var a;if(t=0|t||1,16===(e=e||10)||"hex"===e){a="";for(var r=0,d=0,s=0;s>>24-r&16777215)||s!==this.length-1?n[6-u.length]+u+a:u+a,(r+=2)>=26&&(r-=26,s--)}for(0!==d&&(a=d.toString(16)+a);a.length%t!=0;)a="0"+a;return 0!==this.negative&&(a="-"+a),a}if(e===(0|e)&&e>=2&&e<=36){var h=o[e],l=c[e];a="";var g=this.clone();for(g.negative=0;!g.isZero();){var p=g.modn(l).toString(e);a=(g=g.idivn(l)).isZero()?p+a:n[h-p.length]+p+a}for(this.isZero()&&(a="0"+a);a.length%t!=0;)a="0"+a;return 0!==this.negative&&(a="-"+a),a}assert(!1,"Base should be between 2 and 36")},BN.prototype.toNumber=function toNumber(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&assert(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},BN.prototype.toJSON=function toJSON(){return this.toString(16)},BN.prototype.toBuffer=function toBuffer(e,t){return assert(void 0!==r),this.toArrayLike(r,e,t)},BN.prototype.toArray=function toArray(e,t){return this.toArrayLike(Array,e,t)},BN.prototype.toArrayLike=function toArrayLike(e,t,a){var r=this.byteLength(),n=a||Math.max(1,r);assert(r<=n,"byte array longer than desired length"),assert(n>0,"Requested array length <= 0"),this.strip();var o,c,d="le"===t,s=new e(n),b=this.clone();if(d){for(c=0;!b.isZero();c++)o=b.andln(255),b.iushrn(8),s[c]=o;for(;c=4096&&(a+=13,t>>>=13),t>=64&&(a+=7,t>>>=7),t>=8&&(a+=4,t>>>=4),t>=2&&(a+=2,t>>>=2),a+t},BN.prototype._zeroBits=function _zeroBits(e){if(0===e)return 26;var t=e,a=0;return 0==(8191&t)&&(a+=13,t>>>=13),0==(127&t)&&(a+=7,t>>>=7),0==(15&t)&&(a+=4,t>>>=4),0==(3&t)&&(a+=2,t>>>=2),0==(1&t)&&a++,a},BN.prototype.bitLength=function bitLength(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},BN.prototype.uor=function uor(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},BN.prototype.iuand=function iuand(e){var t;t=this.length>e.length?e:this;for(var a=0;ae.length?this.clone().iand(e):e.clone().iand(this)},BN.prototype.uand=function uand(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},BN.prototype.iuxor=function iuxor(e){var t,a;this.length>e.length?(t=this,a=e):(t=e,a=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},BN.prototype.uxor=function uxor(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},BN.prototype.inotn=function inotn(e){assert("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),a=e%26;this._expand(t),a>0&&t--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-a),this.strip()},BN.prototype.notn=function notn(e){return this.clone().inotn(e)},BN.prototype.setn=function setn(e,t){assert("number"==typeof e&&e>=0);var a=e/26|0,r=e%26;return this._expand(a+1),this.words[a]=t?this.words[a]|1<e.length?(a=this,r=e):(a=e,r=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=a.length,0!==n)this.words[this.length]=n,this.length++;else if(a!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},BN.prototype.isub=function isub(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var a,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(a=this,r=e):(a=e,r=this);for(var o=0,c=0;c>26,this.words[c]=67108863&t;for(;0!==o&&c>26,this.words[c]=67108863&t;if(0===o&&c>>13,g=0|c[1],p=8191&g,B=g>>>13,x=0|c[2],m=8191&x,I=x>>>13,y=0|c[3],C=8191&y,w=y>>>13,v=0|c[4],Q=8191&v,_=v>>>13,k=0|c[5],N=8191&k,D=k>>>13,G=0|c[6],T=8191&G,L=G>>>13,P=0|c[7],U=8191&P,q=P>>>13,O=0|c[8],H=8191&O,z=O>>>13,j=0|c[9],J=8191&j,Y=j>>>13,W=0|d[0],V=8191&W,X=W>>>13,$=0|d[1],et=8191&$,tt=$>>>13,at=0|d[2],rt=8191&at,it=at>>>13,nt=0|d[3],ot=8191&nt,ct=nt>>>13,dt=0|d[4],st=8191&dt,At=dt>>>13,bt=0|d[5],ut=8191&bt,ht=bt>>>13,pt=0|d[6],Bt=8191&pt,xt=pt>>>13,mt=0|d[7],It=8191&mt,Et=mt>>>13,yt=0|d[8],Ct=8191&yt,wt=yt>>>13,vt=0|d[9],Qt=8191&vt,Mt=vt>>>13;a.negative=e.negative^t.negative,a.length=19;var _t=(b+(r=Math.imul(h,V))|0)+((8191&(n=(n=Math.imul(h,X))+Math.imul(l,V)|0))<<13)|0;b=((o=Math.imul(l,X))+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(p,V),n=(n=Math.imul(p,X))+Math.imul(B,V)|0,o=Math.imul(B,X);var kt=(b+(r=r+Math.imul(h,et)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(l,et)|0))<<13)|0;b=((o=o+Math.imul(l,tt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(m,V),n=(n=Math.imul(m,X))+Math.imul(I,V)|0,o=Math.imul(I,X),r=r+Math.imul(p,et)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(B,et)|0,o=o+Math.imul(B,tt)|0;var St=(b+(r=r+Math.imul(h,rt)|0)|0)+((8191&(n=(n=n+Math.imul(h,it)|0)+Math.imul(l,rt)|0))<<13)|0;b=((o=o+Math.imul(l,it)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(C,V),n=(n=Math.imul(C,X))+Math.imul(w,V)|0,o=Math.imul(w,X),r=r+Math.imul(m,et)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(I,et)|0,o=o+Math.imul(I,tt)|0,r=r+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,it)|0;var Nt=(b+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,ct)|0)+Math.imul(l,ot)|0))<<13)|0;b=((o=o+Math.imul(l,ct)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,r=Math.imul(Q,V),n=(n=Math.imul(Q,X))+Math.imul(_,V)|0,o=Math.imul(_,X),r=r+Math.imul(C,et)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(w,et)|0,o=o+Math.imul(w,tt)|0,r=r+Math.imul(m,rt)|0,n=(n=n+Math.imul(m,it)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,it)|0,r=r+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,ct)|0;var Dt=(b+(r=r+Math.imul(h,st)|0)|0)+((8191&(n=(n=n+Math.imul(h,At)|0)+Math.imul(l,st)|0))<<13)|0;b=((o=o+Math.imul(l,At)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,r=Math.imul(N,V),n=(n=Math.imul(N,X))+Math.imul(D,V)|0,o=Math.imul(D,X),r=r+Math.imul(Q,et)|0,n=(n=n+Math.imul(Q,tt)|0)+Math.imul(_,et)|0,o=o+Math.imul(_,tt)|0,r=r+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(w,rt)|0,o=o+Math.imul(w,it)|0,r=r+Math.imul(m,ot)|0,n=(n=n+Math.imul(m,ct)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,ct)|0,r=r+Math.imul(p,st)|0,n=(n=n+Math.imul(p,At)|0)+Math.imul(B,st)|0,o=o+Math.imul(B,At)|0;var Rt=(b+(r=r+Math.imul(h,ut)|0)|0)+((8191&(n=(n=n+Math.imul(h,ht)|0)+Math.imul(l,ut)|0))<<13)|0;b=((o=o+Math.imul(l,ht)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(T,V),n=(n=Math.imul(T,X))+Math.imul(L,V)|0,o=Math.imul(L,X),r=r+Math.imul(N,et)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(D,et)|0,o=o+Math.imul(D,tt)|0,r=r+Math.imul(Q,rt)|0,n=(n=n+Math.imul(Q,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0,r=r+Math.imul(C,ot)|0,n=(n=n+Math.imul(C,ct)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,ct)|0,r=r+Math.imul(m,st)|0,n=(n=n+Math.imul(m,At)|0)+Math.imul(I,st)|0,o=o+Math.imul(I,At)|0,r=r+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ht)|0;var Ft=(b+(r=r+Math.imul(h,Bt)|0)|0)+((8191&(n=(n=n+Math.imul(h,xt)|0)+Math.imul(l,Bt)|0))<<13)|0;b=((o=o+Math.imul(l,xt)|0)+(n>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,r=Math.imul(U,V),n=(n=Math.imul(U,X))+Math.imul(q,V)|0,o=Math.imul(q,X),r=r+Math.imul(T,et)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(L,et)|0,o=o+Math.imul(L,tt)|0,r=r+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(D,rt)|0,o=o+Math.imul(D,it)|0,r=r+Math.imul(Q,ot)|0,n=(n=n+Math.imul(Q,ct)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,ct)|0,r=r+Math.imul(C,st)|0,n=(n=n+Math.imul(C,At)|0)+Math.imul(w,st)|0,o=o+Math.imul(w,At)|0,r=r+Math.imul(m,ut)|0,n=(n=n+Math.imul(m,ht)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ht)|0,r=r+Math.imul(p,Bt)|0,n=(n=n+Math.imul(p,xt)|0)+Math.imul(B,Bt)|0,o=o+Math.imul(B,xt)|0;var Gt=(b+(r=r+Math.imul(h,It)|0)|0)+((8191&(n=(n=n+Math.imul(h,Et)|0)+Math.imul(l,It)|0))<<13)|0;b=((o=o+Math.imul(l,Et)|0)+(n>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,r=Math.imul(H,V),n=(n=Math.imul(H,X))+Math.imul(z,V)|0,o=Math.imul(z,X),r=r+Math.imul(U,et)|0,n=(n=n+Math.imul(U,tt)|0)+Math.imul(q,et)|0,o=o+Math.imul(q,tt)|0,r=r+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,r=r+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,ct)|0,r=r+Math.imul(Q,st)|0,n=(n=n+Math.imul(Q,At)|0)+Math.imul(_,st)|0,o=o+Math.imul(_,At)|0,r=r+Math.imul(C,ut)|0,n=(n=n+Math.imul(C,ht)|0)+Math.imul(w,ut)|0,o=o+Math.imul(w,ht)|0,r=r+Math.imul(m,Bt)|0,n=(n=n+Math.imul(m,xt)|0)+Math.imul(I,Bt)|0,o=o+Math.imul(I,xt)|0,r=r+Math.imul(p,It)|0,n=(n=n+Math.imul(p,Et)|0)+Math.imul(B,It)|0,o=o+Math.imul(B,Et)|0;var Tt=(b+(r=r+Math.imul(h,Ct)|0)|0)+((8191&(n=(n=n+Math.imul(h,wt)|0)+Math.imul(l,Ct)|0))<<13)|0;b=((o=o+Math.imul(l,wt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(J,V),n=(n=Math.imul(J,X))+Math.imul(Y,V)|0,o=Math.imul(Y,X),r=r+Math.imul(H,et)|0,n=(n=n+Math.imul(H,tt)|0)+Math.imul(z,et)|0,o=o+Math.imul(z,tt)|0,r=r+Math.imul(U,rt)|0,n=(n=n+Math.imul(U,it)|0)+Math.imul(q,rt)|0,o=o+Math.imul(q,it)|0,r=r+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,ct)|0,r=r+Math.imul(N,st)|0,n=(n=n+Math.imul(N,At)|0)+Math.imul(D,st)|0,o=o+Math.imul(D,At)|0,r=r+Math.imul(Q,ut)|0,n=(n=n+Math.imul(Q,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,r=r+Math.imul(C,Bt)|0,n=(n=n+Math.imul(C,xt)|0)+Math.imul(w,Bt)|0,o=o+Math.imul(w,xt)|0,r=r+Math.imul(m,It)|0,n=(n=n+Math.imul(m,Et)|0)+Math.imul(I,It)|0,o=o+Math.imul(I,Et)|0,r=r+Math.imul(p,Ct)|0,n=(n=n+Math.imul(p,wt)|0)+Math.imul(B,Ct)|0,o=o+Math.imul(B,wt)|0;var Lt=(b+(r=r+Math.imul(h,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(h,Mt)|0)+Math.imul(l,Qt)|0))<<13)|0;b=((o=o+Math.imul(l,Mt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,r=Math.imul(J,et),n=(n=Math.imul(J,tt))+Math.imul(Y,et)|0,o=Math.imul(Y,tt),r=r+Math.imul(H,rt)|0,n=(n=n+Math.imul(H,it)|0)+Math.imul(z,rt)|0,o=o+Math.imul(z,it)|0,r=r+Math.imul(U,ot)|0,n=(n=n+Math.imul(U,ct)|0)+Math.imul(q,ot)|0,o=o+Math.imul(q,ct)|0,r=r+Math.imul(T,st)|0,n=(n=n+Math.imul(T,At)|0)+Math.imul(L,st)|0,o=o+Math.imul(L,At)|0,r=r+Math.imul(N,ut)|0,n=(n=n+Math.imul(N,ht)|0)+Math.imul(D,ut)|0,o=o+Math.imul(D,ht)|0,r=r+Math.imul(Q,Bt)|0,n=(n=n+Math.imul(Q,xt)|0)+Math.imul(_,Bt)|0,o=o+Math.imul(_,xt)|0,r=r+Math.imul(C,It)|0,n=(n=n+Math.imul(C,Et)|0)+Math.imul(w,It)|0,o=o+Math.imul(w,Et)|0,r=r+Math.imul(m,Ct)|0,n=(n=n+Math.imul(m,wt)|0)+Math.imul(I,Ct)|0,o=o+Math.imul(I,wt)|0;var Pt=(b+(r=r+Math.imul(p,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(p,Mt)|0)+Math.imul(B,Qt)|0))<<13)|0;b=((o=o+Math.imul(B,Mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,r=Math.imul(J,rt),n=(n=Math.imul(J,it))+Math.imul(Y,rt)|0,o=Math.imul(Y,it),r=r+Math.imul(H,ot)|0,n=(n=n+Math.imul(H,ct)|0)+Math.imul(z,ot)|0,o=o+Math.imul(z,ct)|0,r=r+Math.imul(U,st)|0,n=(n=n+Math.imul(U,At)|0)+Math.imul(q,st)|0,o=o+Math.imul(q,At)|0,r=r+Math.imul(T,ut)|0,n=(n=n+Math.imul(T,ht)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ht)|0,r=r+Math.imul(N,Bt)|0,n=(n=n+Math.imul(N,xt)|0)+Math.imul(D,Bt)|0,o=o+Math.imul(D,xt)|0,r=r+Math.imul(Q,It)|0,n=(n=n+Math.imul(Q,Et)|0)+Math.imul(_,It)|0,o=o+Math.imul(_,Et)|0,r=r+Math.imul(C,Ct)|0,n=(n=n+Math.imul(C,wt)|0)+Math.imul(w,Ct)|0,o=o+Math.imul(w,wt)|0;var Ut=(b+(r=r+Math.imul(m,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(m,Mt)|0)+Math.imul(I,Qt)|0))<<13)|0;b=((o=o+Math.imul(I,Mt)|0)+(n>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,r=Math.imul(J,ot),n=(n=Math.imul(J,ct))+Math.imul(Y,ot)|0,o=Math.imul(Y,ct),r=r+Math.imul(H,st)|0,n=(n=n+Math.imul(H,At)|0)+Math.imul(z,st)|0,o=o+Math.imul(z,At)|0,r=r+Math.imul(U,ut)|0,n=(n=n+Math.imul(U,ht)|0)+Math.imul(q,ut)|0,o=o+Math.imul(q,ht)|0,r=r+Math.imul(T,Bt)|0,n=(n=n+Math.imul(T,xt)|0)+Math.imul(L,Bt)|0,o=o+Math.imul(L,xt)|0,r=r+Math.imul(N,It)|0,n=(n=n+Math.imul(N,Et)|0)+Math.imul(D,It)|0,o=o+Math.imul(D,Et)|0,r=r+Math.imul(Q,Ct)|0,n=(n=n+Math.imul(Q,wt)|0)+Math.imul(_,Ct)|0,o=o+Math.imul(_,wt)|0;var qt=(b+(r=r+Math.imul(C,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(C,Mt)|0)+Math.imul(w,Qt)|0))<<13)|0;b=((o=o+Math.imul(w,Mt)|0)+(n>>>13)|0)+(qt>>>26)|0,qt&=67108863,r=Math.imul(J,st),n=(n=Math.imul(J,At))+Math.imul(Y,st)|0,o=Math.imul(Y,At),r=r+Math.imul(H,ut)|0,n=(n=n+Math.imul(H,ht)|0)+Math.imul(z,ut)|0,o=o+Math.imul(z,ht)|0,r=r+Math.imul(U,Bt)|0,n=(n=n+Math.imul(U,xt)|0)+Math.imul(q,Bt)|0,o=o+Math.imul(q,xt)|0,r=r+Math.imul(T,It)|0,n=(n=n+Math.imul(T,Et)|0)+Math.imul(L,It)|0,o=o+Math.imul(L,Et)|0,r=r+Math.imul(N,Ct)|0,n=(n=n+Math.imul(N,wt)|0)+Math.imul(D,Ct)|0,o=o+Math.imul(D,wt)|0;var Ot=(b+(r=r+Math.imul(Q,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(Q,Mt)|0)+Math.imul(_,Qt)|0))<<13)|0;b=((o=o+Math.imul(_,Mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(J,ut),n=(n=Math.imul(J,ht))+Math.imul(Y,ut)|0,o=Math.imul(Y,ht),r=r+Math.imul(H,Bt)|0,n=(n=n+Math.imul(H,xt)|0)+Math.imul(z,Bt)|0,o=o+Math.imul(z,xt)|0,r=r+Math.imul(U,It)|0,n=(n=n+Math.imul(U,Et)|0)+Math.imul(q,It)|0,o=o+Math.imul(q,Et)|0,r=r+Math.imul(T,Ct)|0,n=(n=n+Math.imul(T,wt)|0)+Math.imul(L,Ct)|0,o=o+Math.imul(L,wt)|0;var Ht=(b+(r=r+Math.imul(N,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(N,Mt)|0)+Math.imul(D,Qt)|0))<<13)|0;b=((o=o+Math.imul(D,Mt)|0)+(n>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,r=Math.imul(J,Bt),n=(n=Math.imul(J,xt))+Math.imul(Y,Bt)|0,o=Math.imul(Y,xt),r=r+Math.imul(H,It)|0,n=(n=n+Math.imul(H,Et)|0)+Math.imul(z,It)|0,o=o+Math.imul(z,Et)|0,r=r+Math.imul(U,Ct)|0,n=(n=n+Math.imul(U,wt)|0)+Math.imul(q,Ct)|0,o=o+Math.imul(q,wt)|0;var zt=(b+(r=r+Math.imul(T,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(T,Mt)|0)+Math.imul(L,Qt)|0))<<13)|0;b=((o=o+Math.imul(L,Mt)|0)+(n>>>13)|0)+(zt>>>26)|0,zt&=67108863,r=Math.imul(J,It),n=(n=Math.imul(J,Et))+Math.imul(Y,It)|0,o=Math.imul(Y,Et),r=r+Math.imul(H,Ct)|0,n=(n=n+Math.imul(H,wt)|0)+Math.imul(z,Ct)|0,o=o+Math.imul(z,wt)|0;var Kt=(b+(r=r+Math.imul(U,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(U,Mt)|0)+Math.imul(q,Qt)|0))<<13)|0;b=((o=o+Math.imul(q,Mt)|0)+(n>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,r=Math.imul(J,Ct),n=(n=Math.imul(J,wt))+Math.imul(Y,Ct)|0,o=Math.imul(Y,wt);var jt=(b+(r=r+Math.imul(H,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(H,Mt)|0)+Math.imul(z,Qt)|0))<<13)|0;b=((o=o+Math.imul(z,Mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Jt=(b+(r=Math.imul(J,Qt))|0)+((8191&(n=(n=Math.imul(J,Mt))+Math.imul(Y,Qt)|0))<<13)|0;return b=((o=Math.imul(Y,Mt))+(n>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,s[0]=_t,s[1]=kt,s[2]=St,s[3]=Nt,s[4]=Dt,s[5]=Rt,s[6]=Ft,s[7]=Gt,s[8]=Tt,s[9]=Lt,s[10]=Pt,s[11]=Ut,s[12]=qt,s[13]=Ot,s[14]=Ht,s[15]=zt,s[16]=Kt,s[17]=jt,s[18]=Jt,0!==b&&(s[19]=b,a.length++),a};function jumboMulTo(e,t,a){return(new FFTM).mulp(e,t,a)}function FFTM(e,t){this.x=e,this.y=t}Math.imul||(d=smallMulTo),BN.prototype.mulTo=function mulTo(e,t){var a,r=this.length+e.length;return a=10===this.length&&10===e.length?d(this,e,t):r<63?smallMulTo(this,e,t):r<1024?function bigMulTo(e,t,a){a.negative=t.negative^e.negative,a.length=e.length+t.length;for(var r=0,n=0,o=0;o>>26)|0)>>>26,c&=67108863}a.words[o]=d,r=c,c=n}return 0!==r?a.words[o]=r:a.length--,a.strip()}(this,e,t):jumboMulTo(this,e,t),a},FFTM.prototype.makeRBT=function makeRBT(e){for(var t=new Array(e),a=BN.prototype._countBits(e)-1,r=0;r>=1;return r},FFTM.prototype.permute=function permute(e,t,a,r,n,o){for(var c=0;c>>=1)n++;return 1<>>=13,a[2*o+1]=8191&n,n>>>=13;for(o=2*t;o>=26,t+=r/67108864|0,t+=n>>>26,this.words[a]=67108863&n}return 0!==t&&(this.words[a]=t,this.length++),this},BN.prototype.muln=function muln(e){return this.clone().imuln(e)},BN.prototype.sqr=function sqr(){return this.mul(this)},BN.prototype.isqr=function isqr(){return this.imul(this.clone())},BN.prototype.pow=function pow(e){var t=function toBitArray(e){for(var t=new Array(e.bitLength()),a=0;a>>n}return t}(e);if(0===t.length)return new BN(1);for(var a=this,r=0;r=0);var t,a=e%26,r=(e-a)/26,n=67108863>>>26-a<<26-a;if(0!==a){var o=0;for(t=0;t>>26-a}o&&(this.words[t]=o,this.length++)}if(0!==r){for(t=this.length-1;t>=0;t--)this.words[t+r]=this.words[t];for(t=0;t=0),r=t?(t-t%26)/26:0;var n=e%26,o=Math.min((e-n)/26,this.length),c=67108863^67108863>>>n<o)for(this.length-=o,s=0;s=0&&(0!==b||s>=r);s--){var u=0|this.words[s];this.words[s]=b<<26-n|u>>>n,b=u&c}return d&&0!==b&&(d.words[d.length++]=b),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},BN.prototype.ishrn=function ishrn(e,t,a){return assert(0===this.negative),this.iushrn(e,t,a)},BN.prototype.shln=function shln(e){return this.clone().ishln(e)},BN.prototype.ushln=function ushln(e){return this.clone().iushln(e)},BN.prototype.shrn=function shrn(e){return this.clone().ishrn(e)},BN.prototype.ushrn=function ushrn(e){return this.clone().iushrn(e)},BN.prototype.testn=function testn(e){assert("number"==typeof e&&e>=0);var t=e%26,a=(e-t)/26,r=1<=0);var t=e%26,a=(e-t)/26;if(assert(0===this.negative,"imaskn works only with positive numbers"),this.length<=a)return this;if(0!==t&&a++,this.length=Math.min(a,this.length),0!==t){var r=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},BN.prototype.isubn=function isubn(e){if(assert("number"==typeof e),assert(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(d/67108864|0),this.words[r+a]=67108863&n}for(;r>26,this.words[r+a]=67108863&n;if(0===c)return this.strip();for(assert(-1===c),c=0,r=0;r>26,this.words[r]=67108863&n;return this.negative=1,this.strip()},BN.prototype._wordDiv=function _wordDiv(e,t){var a=(this.length,e.length),r=this.clone(),n=e,o=0|n.words[n.length-1];0!==(a=26-this._countBits(o))&&(n=n.ushln(a),r.iushln(a),o=0|n.words[n.length-1]);var c,d=r.length-n.length;if("mod"!==t){(c=new BN(null)).length=d+1,c.words=new Array(c.length);for(var s=0;s=0;u--){var h=67108864*(0|r.words[n.length+u])+(0|r.words[n.length+u-1]);for(h=Math.min(h/o|0,67108863),r._ishlnsubmul(n,h,u);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(n,1,u),r.isZero()||(r.negative^=1);c&&(c.words[u]=h)}return c&&c.strip(),r.strip(),"div"!==t&&0!==a&&r.iushrn(a),{div:c||null,mod:r}},BN.prototype.divmod=function divmod(e,t,a){return assert(!e.isZero()),this.isZero()?{div:new BN(0),mod:new BN(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(r=o.div.neg()),"div"!==t&&(n=o.mod.neg(),a&&0!==n.negative&&n.iadd(e)),{div:r,mod:n}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(r=o.div.neg()),{div:r,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(n=o.mod.neg(),a&&0!==n.negative&&n.isub(e)),{div:o.div,mod:n}):e.length>this.length||this.cmp(e)<0?{div:new BN(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new BN(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new BN(this.modn(e.words[0]))}:this._wordDiv(e,t);var r,n,o},BN.prototype.div=function div(e){return this.divmod(e,"div",!1).div},BN.prototype.mod=function mod(e){return this.divmod(e,"mod",!1).mod},BN.prototype.umod=function umod(e){return this.divmod(e,"mod",!0).mod},BN.prototype.divRound=function divRound(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var a=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),o=a.cmp(r);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},BN.prototype.modn=function modn(e){assert(e<=67108863);for(var t=(1<<26)%e,a=0,r=this.length-1;r>=0;r--)a=(t*a+(0|this.words[r]))%e;return a},BN.prototype.idivn=function idivn(e){assert(e<=67108863);for(var t=0,a=this.length-1;a>=0;a--){var r=(0|this.words[a])+67108864*t;this.words[a]=r/e|0,t=r%e}return this.strip()},BN.prototype.divn=function divn(e){return this.clone().idivn(e)},BN.prototype.egcd=function egcd(e){assert(0===e.negative),assert(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r=new BN(1),n=new BN(0),o=new BN(0),c=new BN(1),d=0;t.isEven()&&a.isEven();)t.iushrn(1),a.iushrn(1),++d;for(var s=a.clone(),b=t.clone();!t.isZero();){for(var u=0,h=1;0==(t.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(t.iushrn(u);u-- >0;)(r.isOdd()||n.isOdd())&&(r.iadd(s),n.isub(b)),r.iushrn(1),n.iushrn(1);for(var l=0,g=1;0==(a.words[0]&g)&&l<26;++l,g<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(o.isOdd()||c.isOdd())&&(o.iadd(s),c.isub(b)),o.iushrn(1),c.iushrn(1);t.cmp(a)>=0?(t.isub(a),r.isub(o),n.isub(c)):(a.isub(t),o.isub(r),c.isub(n))}return{a:o,b:c,gcd:a.iushln(d)}},BN.prototype._invmp=function _invmp(e){assert(0===e.negative),assert(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r,n=new BN(1),o=new BN(0),c=a.clone();t.cmpn(1)>0&&a.cmpn(1)>0;){for(var d=0,s=1;0==(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0)for(t.iushrn(d);d-- >0;)n.isOdd()&&n.iadd(c),n.iushrn(1);for(var b=0,u=1;0==(a.words[0]&u)&&b<26;++b,u<<=1);if(b>0)for(a.iushrn(b);b-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);t.cmp(a)>=0?(t.isub(a),n.isub(o)):(a.isub(t),o.isub(n))}return(r=0===t.cmpn(1)?n:o).cmpn(0)<0&&r.iadd(e),r},BN.prototype.gcd=function gcd(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),a=e.clone();t.negative=0,a.negative=0;for(var r=0;t.isEven()&&a.isEven();r++)t.iushrn(1),a.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;a.isEven();)a.iushrn(1);var n=t.cmp(a);if(n<0){var o=t;t=a,a=o}else if(0===n||0===a.cmpn(1))break;t.isub(a)}return a.iushln(r)},BN.prototype.invm=function invm(e){return this.egcd(e).a.umod(e)},BN.prototype.isEven=function isEven(){return 0==(1&this.words[0])},BN.prototype.isOdd=function isOdd(){return 1==(1&this.words[0])},BN.prototype.andln=function andln(e){return this.words[0]&e},BN.prototype.bincn=function bincn(e){assert("number"==typeof e);var t=e%26,a=(e-t)/26,r=1<>>26,c&=67108863,this.words[o]=c}return 0!==n&&(this.words[o]=n,this.length++),this},BN.prototype.isZero=function isZero(){return 1===this.length&&0===this.words[0]},BN.prototype.cmpn=function cmpn(e){var t,a=e<0;if(0!==this.negative&&!a)return-1;if(0===this.negative&&a)return 1;if(this.strip(),this.length>1)t=1;else{a&&(e=-e),assert(e<=67108863,"Number is too big");var r=0|this.words[0];t=r===e?0:re.length)return 1;if(this.length=0;a--){var r=0|this.words[a],n=0|e.words[a];if(r!==n){rn&&(t=1);break}}return t},BN.prototype.gtn=function gtn(e){return 1===this.cmpn(e)},BN.prototype.gt=function gt(e){return 1===this.cmp(e)},BN.prototype.gten=function gten(e){return this.cmpn(e)>=0},BN.prototype.gte=function gte(e){return this.cmp(e)>=0},BN.prototype.ltn=function ltn(e){return-1===this.cmpn(e)},BN.prototype.lt=function lt(e){return-1===this.cmp(e)},BN.prototype.lten=function lten(e){return this.cmpn(e)<=0},BN.prototype.lte=function lte(e){return this.cmp(e)<=0},BN.prototype.eqn=function eqn(e){return 0===this.cmpn(e)},BN.prototype.eq=function eq(e){return 0===this.cmp(e)},BN.red=function red(e){return new Red(e)},BN.prototype.toRed=function toRed(e){return assert(!this.red,"Already a number in reduction context"),assert(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},BN.prototype.fromRed=function fromRed(){return assert(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},BN.prototype._forceRed=function _forceRed(e){return this.red=e,this},BN.prototype.forceRed=function forceRed(e){return assert(!this.red,"Already a number in reduction context"),this._forceRed(e)},BN.prototype.redAdd=function redAdd(e){return assert(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},BN.prototype.redIAdd=function redIAdd(e){return assert(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},BN.prototype.redSub=function redSub(e){return assert(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},BN.prototype.redISub=function redISub(e){return assert(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},BN.prototype.redShl=function redShl(e){return assert(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},BN.prototype.redMul=function redMul(e){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},BN.prototype.redIMul=function redIMul(e){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},BN.prototype.redSqr=function redSqr(){return assert(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},BN.prototype.redISqr=function redISqr(){return assert(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},BN.prototype.redSqrt=function redSqrt(){return assert(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},BN.prototype.redInvm=function redInvm(){return assert(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},BN.prototype.redNeg=function redNeg(){return assert(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},BN.prototype.redPow=function redPow(e){return assert(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var s={k256:null,p224:null,p192:null,p25519:null};function MPrime(e,t){this.name=e,this.p=new BN(t,16),this.n=this.p.bitLength(),this.k=new BN(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function Red(e){if("string"==typeof e){var t=BN._prime(e);this.m=t.p,this.prime=t}else assert(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function Mont(e){Red.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new BN(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}MPrime.prototype._tmp=function _tmp(){var e=new BN(null);return e.words=new Array(Math.ceil(this.n/13)),e},MPrime.prototype.ireduce=function ireduce(e){var t,a=e;do{this.split(a,this.tmp),t=(a=(a=this.imulK(a)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?a.isub(this.p):void 0!==a.strip?a.strip():a._strip(),a},MPrime.prototype.split=function split(e,t){e.iushrn(this.n,0,t)},MPrime.prototype.imulK=function imulK(e){return e.imul(this.k)},inherits(K256,MPrime),K256.prototype.split=function split(e,t){for(var a=4194303,r=Math.min(e.length,9),n=0;n>>22,o=c}o>>>=22,e.words[n-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},K256.prototype.imulK=function imulK(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,a=0;a>>=26,e.words[a]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},BN._prime=function prime(e){if(s[e])return s[e];var prime;if("k256"===e)prime=new K256;else if("p224"===e)prime=new P224;else if("p192"===e)prime=new P192;else{if("p25519"!==e)throw new Error("Unknown prime "+e);prime=new P25519}return s[e]=prime,prime},Red.prototype._verify1=function _verify1(e){assert(0===e.negative,"red works only with positives"),assert(e.red,"red works only with red numbers")},Red.prototype._verify2=function _verify2(e,t){assert(0==(e.negative|t.negative),"red works only with positives"),assert(e.red&&e.red===t.red,"red works only with red numbers")},Red.prototype.imod=function imod(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},Red.prototype.neg=function neg(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},Red.prototype.add=function add(e,t){this._verify2(e,t);var a=e.add(t);return a.cmp(this.m)>=0&&a.isub(this.m),a._forceRed(this)},Red.prototype.iadd=function iadd(e,t){this._verify2(e,t);var a=e.iadd(t);return a.cmp(this.m)>=0&&a.isub(this.m),a},Red.prototype.sub=function sub(e,t){this._verify2(e,t);var a=e.sub(t);return a.cmpn(0)<0&&a.iadd(this.m),a._forceRed(this)},Red.prototype.isub=function isub(e,t){this._verify2(e,t);var a=e.isub(t);return a.cmpn(0)<0&&a.iadd(this.m),a},Red.prototype.shl=function shl(e,t){return this._verify1(e),this.imod(e.ushln(t))},Red.prototype.imul=function imul(e,t){return this._verify2(e,t),this.imod(e.imul(t))},Red.prototype.mul=function mul(e,t){return this._verify2(e,t),this.imod(e.mul(t))},Red.prototype.isqr=function isqr(e){return this.imul(e,e.clone())},Red.prototype.sqr=function sqr(e){return this.mul(e,e)},Red.prototype.sqrt=function sqrt(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(assert(t%2==1),3===t){var a=this.m.add(new BN(1)).iushrn(2);return this.pow(e,a)}for(var r=this.m.subn(1),n=0;!r.isZero()&&0===r.andln(1);)n++,r.iushrn(1);assert(!r.isZero());var o=new BN(1).toRed(this),c=o.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new BN(2*s*s).toRed(this);0!==this.pow(s,d).cmp(c);)s.redIAdd(c);for(var b=this.pow(s,r),u=this.pow(e,r.addn(1).iushrn(1)),h=this.pow(e,r),l=n;0!==h.cmp(o);){for(var g=h,p=0;0!==g.cmp(o);p++)g=g.redSqr();assert(p=0;r--){for(var s=t.words[r],b=d-1;b>=0;b--){var u=s>>b&1;n!==a[0]&&(n=this.sqr(n)),0!==u||0!==o?(o<<=1,o|=u,(4===++c||0===r&&0===b)&&(n=this.mul(n,a[o]),c=0,o=0)):c=0}d=26}return n},Red.prototype.convertTo=function convertTo(e){var t=e.umod(this.m);return t===e?t.clone():t},Red.prototype.convertFrom=function convertFrom(e){var t=e.clone();return t.red=null,t},BN.mont=function mont(e){return new Mont(e)},inherits(Mont,Red),Mont.prototype.convertTo=function convertTo(e){return this.imod(e.ushln(this.shift))},Mont.prototype.convertFrom=function convertFrom(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},Mont.prototype.imul=function imul(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var a=e.imul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},Mont.prototype.mul=function mul(e,t){if(e.isZero()||t.isZero())return new BN(0)._forceRed(this);var a=e.mul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},Mont.prototype.invm=function invm(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=a.nmd(e),this)},function(e,t,a){!function(e,t){"use strict";function assert(e,t){if(!e)throw new Error(t||"Assertion failed")}function inherits(e,t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype,e.prototype=new TempCtor,e.prototype.constructor=e}function BN(e,t,a){if(BN.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(a=t,t=10),this._init(e||0,t||10,a||"be"))}var r;"object"==typeof e?e.exports=BN:t.BN=BN,BN.BN=BN,BN.wordSize=26;try{r="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:a(1448).Buffer}catch(e){}function parseHex4Bits(e,t){var a=e.charCodeAt(t);return a>=65&&a<=70?a-55:a>=97&&a<=102?a-87:a-48&15}function parseHexByte(e,t,a){var r=parseHex4Bits(e,a);return a-1>=t&&(r|=parseHex4Bits(e,a-1)<<4),r}function parseBase(e,t,a,r){for(var n=0,o=Math.min(e.length,a),c=t;c=49?d-49+10:d>=17?d-17+10:d}return n}BN.isBN=function isBN(e){return e instanceof BN||null!==e&&"object"==typeof e&&e.constructor.wordSize===BN.wordSize&&Array.isArray(e.words)},BN.max=function max(e,t){return e.cmp(t)>0?e:t},BN.min=function min(e,t){return e.cmp(t)<0?e:t},BN.prototype._init=function init(e,t,a){if("number"==typeof e)return this._initNumber(e,t,a);if("object"==typeof e)return this._initArray(e,t,a);"hex"===t&&(t=16),assert(t===(0|t)&&t>=2&&t<=36);var r=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(r++,this.negative=1),r=0;r-=3)o=e[r]|e[r-1]<<8|e[r-2]<<16,this.words[n]|=o<>>26-c&67108863,(c+=24)>=26&&(c-=26,n++);else if("le"===a)for(r=0,n=0;r>>26-c&67108863,(c+=24)>=26&&(c-=26,n++);return this.strip()},BN.prototype._parseHex=function _parseHex(e,t,a){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)n=parseHexByte(e,t,r)<=18?(o-=18,c+=1,this.words[c]|=n>>>26):o+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(o-=18,c+=1,this.words[c]|=n>>>26):o+=8;this.strip()},BN.prototype._parseBase=function _parseBase(e,t,a){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var o=e.length-a,c=o%r,d=Math.min(o,o-c)+a,s=0,b=a;b1&&0===this.words[this.length-1];)this.length--;return this._normSign()},BN.prototype._normSign=function _normSign(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},BN.prototype.inspect=function inspect(){return(this.red?""};var n=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],o=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function smallMulTo(e,t,a){a.negative=t.negative^e.negative;var r=e.length+t.length|0;a.length=r,r=r-1|0;var n=0|e.words[0],o=0|t.words[0],c=n*o,d=67108863&c,s=c/67108864|0;a.words[0]=d;for(var b=1;b>>26,h=67108863&s,l=Math.min(b,t.length-1),g=Math.max(0,b-e.length+1);g<=l;g++){var p=b-g|0;u+=(c=(n=0|e.words[p])*(o=0|t.words[g])+h)/67108864|0,h=67108863&c}a.words[b]=0|h,s=0|u}return 0!==s?a.words[b]=0|s:a.length--,a.strip()}BN.prototype.toString=function toString(e,t){var a;if(t=0|t||1,16===(e=e||10)||"hex"===e){a="";for(var r=0,d=0,s=0;s>>24-r&16777215)||s!==this.length-1?n[6-u.length]+u+a:u+a,(r+=2)>=26&&(r-=26,s--)}for(0!==d&&(a=d.toString(16)+a);a.length%t!=0;)a="0"+a;return 0!==this.negative&&(a="-"+a),a}if(e===(0|e)&&e>=2&&e<=36){var h=o[e],l=c[e];a="";var g=this.clone();for(g.negative=0;!g.isZero();){var p=g.modn(l).toString(e);a=(g=g.idivn(l)).isZero()?p+a:n[h-p.length]+p+a}for(this.isZero()&&(a="0"+a);a.length%t!=0;)a="0"+a;return 0!==this.negative&&(a="-"+a),a}assert(!1,"Base should be between 2 and 36")},BN.prototype.toNumber=function toNumber(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&assert(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},BN.prototype.toJSON=function toJSON(){return this.toString(16)},BN.prototype.toBuffer=function toBuffer(e,t){return assert(void 0!==r),this.toArrayLike(r,e,t)},BN.prototype.toArray=function toArray(e,t){return this.toArrayLike(Array,e,t)},BN.prototype.toArrayLike=function toArrayLike(e,t,a){var r=this.byteLength(),n=a||Math.max(1,r);assert(r<=n,"byte array longer than desired length"),assert(n>0,"Requested array length <= 0"),this.strip();var o,c,d="le"===t,s=new e(n),b=this.clone();if(d){for(c=0;!b.isZero();c++)o=b.andln(255),b.iushrn(8),s[c]=o;for(;c=4096&&(a+=13,t>>>=13),t>=64&&(a+=7,t>>>=7),t>=8&&(a+=4,t>>>=4),t>=2&&(a+=2,t>>>=2),a+t},BN.prototype._zeroBits=function _zeroBits(e){if(0===e)return 26;var t=e,a=0;return 0==(8191&t)&&(a+=13,t>>>=13),0==(127&t)&&(a+=7,t>>>=7),0==(15&t)&&(a+=4,t>>>=4),0==(3&t)&&(a+=2,t>>>=2),0==(1&t)&&a++,a},BN.prototype.bitLength=function bitLength(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},BN.prototype.uor=function uor(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},BN.prototype.iuand=function iuand(e){var t;t=this.length>e.length?e:this;for(var a=0;ae.length?this.clone().iand(e):e.clone().iand(this)},BN.prototype.uand=function uand(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},BN.prototype.iuxor=function iuxor(e){var t,a;this.length>e.length?(t=this,a=e):(t=e,a=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},BN.prototype.uxor=function uxor(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},BN.prototype.inotn=function inotn(e){assert("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),a=e%26;this._expand(t),a>0&&t--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-a),this.strip()},BN.prototype.notn=function notn(e){return this.clone().inotn(e)},BN.prototype.setn=function setn(e,t){assert("number"==typeof e&&e>=0);var a=e/26|0,r=e%26;return this._expand(a+1),this.words[a]=t?this.words[a]|1<e.length?(a=this,r=e):(a=e,r=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=a.length,0!==n)this.words[this.length]=n,this.length++;else if(a!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},BN.prototype.isub=function isub(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var a,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(a=this,r=e):(a=e,r=this);for(var o=0,c=0;c>26,this.words[c]=67108863&t;for(;0!==o&&c>26,this.words[c]=67108863&t;if(0===o&&c>>13,g=0|c[1],p=8191&g,B=g>>>13,x=0|c[2],m=8191&x,I=x>>>13,y=0|c[3],C=8191&y,w=y>>>13,v=0|c[4],Q=8191&v,_=v>>>13,k=0|c[5],N=8191&k,D=k>>>13,G=0|c[6],T=8191&G,L=G>>>13,P=0|c[7],U=8191&P,q=P>>>13,O=0|c[8],H=8191&O,z=O>>>13,j=0|c[9],J=8191&j,Y=j>>>13,W=0|d[0],V=8191&W,X=W>>>13,$=0|d[1],et=8191&$,tt=$>>>13,at=0|d[2],rt=8191&at,it=at>>>13,nt=0|d[3],ot=8191&nt,ct=nt>>>13,dt=0|d[4],st=8191&dt,At=dt>>>13,bt=0|d[5],ut=8191&bt,ht=bt>>>13,pt=0|d[6],Bt=8191&pt,xt=pt>>>13,mt=0|d[7],It=8191&mt,Et=mt>>>13,yt=0|d[8],Ct=8191&yt,wt=yt>>>13,vt=0|d[9],Qt=8191&vt,Mt=vt>>>13;a.negative=e.negative^t.negative,a.length=19;var _t=(b+(r=Math.imul(h,V))|0)+((8191&(n=(n=Math.imul(h,X))+Math.imul(l,V)|0))<<13)|0;b=((o=Math.imul(l,X))+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(p,V),n=(n=Math.imul(p,X))+Math.imul(B,V)|0,o=Math.imul(B,X);var kt=(b+(r=r+Math.imul(h,et)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(l,et)|0))<<13)|0;b=((o=o+Math.imul(l,tt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(m,V),n=(n=Math.imul(m,X))+Math.imul(I,V)|0,o=Math.imul(I,X),r=r+Math.imul(p,et)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(B,et)|0,o=o+Math.imul(B,tt)|0;var St=(b+(r=r+Math.imul(h,rt)|0)|0)+((8191&(n=(n=n+Math.imul(h,it)|0)+Math.imul(l,rt)|0))<<13)|0;b=((o=o+Math.imul(l,it)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(C,V),n=(n=Math.imul(C,X))+Math.imul(w,V)|0,o=Math.imul(w,X),r=r+Math.imul(m,et)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(I,et)|0,o=o+Math.imul(I,tt)|0,r=r+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,it)|0;var Nt=(b+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,ct)|0)+Math.imul(l,ot)|0))<<13)|0;b=((o=o+Math.imul(l,ct)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,r=Math.imul(Q,V),n=(n=Math.imul(Q,X))+Math.imul(_,V)|0,o=Math.imul(_,X),r=r+Math.imul(C,et)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(w,et)|0,o=o+Math.imul(w,tt)|0,r=r+Math.imul(m,rt)|0,n=(n=n+Math.imul(m,it)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,it)|0,r=r+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,ct)|0;var Dt=(b+(r=r+Math.imul(h,st)|0)|0)+((8191&(n=(n=n+Math.imul(h,At)|0)+Math.imul(l,st)|0))<<13)|0;b=((o=o+Math.imul(l,At)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,r=Math.imul(N,V),n=(n=Math.imul(N,X))+Math.imul(D,V)|0,o=Math.imul(D,X),r=r+Math.imul(Q,et)|0,n=(n=n+Math.imul(Q,tt)|0)+Math.imul(_,et)|0,o=o+Math.imul(_,tt)|0,r=r+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(w,rt)|0,o=o+Math.imul(w,it)|0,r=r+Math.imul(m,ot)|0,n=(n=n+Math.imul(m,ct)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,ct)|0,r=r+Math.imul(p,st)|0,n=(n=n+Math.imul(p,At)|0)+Math.imul(B,st)|0,o=o+Math.imul(B,At)|0;var Rt=(b+(r=r+Math.imul(h,ut)|0)|0)+((8191&(n=(n=n+Math.imul(h,ht)|0)+Math.imul(l,ut)|0))<<13)|0;b=((o=o+Math.imul(l,ht)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(T,V),n=(n=Math.imul(T,X))+Math.imul(L,V)|0,o=Math.imul(L,X),r=r+Math.imul(N,et)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(D,et)|0,o=o+Math.imul(D,tt)|0,r=r+Math.imul(Q,rt)|0,n=(n=n+Math.imul(Q,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0,r=r+Math.imul(C,ot)|0,n=(n=n+Math.imul(C,ct)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,ct)|0,r=r+Math.imul(m,st)|0,n=(n=n+Math.imul(m,At)|0)+Math.imul(I,st)|0,o=o+Math.imul(I,At)|0,r=r+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ht)|0;var Ft=(b+(r=r+Math.imul(h,Bt)|0)|0)+((8191&(n=(n=n+Math.imul(h,xt)|0)+Math.imul(l,Bt)|0))<<13)|0;b=((o=o+Math.imul(l,xt)|0)+(n>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,r=Math.imul(U,V),n=(n=Math.imul(U,X))+Math.imul(q,V)|0,o=Math.imul(q,X),r=r+Math.imul(T,et)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(L,et)|0,o=o+Math.imul(L,tt)|0,r=r+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(D,rt)|0,o=o+Math.imul(D,it)|0,r=r+Math.imul(Q,ot)|0,n=(n=n+Math.imul(Q,ct)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,ct)|0,r=r+Math.imul(C,st)|0,n=(n=n+Math.imul(C,At)|0)+Math.imul(w,st)|0,o=o+Math.imul(w,At)|0,r=r+Math.imul(m,ut)|0,n=(n=n+Math.imul(m,ht)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ht)|0,r=r+Math.imul(p,Bt)|0,n=(n=n+Math.imul(p,xt)|0)+Math.imul(B,Bt)|0,o=o+Math.imul(B,xt)|0;var Gt=(b+(r=r+Math.imul(h,It)|0)|0)+((8191&(n=(n=n+Math.imul(h,Et)|0)+Math.imul(l,It)|0))<<13)|0;b=((o=o+Math.imul(l,Et)|0)+(n>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,r=Math.imul(H,V),n=(n=Math.imul(H,X))+Math.imul(z,V)|0,o=Math.imul(z,X),r=r+Math.imul(U,et)|0,n=(n=n+Math.imul(U,tt)|0)+Math.imul(q,et)|0,o=o+Math.imul(q,tt)|0,r=r+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,r=r+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,ct)|0,r=r+Math.imul(Q,st)|0,n=(n=n+Math.imul(Q,At)|0)+Math.imul(_,st)|0,o=o+Math.imul(_,At)|0,r=r+Math.imul(C,ut)|0,n=(n=n+Math.imul(C,ht)|0)+Math.imul(w,ut)|0,o=o+Math.imul(w,ht)|0,r=r+Math.imul(m,Bt)|0,n=(n=n+Math.imul(m,xt)|0)+Math.imul(I,Bt)|0,o=o+Math.imul(I,xt)|0,r=r+Math.imul(p,It)|0,n=(n=n+Math.imul(p,Et)|0)+Math.imul(B,It)|0,o=o+Math.imul(B,Et)|0;var Tt=(b+(r=r+Math.imul(h,Ct)|0)|0)+((8191&(n=(n=n+Math.imul(h,wt)|0)+Math.imul(l,Ct)|0))<<13)|0;b=((o=o+Math.imul(l,wt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(J,V),n=(n=Math.imul(J,X))+Math.imul(Y,V)|0,o=Math.imul(Y,X),r=r+Math.imul(H,et)|0,n=(n=n+Math.imul(H,tt)|0)+Math.imul(z,et)|0,o=o+Math.imul(z,tt)|0,r=r+Math.imul(U,rt)|0,n=(n=n+Math.imul(U,it)|0)+Math.imul(q,rt)|0,o=o+Math.imul(q,it)|0,r=r+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,ct)|0,r=r+Math.imul(N,st)|0,n=(n=n+Math.imul(N,At)|0)+Math.imul(D,st)|0,o=o+Math.imul(D,At)|0,r=r+Math.imul(Q,ut)|0,n=(n=n+Math.imul(Q,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,r=r+Math.imul(C,Bt)|0,n=(n=n+Math.imul(C,xt)|0)+Math.imul(w,Bt)|0,o=o+Math.imul(w,xt)|0,r=r+Math.imul(m,It)|0,n=(n=n+Math.imul(m,Et)|0)+Math.imul(I,It)|0,o=o+Math.imul(I,Et)|0,r=r+Math.imul(p,Ct)|0,n=(n=n+Math.imul(p,wt)|0)+Math.imul(B,Ct)|0,o=o+Math.imul(B,wt)|0;var Lt=(b+(r=r+Math.imul(h,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(h,Mt)|0)+Math.imul(l,Qt)|0))<<13)|0;b=((o=o+Math.imul(l,Mt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,r=Math.imul(J,et),n=(n=Math.imul(J,tt))+Math.imul(Y,et)|0,o=Math.imul(Y,tt),r=r+Math.imul(H,rt)|0,n=(n=n+Math.imul(H,it)|0)+Math.imul(z,rt)|0,o=o+Math.imul(z,it)|0,r=r+Math.imul(U,ot)|0,n=(n=n+Math.imul(U,ct)|0)+Math.imul(q,ot)|0,o=o+Math.imul(q,ct)|0,r=r+Math.imul(T,st)|0,n=(n=n+Math.imul(T,At)|0)+Math.imul(L,st)|0,o=o+Math.imul(L,At)|0,r=r+Math.imul(N,ut)|0,n=(n=n+Math.imul(N,ht)|0)+Math.imul(D,ut)|0,o=o+Math.imul(D,ht)|0,r=r+Math.imul(Q,Bt)|0,n=(n=n+Math.imul(Q,xt)|0)+Math.imul(_,Bt)|0,o=o+Math.imul(_,xt)|0,r=r+Math.imul(C,It)|0,n=(n=n+Math.imul(C,Et)|0)+Math.imul(w,It)|0,o=o+Math.imul(w,Et)|0,r=r+Math.imul(m,Ct)|0,n=(n=n+Math.imul(m,wt)|0)+Math.imul(I,Ct)|0,o=o+Math.imul(I,wt)|0;var Pt=(b+(r=r+Math.imul(p,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(p,Mt)|0)+Math.imul(B,Qt)|0))<<13)|0;b=((o=o+Math.imul(B,Mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,r=Math.imul(J,rt),n=(n=Math.imul(J,it))+Math.imul(Y,rt)|0,o=Math.imul(Y,it),r=r+Math.imul(H,ot)|0,n=(n=n+Math.imul(H,ct)|0)+Math.imul(z,ot)|0,o=o+Math.imul(z,ct)|0,r=r+Math.imul(U,st)|0,n=(n=n+Math.imul(U,At)|0)+Math.imul(q,st)|0,o=o+Math.imul(q,At)|0,r=r+Math.imul(T,ut)|0,n=(n=n+Math.imul(T,ht)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ht)|0,r=r+Math.imul(N,Bt)|0,n=(n=n+Math.imul(N,xt)|0)+Math.imul(D,Bt)|0,o=o+Math.imul(D,xt)|0,r=r+Math.imul(Q,It)|0,n=(n=n+Math.imul(Q,Et)|0)+Math.imul(_,It)|0,o=o+Math.imul(_,Et)|0,r=r+Math.imul(C,Ct)|0,n=(n=n+Math.imul(C,wt)|0)+Math.imul(w,Ct)|0,o=o+Math.imul(w,wt)|0;var Ut=(b+(r=r+Math.imul(m,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(m,Mt)|0)+Math.imul(I,Qt)|0))<<13)|0;b=((o=o+Math.imul(I,Mt)|0)+(n>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,r=Math.imul(J,ot),n=(n=Math.imul(J,ct))+Math.imul(Y,ot)|0,o=Math.imul(Y,ct),r=r+Math.imul(H,st)|0,n=(n=n+Math.imul(H,At)|0)+Math.imul(z,st)|0,o=o+Math.imul(z,At)|0,r=r+Math.imul(U,ut)|0,n=(n=n+Math.imul(U,ht)|0)+Math.imul(q,ut)|0,o=o+Math.imul(q,ht)|0,r=r+Math.imul(T,Bt)|0,n=(n=n+Math.imul(T,xt)|0)+Math.imul(L,Bt)|0,o=o+Math.imul(L,xt)|0,r=r+Math.imul(N,It)|0,n=(n=n+Math.imul(N,Et)|0)+Math.imul(D,It)|0,o=o+Math.imul(D,Et)|0,r=r+Math.imul(Q,Ct)|0,n=(n=n+Math.imul(Q,wt)|0)+Math.imul(_,Ct)|0,o=o+Math.imul(_,wt)|0;var qt=(b+(r=r+Math.imul(C,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(C,Mt)|0)+Math.imul(w,Qt)|0))<<13)|0;b=((o=o+Math.imul(w,Mt)|0)+(n>>>13)|0)+(qt>>>26)|0,qt&=67108863,r=Math.imul(J,st),n=(n=Math.imul(J,At))+Math.imul(Y,st)|0,o=Math.imul(Y,At),r=r+Math.imul(H,ut)|0,n=(n=n+Math.imul(H,ht)|0)+Math.imul(z,ut)|0,o=o+Math.imul(z,ht)|0,r=r+Math.imul(U,Bt)|0,n=(n=n+Math.imul(U,xt)|0)+Math.imul(q,Bt)|0,o=o+Math.imul(q,xt)|0,r=r+Math.imul(T,It)|0,n=(n=n+Math.imul(T,Et)|0)+Math.imul(L,It)|0,o=o+Math.imul(L,Et)|0,r=r+Math.imul(N,Ct)|0,n=(n=n+Math.imul(N,wt)|0)+Math.imul(D,Ct)|0,o=o+Math.imul(D,wt)|0;var Ot=(b+(r=r+Math.imul(Q,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(Q,Mt)|0)+Math.imul(_,Qt)|0))<<13)|0;b=((o=o+Math.imul(_,Mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(J,ut),n=(n=Math.imul(J,ht))+Math.imul(Y,ut)|0,o=Math.imul(Y,ht),r=r+Math.imul(H,Bt)|0,n=(n=n+Math.imul(H,xt)|0)+Math.imul(z,Bt)|0,o=o+Math.imul(z,xt)|0,r=r+Math.imul(U,It)|0,n=(n=n+Math.imul(U,Et)|0)+Math.imul(q,It)|0,o=o+Math.imul(q,Et)|0,r=r+Math.imul(T,Ct)|0,n=(n=n+Math.imul(T,wt)|0)+Math.imul(L,Ct)|0,o=o+Math.imul(L,wt)|0;var Ht=(b+(r=r+Math.imul(N,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(N,Mt)|0)+Math.imul(D,Qt)|0))<<13)|0;b=((o=o+Math.imul(D,Mt)|0)+(n>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,r=Math.imul(J,Bt),n=(n=Math.imul(J,xt))+Math.imul(Y,Bt)|0,o=Math.imul(Y,xt),r=r+Math.imul(H,It)|0,n=(n=n+Math.imul(H,Et)|0)+Math.imul(z,It)|0,o=o+Math.imul(z,Et)|0,r=r+Math.imul(U,Ct)|0,n=(n=n+Math.imul(U,wt)|0)+Math.imul(q,Ct)|0,o=o+Math.imul(q,wt)|0;var zt=(b+(r=r+Math.imul(T,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(T,Mt)|0)+Math.imul(L,Qt)|0))<<13)|0;b=((o=o+Math.imul(L,Mt)|0)+(n>>>13)|0)+(zt>>>26)|0,zt&=67108863,r=Math.imul(J,It),n=(n=Math.imul(J,Et))+Math.imul(Y,It)|0,o=Math.imul(Y,Et),r=r+Math.imul(H,Ct)|0,n=(n=n+Math.imul(H,wt)|0)+Math.imul(z,Ct)|0,o=o+Math.imul(z,wt)|0;var Kt=(b+(r=r+Math.imul(U,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(U,Mt)|0)+Math.imul(q,Qt)|0))<<13)|0;b=((o=o+Math.imul(q,Mt)|0)+(n>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,r=Math.imul(J,Ct),n=(n=Math.imul(J,wt))+Math.imul(Y,Ct)|0,o=Math.imul(Y,wt);var jt=(b+(r=r+Math.imul(H,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(H,Mt)|0)+Math.imul(z,Qt)|0))<<13)|0;b=((o=o+Math.imul(z,Mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Jt=(b+(r=Math.imul(J,Qt))|0)+((8191&(n=(n=Math.imul(J,Mt))+Math.imul(Y,Qt)|0))<<13)|0;return b=((o=Math.imul(Y,Mt))+(n>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,s[0]=_t,s[1]=kt,s[2]=St,s[3]=Nt,s[4]=Dt,s[5]=Rt,s[6]=Ft,s[7]=Gt,s[8]=Tt,s[9]=Lt,s[10]=Pt,s[11]=Ut,s[12]=qt,s[13]=Ot,s[14]=Ht,s[15]=zt,s[16]=Kt,s[17]=jt,s[18]=Jt,0!==b&&(s[19]=b,a.length++),a};function jumboMulTo(e,t,a){return(new FFTM).mulp(e,t,a)}function FFTM(e,t){this.x=e,this.y=t}Math.imul||(d=smallMulTo),BN.prototype.mulTo=function mulTo(e,t){var a,r=this.length+e.length;return a=10===this.length&&10===e.length?d(this,e,t):r<63?smallMulTo(this,e,t):r<1024?function bigMulTo(e,t,a){a.negative=t.negative^e.negative,a.length=e.length+t.length;for(var r=0,n=0,o=0;o>>26)|0)>>>26,c&=67108863}a.words[o]=d,r=c,c=n}return 0!==r?a.words[o]=r:a.length--,a.strip()}(this,e,t):jumboMulTo(this,e,t),a},FFTM.prototype.makeRBT=function makeRBT(e){for(var t=new Array(e),a=BN.prototype._countBits(e)-1,r=0;r>=1;return r},FFTM.prototype.permute=function permute(e,t,a,r,n,o){for(var c=0;c>>=1)n++;return 1<>>=13,a[2*o+1]=8191&n,n>>>=13;for(o=2*t;o>=26,t+=r/67108864|0,t+=n>>>26,this.words[a]=67108863&n}return 0!==t&&(this.words[a]=t,this.length++),this},BN.prototype.muln=function muln(e){return this.clone().imuln(e)},BN.prototype.sqr=function sqr(){return this.mul(this)},BN.prototype.isqr=function isqr(){return this.imul(this.clone())},BN.prototype.pow=function pow(e){var t=function toBitArray(e){for(var t=new Array(e.bitLength()),a=0;a>>n}return t}(e);if(0===t.length)return new BN(1);for(var a=this,r=0;r=0);var t,a=e%26,r=(e-a)/26,n=67108863>>>26-a<<26-a;if(0!==a){var o=0;for(t=0;t>>26-a}o&&(this.words[t]=o,this.length++)}if(0!==r){for(t=this.length-1;t>=0;t--)this.words[t+r]=this.words[t];for(t=0;t=0),r=t?(t-t%26)/26:0;var n=e%26,o=Math.min((e-n)/26,this.length),c=67108863^67108863>>>n<o)for(this.length-=o,s=0;s=0&&(0!==b||s>=r);s--){var u=0|this.words[s];this.words[s]=b<<26-n|u>>>n,b=u&c}return d&&0!==b&&(d.words[d.length++]=b),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},BN.prototype.ishrn=function ishrn(e,t,a){return assert(0===this.negative),this.iushrn(e,t,a)},BN.prototype.shln=function shln(e){return this.clone().ishln(e)},BN.prototype.ushln=function ushln(e){return this.clone().iushln(e)},BN.prototype.shrn=function shrn(e){return this.clone().ishrn(e)},BN.prototype.ushrn=function ushrn(e){return this.clone().iushrn(e)},BN.prototype.testn=function testn(e){assert("number"==typeof e&&e>=0);var t=e%26,a=(e-t)/26,r=1<=0);var t=e%26,a=(e-t)/26;if(assert(0===this.negative,"imaskn works only with positive numbers"),this.length<=a)return this;if(0!==t&&a++,this.length=Math.min(a,this.length),0!==t){var r=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},BN.prototype.isubn=function isubn(e){if(assert("number"==typeof e),assert(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(d/67108864|0),this.words[r+a]=67108863&n}for(;r>26,this.words[r+a]=67108863&n;if(0===c)return this.strip();for(assert(-1===c),c=0,r=0;r>26,this.words[r]=67108863&n;return this.negative=1,this.strip()},BN.prototype._wordDiv=function _wordDiv(e,t){var a=(this.length,e.length),r=this.clone(),n=e,o=0|n.words[n.length-1];0!==(a=26-this._countBits(o))&&(n=n.ushln(a),r.iushln(a),o=0|n.words[n.length-1]);var c,d=r.length-n.length;if("mod"!==t){(c=new BN(null)).length=d+1,c.words=new Array(c.length);for(var s=0;s=0;u--){var h=67108864*(0|r.words[n.length+u])+(0|r.words[n.length+u-1]);for(h=Math.min(h/o|0,67108863),r._ishlnsubmul(n,h,u);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(n,1,u),r.isZero()||(r.negative^=1);c&&(c.words[u]=h)}return c&&c.strip(),r.strip(),"div"!==t&&0!==a&&r.iushrn(a),{div:c||null,mod:r}},BN.prototype.divmod=function divmod(e,t,a){return assert(!e.isZero()),this.isZero()?{div:new BN(0),mod:new BN(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(r=o.div.neg()),"div"!==t&&(n=o.mod.neg(),a&&0!==n.negative&&n.iadd(e)),{div:r,mod:n}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(r=o.div.neg()),{div:r,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(n=o.mod.neg(),a&&0!==n.negative&&n.isub(e)),{div:o.div,mod:n}):e.length>this.length||this.cmp(e)<0?{div:new BN(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new BN(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new BN(this.modn(e.words[0]))}:this._wordDiv(e,t);var r,n,o},BN.prototype.div=function div(e){return this.divmod(e,"div",!1).div},BN.prototype.mod=function mod(e){return this.divmod(e,"mod",!1).mod},BN.prototype.umod=function umod(e){return this.divmod(e,"mod",!0).mod},BN.prototype.divRound=function divRound(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var a=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),o=a.cmp(r);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},BN.prototype.modn=function modn(e){assert(e<=67108863);for(var t=(1<<26)%e,a=0,r=this.length-1;r>=0;r--)a=(t*a+(0|this.words[r]))%e;return a},BN.prototype.idivn=function idivn(e){assert(e<=67108863);for(var t=0,a=this.length-1;a>=0;a--){var r=(0|this.words[a])+67108864*t;this.words[a]=r/e|0,t=r%e}return this.strip()},BN.prototype.divn=function divn(e){return this.clone().idivn(e)},BN.prototype.egcd=function egcd(e){assert(0===e.negative),assert(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r=new BN(1),n=new BN(0),o=new BN(0),c=new BN(1),d=0;t.isEven()&&a.isEven();)t.iushrn(1),a.iushrn(1),++d;for(var s=a.clone(),b=t.clone();!t.isZero();){for(var u=0,h=1;0==(t.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(t.iushrn(u);u-- >0;)(r.isOdd()||n.isOdd())&&(r.iadd(s),n.isub(b)),r.iushrn(1),n.iushrn(1);for(var l=0,g=1;0==(a.words[0]&g)&&l<26;++l,g<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(o.isOdd()||c.isOdd())&&(o.iadd(s),c.isub(b)),o.iushrn(1),c.iushrn(1);t.cmp(a)>=0?(t.isub(a),r.isub(o),n.isub(c)):(a.isub(t),o.isub(r),c.isub(n))}return{a:o,b:c,gcd:a.iushln(d)}},BN.prototype._invmp=function _invmp(e){assert(0===e.negative),assert(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r,n=new BN(1),o=new BN(0),c=a.clone();t.cmpn(1)>0&&a.cmpn(1)>0;){for(var d=0,s=1;0==(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0)for(t.iushrn(d);d-- >0;)n.isOdd()&&n.iadd(c),n.iushrn(1);for(var b=0,u=1;0==(a.words[0]&u)&&b<26;++b,u<<=1);if(b>0)for(a.iushrn(b);b-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);t.cmp(a)>=0?(t.isub(a),n.isub(o)):(a.isub(t),o.isub(n))}return(r=0===t.cmpn(1)?n:o).cmpn(0)<0&&r.iadd(e),r},BN.prototype.gcd=function gcd(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),a=e.clone();t.negative=0,a.negative=0;for(var r=0;t.isEven()&&a.isEven();r++)t.iushrn(1),a.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;a.isEven();)a.iushrn(1);var n=t.cmp(a);if(n<0){var o=t;t=a,a=o}else if(0===n||0===a.cmpn(1))break;t.isub(a)}return a.iushln(r)},BN.prototype.invm=function invm(e){return this.egcd(e).a.umod(e)},BN.prototype.isEven=function isEven(){return 0==(1&this.words[0])},BN.prototype.isOdd=function isOdd(){return 1==(1&this.words[0])},BN.prototype.andln=function andln(e){return this.words[0]&e},BN.prototype.bincn=function bincn(e){assert("number"==typeof e);var t=e%26,a=(e-t)/26,r=1<>>26,c&=67108863,this.words[o]=c}return 0!==n&&(this.words[o]=n,this.length++),this},BN.prototype.isZero=function isZero(){return 1===this.length&&0===this.words[0]},BN.prototype.cmpn=function cmpn(e){var t,a=e<0;if(0!==this.negative&&!a)return-1;if(0===this.negative&&a)return 1;if(this.strip(),this.length>1)t=1;else{a&&(e=-e),assert(e<=67108863,"Number is too big");var r=0|this.words[0];t=r===e?0:re.length)return 1;if(this.length=0;a--){var r=0|this.words[a],n=0|e.words[a];if(r!==n){rn&&(t=1);break}}return t},BN.prototype.gtn=function gtn(e){return 1===this.cmpn(e)},BN.prototype.gt=function gt(e){return 1===this.cmp(e)},BN.prototype.gten=function gten(e){return this.cmpn(e)>=0},BN.prototype.gte=function gte(e){return this.cmp(e)>=0},BN.prototype.ltn=function ltn(e){return-1===this.cmpn(e)},BN.prototype.lt=function lt(e){return-1===this.cmp(e)},BN.prototype.lten=function lten(e){return this.cmpn(e)<=0},BN.prototype.lte=function lte(e){return this.cmp(e)<=0},BN.prototype.eqn=function eqn(e){return 0===this.cmpn(e)},BN.prototype.eq=function eq(e){return 0===this.cmp(e)},BN.red=function red(e){return new Red(e)},BN.prototype.toRed=function toRed(e){return assert(!this.red,"Already a number in reduction context"),assert(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},BN.prototype.fromRed=function fromRed(){return assert(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},BN.prototype._forceRed=function _forceRed(e){return this.red=e,this},BN.prototype.forceRed=function forceRed(e){return assert(!this.red,"Already a number in reduction context"),this._forceRed(e)},BN.prototype.redAdd=function redAdd(e){return assert(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},BN.prototype.redIAdd=function redIAdd(e){return assert(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},BN.prototype.redSub=function redSub(e){return assert(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},BN.prototype.redISub=function redISub(e){return assert(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},BN.prototype.redShl=function redShl(e){return assert(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},BN.prototype.redMul=function redMul(e){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},BN.prototype.redIMul=function redIMul(e){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},BN.prototype.redSqr=function redSqr(){return assert(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},BN.prototype.redISqr=function redISqr(){return assert(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},BN.prototype.redSqrt=function redSqrt(){return assert(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},BN.prototype.redInvm=function redInvm(){return assert(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},BN.prototype.redNeg=function redNeg(){return assert(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},BN.prototype.redPow=function redPow(e){return assert(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var s={k256:null,p224:null,p192:null,p25519:null};function MPrime(e,t){this.name=e,this.p=new BN(t,16),this.n=this.p.bitLength(),this.k=new BN(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function Red(e){if("string"==typeof e){var t=BN._prime(e);this.m=t.p,this.prime=t}else assert(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function Mont(e){Red.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new BN(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}MPrime.prototype._tmp=function _tmp(){var e=new BN(null);return e.words=new Array(Math.ceil(this.n/13)),e},MPrime.prototype.ireduce=function ireduce(e){var t,a=e;do{this.split(a,this.tmp),t=(a=(a=this.imulK(a)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?a.isub(this.p):void 0!==a.strip?a.strip():a._strip(),a},MPrime.prototype.split=function split(e,t){e.iushrn(this.n,0,t)},MPrime.prototype.imulK=function imulK(e){return e.imul(this.k)},inherits(K256,MPrime),K256.prototype.split=function split(e,t){for(var a=4194303,r=Math.min(e.length,9),n=0;n>>22,o=c}o>>>=22,e.words[n-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},K256.prototype.imulK=function imulK(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,a=0;a>>=26,e.words[a]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},BN._prime=function prime(e){if(s[e])return s[e];var prime;if("k256"===e)prime=new K256;else if("p224"===e)prime=new P224;else if("p192"===e)prime=new P192;else{if("p25519"!==e)throw new Error("Unknown prime "+e);prime=new P25519}return s[e]=prime,prime},Red.prototype._verify1=function _verify1(e){assert(0===e.negative,"red works only with positives"),assert(e.red,"red works only with red numbers")},Red.prototype._verify2=function _verify2(e,t){assert(0==(e.negative|t.negative),"red works only with positives"),assert(e.red&&e.red===t.red,"red works only with red numbers")},Red.prototype.imod=function imod(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},Red.prototype.neg=function neg(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},Red.prototype.add=function add(e,t){this._verify2(e,t);var a=e.add(t);return a.cmp(this.m)>=0&&a.isub(this.m),a._forceRed(this)},Red.prototype.iadd=function iadd(e,t){this._verify2(e,t);var a=e.iadd(t);return a.cmp(this.m)>=0&&a.isub(this.m),a},Red.prototype.sub=function sub(e,t){this._verify2(e,t);var a=e.sub(t);return a.cmpn(0)<0&&a.iadd(this.m),a._forceRed(this)},Red.prototype.isub=function isub(e,t){this._verify2(e,t);var a=e.isub(t);return a.cmpn(0)<0&&a.iadd(this.m),a},Red.prototype.shl=function shl(e,t){return this._verify1(e),this.imod(e.ushln(t))},Red.prototype.imul=function imul(e,t){return this._verify2(e,t),this.imod(e.imul(t))},Red.prototype.mul=function mul(e,t){return this._verify2(e,t),this.imod(e.mul(t))},Red.prototype.isqr=function isqr(e){return this.imul(e,e.clone())},Red.prototype.sqr=function sqr(e){return this.mul(e,e)},Red.prototype.sqrt=function sqrt(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(assert(t%2==1),3===t){var a=this.m.add(new BN(1)).iushrn(2);return this.pow(e,a)}for(var r=this.m.subn(1),n=0;!r.isZero()&&0===r.andln(1);)n++,r.iushrn(1);assert(!r.isZero());var o=new BN(1).toRed(this),c=o.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new BN(2*s*s).toRed(this);0!==this.pow(s,d).cmp(c);)s.redIAdd(c);for(var b=this.pow(s,r),u=this.pow(e,r.addn(1).iushrn(1)),h=this.pow(e,r),l=n;0!==h.cmp(o);){for(var g=h,p=0;0!==g.cmp(o);p++)g=g.redSqr();assert(p=0;r--){for(var s=t.words[r],b=d-1;b>=0;b--){var u=s>>b&1;n!==a[0]&&(n=this.sqr(n)),0!==u||0!==o?(o<<=1,o|=u,(4===++c||0===r&&0===b)&&(n=this.mul(n,a[o]),c=0,o=0)):c=0}d=26}return n},Red.prototype.convertTo=function convertTo(e){var t=e.umod(this.m);return t===e?t.clone():t},Red.prototype.convertFrom=function convertFrom(e){var t=e.clone();return t.red=null,t},BN.mont=function mont(e){return new Mont(e)},inherits(Mont,Red),Mont.prototype.convertTo=function convertTo(e){return this.imod(e.ushln(this.shift))},Mont.prototype.convertFrom=function convertFrom(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},Mont.prototype.imul=function imul(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var a=e.imul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},Mont.prototype.mul=function mul(e,t){if(e.isZero()||t.isZero())return new BN(0)._forceRed(this);var a=e.mul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},Mont.prototype.invm=function invm(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=a.nmd(e),this)},function(e,t,a){!function(e,t){"use strict";function assert(e,t){if(!e)throw new Error(t||"Assertion failed")}function inherits(e,t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype,e.prototype=new TempCtor,e.prototype.constructor=e}function BN(e,t,a){if(BN.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(a=t,t=10),this._init(e||0,t||10,a||"be"))}var r;"object"==typeof e?e.exports=BN:t.BN=BN,BN.BN=BN,BN.wordSize=26;try{r="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:a(1485).Buffer}catch(e){}function parseHex4Bits(e,t){var a=e.charCodeAt(t);return a>=65&&a<=70?a-55:a>=97&&a<=102?a-87:a-48&15}function parseHexByte(e,t,a){var r=parseHex4Bits(e,a);return a-1>=t&&(r|=parseHex4Bits(e,a-1)<<4),r}function parseBase(e,t,a,r){for(var n=0,o=Math.min(e.length,a),c=t;c=49?d-49+10:d>=17?d-17+10:d}return n}BN.isBN=function isBN(e){return e instanceof BN||null!==e&&"object"==typeof e&&e.constructor.wordSize===BN.wordSize&&Array.isArray(e.words)},BN.max=function max(e,t){return e.cmp(t)>0?e:t},BN.min=function min(e,t){return e.cmp(t)<0?e:t},BN.prototype._init=function init(e,t,a){if("number"==typeof e)return this._initNumber(e,t,a);if("object"==typeof e)return this._initArray(e,t,a);"hex"===t&&(t=16),assert(t===(0|t)&&t>=2&&t<=36);var r=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(r++,this.negative=1),r=0;r-=3)o=e[r]|e[r-1]<<8|e[r-2]<<16,this.words[n]|=o<>>26-c&67108863,(c+=24)>=26&&(c-=26,n++);else if("le"===a)for(r=0,n=0;r>>26-c&67108863,(c+=24)>=26&&(c-=26,n++);return this.strip()},BN.prototype._parseHex=function _parseHex(e,t,a){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)n=parseHexByte(e,t,r)<=18?(o-=18,c+=1,this.words[c]|=n>>>26):o+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(o-=18,c+=1,this.words[c]|=n>>>26):o+=8;this.strip()},BN.prototype._parseBase=function _parseBase(e,t,a){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var o=e.length-a,c=o%r,d=Math.min(o,o-c)+a,s=0,b=a;b1&&0===this.words[this.length-1];)this.length--;return this._normSign()},BN.prototype._normSign=function _normSign(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},BN.prototype.inspect=function inspect(){return(this.red?""};var n=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],o=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function smallMulTo(e,t,a){a.negative=t.negative^e.negative;var r=e.length+t.length|0;a.length=r,r=r-1|0;var n=0|e.words[0],o=0|t.words[0],c=n*o,d=67108863&c,s=c/67108864|0;a.words[0]=d;for(var b=1;b>>26,h=67108863&s,l=Math.min(b,t.length-1),g=Math.max(0,b-e.length+1);g<=l;g++){var p=b-g|0;u+=(c=(n=0|e.words[p])*(o=0|t.words[g])+h)/67108864|0,h=67108863&c}a.words[b]=0|h,s=0|u}return 0!==s?a.words[b]=0|s:a.length--,a.strip()}BN.prototype.toString=function toString(e,t){var a;if(t=0|t||1,16===(e=e||10)||"hex"===e){a="";for(var r=0,d=0,s=0;s>>24-r&16777215)||s!==this.length-1?n[6-u.length]+u+a:u+a,(r+=2)>=26&&(r-=26,s--)}for(0!==d&&(a=d.toString(16)+a);a.length%t!=0;)a="0"+a;return 0!==this.negative&&(a="-"+a),a}if(e===(0|e)&&e>=2&&e<=36){var h=o[e],l=c[e];a="";var g=this.clone();for(g.negative=0;!g.isZero();){var p=g.modn(l).toString(e);a=(g=g.idivn(l)).isZero()?p+a:n[h-p.length]+p+a}for(this.isZero()&&(a="0"+a);a.length%t!=0;)a="0"+a;return 0!==this.negative&&(a="-"+a),a}assert(!1,"Base should be between 2 and 36")},BN.prototype.toNumber=function toNumber(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&assert(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},BN.prototype.toJSON=function toJSON(){return this.toString(16)},BN.prototype.toBuffer=function toBuffer(e,t){return assert(void 0!==r),this.toArrayLike(r,e,t)},BN.prototype.toArray=function toArray(e,t){return this.toArrayLike(Array,e,t)},BN.prototype.toArrayLike=function toArrayLike(e,t,a){var r=this.byteLength(),n=a||Math.max(1,r);assert(r<=n,"byte array longer than desired length"),assert(n>0,"Requested array length <= 0"),this.strip();var o,c,d="le"===t,s=new e(n),b=this.clone();if(d){for(c=0;!b.isZero();c++)o=b.andln(255),b.iushrn(8),s[c]=o;for(;c=4096&&(a+=13,t>>>=13),t>=64&&(a+=7,t>>>=7),t>=8&&(a+=4,t>>>=4),t>=2&&(a+=2,t>>>=2),a+t},BN.prototype._zeroBits=function _zeroBits(e){if(0===e)return 26;var t=e,a=0;return 0==(8191&t)&&(a+=13,t>>>=13),0==(127&t)&&(a+=7,t>>>=7),0==(15&t)&&(a+=4,t>>>=4),0==(3&t)&&(a+=2,t>>>=2),0==(1&t)&&a++,a},BN.prototype.bitLength=function bitLength(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},BN.prototype.uor=function uor(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},BN.prototype.iuand=function iuand(e){var t;t=this.length>e.length?e:this;for(var a=0;ae.length?this.clone().iand(e):e.clone().iand(this)},BN.prototype.uand=function uand(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},BN.prototype.iuxor=function iuxor(e){var t,a;this.length>e.length?(t=this,a=e):(t=e,a=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},BN.prototype.uxor=function uxor(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},BN.prototype.inotn=function inotn(e){assert("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),a=e%26;this._expand(t),a>0&&t--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-a),this.strip()},BN.prototype.notn=function notn(e){return this.clone().inotn(e)},BN.prototype.setn=function setn(e,t){assert("number"==typeof e&&e>=0);var a=e/26|0,r=e%26;return this._expand(a+1),this.words[a]=t?this.words[a]|1<e.length?(a=this,r=e):(a=e,r=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=a.length,0!==n)this.words[this.length]=n,this.length++;else if(a!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},BN.prototype.isub=function isub(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var a,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(a=this,r=e):(a=e,r=this);for(var o=0,c=0;c>26,this.words[c]=67108863&t;for(;0!==o&&c>26,this.words[c]=67108863&t;if(0===o&&c>>13,g=0|c[1],p=8191&g,B=g>>>13,x=0|c[2],m=8191&x,I=x>>>13,y=0|c[3],C=8191&y,w=y>>>13,v=0|c[4],Q=8191&v,_=v>>>13,k=0|c[5],N=8191&k,D=k>>>13,G=0|c[6],T=8191&G,L=G>>>13,P=0|c[7],U=8191&P,q=P>>>13,O=0|c[8],H=8191&O,z=O>>>13,j=0|c[9],J=8191&j,Y=j>>>13,W=0|d[0],V=8191&W,X=W>>>13,$=0|d[1],et=8191&$,tt=$>>>13,at=0|d[2],rt=8191&at,it=at>>>13,nt=0|d[3],ot=8191&nt,ct=nt>>>13,dt=0|d[4],st=8191&dt,At=dt>>>13,bt=0|d[5],ut=8191&bt,ht=bt>>>13,pt=0|d[6],Bt=8191&pt,xt=pt>>>13,mt=0|d[7],It=8191&mt,Et=mt>>>13,yt=0|d[8],Ct=8191&yt,wt=yt>>>13,vt=0|d[9],Qt=8191&vt,Mt=vt>>>13;a.negative=e.negative^t.negative,a.length=19;var _t=(b+(r=Math.imul(h,V))|0)+((8191&(n=(n=Math.imul(h,X))+Math.imul(l,V)|0))<<13)|0;b=((o=Math.imul(l,X))+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(p,V),n=(n=Math.imul(p,X))+Math.imul(B,V)|0,o=Math.imul(B,X);var kt=(b+(r=r+Math.imul(h,et)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(l,et)|0))<<13)|0;b=((o=o+Math.imul(l,tt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(m,V),n=(n=Math.imul(m,X))+Math.imul(I,V)|0,o=Math.imul(I,X),r=r+Math.imul(p,et)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(B,et)|0,o=o+Math.imul(B,tt)|0;var St=(b+(r=r+Math.imul(h,rt)|0)|0)+((8191&(n=(n=n+Math.imul(h,it)|0)+Math.imul(l,rt)|0))<<13)|0;b=((o=o+Math.imul(l,it)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(C,V),n=(n=Math.imul(C,X))+Math.imul(w,V)|0,o=Math.imul(w,X),r=r+Math.imul(m,et)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(I,et)|0,o=o+Math.imul(I,tt)|0,r=r+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,it)|0;var Nt=(b+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,ct)|0)+Math.imul(l,ot)|0))<<13)|0;b=((o=o+Math.imul(l,ct)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,r=Math.imul(Q,V),n=(n=Math.imul(Q,X))+Math.imul(_,V)|0,o=Math.imul(_,X),r=r+Math.imul(C,et)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(w,et)|0,o=o+Math.imul(w,tt)|0,r=r+Math.imul(m,rt)|0,n=(n=n+Math.imul(m,it)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,it)|0,r=r+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,ct)|0;var Dt=(b+(r=r+Math.imul(h,st)|0)|0)+((8191&(n=(n=n+Math.imul(h,At)|0)+Math.imul(l,st)|0))<<13)|0;b=((o=o+Math.imul(l,At)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,r=Math.imul(N,V),n=(n=Math.imul(N,X))+Math.imul(D,V)|0,o=Math.imul(D,X),r=r+Math.imul(Q,et)|0,n=(n=n+Math.imul(Q,tt)|0)+Math.imul(_,et)|0,o=o+Math.imul(_,tt)|0,r=r+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(w,rt)|0,o=o+Math.imul(w,it)|0,r=r+Math.imul(m,ot)|0,n=(n=n+Math.imul(m,ct)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,ct)|0,r=r+Math.imul(p,st)|0,n=(n=n+Math.imul(p,At)|0)+Math.imul(B,st)|0,o=o+Math.imul(B,At)|0;var Rt=(b+(r=r+Math.imul(h,ut)|0)|0)+((8191&(n=(n=n+Math.imul(h,ht)|0)+Math.imul(l,ut)|0))<<13)|0;b=((o=o+Math.imul(l,ht)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(T,V),n=(n=Math.imul(T,X))+Math.imul(L,V)|0,o=Math.imul(L,X),r=r+Math.imul(N,et)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(D,et)|0,o=o+Math.imul(D,tt)|0,r=r+Math.imul(Q,rt)|0,n=(n=n+Math.imul(Q,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0,r=r+Math.imul(C,ot)|0,n=(n=n+Math.imul(C,ct)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,ct)|0,r=r+Math.imul(m,st)|0,n=(n=n+Math.imul(m,At)|0)+Math.imul(I,st)|0,o=o+Math.imul(I,At)|0,r=r+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ht)|0;var Ft=(b+(r=r+Math.imul(h,Bt)|0)|0)+((8191&(n=(n=n+Math.imul(h,xt)|0)+Math.imul(l,Bt)|0))<<13)|0;b=((o=o+Math.imul(l,xt)|0)+(n>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,r=Math.imul(U,V),n=(n=Math.imul(U,X))+Math.imul(q,V)|0,o=Math.imul(q,X),r=r+Math.imul(T,et)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(L,et)|0,o=o+Math.imul(L,tt)|0,r=r+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(D,rt)|0,o=o+Math.imul(D,it)|0,r=r+Math.imul(Q,ot)|0,n=(n=n+Math.imul(Q,ct)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,ct)|0,r=r+Math.imul(C,st)|0,n=(n=n+Math.imul(C,At)|0)+Math.imul(w,st)|0,o=o+Math.imul(w,At)|0,r=r+Math.imul(m,ut)|0,n=(n=n+Math.imul(m,ht)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ht)|0,r=r+Math.imul(p,Bt)|0,n=(n=n+Math.imul(p,xt)|0)+Math.imul(B,Bt)|0,o=o+Math.imul(B,xt)|0;var Gt=(b+(r=r+Math.imul(h,It)|0)|0)+((8191&(n=(n=n+Math.imul(h,Et)|0)+Math.imul(l,It)|0))<<13)|0;b=((o=o+Math.imul(l,Et)|0)+(n>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,r=Math.imul(H,V),n=(n=Math.imul(H,X))+Math.imul(z,V)|0,o=Math.imul(z,X),r=r+Math.imul(U,et)|0,n=(n=n+Math.imul(U,tt)|0)+Math.imul(q,et)|0,o=o+Math.imul(q,tt)|0,r=r+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,r=r+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,ct)|0,r=r+Math.imul(Q,st)|0,n=(n=n+Math.imul(Q,At)|0)+Math.imul(_,st)|0,o=o+Math.imul(_,At)|0,r=r+Math.imul(C,ut)|0,n=(n=n+Math.imul(C,ht)|0)+Math.imul(w,ut)|0,o=o+Math.imul(w,ht)|0,r=r+Math.imul(m,Bt)|0,n=(n=n+Math.imul(m,xt)|0)+Math.imul(I,Bt)|0,o=o+Math.imul(I,xt)|0,r=r+Math.imul(p,It)|0,n=(n=n+Math.imul(p,Et)|0)+Math.imul(B,It)|0,o=o+Math.imul(B,Et)|0;var Tt=(b+(r=r+Math.imul(h,Ct)|0)|0)+((8191&(n=(n=n+Math.imul(h,wt)|0)+Math.imul(l,Ct)|0))<<13)|0;b=((o=o+Math.imul(l,wt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(J,V),n=(n=Math.imul(J,X))+Math.imul(Y,V)|0,o=Math.imul(Y,X),r=r+Math.imul(H,et)|0,n=(n=n+Math.imul(H,tt)|0)+Math.imul(z,et)|0,o=o+Math.imul(z,tt)|0,r=r+Math.imul(U,rt)|0,n=(n=n+Math.imul(U,it)|0)+Math.imul(q,rt)|0,o=o+Math.imul(q,it)|0,r=r+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,ct)|0,r=r+Math.imul(N,st)|0,n=(n=n+Math.imul(N,At)|0)+Math.imul(D,st)|0,o=o+Math.imul(D,At)|0,r=r+Math.imul(Q,ut)|0,n=(n=n+Math.imul(Q,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,r=r+Math.imul(C,Bt)|0,n=(n=n+Math.imul(C,xt)|0)+Math.imul(w,Bt)|0,o=o+Math.imul(w,xt)|0,r=r+Math.imul(m,It)|0,n=(n=n+Math.imul(m,Et)|0)+Math.imul(I,It)|0,o=o+Math.imul(I,Et)|0,r=r+Math.imul(p,Ct)|0,n=(n=n+Math.imul(p,wt)|0)+Math.imul(B,Ct)|0,o=o+Math.imul(B,wt)|0;var Lt=(b+(r=r+Math.imul(h,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(h,Mt)|0)+Math.imul(l,Qt)|0))<<13)|0;b=((o=o+Math.imul(l,Mt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,r=Math.imul(J,et),n=(n=Math.imul(J,tt))+Math.imul(Y,et)|0,o=Math.imul(Y,tt),r=r+Math.imul(H,rt)|0,n=(n=n+Math.imul(H,it)|0)+Math.imul(z,rt)|0,o=o+Math.imul(z,it)|0,r=r+Math.imul(U,ot)|0,n=(n=n+Math.imul(U,ct)|0)+Math.imul(q,ot)|0,o=o+Math.imul(q,ct)|0,r=r+Math.imul(T,st)|0,n=(n=n+Math.imul(T,At)|0)+Math.imul(L,st)|0,o=o+Math.imul(L,At)|0,r=r+Math.imul(N,ut)|0,n=(n=n+Math.imul(N,ht)|0)+Math.imul(D,ut)|0,o=o+Math.imul(D,ht)|0,r=r+Math.imul(Q,Bt)|0,n=(n=n+Math.imul(Q,xt)|0)+Math.imul(_,Bt)|0,o=o+Math.imul(_,xt)|0,r=r+Math.imul(C,It)|0,n=(n=n+Math.imul(C,Et)|0)+Math.imul(w,It)|0,o=o+Math.imul(w,Et)|0,r=r+Math.imul(m,Ct)|0,n=(n=n+Math.imul(m,wt)|0)+Math.imul(I,Ct)|0,o=o+Math.imul(I,wt)|0;var Pt=(b+(r=r+Math.imul(p,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(p,Mt)|0)+Math.imul(B,Qt)|0))<<13)|0;b=((o=o+Math.imul(B,Mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,r=Math.imul(J,rt),n=(n=Math.imul(J,it))+Math.imul(Y,rt)|0,o=Math.imul(Y,it),r=r+Math.imul(H,ot)|0,n=(n=n+Math.imul(H,ct)|0)+Math.imul(z,ot)|0,o=o+Math.imul(z,ct)|0,r=r+Math.imul(U,st)|0,n=(n=n+Math.imul(U,At)|0)+Math.imul(q,st)|0,o=o+Math.imul(q,At)|0,r=r+Math.imul(T,ut)|0,n=(n=n+Math.imul(T,ht)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ht)|0,r=r+Math.imul(N,Bt)|0,n=(n=n+Math.imul(N,xt)|0)+Math.imul(D,Bt)|0,o=o+Math.imul(D,xt)|0,r=r+Math.imul(Q,It)|0,n=(n=n+Math.imul(Q,Et)|0)+Math.imul(_,It)|0,o=o+Math.imul(_,Et)|0,r=r+Math.imul(C,Ct)|0,n=(n=n+Math.imul(C,wt)|0)+Math.imul(w,Ct)|0,o=o+Math.imul(w,wt)|0;var Ut=(b+(r=r+Math.imul(m,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(m,Mt)|0)+Math.imul(I,Qt)|0))<<13)|0;b=((o=o+Math.imul(I,Mt)|0)+(n>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,r=Math.imul(J,ot),n=(n=Math.imul(J,ct))+Math.imul(Y,ot)|0,o=Math.imul(Y,ct),r=r+Math.imul(H,st)|0,n=(n=n+Math.imul(H,At)|0)+Math.imul(z,st)|0,o=o+Math.imul(z,At)|0,r=r+Math.imul(U,ut)|0,n=(n=n+Math.imul(U,ht)|0)+Math.imul(q,ut)|0,o=o+Math.imul(q,ht)|0,r=r+Math.imul(T,Bt)|0,n=(n=n+Math.imul(T,xt)|0)+Math.imul(L,Bt)|0,o=o+Math.imul(L,xt)|0,r=r+Math.imul(N,It)|0,n=(n=n+Math.imul(N,Et)|0)+Math.imul(D,It)|0,o=o+Math.imul(D,Et)|0,r=r+Math.imul(Q,Ct)|0,n=(n=n+Math.imul(Q,wt)|0)+Math.imul(_,Ct)|0,o=o+Math.imul(_,wt)|0;var qt=(b+(r=r+Math.imul(C,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(C,Mt)|0)+Math.imul(w,Qt)|0))<<13)|0;b=((o=o+Math.imul(w,Mt)|0)+(n>>>13)|0)+(qt>>>26)|0,qt&=67108863,r=Math.imul(J,st),n=(n=Math.imul(J,At))+Math.imul(Y,st)|0,o=Math.imul(Y,At),r=r+Math.imul(H,ut)|0,n=(n=n+Math.imul(H,ht)|0)+Math.imul(z,ut)|0,o=o+Math.imul(z,ht)|0,r=r+Math.imul(U,Bt)|0,n=(n=n+Math.imul(U,xt)|0)+Math.imul(q,Bt)|0,o=o+Math.imul(q,xt)|0,r=r+Math.imul(T,It)|0,n=(n=n+Math.imul(T,Et)|0)+Math.imul(L,It)|0,o=o+Math.imul(L,Et)|0,r=r+Math.imul(N,Ct)|0,n=(n=n+Math.imul(N,wt)|0)+Math.imul(D,Ct)|0,o=o+Math.imul(D,wt)|0;var Ot=(b+(r=r+Math.imul(Q,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(Q,Mt)|0)+Math.imul(_,Qt)|0))<<13)|0;b=((o=o+Math.imul(_,Mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(J,ut),n=(n=Math.imul(J,ht))+Math.imul(Y,ut)|0,o=Math.imul(Y,ht),r=r+Math.imul(H,Bt)|0,n=(n=n+Math.imul(H,xt)|0)+Math.imul(z,Bt)|0,o=o+Math.imul(z,xt)|0,r=r+Math.imul(U,It)|0,n=(n=n+Math.imul(U,Et)|0)+Math.imul(q,It)|0,o=o+Math.imul(q,Et)|0,r=r+Math.imul(T,Ct)|0,n=(n=n+Math.imul(T,wt)|0)+Math.imul(L,Ct)|0,o=o+Math.imul(L,wt)|0;var Ht=(b+(r=r+Math.imul(N,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(N,Mt)|0)+Math.imul(D,Qt)|0))<<13)|0;b=((o=o+Math.imul(D,Mt)|0)+(n>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,r=Math.imul(J,Bt),n=(n=Math.imul(J,xt))+Math.imul(Y,Bt)|0,o=Math.imul(Y,xt),r=r+Math.imul(H,It)|0,n=(n=n+Math.imul(H,Et)|0)+Math.imul(z,It)|0,o=o+Math.imul(z,Et)|0,r=r+Math.imul(U,Ct)|0,n=(n=n+Math.imul(U,wt)|0)+Math.imul(q,Ct)|0,o=o+Math.imul(q,wt)|0;var zt=(b+(r=r+Math.imul(T,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(T,Mt)|0)+Math.imul(L,Qt)|0))<<13)|0;b=((o=o+Math.imul(L,Mt)|0)+(n>>>13)|0)+(zt>>>26)|0,zt&=67108863,r=Math.imul(J,It),n=(n=Math.imul(J,Et))+Math.imul(Y,It)|0,o=Math.imul(Y,Et),r=r+Math.imul(H,Ct)|0,n=(n=n+Math.imul(H,wt)|0)+Math.imul(z,Ct)|0,o=o+Math.imul(z,wt)|0;var Kt=(b+(r=r+Math.imul(U,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(U,Mt)|0)+Math.imul(q,Qt)|0))<<13)|0;b=((o=o+Math.imul(q,Mt)|0)+(n>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,r=Math.imul(J,Ct),n=(n=Math.imul(J,wt))+Math.imul(Y,Ct)|0,o=Math.imul(Y,wt);var jt=(b+(r=r+Math.imul(H,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(H,Mt)|0)+Math.imul(z,Qt)|0))<<13)|0;b=((o=o+Math.imul(z,Mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Jt=(b+(r=Math.imul(J,Qt))|0)+((8191&(n=(n=Math.imul(J,Mt))+Math.imul(Y,Qt)|0))<<13)|0;return b=((o=Math.imul(Y,Mt))+(n>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,s[0]=_t,s[1]=kt,s[2]=St,s[3]=Nt,s[4]=Dt,s[5]=Rt,s[6]=Ft,s[7]=Gt,s[8]=Tt,s[9]=Lt,s[10]=Pt,s[11]=Ut,s[12]=qt,s[13]=Ot,s[14]=Ht,s[15]=zt,s[16]=Kt,s[17]=jt,s[18]=Jt,0!==b&&(s[19]=b,a.length++),a};function jumboMulTo(e,t,a){return(new FFTM).mulp(e,t,a)}function FFTM(e,t){this.x=e,this.y=t}Math.imul||(d=smallMulTo),BN.prototype.mulTo=function mulTo(e,t){var a,r=this.length+e.length;return a=10===this.length&&10===e.length?d(this,e,t):r<63?smallMulTo(this,e,t):r<1024?function bigMulTo(e,t,a){a.negative=t.negative^e.negative,a.length=e.length+t.length;for(var r=0,n=0,o=0;o>>26)|0)>>>26,c&=67108863}a.words[o]=d,r=c,c=n}return 0!==r?a.words[o]=r:a.length--,a.strip()}(this,e,t):jumboMulTo(this,e,t),a},FFTM.prototype.makeRBT=function makeRBT(e){for(var t=new Array(e),a=BN.prototype._countBits(e)-1,r=0;r>=1;return r},FFTM.prototype.permute=function permute(e,t,a,r,n,o){for(var c=0;c>>=1)n++;return 1<>>=13,a[2*o+1]=8191&n,n>>>=13;for(o=2*t;o>=26,t+=r/67108864|0,t+=n>>>26,this.words[a]=67108863&n}return 0!==t&&(this.words[a]=t,this.length++),this},BN.prototype.muln=function muln(e){return this.clone().imuln(e)},BN.prototype.sqr=function sqr(){return this.mul(this)},BN.prototype.isqr=function isqr(){return this.imul(this.clone())},BN.prototype.pow=function pow(e){var t=function toBitArray(e){for(var t=new Array(e.bitLength()),a=0;a>>n}return t}(e);if(0===t.length)return new BN(1);for(var a=this,r=0;r=0);var t,a=e%26,r=(e-a)/26,n=67108863>>>26-a<<26-a;if(0!==a){var o=0;for(t=0;t>>26-a}o&&(this.words[t]=o,this.length++)}if(0!==r){for(t=this.length-1;t>=0;t--)this.words[t+r]=this.words[t];for(t=0;t=0),r=t?(t-t%26)/26:0;var n=e%26,o=Math.min((e-n)/26,this.length),c=67108863^67108863>>>n<o)for(this.length-=o,s=0;s=0&&(0!==b||s>=r);s--){var u=0|this.words[s];this.words[s]=b<<26-n|u>>>n,b=u&c}return d&&0!==b&&(d.words[d.length++]=b),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},BN.prototype.ishrn=function ishrn(e,t,a){return assert(0===this.negative),this.iushrn(e,t,a)},BN.prototype.shln=function shln(e){return this.clone().ishln(e)},BN.prototype.ushln=function ushln(e){return this.clone().iushln(e)},BN.prototype.shrn=function shrn(e){return this.clone().ishrn(e)},BN.prototype.ushrn=function ushrn(e){return this.clone().iushrn(e)},BN.prototype.testn=function testn(e){assert("number"==typeof e&&e>=0);var t=e%26,a=(e-t)/26,r=1<=0);var t=e%26,a=(e-t)/26;if(assert(0===this.negative,"imaskn works only with positive numbers"),this.length<=a)return this;if(0!==t&&a++,this.length=Math.min(a,this.length),0!==t){var r=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},BN.prototype.isubn=function isubn(e){if(assert("number"==typeof e),assert(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(d/67108864|0),this.words[r+a]=67108863&n}for(;r>26,this.words[r+a]=67108863&n;if(0===c)return this.strip();for(assert(-1===c),c=0,r=0;r>26,this.words[r]=67108863&n;return this.negative=1,this.strip()},BN.prototype._wordDiv=function _wordDiv(e,t){var a=(this.length,e.length),r=this.clone(),n=e,o=0|n.words[n.length-1];0!==(a=26-this._countBits(o))&&(n=n.ushln(a),r.iushln(a),o=0|n.words[n.length-1]);var c,d=r.length-n.length;if("mod"!==t){(c=new BN(null)).length=d+1,c.words=new Array(c.length);for(var s=0;s=0;u--){var h=67108864*(0|r.words[n.length+u])+(0|r.words[n.length+u-1]);for(h=Math.min(h/o|0,67108863),r._ishlnsubmul(n,h,u);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(n,1,u),r.isZero()||(r.negative^=1);c&&(c.words[u]=h)}return c&&c.strip(),r.strip(),"div"!==t&&0!==a&&r.iushrn(a),{div:c||null,mod:r}},BN.prototype.divmod=function divmod(e,t,a){return assert(!e.isZero()),this.isZero()?{div:new BN(0),mod:new BN(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(r=o.div.neg()),"div"!==t&&(n=o.mod.neg(),a&&0!==n.negative&&n.iadd(e)),{div:r,mod:n}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(r=o.div.neg()),{div:r,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(n=o.mod.neg(),a&&0!==n.negative&&n.isub(e)),{div:o.div,mod:n}):e.length>this.length||this.cmp(e)<0?{div:new BN(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new BN(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new BN(this.modn(e.words[0]))}:this._wordDiv(e,t);var r,n,o},BN.prototype.div=function div(e){return this.divmod(e,"div",!1).div},BN.prototype.mod=function mod(e){return this.divmod(e,"mod",!1).mod},BN.prototype.umod=function umod(e){return this.divmod(e,"mod",!0).mod},BN.prototype.divRound=function divRound(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var a=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),o=a.cmp(r);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},BN.prototype.modn=function modn(e){assert(e<=67108863);for(var t=(1<<26)%e,a=0,r=this.length-1;r>=0;r--)a=(t*a+(0|this.words[r]))%e;return a},BN.prototype.idivn=function idivn(e){assert(e<=67108863);for(var t=0,a=this.length-1;a>=0;a--){var r=(0|this.words[a])+67108864*t;this.words[a]=r/e|0,t=r%e}return this.strip()},BN.prototype.divn=function divn(e){return this.clone().idivn(e)},BN.prototype.egcd=function egcd(e){assert(0===e.negative),assert(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r=new BN(1),n=new BN(0),o=new BN(0),c=new BN(1),d=0;t.isEven()&&a.isEven();)t.iushrn(1),a.iushrn(1),++d;for(var s=a.clone(),b=t.clone();!t.isZero();){for(var u=0,h=1;0==(t.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(t.iushrn(u);u-- >0;)(r.isOdd()||n.isOdd())&&(r.iadd(s),n.isub(b)),r.iushrn(1),n.iushrn(1);for(var l=0,g=1;0==(a.words[0]&g)&&l<26;++l,g<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(o.isOdd()||c.isOdd())&&(o.iadd(s),c.isub(b)),o.iushrn(1),c.iushrn(1);t.cmp(a)>=0?(t.isub(a),r.isub(o),n.isub(c)):(a.isub(t),o.isub(r),c.isub(n))}return{a:o,b:c,gcd:a.iushln(d)}},BN.prototype._invmp=function _invmp(e){assert(0===e.negative),assert(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r,n=new BN(1),o=new BN(0),c=a.clone();t.cmpn(1)>0&&a.cmpn(1)>0;){for(var d=0,s=1;0==(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0)for(t.iushrn(d);d-- >0;)n.isOdd()&&n.iadd(c),n.iushrn(1);for(var b=0,u=1;0==(a.words[0]&u)&&b<26;++b,u<<=1);if(b>0)for(a.iushrn(b);b-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);t.cmp(a)>=0?(t.isub(a),n.isub(o)):(a.isub(t),o.isub(n))}return(r=0===t.cmpn(1)?n:o).cmpn(0)<0&&r.iadd(e),r},BN.prototype.gcd=function gcd(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),a=e.clone();t.negative=0,a.negative=0;for(var r=0;t.isEven()&&a.isEven();r++)t.iushrn(1),a.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;a.isEven();)a.iushrn(1);var n=t.cmp(a);if(n<0){var o=t;t=a,a=o}else if(0===n||0===a.cmpn(1))break;t.isub(a)}return a.iushln(r)},BN.prototype.invm=function invm(e){return this.egcd(e).a.umod(e)},BN.prototype.isEven=function isEven(){return 0==(1&this.words[0])},BN.prototype.isOdd=function isOdd(){return 1==(1&this.words[0])},BN.prototype.andln=function andln(e){return this.words[0]&e},BN.prototype.bincn=function bincn(e){assert("number"==typeof e);var t=e%26,a=(e-t)/26,r=1<>>26,c&=67108863,this.words[o]=c}return 0!==n&&(this.words[o]=n,this.length++),this},BN.prototype.isZero=function isZero(){return 1===this.length&&0===this.words[0]},BN.prototype.cmpn=function cmpn(e){var t,a=e<0;if(0!==this.negative&&!a)return-1;if(0===this.negative&&a)return 1;if(this.strip(),this.length>1)t=1;else{a&&(e=-e),assert(e<=67108863,"Number is too big");var r=0|this.words[0];t=r===e?0:re.length)return 1;if(this.length=0;a--){var r=0|this.words[a],n=0|e.words[a];if(r!==n){rn&&(t=1);break}}return t},BN.prototype.gtn=function gtn(e){return 1===this.cmpn(e)},BN.prototype.gt=function gt(e){return 1===this.cmp(e)},BN.prototype.gten=function gten(e){return this.cmpn(e)>=0},BN.prototype.gte=function gte(e){return this.cmp(e)>=0},BN.prototype.ltn=function ltn(e){return-1===this.cmpn(e)},BN.prototype.lt=function lt(e){return-1===this.cmp(e)},BN.prototype.lten=function lten(e){return this.cmpn(e)<=0},BN.prototype.lte=function lte(e){return this.cmp(e)<=0},BN.prototype.eqn=function eqn(e){return 0===this.cmpn(e)},BN.prototype.eq=function eq(e){return 0===this.cmp(e)},BN.red=function red(e){return new Red(e)},BN.prototype.toRed=function toRed(e){return assert(!this.red,"Already a number in reduction context"),assert(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},BN.prototype.fromRed=function fromRed(){return assert(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},BN.prototype._forceRed=function _forceRed(e){return this.red=e,this},BN.prototype.forceRed=function forceRed(e){return assert(!this.red,"Already a number in reduction context"),this._forceRed(e)},BN.prototype.redAdd=function redAdd(e){return assert(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},BN.prototype.redIAdd=function redIAdd(e){return assert(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},BN.prototype.redSub=function redSub(e){return assert(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},BN.prototype.redISub=function redISub(e){return assert(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},BN.prototype.redShl=function redShl(e){return assert(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},BN.prototype.redMul=function redMul(e){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},BN.prototype.redIMul=function redIMul(e){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},BN.prototype.redSqr=function redSqr(){return assert(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},BN.prototype.redISqr=function redISqr(){return assert(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},BN.prototype.redSqrt=function redSqrt(){return assert(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},BN.prototype.redInvm=function redInvm(){return assert(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},BN.prototype.redNeg=function redNeg(){return assert(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},BN.prototype.redPow=function redPow(e){return assert(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var s={k256:null,p224:null,p192:null,p25519:null};function MPrime(e,t){this.name=e,this.p=new BN(t,16),this.n=this.p.bitLength(),this.k=new BN(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function Red(e){if("string"==typeof e){var t=BN._prime(e);this.m=t.p,this.prime=t}else assert(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function Mont(e){Red.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new BN(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}MPrime.prototype._tmp=function _tmp(){var e=new BN(null);return e.words=new Array(Math.ceil(this.n/13)),e},MPrime.prototype.ireduce=function ireduce(e){var t,a=e;do{this.split(a,this.tmp),t=(a=(a=this.imulK(a)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?a.isub(this.p):void 0!==a.strip?a.strip():a._strip(),a},MPrime.prototype.split=function split(e,t){e.iushrn(this.n,0,t)},MPrime.prototype.imulK=function imulK(e){return e.imul(this.k)},inherits(K256,MPrime),K256.prototype.split=function split(e,t){for(var a=4194303,r=Math.min(e.length,9),n=0;n>>22,o=c}o>>>=22,e.words[n-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},K256.prototype.imulK=function imulK(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,a=0;a>>=26,e.words[a]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},BN._prime=function prime(e){if(s[e])return s[e];var prime;if("k256"===e)prime=new K256;else if("p224"===e)prime=new P224;else if("p192"===e)prime=new P192;else{if("p25519"!==e)throw new Error("Unknown prime "+e);prime=new P25519}return s[e]=prime,prime},Red.prototype._verify1=function _verify1(e){assert(0===e.negative,"red works only with positives"),assert(e.red,"red works only with red numbers")},Red.prototype._verify2=function _verify2(e,t){assert(0==(e.negative|t.negative),"red works only with positives"),assert(e.red&&e.red===t.red,"red works only with red numbers")},Red.prototype.imod=function imod(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},Red.prototype.neg=function neg(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},Red.prototype.add=function add(e,t){this._verify2(e,t);var a=e.add(t);return a.cmp(this.m)>=0&&a.isub(this.m),a._forceRed(this)},Red.prototype.iadd=function iadd(e,t){this._verify2(e,t);var a=e.iadd(t);return a.cmp(this.m)>=0&&a.isub(this.m),a},Red.prototype.sub=function sub(e,t){this._verify2(e,t);var a=e.sub(t);return a.cmpn(0)<0&&a.iadd(this.m),a._forceRed(this)},Red.prototype.isub=function isub(e,t){this._verify2(e,t);var a=e.isub(t);return a.cmpn(0)<0&&a.iadd(this.m),a},Red.prototype.shl=function shl(e,t){return this._verify1(e),this.imod(e.ushln(t))},Red.prototype.imul=function imul(e,t){return this._verify2(e,t),this.imod(e.imul(t))},Red.prototype.mul=function mul(e,t){return this._verify2(e,t),this.imod(e.mul(t))},Red.prototype.isqr=function isqr(e){return this.imul(e,e.clone())},Red.prototype.sqr=function sqr(e){return this.mul(e,e)},Red.prototype.sqrt=function sqrt(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(assert(t%2==1),3===t){var a=this.m.add(new BN(1)).iushrn(2);return this.pow(e,a)}for(var r=this.m.subn(1),n=0;!r.isZero()&&0===r.andln(1);)n++,r.iushrn(1);assert(!r.isZero());var o=new BN(1).toRed(this),c=o.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new BN(2*s*s).toRed(this);0!==this.pow(s,d).cmp(c);)s.redIAdd(c);for(var b=this.pow(s,r),u=this.pow(e,r.addn(1).iushrn(1)),h=this.pow(e,r),l=n;0!==h.cmp(o);){for(var g=h,p=0;0!==g.cmp(o);p++)g=g.redSqr();assert(p=0;r--){for(var s=t.words[r],b=d-1;b>=0;b--){var u=s>>b&1;n!==a[0]&&(n=this.sqr(n)),0!==u||0!==o?(o<<=1,o|=u,(4===++c||0===r&&0===b)&&(n=this.mul(n,a[o]),c=0,o=0)):c=0}d=26}return n},Red.prototype.convertTo=function convertTo(e){var t=e.umod(this.m);return t===e?t.clone():t},Red.prototype.convertFrom=function convertFrom(e){var t=e.clone();return t.red=null,t},BN.mont=function mont(e){return new Mont(e)},inherits(Mont,Red),Mont.prototype.convertTo=function convertTo(e){return this.imod(e.ushln(this.shift))},Mont.prototype.convertFrom=function convertFrom(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},Mont.prototype.imul=function imul(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var a=e.imul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},Mont.prototype.mul=function mul(e,t){if(e.isZero()||t.isZero())return new BN(0)._forceRed(this);var a=e.mul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},Mont.prototype.invm=function invm(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=a.nmd(e),this)},function(e,t,a){!function(e,t){"use strict";function assert(e,t){if(!e)throw new Error(t||"Assertion failed")}function inherits(e,t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype,e.prototype=new TempCtor,e.prototype.constructor=e}function BN(e,t,a){if(BN.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(a=t,t=10),this._init(e||0,t||10,a||"be"))}var r;"object"==typeof e?e.exports=BN:t.BN=BN,BN.BN=BN,BN.wordSize=26;try{r="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:a(1551).Buffer}catch(e){}function parseHex4Bits(e,t){var a=e.charCodeAt(t);return a>=65&&a<=70?a-55:a>=97&&a<=102?a-87:a-48&15}function parseHexByte(e,t,a){var r=parseHex4Bits(e,a);return a-1>=t&&(r|=parseHex4Bits(e,a-1)<<4),r}function parseBase(e,t,a,r){for(var n=0,o=Math.min(e.length,a),c=t;c=49?d-49+10:d>=17?d-17+10:d}return n}BN.isBN=function isBN(e){return e instanceof BN||null!==e&&"object"==typeof e&&e.constructor.wordSize===BN.wordSize&&Array.isArray(e.words)},BN.max=function max(e,t){return e.cmp(t)>0?e:t},BN.min=function min(e,t){return e.cmp(t)<0?e:t},BN.prototype._init=function init(e,t,a){if("number"==typeof e)return this._initNumber(e,t,a);if("object"==typeof e)return this._initArray(e,t,a);"hex"===t&&(t=16),assert(t===(0|t)&&t>=2&&t<=36);var r=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(r++,this.negative=1),r=0;r-=3)o=e[r]|e[r-1]<<8|e[r-2]<<16,this.words[n]|=o<>>26-c&67108863,(c+=24)>=26&&(c-=26,n++);else if("le"===a)for(r=0,n=0;r>>26-c&67108863,(c+=24)>=26&&(c-=26,n++);return this.strip()},BN.prototype._parseHex=function _parseHex(e,t,a){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)n=parseHexByte(e,t,r)<=18?(o-=18,c+=1,this.words[c]|=n>>>26):o+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(o-=18,c+=1,this.words[c]|=n>>>26):o+=8;this.strip()},BN.prototype._parseBase=function _parseBase(e,t,a){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var o=e.length-a,c=o%r,d=Math.min(o,o-c)+a,s=0,b=a;b1&&0===this.words[this.length-1];)this.length--;return this._normSign()},BN.prototype._normSign=function _normSign(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},BN.prototype.inspect=function inspect(){return(this.red?""};var n=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],o=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function smallMulTo(e,t,a){a.negative=t.negative^e.negative;var r=e.length+t.length|0;a.length=r,r=r-1|0;var n=0|e.words[0],o=0|t.words[0],c=n*o,d=67108863&c,s=c/67108864|0;a.words[0]=d;for(var b=1;b>>26,h=67108863&s,l=Math.min(b,t.length-1),g=Math.max(0,b-e.length+1);g<=l;g++){var p=b-g|0;u+=(c=(n=0|e.words[p])*(o=0|t.words[g])+h)/67108864|0,h=67108863&c}a.words[b]=0|h,s=0|u}return 0!==s?a.words[b]=0|s:a.length--,a.strip()}BN.prototype.toString=function toString(e,t){var a;if(t=0|t||1,16===(e=e||10)||"hex"===e){a="";for(var r=0,d=0,s=0;s>>24-r&16777215)||s!==this.length-1?n[6-u.length]+u+a:u+a,(r+=2)>=26&&(r-=26,s--)}for(0!==d&&(a=d.toString(16)+a);a.length%t!=0;)a="0"+a;return 0!==this.negative&&(a="-"+a),a}if(e===(0|e)&&e>=2&&e<=36){var h=o[e],l=c[e];a="";var g=this.clone();for(g.negative=0;!g.isZero();){var p=g.modn(l).toString(e);a=(g=g.idivn(l)).isZero()?p+a:n[h-p.length]+p+a}for(this.isZero()&&(a="0"+a);a.length%t!=0;)a="0"+a;return 0!==this.negative&&(a="-"+a),a}assert(!1,"Base should be between 2 and 36")},BN.prototype.toNumber=function toNumber(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&assert(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},BN.prototype.toJSON=function toJSON(){return this.toString(16)},BN.prototype.toBuffer=function toBuffer(e,t){return assert(void 0!==r),this.toArrayLike(r,e,t)},BN.prototype.toArray=function toArray(e,t){return this.toArrayLike(Array,e,t)},BN.prototype.toArrayLike=function toArrayLike(e,t,a){var r=this.byteLength(),n=a||Math.max(1,r);assert(r<=n,"byte array longer than desired length"),assert(n>0,"Requested array length <= 0"),this.strip();var o,c,d="le"===t,s=new e(n),b=this.clone();if(d){for(c=0;!b.isZero();c++)o=b.andln(255),b.iushrn(8),s[c]=o;for(;c=4096&&(a+=13,t>>>=13),t>=64&&(a+=7,t>>>=7),t>=8&&(a+=4,t>>>=4),t>=2&&(a+=2,t>>>=2),a+t},BN.prototype._zeroBits=function _zeroBits(e){if(0===e)return 26;var t=e,a=0;return 0==(8191&t)&&(a+=13,t>>>=13),0==(127&t)&&(a+=7,t>>>=7),0==(15&t)&&(a+=4,t>>>=4),0==(3&t)&&(a+=2,t>>>=2),0==(1&t)&&a++,a},BN.prototype.bitLength=function bitLength(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},BN.prototype.uor=function uor(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},BN.prototype.iuand=function iuand(e){var t;t=this.length>e.length?e:this;for(var a=0;ae.length?this.clone().iand(e):e.clone().iand(this)},BN.prototype.uand=function uand(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},BN.prototype.iuxor=function iuxor(e){var t,a;this.length>e.length?(t=this,a=e):(t=e,a=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},BN.prototype.uxor=function uxor(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},BN.prototype.inotn=function inotn(e){assert("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),a=e%26;this._expand(t),a>0&&t--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-a),this.strip()},BN.prototype.notn=function notn(e){return this.clone().inotn(e)},BN.prototype.setn=function setn(e,t){assert("number"==typeof e&&e>=0);var a=e/26|0,r=e%26;return this._expand(a+1),this.words[a]=t?this.words[a]|1<e.length?(a=this,r=e):(a=e,r=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=a.length,0!==n)this.words[this.length]=n,this.length++;else if(a!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},BN.prototype.isub=function isub(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var a,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(a=this,r=e):(a=e,r=this);for(var o=0,c=0;c>26,this.words[c]=67108863&t;for(;0!==o&&c>26,this.words[c]=67108863&t;if(0===o&&c>>13,g=0|c[1],p=8191&g,B=g>>>13,x=0|c[2],m=8191&x,I=x>>>13,y=0|c[3],C=8191&y,w=y>>>13,v=0|c[4],Q=8191&v,_=v>>>13,k=0|c[5],N=8191&k,D=k>>>13,G=0|c[6],T=8191&G,L=G>>>13,P=0|c[7],U=8191&P,q=P>>>13,O=0|c[8],H=8191&O,z=O>>>13,j=0|c[9],J=8191&j,Y=j>>>13,W=0|d[0],V=8191&W,X=W>>>13,$=0|d[1],et=8191&$,tt=$>>>13,at=0|d[2],rt=8191&at,it=at>>>13,nt=0|d[3],ot=8191&nt,ct=nt>>>13,dt=0|d[4],st=8191&dt,At=dt>>>13,bt=0|d[5],ut=8191&bt,ht=bt>>>13,pt=0|d[6],Bt=8191&pt,xt=pt>>>13,mt=0|d[7],It=8191&mt,Et=mt>>>13,yt=0|d[8],Ct=8191&yt,wt=yt>>>13,vt=0|d[9],Qt=8191&vt,Mt=vt>>>13;a.negative=e.negative^t.negative,a.length=19;var _t=(b+(r=Math.imul(h,V))|0)+((8191&(n=(n=Math.imul(h,X))+Math.imul(l,V)|0))<<13)|0;b=((o=Math.imul(l,X))+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(p,V),n=(n=Math.imul(p,X))+Math.imul(B,V)|0,o=Math.imul(B,X);var kt=(b+(r=r+Math.imul(h,et)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(l,et)|0))<<13)|0;b=((o=o+Math.imul(l,tt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(m,V),n=(n=Math.imul(m,X))+Math.imul(I,V)|0,o=Math.imul(I,X),r=r+Math.imul(p,et)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(B,et)|0,o=o+Math.imul(B,tt)|0;var St=(b+(r=r+Math.imul(h,rt)|0)|0)+((8191&(n=(n=n+Math.imul(h,it)|0)+Math.imul(l,rt)|0))<<13)|0;b=((o=o+Math.imul(l,it)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(C,V),n=(n=Math.imul(C,X))+Math.imul(w,V)|0,o=Math.imul(w,X),r=r+Math.imul(m,et)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(I,et)|0,o=o+Math.imul(I,tt)|0,r=r+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,it)|0;var Nt=(b+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,ct)|0)+Math.imul(l,ot)|0))<<13)|0;b=((o=o+Math.imul(l,ct)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,r=Math.imul(Q,V),n=(n=Math.imul(Q,X))+Math.imul(_,V)|0,o=Math.imul(_,X),r=r+Math.imul(C,et)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(w,et)|0,o=o+Math.imul(w,tt)|0,r=r+Math.imul(m,rt)|0,n=(n=n+Math.imul(m,it)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,it)|0,r=r+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,ct)|0;var Dt=(b+(r=r+Math.imul(h,st)|0)|0)+((8191&(n=(n=n+Math.imul(h,At)|0)+Math.imul(l,st)|0))<<13)|0;b=((o=o+Math.imul(l,At)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,r=Math.imul(N,V),n=(n=Math.imul(N,X))+Math.imul(D,V)|0,o=Math.imul(D,X),r=r+Math.imul(Q,et)|0,n=(n=n+Math.imul(Q,tt)|0)+Math.imul(_,et)|0,o=o+Math.imul(_,tt)|0,r=r+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(w,rt)|0,o=o+Math.imul(w,it)|0,r=r+Math.imul(m,ot)|0,n=(n=n+Math.imul(m,ct)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,ct)|0,r=r+Math.imul(p,st)|0,n=(n=n+Math.imul(p,At)|0)+Math.imul(B,st)|0,o=o+Math.imul(B,At)|0;var Rt=(b+(r=r+Math.imul(h,ut)|0)|0)+((8191&(n=(n=n+Math.imul(h,ht)|0)+Math.imul(l,ut)|0))<<13)|0;b=((o=o+Math.imul(l,ht)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(T,V),n=(n=Math.imul(T,X))+Math.imul(L,V)|0,o=Math.imul(L,X),r=r+Math.imul(N,et)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(D,et)|0,o=o+Math.imul(D,tt)|0,r=r+Math.imul(Q,rt)|0,n=(n=n+Math.imul(Q,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0,r=r+Math.imul(C,ot)|0,n=(n=n+Math.imul(C,ct)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,ct)|0,r=r+Math.imul(m,st)|0,n=(n=n+Math.imul(m,At)|0)+Math.imul(I,st)|0,o=o+Math.imul(I,At)|0,r=r+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ht)|0;var Ft=(b+(r=r+Math.imul(h,Bt)|0)|0)+((8191&(n=(n=n+Math.imul(h,xt)|0)+Math.imul(l,Bt)|0))<<13)|0;b=((o=o+Math.imul(l,xt)|0)+(n>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,r=Math.imul(U,V),n=(n=Math.imul(U,X))+Math.imul(q,V)|0,o=Math.imul(q,X),r=r+Math.imul(T,et)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(L,et)|0,o=o+Math.imul(L,tt)|0,r=r+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(D,rt)|0,o=o+Math.imul(D,it)|0,r=r+Math.imul(Q,ot)|0,n=(n=n+Math.imul(Q,ct)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,ct)|0,r=r+Math.imul(C,st)|0,n=(n=n+Math.imul(C,At)|0)+Math.imul(w,st)|0,o=o+Math.imul(w,At)|0,r=r+Math.imul(m,ut)|0,n=(n=n+Math.imul(m,ht)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ht)|0,r=r+Math.imul(p,Bt)|0,n=(n=n+Math.imul(p,xt)|0)+Math.imul(B,Bt)|0,o=o+Math.imul(B,xt)|0;var Gt=(b+(r=r+Math.imul(h,It)|0)|0)+((8191&(n=(n=n+Math.imul(h,Et)|0)+Math.imul(l,It)|0))<<13)|0;b=((o=o+Math.imul(l,Et)|0)+(n>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,r=Math.imul(H,V),n=(n=Math.imul(H,X))+Math.imul(z,V)|0,o=Math.imul(z,X),r=r+Math.imul(U,et)|0,n=(n=n+Math.imul(U,tt)|0)+Math.imul(q,et)|0,o=o+Math.imul(q,tt)|0,r=r+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,r=r+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,ct)|0,r=r+Math.imul(Q,st)|0,n=(n=n+Math.imul(Q,At)|0)+Math.imul(_,st)|0,o=o+Math.imul(_,At)|0,r=r+Math.imul(C,ut)|0,n=(n=n+Math.imul(C,ht)|0)+Math.imul(w,ut)|0,o=o+Math.imul(w,ht)|0,r=r+Math.imul(m,Bt)|0,n=(n=n+Math.imul(m,xt)|0)+Math.imul(I,Bt)|0,o=o+Math.imul(I,xt)|0,r=r+Math.imul(p,It)|0,n=(n=n+Math.imul(p,Et)|0)+Math.imul(B,It)|0,o=o+Math.imul(B,Et)|0;var Tt=(b+(r=r+Math.imul(h,Ct)|0)|0)+((8191&(n=(n=n+Math.imul(h,wt)|0)+Math.imul(l,Ct)|0))<<13)|0;b=((o=o+Math.imul(l,wt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(J,V),n=(n=Math.imul(J,X))+Math.imul(Y,V)|0,o=Math.imul(Y,X),r=r+Math.imul(H,et)|0,n=(n=n+Math.imul(H,tt)|0)+Math.imul(z,et)|0,o=o+Math.imul(z,tt)|0,r=r+Math.imul(U,rt)|0,n=(n=n+Math.imul(U,it)|0)+Math.imul(q,rt)|0,o=o+Math.imul(q,it)|0,r=r+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,ct)|0,r=r+Math.imul(N,st)|0,n=(n=n+Math.imul(N,At)|0)+Math.imul(D,st)|0,o=o+Math.imul(D,At)|0,r=r+Math.imul(Q,ut)|0,n=(n=n+Math.imul(Q,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,r=r+Math.imul(C,Bt)|0,n=(n=n+Math.imul(C,xt)|0)+Math.imul(w,Bt)|0,o=o+Math.imul(w,xt)|0,r=r+Math.imul(m,It)|0,n=(n=n+Math.imul(m,Et)|0)+Math.imul(I,It)|0,o=o+Math.imul(I,Et)|0,r=r+Math.imul(p,Ct)|0,n=(n=n+Math.imul(p,wt)|0)+Math.imul(B,Ct)|0,o=o+Math.imul(B,wt)|0;var Lt=(b+(r=r+Math.imul(h,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(h,Mt)|0)+Math.imul(l,Qt)|0))<<13)|0;b=((o=o+Math.imul(l,Mt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,r=Math.imul(J,et),n=(n=Math.imul(J,tt))+Math.imul(Y,et)|0,o=Math.imul(Y,tt),r=r+Math.imul(H,rt)|0,n=(n=n+Math.imul(H,it)|0)+Math.imul(z,rt)|0,o=o+Math.imul(z,it)|0,r=r+Math.imul(U,ot)|0,n=(n=n+Math.imul(U,ct)|0)+Math.imul(q,ot)|0,o=o+Math.imul(q,ct)|0,r=r+Math.imul(T,st)|0,n=(n=n+Math.imul(T,At)|0)+Math.imul(L,st)|0,o=o+Math.imul(L,At)|0,r=r+Math.imul(N,ut)|0,n=(n=n+Math.imul(N,ht)|0)+Math.imul(D,ut)|0,o=o+Math.imul(D,ht)|0,r=r+Math.imul(Q,Bt)|0,n=(n=n+Math.imul(Q,xt)|0)+Math.imul(_,Bt)|0,o=o+Math.imul(_,xt)|0,r=r+Math.imul(C,It)|0,n=(n=n+Math.imul(C,Et)|0)+Math.imul(w,It)|0,o=o+Math.imul(w,Et)|0,r=r+Math.imul(m,Ct)|0,n=(n=n+Math.imul(m,wt)|0)+Math.imul(I,Ct)|0,o=o+Math.imul(I,wt)|0;var Pt=(b+(r=r+Math.imul(p,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(p,Mt)|0)+Math.imul(B,Qt)|0))<<13)|0;b=((o=o+Math.imul(B,Mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,r=Math.imul(J,rt),n=(n=Math.imul(J,it))+Math.imul(Y,rt)|0,o=Math.imul(Y,it),r=r+Math.imul(H,ot)|0,n=(n=n+Math.imul(H,ct)|0)+Math.imul(z,ot)|0,o=o+Math.imul(z,ct)|0,r=r+Math.imul(U,st)|0,n=(n=n+Math.imul(U,At)|0)+Math.imul(q,st)|0,o=o+Math.imul(q,At)|0,r=r+Math.imul(T,ut)|0,n=(n=n+Math.imul(T,ht)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ht)|0,r=r+Math.imul(N,Bt)|0,n=(n=n+Math.imul(N,xt)|0)+Math.imul(D,Bt)|0,o=o+Math.imul(D,xt)|0,r=r+Math.imul(Q,It)|0,n=(n=n+Math.imul(Q,Et)|0)+Math.imul(_,It)|0,o=o+Math.imul(_,Et)|0,r=r+Math.imul(C,Ct)|0,n=(n=n+Math.imul(C,wt)|0)+Math.imul(w,Ct)|0,o=o+Math.imul(w,wt)|0;var Ut=(b+(r=r+Math.imul(m,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(m,Mt)|0)+Math.imul(I,Qt)|0))<<13)|0;b=((o=o+Math.imul(I,Mt)|0)+(n>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,r=Math.imul(J,ot),n=(n=Math.imul(J,ct))+Math.imul(Y,ot)|0,o=Math.imul(Y,ct),r=r+Math.imul(H,st)|0,n=(n=n+Math.imul(H,At)|0)+Math.imul(z,st)|0,o=o+Math.imul(z,At)|0,r=r+Math.imul(U,ut)|0,n=(n=n+Math.imul(U,ht)|0)+Math.imul(q,ut)|0,o=o+Math.imul(q,ht)|0,r=r+Math.imul(T,Bt)|0,n=(n=n+Math.imul(T,xt)|0)+Math.imul(L,Bt)|0,o=o+Math.imul(L,xt)|0,r=r+Math.imul(N,It)|0,n=(n=n+Math.imul(N,Et)|0)+Math.imul(D,It)|0,o=o+Math.imul(D,Et)|0,r=r+Math.imul(Q,Ct)|0,n=(n=n+Math.imul(Q,wt)|0)+Math.imul(_,Ct)|0,o=o+Math.imul(_,wt)|0;var qt=(b+(r=r+Math.imul(C,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(C,Mt)|0)+Math.imul(w,Qt)|0))<<13)|0;b=((o=o+Math.imul(w,Mt)|0)+(n>>>13)|0)+(qt>>>26)|0,qt&=67108863,r=Math.imul(J,st),n=(n=Math.imul(J,At))+Math.imul(Y,st)|0,o=Math.imul(Y,At),r=r+Math.imul(H,ut)|0,n=(n=n+Math.imul(H,ht)|0)+Math.imul(z,ut)|0,o=o+Math.imul(z,ht)|0,r=r+Math.imul(U,Bt)|0,n=(n=n+Math.imul(U,xt)|0)+Math.imul(q,Bt)|0,o=o+Math.imul(q,xt)|0,r=r+Math.imul(T,It)|0,n=(n=n+Math.imul(T,Et)|0)+Math.imul(L,It)|0,o=o+Math.imul(L,Et)|0,r=r+Math.imul(N,Ct)|0,n=(n=n+Math.imul(N,wt)|0)+Math.imul(D,Ct)|0,o=o+Math.imul(D,wt)|0;var Ot=(b+(r=r+Math.imul(Q,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(Q,Mt)|0)+Math.imul(_,Qt)|0))<<13)|0;b=((o=o+Math.imul(_,Mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(J,ut),n=(n=Math.imul(J,ht))+Math.imul(Y,ut)|0,o=Math.imul(Y,ht),r=r+Math.imul(H,Bt)|0,n=(n=n+Math.imul(H,xt)|0)+Math.imul(z,Bt)|0,o=o+Math.imul(z,xt)|0,r=r+Math.imul(U,It)|0,n=(n=n+Math.imul(U,Et)|0)+Math.imul(q,It)|0,o=o+Math.imul(q,Et)|0,r=r+Math.imul(T,Ct)|0,n=(n=n+Math.imul(T,wt)|0)+Math.imul(L,Ct)|0,o=o+Math.imul(L,wt)|0;var Ht=(b+(r=r+Math.imul(N,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(N,Mt)|0)+Math.imul(D,Qt)|0))<<13)|0;b=((o=o+Math.imul(D,Mt)|0)+(n>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,r=Math.imul(J,Bt),n=(n=Math.imul(J,xt))+Math.imul(Y,Bt)|0,o=Math.imul(Y,xt),r=r+Math.imul(H,It)|0,n=(n=n+Math.imul(H,Et)|0)+Math.imul(z,It)|0,o=o+Math.imul(z,Et)|0,r=r+Math.imul(U,Ct)|0,n=(n=n+Math.imul(U,wt)|0)+Math.imul(q,Ct)|0,o=o+Math.imul(q,wt)|0;var zt=(b+(r=r+Math.imul(T,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(T,Mt)|0)+Math.imul(L,Qt)|0))<<13)|0;b=((o=o+Math.imul(L,Mt)|0)+(n>>>13)|0)+(zt>>>26)|0,zt&=67108863,r=Math.imul(J,It),n=(n=Math.imul(J,Et))+Math.imul(Y,It)|0,o=Math.imul(Y,Et),r=r+Math.imul(H,Ct)|0,n=(n=n+Math.imul(H,wt)|0)+Math.imul(z,Ct)|0,o=o+Math.imul(z,wt)|0;var Kt=(b+(r=r+Math.imul(U,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(U,Mt)|0)+Math.imul(q,Qt)|0))<<13)|0;b=((o=o+Math.imul(q,Mt)|0)+(n>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,r=Math.imul(J,Ct),n=(n=Math.imul(J,wt))+Math.imul(Y,Ct)|0,o=Math.imul(Y,wt);var jt=(b+(r=r+Math.imul(H,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(H,Mt)|0)+Math.imul(z,Qt)|0))<<13)|0;b=((o=o+Math.imul(z,Mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Jt=(b+(r=Math.imul(J,Qt))|0)+((8191&(n=(n=Math.imul(J,Mt))+Math.imul(Y,Qt)|0))<<13)|0;return b=((o=Math.imul(Y,Mt))+(n>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,s[0]=_t,s[1]=kt,s[2]=St,s[3]=Nt,s[4]=Dt,s[5]=Rt,s[6]=Ft,s[7]=Gt,s[8]=Tt,s[9]=Lt,s[10]=Pt,s[11]=Ut,s[12]=qt,s[13]=Ot,s[14]=Ht,s[15]=zt,s[16]=Kt,s[17]=jt,s[18]=Jt,0!==b&&(s[19]=b,a.length++),a};function jumboMulTo(e,t,a){return(new FFTM).mulp(e,t,a)}function FFTM(e,t){this.x=e,this.y=t}Math.imul||(d=smallMulTo),BN.prototype.mulTo=function mulTo(e,t){var a,r=this.length+e.length;return a=10===this.length&&10===e.length?d(this,e,t):r<63?smallMulTo(this,e,t):r<1024?function bigMulTo(e,t,a){a.negative=t.negative^e.negative,a.length=e.length+t.length;for(var r=0,n=0,o=0;o>>26)|0)>>>26,c&=67108863}a.words[o]=d,r=c,c=n}return 0!==r?a.words[o]=r:a.length--,a.strip()}(this,e,t):jumboMulTo(this,e,t),a},FFTM.prototype.makeRBT=function makeRBT(e){for(var t=new Array(e),a=BN.prototype._countBits(e)-1,r=0;r>=1;return r},FFTM.prototype.permute=function permute(e,t,a,r,n,o){for(var c=0;c>>=1)n++;return 1<>>=13,a[2*o+1]=8191&n,n>>>=13;for(o=2*t;o>=26,t+=r/67108864|0,t+=n>>>26,this.words[a]=67108863&n}return 0!==t&&(this.words[a]=t,this.length++),this},BN.prototype.muln=function muln(e){return this.clone().imuln(e)},BN.prototype.sqr=function sqr(){return this.mul(this)},BN.prototype.isqr=function isqr(){return this.imul(this.clone())},BN.prototype.pow=function pow(e){var t=function toBitArray(e){for(var t=new Array(e.bitLength()),a=0;a>>n}return t}(e);if(0===t.length)return new BN(1);for(var a=this,r=0;r=0);var t,a=e%26,r=(e-a)/26,n=67108863>>>26-a<<26-a;if(0!==a){var o=0;for(t=0;t>>26-a}o&&(this.words[t]=o,this.length++)}if(0!==r){for(t=this.length-1;t>=0;t--)this.words[t+r]=this.words[t];for(t=0;t=0),r=t?(t-t%26)/26:0;var n=e%26,o=Math.min((e-n)/26,this.length),c=67108863^67108863>>>n<o)for(this.length-=o,s=0;s=0&&(0!==b||s>=r);s--){var u=0|this.words[s];this.words[s]=b<<26-n|u>>>n,b=u&c}return d&&0!==b&&(d.words[d.length++]=b),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},BN.prototype.ishrn=function ishrn(e,t,a){return assert(0===this.negative),this.iushrn(e,t,a)},BN.prototype.shln=function shln(e){return this.clone().ishln(e)},BN.prototype.ushln=function ushln(e){return this.clone().iushln(e)},BN.prototype.shrn=function shrn(e){return this.clone().ishrn(e)},BN.prototype.ushrn=function ushrn(e){return this.clone().iushrn(e)},BN.prototype.testn=function testn(e){assert("number"==typeof e&&e>=0);var t=e%26,a=(e-t)/26,r=1<=0);var t=e%26,a=(e-t)/26;if(assert(0===this.negative,"imaskn works only with positive numbers"),this.length<=a)return this;if(0!==t&&a++,this.length=Math.min(a,this.length),0!==t){var r=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},BN.prototype.isubn=function isubn(e){if(assert("number"==typeof e),assert(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(d/67108864|0),this.words[r+a]=67108863&n}for(;r>26,this.words[r+a]=67108863&n;if(0===c)return this.strip();for(assert(-1===c),c=0,r=0;r>26,this.words[r]=67108863&n;return this.negative=1,this.strip()},BN.prototype._wordDiv=function _wordDiv(e,t){var a=(this.length,e.length),r=this.clone(),n=e,o=0|n.words[n.length-1];0!==(a=26-this._countBits(o))&&(n=n.ushln(a),r.iushln(a),o=0|n.words[n.length-1]);var c,d=r.length-n.length;if("mod"!==t){(c=new BN(null)).length=d+1,c.words=new Array(c.length);for(var s=0;s=0;u--){var h=67108864*(0|r.words[n.length+u])+(0|r.words[n.length+u-1]);for(h=Math.min(h/o|0,67108863),r._ishlnsubmul(n,h,u);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(n,1,u),r.isZero()||(r.negative^=1);c&&(c.words[u]=h)}return c&&c.strip(),r.strip(),"div"!==t&&0!==a&&r.iushrn(a),{div:c||null,mod:r}},BN.prototype.divmod=function divmod(e,t,a){return assert(!e.isZero()),this.isZero()?{div:new BN(0),mod:new BN(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(r=o.div.neg()),"div"!==t&&(n=o.mod.neg(),a&&0!==n.negative&&n.iadd(e)),{div:r,mod:n}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(r=o.div.neg()),{div:r,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(n=o.mod.neg(),a&&0!==n.negative&&n.isub(e)),{div:o.div,mod:n}):e.length>this.length||this.cmp(e)<0?{div:new BN(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new BN(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new BN(this.modn(e.words[0]))}:this._wordDiv(e,t);var r,n,o},BN.prototype.div=function div(e){return this.divmod(e,"div",!1).div},BN.prototype.mod=function mod(e){return this.divmod(e,"mod",!1).mod},BN.prototype.umod=function umod(e){return this.divmod(e,"mod",!0).mod},BN.prototype.divRound=function divRound(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var a=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),o=a.cmp(r);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},BN.prototype.modn=function modn(e){assert(e<=67108863);for(var t=(1<<26)%e,a=0,r=this.length-1;r>=0;r--)a=(t*a+(0|this.words[r]))%e;return a},BN.prototype.idivn=function idivn(e){assert(e<=67108863);for(var t=0,a=this.length-1;a>=0;a--){var r=(0|this.words[a])+67108864*t;this.words[a]=r/e|0,t=r%e}return this.strip()},BN.prototype.divn=function divn(e){return this.clone().idivn(e)},BN.prototype.egcd=function egcd(e){assert(0===e.negative),assert(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r=new BN(1),n=new BN(0),o=new BN(0),c=new BN(1),d=0;t.isEven()&&a.isEven();)t.iushrn(1),a.iushrn(1),++d;for(var s=a.clone(),b=t.clone();!t.isZero();){for(var u=0,h=1;0==(t.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(t.iushrn(u);u-- >0;)(r.isOdd()||n.isOdd())&&(r.iadd(s),n.isub(b)),r.iushrn(1),n.iushrn(1);for(var l=0,g=1;0==(a.words[0]&g)&&l<26;++l,g<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(o.isOdd()||c.isOdd())&&(o.iadd(s),c.isub(b)),o.iushrn(1),c.iushrn(1);t.cmp(a)>=0?(t.isub(a),r.isub(o),n.isub(c)):(a.isub(t),o.isub(r),c.isub(n))}return{a:o,b:c,gcd:a.iushln(d)}},BN.prototype._invmp=function _invmp(e){assert(0===e.negative),assert(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r,n=new BN(1),o=new BN(0),c=a.clone();t.cmpn(1)>0&&a.cmpn(1)>0;){for(var d=0,s=1;0==(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0)for(t.iushrn(d);d-- >0;)n.isOdd()&&n.iadd(c),n.iushrn(1);for(var b=0,u=1;0==(a.words[0]&u)&&b<26;++b,u<<=1);if(b>0)for(a.iushrn(b);b-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);t.cmp(a)>=0?(t.isub(a),n.isub(o)):(a.isub(t),o.isub(n))}return(r=0===t.cmpn(1)?n:o).cmpn(0)<0&&r.iadd(e),r},BN.prototype.gcd=function gcd(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),a=e.clone();t.negative=0,a.negative=0;for(var r=0;t.isEven()&&a.isEven();r++)t.iushrn(1),a.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;a.isEven();)a.iushrn(1);var n=t.cmp(a);if(n<0){var o=t;t=a,a=o}else if(0===n||0===a.cmpn(1))break;t.isub(a)}return a.iushln(r)},BN.prototype.invm=function invm(e){return this.egcd(e).a.umod(e)},BN.prototype.isEven=function isEven(){return 0==(1&this.words[0])},BN.prototype.isOdd=function isOdd(){return 1==(1&this.words[0])},BN.prototype.andln=function andln(e){return this.words[0]&e},BN.prototype.bincn=function bincn(e){assert("number"==typeof e);var t=e%26,a=(e-t)/26,r=1<>>26,c&=67108863,this.words[o]=c}return 0!==n&&(this.words[o]=n,this.length++),this},BN.prototype.isZero=function isZero(){return 1===this.length&&0===this.words[0]},BN.prototype.cmpn=function cmpn(e){var t,a=e<0;if(0!==this.negative&&!a)return-1;if(0===this.negative&&a)return 1;if(this.strip(),this.length>1)t=1;else{a&&(e=-e),assert(e<=67108863,"Number is too big");var r=0|this.words[0];t=r===e?0:re.length)return 1;if(this.length=0;a--){var r=0|this.words[a],n=0|e.words[a];if(r!==n){rn&&(t=1);break}}return t},BN.prototype.gtn=function gtn(e){return 1===this.cmpn(e)},BN.prototype.gt=function gt(e){return 1===this.cmp(e)},BN.prototype.gten=function gten(e){return this.cmpn(e)>=0},BN.prototype.gte=function gte(e){return this.cmp(e)>=0},BN.prototype.ltn=function ltn(e){return-1===this.cmpn(e)},BN.prototype.lt=function lt(e){return-1===this.cmp(e)},BN.prototype.lten=function lten(e){return this.cmpn(e)<=0},BN.prototype.lte=function lte(e){return this.cmp(e)<=0},BN.prototype.eqn=function eqn(e){return 0===this.cmpn(e)},BN.prototype.eq=function eq(e){return 0===this.cmp(e)},BN.red=function red(e){return new Red(e)},BN.prototype.toRed=function toRed(e){return assert(!this.red,"Already a number in reduction context"),assert(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},BN.prototype.fromRed=function fromRed(){return assert(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},BN.prototype._forceRed=function _forceRed(e){return this.red=e,this},BN.prototype.forceRed=function forceRed(e){return assert(!this.red,"Already a number in reduction context"),this._forceRed(e)},BN.prototype.redAdd=function redAdd(e){return assert(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},BN.prototype.redIAdd=function redIAdd(e){return assert(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},BN.prototype.redSub=function redSub(e){return assert(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},BN.prototype.redISub=function redISub(e){return assert(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},BN.prototype.redShl=function redShl(e){return assert(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},BN.prototype.redMul=function redMul(e){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},BN.prototype.redIMul=function redIMul(e){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},BN.prototype.redSqr=function redSqr(){return assert(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},BN.prototype.redISqr=function redISqr(){return assert(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},BN.prototype.redSqrt=function redSqrt(){return assert(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},BN.prototype.redInvm=function redInvm(){return assert(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},BN.prototype.redNeg=function redNeg(){return assert(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},BN.prototype.redPow=function redPow(e){return assert(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var s={k256:null,p224:null,p192:null,p25519:null};function MPrime(e,t){this.name=e,this.p=new BN(t,16),this.n=this.p.bitLength(),this.k=new BN(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function Red(e){if("string"==typeof e){var t=BN._prime(e);this.m=t.p,this.prime=t}else assert(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function Mont(e){Red.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new BN(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}MPrime.prototype._tmp=function _tmp(){var e=new BN(null);return e.words=new Array(Math.ceil(this.n/13)),e},MPrime.prototype.ireduce=function ireduce(e){var t,a=e;do{this.split(a,this.tmp),t=(a=(a=this.imulK(a)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?a.isub(this.p):void 0!==a.strip?a.strip():a._strip(),a},MPrime.prototype.split=function split(e,t){e.iushrn(this.n,0,t)},MPrime.prototype.imulK=function imulK(e){return e.imul(this.k)},inherits(K256,MPrime),K256.prototype.split=function split(e,t){for(var a=4194303,r=Math.min(e.length,9),n=0;n>>22,o=c}o>>>=22,e.words[n-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},K256.prototype.imulK=function imulK(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,a=0;a>>=26,e.words[a]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},BN._prime=function prime(e){if(s[e])return s[e];var prime;if("k256"===e)prime=new K256;else if("p224"===e)prime=new P224;else if("p192"===e)prime=new P192;else{if("p25519"!==e)throw new Error("Unknown prime "+e);prime=new P25519}return s[e]=prime,prime},Red.prototype._verify1=function _verify1(e){assert(0===e.negative,"red works only with positives"),assert(e.red,"red works only with red numbers")},Red.prototype._verify2=function _verify2(e,t){assert(0==(e.negative|t.negative),"red works only with positives"),assert(e.red&&e.red===t.red,"red works only with red numbers")},Red.prototype.imod=function imod(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},Red.prototype.neg=function neg(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},Red.prototype.add=function add(e,t){this._verify2(e,t);var a=e.add(t);return a.cmp(this.m)>=0&&a.isub(this.m),a._forceRed(this)},Red.prototype.iadd=function iadd(e,t){this._verify2(e,t);var a=e.iadd(t);return a.cmp(this.m)>=0&&a.isub(this.m),a},Red.prototype.sub=function sub(e,t){this._verify2(e,t);var a=e.sub(t);return a.cmpn(0)<0&&a.iadd(this.m),a._forceRed(this)},Red.prototype.isub=function isub(e,t){this._verify2(e,t);var a=e.isub(t);return a.cmpn(0)<0&&a.iadd(this.m),a},Red.prototype.shl=function shl(e,t){return this._verify1(e),this.imod(e.ushln(t))},Red.prototype.imul=function imul(e,t){return this._verify2(e,t),this.imod(e.imul(t))},Red.prototype.mul=function mul(e,t){return this._verify2(e,t),this.imod(e.mul(t))},Red.prototype.isqr=function isqr(e){return this.imul(e,e.clone())},Red.prototype.sqr=function sqr(e){return this.mul(e,e)},Red.prototype.sqrt=function sqrt(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(assert(t%2==1),3===t){var a=this.m.add(new BN(1)).iushrn(2);return this.pow(e,a)}for(var r=this.m.subn(1),n=0;!r.isZero()&&0===r.andln(1);)n++,r.iushrn(1);assert(!r.isZero());var o=new BN(1).toRed(this),c=o.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new BN(2*s*s).toRed(this);0!==this.pow(s,d).cmp(c);)s.redIAdd(c);for(var b=this.pow(s,r),u=this.pow(e,r.addn(1).iushrn(1)),h=this.pow(e,r),l=n;0!==h.cmp(o);){for(var g=h,p=0;0!==g.cmp(o);p++)g=g.redSqr();assert(p=0;r--){for(var s=t.words[r],b=d-1;b>=0;b--){var u=s>>b&1;n!==a[0]&&(n=this.sqr(n)),0!==u||0!==o?(o<<=1,o|=u,(4===++c||0===r&&0===b)&&(n=this.mul(n,a[o]),c=0,o=0)):c=0}d=26}return n},Red.prototype.convertTo=function convertTo(e){var t=e.umod(this.m);return t===e?t.clone():t},Red.prototype.convertFrom=function convertFrom(e){var t=e.clone();return t.red=null,t},BN.mont=function mont(e){return new Mont(e)},inherits(Mont,Red),Mont.prototype.convertTo=function convertTo(e){return this.imod(e.ushln(this.shift))},Mont.prototype.convertFrom=function convertFrom(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},Mont.prototype.imul=function imul(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var a=e.imul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},Mont.prototype.mul=function mul(e,t){if(e.isZero()||t.isZero())return new BN(0)._forceRed(this);var a=e.mul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},Mont.prototype.invm=function invm(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=a.nmd(e),this)},function(e,t,a){!function(e,t){"use strict";function assert(e,t){if(!e)throw new Error(t||"Assertion failed")}function inherits(e,t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype,e.prototype=new TempCtor,e.prototype.constructor=e}function BN(e,t,a){if(BN.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(a=t,t=10),this._init(e||0,t||10,a||"be"))}var r;"object"==typeof e?e.exports=BN:t.BN=BN,BN.BN=BN,BN.wordSize=26;try{r="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:a(1561).Buffer}catch(e){}function parseHex4Bits(e,t){var a=e.charCodeAt(t);return a>=65&&a<=70?a-55:a>=97&&a<=102?a-87:a-48&15}function parseHexByte(e,t,a){var r=parseHex4Bits(e,a);return a-1>=t&&(r|=parseHex4Bits(e,a-1)<<4),r}function parseBase(e,t,a,r){for(var n=0,o=Math.min(e.length,a),c=t;c=49?d-49+10:d>=17?d-17+10:d}return n}BN.isBN=function isBN(e){return e instanceof BN||null!==e&&"object"==typeof e&&e.constructor.wordSize===BN.wordSize&&Array.isArray(e.words)},BN.max=function max(e,t){return e.cmp(t)>0?e:t},BN.min=function min(e,t){return e.cmp(t)<0?e:t},BN.prototype._init=function init(e,t,a){if("number"==typeof e)return this._initNumber(e,t,a);if("object"==typeof e)return this._initArray(e,t,a);"hex"===t&&(t=16),assert(t===(0|t)&&t>=2&&t<=36);var r=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(r++,this.negative=1),r=0;r-=3)o=e[r]|e[r-1]<<8|e[r-2]<<16,this.words[n]|=o<>>26-c&67108863,(c+=24)>=26&&(c-=26,n++);else if("le"===a)for(r=0,n=0;r>>26-c&67108863,(c+=24)>=26&&(c-=26,n++);return this.strip()},BN.prototype._parseHex=function _parseHex(e,t,a){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)n=parseHexByte(e,t,r)<=18?(o-=18,c+=1,this.words[c]|=n>>>26):o+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(o-=18,c+=1,this.words[c]|=n>>>26):o+=8;this.strip()},BN.prototype._parseBase=function _parseBase(e,t,a){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var o=e.length-a,c=o%r,d=Math.min(o,o-c)+a,s=0,b=a;b1&&0===this.words[this.length-1];)this.length--;return this._normSign()},BN.prototype._normSign=function _normSign(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},BN.prototype.inspect=function inspect(){return(this.red?""};var n=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],o=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function smallMulTo(e,t,a){a.negative=t.negative^e.negative;var r=e.length+t.length|0;a.length=r,r=r-1|0;var n=0|e.words[0],o=0|t.words[0],c=n*o,d=67108863&c,s=c/67108864|0;a.words[0]=d;for(var b=1;b>>26,h=67108863&s,l=Math.min(b,t.length-1),g=Math.max(0,b-e.length+1);g<=l;g++){var p=b-g|0;u+=(c=(n=0|e.words[p])*(o=0|t.words[g])+h)/67108864|0,h=67108863&c}a.words[b]=0|h,s=0|u}return 0!==s?a.words[b]=0|s:a.length--,a.strip()}BN.prototype.toString=function toString(e,t){var a;if(t=0|t||1,16===(e=e||10)||"hex"===e){a="";for(var r=0,d=0,s=0;s>>24-r&16777215)||s!==this.length-1?n[6-u.length]+u+a:u+a,(r+=2)>=26&&(r-=26,s--)}for(0!==d&&(a=d.toString(16)+a);a.length%t!=0;)a="0"+a;return 0!==this.negative&&(a="-"+a),a}if(e===(0|e)&&e>=2&&e<=36){var h=o[e],l=c[e];a="";var g=this.clone();for(g.negative=0;!g.isZero();){var p=g.modn(l).toString(e);a=(g=g.idivn(l)).isZero()?p+a:n[h-p.length]+p+a}for(this.isZero()&&(a="0"+a);a.length%t!=0;)a="0"+a;return 0!==this.negative&&(a="-"+a),a}assert(!1,"Base should be between 2 and 36")},BN.prototype.toNumber=function toNumber(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&assert(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},BN.prototype.toJSON=function toJSON(){return this.toString(16)},BN.prototype.toBuffer=function toBuffer(e,t){return assert(void 0!==r),this.toArrayLike(r,e,t)},BN.prototype.toArray=function toArray(e,t){return this.toArrayLike(Array,e,t)},BN.prototype.toArrayLike=function toArrayLike(e,t,a){var r=this.byteLength(),n=a||Math.max(1,r);assert(r<=n,"byte array longer than desired length"),assert(n>0,"Requested array length <= 0"),this.strip();var o,c,d="le"===t,s=new e(n),b=this.clone();if(d){for(c=0;!b.isZero();c++)o=b.andln(255),b.iushrn(8),s[c]=o;for(;c=4096&&(a+=13,t>>>=13),t>=64&&(a+=7,t>>>=7),t>=8&&(a+=4,t>>>=4),t>=2&&(a+=2,t>>>=2),a+t},BN.prototype._zeroBits=function _zeroBits(e){if(0===e)return 26;var t=e,a=0;return 0==(8191&t)&&(a+=13,t>>>=13),0==(127&t)&&(a+=7,t>>>=7),0==(15&t)&&(a+=4,t>>>=4),0==(3&t)&&(a+=2,t>>>=2),0==(1&t)&&a++,a},BN.prototype.bitLength=function bitLength(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},BN.prototype.uor=function uor(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},BN.prototype.iuand=function iuand(e){var t;t=this.length>e.length?e:this;for(var a=0;ae.length?this.clone().iand(e):e.clone().iand(this)},BN.prototype.uand=function uand(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},BN.prototype.iuxor=function iuxor(e){var t,a;this.length>e.length?(t=this,a=e):(t=e,a=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},BN.prototype.uxor=function uxor(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},BN.prototype.inotn=function inotn(e){assert("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),a=e%26;this._expand(t),a>0&&t--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-a),this.strip()},BN.prototype.notn=function notn(e){return this.clone().inotn(e)},BN.prototype.setn=function setn(e,t){assert("number"==typeof e&&e>=0);var a=e/26|0,r=e%26;return this._expand(a+1),this.words[a]=t?this.words[a]|1<e.length?(a=this,r=e):(a=e,r=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=a.length,0!==n)this.words[this.length]=n,this.length++;else if(a!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},BN.prototype.isub=function isub(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var a,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(a=this,r=e):(a=e,r=this);for(var o=0,c=0;c>26,this.words[c]=67108863&t;for(;0!==o&&c>26,this.words[c]=67108863&t;if(0===o&&c>>13,g=0|c[1],p=8191&g,B=g>>>13,x=0|c[2],m=8191&x,I=x>>>13,y=0|c[3],C=8191&y,w=y>>>13,v=0|c[4],Q=8191&v,_=v>>>13,k=0|c[5],N=8191&k,D=k>>>13,G=0|c[6],T=8191&G,L=G>>>13,P=0|c[7],U=8191&P,q=P>>>13,O=0|c[8],H=8191&O,z=O>>>13,j=0|c[9],J=8191&j,Y=j>>>13,W=0|d[0],V=8191&W,X=W>>>13,$=0|d[1],et=8191&$,tt=$>>>13,at=0|d[2],rt=8191&at,it=at>>>13,nt=0|d[3],ot=8191&nt,ct=nt>>>13,dt=0|d[4],st=8191&dt,At=dt>>>13,bt=0|d[5],ut=8191&bt,ht=bt>>>13,pt=0|d[6],Bt=8191&pt,xt=pt>>>13,mt=0|d[7],It=8191&mt,Et=mt>>>13,yt=0|d[8],Ct=8191&yt,wt=yt>>>13,vt=0|d[9],Qt=8191&vt,Mt=vt>>>13;a.negative=e.negative^t.negative,a.length=19;var _t=(b+(r=Math.imul(h,V))|0)+((8191&(n=(n=Math.imul(h,X))+Math.imul(l,V)|0))<<13)|0;b=((o=Math.imul(l,X))+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(p,V),n=(n=Math.imul(p,X))+Math.imul(B,V)|0,o=Math.imul(B,X);var kt=(b+(r=r+Math.imul(h,et)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(l,et)|0))<<13)|0;b=((o=o+Math.imul(l,tt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(m,V),n=(n=Math.imul(m,X))+Math.imul(I,V)|0,o=Math.imul(I,X),r=r+Math.imul(p,et)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(B,et)|0,o=o+Math.imul(B,tt)|0;var St=(b+(r=r+Math.imul(h,rt)|0)|0)+((8191&(n=(n=n+Math.imul(h,it)|0)+Math.imul(l,rt)|0))<<13)|0;b=((o=o+Math.imul(l,it)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(C,V),n=(n=Math.imul(C,X))+Math.imul(w,V)|0,o=Math.imul(w,X),r=r+Math.imul(m,et)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(I,et)|0,o=o+Math.imul(I,tt)|0,r=r+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,it)|0;var Nt=(b+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,ct)|0)+Math.imul(l,ot)|0))<<13)|0;b=((o=o+Math.imul(l,ct)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,r=Math.imul(Q,V),n=(n=Math.imul(Q,X))+Math.imul(_,V)|0,o=Math.imul(_,X),r=r+Math.imul(C,et)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(w,et)|0,o=o+Math.imul(w,tt)|0,r=r+Math.imul(m,rt)|0,n=(n=n+Math.imul(m,it)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,it)|0,r=r+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,ct)|0;var Dt=(b+(r=r+Math.imul(h,st)|0)|0)+((8191&(n=(n=n+Math.imul(h,At)|0)+Math.imul(l,st)|0))<<13)|0;b=((o=o+Math.imul(l,At)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,r=Math.imul(N,V),n=(n=Math.imul(N,X))+Math.imul(D,V)|0,o=Math.imul(D,X),r=r+Math.imul(Q,et)|0,n=(n=n+Math.imul(Q,tt)|0)+Math.imul(_,et)|0,o=o+Math.imul(_,tt)|0,r=r+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(w,rt)|0,o=o+Math.imul(w,it)|0,r=r+Math.imul(m,ot)|0,n=(n=n+Math.imul(m,ct)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,ct)|0,r=r+Math.imul(p,st)|0,n=(n=n+Math.imul(p,At)|0)+Math.imul(B,st)|0,o=o+Math.imul(B,At)|0;var Rt=(b+(r=r+Math.imul(h,ut)|0)|0)+((8191&(n=(n=n+Math.imul(h,ht)|0)+Math.imul(l,ut)|0))<<13)|0;b=((o=o+Math.imul(l,ht)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(T,V),n=(n=Math.imul(T,X))+Math.imul(L,V)|0,o=Math.imul(L,X),r=r+Math.imul(N,et)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(D,et)|0,o=o+Math.imul(D,tt)|0,r=r+Math.imul(Q,rt)|0,n=(n=n+Math.imul(Q,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0,r=r+Math.imul(C,ot)|0,n=(n=n+Math.imul(C,ct)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,ct)|0,r=r+Math.imul(m,st)|0,n=(n=n+Math.imul(m,At)|0)+Math.imul(I,st)|0,o=o+Math.imul(I,At)|0,r=r+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ht)|0;var Ft=(b+(r=r+Math.imul(h,Bt)|0)|0)+((8191&(n=(n=n+Math.imul(h,xt)|0)+Math.imul(l,Bt)|0))<<13)|0;b=((o=o+Math.imul(l,xt)|0)+(n>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,r=Math.imul(U,V),n=(n=Math.imul(U,X))+Math.imul(q,V)|0,o=Math.imul(q,X),r=r+Math.imul(T,et)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(L,et)|0,o=o+Math.imul(L,tt)|0,r=r+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(D,rt)|0,o=o+Math.imul(D,it)|0,r=r+Math.imul(Q,ot)|0,n=(n=n+Math.imul(Q,ct)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,ct)|0,r=r+Math.imul(C,st)|0,n=(n=n+Math.imul(C,At)|0)+Math.imul(w,st)|0,o=o+Math.imul(w,At)|0,r=r+Math.imul(m,ut)|0,n=(n=n+Math.imul(m,ht)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ht)|0,r=r+Math.imul(p,Bt)|0,n=(n=n+Math.imul(p,xt)|0)+Math.imul(B,Bt)|0,o=o+Math.imul(B,xt)|0;var Gt=(b+(r=r+Math.imul(h,It)|0)|0)+((8191&(n=(n=n+Math.imul(h,Et)|0)+Math.imul(l,It)|0))<<13)|0;b=((o=o+Math.imul(l,Et)|0)+(n>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,r=Math.imul(H,V),n=(n=Math.imul(H,X))+Math.imul(z,V)|0,o=Math.imul(z,X),r=r+Math.imul(U,et)|0,n=(n=n+Math.imul(U,tt)|0)+Math.imul(q,et)|0,o=o+Math.imul(q,tt)|0,r=r+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,r=r+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,ct)|0,r=r+Math.imul(Q,st)|0,n=(n=n+Math.imul(Q,At)|0)+Math.imul(_,st)|0,o=o+Math.imul(_,At)|0,r=r+Math.imul(C,ut)|0,n=(n=n+Math.imul(C,ht)|0)+Math.imul(w,ut)|0,o=o+Math.imul(w,ht)|0,r=r+Math.imul(m,Bt)|0,n=(n=n+Math.imul(m,xt)|0)+Math.imul(I,Bt)|0,o=o+Math.imul(I,xt)|0,r=r+Math.imul(p,It)|0,n=(n=n+Math.imul(p,Et)|0)+Math.imul(B,It)|0,o=o+Math.imul(B,Et)|0;var Tt=(b+(r=r+Math.imul(h,Ct)|0)|0)+((8191&(n=(n=n+Math.imul(h,wt)|0)+Math.imul(l,Ct)|0))<<13)|0;b=((o=o+Math.imul(l,wt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(J,V),n=(n=Math.imul(J,X))+Math.imul(Y,V)|0,o=Math.imul(Y,X),r=r+Math.imul(H,et)|0,n=(n=n+Math.imul(H,tt)|0)+Math.imul(z,et)|0,o=o+Math.imul(z,tt)|0,r=r+Math.imul(U,rt)|0,n=(n=n+Math.imul(U,it)|0)+Math.imul(q,rt)|0,o=o+Math.imul(q,it)|0,r=r+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,ct)|0,r=r+Math.imul(N,st)|0,n=(n=n+Math.imul(N,At)|0)+Math.imul(D,st)|0,o=o+Math.imul(D,At)|0,r=r+Math.imul(Q,ut)|0,n=(n=n+Math.imul(Q,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,r=r+Math.imul(C,Bt)|0,n=(n=n+Math.imul(C,xt)|0)+Math.imul(w,Bt)|0,o=o+Math.imul(w,xt)|0,r=r+Math.imul(m,It)|0,n=(n=n+Math.imul(m,Et)|0)+Math.imul(I,It)|0,o=o+Math.imul(I,Et)|0,r=r+Math.imul(p,Ct)|0,n=(n=n+Math.imul(p,wt)|0)+Math.imul(B,Ct)|0,o=o+Math.imul(B,wt)|0;var Lt=(b+(r=r+Math.imul(h,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(h,Mt)|0)+Math.imul(l,Qt)|0))<<13)|0;b=((o=o+Math.imul(l,Mt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,r=Math.imul(J,et),n=(n=Math.imul(J,tt))+Math.imul(Y,et)|0,o=Math.imul(Y,tt),r=r+Math.imul(H,rt)|0,n=(n=n+Math.imul(H,it)|0)+Math.imul(z,rt)|0,o=o+Math.imul(z,it)|0,r=r+Math.imul(U,ot)|0,n=(n=n+Math.imul(U,ct)|0)+Math.imul(q,ot)|0,o=o+Math.imul(q,ct)|0,r=r+Math.imul(T,st)|0,n=(n=n+Math.imul(T,At)|0)+Math.imul(L,st)|0,o=o+Math.imul(L,At)|0,r=r+Math.imul(N,ut)|0,n=(n=n+Math.imul(N,ht)|0)+Math.imul(D,ut)|0,o=o+Math.imul(D,ht)|0,r=r+Math.imul(Q,Bt)|0,n=(n=n+Math.imul(Q,xt)|0)+Math.imul(_,Bt)|0,o=o+Math.imul(_,xt)|0,r=r+Math.imul(C,It)|0,n=(n=n+Math.imul(C,Et)|0)+Math.imul(w,It)|0,o=o+Math.imul(w,Et)|0,r=r+Math.imul(m,Ct)|0,n=(n=n+Math.imul(m,wt)|0)+Math.imul(I,Ct)|0,o=o+Math.imul(I,wt)|0;var Pt=(b+(r=r+Math.imul(p,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(p,Mt)|0)+Math.imul(B,Qt)|0))<<13)|0;b=((o=o+Math.imul(B,Mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,r=Math.imul(J,rt),n=(n=Math.imul(J,it))+Math.imul(Y,rt)|0,o=Math.imul(Y,it),r=r+Math.imul(H,ot)|0,n=(n=n+Math.imul(H,ct)|0)+Math.imul(z,ot)|0,o=o+Math.imul(z,ct)|0,r=r+Math.imul(U,st)|0,n=(n=n+Math.imul(U,At)|0)+Math.imul(q,st)|0,o=o+Math.imul(q,At)|0,r=r+Math.imul(T,ut)|0,n=(n=n+Math.imul(T,ht)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ht)|0,r=r+Math.imul(N,Bt)|0,n=(n=n+Math.imul(N,xt)|0)+Math.imul(D,Bt)|0,o=o+Math.imul(D,xt)|0,r=r+Math.imul(Q,It)|0,n=(n=n+Math.imul(Q,Et)|0)+Math.imul(_,It)|0,o=o+Math.imul(_,Et)|0,r=r+Math.imul(C,Ct)|0,n=(n=n+Math.imul(C,wt)|0)+Math.imul(w,Ct)|0,o=o+Math.imul(w,wt)|0;var Ut=(b+(r=r+Math.imul(m,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(m,Mt)|0)+Math.imul(I,Qt)|0))<<13)|0;b=((o=o+Math.imul(I,Mt)|0)+(n>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,r=Math.imul(J,ot),n=(n=Math.imul(J,ct))+Math.imul(Y,ot)|0,o=Math.imul(Y,ct),r=r+Math.imul(H,st)|0,n=(n=n+Math.imul(H,At)|0)+Math.imul(z,st)|0,o=o+Math.imul(z,At)|0,r=r+Math.imul(U,ut)|0,n=(n=n+Math.imul(U,ht)|0)+Math.imul(q,ut)|0,o=o+Math.imul(q,ht)|0,r=r+Math.imul(T,Bt)|0,n=(n=n+Math.imul(T,xt)|0)+Math.imul(L,Bt)|0,o=o+Math.imul(L,xt)|0,r=r+Math.imul(N,It)|0,n=(n=n+Math.imul(N,Et)|0)+Math.imul(D,It)|0,o=o+Math.imul(D,Et)|0,r=r+Math.imul(Q,Ct)|0,n=(n=n+Math.imul(Q,wt)|0)+Math.imul(_,Ct)|0,o=o+Math.imul(_,wt)|0;var qt=(b+(r=r+Math.imul(C,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(C,Mt)|0)+Math.imul(w,Qt)|0))<<13)|0;b=((o=o+Math.imul(w,Mt)|0)+(n>>>13)|0)+(qt>>>26)|0,qt&=67108863,r=Math.imul(J,st),n=(n=Math.imul(J,At))+Math.imul(Y,st)|0,o=Math.imul(Y,At),r=r+Math.imul(H,ut)|0,n=(n=n+Math.imul(H,ht)|0)+Math.imul(z,ut)|0,o=o+Math.imul(z,ht)|0,r=r+Math.imul(U,Bt)|0,n=(n=n+Math.imul(U,xt)|0)+Math.imul(q,Bt)|0,o=o+Math.imul(q,xt)|0,r=r+Math.imul(T,It)|0,n=(n=n+Math.imul(T,Et)|0)+Math.imul(L,It)|0,o=o+Math.imul(L,Et)|0,r=r+Math.imul(N,Ct)|0,n=(n=n+Math.imul(N,wt)|0)+Math.imul(D,Ct)|0,o=o+Math.imul(D,wt)|0;var Ot=(b+(r=r+Math.imul(Q,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(Q,Mt)|0)+Math.imul(_,Qt)|0))<<13)|0;b=((o=o+Math.imul(_,Mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(J,ut),n=(n=Math.imul(J,ht))+Math.imul(Y,ut)|0,o=Math.imul(Y,ht),r=r+Math.imul(H,Bt)|0,n=(n=n+Math.imul(H,xt)|0)+Math.imul(z,Bt)|0,o=o+Math.imul(z,xt)|0,r=r+Math.imul(U,It)|0,n=(n=n+Math.imul(U,Et)|0)+Math.imul(q,It)|0,o=o+Math.imul(q,Et)|0,r=r+Math.imul(T,Ct)|0,n=(n=n+Math.imul(T,wt)|0)+Math.imul(L,Ct)|0,o=o+Math.imul(L,wt)|0;var Ht=(b+(r=r+Math.imul(N,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(N,Mt)|0)+Math.imul(D,Qt)|0))<<13)|0;b=((o=o+Math.imul(D,Mt)|0)+(n>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,r=Math.imul(J,Bt),n=(n=Math.imul(J,xt))+Math.imul(Y,Bt)|0,o=Math.imul(Y,xt),r=r+Math.imul(H,It)|0,n=(n=n+Math.imul(H,Et)|0)+Math.imul(z,It)|0,o=o+Math.imul(z,Et)|0,r=r+Math.imul(U,Ct)|0,n=(n=n+Math.imul(U,wt)|0)+Math.imul(q,Ct)|0,o=o+Math.imul(q,wt)|0;var zt=(b+(r=r+Math.imul(T,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(T,Mt)|0)+Math.imul(L,Qt)|0))<<13)|0;b=((o=o+Math.imul(L,Mt)|0)+(n>>>13)|0)+(zt>>>26)|0,zt&=67108863,r=Math.imul(J,It),n=(n=Math.imul(J,Et))+Math.imul(Y,It)|0,o=Math.imul(Y,Et),r=r+Math.imul(H,Ct)|0,n=(n=n+Math.imul(H,wt)|0)+Math.imul(z,Ct)|0,o=o+Math.imul(z,wt)|0;var Kt=(b+(r=r+Math.imul(U,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(U,Mt)|0)+Math.imul(q,Qt)|0))<<13)|0;b=((o=o+Math.imul(q,Mt)|0)+(n>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,r=Math.imul(J,Ct),n=(n=Math.imul(J,wt))+Math.imul(Y,Ct)|0,o=Math.imul(Y,wt);var jt=(b+(r=r+Math.imul(H,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(H,Mt)|0)+Math.imul(z,Qt)|0))<<13)|0;b=((o=o+Math.imul(z,Mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Jt=(b+(r=Math.imul(J,Qt))|0)+((8191&(n=(n=Math.imul(J,Mt))+Math.imul(Y,Qt)|0))<<13)|0;return b=((o=Math.imul(Y,Mt))+(n>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,s[0]=_t,s[1]=kt,s[2]=St,s[3]=Nt,s[4]=Dt,s[5]=Rt,s[6]=Ft,s[7]=Gt,s[8]=Tt,s[9]=Lt,s[10]=Pt,s[11]=Ut,s[12]=qt,s[13]=Ot,s[14]=Ht,s[15]=zt,s[16]=Kt,s[17]=jt,s[18]=Jt,0!==b&&(s[19]=b,a.length++),a};function jumboMulTo(e,t,a){return(new FFTM).mulp(e,t,a)}function FFTM(e,t){this.x=e,this.y=t}Math.imul||(d=smallMulTo),BN.prototype.mulTo=function mulTo(e,t){var a,r=this.length+e.length;return a=10===this.length&&10===e.length?d(this,e,t):r<63?smallMulTo(this,e,t):r<1024?function bigMulTo(e,t,a){a.negative=t.negative^e.negative,a.length=e.length+t.length;for(var r=0,n=0,o=0;o>>26)|0)>>>26,c&=67108863}a.words[o]=d,r=c,c=n}return 0!==r?a.words[o]=r:a.length--,a.strip()}(this,e,t):jumboMulTo(this,e,t),a},FFTM.prototype.makeRBT=function makeRBT(e){for(var t=new Array(e),a=BN.prototype._countBits(e)-1,r=0;r>=1;return r},FFTM.prototype.permute=function permute(e,t,a,r,n,o){for(var c=0;c>>=1)n++;return 1<>>=13,a[2*o+1]=8191&n,n>>>=13;for(o=2*t;o>=26,t+=r/67108864|0,t+=n>>>26,this.words[a]=67108863&n}return 0!==t&&(this.words[a]=t,this.length++),this},BN.prototype.muln=function muln(e){return this.clone().imuln(e)},BN.prototype.sqr=function sqr(){return this.mul(this)},BN.prototype.isqr=function isqr(){return this.imul(this.clone())},BN.prototype.pow=function pow(e){var t=function toBitArray(e){for(var t=new Array(e.bitLength()),a=0;a>>n}return t}(e);if(0===t.length)return new BN(1);for(var a=this,r=0;r=0);var t,a=e%26,r=(e-a)/26,n=67108863>>>26-a<<26-a;if(0!==a){var o=0;for(t=0;t>>26-a}o&&(this.words[t]=o,this.length++)}if(0!==r){for(t=this.length-1;t>=0;t--)this.words[t+r]=this.words[t];for(t=0;t=0),r=t?(t-t%26)/26:0;var n=e%26,o=Math.min((e-n)/26,this.length),c=67108863^67108863>>>n<o)for(this.length-=o,s=0;s=0&&(0!==b||s>=r);s--){var u=0|this.words[s];this.words[s]=b<<26-n|u>>>n,b=u&c}return d&&0!==b&&(d.words[d.length++]=b),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},BN.prototype.ishrn=function ishrn(e,t,a){return assert(0===this.negative),this.iushrn(e,t,a)},BN.prototype.shln=function shln(e){return this.clone().ishln(e)},BN.prototype.ushln=function ushln(e){return this.clone().iushln(e)},BN.prototype.shrn=function shrn(e){return this.clone().ishrn(e)},BN.prototype.ushrn=function ushrn(e){return this.clone().iushrn(e)},BN.prototype.testn=function testn(e){assert("number"==typeof e&&e>=0);var t=e%26,a=(e-t)/26,r=1<=0);var t=e%26,a=(e-t)/26;if(assert(0===this.negative,"imaskn works only with positive numbers"),this.length<=a)return this;if(0!==t&&a++,this.length=Math.min(a,this.length),0!==t){var r=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},BN.prototype.isubn=function isubn(e){if(assert("number"==typeof e),assert(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(d/67108864|0),this.words[r+a]=67108863&n}for(;r>26,this.words[r+a]=67108863&n;if(0===c)return this.strip();for(assert(-1===c),c=0,r=0;r>26,this.words[r]=67108863&n;return this.negative=1,this.strip()},BN.prototype._wordDiv=function _wordDiv(e,t){var a=(this.length,e.length),r=this.clone(),n=e,o=0|n.words[n.length-1];0!==(a=26-this._countBits(o))&&(n=n.ushln(a),r.iushln(a),o=0|n.words[n.length-1]);var c,d=r.length-n.length;if("mod"!==t){(c=new BN(null)).length=d+1,c.words=new Array(c.length);for(var s=0;s=0;u--){var h=67108864*(0|r.words[n.length+u])+(0|r.words[n.length+u-1]);for(h=Math.min(h/o|0,67108863),r._ishlnsubmul(n,h,u);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(n,1,u),r.isZero()||(r.negative^=1);c&&(c.words[u]=h)}return c&&c.strip(),r.strip(),"div"!==t&&0!==a&&r.iushrn(a),{div:c||null,mod:r}},BN.prototype.divmod=function divmod(e,t,a){return assert(!e.isZero()),this.isZero()?{div:new BN(0),mod:new BN(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(r=o.div.neg()),"div"!==t&&(n=o.mod.neg(),a&&0!==n.negative&&n.iadd(e)),{div:r,mod:n}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(r=o.div.neg()),{div:r,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(n=o.mod.neg(),a&&0!==n.negative&&n.isub(e)),{div:o.div,mod:n}):e.length>this.length||this.cmp(e)<0?{div:new BN(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new BN(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new BN(this.modn(e.words[0]))}:this._wordDiv(e,t);var r,n,o},BN.prototype.div=function div(e){return this.divmod(e,"div",!1).div},BN.prototype.mod=function mod(e){return this.divmod(e,"mod",!1).mod},BN.prototype.umod=function umod(e){return this.divmod(e,"mod",!0).mod},BN.prototype.divRound=function divRound(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var a=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),o=a.cmp(r);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},BN.prototype.modn=function modn(e){assert(e<=67108863);for(var t=(1<<26)%e,a=0,r=this.length-1;r>=0;r--)a=(t*a+(0|this.words[r]))%e;return a},BN.prototype.idivn=function idivn(e){assert(e<=67108863);for(var t=0,a=this.length-1;a>=0;a--){var r=(0|this.words[a])+67108864*t;this.words[a]=r/e|0,t=r%e}return this.strip()},BN.prototype.divn=function divn(e){return this.clone().idivn(e)},BN.prototype.egcd=function egcd(e){assert(0===e.negative),assert(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r=new BN(1),n=new BN(0),o=new BN(0),c=new BN(1),d=0;t.isEven()&&a.isEven();)t.iushrn(1),a.iushrn(1),++d;for(var s=a.clone(),b=t.clone();!t.isZero();){for(var u=0,h=1;0==(t.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(t.iushrn(u);u-- >0;)(r.isOdd()||n.isOdd())&&(r.iadd(s),n.isub(b)),r.iushrn(1),n.iushrn(1);for(var l=0,g=1;0==(a.words[0]&g)&&l<26;++l,g<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(o.isOdd()||c.isOdd())&&(o.iadd(s),c.isub(b)),o.iushrn(1),c.iushrn(1);t.cmp(a)>=0?(t.isub(a),r.isub(o),n.isub(c)):(a.isub(t),o.isub(r),c.isub(n))}return{a:o,b:c,gcd:a.iushln(d)}},BN.prototype._invmp=function _invmp(e){assert(0===e.negative),assert(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r,n=new BN(1),o=new BN(0),c=a.clone();t.cmpn(1)>0&&a.cmpn(1)>0;){for(var d=0,s=1;0==(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0)for(t.iushrn(d);d-- >0;)n.isOdd()&&n.iadd(c),n.iushrn(1);for(var b=0,u=1;0==(a.words[0]&u)&&b<26;++b,u<<=1);if(b>0)for(a.iushrn(b);b-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);t.cmp(a)>=0?(t.isub(a),n.isub(o)):(a.isub(t),o.isub(n))}return(r=0===t.cmpn(1)?n:o).cmpn(0)<0&&r.iadd(e),r},BN.prototype.gcd=function gcd(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),a=e.clone();t.negative=0,a.negative=0;for(var r=0;t.isEven()&&a.isEven();r++)t.iushrn(1),a.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;a.isEven();)a.iushrn(1);var n=t.cmp(a);if(n<0){var o=t;t=a,a=o}else if(0===n||0===a.cmpn(1))break;t.isub(a)}return a.iushln(r)},BN.prototype.invm=function invm(e){return this.egcd(e).a.umod(e)},BN.prototype.isEven=function isEven(){return 0==(1&this.words[0])},BN.prototype.isOdd=function isOdd(){return 1==(1&this.words[0])},BN.prototype.andln=function andln(e){return this.words[0]&e},BN.prototype.bincn=function bincn(e){assert("number"==typeof e);var t=e%26,a=(e-t)/26,r=1<>>26,c&=67108863,this.words[o]=c}return 0!==n&&(this.words[o]=n,this.length++),this},BN.prototype.isZero=function isZero(){return 1===this.length&&0===this.words[0]},BN.prototype.cmpn=function cmpn(e){var t,a=e<0;if(0!==this.negative&&!a)return-1;if(0===this.negative&&a)return 1;if(this.strip(),this.length>1)t=1;else{a&&(e=-e),assert(e<=67108863,"Number is too big");var r=0|this.words[0];t=r===e?0:re.length)return 1;if(this.length=0;a--){var r=0|this.words[a],n=0|e.words[a];if(r!==n){rn&&(t=1);break}}return t},BN.prototype.gtn=function gtn(e){return 1===this.cmpn(e)},BN.prototype.gt=function gt(e){return 1===this.cmp(e)},BN.prototype.gten=function gten(e){return this.cmpn(e)>=0},BN.prototype.gte=function gte(e){return this.cmp(e)>=0},BN.prototype.ltn=function ltn(e){return-1===this.cmpn(e)},BN.prototype.lt=function lt(e){return-1===this.cmp(e)},BN.prototype.lten=function lten(e){return this.cmpn(e)<=0},BN.prototype.lte=function lte(e){return this.cmp(e)<=0},BN.prototype.eqn=function eqn(e){return 0===this.cmpn(e)},BN.prototype.eq=function eq(e){return 0===this.cmp(e)},BN.red=function red(e){return new Red(e)},BN.prototype.toRed=function toRed(e){return assert(!this.red,"Already a number in reduction context"),assert(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},BN.prototype.fromRed=function fromRed(){return assert(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},BN.prototype._forceRed=function _forceRed(e){return this.red=e,this},BN.prototype.forceRed=function forceRed(e){return assert(!this.red,"Already a number in reduction context"),this._forceRed(e)},BN.prototype.redAdd=function redAdd(e){return assert(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},BN.prototype.redIAdd=function redIAdd(e){return assert(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},BN.prototype.redSub=function redSub(e){return assert(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},BN.prototype.redISub=function redISub(e){return assert(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},BN.prototype.redShl=function redShl(e){return assert(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},BN.prototype.redMul=function redMul(e){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},BN.prototype.redIMul=function redIMul(e){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},BN.prototype.redSqr=function redSqr(){return assert(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},BN.prototype.redISqr=function redISqr(){return assert(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},BN.prototype.redSqrt=function redSqrt(){return assert(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},BN.prototype.redInvm=function redInvm(){return assert(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},BN.prototype.redNeg=function redNeg(){return assert(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},BN.prototype.redPow=function redPow(e){return assert(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var s={k256:null,p224:null,p192:null,p25519:null};function MPrime(e,t){this.name=e,this.p=new BN(t,16),this.n=this.p.bitLength(),this.k=new BN(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function Red(e){if("string"==typeof e){var t=BN._prime(e);this.m=t.p,this.prime=t}else assert(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function Mont(e){Red.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new BN(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}MPrime.prototype._tmp=function _tmp(){var e=new BN(null);return e.words=new Array(Math.ceil(this.n/13)),e},MPrime.prototype.ireduce=function ireduce(e){var t,a=e;do{this.split(a,this.tmp),t=(a=(a=this.imulK(a)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?a.isub(this.p):void 0!==a.strip?a.strip():a._strip(),a},MPrime.prototype.split=function split(e,t){e.iushrn(this.n,0,t)},MPrime.prototype.imulK=function imulK(e){return e.imul(this.k)},inherits(K256,MPrime),K256.prototype.split=function split(e,t){for(var a=4194303,r=Math.min(e.length,9),n=0;n>>22,o=c}o>>>=22,e.words[n-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},K256.prototype.imulK=function imulK(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,a=0;a>>=26,e.words[a]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},BN._prime=function prime(e){if(s[e])return s[e];var prime;if("k256"===e)prime=new K256;else if("p224"===e)prime=new P224;else if("p192"===e)prime=new P192;else{if("p25519"!==e)throw new Error("Unknown prime "+e);prime=new P25519}return s[e]=prime,prime},Red.prototype._verify1=function _verify1(e){assert(0===e.negative,"red works only with positives"),assert(e.red,"red works only with red numbers")},Red.prototype._verify2=function _verify2(e,t){assert(0==(e.negative|t.negative),"red works only with positives"),assert(e.red&&e.red===t.red,"red works only with red numbers")},Red.prototype.imod=function imod(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},Red.prototype.neg=function neg(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},Red.prototype.add=function add(e,t){this._verify2(e,t);var a=e.add(t);return a.cmp(this.m)>=0&&a.isub(this.m),a._forceRed(this)},Red.prototype.iadd=function iadd(e,t){this._verify2(e,t);var a=e.iadd(t);return a.cmp(this.m)>=0&&a.isub(this.m),a},Red.prototype.sub=function sub(e,t){this._verify2(e,t);var a=e.sub(t);return a.cmpn(0)<0&&a.iadd(this.m),a._forceRed(this)},Red.prototype.isub=function isub(e,t){this._verify2(e,t);var a=e.isub(t);return a.cmpn(0)<0&&a.iadd(this.m),a},Red.prototype.shl=function shl(e,t){return this._verify1(e),this.imod(e.ushln(t))},Red.prototype.imul=function imul(e,t){return this._verify2(e,t),this.imod(e.imul(t))},Red.prototype.mul=function mul(e,t){return this._verify2(e,t),this.imod(e.mul(t))},Red.prototype.isqr=function isqr(e){return this.imul(e,e.clone())},Red.prototype.sqr=function sqr(e){return this.mul(e,e)},Red.prototype.sqrt=function sqrt(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(assert(t%2==1),3===t){var a=this.m.add(new BN(1)).iushrn(2);return this.pow(e,a)}for(var r=this.m.subn(1),n=0;!r.isZero()&&0===r.andln(1);)n++,r.iushrn(1);assert(!r.isZero());var o=new BN(1).toRed(this),c=o.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new BN(2*s*s).toRed(this);0!==this.pow(s,d).cmp(c);)s.redIAdd(c);for(var b=this.pow(s,r),u=this.pow(e,r.addn(1).iushrn(1)),h=this.pow(e,r),l=n;0!==h.cmp(o);){for(var g=h,p=0;0!==g.cmp(o);p++)g=g.redSqr();assert(p=0;r--){for(var s=t.words[r],b=d-1;b>=0;b--){var u=s>>b&1;n!==a[0]&&(n=this.sqr(n)),0!==u||0!==o?(o<<=1,o|=u,(4===++c||0===r&&0===b)&&(n=this.mul(n,a[o]),c=0,o=0)):c=0}d=26}return n},Red.prototype.convertTo=function convertTo(e){var t=e.umod(this.m);return t===e?t.clone():t},Red.prototype.convertFrom=function convertFrom(e){var t=e.clone();return t.red=null,t},BN.mont=function mont(e){return new Mont(e)},inherits(Mont,Red),Mont.prototype.convertTo=function convertTo(e){return this.imod(e.ushln(this.shift))},Mont.prototype.convertFrom=function convertFrom(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},Mont.prototype.imul=function imul(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var a=e.imul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},Mont.prototype.mul=function mul(e,t){if(e.isZero()||t.isZero())return new BN(0)._forceRed(this);var a=e.mul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},Mont.prototype.invm=function invm(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=a.nmd(e),this)},function(e,t,a){!function(e,t){"use strict";function assert(e,t){if(!e)throw new Error(t||"Assertion failed")}function inherits(e,t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype,e.prototype=new TempCtor,e.prototype.constructor=e}function BN(e,t,a){if(BN.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(a=t,t=10),this._init(e||0,t||10,a||"be"))}var r;"object"==typeof e?e.exports=BN:t.BN=BN,BN.BN=BN,BN.wordSize=26;try{r="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:a(1623).Buffer}catch(e){}function parseHex4Bits(e,t){var a=e.charCodeAt(t);return a>=65&&a<=70?a-55:a>=97&&a<=102?a-87:a-48&15}function parseHexByte(e,t,a){var r=parseHex4Bits(e,a);return a-1>=t&&(r|=parseHex4Bits(e,a-1)<<4),r}function parseBase(e,t,a,r){for(var n=0,o=Math.min(e.length,a),c=t;c=49?d-49+10:d>=17?d-17+10:d}return n}BN.isBN=function isBN(e){return e instanceof BN||null!==e&&"object"==typeof e&&e.constructor.wordSize===BN.wordSize&&Array.isArray(e.words)},BN.max=function max(e,t){return e.cmp(t)>0?e:t},BN.min=function min(e,t){return e.cmp(t)<0?e:t},BN.prototype._init=function init(e,t,a){if("number"==typeof e)return this._initNumber(e,t,a);if("object"==typeof e)return this._initArray(e,t,a);"hex"===t&&(t=16),assert(t===(0|t)&&t>=2&&t<=36);var r=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(r++,this.negative=1),r=0;r-=3)o=e[r]|e[r-1]<<8|e[r-2]<<16,this.words[n]|=o<>>26-c&67108863,(c+=24)>=26&&(c-=26,n++);else if("le"===a)for(r=0,n=0;r>>26-c&67108863,(c+=24)>=26&&(c-=26,n++);return this.strip()},BN.prototype._parseHex=function _parseHex(e,t,a){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)n=parseHexByte(e,t,r)<=18?(o-=18,c+=1,this.words[c]|=n>>>26):o+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(o-=18,c+=1,this.words[c]|=n>>>26):o+=8;this.strip()},BN.prototype._parseBase=function _parseBase(e,t,a){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var o=e.length-a,c=o%r,d=Math.min(o,o-c)+a,s=0,b=a;b1&&0===this.words[this.length-1];)this.length--;return this._normSign()},BN.prototype._normSign=function _normSign(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},BN.prototype.inspect=function inspect(){return(this.red?""};var n=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],o=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function smallMulTo(e,t,a){a.negative=t.negative^e.negative;var r=e.length+t.length|0;a.length=r,r=r-1|0;var n=0|e.words[0],o=0|t.words[0],c=n*o,d=67108863&c,s=c/67108864|0;a.words[0]=d;for(var b=1;b>>26,h=67108863&s,l=Math.min(b,t.length-1),g=Math.max(0,b-e.length+1);g<=l;g++){var p=b-g|0;u+=(c=(n=0|e.words[p])*(o=0|t.words[g])+h)/67108864|0,h=67108863&c}a.words[b]=0|h,s=0|u}return 0!==s?a.words[b]=0|s:a.length--,a.strip()}BN.prototype.toString=function toString(e,t){var a;if(t=0|t||1,16===(e=e||10)||"hex"===e){a="";for(var r=0,d=0,s=0;s>>24-r&16777215)||s!==this.length-1?n[6-u.length]+u+a:u+a,(r+=2)>=26&&(r-=26,s--)}for(0!==d&&(a=d.toString(16)+a);a.length%t!=0;)a="0"+a;return 0!==this.negative&&(a="-"+a),a}if(e===(0|e)&&e>=2&&e<=36){var h=o[e],l=c[e];a="";var g=this.clone();for(g.negative=0;!g.isZero();){var p=g.modn(l).toString(e);a=(g=g.idivn(l)).isZero()?p+a:n[h-p.length]+p+a}for(this.isZero()&&(a="0"+a);a.length%t!=0;)a="0"+a;return 0!==this.negative&&(a="-"+a),a}assert(!1,"Base should be between 2 and 36")},BN.prototype.toNumber=function toNumber(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&assert(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},BN.prototype.toJSON=function toJSON(){return this.toString(16)},BN.prototype.toBuffer=function toBuffer(e,t){return assert(void 0!==r),this.toArrayLike(r,e,t)},BN.prototype.toArray=function toArray(e,t){return this.toArrayLike(Array,e,t)},BN.prototype.toArrayLike=function toArrayLike(e,t,a){var r=this.byteLength(),n=a||Math.max(1,r);assert(r<=n,"byte array longer than desired length"),assert(n>0,"Requested array length <= 0"),this.strip();var o,c,d="le"===t,s=new e(n),b=this.clone();if(d){for(c=0;!b.isZero();c++)o=b.andln(255),b.iushrn(8),s[c]=o;for(;c=4096&&(a+=13,t>>>=13),t>=64&&(a+=7,t>>>=7),t>=8&&(a+=4,t>>>=4),t>=2&&(a+=2,t>>>=2),a+t},BN.prototype._zeroBits=function _zeroBits(e){if(0===e)return 26;var t=e,a=0;return 0==(8191&t)&&(a+=13,t>>>=13),0==(127&t)&&(a+=7,t>>>=7),0==(15&t)&&(a+=4,t>>>=4),0==(3&t)&&(a+=2,t>>>=2),0==(1&t)&&a++,a},BN.prototype.bitLength=function bitLength(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},BN.prototype.uor=function uor(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},BN.prototype.iuand=function iuand(e){var t;t=this.length>e.length?e:this;for(var a=0;ae.length?this.clone().iand(e):e.clone().iand(this)},BN.prototype.uand=function uand(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},BN.prototype.iuxor=function iuxor(e){var t,a;this.length>e.length?(t=this,a=e):(t=e,a=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},BN.prototype.uxor=function uxor(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},BN.prototype.inotn=function inotn(e){assert("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),a=e%26;this._expand(t),a>0&&t--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-a),this.strip()},BN.prototype.notn=function notn(e){return this.clone().inotn(e)},BN.prototype.setn=function setn(e,t){assert("number"==typeof e&&e>=0);var a=e/26|0,r=e%26;return this._expand(a+1),this.words[a]=t?this.words[a]|1<e.length?(a=this,r=e):(a=e,r=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=a.length,0!==n)this.words[this.length]=n,this.length++;else if(a!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},BN.prototype.isub=function isub(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var a,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(a=this,r=e):(a=e,r=this);for(var o=0,c=0;c>26,this.words[c]=67108863&t;for(;0!==o&&c>26,this.words[c]=67108863&t;if(0===o&&c>>13,g=0|c[1],p=8191&g,B=g>>>13,x=0|c[2],m=8191&x,I=x>>>13,y=0|c[3],C=8191&y,w=y>>>13,v=0|c[4],Q=8191&v,_=v>>>13,k=0|c[5],N=8191&k,D=k>>>13,G=0|c[6],T=8191&G,L=G>>>13,P=0|c[7],U=8191&P,q=P>>>13,O=0|c[8],H=8191&O,z=O>>>13,j=0|c[9],J=8191&j,Y=j>>>13,W=0|d[0],V=8191&W,X=W>>>13,$=0|d[1],et=8191&$,tt=$>>>13,at=0|d[2],rt=8191&at,it=at>>>13,nt=0|d[3],ot=8191&nt,ct=nt>>>13,dt=0|d[4],st=8191&dt,At=dt>>>13,bt=0|d[5],ut=8191&bt,ht=bt>>>13,pt=0|d[6],Bt=8191&pt,xt=pt>>>13,mt=0|d[7],It=8191&mt,Et=mt>>>13,yt=0|d[8],Ct=8191&yt,wt=yt>>>13,vt=0|d[9],Qt=8191&vt,Mt=vt>>>13;a.negative=e.negative^t.negative,a.length=19;var _t=(b+(r=Math.imul(h,V))|0)+((8191&(n=(n=Math.imul(h,X))+Math.imul(l,V)|0))<<13)|0;b=((o=Math.imul(l,X))+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(p,V),n=(n=Math.imul(p,X))+Math.imul(B,V)|0,o=Math.imul(B,X);var kt=(b+(r=r+Math.imul(h,et)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(l,et)|0))<<13)|0;b=((o=o+Math.imul(l,tt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(m,V),n=(n=Math.imul(m,X))+Math.imul(I,V)|0,o=Math.imul(I,X),r=r+Math.imul(p,et)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(B,et)|0,o=o+Math.imul(B,tt)|0;var St=(b+(r=r+Math.imul(h,rt)|0)|0)+((8191&(n=(n=n+Math.imul(h,it)|0)+Math.imul(l,rt)|0))<<13)|0;b=((o=o+Math.imul(l,it)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(C,V),n=(n=Math.imul(C,X))+Math.imul(w,V)|0,o=Math.imul(w,X),r=r+Math.imul(m,et)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(I,et)|0,o=o+Math.imul(I,tt)|0,r=r+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,it)|0;var Nt=(b+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,ct)|0)+Math.imul(l,ot)|0))<<13)|0;b=((o=o+Math.imul(l,ct)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,r=Math.imul(Q,V),n=(n=Math.imul(Q,X))+Math.imul(_,V)|0,o=Math.imul(_,X),r=r+Math.imul(C,et)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(w,et)|0,o=o+Math.imul(w,tt)|0,r=r+Math.imul(m,rt)|0,n=(n=n+Math.imul(m,it)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,it)|0,r=r+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,ct)|0;var Dt=(b+(r=r+Math.imul(h,st)|0)|0)+((8191&(n=(n=n+Math.imul(h,At)|0)+Math.imul(l,st)|0))<<13)|0;b=((o=o+Math.imul(l,At)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,r=Math.imul(N,V),n=(n=Math.imul(N,X))+Math.imul(D,V)|0,o=Math.imul(D,X),r=r+Math.imul(Q,et)|0,n=(n=n+Math.imul(Q,tt)|0)+Math.imul(_,et)|0,o=o+Math.imul(_,tt)|0,r=r+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(w,rt)|0,o=o+Math.imul(w,it)|0,r=r+Math.imul(m,ot)|0,n=(n=n+Math.imul(m,ct)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,ct)|0,r=r+Math.imul(p,st)|0,n=(n=n+Math.imul(p,At)|0)+Math.imul(B,st)|0,o=o+Math.imul(B,At)|0;var Rt=(b+(r=r+Math.imul(h,ut)|0)|0)+((8191&(n=(n=n+Math.imul(h,ht)|0)+Math.imul(l,ut)|0))<<13)|0;b=((o=o+Math.imul(l,ht)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(T,V),n=(n=Math.imul(T,X))+Math.imul(L,V)|0,o=Math.imul(L,X),r=r+Math.imul(N,et)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(D,et)|0,o=o+Math.imul(D,tt)|0,r=r+Math.imul(Q,rt)|0,n=(n=n+Math.imul(Q,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0,r=r+Math.imul(C,ot)|0,n=(n=n+Math.imul(C,ct)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,ct)|0,r=r+Math.imul(m,st)|0,n=(n=n+Math.imul(m,At)|0)+Math.imul(I,st)|0,o=o+Math.imul(I,At)|0,r=r+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ht)|0;var Ft=(b+(r=r+Math.imul(h,Bt)|0)|0)+((8191&(n=(n=n+Math.imul(h,xt)|0)+Math.imul(l,Bt)|0))<<13)|0;b=((o=o+Math.imul(l,xt)|0)+(n>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,r=Math.imul(U,V),n=(n=Math.imul(U,X))+Math.imul(q,V)|0,o=Math.imul(q,X),r=r+Math.imul(T,et)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(L,et)|0,o=o+Math.imul(L,tt)|0,r=r+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(D,rt)|0,o=o+Math.imul(D,it)|0,r=r+Math.imul(Q,ot)|0,n=(n=n+Math.imul(Q,ct)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,ct)|0,r=r+Math.imul(C,st)|0,n=(n=n+Math.imul(C,At)|0)+Math.imul(w,st)|0,o=o+Math.imul(w,At)|0,r=r+Math.imul(m,ut)|0,n=(n=n+Math.imul(m,ht)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ht)|0,r=r+Math.imul(p,Bt)|0,n=(n=n+Math.imul(p,xt)|0)+Math.imul(B,Bt)|0,o=o+Math.imul(B,xt)|0;var Gt=(b+(r=r+Math.imul(h,It)|0)|0)+((8191&(n=(n=n+Math.imul(h,Et)|0)+Math.imul(l,It)|0))<<13)|0;b=((o=o+Math.imul(l,Et)|0)+(n>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,r=Math.imul(H,V),n=(n=Math.imul(H,X))+Math.imul(z,V)|0,o=Math.imul(z,X),r=r+Math.imul(U,et)|0,n=(n=n+Math.imul(U,tt)|0)+Math.imul(q,et)|0,o=o+Math.imul(q,tt)|0,r=r+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,r=r+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,ct)|0,r=r+Math.imul(Q,st)|0,n=(n=n+Math.imul(Q,At)|0)+Math.imul(_,st)|0,o=o+Math.imul(_,At)|0,r=r+Math.imul(C,ut)|0,n=(n=n+Math.imul(C,ht)|0)+Math.imul(w,ut)|0,o=o+Math.imul(w,ht)|0,r=r+Math.imul(m,Bt)|0,n=(n=n+Math.imul(m,xt)|0)+Math.imul(I,Bt)|0,o=o+Math.imul(I,xt)|0,r=r+Math.imul(p,It)|0,n=(n=n+Math.imul(p,Et)|0)+Math.imul(B,It)|0,o=o+Math.imul(B,Et)|0;var Tt=(b+(r=r+Math.imul(h,Ct)|0)|0)+((8191&(n=(n=n+Math.imul(h,wt)|0)+Math.imul(l,Ct)|0))<<13)|0;b=((o=o+Math.imul(l,wt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(J,V),n=(n=Math.imul(J,X))+Math.imul(Y,V)|0,o=Math.imul(Y,X),r=r+Math.imul(H,et)|0,n=(n=n+Math.imul(H,tt)|0)+Math.imul(z,et)|0,o=o+Math.imul(z,tt)|0,r=r+Math.imul(U,rt)|0,n=(n=n+Math.imul(U,it)|0)+Math.imul(q,rt)|0,o=o+Math.imul(q,it)|0,r=r+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,ct)|0,r=r+Math.imul(N,st)|0,n=(n=n+Math.imul(N,At)|0)+Math.imul(D,st)|0,o=o+Math.imul(D,At)|0,r=r+Math.imul(Q,ut)|0,n=(n=n+Math.imul(Q,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,r=r+Math.imul(C,Bt)|0,n=(n=n+Math.imul(C,xt)|0)+Math.imul(w,Bt)|0,o=o+Math.imul(w,xt)|0,r=r+Math.imul(m,It)|0,n=(n=n+Math.imul(m,Et)|0)+Math.imul(I,It)|0,o=o+Math.imul(I,Et)|0,r=r+Math.imul(p,Ct)|0,n=(n=n+Math.imul(p,wt)|0)+Math.imul(B,Ct)|0,o=o+Math.imul(B,wt)|0;var Lt=(b+(r=r+Math.imul(h,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(h,Mt)|0)+Math.imul(l,Qt)|0))<<13)|0;b=((o=o+Math.imul(l,Mt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,r=Math.imul(J,et),n=(n=Math.imul(J,tt))+Math.imul(Y,et)|0,o=Math.imul(Y,tt),r=r+Math.imul(H,rt)|0,n=(n=n+Math.imul(H,it)|0)+Math.imul(z,rt)|0,o=o+Math.imul(z,it)|0,r=r+Math.imul(U,ot)|0,n=(n=n+Math.imul(U,ct)|0)+Math.imul(q,ot)|0,o=o+Math.imul(q,ct)|0,r=r+Math.imul(T,st)|0,n=(n=n+Math.imul(T,At)|0)+Math.imul(L,st)|0,o=o+Math.imul(L,At)|0,r=r+Math.imul(N,ut)|0,n=(n=n+Math.imul(N,ht)|0)+Math.imul(D,ut)|0,o=o+Math.imul(D,ht)|0,r=r+Math.imul(Q,Bt)|0,n=(n=n+Math.imul(Q,xt)|0)+Math.imul(_,Bt)|0,o=o+Math.imul(_,xt)|0,r=r+Math.imul(C,It)|0,n=(n=n+Math.imul(C,Et)|0)+Math.imul(w,It)|0,o=o+Math.imul(w,Et)|0,r=r+Math.imul(m,Ct)|0,n=(n=n+Math.imul(m,wt)|0)+Math.imul(I,Ct)|0,o=o+Math.imul(I,wt)|0;var Pt=(b+(r=r+Math.imul(p,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(p,Mt)|0)+Math.imul(B,Qt)|0))<<13)|0;b=((o=o+Math.imul(B,Mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,r=Math.imul(J,rt),n=(n=Math.imul(J,it))+Math.imul(Y,rt)|0,o=Math.imul(Y,it),r=r+Math.imul(H,ot)|0,n=(n=n+Math.imul(H,ct)|0)+Math.imul(z,ot)|0,o=o+Math.imul(z,ct)|0,r=r+Math.imul(U,st)|0,n=(n=n+Math.imul(U,At)|0)+Math.imul(q,st)|0,o=o+Math.imul(q,At)|0,r=r+Math.imul(T,ut)|0,n=(n=n+Math.imul(T,ht)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ht)|0,r=r+Math.imul(N,Bt)|0,n=(n=n+Math.imul(N,xt)|0)+Math.imul(D,Bt)|0,o=o+Math.imul(D,xt)|0,r=r+Math.imul(Q,It)|0,n=(n=n+Math.imul(Q,Et)|0)+Math.imul(_,It)|0,o=o+Math.imul(_,Et)|0,r=r+Math.imul(C,Ct)|0,n=(n=n+Math.imul(C,wt)|0)+Math.imul(w,Ct)|0,o=o+Math.imul(w,wt)|0;var Ut=(b+(r=r+Math.imul(m,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(m,Mt)|0)+Math.imul(I,Qt)|0))<<13)|0;b=((o=o+Math.imul(I,Mt)|0)+(n>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,r=Math.imul(J,ot),n=(n=Math.imul(J,ct))+Math.imul(Y,ot)|0,o=Math.imul(Y,ct),r=r+Math.imul(H,st)|0,n=(n=n+Math.imul(H,At)|0)+Math.imul(z,st)|0,o=o+Math.imul(z,At)|0,r=r+Math.imul(U,ut)|0,n=(n=n+Math.imul(U,ht)|0)+Math.imul(q,ut)|0,o=o+Math.imul(q,ht)|0,r=r+Math.imul(T,Bt)|0,n=(n=n+Math.imul(T,xt)|0)+Math.imul(L,Bt)|0,o=o+Math.imul(L,xt)|0,r=r+Math.imul(N,It)|0,n=(n=n+Math.imul(N,Et)|0)+Math.imul(D,It)|0,o=o+Math.imul(D,Et)|0,r=r+Math.imul(Q,Ct)|0,n=(n=n+Math.imul(Q,wt)|0)+Math.imul(_,Ct)|0,o=o+Math.imul(_,wt)|0;var qt=(b+(r=r+Math.imul(C,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(C,Mt)|0)+Math.imul(w,Qt)|0))<<13)|0;b=((o=o+Math.imul(w,Mt)|0)+(n>>>13)|0)+(qt>>>26)|0,qt&=67108863,r=Math.imul(J,st),n=(n=Math.imul(J,At))+Math.imul(Y,st)|0,o=Math.imul(Y,At),r=r+Math.imul(H,ut)|0,n=(n=n+Math.imul(H,ht)|0)+Math.imul(z,ut)|0,o=o+Math.imul(z,ht)|0,r=r+Math.imul(U,Bt)|0,n=(n=n+Math.imul(U,xt)|0)+Math.imul(q,Bt)|0,o=o+Math.imul(q,xt)|0,r=r+Math.imul(T,It)|0,n=(n=n+Math.imul(T,Et)|0)+Math.imul(L,It)|0,o=o+Math.imul(L,Et)|0,r=r+Math.imul(N,Ct)|0,n=(n=n+Math.imul(N,wt)|0)+Math.imul(D,Ct)|0,o=o+Math.imul(D,wt)|0;var Ot=(b+(r=r+Math.imul(Q,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(Q,Mt)|0)+Math.imul(_,Qt)|0))<<13)|0;b=((o=o+Math.imul(_,Mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(J,ut),n=(n=Math.imul(J,ht))+Math.imul(Y,ut)|0,o=Math.imul(Y,ht),r=r+Math.imul(H,Bt)|0,n=(n=n+Math.imul(H,xt)|0)+Math.imul(z,Bt)|0,o=o+Math.imul(z,xt)|0,r=r+Math.imul(U,It)|0,n=(n=n+Math.imul(U,Et)|0)+Math.imul(q,It)|0,o=o+Math.imul(q,Et)|0,r=r+Math.imul(T,Ct)|0,n=(n=n+Math.imul(T,wt)|0)+Math.imul(L,Ct)|0,o=o+Math.imul(L,wt)|0;var Ht=(b+(r=r+Math.imul(N,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(N,Mt)|0)+Math.imul(D,Qt)|0))<<13)|0;b=((o=o+Math.imul(D,Mt)|0)+(n>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,r=Math.imul(J,Bt),n=(n=Math.imul(J,xt))+Math.imul(Y,Bt)|0,o=Math.imul(Y,xt),r=r+Math.imul(H,It)|0,n=(n=n+Math.imul(H,Et)|0)+Math.imul(z,It)|0,o=o+Math.imul(z,Et)|0,r=r+Math.imul(U,Ct)|0,n=(n=n+Math.imul(U,wt)|0)+Math.imul(q,Ct)|0,o=o+Math.imul(q,wt)|0;var zt=(b+(r=r+Math.imul(T,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(T,Mt)|0)+Math.imul(L,Qt)|0))<<13)|0;b=((o=o+Math.imul(L,Mt)|0)+(n>>>13)|0)+(zt>>>26)|0,zt&=67108863,r=Math.imul(J,It),n=(n=Math.imul(J,Et))+Math.imul(Y,It)|0,o=Math.imul(Y,Et),r=r+Math.imul(H,Ct)|0,n=(n=n+Math.imul(H,wt)|0)+Math.imul(z,Ct)|0,o=o+Math.imul(z,wt)|0;var Kt=(b+(r=r+Math.imul(U,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(U,Mt)|0)+Math.imul(q,Qt)|0))<<13)|0;b=((o=o+Math.imul(q,Mt)|0)+(n>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,r=Math.imul(J,Ct),n=(n=Math.imul(J,wt))+Math.imul(Y,Ct)|0,o=Math.imul(Y,wt);var jt=(b+(r=r+Math.imul(H,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(H,Mt)|0)+Math.imul(z,Qt)|0))<<13)|0;b=((o=o+Math.imul(z,Mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Jt=(b+(r=Math.imul(J,Qt))|0)+((8191&(n=(n=Math.imul(J,Mt))+Math.imul(Y,Qt)|0))<<13)|0;return b=((o=Math.imul(Y,Mt))+(n>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,s[0]=_t,s[1]=kt,s[2]=St,s[3]=Nt,s[4]=Dt,s[5]=Rt,s[6]=Ft,s[7]=Gt,s[8]=Tt,s[9]=Lt,s[10]=Pt,s[11]=Ut,s[12]=qt,s[13]=Ot,s[14]=Ht,s[15]=zt,s[16]=Kt,s[17]=jt,s[18]=Jt,0!==b&&(s[19]=b,a.length++),a};function jumboMulTo(e,t,a){return(new FFTM).mulp(e,t,a)}function FFTM(e,t){this.x=e,this.y=t}Math.imul||(d=smallMulTo),BN.prototype.mulTo=function mulTo(e,t){var a,r=this.length+e.length;return a=10===this.length&&10===e.length?d(this,e,t):r<63?smallMulTo(this,e,t):r<1024?function bigMulTo(e,t,a){a.negative=t.negative^e.negative,a.length=e.length+t.length;for(var r=0,n=0,o=0;o>>26)|0)>>>26,c&=67108863}a.words[o]=d,r=c,c=n}return 0!==r?a.words[o]=r:a.length--,a.strip()}(this,e,t):jumboMulTo(this,e,t),a},FFTM.prototype.makeRBT=function makeRBT(e){for(var t=new Array(e),a=BN.prototype._countBits(e)-1,r=0;r>=1;return r},FFTM.prototype.permute=function permute(e,t,a,r,n,o){for(var c=0;c>>=1)n++;return 1<>>=13,a[2*o+1]=8191&n,n>>>=13;for(o=2*t;o>=26,t+=r/67108864|0,t+=n>>>26,this.words[a]=67108863&n}return 0!==t&&(this.words[a]=t,this.length++),this},BN.prototype.muln=function muln(e){return this.clone().imuln(e)},BN.prototype.sqr=function sqr(){return this.mul(this)},BN.prototype.isqr=function isqr(){return this.imul(this.clone())},BN.prototype.pow=function pow(e){var t=function toBitArray(e){for(var t=new Array(e.bitLength()),a=0;a>>n}return t}(e);if(0===t.length)return new BN(1);for(var a=this,r=0;r=0);var t,a=e%26,r=(e-a)/26,n=67108863>>>26-a<<26-a;if(0!==a){var o=0;for(t=0;t>>26-a}o&&(this.words[t]=o,this.length++)}if(0!==r){for(t=this.length-1;t>=0;t--)this.words[t+r]=this.words[t];for(t=0;t=0),r=t?(t-t%26)/26:0;var n=e%26,o=Math.min((e-n)/26,this.length),c=67108863^67108863>>>n<o)for(this.length-=o,s=0;s=0&&(0!==b||s>=r);s--){var u=0|this.words[s];this.words[s]=b<<26-n|u>>>n,b=u&c}return d&&0!==b&&(d.words[d.length++]=b),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},BN.prototype.ishrn=function ishrn(e,t,a){return assert(0===this.negative),this.iushrn(e,t,a)},BN.prototype.shln=function shln(e){return this.clone().ishln(e)},BN.prototype.ushln=function ushln(e){return this.clone().iushln(e)},BN.prototype.shrn=function shrn(e){return this.clone().ishrn(e)},BN.prototype.ushrn=function ushrn(e){return this.clone().iushrn(e)},BN.prototype.testn=function testn(e){assert("number"==typeof e&&e>=0);var t=e%26,a=(e-t)/26,r=1<=0);var t=e%26,a=(e-t)/26;if(assert(0===this.negative,"imaskn works only with positive numbers"),this.length<=a)return this;if(0!==t&&a++,this.length=Math.min(a,this.length),0!==t){var r=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},BN.prototype.isubn=function isubn(e){if(assert("number"==typeof e),assert(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(d/67108864|0),this.words[r+a]=67108863&n}for(;r>26,this.words[r+a]=67108863&n;if(0===c)return this.strip();for(assert(-1===c),c=0,r=0;r>26,this.words[r]=67108863&n;return this.negative=1,this.strip()},BN.prototype._wordDiv=function _wordDiv(e,t){var a=(this.length,e.length),r=this.clone(),n=e,o=0|n.words[n.length-1];0!==(a=26-this._countBits(o))&&(n=n.ushln(a),r.iushln(a),o=0|n.words[n.length-1]);var c,d=r.length-n.length;if("mod"!==t){(c=new BN(null)).length=d+1,c.words=new Array(c.length);for(var s=0;s=0;u--){var h=67108864*(0|r.words[n.length+u])+(0|r.words[n.length+u-1]);for(h=Math.min(h/o|0,67108863),r._ishlnsubmul(n,h,u);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(n,1,u),r.isZero()||(r.negative^=1);c&&(c.words[u]=h)}return c&&c.strip(),r.strip(),"div"!==t&&0!==a&&r.iushrn(a),{div:c||null,mod:r}},BN.prototype.divmod=function divmod(e,t,a){return assert(!e.isZero()),this.isZero()?{div:new BN(0),mod:new BN(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(r=o.div.neg()),"div"!==t&&(n=o.mod.neg(),a&&0!==n.negative&&n.iadd(e)),{div:r,mod:n}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(r=o.div.neg()),{div:r,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(n=o.mod.neg(),a&&0!==n.negative&&n.isub(e)),{div:o.div,mod:n}):e.length>this.length||this.cmp(e)<0?{div:new BN(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new BN(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new BN(this.modn(e.words[0]))}:this._wordDiv(e,t);var r,n,o},BN.prototype.div=function div(e){return this.divmod(e,"div",!1).div},BN.prototype.mod=function mod(e){return this.divmod(e,"mod",!1).mod},BN.prototype.umod=function umod(e){return this.divmod(e,"mod",!0).mod},BN.prototype.divRound=function divRound(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var a=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),o=a.cmp(r);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},BN.prototype.modn=function modn(e){assert(e<=67108863);for(var t=(1<<26)%e,a=0,r=this.length-1;r>=0;r--)a=(t*a+(0|this.words[r]))%e;return a},BN.prototype.idivn=function idivn(e){assert(e<=67108863);for(var t=0,a=this.length-1;a>=0;a--){var r=(0|this.words[a])+67108864*t;this.words[a]=r/e|0,t=r%e}return this.strip()},BN.prototype.divn=function divn(e){return this.clone().idivn(e)},BN.prototype.egcd=function egcd(e){assert(0===e.negative),assert(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r=new BN(1),n=new BN(0),o=new BN(0),c=new BN(1),d=0;t.isEven()&&a.isEven();)t.iushrn(1),a.iushrn(1),++d;for(var s=a.clone(),b=t.clone();!t.isZero();){for(var u=0,h=1;0==(t.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(t.iushrn(u);u-- >0;)(r.isOdd()||n.isOdd())&&(r.iadd(s),n.isub(b)),r.iushrn(1),n.iushrn(1);for(var l=0,g=1;0==(a.words[0]&g)&&l<26;++l,g<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(o.isOdd()||c.isOdd())&&(o.iadd(s),c.isub(b)),o.iushrn(1),c.iushrn(1);t.cmp(a)>=0?(t.isub(a),r.isub(o),n.isub(c)):(a.isub(t),o.isub(r),c.isub(n))}return{a:o,b:c,gcd:a.iushln(d)}},BN.prototype._invmp=function _invmp(e){assert(0===e.negative),assert(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r,n=new BN(1),o=new BN(0),c=a.clone();t.cmpn(1)>0&&a.cmpn(1)>0;){for(var d=0,s=1;0==(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0)for(t.iushrn(d);d-- >0;)n.isOdd()&&n.iadd(c),n.iushrn(1);for(var b=0,u=1;0==(a.words[0]&u)&&b<26;++b,u<<=1);if(b>0)for(a.iushrn(b);b-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);t.cmp(a)>=0?(t.isub(a),n.isub(o)):(a.isub(t),o.isub(n))}return(r=0===t.cmpn(1)?n:o).cmpn(0)<0&&r.iadd(e),r},BN.prototype.gcd=function gcd(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),a=e.clone();t.negative=0,a.negative=0;for(var r=0;t.isEven()&&a.isEven();r++)t.iushrn(1),a.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;a.isEven();)a.iushrn(1);var n=t.cmp(a);if(n<0){var o=t;t=a,a=o}else if(0===n||0===a.cmpn(1))break;t.isub(a)}return a.iushln(r)},BN.prototype.invm=function invm(e){return this.egcd(e).a.umod(e)},BN.prototype.isEven=function isEven(){return 0==(1&this.words[0])},BN.prototype.isOdd=function isOdd(){return 1==(1&this.words[0])},BN.prototype.andln=function andln(e){return this.words[0]&e},BN.prototype.bincn=function bincn(e){assert("number"==typeof e);var t=e%26,a=(e-t)/26,r=1<>>26,c&=67108863,this.words[o]=c}return 0!==n&&(this.words[o]=n,this.length++),this},BN.prototype.isZero=function isZero(){return 1===this.length&&0===this.words[0]},BN.prototype.cmpn=function cmpn(e){var t,a=e<0;if(0!==this.negative&&!a)return-1;if(0===this.negative&&a)return 1;if(this.strip(),this.length>1)t=1;else{a&&(e=-e),assert(e<=67108863,"Number is too big");var r=0|this.words[0];t=r===e?0:re.length)return 1;if(this.length=0;a--){var r=0|this.words[a],n=0|e.words[a];if(r!==n){rn&&(t=1);break}}return t},BN.prototype.gtn=function gtn(e){return 1===this.cmpn(e)},BN.prototype.gt=function gt(e){return 1===this.cmp(e)},BN.prototype.gten=function gten(e){return this.cmpn(e)>=0},BN.prototype.gte=function gte(e){return this.cmp(e)>=0},BN.prototype.ltn=function ltn(e){return-1===this.cmpn(e)},BN.prototype.lt=function lt(e){return-1===this.cmp(e)},BN.prototype.lten=function lten(e){return this.cmpn(e)<=0},BN.prototype.lte=function lte(e){return this.cmp(e)<=0},BN.prototype.eqn=function eqn(e){return 0===this.cmpn(e)},BN.prototype.eq=function eq(e){return 0===this.cmp(e)},BN.red=function red(e){return new Red(e)},BN.prototype.toRed=function toRed(e){return assert(!this.red,"Already a number in reduction context"),assert(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},BN.prototype.fromRed=function fromRed(){return assert(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},BN.prototype._forceRed=function _forceRed(e){return this.red=e,this},BN.prototype.forceRed=function forceRed(e){return assert(!this.red,"Already a number in reduction context"),this._forceRed(e)},BN.prototype.redAdd=function redAdd(e){return assert(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},BN.prototype.redIAdd=function redIAdd(e){return assert(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},BN.prototype.redSub=function redSub(e){return assert(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},BN.prototype.redISub=function redISub(e){return assert(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},BN.prototype.redShl=function redShl(e){return assert(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},BN.prototype.redMul=function redMul(e){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},BN.prototype.redIMul=function redIMul(e){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},BN.prototype.redSqr=function redSqr(){return assert(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},BN.prototype.redISqr=function redISqr(){return assert(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},BN.prototype.redSqrt=function redSqrt(){return assert(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},BN.prototype.redInvm=function redInvm(){return assert(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},BN.prototype.redNeg=function redNeg(){return assert(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},BN.prototype.redPow=function redPow(e){return assert(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var s={k256:null,p224:null,p192:null,p25519:null};function MPrime(e,t){this.name=e,this.p=new BN(t,16),this.n=this.p.bitLength(),this.k=new BN(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function Red(e){if("string"==typeof e){var t=BN._prime(e);this.m=t.p,this.prime=t}else assert(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function Mont(e){Red.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new BN(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}MPrime.prototype._tmp=function _tmp(){var e=new BN(null);return e.words=new Array(Math.ceil(this.n/13)),e},MPrime.prototype.ireduce=function ireduce(e){var t,a=e;do{this.split(a,this.tmp),t=(a=(a=this.imulK(a)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?a.isub(this.p):void 0!==a.strip?a.strip():a._strip(),a},MPrime.prototype.split=function split(e,t){e.iushrn(this.n,0,t)},MPrime.prototype.imulK=function imulK(e){return e.imul(this.k)},inherits(K256,MPrime),K256.prototype.split=function split(e,t){for(var a=4194303,r=Math.min(e.length,9),n=0;n>>22,o=c}o>>>=22,e.words[n-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},K256.prototype.imulK=function imulK(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,a=0;a>>=26,e.words[a]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},BN._prime=function prime(e){if(s[e])return s[e];var prime;if("k256"===e)prime=new K256;else if("p224"===e)prime=new P224;else if("p192"===e)prime=new P192;else{if("p25519"!==e)throw new Error("Unknown prime "+e);prime=new P25519}return s[e]=prime,prime},Red.prototype._verify1=function _verify1(e){assert(0===e.negative,"red works only with positives"),assert(e.red,"red works only with red numbers")},Red.prototype._verify2=function _verify2(e,t){assert(0==(e.negative|t.negative),"red works only with positives"),assert(e.red&&e.red===t.red,"red works only with red numbers")},Red.prototype.imod=function imod(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},Red.prototype.neg=function neg(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},Red.prototype.add=function add(e,t){this._verify2(e,t);var a=e.add(t);return a.cmp(this.m)>=0&&a.isub(this.m),a._forceRed(this)},Red.prototype.iadd=function iadd(e,t){this._verify2(e,t);var a=e.iadd(t);return a.cmp(this.m)>=0&&a.isub(this.m),a},Red.prototype.sub=function sub(e,t){this._verify2(e,t);var a=e.sub(t);return a.cmpn(0)<0&&a.iadd(this.m),a._forceRed(this)},Red.prototype.isub=function isub(e,t){this._verify2(e,t);var a=e.isub(t);return a.cmpn(0)<0&&a.iadd(this.m),a},Red.prototype.shl=function shl(e,t){return this._verify1(e),this.imod(e.ushln(t))},Red.prototype.imul=function imul(e,t){return this._verify2(e,t),this.imod(e.imul(t))},Red.prototype.mul=function mul(e,t){return this._verify2(e,t),this.imod(e.mul(t))},Red.prototype.isqr=function isqr(e){return this.imul(e,e.clone())},Red.prototype.sqr=function sqr(e){return this.mul(e,e)},Red.prototype.sqrt=function sqrt(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(assert(t%2==1),3===t){var a=this.m.add(new BN(1)).iushrn(2);return this.pow(e,a)}for(var r=this.m.subn(1),n=0;!r.isZero()&&0===r.andln(1);)n++,r.iushrn(1);assert(!r.isZero());var o=new BN(1).toRed(this),c=o.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new BN(2*s*s).toRed(this);0!==this.pow(s,d).cmp(c);)s.redIAdd(c);for(var b=this.pow(s,r),u=this.pow(e,r.addn(1).iushrn(1)),h=this.pow(e,r),l=n;0!==h.cmp(o);){for(var g=h,p=0;0!==g.cmp(o);p++)g=g.redSqr();assert(p=0;r--){for(var s=t.words[r],b=d-1;b>=0;b--){var u=s>>b&1;n!==a[0]&&(n=this.sqr(n)),0!==u||0!==o?(o<<=1,o|=u,(4===++c||0===r&&0===b)&&(n=this.mul(n,a[o]),c=0,o=0)):c=0}d=26}return n},Red.prototype.convertTo=function convertTo(e){var t=e.umod(this.m);return t===e?t.clone():t},Red.prototype.convertFrom=function convertFrom(e){var t=e.clone();return t.red=null,t},BN.mont=function mont(e){return new Mont(e)},inherits(Mont,Red),Mont.prototype.convertTo=function convertTo(e){return this.imod(e.ushln(this.shift))},Mont.prototype.convertFrom=function convertFrom(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},Mont.prototype.imul=function imul(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var a=e.imul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},Mont.prototype.mul=function mul(e,t){if(e.isZero()||t.isZero())return new BN(0)._forceRed(this);var a=e.mul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},Mont.prototype.invm=function invm(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=a.nmd(e),this)},(e,t,a)=>{"use strict";var r=a(38),n=a(6);function isSurrogatePair(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function htonl(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function zero2(e){return 1===e.length?"0"+e:e}function zero8(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=n,t.toArray=function toArray(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var a=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n>6|192,a[r++]=63&o|128):isSurrogatePair(e,n)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++n)),a[r++]=o>>18|240,a[r++]=o>>12&63|128,a[r++]=o>>6&63|128,a[r++]=63&o|128):(a[r++]=o>>12|224,a[r++]=o>>6&63|128,a[r++]=63&o|128)}else for(n=0;n>>0}return c},t.split32=function split32(e,t){for(var a=new Array(4*e.length),r=0,n=0;r>>24,a[n+1]=o>>>16&255,a[n+2]=o>>>8&255,a[n+3]=255&o):(a[n+3]=o>>>24,a[n+2]=o>>>16&255,a[n+1]=o>>>8&255,a[n]=255&o)}return a},t.rotr32=function rotr32(e,t){return e>>>t|e<<32-t},t.rotl32=function rotl32(e,t){return e<>>32-t},t.sum32=function sum32(e,t){return e+t>>>0},t.sum32_3=function sum32_3(e,t,a){return e+t+a>>>0},t.sum32_4=function sum32_4(e,t,a,r){return e+t+a+r>>>0},t.sum32_5=function sum32_5(e,t,a,r,n){return e+t+a+r+n>>>0},t.sum64=function sum64(e,t,a,r){var n=e[t],o=r+e[t+1]>>>0,c=(o>>0,e[t+1]=o},t.sum64_hi=function sum64_hi(e,t,a,r){return(t+r>>>0>>0},t.sum64_lo=function sum64_lo(e,t,a,r){return t+r>>>0},t.sum64_4_hi=function sum64_4_hi(e,t,a,r,n,o,c,d){var s=0,b=t;return s+=(b=b+r>>>0)>>0)>>0)>>0},t.sum64_4_lo=function sum64_4_lo(e,t,a,r,n,o,c,d){return t+r+o+d>>>0},t.sum64_5_hi=function sum64_5_hi(e,t,a,r,n,o,c,d,s,b){var u=0,h=t;return u+=(h=h+r>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function sum64_5_lo(e,t,a,r,n,o,c,d,s,b){return t+r+o+d+b>>>0},t.rotr64_hi=function rotr64_hi(e,t,a){return(t<<32-a|e>>>a)>>>0},t.rotr64_lo=function rotr64_lo(e,t,a){return(e<<32-a|t>>>a)>>>0},t.shr64_hi=function shr64_hi(e,t,a){return e>>>a},t.shr64_lo=function shr64_lo(e,t,a){return(e<<32-a|t>>>a)>>>0}},(e,t,a)=>{"use strict";var r=a(87),n=a(15);function isSurrogatePair(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function htonl(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function zero2(e){return 1===e.length?"0"+e:e}function zero8(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=n,t.toArray=function toArray(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var a=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n>6|192,a[r++]=63&o|128):isSurrogatePair(e,n)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++n)),a[r++]=o>>18|240,a[r++]=o>>12&63|128,a[r++]=o>>6&63|128,a[r++]=63&o|128):(a[r++]=o>>12|224,a[r++]=o>>6&63|128,a[r++]=63&o|128)}else for(n=0;n>>0}return c},t.split32=function split32(e,t){for(var a=new Array(4*e.length),r=0,n=0;r>>24,a[n+1]=o>>>16&255,a[n+2]=o>>>8&255,a[n+3]=255&o):(a[n+3]=o>>>24,a[n+2]=o>>>16&255,a[n+1]=o>>>8&255,a[n]=255&o)}return a},t.rotr32=function rotr32(e,t){return e>>>t|e<<32-t},t.rotl32=function rotl32(e,t){return e<>>32-t},t.sum32=function sum32(e,t){return e+t>>>0},t.sum32_3=function sum32_3(e,t,a){return e+t+a>>>0},t.sum32_4=function sum32_4(e,t,a,r){return e+t+a+r>>>0},t.sum32_5=function sum32_5(e,t,a,r,n){return e+t+a+r+n>>>0},t.sum64=function sum64(e,t,a,r){var n=e[t],o=r+e[t+1]>>>0,c=(o>>0,e[t+1]=o},t.sum64_hi=function sum64_hi(e,t,a,r){return(t+r>>>0>>0},t.sum64_lo=function sum64_lo(e,t,a,r){return t+r>>>0},t.sum64_4_hi=function sum64_4_hi(e,t,a,r,n,o,c,d){var s=0,b=t;return s+=(b=b+r>>>0)>>0)>>0)>>0},t.sum64_4_lo=function sum64_4_lo(e,t,a,r,n,o,c,d){return t+r+o+d>>>0},t.sum64_5_hi=function sum64_5_hi(e,t,a,r,n,o,c,d,s,b){var u=0,h=t;return u+=(h=h+r>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function sum64_5_lo(e,t,a,r,n,o,c,d,s,b){return t+r+o+d+b>>>0},t.rotr64_hi=function rotr64_hi(e,t,a){return(t<<32-a|e>>>a)>>>0},t.rotr64_lo=function rotr64_lo(e,t,a){return(e<<32-a|t>>>a)>>>0},t.shr64_hi=function shr64_hi(e,t,a){return e>>>a},t.shr64_lo=function shr64_lo(e,t,a){return(e<<32-a|t>>>a)>>>0}},(e,t,a)=>{"use strict";var r=a(88),n=a(16);function isSurrogatePair(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function htonl(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function zero2(e){return 1===e.length?"0"+e:e}function zero8(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=n,t.toArray=function toArray(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var a=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n>6|192,a[r++]=63&o|128):isSurrogatePair(e,n)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++n)),a[r++]=o>>18|240,a[r++]=o>>12&63|128,a[r++]=o>>6&63|128,a[r++]=63&o|128):(a[r++]=o>>12|224,a[r++]=o>>6&63|128,a[r++]=63&o|128)}else for(n=0;n>>0}return c},t.split32=function split32(e,t){for(var a=new Array(4*e.length),r=0,n=0;r>>24,a[n+1]=o>>>16&255,a[n+2]=o>>>8&255,a[n+3]=255&o):(a[n+3]=o>>>24,a[n+2]=o>>>16&255,a[n+1]=o>>>8&255,a[n]=255&o)}return a},t.rotr32=function rotr32(e,t){return e>>>t|e<<32-t},t.rotl32=function rotl32(e,t){return e<>>32-t},t.sum32=function sum32(e,t){return e+t>>>0},t.sum32_3=function sum32_3(e,t,a){return e+t+a>>>0},t.sum32_4=function sum32_4(e,t,a,r){return e+t+a+r>>>0},t.sum32_5=function sum32_5(e,t,a,r,n){return e+t+a+r+n>>>0},t.sum64=function sum64(e,t,a,r){var n=e[t],o=r+e[t+1]>>>0,c=(o>>0,e[t+1]=o},t.sum64_hi=function sum64_hi(e,t,a,r){return(t+r>>>0>>0},t.sum64_lo=function sum64_lo(e,t,a,r){return t+r>>>0},t.sum64_4_hi=function sum64_4_hi(e,t,a,r,n,o,c,d){var s=0,b=t;return s+=(b=b+r>>>0)>>0)>>0)>>0},t.sum64_4_lo=function sum64_4_lo(e,t,a,r,n,o,c,d){return t+r+o+d>>>0},t.sum64_5_hi=function sum64_5_hi(e,t,a,r,n,o,c,d,s,b){var u=0,h=t;return u+=(h=h+r>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function sum64_5_lo(e,t,a,r,n,o,c,d,s,b){return t+r+o+d+b>>>0},t.rotr64_hi=function rotr64_hi(e,t,a){return(t<<32-a|e>>>a)>>>0},t.rotr64_lo=function rotr64_lo(e,t,a){return(e<<32-a|t>>>a)>>>0},t.shr64_hi=function shr64_hi(e,t,a){return e>>>a},t.shr64_lo=function shr64_lo(e,t,a){return(e<<32-a|t>>>a)>>>0}},(e,t,a)=>{"use strict";var r=a(89),n=a(157);function isSurrogatePair(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function htonl(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function zero2(e){return 1===e.length?"0"+e:e}function zero8(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=n,t.toArray=function toArray(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var a=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n>6|192,a[r++]=63&o|128):isSurrogatePair(e,n)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++n)),a[r++]=o>>18|240,a[r++]=o>>12&63|128,a[r++]=o>>6&63|128,a[r++]=63&o|128):(a[r++]=o>>12|224,a[r++]=o>>6&63|128,a[r++]=63&o|128)}else for(n=0;n>>0}return c},t.split32=function split32(e,t){for(var a=new Array(4*e.length),r=0,n=0;r>>24,a[n+1]=o>>>16&255,a[n+2]=o>>>8&255,a[n+3]=255&o):(a[n+3]=o>>>24,a[n+2]=o>>>16&255,a[n+1]=o>>>8&255,a[n]=255&o)}return a},t.rotr32=function rotr32(e,t){return e>>>t|e<<32-t},t.rotl32=function rotl32(e,t){return e<>>32-t},t.sum32=function sum32(e,t){return e+t>>>0},t.sum32_3=function sum32_3(e,t,a){return e+t+a>>>0},t.sum32_4=function sum32_4(e,t,a,r){return e+t+a+r>>>0},t.sum32_5=function sum32_5(e,t,a,r,n){return e+t+a+r+n>>>0},t.sum64=function sum64(e,t,a,r){var n=e[t],o=r+e[t+1]>>>0,c=(o>>0,e[t+1]=o},t.sum64_hi=function sum64_hi(e,t,a,r){return(t+r>>>0>>0},t.sum64_lo=function sum64_lo(e,t,a,r){return t+r>>>0},t.sum64_4_hi=function sum64_4_hi(e,t,a,r,n,o,c,d){var s=0,b=t;return s+=(b=b+r>>>0)>>0)>>0)>>0},t.sum64_4_lo=function sum64_4_lo(e,t,a,r,n,o,c,d){return t+r+o+d>>>0},t.sum64_5_hi=function sum64_5_hi(e,t,a,r,n,o,c,d,s,b){var u=0,h=t;return u+=(h=h+r>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function sum64_5_lo(e,t,a,r,n,o,c,d,s,b){return t+r+o+d+b>>>0},t.rotr64_hi=function rotr64_hi(e,t,a){return(t<<32-a|e>>>a)>>>0},t.rotr64_lo=function rotr64_lo(e,t,a){return(e<<32-a|t>>>a)>>>0},t.shr64_hi=function shr64_hi(e,t,a){return e>>>a},t.shr64_lo=function shr64_lo(e,t,a){return(e<<32-a|t>>>a)>>>0}},(e,t,a)=>{"use strict";var r=a(90),n=a(17);function isSurrogatePair(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function htonl(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function zero2(e){return 1===e.length?"0"+e:e}function zero8(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=n,t.toArray=function toArray(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var a=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n>6|192,a[r++]=63&o|128):isSurrogatePair(e,n)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++n)),a[r++]=o>>18|240,a[r++]=o>>12&63|128,a[r++]=o>>6&63|128,a[r++]=63&o|128):(a[r++]=o>>12|224,a[r++]=o>>6&63|128,a[r++]=63&o|128)}else for(n=0;n>>0}return c},t.split32=function split32(e,t){for(var a=new Array(4*e.length),r=0,n=0;r>>24,a[n+1]=o>>>16&255,a[n+2]=o>>>8&255,a[n+3]=255&o):(a[n+3]=o>>>24,a[n+2]=o>>>16&255,a[n+1]=o>>>8&255,a[n]=255&o)}return a},t.rotr32=function rotr32(e,t){return e>>>t|e<<32-t},t.rotl32=function rotl32(e,t){return e<>>32-t},t.sum32=function sum32(e,t){return e+t>>>0},t.sum32_3=function sum32_3(e,t,a){return e+t+a>>>0},t.sum32_4=function sum32_4(e,t,a,r){return e+t+a+r>>>0},t.sum32_5=function sum32_5(e,t,a,r,n){return e+t+a+r+n>>>0},t.sum64=function sum64(e,t,a,r){var n=e[t],o=r+e[t+1]>>>0,c=(o>>0,e[t+1]=o},t.sum64_hi=function sum64_hi(e,t,a,r){return(t+r>>>0>>0},t.sum64_lo=function sum64_lo(e,t,a,r){return t+r>>>0},t.sum64_4_hi=function sum64_4_hi(e,t,a,r,n,o,c,d){var s=0,b=t;return s+=(b=b+r>>>0)>>0)>>0)>>0},t.sum64_4_lo=function sum64_4_lo(e,t,a,r,n,o,c,d){return t+r+o+d>>>0},t.sum64_5_hi=function sum64_5_hi(e,t,a,r,n,o,c,d,s,b){var u=0,h=t;return u+=(h=h+r>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function sum64_5_lo(e,t,a,r,n,o,c,d,s,b){return t+r+o+d+b>>>0},t.rotr64_hi=function rotr64_hi(e,t,a){return(t<<32-a|e>>>a)>>>0},t.rotr64_lo=function rotr64_lo(e,t,a){return(e<<32-a|t>>>a)>>>0},t.shr64_hi=function shr64_hi(e,t,a){return e>>>a},t.shr64_lo=function shr64_lo(e,t,a){return(e<<32-a|t>>>a)>>>0}},(e,t,a)=>{"use strict";var r=a(91),n=a(9);function isSurrogatePair(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function htonl(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function zero2(e){return 1===e.length?"0"+e:e}function zero8(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=n,t.toArray=function toArray(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var a=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n>6|192,a[r++]=63&o|128):isSurrogatePair(e,n)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++n)),a[r++]=o>>18|240,a[r++]=o>>12&63|128,a[r++]=o>>6&63|128,a[r++]=63&o|128):(a[r++]=o>>12|224,a[r++]=o>>6&63|128,a[r++]=63&o|128)}else for(n=0;n>>0}return c},t.split32=function split32(e,t){for(var a=new Array(4*e.length),r=0,n=0;r>>24,a[n+1]=o>>>16&255,a[n+2]=o>>>8&255,a[n+3]=255&o):(a[n+3]=o>>>24,a[n+2]=o>>>16&255,a[n+1]=o>>>8&255,a[n]=255&o)}return a},t.rotr32=function rotr32(e,t){return e>>>t|e<<32-t},t.rotl32=function rotl32(e,t){return e<>>32-t},t.sum32=function sum32(e,t){return e+t>>>0},t.sum32_3=function sum32_3(e,t,a){return e+t+a>>>0},t.sum32_4=function sum32_4(e,t,a,r){return e+t+a+r>>>0},t.sum32_5=function sum32_5(e,t,a,r,n){return e+t+a+r+n>>>0},t.sum64=function sum64(e,t,a,r){var n=e[t],o=r+e[t+1]>>>0,c=(o>>0,e[t+1]=o},t.sum64_hi=function sum64_hi(e,t,a,r){return(t+r>>>0>>0},t.sum64_lo=function sum64_lo(e,t,a,r){return t+r>>>0},t.sum64_4_hi=function sum64_4_hi(e,t,a,r,n,o,c,d){var s=0,b=t;return s+=(b=b+r>>>0)>>0)>>0)>>0},t.sum64_4_lo=function sum64_4_lo(e,t,a,r,n,o,c,d){return t+r+o+d>>>0},t.sum64_5_hi=function sum64_5_hi(e,t,a,r,n,o,c,d,s,b){var u=0,h=t;return u+=(h=h+r>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function sum64_5_lo(e,t,a,r,n,o,c,d,s,b){return t+r+o+d+b>>>0},t.rotr64_hi=function rotr64_hi(e,t,a){return(t<<32-a|e>>>a)>>>0},t.rotr64_lo=function rotr64_lo(e,t,a){return(e<<32-a|t>>>a)>>>0},t.shr64_hi=function shr64_hi(e,t,a){return e>>>a},t.shr64_lo=function shr64_lo(e,t,a){return(e<<32-a|t>>>a)>>>0}},(e,t,a)=>{"use strict";var r=a(93),n=a(18);function isSurrogatePair(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function htonl(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function zero2(e){return 1===e.length?"0"+e:e}function zero8(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=n,t.toArray=function toArray(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var a=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n>6|192,a[r++]=63&o|128):isSurrogatePair(e,n)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++n)),a[r++]=o>>18|240,a[r++]=o>>12&63|128,a[r++]=o>>6&63|128,a[r++]=63&o|128):(a[r++]=o>>12|224,a[r++]=o>>6&63|128,a[r++]=63&o|128)}else for(n=0;n>>0}return c},t.split32=function split32(e,t){for(var a=new Array(4*e.length),r=0,n=0;r>>24,a[n+1]=o>>>16&255,a[n+2]=o>>>8&255,a[n+3]=255&o):(a[n+3]=o>>>24,a[n+2]=o>>>16&255,a[n+1]=o>>>8&255,a[n]=255&o)}return a},t.rotr32=function rotr32(e,t){return e>>>t|e<<32-t},t.rotl32=function rotl32(e,t){return e<>>32-t},t.sum32=function sum32(e,t){return e+t>>>0},t.sum32_3=function sum32_3(e,t,a){return e+t+a>>>0},t.sum32_4=function sum32_4(e,t,a,r){return e+t+a+r>>>0},t.sum32_5=function sum32_5(e,t,a,r,n){return e+t+a+r+n>>>0},t.sum64=function sum64(e,t,a,r){var n=e[t],o=r+e[t+1]>>>0,c=(o>>0,e[t+1]=o},t.sum64_hi=function sum64_hi(e,t,a,r){return(t+r>>>0>>0},t.sum64_lo=function sum64_lo(e,t,a,r){return t+r>>>0},t.sum64_4_hi=function sum64_4_hi(e,t,a,r,n,o,c,d){var s=0,b=t;return s+=(b=b+r>>>0)>>0)>>0)>>0},t.sum64_4_lo=function sum64_4_lo(e,t,a,r,n,o,c,d){return t+r+o+d>>>0},t.sum64_5_hi=function sum64_5_hi(e,t,a,r,n,o,c,d,s,b){var u=0,h=t;return u+=(h=h+r>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function sum64_5_lo(e,t,a,r,n,o,c,d,s,b){return t+r+o+d+b>>>0},t.rotr64_hi=function rotr64_hi(e,t,a){return(t<<32-a|e>>>a)>>>0},t.rotr64_lo=function rotr64_lo(e,t,a){return(e<<32-a|t>>>a)>>>0},t.shr64_hi=function shr64_hi(e,t,a){return e>>>a},t.shr64_lo=function shr64_lo(e,t,a){return(e<<32-a|t>>>a)>>>0}},(e,t,a)=>{var r=a(28);e.exports=function(e){return"object"==typeof e?null!==e:r(e)}},(e,t,a)=>{var r=a(31),n=a(300),o=r({}.hasOwnProperty);e.exports=Object.hasOwn||function hasOwn(e,t){return o(n(e),t)}},(e,t,a)=>{var r=a(7).Buffer,n=a(49).Transform,o=a(718).a;function CipherBase(e){n.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}a(6)(CipherBase,n),CipherBase.prototype.update=function(e,t,a){"string"==typeof e&&(e=r.from(e,t));var n=this._update(e);return this.hashMode?this:(a&&(n=this._toString(n,a)),n)},CipherBase.prototype.setAutoPadding=function(){},CipherBase.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},CipherBase.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},CipherBase.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},CipherBase.prototype._transform=function(e,t,a){var r;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){r=e}finally{a(r)}},CipherBase.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},CipherBase.prototype._finalOrDigest=function(e){var t=this.__final()||r.alloc(0);return e&&(t=this._toString(t,e,!0)),t},CipherBase.prototype._toString=function(e,t,a){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var r=this._decoder.write(e);return a&&(r+=this._decoder.end()),r},e.exports=CipherBase},(e,t,a)=>{var r=a(50),n=a(560),o=a(562),c=a(94),d=a(294),s=TypeError,b=Object.defineProperty,u=Object.getOwnPropertyDescriptor,h="enumerable",l="configurable",g="writable";t.f=r?o?function defineProperty(e,t,a){if(c(e),t=d(t),c(a),"function"==typeof e&&"prototype"===t&&"value"in a&&g in a&&!a.writable){var r=u(e,t);r&&r.writable&&(e[t]=a.value,a={configurable:l in a?a.configurable:r.configurable,enumerable:h in a?a.enumerable:r.enumerable,writable:!1})}return b(e,t,a)}:b:function defineProperty(e,t,a){if(c(e),t=d(t),c(a),n)try{return b(e,t,a)}catch(e){}if("get"in a||"set"in a)throw s("Accessors not supported");return"value"in a&&(e[t]=a.value),e}},(e,t,a)=>{"use strict";var r=a(0).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.BLS12_381_ToFp2Point=t.BLS12_381_ToFpPoint=t.BLS12_381_ToFrPoint=t.BLS12_381_FromG2Point=t.BLS12_381_ToG2Point=t.BLS12_381_FromG1Point=t.BLS12_381_ToG1Point=void 0;var n=a(1),o=a(22),c=new n.BN("1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab",16);function BLS12_381_ToFp2Point(e,t,a){if(new n.BN(e).gte(c))throw new o.VmError(o.ERROR.BLS_12_381_FP_NOT_IN_FIELD);if(new n.BN(t).gte(c))throw new o.VmError(o.ERROR.BLS_12_381_FP_NOT_IN_FIELD);var r=new a.Fp,d=new a.Fp,s=new a.Fp2;return r.setStr(e.slice(16).toString("hex"),16),d.setStr(t.slice(16).toString("hex"),16),s.set_a(r),s.set_b(d),s}t.BLS12_381_ToG1Point=function BLS12_381_ToG1Point(e,t){var a=e.slice(16,64).toString("hex"),r=e.slice(80,128).toString("hex"),n="0".repeat(96);if(a==r&&a==n)return new t.G1;var c=new t.Fp,d=new t.Fp,s=new t.Fp;c.setStr(a,16),d.setStr(r,16),s.setStr("1",16);var b=new t.G1;if(b.setX(c),b.setY(d),b.setZ(s),!b.isValidOrder())throw new o.VmError(o.ERROR.BLS_12_381_POINT_NOT_ON_CURVE);if(!b.isValid())throw new o.VmError(o.ERROR.BLS_12_381_POINT_NOT_ON_CURVE);return b},t.BLS12_381_FromG1Point=function BLS12_381_FromG1Point(e){var t=e.getStr(16),a=t.match(/"?[0-9a-f]+"?/g);if("0"==t)return r.alloc(128,0);var o=(0,n.padToEven)(a[1]),c=(0,n.padToEven)(a[2]),d=r.concat([r.alloc(64-o.length/2,0),r.from(o,"hex")]),s=r.concat([r.alloc(64-c.length/2,0),r.from(c,"hex")]);return r.concat([d,s])},t.BLS12_381_ToG2Point=function BLS12_381_ToG2Point(e,t){var a=e.slice(0,64),n=e.slice(64,128),c=e.slice(128,192),d=e.slice(192,256),s=r.alloc(64,0);if(a.equals(n)&&a.equals(c)&&a.equals(d)&&a.equals(s))return new t.G2;var b=BLS12_381_ToFp2Point(a,n,t),u=BLS12_381_ToFp2Point(c,d,t),h=new t.Fp;h.setStr("1",16);var l=new t.Fp;l.setStr("0",16);var g=new t.Fp2;g.set_a(h),g.set_b(l);var p=new t.G2;if(p.setX(b),p.setY(u),p.setZ(g),!p.isValidOrder())throw new o.VmError(o.ERROR.BLS_12_381_POINT_NOT_ON_CURVE);if(!p.isValid())throw new o.VmError(o.ERROR.BLS_12_381_POINT_NOT_ON_CURVE);return p},t.BLS12_381_FromG2Point=function BLS12_381_FromG2Point(e){var t=e.getStr(16);if("0"==t)return r.alloc(256,0);var a=t.match(/"?[0-9a-f]+"?/g),o=(0,n.padToEven)(a[1]),c=(0,n.padToEven)(a[2]),d=(0,n.padToEven)(a[3]),s=(0,n.padToEven)(a[4]),b=r.concat([r.alloc(64-o.length/2,0),r.from(o,"hex")]),u=r.concat([r.alloc(64-c.length/2,0),r.from(c,"hex")]),h=r.concat([r.alloc(64-d.length/2,0),r.from(d,"hex")]),l=r.concat([r.alloc(64-s.length/2,0),r.from(s,"hex")]);return r.concat([b,u,h,l])},t.BLS12_381_ToFrPoint=function BLS12_381_ToFrPoint(e,t){var a=t.fromHexStr(e.toString("hex")),r=new t.Fr;return r.setBigEndianMod(a),r},t.BLS12_381_ToFpPoint=function BLS12_381_ToFpPoint(e,t){if(new n.BN(e).gte(c))throw new o.VmError(o.ERROR.BLS_12_381_FP_NOT_IN_FIELD);var a=new t.Fp;return a.setBigEndianMod(t.fromHexStr(e.toString("hex"))),a},t.BLS12_381_ToFp2Point=BLS12_381_ToFp2Point},(e,t,a)=>{"use strict";var r=a(0).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.BLS12_381_ToFp2Point=t.BLS12_381_ToFpPoint=t.BLS12_381_ToFrPoint=t.BLS12_381_FromG2Point=t.BLS12_381_ToG2Point=t.BLS12_381_FromG1Point=t.BLS12_381_ToG1Point=void 0;const n=a(1),o=a(19),c=new n.BN("1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab",16);function BLS12_381_ToFp2Point(e,t,a){if(new n.BN(e).gte(c))throw new o.VmError(o.ERROR.BLS_12_381_FP_NOT_IN_FIELD);if(new n.BN(t).gte(c))throw new o.VmError(o.ERROR.BLS_12_381_FP_NOT_IN_FIELD);const r=new a.Fp,d=new a.Fp,s=new a.Fp2;return r.setStr(e.slice(16).toString("hex"),16),d.setStr(t.slice(16).toString("hex"),16),s.set_a(r),s.set_b(d),s}t.BLS12_381_ToG1Point=function BLS12_381_ToG1Point(e,t){const a=e.slice(16,64).toString("hex"),r=e.slice(80,128).toString("hex"),n="0".repeat(96);if(a==r&&a==n)return new t.G1;const c=new t.Fp,d=new t.Fp,s=new t.Fp;c.setStr(a,16),d.setStr(r,16),s.setStr("1",16);const b=new t.G1;if(b.setX(c),b.setY(d),b.setZ(s),!b.isValidOrder())throw new o.VmError(o.ERROR.BLS_12_381_POINT_NOT_ON_CURVE);if(!b.isValid())throw new o.VmError(o.ERROR.BLS_12_381_POINT_NOT_ON_CURVE);return b},t.BLS12_381_FromG1Point=function BLS12_381_FromG1Point(e){const t=e.getStr(16),a=t.match(/"?[0-9a-f]+"?/g);if("0"==t)return r.alloc(128,0);const o=(0,n.padToEven)(a[1]),c=(0,n.padToEven)(a[2]),d=r.concat([r.alloc(64-o.length/2,0),r.from(o,"hex")]),s=r.concat([r.alloc(64-c.length/2,0),r.from(c,"hex")]);return r.concat([d,s])},t.BLS12_381_ToG2Point=function BLS12_381_ToG2Point(e,t){const a=e.slice(0,64),n=e.slice(64,128),c=e.slice(128,192),d=e.slice(192,256),s=r.alloc(64,0);if(a.equals(n)&&a.equals(c)&&a.equals(d)&&a.equals(s))return new t.G2;const b=BLS12_381_ToFp2Point(a,n,t),u=BLS12_381_ToFp2Point(c,d,t),h=new t.Fp;h.setStr("1",16);const l=new t.Fp;l.setStr("0",16);const g=new t.Fp2;g.set_a(h),g.set_b(l);const p=new t.G2;if(p.setX(b),p.setY(u),p.setZ(g),!p.isValidOrder())throw new o.VmError(o.ERROR.BLS_12_381_POINT_NOT_ON_CURVE);if(!p.isValid())throw new o.VmError(o.ERROR.BLS_12_381_POINT_NOT_ON_CURVE);return p},t.BLS12_381_FromG2Point=function BLS12_381_FromG2Point(e){const t=e.getStr(16);if("0"==t)return r.alloc(256,0);const a=t.match(/"?[0-9a-f]+"?/g),o=(0,n.padToEven)(a[1]),c=(0,n.padToEven)(a[2]),d=(0,n.padToEven)(a[3]),s=(0,n.padToEven)(a[4]),b=r.concat([r.alloc(64-o.length/2,0),r.from(o,"hex")]),u=r.concat([r.alloc(64-c.length/2,0),r.from(c,"hex")]),h=r.concat([r.alloc(64-d.length/2,0),r.from(d,"hex")]),l=r.concat([r.alloc(64-s.length/2,0),r.from(s,"hex")]);return r.concat([b,u,h,l])},t.BLS12_381_ToFrPoint=function BLS12_381_ToFrPoint(e,t){const a=t.fromHexStr(e.toString("hex")),r=new t.Fr;return r.setBigEndianMod(a),r},t.BLS12_381_ToFpPoint=function BLS12_381_ToFpPoint(e,t){if(new n.BN(e).gte(c))throw new o.VmError(o.ERROR.BLS_12_381_FP_NOT_IN_FIELD);const a=new t.Fp;return a.setBigEndianMod(t.fromHexStr(e.toString("hex"))),a},t.BLS12_381_ToFp2Point=BLS12_381_ToFp2Point},function(e,t,a){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a);var n=Object.getOwnPropertyDescriptor(t,a);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,r,n)}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),n=this&&this.__exportStar||function(e,t){for(var a in e)"default"===a||Object.prototype.hasOwnProperty.call(t,a)||r(t,e,a)};Object.defineProperty(t,"__esModule",{value:!0}),n(a(357),t),n(a(359),t),n(a(449),t),n(a(1554),t),n(a(1018),t),n(a(450),t),n(a(1555),t),n(a(1556),t),n(a(147),t),n(a(343),t),n(a(1019),t),n(a(1557),t),n(a(1558),t)},function(e,t,a){"use strict";var r=a(8).Buffer,n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,a=t&&e[t],r=0;if(a)return a.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(e,t){var a="function"==typeof Symbol&&e[Symbol.iterator];if(!a)return e;var r,n,o=a.call(e),c=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)c.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(a=o.return)&&a.call(o)}finally{if(n)throw n.error}}return c};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var c=a(55),d=a(128),s=a(251);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToBuffer=function(e){var a=(0,t.intToHex)(e);return r.from((0,d.padToEven)(a.slice(2)),"hex")};t.zeros=function(e){return r.allocUnsafe(e).fill(0)};var setLength=function(e,a,r){var n=(0,t.zeros)(a);return r?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,s.assertIsBuffer)(e),stripZeros(e)};t.unpadArray=function(e){return(0,s.assertIsArray)(e),stripZeros(e)};t.unpadHexString=function(e){return(0,s.assertIsHexString)(e),e=(0,d.stripHexPrefix)(e),stripZeros(e)};t.toBuffer=function(e){if(null==e)return r.allocUnsafe(0);if(r.isBuffer(e))return r.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return r.from(e);if("string"==typeof e){if(!(0,d.isHexString)(e))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(e));return r.from((0,d.padToEven)((0,d.stripHexPrefix)(e)),"hex")}if("number"==typeof e)return(0,t.intToBuffer)(e);if(c.BN.isBN(e)){if(e.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(e));return e.toArrayLike(r)}if(e.toArray)return r.from(e.toArray());if(e.toBuffer)return r.from(e.toBuffer());throw new Error("invalid type")};t.bufferToInt=function(e){return new c.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")};t.fromSigned=function(e){return new c.BN(e).fromTwos(256)};t.toUnsigned=function(e){return r.from(e.toTwos(256).toArray())};t.addHexPrefix=function(e){return"string"!=typeof e||(0,d.isHexPrefixed)(e)?e:"0x"+e};t.toUtf8=function(e){if((e=(0,d.stripHexPrefix)(e)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return r.from(e.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};t.baToJSON=function(e){if(r.isBuffer(e))return"0x".concat(e.toString("hex"));if(e instanceof Array){for(var a=[],n=0;n0&&0===b[0])throw new Error("".concat(s," cannot have leading zeroes, received: ").concat(b.toString("hex")))}}catch(e){t={error:e}}finally{try{c&&!c.done&&(a=r.return)&&a.call(r)}finally{if(t)throw t.error}}},t.arrToBufArr=function arrToBufArr(e){return Array.isArray(e)?e.map((function(e){return arrToBufArr(e)})):r.from(e)},t.bufArrToArr=function bufArrToArr(e){return Array.isArray(e)?e.map((function(e){return bufArrToArr(e)})):Uint8Array.from(null!=e?e:[])}},function(e,t,a){"use strict";var r=a(10).Buffer,n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,a=t&&e[t],r=0;if(a)return a.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(e,t){var a="function"==typeof Symbol&&e[Symbol.iterator];if(!a)return e;var r,n,o=a.call(e),c=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)c.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(a=o.return)&&a.call(o)}finally{if(n)throw n.error}}return c};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var c=a(56),d=a(129),s=a(255);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToBuffer=function(e){var a=(0,t.intToHex)(e);return r.from((0,d.padToEven)(a.slice(2)),"hex")};t.zeros=function(e){return r.allocUnsafe(e).fill(0)};var setLength=function(e,a,r){var n=(0,t.zeros)(a);return r?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,s.assertIsBuffer)(e),stripZeros(e)};t.unpadArray=function(e){return(0,s.assertIsArray)(e),stripZeros(e)};t.unpadHexString=function(e){return(0,s.assertIsHexString)(e),e=(0,d.stripHexPrefix)(e),stripZeros(e)};t.toBuffer=function(e){if(null==e)return r.allocUnsafe(0);if(r.isBuffer(e))return r.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return r.from(e);if("string"==typeof e){if(!(0,d.isHexString)(e))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(e));return r.from((0,d.padToEven)((0,d.stripHexPrefix)(e)),"hex")}if("number"==typeof e)return(0,t.intToBuffer)(e);if(c.BN.isBN(e)){if(e.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(e));return e.toArrayLike(r)}if(e.toArray)return r.from(e.toArray());if(e.toBuffer)return r.from(e.toBuffer());throw new Error("invalid type")};t.bufferToInt=function(e){return new c.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")};t.fromSigned=function(e){return new c.BN(e).fromTwos(256)};t.toUnsigned=function(e){return r.from(e.toTwos(256).toArray())};t.addHexPrefix=function(e){return"string"!=typeof e||(0,d.isHexPrefixed)(e)?e:"0x"+e};t.toUtf8=function(e){if((e=(0,d.stripHexPrefix)(e)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return r.from(e.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};t.baToJSON=function(e){if(r.isBuffer(e))return"0x".concat(e.toString("hex"));if(e instanceof Array){for(var a=[],n=0;n0&&0===b[0])throw new Error("".concat(s," cannot have leading zeroes, received: ").concat(b.toString("hex")))}}catch(e){t={error:e}}finally{try{c&&!c.done&&(a=r.return)&&a.call(r)}finally{if(t)throw t.error}}},t.arrToBufArr=function arrToBufArr(e){return Array.isArray(e)?e.map((function(e){return arrToBufArr(e)})):r.from(e)},t.bufArrToArr=function bufArrToArr(e){return Array.isArray(e)?e.map((function(e){return bufArrToArr(e)})):Uint8Array.from(null!=e?e:[])}},function(e,t,a){"use strict";var r=a(2).Buffer,n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,a=t&&e[t],r=0;if(a)return a.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(e,t){var a="function"==typeof Symbol&&e[Symbol.iterator];if(!a)return e;var r,n,o=a.call(e),c=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)c.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(a=o.return)&&a.call(o)}finally{if(n)throw n.error}}return c};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var c=a(57),d=a(132),s=a(262);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToBuffer=function(e){var a=(0,t.intToHex)(e);return r.from((0,d.padToEven)(a.slice(2)),"hex")};t.zeros=function(e){return r.allocUnsafe(e).fill(0)};var setLength=function(e,a,r){var n=(0,t.zeros)(a);return r?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,s.assertIsBuffer)(e),stripZeros(e)};t.unpadArray=function(e){return(0,s.assertIsArray)(e),stripZeros(e)};t.unpadHexString=function(e){return(0,s.assertIsHexString)(e),e=(0,d.stripHexPrefix)(e),stripZeros(e)};t.toBuffer=function(e){if(null==e)return r.allocUnsafe(0);if(r.isBuffer(e))return r.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return r.from(e);if("string"==typeof e){if(!(0,d.isHexString)(e))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(e));return r.from((0,d.padToEven)((0,d.stripHexPrefix)(e)),"hex")}if("number"==typeof e)return(0,t.intToBuffer)(e);if(c.BN.isBN(e)){if(e.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(e));return e.toArrayLike(r)}if(e.toArray)return r.from(e.toArray());if(e.toBuffer)return r.from(e.toBuffer());throw new Error("invalid type")};t.bufferToInt=function(e){return new c.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")};t.fromSigned=function(e){return new c.BN(e).fromTwos(256)};t.toUnsigned=function(e){return r.from(e.toTwos(256).toArray())};t.addHexPrefix=function(e){return"string"!=typeof e||(0,d.isHexPrefixed)(e)?e:"0x"+e};t.toUtf8=function(e){if((e=(0,d.stripHexPrefix)(e)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return r.from(e.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};t.baToJSON=function(e){if(r.isBuffer(e))return"0x".concat(e.toString("hex"));if(e instanceof Array){for(var a=[],n=0;n0&&0===b[0])throw new Error("".concat(s," cannot have leading zeroes, received: ").concat(b.toString("hex")))}}catch(e){t={error:e}}finally{try{c&&!c.done&&(a=r.return)&&a.call(r)}finally{if(t)throw t.error}}},t.arrToBufArr=function arrToBufArr(e){return Array.isArray(e)?e.map((function(e){return arrToBufArr(e)})):r.from(e)},t.bufArrToArr=function bufArrToArr(e){return Array.isArray(e)?e.map((function(e){return bufArrToArr(e)})):Uint8Array.from(null!=e?e:[])}},function(e,t,a){"use strict";var r=a(0).Buffer,n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,a=t&&e[t],r=0;if(a)return a.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(e,t){var a="function"==typeof Symbol&&e[Symbol.iterator];if(!a)return e;var r,n,o=a.call(e),c=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)c.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(a=o.return)&&a.call(o)}finally{if(n)throw n.error}}return c};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var c=a(58),d=a(134),s=a(269);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToBuffer=function(e){var a=(0,t.intToHex)(e);return r.from((0,d.padToEven)(a.slice(2)),"hex")};t.zeros=function(e){return r.allocUnsafe(e).fill(0)};var setLength=function(e,a,r){var n=(0,t.zeros)(a);return r?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,s.assertIsBuffer)(e),stripZeros(e)};t.unpadArray=function(e){return(0,s.assertIsArray)(e),stripZeros(e)};t.unpadHexString=function(e){return(0,s.assertIsHexString)(e),e=(0,d.stripHexPrefix)(e),stripZeros(e)};t.toBuffer=function(e){if(null==e)return r.allocUnsafe(0);if(r.isBuffer(e))return r.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return r.from(e);if("string"==typeof e){if(!(0,d.isHexString)(e))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(e));return r.from((0,d.padToEven)((0,d.stripHexPrefix)(e)),"hex")}if("number"==typeof e)return(0,t.intToBuffer)(e);if(c.BN.isBN(e)){if(e.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(e));return e.toArrayLike(r)}if(e.toArray)return r.from(e.toArray());if(e.toBuffer)return r.from(e.toBuffer());throw new Error("invalid type")};t.bufferToInt=function(e){return new c.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")};t.fromSigned=function(e){return new c.BN(e).fromTwos(256)};t.toUnsigned=function(e){return r.from(e.toTwos(256).toArray())};t.addHexPrefix=function(e){return"string"!=typeof e||(0,d.isHexPrefixed)(e)?e:"0x"+e};t.toUtf8=function(e){if((e=(0,d.stripHexPrefix)(e)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return r.from(e.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};t.baToJSON=function(e){if(r.isBuffer(e))return"0x".concat(e.toString("hex"));if(e instanceof Array){for(var a=[],n=0;n0&&0===b[0])throw new Error("".concat(s," cannot have leading zeroes, received: ").concat(b.toString("hex")))}}catch(e){t={error:e}}finally{try{c&&!c.done&&(a=r.return)&&a.call(r)}finally{if(t)throw t.error}}},t.arrToBufArr=function arrToBufArr(e){return Array.isArray(e)?e.map((function(e){return arrToBufArr(e)})):r.from(e)},t.bufArrToArr=function bufArrToArr(e){return Array.isArray(e)?e.map((function(e){return bufArrToArr(e)})):Uint8Array.from(null!=e?e:[])}},function(e,t,a){"use strict";var r=a(2).Buffer,n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,a=t&&e[t],r=0;if(a)return a.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(e,t){var a="function"==typeof Symbol&&e[Symbol.iterator];if(!a)return e;var r,n,o=a.call(e),c=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)c.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(a=o.return)&&a.call(o)}finally{if(n)throw n.error}}return c};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var c=a(59),d=a(136),s=a(280);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToBuffer=function(e){var a=(0,t.intToHex)(e);return r.from((0,d.padToEven)(a.slice(2)),"hex")};t.zeros=function(e){return r.allocUnsafe(e).fill(0)};var setLength=function(e,a,r){var n=(0,t.zeros)(a);return r?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,s.assertIsBuffer)(e),stripZeros(e)};t.unpadArray=function(e){return(0,s.assertIsArray)(e),stripZeros(e)};t.unpadHexString=function(e){return(0,s.assertIsHexString)(e),e=(0,d.stripHexPrefix)(e),stripZeros(e)};t.toBuffer=function(e){if(null==e)return r.allocUnsafe(0);if(r.isBuffer(e))return r.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return r.from(e);if("string"==typeof e){if(!(0,d.isHexString)(e))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(e));return r.from((0,d.padToEven)((0,d.stripHexPrefix)(e)),"hex")}if("number"==typeof e)return(0,t.intToBuffer)(e);if(c.BN.isBN(e)){if(e.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(e));return e.toArrayLike(r)}if(e.toArray)return r.from(e.toArray());if(e.toBuffer)return r.from(e.toBuffer());throw new Error("invalid type")};t.bufferToInt=function(e){return new c.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")};t.fromSigned=function(e){return new c.BN(e).fromTwos(256)};t.toUnsigned=function(e){return r.from(e.toTwos(256).toArray())};t.addHexPrefix=function(e){return"string"!=typeof e||(0,d.isHexPrefixed)(e)?e:"0x"+e};t.toUtf8=function(e){if((e=(0,d.stripHexPrefix)(e)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return r.from(e.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};t.baToJSON=function(e){if(r.isBuffer(e))return"0x".concat(e.toString("hex"));if(e instanceof Array){for(var a=[],n=0;n0&&0===b[0])throw new Error("".concat(s," cannot have leading zeroes, received: ").concat(b.toString("hex")))}}catch(e){t={error:e}}finally{try{c&&!c.done&&(a=r.return)&&a.call(r)}finally{if(t)throw t.error}}},t.arrToBufArr=function arrToBufArr(e){return Array.isArray(e)?e.map((function(e){return arrToBufArr(e)})):r.from(e)},t.bufArrToArr=function bufArrToArr(e){return Array.isArray(e)?e.map((function(e){return bufArrToArr(e)})):Uint8Array.from(null!=e?e:[])}},(e,t,a)=>{"use strict";var r=a(3);function assertPath(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function normalizeStringPosix(e,t){for(var a,r="",n=0,o=-1,c=0,d=0;d<=e.length;++d){if(d2){var s=r.lastIndexOf("/");if(s!==r.length-1){-1===s?(r="",n=0):n=(r=r.slice(0,s)).length-1-r.lastIndexOf("/"),o=d,c=0;continue}}else if(2===r.length||1===r.length){r="",n=0,o=d,c=0;continue}t&&(r.length>0?r+="/..":r="..",n=2)}else r.length>0?r+="/"+e.slice(o+1,d):r=e.slice(o+1,d),n=d-o-1;o=d,c=0}else 46===a&&-1!==c?++c:c=-1}return r}var n={resolve:function resolve(){for(var e,t="",a=!1,n=arguments.length-1;n>=-1&&!a;n--){var o;n>=0?o=arguments[n]:(void 0===e&&(e=r.cwd()),o=e),assertPath(o),0!==o.length&&(t=o+"/"+t,a=47===o.charCodeAt(0))}return t=normalizeStringPosix(t,!a),a?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function normalize(e){if(assertPath(e),0===e.length)return".";var t=47===e.charCodeAt(0),a=47===e.charCodeAt(e.length-1);return 0!==(e=normalizeStringPosix(e,!t)).length||t||(e="."),e.length>0&&a&&(e+="/"),t?"/"+e:e},isAbsolute:function isAbsolute(e){return assertPath(e),e.length>0&&47===e.charCodeAt(0)},join:function join(){if(0===arguments.length)return".";for(var e,t=0;t0&&(void 0===e?e=a:e+="/"+a)}return void 0===e?".":n.normalize(e)},relative:function relative(e,t){if(assertPath(e),assertPath(t),e===t)return"";if((e=n.resolve(e))===(t=n.resolve(t)))return"";for(var a=1;as){if(47===t.charCodeAt(c+u))return t.slice(c+u+1);if(0===u)return t.slice(c+u)}else o>s&&(47===e.charCodeAt(a+u)?b=u:0===u&&(b=0));break}var h=e.charCodeAt(a+u);if(h!==t.charCodeAt(c+u))break;47===h&&(b=u)}var l="";for(u=a+b+1;u<=r;++u)u!==r&&47!==e.charCodeAt(u)||(0===l.length?l+="..":l+="/..");return l.length>0?l+t.slice(c+b):(c+=b,47===t.charCodeAt(c)&&++c,t.slice(c))},_makeLong:function _makeLong(e){return e},dirname:function dirname(e){if(assertPath(e),0===e.length)return".";for(var t=e.charCodeAt(0),a=47===t,r=-1,n=!0,o=e.length-1;o>=1;--o)if(47===(t=e.charCodeAt(o))){if(!n){r=o;break}}else n=!1;return-1===r?a?"/":".":a&&1===r?"//":e.slice(0,r)},basename:function basename(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');assertPath(e);var a,r=0,n=-1,o=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var c=t.length-1,d=-1;for(a=e.length-1;a>=0;--a){var s=e.charCodeAt(a);if(47===s){if(!o){r=a+1;break}}else-1===d&&(o=!1,d=a+1),c>=0&&(s===t.charCodeAt(c)?-1==--c&&(n=a):(c=-1,n=d))}return r===n?n=d:-1===n&&(n=e.length),e.slice(r,n)}for(a=e.length-1;a>=0;--a)if(47===e.charCodeAt(a)){if(!o){r=a+1;break}}else-1===n&&(o=!1,n=a+1);return-1===n?"":e.slice(r,n)},extname:function extname(e){assertPath(e);for(var t=-1,a=0,r=-1,n=!0,o=0,c=e.length-1;c>=0;--c){var d=e.charCodeAt(c);if(47!==d)-1===r&&(n=!1,r=c+1),46===d?-1===t?t=c:1!==o&&(o=1):-1!==t&&(o=-1);else if(!n){a=c+1;break}}return-1===t||-1===r||0===o||1===o&&t===r-1&&t===a+1?"":e.slice(t,r)},format:function format(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function _format(e,t){var a=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return a?a===t.root?a+r:a+e+r:r}("/",e)},parse:function parse(e){assertPath(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var a,r=e.charCodeAt(0),n=47===r;n?(t.root="/",a=1):a=0;for(var o=-1,c=0,d=-1,s=!0,b=e.length-1,u=0;b>=a;--b)if(47!==(r=e.charCodeAt(b)))-1===d&&(s=!1,d=b+1),46===r?-1===o?o=b:1!==u&&(u=1):-1!==o&&(u=-1);else if(!s){c=b+1;break}return-1===o||-1===d||0===u||1===u&&o===d-1&&o===c+1?-1!==d&&(t.base=t.name=0===c&&n?e.slice(1,d):e.slice(c,d)):(0===c&&n?(t.name=e.slice(1,o),t.base=e.slice(1,d)):(t.name=e.slice(c,o),t.base=e.slice(c,d)),t.ext=e.slice(o,d)),c>0?t.dir=e.slice(0,c-1):n&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};n.posix=n,e.exports=n},function(e,t,a){!function(e,t){"use strict";function assert(e,t){if(!e)throw new Error(t||"Assertion failed")}function inherits(e,t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype,e.prototype=new TempCtor,e.prototype.constructor=e}function BN(e,t,a){if(BN.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(a=t,t=10),this._init(e||0,t||10,a||"be"))}var r;"object"==typeof e?e.exports=BN:t.BN=BN,BN.BN=BN,BN.wordSize=26;try{r="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:a(1455).Buffer}catch(e){}function parseHex4Bits(e,t){var a=e.charCodeAt(t);return a>=65&&a<=70?a-55:a>=97&&a<=102?a-87:a-48&15}function parseHexByte(e,t,a){var r=parseHex4Bits(e,a);return a-1>=t&&(r|=parseHex4Bits(e,a-1)<<4),r}function parseBase(e,t,a,r){for(var n=0,o=Math.min(e.length,a),c=t;c=49?d-49+10:d>=17?d-17+10:d}return n}BN.isBN=function isBN(e){return e instanceof BN||null!==e&&"object"==typeof e&&e.constructor.wordSize===BN.wordSize&&Array.isArray(e.words)},BN.max=function max(e,t){return e.cmp(t)>0?e:t},BN.min=function min(e,t){return e.cmp(t)<0?e:t},BN.prototype._init=function init(e,t,a){if("number"==typeof e)return this._initNumber(e,t,a);if("object"==typeof e)return this._initArray(e,t,a);"hex"===t&&(t=16),assert(t===(0|t)&&t>=2&&t<=36);var r=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(r++,this.negative=1),r=0;r-=3)o=e[r]|e[r-1]<<8|e[r-2]<<16,this.words[n]|=o<>>26-c&67108863,(c+=24)>=26&&(c-=26,n++);else if("le"===a)for(r=0,n=0;r>>26-c&67108863,(c+=24)>=26&&(c-=26,n++);return this.strip()},BN.prototype._parseHex=function _parseHex(e,t,a){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)n=parseHexByte(e,t,r)<=18?(o-=18,c+=1,this.words[c]|=n>>>26):o+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(o-=18,c+=1,this.words[c]|=n>>>26):o+=8;this.strip()},BN.prototype._parseBase=function _parseBase(e,t,a){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var o=e.length-a,c=o%r,d=Math.min(o,o-c)+a,s=0,b=a;b1&&0===this.words[this.length-1];)this.length--;return this._normSign()},BN.prototype._normSign=function _normSign(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},BN.prototype.inspect=function inspect(){return(this.red?""};var n=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],o=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function smallMulTo(e,t,a){a.negative=t.negative^e.negative;var r=e.length+t.length|0;a.length=r,r=r-1|0;var n=0|e.words[0],o=0|t.words[0],c=n*o,d=67108863&c,s=c/67108864|0;a.words[0]=d;for(var b=1;b>>26,h=67108863&s,l=Math.min(b,t.length-1),g=Math.max(0,b-e.length+1);g<=l;g++){var p=b-g|0;u+=(c=(n=0|e.words[p])*(o=0|t.words[g])+h)/67108864|0,h=67108863&c}a.words[b]=0|h,s=0|u}return 0!==s?a.words[b]=0|s:a.length--,a.strip()}BN.prototype.toString=function toString(e,t){var a;if(t=0|t||1,16===(e=e||10)||"hex"===e){a="";for(var r=0,d=0,s=0;s>>24-r&16777215)||s!==this.length-1?n[6-u.length]+u+a:u+a,(r+=2)>=26&&(r-=26,s--)}for(0!==d&&(a=d.toString(16)+a);a.length%t!=0;)a="0"+a;return 0!==this.negative&&(a="-"+a),a}if(e===(0|e)&&e>=2&&e<=36){var h=o[e],l=c[e];a="";var g=this.clone();for(g.negative=0;!g.isZero();){var p=g.modn(l).toString(e);a=(g=g.idivn(l)).isZero()?p+a:n[h-p.length]+p+a}for(this.isZero()&&(a="0"+a);a.length%t!=0;)a="0"+a;return 0!==this.negative&&(a="-"+a),a}assert(!1,"Base should be between 2 and 36")},BN.prototype.toNumber=function toNumber(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&assert(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},BN.prototype.toJSON=function toJSON(){return this.toString(16)},BN.prototype.toBuffer=function toBuffer(e,t){return assert(void 0!==r),this.toArrayLike(r,e,t)},BN.prototype.toArray=function toArray(e,t){return this.toArrayLike(Array,e,t)},BN.prototype.toArrayLike=function toArrayLike(e,t,a){var r=this.byteLength(),n=a||Math.max(1,r);assert(r<=n,"byte array longer than desired length"),assert(n>0,"Requested array length <= 0"),this.strip();var o,c,d="le"===t,s=new e(n),b=this.clone();if(d){for(c=0;!b.isZero();c++)o=b.andln(255),b.iushrn(8),s[c]=o;for(;c=4096&&(a+=13,t>>>=13),t>=64&&(a+=7,t>>>=7),t>=8&&(a+=4,t>>>=4),t>=2&&(a+=2,t>>>=2),a+t},BN.prototype._zeroBits=function _zeroBits(e){if(0===e)return 26;var t=e,a=0;return 0==(8191&t)&&(a+=13,t>>>=13),0==(127&t)&&(a+=7,t>>>=7),0==(15&t)&&(a+=4,t>>>=4),0==(3&t)&&(a+=2,t>>>=2),0==(1&t)&&a++,a},BN.prototype.bitLength=function bitLength(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},BN.prototype.uor=function uor(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},BN.prototype.iuand=function iuand(e){var t;t=this.length>e.length?e:this;for(var a=0;ae.length?this.clone().iand(e):e.clone().iand(this)},BN.prototype.uand=function uand(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},BN.prototype.iuxor=function iuxor(e){var t,a;this.length>e.length?(t=this,a=e):(t=e,a=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},BN.prototype.uxor=function uxor(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},BN.prototype.inotn=function inotn(e){assert("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),a=e%26;this._expand(t),a>0&&t--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-a),this.strip()},BN.prototype.notn=function notn(e){return this.clone().inotn(e)},BN.prototype.setn=function setn(e,t){assert("number"==typeof e&&e>=0);var a=e/26|0,r=e%26;return this._expand(a+1),this.words[a]=t?this.words[a]|1<e.length?(a=this,r=e):(a=e,r=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=a.length,0!==n)this.words[this.length]=n,this.length++;else if(a!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},BN.prototype.isub=function isub(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var a,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(a=this,r=e):(a=e,r=this);for(var o=0,c=0;c>26,this.words[c]=67108863&t;for(;0!==o&&c>26,this.words[c]=67108863&t;if(0===o&&c>>13,g=0|c[1],p=8191&g,B=g>>>13,x=0|c[2],m=8191&x,I=x>>>13,y=0|c[3],C=8191&y,w=y>>>13,v=0|c[4],Q=8191&v,_=v>>>13,k=0|c[5],N=8191&k,D=k>>>13,G=0|c[6],T=8191&G,L=G>>>13,P=0|c[7],U=8191&P,q=P>>>13,O=0|c[8],H=8191&O,z=O>>>13,j=0|c[9],J=8191&j,Y=j>>>13,W=0|d[0],V=8191&W,X=W>>>13,$=0|d[1],et=8191&$,tt=$>>>13,at=0|d[2],rt=8191&at,it=at>>>13,nt=0|d[3],ot=8191&nt,ct=nt>>>13,dt=0|d[4],st=8191&dt,At=dt>>>13,bt=0|d[5],ut=8191&bt,ht=bt>>>13,pt=0|d[6],Bt=8191&pt,xt=pt>>>13,mt=0|d[7],It=8191&mt,Et=mt>>>13,yt=0|d[8],Ct=8191&yt,wt=yt>>>13,vt=0|d[9],Qt=8191&vt,Mt=vt>>>13;a.negative=e.negative^t.negative,a.length=19;var _t=(b+(r=Math.imul(h,V))|0)+((8191&(n=(n=Math.imul(h,X))+Math.imul(l,V)|0))<<13)|0;b=((o=Math.imul(l,X))+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(p,V),n=(n=Math.imul(p,X))+Math.imul(B,V)|0,o=Math.imul(B,X);var kt=(b+(r=r+Math.imul(h,et)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(l,et)|0))<<13)|0;b=((o=o+Math.imul(l,tt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(m,V),n=(n=Math.imul(m,X))+Math.imul(I,V)|0,o=Math.imul(I,X),r=r+Math.imul(p,et)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(B,et)|0,o=o+Math.imul(B,tt)|0;var St=(b+(r=r+Math.imul(h,rt)|0)|0)+((8191&(n=(n=n+Math.imul(h,it)|0)+Math.imul(l,rt)|0))<<13)|0;b=((o=o+Math.imul(l,it)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(C,V),n=(n=Math.imul(C,X))+Math.imul(w,V)|0,o=Math.imul(w,X),r=r+Math.imul(m,et)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(I,et)|0,o=o+Math.imul(I,tt)|0,r=r+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,it)|0;var Nt=(b+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,ct)|0)+Math.imul(l,ot)|0))<<13)|0;b=((o=o+Math.imul(l,ct)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,r=Math.imul(Q,V),n=(n=Math.imul(Q,X))+Math.imul(_,V)|0,o=Math.imul(_,X),r=r+Math.imul(C,et)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(w,et)|0,o=o+Math.imul(w,tt)|0,r=r+Math.imul(m,rt)|0,n=(n=n+Math.imul(m,it)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,it)|0,r=r+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,ct)|0;var Dt=(b+(r=r+Math.imul(h,st)|0)|0)+((8191&(n=(n=n+Math.imul(h,At)|0)+Math.imul(l,st)|0))<<13)|0;b=((o=o+Math.imul(l,At)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,r=Math.imul(N,V),n=(n=Math.imul(N,X))+Math.imul(D,V)|0,o=Math.imul(D,X),r=r+Math.imul(Q,et)|0,n=(n=n+Math.imul(Q,tt)|0)+Math.imul(_,et)|0,o=o+Math.imul(_,tt)|0,r=r+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(w,rt)|0,o=o+Math.imul(w,it)|0,r=r+Math.imul(m,ot)|0,n=(n=n+Math.imul(m,ct)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,ct)|0,r=r+Math.imul(p,st)|0,n=(n=n+Math.imul(p,At)|0)+Math.imul(B,st)|0,o=o+Math.imul(B,At)|0;var Rt=(b+(r=r+Math.imul(h,ut)|0)|0)+((8191&(n=(n=n+Math.imul(h,ht)|0)+Math.imul(l,ut)|0))<<13)|0;b=((o=o+Math.imul(l,ht)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(T,V),n=(n=Math.imul(T,X))+Math.imul(L,V)|0,o=Math.imul(L,X),r=r+Math.imul(N,et)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(D,et)|0,o=o+Math.imul(D,tt)|0,r=r+Math.imul(Q,rt)|0,n=(n=n+Math.imul(Q,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0,r=r+Math.imul(C,ot)|0,n=(n=n+Math.imul(C,ct)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,ct)|0,r=r+Math.imul(m,st)|0,n=(n=n+Math.imul(m,At)|0)+Math.imul(I,st)|0,o=o+Math.imul(I,At)|0,r=r+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ht)|0;var Ft=(b+(r=r+Math.imul(h,Bt)|0)|0)+((8191&(n=(n=n+Math.imul(h,xt)|0)+Math.imul(l,Bt)|0))<<13)|0;b=((o=o+Math.imul(l,xt)|0)+(n>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,r=Math.imul(U,V),n=(n=Math.imul(U,X))+Math.imul(q,V)|0,o=Math.imul(q,X),r=r+Math.imul(T,et)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(L,et)|0,o=o+Math.imul(L,tt)|0,r=r+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(D,rt)|0,o=o+Math.imul(D,it)|0,r=r+Math.imul(Q,ot)|0,n=(n=n+Math.imul(Q,ct)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,ct)|0,r=r+Math.imul(C,st)|0,n=(n=n+Math.imul(C,At)|0)+Math.imul(w,st)|0,o=o+Math.imul(w,At)|0,r=r+Math.imul(m,ut)|0,n=(n=n+Math.imul(m,ht)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ht)|0,r=r+Math.imul(p,Bt)|0,n=(n=n+Math.imul(p,xt)|0)+Math.imul(B,Bt)|0,o=o+Math.imul(B,xt)|0;var Gt=(b+(r=r+Math.imul(h,It)|0)|0)+((8191&(n=(n=n+Math.imul(h,Et)|0)+Math.imul(l,It)|0))<<13)|0;b=((o=o+Math.imul(l,Et)|0)+(n>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,r=Math.imul(H,V),n=(n=Math.imul(H,X))+Math.imul(z,V)|0,o=Math.imul(z,X),r=r+Math.imul(U,et)|0,n=(n=n+Math.imul(U,tt)|0)+Math.imul(q,et)|0,o=o+Math.imul(q,tt)|0,r=r+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,r=r+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,ct)|0,r=r+Math.imul(Q,st)|0,n=(n=n+Math.imul(Q,At)|0)+Math.imul(_,st)|0,o=o+Math.imul(_,At)|0,r=r+Math.imul(C,ut)|0,n=(n=n+Math.imul(C,ht)|0)+Math.imul(w,ut)|0,o=o+Math.imul(w,ht)|0,r=r+Math.imul(m,Bt)|0,n=(n=n+Math.imul(m,xt)|0)+Math.imul(I,Bt)|0,o=o+Math.imul(I,xt)|0,r=r+Math.imul(p,It)|0,n=(n=n+Math.imul(p,Et)|0)+Math.imul(B,It)|0,o=o+Math.imul(B,Et)|0;var Tt=(b+(r=r+Math.imul(h,Ct)|0)|0)+((8191&(n=(n=n+Math.imul(h,wt)|0)+Math.imul(l,Ct)|0))<<13)|0;b=((o=o+Math.imul(l,wt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(J,V),n=(n=Math.imul(J,X))+Math.imul(Y,V)|0,o=Math.imul(Y,X),r=r+Math.imul(H,et)|0,n=(n=n+Math.imul(H,tt)|0)+Math.imul(z,et)|0,o=o+Math.imul(z,tt)|0,r=r+Math.imul(U,rt)|0,n=(n=n+Math.imul(U,it)|0)+Math.imul(q,rt)|0,o=o+Math.imul(q,it)|0,r=r+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,ct)|0,r=r+Math.imul(N,st)|0,n=(n=n+Math.imul(N,At)|0)+Math.imul(D,st)|0,o=o+Math.imul(D,At)|0,r=r+Math.imul(Q,ut)|0,n=(n=n+Math.imul(Q,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,r=r+Math.imul(C,Bt)|0,n=(n=n+Math.imul(C,xt)|0)+Math.imul(w,Bt)|0,o=o+Math.imul(w,xt)|0,r=r+Math.imul(m,It)|0,n=(n=n+Math.imul(m,Et)|0)+Math.imul(I,It)|0,o=o+Math.imul(I,Et)|0,r=r+Math.imul(p,Ct)|0,n=(n=n+Math.imul(p,wt)|0)+Math.imul(B,Ct)|0,o=o+Math.imul(B,wt)|0;var Lt=(b+(r=r+Math.imul(h,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(h,Mt)|0)+Math.imul(l,Qt)|0))<<13)|0;b=((o=o+Math.imul(l,Mt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,r=Math.imul(J,et),n=(n=Math.imul(J,tt))+Math.imul(Y,et)|0,o=Math.imul(Y,tt),r=r+Math.imul(H,rt)|0,n=(n=n+Math.imul(H,it)|0)+Math.imul(z,rt)|0,o=o+Math.imul(z,it)|0,r=r+Math.imul(U,ot)|0,n=(n=n+Math.imul(U,ct)|0)+Math.imul(q,ot)|0,o=o+Math.imul(q,ct)|0,r=r+Math.imul(T,st)|0,n=(n=n+Math.imul(T,At)|0)+Math.imul(L,st)|0,o=o+Math.imul(L,At)|0,r=r+Math.imul(N,ut)|0,n=(n=n+Math.imul(N,ht)|0)+Math.imul(D,ut)|0,o=o+Math.imul(D,ht)|0,r=r+Math.imul(Q,Bt)|0,n=(n=n+Math.imul(Q,xt)|0)+Math.imul(_,Bt)|0,o=o+Math.imul(_,xt)|0,r=r+Math.imul(C,It)|0,n=(n=n+Math.imul(C,Et)|0)+Math.imul(w,It)|0,o=o+Math.imul(w,Et)|0,r=r+Math.imul(m,Ct)|0,n=(n=n+Math.imul(m,wt)|0)+Math.imul(I,Ct)|0,o=o+Math.imul(I,wt)|0;var Pt=(b+(r=r+Math.imul(p,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(p,Mt)|0)+Math.imul(B,Qt)|0))<<13)|0;b=((o=o+Math.imul(B,Mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,r=Math.imul(J,rt),n=(n=Math.imul(J,it))+Math.imul(Y,rt)|0,o=Math.imul(Y,it),r=r+Math.imul(H,ot)|0,n=(n=n+Math.imul(H,ct)|0)+Math.imul(z,ot)|0,o=o+Math.imul(z,ct)|0,r=r+Math.imul(U,st)|0,n=(n=n+Math.imul(U,At)|0)+Math.imul(q,st)|0,o=o+Math.imul(q,At)|0,r=r+Math.imul(T,ut)|0,n=(n=n+Math.imul(T,ht)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ht)|0,r=r+Math.imul(N,Bt)|0,n=(n=n+Math.imul(N,xt)|0)+Math.imul(D,Bt)|0,o=o+Math.imul(D,xt)|0,r=r+Math.imul(Q,It)|0,n=(n=n+Math.imul(Q,Et)|0)+Math.imul(_,It)|0,o=o+Math.imul(_,Et)|0,r=r+Math.imul(C,Ct)|0,n=(n=n+Math.imul(C,wt)|0)+Math.imul(w,Ct)|0,o=o+Math.imul(w,wt)|0;var Ut=(b+(r=r+Math.imul(m,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(m,Mt)|0)+Math.imul(I,Qt)|0))<<13)|0;b=((o=o+Math.imul(I,Mt)|0)+(n>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,r=Math.imul(J,ot),n=(n=Math.imul(J,ct))+Math.imul(Y,ot)|0,o=Math.imul(Y,ct),r=r+Math.imul(H,st)|0,n=(n=n+Math.imul(H,At)|0)+Math.imul(z,st)|0,o=o+Math.imul(z,At)|0,r=r+Math.imul(U,ut)|0,n=(n=n+Math.imul(U,ht)|0)+Math.imul(q,ut)|0,o=o+Math.imul(q,ht)|0,r=r+Math.imul(T,Bt)|0,n=(n=n+Math.imul(T,xt)|0)+Math.imul(L,Bt)|0,o=o+Math.imul(L,xt)|0,r=r+Math.imul(N,It)|0,n=(n=n+Math.imul(N,Et)|0)+Math.imul(D,It)|0,o=o+Math.imul(D,Et)|0,r=r+Math.imul(Q,Ct)|0,n=(n=n+Math.imul(Q,wt)|0)+Math.imul(_,Ct)|0,o=o+Math.imul(_,wt)|0;var qt=(b+(r=r+Math.imul(C,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(C,Mt)|0)+Math.imul(w,Qt)|0))<<13)|0;b=((o=o+Math.imul(w,Mt)|0)+(n>>>13)|0)+(qt>>>26)|0,qt&=67108863,r=Math.imul(J,st),n=(n=Math.imul(J,At))+Math.imul(Y,st)|0,o=Math.imul(Y,At),r=r+Math.imul(H,ut)|0,n=(n=n+Math.imul(H,ht)|0)+Math.imul(z,ut)|0,o=o+Math.imul(z,ht)|0,r=r+Math.imul(U,Bt)|0,n=(n=n+Math.imul(U,xt)|0)+Math.imul(q,Bt)|0,o=o+Math.imul(q,xt)|0,r=r+Math.imul(T,It)|0,n=(n=n+Math.imul(T,Et)|0)+Math.imul(L,It)|0,o=o+Math.imul(L,Et)|0,r=r+Math.imul(N,Ct)|0,n=(n=n+Math.imul(N,wt)|0)+Math.imul(D,Ct)|0,o=o+Math.imul(D,wt)|0;var Ot=(b+(r=r+Math.imul(Q,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(Q,Mt)|0)+Math.imul(_,Qt)|0))<<13)|0;b=((o=o+Math.imul(_,Mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(J,ut),n=(n=Math.imul(J,ht))+Math.imul(Y,ut)|0,o=Math.imul(Y,ht),r=r+Math.imul(H,Bt)|0,n=(n=n+Math.imul(H,xt)|0)+Math.imul(z,Bt)|0,o=o+Math.imul(z,xt)|0,r=r+Math.imul(U,It)|0,n=(n=n+Math.imul(U,Et)|0)+Math.imul(q,It)|0,o=o+Math.imul(q,Et)|0,r=r+Math.imul(T,Ct)|0,n=(n=n+Math.imul(T,wt)|0)+Math.imul(L,Ct)|0,o=o+Math.imul(L,wt)|0;var Ht=(b+(r=r+Math.imul(N,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(N,Mt)|0)+Math.imul(D,Qt)|0))<<13)|0;b=((o=o+Math.imul(D,Mt)|0)+(n>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,r=Math.imul(J,Bt),n=(n=Math.imul(J,xt))+Math.imul(Y,Bt)|0,o=Math.imul(Y,xt),r=r+Math.imul(H,It)|0,n=(n=n+Math.imul(H,Et)|0)+Math.imul(z,It)|0,o=o+Math.imul(z,Et)|0,r=r+Math.imul(U,Ct)|0,n=(n=n+Math.imul(U,wt)|0)+Math.imul(q,Ct)|0,o=o+Math.imul(q,wt)|0;var zt=(b+(r=r+Math.imul(T,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(T,Mt)|0)+Math.imul(L,Qt)|0))<<13)|0;b=((o=o+Math.imul(L,Mt)|0)+(n>>>13)|0)+(zt>>>26)|0,zt&=67108863,r=Math.imul(J,It),n=(n=Math.imul(J,Et))+Math.imul(Y,It)|0,o=Math.imul(Y,Et),r=r+Math.imul(H,Ct)|0,n=(n=n+Math.imul(H,wt)|0)+Math.imul(z,Ct)|0,o=o+Math.imul(z,wt)|0;var Kt=(b+(r=r+Math.imul(U,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(U,Mt)|0)+Math.imul(q,Qt)|0))<<13)|0;b=((o=o+Math.imul(q,Mt)|0)+(n>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,r=Math.imul(J,Ct),n=(n=Math.imul(J,wt))+Math.imul(Y,Ct)|0,o=Math.imul(Y,wt);var jt=(b+(r=r+Math.imul(H,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(H,Mt)|0)+Math.imul(z,Qt)|0))<<13)|0;b=((o=o+Math.imul(z,Mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Jt=(b+(r=Math.imul(J,Qt))|0)+((8191&(n=(n=Math.imul(J,Mt))+Math.imul(Y,Qt)|0))<<13)|0;return b=((o=Math.imul(Y,Mt))+(n>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,s[0]=_t,s[1]=kt,s[2]=St,s[3]=Nt,s[4]=Dt,s[5]=Rt,s[6]=Ft,s[7]=Gt,s[8]=Tt,s[9]=Lt,s[10]=Pt,s[11]=Ut,s[12]=qt,s[13]=Ot,s[14]=Ht,s[15]=zt,s[16]=Kt,s[17]=jt,s[18]=Jt,0!==b&&(s[19]=b,a.length++),a};function jumboMulTo(e,t,a){return(new FFTM).mulp(e,t,a)}function FFTM(e,t){this.x=e,this.y=t}Math.imul||(d=smallMulTo),BN.prototype.mulTo=function mulTo(e,t){var a,r=this.length+e.length;return a=10===this.length&&10===e.length?d(this,e,t):r<63?smallMulTo(this,e,t):r<1024?function bigMulTo(e,t,a){a.negative=t.negative^e.negative,a.length=e.length+t.length;for(var r=0,n=0,o=0;o>>26)|0)>>>26,c&=67108863}a.words[o]=d,r=c,c=n}return 0!==r?a.words[o]=r:a.length--,a.strip()}(this,e,t):jumboMulTo(this,e,t),a},FFTM.prototype.makeRBT=function makeRBT(e){for(var t=new Array(e),a=BN.prototype._countBits(e)-1,r=0;r>=1;return r},FFTM.prototype.permute=function permute(e,t,a,r,n,o){for(var c=0;c>>=1)n++;return 1<>>=13,a[2*o+1]=8191&n,n>>>=13;for(o=2*t;o>=26,t+=r/67108864|0,t+=n>>>26,this.words[a]=67108863&n}return 0!==t&&(this.words[a]=t,this.length++),this},BN.prototype.muln=function muln(e){return this.clone().imuln(e)},BN.prototype.sqr=function sqr(){return this.mul(this)},BN.prototype.isqr=function isqr(){return this.imul(this.clone())},BN.prototype.pow=function pow(e){var t=function toBitArray(e){for(var t=new Array(e.bitLength()),a=0;a>>n}return t}(e);if(0===t.length)return new BN(1);for(var a=this,r=0;r=0);var t,a=e%26,r=(e-a)/26,n=67108863>>>26-a<<26-a;if(0!==a){var o=0;for(t=0;t>>26-a}o&&(this.words[t]=o,this.length++)}if(0!==r){for(t=this.length-1;t>=0;t--)this.words[t+r]=this.words[t];for(t=0;t=0),r=t?(t-t%26)/26:0;var n=e%26,o=Math.min((e-n)/26,this.length),c=67108863^67108863>>>n<o)for(this.length-=o,s=0;s=0&&(0!==b||s>=r);s--){var u=0|this.words[s];this.words[s]=b<<26-n|u>>>n,b=u&c}return d&&0!==b&&(d.words[d.length++]=b),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},BN.prototype.ishrn=function ishrn(e,t,a){return assert(0===this.negative),this.iushrn(e,t,a)},BN.prototype.shln=function shln(e){return this.clone().ishln(e)},BN.prototype.ushln=function ushln(e){return this.clone().iushln(e)},BN.prototype.shrn=function shrn(e){return this.clone().ishrn(e)},BN.prototype.ushrn=function ushrn(e){return this.clone().iushrn(e)},BN.prototype.testn=function testn(e){assert("number"==typeof e&&e>=0);var t=e%26,a=(e-t)/26,r=1<=0);var t=e%26,a=(e-t)/26;if(assert(0===this.negative,"imaskn works only with positive numbers"),this.length<=a)return this;if(0!==t&&a++,this.length=Math.min(a,this.length),0!==t){var r=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},BN.prototype.isubn=function isubn(e){if(assert("number"==typeof e),assert(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(d/67108864|0),this.words[r+a]=67108863&n}for(;r>26,this.words[r+a]=67108863&n;if(0===c)return this.strip();for(assert(-1===c),c=0,r=0;r>26,this.words[r]=67108863&n;return this.negative=1,this.strip()},BN.prototype._wordDiv=function _wordDiv(e,t){var a=(this.length,e.length),r=this.clone(),n=e,o=0|n.words[n.length-1];0!==(a=26-this._countBits(o))&&(n=n.ushln(a),r.iushln(a),o=0|n.words[n.length-1]);var c,d=r.length-n.length;if("mod"!==t){(c=new BN(null)).length=d+1,c.words=new Array(c.length);for(var s=0;s=0;u--){var h=67108864*(0|r.words[n.length+u])+(0|r.words[n.length+u-1]);for(h=Math.min(h/o|0,67108863),r._ishlnsubmul(n,h,u);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(n,1,u),r.isZero()||(r.negative^=1);c&&(c.words[u]=h)}return c&&c.strip(),r.strip(),"div"!==t&&0!==a&&r.iushrn(a),{div:c||null,mod:r}},BN.prototype.divmod=function divmod(e,t,a){return assert(!e.isZero()),this.isZero()?{div:new BN(0),mod:new BN(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(r=o.div.neg()),"div"!==t&&(n=o.mod.neg(),a&&0!==n.negative&&n.iadd(e)),{div:r,mod:n}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(r=o.div.neg()),{div:r,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(n=o.mod.neg(),a&&0!==n.negative&&n.isub(e)),{div:o.div,mod:n}):e.length>this.length||this.cmp(e)<0?{div:new BN(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new BN(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new BN(this.modn(e.words[0]))}:this._wordDiv(e,t);var r,n,o},BN.prototype.div=function div(e){return this.divmod(e,"div",!1).div},BN.prototype.mod=function mod(e){return this.divmod(e,"mod",!1).mod},BN.prototype.umod=function umod(e){return this.divmod(e,"mod",!0).mod},BN.prototype.divRound=function divRound(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var a=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),o=a.cmp(r);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},BN.prototype.modn=function modn(e){assert(e<=67108863);for(var t=(1<<26)%e,a=0,r=this.length-1;r>=0;r--)a=(t*a+(0|this.words[r]))%e;return a},BN.prototype.idivn=function idivn(e){assert(e<=67108863);for(var t=0,a=this.length-1;a>=0;a--){var r=(0|this.words[a])+67108864*t;this.words[a]=r/e|0,t=r%e}return this.strip()},BN.prototype.divn=function divn(e){return this.clone().idivn(e)},BN.prototype.egcd=function egcd(e){assert(0===e.negative),assert(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r=new BN(1),n=new BN(0),o=new BN(0),c=new BN(1),d=0;t.isEven()&&a.isEven();)t.iushrn(1),a.iushrn(1),++d;for(var s=a.clone(),b=t.clone();!t.isZero();){for(var u=0,h=1;0==(t.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(t.iushrn(u);u-- >0;)(r.isOdd()||n.isOdd())&&(r.iadd(s),n.isub(b)),r.iushrn(1),n.iushrn(1);for(var l=0,g=1;0==(a.words[0]&g)&&l<26;++l,g<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(o.isOdd()||c.isOdd())&&(o.iadd(s),c.isub(b)),o.iushrn(1),c.iushrn(1);t.cmp(a)>=0?(t.isub(a),r.isub(o),n.isub(c)):(a.isub(t),o.isub(r),c.isub(n))}return{a:o,b:c,gcd:a.iushln(d)}},BN.prototype._invmp=function _invmp(e){assert(0===e.negative),assert(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r,n=new BN(1),o=new BN(0),c=a.clone();t.cmpn(1)>0&&a.cmpn(1)>0;){for(var d=0,s=1;0==(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0)for(t.iushrn(d);d-- >0;)n.isOdd()&&n.iadd(c),n.iushrn(1);for(var b=0,u=1;0==(a.words[0]&u)&&b<26;++b,u<<=1);if(b>0)for(a.iushrn(b);b-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);t.cmp(a)>=0?(t.isub(a),n.isub(o)):(a.isub(t),o.isub(n))}return(r=0===t.cmpn(1)?n:o).cmpn(0)<0&&r.iadd(e),r},BN.prototype.gcd=function gcd(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),a=e.clone();t.negative=0,a.negative=0;for(var r=0;t.isEven()&&a.isEven();r++)t.iushrn(1),a.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;a.isEven();)a.iushrn(1);var n=t.cmp(a);if(n<0){var o=t;t=a,a=o}else if(0===n||0===a.cmpn(1))break;t.isub(a)}return a.iushln(r)},BN.prototype.invm=function invm(e){return this.egcd(e).a.umod(e)},BN.prototype.isEven=function isEven(){return 0==(1&this.words[0])},BN.prototype.isOdd=function isOdd(){return 1==(1&this.words[0])},BN.prototype.andln=function andln(e){return this.words[0]&e},BN.prototype.bincn=function bincn(e){assert("number"==typeof e);var t=e%26,a=(e-t)/26,r=1<>>26,c&=67108863,this.words[o]=c}return 0!==n&&(this.words[o]=n,this.length++),this},BN.prototype.isZero=function isZero(){return 1===this.length&&0===this.words[0]},BN.prototype.cmpn=function cmpn(e){var t,a=e<0;if(0!==this.negative&&!a)return-1;if(0===this.negative&&a)return 1;if(this.strip(),this.length>1)t=1;else{a&&(e=-e),assert(e<=67108863,"Number is too big");var r=0|this.words[0];t=r===e?0:re.length)return 1;if(this.length=0;a--){var r=0|this.words[a],n=0|e.words[a];if(r!==n){rn&&(t=1);break}}return t},BN.prototype.gtn=function gtn(e){return 1===this.cmpn(e)},BN.prototype.gt=function gt(e){return 1===this.cmp(e)},BN.prototype.gten=function gten(e){return this.cmpn(e)>=0},BN.prototype.gte=function gte(e){return this.cmp(e)>=0},BN.prototype.ltn=function ltn(e){return-1===this.cmpn(e)},BN.prototype.lt=function lt(e){return-1===this.cmp(e)},BN.prototype.lten=function lten(e){return this.cmpn(e)<=0},BN.prototype.lte=function lte(e){return this.cmp(e)<=0},BN.prototype.eqn=function eqn(e){return 0===this.cmpn(e)},BN.prototype.eq=function eq(e){return 0===this.cmp(e)},BN.red=function red(e){return new Red(e)},BN.prototype.toRed=function toRed(e){return assert(!this.red,"Already a number in reduction context"),assert(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},BN.prototype.fromRed=function fromRed(){return assert(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},BN.prototype._forceRed=function _forceRed(e){return this.red=e,this},BN.prototype.forceRed=function forceRed(e){return assert(!this.red,"Already a number in reduction context"),this._forceRed(e)},BN.prototype.redAdd=function redAdd(e){return assert(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},BN.prototype.redIAdd=function redIAdd(e){return assert(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},BN.prototype.redSub=function redSub(e){return assert(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},BN.prototype.redISub=function redISub(e){return assert(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},BN.prototype.redShl=function redShl(e){return assert(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},BN.prototype.redMul=function redMul(e){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},BN.prototype.redIMul=function redIMul(e){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},BN.prototype.redSqr=function redSqr(){return assert(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},BN.prototype.redISqr=function redISqr(){return assert(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},BN.prototype.redSqrt=function redSqrt(){return assert(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},BN.prototype.redInvm=function redInvm(){return assert(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},BN.prototype.redNeg=function redNeg(){return assert(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},BN.prototype.redPow=function redPow(e){return assert(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var s={k256:null,p224:null,p192:null,p25519:null};function MPrime(e,t){this.name=e,this.p=new BN(t,16),this.n=this.p.bitLength(),this.k=new BN(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function Red(e){if("string"==typeof e){var t=BN._prime(e);this.m=t.p,this.prime=t}else assert(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function Mont(e){Red.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new BN(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}MPrime.prototype._tmp=function _tmp(){var e=new BN(null);return e.words=new Array(Math.ceil(this.n/13)),e},MPrime.prototype.ireduce=function ireduce(e){var t,a=e;do{this.split(a,this.tmp),t=(a=(a=this.imulK(a)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?a.isub(this.p):void 0!==a.strip?a.strip():a._strip(),a},MPrime.prototype.split=function split(e,t){e.iushrn(this.n,0,t)},MPrime.prototype.imulK=function imulK(e){return e.imul(this.k)},inherits(K256,MPrime),K256.prototype.split=function split(e,t){for(var a=4194303,r=Math.min(e.length,9),n=0;n>>22,o=c}o>>>=22,e.words[n-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},K256.prototype.imulK=function imulK(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,a=0;a>>=26,e.words[a]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},BN._prime=function prime(e){if(s[e])return s[e];var prime;if("k256"===e)prime=new K256;else if("p224"===e)prime=new P224;else if("p192"===e)prime=new P192;else{if("p25519"!==e)throw new Error("Unknown prime "+e);prime=new P25519}return s[e]=prime,prime},Red.prototype._verify1=function _verify1(e){assert(0===e.negative,"red works only with positives"),assert(e.red,"red works only with red numbers")},Red.prototype._verify2=function _verify2(e,t){assert(0==(e.negative|t.negative),"red works only with positives"),assert(e.red&&e.red===t.red,"red works only with red numbers")},Red.prototype.imod=function imod(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},Red.prototype.neg=function neg(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},Red.prototype.add=function add(e,t){this._verify2(e,t);var a=e.add(t);return a.cmp(this.m)>=0&&a.isub(this.m),a._forceRed(this)},Red.prototype.iadd=function iadd(e,t){this._verify2(e,t);var a=e.iadd(t);return a.cmp(this.m)>=0&&a.isub(this.m),a},Red.prototype.sub=function sub(e,t){this._verify2(e,t);var a=e.sub(t);return a.cmpn(0)<0&&a.iadd(this.m),a._forceRed(this)},Red.prototype.isub=function isub(e,t){this._verify2(e,t);var a=e.isub(t);return a.cmpn(0)<0&&a.iadd(this.m),a},Red.prototype.shl=function shl(e,t){return this._verify1(e),this.imod(e.ushln(t))},Red.prototype.imul=function imul(e,t){return this._verify2(e,t),this.imod(e.imul(t))},Red.prototype.mul=function mul(e,t){return this._verify2(e,t),this.imod(e.mul(t))},Red.prototype.isqr=function isqr(e){return this.imul(e,e.clone())},Red.prototype.sqr=function sqr(e){return this.mul(e,e)},Red.prototype.sqrt=function sqrt(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(assert(t%2==1),3===t){var a=this.m.add(new BN(1)).iushrn(2);return this.pow(e,a)}for(var r=this.m.subn(1),n=0;!r.isZero()&&0===r.andln(1);)n++,r.iushrn(1);assert(!r.isZero());var o=new BN(1).toRed(this),c=o.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new BN(2*s*s).toRed(this);0!==this.pow(s,d).cmp(c);)s.redIAdd(c);for(var b=this.pow(s,r),u=this.pow(e,r.addn(1).iushrn(1)),h=this.pow(e,r),l=n;0!==h.cmp(o);){for(var g=h,p=0;0!==g.cmp(o);p++)g=g.redSqr();assert(p=0;r--){for(var s=t.words[r],b=d-1;b>=0;b--){var u=s>>b&1;n!==a[0]&&(n=this.sqr(n)),0!==u||0!==o?(o<<=1,o|=u,(4===++c||0===r&&0===b)&&(n=this.mul(n,a[o]),c=0,o=0)):c=0}d=26}return n},Red.prototype.convertTo=function convertTo(e){var t=e.umod(this.m);return t===e?t.clone():t},Red.prototype.convertFrom=function convertFrom(e){var t=e.clone();return t.red=null,t},BN.mont=function mont(e){return new Mont(e)},inherits(Mont,Red),Mont.prototype.convertTo=function convertTo(e){return this.imod(e.ushln(this.shift))},Mont.prototype.convertFrom=function convertFrom(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},Mont.prototype.imul=function imul(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var a=e.imul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},Mont.prototype.mul=function mul(e,t){if(e.isZero()||t.isZero())return new BN(0)._forceRed(this);var a=e.mul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},Mont.prototype.invm=function invm(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=a.nmd(e),this)},e=>{function assert(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=assert,assert.equal=function assertEqual(e,t,a){if(e!=t)throw new Error(a||"Assertion failed: "+e+" != "+t)}},e=>{function assert(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=assert,assert.equal=function assertEqual(e,t,a){if(e!=t)throw new Error(a||"Assertion failed: "+e+" != "+t)}},e=>{function assert(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=assert,assert.equal=function assertEqual(e,t,a){if(e!=t)throw new Error(a||"Assertion failed: "+e+" != "+t)}},e=>{function assert(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=assert,assert.equal=function assertEqual(e,t,a){if(e!=t)throw new Error(a||"Assertion failed: "+e+" != "+t)}},e=>{function assert(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=assert,assert.equal=function assertEqual(e,t,a){if(e!=t)throw new Error(a||"Assertion failed: "+e+" != "+t)}},(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WalkController=t.BaseTrie=t.SecureTrie=t.CheckpointTrie=void 0;var r=a(329);Object.defineProperty(t,"CheckpointTrie",{enumerable:!0,get:function(){return r.CheckpointTrie}});var n=a(623);Object.defineProperty(t,"SecureTrie",{enumerable:!0,get:function(){return n.SecureTrie}});var o=a(202);Object.defineProperty(t,"BaseTrie",{enumerable:!0,get:function(){return o.Trie}});var c=a(338);Object.defineProperty(t,"WalkController",{enumerable:!0,get:function(){return c.WalkController}})},e=>{function assert(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=assert,assert.equal=function assertEqual(e,t,a){if(e!=t)throw new Error(a||"Assertion failed: "+e+" != "+t)}},(e,t,a)=>{var r=a(73),n=String,o=TypeError;e.exports=function(e){if(r(e))return e;throw o(n(e)+" is not an object")}},(e,t,a)=>{var r=a(184),n=Function.prototype.call;e.exports=r?n.bind(n):function(){return n.apply(n,arguments)}},(e,t,a)=>{"use strict";var r=a(314);e.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},function(e,t,a){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a);var n=Object.getOwnPropertyDescriptor(t,a);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,r,n)}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),n=this&&this.__exportStar||function(e,t){for(var a in e)"default"===a||Object.prototype.hasOwnProperty.call(t,a)||r(t,e,a)};Object.defineProperty(t,"__esModule",{value:!0}),n(a(1660),t),n(a(1661),t),n(a(1662),t),n(a(675),t),n(a(1663),t)},(e,t,a)=>{var r=a(3),n=Object.getOwnPropertyDescriptors||function getOwnPropertyDescriptors(e){for(var t=Object.keys(e),a={},r=0;r=n)return e;switch(e){case"%s":return String(r[a++]);case"%d":return Number(r[a++]);case"%j":try{return JSON.stringify(r[a++])}catch(e){return"[Circular]"}default:return e}})),d=r[a];a=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),isBoolean(a)?r.showHidden=a:a&&t._extend(r,a),isUndefined(r.showHidden)&&(r.showHidden=!1),isUndefined(r.depth)&&(r.depth=2),isUndefined(r.colors)&&(r.colors=!1),isUndefined(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=stylizeWithColor),formatValue(r,e,r.depth)}function stylizeWithColor(e,t){var a=inspect.styles[t];return a?"\x1b["+inspect.colors[a][0]+"m"+e+"\x1b["+inspect.colors[a][1]+"m":e}function stylizeNoColor(e,t){return e}function formatValue(e,a,r){if(e.customInspect&&a&&isFunction(a.inspect)&&a.inspect!==t.inspect&&(!a.constructor||a.constructor.prototype!==a)){var n=a.inspect(r,e);return isString(n)||(n=formatValue(e,n,r)),n}var o=function formatPrimitive(e,t){if(isUndefined(t))return e.stylize("undefined","undefined");if(isString(t)){var a="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(a,"string")}if(isNumber(t))return e.stylize(""+t,"number");if(isBoolean(t))return e.stylize(""+t,"boolean");if(isNull(t))return e.stylize("null","null")}(e,a);if(o)return o;var c=Object.keys(a),d=function arrayToHash(e){var t={};return e.forEach((function(e,a){t[e]=!0})),t}(c);if(e.showHidden&&(c=Object.getOwnPropertyNames(a)),isError(a)&&(c.indexOf("message")>=0||c.indexOf("description")>=0))return formatError(a);if(0===c.length){if(isFunction(a)){var s=a.name?": "+a.name:"";return e.stylize("[Function"+s+"]","special")}if(isRegExp(a))return e.stylize(RegExp.prototype.toString.call(a),"regexp");if(isDate(a))return e.stylize(Date.prototype.toString.call(a),"date");if(isError(a))return formatError(a)}var b,u="",h=!1,l=["{","}"];(isArray(a)&&(h=!0,l=["[","]"]),isFunction(a))&&(u=" [Function"+(a.name?": "+a.name:"")+"]");return isRegExp(a)&&(u=" "+RegExp.prototype.toString.call(a)),isDate(a)&&(u=" "+Date.prototype.toUTCString.call(a)),isError(a)&&(u=" "+formatError(a)),0!==c.length||h&&0!=a.length?r<0?isRegExp(a)?e.stylize(RegExp.prototype.toString.call(a),"regexp"):e.stylize("[Object]","special"):(e.seen.push(a),b=h?function formatArray(e,t,a,r,n){for(var o=[],c=0,d=t.length;c=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return a[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+a[1];return a[0]+t+" "+e.join(", ")+" "+a[1]}(b,u,l)):l[0]+u+l[1]}function formatError(e){return"["+Error.prototype.toString.call(e)+"]"}function formatProperty(e,t,a,r,n,o){var c,d,s;if((s=Object.getOwnPropertyDescriptor(t,n)||{value:t[n]}).get?d=s.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):s.set&&(d=e.stylize("[Setter]","special")),hasOwnProperty(r,n)||(c="["+n+"]"),d||(e.seen.indexOf(s.value)<0?(d=isNull(a)?formatValue(e,s.value,null):formatValue(e,s.value,a-1)).indexOf("\n")>-1&&(d=o?d.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+d.split("\n").map((function(e){return" "+e})).join("\n")):d=e.stylize("[Circular]","special")),isUndefined(c)){if(o&&n.match(/^\d+$/))return d;(c=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(c=c.substr(1,c.length-2),c=e.stylize(c,"name")):(c=c.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),c=e.stylize(c,"string"))}return c+": "+d}function isArray(e){return Array.isArray(e)}function isBoolean(e){return"boolean"==typeof e}function isNull(e){return null===e}function isNumber(e){return"number"==typeof e}function isString(e){return"string"==typeof e}function isUndefined(e){return void 0===e}function isRegExp(e){return isObject(e)&&"[object RegExp]"===objectToString(e)}function isObject(e){return"object"==typeof e&&null!==e}function isDate(e){return isObject(e)&&"[object Date]"===objectToString(e)}function isError(e){return isObject(e)&&("[object Error]"===objectToString(e)||e instanceof Error)}function isFunction(e){return"function"==typeof e}function objectToString(e){return Object.prototype.toString.call(e)}function pad(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!c[e])if(d.test(e)){var a=r.pid;c[e]=function(){var r=t.format.apply(t,arguments);console.error("%s %d: %s",e,a,r)}}else c[e]=function(){};return c[e]},t.inspect=inspect,inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=a(917),t.isArray=isArray,t.isBoolean=isBoolean,t.isNull=isNull,t.isNullOrUndefined=function isNullOrUndefined(e){return null==e},t.isNumber=isNumber,t.isString=isString,t.isSymbol=function isSymbol(e){return"symbol"==typeof e},t.isUndefined=isUndefined,t.isRegExp=isRegExp,t.types.isRegExp=isRegExp,t.isObject=isObject,t.isDate=isDate,t.types.isDate=isDate,t.isError=isError,t.types.isNativeError=isError,t.isFunction=isFunction,t.isPrimitive=function isPrimitive(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=a(924);var b=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var e=new Date,t=[pad(e.getHours()),pad(e.getMinutes()),pad(e.getSeconds())].join(":");return[e.getDate(),b[e.getMonth()],t].join(" ")}function hasOwnProperty(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",timestamp(),t.format.apply(t,arguments))},t.inherits=a(6),t._extend=function(e,t){if(!t||!isObject(t))return e;for(var a=Object.keys(t),r=a.length;r--;)e[a[r]]=t[a[r]];return e};var u="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function callbackifyOnRejected(e,t){if(!e){var a=new Error("Promise was rejected with a falsy value");a.reason=e,e=a}return t(e)}t.promisify=function promisify(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(u&&e[u]){var t;if("function"!=typeof(t=e[u]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,u,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,a,r=new Promise((function(e,r){t=e,a=r})),n=[],o=0;o{(t=e.exports=a(479)).Stream=t,t.Readable=t,t.Writable=a(482),t.Duplex=a(154),t.Transform=a(483),t.PassThrough=a(1087),t.finished=a(270),t.pipeline=a(1088)},(e,t,a)=>{"use strict";var r=a(3),n=65536,o=4294967295;var c=a(7).Buffer,d=a.g.crypto||a.g.msCrypto;d&&d.getRandomValues?e.exports=function randomBytes(e,t){if(e>o)throw new RangeError("requested too many random bytes");var a=c.allocUnsafe(e);if(e>0)if(e>n)for(var s=0;s{var r=a(7).Buffer;function Hash(e,t){this._block=r.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Hash.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=r.from(e,t));for(var a=this._block,n=this._blockSize,o=e.length,c=this._len,d=0;d=this._finalSize&&(this._update(this._block),this._block.fill(0));var a=8*this._len;if(a<=4294967295)this._block.writeUInt32BE(a,this._blockSize-4);else{var r=(4294967295&a)>>>0,n=(a-r)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},Hash.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=Hash},(e,t,a)=>{"use strict";var r=a(20);const n=new WeakMap,o=new WeakMap,c=new WeakMap,d=Symbol("anyProducer"),s=Promise.resolve(),b=Symbol("listenerAdded"),u=Symbol("listenerRemoved");let h=!1;function assertEventName(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new TypeError("eventName must be a string or a symbol")}function assertListener(e){if("function"!=typeof e)throw new TypeError("listener must be a function")}function getListeners(e,t){const a=o.get(e);return a.has(t)||a.set(t,new Set),a.get(t)}function getEventProducers(e,t){const a="string"==typeof t||"symbol"==typeof t?t:d,r=c.get(e);return r.has(a)||r.set(a,new Set),r.get(a)}function iterator(e,t){t=Array.isArray(t)?t:[t];let a=!1,flush=()=>{},r=[];const n={enqueue(e){r.push(e),flush()},finish(){a=!0,flush()}};for(const a of t)getEventProducers(e,a).add(n);return{async next(){return r?0===r.length?a?(r=void 0,this.next()):(await new Promise((e=>{flush=e})),this.next()):{done:!1,value:await r.shift()}:{done:!0}},async return(a){r=void 0;for(const a of t)getEventProducers(e,a).delete(n);return flush(),arguments.length>0?{done:!0,value:await a}:{done:!0}},[Symbol.asyncIterator](){return this}}}function defaultMethodNamesOrAssert(e){if(void 0===e)return l;if(!Array.isArray(e))throw new TypeError("`methodNames` must be an array of strings");for(const t of e)if(!l.includes(t)){if("string"!=typeof t)throw new TypeError("`methodNames` element must be a string");throw new Error(`${t} is not Emittery method`)}return e}const isListenerSymbol=e=>e===b||e===u;class Emittery{static mixin(e,t){return t=defaultMethodNamesOrAssert(t),a=>{if("function"!=typeof a)throw new TypeError("`target` must be function");for(const e of t)if(void 0!==a.prototype[e])throw new Error(`The property \`${e}\` already exists on \`target\``);Object.defineProperty(a.prototype,e,{enumerable:!1,get:function getEmitteryProperty(){return Object.defineProperty(this,e,{enumerable:!1,value:new Emittery}),this[e]}});const emitteryMethodCaller=t=>function(...a){return this[e][t](...a)};for(const e of t)Object.defineProperty(a.prototype,e,{enumerable:!1,value:emitteryMethodCaller(e)});return a}}static get isDebugEnabled(){if("object"!=typeof r)return h;const{env:e}=r||{env:{}};return"emittery"===e.DEBUG||"*"===e.DEBUG||h}static set isDebugEnabled(e){h=e}constructor(e={}){n.set(this,new Set),o.set(this,new Map),c.set(this,new Map),this.debug=e.debug||{},void 0===this.debug.enabled&&(this.debug.enabled=!1),this.debug.logger||(this.debug.logger=(e,t,a,r)=>{r=JSON.stringify(r),"symbol"==typeof a&&(a=a.toString());const n=new Date,o=`${n.getHours()}:${n.getMinutes()}:${n.getSeconds()}.${n.getMilliseconds()}`;console.log(`[${o}][emittery:${e}][${t}] Event Name: ${a}\n\tdata: ${r}`)})}logIfDebugEnabled(e,t,a){(Emittery.isDebugEnabled||this.debug.enabled)&&this.debug.logger(e,this.debug.name,t,a)}on(e,t){assertListener(t),e=Array.isArray(e)?e:[e];for(const a of e)assertEventName(a),getListeners(this,a).add(t),this.logIfDebugEnabled("subscribe",a,void 0),isListenerSymbol(a)||this.emit(b,{eventName:a,listener:t});return this.off.bind(this,e,t)}off(e,t){assertListener(t),e=Array.isArray(e)?e:[e];for(const a of e)assertEventName(a),getListeners(this,a).delete(t),this.logIfDebugEnabled("unsubscribe",a,void 0),isListenerSymbol(a)||this.emit(u,{eventName:a,listener:t})}once(e){return new Promise((t=>{const a=this.on(e,(e=>{a(),t(e)}))}))}events(e){e=Array.isArray(e)?e:[e];for(const t of e)assertEventName(t);return iterator(this,e)}async emit(e,t){assertEventName(e),this.logIfDebugEnabled("emit",e,t),function enqueueProducers(e,t,a){const r=c.get(e);if(r.has(t))for(const e of r.get(t))e.enqueue(a);if(r.has(d)){const e=Promise.all([t,a]);for(const t of r.get(d))t.enqueue(e)}}(this,e,t);const a=getListeners(this,e),r=n.get(this),o=[...a],b=isListenerSymbol(e)?[]:[...r];await s,await Promise.all([...o.map((async e=>{if(a.has(e))return e(t)})),...b.map((async a=>{if(r.has(a))return a(e,t)}))])}async emitSerial(e,t){assertEventName(e),this.logIfDebugEnabled("emitSerial",e,t);const a=getListeners(this,e),r=n.get(this),o=[...a],c=[...r];await s;for(const e of o)a.has(e)&&await e(t);for(const a of c)r.has(a)&&await a(e,t)}onAny(e){return assertListener(e),this.logIfDebugEnabled("subscribeAny",void 0,void 0),n.get(this).add(e),this.emit(b,{listener:e}),this.offAny.bind(this,e)}anyEvent(){return iterator(this)}offAny(e){assertListener(e),this.logIfDebugEnabled("unsubscribeAny",void 0,void 0),this.emit(u,{listener:e}),n.get(this).delete(e)}clearListeners(e){e=Array.isArray(e)?e:[e];for(const t of e)if(this.logIfDebugEnabled("clear",t,void 0),"string"==typeof t||"symbol"==typeof t){getListeners(this,t).clear();const e=getEventProducers(this,t);for(const t of e)t.finish();e.clear()}else{n.get(this).clear();for(const e of o.get(this).values())e.clear();for(const e of c.get(this).values()){for(const t of e)t.finish();e.clear()}}}listenerCount(e){e=Array.isArray(e)?e:[e];let t=0;for(const a of e)if("string"!=typeof a){void 0!==a&&assertEventName(a),t+=n.get(this).size;for(const e of o.get(this).values())t+=e.size;for(const e of c.get(this).values())t+=e.size}else t+=n.get(this).size+getListeners(this,a).size+getEventProducers(this,a).size+getEventProducers(this).size;return t}bindMethods(e,t){if("object"!=typeof e||null===e)throw new TypeError("`target` must be an object");t=defaultMethodNamesOrAssert(t);for(const a of t){if(void 0!==e[a])throw new Error(`The property \`${a}\` already exists on \`target\``);Object.defineProperty(e,a,{enumerable:!1,value:this[a].bind(this)})}}}const l=Object.getOwnPropertyNames(Emittery.prototype).filter((e=>"constructor"!==e));Object.defineProperty(Emittery,"listenerAdded",{value:b,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(Emittery,"listenerRemoved",{value:u,writable:!1,enumerable:!0,configurable:!1}),e.exports=Emittery},(e,t,a)=>{var r=a(34).Buffer;function Hash(e,t){this._block=r.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Hash.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=r.from(e,t));for(var a=this._block,n=this._blockSize,o=e.length,c=this._len,d=0;d=this._finalSize&&(this._update(this._block),this._block.fill(0));var a=8*this._len;if(a<=4294967295)this._block.writeUInt32BE(a,this._blockSize-4);else{var r=(4294967295&a)>>>0,n=(a-r)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},Hash.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=Hash},(e,t,a)=>{var r=a(35).Buffer;function Hash(e,t){this._block=r.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Hash.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=r.from(e,t));for(var a=this._block,n=this._blockSize,o=e.length,c=this._len,d=0;d=this._finalSize&&(this._update(this._block),this._block.fill(0));var a=8*this._len;if(a<=4294967295)this._block.writeUInt32BE(a,this._blockSize-4);else{var r=(4294967295&a)>>>0,n=(a-r)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},Hash.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=Hash},(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.N_DIV_2=t.isAccessList=t.isAccessListBuffer=t.Capability=void 0;var r=a(47);function isAccessListBuffer(e){if(0===e.length)return!0;var t=e[0];return!!Array.isArray(t)}!function(e){e[e.EIP155ReplayProtection=155]="EIP155ReplayProtection",e[e.EIP1559FeeMarket=1559]="EIP1559FeeMarket",e[e.EIP2718TypedTransaction=2718]="EIP2718TypedTransaction",e[e.EIP2930AccessLists=2930]="EIP2930AccessLists"}(t.Capability||(t.Capability={})),t.isAccessListBuffer=isAccessListBuffer,t.isAccessList=function isAccessList(e){return!isAccessListBuffer(e)},t.N_DIV_2=new r.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16)},(e,t,a)=>{var r=a(36).Buffer;function Hash(e,t){this._block=r.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Hash.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=r.from(e,t));for(var a=this._block,n=this._blockSize,o=e.length,c=this._len,d=0;d=this._finalSize&&(this._update(this._block),this._block.fill(0));var a=8*this._len;if(a<=4294967295)this._block.writeUInt32BE(a,this._blockSize-4);else{var r=(4294967295&a)>>>0,n=(a-r)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},Hash.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=Hash},(e,t,a)=>{var r=a(23).Buffer;function Hash(e,t){this._block=r.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Hash.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=r.from(e,t));for(var a=this._block,n=this._blockSize,o=e.length,c=this._len,d=0;d=this._finalSize&&(this._update(this._block),this._block.fill(0));var a=8*this._len;if(a<=4294967295)this._block.writeUInt32BE(a,this._blockSize-4);else{var r=(4294967295&a)>>>0,n=(a-r)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},Hash.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=Hash},e=>{e.exports=function extend(){for(var e={},a=0;a{var r=a(37).Buffer;function Hash(e,t){this._block=r.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Hash.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=r.from(e,t));for(var a=this._block,n=this._blockSize,o=e.length,c=this._len,d=0;d=this._finalSize&&(this._update(this._block),this._block.fill(0));var a=8*this._len;if(a<=4294967295)this._block.writeUInt32BE(a,this._blockSize-4);else{var r=(4294967295&a)>>>0,n=(a-r)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},Hash.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=Hash},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalize=void 0;t.normalize=e=>e},(e,t,a)=>{var r=a(30).Buffer;function Hash(e,t){this._block=r.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Hash.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=r.from(e,t));for(var a=this._block,n=this._blockSize,o=e.length,c=this._len,d=0;d=this._finalSize&&(this._update(this._block),this._block.fill(0));var a=8*this._len;if(a<=4294967295)this._block.writeUInt32BE(a,this._blockSize-4);else{var r=(4294967295&a)>>>0,n=(a-r)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},Hash.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=Hash},(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.N_DIV_2=t.isAccessList=t.isAccessListBuffer=t.Capability=void 0;var r=a(1);function isAccessListBuffer(e){if(0===e.length)return!0;var t=e[0];return!!Array.isArray(t)}!function(e){e[e.EIP155ReplayProtection=155]="EIP155ReplayProtection",e[e.EIP1559FeeMarket=1559]="EIP1559FeeMarket",e[e.EIP2718TypedTransaction=2718]="EIP2718TypedTransaction",e[e.EIP2930AccessLists=2930]="EIP2930AccessLists"}(t.Capability||(t.Capability={})),t.isAccessListBuffer=isAccessListBuffer,t.isAccessList=function isAccessList(e){return!isAccessListBuffer(e)},t.N_DIV_2=new r.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16)},(e,t,a)=>{var r=a(558),n=a(292);e.exports=function(e){return r(n(e))}},(e,t,a)=>{var r=a(50),n=a(76),o=a(187);e.exports=r?function(e,t,a){return n.f(e,t,o(1,a))}:function(e,t,a){return e[t]=a,e}},(e,t,a)=>{var r=a(0).Buffer;const n=a(790),o=n.cwrap("ec_add","string",["string"]),c=n.cwrap("ec_mul","string",["string"]),d=n.cwrap("ec_pairing","string",["string"]);e.exports={add:function bn128add(e){return r.from(o(e.toString("hex")),"hex")},mul:function bn128mul(e){return r.from(c(e.toString("hex")),"hex")},pairing:function bn128pairing(e){return r.from(d(e.toString("hex")),"hex")}}},e=>{"use strict";e.exports=function IsPropertyKey(e){return"string"==typeof e||"symbol"==typeof e}},(e,t,a)=>{"use strict";var r=a(8).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.baToJSON=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.stripZeros=t.unpad=t.setLengthRight=t.setLength=t.setLengthLeft=t.zeros=void 0;var n=a(126),o=a(86);t.zeros=function(e){return r.allocUnsafe(e).fill(0)},t.setLengthLeft=function(e,a,r){void 0===r&&(r=!1);var n=t.zeros(a);return e=t.toBuffer(e),r?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e},t.stripZeros=t.unpad,t.toBuffer=function(e){if(!r.isBuffer(e))if(Array.isArray(e))e=r.from(e);else if("string"==typeof e){if(!n.isHexString(e))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+e);e=r.from(n.padToEven(n.stripHexPrefix(e)),"hex")}else if("number"==typeof e)e=n.intToBuffer(e);else if(null==e)e=r.allocUnsafe(0);else if(o.isBN(e))e=e.toArrayLike(r);else{if(!e.toArray)throw new Error("invalid type");e=r.from(e.toArray())}return e},t.bufferToInt=function(e){return new o(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new o(e).fromTwos(256)},t.toUnsigned=function(e){return r.from(e.toTwos(256).toArray())},t.addHexPrefix=function(e){return"string"!=typeof e||n.isHexPrefixed(e)?e:"0x"+e},t.baToJSON=function(e){if(r.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var a=[],n=0;n{"use strict";var r=a(3),n=Object.keys||function(e){var t=[];for(var a in e)t.push(a);return t};e.exports=Duplex;var o=a(229),c=a(230);a(6)(Duplex,o);for(var d=n(c.prototype),s=0;s{"function"==typeof Object.create?e.exports=function inherits(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function inherits(e,t){if(t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype,e.prototype=new TempCtor,e.prototype.constructor=e}}},(e,t,a)=>{"use strict";var r=a(314),n=a(11),o=n("%Function.prototype.apply%"),c=n("%Function.prototype.call%"),d=n("%Reflect.apply%",!0)||r.call(c,o),s=n("%Object.getOwnPropertyDescriptor%",!0),b=n("%Object.defineProperty%",!0),u=n("%Math.max%");if(b)try{b({},"a",{value:1})}catch(e){b=null}e.exports=function callBind(e){var t=d(r,c,arguments);if(s&&b){var a=s(t,"length");a.configurable&&b(t,"length",{value:1+u(0,e.length-(arguments.length-1))})}return t};var h=function applyBind(){return d(r,o,arguments)};b?b(e.exports,"apply",{value:h}):e.exports.apply=h},e=>{"use strict";var t={};function createErrorType(e,a,r){r||(r=Error);var n=function(e){function NodeError(t,r,n){return e.call(this,function getMessage(e,t,r){return"string"==typeof a?a:a(e,t,r)}(t,r,n))||this}return function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(NodeError,e),NodeError}(r);n.prototype.name=r.name,n.prototype.code=e,t[e]=n}function oneOf(e,t){if(Array.isArray(e)){var a=e.length;return e=e.map((function(e){return String(e)})),a>2?"one of ".concat(t," ").concat(e.slice(0,a-1).join(", "),", or ")+e[a-1]:2===a?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}createErrorType("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),createErrorType("ERR_INVALID_ARG_TYPE",(function(e,t,a){var r,n;if("string"==typeof t&&function startsWith(e,t,a){return e.substr(!a||a<0?0:+a,t.length)===t}(t,"not ")?(r="must not be",t=t.replace(/^not /,"")):r="must be",function endsWith(e,t,a){return(void 0===a||a>e.length)&&(a=e.length),e.substring(a-t.length,a)===t}(e," argument"))n="The ".concat(e," ").concat(r," ").concat(oneOf(t,"type"));else{var o=function includes(e,t,a){return"number"!=typeof a&&(a=0),!(a+t.length>e.length)&&-1!==e.indexOf(t,a)}(e,".")?"property":"argument";n='The "'.concat(e,'" ').concat(o," ").concat(r," ").concat(oneOf(t,"type"))}return n+=". Received type ".concat(typeof a)}),TypeError),createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),createErrorType("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close"),createErrorType("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end"),createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),createErrorType("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.a=t},(e,t,a)=>{var r=a(2).Buffer;e.exports=function xor(e,t){for(var a=Math.min(e.length,t.length),n=new r(a),o=0;o{"use strict";var t={};function createErrorType(e,a,r){r||(r=Error);var n=function(e){function NodeError(t,r,n){return e.call(this,function getMessage(e,t,r){return"string"==typeof a?a:a(e,t,r)}(t,r,n))||this}return function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(NodeError,e),NodeError}(r);n.prototype.name=r.name,n.prototype.code=e,t[e]=n}function oneOf(e,t){if(Array.isArray(e)){var a=e.length;return e=e.map((function(e){return String(e)})),a>2?"one of ".concat(t," ").concat(e.slice(0,a-1).join(", "),", or ")+e[a-1]:2===a?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}createErrorType("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),createErrorType("ERR_INVALID_ARG_TYPE",(function(e,t,a){var r,n;if("string"==typeof t&&function startsWith(e,t,a){return e.substr(!a||a<0?0:+a,t.length)===t}(t,"not ")?(r="must not be",t=t.replace(/^not /,"")):r="must be",function endsWith(e,t,a){return(void 0===a||a>e.length)&&(a=e.length),e.substring(a-t.length,a)===t}(e," argument"))n="The ".concat(e," ").concat(r," ").concat(oneOf(t,"type"));else{var o=function includes(e,t,a){return"number"!=typeof a&&(a=0),!(a+t.length>e.length)&&-1!==e.indexOf(t,a)}(e,".")?"property":"argument";n='The "'.concat(e,'" ').concat(o," ").concat(r," ").concat(oneOf(t,"type"))}return n+=". Received type ".concat(typeof a)}),TypeError),createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),createErrorType("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close"),createErrorType("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end"),createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),createErrorType("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.a=t},(e,t,a)=>{"use strict";var r=a(6),n=a(232),o=a(233),c=a(234),d=a(75);function Hash(e){d.call(this,"digest"),this._hash=e}r(Hash,d),Hash.prototype._update=function(e){this._hash.update(e)},Hash.prototype._final=function(){return this._hash.digest()},e.exports=function createHash(e){return"md5"===(e=e.toLowerCase())?new n:"rmd160"===e||"ripemd160"===e?new o:new Hash(c(e))}},(e,t,a)=>{"use strict";var r=a(8).Buffer,n=a(414),o=a(915);function padToEven(e){var t=e;if("string"!=typeof t)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof t+", while padToEven.");return t.length%2&&(t="0"+t),t}function intToHex(e){return"0x"+e.toString(16)}e.exports={arrayContainsArray:function arrayContainsArray(e,t,a){if(!0!==Array.isArray(e))throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof e+"'");if(!0!==Array.isArray(t))throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof t+"'");return t[Boolean(a)?"some":"every"]((function(t){return e.indexOf(t)>=0}))},intToBuffer:function intToBuffer(e){var t=intToHex(e);return new r(padToEven(t.slice(2)),"hex")},getBinarySize:function getBinarySize(e){if("string"!=typeof e)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof e+"'.");return r.byteLength(e,"utf8")},isHexPrefixed:n,stripHexPrefix:o,padToEven,intToHex,fromAscii:function fromAscii(e){for(var t="",a=0;a{"use strict";var t={};function createErrorType(e,a,r){r||(r=Error);var n=function(e){function NodeError(t,r,n){return e.call(this,function getMessage(e,t,r){return"string"==typeof a?a:a(e,t,r)}(t,r,n))||this}return function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(NodeError,e),NodeError}(r);n.prototype.name=r.name,n.prototype.code=e,t[e]=n}function oneOf(e,t){if(Array.isArray(e)){var a=e.length;return e=e.map((function(e){return String(e)})),a>2?"one of ".concat(t," ").concat(e.slice(0,a-1).join(", "),", or ")+e[a-1]:2===a?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}createErrorType("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),createErrorType("ERR_INVALID_ARG_TYPE",(function(e,t,a){var r,n;if("string"==typeof t&&function startsWith(e,t,a){return e.substr(!a||a<0?0:+a,t.length)===t}(t,"not ")?(r="must not be",t=t.replace(/^not /,"")):r="must be",function endsWith(e,t,a){return(void 0===a||a>e.length)&&(a=e.length),e.substring(a-t.length,a)===t}(e," argument"))n="The ".concat(e," ").concat(r," ").concat(oneOf(t,"type"));else{var o=function includes(e,t,a){return"number"!=typeof a&&(a=0),!(a+t.length>e.length)&&-1!==e.indexOf(t,a)}(e,".")?"property":"argument";n='The "'.concat(e,'" ').concat(o," ").concat(r," ").concat(oneOf(t,"type"))}return n+=". Received type ".concat(typeof a)}),TypeError),createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),createErrorType("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close"),createErrorType("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end"),createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),createErrorType("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.a=t},(e,t,a)=>{"use strict";var r=a(8).Buffer;function isHexPrefixed(e){if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type ".concat(typeof e));return"0"===e[0]&&"x"===e[1]}Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,t.isHexPrefixed=isHexPrefixed;function padToEven(e){var t=e;if("string"!=typeof t)throw new Error("[padToEven] value must be type 'string', received ".concat(typeof t));return t.length%2&&(t="0".concat(t)),t}t.stripHexPrefix=function(e){if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received ".concat(typeof e));return isHexPrefixed(e)?e.slice(2):e},t.padToEven=padToEven,t.getBinarySize=function getBinarySize(e){if("string"!=typeof e)throw new Error("[getBinarySize] method requires input type 'string', recieved ".concat(typeof e));return r.byteLength(e,"utf8")},t.arrayContainsArray=function arrayContainsArray(e,t,a){if(!0!==Array.isArray(e))throw new Error("[arrayContainsArray] method requires input 'superset' to be an array, got type '".concat(typeof e,"'"));if(!0!==Array.isArray(t))throw new Error("[arrayContainsArray] method requires input 'subset' to be an array, got type '".concat(typeof t,"'"));return t[a?"some":"every"]((function(t){return e.indexOf(t)>=0}))},t.toAscii=function toAscii(e){var t="",a=0,r=e.length;for("0x"===e.substring(0,2)&&(a=2);a{"use strict";var r=a(10).Buffer;function isHexPrefixed(e){if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type ".concat(typeof e));return"0"===e[0]&&"x"===e[1]}Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,t.isHexPrefixed=isHexPrefixed;function padToEven(e){var t=e;if("string"!=typeof t)throw new Error("[padToEven] value must be type 'string', received ".concat(typeof t));return t.length%2&&(t="0".concat(t)),t}t.stripHexPrefix=function(e){if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received ".concat(typeof e));return isHexPrefixed(e)?e.slice(2):e},t.padToEven=padToEven,t.getBinarySize=function getBinarySize(e){if("string"!=typeof e)throw new Error("[getBinarySize] method requires input type 'string', recieved ".concat(typeof e));return r.byteLength(e,"utf8")},t.arrayContainsArray=function arrayContainsArray(e,t,a){if(!0!==Array.isArray(e))throw new Error("[arrayContainsArray] method requires input 'superset' to be an array, got type '".concat(typeof e,"'"));if(!0!==Array.isArray(t))throw new Error("[arrayContainsArray] method requires input 'subset' to be an array, got type '".concat(typeof t,"'"));return t[a?"some":"every"]((function(t){return e.indexOf(t)>=0}))},t.toAscii=function toAscii(e){var t="",a=0,r=e.length;for("0x"===e.substring(0,2)&&(a=2);a{"use strict";var t={};function createErrorType(e,a,r){r||(r=Error);var n=function(e){function NodeError(t,r,n){return e.call(this,function getMessage(e,t,r){return"string"==typeof a?a:a(e,t,r)}(t,r,n))||this}return function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(NodeError,e),NodeError}(r);n.prototype.name=r.name,n.prototype.code=e,t[e]=n}function oneOf(e,t){if(Array.isArray(e)){var a=e.length;return e=e.map((function(e){return String(e)})),a>2?"one of ".concat(t," ").concat(e.slice(0,a-1).join(", "),", or ")+e[a-1]:2===a?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}createErrorType("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),createErrorType("ERR_INVALID_ARG_TYPE",(function(e,t,a){var r,n;if("string"==typeof t&&function startsWith(e,t,a){return e.substr(!a||a<0?0:+a,t.length)===t}(t,"not ")?(r="must not be",t=t.replace(/^not /,"")):r="must be",function endsWith(e,t,a){return(void 0===a||a>e.length)&&(a=e.length),e.substring(a-t.length,a)===t}(e," argument"))n="The ".concat(e," ").concat(r," ").concat(oneOf(t,"type"));else{var o=function includes(e,t,a){return"number"!=typeof a&&(a=0),!(a+t.length>e.length)&&-1!==e.indexOf(t,a)}(e,".")?"property":"argument";n='The "'.concat(e,'" ').concat(o," ").concat(r," ").concat(oneOf(t,"type"))}return n+=". Received type ".concat(typeof a)}),TypeError),createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),createErrorType("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close"),createErrorType("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end"),createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),createErrorType("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.a=t},(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SECP256K1_MAX_PRIVATE_KEY_DIV_2=exports.SECP256K1_N=void 0;const path_1=__webpack_require__(85);let secp256k1;exports.SECP256K1_N=0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n,exports.SECP256K1_MAX_PRIVATE_KEY_DIV_2=0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0n;try{const nodeRequire=eval("require"),path=nodeRequire.resolve("secp256k1/package.json"),dir=(0,path_1.dirname)(path),nodeGypBuild=__webpack_require__(999),{Secp256k1}=nodeGypBuild(dir);secp256k1=new Secp256k1}catch{secp256k1=__webpack_require__(1e3)}exports.default=secp256k1},(e,t,a)=>{"use strict";var r=a(2).Buffer;function isHexPrefixed(e){if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type ".concat(typeof e));return"0"===e[0]&&"x"===e[1]}Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,t.isHexPrefixed=isHexPrefixed;function padToEven(e){var t=e;if("string"!=typeof t)throw new Error("[padToEven] value must be type 'string', received ".concat(typeof t));return t.length%2&&(t="0".concat(t)),t}t.stripHexPrefix=function(e){if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received ".concat(typeof e));return isHexPrefixed(e)?e.slice(2):e},t.padToEven=padToEven,t.getBinarySize=function getBinarySize(e){if("string"!=typeof e)throw new Error("[getBinarySize] method requires input type 'string', recieved ".concat(typeof e));return r.byteLength(e,"utf8")},t.arrayContainsArray=function arrayContainsArray(e,t,a){if(!0!==Array.isArray(e))throw new Error("[arrayContainsArray] method requires input 'superset' to be an array, got type '".concat(typeof e,"'"));if(!0!==Array.isArray(t))throw new Error("[arrayContainsArray] method requires input 'subset' to be an array, got type '".concat(typeof t,"'"));return t[a?"some":"every"]((function(t){return e.indexOf(t)>=0}))},t.toAscii=function toAscii(e){var t="",a=0,r=e.length;for("0x"===e.substring(0,2)&&(a=2);a{"use strict";var t={};function createErrorType(e,a,r){r||(r=Error);var n=function(e){function NodeError(t,r,n){return e.call(this,function getMessage(e,t,r){return"string"==typeof a?a:a(e,t,r)}(t,r,n))||this}return function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(NodeError,e),NodeError}(r);n.prototype.name=r.name,n.prototype.code=e,t[e]=n}function oneOf(e,t){if(Array.isArray(e)){var a=e.length;return e=e.map((function(e){return String(e)})),a>2?"one of ".concat(t," ").concat(e.slice(0,a-1).join(", "),", or ")+e[a-1]:2===a?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}createErrorType("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),createErrorType("ERR_INVALID_ARG_TYPE",(function(e,t,a){var r,n;if("string"==typeof t&&function startsWith(e,t,a){return e.substr(!a||a<0?0:+a,t.length)===t}(t,"not ")?(r="must not be",t=t.replace(/^not /,"")):r="must be",function endsWith(e,t,a){return(void 0===a||a>e.length)&&(a=e.length),e.substring(a-t.length,a)===t}(e," argument"))n="The ".concat(e," ").concat(r," ").concat(oneOf(t,"type"));else{var o=function includes(e,t,a){return"number"!=typeof a&&(a=0),!(a+t.length>e.length)&&-1!==e.indexOf(t,a)}(e,".")?"property":"argument";n='The "'.concat(e,'" ').concat(o," ").concat(r," ").concat(oneOf(t,"type"))}return n+=". Received type ".concat(typeof a)}),TypeError),createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),createErrorType("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close"),createErrorType("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end"),createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),createErrorType("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.a=t},(e,t,a)=>{"use strict";var r=a(0).Buffer;function isHexPrefixed(e){if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type ".concat(typeof e));return"0"===e[0]&&"x"===e[1]}Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,t.isHexPrefixed=isHexPrefixed;function padToEven(e){var t=e;if("string"!=typeof t)throw new Error("[padToEven] value must be type 'string', received ".concat(typeof t));return t.length%2&&(t="0".concat(t)),t}t.stripHexPrefix=function(e){if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received ".concat(typeof e));return isHexPrefixed(e)?e.slice(2):e},t.padToEven=padToEven,t.getBinarySize=function getBinarySize(e){if("string"!=typeof e)throw new Error("[getBinarySize] method requires input type 'string', recieved ".concat(typeof e));return r.byteLength(e,"utf8")},t.arrayContainsArray=function arrayContainsArray(e,t,a){if(!0!==Array.isArray(e))throw new Error("[arrayContainsArray] method requires input 'superset' to be an array, got type '".concat(typeof e,"'"));if(!0!==Array.isArray(t))throw new Error("[arrayContainsArray] method requires input 'subset' to be an array, got type '".concat(typeof t,"'"));return t[a?"some":"every"]((function(t){return e.indexOf(t)>=0}))},t.toAscii=function toAscii(e){var t="",a=0,r=e.length;for("0x"===e.substring(0,2)&&(a=2);a{"use strict";var t={};function createErrorType(e,a,r){r||(r=Error);var n=function(e){function NodeError(t,r,n){return e.call(this,function getMessage(e,t,r){return"string"==typeof a?a:a(e,t,r)}(t,r,n))||this}return function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(NodeError,e),NodeError}(r);n.prototype.name=r.name,n.prototype.code=e,t[e]=n}function oneOf(e,t){if(Array.isArray(e)){var a=e.length;return e=e.map((function(e){return String(e)})),a>2?"one of ".concat(t," ").concat(e.slice(0,a-1).join(", "),", or ")+e[a-1]:2===a?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}createErrorType("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),createErrorType("ERR_INVALID_ARG_TYPE",(function(e,t,a){var r,n;if("string"==typeof t&&function startsWith(e,t,a){return e.substr(!a||a<0?0:+a,t.length)===t}(t,"not ")?(r="must not be",t=t.replace(/^not /,"")):r="must be",function endsWith(e,t,a){return(void 0===a||a>e.length)&&(a=e.length),e.substring(a-t.length,a)===t}(e," argument"))n="The ".concat(e," ").concat(r," ").concat(oneOf(t,"type"));else{var o=function includes(e,t,a){return"number"!=typeof a&&(a=0),!(a+t.length>e.length)&&-1!==e.indexOf(t,a)}(e,".")?"property":"argument";n='The "'.concat(e,'" ').concat(o," ").concat(r," ").concat(oneOf(t,"type"))}return n+=". Received type ".concat(typeof a)}),TypeError),createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),createErrorType("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close"),createErrorType("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end"),createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),createErrorType("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.a=t},(e,t,a)=>{"use strict";var r=a(2).Buffer;function isHexPrefixed(e){if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type ".concat(typeof e));return"0"===e[0]&&"x"===e[1]}Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,t.isHexPrefixed=isHexPrefixed;function padToEven(e){var t=e;if("string"!=typeof t)throw new Error("[padToEven] value must be type 'string', received ".concat(typeof t));return t.length%2&&(t="0".concat(t)),t}t.stripHexPrefix=function(e){if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received ".concat(typeof e));return isHexPrefixed(e)?e.slice(2):e},t.padToEven=padToEven,t.getBinarySize=function getBinarySize(e){if("string"!=typeof e)throw new Error("[getBinarySize] method requires input type 'string', recieved ".concat(typeof e));return r.byteLength(e,"utf8")},t.arrayContainsArray=function arrayContainsArray(e,t,a){if(!0!==Array.isArray(e))throw new Error("[arrayContainsArray] method requires input 'superset' to be an array, got type '".concat(typeof e,"'"));if(!0!==Array.isArray(t))throw new Error("[arrayContainsArray] method requires input 'subset' to be an array, got type '".concat(typeof t,"'"));return t[a?"some":"every"]((function(t){return e.indexOf(t)>=0}))},t.toAscii=function toAscii(e){var t="",a=0,r=e.length;for("0x"===e.substring(0,2)&&(a=2);a{"use strict";var t={};function createErrorType(e,a,r){r||(r=Error);var n=function(e){function NodeError(t,r,n){return e.call(this,function getMessage(e,t,r){return"string"==typeof a?a:a(e,t,r)}(t,r,n))||this}return function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(NodeError,e),NodeError}(r);n.prototype.name=r.name,n.prototype.code=e,t[e]=n}function oneOf(e,t){if(Array.isArray(e)){var a=e.length;return e=e.map((function(e){return String(e)})),a>2?"one of ".concat(t," ").concat(e.slice(0,a-1).join(", "),", or ")+e[a-1]:2===a?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}createErrorType("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),createErrorType("ERR_INVALID_ARG_TYPE",(function(e,t,a){var r,n;if("string"==typeof t&&function startsWith(e,t,a){return e.substr(!a||a<0?0:+a,t.length)===t}(t,"not ")?(r="must not be",t=t.replace(/^not /,"")):r="must be",function endsWith(e,t,a){return(void 0===a||a>e.length)&&(a=e.length),e.substring(a-t.length,a)===t}(e," argument"))n="The ".concat(e," ").concat(r," ").concat(oneOf(t,"type"));else{var o=function includes(e,t,a){return"number"!=typeof a&&(a=0),!(a+t.length>e.length)&&-1!==e.indexOf(t,a)}(e,".")?"property":"argument";n='The "'.concat(e,'" ').concat(o," ").concat(r," ").concat(oneOf(t,"type"))}return n+=". Received type ".concat(typeof a)}),TypeError),createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),createErrorType("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close"),createErrorType("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end"),createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),createErrorType("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.a=t},e=>{"use strict";var t={};function createErrorType(e,a,r){r||(r=Error);var n=function(e){function NodeError(t,r,n){return e.call(this,function getMessage(e,t,r){return"string"==typeof a?a:a(e,t,r)}(t,r,n))||this}return function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(NodeError,e),NodeError}(r);n.prototype.name=r.name,n.prototype.code=e,t[e]=n}function oneOf(e,t){if(Array.isArray(e)){var a=e.length;return e=e.map((function(e){return String(e)})),a>2?"one of ".concat(t," ").concat(e.slice(0,a-1).join(", "),", or ")+e[a-1]:2===a?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}createErrorType("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),createErrorType("ERR_INVALID_ARG_TYPE",(function(e,t,a){var r,n;if("string"==typeof t&&function startsWith(e,t,a){return e.substr(!a||a<0?0:+a,t.length)===t}(t,"not ")?(r="must not be",t=t.replace(/^not /,"")):r="must be",function endsWith(e,t,a){return(void 0===a||a>e.length)&&(a=e.length),e.substring(a-t.length,a)===t}(e," argument"))n="The ".concat(e," ").concat(r," ").concat(oneOf(t,"type"));else{var o=function includes(e,t,a){return"number"!=typeof a&&(a=0),!(a+t.length>e.length)&&-1!==e.indexOf(t,a)}(e,".")?"property":"argument";n='The "'.concat(e,'" ').concat(o," ").concat(r," ").concat(oneOf(t,"type"))}return n+=". Received type ".concat(typeof a)}),TypeError),createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),createErrorType("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close"),createErrorType("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end"),createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),createErrorType("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.a=t},(e,t,a)=>{var r=a(31),n=r({}.toString),o=r("".slice);e.exports=function(e){return o(n(e),8,-1)}},e=>{e.exports={}},(e,t,a)=>{var r=a(295),n=a(52),o=a(28),aFunction=function(e){return o(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?aFunction(r[e])||aFunction(n[e]):r[e]&&r[e][t]||n[e]&&n[e][t]}},(e,t,a)=>{"use strict";var r=a(0).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.updateSstoreGas=t.writeCallOutput=t.subMemUsage=t.maxCallGas=t.jumpSubIsValid=t.jumpIsValid=t.getFullname=t.getDataSlice=t.short=t.divCeil=t.describeLocation=t.addressToBuffer=t.trap=t.setLengthLeftStorage=void 0;var n=a(1),o=a(22),c=new n.BN(1).shln(160).subn(1);function divCeil(e,t){var a=e.div(t);return e.mod(t).isZero()?a:a.isNeg()?a.isubn(1):a.iaddn(1)}function getDataSlice(e,t,a){var r=new n.BN(e.length);t.gt(r)&&(t=r);var o=t.add(a);return o.gt(r)&&(o=r),e=e.slice(t.toNumber(),o.toNumber()),e=(0,n.setLengthRight)(e,a.toNumber())}t.setLengthLeftStorage=function setLengthLeftStorage(e){return e.equals(r.alloc(e.length,0))?r.alloc(0):(0,n.setLengthLeft)(e,32)},t.trap=function trap(e){throw new o.VmError(e)},t.addressToBuffer=function addressToBuffer(e){return r.isBuffer(e)?e:e.and(c).toArrayLike(r,"be",20)},t.describeLocation=function describeLocation(e){var t=(0,n.keccak256)(e.eei.getCode()).toString("hex"),a=e.eei.getAddress().buf.toString("hex"),r=e.programCounter-1;return"".concat(t,"/").concat(a,":").concat(r)},t.divCeil=divCeil,t.short=function short(e){var t=e.toString("hex");return t.length<=50?t:t.slice(0,50)+"..."},t.getDataSlice=getDataSlice,t.getFullname=function getFullname(e,t){switch(t){case"LOG":t+=e-160;break;case"PUSH":t+=e-95;break;case"DUP":t+=e-127;break;case"SWAP":t+=e-143}return t},t.jumpIsValid=function jumpIsValid(e,t){return 1===e.validJumps[t]},t.jumpSubIsValid=function jumpSubIsValid(e,t){return 2===e.validJumps[t]},t.maxCallGas=function maxCallGas(e,t,a,r){if(r.gteHardfork("tangerineWhistle")){var n=t.sub(t.divn(64));return e.gt(n)?n:e}return e},t.subMemUsage=function subMemUsage(e,t,a,r){if(a.isZero())return new n.BN(0);var o=divCeil(t.add(a),new n.BN(32));if(o.lte(e.memoryWordCount))return new n.BN(0);var c=o,d=new n.BN(r.param("gasPrices","memory")),s=new n.BN(r.param("gasPrices","quadCoeffDiv")),b=c.mul(d).add(c.mul(c).div(s));if(b.gt(e.highestMemCost)){var u=e.highestMemCost;e.highestMemCost=b.clone(),b.isub(u)}return e.memoryWordCount=o,b},t.writeCallOutput=function writeCallOutput(e,t,a){var r=e.eei.getReturnData();if(r.length>0){var o=t.toNumber(),c=a.toNumber();r.length0&&t.length>0)return o=new n.BN(r.param("gasPrices","sstoreReset"));if(0===a.length&&t.length>0){var o=new n.BN(r.param("gasPrices","sstoreReset"));return e.eei.refundGas(new n.BN(r.param("gasPrices","sstoreRefund")),"updateSstoreGas"),o}return new n.BN(r.param("gasPrices","sstoreSet"))}},function(e,t,a){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a);var n=Object.getOwnPropertyDescriptor(t,a);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,r,n)}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),n=this&&this.__exportStar||function(e,t){for(var a in e)"default"===a||Object.prototype.hasOwnProperty.call(t,a)||r(t,e,a)};Object.defineProperty(t,"__esModule",{value:!0}),n(a(956),t),n(a(1020),t),n(a(1572),t),n(a(1061),t)},(e,t,a)=>{var r=a(20),n=Object.getOwnPropertyDescriptors||function getOwnPropertyDescriptors(e){for(var t=Object.keys(e),a={},r=0;r=n)return e;switch(e){case"%s":return String(r[a++]);case"%d":return Number(r[a++]);case"%j":try{return JSON.stringify(r[a++])}catch(e){return"[Circular]"}default:return e}})),d=r[a];a=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),isBoolean(a)?r.showHidden=a:a&&t._extend(r,a),isUndefined(r.showHidden)&&(r.showHidden=!1),isUndefined(r.depth)&&(r.depth=2),isUndefined(r.colors)&&(r.colors=!1),isUndefined(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=stylizeWithColor),formatValue(r,e,r.depth)}function stylizeWithColor(e,t){var a=inspect.styles[t];return a?"\x1b["+inspect.colors[a][0]+"m"+e+"\x1b["+inspect.colors[a][1]+"m":e}function stylizeNoColor(e,t){return e}function formatValue(e,a,r){if(e.customInspect&&a&&isFunction(a.inspect)&&a.inspect!==t.inspect&&(!a.constructor||a.constructor.prototype!==a)){var n=a.inspect(r,e);return isString(n)||(n=formatValue(e,n,r)),n}var o=function formatPrimitive(e,t){if(isUndefined(t))return e.stylize("undefined","undefined");if(isString(t)){var a="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(a,"string")}if(isNumber(t))return e.stylize(""+t,"number");if(isBoolean(t))return e.stylize(""+t,"boolean");if(isNull(t))return e.stylize("null","null")}(e,a);if(o)return o;var c=Object.keys(a),d=function arrayToHash(e){var t={};return e.forEach((function(e,a){t[e]=!0})),t}(c);if(e.showHidden&&(c=Object.getOwnPropertyNames(a)),isError(a)&&(c.indexOf("message")>=0||c.indexOf("description")>=0))return formatError(a);if(0===c.length){if(isFunction(a)){var s=a.name?": "+a.name:"";return e.stylize("[Function"+s+"]","special")}if(isRegExp(a))return e.stylize(RegExp.prototype.toString.call(a),"regexp");if(isDate(a))return e.stylize(Date.prototype.toString.call(a),"date");if(isError(a))return formatError(a)}var b,u="",h=!1,l=["{","}"];(isArray(a)&&(h=!0,l=["[","]"]),isFunction(a))&&(u=" [Function"+(a.name?": "+a.name:"")+"]");return isRegExp(a)&&(u=" "+RegExp.prototype.toString.call(a)),isDate(a)&&(u=" "+Date.prototype.toUTCString.call(a)),isError(a)&&(u=" "+formatError(a)),0!==c.length||h&&0!=a.length?r<0?isRegExp(a)?e.stylize(RegExp.prototype.toString.call(a),"regexp"):e.stylize("[Object]","special"):(e.seen.push(a),b=h?function formatArray(e,t,a,r,n){for(var o=[],c=0,d=t.length;c=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return a[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+a[1];return a[0]+t+" "+e.join(", ")+" "+a[1]}(b,u,l)):l[0]+u+l[1]}function formatError(e){return"["+Error.prototype.toString.call(e)+"]"}function formatProperty(e,t,a,r,n,o){var c,d,s;if((s=Object.getOwnPropertyDescriptor(t,n)||{value:t[n]}).get?d=s.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):s.set&&(d=e.stylize("[Setter]","special")),hasOwnProperty(r,n)||(c="["+n+"]"),d||(e.seen.indexOf(s.value)<0?(d=isNull(a)?formatValue(e,s.value,null):formatValue(e,s.value,a-1)).indexOf("\n")>-1&&(d=o?d.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+d.split("\n").map((function(e){return" "+e})).join("\n")):d=e.stylize("[Circular]","special")),isUndefined(c)){if(o&&n.match(/^\d+$/))return d;(c=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(c=c.substr(1,c.length-2),c=e.stylize(c,"name")):(c=c.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),c=e.stylize(c,"string"))}return c+": "+d}function isArray(e){return Array.isArray(e)}function isBoolean(e){return"boolean"==typeof e}function isNull(e){return null===e}function isNumber(e){return"number"==typeof e}function isString(e){return"string"==typeof e}function isUndefined(e){return void 0===e}function isRegExp(e){return isObject(e)&&"[object RegExp]"===objectToString(e)}function isObject(e){return"object"==typeof e&&null!==e}function isDate(e){return isObject(e)&&"[object Date]"===objectToString(e)}function isError(e){return isObject(e)&&("[object Error]"===objectToString(e)||e instanceof Error)}function isFunction(e){return"function"==typeof e}function objectToString(e){return Object.prototype.toString.call(e)}function pad(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!c[e])if(d.test(e)){var a=r.pid;c[e]=function(){var r=t.format.apply(t,arguments);console.error("%s %d: %s",e,a,r)}}else c[e]=function(){};return c[e]},t.inspect=inspect,inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=a(1107),t.isArray=isArray,t.isBoolean=isBoolean,t.isNull=isNull,t.isNullOrUndefined=function isNullOrUndefined(e){return null==e},t.isNumber=isNumber,t.isString=isString,t.isSymbol=function isSymbol(e){return"symbol"==typeof e},t.isUndefined=isUndefined,t.isRegExp=isRegExp,t.types.isRegExp=isRegExp,t.isObject=isObject,t.isDate=isDate,t.types.isDate=isDate,t.isError=isError,t.types.isNativeError=isError,t.isFunction=isFunction,t.isPrimitive=function isPrimitive(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=a(1114);var b=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var e=new Date,t=[pad(e.getHours()),pad(e.getMinutes()),pad(e.getSeconds())].join(":");return[e.getDate(),b[e.getMonth()],t].join(" ")}function hasOwnProperty(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",timestamp(),t.format.apply(t,arguments))},t.inherits=a(9),t._extend=function(e,t){if(!t||!isObject(t))return e;for(var a=Object.keys(t),r=a.length;r--;)e[a[r]]=t[a[r]];return e};var u="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function callbackifyOnRejected(e,t){if(!e){var a=new Error("Promise was rejected with a falsy value");a.reason=e,e=a}return t(e)}t.promisify=function promisify(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(u&&e[u]){var t;if("function"!=typeof(t=e[u]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,u,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,a,r=new Promise((function(e,r){t=e,a=r})),n=[],o=0;o0&&n[n.length-1])||6!==o[0]&&2!==o[0])){c=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]{"use strict";var r=a(3),n=a(10).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.RuntimeTransaction=t.hasPartialSignature=t.toValidLengthAddress=void 0;const o=a(12),c=a(5),d=a(27),s=a(449),b=a(343),u=a(24);t.toValidLengthAddress=(e,t)=>{const a=c.Data.toBuffer(e);if(a.byteLength!==u.Address.ByteLength)throw new Error(`The field ${t} must have byte length of ${u.Address.ByteLength}`);return u.Address.from(a)};t.hasPartialSignature=e=>null!=e.v||null!=e.r||null!=e.s;const h=c.Quantity.One.toBuffer();class RuntimeTransaction extends s.BaseTransaction{constructor(e,a,n){let o;if(super(a,n),this.locked=!1,this.validateAndSetSignature=e=>{if((0,t.hasPartialSignature)(e)){if(null==e.v||null==e.r||null==e.s)throw new Error("Transaction signature is incomplete; v, r, and s are required.");if(null==e.nonce)throw new Error("Signed transaction is incomplete; nonce is required.");this.v=c.Quantity.from(e.v,!0),this.r=c.Quantity.from(e.r,!0),this.s=c.Quantity.from(e.s,!0);const a=this.toEthRawTransaction(this.v.toBuffer(),this.r.toBuffer(),this.s.toBuffer());if(this.raw=a,!this.from){const{from:r,serialized:n,hash:o,encodedData:c,encodedSignature:d}=this.computeIntrinsics(this.v,a,this.common.chainId());if(null!==e.from){const a=(0,t.toValidLengthAddress)(e.from,"from");if(!r.toBuffer().equals(a.toBuffer()))throw new Error("Transaction is signed and contains a `from` field, but the signature doesn't match.")}this.from=r,this.serialized=n,this.hash=o,this.encodedData=c,this.encodedSignature=d}}else null!=e.from&&(this.from=(0,t.toValidLengthAddress)(e.from,"from"))},this.finalized=new Promise((e=>{o=(...t)=>r.nextTick(e,...t)})),this.finalizer=o,!Array.isArray(e)){this.nonce=c.Quantity.from(e.nonce,!0),this.gas=c.Quantity.from(null==e.gas?e.gasLimit:e.gas),this.to=null==e.to?c.Quantity.Empty:(0,t.toValidLengthAddress)(e.to,"to"),this.value=c.Quantity.from(e.value||0);const a=null==e.data?null==e.input?"0x":e.input:e.data;this.data=c.Data.from(a)}}serializeForDb(e,t,a){const r=[this.raw,[this.from.toBuffer(),this.hash.toBuffer(),e.toBuffer(),t.toBuffer(),a.toBuffer(),this.effectiveGasPrice.toBuffer()]];return(0,d.encode)(r)}fillFromResult(e,t){const a=e.execResult;let r;a.exceptionError?(r=c.BUFFER_ZERO,this.execException=new o.RuntimeError(this.hash,e,o.RETURN_TYPES.TRANSACTION_HASH)):r=h;return(this.receipt=b.InternalTransactionReceipt.fromValues(r,c.Quantity.toBuffer(t),e.bloom.bitvector,this.logs=a.logs||[],e.gasUsed.toArrayLike(n),e.createdAddress?e.createdAddress.buf:null,this.type)).serialize(!1)}getReceipt(){return this.receipt}getLogs(){return this.logs}once(e){return this.finalized}finalize(e,t=null){this.finalizer({status:e,error:t})}}t.RuntimeTransaction=RuntimeTransaction},function(e,t,a){"use strict";var r,n,o=this&&this.__classPrivateFieldSet||function(e,t,a,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,a):n?n.value=a:t.set(e,a),a},c=this&&this.__classPrivateFieldGet||function(e,t,a,r){if("a"===a&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===a?r:"a"===a?r.call(e):r?r.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0});const d=a(5);t.default=class Manager{constructor(e,t,a){r.set(this,void 0),n.set(this,void 0),o(this,r,t,"f"),o(this,n,a,"f"),this.base=e}getRaw(e){return"string"==typeof e&&(e=d.Data.toBuffer(e)),0===e.length&&(e=d.BUFFER_ZERO),this.base.get(e).catch((e=>{if(404===e.status)return null;throw e}))}async get(e){const t=await this.getRaw(e);return t?new(c(this,r,"f"))(t,c(this,n,"f")):null}set(e,t){return this.base.put(e,t)}del(e){return this.base.del(e)}},r=new WeakMap,n=new WeakMap},(e,t,a)=>{"use strict";var r=a(3),n=Object.keys||function(e){var t=[];for(var a in e)t.push(a);return t};e.exports=Duplex;var o=a(369),c=a(372);a(120)(Duplex,o);for(var d=n(c.prototype),s=0;s{(t=e.exports=a(229)).Stream=t,t.Readable=t,t.Writable=a(230),t.Duplex=a(119),t.Transform=a(231),t.PassThrough=a(378),t.finished=a(159),t.pipeline=a(379)},(e,t,a)=>{"use strict";var r=a(3),n=Object.keys||function(e){var t=[];for(var a in e)t.push(a);return t};e.exports=Duplex;var o=a(428),c=a(431);a(15)(Duplex,o);for(var d=n(c.prototype),s=0;s{"use strict";var r=a(3),n=Object.keys||function(e){var t=[];for(var a in e)t.push(a);return t};e.exports=Duplex;var o=a(441),c=a(444);a(16)(Duplex,o);for(var d=n(c.prototype),s=0;s{"use strict";var r=a(3),n=Object.keys||function(e){var t=[];for(var a in e)t.push(a);return t};e.exports=Duplex;var o=a(463),c=a(466);a(17)(Duplex,o);for(var d=n(c.prototype),s=0;s{"use strict";var r=a(20),n=Object.keys||function(e){var t=[];for(var a in e)t.push(a);return t};e.exports=Duplex;var o=a(479),c=a(482);a(9)(Duplex,o);for(var d=n(c.prototype),s=0;s{"use strict";var r=a(3),n=Object.keys||function(e){var t=[];for(var a in e)t.push(a);return t};e.exports=Duplex;var o=a(517),c=a(520);a(18)(Duplex,o);for(var d=n(c.prototype),s=0;s{"use strict";var r=a(3),n=Object.keys||function(e){var t=[];for(var a in e)t.push(a);return t};e.exports=Duplex;var o=a(527),c=a(530);a(26)(Duplex,o);for(var d=n(c.prototype),s=0;s{"function"==typeof Object.create?e.exports=function inherits(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function inherits(e,t){if(t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype,e.prototype=new TempCtor,e.prototype.constructor=e}}},function(e,t,a){"use strict";var r=a(0).Buffer,n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getLength=t.decode=t.encode=void 0;var o=n(a(747));function safeParseInt(e,t){if("0"===e[0]&&"0"===e[1])throw new Error("invalid RLP: extra zeros");return parseInt(e,t)}function encodeLength(e,t){if(e<56)return r.from([e+t]);var a=intToHex(e),n=intToHex(t+55+a.length/2);return r.from(n+a,"hex")}function _decode(e){var t,a,n,o,c,d=[],s=e[0];if(s<=127)return{data:e.slice(0,1),remainder:e.slice(1)};if(s<=183){if(t=s-127,n=128===s?r.from([]):e.slice(1,t),2===t&&n[0]<128)throw new Error("invalid rlp encoding: byte must be less 0x80");return{data:n,remainder:e.slice(t)}}if(s<=191){if(a=s-182,e.length-1e.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(o=e.slice(a,b)).length)throw new Error("invalid rlp, List has a invalid length");for(;o.length;)c=_decode(o),d.push(c.data),o=c.remainder;return{data:d,remainder:e.slice(b)}}function isHexPrefixed(e){return"0x"===e.slice(0,2)}function intToHex(e){if(e<0)throw new Error("Invalid integer as argument, must be unsigned!");var t=e.toString(16);return t.length%2?"0"+t:t}function toBuffer(e){if(!r.isBuffer(e)){if("string"==typeof e)return isHexPrefixed(e)?r.from(function padToEven(e){return e.length%2?"0"+e:e}(function stripHexPrefix(e){return"string"!=typeof e?e:isHexPrefixed(e)?e.slice(2):e}(e)),"hex"):r.from(e);if("number"==typeof e||"bigint"==typeof e)return e?function intToBuffer(e){var t=intToHex(e);return r.from(t,"hex")}(e):r.from([]);if(null==e)return r.from([]);if(e instanceof Uint8Array)return r.from(e);if(o.default.isBN(e))return r.from(e.toArray());throw new Error("invalid type")}return e}t.encode=function encode(e){if(Array.isArray(e)){for(var t=[],a=0;a{"use strict";var r=a(124).a.ERR_STREAM_PREMATURE_CLOSE;function noop(){}e.exports=function eos(e,t,a){if("function"==typeof t)return eos(e,null,t);t||(t={}),a=function once(e){var t=!1;return function(){if(!t){t=!0;for(var a=arguments.length,r=new Array(a),n=0;n{var r=a(7).Buffer,n=a(232);e.exports=function EVP_BytesToKey(e,t,a,o){if(r.isBuffer(e)||(e=r.from(e,"binary")),t&&(r.isBuffer(t)||(t=r.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var c=a/8,d=r.alloc(c),s=r.alloc(o||0),b=r.alloc(0);c>0||o>0;){var u=new n;u.update(b),u.update(e),t&&u.update(t),b=u.digest();var h=0;if(c>0){var l=d.length-c;h=Math.min(c,b.length),b.copy(d,l,0,h),c-=h}if(h0){var g=s.length-o,p=Math.min(o,b.length-h);b.copy(s,g,h,h+p),o-=p}}return b.fill(0),{key:d,iv:s}}},(e,t,a)=>{"use strict";var r=a(60),n=a(39),o=n.getNAF,c=n.getJSF,d=n.assert;function BaseCurve(e,t){this.type=e,this.p=new r(t.p,16),this.red=t.prime?r.red(t.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=t.n&&new r(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var a=this.n&&this.p.div(this.n);!a||a.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function BasePoint(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=BaseCurve,BaseCurve.prototype.point=function point(){throw new Error("Not implemented")},BaseCurve.prototype.validate=function validate(){throw new Error("Not implemented")},BaseCurve.prototype._fixedNafMul=function _fixedNafMul(e,t){d(e.precomputed);var a=e._getDoubles(),r=o(t,1,this._bitLength),n=(1<=c;u--)s=(s<<1)+r[u];b.push(s)}for(var h=this.jpoint(null,null,null),l=this.jpoint(null,null,null),g=n;g>0;g--){for(c=0;c=0;b--){for(var u=0;b>=0&&0===c[b];b--)u++;if(b>=0&&u++,s=s.dblp(u),b<0)break;var h=c[b];d(0!==h),s="affine"===e.type?h>0?s.mixedAdd(n[h-1>>1]):s.mixedAdd(n[-h-1>>1].neg()):h>0?s.add(n[h-1>>1]):s.add(n[-h-1>>1].neg())}return"affine"===e.type?s.toP():s},BaseCurve.prototype._wnafMulAdd=function _wnafMulAdd(e,t,a,r,n){var d,s,b,u=this._wnafT1,h=this._wnafT2,l=this._wnafT3,g=0;for(d=0;d=1;d-=2){var B=d-1,x=d;if(1===u[B]&&1===u[x]){var m=[t[B],null,null,t[x]];0===t[B].y.cmp(t[x].y)?(m[1]=t[B].add(t[x]),m[2]=t[B].toJ().mixedAdd(t[x].neg())):0===t[B].y.cmp(t[x].y.redNeg())?(m[1]=t[B].toJ().mixedAdd(t[x]),m[2]=t[B].add(t[x].neg())):(m[1]=t[B].toJ().mixedAdd(t[x]),m[2]=t[B].toJ().mixedAdd(t[x].neg()));var I=[-3,-1,-5,-7,0,7,5,1,3],y=c(a[B],a[x]);for(g=Math.max(y[0].length,g),l[B]=new Array(g),l[x]=new Array(g),s=0;s=0;d--){for(var _=0;d>=0;){var k=!0;for(s=0;s=0&&_++,v=v.dblp(_),d<0)break;for(s=0;s0?b=h[s][N-1>>1]:N<0&&(b=h[s][-N-1>>1].neg()),v="affine"===b.type?v.mixedAdd(b):v.add(b))}}for(d=0;d=Math.ceil((e.bitLength()+1)/t.step)},BasePoint.prototype._getDoubles=function _getDoubles(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var a=[this],r=this,n=0;n{"use strict";var r=a(66),n=a(38);function BlockHash(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=BlockHash,BlockHash.prototype.update=function update(e,t){if(e=r.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var a=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-a,e.length),0===this.pending.length&&(this.pending=null),e=r.join32(e,0,e.length-a,this.endian);for(var n=0;n>>24&255,r[n++]=e>>>16&255,r[n++]=e>>>8&255,r[n++]=255&e}else for(r[n++]=255&e,r[n++]=e>>>8&255,r[n++]=e>>>16&255,r[n++]=e>>>24&255,r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=0,o=8;o{var r=a(1435),n=a(1437),o=a(887),c=a(226),d=a(857),s=a(7).Buffer;function parseKeys(e){var t;"object"!=typeof e||s.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=s.from(e));var a,b,u=o(e,t),h=u.tag,l=u.data;switch(h){case"CERTIFICATE":b=r.certificate.decode(l,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(b||(b=r.PublicKey.decode(l,"der")),a=b.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return r.RSAPublicKey.decode(b.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return b.subjectPrivateKey=b.subjectPublicKey,{type:"ec",data:b};case"1.2.840.10040.4.1":return b.algorithm.params.pub_key=r.DSAparam.decode(b.subjectPublicKey.data,"der"),{type:"dsa",data:b.algorithm.params};default:throw new Error("unknown key id "+a)}case"ENCRYPTED PRIVATE KEY":l=function decrypt(e,t){var a=e.algorithm.decrypt.kde.kdeparams.salt,r=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),o=n[e.algorithm.decrypt.cipher.algo.join(".")],b=e.algorithm.decrypt.cipher.iv,u=e.subjectPrivateKey,h=parseInt(o.split("-")[1],10)/8,l=d.pbkdf2Sync(t,a,r,h,"sha1"),g=c.createDecipheriv(o,l,b),p=[];return p.push(g.update(u)),p.push(g.final()),s.concat(p)}(l=r.EncryptedPrivateKey.decode(l,"der"),t);case"PRIVATE KEY":switch(a=(b=r.PrivateKey.decode(l,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return r.RSAPrivateKey.decode(b.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:b.algorithm.curve,privateKey:r.ECPrivateKey.decode(b.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return b.algorithm.params.priv_key=r.DSAparam.decode(b.subjectPrivateKey,"der"),{type:"dsa",params:b.algorithm.params};default:throw new Error("unknown key id "+a)}case"RSA PUBLIC KEY":return r.RSAPublicKey.decode(l,"der");case"RSA PRIVATE KEY":return r.RSAPrivateKey.decode(l,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:r.DSAPrivateKey.decode(l,"der")};case"EC PRIVATE KEY":return{curve:(l=r.ECPrivateKey.decode(l,"der")).parameters.value,privateKey:l.privateKey};default:throw new Error("unknown key type "+h)}}e.exports=parseKeys,parseKeys.signature=r.signature},(e,t,a)=>{"use strict";var r=a(61),n=a(40),o=n.getNAF,c=n.getJSF,d=n.assert;function BaseCurve(e,t){this.type=e,this.p=new r(t.p,16),this.red=t.prime?r.red(t.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=t.n&&new r(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var a=this.n&&this.p.div(this.n);!a||a.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function BasePoint(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=BaseCurve,BaseCurve.prototype.point=function point(){throw new Error("Not implemented")},BaseCurve.prototype.validate=function validate(){throw new Error("Not implemented")},BaseCurve.prototype._fixedNafMul=function _fixedNafMul(e,t){d(e.precomputed);var a=e._getDoubles(),r=o(t,1,this._bitLength),n=(1<=c;u--)s=(s<<1)+r[u];b.push(s)}for(var h=this.jpoint(null,null,null),l=this.jpoint(null,null,null),g=n;g>0;g--){for(c=0;c=0;b--){for(var u=0;b>=0&&0===c[b];b--)u++;if(b>=0&&u++,s=s.dblp(u),b<0)break;var h=c[b];d(0!==h),s="affine"===e.type?h>0?s.mixedAdd(n[h-1>>1]):s.mixedAdd(n[-h-1>>1].neg()):h>0?s.add(n[h-1>>1]):s.add(n[-h-1>>1].neg())}return"affine"===e.type?s.toP():s},BaseCurve.prototype._wnafMulAdd=function _wnafMulAdd(e,t,a,r,n){var d,s,b,u=this._wnafT1,h=this._wnafT2,l=this._wnafT3,g=0;for(d=0;d=1;d-=2){var B=d-1,x=d;if(1===u[B]&&1===u[x]){var m=[t[B],null,null,t[x]];0===t[B].y.cmp(t[x].y)?(m[1]=t[B].add(t[x]),m[2]=t[B].toJ().mixedAdd(t[x].neg())):0===t[B].y.cmp(t[x].y.redNeg())?(m[1]=t[B].toJ().mixedAdd(t[x]),m[2]=t[B].add(t[x].neg())):(m[1]=t[B].toJ().mixedAdd(t[x]),m[2]=t[B].toJ().mixedAdd(t[x].neg()));var I=[-3,-1,-5,-7,0,7,5,1,3],y=c(a[B],a[x]);for(g=Math.max(y[0].length,g),l[B]=new Array(g),l[x]=new Array(g),s=0;s=0;d--){for(var _=0;d>=0;){var k=!0;for(s=0;s=0&&_++,v=v.dblp(_),d<0)break;for(s=0;s0?b=h[s][N-1>>1]:N<0&&(b=h[s][-N-1>>1].neg()),v="affine"===b.type?v.mixedAdd(b):v.add(b))}}for(d=0;d=Math.ceil((e.bitLength()+1)/t.step)},BasePoint.prototype._getDoubles=function _getDoubles(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var a=[this],r=this,n=0;n{"use strict";var r=a(67),n=a(87);function BlockHash(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=BlockHash,BlockHash.prototype.update=function update(e,t){if(e=r.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var a=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-a,e.length),0===this.pending.length&&(this.pending=null),e=r.join32(e,0,e.length-a,this.endian);for(var n=0;n>>24&255,r[n++]=e>>>16&255,r[n++]=e>>>8&255,r[n++]=255&e}else for(r[n++]=255&e,r[n++]=e>>>8&255,r[n++]=e>>>16&255,r[n++]=e>>>24&255,r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=0,o=8;o{"use strict";var r=a(415);e.exports=function hasToStringTagShams(){return r()&&!!Symbol.toStringTag}},(e,t,a)=>{"use strict";var r=a(927),n="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,c=Array.prototype.concat,d=Object.defineProperty,s=d&&function(){var e={};try{for(var t in d(e,"x",{enumerable:!1,value:e}),e)return!1;return e.x===e}catch(e){return!1}}(),defineProperty=function(e,t,a,r){var n;(!(t in e)||"function"==typeof(n=r)&&"[object Function]"===o.call(n)&&r())&&(s?d(e,t,{configurable:!0,enumerable:!1,value:a,writable:!0}):e[t]=a)},defineProperties=function(e,t){var a=arguments.length>2?arguments[2]:{},o=r(t);n&&(o=c.call(o,Object.getOwnPropertySymbols(t)));for(var d=0;d{"use strict";var r=a(62),n=a(41),o=n.getNAF,c=n.getJSF,d=n.assert;function BaseCurve(e,t){this.type=e,this.p=new r(t.p,16),this.red=t.prime?r.red(t.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=t.n&&new r(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var a=this.n&&this.p.div(this.n);!a||a.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function BasePoint(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=BaseCurve,BaseCurve.prototype.point=function point(){throw new Error("Not implemented")},BaseCurve.prototype.validate=function validate(){throw new Error("Not implemented")},BaseCurve.prototype._fixedNafMul=function _fixedNafMul(e,t){d(e.precomputed);var a=e._getDoubles(),r=o(t,1,this._bitLength),n=(1<=c;u--)s=(s<<1)+r[u];b.push(s)}for(var h=this.jpoint(null,null,null),l=this.jpoint(null,null,null),g=n;g>0;g--){for(c=0;c=0;b--){for(var u=0;b>=0&&0===c[b];b--)u++;if(b>=0&&u++,s=s.dblp(u),b<0)break;var h=c[b];d(0!==h),s="affine"===e.type?h>0?s.mixedAdd(n[h-1>>1]):s.mixedAdd(n[-h-1>>1].neg()):h>0?s.add(n[h-1>>1]):s.add(n[-h-1>>1].neg())}return"affine"===e.type?s.toP():s},BaseCurve.prototype._wnafMulAdd=function _wnafMulAdd(e,t,a,r,n){var d,s,b,u=this._wnafT1,h=this._wnafT2,l=this._wnafT3,g=0;for(d=0;d=1;d-=2){var B=d-1,x=d;if(1===u[B]&&1===u[x]){var m=[t[B],null,null,t[x]];0===t[B].y.cmp(t[x].y)?(m[1]=t[B].add(t[x]),m[2]=t[B].toJ().mixedAdd(t[x].neg())):0===t[B].y.cmp(t[x].y.redNeg())?(m[1]=t[B].toJ().mixedAdd(t[x]),m[2]=t[B].add(t[x].neg())):(m[1]=t[B].toJ().mixedAdd(t[x]),m[2]=t[B].toJ().mixedAdd(t[x].neg()));var I=[-3,-1,-5,-7,0,7,5,1,3],y=c(a[B],a[x]);for(g=Math.max(y[0].length,g),l[B]=new Array(g),l[x]=new Array(g),s=0;s=0;d--){for(var _=0;d>=0;){var k=!0;for(s=0;s=0&&_++,v=v.dblp(_),d<0)break;for(s=0;s0?b=h[s][N-1>>1]:N<0&&(b=h[s][-N-1>>1].neg()),v="affine"===b.type?v.mixedAdd(b):v.add(b))}}for(d=0;d=Math.ceil((e.bitLength()+1)/t.step)},BasePoint.prototype._getDoubles=function _getDoubles(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var a=[this],r=this,n=0;n{"use strict";var r=a(68),n=a(88);function BlockHash(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=BlockHash,BlockHash.prototype.update=function update(e,t){if(e=r.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var a=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-a,e.length),0===this.pending.length&&(this.pending=null),e=r.join32(e,0,e.length-a,this.endian);for(var n=0;n>>24&255,r[n++]=e>>>16&255,r[n++]=e>>>8&255,r[n++]=255&e}else for(r[n++]=255&e,r[n++]=e>>>8&255,r[n++]=e>>>16&255,r[n++]=e>>>24&255,r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=0,o=8;o{"use strict";var r=a(63),n=a(42),o=n.getNAF,c=n.getJSF,d=n.assert;function BaseCurve(e,t){this.type=e,this.p=new r(t.p,16),this.red=t.prime?r.red(t.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=t.n&&new r(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var a=this.n&&this.p.div(this.n);!a||a.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function BasePoint(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=BaseCurve,BaseCurve.prototype.point=function point(){throw new Error("Not implemented")},BaseCurve.prototype.validate=function validate(){throw new Error("Not implemented")},BaseCurve.prototype._fixedNafMul=function _fixedNafMul(e,t){d(e.precomputed);var a=e._getDoubles(),r=o(t,1,this._bitLength),n=(1<=c;u--)s=(s<<1)+r[u];b.push(s)}for(var h=this.jpoint(null,null,null),l=this.jpoint(null,null,null),g=n;g>0;g--){for(c=0;c=0;b--){for(var u=0;b>=0&&0===c[b];b--)u++;if(b>=0&&u++,s=s.dblp(u),b<0)break;var h=c[b];d(0!==h),s="affine"===e.type?h>0?s.mixedAdd(n[h-1>>1]):s.mixedAdd(n[-h-1>>1].neg()):h>0?s.add(n[h-1>>1]):s.add(n[-h-1>>1].neg())}return"affine"===e.type?s.toP():s},BaseCurve.prototype._wnafMulAdd=function _wnafMulAdd(e,t,a,r,n){var d,s,b,u=this._wnafT1,h=this._wnafT2,l=this._wnafT3,g=0;for(d=0;d=1;d-=2){var B=d-1,x=d;if(1===u[B]&&1===u[x]){var m=[t[B],null,null,t[x]];0===t[B].y.cmp(t[x].y)?(m[1]=t[B].add(t[x]),m[2]=t[B].toJ().mixedAdd(t[x].neg())):0===t[B].y.cmp(t[x].y.redNeg())?(m[1]=t[B].toJ().mixedAdd(t[x]),m[2]=t[B].add(t[x].neg())):(m[1]=t[B].toJ().mixedAdd(t[x]),m[2]=t[B].toJ().mixedAdd(t[x].neg()));var I=[-3,-1,-5,-7,0,7,5,1,3],y=c(a[B],a[x]);for(g=Math.max(y[0].length,g),l[B]=new Array(g),l[x]=new Array(g),s=0;s=0;d--){for(var _=0;d>=0;){var k=!0;for(s=0;s=0&&_++,v=v.dblp(_),d<0)break;for(s=0;s0?b=h[s][N-1>>1]:N<0&&(b=h[s][-N-1>>1].neg()),v="affine"===b.type?v.mixedAdd(b):v.add(b))}}for(d=0;d=Math.ceil((e.bitLength()+1)/t.step)},BasePoint.prototype._getDoubles=function _getDoubles(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var a=[this],r=this,n=0;n{"use strict";var r=a(69),n=a(89);function BlockHash(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=BlockHash,BlockHash.prototype.update=function update(e,t){if(e=r.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var a=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-a,e.length),0===this.pending.length&&(this.pending=null),e=r.join32(e,0,e.length-a,this.endian);for(var n=0;n>>24&255,r[n++]=e>>>16&255,r[n++]=e>>>8&255,r[n++]=255&e}else for(r[n++]=255&e,r[n++]=e>>>8&255,r[n++]=e>>>16&255,r[n++]=e>>>24&255,r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=0,o=8;o{"use strict";var r=a(64),n=a(43),o=n.getNAF,c=n.getJSF,d=n.assert;function BaseCurve(e,t){this.type=e,this.p=new r(t.p,16),this.red=t.prime?r.red(t.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=t.n&&new r(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var a=this.n&&this.p.div(this.n);!a||a.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function BasePoint(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=BaseCurve,BaseCurve.prototype.point=function point(){throw new Error("Not implemented")},BaseCurve.prototype.validate=function validate(){throw new Error("Not implemented")},BaseCurve.prototype._fixedNafMul=function _fixedNafMul(e,t){d(e.precomputed);var a=e._getDoubles(),r=o(t,1,this._bitLength),n=(1<=c;u--)s=(s<<1)+r[u];b.push(s)}for(var h=this.jpoint(null,null,null),l=this.jpoint(null,null,null),g=n;g>0;g--){for(c=0;c=0;b--){for(var u=0;b>=0&&0===c[b];b--)u++;if(b>=0&&u++,s=s.dblp(u),b<0)break;var h=c[b];d(0!==h),s="affine"===e.type?h>0?s.mixedAdd(n[h-1>>1]):s.mixedAdd(n[-h-1>>1].neg()):h>0?s.add(n[h-1>>1]):s.add(n[-h-1>>1].neg())}return"affine"===e.type?s.toP():s},BaseCurve.prototype._wnafMulAdd=function _wnafMulAdd(e,t,a,r,n){var d,s,b,u=this._wnafT1,h=this._wnafT2,l=this._wnafT3,g=0;for(d=0;d=1;d-=2){var B=d-1,x=d;if(1===u[B]&&1===u[x]){var m=[t[B],null,null,t[x]];0===t[B].y.cmp(t[x].y)?(m[1]=t[B].add(t[x]),m[2]=t[B].toJ().mixedAdd(t[x].neg())):0===t[B].y.cmp(t[x].y.redNeg())?(m[1]=t[B].toJ().mixedAdd(t[x]),m[2]=t[B].add(t[x].neg())):(m[1]=t[B].toJ().mixedAdd(t[x]),m[2]=t[B].toJ().mixedAdd(t[x].neg()));var I=[-3,-1,-5,-7,0,7,5,1,3],y=c(a[B],a[x]);for(g=Math.max(y[0].length,g),l[B]=new Array(g),l[x]=new Array(g),s=0;s=0;d--){for(var _=0;d>=0;){var k=!0;for(s=0;s=0&&_++,v=v.dblp(_),d<0)break;for(s=0;s0?b=h[s][N-1>>1]:N<0&&(b=h[s][-N-1>>1].neg()),v="affine"===b.type?v.mixedAdd(b):v.add(b))}}for(d=0;d=Math.ceil((e.bitLength()+1)/t.step)},BasePoint.prototype._getDoubles=function _getDoubles(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var a=[this],r=this,n=0;n{"use strict";var r=a(70),n=a(90);function BlockHash(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=BlockHash,BlockHash.prototype.update=function update(e,t){if(e=r.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var a=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-a,e.length),0===this.pending.length&&(this.pending=null),e=r.join32(e,0,e.length-a,this.endian);for(var n=0;n>>24&255,r[n++]=e>>>16&255,r[n++]=e>>>8&255,r[n++]=255&e}else for(r[n++]=255&e,r[n++]=e>>>8&255,r[n++]=e>>>16&255,r[n++]=e>>>24&255,r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=0,o=8;o{"use strict";var r=a(29),n=a(44),o=n.getNAF,c=n.getJSF,d=n.assert;function BaseCurve(e,t){this.type=e,this.p=new r(t.p,16),this.red=t.prime?r.red(t.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=t.n&&new r(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var a=this.n&&this.p.div(this.n);!a||a.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function BasePoint(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=BaseCurve,BaseCurve.prototype.point=function point(){throw new Error("Not implemented")},BaseCurve.prototype.validate=function validate(){throw new Error("Not implemented")},BaseCurve.prototype._fixedNafMul=function _fixedNafMul(e,t){d(e.precomputed);var a=e._getDoubles(),r=o(t,1,this._bitLength),n=(1<=c;u--)s=(s<<1)+r[u];b.push(s)}for(var h=this.jpoint(null,null,null),l=this.jpoint(null,null,null),g=n;g>0;g--){for(c=0;c=0;b--){for(var u=0;b>=0&&0===c[b];b--)u++;if(b>=0&&u++,s=s.dblp(u),b<0)break;var h=c[b];d(0!==h),s="affine"===e.type?h>0?s.mixedAdd(n[h-1>>1]):s.mixedAdd(n[-h-1>>1].neg()):h>0?s.add(n[h-1>>1]):s.add(n[-h-1>>1].neg())}return"affine"===e.type?s.toP():s},BaseCurve.prototype._wnafMulAdd=function _wnafMulAdd(e,t,a,r,n){var d,s,b,u=this._wnafT1,h=this._wnafT2,l=this._wnafT3,g=0;for(d=0;d=1;d-=2){var B=d-1,x=d;if(1===u[B]&&1===u[x]){var m=[t[B],null,null,t[x]];0===t[B].y.cmp(t[x].y)?(m[1]=t[B].add(t[x]),m[2]=t[B].toJ().mixedAdd(t[x].neg())):0===t[B].y.cmp(t[x].y.redNeg())?(m[1]=t[B].toJ().mixedAdd(t[x]),m[2]=t[B].add(t[x].neg())):(m[1]=t[B].toJ().mixedAdd(t[x]),m[2]=t[B].toJ().mixedAdd(t[x].neg()));var I=[-3,-1,-5,-7,0,7,5,1,3],y=c(a[B],a[x]);for(g=Math.max(y[0].length,g),l[B]=new Array(g),l[x]=new Array(g),s=0;s=0;d--){for(var _=0;d>=0;){var k=!0;for(s=0;s=0&&_++,v=v.dblp(_),d<0)break;for(s=0;s0?b=h[s][N-1>>1]:N<0&&(b=h[s][-N-1>>1].neg()),v="affine"===b.type?v.mixedAdd(b):v.add(b))}}for(d=0;d=Math.ceil((e.bitLength()+1)/t.step)},BasePoint.prototype._getDoubles=function _getDoubles(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var a=[this],r=this,n=0;n{"use strict";var r=a(71),n=a(91);function BlockHash(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=BlockHash,BlockHash.prototype.update=function update(e,t){if(e=r.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var a=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-a,e.length),0===this.pending.length&&(this.pending=null),e=r.join32(e,0,e.length-a,this.endian);for(var n=0;n>>24&255,r[n++]=e>>>16&255,r[n++]=e>>>8&255,r[n++]=255&e}else for(r[n++]=255&e,r[n++]=e>>>8&255,r[n++]=e>>>16&255,r[n++]=e>>>24&255,r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=0,o=8;o{"use strict";var r=a(9),n=a(484),o=a(486),c=a(487),d=a(1095);function Hash(e){d.call(this,"digest"),this._hash=e}r(Hash,d),Hash.prototype._update=function(e){this._hash.update(e)},Hash.prototype._final=function(){return this._hash.digest()},e.exports=function createHash(e){return"md5"===(e=e.toLowerCase())?new n:"rmd160"===e||"ripemd160"===e?new o:new Hash(c(e))}},(e,t,a)=>{e.exports=a(1105)(a(1126))},(e,t,a)=>{"use strict";var r=a(495);e.exports=function hasToStringTagShams(){return r()&&!!Symbol.toStringTag}},(e,t,a)=>{"use strict";var r=a(108),n=a(1118);e.exports=function supports(){var e=r.apply(null,arguments);return n(e,{bufferKeys:e.bufferKeys||!1,snapshots:e.snapshots||!1,permanence:e.permanence||!1,seek:e.seek||!1,clear:e.clear||!1,status:e.status||!1,createIfMissing:e.createIfMissing||!1,errorIfExists:e.errorIfExists||!1,deferredOpen:e.deferredOpen||!1,openCallback:e.openCallback||!1,promises:e.promises||!1,streams:e.streams||!1,encodings:e.encodings||!1,additionalMethods:r(e.additionalMethods)})}},(e,t,a)=>{"use strict";var r=a(65),n=a(45),o=n.getNAF,c=n.getJSF,d=n.assert;function BaseCurve(e,t){this.type=e,this.p=new r(t.p,16),this.red=t.prime?r.red(t.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=t.n&&new r(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var a=this.n&&this.p.div(this.n);!a||a.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function BasePoint(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=BaseCurve,BaseCurve.prototype.point=function point(){throw new Error("Not implemented")},BaseCurve.prototype.validate=function validate(){throw new Error("Not implemented")},BaseCurve.prototype._fixedNafMul=function _fixedNafMul(e,t){d(e.precomputed);var a=e._getDoubles(),r=o(t,1,this._bitLength),n=(1<=c;u--)s=(s<<1)+r[u];b.push(s)}for(var h=this.jpoint(null,null,null),l=this.jpoint(null,null,null),g=n;g>0;g--){for(c=0;c=0;b--){for(var u=0;b>=0&&0===c[b];b--)u++;if(b>=0&&u++,s=s.dblp(u),b<0)break;var h=c[b];d(0!==h),s="affine"===e.type?h>0?s.mixedAdd(n[h-1>>1]):s.mixedAdd(n[-h-1>>1].neg()):h>0?s.add(n[h-1>>1]):s.add(n[-h-1>>1].neg())}return"affine"===e.type?s.toP():s},BaseCurve.prototype._wnafMulAdd=function _wnafMulAdd(e,t,a,r,n){var d,s,b,u=this._wnafT1,h=this._wnafT2,l=this._wnafT3,g=0;for(d=0;d=1;d-=2){var B=d-1,x=d;if(1===u[B]&&1===u[x]){var m=[t[B],null,null,t[x]];0===t[B].y.cmp(t[x].y)?(m[1]=t[B].add(t[x]),m[2]=t[B].toJ().mixedAdd(t[x].neg())):0===t[B].y.cmp(t[x].y.redNeg())?(m[1]=t[B].toJ().mixedAdd(t[x]),m[2]=t[B].add(t[x].neg())):(m[1]=t[B].toJ().mixedAdd(t[x]),m[2]=t[B].toJ().mixedAdd(t[x].neg()));var I=[-3,-1,-5,-7,0,7,5,1,3],y=c(a[B],a[x]);for(g=Math.max(y[0].length,g),l[B]=new Array(g),l[x]=new Array(g),s=0;s=0;d--){for(var _=0;d>=0;){var k=!0;for(s=0;s=0&&_++,v=v.dblp(_),d<0)break;for(s=0;s0?b=h[s][N-1>>1]:N<0&&(b=h[s][-N-1>>1].neg()),v="affine"===b.type?v.mixedAdd(b):v.add(b))}}for(d=0;d=Math.ceil((e.bitLength()+1)/t.step)},BasePoint.prototype._getDoubles=function _getDoubles(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var a=[this],r=this,n=0;n{"use strict";var r=a(72),n=a(93);function BlockHash(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=BlockHash,BlockHash.prototype.update=function update(e,t){if(e=r.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var a=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-a,e.length),0===this.pending.length&&(this.pending=null),e=r.join32(e,0,e.length-a,this.endian);for(var n=0;n>>24&255,r[n++]=e>>>16&255,r[n++]=e>>>8&255,r[n++]=255&e}else for(r[n++]=255&e,r[n++]=e>>>8&255,r[n++]=e>>>16&255,r[n++]=e>>>24&255,r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=0,o=8;o{"use strict";var r=a(1202);t.fromCallback=function(e,t){if(void 0===e){var a=new Promise((function(t,a){e=function(e,r){e?a(e):t(r)}}));e[void 0!==t?t:"promise"]=a}else if("function"!=typeof e)throw new TypeError("Callback must be a function");return e},t.fromPromise=function(e,t){if(void 0===t)return e;e.then((function(e){r((()=>t(null,e)))})).catch((function(e){r((()=>t(e)))}))}},(e,t,a)=>{let r;e.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:a.g):e=>(r||(r=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)))},(e,t,a)=>{var r=a(33);e.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},(e,t,a)=>{var r,n,o,c=a(1242),d=a(52),s=a(31),b=a(73),u=a(114),h=a(74),l=a(293),g=a(302),p=a(188),B="Object already initialized",x=d.TypeError,m=d.WeakMap;if(c||l.state){var I=l.state||(l.state=new m),y=s(I.get),C=s(I.has),w=s(I.set);r=function(e,t){if(C(I,e))throw new x(B);return t.facade=e,w(I,e,t),t},n=function(e){return y(I,e)||{}},o=function(e){return C(I,e)}}else{var v=g("state");p[v]=!0,r=function(e,t){if(h(e,v))throw new x(B);return t.facade=e,u(e,v,t),t},n=function(e){return h(e,v)?e[v]:{}},o=function(e){return h(e,v)}}e.exports={set:r,get:n,has:o,enforce:function(e){return o(e)?n(e):r(e,{})},getterFor:function(e){return function(t){var a;if(!b(t)||(a=n(t)).type!==e)throw x("Incompatible receiver, "+e+" required");return a}}}},e=>{e.exports=!0},e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},e=>{e.exports={}},(e,t,a)=>{var r=a(31),n=a(298),o=a(184),c=r(r.bind);e.exports=function(e,t){return n(e),void 0===t?e:o?c(e,t):function(){return e.apply(t,arguments)}}},(e,t,a)=>{var r=a(1255);e.exports=function(e){return r(e.length)}},(e,t,a)=>{var r=a(310),n=a(28),o=a(139),c=a(53)("toStringTag"),d=Object,s="Arguments"==o(function(){return arguments}());e.exports=r?o:function(e){var t,a,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(a=function(e,t){try{return e[t]}catch(e){}}(t=d(e),c))?a:s?o(t):"Object"==(r=o(t))&&n(t.callee)?"Arguments":r}},(e,t,a)=>{"use strict";var r=a(0).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.updateSstoreGas=t.writeCallOutput=t.subMemUsage=t.maxCallGas=t.jumpSubIsValid=t.jumpIsValid=t.getFullname=t.getDataSlice=t.short=t.divCeil=t.describeLocation=t.addressToBuffer=t.trap=t.setLengthLeftStorage=void 0;const n=a(1),o=a(19),c=new n.BN(1).shln(160).subn(1);function divCeil(e,t){const a=e.div(t);return e.mod(t).isZero()?a:a.isNeg()?a.isubn(1):a.iaddn(1)}function getDataSlice(e,t,a){const r=new n.BN(e.length);t.gt(r)&&(t=r);let o=t.add(a);return o.gt(r)&&(o=r),e=e.slice(t.toNumber(),o.toNumber()),e=(0,n.setLengthRight)(e,a.toNumber())}t.setLengthLeftStorage=function setLengthLeftStorage(e){return e.equals(r.alloc(e.length,0))?r.alloc(0):(0,n.setLengthLeft)(e,32)},t.trap=function trap(e){throw new o.VmError(e)},t.addressToBuffer=function addressToBuffer(e){return r.isBuffer(e)?e:e.and(c).toArrayLike(r,"be",20)},t.describeLocation=function describeLocation(e){return`${(0,n.keccak256)(e.eei.getCode()).toString("hex")}/${e.eei.getAddress().buf.toString("hex")}:${e.programCounter-1}`},t.divCeil=divCeil,t.short=function short(e){const t=e.toString("hex");return t.length<=50?t:t.slice(0,50)+"..."},t.getDataSlice=getDataSlice,t.getFullname=function getFullname(e,t){switch(t){case"LOG":t+=e-160;break;case"PUSH":t+=e-95;break;case"DUP":t+=e-127;break;case"SWAP":t+=e-143}return t},t.jumpIsValid=function jumpIsValid(e,t){return 1===e.validJumps[t]},t.jumpSubIsValid=function jumpSubIsValid(e,t){return 2===e.validJumps[t]},t.maxCallGas=function maxCallGas(e,t,a,r){if(r.gteHardfork("tangerineWhistle")){const a=t.sub(t.divn(64));return e.gt(a)?a:e}return e},t.subMemUsage=function subMemUsage(e,t,a,r){if(a.isZero())return new n.BN(0);const o=divCeil(t.add(a),new n.BN(32));if(o.lte(e.memoryWordCount))return new n.BN(0);const c=o,d=new n.BN(r.param("gasPrices","memory")),s=new n.BN(r.param("gasPrices","quadCoeffDiv")),b=c.mul(d).add(c.mul(c).div(s));if(b.gt(e.highestMemCost)){const t=e.highestMemCost;e.highestMemCost=b.clone(),b.isub(t)}return e.memoryWordCount=o,b},t.writeCallOutput=function writeCallOutput(e,t,a){const r=e.eei.getReturnData();if(r.length>0){const o=t.toNumber();let c=a.toNumber();r.length0&&t.length>0){return new n.BN(r.param("gasPrices","sstoreReset"))}if(0===a.length&&t.length>0){const t=new n.BN(r.param("gasPrices","sstoreReset"));return e.eei.refundGas(new n.BN(r.param("gasPrices","sstoreRefund")),"updateSstoreGas"),t}return new n.BN(r.param("gasPrices","sstoreSet"))}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalize=void 0;t.normalize=e=>e},(e,t,a)=>{"use strict";var r=a(1330),n="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,c=Array.prototype.concat,d=Object.defineProperty,s=d&&function(){var e={};try{for(var t in d(e,"x",{enumerable:!1,value:e}),e)return!1;return e.x===e}catch(e){return!1}}(),defineProperty=function(e,t,a,r){var n;(!(t in e)||"function"==typeof(n=r)&&"[object Function]"===o.call(n)&&r())&&(s?d(e,t,{configurable:!0,enumerable:!1,value:a,writable:!0}):e[t]=a)},defineProperties=function(e,t){var a=arguments.length>2?arguments[2]:{},o=r(t);n&&(o=c.call(o,Object.getOwnPropertySymbols(t)));for(var d=0;d{"use strict";e.exports=function requirePromise(){if("function"!=typeof Promise)throw new TypeError("`Promise.allSettled` requires a global `Promise` be available.")}},(e,t,a)=>{"use strict";var r=a(316);e.exports=function hasToStringTagShams(){return r()&&!!Symbol.toStringTag}},function(e,t,a){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[a]}})}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),n=this&&this.__exportStar||function(e,t){for(var a in e)"default"===a||Object.prototype.hasOwnProperty.call(t,a)||r(t,e,a)};Object.defineProperty(t,"__esModule",{value:!0}),n(a(1636),t),n(a(1638),t),n(a(672),t),n(a(1639),t),n(a(673),t),n(a(1640),t),n(a(1172),t),n(a(1171),t),n(a(335),t),n(a(1641),t),n(a(770),t),n(a(1643),t),n(a(771),t)},function(e,t,a){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a);var n=Object.getOwnPropertyDescriptor(t,a);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,r,n)}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&r(t,e,a);return n(t,e),t},c=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,a=t&&e[t],r=0;if(a)return a.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},d=this&&this.__read||function(e,t){var a="function"==typeof Symbol&&e[Symbol.iterator];if(!a)return e;var r,n,o=a.call(e),c=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)c.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(a=o.return)&&a.call(o)}finally{if(n)throw n.error}}return c};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseTransaction=void 0;var s=o(a(619)),b=a(47),u=a(105),h=function(){function BaseTransaction(e,t){this.cache={hash:void 0,dataFee:void 0},this.activeCapabilities=[],this.DEFAULT_CHAIN=s.Chain.Mainnet,this.DEFAULT_HARDFORK=s.Hardfork.Istanbul;var a=e.nonce,r=e.gasLimit,n=e.to,o=e.value,c=e.data,d=e.v,u=e.r,h=e.s,l=e.type;this._type=new b.BN((0,b.toBuffer)(l)).toNumber(),this.txOptions=t;var g=(0,b.toBuffer)(""===n?"0x":n),p=(0,b.toBuffer)(""===d?"0x":d),B=(0,b.toBuffer)(""===u?"0x":u),x=(0,b.toBuffer)(""===h?"0x":h);this.nonce=new b.BN((0,b.toBuffer)(""===a?"0x":a)),this.gasLimit=new b.BN((0,b.toBuffer)(""===r?"0x":r)),this.to=g.length>0?new b.Address(g):void 0,this.value=new b.BN((0,b.toBuffer)(""===o?"0x":o)),this.data=(0,b.toBuffer)(""===c?"0x":c),this.v=p.length>0?new b.BN(p):void 0,this.r=B.length>0?new b.BN(B):void 0,this.s=x.length>0?new b.BN(x):void 0,this._validateCannotExceedMaxInteger({value:this.value,r:this.r,s:this.s}),this._validateCannotExceedMaxInteger({gasLimit:this.gasLimit},64),this._validateCannotExceedMaxInteger({nonce:this.nonce},64,!0)}return Object.defineProperty(BaseTransaction.prototype,"transactionType",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(BaseTransaction.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),BaseTransaction.prototype.supports=function(e){return this.activeCapabilities.includes(e)},BaseTransaction.prototype.validate=function(e){void 0===e&&(e=!1);var t=[];return this.getBaseFee().gt(this.gasLimit)&&t.push("gasLimit is too low. given ".concat(this.gasLimit,", need at least ").concat(this.getBaseFee())),this.isSigned()&&!this.verifySignature()&&t.push("Invalid Signature"),e?t:0===t.length},BaseTransaction.prototype.getBaseFee=function(){var e=this.getDataFee().addn(this.common.param("gasPrices","tx"));return this.common.gteHardfork("homestead")&&this.toCreationAddress()&&e.iaddn(this.common.param("gasPrices","txCreation")),e},BaseTransaction.prototype.getDataFee=function(){for(var e=this.common.param("gasPrices","txDataZero"),t=this.common.param("gasPrices","txDataNonZero"),a=0,r=0;r-1&&this.activeCapabilities.splice(h,1)}return s},BaseTransaction.prototype._getCommon=function(e,t){var a;if(t){var r=new b.BN((0,b.toBuffer)(t));if(e){if(!e.chainIdBN().eq(r)){var n=this._errorMsg("The chain ID does not match the chain ID of Common");throw new Error(n)}return e.copy()}return s.default.isSupportedChainId(r)?new s.default({chain:r,hardfork:this.DEFAULT_HARDFORK}):s.default.forCustomChain(this.DEFAULT_CHAIN,{name:"custom-chain",networkId:r,chainId:r},this.DEFAULT_HARDFORK)}return null!==(a=null==e?void 0:e.copy())&&void 0!==a?a:new s.default({chain:this.DEFAULT_CHAIN,hardfork:this.DEFAULT_HARDFORK})},BaseTransaction.prototype._validateCannotExceedMaxInteger=function(e,t,a){var r,n;void 0===t&&(t=256),void 0===a&&(a=!1);try{for(var o=c(Object.entries(e)),s=o.next();!s.done;s=o.next()){var u=d(s.value,2),h=u[0],l=u[1];switch(t){case 64:if(a){if(null==l?void 0:l.gte(b.MAX_UINT64)){var g=this._errorMsg("".concat(h," cannot equal or exceed MAX_UINT64 (2^64-1), given ").concat(l));throw new Error(g)}}else if(null==l?void 0:l.gt(b.MAX_UINT64)){g=this._errorMsg("".concat(h," cannot exceed MAX_UINT64 (2^64-1), given ").concat(l));throw new Error(g)}break;case 256:if(a){if(null==l?void 0:l.gte(b.MAX_INTEGER)){g=this._errorMsg("".concat(h," cannot equal or exceed MAX_INTEGER (2^256-1), given ").concat(l));throw new Error(g)}}else if(null==l?void 0:l.gt(b.MAX_INTEGER)){g=this._errorMsg("".concat(h," cannot exceed MAX_INTEGER (2^256-1), given ").concat(l));throw new Error(g)}break;default:g=this._errorMsg("unimplemented bits value");throw new Error(g)}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}},BaseTransaction.prototype._getSharedErrorPostfix=function(){var e="";try{e=this.isSigned()?(0,b.bufferToHex)(this.hash()):"not available (unsigned)"}catch(t){e="error"}var t="";try{t=this.isSigned().toString()}catch(t){e="error"}var a="";try{a=this.common.hardfork()}catch(e){a="error"}var r="tx type=".concat(this.type," hash=").concat(e," nonce=").concat(this.nonce," value=").concat(this.value," ");return r+="signed=".concat(t," hf=").concat(a)},BaseTransaction}();t.BaseTransaction=h},function(e,t,a){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a);var n=Object.getOwnPropertyDescriptor(t,a);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,r,n)}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&r(t,e,a);return n(t,e),t},c=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,a=t&&e[t],r=0;if(a)return a.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},d=this&&this.__read||function(e,t){var a="function"==typeof Symbol&&e[Symbol.iterator];if(!a)return e;var r,n,o=a.call(e),c=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)c.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(a=o.return)&&a.call(o)}finally{if(n)throw n.error}}return c};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseTransaction=void 0;var s=o(a(32)),b=a(1),u=a(112),h=function(){function BaseTransaction(e,t){this.cache={hash:void 0,dataFee:void 0},this.activeCapabilities=[],this.DEFAULT_CHAIN=s.Chain.Mainnet,this.DEFAULT_HARDFORK=s.Hardfork.Istanbul;var a=e.nonce,r=e.gasLimit,n=e.to,o=e.value,c=e.data,d=e.v,u=e.r,h=e.s,l=e.type;this._type=new b.BN((0,b.toBuffer)(l)).toNumber(),this.txOptions=t;var g=(0,b.toBuffer)(""===n?"0x":n),p=(0,b.toBuffer)(""===d?"0x":d),B=(0,b.toBuffer)(""===u?"0x":u),x=(0,b.toBuffer)(""===h?"0x":h);this.nonce=new b.BN((0,b.toBuffer)(""===a?"0x":a)),this.gasLimit=new b.BN((0,b.toBuffer)(""===r?"0x":r)),this.to=g.length>0?new b.Address(g):void 0,this.value=new b.BN((0,b.toBuffer)(""===o?"0x":o)),this.data=(0,b.toBuffer)(""===c?"0x":c),this.v=p.length>0?new b.BN(p):void 0,this.r=B.length>0?new b.BN(B):void 0,this.s=x.length>0?new b.BN(x):void 0,this._validateCannotExceedMaxInteger({value:this.value,r:this.r,s:this.s}),this._validateCannotExceedMaxInteger({gasLimit:this.gasLimit},64),this._validateCannotExceedMaxInteger({nonce:this.nonce},64,!0)}return Object.defineProperty(BaseTransaction.prototype,"transactionType",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(BaseTransaction.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),BaseTransaction.prototype.supports=function(e){return this.activeCapabilities.includes(e)},BaseTransaction.prototype.validate=function(e){void 0===e&&(e=!1);var t=[];return this.getBaseFee().gt(this.gasLimit)&&t.push("gasLimit is too low. given ".concat(this.gasLimit,", need at least ").concat(this.getBaseFee())),this.isSigned()&&!this.verifySignature()&&t.push("Invalid Signature"),e?t:0===t.length},BaseTransaction.prototype.getBaseFee=function(){var e=this.getDataFee().addn(this.common.param("gasPrices","tx"));return this.common.gteHardfork("homestead")&&this.toCreationAddress()&&e.iaddn(this.common.param("gasPrices","txCreation")),e},BaseTransaction.prototype.getDataFee=function(){for(var e=this.common.param("gasPrices","txDataZero"),t=this.common.param("gasPrices","txDataNonZero"),a=0,r=0;r-1&&this.activeCapabilities.splice(h,1)}return s},BaseTransaction.prototype._getCommon=function(e,t){var a;if(t){var r=new b.BN((0,b.toBuffer)(t));if(e){if(!e.chainIdBN().eq(r)){var n=this._errorMsg("The chain ID does not match the chain ID of Common");throw new Error(n)}return e.copy()}return s.default.isSupportedChainId(r)?new s.default({chain:r,hardfork:this.DEFAULT_HARDFORK}):s.default.forCustomChain(this.DEFAULT_CHAIN,{name:"custom-chain",networkId:r,chainId:r},this.DEFAULT_HARDFORK)}return null!==(a=null==e?void 0:e.copy())&&void 0!==a?a:new s.default({chain:this.DEFAULT_CHAIN,hardfork:this.DEFAULT_HARDFORK})},BaseTransaction.prototype._validateCannotExceedMaxInteger=function(e,t,a){var r,n;void 0===t&&(t=256),void 0===a&&(a=!1);try{for(var o=c(Object.entries(e)),s=o.next();!s.done;s=o.next()){var u=d(s.value,2),h=u[0],l=u[1];switch(t){case 64:if(a){if(null==l?void 0:l.gte(b.MAX_UINT64)){var g=this._errorMsg("".concat(h," cannot equal or exceed MAX_UINT64 (2^64-1), given ").concat(l));throw new Error(g)}}else if(null==l?void 0:l.gt(b.MAX_UINT64)){g=this._errorMsg("".concat(h," cannot exceed MAX_UINT64 (2^64-1), given ").concat(l));throw new Error(g)}break;case 256:if(a){if(null==l?void 0:l.gte(b.MAX_INTEGER)){g=this._errorMsg("".concat(h," cannot equal or exceed MAX_INTEGER (2^256-1), given ").concat(l));throw new Error(g)}}else if(null==l?void 0:l.gt(b.MAX_INTEGER)){g=this._errorMsg("".concat(h," cannot exceed MAX_INTEGER (2^256-1), given ").concat(l));throw new Error(g)}break;default:g=this._errorMsg("unimplemented bits value");throw new Error(g)}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}},BaseTransaction.prototype._getSharedErrorPostfix=function(){var e="";try{e=this.isSigned()?(0,b.bufferToHex)(this.hash()):"not available (unsigned)"}catch(t){e="error"}var t="";try{t=this.isSigned().toString()}catch(t){e="error"}var a="";try{a=this.common.hardfork()}catch(e){a="error"}var r="tx type=".concat(this.type," hash=").concat(e," nonce=").concat(this.nonce," value=").concat(this.value," ");return r+="signed=".concat(t," hf=").concat(a)},BaseTransaction}();t.BaseTransaction=h},function(__unused_webpack_module,exports,__webpack_require__){"use strict";var process=__webpack_require__(3),__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.GetConnector=exports.DefaultOptionsByName=exports.DefaultFlavor=exports.FilecoinFlavorName=exports.EthereumFlavorName=void 0;const ethereum_1=__webpack_require__(642),ethereum_options_1=__webpack_require__(342),filecoin_options_1=__webpack_require__(1782),colors_1=__webpack_require__(664),chalk_1=__importDefault(__webpack_require__(1319));__webpack_require__(97);const NEED_HELP="Need help? Reach out to the Truffle community at",COMMUNITY_LINK="https://trfl.io/support";function GetConnector(flavor,providerOptions,executor){if(flavor===exports.DefaultFlavor)return new ethereum_1.Connector(providerOptions,executor);try{if(flavor===exports.FilecoinFlavorName){flavor="@ganache/filecoin";const f=eval("require")(flavor),Connector=void 0!==f.default?f.default.Connector:f.Connector;return new Connector(providerOptions,executor)}{const{Connector:e}=__webpack_require__(1788)(flavor);return new e(providerOptions,executor)}}catch(e){if(!e.message.includes(`Cannot find module '${flavor}'`))throw e;console.warn(chalk_1.default`\n\n{red.bold ERROR:} Could not find Ganache flavor "{bold filecoin}" (${flavor}); `+"it probably\nneeds to be installed.\n \u25b8 if you're using Ganache as a library run: \n"+chalk_1.default` {blue.bold $ npm install ${flavor}}\n`+" \u25b8 if you're using Ganache as a CLI run: \n"+chalk_1.default` {blue.bold $ npm install --global ${flavor}}\n\n`+chalk_1.default`{hex("${colors_1.TruffleColors.porsche}").bold ${NEED_HELP}}\n`+chalk_1.default`{hex("${colors_1.TruffleColors.turquoise}") ${COMMUNITY_LINK}}\n\n`),process.exit(1)}}exports.EthereumFlavorName="ethereum",exports.FilecoinFlavorName="filecoin",exports.DefaultFlavor=exports.EthereumFlavorName,exports.DefaultOptionsByName={[exports.EthereumFlavorName]:ethereum_options_1.EthereumDefaults,[exports.FilecoinFlavorName]:filecoin_options_1.FilecoinDefaults},exports.GetConnector=GetConnector},function(e,t,a){"use strict";var r=a(10).Buffer,n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.computeIntrinsicsFeeMarketTx=t.computeIntrinsicsAccessListTx=t.computeIntrinsicsLegacyTx=t.computeFromAddress=t.publicKeyConvert=t.ecdsaRecover=t.isValidSigRecovery=void 0;const o=a(5),c=a(27),d=a(24),s=n(a(131));function copyOrFill(e,t,a,r){if(e.byteLength>r)throw new Error("Invalid signature");const n=r-e.byteLength,o=a+n;let c=a;for(;c1===e||0===e;function _ecdsaRecover(e,a,r,n,c){if(!(0,t.isValidSigRecovery)(c))throw new Error("Invalid signature v value");const d=(0,o.keccak)(e),b=a.slice(0,64);copyOrFill(r,b,0,32),copyOrFill(n,b,32,32);const u=a.slice(0,33);if(0!==s.default.ecdsaRecover(u,b,c,d))throw new Error("Invalid Signature");return u}t.ecdsaRecover=(e,t,a,r,n,d)=>{let s,b;const u=2*r+35;if(a===u||a===u+1){const t=[0===(h=r)?o.BUFFER_EMPTY:(0,o.uintToBuffer)(h),o.BUFFER_EMPTY,o.BUFFER_EMPTY],n=(0,c.encodeRange)(t,0,3);s=(0,c.digest)([e.output,n.output],e.length+n.length),b=a-u}else s=(0,c.digest)([e.output],e.length),b=a-27;var h;return _ecdsaRecover(s,t,n,d,b)};t.publicKeyConvert=(e,t)=>{const a=e.slice(0,65);if(0!==s.default.publicKeyConvert(a,t))throw new Error("Invalid Signature");return a};const b=r.allocUnsafe(65);t.computeFromAddress=(e,a,r,n,c)=>{const s=(0,t.ecdsaRecover)(e,b,a,c,r,n),u=(0,t.publicKeyConvert)(b,s);return d.Address.from((0,o.keccak)(u.slice(1)).slice(-20))};t.computeIntrinsicsLegacyTx=(e,a,r)=>{const n=(0,c.encodeRange)(a,0,6),d=(0,c.encodeRange)(a,6,3),s=(0,c.digest)([n.output,d.output],n.length+d.length);return{from:(0,t.computeFromAddress)(n,e.toNumber(),a[7],a[8],r),hash:o.Data.from((0,o.keccak)(s),32),serialized:s,encodedData:n,encodedSignature:d}};t.computeIntrinsicsAccessListTx=(e,a)=>{const n=a[0],s=(0,c.encodeRange)(a,1,8),u=(0,c.encodeRange)(a,9,3),h=r.concat([n,(0,c.digest)([s.output,u.output],s.length+u.length)]),l=_ecdsaRecover(r.concat([n,(0,c.digest)([s.output],s.length)]),b,a[10],a[11],e.toNumber()),g=(0,t.publicKeyConvert)(b,l);return{from:d.Address.from((0,o.keccak)(g.slice(1)).slice(-20)),hash:o.Data.from((0,o.keccak)(h),32),serialized:h,encodedData:s,encodedSignature:u}};t.computeIntrinsicsFeeMarketTx=(e,a)=>{const n=a[0],s=(0,c.encodeRange)(a,1,9),u=(0,c.encodeRange)(a,10,3),h=r.concat([n,(0,c.digest)([s.output,u.output],s.length+u.length)]),l=_ecdsaRecover(r.concat([n,(0,c.digest)([s.output],s.length)]),b,a[11],a[12],e.toNumber()),g=(0,t.publicKeyConvert)(b,l);return{from:d.Address.from((0,o.keccak)(g.slice(1)).slice(-20)),hash:o.Data.from((0,o.keccak)(h),32),serialized:h,encodedData:s,encodedSignature:u}}},function(e,t,a){"use strict";var r=this&&this.__awaiter||function(e,t,a,r){return new(a||(a=Promise))((function(n,o){function fulfilled(e){try{step(r.next(e))}catch(e){o(e)}}function rejected(e){try{step(r.throw(e))}catch(e){o(e)}}function step(e){e.done?n(e.value):function adopt(e){return e instanceof a?e:new a((function(t){t(e)}))}(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var a,r,n,o,c={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function verb(o){return function(d){return function step(o){if(a)throw new TypeError("Generator is already executing.");for(;c;)try{if(a=1,r&&(n=2&o[0]?r.return:o[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,o[1])).done)return n;switch(r=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return c.label++,{value:o[1],done:!1};case 5:c.label++,r=o[1],o=[0];continue;case 7:o=c.ops.pop(),c.trys.pop();continue;default:if(!(n=c.trys,(n=n.length>0&&n[n.length-1])||6!==o[0]&&2!==o[0])){c=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Trie=void 0;var d=c(a(362)),s=a(1),b=a(332),u=a(649),h=a(277),l=a(338),g=a(212),p=a(622),B=a(4),x=function(){function Trie(e,t,a){void 0===a&&(a=!1),this.EMPTY_TRIE_ROOT=s.KECCAK256_RLP,this.lock=new d.default(1),this.db=e?new b.DB(e):new b.DB,this._root=this.EMPTY_TRIE_ROOT,this._deleteFromDB=a,t&&(this.root=t)}return Object.defineProperty(Trie.prototype,"root",{get:function(){return this._root},set:function(e){e||(e=this.EMPTY_TRIE_ROOT),B(32===e.length,"Invalid root length. Roots are 32 bytes"),this._root=e},enumerable:!1,configurable:!0}),Trie.prototype.setRoot=function(e){this.root=null!=e?e:this.EMPTY_TRIE_ROOT},Trie.prototype.checkRoot=function(e){return r(this,void 0,void 0,(function(){var t;return n(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this._lookupNode(e)];case 1:return[2,null!==a.sent()];case 2:if("Missing node in DB"==(t=a.sent()).message)return[2,!1];throw t;case 3:return[2]}}))}))},Object.defineProperty(Trie.prototype,"isCheckpoint",{get:function(){return!1},enumerable:!1,configurable:!0}),Trie.prototype.get=function(e,t){return void 0===t&&(t=!1),r(this,void 0,void 0,(function(){var a,r,o,c;return n(this,(function(n){switch(n.label){case 0:return[4,this.findPath(e,t)];case 1:return a=n.sent(),r=a.node,o=a.remaining,c=null,r&&0===o.length&&(c=r.value),[2,c]}}))}))},Trie.prototype.put=function(e,t){return r(this,void 0,void 0,(function(){var a,r,o;return n(this,(function(n){switch(n.label){case 0:return t&&""!==t.toString()?[3,2]:[4,this.del(e)];case 1:return[2,n.sent()];case 2:return[4,this.lock.wait()];case 3:return n.sent(),this.root.equals(s.KECCAK256_RLP)?[4,this._createInitialNode(e,t)]:[3,5];case 4:return n.sent(),[3,8];case 5:return[4,this.findPath(e)];case 6:return a=n.sent(),r=a.remaining,o=a.stack,[4,this._updateNode(e,t,r,o)];case 7:n.sent(),n.label=8;case 8:return this.lock.signal(),[2]}}))}))},Trie.prototype.del=function(e){return r(this,void 0,void 0,(function(){var t,a,r;return n(this,(function(n){switch(n.label){case 0:return[4,this.lock.wait()];case 1:return n.sent(),[4,this.findPath(e)];case 2:return t=n.sent(),a=t.node,r=t.stack,a?[4,this._deleteNode(e,r)]:[3,4];case 3:n.sent(),n.label=4;case 4:return this.lock.signal(),[2]}}))}))},Trie.prototype.findPath=function(e,t){return void 0===t&&(t=!1),r(this,void 0,void 0,(function(){var a=this;return n(this,(function(o){return[2,new Promise((function(o,c){return r(a,void 0,void 0,(function(){var a,d,s,b,u=this;return n(this,(function(l){switch(l.label){case 0:a=[],d=(0,h.bufferToNibbles)(e),s=function(e,t,s,b){return r(u,void 0,void 0,(function(){var e,r;return n(this,(function(n){return null===t?[2,c(new Error("Path not found"))]:(e=d.slice((0,h.matchingNibbleLength)(s,d)),a.push(t),t instanceof g.BranchNode?0===e.length?o({node:t,remaining:[],stack:a}):(r=e[0],t.getBranch(r)?b.onlyBranchIndex(t,s,r):o({node:null,remaining:e,stack:a})):t instanceof g.LeafNode?(0,h.doKeysMatch)(e,t.key)?o({node:t,remaining:[],stack:a}):o({node:null,remaining:e,stack:a}):t instanceof g.ExtensionNode&&((0,h.matchingNibbleLength)(e,t.key)!==t.key.length?o({node:null,remaining:e,stack:a}):b.allChildren(t,s)),[2])}))}))},l.label=1;case 1:return l.trys.push([1,3,,4]),[4,this.walkTrie(this.root,s)];case 2:return l.sent(),[3,4];case 3:return("Missing node in DB"!=(b=l.sent()).message||t)&&c(b),[3,4];case 4:return o({node:null,remaining:[],stack:a}),[2]}}))}))}))]}))}))},Trie.prototype.walkTrie=function(e,t){return r(this,void 0,void 0,(function(){return n(this,(function(a){switch(a.label){case 0:return[4,l.WalkController.newWalk(t,this,e)];case 1:return a.sent(),[2]}}))}))},Trie.prototype._walkTrie=function(e,t){return r(this,void 0,void 0,(function(){return n(this,(function(a){switch(a.label){case 0:return[4,this.walkTrie(e,t)];case 1:return a.sent(),[2]}}))}))},Trie.prototype._createInitialNode=function(e,t){return r(this,void 0,void 0,(function(){var a;return n(this,(function(r){switch(r.label){case 0:return a=new g.LeafNode((0,h.bufferToNibbles)(e),t),this.root=a.hash(),[4,this.db.put(this.root,a.serialize())];case 1:return r.sent(),[2]}}))}))},Trie.prototype.lookupNode=function(e){return r(this,void 0,void 0,(function(){var t;return n(this,(function(a){switch(a.label){case 0:return(0,g.isRawNode)(e)?[2,(0,g.decodeRawNode)(e)]:(t=null,null,[4,this.db.get(e)]);case 1:if(!(t=a.sent()))throw new Error("Missing node in DB");return[2,(0,g.decodeNode)(t)]}}))}))},Trie.prototype._lookupNode=function(e){return r(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.lookupNode(e)]}))}))},Trie.prototype._updateNode=function(e,t,a,o){return r(this,void 0,void 0,(function(){var r,c,d,s,b,u,l,p,B,x,m,I,y,C,w,v;return n(this,(function(n){switch(n.label){case 0:if(r=[],!(c=o.pop()))throw new Error("Stack underflow");if(d=(0,h.bufferToNibbles)(e),s=!1,c instanceof g.LeafNode){for(b=0,u=0;u=32||t){var o=(0,s.keccak)(n);return r?this._deleteFromDB&&a.push({type:"del",key:o}):a.push({type:"put",key:o,value:n}),o}return e.raw()},Trie.prototype.batch=function(e){return r(this,void 0,void 0,(function(){var t,a,r,c,d,s;return n(this,(function(n){switch(n.label){case 0:n.trys.push([0,7,8,9]),t=o(e),a=t.next(),n.label=1;case 1:if(a.done)return[3,6];if("put"!==(r=a.value).type)return[3,3];if(!r.value)throw new Error("Invalid batch db operation");return[4,this.put(r.key,r.value)];case 2:return n.sent(),[3,5];case 3:return"del"!==r.type?[3,5]:[4,this.del(r.key)];case 4:n.sent(),n.label=5;case 5:return a=t.next(),[3,1];case 6:return[3,9];case 7:return c=n.sent(),d={error:c},[3,9];case 8:try{a&&!a.done&&(s=t.return)&&s.call(t)}finally{if(d)throw d.error}return[7];case 9:return[2]}}))}))},Trie.fromProof=function(e,t){return r(this,void 0,void 0,(function(){var a;return n(this,(function(r){switch(r.label){case 0:return a=e.map((function(e){return{type:"put",key:(0,s.keccak)(e),value:e}})),t||(t=new Trie,a[0]&&(t.root=a[0].key)),[4,t.db.batch(a)];case 1:return r.sent(),[2,t]}}))}))},Trie.prove=function(e,t){return r(this,void 0,void 0,(function(){return n(this,(function(a){return[2,this.createProof(e,t)]}))}))},Trie.createProof=function(e,t){return r(this,void 0,void 0,(function(){var a;return n(this,(function(r){switch(r.label){case 0:return[4,e.findPath(t)];case 1:return a=r.sent().stack,[2,a.map((function(e){return e.serialize()}))]}}))}))},Trie.verifyProof=function(e,t,a){return r(this,void 0,void 0,(function(){var r,o;return n(this,(function(n){switch(n.label){case 0:r=new Trie(null,e),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,Trie.fromProof(a,r)];case 2:return r=n.sent(),[3,4];case 3:throw n.sent(),new Error("Invalid proof nodes given");case 4:return n.trys.push([4,6,,7]),[4,r.get(t,!0)];case 5:return[2,n.sent()];case 6:throw"Missing node in DB"==(o=n.sent()).message?new Error("Invalid proof provided"):o;case 7:return[2]}}))}))},Trie.verifyRangeProof=function(e,t,a,r,n,o){return(0,p.verifyRangeProof)(e,t&&(0,h.bufferToNibbles)(t),a&&(0,h.bufferToNibbles)(a),r.map(h.bufferToNibbles),n,o)},Trie.prototype.createReadStream=function(){return new u.TrieReadStream(this)},Trie.prototype.copy=function(){return new Trie(this.db.copy()._leveldb,this.root)},Trie.prototype._findDbNodes=function(e){return r(this,void 0,void 0,(function(){var t,a=this;return n(this,(function(o){switch(o.label){case 0:return t=function(t,o,c,d){return r(a,void 0,void 0,(function(){return n(this,(function(a){return(0,g.isRawNode)(t)?null!==o&&d.allChildren(o,c):e(t,o,c,d),[2]}))}))},[4,this.walkTrie(this.root,t)];case 1:return o.sent(),[2]}}))}))},Trie.prototype._findValueNodes=function(e){return r(this,void 0,void 0,(function(){var t,a=this;return n(this,(function(o){switch(o.label){case 0:return t=function(t,o,c,d){return r(a,void 0,void 0,(function(){var a;return n(this,(function(r){return a=c,o instanceof g.LeafNode?(a=c.concat(o.key),e(t,o,a,d)):o instanceof g.BranchNode&&o.value?e(t,o,a,d):null!==o&&d.allChildren(o,c),[2]}))}))},[4,this.walkTrie(this.root,t)];case 1:return o.sent(),[2]}}))}))},Trie}();t.Trie=x},function(e,t,a){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a);var n=Object.getOwnPropertyDescriptor(t,a);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,r,n)}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),n=this&&this.__exportStar||function(e,t){for(var a in e)"default"===a||Object.prototype.hasOwnProperty.call(t,a)||r(t,e,a)};Object.defineProperty(t,"__esModule",{value:!0}),n(a(1749),t),n(a(333),t),n(a(192),t)},function(e,t,a){"use strict";var r=this&&this.__awaiter||function(e,t,a,r){return new(a||(a=Promise))((function(n,o){function fulfilled(e){try{step(r.next(e))}catch(e){o(e)}}function rejected(e){try{step(r.throw(e))}catch(e){o(e)}}function step(e){e.done?n(e.value):function adopt(e){return e instanceof a?e:new a((function(t){t(e)}))}(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var a,r,n,o,c={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function verb(o){return function(d){return function step(o){if(a)throw new TypeError("Generator is already executing.");for(;c;)try{if(a=1,r&&(n=2&o[0]?r.return:o[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,o[1])).done)return n;switch(r=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return c.label++,{value:o[1],done:!1};case 5:c.label++,r=o[1],o=[0];continue;case 7:o=c.ops.pop(),c.trys.pop();continue;default:if(!(n=c.trys,(n=n.length>0&&n[n.length-1])||6!==o[0]&&2!==o[0])){c=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]{"use strict";var r=a(8).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.rlphash=t.ripemd160FromArray=t.ripemd160FromString=t.ripemd160=t.sha256FromArray=t.sha256FromString=t.sha256=t.keccakFromArray=t.keccakFromHexString=t.keccakFromString=t.keccak256=t.keccak=void 0;var n=a(933),o=a(426),c=a(55),d=a(80),s=a(251);t.keccak=function(e,t){switch(void 0===t&&(t=256),(0,s.assertIsBuffer)(e),t){case 224:return(0,n.keccak224)(e);case 256:return(0,n.keccak256)(e);case 384:return(0,n.keccak384)(e);case 512:return(0,n.keccak512)(e);default:throw new Error("Invald algorithm: keccak".concat(t))}};t.keccak256=function(e){return(0,t.keccak)(e)};t.keccakFromString=function(e,a){void 0===a&&(a=256),(0,s.assertIsString)(e);var n=r.from(e,"utf8");return(0,t.keccak)(n,a)};t.keccakFromHexString=function(e,a){return void 0===a&&(a=256),(0,s.assertIsHexString)(e),(0,t.keccak)((0,d.toBuffer)(e),a)};t.keccakFromArray=function(e,a){return void 0===a&&(a=256),(0,s.assertIsArray)(e),(0,t.keccak)((0,d.toBuffer)(e),a)};var _sha256=function(e){return e=(0,d.toBuffer)(e),o("sha256").update(e).digest()};t.sha256=function(e){return(0,s.assertIsBuffer)(e),_sha256(e)};t.sha256FromString=function(e){return(0,s.assertIsString)(e),_sha256(e)};t.sha256FromArray=function(e){return(0,s.assertIsArray)(e),_sha256(e)};var _ripemd160=function(e,t){e=(0,d.toBuffer)(e);var a=o("rmd160").update(e).digest();return!0===t?(0,d.setLengthLeft)(a,32):a};t.ripemd160=function(e,t){return(0,s.assertIsBuffer)(e),_ripemd160(e,t)};t.ripemd160FromString=function(e,t){return(0,s.assertIsString)(e),_ripemd160(e,t)};t.ripemd160FromArray=function(e,t){return(0,s.assertIsArray)(e),_ripemd160(e,t)};t.rlphash=function(e){return(0,t.keccak)(c.rlp.encode(e))}},(e,t,a)=>{"use strict";var r=a(10).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.rlphash=t.ripemd160FromArray=t.ripemd160FromString=t.ripemd160=t.sha256FromArray=t.sha256FromString=t.sha256=t.keccakFromArray=t.keccakFromHexString=t.keccakFromString=t.keccak256=t.keccak=void 0;var n=a(1489),o=a(988),c=a(56),d=a(81),s=a(255);t.keccak=function(e,t){switch(void 0===t&&(t=256),(0,s.assertIsBuffer)(e),t){case 224:return(0,n.keccak224)(e);case 256:return(0,n.keccak256)(e);case 384:return(0,n.keccak384)(e);case 512:return(0,n.keccak512)(e);default:throw new Error("Invald algorithm: keccak".concat(t))}};t.keccak256=function(e){return(0,t.keccak)(e)};t.keccakFromString=function(e,a){void 0===a&&(a=256),(0,s.assertIsString)(e);var n=r.from(e,"utf8");return(0,t.keccak)(n,a)};t.keccakFromHexString=function(e,a){return void 0===a&&(a=256),(0,s.assertIsHexString)(e),(0,t.keccak)((0,d.toBuffer)(e),a)};t.keccakFromArray=function(e,a){return void 0===a&&(a=256),(0,s.assertIsArray)(e),(0,t.keccak)((0,d.toBuffer)(e),a)};var _sha256=function(e){return e=(0,d.toBuffer)(e),o("sha256").update(e).digest()};t.sha256=function(e){return(0,s.assertIsBuffer)(e),_sha256(e)};t.sha256FromString=function(e){return(0,s.assertIsString)(e),_sha256(e)};t.sha256FromArray=function(e){return(0,s.assertIsArray)(e),_sha256(e)};var _ripemd160=function(e,t){e=(0,d.toBuffer)(e);var a=o("rmd160").update(e).digest();return!0===t?(0,d.setLengthLeft)(a,32):a};t.ripemd160=function(e,t){return(0,s.assertIsBuffer)(e),_ripemd160(e,t)};t.ripemd160FromString=function(e,t){return(0,s.assertIsString)(e),_ripemd160(e,t)};t.ripemd160FromArray=function(e,t){return(0,s.assertIsArray)(e),_ripemd160(e,t)};t.rlphash=function(e){return(0,t.keccak)(c.rlp.encode(e))}},(e,t,a)=>{"use strict";var r=a(2).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.rlphash=t.ripemd160FromArray=t.ripemd160FromString=t.ripemd160=t.sha256FromArray=t.sha256FromString=t.sha256=t.keccakFromArray=t.keccakFromHexString=t.keccakFromString=t.keccak256=t.keccak=void 0;var n=a(1565),o=a(1052),c=a(57),d=a(82),s=a(262);t.keccak=function(e,t){switch(void 0===t&&(t=256),(0,s.assertIsBuffer)(e),t){case 224:return(0,n.keccak224)(e);case 256:return(0,n.keccak256)(e);case 384:return(0,n.keccak384)(e);case 512:return(0,n.keccak512)(e);default:throw new Error("Invald algorithm: keccak".concat(t))}};t.keccak256=function(e){return(0,t.keccak)(e)};t.keccakFromString=function(e,a){void 0===a&&(a=256),(0,s.assertIsString)(e);var n=r.from(e,"utf8");return(0,t.keccak)(n,a)};t.keccakFromHexString=function(e,a){return void 0===a&&(a=256),(0,s.assertIsHexString)(e),(0,t.keccak)((0,d.toBuffer)(e),a)};t.keccakFromArray=function(e,a){return void 0===a&&(a=256),(0,s.assertIsArray)(e),(0,t.keccak)((0,d.toBuffer)(e),a)};var _sha256=function(e){return e=(0,d.toBuffer)(e),o("sha256").update(e).digest()};t.sha256=function(e){return(0,s.assertIsBuffer)(e),_sha256(e)};t.sha256FromString=function(e){return(0,s.assertIsString)(e),_sha256(e)};t.sha256FromArray=function(e){return(0,s.assertIsArray)(e),_sha256(e)};var _ripemd160=function(e,t){e=(0,d.toBuffer)(e);var a=o("rmd160").update(e).digest();return!0===t?(0,d.setLengthLeft)(a,32):a};t.ripemd160=function(e,t){return(0,s.assertIsBuffer)(e),_ripemd160(e,t)};t.ripemd160FromString=function(e,t){return(0,s.assertIsString)(e),_ripemd160(e,t)};t.ripemd160FromArray=function(e,t){return(0,s.assertIsArray)(e),_ripemd160(e,t)};t.rlphash=function(e){return(0,t.keccak)(c.rlp.encode(e))}},(e,t,a)=>{"use strict";var r=a(0).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.rlphash=t.ripemd160FromArray=t.ripemd160FromString=t.ripemd160=t.sha256FromArray=t.sha256FromString=t.sha256=t.keccakFromArray=t.keccakFromHexString=t.keccakFromString=t.keccak256=t.keccak=void 0;var n=a(477),o=a(176),c=a(58),d=a(83),s=a(269);t.keccak=function(e,t){switch(void 0===t&&(t=256),(0,s.assertIsBuffer)(e),t){case 224:return(0,n.keccak224)(e);case 256:return(0,n.keccak256)(e);case 384:return(0,n.keccak384)(e);case 512:return(0,n.keccak512)(e);default:throw new Error("Invald algorithm: keccak".concat(t))}};t.keccak256=function(e){return(0,t.keccak)(e)};t.keccakFromString=function(e,a){void 0===a&&(a=256),(0,s.assertIsString)(e);var n=r.from(e,"utf8");return(0,t.keccak)(n,a)};t.keccakFromHexString=function(e,a){return void 0===a&&(a=256),(0,s.assertIsHexString)(e),(0,t.keccak)((0,d.toBuffer)(e),a)};t.keccakFromArray=function(e,a){return void 0===a&&(a=256),(0,s.assertIsArray)(e),(0,t.keccak)((0,d.toBuffer)(e),a)};var _sha256=function(e){return e=(0,d.toBuffer)(e),o("sha256").update(e).digest()};t.sha256=function(e){return(0,s.assertIsBuffer)(e),_sha256(e)};t.sha256FromString=function(e){return(0,s.assertIsString)(e),_sha256(e)};t.sha256FromArray=function(e){return(0,s.assertIsArray)(e),_sha256(e)};var _ripemd160=function(e,t){e=(0,d.toBuffer)(e);var a=o("rmd160").update(e).digest();return!0===t?(0,d.setLengthLeft)(a,32):a};t.ripemd160=function(e,t){return(0,s.assertIsBuffer)(e),_ripemd160(e,t)};t.ripemd160FromString=function(e,t){return(0,s.assertIsString)(e),_ripemd160(e,t)};t.ripemd160FromArray=function(e,t){return(0,s.assertIsArray)(e),_ripemd160(e,t)};t.rlphash=function(e){return(0,t.keccak)(c.rlp.encode(e))}},(e,t,a)=>{"use strict";var r=a(2).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.rlphash=t.ripemd160FromArray=t.ripemd160FromString=t.ripemd160=t.sha256FromArray=t.sha256FromString=t.sha256=t.keccakFromArray=t.keccakFromHexString=t.keccakFromString=t.keccak256=t.keccak=void 0;var n=a(1627),o=a(1161),c=a(59),d=a(84),s=a(280);t.keccak=function(e,t){switch(void 0===t&&(t=256),(0,s.assertIsBuffer)(e),t){case 224:return(0,n.keccak224)(e);case 256:return(0,n.keccak256)(e);case 384:return(0,n.keccak384)(e);case 512:return(0,n.keccak512)(e);default:throw new Error("Invald algorithm: keccak".concat(t))}};t.keccak256=function(e){return(0,t.keccak)(e)};t.keccakFromString=function(e,a){void 0===a&&(a=256),(0,s.assertIsString)(e);var n=r.from(e,"utf8");return(0,t.keccak)(n,a)};t.keccakFromHexString=function(e,a){return void 0===a&&(a=256),(0,s.assertIsHexString)(e),(0,t.keccak)((0,d.toBuffer)(e),a)};t.keccakFromArray=function(e,a){return void 0===a&&(a=256),(0,s.assertIsArray)(e),(0,t.keccak)((0,d.toBuffer)(e),a)};var _sha256=function(e){return e=(0,d.toBuffer)(e),o("sha256").update(e).digest()};t.sha256=function(e){return(0,s.assertIsBuffer)(e),_sha256(e)};t.sha256FromString=function(e){return(0,s.assertIsString)(e),_sha256(e)};t.sha256FromArray=function(e){return(0,s.assertIsArray)(e),_sha256(e)};var _ripemd160=function(e,t){e=(0,d.toBuffer)(e);var a=o("rmd160").update(e).digest();return!0===t?(0,d.setLengthLeft)(a,32):a};t.ripemd160=function(e,t){return(0,s.assertIsBuffer)(e),_ripemd160(e,t)};t.ripemd160FromString=function(e,t){return(0,s.assertIsString)(e),_ripemd160(e,t)};t.ripemd160FromArray=function(e,t){return(0,s.assertIsArray)(e),_ripemd160(e,t)};t.rlphash=function(e){return(0,t.keccak)(c.rlp.encode(e))}},(e,t,a)=>{"use strict";var r=a(2).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.KNOWN_CHAINIDS=t.WEI=t.BUFFER_8_ZERO=t.BUFFER_32_ZERO=t.BUFFER_ZERO=t.BUFFER_EMPTY=t.ACCOUNT_ZERO=t.BUFFER_256_ZERO=void 0,t.BUFFER_256_ZERO=r.allocUnsafe(256).fill(0),t.ACCOUNT_ZERO=t.BUFFER_256_ZERO.slice(0,20),t.BUFFER_EMPTY=r.allocUnsafe(0),t.BUFFER_ZERO=t.BUFFER_256_ZERO.slice(0,1),t.BUFFER_32_ZERO=t.BUFFER_256_ZERO.slice(0,32),t.BUFFER_8_ZERO=t.BUFFER_256_ZERO.slice(0,8),t.WEI=1000000000000000000n,t.KNOWN_CHAINIDS=new Set([1,3,4,5,42,11155111])},function(e,t,a){"use strict";var r=a(0).Buffer,n=this&&this.__read||function(e,t){var a="function"==typeof Symbol&&e[Symbol.iterator];if(!a)return e;var r,n,o=a.call(e),c=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)c.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(a=o.return)&&a.call(o)}finally{if(n)throw n.error}}return c},o=this&&this.__spreadArray||function(e,t,a){if(a||2===arguments.length)for(var r,n=0,o=t.length;n0?this._value:null},set:function(e){this._value=e},enumerable:!1,configurable:!0}),BranchNode.prototype.setBranch=function(e,t){this._branches[e]=t},BranchNode.prototype.raw=function(){return o(o([],n(this._branches),!1),[this._value],!1)},BranchNode.prototype.serialize=function(){return c.rlp.encode(this.raw())},BranchNode.prototype.hash=function(){return(0,c.keccak256)(this.serialize())},BranchNode.prototype.getBranch=function(e){var t=this._branches[e];return null!==t&&t.length>0?t:null},BranchNode.prototype.getChildren=function(){for(var e=[],t=0;t<16;t++){var a=this._branches[t];null!==a&&a.length>0&&e.push([t,a])}return e},BranchNode}();t.BranchNode=b;var u=function(){function ExtensionNode(e,t){this._nibbles=e,this._value=t}return ExtensionNode.encodeKey=function(e){return(0,s.addHexPrefix)(e,!1)},ExtensionNode.decodeKey=function(e){return(0,s.removeHexPrefix)(e)},Object.defineProperty(ExtensionNode.prototype,"key",{get:function(){return this._nibbles.slice(0)},set:function(e){this._nibbles=e},enumerable:!1,configurable:!0}),Object.defineProperty(ExtensionNode.prototype,"keyLength",{get:function(){return this._nibbles.length},enumerable:!1,configurable:!0}),Object.defineProperty(ExtensionNode.prototype,"value",{get:function(){return this._value},set:function(e){this._value=e},enumerable:!1,configurable:!0}),ExtensionNode.prototype.encodedKey=function(){return ExtensionNode.encodeKey(this._nibbles.slice(0))},ExtensionNode.prototype.raw=function(){return[(0,d.nibblesToBuffer)(this.encodedKey()),this._value]},ExtensionNode.prototype.serialize=function(){return c.rlp.encode(this.raw())},ExtensionNode.prototype.hash=function(){return(0,c.keccak256)(this.serialize())},ExtensionNode}();t.ExtensionNode=u;var h=function(){function LeafNode(e,t){this._nibbles=e,this._value=t}return LeafNode.encodeKey=function(e){return(0,s.addHexPrefix)(e,!0)},LeafNode.decodeKey=function(e){return(0,s.removeHexPrefix)(e)},Object.defineProperty(LeafNode.prototype,"key",{get:function(){return this._nibbles.slice(0)},set:function(e){this._nibbles=e},enumerable:!1,configurable:!0}),Object.defineProperty(LeafNode.prototype,"keyLength",{get:function(){return this._nibbles.length},enumerable:!1,configurable:!0}),Object.defineProperty(LeafNode.prototype,"value",{get:function(){return this._value},set:function(e){this._value=e},enumerable:!1,configurable:!0}),LeafNode.prototype.encodedKey=function(){return LeafNode.encodeKey(this._nibbles.slice(0))},LeafNode.prototype.raw=function(){return[(0,d.nibblesToBuffer)(this.encodedKey()),this._value]},LeafNode.prototype.serialize=function(){return c.rlp.encode(this.raw())},LeafNode.prototype.hash=function(){return(0,c.keccak256)(this.serialize())},LeafNode}();function decodeRawNode(e){if(17===e.length)return b.fromArray(e);if(2===e.length){var t=(0,d.bufferToNibbles)(e[0]);return(0,s.isTerminator)(t)?new h(h.decodeKey(t),e[1]):new u(u.decodeKey(t),e[1])}throw new Error("Invalid node")}t.LeafNode=h,t.decodeRawNode=decodeRawNode,t.decodeNode=function decodeNode(e){var t=c.rlp.decode(e);if(!Array.isArray(t))throw new Error("Invalid node");return decodeRawNode(t)},t.isRawNode=function isRawNode(e){return Array.isArray(e)&&!r.isBuffer(e)}},(e,t,a)=>{(t=e.exports=a(441)).Stream=t,t.Readable=t,t.Writable=a(444),t.Duplex=a(152),t.Transform=a(445),t.PassThrough=a(984),t.finished=a(256),t.pipeline=a(985)},(e,t,a)=>{(t=e.exports=a(463)).Stream=t,t.Readable=t,t.Writable=a(466),t.Duplex=a(153),t.Transform=a(467),t.PassThrough=a(1048),t.finished=a(263),t.pipeline=a(1049)},(e,t,a)=>{(t=e.exports=a(517)).Stream=t,t.Readable=t,t.Writable=a(520),t.Duplex=a(155),t.Transform=a(521),t.PassThrough=a(1157),t.finished=a(281),t.pipeline=a(1158)},(e,t)=>{"use strict";function reverse(e){const t={};return Object.keys(e).forEach((function(a){(0|a)==a&&(a|=0);const r=e[a];t[r]=a})),t}t.tagClass={0:"universal",1:"application",2:"context",3:"private"},t.tagClassByName=reverse(t.tagClass),t.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},t.tagByName=reverse(t.tag)},function(e,t,a){!function(e,t){"use strict";function assert(e,t){if(!e)throw new Error(t||"Assertion failed")}function inherits(e,t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype,e.prototype=new TempCtor,e.prototype.constructor=e}function BN(e,t,a){if(BN.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(a=t,t=10),this._init(e||0,t||10,a||"be"))}var r;"object"==typeof e?e.exports=BN:t.BN=BN,BN.BN=BN,BN.wordSize=26;try{r="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:a(1439).Buffer}catch(e){}function parseHex4Bits(e,t){var a=e.charCodeAt(t);return a>=65&&a<=70?a-55:a>=97&&a<=102?a-87:a-48&15}function parseHexByte(e,t,a){var r=parseHex4Bits(e,a);return a-1>=t&&(r|=parseHex4Bits(e,a-1)<<4),r}function parseBase(e,t,a,r){for(var n=0,o=Math.min(e.length,a),c=t;c=49?d-49+10:d>=17?d-17+10:d}return n}BN.isBN=function isBN(e){return e instanceof BN||null!==e&&"object"==typeof e&&e.constructor.wordSize===BN.wordSize&&Array.isArray(e.words)},BN.max=function max(e,t){return e.cmp(t)>0?e:t},BN.min=function min(e,t){return e.cmp(t)<0?e:t},BN.prototype._init=function init(e,t,a){if("number"==typeof e)return this._initNumber(e,t,a);if("object"==typeof e)return this._initArray(e,t,a);"hex"===t&&(t=16),assert(t===(0|t)&&t>=2&&t<=36);var r=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(r++,this.negative=1),r=0;r-=3)o=e[r]|e[r-1]<<8|e[r-2]<<16,this.words[n]|=o<>>26-c&67108863,(c+=24)>=26&&(c-=26,n++);else if("le"===a)for(r=0,n=0;r>>26-c&67108863,(c+=24)>=26&&(c-=26,n++);return this.strip()},BN.prototype._parseHex=function _parseHex(e,t,a){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)n=parseHexByte(e,t,r)<=18?(o-=18,c+=1,this.words[c]|=n>>>26):o+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(o-=18,c+=1,this.words[c]|=n>>>26):o+=8;this.strip()},BN.prototype._parseBase=function _parseBase(e,t,a){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var o=e.length-a,c=o%r,d=Math.min(o,o-c)+a,s=0,b=a;b1&&0===this.words[this.length-1];)this.length--;return this._normSign()},BN.prototype._normSign=function _normSign(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},BN.prototype.inspect=function inspect(){return(this.red?""};var n=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],o=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function smallMulTo(e,t,a){a.negative=t.negative^e.negative;var r=e.length+t.length|0;a.length=r,r=r-1|0;var n=0|e.words[0],o=0|t.words[0],c=n*o,d=67108863&c,s=c/67108864|0;a.words[0]=d;for(var b=1;b>>26,h=67108863&s,l=Math.min(b,t.length-1),g=Math.max(0,b-e.length+1);g<=l;g++){var p=b-g|0;u+=(c=(n=0|e.words[p])*(o=0|t.words[g])+h)/67108864|0,h=67108863&c}a.words[b]=0|h,s=0|u}return 0!==s?a.words[b]=0|s:a.length--,a.strip()}BN.prototype.toString=function toString(e,t){var a;if(t=0|t||1,16===(e=e||10)||"hex"===e){a="";for(var r=0,d=0,s=0;s>>24-r&16777215)||s!==this.length-1?n[6-u.length]+u+a:u+a,(r+=2)>=26&&(r-=26,s--)}for(0!==d&&(a=d.toString(16)+a);a.length%t!=0;)a="0"+a;return 0!==this.negative&&(a="-"+a),a}if(e===(0|e)&&e>=2&&e<=36){var h=o[e],l=c[e];a="";var g=this.clone();for(g.negative=0;!g.isZero();){var p=g.modn(l).toString(e);a=(g=g.idivn(l)).isZero()?p+a:n[h-p.length]+p+a}for(this.isZero()&&(a="0"+a);a.length%t!=0;)a="0"+a;return 0!==this.negative&&(a="-"+a),a}assert(!1,"Base should be between 2 and 36")},BN.prototype.toNumber=function toNumber(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&assert(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},BN.prototype.toJSON=function toJSON(){return this.toString(16)},BN.prototype.toBuffer=function toBuffer(e,t){return assert(void 0!==r),this.toArrayLike(r,e,t)},BN.prototype.toArray=function toArray(e,t){return this.toArrayLike(Array,e,t)},BN.prototype.toArrayLike=function toArrayLike(e,t,a){var r=this.byteLength(),n=a||Math.max(1,r);assert(r<=n,"byte array longer than desired length"),assert(n>0,"Requested array length <= 0"),this.strip();var o,c,d="le"===t,s=new e(n),b=this.clone();if(d){for(c=0;!b.isZero();c++)o=b.andln(255),b.iushrn(8),s[c]=o;for(;c=4096&&(a+=13,t>>>=13),t>=64&&(a+=7,t>>>=7),t>=8&&(a+=4,t>>>=4),t>=2&&(a+=2,t>>>=2),a+t},BN.prototype._zeroBits=function _zeroBits(e){if(0===e)return 26;var t=e,a=0;return 0==(8191&t)&&(a+=13,t>>>=13),0==(127&t)&&(a+=7,t>>>=7),0==(15&t)&&(a+=4,t>>>=4),0==(3&t)&&(a+=2,t>>>=2),0==(1&t)&&a++,a},BN.prototype.bitLength=function bitLength(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},BN.prototype.uor=function uor(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},BN.prototype.iuand=function iuand(e){var t;t=this.length>e.length?e:this;for(var a=0;ae.length?this.clone().iand(e):e.clone().iand(this)},BN.prototype.uand=function uand(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},BN.prototype.iuxor=function iuxor(e){var t,a;this.length>e.length?(t=this,a=e):(t=e,a=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},BN.prototype.uxor=function uxor(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},BN.prototype.inotn=function inotn(e){assert("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),a=e%26;this._expand(t),a>0&&t--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-a),this.strip()},BN.prototype.notn=function notn(e){return this.clone().inotn(e)},BN.prototype.setn=function setn(e,t){assert("number"==typeof e&&e>=0);var a=e/26|0,r=e%26;return this._expand(a+1),this.words[a]=t?this.words[a]|1<e.length?(a=this,r=e):(a=e,r=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=a.length,0!==n)this.words[this.length]=n,this.length++;else if(a!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},BN.prototype.isub=function isub(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var a,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(a=this,r=e):(a=e,r=this);for(var o=0,c=0;c>26,this.words[c]=67108863&t;for(;0!==o&&c>26,this.words[c]=67108863&t;if(0===o&&c>>13,g=0|c[1],p=8191&g,B=g>>>13,x=0|c[2],m=8191&x,I=x>>>13,y=0|c[3],C=8191&y,w=y>>>13,v=0|c[4],Q=8191&v,_=v>>>13,k=0|c[5],N=8191&k,D=k>>>13,G=0|c[6],T=8191&G,L=G>>>13,P=0|c[7],U=8191&P,q=P>>>13,O=0|c[8],H=8191&O,z=O>>>13,j=0|c[9],J=8191&j,Y=j>>>13,W=0|d[0],V=8191&W,X=W>>>13,$=0|d[1],et=8191&$,tt=$>>>13,at=0|d[2],rt=8191&at,it=at>>>13,nt=0|d[3],ot=8191&nt,ct=nt>>>13,dt=0|d[4],st=8191&dt,At=dt>>>13,bt=0|d[5],ut=8191&bt,ht=bt>>>13,pt=0|d[6],Bt=8191&pt,xt=pt>>>13,mt=0|d[7],It=8191&mt,Et=mt>>>13,yt=0|d[8],Ct=8191&yt,wt=yt>>>13,vt=0|d[9],Qt=8191&vt,Mt=vt>>>13;a.negative=e.negative^t.negative,a.length=19;var _t=(b+(r=Math.imul(h,V))|0)+((8191&(n=(n=Math.imul(h,X))+Math.imul(l,V)|0))<<13)|0;b=((o=Math.imul(l,X))+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(p,V),n=(n=Math.imul(p,X))+Math.imul(B,V)|0,o=Math.imul(B,X);var kt=(b+(r=r+Math.imul(h,et)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(l,et)|0))<<13)|0;b=((o=o+Math.imul(l,tt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(m,V),n=(n=Math.imul(m,X))+Math.imul(I,V)|0,o=Math.imul(I,X),r=r+Math.imul(p,et)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(B,et)|0,o=o+Math.imul(B,tt)|0;var St=(b+(r=r+Math.imul(h,rt)|0)|0)+((8191&(n=(n=n+Math.imul(h,it)|0)+Math.imul(l,rt)|0))<<13)|0;b=((o=o+Math.imul(l,it)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(C,V),n=(n=Math.imul(C,X))+Math.imul(w,V)|0,o=Math.imul(w,X),r=r+Math.imul(m,et)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(I,et)|0,o=o+Math.imul(I,tt)|0,r=r+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,it)|0;var Nt=(b+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,ct)|0)+Math.imul(l,ot)|0))<<13)|0;b=((o=o+Math.imul(l,ct)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,r=Math.imul(Q,V),n=(n=Math.imul(Q,X))+Math.imul(_,V)|0,o=Math.imul(_,X),r=r+Math.imul(C,et)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(w,et)|0,o=o+Math.imul(w,tt)|0,r=r+Math.imul(m,rt)|0,n=(n=n+Math.imul(m,it)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,it)|0,r=r+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,ct)|0;var Dt=(b+(r=r+Math.imul(h,st)|0)|0)+((8191&(n=(n=n+Math.imul(h,At)|0)+Math.imul(l,st)|0))<<13)|0;b=((o=o+Math.imul(l,At)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,r=Math.imul(N,V),n=(n=Math.imul(N,X))+Math.imul(D,V)|0,o=Math.imul(D,X),r=r+Math.imul(Q,et)|0,n=(n=n+Math.imul(Q,tt)|0)+Math.imul(_,et)|0,o=o+Math.imul(_,tt)|0,r=r+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(w,rt)|0,o=o+Math.imul(w,it)|0,r=r+Math.imul(m,ot)|0,n=(n=n+Math.imul(m,ct)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,ct)|0,r=r+Math.imul(p,st)|0,n=(n=n+Math.imul(p,At)|0)+Math.imul(B,st)|0,o=o+Math.imul(B,At)|0;var Rt=(b+(r=r+Math.imul(h,ut)|0)|0)+((8191&(n=(n=n+Math.imul(h,ht)|0)+Math.imul(l,ut)|0))<<13)|0;b=((o=o+Math.imul(l,ht)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(T,V),n=(n=Math.imul(T,X))+Math.imul(L,V)|0,o=Math.imul(L,X),r=r+Math.imul(N,et)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(D,et)|0,o=o+Math.imul(D,tt)|0,r=r+Math.imul(Q,rt)|0,n=(n=n+Math.imul(Q,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0,r=r+Math.imul(C,ot)|0,n=(n=n+Math.imul(C,ct)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,ct)|0,r=r+Math.imul(m,st)|0,n=(n=n+Math.imul(m,At)|0)+Math.imul(I,st)|0,o=o+Math.imul(I,At)|0,r=r+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ht)|0;var Ft=(b+(r=r+Math.imul(h,Bt)|0)|0)+((8191&(n=(n=n+Math.imul(h,xt)|0)+Math.imul(l,Bt)|0))<<13)|0;b=((o=o+Math.imul(l,xt)|0)+(n>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,r=Math.imul(U,V),n=(n=Math.imul(U,X))+Math.imul(q,V)|0,o=Math.imul(q,X),r=r+Math.imul(T,et)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(L,et)|0,o=o+Math.imul(L,tt)|0,r=r+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(D,rt)|0,o=o+Math.imul(D,it)|0,r=r+Math.imul(Q,ot)|0,n=(n=n+Math.imul(Q,ct)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,ct)|0,r=r+Math.imul(C,st)|0,n=(n=n+Math.imul(C,At)|0)+Math.imul(w,st)|0,o=o+Math.imul(w,At)|0,r=r+Math.imul(m,ut)|0,n=(n=n+Math.imul(m,ht)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ht)|0,r=r+Math.imul(p,Bt)|0,n=(n=n+Math.imul(p,xt)|0)+Math.imul(B,Bt)|0,o=o+Math.imul(B,xt)|0;var Gt=(b+(r=r+Math.imul(h,It)|0)|0)+((8191&(n=(n=n+Math.imul(h,Et)|0)+Math.imul(l,It)|0))<<13)|0;b=((o=o+Math.imul(l,Et)|0)+(n>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,r=Math.imul(H,V),n=(n=Math.imul(H,X))+Math.imul(z,V)|0,o=Math.imul(z,X),r=r+Math.imul(U,et)|0,n=(n=n+Math.imul(U,tt)|0)+Math.imul(q,et)|0,o=o+Math.imul(q,tt)|0,r=r+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,r=r+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,ct)|0,r=r+Math.imul(Q,st)|0,n=(n=n+Math.imul(Q,At)|0)+Math.imul(_,st)|0,o=o+Math.imul(_,At)|0,r=r+Math.imul(C,ut)|0,n=(n=n+Math.imul(C,ht)|0)+Math.imul(w,ut)|0,o=o+Math.imul(w,ht)|0,r=r+Math.imul(m,Bt)|0,n=(n=n+Math.imul(m,xt)|0)+Math.imul(I,Bt)|0,o=o+Math.imul(I,xt)|0,r=r+Math.imul(p,It)|0,n=(n=n+Math.imul(p,Et)|0)+Math.imul(B,It)|0,o=o+Math.imul(B,Et)|0;var Tt=(b+(r=r+Math.imul(h,Ct)|0)|0)+((8191&(n=(n=n+Math.imul(h,wt)|0)+Math.imul(l,Ct)|0))<<13)|0;b=((o=o+Math.imul(l,wt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(J,V),n=(n=Math.imul(J,X))+Math.imul(Y,V)|0,o=Math.imul(Y,X),r=r+Math.imul(H,et)|0,n=(n=n+Math.imul(H,tt)|0)+Math.imul(z,et)|0,o=o+Math.imul(z,tt)|0,r=r+Math.imul(U,rt)|0,n=(n=n+Math.imul(U,it)|0)+Math.imul(q,rt)|0,o=o+Math.imul(q,it)|0,r=r+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,ct)|0,r=r+Math.imul(N,st)|0,n=(n=n+Math.imul(N,At)|0)+Math.imul(D,st)|0,o=o+Math.imul(D,At)|0,r=r+Math.imul(Q,ut)|0,n=(n=n+Math.imul(Q,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,r=r+Math.imul(C,Bt)|0,n=(n=n+Math.imul(C,xt)|0)+Math.imul(w,Bt)|0,o=o+Math.imul(w,xt)|0,r=r+Math.imul(m,It)|0,n=(n=n+Math.imul(m,Et)|0)+Math.imul(I,It)|0,o=o+Math.imul(I,Et)|0,r=r+Math.imul(p,Ct)|0,n=(n=n+Math.imul(p,wt)|0)+Math.imul(B,Ct)|0,o=o+Math.imul(B,wt)|0;var Lt=(b+(r=r+Math.imul(h,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(h,Mt)|0)+Math.imul(l,Qt)|0))<<13)|0;b=((o=o+Math.imul(l,Mt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,r=Math.imul(J,et),n=(n=Math.imul(J,tt))+Math.imul(Y,et)|0,o=Math.imul(Y,tt),r=r+Math.imul(H,rt)|0,n=(n=n+Math.imul(H,it)|0)+Math.imul(z,rt)|0,o=o+Math.imul(z,it)|0,r=r+Math.imul(U,ot)|0,n=(n=n+Math.imul(U,ct)|0)+Math.imul(q,ot)|0,o=o+Math.imul(q,ct)|0,r=r+Math.imul(T,st)|0,n=(n=n+Math.imul(T,At)|0)+Math.imul(L,st)|0,o=o+Math.imul(L,At)|0,r=r+Math.imul(N,ut)|0,n=(n=n+Math.imul(N,ht)|0)+Math.imul(D,ut)|0,o=o+Math.imul(D,ht)|0,r=r+Math.imul(Q,Bt)|0,n=(n=n+Math.imul(Q,xt)|0)+Math.imul(_,Bt)|0,o=o+Math.imul(_,xt)|0,r=r+Math.imul(C,It)|0,n=(n=n+Math.imul(C,Et)|0)+Math.imul(w,It)|0,o=o+Math.imul(w,Et)|0,r=r+Math.imul(m,Ct)|0,n=(n=n+Math.imul(m,wt)|0)+Math.imul(I,Ct)|0,o=o+Math.imul(I,wt)|0;var Pt=(b+(r=r+Math.imul(p,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(p,Mt)|0)+Math.imul(B,Qt)|0))<<13)|0;b=((o=o+Math.imul(B,Mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,r=Math.imul(J,rt),n=(n=Math.imul(J,it))+Math.imul(Y,rt)|0,o=Math.imul(Y,it),r=r+Math.imul(H,ot)|0,n=(n=n+Math.imul(H,ct)|0)+Math.imul(z,ot)|0,o=o+Math.imul(z,ct)|0,r=r+Math.imul(U,st)|0,n=(n=n+Math.imul(U,At)|0)+Math.imul(q,st)|0,o=o+Math.imul(q,At)|0,r=r+Math.imul(T,ut)|0,n=(n=n+Math.imul(T,ht)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ht)|0,r=r+Math.imul(N,Bt)|0,n=(n=n+Math.imul(N,xt)|0)+Math.imul(D,Bt)|0,o=o+Math.imul(D,xt)|0,r=r+Math.imul(Q,It)|0,n=(n=n+Math.imul(Q,Et)|0)+Math.imul(_,It)|0,o=o+Math.imul(_,Et)|0,r=r+Math.imul(C,Ct)|0,n=(n=n+Math.imul(C,wt)|0)+Math.imul(w,Ct)|0,o=o+Math.imul(w,wt)|0;var Ut=(b+(r=r+Math.imul(m,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(m,Mt)|0)+Math.imul(I,Qt)|0))<<13)|0;b=((o=o+Math.imul(I,Mt)|0)+(n>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,r=Math.imul(J,ot),n=(n=Math.imul(J,ct))+Math.imul(Y,ot)|0,o=Math.imul(Y,ct),r=r+Math.imul(H,st)|0,n=(n=n+Math.imul(H,At)|0)+Math.imul(z,st)|0,o=o+Math.imul(z,At)|0,r=r+Math.imul(U,ut)|0,n=(n=n+Math.imul(U,ht)|0)+Math.imul(q,ut)|0,o=o+Math.imul(q,ht)|0,r=r+Math.imul(T,Bt)|0,n=(n=n+Math.imul(T,xt)|0)+Math.imul(L,Bt)|0,o=o+Math.imul(L,xt)|0,r=r+Math.imul(N,It)|0,n=(n=n+Math.imul(N,Et)|0)+Math.imul(D,It)|0,o=o+Math.imul(D,Et)|0,r=r+Math.imul(Q,Ct)|0,n=(n=n+Math.imul(Q,wt)|0)+Math.imul(_,Ct)|0,o=o+Math.imul(_,wt)|0;var qt=(b+(r=r+Math.imul(C,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(C,Mt)|0)+Math.imul(w,Qt)|0))<<13)|0;b=((o=o+Math.imul(w,Mt)|0)+(n>>>13)|0)+(qt>>>26)|0,qt&=67108863,r=Math.imul(J,st),n=(n=Math.imul(J,At))+Math.imul(Y,st)|0,o=Math.imul(Y,At),r=r+Math.imul(H,ut)|0,n=(n=n+Math.imul(H,ht)|0)+Math.imul(z,ut)|0,o=o+Math.imul(z,ht)|0,r=r+Math.imul(U,Bt)|0,n=(n=n+Math.imul(U,xt)|0)+Math.imul(q,Bt)|0,o=o+Math.imul(q,xt)|0,r=r+Math.imul(T,It)|0,n=(n=n+Math.imul(T,Et)|0)+Math.imul(L,It)|0,o=o+Math.imul(L,Et)|0,r=r+Math.imul(N,Ct)|0,n=(n=n+Math.imul(N,wt)|0)+Math.imul(D,Ct)|0,o=o+Math.imul(D,wt)|0;var Ot=(b+(r=r+Math.imul(Q,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(Q,Mt)|0)+Math.imul(_,Qt)|0))<<13)|0;b=((o=o+Math.imul(_,Mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(J,ut),n=(n=Math.imul(J,ht))+Math.imul(Y,ut)|0,o=Math.imul(Y,ht),r=r+Math.imul(H,Bt)|0,n=(n=n+Math.imul(H,xt)|0)+Math.imul(z,Bt)|0,o=o+Math.imul(z,xt)|0,r=r+Math.imul(U,It)|0,n=(n=n+Math.imul(U,Et)|0)+Math.imul(q,It)|0,o=o+Math.imul(q,Et)|0,r=r+Math.imul(T,Ct)|0,n=(n=n+Math.imul(T,wt)|0)+Math.imul(L,Ct)|0,o=o+Math.imul(L,wt)|0;var Ht=(b+(r=r+Math.imul(N,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(N,Mt)|0)+Math.imul(D,Qt)|0))<<13)|0;b=((o=o+Math.imul(D,Mt)|0)+(n>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,r=Math.imul(J,Bt),n=(n=Math.imul(J,xt))+Math.imul(Y,Bt)|0,o=Math.imul(Y,xt),r=r+Math.imul(H,It)|0,n=(n=n+Math.imul(H,Et)|0)+Math.imul(z,It)|0,o=o+Math.imul(z,Et)|0,r=r+Math.imul(U,Ct)|0,n=(n=n+Math.imul(U,wt)|0)+Math.imul(q,Ct)|0,o=o+Math.imul(q,wt)|0;var zt=(b+(r=r+Math.imul(T,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(T,Mt)|0)+Math.imul(L,Qt)|0))<<13)|0;b=((o=o+Math.imul(L,Mt)|0)+(n>>>13)|0)+(zt>>>26)|0,zt&=67108863,r=Math.imul(J,It),n=(n=Math.imul(J,Et))+Math.imul(Y,It)|0,o=Math.imul(Y,Et),r=r+Math.imul(H,Ct)|0,n=(n=n+Math.imul(H,wt)|0)+Math.imul(z,Ct)|0,o=o+Math.imul(z,wt)|0;var Kt=(b+(r=r+Math.imul(U,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(U,Mt)|0)+Math.imul(q,Qt)|0))<<13)|0;b=((o=o+Math.imul(q,Mt)|0)+(n>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,r=Math.imul(J,Ct),n=(n=Math.imul(J,wt))+Math.imul(Y,Ct)|0,o=Math.imul(Y,wt);var jt=(b+(r=r+Math.imul(H,Qt)|0)|0)+((8191&(n=(n=n+Math.imul(H,Mt)|0)+Math.imul(z,Qt)|0))<<13)|0;b=((o=o+Math.imul(z,Mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Jt=(b+(r=Math.imul(J,Qt))|0)+((8191&(n=(n=Math.imul(J,Mt))+Math.imul(Y,Qt)|0))<<13)|0;return b=((o=Math.imul(Y,Mt))+(n>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,s[0]=_t,s[1]=kt,s[2]=St,s[3]=Nt,s[4]=Dt,s[5]=Rt,s[6]=Ft,s[7]=Gt,s[8]=Tt,s[9]=Lt,s[10]=Pt,s[11]=Ut,s[12]=qt,s[13]=Ot,s[14]=Ht,s[15]=zt,s[16]=Kt,s[17]=jt,s[18]=Jt,0!==b&&(s[19]=b,a.length++),a};function jumboMulTo(e,t,a){return(new FFTM).mulp(e,t,a)}function FFTM(e,t){this.x=e,this.y=t}Math.imul||(d=smallMulTo),BN.prototype.mulTo=function mulTo(e,t){var a,r=this.length+e.length;return a=10===this.length&&10===e.length?d(this,e,t):r<63?smallMulTo(this,e,t):r<1024?function bigMulTo(e,t,a){a.negative=t.negative^e.negative,a.length=e.length+t.length;for(var r=0,n=0,o=0;o>>26)|0)>>>26,c&=67108863}a.words[o]=d,r=c,c=n}return 0!==r?a.words[o]=r:a.length--,a.strip()}(this,e,t):jumboMulTo(this,e,t),a},FFTM.prototype.makeRBT=function makeRBT(e){for(var t=new Array(e),a=BN.prototype._countBits(e)-1,r=0;r>=1;return r},FFTM.prototype.permute=function permute(e,t,a,r,n,o){for(var c=0;c>>=1)n++;return 1<>>=13,a[2*o+1]=8191&n,n>>>=13;for(o=2*t;o>=26,t+=r/67108864|0,t+=n>>>26,this.words[a]=67108863&n}return 0!==t&&(this.words[a]=t,this.length++),this},BN.prototype.muln=function muln(e){return this.clone().imuln(e)},BN.prototype.sqr=function sqr(){return this.mul(this)},BN.prototype.isqr=function isqr(){return this.imul(this.clone())},BN.prototype.pow=function pow(e){var t=function toBitArray(e){for(var t=new Array(e.bitLength()),a=0;a>>n}return t}(e);if(0===t.length)return new BN(1);for(var a=this,r=0;r=0);var t,a=e%26,r=(e-a)/26,n=67108863>>>26-a<<26-a;if(0!==a){var o=0;for(t=0;t>>26-a}o&&(this.words[t]=o,this.length++)}if(0!==r){for(t=this.length-1;t>=0;t--)this.words[t+r]=this.words[t];for(t=0;t=0),r=t?(t-t%26)/26:0;var n=e%26,o=Math.min((e-n)/26,this.length),c=67108863^67108863>>>n<o)for(this.length-=o,s=0;s=0&&(0!==b||s>=r);s--){var u=0|this.words[s];this.words[s]=b<<26-n|u>>>n,b=u&c}return d&&0!==b&&(d.words[d.length++]=b),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},BN.prototype.ishrn=function ishrn(e,t,a){return assert(0===this.negative),this.iushrn(e,t,a)},BN.prototype.shln=function shln(e){return this.clone().ishln(e)},BN.prototype.ushln=function ushln(e){return this.clone().iushln(e)},BN.prototype.shrn=function shrn(e){return this.clone().ishrn(e)},BN.prototype.ushrn=function ushrn(e){return this.clone().iushrn(e)},BN.prototype.testn=function testn(e){assert("number"==typeof e&&e>=0);var t=e%26,a=(e-t)/26,r=1<=0);var t=e%26,a=(e-t)/26;if(assert(0===this.negative,"imaskn works only with positive numbers"),this.length<=a)return this;if(0!==t&&a++,this.length=Math.min(a,this.length),0!==t){var r=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},BN.prototype.isubn=function isubn(e){if(assert("number"==typeof e),assert(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(d/67108864|0),this.words[r+a]=67108863&n}for(;r>26,this.words[r+a]=67108863&n;if(0===c)return this.strip();for(assert(-1===c),c=0,r=0;r>26,this.words[r]=67108863&n;return this.negative=1,this.strip()},BN.prototype._wordDiv=function _wordDiv(e,t){var a=(this.length,e.length),r=this.clone(),n=e,o=0|n.words[n.length-1];0!==(a=26-this._countBits(o))&&(n=n.ushln(a),r.iushln(a),o=0|n.words[n.length-1]);var c,d=r.length-n.length;if("mod"!==t){(c=new BN(null)).length=d+1,c.words=new Array(c.length);for(var s=0;s=0;u--){var h=67108864*(0|r.words[n.length+u])+(0|r.words[n.length+u-1]);for(h=Math.min(h/o|0,67108863),r._ishlnsubmul(n,h,u);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(n,1,u),r.isZero()||(r.negative^=1);c&&(c.words[u]=h)}return c&&c.strip(),r.strip(),"div"!==t&&0!==a&&r.iushrn(a),{div:c||null,mod:r}},BN.prototype.divmod=function divmod(e,t,a){return assert(!e.isZero()),this.isZero()?{div:new BN(0),mod:new BN(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(r=o.div.neg()),"div"!==t&&(n=o.mod.neg(),a&&0!==n.negative&&n.iadd(e)),{div:r,mod:n}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(r=o.div.neg()),{div:r,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(n=o.mod.neg(),a&&0!==n.negative&&n.isub(e)),{div:o.div,mod:n}):e.length>this.length||this.cmp(e)<0?{div:new BN(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new BN(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new BN(this.modn(e.words[0]))}:this._wordDiv(e,t);var r,n,o},BN.prototype.div=function div(e){return this.divmod(e,"div",!1).div},BN.prototype.mod=function mod(e){return this.divmod(e,"mod",!1).mod},BN.prototype.umod=function umod(e){return this.divmod(e,"mod",!0).mod},BN.prototype.divRound=function divRound(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var a=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),o=a.cmp(r);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},BN.prototype.modn=function modn(e){assert(e<=67108863);for(var t=(1<<26)%e,a=0,r=this.length-1;r>=0;r--)a=(t*a+(0|this.words[r]))%e;return a},BN.prototype.idivn=function idivn(e){assert(e<=67108863);for(var t=0,a=this.length-1;a>=0;a--){var r=(0|this.words[a])+67108864*t;this.words[a]=r/e|0,t=r%e}return this.strip()},BN.prototype.divn=function divn(e){return this.clone().idivn(e)},BN.prototype.egcd=function egcd(e){assert(0===e.negative),assert(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r=new BN(1),n=new BN(0),o=new BN(0),c=new BN(1),d=0;t.isEven()&&a.isEven();)t.iushrn(1),a.iushrn(1),++d;for(var s=a.clone(),b=t.clone();!t.isZero();){for(var u=0,h=1;0==(t.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(t.iushrn(u);u-- >0;)(r.isOdd()||n.isOdd())&&(r.iadd(s),n.isub(b)),r.iushrn(1),n.iushrn(1);for(var l=0,g=1;0==(a.words[0]&g)&&l<26;++l,g<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(o.isOdd()||c.isOdd())&&(o.iadd(s),c.isub(b)),o.iushrn(1),c.iushrn(1);t.cmp(a)>=0?(t.isub(a),r.isub(o),n.isub(c)):(a.isub(t),o.isub(r),c.isub(n))}return{a:o,b:c,gcd:a.iushln(d)}},BN.prototype._invmp=function _invmp(e){assert(0===e.negative),assert(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r,n=new BN(1),o=new BN(0),c=a.clone();t.cmpn(1)>0&&a.cmpn(1)>0;){for(var d=0,s=1;0==(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0)for(t.iushrn(d);d-- >0;)n.isOdd()&&n.iadd(c),n.iushrn(1);for(var b=0,u=1;0==(a.words[0]&u)&&b<26;++b,u<<=1);if(b>0)for(a.iushrn(b);b-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);t.cmp(a)>=0?(t.isub(a),n.isub(o)):(a.isub(t),o.isub(n))}return(r=0===t.cmpn(1)?n:o).cmpn(0)<0&&r.iadd(e),r},BN.prototype.gcd=function gcd(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),a=e.clone();t.negative=0,a.negative=0;for(var r=0;t.isEven()&&a.isEven();r++)t.iushrn(1),a.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;a.isEven();)a.iushrn(1);var n=t.cmp(a);if(n<0){var o=t;t=a,a=o}else if(0===n||0===a.cmpn(1))break;t.isub(a)}return a.iushln(r)},BN.prototype.invm=function invm(e){return this.egcd(e).a.umod(e)},BN.prototype.isEven=function isEven(){return 0==(1&this.words[0])},BN.prototype.isOdd=function isOdd(){return 1==(1&this.words[0])},BN.prototype.andln=function andln(e){return this.words[0]&e},BN.prototype.bincn=function bincn(e){assert("number"==typeof e);var t=e%26,a=(e-t)/26,r=1<>>26,c&=67108863,this.words[o]=c}return 0!==n&&(this.words[o]=n,this.length++),this},BN.prototype.isZero=function isZero(){return 1===this.length&&0===this.words[0]},BN.prototype.cmpn=function cmpn(e){var t,a=e<0;if(0!==this.negative&&!a)return-1;if(0===this.negative&&a)return 1;if(this.strip(),this.length>1)t=1;else{a&&(e=-e),assert(e<=67108863,"Number is too big");var r=0|this.words[0];t=r===e?0:re.length)return 1;if(this.length=0;a--){var r=0|this.words[a],n=0|e.words[a];if(r!==n){rn&&(t=1);break}}return t},BN.prototype.gtn=function gtn(e){return 1===this.cmpn(e)},BN.prototype.gt=function gt(e){return 1===this.cmp(e)},BN.prototype.gten=function gten(e){return this.cmpn(e)>=0},BN.prototype.gte=function gte(e){return this.cmp(e)>=0},BN.prototype.ltn=function ltn(e){return-1===this.cmpn(e)},BN.prototype.lt=function lt(e){return-1===this.cmp(e)},BN.prototype.lten=function lten(e){return this.cmpn(e)<=0},BN.prototype.lte=function lte(e){return this.cmp(e)<=0},BN.prototype.eqn=function eqn(e){return 0===this.cmpn(e)},BN.prototype.eq=function eq(e){return 0===this.cmp(e)},BN.red=function red(e){return new Red(e)},BN.prototype.toRed=function toRed(e){return assert(!this.red,"Already a number in reduction context"),assert(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},BN.prototype.fromRed=function fromRed(){return assert(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},BN.prototype._forceRed=function _forceRed(e){return this.red=e,this},BN.prototype.forceRed=function forceRed(e){return assert(!this.red,"Already a number in reduction context"),this._forceRed(e)},BN.prototype.redAdd=function redAdd(e){return assert(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},BN.prototype.redIAdd=function redIAdd(e){return assert(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},BN.prototype.redSub=function redSub(e){return assert(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},BN.prototype.redISub=function redISub(e){return assert(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},BN.prototype.redShl=function redShl(e){return assert(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},BN.prototype.redMul=function redMul(e){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},BN.prototype.redIMul=function redIMul(e){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},BN.prototype.redSqr=function redSqr(){return assert(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},BN.prototype.redISqr=function redISqr(){return assert(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},BN.prototype.redSqrt=function redSqrt(){return assert(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},BN.prototype.redInvm=function redInvm(){return assert(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},BN.prototype.redNeg=function redNeg(){return assert(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},BN.prototype.redPow=function redPow(e){return assert(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var s={k256:null,p224:null,p192:null,p25519:null};function MPrime(e,t){this.name=e,this.p=new BN(t,16),this.n=this.p.bitLength(),this.k=new BN(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function Red(e){if("string"==typeof e){var t=BN._prime(e);this.m=t.p,this.prime=t}else assert(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function Mont(e){Red.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new BN(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}MPrime.prototype._tmp=function _tmp(){var e=new BN(null);return e.words=new Array(Math.ceil(this.n/13)),e},MPrime.prototype.ireduce=function ireduce(e){var t,a=e;do{this.split(a,this.tmp),t=(a=(a=this.imulK(a)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?a.isub(this.p):void 0!==a.strip?a.strip():a._strip(),a},MPrime.prototype.split=function split(e,t){e.iushrn(this.n,0,t)},MPrime.prototype.imulK=function imulK(e){return e.imul(this.k)},inherits(K256,MPrime),K256.prototype.split=function split(e,t){for(var a=4194303,r=Math.min(e.length,9),n=0;n>>22,o=c}o>>>=22,e.words[n-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},K256.prototype.imulK=function imulK(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,a=0;a>>=26,e.words[a]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},BN._prime=function prime(e){if(s[e])return s[e];var prime;if("k256"===e)prime=new K256;else if("p224"===e)prime=new P224;else if("p192"===e)prime=new P192;else{if("p25519"!==e)throw new Error("Unknown prime "+e);prime=new P25519}return s[e]=prime,prime},Red.prototype._verify1=function _verify1(e){assert(0===e.negative,"red works only with positives"),assert(e.red,"red works only with red numbers")},Red.prototype._verify2=function _verify2(e,t){assert(0==(e.negative|t.negative),"red works only with positives"),assert(e.red&&e.red===t.red,"red works only with red numbers")},Red.prototype.imod=function imod(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},Red.prototype.neg=function neg(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},Red.prototype.add=function add(e,t){this._verify2(e,t);var a=e.add(t);return a.cmp(this.m)>=0&&a.isub(this.m),a._forceRed(this)},Red.prototype.iadd=function iadd(e,t){this._verify2(e,t);var a=e.iadd(t);return a.cmp(this.m)>=0&&a.isub(this.m),a},Red.prototype.sub=function sub(e,t){this._verify2(e,t);var a=e.sub(t);return a.cmpn(0)<0&&a.iadd(this.m),a._forceRed(this)},Red.prototype.isub=function isub(e,t){this._verify2(e,t);var a=e.isub(t);return a.cmpn(0)<0&&a.iadd(this.m),a},Red.prototype.shl=function shl(e,t){return this._verify1(e),this.imod(e.ushln(t))},Red.prototype.imul=function imul(e,t){return this._verify2(e,t),this.imod(e.imul(t))},Red.prototype.mul=function mul(e,t){return this._verify2(e,t),this.imod(e.mul(t))},Red.prototype.isqr=function isqr(e){return this.imul(e,e.clone())},Red.prototype.sqr=function sqr(e){return this.mul(e,e)},Red.prototype.sqrt=function sqrt(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(assert(t%2==1),3===t){var a=this.m.add(new BN(1)).iushrn(2);return this.pow(e,a)}for(var r=this.m.subn(1),n=0;!r.isZero()&&0===r.andln(1);)n++,r.iushrn(1);assert(!r.isZero());var o=new BN(1).toRed(this),c=o.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new BN(2*s*s).toRed(this);0!==this.pow(s,d).cmp(c);)s.redIAdd(c);for(var b=this.pow(s,r),u=this.pow(e,r.addn(1).iushrn(1)),h=this.pow(e,r),l=n;0!==h.cmp(o);){for(var g=h,p=0;0!==g.cmp(o);p++)g=g.redSqr();assert(p=0;r--){for(var s=t.words[r],b=d-1;b>=0;b--){var u=s>>b&1;n!==a[0]&&(n=this.sqr(n)),0!==u||0!==o?(o<<=1,o|=u,(4===++c||0===r&&0===b)&&(n=this.mul(n,a[o]),c=0,o=0)):c=0}d=26}return n},Red.prototype.convertTo=function convertTo(e){var t=e.umod(this.m);return t===e?t.clone():t},Red.prototype.convertFrom=function convertFrom(e){var t=e.clone();return t.red=null,t},BN.mont=function mont(e){return new Mont(e)},inherits(Mont,Red),Mont.prototype.convertTo=function convertTo(e){return this.imod(e.ushln(this.shift))},Mont.prototype.convertFrom=function convertFrom(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},Mont.prototype.imul=function imul(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var a=e.imul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},Mont.prototype.mul=function mul(e,t){if(e.isZero()||t.isZero())return new BN(0)._forceRed(this);var a=e.mul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},Mont.prototype.invm=function invm(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=a.nmd(e),this)},(e,t,a)=>{"use strict";var r=a(249),n=a(248),o=n("%Function.prototype.apply%"),c=n("%Function.prototype.call%"),d=n("%Reflect.apply%",!0)||r.call(c,o),s=n("%Object.getOwnPropertyDescriptor%",!0),b=n("%Object.defineProperty%",!0),u=n("%Math.max%");if(b)try{b({},"a",{value:1})}catch(e){b=null}e.exports=function callBind(e){var t=d(r,c,arguments);if(s&&b){var a=s(t,"length");a.configurable&&b(t,"length",{value:1+u(0,e.length-(arguments.length-1))})}return t};var h=function applyBind(){return d(r,o,arguments)};b?b(e.exports,"apply",{value:h}):e.exports.apply=h},(e,t,a)=>{"use strict";var r=a(8).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.rlphash=t.ripemd160=t.sha256=t.keccak256=t.keccak=void 0;var n=a(933),o=n.keccak224,c=n.keccak384,d=n.keccak256,s=n.keccak512,b=a(426),u=a(126),h=a(246),l=a(117);t.keccak=function(e,t){switch(void 0===t&&(t=256),e="string"!=typeof e||u.isHexString(e)?l.toBuffer(e):r.from(e,"utf8"),t||(t=256),t){case 224:return o(e);case 256:return d(e);case 384:return c(e);case 512:return s(e);default:throw new Error("Invald algorithm: keccak"+t)}},t.keccak256=function(e){return t.keccak(e)},t.sha256=function(e){return e=l.toBuffer(e),b("sha256").update(e).digest()},t.ripemd160=function(e,t){e=l.toBuffer(e);var a=b("rmd160").update(e).digest();return!0===t?l.setLength(a,32):a},t.rlphash=function(e){return t.keccak(h.encode(e))}},(e,t,a)=>{"use strict";const r=a(1199),n=a(287),o=a(1215);e.exports=function(t,a,c){return"object"!=typeof a||c?(c||(c={}),n(o(r(t,a,c),c),c)):e.exports(t,null,a)}},function(e,t,a){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TransientStorage=t.DefaultStateManager=t.BaseStateManager=void 0;var n=a(609);Object.defineProperty(t,"BaseStateManager",{enumerable:!0,get:function(){return n.BaseStateManager}});var o=a(626);Object.defineProperty(t,"DefaultStateManager",{enumerable:!0,get:function(){return r(o).default}});var c=a(688);Object.defineProperty(t,"TransientStorage",{enumerable:!0,get:function(){return r(c).default}})},function(e,t,a){"use strict";var r=a(0).Buffer,n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(a(4)),c=a(1),d=256,s=function(){function Bloom(e){e?((0,o.default)(e.length===d,"bitvectors must be 2048 bits long"),this.bitvector=e):this.bitvector=(0,c.zeros)(d)}return Bloom.prototype.add=function(e){(0,o.default)(r.isBuffer(e),"Element should be buffer"),e=(0,c.keccak256)(e);for(var t=0;t<3;t++){var a=2047&e.readUInt16BE(2*t),n=a>>3,s=1<>3,b=1<e.length+t.length}),n){const e={"user-agent":o};s&&(e.origin=s),n.password=n.username="";const t=n.host.endsWith(".infura.io");BaseHandler.setAuthHeaders(a,e),BaseHandler.setUserHeaders(a,e,!t),this.headers=e}}setCache(e){this.persistentCache=e}static setAuthHeaders(e,t){if(null!=e.username||null!=e.password){if(null!=e.jwt)throw new Error("Authentication via both username/password (Basic) and JWT (Bearer) is not possible");t.authorization=`Basic ${r.from(`${e.username||""}:${e.password||""}`).toString("base64")}`}else e.jwt&&(t.authorization=`Bearer ${e.jwt}`)}static setUserHeaders(e,t,a){const r=e.headers;if(r)for(let e=0,n=r.length;e{if(e.notFound)return null;throw e}));return null!=r?{result:JSON.parse(r).result,raw:r}:void 0}async queueRequest(e,t,a,n,c={disableCache:!1}){if(!c.disableCache){const n=this.getFromMemCache(a);if(void 0!==n)return n;const o=await this.getFromSlowCache(e,t,a);if(void 0!==o)return this.valueCache.set(a,r.from(o.raw)),o.result}const d=this.limiter.handle(n).then((async({response:n,raw:d})=>{if(this.abortSignal.aborted)return Promise.reject(new s.AbortError);if((0,o.hasOwn)(n,"result")){if(!c.disableCache&&(this.valueCache.set(a,d),this.persistentCache)){const n=this.persistentCache.put(e,t,a,"string"==typeof d?r.from(d):d).catch((e=>{}));this.fireForget.add(n),n.finally((()=>{this.fireForget.delete(n)}))}return n.result}if((0,o.hasOwn)(n,"error")&&null!=n.error){const{error:e}=n;throw new s.CodedError(e.message,e.code)}throw new Error(`Invalid response from fork provider: \`${JSON.stringify(n)}\``)}));return this.requestCache.set(a,d),await d}async close(){await Promise.all(this.fireForget.keys()),this.persistentCache&&await this.persistentCache.close()}}t.BaseHandler=BaseHandler,BaseHandler.JSONRPC_PREFIX='{"jsonrpc":"2.0","id":'},(e,t,a)=>{"use strict";var r=a(122).a.ERR_STREAM_PREMATURE_CLOSE;function noop(){}e.exports=function eos(e,t,a){if("function"==typeof t)return eos(e,null,t);t||(t={}),a=function once(e){var t=!1;return function(){if(!t){t=!0;for(var a=arguments.length,r=new Array(a),n=0;n{var r=a(1409),n=a(1418),o=a(844);t.createCipher=t.Cipher=r.createCipher,t.createCipheriv=t.Cipheriv=r.createCipheriv,t.createDecipher=t.Decipher=n.createDecipher,t.createDecipheriv=t.Decipheriv=n.createDecipheriv,t.listCiphers=t.getCiphers=function getCiphers(){return Object.keys(o)}},(e,t,a)=>{var r={ECB:a(1410),CBC:a(1411),CFB:a(1412),CFB8:a(1413),CFB1:a(1414),OFB:a(1415),CTR:a(1383),GCM:a(1383)},n=a(844);for(var o in n)n[o].module=r[n[o].mode];e.exports=n},(e,t,a)=>{var r=a(7).Buffer;function asUInt32Array(e){r.isBuffer(e)||(e=r.from(e));for(var t=e.length/4|0,a=new Array(t),n=0;n>>24]^u[p>>>16&255]^h[B>>>8&255]^l[255&x]^t[m++],c=b[p>>>24]^u[B>>>16&255]^h[x>>>8&255]^l[255&g]^t[m++],d=b[B>>>24]^u[x>>>16&255]^h[g>>>8&255]^l[255&p]^t[m++],s=b[x>>>24]^u[g>>>16&255]^h[p>>>8&255]^l[255&B]^t[m++],g=o,p=c,B=d,x=s;return o=(r[g>>>24]<<24|r[p>>>16&255]<<16|r[B>>>8&255]<<8|r[255&x])^t[m++],c=(r[p>>>24]<<24|r[B>>>16&255]<<16|r[x>>>8&255]<<8|r[255&g])^t[m++],d=(r[B>>>24]<<24|r[x>>>16&255]<<16|r[g>>>8&255]<<8|r[255&p])^t[m++],s=(r[x>>>24]<<24|r[g>>>16&255]<<16|r[p>>>8&255]<<8|r[255&B])^t[m++],[o>>>=0,c>>>=0,d>>>=0,s>>>=0]}var n=[0,1,2,4,8,16,32,64,128,27,54],o=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var a=[],r=[],n=[[],[],[],[]],o=[[],[],[],[]],c=0,d=0,s=0;s<256;++s){var b=d^d<<1^d<<2^d<<3^d<<4;b=b>>>8^255&b^99,a[c]=b,r[b]=c;var u=e[c],h=e[u],l=e[h],g=257*e[b]^16843008*b;n[0][c]=g<<24|g>>>8,n[1][c]=g<<16|g>>>16,n[2][c]=g<<8|g>>>24,n[3][c]=g,g=16843009*l^65537*h^257*u^16843008*c,o[0][b]=g<<24|g>>>8,o[1][b]=g<<16|g>>>16,o[2][b]=g<<8|g>>>24,o[3][b]=g,0===c?c=d=1:(c=u^e[e[e[l^u]]],d^=e[e[d]])}return{SBOX:a,INV_SBOX:r,SUB_MIX:n,INV_SUB_MIX:o}}();function AES(e){this._key=asUInt32Array(e),this._reset()}AES.blockSize=16,AES.keySize=32,AES.prototype.blockSize=AES.blockSize,AES.prototype.keySize=AES.keySize,AES.prototype._reset=function(){for(var e=this._key,t=e.length,a=t+6,r=4*(a+1),c=[],d=0;d>>24,s=o.SBOX[s>>>24]<<24|o.SBOX[s>>>16&255]<<16|o.SBOX[s>>>8&255]<<8|o.SBOX[255&s],s^=n[d/t|0]<<24):t>6&&d%t==4&&(s=o.SBOX[s>>>24]<<24|o.SBOX[s>>>16&255]<<16|o.SBOX[s>>>8&255]<<8|o.SBOX[255&s]),c[d]=c[d-t]^s}for(var b=[],u=0;u>>24]]^o.INV_SUB_MIX[1][o.SBOX[l>>>16&255]]^o.INV_SUB_MIX[2][o.SBOX[l>>>8&255]]^o.INV_SUB_MIX[3][o.SBOX[255&l]]}this._nRounds=a,this._keySchedule=c,this._invKeySchedule=b},AES.prototype.encryptBlockRaw=function(e){return cryptBlock(e=asUInt32Array(e),this._keySchedule,o.SUB_MIX,o.SBOX,this._nRounds)},AES.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),a=r.allocUnsafe(16);return a.writeUInt32BE(t[0],0),a.writeUInt32BE(t[1],4),a.writeUInt32BE(t[2],8),a.writeUInt32BE(t[3],12),a},AES.prototype.decryptBlock=function(e){var t=(e=asUInt32Array(e))[1];e[1]=e[3],e[3]=t;var a=cryptBlock(e,this._invKeySchedule,o.INV_SUB_MIX,o.INV_SBOX,this._nRounds),n=r.allocUnsafe(16);return n.writeUInt32BE(a[0],0),n.writeUInt32BE(a[3],4),n.writeUInt32BE(a[2],8),n.writeUInt32BE(a[1],12),n},AES.prototype.scrub=function(){scrubVec(this._keySchedule),scrubVec(this._invKeySchedule),scrubVec(this._key)},e.exports.AES=AES},(e,t,a)=>{"use strict";var r,n=a(3);e.exports=Readable,Readable.ReadableState=ReadableState;a(13).EventEmitter;var o=function EElistenerCount(e,t){return e.listeners(t).length},c=a(845),d=a(2).Buffer,s=a.g.Uint8Array||function(){};var b,u=a(1416);b=u&&u.debuglog?u.debuglog("stream"):function debug(){};var h,l,g,p=a(846),B=a(376),x=a(377).getHighWaterMark,m=a(124).a,I=m.ERR_INVALID_ARG_TYPE,y=m.ERR_STREAM_PUSH_AFTER_EOF,C=m.ERR_METHOD_NOT_IMPLEMENTED,w=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;a(6)(Readable,c);var v=B.errorOrDestroy,Q=["error","close","destroy","pause","resume"];function ReadableState(e,t,n){r=r||a(119),e=e||{},"boolean"!=typeof n&&(n=t instanceof r),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=x(this,e,"readableHighWaterMark",n),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(h||(h=a(718).a),this.decoder=new h(e.encoding),this.encoding=e.encoding)}function Readable(e){if(r=r||a(119),!(this instanceof Readable))return new Readable(e);var t=this instanceof r;this._readableState=new ReadableState(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),c.call(this)}function readableAddChunk(e,t,a,r,n){b("readableAddChunk",t);var o,c=e._readableState;if(null===t)c.reading=!1,function onEofChunk(e,t){if(b("onEofChunk"),t.ended)return;if(t.decoder){var a=t.decoder.end();a&&a.length&&(t.buffer.push(a),t.length+=t.objectMode?1:a.length)}t.ended=!0,t.sync?emitReadable(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,emitReadable_(e)))}(e,c);else if(n||(o=function chunkInvalid(e,t){var a;(function _isUint8Array(e){return d.isBuffer(e)||e instanceof s})(t)||"string"==typeof t||void 0===t||e.objectMode||(a=new I("chunk",["string","Buffer","Uint8Array"],t));return a}(c,t)),o)v(e,o);else if(c.objectMode||t&&t.length>0)if("string"==typeof t||c.objectMode||Object.getPrototypeOf(t)===d.prototype||(t=function _uint8ArrayToBuffer(e){return d.from(e)}(t)),r)c.endEmitted?v(e,new w):addChunk(e,c,t,!0);else if(c.ended)v(e,new y);else{if(c.destroyed)return!1;c.reading=!1,c.decoder&&!a?(t=c.decoder.write(t),c.objectMode||0!==t.length?addChunk(e,c,t,!1):maybeReadMore(e,c)):addChunk(e,c,t,!1)}else r||(c.reading=!1,maybeReadMore(e,c));return!c.ended&&(c.lengtht.highWaterMark&&(t.highWaterMark=function computeNewHighWaterMark(e){return e>=_?e=_:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function emitReadable(e){var t=e._readableState;b("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(b("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(emitReadable_,e))}function emitReadable_(e){var t=e._readableState;b("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,flow(e)}function maybeReadMore(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(maybeReadMore_,e,t))}function maybeReadMore_(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function nReadingNextTick(e){b("readable nexttick read 0"),e.read(0)}function resume_(e,t){b("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),flow(e),t.flowing&&!t.reading&&e.read(0)}function flow(e){var t=e._readableState;for(b("flow",t.flowing);t.flowing&&null!==e.read(););}function fromList(e,t){return 0===t.length?null:(t.objectMode?a=t.buffer.shift():!e||e>=t.length?(a=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):a=t.buffer.consume(e,t.decoder),a);var a}function endReadable(e){var t=e._readableState;b("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(endReadableNT,t,e))}function endReadableNT(e,t){if(b("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var a=t._writableState;(!a||a.autoDestroy&&a.finished)&&t.destroy()}}function indexOf(e,t){for(var a=0,r=e.length;a=t.highWaterMark:t.length>0)||t.ended))return b("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?endReadable(this):emitReadable(this),null;if(0===(e=howMuchToRead(e,t))&&t.ended)return 0===t.length&&endReadable(this),null;var r,n=t.needReadable;return b("need readable",n),(0===t.length||t.length-e0?fromList(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),a!==e&&t.ended&&endReadable(this)),null!==r&&this.emit("data",r),r},Readable.prototype._read=function(e){v(this,new C("_read()"))},Readable.prototype.pipe=function(e,t){var a=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,b("pipe count=%d opts=%j",r.pipesCount,t);var c=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?onend:unpipe;function onunpipe(t,n){b("onunpipe"),t===a&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,function cleanup(){b("cleanup"),e.removeListener("close",onclose),e.removeListener("finish",onfinish),e.removeListener("drain",d),e.removeListener("error",onerror),e.removeListener("unpipe",onunpipe),a.removeListener("end",onend),a.removeListener("end",unpipe),a.removeListener("data",ondata),s=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||d()}())}function onend(){b("onend"),e.end()}r.endEmitted?n.nextTick(c):a.once("end",c),e.on("unpipe",onunpipe);var d=function pipeOnDrain(e){return function pipeOnDrainFunctionResult(){var t=e._readableState;b("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,flow(e))}}(a);e.on("drain",d);var s=!1;function ondata(t){b("ondata");var n=e.write(t);b("dest.write",n),!1===n&&((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==indexOf(r.pipes,e))&&!s&&(b("false write response, pause",r.awaitDrain),r.awaitDrain++),a.pause())}function onerror(t){b("onerror",t),unpipe(),e.removeListener("error",onerror),0===o(e,"error")&&v(e,t)}function onclose(){e.removeListener("finish",onfinish),unpipe()}function onfinish(){b("onfinish"),e.removeListener("close",onclose),unpipe()}function unpipe(){b("unpipe"),a.unpipe(e)}return a.on("data",ondata),function prependListener(e,t,a){if("function"==typeof e.prependListener)return e.prependListener(t,a);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(a):e._events[t]=[a,e._events[t]]:e.on(t,a)}(e,"error",onerror),e.once("close",onclose),e.once("finish",onfinish),e.emit("pipe",a),r.flowing||(b("pipe resume"),a.resume()),e},Readable.prototype.unpipe=function(e){var t=this._readableState,a={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,a)),this;if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o0,!1!==r.flowing&&this.resume()):"readable"===e&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,b("on readable",r.length,r.reading),r.length?emitReadable(this):r.reading||n.nextTick(nReadingNextTick,this))),a},Readable.prototype.addListener=Readable.prototype.on,Readable.prototype.removeListener=function(e,t){var a=c.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(updateReadableListening,this),a},Readable.prototype.removeAllListeners=function(e){var t=c.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(updateReadableListening,this),t},Readable.prototype.resume=function(){var e=this._readableState;return e.flowing||(b("resume"),e.flowing=!e.readableListening,function resume(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(resume_,e,t))}(this,e)),e.paused=!1,this},Readable.prototype.pause=function(){return b("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(b("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},Readable.prototype.wrap=function(e){var t=this,a=this._readableState,r=!1;for(var n in e.on("end",(function(){if(b("wrapped end"),a.decoder&&!a.ended){var e=a.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(n){(b("wrapped data"),a.decoder&&(n=a.decoder.write(n)),a.objectMode&&null==n)||(a.objectMode||n&&n.length)&&(t.push(n)||(r=!0,e.pause()))})),e)void 0===this[n]&&"function"==typeof e[n]&&(this[n]=function methodWrap(t){return function methodWrapReturnFunction(){return e[t].apply(e,arguments)}}(n));for(var o=0;o{"use strict";var r,n=a(3);function CorkedRequest(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function onCorkedFinish(e,t,a){var r=e.entry;e.entry=null;for(;r;){var n=r.callback;t.pendingcb--,n(a),r=r.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=Writable,Writable.WritableState=WritableState;var o={deprecate:a(847)},c=a(845),d=a(2).Buffer,s=a.g.Uint8Array||function(){};var b,u=a(376),h=a(377).getHighWaterMark,l=a(124).a,g=l.ERR_INVALID_ARG_TYPE,p=l.ERR_METHOD_NOT_IMPLEMENTED,B=l.ERR_MULTIPLE_CALLBACK,x=l.ERR_STREAM_CANNOT_PIPE,m=l.ERR_STREAM_DESTROYED,I=l.ERR_STREAM_NULL_VALUES,y=l.ERR_STREAM_WRITE_AFTER_END,C=l.ERR_UNKNOWN_ENCODING,w=u.errorOrDestroy;function nop(){}function WritableState(e,t,o){r=r||a(119),e=e||{},"boolean"!=typeof o&&(o=t instanceof r),this.objectMode=!!e.objectMode,o&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=h(this,e,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var c=!1===e.decodeStrings;this.decodeStrings=!c,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function onwrite(e,t){var a=e._writableState,r=a.sync,o=a.writecb;if("function"!=typeof o)throw new B;if(function onwriteStateUpdate(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(a),t)!function onwriteError(e,t,a,r,o){--t.pendingcb,a?(n.nextTick(o,r),n.nextTick(finishMaybe,e,t),e._writableState.errorEmitted=!0,w(e,r)):(o(r),e._writableState.errorEmitted=!0,w(e,r),finishMaybe(e,t))}(e,a,r,t,o);else{var c=needFinish(a)||e.destroyed;c||a.corked||a.bufferProcessing||!a.bufferedRequest||clearBuffer(e,a),r?n.nextTick(afterWrite,e,a,c,o):afterWrite(e,a,c,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new CorkedRequest(this)}function Writable(e){var t=this instanceof(r=r||a(119));if(!t&&!b.call(Writable,this))return new Writable(e);this._writableState=new WritableState(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),c.call(this)}function doWrite(e,t,a,r,n,o,c){t.writelen=r,t.writecb=c,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new m("write")):a?e._writev(n,t.onwrite):e._write(n,o,t.onwrite),t.sync=!1}function afterWrite(e,t,a,r){a||function onwriteDrain(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),finishMaybe(e,t)}function clearBuffer(e,t){t.bufferProcessing=!0;var a=t.bufferedRequest;if(e._writev&&a&&a.next){var r=t.bufferedRequestCount,n=new Array(r),o=t.corkedRequestsFree;o.entry=a;for(var c=0,d=!0;a;)n[c]=a,a.isBuf||(d=!1),a=a.next,c+=1;n.allBuffers=d,doWrite(e,t,!0,t.length,n,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new CorkedRequest(t),t.bufferedRequestCount=0}else{for(;a;){var s=a.chunk,b=a.encoding,u=a.callback;if(doWrite(e,t,!1,t.objectMode?1:s.length,s,b,u),a=a.next,t.bufferedRequestCount--,t.writing)break}null===a&&(t.lastBufferedRequest=null)}t.bufferedRequest=a,t.bufferProcessing=!1}function needFinish(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function callFinal(e,t){e._final((function(a){t.pendingcb--,a&&w(e,a),t.prefinished=!0,e.emit("prefinish"),finishMaybe(e,t)}))}function finishMaybe(e,t){var a=needFinish(t);if(a&&(function prefinish(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,n.nextTick(callFinal,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return a}a(6)(Writable,c),WritableState.prototype.getBuffer=function getBuffer(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:o.deprecate((function writableStateBufferGetter(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(b=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function value(e){return!!b.call(this,e)||this===Writable&&(e&&e._writableState instanceof WritableState)}})):b=function realHasInstance(e){return e instanceof this},Writable.prototype.pipe=function(){w(this,new x)},Writable.prototype.write=function(e,t,a){var r=this._writableState,o=!1,c=!r.objectMode&&function _isUint8Array(e){return d.isBuffer(e)||e instanceof s}(e);return c&&!d.isBuffer(e)&&(e=function _uint8ArrayToBuffer(e){return d.from(e)}(e)),"function"==typeof t&&(a=t,t=null),c?t="buffer":t||(t=r.defaultEncoding),"function"!=typeof a&&(a=nop),r.ending?function writeAfterEnd(e,t){var a=new y;w(e,a),n.nextTick(t,a)}(this,a):(c||function validChunk(e,t,a,r){var o;return null===a?o=new I:"string"==typeof a||t.objectMode||(o=new g("chunk",["string","Buffer"],a)),!o||(w(e,o),n.nextTick(r,o),!1)}(this,r,e,a))&&(r.pendingcb++,o=function writeOrBuffer(e,t,a,r,n,o){if(!a){var c=function decodeChunk(e,t,a){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,a));return t}(t,r,n);r!==c&&(a=!0,n="buffer",r=c)}var s=t.objectMode?1:r.length;t.length+=s;var b=t.length-1))throw new C(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(Writable.prototype,"writableBuffer",{enumerable:!1,get:function get(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:!1,get:function get(){return this._writableState.highWaterMark}}),Writable.prototype._write=function(e,t,a){a(new p("_write()"))},Writable.prototype._writev=null,Writable.prototype.end=function(e,t,a){var r=this._writableState;return"function"==typeof e?(a=e,e=null,t=null):"function"==typeof t&&(a=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function endWritable(e,t,a){t.ending=!0,finishMaybe(e,t),a&&(t.finished?n.nextTick(a):e.once("finish",a));t.ended=!0,e.writable=!1}(this,r,a),this},Object.defineProperty(Writable.prototype,"writableLength",{enumerable:!1,get:function get(){return this._writableState.length}}),Object.defineProperty(Writable.prototype,"destroyed",{enumerable:!1,get:function get(){return void 0!==this._writableState&&this._writableState.destroyed},set:function set(e){this._writableState&&(this._writableState.destroyed=e)}}),Writable.prototype.destroy=u.destroy,Writable.prototype._undestroy=u.undestroy,Writable.prototype._destroy=function(e,t){t(e)}},(e,t,a)=>{"use strict";e.exports=Transform;var r=a(124).a,n=r.ERR_METHOD_NOT_IMPLEMENTED,o=r.ERR_MULTIPLE_CALLBACK,c=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,d=r.ERR_TRANSFORM_WITH_LENGTH_0,s=a(119);function afterTransform(e,t){var a=this._transformState;a.transforming=!1;var r=a.writecb;if(null===r)return this.emit("error",new o);a.writechunk=null,a.writecb=null,null!=t&&this.push(t),r(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length{"use strict";var r=a(6),n=a(381),o=a(7).Buffer,c=new Array(16);function MD5(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function rotl(e,t){return e<>>32-t}function fnF(e,t,a,r,n,o,c){return rotl(e+(t&a|~t&r)+n+o|0,c)+t|0}function fnG(e,t,a,r,n,o,c){return rotl(e+(t&r|a&~r)+n+o|0,c)+t|0}function fnH(e,t,a,r,n,o,c){return rotl(e+(t^a^r)+n+o|0,c)+t|0}function fnI(e,t,a,r,n,o,c){return rotl(e+(a^(t|~r))+n+o|0,c)+t|0}r(MD5,n),MD5.prototype._update=function(){for(var e=c,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var a=this._a,r=this._b,n=this._c,o=this._d;a=fnF(a,r,n,o,e[0],3614090360,7),o=fnF(o,a,r,n,e[1],3905402710,12),n=fnF(n,o,a,r,e[2],606105819,17),r=fnF(r,n,o,a,e[3],3250441966,22),a=fnF(a,r,n,o,e[4],4118548399,7),o=fnF(o,a,r,n,e[5],1200080426,12),n=fnF(n,o,a,r,e[6],2821735955,17),r=fnF(r,n,o,a,e[7],4249261313,22),a=fnF(a,r,n,o,e[8],1770035416,7),o=fnF(o,a,r,n,e[9],2336552879,12),n=fnF(n,o,a,r,e[10],4294925233,17),r=fnF(r,n,o,a,e[11],2304563134,22),a=fnF(a,r,n,o,e[12],1804603682,7),o=fnF(o,a,r,n,e[13],4254626195,12),n=fnF(n,o,a,r,e[14],2792965006,17),a=fnG(a,r=fnF(r,n,o,a,e[15],1236535329,22),n,o,e[1],4129170786,5),o=fnG(o,a,r,n,e[6],3225465664,9),n=fnG(n,o,a,r,e[11],643717713,14),r=fnG(r,n,o,a,e[0],3921069994,20),a=fnG(a,r,n,o,e[5],3593408605,5),o=fnG(o,a,r,n,e[10],38016083,9),n=fnG(n,o,a,r,e[15],3634488961,14),r=fnG(r,n,o,a,e[4],3889429448,20),a=fnG(a,r,n,o,e[9],568446438,5),o=fnG(o,a,r,n,e[14],3275163606,9),n=fnG(n,o,a,r,e[3],4107603335,14),r=fnG(r,n,o,a,e[8],1163531501,20),a=fnG(a,r,n,o,e[13],2850285829,5),o=fnG(o,a,r,n,e[2],4243563512,9),n=fnG(n,o,a,r,e[7],1735328473,14),a=fnH(a,r=fnG(r,n,o,a,e[12],2368359562,20),n,o,e[5],4294588738,4),o=fnH(o,a,r,n,e[8],2272392833,11),n=fnH(n,o,a,r,e[11],1839030562,16),r=fnH(r,n,o,a,e[14],4259657740,23),a=fnH(a,r,n,o,e[1],2763975236,4),o=fnH(o,a,r,n,e[4],1272893353,11),n=fnH(n,o,a,r,e[7],4139469664,16),r=fnH(r,n,o,a,e[10],3200236656,23),a=fnH(a,r,n,o,e[13],681279174,4),o=fnH(o,a,r,n,e[0],3936430074,11),n=fnH(n,o,a,r,e[3],3572445317,16),r=fnH(r,n,o,a,e[6],76029189,23),a=fnH(a,r,n,o,e[9],3654602809,4),o=fnH(o,a,r,n,e[12],3873151461,11),n=fnH(n,o,a,r,e[15],530742520,16),a=fnI(a,r=fnH(r,n,o,a,e[2],3299628645,23),n,o,e[0],4096336452,6),o=fnI(o,a,r,n,e[7],1126891415,10),n=fnI(n,o,a,r,e[14],2878612391,15),r=fnI(r,n,o,a,e[5],4237533241,21),a=fnI(a,r,n,o,e[12],1700485571,6),o=fnI(o,a,r,n,e[3],2399980690,10),n=fnI(n,o,a,r,e[10],4293915773,15),r=fnI(r,n,o,a,e[1],2240044497,21),a=fnI(a,r,n,o,e[8],1873313359,6),o=fnI(o,a,r,n,e[15],4264355552,10),n=fnI(n,o,a,r,e[6],2734768916,15),r=fnI(r,n,o,a,e[13],1309151649,21),a=fnI(a,r,n,o,e[4],4149444226,6),o=fnI(o,a,r,n,e[11],3174756917,10),n=fnI(n,o,a,r,e[2],718787259,15),r=fnI(r,n,o,a,e[9],3951481745,21),this._a=this._a+a|0,this._b=this._b+r|0,this._c=this._c+n|0,this._d=this._d+o|0},MD5.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=MD5},(e,t,a)=>{"use strict";var r=a(2).Buffer,n=a(6),o=a(381),c=new Array(16),d=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],s=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],b=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],u=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],h=[0,1518500249,1859775393,2400959708,2840853838],l=[1352829926,1548603684,1836072691,2053994217,0];function RIPEMD160(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function rotl(e,t){return e<>>32-t}function fn1(e,t,a,r,n,o,c,d){return rotl(e+(t^a^r)+o+c|0,d)+n|0}function fn2(e,t,a,r,n,o,c,d){return rotl(e+(t&a|~t&r)+o+c|0,d)+n|0}function fn3(e,t,a,r,n,o,c,d){return rotl(e+((t|~a)^r)+o+c|0,d)+n|0}function fn4(e,t,a,r,n,o,c,d){return rotl(e+(t&r|a&~r)+o+c|0,d)+n|0}function fn5(e,t,a,r,n,o,c,d){return rotl(e+(t^(a|~r))+o+c|0,d)+n|0}n(RIPEMD160,o),RIPEMD160.prototype._update=function(){for(var e=c,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var a=0|this._a,r=0|this._b,n=0|this._c,o=0|this._d,g=0|this._e,p=0|this._a,B=0|this._b,x=0|this._c,m=0|this._d,I=0|this._e,y=0;y<80;y+=1){var C,w;y<16?(C=fn1(a,r,n,o,g,e[d[y]],h[0],b[y]),w=fn5(p,B,x,m,I,e[s[y]],l[0],u[y])):y<32?(C=fn2(a,r,n,o,g,e[d[y]],h[1],b[y]),w=fn4(p,B,x,m,I,e[s[y]],l[1],u[y])):y<48?(C=fn3(a,r,n,o,g,e[d[y]],h[2],b[y]),w=fn3(p,B,x,m,I,e[s[y]],l[2],u[y])):y<64?(C=fn4(a,r,n,o,g,e[d[y]],h[3],b[y]),w=fn2(p,B,x,m,I,e[s[y]],l[3],u[y])):(C=fn5(a,r,n,o,g,e[d[y]],h[4],b[y]),w=fn1(p,B,x,m,I,e[s[y]],l[4],u[y])),a=g,g=o,o=rotl(n,10),n=r,r=C,p=I,I=m,m=rotl(x,10),x=B,B=w}var v=this._b+n+m|0;this._b=this._c+o+I|0,this._c=this._d+g+p|0,this._d=this._e+a+B|0,this._e=this._a+r+x|0,this._a=v},RIPEMD160.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=r.alloc?r.alloc(20):new r(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=RIPEMD160},(e,t,a)=>{var r=e.exports=function SHA(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};r.sha=a(851),r.sha1=a(852),r.sha224=a(853),r.sha256=a(382),r.sha384=a(854),r.sha512=a(383)},(e,t,a)=>{"use strict";var r=a(38);function Cipher(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}e.exports=Cipher,Cipher.prototype._init=function _init(){},Cipher.prototype.update=function update(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},Cipher.prototype._buffer=function _buffer(e,t){for(var a=Math.min(this.buffer.length-this.bufferOff,e.length-t),r=0;r0;r--)t+=this._buffer(e,t),a+=this._flushBuffer(n,a);return t+=this._buffer(e,t),n},Cipher.prototype.final=function final(e){var t,a;return e&&(t=this.update(e)),a="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(a):a},Cipher.prototype._pad=function _pad(e,t){if(0===t)return!1;for(;t{var r;function Rand(e){this.rand=e}if(e.exports=function rand(e){return r||(r=new Rand(null)),r.generate(e)},e.exports.Rand=Rand,Rand.prototype.generate=function generate(e){return this._rand(e)},Rand.prototype._rand=function _rand(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),a=0;a{var r=a(2).Buffer,n=a(721),o=a(100);function getr(e){var t,a=e.modulus.byteLength();do{t=new n(o(a))}while(t.cmp(e.modulus)>=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function crt(e,t){var a=function blind(e){var t=getr(e);return{blinder:t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(t),o=t.modulus.byteLength(),c=new n(e).mul(a.blinder).umod(t.modulus),d=c.toRed(n.mont(t.prime1)),s=c.toRed(n.mont(t.prime2)),b=t.coefficient,u=t.prime1,h=t.prime2,l=d.redPow(t.exponent1).fromRed(),g=s.redPow(t.exponent2).fromRed(),p=l.isub(g).imul(b).umod(u).imul(h);return g.iadd(p).imul(a.unblinder).umod(t.modulus).toArrayLike(r,"be",o)}crt.getr=getr,e.exports=crt},(e,t,a)=>{"use strict";var r=t;r.version=a(1430).a,r.utils=a(39),r.rand=a(236),r.curve=a(394),r.curves=a(239),r.ec=a(874),r.eddsa=a(878)},(e,t,a)=>{"use strict";var r,n=t,o=a(240),c=a(394),d=a(39).assert;function PresetCurve(e){"short"===e.type?this.curve=new c.short(e):"edwards"===e.type?this.curve=new c.edwards(e):this.curve=new c.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,d(this.g.validate(),"Invalid curve"),d(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function defineCurve(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var a=new PresetCurve(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:a}),a}})}n.PresetCurve=PresetCurve,defineCurve("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),defineCurve("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),defineCurve("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),defineCurve("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),defineCurve("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),defineCurve("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),defineCurve("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=a(873)}catch(e){r=void 0}defineCurve("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})},(e,t,a)=>{var r=t;r.utils=a(66),r.common=a(162),r.sha=a(1432),r.ripemd=a(1433),r.hmac=a(872),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},(e,t,a)=>{"use strict";var r,n=a(3),o=a(2),c=o.Buffer,d={};for(r in o)o.hasOwnProperty(r)&&"SlowBuffer"!==r&&"Buffer"!==r&&(d[r]=o[r]);var s=d.Buffer={};for(r in c)c.hasOwnProperty(r)&&"allocUnsafe"!==r&&"allocUnsafeSlow"!==r&&(s[r]=c[r]);if(d.Buffer.prototype=c.prototype,s.from&&s.from!==Uint8Array.from||(s.from=function(e,t,a){if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&void 0===e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return c(e,t,a)}),s.alloc||(s.alloc=function(e,t,a){if("number"!=typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var r=c(e);return t&&0!==t.length?"string"==typeof a?r.fill(t,a):r.fill(t):r.fill(0),r}),!d.kStringMaxLength)try{d.kStringMaxLength=n.binding("buffer").kStringMaxLength}catch(e){}d.constants||(d.constants={MAX_LENGTH:d.kMaxLength},d.kStringMaxLength&&(d.constants.MAX_STRING_LENGTH=d.kStringMaxLength)),e.exports=d},(e,t,a)=>{"use strict";const r=a(400).a,n=a(348).b,o=a(348).a,c=a(38),d=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],s=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(d);function Node(e,t,a){const r={};this._baseState=r,r.name=a,r.enc=e,r.parent=t||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}e.exports=Node;const b=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];Node.prototype.clone=function clone(){const e=this._baseState,t={};b.forEach((function(a){t[a]=e[a]}));const a=new this.constructor(t.parent);return a._baseState=t,a},Node.prototype._wrap=function wrap(){const e=this._baseState;s.forEach((function(t){this[t]=function _wrappedMethod(){const a=new this.constructor(this);return e.children.push(a),a[t].apply(a,arguments)}}),this)},Node.prototype._init=function init(e){const t=this._baseState;c(null===t.parent),e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this),c.equal(t.children.length,1,"Root node can have only one child")},Node.prototype._useArgs=function useArgs(e){const t=this._baseState,a=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==a.length&&(c(null===t.children),t.children=a,a.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(c(null===t.args),t.args=e,t.reverseArgs=e.map((function(e){if("object"!=typeof e||e.constructor!==Object)return e;const t={};return Object.keys(e).forEach((function(a){a==(0|a)&&(a|=0);const r=e[a];t[r]=a})),t})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){Node.prototype[e]=function _overrided(){const t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}})),d.forEach((function(e){Node.prototype[e]=function _tagMethod(){const t=this._baseState,a=Array.prototype.slice.call(arguments);return c(null===t.tag),t.tag=e,this._useArgs(a),this}})),Node.prototype.use=function use(e){c(e);const t=this._baseState;return c(null===t.use),t.use=e,this},Node.prototype.optional=function optional(){return this._baseState.optional=!0,this},Node.prototype.def=function def(e){const t=this._baseState;return c(null===t.default),t.default=e,t.optional=!0,this},Node.prototype.explicit=function explicit(e){const t=this._baseState;return c(null===t.explicit&&null===t.implicit),t.explicit=e,this},Node.prototype.implicit=function implicit(e){const t=this._baseState;return c(null===t.explicit&&null===t.implicit),t.implicit=e,this},Node.prototype.obj=function obj(){const e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},Node.prototype.key=function key(e){const t=this._baseState;return c(null===t.key),t.key=e,this},Node.prototype.any=function any(){return this._baseState.any=!0,this},Node.prototype.choice=function choice(e){const t=this._baseState;return c(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},Node.prototype.contains=function contains(e){const t=this._baseState;return c(null===t.use),t.contains=e,this},Node.prototype._decode=function decode(e,t){const a=this._baseState;if(null===a.parent)return e.wrapResult(a.children[0]._decode(e,t));let r,n=a.default,c=!0,d=null;if(null!==a.key&&(d=e.enterKey(a.key)),a.optional){let r=null;if(null!==a.explicit?r=a.explicit:null!==a.implicit?r=a.implicit:null!==a.tag&&(r=a.tag),null!==r||a.any){if(c=this._peekTag(e,r,a.any),e.isError(c))return c}else{const r=e.save();try{null===a.choice?this._decodeGeneric(a.tag,e,t):this._decodeChoice(e,t),c=!0}catch(e){c=!1}e.restore(r)}}if(a.obj&&c&&(r=e.enterObject()),c){if(null!==a.explicit){const t=this._decodeTag(e,a.explicit);if(e.isError(t))return t;e=t}const r=e.offset;if(null===a.use&&null===a.choice){let t;a.any&&(t=e.save());const r=this._decodeTag(e,null!==a.implicit?a.implicit:a.tag,a.any);if(e.isError(r))return r;a.any?n=e.raw(t):e=r}if(t&&t.track&&null!==a.tag&&t.track(e.path(),r,e.length,"tagged"),t&&t.track&&null!==a.tag&&t.track(e.path(),e.offset,e.length,"content"),a.any||(n=null===a.choice?this._decodeGeneric(a.tag,e,t):this._decodeChoice(e,t)),e.isError(n))return n;if(a.any||null!==a.choice||null===a.children||a.children.forEach((function decodeChildren(a){a._decode(e,t)})),a.contains&&("octstr"===a.tag||"bitstr"===a.tag)){const r=new o(n);n=this._getUse(a.contains,e._reporterState.obj)._decode(r,t)}}return a.obj&&c&&(n=e.leaveObject(r)),null===a.key||null===n&&!0!==c?null!==d&&e.exitKey(d):e.leaveKey(d,a.key,n),n},Node.prototype._decodeGeneric=function decodeGeneric(e,t,a){const r=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,r.args[0],a):/str$/.test(e)?this._decodeStr(t,e,a):"objid"===e&&r.args?this._decodeObjid(t,r.args[0],r.args[1],a):"objid"===e?this._decodeObjid(t,null,null,a):"gentime"===e||"utctime"===e?this._decodeTime(t,e,a):"null_"===e?this._decodeNull(t,a):"bool"===e?this._decodeBool(t,a):"objDesc"===e?this._decodeStr(t,e,a):"int"===e||"enum"===e?this._decodeInt(t,r.args&&r.args[0],a):null!==r.use?this._getUse(r.use,t._reporterState.obj)._decode(t,a):t.error("unknown tag: "+e)},Node.prototype._getUse=function _getUse(e,t){const a=this._baseState;return a.useDecoder=this._use(e,t),c(null===a.useDecoder._baseState.parent),a.useDecoder=a.useDecoder._baseState.children[0],a.implicit!==a.useDecoder._baseState.implicit&&(a.useDecoder=a.useDecoder.clone(),a.useDecoder._baseState.implicit=a.implicit),a.useDecoder},Node.prototype._decodeChoice=function decodeChoice(e,t){const a=this._baseState;let r=null,n=!1;return Object.keys(a.choice).some((function(o){const c=e.save(),d=a.choice[o];try{const a=d._decode(e,t);if(e.isError(a))return!1;r={type:o,value:a},n=!0}catch(t){return e.restore(c),!1}return!0}),this),n?r:e.error("Choice not matched")},Node.prototype._createEncoderBuffer=function createEncoderBuffer(e){return new n(e,this.reporter)},Node.prototype._encode=function encode(e,t,a){const r=this._baseState;if(null!==r.default&&r.default===e)return;const n=this._encodeValue(e,t,a);return void 0===n||this._skipDefault(n,t,a)?void 0:n},Node.prototype._encodeValue=function encode(e,t,a){const n=this._baseState;if(null===n.parent)return n.children[0]._encode(e,t||new r);let o=null;if(this.reporter=t,n.optional&&void 0===e){if(null===n.default)return;e=n.default}let c=null,d=!1;if(n.any)o=this._createEncoderBuffer(e);else if(n.choice)o=this._encodeChoice(e,t);else if(n.contains)c=this._getUse(n.contains,a)._encode(e,t),d=!0;else if(n.children)c=n.children.map((function(a){if("null_"===a._baseState.tag)return a._encode(null,t,e);if(null===a._baseState.key)return t.error("Child should have a key");const r=t.enterKey(a._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");const n=a._encode(e[a._baseState.key],t,e);return t.leaveKey(r),n}),this).filter((function(e){return e})),c=this._createEncoderBuffer(c);else if("seqof"===n.tag||"setof"===n.tag){if(!n.args||1!==n.args.length)return t.error("Too many args for : "+n.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");const a=this.clone();a._baseState.implicit=null,c=this._createEncoderBuffer(e.map((function(a){const r=this._baseState;return this._getUse(r.args[0],e)._encode(a,t)}),a))}else null!==n.use?o=this._getUse(n.use,a)._encode(e,t):(c=this._encodePrimitive(n.tag,e),d=!0);if(!n.any&&null===n.choice){const e=null!==n.implicit?n.implicit:n.tag,a=null===n.implicit?"universal":"context";null===e?null===n.use&&t.error("Tag could be omitted only for .use()"):null===n.use&&(o=this._encodeComposite(e,d,a,c))}return null!==n.explicit&&(o=this._encodeComposite(n.explicit,!1,"context",o)),o},Node.prototype._encodeChoice=function encodeChoice(e,t){const a=this._baseState,r=a.choice[e.type];return r||c(!1,e.type+" not found in "+JSON.stringify(Object.keys(a.choice))),r._encode(e.value,t)},Node.prototype._encodePrimitive=function encodePrimitive(e,t){const a=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&a.args)return this._encodeObjid(t,a.reverseArgs[0],a.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,a.args&&a.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},Node.prototype._isNumstr=function isNumstr(e){return/^[0-9 ]*$/.test(e)},Node.prototype._isPrintstr=function isPrintstr(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}},(e,t,a)=>{"use strict";var r=a(8).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.ecdhUnsafe=t.ecdh=t.recover=t.verify=t.sign=t.signatureImportLax=t.signatureImport=t.signatureExport=t.signatureNormalize=t.publicKeyCombine=t.publicKeyTweakMul=t.publicKeyTweakAdd=t.publicKeyVerify=t.publicKeyConvert=t.publicKeyCreate=t.privateKeyTweakMul=t.privateKeyTweakAdd=t.privateKeyModInverse=t.privateKeyNegate=t.privateKeyImport=t.privateKeyExport=t.privateKeyVerify=void 0;var n=a(204),o=a(1454),c=a(1456);t.privateKeyVerify=function(e){return 32===e.length&&n.privateKeyVerify(Uint8Array.from(e))},t.privateKeyExport=function(e,t){if(32!==e.length)throw new RangeError("private key length is invalid");var a=o.privateKeyExport(e,t);return c.privateKeyExport(e,a,t)},t.privateKeyImport=function(e){if(null!==(e=c.privateKeyImport(e))&&32===e.length&&t.privateKeyVerify(e))return e;throw new Error("couldn't import from DER format")},t.privateKeyNegate=function(e){return r.from(n.privateKeyNegate(Uint8Array.from(e)))},t.privateKeyModInverse=function(e){if(32!==e.length)throw new Error("private key length is invalid");return r.from(o.privateKeyModInverse(Uint8Array.from(e)))},t.privateKeyTweakAdd=function(e,t){return r.from(n.privateKeyTweakAdd(Uint8Array.from(e),t))},t.privateKeyTweakMul=function(e,t){return r.from(n.privateKeyTweakMul(Uint8Array.from(e),Uint8Array.from(t)))},t.publicKeyCreate=function(e,t){return r.from(n.publicKeyCreate(Uint8Array.from(e),t))},t.publicKeyConvert=function(e,t){return r.from(n.publicKeyConvert(Uint8Array.from(e),t))},t.publicKeyVerify=function(e){return(33===e.length||65===e.length)&&n.publicKeyVerify(Uint8Array.from(e))},t.publicKeyTweakAdd=function(e,t,a){return r.from(n.publicKeyTweakAdd(Uint8Array.from(e),Uint8Array.from(t),a))},t.publicKeyTweakMul=function(e,t,a){return r.from(n.publicKeyTweakMul(Uint8Array.from(e),Uint8Array.from(t),a))},t.publicKeyCombine=function(e,t){var a=[];return e.forEach((function(e){a.push(Uint8Array.from(e))})),r.from(n.publicKeyCombine(a,t))},t.signatureNormalize=function(e){return r.from(n.signatureNormalize(Uint8Array.from(e)))},t.signatureExport=function(e){return r.from(n.signatureExport(Uint8Array.from(e)))},t.signatureImport=function(e){return r.from(n.signatureImport(Uint8Array.from(e)))},t.signatureImportLax=function(e){if(0===e.length)throw new RangeError("signature length is invalid");var t=c.signatureImportLax(e);if(null===t)throw new Error("couldn't parse DER signature");return o.signatureImport(t)},t.sign=function(e,t,a){if(null===a)throw new TypeError("options should be an Object");var o=void 0;if(a){if(o={},null===a.data)throw new TypeError("options.data should be a Buffer");if(a.data){if(32!=a.data.length)throw new RangeError("options.data length is invalid");o.data=new Uint8Array(a.data)}if(null===a.noncefn)throw new TypeError("options.noncefn should be a Function");a.noncefn&&(o.noncefn=function(e,t,n,o,c){var d=null!=n?r.from(n):null,s=null!=o?r.from(o):null,b=r.from("");return a.noncefn&&(b=a.noncefn(r.from(e),r.from(t),d,s,c)),new Uint8Array(b)})}var c=n.ecdsaSign(Uint8Array.from(e),Uint8Array.from(t),o);return{signature:r.from(c.signature),recovery:c.recid}},t.verify=function(e,t,a){return n.ecdsaVerify(Uint8Array.from(t),Uint8Array.from(e),a)},t.recover=function(e,t,a,o){return r.from(n.ecdsaRecover(Uint8Array.from(t),a,Uint8Array.from(e),o))},t.ecdh=function(e,t){return r.from(n.ecdh(Uint8Array.from(e),Uint8Array.from(t),{}))},t.ecdhUnsafe=function(e,t,a){if(33!==e.length&&65!==e.length)throw new RangeError("public key length is invalid");if(32!==t.length)throw new RangeError("private key length is invalid");return r.from(o.ecdhUnsafe(Uint8Array.from(e),Uint8Array.from(t),a))}},(e,t,a)=>{"use strict";var r,n=t,o=a(245),c=a(411),d=a(40).assert;function PresetCurve(e){"short"===e.type?this.curve=new c.short(e):"edwards"===e.type?this.curve=new c.edwards(e):this.curve=new c.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,d(this.g.validate(),"Invalid curve"),d(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function defineCurve(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var a=new PresetCurve(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:a}),a}})}n.PresetCurve=PresetCurve,defineCurve("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),defineCurve("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),defineCurve("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),defineCurve("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),defineCurve("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),defineCurve("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),defineCurve("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=a(907)}catch(e){r=void 0}defineCurve("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})},(e,t,a)=>{var r=t;r.utils=a(67),r.common=a(165),r.sha=a(1449),r.ripemd=a(1450),r.hmac=a(906),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},(e,t,a)=>{"use strict";var r=a(8).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.getLength=t.decode=t.encode=void 0;var n=a(726);function safeParseInt(e,t){if("00"===e.slice(0,2))throw new Error("invalid RLP: extra zeros");return parseInt(e,t)}function encodeLength(e,t){if(e<56)return r.from([e+t]);var a=intToHex(e),n=intToHex(t+55+a.length/2);return r.from(n+a,"hex")}function _decode(e){var t,a,n,o,c,d=[],s=e[0];if(s<=127)return{data:e.slice(0,1),remainder:e.slice(1)};if(s<=183){if(t=s-127,n=128===s?r.from([]):e.slice(1,t),2===t&&n[0]<128)throw new Error("invalid rlp encoding: byte must be less 0x80");return{data:n,remainder:e.slice(t)}}if(s<=191){if(a=s-182,e.length-1e.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(o=e.slice(a,b)).length)throw new Error("invalid rlp, List has a invalid length");for(;o.length;)c=_decode(o),d.push(c.data),o=c.remainder;return{data:d,remainder:e.slice(b)}}function isHexPrefixed(e){return"0x"===e.slice(0,2)}function intToHex(e){if(e<0)throw new Error("Invalid integer as argument, must be unsigned!");var t=e.toString(16);return t.length%2?"0"+t:t}function toBuffer(e){if(!r.isBuffer(e)){if("string"==typeof e)return isHexPrefixed(e)?r.from(function padToEven(e){return e.length%2?"0"+e:e}(function stripHexPrefix(e){return"string"!=typeof e?e:isHexPrefixed(e)?e.slice(2):e}(e)),"hex"):r.from(e);if("number"==typeof e||"bigint"==typeof e)return e?function intToBuffer(e){var t=intToHex(e);return r.from(t,"hex")}(e):r.from([]);if(null==e)return r.from([]);if(e instanceof Uint8Array)return r.from(e);if(n.isBN(e))return r.from(e.toArray());throw new Error("invalid type")}return e}t.encode=function encode(e){if(Array.isArray(e)){for(var t=[],a=0;a{"use strict";var r=a(248),n=a(218),o=n(r("String.prototype.indexOf"));e.exports=function callBoundIntrinsic(e,t){var a=r(e,!!t);return"function"==typeof a&&o(e,".prototype.")>-1?n(a):a}},(e,t,a)=>{"use strict";var r,n=SyntaxError,o=Function,c=TypeError,getEvalledConstructor=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(e){}},d=Object.getOwnPropertyDescriptor;if(d)try{d({},"")}catch(e){d=null}var throwTypeError=function(){throw new c},s=d?function(){try{return throwTypeError}catch(e){try{return d(arguments,"callee").get}catch(e){return throwTypeError}}}():throwTypeError,b=a(919)(),u=Object.getPrototypeOf||function(e){return e.__proto__},h={},l="undefined"==typeof Uint8Array?r:u(Uint8Array),g={"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":b?u([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":h,"%AsyncGenerator%":h,"%AsyncGeneratorFunction%":h,"%AsyncIteratorPrototype%":h,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":h,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":b?u(u([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&b?u((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&b?u((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":b?u(""[Symbol.iterator]()):r,"%Symbol%":b?Symbol:r,"%SyntaxError%":n,"%ThrowTypeError%":s,"%TypedArray%":l,"%TypeError%":c,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet},p=function doEval(e){var t;if("%AsyncFunction%"===e)t=getEvalledConstructor("async function () {}");else if("%GeneratorFunction%"===e)t=getEvalledConstructor("function* () {}");else if("%AsyncGeneratorFunction%"===e)t=getEvalledConstructor("async function* () {}");else if("%AsyncGenerator%"===e){var a=doEval("%AsyncGeneratorFunction%");a&&(t=a.prototype)}else if("%AsyncIteratorPrototype%"===e){var r=doEval("%AsyncGenerator%");r&&(t=u(r.prototype))}return g[e]=t,t},B={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},x=a(249),m=a(921),I=x.call(Function.call,Array.prototype.concat),y=x.call(Function.apply,Array.prototype.splice),C=x.call(Function.call,String.prototype.replace),w=x.call(Function.call,String.prototype.slice),v=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Q=/\\(\\)?/g,_=function stringToPath(e){var t=w(e,0,1),a=w(e,-1);if("%"===t&&"%"!==a)throw new n("invalid intrinsic syntax, expected closing `%`");if("%"===a&&"%"!==t)throw new n("invalid intrinsic syntax, expected opening `%`");var r=[];return C(e,v,(function(e,t,a,n){r[r.length]=a?C(n,Q,"$1"):t||e})),r},k=function getBaseIntrinsic(e,t){var a,r=e;if(m(B,r)&&(r="%"+(a=B[r])[0]+"%"),m(g,r)){var o=g[r];if(o===h&&(o=p(r)),void 0===o&&!t)throw new c("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:a,name:r,value:o}}throw new n("intrinsic "+e+" does not exist!")};e.exports=function GetIntrinsic(e,t){if("string"!=typeof e||0===e.length)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new c('"allowMissing" argument must be a boolean');var a=_(e),r=a.length>0?a[0]:"",o=k("%"+r+"%",t),s=o.name,b=o.value,u=!1,h=o.alias;h&&(r=h[0],y(a,I([0,1],h)));for(var l=1,p=!0;l=a.length){var v=d(b,B);b=(p=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:b[B]}else p=m(b,B),b=b[B];p&&!u&&(g[s]=b)}}return b}},(e,t,a)=>{"use strict";var r=a(920);e.exports=Function.prototype.bind||r},(e,t,a)=>{"use strict";var r=a(127).a.ERR_STREAM_PREMATURE_CLOSE;function noop(){}e.exports=function eos(e,t,a){if("function"==typeof t)return eos(e,null,t);t||(t={}),a=function once(e){var t=!1;return function(){if(!t){t=!0;for(var a=arguments.length,r=new Array(a),n=0;n{"use strict";var r=a(8).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.assertIsString=t.assertIsArray=t.assertIsBuffer=t.assertIsHexString=void 0;var n=a(128);t.assertIsHexString=function(e){if(!(0,n.isHexString)(e)){var t="This method only supports 0x-prefixed hex strings but input was: ".concat(e);throw new Error(t)}};t.assertIsBuffer=function(e){if(!r.isBuffer(e)){var t="This method only supports Buffer but input was: ".concat(e);throw new Error(t)}};t.assertIsArray=function(e){if(!Array.isArray(e)){var t="This method only supports number arrays but input was: ".concat(e);throw new Error(t)}};t.assertIsString=function(e){if("string"!=typeof e){var t="This method only supports strings but input was: ".concat(e);throw new Error(t)}}},(e,t,a)=>{"use strict";var r=a(8).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.toType=t.TypeOutput=t.bnToRlp=t.bnToUnpaddedBuffer=t.bnToHex=void 0;var n,o=a(55),c=a(128),d=a(80);function bnToUnpaddedBuffer(e){return(0,d.unpadBuffer)(e.toArrayLike(r))}t.bnToHex=function bnToHex(e){return"0x".concat(e.toString(16))},t.bnToUnpaddedBuffer=bnToUnpaddedBuffer,t.bnToRlp=function bnToRlp(e){return bnToUnpaddedBuffer(e)},function(e){e[e.Number=0]="Number",e[e.BN=1]="BN",e[e.Buffer=2]="Buffer",e[e.PrefixedHexString=3]="PrefixedHexString"}(n=t.TypeOutput||(t.TypeOutput={})),t.toType=function toType(e,t){if(null===e)return null;if(void 0!==e){if("string"==typeof e&&!(0,c.isHexString)(e))throw new Error("A string must be provided with a 0x-prefix, given: ".concat(e));if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");var a=(0,d.toBuffer)(e);if(t===n.Buffer)return a;if(t===n.BN)return new o.BN(a);if(t===n.Number){var r=new o.BN(a),s=new o.BN(Number.MAX_SAFE_INTEGER.toString());if(r.gt(s))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return r.toNumber()}return"0x".concat(a.toString("hex"))}}},(e,t,a)=>{"use strict";var r,n=t,o=a(254),c=a(438),d=a(41).assert;function PresetCurve(e){"short"===e.type?this.curve=new c.short(e):"edwards"===e.type?this.curve=new c.edwards(e):this.curve=new c.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,d(this.g.validate(),"Invalid curve"),d(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function defineCurve(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var a=new PresetCurve(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:a}),a}})}n.PresetCurve=PresetCurve,defineCurve("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),defineCurve("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),defineCurve("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),defineCurve("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),defineCurve("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),defineCurve("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),defineCurve("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=a(968)}catch(e){r=void 0}defineCurve("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})},(e,t,a)=>{var r=t;r.utils=a(68),r.common=a(169),r.sha=a(1486),r.ripemd=a(1487),r.hmac=a(967),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},(e,t,a)=>{"use strict";var r=a(10).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.assertIsString=t.assertIsArray=t.assertIsBuffer=t.assertIsHexString=void 0;var n=a(129);t.assertIsHexString=function(e){if(!(0,n.isHexString)(e)){var t="This method only supports 0x-prefixed hex strings but input was: ".concat(e);throw new Error(t)}};t.assertIsBuffer=function(e){if(!r.isBuffer(e)){var t="This method only supports Buffer but input was: ".concat(e);throw new Error(t)}};t.assertIsArray=function(e){if(!Array.isArray(e)){var t="This method only supports number arrays but input was: ".concat(e);throw new Error(t)}};t.assertIsString=function(e){if("string"!=typeof e){var t="This method only supports strings but input was: ".concat(e);throw new Error(t)}}},(e,t,a)=>{"use strict";var r=a(130).a.ERR_STREAM_PREMATURE_CLOSE;function noop(){}e.exports=function eos(e,t,a){if("function"==typeof t)return eos(e,null,t);t||(t={}),a=function once(e){var t=!1;return function(){if(!t){t=!0;for(var a=arguments.length,r=new Array(a),n=0;n{"use strict";var r=a(10).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.toType=t.TypeOutput=t.bnToRlp=t.bnToUnpaddedBuffer=t.bnToHex=void 0;var n,o=a(56),c=a(129),d=a(81);function bnToUnpaddedBuffer(e){return(0,d.unpadBuffer)(e.toArrayLike(r))}t.bnToHex=function bnToHex(e){return"0x".concat(e.toString(16))},t.bnToUnpaddedBuffer=bnToUnpaddedBuffer,t.bnToRlp=function bnToRlp(e){return bnToUnpaddedBuffer(e)},function(e){e[e.Number=0]="Number",e[e.BN=1]="BN",e[e.Buffer=2]="Buffer",e[e.PrefixedHexString=3]="PrefixedHexString"}(n=t.TypeOutput||(t.TypeOutput={})),t.toType=function toType(e,t){if(null===e)return null;if(void 0!==e){if("string"==typeof e&&!(0,c.isHexString)(e))throw new Error("A string must be provided with a 0x-prefix, given: ".concat(e));if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");var a=(0,d.toBuffer)(e);if(t===n.Buffer)return a;if(t===n.BN)return new o.BN(a);if(t===n.Number){var r=new o.BN(a),s=new o.BN(Number.MAX_SAFE_INTEGER.toString());if(r.gt(s))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return r.toNumber()}return"0x".concat(a.toString("hex"))}}},(e,t,a)=>{"use strict";var r,n=t,o=a(259),c=a(455),d=a(42).assert;function PresetCurve(e){"short"===e.type?this.curve=new c.short(e):"edwards"===e.type?this.curve=new c.edwards(e):this.curve=new c.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,d(this.g.validate(),"Invalid curve"),d(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function defineCurve(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var a=new PresetCurve(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:a}),a}})}n.PresetCurve=PresetCurve,defineCurve("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),defineCurve("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),defineCurve("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),defineCurve("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),defineCurve("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),defineCurve("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),defineCurve("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=a(1010)}catch(e){r=void 0}defineCurve("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})},(e,t,a)=>{var r=t;r.utils=a(69),r.common=a(171),r.sha=a(1552),r.ripemd=a(1553),r.hmac=a(1009),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},(e,t,a)=>{"use strict";var r,n=t,o=a(261),c=a(460),d=a(43).assert;function PresetCurve(e){"short"===e.type?this.curve=new c.short(e):"edwards"===e.type?this.curve=new c.edwards(e):this.curve=new c.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,d(this.g.validate(),"Invalid curve"),d(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function defineCurve(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var a=new PresetCurve(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:a}),a}})}n.PresetCurve=PresetCurve,defineCurve("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),defineCurve("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),defineCurve("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),defineCurve("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),defineCurve("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),defineCurve("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),defineCurve("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=a(1032)}catch(e){r=void 0}defineCurve("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})},(e,t,a)=>{var r=t;r.utils=a(70),r.common=a(173),r.sha=a(1562),r.ripemd=a(1563),r.hmac=a(1031),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},(e,t,a)=>{"use strict";var r=a(2).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.assertIsString=t.assertIsArray=t.assertIsBuffer=t.assertIsHexString=void 0;var n=a(132);t.assertIsHexString=function(e){if(!(0,n.isHexString)(e)){var t="This method only supports 0x-prefixed hex strings but input was: ".concat(e);throw new Error(t)}};t.assertIsBuffer=function(e){if(!r.isBuffer(e)){var t="This method only supports Buffer but input was: ".concat(e);throw new Error(t)}};t.assertIsArray=function(e){if(!Array.isArray(e)){var t="This method only supports number arrays but input was: ".concat(e);throw new Error(t)}};t.assertIsString=function(e){if("string"!=typeof e){var t="This method only supports strings but input was: ".concat(e);throw new Error(t)}}},(e,t,a)=>{"use strict";var r=a(133).a.ERR_STREAM_PREMATURE_CLOSE;function noop(){}e.exports=function eos(e,t,a){if("function"==typeof t)return eos(e,null,t);t||(t={}),a=function once(e){var t=!1;return function(){if(!t){t=!0;for(var a=arguments.length,r=new Array(a),n=0;n{"use strict";var r=a(2).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.toType=t.TypeOutput=t.bnToRlp=t.bnToUnpaddedBuffer=t.bnToHex=void 0;var n,o=a(57),c=a(132),d=a(82);function bnToUnpaddedBuffer(e){return(0,d.unpadBuffer)(e.toArrayLike(r))}t.bnToHex=function bnToHex(e){return"0x".concat(e.toString(16))},t.bnToUnpaddedBuffer=bnToUnpaddedBuffer,t.bnToRlp=function bnToRlp(e){return bnToUnpaddedBuffer(e)},function(e){e[e.Number=0]="Number",e[e.BN=1]="BN",e[e.Buffer=2]="Buffer",e[e.PrefixedHexString=3]="PrefixedHexString"}(n=t.TypeOutput||(t.TypeOutput={})),t.toType=function toType(e,t){if(null===e)return null;if(void 0!==e){if("string"==typeof e&&!(0,c.isHexString)(e))throw new Error("A string must be provided with a 0x-prefix, given: ".concat(e));if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");var a=(0,d.toBuffer)(e);if(t===n.Buffer)return a;if(t===n.BN)return new o.BN(a);if(t===n.Number){var r=new o.BN(a),s=new o.BN(Number.MAX_SAFE_INTEGER.toString());if(r.gt(s))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return r.toNumber()}return"0x".concat(a.toString("hex"))}}},(e,t,a)=>{"use strict";var r=t;r.version=a(1575).a,r.utils=a(44),r.rand=a(266),r.curve=a(474),r.curves=a(267),r.ec=a(1073),r.eddsa=a(1077)},(e,t,a)=>{var r;function Rand(e){this.rand=e}if(e.exports=function rand(e){return r||(r=new Rand(null)),r.generate(e)},e.exports.Rand=Rand,Rand.prototype.generate=function generate(e){return this._rand(e)},Rand.prototype._rand=function _rand(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),a=0;a{"use strict";var r,n=t,o=a(268),c=a(474),d=a(44).assert;function PresetCurve(e){"short"===e.type?this.curve=new c.short(e):"edwards"===e.type?this.curve=new c.edwards(e):this.curve=new c.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,d(this.g.validate(),"Invalid curve"),d(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function defineCurve(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var a=new PresetCurve(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:a}),a}})}n.PresetCurve=PresetCurve,defineCurve("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),defineCurve("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),defineCurve("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),defineCurve("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),defineCurve("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),defineCurve("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),defineCurve("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=a(1072)}catch(e){r=void 0}defineCurve("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})},(e,t,a)=>{var r=t;r.utils=a(71),r.common=a(175),r.sha=a(1577),r.ripemd=a(1578),r.hmac=a(1071),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},(e,t,a)=>{"use strict";var r=a(0).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.assertIsString=t.assertIsArray=t.assertIsBuffer=t.assertIsHexString=void 0;var n=a(134);t.assertIsHexString=function(e){if(!(0,n.isHexString)(e)){var t="This method only supports 0x-prefixed hex strings but input was: ".concat(e);throw new Error(t)}};t.assertIsBuffer=function(e){if(!r.isBuffer(e)){var t="This method only supports Buffer but input was: ".concat(e);throw new Error(t)}};t.assertIsArray=function(e){if(!Array.isArray(e)){var t="This method only supports number arrays but input was: ".concat(e);throw new Error(t)}};t.assertIsString=function(e){if("string"!=typeof e){var t="This method only supports strings but input was: ".concat(e);throw new Error(t)}}},(e,t,a)=>{"use strict";var r=a(135).a.ERR_STREAM_PREMATURE_CLOSE;function noop(){}e.exports=function eos(e,t,a){if("function"==typeof t)return eos(e,null,t);t||(t={}),a=function once(e){var t=!1;return function(){if(!t){t=!0;for(var a=arguments.length,r=new Array(a),n=0;n{"use strict";var r=a(0).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.toType=t.TypeOutput=t.bnToRlp=t.bnToUnpaddedBuffer=t.bnToHex=void 0;var n,o=a(58),c=a(134),d=a(83);function bnToUnpaddedBuffer(e){return(0,d.unpadBuffer)(e.toArrayLike(r))}t.bnToHex=function bnToHex(e){return"0x".concat(e.toString(16))},t.bnToUnpaddedBuffer=bnToUnpaddedBuffer,t.bnToRlp=function bnToRlp(e){return bnToUnpaddedBuffer(e)},function(e){e[e.Number=0]="Number",e[e.BN=1]="BN",e[e.Buffer=2]="Buffer",e[e.PrefixedHexString=3]="PrefixedHexString"}(n=t.TypeOutput||(t.TypeOutput={})),t.toType=function toType(e,t){if(null===e)return null;if(void 0!==e){if("string"==typeof e&&!(0,c.isHexString)(e))throw new Error("A string must be provided with a 0x-prefix, given: ".concat(e));if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");var a=(0,d.toBuffer)(e);if(t===n.Buffer)return a;if(t===n.BN)return new o.BN(a);if(t===n.Number){var r=new o.BN(a),s=new o.BN(Number.MAX_SAFE_INTEGER.toString());if(r.gt(s))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return r.toNumber()}return"0x".concat(a.toString("hex"))}}},(e,t,a)=>{"use strict";var r=a(273),n=a(762),o=n(r("String.prototype.indexOf"));e.exports=function callBoundIntrinsic(e,t){var a=r(e,!!t);return"function"==typeof a&&o(e,".prototype.")>-1?n(a):a}},(e,t,a)=>{"use strict";var r,n=SyntaxError,o=Function,c=TypeError,getEvalledConstructor=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(e){}},d=Object.getOwnPropertyDescriptor;if(d)try{d({},"")}catch(e){d=null}var throwTypeError=function(){throw new c},s=d?function(){try{return throwTypeError}catch(e){try{return d(arguments,"callee").get}catch(e){return throwTypeError}}}():throwTypeError,b=a(1109)(),u=Object.getPrototypeOf||function(e){return e.__proto__},h={},l="undefined"==typeof Uint8Array?r:u(Uint8Array),g={"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":b?u([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":h,"%AsyncGenerator%":h,"%AsyncGeneratorFunction%":h,"%AsyncIteratorPrototype%":h,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":h,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":b?u(u([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&b?u((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&b?u((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":b?u(""[Symbol.iterator]()):r,"%Symbol%":b?Symbol:r,"%SyntaxError%":n,"%ThrowTypeError%":s,"%TypedArray%":l,"%TypeError%":c,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet},p=function doEval(e){var t;if("%AsyncFunction%"===e)t=getEvalledConstructor("async function () {}");else if("%GeneratorFunction%"===e)t=getEvalledConstructor("function* () {}");else if("%AsyncGeneratorFunction%"===e)t=getEvalledConstructor("async function* () {}");else if("%AsyncGenerator%"===e){var a=doEval("%AsyncGeneratorFunction%");a&&(t=a.prototype)}else if("%AsyncIteratorPrototype%"===e){var r=doEval("%AsyncGenerator%");r&&(t=u(r.prototype))}return g[e]=t,t},B={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},x=a(274),m=a(1111),I=x.call(Function.call,Array.prototype.concat),y=x.call(Function.apply,Array.prototype.splice),C=x.call(Function.call,String.prototype.replace),w=x.call(Function.call,String.prototype.slice),v=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Q=/\\(\\)?/g,_=function stringToPath(e){var t=w(e,0,1),a=w(e,-1);if("%"===t&&"%"!==a)throw new n("invalid intrinsic syntax, expected closing `%`");if("%"===a&&"%"!==t)throw new n("invalid intrinsic syntax, expected opening `%`");var r=[];return C(e,v,(function(e,t,a,n){r[r.length]=a?C(n,Q,"$1"):t||e})),r},k=function getBaseIntrinsic(e,t){var a,r=e;if(m(B,r)&&(r="%"+(a=B[r])[0]+"%"),m(g,r)){var o=g[r];if(o===h&&(o=p(r)),void 0===o&&!t)throw new c("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:a,name:r,value:o}}throw new n("intrinsic "+e+" does not exist!")};e.exports=function GetIntrinsic(e,t){if("string"!=typeof e||0===e.length)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new c('"allowMissing" argument must be a boolean');var a=_(e),r=a.length>0?a[0]:"",o=k("%"+r+"%",t),s=o.name,b=o.value,u=!1,h=o.alias;h&&(r=h[0],y(a,I([0,1],h)));for(var l=1,p=!0;l=a.length){var v=d(b,B);b=(p=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:b[B]}else p=m(b,B),b=b[B];p&&!u&&(g[s]=b)}}return b}},(e,t,a)=>{"use strict";var r=a(1110);e.exports=Function.prototype.bind||r},(e,t,a)=>{var r=a(670).create,n=r("LevelUPError"),o=r("NotFoundError",n);o.prototype.notFound=!0,o.prototype.status=404,e.exports={LevelUPError:n,InitializationError:r("InitializationError",n),OpenError:r("OpenError",n),ReadError:r("ReadError",n),WriteError:r("WriteError",n),NotFoundError:o,EncodingError:r("EncodingError",n)}},e=>{"use strict";e.exports=function createRBTree(e){return new RedBlackTree(e||defaultCompare,null)};function RBNode(e,t,a,r,n,o){this._color=e,this.key=t,this.value=a,this.left=r,this.right=n,this._count=o}function cloneNode(e){return new RBNode(e._color,e.key,e.value,e.left,e.right,e._count)}function repaint(e,t){return new RBNode(e,t.key,t.value,t.left,t.right,t._count)}function recount(e){e._count=1+(e.left?e.left._count:0)+(e.right?e.right._count:0)}function RedBlackTree(e,t){this._compare=e,this.root=t}var t=RedBlackTree.prototype;function doVisitFull(e,t){var a;if(t.left&&(a=doVisitFull(e,t.left)))return a;return(a=e(t.key,t.value))||(t.right?doVisitFull(e,t.right):void 0)}function doVisitHalf(e,t,a,r){if(t(e,r.key)<=0){var n;if(r.left)if(n=doVisitHalf(e,t,a,r.left))return n;if(n=a(r.key,r.value))return n}if(r.right)return doVisitHalf(e,t,a,r.right)}function doVisit(e,t,a,r,n){var o,c=a(e,n.key),d=a(t,n.key);if(c<=0){if(n.left&&(o=doVisit(e,t,a,r,n.left)))return o;if(d>0&&(o=r(n.key,n.value)))return o}if(d>0&&n.right)return doVisit(e,t,a,r,n.right)}function RedBlackTreeIterator(e,t){this.tree=e,this._stack=t}Object.defineProperty(t,"keys",{get:function(){var e=[];return this.forEach((function(t,a){e.push(t)})),e}}),Object.defineProperty(t,"values",{get:function(){var e=[];return this.forEach((function(t,a){e.push(a)})),e}}),Object.defineProperty(t,"length",{get:function(){return this.root?this.root._count:0}}),t.insert=function(e,t){for(var a=this._compare,r=this.root,n=[],o=[];r;){var c=a(e,r.key);n.push(r),o.push(c),r=c<=0?r.left:r.right}n.push(new RBNode(0,e,t,null,null,1));for(var d=n.length-2;d>=0;--d){r=n[d];o[d]<=0?n[d]=new RBNode(r._color,r.key,r.value,n[d+1],r.right,r._count+1):n[d]=new RBNode(r._color,r.key,r.value,r.left,n[d+1],r._count+1)}for(d=n.length-1;d>1;--d){var s=n[d-1];r=n[d];if(1===s._color||1===r._color)break;var b=n[d-2];if(b.left===s)if(s.left===r){if(!(u=b.right)||0!==u._color){if(b._color=0,b.left=s.right,s._color=1,s.right=b,n[d-2]=s,n[d-1]=r,recount(b),recount(s),d>=3)(h=n[d-3]).left===b?h.left=s:h.right=s;break}s._color=1,b.right=repaint(1,u),b._color=0,d-=1}else{if(!(u=b.right)||0!==u._color){if(s.right=r.left,b._color=0,b.left=r.right,r._color=1,r.left=s,r.right=b,n[d-2]=r,n[d-1]=s,recount(b),recount(s),recount(r),d>=3)(h=n[d-3]).left===b?h.left=r:h.right=r;break}s._color=1,b.right=repaint(1,u),b._color=0,d-=1}else if(s.right===r){if(!(u=b.left)||0!==u._color){if(b._color=0,b.right=s.left,s._color=1,s.left=b,n[d-2]=s,n[d-1]=r,recount(b),recount(s),d>=3)(h=n[d-3]).right===b?h.right=s:h.left=s;break}s._color=1,b.left=repaint(1,u),b._color=0,d-=1}else{var u;if(!(u=b.left)||0!==u._color){var h;if(s.left=r.right,b._color=0,b.right=r.left,r._color=1,r.right=s,r.left=b,n[d-2]=r,n[d-1]=s,recount(b),recount(s),recount(r),d>=3)(h=n[d-3]).right===b?h.right=r:h.left=r;break}s._color=1,b.left=repaint(1,u),b._color=0,d-=1}}return n[0]._color=1,new RedBlackTree(a,n[0])},t.forEach=function rbTreeForEach(e,t,a){if(this.root)switch(arguments.length){case 1:return doVisitFull(e,this.root);case 2:return doVisitHalf(t,this._compare,e,this.root);case 3:if(this._compare(t,a)>=0)return;return doVisit(t,a,this._compare,e,this.root)}},Object.defineProperty(t,"begin",{get:function(){for(var e=[],t=this.root;t;)e.push(t),t=t.left;return new RedBlackTreeIterator(this,e)}}),Object.defineProperty(t,"end",{get:function(){for(var e=[],t=this.root;t;)e.push(t),t=t.right;return new RedBlackTreeIterator(this,e)}}),t.at=function(e){if(e<0)return new RedBlackTreeIterator(this,[]);for(var t=this.root,a=[];;){if(a.push(t),t.left){if(e=t.right._count)break;t=t.right}return new RedBlackTreeIterator(this,[])},t.ge=function(e){for(var t=this._compare,a=this.root,r=[],n=0;a;){var o=t(e,a.key);r.push(a),o<=0&&(n=r.length),a=o<=0?a.left:a.right}return r.length=n,new RedBlackTreeIterator(this,r)},t.gt=function(e){for(var t=this._compare,a=this.root,r=[],n=0;a;){var o=t(e,a.key);r.push(a),o<0&&(n=r.length),a=o<0?a.left:a.right}return r.length=n,new RedBlackTreeIterator(this,r)},t.lt=function(e){for(var t=this._compare,a=this.root,r=[],n=0;a;){var o=t(e,a.key);r.push(a),o>0&&(n=r.length),a=o<=0?a.left:a.right}return r.length=n,new RedBlackTreeIterator(this,r)},t.le=function(e){for(var t=this._compare,a=this.root,r=[],n=0;a;){var o=t(e,a.key);r.push(a),o>=0&&(n=r.length),a=o<0?a.left:a.right}return r.length=n,new RedBlackTreeIterator(this,r)},t.find=function(e){for(var t=this._compare,a=this.root,r=[];a;){var n=t(e,a.key);if(r.push(a),0===n)return new RedBlackTreeIterator(this,r);a=n<=0?a.left:a.right}return new RedBlackTreeIterator(this,[])},t.remove=function(e){var t=this.find(e);return t?t.remove():this},t.get=function(e){for(var t=this._compare,a=this.root;a;){var r=t(e,a.key);if(0===r)return a.value;a=r<=0?a.left:a.right}};var a=RedBlackTreeIterator.prototype;function swapNode(e,t){e.key=t.key,e.value=t.value,e.left=t.left,e.right=t.right,e._color=t._color,e._count=t._count}function defaultCompare(e,t){return et?1:0}Object.defineProperty(a,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(a,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),a.clone=function(){return new RedBlackTreeIterator(this.tree,this._stack.slice())},a.remove=function(){var e=this._stack;if(0===e.length)return this.tree;var t=new Array(e.length),a=e[e.length-1];t[t.length-1]=new RBNode(a._color,a.key,a.value,a.left,a.right,a._count);for(var r=e.length-2;r>=0;--r){(a=e[r]).left===e[r+1]?t[r]=new RBNode(a._color,a.key,a.value,t[r+1],a.right,a._count):t[r]=new RBNode(a._color,a.key,a.value,a.left,t[r+1],a._count)}if((a=t[t.length-1]).left&&a.right){var n=t.length;for(a=a.left;a.right;)t.push(a),a=a.right;var o=t[n-1];t.push(new RBNode(a._color,o.key,o.value,a.left,a.right,a._count)),t[n-1].key=a.key,t[n-1].value=a.value;for(r=t.length-2;r>=n;--r)a=t[r],t[r]=new RBNode(a._color,a.key,a.value,a.left,t[r+1],a._count);t[n-1].left=t[n]}if(0===(a=t[t.length-1])._color){var c=t[t.length-2];c.left===a?c.left=null:c.right===a&&(c.right=null),t.pop();for(r=0;r=0;--o){if(t=e[o],0===o)return void(t._color=1);if((a=e[o-1]).left===t){if((r=a.right).right&&0===r.right._color)return n=(r=a.right=cloneNode(r)).right=cloneNode(r.right),a.right=r.left,r.left=a,r.right=n,r._color=a._color,t._color=1,a._color=1,n._color=1,recount(a),recount(r),o>1&&((c=e[o-2]).left===a?c.left=r:c.right=r),void(e[o-1]=r);if(r.left&&0===r.left._color)return n=(r=a.right=cloneNode(r)).left=cloneNode(r.left),a.right=n.left,r.left=n.right,n.left=a,n.right=r,n._color=a._color,a._color=1,r._color=1,t._color=1,recount(a),recount(r),recount(n),o>1&&((c=e[o-2]).left===a?c.left=n:c.right=n),void(e[o-1]=n);if(1===r._color){if(0===a._color)return a._color=1,void(a.right=repaint(0,r));a.right=repaint(0,r);continue}r=cloneNode(r),a.right=r.left,r.left=a,r._color=a._color,a._color=0,recount(a),recount(r),o>1&&((c=e[o-2]).left===a?c.left=r:c.right=r),e[o-1]=r,e[o]=a,o+11&&((c=e[o-2]).right===a?c.right=r:c.left=r),void(e[o-1]=r);if(r.right&&0===r.right._color)return n=(r=a.left=cloneNode(r)).right=cloneNode(r.right),a.left=n.right,r.right=n.left,n.right=a,n.left=r,n._color=a._color,a._color=1,r._color=1,t._color=1,recount(a),recount(r),recount(n),o>1&&((c=e[o-2]).right===a?c.right=n:c.left=n),void(e[o-1]=n);if(1===r._color){if(0===a._color)return a._color=1,void(a.left=repaint(0,r));a.left=repaint(0,r);continue}var c;r=cloneNode(r),a.left=r.right,r.right=a,r._color=a._color,a._color=0,recount(a),recount(r),o>1&&((c=e[o-2]).right===a?c.right=r:c.left=r),e[o-1]=r,e[o]=a,o+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(a,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(a,"index",{get:function(){var e=0,t=this._stack;if(0===t.length){var a=this.tree.root;return a?a._count:0}t[t.length-1].left&&(e=t[t.length-1].left._count);for(var r=t.length-2;r>=0;--r)t[r+1]===t[r].right&&(++e,t[r].left&&(e+=t[r].left._count));return e},enumerable:!0}),a.next=function(){var e=this._stack;if(0!==e.length){var t=e[e.length-1];if(t.right)for(t=t.right;t;)e.push(t),t=t.left;else for(e.pop();e.length>0&&e[e.length-1].right===t;)t=e[e.length-1],e.pop()}},Object.defineProperty(a,"hasNext",{get:function(){var e=this._stack;if(0===e.length)return!1;if(e[e.length-1].right)return!0;for(var t=e.length-1;t>0;--t)if(e[t-1].left===e[t])return!0;return!1}}),a.update=function(e){var t=this._stack;if(0===t.length)throw new Error("Can't update empty node!");var a=new Array(t.length),r=t[t.length-1];a[a.length-1]=new RBNode(r._color,r.key,e,r.left,r.right,r._count);for(var n=t.length-2;n>=0;--n)(r=t[n]).left===t[n+1]?a[n]=new RBNode(r._color,r.key,r.value,a[n+1],r.right,r._count):a[n]=new RBNode(r._color,r.key,r.value,r.left,a[n+1],r._count);return new RedBlackTree(this.tree._compare,a[0])},a.prev=function(){var e=this._stack;if(0!==e.length){var t=e[e.length-1];if(t.left)for(t=t.left;t;)e.push(t),t=t.right;else for(e.pop();e.length>0&&e[e.length-1].left===t;)t=e[e.length-1],e.pop()}},Object.defineProperty(a,"hasPrev",{get:function(){var e=this._stack;if(0===e.length)return!1;if(e[e.length-1].left)return!0;for(var t=e.length-1;t>0;--t)if(e[t-1].right===e[t])return!0;return!1}})},(e,t,a)=>{"use strict";var r=a(0).Buffer;function matchingNibbleLength(e,t){for(var a=0;e[a]===t[a]&&e.length>a;)a++;return a}Object.defineProperty(t,"__esModule",{value:!0}),t.doKeysMatch=t.matchingNibbleLength=t.nibblesCompare=t.nibblesToBuffer=t.bufferToNibbles=void 0,t.bufferToNibbles=function bufferToNibbles(e){for(var t=r.from(e),a=[],n=0;n>4,a[++o]=t[n]%16}return a},t.nibblesToBuffer=function nibblesToBuffer(e){for(var t=r.alloc(e.length/2),a=0;at[n]){r=1;break}}return 0===r&&(e.lengtht.length&&(r=1)),r},t.matchingNibbleLength=matchingNibbleLength,t.doKeysMatch=function doKeysMatch(e,t){var a=matchingNibbleLength(e,t);return a===e.length&&a===t.length}},(e,t,a)=>{"use strict";var r,n=t,o=a(279),c=a(514),d=a(45).assert;function PresetCurve(e){"short"===e.type?this.curve=new c.short(e):"edwards"===e.type?this.curve=new c.edwards(e):this.curve=new c.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,d(this.g.validate(),"Invalid curve"),d(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function defineCurve(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var a=new PresetCurve(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:a}),a}})}n.PresetCurve=PresetCurve,defineCurve("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),defineCurve("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),defineCurve("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),defineCurve("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),defineCurve("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),defineCurve("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),defineCurve("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=a(1141)}catch(e){r=void 0}defineCurve("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})},(e,t,a)=>{var r=t;r.utils=a(72),r.common=a(181),r.sha=a(1624),r.ripemd=a(1625),r.hmac=a(1140),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},(e,t,a)=>{"use strict";var r=a(2).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.assertIsString=t.assertIsArray=t.assertIsBuffer=t.assertIsHexString=void 0;var n=a(136);t.assertIsHexString=function(e){if(!(0,n.isHexString)(e)){var t="This method only supports 0x-prefixed hex strings but input was: ".concat(e);throw new Error(t)}};t.assertIsBuffer=function(e){if(!r.isBuffer(e)){var t="This method only supports Buffer but input was: ".concat(e);throw new Error(t)}};t.assertIsArray=function(e){if(!Array.isArray(e)){var t="This method only supports number arrays but input was: ".concat(e);throw new Error(t)}};t.assertIsString=function(e){if("string"!=typeof e){var t="This method only supports strings but input was: ".concat(e);throw new Error(t)}}},(e,t,a)=>{"use strict";var r=a(137).a.ERR_STREAM_PREMATURE_CLOSE;function noop(){}e.exports=function eos(e,t,a){if("function"==typeof t)return eos(e,null,t);t||(t={}),a=function once(e){var t=!1;return function(){if(!t){t=!0;for(var a=arguments.length,r=new Array(a),n=0;n{"use strict";var r=a(2).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.toType=t.TypeOutput=t.bnToRlp=t.bnToUnpaddedBuffer=t.bnToHex=void 0;var n,o=a(59),c=a(136),d=a(84);function bnToUnpaddedBuffer(e){return(0,d.unpadBuffer)(e.toArrayLike(r))}t.bnToHex=function bnToHex(e){return"0x".concat(e.toString(16))},t.bnToUnpaddedBuffer=bnToUnpaddedBuffer,t.bnToRlp=function bnToRlp(e){return bnToUnpaddedBuffer(e)},function(e){e[e.Number=0]="Number",e[e.BN=1]="BN",e[e.Buffer=2]="Buffer",e[e.PrefixedHexString=3]="PrefixedHexString"}(n=t.TypeOutput||(t.TypeOutput={})),t.toType=function toType(e,t){if(null===e)return null;if(void 0!==e){if("string"==typeof e&&!(0,c.isHexString)(e))throw new Error("A string must be provided with a 0x-prefix, given: ".concat(e));if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");var a=(0,d.toBuffer)(e);if(t===n.Buffer)return a;if(t===n.BN)return new o.BN(a);if(t===n.Number){var r=new o.BN(a),s=new o.BN(Number.MAX_SAFE_INTEGER.toString());if(r.gt(s))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return r.toNumber()}return"0x".concat(a.toString("hex"))}}},(e,t,a)=>{"use strict";var r=a(138).a.ERR_STREAM_PREMATURE_CLOSE;function noop(){}e.exports=function eos(e,t,a){if("function"==typeof t)return eos(e,null,t);t||(t={}),a=function once(e){var t=!1;return function(){if(!t){t=!0;for(var a=arguments.length,r=new Array(a),n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URL=void 0,t.URL=globalThis.URL},e=>{e.exports=function isBuffer(e){return null!=e&&null!=e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}},(e,t,a)=>{"use strict";const r=a(183);e.exports=function(e,...t){0===t.length?r(e):r((()=>e(...t)))}},(e,t,a)=>{"use strict";const r=a(13).EventEmitter,n=a(144).inherits,o=a(1207),c=a(1212),d=a(1213),s=a(546),b=a(543),u=a(182),h=a(705).a,l=a(705).b,g=a(1214),p=s.WriteError,B=s.ReadError,x=s.NotFoundError,m=s.OpenError,I=s.InitializationError;function LevelUP(e,t,a){if(!(this instanceof LevelUP))return new LevelUP(e,t,a);let n;if(r.call(this),this.setMaxListeners(1/0),"function"==typeof t&&(a=t,t={}),t=t||{},!e||"object"!=typeof e){if(n=new I("First argument must be an abstract-leveldown compliant store"),"function"==typeof a)return g(a,n);throw n}if("string"!=typeof e.status)throw new Error(".status required, old abstract-leveldown");this.options=l(t),this._db=e,this.db=null,this.open(a||(e=>{e&&this.emit("error",e)})),this.supports=b(this.db.supports,{status:!0,deferredOpen:!0,openCallback:!0,promises:!0,streams:!0});for(const e of Object.keys(this.supports.additionalMethods))null==this[e]&&(this[e]=function(...t){return this.db[e](...t)})}function maybeError(e,t){return!e.isOperational()&&(g(t,new B("Database is not open")),!0)}LevelUP.prototype.emit=r.prototype.emit,LevelUP.prototype.once=r.prototype.once,n(LevelUP,r),Object.defineProperty(LevelUP.prototype,"status",{enumerable:!0,get(){return this.db.status}}),LevelUP.prototype.isOperational=function(){return"open"===this.db.status||"opening"===this.db.status},LevelUP.prototype.open=function(e,t){return"function"==typeof e&&(t=e,e=null),t=u.fromCallback(t),e||(e=this.options),this.db&&this.isOpen()?(g(t,null,this),t.promise):this.db&&this._isOpening()?(this.once("open",(()=>{t(null,this)})),t.promise):(this.db=new o(this._db),this.emit("opening"),this.db.open(e,(e=>{if(e)return t(new m(e));this.db=this._db,t(null,this),this.emit("open"),this.emit("ready")})),t.promise)},LevelUP.prototype.close=function(e){return e=u.fromCallback(e),this.isOpen()?(this.db.close(((t,...a)=>{this.emit("closed"),e(t,...a)})),this.emit("closing")):this.isClosed()?g(e):"closing"===this.db.status?this.once("closed",e):this._isOpening()&&this.once("open",(()=>{this.close(e)})),e.promise},LevelUP.prototype.isOpen=function(){return"open"===this.db.status},LevelUP.prototype._isOpening=function(){return"opening"===this.db.status},LevelUP.prototype.isClosed=function(){return/^clos|new/.test(this.db.status)},LevelUP.prototype.get=function(e,t,a){return a=h(t,a),maybeError(this,a=u.fromCallback(a))||(t=l(t),this.db.get(e,t,(function(t,r){if(t)return t=/notfound/i.test(t)||t.notFound?new x("Key not found in database ["+e+"]",t):new B(t),a(t);a(null,r)}))),a.promise},LevelUP.prototype.getMany=function(e,t,a){return this.db.getMany(e,t,a)},LevelUP.prototype.put=function(e,t,a,r){return r=h(a,r),maybeError(this,r=u.fromCallback(r))||(a=l(a),this.db.put(e,t,a,(a=>{if(a)return r(new p(a));this.emit("put",e,t),r()}))),r.promise},LevelUP.prototype.del=function(e,t,a){return a=h(t,a),maybeError(this,a=u.fromCallback(a))||(t=l(t),this.db.del(e,t,(t=>{if(t)return a(new p(t));this.emit("del",e),a()}))),a.promise},LevelUP.prototype.batch=function(e,t,a){return arguments.length?(a="function"==typeof e?e:h(t,a),maybeError(this,a=u.fromCallback(a))||(t=l(t),this.db.batch(e,t,(t=>{if(t)return a(new p(t));this.emit("batch",e),a()}))),a.promise):new d(this)},LevelUP.prototype.iterator=function(e){return this.db.iterator(e)},LevelUP.prototype.clear=function(e,t){return t=h(e,t),e=l(e),maybeError(this,t=u.fromCallback(t))||this.db.clear(e,(a=>{if(a)return t(new p(a));this.emit("clear",e),t()})),t.promise},LevelUP.prototype.readStream=LevelUP.prototype.createReadStream=function(e){return"number"!=typeof(e=Object.assign({keys:!0,values:!0},e)).limit&&(e.limit=-1),new c(this.db.iterator(e),e)},LevelUP.prototype.keyStream=LevelUP.prototype.createKeyStream=function(e){return this.createReadStream(Object.assign({},e,{keys:!0,values:!1}))},LevelUP.prototype.valueStream=LevelUP.prototype.createValueStream=function(e){return this.createReadStream(Object.assign({},e,{keys:!1,values:!0}))},LevelUP.prototype.toString=function(){return"LevelUP"},LevelUP.prototype.type="levelup",LevelUP.prototype._nextTick=g,LevelUP.errors=s,e.exports=LevelUP},(e,t,a)=>{"use strict";const r=a(183);e.exports=function(e,...t){0===t.length?r(e):r((()=>e(...t)))}},(e,t,a)=>{"use strict";const r=a(183);e.exports=function(e,...t){0===t.length?r(e):r((()=>e(...t)))}},(e,t,a)=>{"use strict";const r=a(552);e.exports=function(e,...t){0===t.length?r(e):r((()=>e(...t)))}},(e,t,a)=>{"use strict";var r=a(0).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.DBOp=t.DBTarget=void 0;var n,o=a(1239);!function(e){e[e.Heads=0]="Heads",e[e.HeadHeader=1]="HeadHeader",e[e.HeadBlock=2]="HeadBlock",e[e.HashToNumber=3]="HashToNumber",e[e.NumberToHash=4]="NumberToHash",e[e.TotalDifficulty=5]="TotalDifficulty",e[e.Body=6]="Body",e[e.Header=7]="Header",e[e.CliqueSignerStates=8]="CliqueSignerStates",e[e.CliqueVotes=9]="CliqueVotes",e[e.CliqueBlockSigners=10]="CliqueBlockSigners"}(n=t.DBTarget||(t.DBTarget={}));var c=function(){function DBOp(e,t){switch(this.operationTarget=e,this.baseDBOp={key:"",keyEncoding:"binary",valueEncoding:"binary"},e){case n.Heads:this.baseDBOp.key=o.HEADS_KEY,this.baseDBOp.valueEncoding="json";break;case n.HeadHeader:this.baseDBOp.key=o.HEAD_HEADER_KEY;break;case n.HeadBlock:this.baseDBOp.key=o.HEAD_BLOCK_KEY;break;case n.HashToNumber:this.baseDBOp.key=(0,o.hashToNumberKey)(t.blockHash),this.cacheString="hashToNumber";break;case n.NumberToHash:this.baseDBOp.key=(0,o.numberToHashKey)(t.blockNumber),this.cacheString="numberToHash";break;case n.TotalDifficulty:this.baseDBOp.key=(0,o.tdKey)(t.blockNumber,t.blockHash),this.cacheString="td";break;case n.Body:this.baseDBOp.key=(0,o.bodyKey)(t.blockNumber,t.blockHash),this.cacheString="body";break;case n.Header:this.baseDBOp.key=(0,o.headerKey)(t.blockNumber,t.blockHash),this.cacheString="header";break;case n.CliqueSignerStates:this.baseDBOp.key=o.CLIQUE_SIGNERS_KEY;break;case n.CliqueVotes:this.baseDBOp.key=o.CLIQUE_VOTES_KEY;break;case n.CliqueBlockSigners:this.baseDBOp.key=o.CLIQUE_BLOCK_SIGNERS_KEY}}return DBOp.get=function(e,t){return new DBOp(e,t)},DBOp.set=function(e,t,a){var r=new DBOp(e,a);return r.baseDBOp.value=t,r.baseDBOp.type="put",e==n.Heads?r.baseDBOp.valueEncoding="json":r.baseDBOp.valueEncoding="binary",r},DBOp.del=function(e,t){var a=new DBOp(e,t);return a.baseDBOp.type="del",a},DBOp.prototype.updateCache=function(e){if(this.cacheString&&e[this.cacheString])if("put"==this.baseDBOp.type)r.isBuffer(this.baseDBOp.value)&&e[this.cacheString].set(this.baseDBOp.key,this.baseDBOp.value);else{if("del"!=this.baseDBOp.type)throw new Error("unsupported db operation on cache");e[this.cacheString].del(this.baseDBOp.key)}},DBOp}();t.DBOp=c},e=>{var t=TypeError;e.exports=function(e){if(null==e)throw t("Can't call method on "+e);return e}},(e,t,a)=>{var r=a(52),n=a(1243),o="__core-js_shared__",c=r[o]||n(o,{});e.exports=c},(e,t,a)=>{var r=a(1244),n=a(563);e.exports=function(e){var t=r(e,"string");return n(t)?t:t+""}},e=>{e.exports={}},(e,t,a)=>{var r=a(31);e.exports=r({}.isPrototypeOf)},(e,t,a)=>{var r=a(298);e.exports=function(e,t){var a=e[t];return null==a?void 0:r(a)}},(e,t,a)=>{var r=a(28),n=a(299),o=TypeError;e.exports=function(e){if(r(e))return e;throw o(n(e)+" is not a function")}},e=>{var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},(e,t,a)=>{var r=a(292),n=Object;e.exports=function(e){return n(r(e))}},(e,t,a)=>{var r=a(31),n=0,o=Math.random(),c=r(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+c(++n+o,36)}},(e,t,a)=>{var r=a(566),n=a(301),o=r("keys");e.exports=function(e){return o[e]||(o[e]=n(e))}},(e,t,a)=>{"use strict";var r=a(304),n=a(95),o=a(186),c=a(1250),d=a(28),s=a(1251),b=a(570),u=a(1259),h=a(309),l=a(114),g=a(308),p=a(53),B=a(140),x=a(567),m=c.PROPER,I=c.CONFIGURABLE,y=x.IteratorPrototype,C=x.BUGGY_SAFARI_ITERATORS,w=p("iterator"),v="keys",Q="values",_="entries",returnThis=function(){return this};e.exports=function(e,t,a,c,p,x,k){s(a,t,c);var N,D,G,getIterationMethod=function(e){if(e===p&&q)return q;if(!C&&e in P)return P[e];switch(e){case v:return function keys(){return new a(this,e)};case Q:return function values(){return new a(this,e)};case _:return function entries(){return new a(this,e)}}return function(){return new a(this)}},T=t+" Iterator",L=!1,P=e.prototype,U=P[w]||P["@@iterator"]||p&&P[p],q=!C&&U||getIterationMethod(p),O="Array"==t&&P.entries||U;if(O&&(N=b(O.call(new e)))!==Object.prototype&&N.next&&(o||b(N)===y||(u?u(N,y):d(N[w])||g(N,w,returnThis)),h(N,T,!0,!0),o&&(B[T]=returnThis)),m&&p==Q&&U&&U.name!==Q&&(!o&&I?l(P,"name",Q):(L=!0,q=function values(){return n(U,this)})),p)if(D={values:getIterationMethod(Q),keys:x?q:getIterationMethod(v),entries:getIterationMethod(_)},k)for(G in D)(C||L||!(G in P))&&g(P,G,D[G]);else r({target:t,proto:!0,forced:C||L},D);return o&&!k||P[w]===q||g(P,w,q,{name:p}),B[t]=q,D}},(e,t,a)=>{"use strict";var r=a(52),n=a(1248),o=a(31),c=a(28),d=a(1724).f,s=a(1249),b=a(295),u=a(189),h=a(114),l=a(74),wrapConstructor=function(e){var Wrapper=function(t,a,r){if(this instanceof Wrapper){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,a)}return new e(t,a,r)}return n(e,this,arguments)};return Wrapper.prototype=e.prototype,Wrapper};e.exports=function(e,t){var a,n,g,p,B,x,m,I,y=e.target,C=e.global,w=e.stat,v=e.proto,Q=C?r:w?r[y]:(r[y]||{}).prototype,_=C?b:b[y]||h(b,y,{})[y],k=_.prototype;for(g in t)a=!s(C?g:y+(w?".":"#")+g,e.forced)&&Q&&l(Q,g),B=_[g],a&&(x=e.dontCallGetSet?(I=d(Q,g))&&I.value:Q[g]),p=a&&x?x:t[g],a&&typeof B==typeof p||(m=e.bind&&a?u(p,r):e.wrap&&a?wrapConstructor(p):v&&c(p)?o(p):p,(e.sham||p&&p.sham||B&&B.sham)&&h(m,"sham",!0),h(_,g,m),v&&(l(b,n=y+"Prototype")||h(b,n,{}),h(b[n],g,p),e.real&&k&&!k[g]&&h(k,g,p)))}},(e,t,a)=>{var r,n=a(94),o=a(1726),c=a(307),d=a(188),s=a(1256),b=a(561),u=a(302),h=u("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(e){return"
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Implements

  • Api

Indexable

[index: string]: (...args: any) => Promise<any>
    • (...args: any): Promise<any>
    • Parameters

      • Rest ...args: any

      Returns Promise<any>

Index

Constructors

Properties

Methods

Constructors

constructor

  • new default(options: EthereumInternalOptions, wallet: default, blockchain: default): default

Properties

Private Readonly #blockchain

#blockchain: default

Private Readonly #filters

#filters: Map<string, InternalFilter> = ...

Private Readonly #getId

#getId: () => Quantity = ...

Type declaration

    • (): Quantity
    • Returns Quantity

Private Readonly #options

#options: EthereumInternalOptions

Private Readonly #subscriptions

#subscriptions: Map<string, UnsubscribeFn> = ...

Private Readonly #wallet

#wallet: default

Methods

bzz_hive

  • bzz_hive(): Promise<any[]>

Returns default

Properties

Private Readonly #blockchain

#blockchain: default

Private Readonly #filters

#filters: Map<string, InternalFilter> = ...

Private Readonly #getId

#getId: () => Quantity = ...

Type declaration

    • (): Quantity
    • Returns Quantity

Private Readonly #options

#options: EthereumInternalOptions

Private Readonly #subscriptions

#subscriptions: Map<string, UnsubscribeFn> = ...

Private Readonly #wallet

#wallet: default

Methods

bzz_hive

  • bzz_hive(): Promise<any[]>
  • Returns the kademlia table in a readable table format.

    example
    console.log(await provider.send("bzz_hive"));
     

    Returns Promise<any[]>

    Returns the kademlia table in a readable table format.

    -

bzz_info

  • bzz_info(): Promise<any[]>

bzz_info

  • bzz_info(): Promise<any[]>
  • Returns details about the swarm node.

    example
    console.log(await provider.send("bzz_info"));
     

    Returns Promise<any[]>

    Returns details about the swarm node.

    -

db_getHex

  • db_getHex(dbName: string, key: string): Promise<string>

db_getHex

  • db_getHex(dbName: string, key: string): Promise<string>
  • Returns binary data from the local database.

    example
    console.log(await provider.send("db_getHex", ["testDb", "testKey"] ));
     
    @@ -29,7 +29,7 @@
  • key: string

    Key name.

  • Returns Promise<string>

    The previously stored data.

    -

    db_getString

    • db_getString(dbName: string, key: string): Promise<string>

    db_getString

    • db_getString(dbName: string, key: string): Promise<string>
    • Returns string from the local database.

      example
      console.log(await provider.send("db_getString", ["testDb", "testKey"] ));
       
      @@ -38,7 +38,7 @@
  • key: string

    Key name.

  • Returns Promise<string>

    The previously stored string.

    -

    db_putHex

    • db_putHex(dbName: string, key: string, data: string): Promise<boolean>

    db_putHex

    • db_putHex(dbName: string, key: string, data: string): Promise<boolean>
    • Stores binary data in the local database.

      example
      console.log(await provider.send("db_putHex", ["testDb", "testKey", "0x0"] ));
       
      @@ -49,7 +49,7 @@
  • data: string

    Data to store.

  • Returns Promise<boolean>

    true if the value was stored, otherwise false.

    -

    db_putString

    • db_putString(dbName: string, key: string, value: string): Promise<boolean>

    db_putString

    • db_putString(dbName: string, key: string, value: string): Promise<boolean>
    • Stores a string in the local database.

      example
      console.log(await provider.send("db_putString", ["testDb", "testKey", "testValue"] ));
       
      @@ -60,7 +60,7 @@
    • value: string

      String to store.

    Returns Promise<boolean>

    returns true if the value was stored, otherwise false.

    -

    debug_storageRangeAt

    • debug_storageRangeAt(blockHash: string, transactionIndex: number, contractAddress: string, startKey: string, maxResult: number): Promise<StorageRangeAtResult>

    debug_storageRangeAt

    • debug_storageRangeAt(blockHash: string, transactionIndex: number, contractAddress: string, startKey: string, maxResult: number): Promise<StorageRangeAtResult>
    • Attempts to replay the transaction as it was executed on the network and return storage data given a starting key and max number of entries to return.

      example
      // Simple.sol
      // // SPDX-License-Identifier: MIT
      // pragma solidity ^0.7.4;
      //
      // contract Simple {
      // uint256 public value;
      // constructor() payable {
      // value = 5;
      // }
      // }
      const simpleSol = "0x6080604052600560008190555060858060196000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c80633fa4f24514602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b6000548156fea26469706673582212200897f7766689bf7a145227297912838b19bcad29039258a293be78e3bf58e20264736f6c63430007040033";
      const [from] = await provider.request({ method: "eth_accounts", params: [] });
      await provider.request({ method: "eth_subscribe", params: ["newHeads"] });
      const initialTxHash = await provider.request({ method: "eth_sendTransaction", params: [{ from, gas: "0x5b8d80", data: simpleSol }] });
      await provider.once("message"); // Note: `await provider.once` is non-standard

      const {contractAddress} = await provider.request({ method: "eth_getTransactionReceipt", params: [initialTxHash] });

      // set value to 19
      const data = "0x552410770000000000000000000000000000000000000000000000000000000000000019";
      const txHash = await provider.request({ method: "eth_sendTransaction", params: [{ from, to: contractAddress, data }] });
      await provider.once("message"); // Note: `await provider.once` is non-standard

      const { blockHash, transactionIndex } = await provider.request({ method: "eth_getTransactionReceipt", params: [txHash] });
      const storage = await provider.request({ method: "debug_storageRangeAt", params: [blockHash, transactionIndex, contractAddress, "0x01", 1] });
      console.log(storage); @@ -78,7 +78,7 @@

    Returns Promise<StorageRangeAtResult>

    Returns a storage object with the keys being keccak-256 hashes of the storage keys, and the values being the raw, unhashed key and value for that specific storage slot. Also returns a next key which is the keccak-256 hash of the next key in storage for continuous downloading.

    -

    debug_traceTransaction

    • debug_traceTransaction(transactionHash: string, options?: TraceTransactionOptions): Promise<TraceTransactionResult>

    debug_traceTransaction

    • debug_traceTransaction(transactionHash: string, options?: TraceTransactionOptions): Promise<TraceTransactionResult>
    • Attempt to run the transaction in the exact same manner as it was executed on the network. It will replay any transaction that may have been executed prior to this one before it will finally attempt to execute the transaction @@ -110,17 +110,17 @@

    • stack: The EVM execution stack.
    • storage: An object containing the contract's storage data.
    -

    eth_accounts

    • eth_accounts(): Promise<string[]>

    eth_accounts

    • eth_accounts(): Promise<string[]>
    • Returns a list of addresses owned by client.

      example
      const accounts = await provider.request({ method: "eth_accounts", params: [] });
      console.log(accounts);

      Returns Promise<string[]>

      Array of 20 Bytes - addresses owned by the client.

      -

    eth_blockNumber

    • eth_blockNumber(): Promise<Quantity>

    eth_blockNumber

    • eth_blockNumber(): Promise<Quantity>
    • Returns the number of the most recent block.

      example
      const blockNumber = await provider.request({ method: "eth_blockNumber" });
      console.log(blockNumber);

      Returns Promise<Quantity>

      The current block number the client is on.

      -

    eth_call

    • eth_call(transaction: Transaction, blockNumber?: string, overrides?: CallOverrides): Promise<Data>

    eth_call

    • eth_call(transaction: Transaction, blockNumber?: string, overrides?: CallOverrides): Promise<Data>
    • Executes a new message call immediately without creating a transaction on the block chain.

      Transaction call object:

        @@ -152,19 +152,19 @@
    • overrides: CallOverrides = {}

      State overrides to apply during the simulation.

    Returns Promise<Data>

    The return value of executed contract.

    -

    eth_chainId

    • eth_chainId(): Promise<Quantity>

    eth_chainId

    • eth_chainId(): Promise<Quantity>
    • Returns the currently configured chain id, a value used in replay-protected transaction signing as introduced by EIP-155.

      eip

      155 – Simple replay attack protection

      example
      const chainId = await provider.send("eth_chainId");
      console.log(chainId);

      Returns Promise<Quantity>

      The chain id as a string.

      -

    eth_coinbase

    • eth_coinbase(): Promise<Address>

    eth_coinbase

    • eth_coinbase(): Promise<Address>
    • Returns the client coinbase address.

      example
      const coinbaseAddress = await provider.request({ method: "eth_coinbase" });
      console.log(coinbaseAddress);

      Returns Promise<Address>

      The current coinbase address.

      -

    eth_estimateGas

    • eth_estimateGas(transaction: Transaction, blockNumber?: string): Promise<Quantity>

    eth_estimateGas

    • eth_estimateGas(transaction: Transaction, blockNumber?: string): Promise<Quantity>
    • Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. The transaction will not be added to the blockchain. Note that the estimate may be significantly more than the @@ -187,12 +187,12 @@

      Integer block number, or the string "latest", "earliest" or "pending".

    Returns Promise<Quantity>

    The amount of gas used.

    -

    eth_gasPrice

    • eth_gasPrice(): Promise<Quantity>

    eth_gasPrice

    • eth_gasPrice(): Promise<Quantity>
    • Returns the current price per gas in wei.

      example
      const gasPrice = await provider.request({ method: "eth_gasPrice", params: [] });
      console.log(gasPrice);

      Returns Promise<Quantity>

      Integer of the current gas price in wei.

      -

    eth_getBalance

    • eth_getBalance(address: string, blockNumber?: string): Promise<Quantity>

    eth_getBalance

    • eth_getBalance(address: string, blockNumber?: string): Promise<Quantity>
    • Returns the balance of the account of given address.

      example
      const accounts = await provider.request({ method: "eth_accounts", params: [] });
      const balance = await provider.request({ method: "eth_getBalance", params: [accounts[0], "latest"] });
      console.log(balance);
      @@ -202,7 +202,7 @@

      Integer block number, or the string "latest", "earliest" or "pending".

    Returns Promise<Quantity>

    Integer of the account balance in wei.

    -

    eth_getBlockByHash

    • eth_getBlockByHash<IncludeTransactions>(hash: string, transactions?: IncludeTransactions): Promise<{ hash: Data; size: Quantity; transactions: IncludeTransactions extends true ? (LegacyTransactionJSON | EIP2930AccessListTransactionJSON | EIP1559FeeMarketTransactionJSON | Transaction<"private">)[] : Data[]; uncles: Data[] } & BlockHeader>

    eth_getBlockByHash

    • eth_getBlockByHash<IncludeTransactions>(hash: string, transactions?: IncludeTransactions): Promise<{ hash: Data; size: Quantity; transactions: IncludeTransactions extends true ? (LegacyTransactionJSON | EIP2930AccessListTransactionJSON | EIP1559FeeMarketTransactionJSON | Transaction<"private">)[] : Data[]; uncles: Data[] } & BlockHeader>
    • Returns information about a block by block hash.

      example
      // Simple.sol
      // // SPDX-License-Identifier: MIT
      // pragma solidity ^0.7.4;
      //
      // contract Simple {
      // uint256 public value;
      // constructor() payable {
      // value = 5;
      // }
      // }
      const simpleSol = "0x6080604052600560008190555060858060196000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c80633fa4f24514602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b6000548156fea26469706673582212200897f7766689bf7a145227297912838b19bcad29039258a293be78e3bf58e20264736f6c63430007040033";
      const [from] = await provider.request({ method: "eth_accounts", params: [] });
      await provider.request({ method: "eth_subscribe", params: ["newHeads"] });
      const txHash = await provider.request({ method: "eth_sendTransaction", params: [{ from, gas: "0x5b8d80", data: simpleSol }] });
      await provider.once("message"); // Note: `await provider.once` is non-standard
      const txReceipt = await provider.request({ method: "eth_getTransactionReceipt", params: [txHash] });
      const block = await provider.request({ method: "eth_getBlockByHash", params: [txReceipt.blockHash, true] });
      console.log(block);
      @@ -234,7 +234,7 @@
    • transactions: Array - Array of transaction objects or 32 Bytes transaction hashes depending on the last parameter.
    • uncles: Array - Array of uncle hashes.
    -

    eth_getBlockByNumber

    • eth_getBlockByNumber<IncludeTransactions>(number: string, transactions?: IncludeTransactions): Promise<{ hash: Data; size: Quantity; transactions: IncludeTransactions extends true ? (LegacyTransactionJSON | EIP2930AccessListTransactionJSON | EIP1559FeeMarketTransactionJSON | Transaction<"private">)[] : Data[]; uncles: Data[] } & BlockHeader>

    eth_getBlockByNumber

    • eth_getBlockByNumber<IncludeTransactions>(number: string, transactions?: IncludeTransactions): Promise<{ hash: Data; size: Quantity; transactions: IncludeTransactions extends true ? (LegacyTransactionJSON | EIP2930AccessListTransactionJSON | EIP1559FeeMarketTransactionJSON | Transaction<"private">)[] : Data[]; uncles: Data[] } & BlockHeader>
    • Returns information about a block by block number.

      example
      const block = await provider.request({ method: "eth_getBlockByNumber", params: ["0x0", false] });
      console.log(block);
      @@ -267,19 +267,19 @@
    • transactions: Array - Array of transaction objects or 32 Bytes transaction hashes depending on the last parameter.
    • uncles: Array - Array of uncle hashes.
    -

    eth_getBlockTransactionCountByHash

    • eth_getBlockTransactionCountByHash(hash: string): Promise<Quantity>

    eth_getBlockTransactionCountByHash

    • eth_getBlockTransactionCountByHash(hash: string): Promise<Quantity>
    • Returns the number of transactions in a block from a block matching the given block hash.

      example
      // Simple.sol
      // // SPDX-License-Identifier: MIT
      // pragma solidity ^0.7.4;
      //
      // contract Simple {
      // uint256 public value;
      // constructor() payable {
      // value = 5;
      // }
      // }
      const simpleSol = "0x6080604052600560008190555060858060196000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c80633fa4f24514602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b6000548156fea26469706673582212200897f7766689bf7a145227297912838b19bcad29039258a293be78e3bf58e20264736f6c63430007040033";
      const [from] = await provider.request({ method: "eth_accounts", params: [] });
      await provider.request({ method: "eth_subscribe", params: ["newHeads"] });
      const txHash = await provider.request({ method: "eth_sendTransaction", params: [{ from, gas: "0x5b8d80", data: simpleSol }] });
      await provider.once("message"); // Note: `await provider.once` is non-standard
      const txReceipt = await provider.request({ method: "eth_getTransactionReceipt", params: [txHash] });
      const txCount = await provider.request({ method: "eth_getBlockTransactionCountByHash", params: [txReceipt.blockHash] });
      console.log(txCount);

      Parameters

      • hash: string

        Hash of a block.

      Returns Promise<Quantity>

      Number of transactions in the block.

      -

    eth_getBlockTransactionCountByNumber

    • eth_getBlockTransactionCountByNumber(blockNumber: string): Promise<Quantity>

    eth_getBlockTransactionCountByNumber

    • eth_getBlockTransactionCountByNumber(blockNumber: string): Promise<Quantity>
    • Returns the number of transactions in a block from a block matching the given block number.

      example
      const txCount = await provider.request({ method: "eth_getBlockTransactionCountByNumber", params: ["0x0"] });
      console.log(txCount);

      Parameters

      • blockNumber: string

      Returns Promise<Quantity>

      Integer of the number of transactions in the block.

      -

    eth_getCode

    • eth_getCode(address: string, blockNumber?: string): Promise<Data>

    eth_getCode

    • eth_getCode(address: string, blockNumber?: string): Promise<Data>
    • Returns code at a given address.

      example
      // Simple.sol
      // // SPDX-License-Identifier: MIT
      // pragma solidity ^0.7.4;
      //
      // contract Simple {
      // uint256 public value;
      // constructor() payable {
      // value = 5;
      // }
      // }
      const simpleSol = "0x6080604052600560008190555060858060196000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c80633fa4f24514602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b6000548156fea26469706673582212200897f7766689bf7a145227297912838b19bcad29039258a293be78e3bf58e20264736f6c63430007040033";
      const [from] = await provider.request({ method: "eth_accounts", params: [] });
      await provider.request({ method: "eth_subscribe", params: ["newHeads"] });
      const txHash = await provider.request({ method: "eth_sendTransaction", params: [{ from, gas: "0x5b8d80", data: simpleSol }] });
      await provider.once("message"); // Note: `await provider.once` is non-standard
      const txReceipt = await provider.request({ method: "eth_getTransactionReceipt", params: [txHash] });
      const code = await provider.request({ method: "eth_getCode", params: [txReceipt.contractAddress, "latest"] });
      console.log(code);
      @@ -288,12 +288,12 @@
    • blockNumber: string = Tag.latest

      Integer block number, or the string "latest", "earliest" or "pending".

    Returns Promise<Data>

    The code from the given address.

    -

    eth_getCompilers

    • eth_getCompilers(): Promise<string[]>

    eth_getCompilers

    • eth_getCompilers(): Promise<string[]>
    • Returns a list of available compilers.

      example
      const compilers = await provider.send("eth_getCompilers");
      console.log(compilers);

      Returns Promise<string[]>

      List of available compilers.

      -

    eth_getFilterChanges

    • eth_getFilterChanges(filterId: string): Promise<Data[]>

    eth_getFilterChanges

    • eth_getFilterChanges(filterId: string): Promise<Data[]>
    • Polling method for a filter, which returns an array of logs, block hashes, or transaction hashes, depending on the filter type, which occurred since last poll.

      @@ -317,14 +317,14 @@
    • data: DATA - Contains one or more 32 Bytes non-indexed arguments of the log.
    • topics: Array of DATA - Array of 0 to 4 32 Bytes DATA of indexed log arguments.
    -

    eth_getFilterLogs

    • eth_getFilterLogs(filterId: string): Promise<Logs>

    eth_getFilterLogs

    • eth_getFilterLogs(filterId: string): Promise<Logs>
    • Returns an array of all logs matching filter with given id.

      example
      // Logs.sol
      // // SPDX-License-Identifier: MIT
      // pragma solidity ^0.7.4;
      // contract Logs {
      // event Event(uint256 indexed first, uint256 indexed second);
      // constructor() {
      // emit Event(1, 2);
      // }
      //
      // function logNTimes(uint8 n) public {
      // for (uint8 i = 0; i < n; i++) {
      // emit Event(i, i);
      // }
      // }
      // }

      const logsContract = "0x608060405234801561001057600080fd5b50600260017f34e802e5ebd1f132e05852c5064046c1b535831ec52f1c4997fc6fdc4d5345b360405160405180910390a360e58061004f6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c80635e19e69f14602d575b600080fd5b605960048036036020811015604157600080fd5b81019080803560ff169060200190929190505050605b565b005b60005b8160ff168160ff16101560ab578060ff168160ff167f34e802e5ebd1f132e05852c5064046c1b535831ec52f1c4997fc6fdc4d5345b360405160405180910390a38080600101915050605e565b505056fea26469706673582212201af9c13c7b00e2b628c1258d45f9f62d2aad8cd32fc32fd9515d8ad1e792679064736f6c63430007040033";
      const [from] = await provider.send("eth_accounts");
      const filterId = await provider.send("eth_newFilter");

      await provider.send("eth_subscribe", ["newHeads"]);
      await provider.send("eth_sendTransaction", [{ from, data: logsContract, gas: "0x5b8d80" }] );
      await provider.once("message");

      const logs = await provider.request({ method: "eth_getFilterLogs", params: [filterId] });
      console.log(logs);

      Parameters

      • filterId: string

        The filter id.

      Returns Promise<Logs>

      Array of log objects, or an empty array.

      -

    eth_getLogs

    • eth_getLogs(filter: FilterArgs): Promise<Logs>

    eth_getLogs

    • eth_getLogs(filter: FilterArgs): Promise<Logs>
    • Returns an array of all logs matching a given filter object.

      Filter options:

        @@ -343,7 +343,7 @@

      Parameters

      • filter: FilterArgs

        The filter options as seen in source.

      Returns Promise<Logs>

      Array of log objects, or an empty array.

      -

    eth_getProof

    • eth_getProof(address: string, storageKeys: string[], blockNumber?: string): Promise<AccountProof>

    eth_getProof

    • eth_getProof(address: string, storageKeys: string[], blockNumber?: string): Promise<AccountProof>
    • Returns the details for the account at the specified address and block number, the account's Merkle proof, and the storage values for the specified storage keys with their Merkle-proofs.

      @@ -380,7 +380,7 @@
    -

    eth_getStorageAt

    • eth_getStorageAt(address: string, position: string, blockNumber?: string): Promise<Data>

    eth_getStorageAt

    • eth_getStorageAt(address: string, position: string, blockNumber?: string): Promise<Data>
    • Returns the value from a storage position at a given address.

      example
      // Simple.sol
      // // SPDX-License-Identifier: MIT
      // pragma solidity ^0.7.4;
      //
      // contract Simple {
      // uint256 public value;
      // constructor() payable {
      // value = 5;
      // }
      // }
      const simpleSol = "0x6080604052600560008190555060858060196000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c80633fa4f24514602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b6000548156fea26469706673582212200897f7766689bf7a145227297912838b19bcad29039258a293be78e3bf58e20264736f6c63430007040033";
      const [from] = await provider.request({ method: "eth_accounts", params: [] });
      await provider.request({ method: "eth_subscribe", params: ["newHeads"] });
      const txHash = await provider.request({ method: "eth_sendTransaction", params: [{ from, gas: "0x5b8d80", data: simpleSol }] });
      await provider.once("message"); // Note: `await provider.once` is non-standard
      const txReceipt = await provider.request({ method: "eth_getTransactionReceipt", params: [txHash] });
      const storageValue = await provider.request({ method: "eth_getStorageAt", params: [txReceipt.contractAddress, "0x0", "latest"] });
      console.log(storageValue);
      @@ -392,7 +392,7 @@

      Integer block number, or the string "latest", "earliest" or "pending".

    Returns Promise<Data>

    The value in storage at the requested position.

    -

    eth_getTransactionByBlockHashAndIndex

    • eth_getTransactionByBlockHashAndIndex(hash: string, index: string): Promise<LegacyTransactionJSON | EIP2930AccessListTransactionJSON | EIP1559FeeMarketTransactionJSON>

    eth_getTransactionByBlockHashAndIndex

    • eth_getTransactionByBlockHashAndIndex(hash: string, index: string): Promise<LegacyTransactionJSON | EIP2930AccessListTransactionJSON | EIP1559FeeMarketTransactionJSON>
    • Returns information about a transaction by block hash and transaction index position.

      example
      const [from, to] = await provider.request({ method: "eth_accounts", params: [] });
      await provider.request({ method: "eth_subscribe", params: ["newHeads"] });
      const txHash = await provider.request({ method: "eth_sendTransaction", params: [{ from, to, gas: "0x5b8d80" }] });
      await provider.once("message"); // Note: `await provider.once` is non-standard
      const { blockHash, transactionIndex } = await provider.request({ method: "eth_getTransactionReceipt", params: [txHash] });

      const tx = await provider.request({ method: "eth_getTransactionByBlockHashAndIndex", params: [ blockHash, transactionIndex ] });
      console.log(tx);
      @@ -417,7 +417,7 @@
    • r: DATA, 32 Bytes - ECDSA signature r.
    • s: DATA, 32 Bytes - ECDSA signature s.
    -

    eth_getTransactionByBlockNumberAndIndex

    • eth_getTransactionByBlockNumberAndIndex(number: string, index: string): Promise<LegacyTransactionJSON | EIP2930AccessListTransactionJSON | EIP1559FeeMarketTransactionJSON>

    eth_getTransactionByBlockNumberAndIndex

    • eth_getTransactionByBlockNumberAndIndex(number: string, index: string): Promise<LegacyTransactionJSON | EIP2930AccessListTransactionJSON | EIP1559FeeMarketTransactionJSON>
    • Returns information about a transaction by block number and transaction index position.

      example
      const [from, to] = await provider.request({ method: "eth_accounts", params: [] });
      await provider.request({ method: "eth_subscribe", params: ["newHeads"] });
      const txHash = await provider.request({ method: "eth_sendTransaction", params: [{ from, to, gas: "0x5b8d80" }] });
      await provider.once("message"); // Note: `await provider.once` is non-standard
      const { transactionIndex } = await provider.request({ method: "eth_getTransactionReceipt", params: [txHash] });

      const tx = await provider.request({ method: "eth_getTransactionByBlockNumberAndIndex", params: [ "latest", transactionIndex ] });
      console.log(tx);
      @@ -442,7 +442,7 @@
    • r: DATA, 32 Bytes - ECDSA signature r.
    • s: DATA, 32 Bytes - ECDSA signature s.
    -

    eth_getTransactionByHash

    • eth_getTransactionByHash(transactionHash: string): Promise<LegacyTransactionJSON | EIP2930AccessListTransactionJSON | EIP1559FeeMarketTransactionJSON | Transaction<"private">>

    eth_getTransactionByHash

    • eth_getTransactionByHash(transactionHash: string): Promise<LegacyTransactionJSON | EIP2930AccessListTransactionJSON | EIP1559FeeMarketTransactionJSON | Transaction<"private">>
    • Returns the information about a transaction requested by transaction hash.

      example
      const [from, to] = await provider.request({ method: "eth_accounts", params: [] });
      await provider.request({ method: "eth_subscribe", params: ["newHeads"] });
      const txHash = await provider.request({ method: "eth_sendTransaction", params: [{ from, to, gas: "0x5b8d80" }] });
      await provider.once("message"); // Note: `await provider.once` is non-standard

      const tx = await provider.request({ method: "eth_getTransactionByHash", params: [ txHash ] });
      console.log(tx);
      @@ -465,7 +465,7 @@
    • r: DATA, 32 Bytes - ECDSA signature r.
    • s: DATA, 32 Bytes - ECDSA signature s.
    -

    eth_getTransactionCount

    • eth_getTransactionCount(address: string, blockNumber?: string): Promise<Quantity>

    eth_getTransactionCount

    • eth_getTransactionCount(address: string, blockNumber?: string): Promise<Quantity>
    • Returns the number of transactions sent from an address.

      example
      const [from, to] = await provider.request({ method: "eth_accounts", params: [] });
      await provider.request({ method: "eth_subscribe", params: ["newHeads"] });
      await provider.request({ method: "eth_sendTransaction", params: [{ from, to, gas: "0x5b8d80" }] });
      await provider.once("message"); // Note: `await provider.once` is non-standard

      const txCount = await provider.request({ method: "eth_getTransactionCount", params: [ from, "latest" ] });
      console.log(txCount);
      @@ -475,7 +475,7 @@

      Integer block number, or the string "latest", "earliest" or "pending".

    Returns Promise<Quantity>

    Number of transactions sent from this address.

    -

    eth_getTransactionReceipt

    • eth_getTransactionReceipt(transactionHash: string): Promise<TransactionReceipt>

    eth_getTransactionReceipt

    • eth_getTransactionReceipt(transactionHash: string): Promise<TransactionReceipt>
    • Returns the receipt of a transaction by transaction hash.

      Note: The receipt is not available for pending transactions.

      example
      const [from, to] = await provider.request({ method: "eth_accounts", params: [] });
      await provider.request({ method: "eth_subscribe", params: ["newHeads"] });
      const txHash = await provider.request({ method: "eth_sendTransaction", params: [{ from, to, gas: "0x5b8d80" }] });
      await provider.once("message"); // Note: `await provider.once` is non-standard

      const txReceipt = await provider.request({ method: "eth_getTransactionReceipt", params: [ txHash ] });
      console.log(txReceipt); @@ -483,7 +483,7 @@

      Parameters

      • transactionHash: string

        Hash of a transaction.

      Returns Promise<TransactionReceipt>

      Returns the receipt of a transaction by transaction hash.

      -

    eth_getUncleByBlockHashAndIndex

    • eth_getUncleByBlockHashAndIndex(hash: string, index: string): Promise<Omit<{ baseFeePerGas?: string; difficulty: string; extraData: string; gasLimit: string; gasUsed: string; hash: string; logsBloom: string; miner: string; mixHash: string; nonce: string; number: string; parentHash: string; receiptsRoot: string; sha3Uncles: string; size: string; stateRoot: string; timestamp: string; totalDifficulty: string; transactions: ({ hash: string; type?: string; nonce: string; blockHash: string; blockNumber: string; transactionIndex: string; from: string; to: string; value: string; gas: string; gasPrice: string; input: string; v: string; r: string; s: string; } | { hash: string; type: string; chainId: string; nonce: string; blockHash: string; blockNumber: string; transactionIndex: string; from: string; to: string; value: string; gas: string; gasPrice: string; input: string; accessList: { address: string; storageKeys: string[]; }[]; v: string; r: string; s: string; } | { hash: string; type: string; chainId: string; nonce: string; blockHash: string; blockNumber: string; transactionIndex: string; from: string; to: string; value: string; maxPriorityFeePerGas: string; maxFeePerGas: string; gasPrice: string; gas: string; input: string; accessList: { address: string; storageKeys: string[]; }[]; v: string; r: string; s: string; } | { type?: string; from: string; nonce: string; gas: string; to: string; value: string; input: string; v: string; r: string; s: string; gasPrice: string; blockNumber: null; blockHash: null; transactionIndex: null; hash: string; })[]; transactionsRoot: string; uncles: string[] }, "transactions">>

    eth_getUncleByBlockHashAndIndex

    • eth_getUncleByBlockHashAndIndex(hash: string, index: string): Promise<Omit<{ baseFeePerGas?: string; difficulty: string; extraData: string; gasLimit: string; gasUsed: string; hash: string; logsBloom: string; miner: string; mixHash: string; nonce: string; number: string; parentHash: string; receiptsRoot: string; sha3Uncles: string; size: string; stateRoot: string; timestamp: string; totalDifficulty: string; transactions: ({ hash: string; type?: string; nonce: string; blockHash: string; blockNumber: string; transactionIndex: string; from: string; to: string; value: string; gas: string; gasPrice: string; input: string; v: string; r: string; s: string; } | { hash: string; type: string; chainId: string; nonce: string; blockHash: string; blockNumber: string; transactionIndex: string; from: string; to: string; value: string; gas: string; gasPrice: string; input: string; accessList: { address: string; storageKeys: string[]; }[]; v: string; r: string; s: string; } | { hash: string; type: string; chainId: string; nonce: string; blockHash: string; blockNumber: string; transactionIndex: string; from: string; to: string; value: string; maxPriorityFeePerGas: string; maxFeePerGas: string; gasPrice: string; gas: string; input: string; accessList: { address: string; storageKeys: string[]; }[]; v: string; r: string; s: string; } | { type?: string; nonce: string; value: string; r: string; s: string; blockHash: null; hash: string; blockNumber: null; gasPrice: string; gas: string; to: string; v: string; from: string; transactionIndex: null; input: string; })[]; transactionsRoot: string; uncles: string[] }, "transactions">>
    • Returns information about a uncle of a block by hash and uncle index position.

      example
      const blockHash = await provider.send("eth_getBlockByNumber", ["latest"] );
      const block = await provider.send("eth_getUncleByBlockHashAndIndex", [blockHash, "0x0"] );
      console.log(block);
      @@ -491,7 +491,7 @@

      Hash of a block.

    • index: string

      The uncle's index position.

      -

    Returns Promise<Omit<{ baseFeePerGas?: string; difficulty: string; extraData: string; gasLimit: string; gasUsed: string; hash: string; logsBloom: string; miner: string; mixHash: string; nonce: string; number: string; parentHash: string; receiptsRoot: string; sha3Uncles: string; size: string; stateRoot: string; timestamp: string; totalDifficulty: string; transactions: ({ hash: string; type?: string; nonce: string; blockHash: string; blockNumber: string; transactionIndex: string; from: string; to: string; value: string; gas: string; gasPrice: string; input: string; v: string; r: string; s: string; } | { hash: string; type: string; chainId: string; nonce: string; blockHash: string; blockNumber: string; transactionIndex: string; from: string; to: string; value: string; gas: string; gasPrice: string; input: string; accessList: { address: string; storageKeys: string[]; }[]; v: string; r: string; s: string; } | { hash: string; type: string; chainId: string; nonce: string; blockHash: string; blockNumber: string; transactionIndex: string; from: string; to: string; value: string; maxPriorityFeePerGas: string; maxFeePerGas: string; gasPrice: string; gas: string; input: string; accessList: { address: string; storageKeys: string[]; }[]; v: string; r: string; s: string; } | { type?: string; from: string; nonce: string; gas: string; to: string; value: string; input: string; v: string; r: string; s: string; gasPrice: string; blockNumber: null; blockHash: null; transactionIndex: null; hash: string; })[]; transactionsRoot: string; uncles: string[] }, "transactions">>

    A block object or null when no block is found.

    +

    Returns Promise<Omit<{ baseFeePerGas?: string; difficulty: string; extraData: string; gasLimit: string; gasUsed: string; hash: string; logsBloom: string; miner: string; mixHash: string; nonce: string; number: string; parentHash: string; receiptsRoot: string; sha3Uncles: string; size: string; stateRoot: string; timestamp: string; totalDifficulty: string; transactions: ({ hash: string; type?: string; nonce: string; blockHash: string; blockNumber: string; transactionIndex: string; from: string; to: string; value: string; gas: string; gasPrice: string; input: string; v: string; r: string; s: string; } | { hash: string; type: string; chainId: string; nonce: string; blockHash: string; blockNumber: string; transactionIndex: string; from: string; to: string; value: string; gas: string; gasPrice: string; input: string; accessList: { address: string; storageKeys: string[]; }[]; v: string; r: string; s: string; } | { hash: string; type: string; chainId: string; nonce: string; blockHash: string; blockNumber: string; transactionIndex: string; from: string; to: string; value: string; maxPriorityFeePerGas: string; maxFeePerGas: string; gasPrice: string; gas: string; input: string; accessList: { address: string; storageKeys: string[]; }[]; v: string; r: string; s: string; } | { type?: string; nonce: string; value: string; r: string; s: string; blockHash: null; hash: string; blockNumber: null; gasPrice: string; gas: string; to: string; v: string; from: string; transactionIndex: null; input: string; })[]; transactionsRoot: string; uncles: string[] }, "transactions">>

    A block object or null when no block is found.

    • hash: DATA, 32 Bytes - Hash of the block. null when pending.
    • parentHash: DATA, 32 Bytes - Hash of the parent block.
    • @@ -515,7 +515,7 @@

    **NOTE: **The return does not contain a list of transactions in the uncle block, to get this, make another request to eth_getBlockByHash.

    -

    eth_getUncleByBlockNumberAndIndex

    • eth_getUncleByBlockNumberAndIndex(blockNumber: string, uncleIndex: string): Promise<Omit<{ baseFeePerGas?: string; difficulty: string; extraData: string; gasLimit: string; gasUsed: string; hash: string; logsBloom: string; miner: string; mixHash: string; nonce: string; number: string; parentHash: string; receiptsRoot: string; sha3Uncles: string; size: string; stateRoot: string; timestamp: string; totalDifficulty: string; transactions: ({ hash: string; type?: string; nonce: string; blockHash: string; blockNumber: string; transactionIndex: string; from: string; to: string; value: string; gas: string; gasPrice: string; input: string; v: string; r: string; s: string; } | { hash: string; type: string; chainId: string; nonce: string; blockHash: string; blockNumber: string; transactionIndex: string; from: string; to: string; value: string; gas: string; gasPrice: string; input: string; accessList: { address: string; storageKeys: string[]; }[]; v: string; r: string; s: string; } | { hash: string; type: string; chainId: string; nonce: string; blockHash: string; blockNumber: string; transactionIndex: string; from: string; to: string; value: string; maxPriorityFeePerGas: string; maxFeePerGas: string; gasPrice: string; gas: string; input: string; accessList: { address: string; storageKeys: string[]; }[]; v: string; r: string; s: string; } | { type?: string; from: string; nonce: string; gas: string; to: string; value: string; input: string; v: string; r: string; s: string; gasPrice: string; blockNumber: null; blockHash: null; transactionIndex: null; hash: string; })[]; transactionsRoot: string; uncles: string[] }, "transactions">>

    eth_getUncleByBlockNumberAndIndex

    • eth_getUncleByBlockNumberAndIndex(blockNumber: string, uncleIndex: string): Promise<Omit<{ baseFeePerGas?: string; difficulty: string; extraData: string; gasLimit: string; gasUsed: string; hash: string; logsBloom: string; miner: string; mixHash: string; nonce: string; number: string; parentHash: string; receiptsRoot: string; sha3Uncles: string; size: string; stateRoot: string; timestamp: string; totalDifficulty: string; transactions: ({ hash: string; type?: string; nonce: string; blockHash: string; blockNumber: string; transactionIndex: string; from: string; to: string; value: string; gas: string; gasPrice: string; input: string; v: string; r: string; s: string; } | { hash: string; type: string; chainId: string; nonce: string; blockHash: string; blockNumber: string; transactionIndex: string; from: string; to: string; value: string; gas: string; gasPrice: string; input: string; accessList: { address: string; storageKeys: string[]; }[]; v: string; r: string; s: string; } | { hash: string; type: string; chainId: string; nonce: string; blockHash: string; blockNumber: string; transactionIndex: string; from: string; to: string; value: string; maxPriorityFeePerGas: string; maxFeePerGas: string; gasPrice: string; gas: string; input: string; accessList: { address: string; storageKeys: string[]; }[]; v: string; r: string; s: string; } | { type?: string; nonce: string; value: string; r: string; s: string; blockHash: null; hash: string; blockNumber: null; gasPrice: string; gas: string; to: string; v: string; from: string; transactionIndex: null; input: string; })[]; transactionsRoot: string; uncles: string[] }, "transactions">>
    • Returns information about a uncle of a block by hash and uncle index position.

      example
      const block = await provider.send("eth_getUncleByBlockNumberAndIndex", ["latest", "0x0"] );
      console.log(block);
      @@ -523,7 +523,7 @@

      A block number, or the string "earliest", "latest" or "pending".

    • uncleIndex: string

      The uncle's index position.

      -

    Returns Promise<Omit<{ baseFeePerGas?: string; difficulty: string; extraData: string; gasLimit: string; gasUsed: string; hash: string; logsBloom: string; miner: string; mixHash: string; nonce: string; number: string; parentHash: string; receiptsRoot: string; sha3Uncles: string; size: string; stateRoot: string; timestamp: string; totalDifficulty: string; transactions: ({ hash: string; type?: string; nonce: string; blockHash: string; blockNumber: string; transactionIndex: string; from: string; to: string; value: string; gas: string; gasPrice: string; input: string; v: string; r: string; s: string; } | { hash: string; type: string; chainId: string; nonce: string; blockHash: string; blockNumber: string; transactionIndex: string; from: string; to: string; value: string; gas: string; gasPrice: string; input: string; accessList: { address: string; storageKeys: string[]; }[]; v: string; r: string; s: string; } | { hash: string; type: string; chainId: string; nonce: string; blockHash: string; blockNumber: string; transactionIndex: string; from: string; to: string; value: string; maxPriorityFeePerGas: string; maxFeePerGas: string; gasPrice: string; gas: string; input: string; accessList: { address: string; storageKeys: string[]; }[]; v: string; r: string; s: string; } | { type?: string; from: string; nonce: string; gas: string; to: string; value: string; input: string; v: string; r: string; s: string; gasPrice: string; blockNumber: null; blockHash: null; transactionIndex: null; hash: string; })[]; transactionsRoot: string; uncles: string[] }, "transactions">>

    A block object or null when no block is found.

    +

    Returns Promise<Omit<{ baseFeePerGas?: string; difficulty: string; extraData: string; gasLimit: string; gasUsed: string; hash: string; logsBloom: string; miner: string; mixHash: string; nonce: string; number: string; parentHash: string; receiptsRoot: string; sha3Uncles: string; size: string; stateRoot: string; timestamp: string; totalDifficulty: string; transactions: ({ hash: string; type?: string; nonce: string; blockHash: string; blockNumber: string; transactionIndex: string; from: string; to: string; value: string; gas: string; gasPrice: string; input: string; v: string; r: string; s: string; } | { hash: string; type: string; chainId: string; nonce: string; blockHash: string; blockNumber: string; transactionIndex: string; from: string; to: string; value: string; gas: string; gasPrice: string; input: string; accessList: { address: string; storageKeys: string[]; }[]; v: string; r: string; s: string; } | { hash: string; type: string; chainId: string; nonce: string; blockHash: string; blockNumber: string; transactionIndex: string; from: string; to: string; value: string; maxPriorityFeePerGas: string; maxFeePerGas: string; gasPrice: string; gas: string; input: string; accessList: { address: string; storageKeys: string[]; }[]; v: string; r: string; s: string; } | { type?: string; nonce: string; value: string; r: string; s: string; blockHash: null; hash: string; blockNumber: null; gasPrice: string; gas: string; to: string; v: string; from: string; transactionIndex: null; input: string; })[]; transactionsRoot: string; uncles: string[] }, "transactions">>

    A block object or null when no block is found.

    • hash: DATA, 32 Bytes - Hash of the block. null when pending.

    • @@ -567,21 +567,21 @@ block, to get this, make another request to eth_getBlockByHash.

    -

    eth_getUncleCountByBlockHash

    • eth_getUncleCountByBlockHash(hash: string): Promise<Quantity>

    eth_getUncleCountByBlockHash

    • eth_getUncleCountByBlockHash(hash: string): Promise<Quantity>
    • Returns the number of uncles in a block from a block matching the given block hash.

      example
      const blockHash = await provider.send("eth_getBlockByNumber", ["latest"] );
      const uncleCount = await provider.send("eth_getUncleCountByBlockHash", [blockHash] );
      console.log(uncleCount);

      Parameters

      • hash: string

        Hash of a block.

      Returns Promise<Quantity>

      The number of uncles in a block.

      -

    eth_getUncleCountByBlockNumber

    • eth_getUncleCountByBlockNumber(blockNumber: string): Promise<Quantity>

    eth_getUncleCountByBlockNumber

    • eth_getUncleCountByBlockNumber(blockNumber: string): Promise<Quantity>
    • Returns the number of uncles in a block from a block matching the given block hash.

      example
      const uncleCount = await provider.send("eth_getUncleCountByBlockNumber", ["latest"] );
      console.log(uncleCount);

      Parameters

      • blockNumber: string

        A block number, or the string "earliest", "latest" or "pending".

      Returns Promise<Quantity>

      The number of uncles in a block.

      -

    eth_getWork

    • eth_getWork(): Promise<[] | [string, string, string]>

    eth_getWork

    • eth_getWork(): Promise<[] | [string, string, string]>
    • Returns: An Array with the following elements 1: DATA, 32 Bytes - current block header pow-hash 2: DATA, 32 Bytes - the seed hash used for the DAG. @@ -589,28 +589,28 @@

      example
      console.log(await provider.send("eth_getWork", [] ));
       

      Returns Promise<[] | [string, string, string]>

      The hash of the current block, the seedHash, and the boundary condition to be met ("target").

      -

    eth_hashrate

    • eth_hashrate(): Promise<Quantity>

    eth_hashrate

    • eth_hashrate(): Promise<Quantity>
    • Returns the number of hashes per second that the node is mining with.

      example
      const hashrate = await provider.request({ method: "eth_hashrate", params: [] });
      console.log(hashrate);

      Returns Promise<Quantity>

      Number of hashes per second.

      -

    eth_maxPriorityFeePerGas

    • eth_maxPriorityFeePerGas(): Promise<Quantity>

    eth_maxPriorityFeePerGas

    • eth_maxPriorityFeePerGas(): Promise<Quantity>
    • Returns a maxPriorityFeePerGas value suitable for quick transaction inclusion.

      example
      const suggestedTip = await provider.request({ method: "eth_maxPriorityFeePerGas", params: [] });
      console.log(suggestedTip);

      Returns Promise<Quantity>

      The maxPriorityFeePerGas in wei.

      -

    eth_mining

    • eth_mining(): Promise<boolean>

    eth_mining

    • eth_mining(): Promise<boolean>
    • Returns true if client is actively mining new blocks.

      example
      const isMining = await provider.request({ method: "eth_mining", params: [] });
      console.log(isMining);

      Returns Promise<boolean>

      returns true if the client is mining, otherwise false.

      -

    eth_newBlockFilter

    • eth_newBlockFilter(): Promise<Quantity>

    eth_newBlockFilter

    • eth_newBlockFilter(): Promise<Quantity>
    • Creates a filter in the node, to notify when a new block arrives. To check if the state has changed, call eth_getFilterChanges.

      example
      const filterId = await provider.request({ method: "eth_newBlockFilter", params: [] });
      console.log(filterId);

      Returns Promise<Quantity>

      A filter id.

      -

    eth_newFilter

    • eth_newFilter(filter?: RangeFilterArgs): Promise<Quantity>

    eth_newFilter

    • eth_newFilter(filter?: RangeFilterArgs): Promise<Quantity>
    • Creates a filter object, based on filter options, to notify when the state changes (logs). To check if the state has changed, call eth_getFilterChanges.

      @@ -649,25 +649,25 @@

      A note on specifying topic filters:

      Parameters

      • Optional filter: RangeFilterArgs

        The filter options as seen in source.

      Returns Promise<Quantity>

      A filter id.

      -

    eth_newPendingTransactionFilter

    • eth_newPendingTransactionFilter(): Promise<Quantity>

    eth_newPendingTransactionFilter

    • eth_newPendingTransactionFilter(): Promise<Quantity>
    • Creates a filter in the node, to notify when new pending transactions arrive. To check if the state has changed, call eth_getFilterChanges.

      example
      const filterId = await provider.request({ method: "eth_newPendingTransactionFilter", params: [] });
      console.log(filterId);

      Returns Promise<Quantity>

      A filter id.

      -

    eth_protocolVersion

    • eth_protocolVersion(): Promise<Data>

    eth_protocolVersion

    • eth_protocolVersion(): Promise<Data>
    • Returns the current ethereum protocol version.

      example
      const version = await provider.request({ method: "eth_protocolVersion", params: [] });
      console.log(version);

      Returns Promise<Data>

      The current ethereum protocol version.

      -

    eth_sendRawTransaction

    • eth_sendRawTransaction(transaction: string): Promise<Data>

    eth_sendRawTransaction

    • eth_sendRawTransaction(transaction: string): Promise<Data>
    • Creates new message call transaction or a contract creation for signed transactions.

      example
      const [from, to] = await provider.request({ method: "eth_accounts", params: [] });
      const signedTx = await provider.request({ method: "eth_signTransaction", params: [{ from, to, gas: "0x5b8d80" }] });
      const txHash = await provider.send("eth_sendRawTransaction", [signedTx] );
      console.log(txHash);

      Parameters

      • transaction: string

        The signed transaction data.

      Returns Promise<Data>

      The transaction hash.

      -

    eth_sendTransaction

    • eth_sendTransaction(transaction: Transaction): Promise<Data>

    eth_sendTransaction

    • eth_sendTransaction(transaction: Transaction): Promise<Data>
    • Creates new message call transaction or a contract creation, if the data field contains code.

      Transaction call object:

        @@ -683,7 +683,7 @@

        A note on specifying topic filters:

      Parameters

      • transaction: Transaction

        The transaction call object as seen in source.

      Returns Promise<Data>

      The transaction hash.

      -

    eth_sign

    • eth_sign(address: string, message: string): Promise<string>

    eth_sign

    • eth_sign(address: string, message: string): Promise<string>
    • The sign method calculates an Ethereum specific signature with: sign(keccak256("\x19Ethereum Signed Message:\n" + message.length + message))).

      By adding a prefix to the message makes the calculated signature @@ -702,7 +702,7 @@

      A note on specifying topic filters:

      in big-endian format. Bytes 0...64 contain the r parameter, bytes 64...128 the s parameter, and the last byte the v parameter. Note that the v parameter includes the chain id as specified in EIP-155.

      -

    eth_signTransaction

    • eth_signTransaction(transaction: Transaction): Promise<Data>

    eth_signTransaction

    • eth_signTransaction(transaction: Transaction): Promise<Data>
    • Signs a transaction that can be submitted to the network at a later time using eth_sendRawTransaction.

      Transaction call object:

        @@ -718,7 +718,7 @@

        A note on specifying topic filters:

      Parameters

      • transaction: Transaction

        The transaction call object as seen in source.

      Returns Promise<Data>

      The raw, signed transaction.

      -

    eth_signTypedData

    • eth_signTypedData(address: string, typedData: TypedMessage<MessageTypes>): Promise<string>

    eth_signTypedData

    • eth_signTypedData(address: string, typedData: TypedMessage<MessageTypes>): Promise<string>
    • Identical to eth_signTypedData_v4.

      eip

      712

      example
      const [account] = await provider.request({ method: "eth_accounts", params: [] });
      const typedData = {
      types: {
      EIP712Domain: [
      { name: 'name', type: 'string' },
      { name: 'version', type: 'string' },
      { name: 'chainId', type: 'uint256' },
      { name: 'verifyingContract', type: 'address' },
      ],
      Person: [
      { name: 'name', type: 'string' },
      { name: 'wallet', type: 'address' }
      ],
      Mail: [
      { name: 'from', type: 'Person' },
      { name: 'to', type: 'Person' },
      { name: 'contents', type: 'string' }
      ],
      },
      primaryType: 'Mail',
      domain: {
      name: 'Ether Mail',
      version: '1',
      chainId: 1,
      verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',
      },
      message: {
      from: {
      name: 'Cow',
      wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826',
      },
      to: {
      name: 'Bob',
      wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB',
      },
      contents: 'Hello, Bob!',
      },
      };
      const signature = await provider.request({ method: "eth_signTypedData", params: [account, typedData] });
      console.log(signature); @@ -733,7 +733,7 @@

      A note on specifying topic filters:

      in big-endian format. Bytes 0...64 contain the r parameter, bytes 64...128 the s parameter, and the last byte the v parameter. Note that the v parameter includes the chain id as specified in EIP-155.

      -

    eth_signTypedData_v4

    • eth_signTypedData_v4(address: string, typedData: TypedMessage<MessageTypes>): Promise<string>

    eth_signTypedData_v4

    • eth_signTypedData_v4(address: string, typedData: TypedMessage<MessageTypes>): Promise<string>
    • eip

      712

      example
      const [account] = await provider.request({ method: "eth_accounts", params: [] });
      const typedData = {
      types: {
      EIP712Domain: [
      { name: 'name', type: 'string' },
      { name: 'version', type: 'string' },
      { name: 'chainId', type: 'uint256' },
      { name: 'verifyingContract', type: 'address' },
      ],
      Person: [
      { name: 'name', type: 'string' },
      { name: 'wallet', type: 'address' }
      ],
      Mail: [
      { name: 'from', type: 'Person' },
      { name: 'to', type: 'Person' },
      { name: 'contents', type: 'string' }
      ],
      },
      primaryType: 'Mail',
      domain: {
      name: 'Ether Mail',
      version: '1',
      chainId: 1,
      verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',
      },
      message: {
      from: {
      name: 'Cow',
      wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826',
      },
      to: {
      name: 'Bob',
      wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB',
      },
      contents: 'Hello, Bob!',
      },
      };
      const signature = await provider.request({ method: "eth_signTypedData_v4", params: [account, typedData] });
      console.log(signature);

      Parameters

      • address: string
        @@ -746,7 +746,7 @@

        A note on specifying topic filters:

        in big-endian format. Bytes 0...64 contain the r parameter, bytes 64...128 the s parameter, and the last byte the v parameter. Note that the v parameter includes the chain id as specified in EIP-155.

        -

    eth_submitHashrate

    • eth_submitHashrate(hashRate: string, clientID: string): Promise<boolean>

    eth_submitHashrate

    • eth_submitHashrate(hashRate: string, clientID: string): Promise<boolean>
    • Used for submitting mining hashrate.

      example
      const hashRate = "0x0000000000000000000000000000000000000000000000000000000000000001";
      const clientId = "0xb2222a74119abd18dbcb7d1f661c6578b7bbeb4984c50e66ed538347f606b971";
      const result = await provider.request({ method: "eth_submitHashrate", params: [hashRate, clientId] });
      console.log(result);
      @@ -755,7 +755,7 @@

      A note on specifying topic filters:

    • clientID: string

      A random hexadecimal(32 bytes) ID identifying the client.

    Returns Promise<boolean>

    true if submitting went through successfully and false otherwise.

    -

    eth_submitWork

    • eth_submitWork(nonce: string, powHash: string, digest: string): Promise<boolean>

    eth_submitWork

    • eth_submitWork(nonce: string, powHash: string, digest: string): Promise<boolean>
    • Used for submitting a proof-of-work solution.

      example
      const nonce = "0xe0df4bd14ab39a71";
      const powHash = "0x0000000000000000000000000000000000000000000000000000000000000001";
      const digest = "0xb2222a74119abd18dbcb7d1f661c6578b7bbeb4984c50e66ed538347f606b971";
      const result = await provider.request({ method: "eth_submitWork", params: [nonce, powHash, digest] });
      console.log(result);
      @@ -766,7 +766,7 @@

      A note on specifying topic filters:

    • digest: string

      The mix digest (256 bits).

    Returns Promise<boolean>

    true if the provided solution is valid, otherwise false.

    -

    eth_subscribe

    • eth_subscribe(subscriptionName: SubscriptionName): PromiEvent<Quantity>
    • eth_subscribe(subscriptionName: "logs", options: BaseFilterArgs): PromiEvent<Quantity>

    eth_subscribe

    • eth_subscribe(subscriptionName: SubscriptionName): PromiEvent<Quantity>
    • eth_subscribe(subscriptionName: "logs", options: BaseFilterArgs): PromiEvent<Quantity>
    • Starts a subscription to a particular event. For every event that matches the subscription a JSON-RPC notification with event details and subscription ID will be sent to a client.

      @@ -775,7 +775,7 @@

      A note on specifying topic filters:

      Parameters

      • subscriptionName: SubscriptionName

        Name for the subscription.

      Returns PromiEvent<Quantity>

      A subscription id.

      -
    • +
    • Starts a subscription to a particular event. For every event that matches the subscription a JSON-RPC notification with event details and subscription ID will be sent to a client.

      @@ -791,7 +791,7 @@

      A note on specifying topic filters:

    • topics, only logs which match the specified topics

    Returns PromiEvent<Quantity>

    A subscription id.

    -

    eth_syncing

    • eth_syncing(): Promise<boolean>

    eth_syncing

    • eth_syncing(): Promise<boolean>
    • Returns an object containing data about the sync status or false when not syncing.

      example
      const result = await provider.request({ method: "eth_syncing", params: [] });
      console.log(result);
      @@ -802,7 +802,7 @@

      A note on specifying topic filters:

    • currentBlock: {bigint} The current block, same as eth_blockNumber.
    • highestBlock: {bigint} The estimated highest block.
    -

    eth_uninstallFilter

    • eth_uninstallFilter(filterId: string): Promise<boolean>

    eth_uninstallFilter

    • eth_uninstallFilter(filterId: string): Promise<boolean>
    • Uninstalls a filter with given id. Should always be called when watch is no longer needed.

      example
      const filterId = await provider.request({ method: "eth_newFilter", params: [] });
      const result = await provider.request({ method: "eth_uninstallFilter", params: [filterId] });
      console.log(result); @@ -811,7 +811,7 @@

      A note on specifying topic filters:

      The filter id.

    Returns Promise<boolean>

    true if the filter was successfully uninstalled, otherwise false.

    -

    eth_unsubscribe

    • eth_unsubscribe(subscriptionId: string): Promise<boolean>

    eth_unsubscribe

    • eth_unsubscribe(subscriptionId: string): Promise<boolean>
    • Cancel a subscription to a particular event. Returns a boolean indicating if the subscription was successfully cancelled.

      example
      const subscriptionId = await provider.request({ method: "eth_subscribe", params: ["newHeads"] });
      const result = await provider.request({ method: "eth_unsubscribe", params: [subscriptionId] });
      console.log(result); @@ -819,7 +819,7 @@

      A note on specifying topic filters:

      Parameters

      • subscriptionId: string

        The ID of the subscription to unsubscribe to.

      Returns Promise<boolean>

      true if subscription was cancelled successfully, otherwise false.

      -

    evm_addAccount

    • evm_addAccount(address: string, passphrase: string): Promise<boolean>

    evm_addAccount

    • evm_addAccount(address: string, passphrase: string): Promise<boolean>
    • Adds any arbitrary account to the personal namespace.

      Note: accounts already known to the personal namespace and accounts returned by eth_accounts cannot be re-added using this method.

      @@ -834,21 +834,21 @@

      A note on specifying topic filters:

      that require a password.

    Returns Promise<boolean>

    true if the account was successfully added. false if the account is already in the personal namespace.

    -

    evm_increaseTime

    • evm_increaseTime(seconds: string | number): Promise<number>

    evm_increaseTime

    • evm_increaseTime(seconds: string | number): Promise<number>
    • Jump forward in time by the given amount of time, in seconds.

      example
      const seconds = 10;
      const timeAdjustment = await provider.send("evm_increaseTime", [seconds] );
      console.log(timeAdjustment);

      Parameters

      • seconds: string | number

        Number of seconds to jump forward in time by. Must be greater than or equal to 0.

      Returns Promise<number>

      Returns the total time adjustment, in seconds.

      -

    evm_mine

    • evm_mine(): Promise<"0x0">
    • evm_mine(timestamp: number): Promise<"0x0">
    • evm_mine(options: MineOptions): Promise<"0x0">

    evm_mine

    • evm_mine(): Promise<"0x0">
    • evm_mine(timestamp: number): Promise<"0x0">
    • evm_mine(options: MineOptions): Promise<"0x0">
    • Force a single block to be mined.

      Mines a block independent of whether or not mining is started or stopped. Will mine an empty block if there are no available transactions to mine.

      example
      console.log("start", await provider.send("eth_blockNumber"));
      await provider.send("evm_mine", [{blocks: 5}] ); // mines 5 blocks
      console.log("end", await provider.send("eth_blockNumber"));

      Returns Promise<"0x0">

      The string "0x0". May return additional meta-data in the future.

      -
    • Parameters

      • timestamp: number

      Returns Promise<"0x0">

    • Parameters

      • options: MineOptions

      Returns Promise<"0x0">

    evm_removeAccount

    • evm_removeAccount(address: string, passphrase: string): Promise<boolean>

    evm_removeAccount

    • evm_removeAccount(address: string, passphrase: string): Promise<boolean>
    • Removes an account from the personal namespace.

      Note: accounts not known to the personal namespace cannot be removed using this method.

      @@ -861,7 +861,7 @@

      A note on specifying topic filters:

      The passphrase used to decrypt the account's private key.

    Returns Promise<boolean>

    true if the account was successfully removed. false if the account was not in the personal namespace.

    -

    evm_revert

    • evm_revert(snapshotId: string): Promise<boolean>

    evm_revert

    • evm_revert(snapshotId: string): Promise<boolean>
    • Revert the state of the blockchain to a previous snapshot. Takes a single parameter, which is the snapshot id to revert to. This deletes the given snapshot, as well as any snapshots taken after (e.g.: reverting to id 0x1 @@ -871,7 +871,7 @@

      A note on specifying topic filters:

      Parameters

      • snapshotId: string

        The snapshot id to revert.

      Returns Promise<boolean>

      true if a snapshot was reverted, otherwise false.

      -

    evm_setAccountBalance

    • evm_setAccountBalance(address: string, balance: string): Promise<boolean>

    evm_setAccountBalance

    • evm_setAccountBalance(address: string, balance: string): Promise<boolean>
    • Sets the given account's balance to the specified WEI value. Mines a new block before returning.

      Warning: this will result in an invalid state tree.

      @@ -882,7 +882,7 @@

      A note on specifying topic filters:

    • balance: string

      The balance value, in WEI, to be set.

    Returns Promise<boolean>

    true if it worked, otherwise false.

    -

    evm_setAccountCode

    • evm_setAccountCode(address: string, code: string): Promise<boolean>

    evm_setAccountCode

    • evm_setAccountCode(address: string, code: string): Promise<boolean>
    • Sets the given account's code to the specified data. Mines a new block before returning.

      Warning: this will result in an invalid state tree.

      @@ -893,7 +893,7 @@

      A note on specifying topic filters:

    • code: string

      The code to be set.

    Returns Promise<boolean>

    true if it worked, otherwise false.

    -

    evm_setAccountNonce

    • evm_setAccountNonce(address: string, nonce: string): Promise<boolean>

    evm_setAccountNonce

    • evm_setAccountNonce(address: string, nonce: string): Promise<boolean>
    • Sets the given account's nonce to the specified value. Mines a new block before returning.

      Warning: this will result in an invalid state tree.

      @@ -904,7 +904,7 @@

      A note on specifying topic filters:

    • nonce: string

      The nonce value to be set.

    Returns Promise<boolean>

    true if it worked, otherwise false.

    -

    evm_setAccountStorageAt

    • evm_setAccountStorageAt(address: string, slot: string, value: string): Promise<boolean>

    evm_setAccountStorageAt

    • evm_setAccountStorageAt(address: string, slot: string, value: string): Promise<boolean>
    • Sets the given account's storage slot to the specified data. Mines a new block before returning.

      Warning: this will result in an invalid state tree.

      @@ -917,7 +917,7 @@

      A note on specifying topic filters:

    • value: string

      The value to be set.

    Returns Promise<boolean>

    true if it worked, otherwise false.

    -

    evm_setTime

    • evm_setTime(time: string | number | Date): Promise<number>

    evm_setTime

    • evm_setTime(time: string | number | Date): Promise<number>
    • Sets the internal clock time to the given timestamp.

      Warning: This will allow you to move backwards in time, which may cause new blocks to appear to be mined before old blocks. This will result in @@ -927,7 +927,7 @@

      A note on specifying topic filters:

      Parameters

      • time: string | number | Date

        JavaScript timestamp (millisecond precision).

      Returns Promise<number>

      The amount of seconds between the given timestamp and now.

      -

    evm_snapshot

    • evm_snapshot(): Promise<Quantity>

    evm_snapshot

    • evm_snapshot(): Promise<Quantity>
    • Snapshot the state of the blockchain at the current block. Takes no parameters. Returns the id of the snapshot that was created. A snapshot can only be reverted once. After a successful evm_revert, the same snapshot @@ -936,21 +936,21 @@

      A note on specifying topic filters:

      example
      const provider = ganache.provider();
      const [from, to] = await provider.send("eth_accounts");
      const startingBalance = BigInt(await provider.send("eth_getBalance", [from] ));

      // take a snapshot
      const snapshotId = await provider.send("evm_snapshot");

      // send value to another account (over-simplified example)
      await provider.send("eth_subscribe", ["newHeads"] );
      await provider.send("eth_sendTransaction", [{from, to, value: "0xffff"}] );
      await provider.once("message"); // Note: `await provider.once` is non-standard

      // ensure balance has updated
      const newBalance = await provider.send("eth_getBalance", [from] );
      assert(BigInt(newBalance) < startingBalance);

      // revert the snapshot
      const isReverted = await provider.send("evm_revert", [snapshotId] );
      assert(isReverted);

      // ensure balance has reverted
      const endingBalance = await provider.send("eth_getBalance", [from] );
      const isBalanceReverted = assert.strictEqual(BigInt(endingBalance), startingBalance);
      console.log({isBalanceReverted: isBalanceReverted});

      Returns Promise<Quantity>

      The hex-encoded identifier for this snapshot.

      -

    miner_setEtherbase

    • miner_setEtherbase(address: string): Promise<boolean>

    miner_setEtherbase

    • miner_setEtherbase(address: string): Promise<boolean>
    • Sets the etherbase, where mining rewards will go.

      example
      const [account] = await provider.request({ method: "eth_accounts", params: [] });
      console.log(await provider.send("miner_setEtherbase", [account] ));

      Parameters

      • address: string

        The address where the mining rewards will go.

      Returns Promise<boolean>

      true.

      -

    miner_setExtra

    • miner_setExtra(extra: string): Promise<boolean>

    miner_setExtra

    • miner_setExtra(extra: string): Promise<boolean>
    • Set the extraData block header field a miner can include.

      example
      console.log(await provider.send("miner_setExtra", ["0x0"] ));
       

      Parameters

      • extra: string

        The extraData to include.

      Returns Promise<boolean>

      If successfully set returns true, otherwise returns an error.

      -

    miner_setGasPrice

    • miner_setGasPrice(number: string): Promise<boolean>

    miner_setGasPrice

    • miner_setGasPrice(number: string): Promise<boolean>
    • Sets the default accepted gas price when mining transactions. Any transactions that don't specify a gas price will use this amount. Transactions that are below this limit are excluded from the mining process.

      @@ -959,7 +959,7 @@

      A note on specifying topic filters:

      Parameters

      • number: string

        Default accepted gas price.

      Returns Promise<boolean>

      true.

      -

    miner_start

    • miner_start(threads?: number): Promise<boolean>

    miner_start

    • miner_start(threads?: number): Promise<boolean>
    • Resume the CPU mining process with the given number of threads.

      Note: threads is ignored.

      example
      await provider.send("miner_stop");
      // check that eth_mining returns false
      console.log(await provider.send("eth_mining"));
      await provider.send("miner_start");
      // check that eth_mining returns true
      console.log(await provider.send("eth_mining")); @@ -967,28 +967,28 @@

      A note on specifying topic filters:

      Parameters

      • threads: number = 1

        Number of threads to resume the CPU mining process with.

      Returns Promise<boolean>

      true.

      -

    miner_stop

    • miner_stop(): Promise<boolean>

    miner_stop

    • miner_stop(): Promise<boolean>
    • Stop the CPU mining operation.

      example
      // check that eth_mining returns true
      console.log(await provider.send("eth_mining"));
      await provider.send("miner_stop");
      // check that eth_mining returns false
      console.log(await provider.send("eth_mining"));

      Returns Promise<boolean>

      true.

      -

    net_listening

    • net_listening(): Promise<boolean>

    net_listening

    • net_listening(): Promise<boolean>
    • Returns true if client is actively listening for network connections.

      example
      console.log(await provider.send("net_listening"));
       

      Returns Promise<boolean>

      true when listening, otherwise false.

      -

    net_peerCount

    • net_peerCount(): Promise<Quantity>

    net_peerCount

    • net_peerCount(): Promise<Quantity>
    • Returns number of peers currently connected to the client.

      example
      console.log(await provider.send("net_peerCount"));
       

      Returns Promise<Quantity>

      Number of connected peers.

      -

    net_version

    • net_version(): Promise<string>

    net_version

    • net_version(): Promise<string>
    • Returns the current network id.

      example
      console.log(await provider.send("net_version"));
       

      Returns Promise<string>

      The current network id. This value should NOT be JSON-RPC Quantity/Data encoded.

      -

    personal_importRawKey

    • personal_importRawKey(rawKey: string, passphrase: string): Promise<Address>

    personal_importRawKey

    • personal_importRawKey(rawKey: string, passphrase: string): Promise<Address>
    • Imports the given unencrypted private key (hex string) into the key store, encrypting it with the passphrase.

      example
      const rawKey = "0x0123456789012345678901234567890123456789012345678901234567890123";
      const passphrase = "passphrase";

      const address = await provider.send("personal_importRawKey",[rawKey, passphrase] );
      console.log(address);
      @@ -997,20 +997,20 @@

      A note on specifying topic filters:

    • passphrase: string

      The passphrase to encrypt with.

    Returns Promise<Address>

    Returns the address of the new account.

    -

    personal_listAccounts

    • personal_listAccounts(): Promise<string[]>

    personal_listAccounts

    • personal_listAccounts(): Promise<string[]>
    • Returns all the Ethereum account addresses of all keys that have been added.

      example
      console.log(await provider.send("personal_listAccounts"));
       

      Returns Promise<string[]>

      The Ethereum account addresses of all keys that have been added.

      -

    personal_lockAccount

    • personal_lockAccount(address: string): Promise<boolean>

    personal_lockAccount

    • personal_lockAccount(address: string): Promise<boolean>
    • Locks the account. The account can no longer be used to send transactions.

      example
      const [account] = await provider.send("personal_listAccounts");
      const isLocked = await provider.send("personal_lockAccount", [account] );
      console.log(isLocked);

      Parameters

      • address: string

        The account address to be locked.

      Returns Promise<boolean>

      Returns true if the account was locked, otherwise false.

      -

    personal_newAccount

    • personal_newAccount(passphrase: string): Promise<Address>

    personal_newAccount

    • personal_newAccount(passphrase: string): Promise<Address>
    • Generates a new account with private key. Returns the address of the new account.

      example
      const passphrase = "passphrase";
      const address = await provider.send("personal_newAccount", [passphrase] );
      console.log(address); @@ -1018,7 +1018,7 @@

      A note on specifying topic filters:

      Parameters

      • passphrase: string

        The passphrase to encrypt the private key with.

      Returns Promise<Address>

      The new account's address.

      -

    personal_sendTransaction

    • personal_sendTransaction(transaction: Transaction, passphrase: string): Promise<Data>

    personal_sendTransaction

    • personal_sendTransaction(transaction: Transaction, passphrase: string): Promise<Data>
    • Validate the given passphrase and submit transaction.

      The transaction is the same argument as for eth_sendTransaction and contains the from address. If the passphrase can be used to decrypt the @@ -1039,7 +1039,7 @@

      A note on specifying topic filters:

      Parameters

      • transaction: Transaction
      • passphrase: string

        The passphrase to decrpyt the private key belonging to tx.from.

      Returns Promise<Data>

      The transaction hash or if unsuccessful an error.

      -

    personal_signTransaction

    • personal_signTransaction(transaction: Transaction, passphrase: string): Promise<Data>

    personal_signTransaction

    • personal_signTransaction(transaction: Transaction, passphrase: string): Promise<Data>
    • Validates the given passphrase and signs a transaction that can be submitted to the network at a later time using eth_sendRawTransaction.

      The transaction is the same argument as for eth_signTransaction and @@ -1060,7 +1060,7 @@

      A note on specifying topic filters:

      Parameters

      • transaction: Transaction

        The transaction call object as seen in source.

      • passphrase: string

      Returns Promise<Data>

      The raw, signed transaction.

      -

    personal_unlockAccount

    • personal_unlockAccount(address: string, passphrase: string, duration?: number): Promise<boolean>

    personal_unlockAccount

    • personal_unlockAccount(address: string, passphrase: string, duration?: number): Promise<boolean>
    • Unlocks the account for use.

      The unencrypted key will be held in memory until the unlock duration expires. The unlock duration defaults to 300 seconds. An explicit duration @@ -1077,40 +1077,40 @@

      A note on specifying topic filters:

      (default: 300) Duration in seconds how long the account should remain unlocked for. Set to 0 to disable automatic locking.

    Returns Promise<boolean>

    true if it worked. Throws an error or returns false if it did not.

    -

    rpc_modules

    • rpc_modules(): Promise<{ eth: "1.0"; evm: "1.0"; net: "1.0"; personal: "1.0"; rpc: "1.0"; web3: "1.0" }>

    rpc_modules

    • rpc_modules(): Promise<{ eth: "1.0"; evm: "1.0"; net: "1.0"; personal: "1.0"; rpc: "1.0"; web3: "1.0" }>
    • Returns object of RPC modules.

      example
      console.log(await provider.send("rpc_modules"));
       

      Returns Promise<{ eth: "1.0"; evm: "1.0"; net: "1.0"; personal: "1.0"; rpc: "1.0"; web3: "1.0" }>

      RPC modules.

      -

    shh_addToGroup

    • shh_addToGroup(address: string): Promise<boolean>

    shh_addToGroup

    • shh_addToGroup(address: string): Promise<boolean>
    • Adds a whisper identity to the group.

      example
      console.log(await provider.send("shh_addToGroup", ["0x0"] ));
       

      Parameters

      • address: string

        The identity address to add to a group.

      Returns Promise<boolean>

      true if the identity was successfully added to the group, otherwise false.

      -

    shh_getFilterChanges

    • shh_getFilterChanges(id: string): Promise<[]>

    shh_getFilterChanges

    • shh_getFilterChanges(id: string): Promise<[]>

    shh_getMessages

    • shh_getMessages(id: string): Promise<boolean>

    shh_getMessages

    • shh_getMessages(id: string): Promise<boolean>
    • Get all messages matching a filter. Unlike shh_getFilterChanges this returns all messages.

      example
      console.log(await provider.send("shh_getMessages", ["0x0"] ));
       

      Parameters

      • id: string

        The filter id. Ex: "0x7"

      Returns Promise<boolean>

      See: shh_getFilterChanges.

      -

    shh_hasIdentity

    • shh_hasIdentity(address: string): Promise<boolean>

    shh_hasIdentity

    • shh_hasIdentity(address: string): Promise<boolean>
    • Checks if the client hold the private keys for a given identity.

      example
      console.log(await provider.send("shh_hasIdentity", ["0x0"] ));
       

      Parameters

      • address: string

        The identity address to check.

      Returns Promise<boolean>

      Returns true if the client holds the private key for that identity, otherwise false.

      -

    shh_newFilter

    • shh_newFilter(to: string, topics: string[]): Promise<boolean>

    shh_newFilter

    • shh_newFilter(to: string, topics: string[]): Promise<boolean>
    • Creates filter to notify, when client receives whisper message matching the filter options.

      example
      console.log(await provider.send("shh_newFilter", ["0x0", []] ));
       
      @@ -1120,17 +1120,17 @@

      A note on specifying topic filters:

    • topics: string[]

      Array of topics which the incoming message's topics should match.

    Returns Promise<boolean>

    Returns true if the identity was successfully added to the group, otherwise false.

    -

    shh_newGroup

    • shh_newGroup(): Promise<string>

    shh_newGroup

    • shh_newGroup(): Promise<string>

    shh_newIdentity

    • shh_newIdentity(): Promise<string>

    shh_newIdentity

    • shh_newIdentity(): Promise<string>
    • Creates new whisper identity in the client.

      example
      console.log(await provider.send("shh_newIdentity"));
       

      Returns Promise<string>

      • The address of the new identity.
      -

    shh_post

    • shh_post(postData: any): Promise<boolean>

    shh_post

    • shh_post(postData: any): Promise<boolean>
    • Creates a whisper message and injects it into the network for distribution.

      example
      console.log(await provider.send("shh_post", [{}] ));
       
      @@ -1139,7 +1139,7 @@

      A note on specifying topic filters:

    Returns Promise<boolean>

    Returns true if the message was sent, otherwise false.

    -

    shh_uninstallFilter

    • shh_uninstallFilter(id: string): Promise<boolean>

    shh_uninstallFilter

    • shh_uninstallFilter(id: string): Promise<boolean>
    • Uninstalls a filter with given id. Should always be called when watch is no longer needed. Additionally filters timeout when they aren't requested with shh_getFilterChanges for a period of time.

      example
      console.log(await provider.send("shh_uninstallFilter", ["0x0"] ));
      @@ -1147,22 +1147,22 @@ 

      A note on specifying topic filters:

      Parameters

      • id: string

        The filter id. Ex: "0x7"

      Returns Promise<boolean>

      true if the filter was successfully uninstalled, otherwise false.

      -

    shh_version

    • shh_version(): Promise<string>

    shh_version

    • shh_version(): Promise<string>
    • Returns the current whisper protocol version.

      example
      console.log(await provider.send("shh_version"));
       

      Returns Promise<string>

      The current whisper protocol version.

      -

    txpool_content

    • txpool_content(): Promise<Content<"private">>

    txpool_content

    • txpool_content(): Promise<Content<"private">>
    • Returns the current content of the transaction pool.

      example
      const [from] = await provider.request({ method: "eth_accounts", params: [] });
      const pendingTx = await provider.request({ method: "eth_sendTransaction", params: [{ from, gas: "0x5b8d80", nonce:"0x0" }] });
      const queuedTx = await provider.request({ method: "eth_sendTransaction", params: [{ from, gas: "0x5b8d80", nonce:"0x2" }] });
      const pool = await provider.send("txpool_content");
      console.log(pool);

      Returns Promise<Content<"private">>

      The transactions currently pending or queued in the transaction pool.

      -

    web3_clientVersion

    • web3_clientVersion(): Promise<string>

    web3_clientVersion

    • web3_clientVersion(): Promise<string>
    • Returns the current client version.

      example
      console.log(await provider.send("web3_clientVersion"));
       

      Returns Promise<string>

      The current client version.

      -

    web3_sha3

    • web3_sha3(data: string): Promise<Data>

    web3_sha3

    • web3_sha3(data: string): Promise<Data>
    • Returns Keccak-256 (not the standardized SHA3-256) of the given data.

      example
      const data = "hello trufflers";
      const sha3 = await provider.send("web3_sha3", [data] );
      console.log(sha3);
      diff --git a/src/chains/ethereum/address/package-lock.json b/src/chains/ethereum/address/package-lock.json index 326ce42811..cd4f7fd3ca 100644 --- a/src/chains/ethereum/address/package-lock.json +++ b/src/chains/ethereum/address/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ganache/ethereum-address", - "version": "0.5.2", + "version": "0.5.3-alpha.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/chains/ethereum/address/package.json b/src/chains/ethereum/address/package.json index 4e49d705bc..980c0a11a6 100644 --- a/src/chains/ethereum/address/package.json +++ b/src/chains/ethereum/address/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "0.5.2", + "version": "0.5.3-alpha.0", "description": "", "author": "David Murdoch", "homepage": "https://github.com/trufflesuite/ganache/tree/develop/src/chains/ethereum/address#readme", @@ -56,6 +56,6 @@ "typescript": "4.7.4" }, "dependencies": { - "@ganache/utils": "0.5.2" + "@ganache/utils": "0.5.3-alpha.0" } } diff --git a/src/chains/ethereum/block/package-lock.json b/src/chains/ethereum/block/package-lock.json index f451651645..aec7e22045 100644 --- a/src/chains/ethereum/block/package-lock.json +++ b/src/chains/ethereum/block/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ganache/ethereum-block", - "version": "0.5.3", + "version": "0.5.4-alpha.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/chains/ethereum/block/package.json b/src/chains/ethereum/block/package.json index f6de5db750..a3491f9754 100644 --- a/src/chains/ethereum/block/package.json +++ b/src/chains/ethereum/block/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "0.5.3", + "version": "0.5.4-alpha.0", "description": "", "author": "David Murdoch", "homepage": "https://github.com/trufflesuite/ganache/tree/develop/src/chains/ethereum/block#readme", @@ -57,12 +57,12 @@ }, "dependencies": { "@ethereumjs/common": "3.0.0", - "@ganache/ethereum-address": "0.5.2", - "@ganache/ethereum-transaction": "0.5.3", - "@ganache/ethereum-utils": "0.5.2", - "@ganache/rlp": "0.5.2", - "@ganache/utils": "0.5.2", - "emittery": "0.10.0", - "@ethereumjs/util": "8.0.0" + "@ethereumjs/util": "8.0.0", + "@ganache/ethereum-address": "0.5.3-alpha.0", + "@ganache/ethereum-transaction": "0.5.4-alpha.0", + "@ganache/ethereum-utils": "0.5.3-alpha.0", + "@ganache/rlp": "0.5.3-alpha.0", + "@ganache/utils": "0.5.3-alpha.0", + "emittery": "0.10.0" } } diff --git a/src/chains/ethereum/console.log/package-lock.json b/src/chains/ethereum/console.log/package-lock.json index c098379c01..2a61a2dd81 100644 --- a/src/chains/ethereum/console.log/package-lock.json +++ b/src/chains/ethereum/console.log/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ganache/console.log", - "version": "0.2.0", + "version": "0.2.1-alpha.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/chains/ethereum/console.log/package.json b/src/chains/ethereum/console.log/package.json index 09639abb83..29c3121ac7 100644 --- a/src/chains/ethereum/console.log/package.json +++ b/src/chains/ethereum/console.log/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "0.2.0", + "version": "0.2.1-alpha.0", "description": "A Solidity library and EVM hooks for using console.log from Solidity contracts", "author": "David Murdoch", "homepage": "https://github.com/trufflesuite/ganache/tree/develop/src/chains/ethereum/console.log#readme", @@ -66,7 +66,7 @@ "typescript": "4.7.4" }, "dependencies": { - "@ganache/utils": "0.3.0", - "@ethereumjs/util": "8.0.0" + "@ethereumjs/util": "8.0.0", + "@ganache/utils": "0.3.0" } } diff --git a/src/chains/ethereum/ethereum/package-lock.json b/src/chains/ethereum/ethereum/package-lock.json index aa906bbaf0..c93d374223 100644 --- a/src/chains/ethereum/ethereum/package-lock.json +++ b/src/chains/ethereum/ethereum/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ganache/ethereum", - "version": "0.5.3", + "version": "0.5.4-alpha.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/chains/ethereum/ethereum/package.json b/src/chains/ethereum/ethereum/package.json index b449cab373..cd36e91e18 100644 --- a/src/chains/ethereum/ethereum/package.json +++ b/src/chains/ethereum/ethereum/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "0.5.3", + "version": "0.5.4-alpha.0", "description": "Ganache's Ethereum client implementation", "author": "David Murdoch (https://davidmurdoch.com)", "homepage": "https://github.com/trufflesuite/ganache/tree/develop/src/ethereum/ethereum#readme", @@ -56,17 +56,17 @@ "@ethereumjs/tx": "4.0.0", "@ethereumjs/util": "8.0.0", "@ethereumjs/vm": "6.0.0", - "@ganache/console.log": "0.2.0", - "@ganache/ethereum-address": "0.5.2", - "@ganache/ethereum-block": "0.5.3", - "@ganache/ethereum-options": "0.5.3", - "@ganache/ethereum-transaction": "0.5.3", - "@ganache/ethereum-utils": "0.5.2", - "@ganache/options": "0.5.2", - "@ganache/promise-queue": "0.3.1", - "@ganache/rlp": "0.5.2", - "@ganache/secp256k1": "0.4.1", - "@ganache/utils": "0.5.2", + "@ganache/console.log": "0.2.1-alpha.0", + "@ganache/ethereum-address": "0.5.3-alpha.0", + "@ganache/ethereum-block": "0.5.4-alpha.0", + "@ganache/ethereum-options": "0.5.4-alpha.0", + "@ganache/ethereum-transaction": "0.5.4-alpha.0", + "@ganache/ethereum-utils": "0.5.3-alpha.0", + "@ganache/options": "0.5.3-alpha.0", + "@ganache/promise-queue": "0.3.2-alpha.0", + "@ganache/rlp": "0.5.3-alpha.0", + "@ganache/secp256k1": "0.4.2-alpha.0", + "@ganache/utils": "0.5.3-alpha.0", "abort-controller": "3.0.0", "bip39": "3.0.4", "emittery": "0.10.0", diff --git a/src/chains/ethereum/options/package-lock.json b/src/chains/ethereum/options/package-lock.json index 14ba860da4..87fad4d5de 100644 --- a/src/chains/ethereum/options/package-lock.json +++ b/src/chains/ethereum/options/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ganache/ethereum-options", - "version": "0.5.3", + "version": "0.5.4-alpha.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/chains/ethereum/options/package.json b/src/chains/ethereum/options/package.json index 1d7f3974af..65f47e253f 100644 --- a/src/chains/ethereum/options/package.json +++ b/src/chains/ethereum/options/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "0.5.3", + "version": "0.5.4-alpha.0", "description": "", "author": "David Murdoch (https://davidmurdoch.com)", "homepage": "https://github.com/trufflesuite/ganache/tree/develop/src/chains/ethereum/options#readme", @@ -48,10 +48,10 @@ "truffle" ], "dependencies": { - "@ganache/ethereum-address": "0.5.2", - "@ganache/ethereum-utils": "0.5.2", - "@ganache/options": "0.5.2", - "@ganache/utils": "0.5.2", + "@ganache/ethereum-address": "0.5.3-alpha.0", + "@ganache/ethereum-utils": "0.5.3-alpha.0", + "@ganache/options": "0.5.3-alpha.0", + "@ganache/utils": "0.5.3-alpha.0", "bip39": "3.0.4", "seedrandom": "3.0.5" }, diff --git a/src/chains/ethereum/transaction/package-lock.json b/src/chains/ethereum/transaction/package-lock.json index 2aed245a58..f93b28a41b 100644 --- a/src/chains/ethereum/transaction/package-lock.json +++ b/src/chains/ethereum/transaction/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ganache/ethereum-transaction", - "version": "0.5.3", + "version": "0.5.4-alpha.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/chains/ethereum/transaction/package.json b/src/chains/ethereum/transaction/package.json index 4127a0a3f8..72249d0407 100644 --- a/src/chains/ethereum/transaction/package.json +++ b/src/chains/ethereum/transaction/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "0.5.3", + "version": "0.5.4-alpha.0", "description": "", "author": "David Murdoch", "homepage": "https://github.com/trufflesuite/ganache/tree/develop/src/chains/ethereum/transaction#readme", @@ -49,13 +49,13 @@ ], "dependencies": { "@ethereumjs/common": "3.0.0", - "@ganache/ethereum-address": "0.5.2", - "@ganache/ethereum-utils": "0.5.2", - "@ganache/rlp": "0.5.2", - "@ganache/secp256k1": "0.4.1", "@ethereumjs/tx": "4.0.0", - "@ganache/utils": "0.5.2", "@ethereumjs/util": "8.0.0", + "@ganache/ethereum-address": "0.5.3-alpha.0", + "@ganache/ethereum-utils": "0.5.3-alpha.0", + "@ganache/rlp": "0.5.3-alpha.0", + "@ganache/secp256k1": "0.4.2-alpha.0", + "@ganache/utils": "0.5.3-alpha.0", "node-gyp-build": "4.5.0" }, "devDependencies": { diff --git a/src/chains/ethereum/utils/package-lock.json b/src/chains/ethereum/utils/package-lock.json index db38cf594a..5c21da907c 100644 --- a/src/chains/ethereum/utils/package-lock.json +++ b/src/chains/ethereum/utils/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ganache/ethereum-utils", - "version": "0.5.2", + "version": "0.5.3-alpha.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/chains/ethereum/utils/package.json b/src/chains/ethereum/utils/package.json index 2baab515ff..66999b1958 100644 --- a/src/chains/ethereum/utils/package.json +++ b/src/chains/ethereum/utils/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "0.5.2", + "version": "0.5.3-alpha.0", "description": "", "author": "David Murdoch (https://davidmurdoch.com)", "homepage": "https://github.com/trufflesuite/ganache/tree/develop/src/chains/ethereum/utils#readme", @@ -51,13 +51,13 @@ "@ethereumjs/common": "3.0.0", "@ethereumjs/evm": "1.0.0", "@ethereumjs/tx": "4.0.0", + "@ethereumjs/util": "8.0.0", "@ethereumjs/vm": "6.0.0", - "@ganache/ethereum-address": "0.5.2", - "@ganache/rlp": "0.5.2", - "@ganache/utils": "0.5.2", + "@ganache/ethereum-address": "0.5.3-alpha.0", + "@ganache/rlp": "0.5.3-alpha.0", + "@ganache/utils": "0.5.3-alpha.0", "emittery": "0.10.0", - "ethereumjs-abi": "0.6.8", - "@ethereumjs/util": "8.0.0" + "ethereumjs-abi": "0.6.8" }, "devDependencies": { "@types/mocha": "9.0.0", diff --git a/src/chains/filecoin/filecoin/package-lock.json b/src/chains/filecoin/filecoin/package-lock.json index e5c4f720b9..47482f13c9 100644 --- a/src/chains/filecoin/filecoin/package-lock.json +++ b/src/chains/filecoin/filecoin/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ganache/filecoin", - "version": "0.5.2", + "version": "0.5.3-alpha.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/chains/filecoin/filecoin/package.json b/src/chains/filecoin/filecoin/package.json index 831e6e6a57..63a7ecbe21 100644 --- a/src/chains/filecoin/filecoin/package.json +++ b/src/chains/filecoin/filecoin/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "0.5.2", + "version": "0.5.3-alpha.0", "description": "Ganache's Filecoin client implementation", "author": "Tim Coulter", "homepage": "https://github.com/trufflesuite/ganache/tree/develop/src/filecoin#readme", @@ -57,8 +57,8 @@ "@filecoin-shipyard/lotus-client-provider-browser": "0.0.14", "@filecoin-shipyard/lotus-client-rpc": "0.2.0", "@filecoin-shipyard/lotus-client-schema": "2.0.0", - "@ganache/filecoin-options": "0.5.2", - "@ganache/utils": "0.5.2", + "@ganache/filecoin-options": "0.5.3-alpha.0", + "@ganache/utils": "0.5.3-alpha.0", "@trufflesuite/uws-js-unofficial": "20.10.0-unofficial.1", "@types/abstract-leveldown": "7.2.0", "@types/bn.js": "5.1.0", diff --git a/src/chains/filecoin/options/package-lock.json b/src/chains/filecoin/options/package-lock.json index c76b52d8c3..575afc265f 100644 --- a/src/chains/filecoin/options/package-lock.json +++ b/src/chains/filecoin/options/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ganache/filecoin-options", - "version": "0.5.2", + "version": "0.5.3-alpha.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/chains/filecoin/options/package.json b/src/chains/filecoin/options/package.json index ece075311a..29fda614c1 100644 --- a/src/chains/filecoin/options/package.json +++ b/src/chains/filecoin/options/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "0.5.2", + "version": "0.5.3-alpha.0", "description": "", "author": "Tim Coulter", "homepage": "https://github.com/trufflesuite/ganache/tree/develop/src/chains/filecoin/options#readme", @@ -50,7 +50,7 @@ "truffle" ], "devDependencies": { - "@ganache/options": "0.5.2", + "@ganache/options": "0.5.3-alpha.0", "@types/mocha": "9.0.0", "@types/seedrandom": "3.0.1", "@types/terser-webpack-plugin": "5.0.2", diff --git a/src/chains/tezos/options/package-lock.json b/src/chains/tezos/options/package-lock.json index 03684240ef..eeeef63883 100644 --- a/src/chains/tezos/options/package-lock.json +++ b/src/chains/tezos/options/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ganache/tezos-options", - "version": "0.3.0", + "version": "0.3.1-alpha.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/chains/tezos/options/package.json b/src/chains/tezos/options/package.json index e144226da0..29100e3594 100644 --- a/src/chains/tezos/options/package.json +++ b/src/chains/tezos/options/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "0.3.0", + "version": "0.3.1-alpha.0", "description": "", "author": "David Murdoch (https://davidmurdoch.com)", "homepage": "https://github.com/trufflesuite/ganache/tree/develop/src/chains/tezos/options#readme", diff --git a/src/chains/tezos/tezos/package-lock.json b/src/chains/tezos/tezos/package-lock.json index 9e51b03690..85a38ccb87 100644 --- a/src/chains/tezos/tezos/package-lock.json +++ b/src/chains/tezos/tezos/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ganache/tezos", - "version": "0.5.2", + "version": "0.5.3-alpha.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/chains/tezos/tezos/package.json b/src/chains/tezos/tezos/package.json index 6c64c2841e..343f2f1940 100644 --- a/src/chains/tezos/tezos/package.json +++ b/src/chains/tezos/tezos/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "0.5.2", + "version": "0.5.3-alpha.0", "description": "Ganache's Tezos client implementation", "author": "David Murdoch (https://davidmurdoch.com)", "homepage": "https://github.com/trufflesuite/ganache/tree/develop/src/chains/tezos/tezos#readme", @@ -42,8 +42,8 @@ "tooling" ], "dependencies": { - "@ganache/options": "0.5.2", - "@ganache/utils": "0.5.2", + "@ganache/options": "0.5.3-alpha.0", + "@ganache/utils": "0.5.3-alpha.0", "emittery": "0.10.0" }, "devDependencies": { diff --git a/src/packages/cli/package-lock.json b/src/packages/cli/package-lock.json index db7220e615..0a6ac42234 100644 --- a/src/packages/cli/package-lock.json +++ b/src/packages/cli/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ganache/cli", - "version": "0.5.3", + "version": "0.5.4-alpha.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/packages/cli/package.json b/src/packages/cli/package.json index 0e2ce6571f..dec71c508b 100644 --- a/src/packages/cli/package.json +++ b/src/packages/cli/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "0.5.3", + "version": "0.5.4-alpha.0", "description": "", "author": "David Murdoch", "homepage": "https://github.com/trufflesuite/ganache/tree/develop/src/packages/cli#readme", @@ -53,8 +53,8 @@ "truffle" ], "devDependencies": { - "@ganache/ethereum": "0.5.3", - "@ganache/filecoin": "0.5.2", + "@ganache/ethereum": "0.5.4-alpha.0", + "@ganache/filecoin": "0.5.3-alpha.0", "@types/mocha": "9.0.0", "cross-env": "7.0.3", "mocha": "9.1.3", @@ -62,14 +62,14 @@ "typescript": "4.7.4" }, "dependencies": { - "@ganache/colors": "0.3.0", - "@ganache/core": "0.5.3", - "@ganache/flavors": "0.5.3", - "@ganache/options": "0.5.2", - "@ganache/utils": "0.5.2", + "@ethereumjs/util": "8.0.0", + "@ganache/colors": "0.3.1-alpha.0", + "@ganache/core": "0.5.4-alpha.0", + "@ganache/flavors": "0.5.4-alpha.0", + "@ganache/options": "0.5.3-alpha.0", + "@ganache/utils": "0.5.3-alpha.0", "@types/node": "17.0.0", "chalk": "4.1.0", - "@ethereumjs/util": "8.0.0", "marked-terminal": "4.1.0" } } diff --git a/src/packages/colors/package-lock.json b/src/packages/colors/package-lock.json index 78e1b0a8b8..cae0bc7ad8 100644 --- a/src/packages/colors/package-lock.json +++ b/src/packages/colors/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ganache/colors", - "version": "0.3.0", + "version": "0.3.1-alpha.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/packages/colors/package.json b/src/packages/colors/package.json index afbf391cdb..6ef37c444b 100644 --- a/src/packages/colors/package.json +++ b/src/packages/colors/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "0.3.0", + "version": "0.3.1-alpha.0", "description": "Truffle's colors, hex encoded", "author": "David Murdoch", "homepage": "https://github.com/trufflesuite/ganache/tree/develop/src/packages/colors#readme", diff --git a/src/packages/core/package-lock.json b/src/packages/core/package-lock.json index 165a5a5a54..5e78e07ace 100644 --- a/src/packages/core/package-lock.json +++ b/src/packages/core/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ganache/core", - "version": "0.5.3", + "version": "0.5.4-alpha.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/packages/core/package.json b/src/packages/core/package.json index ae8d708200..e5fc4cccbd 100644 --- a/src/packages/core/package.json +++ b/src/packages/core/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "0.5.3", + "version": "0.5.4-alpha.0", "description": "A library to create a local blockchain for fast Ethereum development.", "author": "David Murdoch (https://davidmurdoch.com)", "homepage": "https://github.com/trufflesuite/ganache/tree/develop/src/packages/core#readme", @@ -48,11 +48,11 @@ "tooling" ], "dependencies": { - "@ganache/ethereum": "0.5.3", - "@ganache/flavors": "0.5.3", - "@ganache/options": "0.5.2", - "@ganache/tezos": "0.5.2", - "@ganache/utils": "0.5.2", + "@ganache/ethereum": "0.5.4-alpha.0", + "@ganache/flavors": "0.5.4-alpha.0", + "@ganache/options": "0.5.3-alpha.0", + "@ganache/tezos": "0.5.3-alpha.0", + "@ganache/utils": "0.5.3-alpha.0", "@trufflesuite/uws-js-unofficial": "20.10.0-unofficial.1", "aggregate-error": "3.1.0", "emittery": "0.10.0", diff --git a/src/packages/flavors/package-lock.json b/src/packages/flavors/package-lock.json index 6448fa5db4..c1bc5969d4 100644 --- a/src/packages/flavors/package-lock.json +++ b/src/packages/flavors/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ganache/flavors", - "version": "0.5.3", + "version": "0.5.4-alpha.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/packages/flavors/package.json b/src/packages/flavors/package.json index 6421dfb51e..af9d79af98 100644 --- a/src/packages/flavors/package.json +++ b/src/packages/flavors/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "0.5.3", + "version": "0.5.4-alpha.0", "description": "Ganache's flavors enumeration and TypeScript types", "author": "David Murdoch (https://davidmurdoch.com)", "homepage": "https://github.com/trufflesuite/ganache/tree/develop/src/packages/flavors#readme", @@ -46,14 +46,14 @@ "tooling" ], "dependencies": { - "@ganache/colors": "0.3.0", - "@ganache/ethereum": "0.5.3", - "@ganache/ethereum-options": "0.5.3", - "@ganache/filecoin": "0.5.2", - "@ganache/filecoin-options": "0.5.2", - "@ganache/options": "0.5.2", - "@ganache/tezos": "0.5.2", - "@ganache/utils": "0.5.2", + "@ganache/colors": "0.3.1-alpha.0", + "@ganache/ethereum": "0.5.4-alpha.0", + "@ganache/ethereum-options": "0.5.4-alpha.0", + "@ganache/filecoin": "0.5.3-alpha.0", + "@ganache/filecoin-options": "0.5.3-alpha.0", + "@ganache/options": "0.5.3-alpha.0", + "@ganache/tezos": "0.5.3-alpha.0", + "@ganache/utils": "0.5.3-alpha.0", "chalk": "4.1.0" }, "devDependencies": { diff --git a/src/packages/ganache/package.json b/src/packages/ganache/package.json index 2bb3658f76..d312d6f330 100644 --- a/src/packages/ganache/package.json +++ b/src/packages/ganache/package.json @@ -1,6 +1,6 @@ { "name": "ganache", - "version": "7.4.3", + "version": "7.4.4-alpha.0", "description": "A library and cli to create a local blockchain for fast Ethereum development.", "author": "David Murdoch", "homepage": "https://github.com/trufflesuite/ganache/tree/develop/src/packages/ganache#readme", @@ -58,9 +58,9 @@ ], "devDependencies": { "@ethereumjs/vm": "6.0.0", - "@ganache/cli": "0.5.3", - "@ganache/core": "0.5.3", - "@ganache/flavors": "0.5.3", + "@ganache/cli": "0.5.4-alpha.0", + "@ganache/core": "0.5.4-alpha.0", + "@ganache/flavors": "0.5.4-alpha.0", "@microsoft/api-extractor": "7.31.1", "@types/abstract-leveldown": "7.2.0", "@types/mocha": "9.0.0", diff --git a/src/packages/options/package-lock.json b/src/packages/options/package-lock.json index e226182d07..5efcf82d86 100644 --- a/src/packages/options/package-lock.json +++ b/src/packages/options/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ganache/options", - "version": "0.5.2", + "version": "0.5.3-alpha.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/packages/options/package.json b/src/packages/options/package.json index d5f8b7e605..a064b93214 100644 --- a/src/packages/options/package.json +++ b/src/packages/options/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "0.5.2", + "version": "0.5.3-alpha.0", "description": "Ganache's server/provider options TypeScript types", "author": "David Murdoch (https://davidmurdoch.com)", "homepage": "https://github.com/trufflesuite/ganache/tree/develop/src/packages/options#readme", @@ -45,7 +45,7 @@ "tooling" ], "dependencies": { - "@ganache/utils": "0.5.2", + "@ganache/utils": "0.5.3-alpha.0", "bip39": "3.0.4", "seedrandom": "3.0.5" }, diff --git a/src/packages/promise-queue/package-lock.json b/src/packages/promise-queue/package-lock.json index 18b2c2ee22..8f6ee46b23 100644 --- a/src/packages/promise-queue/package-lock.json +++ b/src/packages/promise-queue/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ganache/promise-queue", - "version": "0.3.1", + "version": "0.3.2-alpha.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/packages/promise-queue/package.json b/src/packages/promise-queue/package.json index 919ea86560..19b06999e1 100644 --- a/src/packages/promise-queue/package.json +++ b/src/packages/promise-queue/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "0.3.1", + "version": "0.3.2-alpha.0", "description": "A queue that resolves Promise instances in first-in first-out order.", "author": "David Murdoch (https://davidmurdoch.com)", "homepage": "https://github.com/trufflesuite/ganache/tree/develop/src/packages/promise-queue#readme", diff --git a/src/packages/rlp/package-lock.json b/src/packages/rlp/package-lock.json index 10e74fb78a..9649c9b64f 100644 --- a/src/packages/rlp/package-lock.json +++ b/src/packages/rlp/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ganache/rlp", - "version": "0.5.2", + "version": "0.5.3-alpha.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/packages/rlp/package.json b/src/packages/rlp/package.json index 4c2ad6e2f2..8db23e7fbd 100644 --- a/src/packages/rlp/package.json +++ b/src/packages/rlp/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "0.5.2", + "version": "0.5.3-alpha.0", "description": "Recursive Length Prefix Encoding Module", "author": "David Murdoch", "homepage": "https://github.com/trufflesuite/ganache/tree/develop/src/packages/rlp#readme", @@ -48,7 +48,7 @@ "truffle" ], "dependencies": { - "@ganache/utils": "0.5.2", + "@ganache/utils": "0.5.3-alpha.0", "rlp": "2.2.7" }, "devDependencies": { diff --git a/src/packages/secp256k1/package-lock.json b/src/packages/secp256k1/package-lock.json index cc5f08101d..86416c9f03 100644 --- a/src/packages/secp256k1/package-lock.json +++ b/src/packages/secp256k1/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ganache/secp256k1", - "version": "0.4.1", + "version": "0.4.2-alpha.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/packages/secp256k1/package.json b/src/packages/secp256k1/package.json index 46ef3646cc..ae08bba292 100644 --- a/src/packages/secp256k1/package.json +++ b/src/packages/secp256k1/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "0.4.1", + "version": "0.4.2-alpha.0", "description": "", "author": "David Murdoch", "homepage": "https://github.com/trufflesuite/ganache/tree/develop/src/packages/secp256k1#readme", diff --git a/src/packages/utils/package-lock.json b/src/packages/utils/package-lock.json index d25de04791..528d7856a4 100644 --- a/src/packages/utils/package-lock.json +++ b/src/packages/utils/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ganache/utils", - "version": "0.5.2", + "version": "0.5.3-alpha.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/packages/utils/package.json b/src/packages/utils/package.json index ea1a07ac84..9e006ee9b0 100644 --- a/src/packages/utils/package.json +++ b/src/packages/utils/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "0.5.2", + "version": "0.5.3-alpha.0", "description": "Utility functions for @ganache packages", "author": "David Murdoch (https://davidmurdoch.com)", "homepage": "https://github.com/trufflesuite/ganache/tree/develop/src/packages/utils#readme",