/*! For license information please see 2.d22e90c9.chunk.js.LICENSE.txt */ (this.webpackJsonpjuicy_turd_nft_minting_dapp=this.webpackJsonpjuicy_turd_nft_minting_dapp||[]).push([[2],[function(t,e,r){"use strict";r.d(e,"i",(function(){return a})),r.d(e,"h",(function(){return s})),r.d(e,"a",(function(){return u})),r.d(e,"b",(function(){return h})),r.d(e,"l",(function(){return f})),r.d(e,"j",(function(){return l})),r.d(e,"g",(function(){return d})),r.d(e,"d",(function(){return p})),r.d(e,"e",(function(){return m})),r.d(e,"c",(function(){return v})),r.d(e,"f",(function(){return g})),r.d(e,"k",(function(){return y}));var n=new(r(5).a)("bytes/5.4.0");function i(t){return!!t.toHexString}function o(t){return t.slice||(t.slice=function(){var e=Array.prototype.slice.call(arguments);return o(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function a(t){return l(t)&&!(t.length%2)||s(t)}function s(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"===typeof t)return!1;if(null==t.length)return!1;for(var e=0;e=256||r%1)return!1}return!0}function u(t,e){if(e||(e={}),"number"===typeof t){n.checkSafeUint53(t,"invalid arrayify value");for(var r=[];t;)r.unshift(255&t),t=parseInt(String(t/256));return 0===r.length&&r.push(0),o(new Uint8Array(r))}if(e.allowMissingPrefix&&"string"===typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),i(t)&&(t=t.toHexString()),l(t)){var a=t.substring(2);a.length%2&&("left"===e.hexPad?a="0x0"+a.substring(2):"right"===e.hexPad?a+="0":n.throwArgumentError("hex data is odd-length","value",t));for(var u=[],h=0;h>4]+c[15&u]}return o}return n.throwArgumentError("invalid hexlify value","value",t)}function p(t){if("string"!==typeof t)t=d(t);else if(!l(t)||t.length%2)return null;return(t.length-2)/2}function m(t,e,r){return"string"!==typeof t?t=d(t):(!l(t)||t.length%2)&&n.throwArgumentError("invalid hexData","value",t),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function v(t){var e="0x";return t.forEach((function(t){e+=d(t).substring(2)})),e}function g(t,e){for("string"!==typeof t?t=d(t):l(t)||n.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&n.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function y(t){var e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0};if(a(t)){var r=u(t);65!==r.length&&n.throwArgumentError("invalid signature string; must be 65 bytes","signature",t),e.r=d(r.slice(0,32)),e.s=d(r.slice(32,64)),e.v=r[64],e.v<27&&(0===e.v||1===e.v?e.v+=27:n.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=d(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,null!=e._vs){var i=function(t,e){(t=u(t)).length>e&&n.throwArgumentError("value out of range","value",arguments[0]);var r=new Uint8Array(e);return r.set(t,e-t.length),o(r)}(u(e._vs),32);e._vs=d(i);var s=i[0]>=128?1:0;null==e.recoveryParam?e.recoveryParam=s:e.recoveryParam!==s&&n.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;var h=d(i);null==e.s?e.s=h:e.s!==h&&n.throwArgumentError("signature v mismatch _vs","signature",t)}null==e.recoveryParam?null==e.v?n.throwArgumentError("signature missing v and recoveryParam","signature",t):0===e.v||1===e.v?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2:null==e.v?e.v=27+e.recoveryParam:e.recoveryParam!==1-e.v%2&&n.throwArgumentError("signature recoveryParam mismatch v","signature",t),null!=e.r&&l(e.r)?e.r=g(e.r,32):n.throwArgumentError("signature missing or invalid r","signature",t),null!=e.s&&l(e.s)?e.s=g(e.s,32):n.throwArgumentError("signature missing or invalid s","signature",t);var f=u(e.s);f[0]>=128&&n.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(f[0]|=128);var c=d(f);e._vs&&(l(e._vs)||n.throwArgumentError("signature invalid _vs","signature",t),e._vs=g(e._vs,32)),null==e._vs?e._vs=c:e._vs!==c&&n.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e}},function(t,e,r){"use strict";t.exports=r(227)},function(t,e,r){"use strict";(function(t){var n=r(243),i=r(244),o=r(121);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function p(t,e){if(u.isBuffer(t))return t.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!==typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(t).length;default:if(n)return F(t).length;e=(""+e).toLowerCase(),n=!0}}function m(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return T(this,e,r);case"utf8":case"utf-8":return E(this,e,r);case"ascii":return O(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function v(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,i){if(0===t.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"===typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:y(t,e,r,n,i);if("number"===typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,n,i){var o,a=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}function h(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var f=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var l=!0,c=0;ci&&(n=i):n=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function A(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function E(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:h>223?3:h>191?2:1;if(i+l<=r)switch(l){case 1:h<128&&(f=h);break;case 2:128===(192&(o=t[i+1]))&&(u=(31&h)<<6|63&o)>127&&(f=u);break;case 3:o=t[i+1],a=t[i+2],128===(192&o)&&128===(192&a)&&(u=(15&h)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128===(192&o)&&128===(192&a)&&128===(192&s)&&(u=(15&h)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(f=u)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=l}return function(t){var e=t.length;if(e<=x)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},u.prototype.compare=function(t,e,r,n,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),s=Math.min(o,a),h=this.slice(n,i),f=t.slice(e,r),l=0;li)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return b(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":return M(this,t,e,r);case"latin1":case"binary":return _(this,t,e,r);case"base64":return k(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function O(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function B(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function I(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function N(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function j(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(t,e,r,n,o){return o||j(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function L(t,e,r,n,o){return o||j(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUInt8=function(t,e){return e||C(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||C(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||C(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||C(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||C(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||C(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||C(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||C(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||C(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||C(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||C(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||B(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):N(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);B(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);B(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):N(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return U(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return U(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return L(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return L(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"===typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function z(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(D,"")).length<2)return"";for(;t.length%4!==0;)t+="=";return t}(t))}function H(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(12))},function(t,e,r){"use strict";t.exports=r(532)},function(t,e){"function"===typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return p}));var n=r(6),i=r(8),o=!1,a=!1,s={debug:1,default:2,info:2,warning:3,error:4,off:5},u=s.default,h=null;var f,l,c=function(){try{var t=[];if(["NFD","NFC","NFKD","NFKC"].forEach((function(e){try{if("test"!=="test".normalize(e))throw new Error("bad normalize")}catch(r){t.push(e)}})),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();!function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"}(f||(f={})),function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED"}(l||(l={}));var d="0123456789abcdef",p=function(){function t(e){Object(n.a)(this,t),Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}return Object(i.a)(t,[{key:"_log",value:function(t,e){var r=t.toLowerCase();null==s[r]&&this.throwArgumentError("invalid log level name","logLevel",t),u>s[r]||console.log.apply(console,e)}},{key:"debug",value:function(){for(var e=arguments.length,r=new Array(e),n=0;n>4],r+=d[15&e[o]];i.push(t+"=Uint8Array(0x"+r+")")}else i.push(t+"="+JSON.stringify(e))}catch(s){i.push(t+"="+JSON.stringify(n[t].toString()))}})),i.push("code=".concat(r)),i.push("version=".concat(this.version));var o=e;i.length&&(e+=" ("+i.join(", ")+")");var s=new Error(e);return s.reason=o,s.code=r,Object.keys(n).forEach((function(t){s[t]=n[t]})),s}},{key:"throwError",value:function(t,e,r){throw this.makeError(t,e,r)}},{key:"throwArgumentError",value:function(e,r,n){return this.throwError(e,t.errors.INVALID_ARGUMENT,{argument:r,value:n})}},{key:"assert",value:function(t,e,r,n){t||this.throwError(e,r,n)}},{key:"assertArgument",value:function(t,e,r,n){t||this.throwArgumentError(e,r,n)}},{key:"checkNormalize",value:function(e){null==e&&(e="platform missing String.prototype.normalize"),c&&this.throwError("platform missing String.prototype.normalize",t.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:c})}},{key:"checkSafeUint53",value:function(e,r){"number"===typeof e&&(null==r&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,t.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,t.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}},{key:"checkArgumentCount",value:function(e,r,n){n=n?": "+n:"",er&&this.throwError("too many arguments"+n,t.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}},{key:"checkNew",value:function(e,r){e!==Object&&null!=e||this.throwError("missing new",t.errors.MISSING_NEW,{name:r.name})}},{key:"checkAbstract",value:function(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",t.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",t.errors.MISSING_NEW,{name:r.name})}}],[{key:"globalLogger",value:function(){return h||(h=new t("logger/5.4.1")),h}},{key:"setCensorship",value:function(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",t.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o){if(!e)return;this.globalLogger().throwError("error censorship permanent",t.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}a=!!e,o=!!r}},{key:"setLogLevel",value:function(e){var r=s[e.toLowerCase()];null!=r?u=r:t.globalLogger().warn("invalid log level - "+e)}},{key:"from",value:function(e){return new t(e)}}]),t}();p.errors=l,p.levels=f},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.d(e,"a",(function(){return n}))},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"===typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(295).Buffer}catch(A){}function s(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function h(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=u(t,e,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(t.length-e)%2===0?e+1:e;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var f=["","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"],l=[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 d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var h=1;h>>26,l=67108863&u,c=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=c;d++){var p=h-d|0;f+=(a=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&a}r.words[h]=0|l,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?f[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=l[t],d=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:f[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n("undefined"!==typeof a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===e,h=new t(o),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),h[s]=a;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"===typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,v=0|a[2],g=8191&v,y=v>>>13,b=0|a[3],w=8191&b,M=b>>>13,_=0|a[4],k=8191&_,S=_>>>13,A=0|a[5],E=8191&A,x=A>>>13,O=0|a[6],R=8191&O,T=O>>>13,P=0|a[7],C=8191&P,B=P>>>13,I=0|a[8],N=8191&I,j=I>>>13,U=0|a[9],L=8191&U,D=U>>>13,q=0|s[0],F=8191&q,z=q>>>13,H=0|s[1],K=8191&H,Z=H>>>13,W=0|s[2],V=8191&W,G=W>>>13,J=0|s[3],X=8191&J,$=J>>>13,Y=0|s[4],Q=8191&Y,tt=Y>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ht=st>>>13,ft=0|s[8],lt=8191&ft,ct=ft>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(n=Math.imul(l,F))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;h=((o=Math.imul(c,z))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(h+(n=n+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,Z)|0)+Math.imul(c,K)|0))<<13)|0;h=((o=o+Math.imul(c,Z)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,F),i=(i=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,Z)|0;var yt=(h+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;h=((o=o+Math.imul(c,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,Z)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,Z)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(h+(n=n+Math.imul(l,X)|0)|0)+((8191&(i=(i=i+Math.imul(l,$)|0)+Math.imul(c,X)|0))<<13)|0;h=((o=o+Math.imul(c,$)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(k,F),i=(i=Math.imul(k,z))+Math.imul(S,F)|0,o=Math.imul(S,z),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(M,K)|0,o=o+Math.imul(M,Z)|0,n=n+Math.imul(g,V)|0,i=(i=i+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,$)|0;var wt=(h+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,z))+Math.imul(x,F)|0,o=Math.imul(x,z),n=n+Math.imul(k,K)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,n=n+Math.imul(g,X)|0,i=(i=i+Math.imul(g,$)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(h+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(c,rt)|0))<<13)|0;h=((o=o+Math.imul(c,nt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,F),i=(i=Math.imul(R,z))+Math.imul(T,F)|0,o=Math.imul(T,z),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,Z)|0,n=n+Math.imul(k,V)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,$)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var _t=(h+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,at)|0)+Math.imul(c,ot)|0))<<13)|0;h=((o=o+Math.imul(c,at)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,z))+Math.imul(B,F)|0,o=Math.imul(B,z),n=n+Math.imul(R,K)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(T,K)|0,o=o+Math.imul(T,Z)|0,n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,n=n+Math.imul(k,X)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,$)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var kt=(h+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(c,ut)|0))<<13)|0;h=((o=o+Math.imul(c,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(N,F),i=(i=Math.imul(N,z))+Math.imul(j,F)|0,o=Math.imul(j,z),n=n+Math.imul(C,K)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,G)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,$)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var St=(h+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;h=((o=o+Math.imul(c,ct)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(L,F),i=(i=Math.imul(L,z))+Math.imul(D,F)|0,o=Math.imul(D,z),n=n+Math.imul(N,K)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(j,K)|0,o=o+Math.imul(j,Z)|0,n=n+Math.imul(C,V)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(B,V)|0,o=o+Math.imul(B,G)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,$)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,$)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,at)|0,n=n+Math.imul(g,ut)|0,i=(i=i+Math.imul(g,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var At=(h+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;h=((o=o+Math.imul(c,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(L,K),i=(i=Math.imul(L,Z))+Math.imul(D,K)|0,o=Math.imul(D,Z),n=n+Math.imul(N,V)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,$)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,$)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,at)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,at)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ht)|0,n=n+Math.imul(g,lt)|0,i=(i=i+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var Et=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(L,V),i=(i=Math.imul(L,G))+Math.imul(D,V)|0,o=Math.imul(D,G),n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,$)|0)+Math.imul(j,X)|0,o=o+Math.imul(j,$)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,at)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ht)|0,n=n+Math.imul(w,lt)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var xt=(h+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(L,X),i=(i=Math.imul(L,$))+Math.imul(D,X)|0,o=Math.imul(D,$),n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,at)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ht)|0,n=n+Math.imul(k,lt)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(S,lt)|0,o=o+Math.imul(S,ct)|0;var Ot=(h+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;h=((o=o+Math.imul(M,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(L,Q),i=(i=Math.imul(L,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(N,rt)|0,i=(i=i+Math.imul(N,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,at)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,at)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ht)|0,n=n+Math.imul(E,lt)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Rt=(h+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,mt)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(L,rt),i=(i=Math.imul(L,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(N,ot)|0,i=(i=i+Math.imul(N,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,n=n+Math.imul(C,ut)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ht)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(T,lt)|0,o=o+Math.imul(T,ct)|0;var Tt=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((o=o+Math.imul(x,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(L,ot),i=(i=Math.imul(L,at))+Math.imul(D,ot)|0,o=Math.imul(D,at),n=n+Math.imul(N,ut)|0,i=(i=i+Math.imul(N,ht)|0)+Math.imul(j,ut)|0,o=o+Math.imul(j,ht)|0,n=n+Math.imul(C,lt)|0,i=(i=i+Math.imul(C,ct)|0)+Math.imul(B,lt)|0,o=o+Math.imul(B,ct)|0;var Pt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(T,pt)|0))<<13)|0;h=((o=o+Math.imul(T,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(L,ut),i=(i=Math.imul(L,ht))+Math.imul(D,ut)|0,o=Math.imul(D,ht),n=n+Math.imul(N,lt)|0,i=(i=i+Math.imul(N,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var Ct=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(B,pt)|0))<<13)|0;h=((o=o+Math.imul(B,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(L,lt),i=(i=Math.imul(L,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var Bt=(h+(n=n+Math.imul(N,pt)|0)|0)+((8191&(i=(i=i+Math.imul(N,mt)|0)+Math.imul(j,pt)|0))<<13)|0;h=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var It=(h+(n=Math.imul(L,pt))|0)+((8191&(i=(i=Math.imul(L,mt))+Math.imul(D,pt)|0))<<13)|0;return h=((o=Math.imul(D,mt))+(i>>>13)|0)+(It>>>26)|0,It&=67108863,u[0]=vt,u[1]=gt,u[2]=yt,u[3]=bt,u[4]=wt,u[5]=Mt,u[6]=_t,u[7]=kt,u[8]=St,u[9]=At,u[10]=Et,u[11]=xt,u[12]=Ot,u[13]=Rt,u[14]=Tt,u[15]=Pt,u[16]=Ct,u[17]=Bt,u[18]=It,0!==h&&(u[19]=h,r.length++),r};function m(t,e,r){return(new v).mulp(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(p=d),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):m(this,t,e),r},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},v.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,h=0;h=0&&(0!==f||h>=i);h--){var l=0|this.words[h];this.words[h]=f<<26-o|l>>>o,f=l&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"===typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var h=0;h=0;l--){var c=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(c=Math.min(c/a|0,67108863),n._ishlnsubmul(i,c,l);0!==n.negative;)c--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=c)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0===(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(l)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,f=1;0===(e.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(e.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,c=1;0===(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"===typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new k(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(b,y),b.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return g[t]=e,e},k.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,i),c=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=a;0!==d.cmp(s);){for(var m=d,v=0;0!==m.cmp(s);v++)m=m.redSqr();n(v=0;n--){for(var h=e.words[n],f=u-1;f>=0;f--){var l=h>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===n&&0===f)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},i(S,k),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(17)(t))},function(t,e,r){"use strict";function n(t,e){for(var r=0;r1)for(var r=1;r1?e-1:0),n=1;n0?" Args: "+r.join(", "):""))}var A=function(){function t(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}var e=t.prototype;return e.indexOfGroup=function(t){for(var e=0,r=0;r=this.groupSizes.length){for(var r=this.groupSizes,n=r.length,i=n;t>=i;)(i<<=1)<0&&S(16,""+t);this.groupSizes=new Uint32Array(i),this.groupSizes.set(r),this.length=i;for(var o=n;o=this.length||0===this.groupSizes[t])return e;for(var r=this.groupSizes[t],n=this.indexOfGroup(t),i=n+r,o=n;o=O&&(O=e+1),E.set(t,e),x.set(e,t)},C="style["+M+'][data-styled-version="5.3.1"]',B=new RegExp("^"+M+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),I=function(t,e,r){for(var n,i=r.split(","),o=0,a=i.length;o=0;r--){var n=e[r];if(n&&1===n.nodeType&&n.hasAttribute(M))return n}}(r),o=void 0!==i?i.nextSibling:null;n.setAttribute(M,"active"),n.setAttribute("data-styled-version","5.3.1");var a=j();return a&&n.setAttribute("nonce",a),r.insertBefore(n,o),n},L=function(){function t(t){var e=this.element=U(t);e.appendChild(document.createTextNode("")),this.sheet=function(t){if(t.sheet)return t.sheet;for(var e=document.styleSheets,r=0,n=e.length;r=0){var r=document.createTextNode(e),n=this.nodes[t];return this.element.insertBefore(r,n||null),this.length++,!0}return!1},e.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.getRule=function(t){return t0&&(h+=t+",")})),n+=""+s+u+'{content:"'+h+'"}/*!sc*/\n'}}}return n}(this)},t}(),K=/(a)(d)/gi,Z=function(t){return String.fromCharCode(t+(t>25?39:97))};function W(t){var e,r="";for(e=Math.abs(t);e>52;e=e/52|0)r=Z(e%52)+r;return(Z(e%52)+r).replace(K,"$1-$2")}var V=function(t,e){for(var r=e.length;r;)t=33*t^e.charCodeAt(--r);return t},G=function(t){return V(5381,t)};function J(t){for(var e=0;e>>0);if(!e.hasNameForId(n,a)){var s=r(o,"."+a,void 0,n);e.insertRules(n,a,s)}i.push(a),this.staticRulesId=a}else{for(var u=this.rules.length,h=V(this.baseHash,r.hash),f="",l=0;l>>0);if(!e.hasNameForId(n,m)){var v=r(f,"."+m,void 0,n);e.insertRules(n,m,v)}i.push(m)}}return i.join(" ")},t}(),Y=/^\s*\/\/.*$/gm,Q=[":","[",".","#"];function tt(t){var e,r,n,i,o=void 0===t?g:t,a=o.options,s=void 0===a?g:a,h=o.plugins,f=void 0===h?v:h,l=new u.a(s),c=[],d=function(t){function e(e){if(e)try{t(e+"}")}catch(t){}}return function(r,n,i,o,a,s,u,h,f,l){switch(r){case 1:if(0===f&&64===n.charCodeAt(0))return t(n+";"),"";break;case 2:if(0===h)return n+"/*|*/";break;case 3:switch(h){case 102:case 112:return t(i[0]+n),"";default:return n+(0===l?"/*|*/":"")}case-2:n.split("/*|*/}").forEach(e)}}}((function(t){c.push(t)})),p=function(t,n,o){return 0===n&&-1!==Q.indexOf(o[r.length])||o.match(i)?t:"."+e};function m(t,o,a,s){void 0===s&&(s="&");var u=t.replace(Y,""),h=o&&a?a+" "+o+" { "+u+" }":u;return e=s,r=o,n=new RegExp("\\"+r+"\\b","g"),i=new RegExp("(\\"+r+"\\b){2,}"),l(a||!o?"":o,h)}return l.use([].concat(f,[function(t,e,i){2===t&&i.length&&i[0].lastIndexOf(r)>0&&(i[0]=i[0].replace(n,p))},d,function(t){if(-2===t){var e=c;return c=[],e}}])),m.hash=f.length?f.reduce((function(t,e){return e.name||S(15),V(t,e.name)}),5381).toString():"",m}var et=o.a.createContext(),rt=(et.Consumer,o.a.createContext()),nt=(rt.Consumer,new H),it=tt();function ot(){return Object(i.useContext)(et)||nt}function at(){return Object(i.useContext)(rt)||it}function st(t){var e=Object(i.useState)(t.stylisPlugins),r=e[0],n=e[1],a=ot(),u=Object(i.useMemo)((function(){var e=a;return t.sheet?e=t.sheet:t.target&&(e=e.reconstructWithOptions({target:t.target},!1)),t.disableCSSOMInjection&&(e=e.reconstructWithOptions({useCSSOMInjection:!1})),e}),[t.disableCSSOMInjection,t.sheet,t.target]),h=Object(i.useMemo)((function(){return tt({options:{prefix:!t.disableVendorPrefixes},plugins:r})}),[t.disableVendorPrefixes,r]);return Object(i.useEffect)((function(){s()(r,t.stylisPlugins)||n(t.stylisPlugins)}),[t.stylisPlugins]),o.a.createElement(et.Provider,{value:u},o.a.createElement(rt.Provider,{value:h},t.children))}var ut=function(){function t(t,e){var r=this;this.inject=function(t,e){void 0===e&&(e=it);var n=r.name+e.hash;t.hasNameForId(r.id,n)||t.insertRules(r.id,n,e(r.rules,n,"@keyframes"))},this.toString=function(){return S(12,String(r.name))},this.name=t,this.id="sc-keyframes-"+t,this.rules=e}return t.prototype.getName=function(t){return void 0===t&&(t=it),this.name+t.hash},t}(),ht=/([A-Z])/,ft=/([A-Z])/g,lt=/^ms-/,ct=function(t){return"-"+t.toLowerCase()};function dt(t){return ht.test(t)?t.replace(ft,ct).replace(lt,"-ms-"):t}var pt=function(t){return null==t||!1===t||""===t};function mt(t,e,r,n){if(Array.isArray(t)){for(var i,o=[],a=0,s=t.length;a1?e-1:0),n=1;n?@[\\\]^`{|}~-]+/g,wt=/(^-|-$)/g;function Mt(t){return t.replace(bt,"-").replace(wt,"")}var _t=function(t){return W(G(t)>>>0)};function kt(t){return"string"==typeof t&&!0}var St=function(t){return"function"==typeof t||"object"==typeof t&&null!==t&&!Array.isArray(t)},At=function(t){return"__proto__"!==t&&"constructor"!==t&&"prototype"!==t};function Et(t,e,r){var n=t[r];St(e)&&St(n)?xt(n,e):t[r]=e}function xt(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n=0||(i[r]=t[r]);return i}(e,["componentId"]),o=n&&n+"-"+(kt(t)?t:Mt(b(t)));return Tt(t,d({},i,{attrs:_,componentId:o}),r)},Object.defineProperty(S,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=n?xt({},t.defaultProps,e):e}}),S.toString=function(){return"."+S.styledComponentId},a&&c()(S,t,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),S}var Pt=function(t){return function t(e,r,i){if(void 0===i&&(i=g),!Object(n.isValidElementType)(r))return S(1,String(r));var o=function(){return e(r,i,gt.apply(void 0,arguments))};return o.withConfig=function(n){return t(e,r,d({},i,{},n))},o.attrs=function(n){return t(e,r,d({},i,{attrs:Array.prototype.concat(i.attrs,n).filter(Boolean)}))},o}(Tt,t)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(t){Pt[t]=Pt(t)}));!function(){function t(t,e){this.rules=t,this.componentId=e,this.isStatic=J(t),H.registerId(this.componentId+1)}var e=t.prototype;e.createStyles=function(t,e,r,n){var i=n(mt(this.rules,e,r,n).join(""),""),o=this.componentId+t;r.insertRules(o,o,i)},e.removeStyles=function(t,e){e.clearRules(this.componentId+t)},e.renderStyles=function(t,e,r,n){t>2&&H.registerId(this.componentId+t),this.removeStyles(t,r),this.createStyles(t,e,r,n)}}();!function(){function t(){var t=this;this._emitSheetCSS=function(){var e=t.instance.toString();if(!e)return"";var r=j();return""},this.getStyleTags=function(){return t.sealed?S(2):t._emitSheetCSS()},this.getStyleElement=function(){var e;if(t.sealed)return S(2);var r=((e={})[M]="",e["data-styled-version"]="5.3.1",e.dangerouslySetInnerHTML={__html:t.instance.toString()},e),n=j();return n&&(r.nonce=n),[o.a.createElement("style",d({},r,{key:"sc-0-0"}))]},this.seal=function(){t.sealed=!0},this.instance=new H({isServer:!0}),this.sealed=!1}var e=t.prototype;e.collectStyles=function(t){return this.sealed?S(2):o.a.createElement(st,{sheet:this.instance},t)},e.interleaveWithNodeStream=function(t){return S(3)}}();e.a=Pt}).call(this,r(11))},function(t,e,r){t.exports=r(231)},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){"use strict";r.d(e,"a",(function(){return a}));var n=r(217),i=r.n(n),o=r(0);function a(t){return"0x"+i.a.keccak_256(Object(o.a)(t))}},function(t,e,r){"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function o(t){for(var e=1;e=0&&(i=r.type.substring(o));var a=t(e,r.components);Array.isArray(a)&&e?n.push("tuple("+a.join(",")+")"+i):e?n.push("("+a+")"):n.push("("+a.join(",")+")"+i)}else n.push(r.type)})),n},h=function(t){if(!i.isHexStrict(t))throw new Error("The parameter must be a valid HEX string.");var e="",r=0,n=t.length;for("0x"===t.substring(0,2)&&(r=2);r7?r+=t[n].toUpperCase():r+=t[n];return r},toHex:i.toHex,toBN:i.toBN,bytesToHex:i.bytesToHex,hexToBytes:i.hexToBytes,hexToNumberString:i.hexToNumberString,hexToNumber:i.hexToNumber,toDecimal:i.hexToNumber,numberToHex:i.numberToHex,fromDecimal:i.numberToHex,hexToUtf8:i.hexToUtf8,hexToString:i.hexToUtf8,toUtf8:i.hexToUtf8,stripHexPrefix:i.stripHexPrefix,utf8ToHex:i.utf8ToHex,stringToHex:i.utf8ToHex,fromUtf8:i.utf8ToHex,hexToAscii:h,toAscii:h,asciiToHex:f,fromAscii:f,unitMap:n.unitMap,toWei:function(t,e){if(e=l(e),!i.isBN(t)&&"string"!==typeof t)throw new Error("Please pass numbers as strings or BN objects to avoid precision errors.");return i.isBN(t)?n.toWei(t,e):n.toWei(t,e).toString(10)},fromWei:function(t,e){if(e=l(e),!i.isBN(t)&&"string"!==typeof t)throw new Error("Please pass numbers as strings or BN objects to avoid precision errors.");return i.isBN(t)?n.fromWei(t,e):n.fromWei(t,e).toString(10)},padLeft:i.leftPad,leftPad:i.leftPad,padRight:i.rightPad,rightPad:i.rightPad,toTwosComplement:i.toTwosComplement,isBloom:i.isBloom,isUserEthereumAddressInBloom:i.isUserEthereumAddressInBloom,isContractAddressInBloom:i.isContractAddressInBloom,isTopic:i.isTopic,isTopicInBloom:i.isTopicInBloom,isInBloom:i.isInBloom,compareBlockNumbers:function(t,e){if(t==e)return 0;if("genesis"!=t&&"earliest"!=t&&0!=t||"genesis"!=e&&"earliest"!=e&&0!=e){if("genesis"==t||"earliest"==t)return-1;if("genesis"==e||"earliest"==e)return 1;if("latest"==t)return"pending"==e?-1:1;if("latest"===e)return"pending"==t?1:-1;if("pending"==t)return 1;if("pending"==e)return-1;var r=new s(t),n=new s(e);return r.lt(n)?-1:r.eq(n)?0:1}return 0},toNumber:i.toNumber}},function(t,e,r){var n=e;n.utils=r(27),n.common=r(62),n.sha=r(296),n.ripemd=r(300),n.hmac=r(301),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=r,r.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},function(t,e,r){"use strict";var n=e,i=r(30),o=r(22),a=r(187);n.assert=o,n.toArray=a.toArray,n.zero2=a.zero2,n.toHex=a.toHex,n.encode=a.encode,n.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n,i=0,o=0;t.cmpn(-i)>0||e.cmpn(-o)>0;){var a,s,u=t.andln(3)+i&3,h=e.andln(3)+o&3;3===u&&(u=-1),3===h&&(h=-1),a=0===(1&u)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==h?u:-u,r[0].push(a),s=0===(1&h)?0:3!==(n=e.andln(7)+o&7)&&5!==n||2!==u?h:-h,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"===typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},function(t,e,r){"use strict";r.d(e,"a",(function(){return p}));var n=r(0),i=r(35),o=r(18),a=(r(25),new(r(5).a)("address/5.4.0"));function s(t){Object(n.j)(t,20)||a.throwArgumentError("invalid address","address",t);for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),i=0;i<40;i++)r[i]=e[i].charCodeAt(0);for(var s=Object(n.a)(Object(o.a)(r)),u=0;u<40;u+=2)s[u>>1]>>4>=8&&(e[u]=e[u].toUpperCase()),(15&s[u>>1])>=8&&(e[u+1]=e[u+1].toUpperCase());return"0x"+e.join("")}for(var u={},h=0;h<10;h++)u[String(h)]=String(h);for(var f=0;f<26;f++)u[String.fromCharCode(65+f)]=String(10+f);var l,c=Math.floor((l=9007199254740991,Math.log10?Math.log10(l):Math.log(l)/Math.LN10));function d(t){for(var e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map((function(t){return u[t]})).join("");e.length>=c;){var r=e.substring(0,c);e=parseInt(r,10)%97+e.substring(r.length)}for(var n=String(98-parseInt(e,10)%97);n.length<2;)n="0"+n;return n}function p(t){var e=null;if("string"!==typeof t&&a.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=s(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&a.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==d(t)&&a.throwArgumentError("bad icap checksum","address",t),e=Object(i.c)(t.substring(4));e.length<40;)e="0"+e;e=s("0x"+e)}else a.throwArgumentError("invalid address","address",t);return e}},function(t,e,r){"use strict";r.d(e,"b",(function(){return h})),r.d(e,"a",(function(){return c}));var n=r(0),i=r(5),o=new i.a("rlp/5.4.0");function a(t){for(var e=[];t;)e.unshift(255&t),t>>=8;return e}function s(t,e,r){for(var n=0,i=0;ie+1+n&&o.throwError("child data too short",i.a.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:a}}function l(t,e){if(0===t.length&&o.throwError("data too short",i.a.errors.BUFFER_OVERRUN,{}),t[e]>=248){var r=t[e]-247;e+1+r>t.length&&o.throwError("data short segment too short",i.a.errors.BUFFER_OVERRUN,{});var a=s(t,e+1,r);return e+1+r+a>t.length&&o.throwError("data long segment too short",i.a.errors.BUFFER_OVERRUN,{}),f(t,e,e+1+r,r+a)}if(t[e]>=192){var u=t[e]-192;return e+1+u>t.length&&o.throwError("data array too short",i.a.errors.BUFFER_OVERRUN,{}),f(t,e,e+1,u)}if(t[e]>=184){var h=t[e]-183;e+1+h>t.length&&o.throwError("data array too short",i.a.errors.BUFFER_OVERRUN,{});var l=s(t,e+1,h);return e+1+h+l>t.length&&o.throwError("data array too short",i.a.errors.BUFFER_OVERRUN,{}),{consumed:1+h+l,result:Object(n.g)(t.slice(e+1+h,e+1+h+l))}}if(t[e]>=128){var c=t[e]-128;return e+1+c>t.length&&o.throwError("data too short",i.a.errors.BUFFER_OVERRUN,{}),{consumed:1+c,result:Object(n.g)(t.slice(e+1,e+1+c))}}return{consumed:1,result:Object(n.g)(t[e])}}function c(t){var e=Object(n.a)(t),r=l(e,0);return r.consumed!==e.length&&o.throwArgumentError("invalid rlp data","data",t),r.result}},function(t,e,r){"use strict";var n,i="object"===typeof Reflect?Reflect:null,o=i&&"function"===typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=i&&"function"===typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var a=Number.isNaN||function(t){return t!==t};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,o),n(r)}function o(){"function"===typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}g(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"===typeof t.on&&g(t,"error",e,r)}(t,i,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function h(t){if("function"!==typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function f(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function l(t,e,r,n){var i,o,a,s;if(h(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),a=o[e]),void 0===a)a=o[e]=r,++t._eventsCount;else if("function"===typeof a?a=o[e]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=f(t))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return t}function c(){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 d(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=c.bind(n);return i.listener=r,n.wrapFn=i,i}function p(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"===typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(a=e[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[t];if(void 0===u)return!1;if("function"===typeof u)o(u,this,e);else{var h=u.length,f=v(u,h);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},s.prototype.listeners=function(t){return p(this,t,!0)},s.prototype.rawListeners=function(t){return p(this,t,!1)},s.listenerCount=function(t,e){return"function"===typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,r){"use strict";var n=r(22),i=r(4);function o(t,e){return 55296===(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320===(64512&t.charCodeAt(e+1)))}function a(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function s(t){return 1===t.length?"0"+t:t}function u(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=i,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"===typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!==0&&(t="0"+t),i=0;i>6|192,r[n++]=63&a|128):o(t,i)?(a=65536+((1023&a)<<10)+(1023&t.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i>>0}return a},e.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},e.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},e.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,a=(o>>0,t[e+1]=o},e.sum64_hi=function(t,e,r,n){return(e+n>>>0>>0},e.sum64_lo=function(t,e,r,n){return e+n>>>0},e.sum64_4_hi=function(t,e,r,n,i,o,a,s){var u=0,h=e;return u+=(h=h+n>>>0)>>0)>>0)>>0},e.sum64_4_lo=function(t,e,r,n,i,o,a,s){return e+n+o+s>>>0},e.sum64_5_hi=function(t,e,r,n,i,o,a,s,u,h){var f=0,l=e;return f+=(l=l+n>>>0)>>0)>>0)>>0)>>0},e.sum64_5_lo=function(t,e,r,n,i,o,a,s,u,h){return e+n+o+s+h>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"===typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(409).Buffer}catch(O){}function s(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function u(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function h(t,e,r,i){for(var o=0,a=0,s=Math.min(t.length,r),u=e;u=49?h-49+10:h>=17?h-17+10:h,n(h>=0&&a0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=u(t,e,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(t.length-e)%2===0?e+1:e;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(O){o.prototype.inspect=l}else o.prototype.inspect=l;function l(){return(this.red?""}var c=["","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"],d=[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],p=[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];o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=d[t],f=p[t];r="";var l=this.clone();for(l.negative=0;!l.isZero();){var m=l.modrn(f).toString(t);r=(l=l.idivn(f)).isZero()?m+r:c[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(a,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function m(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var h=1;h>>26,l=67108863&u,c=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=c;d++){var p=h-d|0;f+=(a=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&a}r.words[h]=0|l,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r._strip()}o.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](a,i),a},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r=0&&(t[r--]=a>>8&255),r>=0&&(t[r--]=a>>16&255),6===o?(r>=0&&(t[r--]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"===typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,v=0|a[2],g=8191&v,y=v>>>13,b=0|a[3],w=8191&b,M=b>>>13,_=0|a[4],k=8191&_,S=_>>>13,A=0|a[5],E=8191&A,x=A>>>13,O=0|a[6],R=8191&O,T=O>>>13,P=0|a[7],C=8191&P,B=P>>>13,I=0|a[8],N=8191&I,j=I>>>13,U=0|a[9],L=8191&U,D=U>>>13,q=0|s[0],F=8191&q,z=q>>>13,H=0|s[1],K=8191&H,Z=H>>>13,W=0|s[2],V=8191&W,G=W>>>13,J=0|s[3],X=8191&J,$=J>>>13,Y=0|s[4],Q=8191&Y,tt=Y>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ht=st>>>13,ft=0|s[8],lt=8191&ft,ct=ft>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(n=Math.imul(l,F))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;h=((o=Math.imul(c,z))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(h+(n=n+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,Z)|0)+Math.imul(c,K)|0))<<13)|0;h=((o=o+Math.imul(c,Z)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,F),i=(i=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,Z)|0;var yt=(h+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;h=((o=o+Math.imul(c,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,Z)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,Z)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(h+(n=n+Math.imul(l,X)|0)|0)+((8191&(i=(i=i+Math.imul(l,$)|0)+Math.imul(c,X)|0))<<13)|0;h=((o=o+Math.imul(c,$)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(k,F),i=(i=Math.imul(k,z))+Math.imul(S,F)|0,o=Math.imul(S,z),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(M,K)|0,o=o+Math.imul(M,Z)|0,n=n+Math.imul(g,V)|0,i=(i=i+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,$)|0;var wt=(h+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,z))+Math.imul(x,F)|0,o=Math.imul(x,z),n=n+Math.imul(k,K)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,n=n+Math.imul(g,X)|0,i=(i=i+Math.imul(g,$)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(h+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(c,rt)|0))<<13)|0;h=((o=o+Math.imul(c,nt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,F),i=(i=Math.imul(R,z))+Math.imul(T,F)|0,o=Math.imul(T,z),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,Z)|0,n=n+Math.imul(k,V)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,$)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var _t=(h+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,at)|0)+Math.imul(c,ot)|0))<<13)|0;h=((o=o+Math.imul(c,at)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,z))+Math.imul(B,F)|0,o=Math.imul(B,z),n=n+Math.imul(R,K)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(T,K)|0,o=o+Math.imul(T,Z)|0,n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,n=n+Math.imul(k,X)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,$)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var kt=(h+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(c,ut)|0))<<13)|0;h=((o=o+Math.imul(c,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(N,F),i=(i=Math.imul(N,z))+Math.imul(j,F)|0,o=Math.imul(j,z),n=n+Math.imul(C,K)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,G)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,$)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var St=(h+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;h=((o=o+Math.imul(c,ct)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(L,F),i=(i=Math.imul(L,z))+Math.imul(D,F)|0,o=Math.imul(D,z),n=n+Math.imul(N,K)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(j,K)|0,o=o+Math.imul(j,Z)|0,n=n+Math.imul(C,V)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(B,V)|0,o=o+Math.imul(B,G)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,$)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,$)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,at)|0,n=n+Math.imul(g,ut)|0,i=(i=i+Math.imul(g,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var At=(h+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;h=((o=o+Math.imul(c,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(L,K),i=(i=Math.imul(L,Z))+Math.imul(D,K)|0,o=Math.imul(D,Z),n=n+Math.imul(N,V)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,$)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,$)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,at)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,at)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ht)|0,n=n+Math.imul(g,lt)|0,i=(i=i+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var Et=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(L,V),i=(i=Math.imul(L,G))+Math.imul(D,V)|0,o=Math.imul(D,G),n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,$)|0)+Math.imul(j,X)|0,o=o+Math.imul(j,$)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,at)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ht)|0,n=n+Math.imul(w,lt)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var xt=(h+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(L,X),i=(i=Math.imul(L,$))+Math.imul(D,X)|0,o=Math.imul(D,$),n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,at)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ht)|0,n=n+Math.imul(k,lt)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(S,lt)|0,o=o+Math.imul(S,ct)|0;var Ot=(h+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;h=((o=o+Math.imul(M,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(L,Q),i=(i=Math.imul(L,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(N,rt)|0,i=(i=i+Math.imul(N,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,at)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,at)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ht)|0,n=n+Math.imul(E,lt)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Rt=(h+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,mt)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(L,rt),i=(i=Math.imul(L,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(N,ot)|0,i=(i=i+Math.imul(N,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,n=n+Math.imul(C,ut)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ht)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(T,lt)|0,o=o+Math.imul(T,ct)|0;var Tt=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((o=o+Math.imul(x,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(L,ot),i=(i=Math.imul(L,at))+Math.imul(D,ot)|0,o=Math.imul(D,at),n=n+Math.imul(N,ut)|0,i=(i=i+Math.imul(N,ht)|0)+Math.imul(j,ut)|0,o=o+Math.imul(j,ht)|0,n=n+Math.imul(C,lt)|0,i=(i=i+Math.imul(C,ct)|0)+Math.imul(B,lt)|0,o=o+Math.imul(B,ct)|0;var Pt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(T,pt)|0))<<13)|0;h=((o=o+Math.imul(T,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(L,ut),i=(i=Math.imul(L,ht))+Math.imul(D,ut)|0,o=Math.imul(D,ht),n=n+Math.imul(N,lt)|0,i=(i=i+Math.imul(N,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var Ct=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(B,pt)|0))<<13)|0;h=((o=o+Math.imul(B,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(L,lt),i=(i=Math.imul(L,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var Bt=(h+(n=n+Math.imul(N,pt)|0)|0)+((8191&(i=(i=i+Math.imul(N,mt)|0)+Math.imul(j,pt)|0))<<13)|0;h=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var It=(h+(n=Math.imul(L,pt))|0)+((8191&(i=(i=Math.imul(L,mt))+Math.imul(D,pt)|0))<<13)|0;return h=((o=Math.imul(D,mt))+(i>>>13)|0)+(It>>>26)|0,It&=67108863,u[0]=vt,u[1]=gt,u[2]=yt,u[3]=bt,u[4]=wt,u[5]=Mt,u[6]=_t,u[7]=kt,u[8]=St,u[9]=At,u[10]=Et,u[11]=xt,u[12]=Ot,u[13]=Rt,u[14]=Tt,u[15]=Pt,u[16]=Ct,u[17]=Bt,u[18]=It,0!==h&&(u[19]=h,r.length++),r};function g(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function y(t,e,r){return g(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(v=m),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?v(this,t,e):r<63?m(this,t,e):r<1024?g(this,t,e):y(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},b.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,h=0;h=0&&(0!==f||h>=i);h--){var l=0|this.words[h];this.words[h]=f<<26-o|l>>>o,f=l&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"===typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var h=0;h=0;l--){var c=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(c=Math.min(c/a|0,67108863),n._ishlnsubmul(i,c,l);0!==n.negative;)c--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=c)}return s&&s._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0===(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(l)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,f=1;0===(e.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(e.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,c=1;0===(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"===typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new E(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var w={k256:null,p224:null,p192:null,p25519:null};function M(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){M.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function k(){M.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){M.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){M.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){E.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}M.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},M.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},M.prototype.split=function(t,e){t.iushrn(this.n,0,e)},M.prototype.imulK=function(t){return t.imul(this.k)},i(_,M),_.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},_.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(w[t])return w[t];var e;if("k256"===t)e=new _;else if("p224"===t)e=new k;else if("p192"===t)e=new S;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new A}return w[t]=e,e},E.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},E.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},E.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(f(t,t.umod(this.m)._forceRed(this)),t)},E.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},E.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},E.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},E.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},E.prototype.isqr=function(t){return this.imul(t,t.clone())},E.prototype.sqr=function(t){return this.mul(t,t)},E.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,i),c=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=a;0!==d.cmp(s);){for(var m=d,v=0;0!==m.cmp(s);v++)m=m.redSqr();n(v=0;n--){for(var h=e.words[n],f=u-1;f>=0;f--){var l=h>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===n&&0===f)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},E.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},E.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new x(t)},i(x,E),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(17)(t))},function(t,e,r){"use strict";var n=r(9).Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!==typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=h,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=f,this.end=l,e=3;break;default:return this.write=c,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function a(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!==(192&e[0]))return t.lastNeed=0,"\ufffd";if(t.lastNeed>1&&e.length>1){if(128!==(192&e[1]))return t.lastNeed=1,"\ufffd";if(t.lastNeed>2&&e.length>2&&128!==(192&e[2]))return t.lastNeed=2,"\ufffd"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function h(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function f(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function c(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(t.lastNeed=i-1),i;if(--n=0)return i>0&&(t.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"===typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(411).Buffer}catch(A){}function s(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function h(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=u(t,e,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(t.length-e)%2===0?e+1:e;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var f=["","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"],l=[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 d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var h=1;h>>26,l=67108863&u,c=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=c;d++){var p=h-d|0;f+=(a=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&a}r.words[h]=0|l,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?f[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=l[t],d=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:f[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n("undefined"!==typeof a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===e,h=new t(o),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),h[s]=a;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"===typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,v=0|a[2],g=8191&v,y=v>>>13,b=0|a[3],w=8191&b,M=b>>>13,_=0|a[4],k=8191&_,S=_>>>13,A=0|a[5],E=8191&A,x=A>>>13,O=0|a[6],R=8191&O,T=O>>>13,P=0|a[7],C=8191&P,B=P>>>13,I=0|a[8],N=8191&I,j=I>>>13,U=0|a[9],L=8191&U,D=U>>>13,q=0|s[0],F=8191&q,z=q>>>13,H=0|s[1],K=8191&H,Z=H>>>13,W=0|s[2],V=8191&W,G=W>>>13,J=0|s[3],X=8191&J,$=J>>>13,Y=0|s[4],Q=8191&Y,tt=Y>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ht=st>>>13,ft=0|s[8],lt=8191&ft,ct=ft>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(n=Math.imul(l,F))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;h=((o=Math.imul(c,z))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(h+(n=n+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,Z)|0)+Math.imul(c,K)|0))<<13)|0;h=((o=o+Math.imul(c,Z)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,F),i=(i=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,Z)|0;var yt=(h+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;h=((o=o+Math.imul(c,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,Z)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,Z)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(h+(n=n+Math.imul(l,X)|0)|0)+((8191&(i=(i=i+Math.imul(l,$)|0)+Math.imul(c,X)|0))<<13)|0;h=((o=o+Math.imul(c,$)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(k,F),i=(i=Math.imul(k,z))+Math.imul(S,F)|0,o=Math.imul(S,z),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(M,K)|0,o=o+Math.imul(M,Z)|0,n=n+Math.imul(g,V)|0,i=(i=i+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,$)|0;var wt=(h+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,z))+Math.imul(x,F)|0,o=Math.imul(x,z),n=n+Math.imul(k,K)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,n=n+Math.imul(g,X)|0,i=(i=i+Math.imul(g,$)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(h+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(c,rt)|0))<<13)|0;h=((o=o+Math.imul(c,nt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,F),i=(i=Math.imul(R,z))+Math.imul(T,F)|0,o=Math.imul(T,z),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,Z)|0,n=n+Math.imul(k,V)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,$)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var _t=(h+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,at)|0)+Math.imul(c,ot)|0))<<13)|0;h=((o=o+Math.imul(c,at)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,z))+Math.imul(B,F)|0,o=Math.imul(B,z),n=n+Math.imul(R,K)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(T,K)|0,o=o+Math.imul(T,Z)|0,n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,n=n+Math.imul(k,X)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,$)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var kt=(h+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(c,ut)|0))<<13)|0;h=((o=o+Math.imul(c,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(N,F),i=(i=Math.imul(N,z))+Math.imul(j,F)|0,o=Math.imul(j,z),n=n+Math.imul(C,K)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,G)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,$)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var St=(h+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;h=((o=o+Math.imul(c,ct)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(L,F),i=(i=Math.imul(L,z))+Math.imul(D,F)|0,o=Math.imul(D,z),n=n+Math.imul(N,K)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(j,K)|0,o=o+Math.imul(j,Z)|0,n=n+Math.imul(C,V)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(B,V)|0,o=o+Math.imul(B,G)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,$)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,$)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,at)|0,n=n+Math.imul(g,ut)|0,i=(i=i+Math.imul(g,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var At=(h+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;h=((o=o+Math.imul(c,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(L,K),i=(i=Math.imul(L,Z))+Math.imul(D,K)|0,o=Math.imul(D,Z),n=n+Math.imul(N,V)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,$)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,$)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,at)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,at)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ht)|0,n=n+Math.imul(g,lt)|0,i=(i=i+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var Et=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(L,V),i=(i=Math.imul(L,G))+Math.imul(D,V)|0,o=Math.imul(D,G),n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,$)|0)+Math.imul(j,X)|0,o=o+Math.imul(j,$)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,at)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ht)|0,n=n+Math.imul(w,lt)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var xt=(h+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(L,X),i=(i=Math.imul(L,$))+Math.imul(D,X)|0,o=Math.imul(D,$),n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,at)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ht)|0,n=n+Math.imul(k,lt)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(S,lt)|0,o=o+Math.imul(S,ct)|0;var Ot=(h+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;h=((o=o+Math.imul(M,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(L,Q),i=(i=Math.imul(L,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(N,rt)|0,i=(i=i+Math.imul(N,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,at)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,at)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ht)|0,n=n+Math.imul(E,lt)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Rt=(h+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,mt)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(L,rt),i=(i=Math.imul(L,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(N,ot)|0,i=(i=i+Math.imul(N,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,n=n+Math.imul(C,ut)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ht)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(T,lt)|0,o=o+Math.imul(T,ct)|0;var Tt=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((o=o+Math.imul(x,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(L,ot),i=(i=Math.imul(L,at))+Math.imul(D,ot)|0,o=Math.imul(D,at),n=n+Math.imul(N,ut)|0,i=(i=i+Math.imul(N,ht)|0)+Math.imul(j,ut)|0,o=o+Math.imul(j,ht)|0,n=n+Math.imul(C,lt)|0,i=(i=i+Math.imul(C,ct)|0)+Math.imul(B,lt)|0,o=o+Math.imul(B,ct)|0;var Pt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(T,pt)|0))<<13)|0;h=((o=o+Math.imul(T,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(L,ut),i=(i=Math.imul(L,ht))+Math.imul(D,ut)|0,o=Math.imul(D,ht),n=n+Math.imul(N,lt)|0,i=(i=i+Math.imul(N,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var Ct=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(B,pt)|0))<<13)|0;h=((o=o+Math.imul(B,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(L,lt),i=(i=Math.imul(L,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var Bt=(h+(n=n+Math.imul(N,pt)|0)|0)+((8191&(i=(i=i+Math.imul(N,mt)|0)+Math.imul(j,pt)|0))<<13)|0;h=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var It=(h+(n=Math.imul(L,pt))|0)+((8191&(i=(i=Math.imul(L,mt))+Math.imul(D,pt)|0))<<13)|0;return h=((o=Math.imul(D,mt))+(i>>>13)|0)+(It>>>26)|0,It&=67108863,u[0]=vt,u[1]=gt,u[2]=yt,u[3]=bt,u[4]=wt,u[5]=Mt,u[6]=_t,u[7]=kt,u[8]=St,u[9]=At,u[10]=Et,u[11]=xt,u[12]=Ot,u[13]=Rt,u[14]=Tt,u[15]=Pt,u[16]=Ct,u[17]=Bt,u[18]=It,0!==h&&(u[19]=h,r.length++),r};function m(t,e,r){return(new v).mulp(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(p=d),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):m(this,t,e),r},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},v.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,h=0;h=0&&(0!==f||h>=i);h--){var l=0|this.words[h];this.words[h]=f<<26-o|l>>>o,f=l&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"===typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var h=0;h=0;l--){var c=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(c=Math.min(c/a|0,67108863),n._ishlnsubmul(i,c,l);0!==n.negative;)c--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=c)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0===(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(l)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,f=1;0===(e.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(e.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,c=1;0===(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"===typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new k(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(b,y),b.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return g[t]=e,e},k.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,i),c=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=a;0!==d.cmp(s);){for(var m=d,v=0;0!==m.cmp(s);v++)m=m.redSqr();n(v=0;n--){for(var h=e.words[n],f=u-1;f>=0;f--){var l=h>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===n&&0===f)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},i(S,k),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(17)(t))},function(t,e,r){"use strict";(function(e,n){var i=65536,o=4294967295;var a=r(9).Buffer,s=e.crypto||e.msCrypto;s&&s.getRandomValues?t.exports=function(t,e){if(t>o)throw new RangeError("requested too many random bytes");var r=a.allocUnsafe(t);if(t>0)if(t>i)for(var u=0;u=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}},function(t,e,r){var n=r(9).Buffer,i=r(369).Transform,o=r(29).StringDecoder;function a(t){i.call(this),this.hashMode="string"===typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(4)(a,i),a.prototype.update=function(t,e,r){"string"===typeof t&&(t=n.from(t,e));var i=this._update(t);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(i){n=i}finally{r(n)}},a.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(r){e=r}t(e)},a.prototype._finalOrDigest=function(t){var e=this.__final()||n.alloc(0);return t&&(e=this._toString(e,t,!0)),e},a.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n},t.exports=a},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||e.hasOwnProperty(r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(203),e),i(r(204),e),i(r(471),e),i(r(113),e),i(r(472),e),i(r(42),e),i(r(473),e),i(r(474),e),i(r(115),e),i(r(52),e)},function(t,e,r){"use strict";r.d(e,"a",(function(){return p})),r.d(e,"c",(function(){return b})),r.d(e,"b",(function(){return w}));var n=r(6),i=r(8),o=r(218),a=r.n(o),s=r(0),u=r(5),h=a.a.BN,f=new u.a("bignumber/5.4.2"),l={},c=9007199254740991;var d=!1,p=function(){function t(e,r){Object(n.a)(this,t),f.checkNew(this instanceof t?this.constructor:void 0,t),e!==l&&f.throwError("cannot call constructor directly; use BigNumber.from",u.a.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}return Object(i.a)(t,[{key:"fromTwos",value:function(t){return v(g(this).fromTwos(t))}},{key:"toTwos",value:function(t){return v(g(this).toTwos(t))}},{key:"abs",value:function(){return"-"===this._hex[0]?t.from(this._hex.substring(1)):this}},{key:"add",value:function(t){return v(g(this).add(g(t)))}},{key:"sub",value:function(t){return v(g(this).sub(g(t)))}},{key:"div",value:function(e){return t.from(e).isZero()&&y("division by zero","div"),v(g(this).div(g(e)))}},{key:"mul",value:function(t){return v(g(this).mul(g(t)))}},{key:"mod",value:function(t){var e=g(t);return e.isNeg()&&y("cannot modulo negative values","mod"),v(g(this).umod(e))}},{key:"pow",value:function(t){var e=g(t);return e.isNeg()&&y("cannot raise to negative values","pow"),v(g(this).pow(e))}},{key:"and",value:function(t){var e=g(t);return(this.isNegative()||e.isNeg())&&y("cannot 'and' negative values","and"),v(g(this).and(e))}},{key:"or",value:function(t){var e=g(t);return(this.isNegative()||e.isNeg())&&y("cannot 'or' negative values","or"),v(g(this).or(e))}},{key:"xor",value:function(t){var e=g(t);return(this.isNegative()||e.isNeg())&&y("cannot 'xor' negative values","xor"),v(g(this).xor(e))}},{key:"mask",value:function(t){return(this.isNegative()||t<0)&&y("cannot mask negative values","mask"),v(g(this).maskn(t))}},{key:"shl",value:function(t){return(this.isNegative()||t<0)&&y("cannot shift negative values","shl"),v(g(this).shln(t))}},{key:"shr",value:function(t){return(this.isNegative()||t<0)&&y("cannot shift negative values","shr"),v(g(this).shrn(t))}},{key:"eq",value:function(t){return g(this).eq(g(t))}},{key:"lt",value:function(t){return g(this).lt(g(t))}},{key:"lte",value:function(t){return g(this).lte(g(t))}},{key:"gt",value:function(t){return g(this).gt(g(t))}},{key:"gte",value:function(t){return g(this).gte(g(t))}},{key:"isNegative",value:function(){return"-"===this._hex[0]}},{key:"isZero",value:function(){return g(this).isZero()}},{key:"toNumber",value:function(){try{return g(this).toNumber()}catch(t){y("overflow","toNumber",this.toString())}return null}},{key:"toBigInt",value:function(){try{return BigInt(this.toString())}catch(t){}return f.throwError("this platform does not support BigInt",u.a.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}},{key:"toString",value:function(){return arguments.length>0&&(10===arguments[0]?d||(d=!0,f.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?f.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",u.a.errors.UNEXPECTED_ARGUMENT,{}):f.throwError("BigNumber.toString does not accept parameters",u.a.errors.UNEXPECTED_ARGUMENT,{})),g(this).toString(10)}},{key:"toHexString",value:function(){return this._hex}},{key:"toJSON",value:function(t){return{type:"BigNumber",hex:this.toHexString()}}}],[{key:"from",value:function(e){if(e instanceof t)return e;if("string"===typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new t(l,m(e)):e.match(/^-?[0-9]+$/)?new t(l,m(new h(e))):f.throwArgumentError("invalid BigNumber string","value",e);if("number"===typeof e)return e%1&&y("underflow","BigNumber.from",e),(e>=c||e<=-c)&&y("overflow","BigNumber.from",e),t.from(String(e));var r=e;if("bigint"===typeof r)return t.from(r.toString());if(Object(s.h)(r))return t.from(Object(s.g)(r));if(r)if(r.toHexString){var n=r.toHexString();if("string"===typeof n)return t.from(n)}else{var i=r._hex;if(null==i&&"BigNumber"===r.type&&(i=r.hex),"string"===typeof i&&(Object(s.j)(i)||"-"===i[0]&&Object(s.j)(i.substring(1))))return t.from(i)}return f.throwArgumentError("invalid BigNumber value","value",e)}},{key:"isBigNumber",value:function(t){return!(!t||!t._isBigNumber)}}]),t}();function m(t){if("string"!==typeof t)return m(t.toString(16));if("-"===t[0])return"-"===(t=t.substring(1))[0]&&f.throwArgumentError("invalid hex","value",t),"0x00"===(t=m(t))?t:"-"+t;if("0x"!==t.substring(0,2)&&(t="0x"+t),"0x"===t)return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&"0x00"===t.substring(0,4);)t="0x"+t.substring(4);return t}function v(t){return p.from(m(t))}function g(t){var e=p.from(t).toHexString();return"-"===e[0]?new h("-"+e.substring(3),16):new h(e.substring(2),16)}function y(t,e,r){var n={fault:t,operation:e};return null!=r&&(n.value=r),f.throwError(t,u.a.errors.NUMERIC_FAULT,n)}function b(t){return new h(t,36).toString(16)}function w(t){return new h(t,16).toString(36)}},function(t,e,r){var n=r(236),i=r(287);t.exports={packageInit:function(t,e){if(e=Array.prototype.slice.call(e),!t)throw new Error('You need to instantiate using the "new" keyword.');Object.defineProperty(t,"currentProvider",{get:function(){return t._provider},set:function(e){return t.setProvider(e)},enumerable:!0,configurable:!0}),e[0]&&e[0]._requestManager?t._requestManager=e[0]._requestManager:t._requestManager=new n.Manager(e[0],e[1]),t.givenProvider=n.Manager.givenProvider,t.providers=n.Manager.providers,t._provider=t._requestManager.provider,t.setProvider||(t.setProvider=function(e,r){return t._requestManager.setProvider(e,r),t._provider=t._requestManager.provider,!0}),t.setRequestManager=function(e){t._requestManager=e,t._provider=e.provider},t.BatchRequest=n.BatchManager.bind(null,t._requestManager),t.extend=i(t)},addProviders:function(t){t.givenProvider=n.Manager.givenProvider,t.providers=n.Manager.providers}}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function r(t,e){for(var r=0;r1?(t[r[0]]=t[r[0]]||{},t[r[0]][r[1]]=e):t[r[0]]=e},d.prototype.getCall=function(t){return"function"===typeof this.call?this.call(t):this.call},d.prototype.extractCallback=function(t){if("function"===typeof t[t.length-1])return t.pop()},d.prototype.validateArgs=function(t){if(t.length!==this.params)throw s.InvalidNumberOfParams(t.length,this.params,this.name)},d.prototype.formatInput=function(t){var e=this;return this.inputFormatter?this.inputFormatter.map((function(r,n){return r?r.call(e,t[n]):t[n]})):t},d.prototype.formatOutput=function(t){var e=this;return Array.isArray(t)?t.map((function(t){return e.outputFormatter&&t?e.outputFormatter(t):t})):this.outputFormatter&&t?this.outputFormatter(t):t},d.prototype.toPayload=function(t){var e=this.getCall(t),r=this.extractCallback(t),n=this.formatInput(t);this.validateArgs(n);var i={method:e,params:n,callback:r};return this.transformPayload&&(i=this.transformPayload(i)),i},d.prototype._confirmTransaction=function(t,e,r){var n=this,i=!1,p=!0,m=0,v=0,g=null,y=null,b=r.params[0]&&"object"===typeof r.params[0]&&r.params[0].gas?r.params[0].gas:null,w=!!r.params[0]&&"object"===typeof r.params[0]&&r.params[0].data&&r.params[0].from&&!r.params[0].to,M=w&&r.params[0].data.length>2,_=[new d({name:"getBlockByNumber",call:"eth_getBlockByNumber",params:2,inputFormatter:[u.inputBlockNumberFormatter,function(t){return!!t}],outputFormatter:u.outputBlockFormatter}),new d({name:"getTransactionReceipt",call:"eth_getTransactionReceipt",params:1,inputFormatter:[null],outputFormatter:u.outputTransactionReceiptFormatter}),new d({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[u.inputAddressFormatter,u.inputDefaultBlockNumberFormatter]}),new d({name:"getTransactionByHash",call:"eth_getTransactionByHash",params:1,inputFormatter:[null],outputFormatter:u.outputTransactionFormatter}),new l({name:"subscribe",type:"eth",subscriptions:{newBlockHeaders:{subscriptionName:"newHeads",params:0,outputFormatter:u.outputBlockFormatter}}})],k={};_.forEach((function(t){t.attachToObject(k),t.requestManager=n.requestManager}));var S=function(l,d,_,S,A){if(!_)return A||(A={unsubscribe:function(){clearInterval(g)}}),(l?f.resolve(l):k.getTransactionReceipt(e)).catch((function(e){A.unsubscribe(),i=!0,h._fireError({message:"Failed to check for transaction receipt:",data:e},t.eventEmitter,t.reject)})).then(function(){var e=a(o.mark((function e(r){var i,a,s;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r&&r.blockHash){e.next=2;break}throw new Error("Receipt missing or blockHash null");case 2:if(n.extraFormatters&&n.extraFormatters.receiptFormatter&&(r=n.extraFormatters.receiptFormatter(r)),!(t.eventEmitter.listeners("confirmation").length>0)){e.next=28;break}if(void 0!==l&&0===v){e.next=25;break}return e.next=7,k.getBlockByNumber("latest");case 7:if(a=e.sent,s=a?a.hash:null,!d){e.next=24;break}if(!y){e.next=17;break}return e.next=13,k.getBlockByNumber(y.number+1);case 13:(i=e.sent)&&(y=i,t.eventEmitter.emit("confirmation",v,r,s)),e.next=22;break;case 17:return e.next=19,k.getBlockByNumber(r.blockNumber);case 19:i=e.sent,y=i,t.eventEmitter.emit("confirmation",v,r,s);case 22:e.next=25;break;case 24:t.eventEmitter.emit("confirmation",v,r,s);case 25:(d&&i||!d)&&v++,p=!1,v===n.transactionConfirmationBlocks+1&&(A.unsubscribe(),t.eventEmitter.removeAllListeners());case 28:return e.abrupt("return",r);case 29:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).then(function(){var e=a(o.mark((function e(r){var a;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!w||i){e.next=19;break}if(r.contractAddress){e.next=5;break}return p&&(A.unsubscribe(),i=!0),h._fireError(s.NoContractAddressFoundError(r),t.eventEmitter,t.reject,null,r),e.abrupt("return");case 5:return e.prev=5,e.next=8,k.getCode(r.contractAddress);case 8:a=e.sent,e.next=13;break;case 11:e.prev=11,e.t0=e.catch(5);case 13:if(a){e.next=15;break}return e.abrupt("return");case 15:!0===r.status&&M||a.length>2?(t.eventEmitter.emit("receipt",r),n.extraFormatters&&n.extraFormatters.contractDeployFormatter?t.resolve(n.extraFormatters.contractDeployFormatter(r)):t.resolve(r),p&&t.eventEmitter.removeAllListeners()):h._fireError(s.ContractCodeNotStoredError(r),t.eventEmitter,t.reject,null,r),p&&A.unsubscribe(),i=!0;case 19:return e.abrupt("return",r);case 20:case"end":return e.stop()}}),e,null,[[5,11]])})));return function(t){return e.apply(this,arguments)}}()).then(function(){var e=a(o.mark((function e(a){var f,l,d,m;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(w||i){e.next=35;break}if(a.outOfGas||b&&b===a.gasUsed||!0!==a.status&&"0x1"!==a.status&&"undefined"!==typeof a.status){e.next=7;break}t.eventEmitter.emit("receipt",a),t.resolve(a),p&&t.eventEmitter.removeAllListeners(),e.next=33;break;case 7:if(JSON.stringify(a,null,2),!1!==a.status&&"0x0"!==a.status){e.next=32;break}if(e.prev=9,f=null,!n.handleRevert||"eth_sendTransaction"!==n.call&&"eth_sendRawTransaction"!==n.call){e.next=24;break}return l=r.params[0],"eth_sendRawTransaction"===n.call&&(d=r.params[0],m=c.parse(d),l=u.inputTransactionFormatter({data:m.data,to:m.to,from:m.from,gas:m.gasLimit.toHexString(),gasPrice:m.gasPrice.toHexString(),value:m.value.toHexString()})),e.next=16,n.getRevertReason(l,a.blockNumber);case 16:if(!(f=e.sent)){e.next=21;break}h._fireError(s.TransactionRevertInstructionError(f.reason,f.signature,a),t.eventEmitter,t.reject,null,a),e.next=22;break;case 21:throw!1;case 22:e.next=25;break;case 24:throw!1;case 25:e.next=30;break;case 27:e.prev=27,e.t0=e.catch(9),h._fireError(s.TransactionRevertedWithoutReasonError(a),t.eventEmitter,t.reject,null,a);case 30:e.next=33;break;case 32:h._fireError(s.TransactionOutOfGasError(a),t.eventEmitter,t.reject,null,a);case 33:p&&A.unsubscribe(),i=!0;case 35:case"end":return e.stop()}}),e,null,[[9,27]])})));return function(t){return e.apply(this,arguments)}}()).catch((function(){m++,d?m-1>=n.transactionPollingTimeout&&(A.unsubscribe(),i=!0,h._fireError(s.TransactionError("Transaction was not mined within "+n.transactionPollingTimeout+" seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!"),t.eventEmitter,t.reject)):m-1>=n.transactionBlockTimeout&&(A.unsubscribe(),i=!0,h._fireError(s.TransactionError("Transaction was not mined within "+n.transactionBlockTimeout+" blocks, please make sure your transaction was properly sent. Be aware that it might still be mined!"),t.eventEmitter,t.reject))}));A.unsubscribe(),i=!0,h._fireError({message:"Failed to subscribe to new newBlockHeaders to confirm the transaction receipts.",data:_},t.eventEmitter,t.reject)},A=function(t){var e=function(){g=setInterval(S.bind(null,t,!0),1e3)};this.requestManager.provider.on?k.subscribe("newBlockHeaders",(function(r,n,i){r||!n?e():S(t,!1,r,0,i)})):e()}.bind(this);k.getTransactionReceipt(e).then((function(e){e&&e.blockHash?(t.eventEmitter.listeners("confirmation").length>0&&A(e),S(e,!1)):i||A()})).catch((function(){i||A()}))};var p=function(t,e){return"number"===typeof t?e.wallet[t]:t&&"object"===typeof t&&t.address&&t.privateKey?t:e.wallet[t.toLowerCase()]};function m(t,e){return new Promise((function(r,i){try{var o=new d({name:"getBlockByNumber",call:"eth_getBlockByNumber",params:2,inputFormatter:[function(t){return t?h.toHex(t):"latest"},function(){return!1}]}).createFunction(t.requestManager),a=new d({name:"getGasPrice",call:"eth_gasPrice",params:0}).createFunction(t.requestManager);Promise.all([o(),a()]).then((function(t){var i=n(t,2),o=i[0],a=i[1];if(("0x2"===e.type||void 0===e.type)&&o&&o.baseFeePerGas){var s,u;e.gasPrice?(s=e.gasPrice,u=e.gasPrice,delete e.gasPrice):(s=e.maxPriorityFeePerGas||"0x9502F900",u=e.maxFeePerGas||h.toHex(h.toBN(o.baseFeePerGas).mul(h.toBN(2)).add(h.toBN(s)))),r({maxFeePerGas:u,maxPriorityFeePerGas:s})}else{if(e.maxPriorityFeePerGas||e.maxFeePerGas)throw Error("Network doesn't support eip-1559");r({gasPrice:a})}}))}catch(s){i(s)}}))}d.prototype.buildCall=function(){var t=this,e="eth_sendTransaction"===t.call||"eth_sendRawTransaction"===t.call,r="eth_call"===t.call,n=function(){var n=f(!e),o=t.toPayload(Array.prototype.slice.call(arguments)),a=function(i,a){var u;if(t.handleRevert&&r&&t.abiCoder&&(!i&&t.isRevertReasonString(a)?u=a.substring(10):i&&i.data&&(u=i.data.substring(10)),u)){var f=t.abiCoder.decodeParameter("string","0x"+u),l="Error(String)";return void h._fireError(s.RevertInstructionError(f,l),n.eventEmitter,n.reject,o.callback,{reason:f,signature:l})}try{a=t.formatOutput(a)}catch(c){i=c}if(a instanceof Error&&(i=a),i)return i.error&&(i=i.error),h._fireError(i,n.eventEmitter,n.reject,o.callback);o.callback&&o.callback(null,a),e?(n.eventEmitter.emit("transactionHash",a),t._confirmTransaction(n,a,o)):i||n.resolve(a)},u=function(e){var r=i(i({},o),{},{method:"eth_sendRawTransaction",params:[e.rawTransaction]});t.requestManager.send(r,a)},l=function(t,e){var r;if(e&&e.accounts&&e.accounts.wallet&&e.accounts.wallet.length)if("eth_sendTransaction"===t.method){var i=t.params[0];if((r=p(i&&"object"===typeof i?i.from:null,e.accounts))&&r.privateKey)return delete(i=JSON.parse(JSON.stringify(i))).from,e.defaultChain&&!i.chain&&(i.chain=e.defaultChain),e.defaultHardfork&&!i.hardfork&&(i.hardfork=e.defaultHardfork),e.defaultCommon&&!i.common&&(i.common=e.defaultCommon),void e.accounts.signTransaction(i,r.privateKey).then(u).catch((function(t){if("function"===typeof n.eventEmitter.listeners&&n.eventEmitter.listeners("error").length){try{n.eventEmitter.emit("error",t)}catch(t){}n.eventEmitter.removeAllListeners(),n.eventEmitter.catch((function(){}))}n.reject(t)}))}else if("eth_sign"===t.method){var o=t.params[1];if((r=p(t.params[0],e.accounts))&&r.privateKey){var s=e.accounts.sign(o,r.privateKey);return t.callback&&t.callback(null,s.signature),void n.resolve(s.signature)}}return e.requestManager.send(t,a)};return e&&o.params[0]&&"object"===typeof o.params[0]&&"undefined"===typeof o.params[0].gasPrice&&("undefined"===typeof o.params[0].maxPriorityFeePerGas||"undefined"===typeof o.params[0].maxFeePerGas)?m(t,o.params[0]).then((function(r){void 0!==r.gasPrice?o.params[0].gasPrice=r.gasPrice:void 0!==r.maxPriorityFeePerGas&&void 0!==r.maxFeePerGas&&(o.params[0].maxPriorityFeePerGas=r.maxPriorityFeePerGas,o.params[0].maxFeePerGas=r.maxFeePerGas),e&&setTimeout((function(){n.eventEmitter.emit("sending",o)}),0),l(o,t)})):(e&&setTimeout((function(){n.eventEmitter.emit("sending",o)}),0),l(o,t)),e&&setTimeout((function(){n.eventEmitter.emit("sent",o)}),0),n.eventEmitter};return n.method=t,n.request=this.request.bind(this),n},d.prototype.getRevertReason=function(t,e){var r=this;return new Promise((function(n,i){new d({name:"call",call:"eth_call",params:2,abiCoder:r.abiCoder,handleRevert:!0}).createFunction(r.requestManager)(t,h.numberToHex(e)).then((function(){n(!1)})).catch((function(t){t.reason?n({reason:t.reason,signature:t.signature}):i(t)}))}))},d.prototype.isRevertReasonString=function(t){return"string"===typeof t&&(t.length-2)/2%32===4&&"0x08c379a0"===t.substring(0,10)},d.prototype.request=function(){var t=this.toPayload(Array.prototype.slice.call(arguments));return t.format=this.formatOutput.bind(this),t},t.exports=d},function(t,e,r){var n=r(288),i=r(289),o=r(90),a=r(290);t.exports=function(t,e){return n(t)||i(t,e)||o(t,e)||a()}},function(t,e,r){"use strict";(function(t){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.baToJSON=e.addHexPrefix=e.toUnsigned=e.fromSigned=e.bufferToHex=e.bufferToInt=e.toBuffer=e.unpadHexString=e.unpadArray=e.unpadBuffer=e.setLengthRight=e.setLengthLeft=e.zeros=void 0;var i=n(r(28)),o=r(52),a=r(84);e.zeros=function(e){return t.allocUnsafe(e).fill(0)};var s=function(t,r,n){var i=e.zeros(r);return n?t.length0&&"0"===e.toString();)e=(t=t.slice(1))[0];return t};e.unpadBuffer=function(t){return a.assertIsBuffer(t),u(t)},e.unpadArray=function(t){return a.assertIsArray(t),u(t)},e.unpadHexString=function(t){return a.assertIsHexString(t),t=o.stripHexPrefix(t),u(t)},e.toBuffer=function(e){if(null===e||void 0===e)return t.allocUnsafe(0);if(t.isBuffer(e))return t.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return t.from(e);if("string"===typeof e){if(!o.isHexString(e))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+e);return t.from(o.padToEven(o.stripHexPrefix(e)),"hex")}if("number"===typeof e)return o.intToBuffer(e);if(i.default.isBN(e))return e.toArrayLike(t);if(e.toArray)return t.from(e.toArray());if(e.toBuffer)return t.from(e.toBuffer());throw new Error("invalid type")},e.bufferToInt=function(t){return new i.default(e.toBuffer(t)).toNumber()},e.bufferToHex=function(t){return"0x"+(t=e.toBuffer(t)).toString("hex")},e.fromSigned=function(t){return new i.default(t).fromTwos(256)},e.toUnsigned=function(e){return t.from(e.toTwos(256).toArray())},e.addHexPrefix=function(t){return"string"!==typeof t||o.isHexPrefixed(t)?t:"0x"+t},e.baToJSON=function(r){if(t.isBuffer(r))return"0x"+r.toString("hex");if(r instanceof Array){for(var n=[],i=0;i2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}i("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(t,e,r){var n,i,a,s;if("string"===typeof e&&(i="not ",e.substr(!a||a<0?0:+a,i.length)===i)?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(n," ").concat(o(e,"type"));else{var u=function(t,e,r){return"number"!==typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";s='The "'.concat(t,'" ').concat(u," ").concat(n," ").concat(o(e,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=n},function(t,e,r){"use strict";(function(e){var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=h;var i=r(155),o=r(159);r(4)(h,i);for(var a=n(o.prototype),s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},function(t,e,r){"use strict";var n={};function i(t,e,r){r||(r=Error);var i=function(t){var r,n;function i(r,n,i){return t.call(this,function(t,r,n){return"string"===typeof e?e:e(t,r,n)}(r,n,i))||this}return n=t,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);i.prototype.name=r.name,i.prototype.code=t,n[t]=i}function o(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}i("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(t,e,r){var n,i,a,s;if("string"===typeof e&&(i="not ",e.substr(!a||a<0?0:+a,i.length)===i)?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(n," ").concat(o(e,"type"));else{var u=function(t,e,r){return"number"!==typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";s='The "'.concat(t,'" ').concat(u," ").concat(n," ").concat(o(e,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=n},function(t,e,r){"use strict";(function(e){var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=h;var i=r(181),o=r(185);r(4)(h,i);for(var a=n(o.prototype),s=0;s=0}))},intToBuffer:function(t){var r=a(t);return new e(o(r.slice(2)),"hex")},getBinarySize:function(t){if("string"!==typeof t)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof t+"'.");return e.byteLength(t,"utf8")},isHexPrefixed:n,stripHexPrefix:i,padToEven:o,intToHex:a,fromAscii:function(t){for(var e="",r=0;r2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}i("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(t,e,r){var n,i,a,s;if("string"===typeof e&&(i="not ",e.substr(!a||a<0?0:+a,i.length)===i)?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(n," ").concat(o(e,"type"));else{var u=function(t,e,r){return"number"!==typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";s='The "'.concat(t,'" ').concat(u," ").concat(n," ").concat(o(e,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=n},function(t,e,r){"use strict";(function(e){var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=h;var i=r(208),o=r(212);r(4)(h,i);for(var a=n(o.prototype),s=0;s",'"',"`"," ","\r","\n","\t"]),f=["'"].concat(h),l=["%","/","?",";","#"].concat(f),c=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=r(262);function b(t,e,r){if(t&&i.isObject(t)&&t instanceof o)return t;var n=new o;return n.parse(t,e,r),n}o.prototype.parse=function(t,e,r){if(!i.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),s=-1!==o&&o127?B+="x":B+=C[I];if(!B.match(d)){var j=T.slice(0,x),U=T.slice(x+1),L=C.match(p);L&&(j.push(L[1]),U.unshift(L[2])),U.length&&(b="/"+U.join(".")+b),this.hostname=j.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=n.toASCII(this.hostname));var D=this.port?":"+this.port:"",q=this.hostname||"";this.host=q+D,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!m[_])for(x=0,P=f.length;x0)&&r.host.split("@"))&&(r.auth=R.shift(),r.host=r.hostname=R.shift());return r.search=t.search,r.query=t.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!k.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var A=k.slice(-1)[0],E=(r.host||t.host||k.length>1)&&("."===A||".."===A)||""===A,x=0,O=k.length;O>=0;O--)"."===(A=k[O])?k.splice(O,1):".."===A?(k.splice(O,1),x++):x&&(k.splice(O,1),x--);if(!M&&!_)for(;x--;x)k.unshift("..");!M||""===k[0]||k[0]&&"/"===k[0].charAt(0)||k.unshift(""),E&&"/"!==k.join("/").substr(-1)&&k.push("");var R,T=""===k[0]||k[0]&&"/"===k[0].charAt(0);S&&(r.hostname=r.host=T?"":k.length?k.shift():"",(R=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=R.shift(),r.host=r.hostname=R.shift()));return(M=M||r.host&&k.length)&&!T&&k.unshift(""),k.length?r.pathname=k.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var t=this.host,e=s.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},function(t,e,r){(e=t.exports=r(131)).Stream=e,e.Readable=e,e.Writable=r(88),e.Duplex=r(39),e.Transform=r(135),e.PassThrough=r(277)},function(t,e,r){function n(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===n(t)},e.isBoolean=function(t){return"boolean"===typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return"number"===typeof t},e.isString=function(t){return"string"===typeof t},e.isSymbol=function(t){return"symbol"===typeof t},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return"[object RegExp]"===n(t)},e.isObject=function(t){return"object"===typeof t&&null!==t},e.isDate=function(t){return"[object Date]"===n(t)},e.isError=function(t){return"[object Error]"===n(t)||t instanceof Error},e.isFunction=function(t){return"function"===typeof t},e.isPrimitive=function(t){return null===t||"boolean"===typeof t||"number"===typeof t||"string"===typeof t||"symbol"===typeof t||"undefined"===typeof t},e.isBuffer=r(2).Buffer.isBuffer},function(t,e,r){"use strict";var n=r(27),i=r(22);function o(){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}e.BlockHash=o,o.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o0&&t.topics.length!==n+1&&(e={anonymous:!0,inputs:[]})}var i=e.anonymous?t.topics:t.topics.slice(1);return r.returnValues=l.decodeLog(e.inputs,t.data,i),delete r.returnValues.__length__,r.event=e.name,r.signature=e.anonymous||!t.topics[0]?null:t.topics[0],r.raw={data:r.data,topics:r.topics},delete r.data,delete r.topics,r},c.prototype._encodeMethodABI=function(){var t=this._method.signature,e=this.arguments||[],r=!1,n=this._parent.options.jsonInterface.filter((function(e){return"constructor"===t&&e.type===t||(e.signature===t||e.signature===t.replace("0x","")||e.name===t)&&"function"===e.type})).map((function(t){var n=Array.isArray(t.inputs)?t.inputs.length:0;if(n!==e.length)throw new Error("The number of arguments is not matching the methods required number. You need to pass "+n+" arguments.");return"function"===t.type&&(r=t.signature),Array.isArray(t.inputs)?t.inputs:[]})).map((function(t){return l.encodeParameters(t,e).replace("0x","")}))[0]||"";if("constructor"===t){if(!this._deployData)throw new Error("The contract has no contract data option set. This is necessary to append the constructor parameters.");return this._deployData.startsWith("0x")||(this._deployData="0x"+this._deployData),this._deployData+n}var i=r?r+n:n;if(!i)throw new Error("Couldn't find a matching contract method named \""+this._method.name+'".');return i},c.prototype._decodeMethodReturn=function(t,e){if(!e)return null;e=e.length>=2?e.slice(2):e;var r=l.decodeParameters(t,e);return 1===r.__length__?r[0]:(delete r.__length__,r)},c.prototype.deploy=function(t,e){if((t=t||{}).arguments=t.arguments||[],!(t=this._getOrSetDefaultOptions(t)).data){if("function"===typeof e)return e(h.ContractMissingDeployDataError());throw h.ContractMissingDeployDataError()}var r=this.options.jsonInterface.find((function(t){return"constructor"===t.type}))||{};return r.signature="constructor",this._createTxObject.apply({method:r,parent:this,deployData:t.data,_ethAccounts:this.constructor._ethAccounts},t.arguments)},c.prototype._generateEventOptions=function(){var t=Array.prototype.slice.call(arguments),e=this._getCallback(t),r="object"===(!!t[t.length-1]&&typeof t[t.length-1])?t.pop():{},n="string"===typeof t[0]?t[0]:"allevents",i="allevents"===n.toLowerCase()?{name:"ALLEVENTS",jsonInterface:this.options.jsonInterface}:this.options.jsonInterface.find((function(t){return"event"===t.type&&(t.name===n||t.signature==="0x"+n.replace("0x",""))}));if(!i)throw h.ContractEventDoesNotExistError(n);if(!a.isAddress(this.options.address))throw h.ContractNoAddressDefinedError();return{params:this._encodeEventABI(i,r),event:i,callback:e}},c.prototype.clone=function(){return new this.constructor(this.options.jsonInterface,this.options.address,this.options)},c.prototype.once=function(t,e,r){var n=Array.prototype.slice.call(arguments);if(!(r=this._getCallback(n)))throw h.ContractOnceRequiresCallbackError();e&&delete e.fromBlock,this._on(t,e,(function(t,e,n){n.unsubscribe(),"function"===typeof r&&r(t,e,n)}))},c.prototype._on=function(){var t=this._generateEventOptions.apply(this,arguments);t.params&&t.params.toBlock&&(delete t.params.toBlock,console.warn("Invalid option: toBlock. Use getPastEvents for specific range.")),this._checkListener("newListener",t.event.name),this._checkListener("removeListener",t.event.name);var e=new s({subscription:{params:1,inputFormatter:[u.inputLogFormatter],outputFormatter:this._decodeEventABI.bind(t.event),subscriptionHandler:function(t){t.removed?this.emit("changed",t):this.emit("data",t),"function"===typeof this.callback&&this.callback(null,t,this)}},type:"eth",requestManager:this._requestManager});return e.subscribe("logs",t.params,t.callback||function(){}),e},c.prototype.getPastEvents=function(){var t=this._generateEventOptions.apply(this,arguments),e=new o({name:"getPastLogs",call:"eth_getLogs",params:1,inputFormatter:[u.inputLogFormatter],outputFormatter:this._decodeEventABI.bind(t.event)});e.setRequestManager(this._requestManager);var r=e.buildCall();return e=null,r(t.params,t.callback)},c.prototype._createTxObject=function(){var t=Array.prototype.slice.call(arguments),e={};if("function"===this.method.type&&(e.call=this.parent._executeMethod.bind(e,"call"),e.call.request=this.parent._executeMethod.bind(e,"call",!0)),e.send=this.parent._executeMethod.bind(e,"send"),e.send.request=this.parent._executeMethod.bind(e,"send",!0),e.encodeABI=this.parent._encodeMethodABI.bind(e),e.estimateGas=this.parent._executeMethod.bind(e,"estimate"),t&&this.method.inputs&&t.length!==this.method.inputs.length){if(this.nextMethod)return this.nextMethod.apply(null,t);throw h.InvalidNumberOfParams(t.length,this.method.inputs.length,this.method.name)}return e.arguments=t||[],e._method=this.method,e._parent=this.parent,e._ethAccounts=this.parent.constructor._ethAccounts||this._ethAccounts,this.deployData&&(e._deployData=this.deployData),e},c.prototype._processExecuteArguments=function(t,e){var r={};if(r.type=t.shift(),r.callback=this._parent._getCallback(t),"call"!==r.type||!0===t[t.length-1]||"string"!==typeof t[t.length-1]&&!isFinite(t[t.length-1])||(r.defaultBlock=t.pop()),r.options="object"===(!!t[t.length-1]&&typeof t[t.length-1])?t.pop():{},r.generateRequest=!0===t[t.length-1]&&t.pop(),r.options=this._parent._getOrSetDefaultOptions(r.options),r.options.data=this.encodeABI(),!this._deployData&&!a.isAddress(this._parent.options.address))throw h.ContractNoAddressDefinedError();return this._deployData||(r.options.to=this._parent.options.address),r.options.data?r:a._fireError(new Error("Couldn't find a matching contract method, or the number of parameters is wrong."),e.eventEmitter,e.reject,r.callback)},c.prototype._executeMethod=function(){var t=this,e=this._parent._processExecuteArguments.call(this,Array.prototype.slice.call(arguments),r),r=f("send"!==e.type),n=t.constructor._ethAccounts||t._ethAccounts;if(e.generateRequest){var i={params:[u.inputCallFormatter.call(this._parent,e.options)],callback:e.callback};return"call"===e.type?(i.params.push(u.inputDefaultBlockNumberFormatter.call(this._parent,e.defaultBlock)),i.method="eth_call",i.format=this._parent._decodeMethodReturn.bind(null,this._method.outputs)):i.method="eth_sendTransaction",i}switch(e.type){case"estimate":var s=new o({name:"estimateGas",call:"eth_estimateGas",params:1,inputFormatter:[u.inputCallFormatter],outputFormatter:a.hexToNumber,requestManager:t._parent._requestManager,accounts:n,defaultAccount:t._parent.defaultAccount,defaultBlock:t._parent.defaultBlock}).createFunction();return s(e.options,e.callback);case"call":var c=new o({name:"call",call:"eth_call",params:2,inputFormatter:[u.inputCallFormatter,u.inputDefaultBlockNumberFormatter],outputFormatter:function(e){return t._parent._decodeMethodReturn(t._method.outputs,e)},requestManager:t._parent._requestManager,accounts:n,defaultAccount:t._parent.defaultAccount,defaultBlock:t._parent.defaultBlock,handleRevert:t._parent.handleRevert,abiCoder:l}).createFunction();return c(e.options,e.defaultBlock,e.callback);case"send":if(!a.isAddress(e.options.from))return a._fireError(h.ContractNoFromAddressDefinedError(),r.eventEmitter,r.reject,e.callback);if("boolean"===typeof this._method.payable&&!this._method.payable&&e.options.value&&e.options.value>0)return a._fireError(new Error("Can not send value to non-payable contract method or constructor"),r.eventEmitter,r.reject,e.callback);var d={receiptFormatter:function(e){if(Array.isArray(e.logs)){var r=e.logs.map((function(e){return t._parent._decodeEventABI.call({name:"ALLEVENTS",jsonInterface:t._parent.options.jsonInterface},e)}));e.events={};var n=0;r.forEach((function(t){t.event?e.events[t.event]?Array.isArray(e.events[t.event])?e.events[t.event].push(t):e.events[t.event]=[e.events[t.event],t]:e.events[t.event]=t:(e.events[n]=t,n++)})),delete e.logs}return e},contractDeployFormatter:function(e){var r=t._parent.clone();return r.options.address=e.contractAddress,r}},p=new o({name:"sendTransaction",call:"eth_sendTransaction",params:1,inputFormatter:[u.inputTransactionFormatter],requestManager:t._parent._requestManager,accounts:t.constructor._ethAccounts||t._ethAccounts,defaultAccount:t._parent.defaultAccount,defaultBlock:t._parent.defaultBlock,transactionBlockTimeout:t._parent.transactionBlockTimeout,transactionConfirmationBlocks:t._parent.transactionConfirmationBlocks,transactionPollingTimeout:t._parent.transactionPollingTimeout,defaultCommon:t._parent.defaultCommon,defaultChain:t._parent.defaultChain,defaultHardfork:t._parent.defaultHardfork,handleRevert:t._parent.handleRevert,extraFormatters:d,abiCoder:l}).createFunction();return p(e.options,e.callback);default:throw new Error('Method "'+e.type+'" not implemented.')}},t.exports=c},function(t,e,r){"use strict";function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1?(t[r[0]]=t[r[0]]||{},t[r[0]][r[1]]=e):t[r[0]]=e},i.prototype.buildCall=function(){var t=this;return function(){t.subscriptions[arguments[0]]||console.warn("Subscription "+JSON.stringify(arguments[0])+" doesn't exist. Subscribing anyway.");var e=new n({subscription:t.subscriptions[arguments[0]]||{},requestManager:t.requestManager,type:t.type});return e.subscribe.apply(e,arguments)}},t.exports={subscriptions:i,subscription:n}},function(t,e,r){"use strict";var n=r(36),i=r(40),o=r(20),a=function(){var t=this;n.packageInit(this,arguments),[new i({name:"getId",call:"net_version",params:0,outputFormatter:parseInt}),new i({name:"isListening",call:"net_listening",params:0}),new i({name:"getPeerCount",call:"net_peerCount",params:0,outputFormatter:o.hexToNumber})].forEach((function(e){e.attachToObject(t),e.setRequestManager(t._requestManager)}))};n.addProviders(a),t.exports=a},function(t){t.exports=JSON.parse('{"identity":0,"ip4":4,"tcp":6,"sha1":17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,"dccp":33,"murmur3-128":34,"murmur3-32":35,"ip6":41,"ip6zone":42,"path":47,"multicodec":48,"multihash":49,"multiaddr":50,"multibase":51,"dns":53,"dns4":54,"dns6":55,"dnsaddr":56,"protobuf":80,"cbor":81,"raw":85,"dbl-sha2-256":86,"rlp":96,"bencode":99,"dag-pb":112,"dag-cbor":113,"libp2p-key":114,"git-raw":120,"torrent-info":123,"torrent-file":124,"leofcoin-block":129,"leofcoin-tx":130,"leofcoin-pr":131,"sctp":132,"eth-block":144,"eth-block-list":145,"eth-tx-trie":146,"eth-tx":147,"eth-tx-receipt-trie":148,"eth-tx-receipt":149,"eth-state-trie":150,"eth-account-snapshot":151,"eth-storage-trie":152,"bitcoin-block":176,"bitcoin-tx":177,"zcash-block":192,"zcash-tx":193,"stellar-block":208,"stellar-tx":209,"md4":212,"md5":213,"bmt":214,"decred-block":224,"decred-tx":225,"ipld-ns":226,"ipfs-ns":227,"swarm-ns":228,"ipns-ns":229,"zeronet":230,"ed25519-pub":237,"dash-block":240,"dash-tx":241,"swarm-manifest":250,"swarm-feed":251,"udp":273,"p2p-webrtc-star":275,"p2p-webrtc-direct":276,"p2p-stardust":277,"p2p-circuit":290,"dag-json":297,"udt":301,"utp":302,"unix":400,"p2p":421,"ipfs":421,"https":443,"onion":444,"onion3":445,"garlic64":446,"garlic32":447,"tls":448,"quic":460,"ws":477,"wss":478,"p2p-websocket-star":479,"http":480,"json":512,"messagepack":513,"x11":4352,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46000,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"holochain-adr-v0":8417572,"holochain-adr-v1":8483108,"holochain-key-v0":9728292,"holochain-key-v1":9793828,"holochain-sig-v0":10645796,"holochain-sig-v1":10711332}')},function(t,e,r){"use strict";e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=r(31),e.createHash=e.Hash=r(46),e.createHmac=e.Hmac=r(163);var n=r(375),i=Object.keys(n),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);e.getHashes=function(){return o};var a=r(166);e.pbkdf2=a.pbkdf2,e.pbkdf2Sync=a.pbkdf2Sync;var s=r(377);e.Cipher=s.Cipher,e.createCipher=s.createCipher,e.Cipheriv=s.Cipheriv,e.createCipheriv=s.createCipheriv,e.Decipher=s.Decipher,e.createDecipher=s.createDecipher,e.Decipheriv=s.Decipheriv,e.createDecipheriv=s.createDecipheriv,e.getCiphers=s.getCiphers,e.listCiphers=s.listCiphers;var u=r(392);e.DiffieHellmanGroup=u.DiffieHellmanGroup,e.createDiffieHellmanGroup=u.createDiffieHellmanGroup,e.getDiffieHellman=u.getDiffieHellman,e.createDiffieHellman=u.createDiffieHellman,e.DiffieHellman=u.DiffieHellman;var h=r(399);e.createSign=h.createSign,e.Sign=h.Sign,e.createVerify=h.createVerify,e.Verify=h.Verify,e.createECDH=r(434);var f=r(437);e.publicEncrypt=f.publicEncrypt,e.privateEncrypt=f.privateEncrypt,e.publicDecrypt=f.publicDecrypt,e.privateDecrypt=f.privateDecrypt;var l=r(441);e.randomFill=l.randomFill,e.randomFillSync=l.randomFillSync,e.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},function(t,e,r){var n=r(9).Buffer;function i(t){n.isBuffer(t)||(t=n.from(t));for(var e=t.length/4|0,r=new Array(e),i=0;i>>24]^f[p>>>16&255]^l[m>>>8&255]^c[255&v]^e[g++],a=h[p>>>24]^f[m>>>16&255]^l[v>>>8&255]^c[255&d]^e[g++],s=h[m>>>24]^f[v>>>16&255]^l[d>>>8&255]^c[255&p]^e[g++],u=h[v>>>24]^f[d>>>16&255]^l[p>>>8&255]^c[255&m]^e[g++],d=o,p=a,m=s,v=u;return o=(n[d>>>24]<<24|n[p>>>16&255]<<16|n[m>>>8&255]<<8|n[255&v])^e[g++],a=(n[p>>>24]<<24|n[m>>>16&255]<<16|n[v>>>8&255]<<8|n[255&d])^e[g++],s=(n[m>>>24]<<24|n[v>>>16&255]<<16|n[d>>>8&255]<<8|n[255&p])^e[g++],u=(n[v>>>24]<<24|n[d>>>16&255]<<16|n[p>>>8&255]<<8|n[255&m])^e[g++],[o>>>=0,a>>>=0,s>>>=0,u>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,u=0;u<256;++u){var h=s^s<<1^s<<2^s<<3^s<<4;h=h>>>8^255&h^99,r[a]=h,n[h]=a;var f=t[a],l=t[f],c=t[l],d=257*t[h]^16843008*h;i[0][a]=d<<24|d>>>8,i[1][a]=d<<16|d>>>16,i[2][a]=d<<8|d>>>24,i[3][a]=d,d=16843009*c^65537*l^257*f^16843008*a,o[0][h]=d<<24|d>>>8,o[1][h]=d<<16|d>>>16,o[2][h]=d<<8|d>>>24,o[3][h]=d,0===a?a=s=1:(a=f^t[t[t[c^f]]],s^=t[t[s]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function h(t){this._key=i(t),this._reset()}h.blockSize=16,h.keySize=32,h.prototype.blockSize=h.blockSize,h.prototype.keySize=h.keySize,h.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,n=4*(r+1),i=[],o=0;o>>24,a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a],a^=s[o/e|0]<<24):e>6&&o%e===4&&(a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a]),i[o]=i[o-e]^a}for(var h=[],f=0;f>>24]]^u.INV_SUB_MIX[1][u.SBOX[c>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[c>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&c]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=h},h.prototype.encryptBlockRaw=function(t){return a(t=i(t),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},h.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=n.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r},h.prototype.decryptBlock=function(t){var e=(t=i(t))[1];t[1]=t[3],t[3]=e;var r=a(t,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),o=n.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},h.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},t.exports.AES=h},function(t,e,r){var n=r(9).Buffer,i=r(95);t.exports=function(t,e,r,o){if(n.isBuffer(t)||(t=n.from(t,"binary")),e&&(n.isBuffer(e)||(e=n.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=r/8,s=n.alloc(a),u=n.alloc(o||0),h=n.alloc(0);a>0||o>0;){var f=new i;f.update(h),f.update(t),e&&f.update(e),h=f.digest();var l=0;if(a>0){var c=s.length-a;l=Math.min(a,h.length),h.copy(s,c,0,l),a-=l}if(l0){var d=u.length-o,p=Math.min(o,h.length-l);h.copy(u,d,l,l+p),o-=p}}return h.fill(0),{key:s,iv:u}}},function(t,e,r){"use strict";var n=r(30),i=r(23),o=i.getNAF,a=i.getJSF,s=i.assert;function u(t,e){this.type=t,this.p=new n(e.p,16),this.red=e.prime?n.red(e.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=e.n&&new n(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.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 r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function h(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(t,e){s(t.precomputed);var r=t._getDoubles(),n=o(e,1,this._bitLength),i=(1<=a;f--)u=(u<<1)+n[f];h.push(u)}for(var l=this.jpoint(null,null,null),c=this.jpoint(null,null,null),d=i;d>0;d--){for(a=0;a=0;h--){for(var f=0;h>=0&&0===a[h];h--)f++;if(h>=0&&f++,u=u.dblp(f),h<0)break;var l=a[h];s(0!==l),u="affine"===t.type?l>0?u.mixedAdd(i[l-1>>1]):u.mixedAdd(i[-l-1>>1].neg()):l>0?u.add(i[l-1>>1]):u.add(i[-l-1>>1].neg())}return"affine"===t.type?u.toP():u},u.prototype._wnafMulAdd=function(t,e,r,n,i){var s,u,h,f=this._wnafT1,l=this._wnafT2,c=this._wnafT3,d=0;for(s=0;s=1;s-=2){var m=s-1,v=s;if(1===f[m]&&1===f[v]){var g=[e[m],null,null,e[v]];0===e[m].y.cmp(e[v].y)?(g[1]=e[m].add(e[v]),g[2]=e[m].toJ().mixedAdd(e[v].neg())):0===e[m].y.cmp(e[v].y.redNeg())?(g[1]=e[m].toJ().mixedAdd(e[v]),g[2]=e[m].add(e[v].neg())):(g[1]=e[m].toJ().mixedAdd(e[v]),g[2]=e[m].toJ().mixedAdd(e[v].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],b=a(r[m],r[v]);for(d=Math.max(b[0].length,d),c[m]=new Array(d),c[v]=new Array(d),u=0;u=0;s--){for(var S=0;s>=0;){var A=!0;for(u=0;u=0&&S++,_=_.dblp(S),s<0)break;for(u=0;u0?h=l[u][E-1>>1]:E<0&&(h=l[u][-E-1>>1].neg()),_="affine"===h.type?_.mixedAdd(h):_.add(h))}}for(s=0;s=Math.ceil((t.bitLength()+1)/e.step)},h.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;ie.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(s=e.slice(n,l)).length)throw new Error("invalid rlp, List has a invalid length");for(;s.length;)u=a(s),h.push(u.data),s=u.remainder;return{data:h,remainder:e.slice(l)}}function s(t){return"0x"===t.slice(0,2)}function u(t){if(t<0)throw new Error("Invalid integer as argument, must be unsigned!");var e=t.toString(16);return e.length%2?"0"+e:e}function h(e){if(!t.isBuffer(e)){if("string"===typeof e)return s(e)?t.from((r="string"!==typeof(i=e)?i:s(i)?i.slice(2):i).length%2?"0"+r:r,"hex"):t.from(e);if("number"===typeof e||"bigint"===typeof e)return e?function(e){var r=u(e);return t.from(r,"hex")}(e):t.from([]);if(null===e||void 0===e)return t.from([]);if(e instanceof Uint8Array)return t.from(e);if(n.isBN(e))return t.from(e.toArray());throw new Error("invalid type")}var r,i;return e}e.encode=function e(r){if(Array.isArray(r)){for(var n=[],i=0;i=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function h(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=u(t,e,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(t.length-e)%2===0?e+1:e;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var f=["","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"],l=[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 d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var h=1;h>>26,l=67108863&u,c=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=c;d++){var p=h-d|0;f+=(a=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&a}r.words[h]=0|l,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?f[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=l[t],d=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:f[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n("undefined"!==typeof a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===e,h=new t(o),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),h[s]=a;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"===typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,v=0|a[2],g=8191&v,y=v>>>13,b=0|a[3],w=8191&b,M=b>>>13,_=0|a[4],k=8191&_,S=_>>>13,A=0|a[5],E=8191&A,x=A>>>13,O=0|a[6],R=8191&O,T=O>>>13,P=0|a[7],C=8191&P,B=P>>>13,I=0|a[8],N=8191&I,j=I>>>13,U=0|a[9],L=8191&U,D=U>>>13,q=0|s[0],F=8191&q,z=q>>>13,H=0|s[1],K=8191&H,Z=H>>>13,W=0|s[2],V=8191&W,G=W>>>13,J=0|s[3],X=8191&J,$=J>>>13,Y=0|s[4],Q=8191&Y,tt=Y>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ht=st>>>13,ft=0|s[8],lt=8191&ft,ct=ft>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(n=Math.imul(l,F))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;h=((o=Math.imul(c,z))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(h+(n=n+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,Z)|0)+Math.imul(c,K)|0))<<13)|0;h=((o=o+Math.imul(c,Z)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,F),i=(i=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,Z)|0;var yt=(h+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;h=((o=o+Math.imul(c,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,Z)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,Z)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(h+(n=n+Math.imul(l,X)|0)|0)+((8191&(i=(i=i+Math.imul(l,$)|0)+Math.imul(c,X)|0))<<13)|0;h=((o=o+Math.imul(c,$)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(k,F),i=(i=Math.imul(k,z))+Math.imul(S,F)|0,o=Math.imul(S,z),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(M,K)|0,o=o+Math.imul(M,Z)|0,n=n+Math.imul(g,V)|0,i=(i=i+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,$)|0;var wt=(h+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,z))+Math.imul(x,F)|0,o=Math.imul(x,z),n=n+Math.imul(k,K)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,n=n+Math.imul(g,X)|0,i=(i=i+Math.imul(g,$)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(h+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(c,rt)|0))<<13)|0;h=((o=o+Math.imul(c,nt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,F),i=(i=Math.imul(R,z))+Math.imul(T,F)|0,o=Math.imul(T,z),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,Z)|0,n=n+Math.imul(k,V)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,$)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var _t=(h+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,at)|0)+Math.imul(c,ot)|0))<<13)|0;h=((o=o+Math.imul(c,at)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,z))+Math.imul(B,F)|0,o=Math.imul(B,z),n=n+Math.imul(R,K)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(T,K)|0,o=o+Math.imul(T,Z)|0,n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,n=n+Math.imul(k,X)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,$)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var kt=(h+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(c,ut)|0))<<13)|0;h=((o=o+Math.imul(c,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(N,F),i=(i=Math.imul(N,z))+Math.imul(j,F)|0,o=Math.imul(j,z),n=n+Math.imul(C,K)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,G)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,$)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var St=(h+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;h=((o=o+Math.imul(c,ct)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(L,F),i=(i=Math.imul(L,z))+Math.imul(D,F)|0,o=Math.imul(D,z),n=n+Math.imul(N,K)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(j,K)|0,o=o+Math.imul(j,Z)|0,n=n+Math.imul(C,V)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(B,V)|0,o=o+Math.imul(B,G)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,$)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,$)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,at)|0,n=n+Math.imul(g,ut)|0,i=(i=i+Math.imul(g,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var At=(h+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;h=((o=o+Math.imul(c,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(L,K),i=(i=Math.imul(L,Z))+Math.imul(D,K)|0,o=Math.imul(D,Z),n=n+Math.imul(N,V)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,$)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,$)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,at)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,at)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ht)|0,n=n+Math.imul(g,lt)|0,i=(i=i+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var Et=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(L,V),i=(i=Math.imul(L,G))+Math.imul(D,V)|0,o=Math.imul(D,G),n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,$)|0)+Math.imul(j,X)|0,o=o+Math.imul(j,$)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,at)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ht)|0,n=n+Math.imul(w,lt)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var xt=(h+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(L,X),i=(i=Math.imul(L,$))+Math.imul(D,X)|0,o=Math.imul(D,$),n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,at)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ht)|0,n=n+Math.imul(k,lt)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(S,lt)|0,o=o+Math.imul(S,ct)|0;var Ot=(h+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;h=((o=o+Math.imul(M,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(L,Q),i=(i=Math.imul(L,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(N,rt)|0,i=(i=i+Math.imul(N,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,at)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,at)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ht)|0,n=n+Math.imul(E,lt)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Rt=(h+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,mt)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(L,rt),i=(i=Math.imul(L,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(N,ot)|0,i=(i=i+Math.imul(N,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,n=n+Math.imul(C,ut)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ht)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(T,lt)|0,o=o+Math.imul(T,ct)|0;var Tt=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((o=o+Math.imul(x,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(L,ot),i=(i=Math.imul(L,at))+Math.imul(D,ot)|0,o=Math.imul(D,at),n=n+Math.imul(N,ut)|0,i=(i=i+Math.imul(N,ht)|0)+Math.imul(j,ut)|0,o=o+Math.imul(j,ht)|0,n=n+Math.imul(C,lt)|0,i=(i=i+Math.imul(C,ct)|0)+Math.imul(B,lt)|0,o=o+Math.imul(B,ct)|0;var Pt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(T,pt)|0))<<13)|0;h=((o=o+Math.imul(T,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(L,ut),i=(i=Math.imul(L,ht))+Math.imul(D,ut)|0,o=Math.imul(D,ht),n=n+Math.imul(N,lt)|0,i=(i=i+Math.imul(N,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var Ct=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(B,pt)|0))<<13)|0;h=((o=o+Math.imul(B,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(L,lt),i=(i=Math.imul(L,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var Bt=(h+(n=n+Math.imul(N,pt)|0)|0)+((8191&(i=(i=i+Math.imul(N,mt)|0)+Math.imul(j,pt)|0))<<13)|0;h=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var It=(h+(n=Math.imul(L,pt))|0)+((8191&(i=(i=Math.imul(L,mt))+Math.imul(D,pt)|0))<<13)|0;return h=((o=Math.imul(D,mt))+(i>>>13)|0)+(It>>>26)|0,It&=67108863,u[0]=vt,u[1]=gt,u[2]=yt,u[3]=bt,u[4]=wt,u[5]=Mt,u[6]=_t,u[7]=kt,u[8]=St,u[9]=At,u[10]=Et,u[11]=xt,u[12]=Ot,u[13]=Rt,u[14]=Tt,u[15]=Pt,u[16]=Ct,u[17]=Bt,u[18]=It,0!==h&&(u[19]=h,r.length++),r};function m(t,e,r){return(new v).mulp(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(p=d),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):m(this,t,e),r},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},v.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,h=0;h=0&&(0!==f||h>=i);h--){var l=0|this.words[h];this.words[h]=f<<26-o|l>>>o,f=l&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"===typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var h=0;h=0;l--){var c=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(c=Math.min(c/a|0,67108863),n._ishlnsubmul(i,c,l);0!==n.negative;)c--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=c)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0===(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(l)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,f=1;0===(e.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(e.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,c=1;0===(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"===typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new k(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(b,y),b.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return g[t]=e,e},k.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,i),c=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=a;0!==d.cmp(s);){for(var m=d,v=0;0!==m.cmp(s);v++)m=m.redSqr();n(v=0;n--){for(var h=e.words[n],f=u-1;f>=0;f--){var l=h>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===n&&0===f)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},i(S,k),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(17)(t))},function(t,e,r){(function(t){var n=r(272),i=r(130),o=r(136),a=r(279),s=r(59),u=e;u.request=function(e,r){e="string"===typeof e?s.parse(e):o(e);var i=-1===t.location.protocol.search(/^https?:$/)?"http:":"",a=e.protocol||i,u=e.hostname||e.host,h=e.port,f=e.path||"/";u&&-1!==u.indexOf(":")&&(u="["+u+"]"),e.url=(u?a+"//"+u:"")+(h?":"+h:"")+f,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var l=new n(e);return r&&l.on("response",r),l},u.get=function(t,e){var r=u.request(t,e);return r.end(),r},u.ClientRequest=n,u.IncomingMessage=i.IncomingMessage,u.Agent=function(){},u.Agent.defaultMaxSockets=4,u.globalAgent=new u.Agent,u.STATUS_CODES=a,u.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,r(12))},function(t,e,r){"use strict";(function(e,n,i){var o=r(72);function a(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;t.entry=null;for(;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}t.exports=y;var s,u=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?n:o.nextTick;y.WritableState=g;var h=Object.create(r(61));h.inherits=r(4);var f={deprecate:r(73)},l=r(132),c=r(9).Buffer,d=i.Uint8Array||function(){};var p,m=r(133);function v(){}function g(t,e){s=s||r(39),t=t||{};var n=e instanceof s;this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,h=t.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(h||0===h)?h:f,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===t.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(o.nextTick(i,n),o.nextTick(S,t,e),t._writableState.errorEmitted=!0,t.emit("error",n)):(i(n),t._writableState.errorEmitted=!0,t.emit("error",n),S(t,e))}(t,r,n,e,i);else{var a=_(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||M(t,r),n?u(w,t,r,a,i):w(t,r,a,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function y(t){if(s=s||r(39),!p.call(y,this)&&!(this instanceof s))return new y(t);this._writableState=new g(t,this),this.writable=!0,t&&("function"===typeof t.write&&(this._write=t.write),"function"===typeof t.writev&&(this._writev=t.writev),"function"===typeof t.destroy&&(this._destroy=t.destroy),"function"===typeof t.final&&(this._final=t.final)),l.call(this)}function b(t,e,r,n,i,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function w(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),S(t,e)}function M(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var s=0,u=!0;r;)i[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;i.allBuffers=u,b(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new a(e),e.bufferedRequestCount=0}else{for(;r;){var h=r.chunk,f=r.encoding,l=r.callback;if(b(t,e,!1,e.objectMode?1:h.length,h,f,l),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function _(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function k(t,e){t._final((function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),S(t,e)}))}function S(t,e){var r=_(e);return r&&(!function(t,e){e.prefinished||e.finalCalled||("function"===typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(k,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),r}h.inherits(y,l),g.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(g.prototype,"buffer",{get:f.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"===typeof Symbol&&Symbol.hasInstance&&"function"===typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(t){return!!p.call(this,t)||this===y&&(t&&t._writableState instanceof g)}})):p=function(t){return t instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(t,e,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(n=t,c.isBuffer(n)||n instanceof d);return s&&!c.isBuffer(t)&&(t=function(t){return c.from(t)}(t)),"function"===typeof e&&(r=e,e=null),s?e="buffer":e||(e=i.defaultEncoding),"function"!==typeof r&&(r=v),i.ended?function(t,e){var r=new Error("write after end");t.emit("error",r),o.nextTick(e,r)}(this,r):(s||function(t,e,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"===typeof r||void 0===r||e.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(t.emit("error",a),o.nextTick(n,a),i=!1),i}(this,i,t,r))&&(i.pendingcb++,a=function(t,e,r,n,i,o){if(!r){var a=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!==typeof e||(e=c.from(e,r));return e}(e,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=e.objectMode?1:n.length;e.length+=s;var u=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(t,e,r){var n=this._writableState;"function"===typeof t?(r=t,t=null,e=null):"function"===typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(t,e,r){e.ending=!0,S(t,e),r&&(e.finished?o.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),y.prototype.destroy=m.destroy,y.prototype._undestroy=m.undestroy,y.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,r(11),r(134).setImmediate,r(12))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){this.listeners={}}return t.prototype.addEventListener=function(t,e){t=t.toLowerCase(),this.listeners[t]=this.listeners[t]||[],this.listeners[t].push(e.handleEvent||e)},t.prototype.removeEventListener=function(t,e){if(t=t.toLowerCase(),this.listeners[t]){var r=this.listeners[t].indexOf(e.handleEvent||e);r<0||this.listeners[t].splice(r,1)}},t.prototype.dispatchEvent=function(t){var e=t.type.toLowerCase();if(t.target=this,this.listeners[e])for(var r=0,n=this.listeners[e];r 2 bytes.");var r=o.decode(t);if(!e.isValidCode(r))throw new Error("multihash unknown function code: 0x".concat(r.toString(16)));t=t.slice(o.decode.bytes);var i=o.decode(t);if(i<0)throw new Error("multihash invalid length: ".concat(i));if((t=t.slice(o.decode.bytes)).length!==i)throw new Error("multihash length inconsistent: 0x".concat(t.toString("hex")));return{code:r,name:a.codes[r],length:i,digest:t}},e.encode=function(t,r,i){if(!t||void 0===r)throw new Error("multihash encode requires at least two args: digest, code");var a=e.coerceCode(r);if(!n.isBuffer(t))throw new Error("digest should be a Buffer");if(null==i&&(i=t.length),i&&t.length!==i)throw new Error("digest length should be equal to specified length.");return n.concat([n.from(o.encode(a)),n.from(o.encode(i)),t])},e.coerceCode=function(t){var r=t;if("string"===typeof t){if(void 0===a.names[t])throw new Error("Unrecognized hash function named: ".concat(t));r=a.names[t]}if("number"!==typeof r)throw new Error("Hash function code should be a number. Got: ".concat(r));if(void 0===a.codes[r]&&!e.isAppCode(r))throw new Error("Unrecognized function code: ".concat(r));return r},e.isAppCode=function(t){return t>0&&t<16},e.isValidCode=function(t){return!!e.isAppCode(t)||!!a.codes[t]},e.validate=s,e.prefix=function(t){return s(t),t.slice(0,2)}},function(t,e,r){var n=r(149);t.exports=function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&n(t,e)}},function(t,e,r){var n=r(345),i=r(150),o=r(346);t.exports=function(t){var e=i();return function(){var r,i=n(t);if(e){var a=n(this).constructor;r=Reflect.construct(i,arguments,a)}else r=i.apply(this,arguments);return o(this,r)}}},function(t,e,r){"use strict";var n=r(4),i=r(154),o=r(9).Buffer,a=new Array(16);function s(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function u(t,e){return t<>>32-e}function h(t,e,r,n,i,o,a){return u(t+(e&r|~e&n)+i+o|0,a)+e|0}function f(t,e,r,n,i,o,a){return u(t+(e&n|r&~n)+i+o|0,a)+e|0}function l(t,e,r,n,i,o,a){return u(t+(e^r^n)+i+o|0,a)+e|0}function c(t,e,r,n,i,o,a){return u(t+(r^(e|~n))+i+o|0,a)+e|0}n(s,i),s.prototype._update=function(){for(var t=a,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,o=this._d;r=h(r,n,i,o,t[0],3614090360,7),o=h(o,r,n,i,t[1],3905402710,12),i=h(i,o,r,n,t[2],606105819,17),n=h(n,i,o,r,t[3],3250441966,22),r=h(r,n,i,o,t[4],4118548399,7),o=h(o,r,n,i,t[5],1200080426,12),i=h(i,o,r,n,t[6],2821735955,17),n=h(n,i,o,r,t[7],4249261313,22),r=h(r,n,i,o,t[8],1770035416,7),o=h(o,r,n,i,t[9],2336552879,12),i=h(i,o,r,n,t[10],4294925233,17),n=h(n,i,o,r,t[11],2304563134,22),r=h(r,n,i,o,t[12],1804603682,7),o=h(o,r,n,i,t[13],4254626195,12),i=h(i,o,r,n,t[14],2792965006,17),r=f(r,n=h(n,i,o,r,t[15],1236535329,22),i,o,t[1],4129170786,5),o=f(o,r,n,i,t[6],3225465664,9),i=f(i,o,r,n,t[11],643717713,14),n=f(n,i,o,r,t[0],3921069994,20),r=f(r,n,i,o,t[5],3593408605,5),o=f(o,r,n,i,t[10],38016083,9),i=f(i,o,r,n,t[15],3634488961,14),n=f(n,i,o,r,t[4],3889429448,20),r=f(r,n,i,o,t[9],568446438,5),o=f(o,r,n,i,t[14],3275163606,9),i=f(i,o,r,n,t[3],4107603335,14),n=f(n,i,o,r,t[8],1163531501,20),r=f(r,n,i,o,t[13],2850285829,5),o=f(o,r,n,i,t[2],4243563512,9),i=f(i,o,r,n,t[7],1735328473,14),r=l(r,n=f(n,i,o,r,t[12],2368359562,20),i,o,t[5],4294588738,4),o=l(o,r,n,i,t[8],2272392833,11),i=l(i,o,r,n,t[11],1839030562,16),n=l(n,i,o,r,t[14],4259657740,23),r=l(r,n,i,o,t[1],2763975236,4),o=l(o,r,n,i,t[4],1272893353,11),i=l(i,o,r,n,t[7],4139469664,16),n=l(n,i,o,r,t[10],3200236656,23),r=l(r,n,i,o,t[13],681279174,4),o=l(o,r,n,i,t[0],3936430074,11),i=l(i,o,r,n,t[3],3572445317,16),n=l(n,i,o,r,t[6],76029189,23),r=l(r,n,i,o,t[9],3654602809,4),o=l(o,r,n,i,t[12],3873151461,11),i=l(i,o,r,n,t[15],530742520,16),r=c(r,n=l(n,i,o,r,t[2],3299628645,23),i,o,t[0],4096336452,6),o=c(o,r,n,i,t[7],1126891415,10),i=c(i,o,r,n,t[14],2878612391,15),n=c(n,i,o,r,t[5],4237533241,21),r=c(r,n,i,o,t[12],1700485571,6),o=c(o,r,n,i,t[3],2399980690,10),i=c(i,o,r,n,t[10],4293915773,15),n=c(n,i,o,r,t[1],2240044497,21),r=c(r,n,i,o,t[8],1873313359,6),o=c(o,r,n,i,t[15],4264355552,10),i=c(i,o,r,n,t[6],2734768916,15),n=c(n,i,o,r,t[13],1309151649,21),r=c(r,n,i,o,t[4],4149444226,6),o=c(o,r,n,i,t[11],3174756917,10),i=c(i,o,r,n,t[2],718787259,15),n=c(n,i,o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},s.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 t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=s},function(t,e,r){"use strict";var n=r(47).codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,r,o){if("function"===typeof r)return t(e,null,r);r||(r={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i>>32-e}function m(t,e,r,n,i,o,a,s){return p(t+(e^r^n)+o+a|0,s)+i|0}function v(t,e,r,n,i,o,a,s){return p(t+(e&r|~e&n)+o+a|0,s)+i|0}function g(t,e,r,n,i,o,a,s){return p(t+((e|~r)^n)+o+a|0,s)+i|0}function y(t,e,r,n,i,o,a,s){return p(t+(e&n|r&~n)+o+a|0,s)+i|0}function b(t,e,r,n,i,o,a,s){return p(t+(e^(r|~n))+o+a|0,s)+i|0}i(d,o),d.prototype._update=function(){for(var t=a,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,d=0|this._e,w=0|this._a,M=0|this._b,_=0|this._c,k=0|this._d,S=0|this._e,A=0;A<80;A+=1){var E,x;A<16?(E=m(r,n,i,o,d,t[s[A]],l[0],h[A]),x=b(w,M,_,k,S,t[u[A]],c[0],f[A])):A<32?(E=v(r,n,i,o,d,t[s[A]],l[1],h[A]),x=y(w,M,_,k,S,t[u[A]],c[1],f[A])):A<48?(E=g(r,n,i,o,d,t[s[A]],l[2],h[A]),x=g(w,M,_,k,S,t[u[A]],c[2],f[A])):A<64?(E=y(r,n,i,o,d,t[s[A]],l[3],h[A]),x=v(w,M,_,k,S,t[u[A]],c[3],f[A])):(E=b(r,n,i,o,d,t[s[A]],l[4],h[A]),x=m(w,M,_,k,S,t[u[A]],c[4],f[A])),r=d,d=o,o=p(i,10),i=n,n=E,w=S,S=k,k=p(_,10),_=M,M=x}var O=this._b+i+k|0;this._b=this._c+o+S|0,this._c=this._d+d+w|0,this._d=this._e+r+M|0,this._e=this._a+n+_|0,this._a=O},d.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 t=n.alloc?n.alloc(20):new n(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=d},function(t,e,r){(e=t.exports=function(t){t=t.toLowerCase();var r=e[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r}).sha=r(365),e.sha1=r(366),e.sha224=r(367),e.sha256=r(161),e.sha384=r(368),e.sha512=r(162)},function(t,e,r){"use strict";var n=r(22);function i(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}t.exports=i,i.prototype._init=function(){},i.prototype.update=function(t){return 0===t.length?[]:"decrypt"===this.type?this._updateDecrypt(t):this._updateEncrypt(t)},i.prototype._buffer=function(t,e){for(var r=Math.min(this.buffer.length-this.bufferOff,t.length-e),n=0;n0;n--)e+=this._buffer(t,e),r+=this._flushBuffer(i,r);return e+=this._buffer(t,e),i},i.prototype.final=function(t){var e,r;return t&&(e=this.update(t)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(r):r},i.prototype._pad=function(t,e){if(0===e)return!1;for(;e=0||!e.umod(t.prime1)||!e.umod(t.prime2));return e}function a(t,r){var i=function(t){var e=o(t);return{blinder:e.toRed(n.mont(t.modulus)).redPow(new n(t.publicExponent)).fromRed(),unblinder:e.invm(t.modulus)}}(r),a=r.modulus.byteLength(),s=new n(t).mul(i.blinder).umod(r.modulus),u=s.toRed(n.mont(r.prime1)),h=s.toRed(n.mont(r.prime2)),f=r.coefficient,l=r.prime1,c=r.prime2,d=u.redPow(r.exponent1).fromRed(),p=h.redPow(r.exponent2).fromRed(),m=d.isub(p).imul(f).umod(l).imul(c);return p.iadd(m).imul(i.unblinder).umod(r.modulus).toArrayLike(e,"be",a)}a.getr=o,t.exports=a}).call(this,r(2).Buffer)},function(t,e,r){"use strict";var n,i=e,o=r(21),a=r(188),s=r(23).assert;function u(t){"short"===t.type?this.curve=new a.short(t):"edwards"===t.type?this.curve=new a.edwards(t):this.curve=new a.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function h(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new u(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,h("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"]}),h("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"]}),h("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"]}),h("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"]}),h("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"]}),h("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"]}),h("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{n=r(415)}catch(f){n=void 0}h("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",n]})},function(t,e,r){"use strict";(function(e){var n,i=r(2),o=i.Buffer,a={};for(n in i)i.hasOwnProperty(n)&&"SlowBuffer"!==n&&"Buffer"!==n&&(a[n]=i[n]);var s=a.Buffer={};for(n in o)o.hasOwnProperty(n)&&"allocUnsafe"!==n&&"allocUnsafeSlow"!==n&&(s[n]=o[n]);if(a.Buffer.prototype=o.prototype,s.from&&s.from!==Uint8Array.from||(s.from=function(t,e,r){if("number"===typeof t)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof t);if(t&&"undefined"===typeof t.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);return o(t,e,r)}),s.alloc||(s.alloc=function(t,e,r){if("number"!==typeof t)throw new TypeError('The "size" argument must be of type number. Received type '+typeof t);if(t<0||t>=2*(1<<30))throw new RangeError('The value "'+t+'" is invalid for option "size"');var n=o(t);return e&&0!==e.length?"string"===typeof r?n.fill(e,r):n.fill(e):n.fill(0),n}),!a.kStringMaxLength)try{a.kStringMaxLength=e.binding("buffer").kStringMaxLength}catch(u){}a.constants||(a.constants={MAX_LENGTH:a.kMaxLength},a.kStringMaxLength&&(a.constants.MAX_STRING_LENGTH=a.kStringMaxLength)),t.exports=a}).call(this,r(11))},function(t,e,r){"use strict";var n=r(109).Reporter,i=r(67).EncoderBuffer,o=r(67).DecoderBuffer,a=r(22),s=["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"],u=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(s);function h(t,e,r){var n={};this._baseState=n,n.name=r,n.enc=t,n.parent=e||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}t.exports=h;var f=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];h.prototype.clone=function(){var t=this._baseState,e={};f.forEach((function(r){e[r]=t[r]}));var r=new this.constructor(e.parent);return r._baseState=e,r},h.prototype._wrap=function(){var t=this._baseState;u.forEach((function(e){this[e]=function(){var r=new this.constructor(this);return t.children.push(r),r[e].apply(r,arguments)}}),this)},h.prototype._init=function(t){var e=this._baseState;a(null===e.parent),t.call(this),e.children=e.children.filter((function(t){return t._baseState.parent===this}),this),a.equal(e.children.length,1,"Root node can have only one child")},h.prototype._useArgs=function(t){var e=this._baseState,r=t.filter((function(t){return t instanceof this.constructor}),this);t=t.filter((function(t){return!(t instanceof this.constructor)}),this),0!==r.length&&(a(null===e.children),e.children=r,r.forEach((function(t){t._baseState.parent=this}),this)),0!==t.length&&(a(null===e.args),e.args=t,e.reverseArgs=t.map((function(t){if("object"!==typeof t||t.constructor!==Object)return t;var e={};return Object.keys(t).forEach((function(r){r==(0|r)&&(r|=0);var n=t[r];e[n]=r})),e})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(t){h.prototype[t]=function(){var e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}})),s.forEach((function(t){h.prototype[t]=function(){var e=this._baseState,r=Array.prototype.slice.call(arguments);return a(null===e.tag),e.tag=t,this._useArgs(r),this}})),h.prototype.use=function(t){a(t);var e=this._baseState;return a(null===e.use),e.use=t,this},h.prototype.optional=function(){return this._baseState.optional=!0,this},h.prototype.def=function(t){var e=this._baseState;return a(null===e.default),e.default=t,e.optional=!0,this},h.prototype.explicit=function(t){var e=this._baseState;return a(null===e.explicit&&null===e.implicit),e.explicit=t,this},h.prototype.implicit=function(t){var e=this._baseState;return a(null===e.explicit&&null===e.implicit),e.implicit=t,this},h.prototype.obj=function(){var t=this._baseState,e=Array.prototype.slice.call(arguments);return t.obj=!0,0!==e.length&&this._useArgs(e),this},h.prototype.key=function(t){var e=this._baseState;return a(null===e.key),e.key=t,this},h.prototype.any=function(){return this._baseState.any=!0,this},h.prototype.choice=function(t){var e=this._baseState;return a(null===e.choice),e.choice=t,this._useArgs(Object.keys(t).map((function(e){return t[e]}))),this},h.prototype.contains=function(t){var e=this._baseState;return a(null===e.use),e.contains=t,this},h.prototype._decode=function(t,e){var r=this._baseState;if(null===r.parent)return t.wrapResult(r.children[0]._decode(t,e));var n,i=r.default,a=!0,s=null;if(null!==r.key&&(s=t.enterKey(r.key)),r.optional){var u=null;if(null!==r.explicit?u=r.explicit:null!==r.implicit?u=r.implicit:null!==r.tag&&(u=r.tag),null!==u||r.any){if(a=this._peekTag(t,u,r.any),t.isError(a))return a}else{var h=t.save();try{null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e),a=!0}catch(m){a=!1}t.restore(h)}}if(r.obj&&a&&(n=t.enterObject()),a){if(null!==r.explicit){var f=this._decodeTag(t,r.explicit);if(t.isError(f))return f;t=f}var l=t.offset;if(null===r.use&&null===r.choice){var c;r.any&&(c=t.save());var d=this._decodeTag(t,null!==r.implicit?r.implicit:r.tag,r.any);if(t.isError(d))return d;r.any?i=t.raw(c):t=d}if(e&&e.track&&null!==r.tag&&e.track(t.path(),l,t.length,"tagged"),e&&e.track&&null!==r.tag&&e.track(t.path(),t.offset,t.length,"content"),r.any||(i=null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e)),t.isError(i))return i;if(r.any||null!==r.choice||null===r.children||r.children.forEach((function(r){r._decode(t,e)})),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){var p=new o(i);i=this._getUse(r.contains,t._reporterState.obj)._decode(p,e)}}return r.obj&&a&&(i=t.leaveObject(n)),null===r.key||null===i&&!0!==a?null!==s&&t.exitKey(s):t.leaveKey(s,r.key,i),i},h.prototype._decodeGeneric=function(t,e,r){var n=this._baseState;return"seq"===t||"set"===t?null:"seqof"===t||"setof"===t?this._decodeList(e,t,n.args[0],r):/str$/.test(t)?this._decodeStr(e,t,r):"objid"===t&&n.args?this._decodeObjid(e,n.args[0],n.args[1],r):"objid"===t?this._decodeObjid(e,null,null,r):"gentime"===t||"utctime"===t?this._decodeTime(e,t,r):"null_"===t?this._decodeNull(e,r):"bool"===t?this._decodeBool(e,r):"objDesc"===t?this._decodeStr(e,t,r):"int"===t||"enum"===t?this._decodeInt(e,n.args&&n.args[0],r):null!==n.use?this._getUse(n.use,e._reporterState.obj)._decode(e,r):e.error("unknown tag: "+t)},h.prototype._getUse=function(t,e){var r=this._baseState;return r.useDecoder=this._use(t,e),a(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},h.prototype._decodeChoice=function(t,e){var r=this._baseState,n=null,i=!1;return Object.keys(r.choice).some((function(o){var a=t.save(),s=r.choice[o];try{var u=s._decode(t,e);if(t.isError(u))return!1;n={type:o,value:u},i=!0}catch(h){return t.restore(a),!1}return!0}),this),i?n:t.error("Choice not matched")},h.prototype._createEncoderBuffer=function(t){return new i(t,this.reporter)},h.prototype._encode=function(t,e,r){var n=this._baseState;if(null===n.default||n.default!==t){var i=this._encodeValue(t,e,r);if(void 0!==i&&!this._skipDefault(i,e,r))return i}},h.prototype._encodeValue=function(t,e,r){var i=this._baseState;if(null===i.parent)return i.children[0]._encode(t,e||new n);var o=null;if(this.reporter=e,i.optional&&void 0===t){if(null===i.default)return;t=i.default}var a=null,s=!1;if(i.any)o=this._createEncoderBuffer(t);else if(i.choice)o=this._encodeChoice(t,e);else if(i.contains)a=this._getUse(i.contains,r)._encode(t,e),s=!0;else if(i.children)a=i.children.map((function(r){if("null_"===r._baseState.tag)return r._encode(null,e,t);if(null===r._baseState.key)return e.error("Child should have a key");var n=e.enterKey(r._baseState.key);if("object"!==typeof t)return e.error("Child expected, but input is not object");var i=r._encode(t[r._baseState.key],e,t);return e.leaveKey(n),i}),this).filter((function(t){return t})),a=this._createEncoderBuffer(a);else if("seqof"===i.tag||"setof"===i.tag){if(!i.args||1!==i.args.length)return e.error("Too many args for : "+i.tag);if(!Array.isArray(t))return e.error("seqof/setof, but data is not Array");var u=this.clone();u._baseState.implicit=null,a=this._createEncoderBuffer(t.map((function(r){var n=this._baseState;return this._getUse(n.args[0],t)._encode(r,e)}),u))}else null!==i.use?o=this._getUse(i.use,r)._encode(t,e):(a=this._encodePrimitive(i.tag,t),s=!0);if(!i.any&&null===i.choice){var h=null!==i.implicit?i.implicit:i.tag,f=null===i.implicit?"universal":"context";null===h?null===i.use&&e.error("Tag could be omitted only for .use()"):null===i.use&&(o=this._encodeComposite(h,s,f,a))}return null!==i.explicit&&(o=this._encodeComposite(i.explicit,!1,"context",o)),o},h.prototype._encodeChoice=function(t,e){var r=this._baseState,n=r.choice[t.type];return n||a(!1,t.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(t.value,e)},h.prototype._encodePrimitive=function(t,e){var r=this._baseState;if(/str$/.test(t))return this._encodeStr(e,t);if("objid"===t&&r.args)return this._encodeObjid(e,r.reverseArgs[0],r.args[1]);if("objid"===t)return this._encodeObjid(e,null,null);if("gentime"===t||"utctime"===t)return this._encodeTime(e,t);if("null_"===t)return this._encodeNull();if("int"===t||"enum"===t)return this._encodeInt(e,r.args&&r.reverseArgs[0]);if("bool"===t)return this._encodeBool(e);if("objDesc"===t)return this._encodeStr(e,t);throw new Error("Unsupported tag: "+t)},h.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},h.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(t)}},function(t,e,r){"use strict";var n=r(4);function i(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}function o(t,e){this.path=t,this.rethrow(e)}e.Reporter=i,i.prototype.isError=function(t){return t instanceof o},i.prototype.save=function(){var t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},i.prototype.restore=function(t){var e=this._reporterState;e.obj=t.obj,e.path=e.path.slice(0,t.pathLen)},i.prototype.enterKey=function(t){return this._reporterState.path.push(t)},i.prototype.exitKey=function(t){var e=this._reporterState;e.path=e.path.slice(0,t-1)},i.prototype.leaveKey=function(t,e,r){var n=this._reporterState;this.exitKey(t),null!==n.obj&&(n.obj[e]=r)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){var t=this._reporterState,e=t.obj;return t.obj={},e},i.prototype.leaveObject=function(t){var e=this._reporterState,r=e.obj;return e.obj=t,r},i.prototype.error=function(t){var e,r=this._reporterState,n=t instanceof o;if(e=n?t:new o(r.path.map((function(t){return"["+JSON.stringify(t)+"]"})).join(""),t.message||t,t.stack),!r.options.partial)throw e;return n||r.errors.push(e),e},i.prototype.wrapResult=function(t){var e=this._reporterState;return e.options.partial?{result:this.isError(t)?null:t,errors:e.errors}:t},n(o,Error),o.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},function(t,e,r){"use strict";function n(t){var e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);var n=t[r];e[n]=r})),e}e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=n(e.tagClass),e.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"},e.tagByName=n(e.tag)},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"===typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(439).Buffer}catch(A){}function s(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function h(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=u(t,e,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(t.length-e)%2===0?e+1:e;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var f=["","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"],l=[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 d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var h=1;h>>26,l=67108863&u,c=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=c;d++){var p=h-d|0;f+=(a=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&a}r.words[h]=0|l,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?f[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=l[t],d=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:f[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n("undefined"!==typeof a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===e,h=new t(o),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),h[s]=a;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"===typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,v=0|a[2],g=8191&v,y=v>>>13,b=0|a[3],w=8191&b,M=b>>>13,_=0|a[4],k=8191&_,S=_>>>13,A=0|a[5],E=8191&A,x=A>>>13,O=0|a[6],R=8191&O,T=O>>>13,P=0|a[7],C=8191&P,B=P>>>13,I=0|a[8],N=8191&I,j=I>>>13,U=0|a[9],L=8191&U,D=U>>>13,q=0|s[0],F=8191&q,z=q>>>13,H=0|s[1],K=8191&H,Z=H>>>13,W=0|s[2],V=8191&W,G=W>>>13,J=0|s[3],X=8191&J,$=J>>>13,Y=0|s[4],Q=8191&Y,tt=Y>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ht=st>>>13,ft=0|s[8],lt=8191&ft,ct=ft>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(n=Math.imul(l,F))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;h=((o=Math.imul(c,z))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(h+(n=n+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,Z)|0)+Math.imul(c,K)|0))<<13)|0;h=((o=o+Math.imul(c,Z)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,F),i=(i=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,Z)|0;var yt=(h+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;h=((o=o+Math.imul(c,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,Z)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,Z)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(h+(n=n+Math.imul(l,X)|0)|0)+((8191&(i=(i=i+Math.imul(l,$)|0)+Math.imul(c,X)|0))<<13)|0;h=((o=o+Math.imul(c,$)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(k,F),i=(i=Math.imul(k,z))+Math.imul(S,F)|0,o=Math.imul(S,z),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(M,K)|0,o=o+Math.imul(M,Z)|0,n=n+Math.imul(g,V)|0,i=(i=i+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,$)|0;var wt=(h+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,z))+Math.imul(x,F)|0,o=Math.imul(x,z),n=n+Math.imul(k,K)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,n=n+Math.imul(g,X)|0,i=(i=i+Math.imul(g,$)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(h+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(c,rt)|0))<<13)|0;h=((o=o+Math.imul(c,nt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,F),i=(i=Math.imul(R,z))+Math.imul(T,F)|0,o=Math.imul(T,z),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,Z)|0,n=n+Math.imul(k,V)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,$)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var _t=(h+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,at)|0)+Math.imul(c,ot)|0))<<13)|0;h=((o=o+Math.imul(c,at)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,z))+Math.imul(B,F)|0,o=Math.imul(B,z),n=n+Math.imul(R,K)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(T,K)|0,o=o+Math.imul(T,Z)|0,n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,n=n+Math.imul(k,X)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,$)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var kt=(h+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(c,ut)|0))<<13)|0;h=((o=o+Math.imul(c,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(N,F),i=(i=Math.imul(N,z))+Math.imul(j,F)|0,o=Math.imul(j,z),n=n+Math.imul(C,K)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,G)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,$)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var St=(h+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;h=((o=o+Math.imul(c,ct)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(L,F),i=(i=Math.imul(L,z))+Math.imul(D,F)|0,o=Math.imul(D,z),n=n+Math.imul(N,K)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(j,K)|0,o=o+Math.imul(j,Z)|0,n=n+Math.imul(C,V)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(B,V)|0,o=o+Math.imul(B,G)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,$)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,$)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,at)|0,n=n+Math.imul(g,ut)|0,i=(i=i+Math.imul(g,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var At=(h+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;h=((o=o+Math.imul(c,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(L,K),i=(i=Math.imul(L,Z))+Math.imul(D,K)|0,o=Math.imul(D,Z),n=n+Math.imul(N,V)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,$)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,$)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,at)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,at)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ht)|0,n=n+Math.imul(g,lt)|0,i=(i=i+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var Et=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(L,V),i=(i=Math.imul(L,G))+Math.imul(D,V)|0,o=Math.imul(D,G),n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,$)|0)+Math.imul(j,X)|0,o=o+Math.imul(j,$)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,at)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ht)|0,n=n+Math.imul(w,lt)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var xt=(h+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(L,X),i=(i=Math.imul(L,$))+Math.imul(D,X)|0,o=Math.imul(D,$),n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,at)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ht)|0,n=n+Math.imul(k,lt)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(S,lt)|0,o=o+Math.imul(S,ct)|0;var Ot=(h+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;h=((o=o+Math.imul(M,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(L,Q),i=(i=Math.imul(L,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(N,rt)|0,i=(i=i+Math.imul(N,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,at)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,at)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ht)|0,n=n+Math.imul(E,lt)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Rt=(h+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,mt)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(L,rt),i=(i=Math.imul(L,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(N,ot)|0,i=(i=i+Math.imul(N,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,n=n+Math.imul(C,ut)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ht)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(T,lt)|0,o=o+Math.imul(T,ct)|0;var Tt=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((o=o+Math.imul(x,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(L,ot),i=(i=Math.imul(L,at))+Math.imul(D,ot)|0,o=Math.imul(D,at),n=n+Math.imul(N,ut)|0,i=(i=i+Math.imul(N,ht)|0)+Math.imul(j,ut)|0,o=o+Math.imul(j,ht)|0,n=n+Math.imul(C,lt)|0,i=(i=i+Math.imul(C,ct)|0)+Math.imul(B,lt)|0,o=o+Math.imul(B,ct)|0;var Pt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(T,pt)|0))<<13)|0;h=((o=o+Math.imul(T,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(L,ut),i=(i=Math.imul(L,ht))+Math.imul(D,ut)|0,o=Math.imul(D,ht),n=n+Math.imul(N,lt)|0,i=(i=i+Math.imul(N,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var Ct=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(B,pt)|0))<<13)|0;h=((o=o+Math.imul(B,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(L,lt),i=(i=Math.imul(L,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var Bt=(h+(n=n+Math.imul(N,pt)|0)|0)+((8191&(i=(i=i+Math.imul(N,mt)|0)+Math.imul(j,pt)|0))<<13)|0;h=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var It=(h+(n=Math.imul(L,pt))|0)+((8191&(i=(i=Math.imul(L,mt))+Math.imul(D,pt)|0))<<13)|0;return h=((o=Math.imul(D,mt))+(i>>>13)|0)+(It>>>26)|0,It&=67108863,u[0]=vt,u[1]=gt,u[2]=yt,u[3]=bt,u[4]=wt,u[5]=Mt,u[6]=_t,u[7]=kt,u[8]=St,u[9]=At,u[10]=Et,u[11]=xt,u[12]=Ot,u[13]=Rt,u[14]=Tt,u[15]=Pt,u[16]=Ct,u[17]=Bt,u[18]=It,0!==h&&(u[19]=h,r.length++),r};function m(t,e,r){return(new v).mulp(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(p=d),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):m(this,t,e),r},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},v.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,h=0;h=0&&(0!==f||h>=i);h--){var l=0|this.words[h];this.words[h]=f<<26-o|l>>>o,f=l&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"===typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var h=0;h=0;l--){var c=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(c=Math.min(c/a|0,67108863),n._ishlnsubmul(i,c,l);0!==n.negative;)c--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=c)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0===(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(l)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,f=1;0===(e.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(e.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,c=1;0===(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"===typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new k(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(b,y),b.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return g[t]=e,e},k.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,i),c=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=a;0!==d.cmp(s);){for(var m=d,v=0;0!==m.cmp(s);v++)m=m.redSqr();n(v=0;n--){for(var h=e.words[n],f=u-1;f>=0;f--){var l=h>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===n&&0===f)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},i(S,k),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(17)(t))},function(t,e,r){"use strict";(function(e){var n=r(45);function i(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i=0;h--)if(f[h]!==l[h])return!1;for(h=f.length-1;h>=0;h--)if(!b(t[s=f[h]],e[s],r,n))return!1;return!0}(t,e,r,n))}return r?t===e:t==e}function w(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function M(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(r){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function _(t,e,r,n){var i;if("function"!==typeof e)throw new TypeError('"block" argument must be a function');"string"===typeof r&&(n=r,r=null),i=function(t){var e;try{t()}catch(r){e=r}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&g(i,r,"Missing expected exception"+n);var o="string"===typeof n,s=!t&&i&&!r;if((!t&&a.isError(i)&&o&&M(i,r)||s)&&g(i,r,"Got unwanted exception"+n),t&&i&&r&&!M(i,r)||!t&&i)throw i}c.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return m(v(t.actual),128)+" "+t.operator+" "+m(v(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=p(e),o=n.indexOf("\n"+i);if(o>=0){var a=n.indexOf("\n",o+1);n=n.substring(a+1)}this.stack=n}}},a.inherits(c.AssertionError,Error),c.fail=g,c.ok=y,c.equal=function(t,e,r){t!=e&&g(t,e,r,"==",c.equal)},c.notEqual=function(t,e,r){t==e&&g(t,e,r,"!=",c.notEqual)},c.deepEqual=function(t,e,r){b(t,e,!1)||g(t,e,r,"deepEqual",c.deepEqual)},c.deepStrictEqual=function(t,e,r){b(t,e,!0)||g(t,e,r,"deepStrictEqual",c.deepStrictEqual)},c.notDeepEqual=function(t,e,r){b(t,e,!1)&&g(t,e,r,"notDeepEqual",c.notDeepEqual)},c.notDeepStrictEqual=function t(e,r,n){b(e,r,!0)&&g(e,r,n,"notDeepStrictEqual",t)},c.strictEqual=function(t,e,r){t!==e&&g(t,e,r,"===",c.strictEqual)},c.notStrictEqual=function(t,e,r){t===e&&g(t,e,r,"!==",c.notStrictEqual)},c.throws=function(t,e,r){_(!0,t,e,r)},c.doesNotThrow=function(t,e,r){_(!1,t,e,r)},c.ifError=function(t){if(t)throw t},c.strict=n((function t(e,r){e||g(e,!0,r,"==",t)}),c,{equal:c.strictEqual,deepEqual:c.deepStrictEqual,notEqual:c.notStrictEqual,notDeepEqual:c.notDeepStrictEqual}),c.strict.strict=c.strict;var k=Object.keys||function(t){var e=[];for(var r in t)s.call(t,r)&&e.push(r);return e}}).call(this,r(12))},function(t,e,r){"use strict";(function(t){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.rlphash=e.ripemd160FromArray=e.ripemd160FromString=e.ripemd160=e.sha256FromArray=e.sha256FromString=e.sha256=e.keccakFromArray=e.keccakFromHexString=e.keccakFromString=e.keccak256=e.keccak=void 0;var a=r(456),s=r(46),u=o(r(83)),h=r(42),f=r(84);e.keccak=function(t,e){switch(void 0===e&&(e=256),f.assertIsBuffer(t),e){case 224:return a.keccak224(t);case 256:return a.keccak256(t);case 384:return a.keccak384(t);case 512:return a.keccak512(t);default:throw new Error("Invald algorithm: keccak"+e)}},e.keccak256=function(t){return e.keccak(t)},e.keccakFromString=function(r,n){void 0===n&&(n=256),f.assertIsString(r);var i=t.from(r,"utf8");return e.keccak(i,n)},e.keccakFromHexString=function(t,r){return void 0===r&&(r=256),f.assertIsHexString(t),e.keccak(h.toBuffer(t),r)},e.keccakFromArray=function(t,r){return void 0===r&&(r=256),f.assertIsArray(t),e.keccak(h.toBuffer(t),r)};var l=function(t){return t=h.toBuffer(t),s("sha256").update(t).digest()};e.sha256=function(t){return f.assertIsBuffer(t),l(t)},e.sha256FromString=function(t){return f.assertIsString(t),l(t)},e.sha256FromArray=function(t){return f.assertIsArray(t),l(t)};var c=function(t,e){t=h.toBuffer(t);var r=s("rmd160").update(t).digest();return!0===e?h.setLengthLeft(r,32):r};e.ripemd160=function(t,e){return f.assertIsBuffer(t),c(t,e)},e.ripemd160FromString=function(t,e){return f.assertIsString(t),c(t,e)},e.ripemd160FromArray=function(t,e){return f.assertIsArray(t),c(t,e)},e.rlphash=function(t){return e.keccak(u.encode(t))}}).call(this,r(2).Buffer)},function(t,e,r){"use strict";var n=r(53).codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,r,o){if("function"===typeof r)return t(e,null,r);r||(r={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(t,e){var r="function"===typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(s){i={error:s}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.BaseTransaction=void 0;var a=o(r(117)),s=r(34),u=r(55),h=function(){function t(t){this.activeCapabilities=[],this.DEFAULT_CHAIN="mainnet",this.DEFAULT_HARDFORK="istanbul";var e=t.nonce,r=t.gasLimit,n=t.to,i=t.value,o=t.data,a=t.v,u=t.r,h=t.s,f=t.type;this._type=new s.BN(s.toBuffer(f)).toNumber();var l=s.toBuffer(""===n?"0x":n),c=s.toBuffer(""===a?"0x":a),d=s.toBuffer(""===u?"0x":u),p=s.toBuffer(""===h?"0x":h);this.nonce=new s.BN(s.toBuffer(""===e?"0x":e)),this.gasLimit=new s.BN(s.toBuffer(""===r?"0x":r)),this.to=l.length>0?new s.Address(l):void 0,this.value=new s.BN(s.toBuffer(""===i?"0x":i)),this.data=s.toBuffer(""===o?"0x":o),this.v=c.length>0?new s.BN(c):void 0,this.r=d.length>0?new s.BN(d):void 0,this.s=p.length>0?new s.BN(p):void 0,this._validateCannotExceedMaxInteger({nonce:this.nonce,gasLimit:this.gasLimit,value:this.value,r:this.r,s:this.s})}return Object.defineProperty(t.prototype,"transactionType",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),t.prototype.supports=function(t){return this.activeCapabilities.includes(t)},t.prototype.validate=function(t){void 0===t&&(t=!1);var e=[];return this.getBaseFee().gt(this.gasLimit)&&e.push("gasLimit is too low. given "+this.gasLimit+", need at least "+this.getBaseFee()),this.isSigned()&&!this.verifySignature()&&e.push("Invalid Signature"),t?e:0===e.length},t.prototype.getBaseFee=function(){var t=this.getDataFee().addn(this.common.param("gasPrices","tx"));return this.common.gteHardfork("homestead")&&this.toCreationAddress()&&t.iaddn(this.common.param("gasPrices","txCreation")),t},t.prototype.getDataFee=function(){for(var t=this.common.param("gasPrices","txDataZero"),e=this.common.param("gasPrices","txDataNonZero"),r=0,n=0;n-1&&this.activeCapabilities.splice(f,1)}return h},t.prototype._getCommon=function(t,e){var r;if(e){var n=new s.BN(s.toBuffer(e));if(t){if(!t.chainIdBN().eq(n))throw new Error("The chain ID does not match the chain ID of Common");return t.copy()}return a.default.isSupportedChainId(n)?new a.default({chain:n,hardfork:this.DEFAULT_HARDFORK}):a.default.forCustomChain(this.DEFAULT_CHAIN,{name:"custom-chain",networkId:n,chainId:n},this.DEFAULT_HARDFORK)}return null!==(r=null===t||void 0===t?void 0:t.copy())&&void 0!==r?r:new a.default({chain:this.DEFAULT_CHAIN,hardfork:this.DEFAULT_HARDFORK})},t.prototype._validateCannotExceedMaxInteger=function(t,e){var r,o;void 0===e&&(e=53);try{for(var a=n(Object.entries(t)),u=a.next();!u.done;u=a.next()){var h=i(u.value,2),f=h[0],l=h[1];if(53===e){if(null===l||void 0===l?void 0:l.gt(s.MAX_INTEGER))throw new Error(f+" cannot exceed MAX_INTEGER, given "+l)}else{if(256!==e)throw new Error("unimplemented bits value");if(null===l||void 0===l?void 0:l.gte(s.TWO_POW256))throw new Error(f+" must be less than 2^256, given "+l)}}}catch(c){r={error:c}}finally{try{u&&!u.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}},t}();e.BaseTransaction=h},function(t,e,r){"use strict";(function(t){var n=this&&this.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.Hardfork=e.Chain=e.CustomChain=void 0;var a,s,u=r(26),h=r(475),f=r(34),l=r(476),c=r(483),d=r(496);!function(t){t.PolygonMainnet="polygon-mainnet",t.PolygonMumbai="polygon-mumbai",t.ArbitrumRinkebyTestnet="arbitrum-rinkeby-testnet",t.xDaiChain="x-dai-chain"}(a=e.CustomChain||(e.CustomChain={})),function(t){t[t.Mainnet=1]="Mainnet",t[t.Ropsten=3]="Ropsten",t[t.Rinkeby=4]="Rinkeby",t[t.Kovan=42]="Kovan",t[t.Goerli=5]="Goerli",t[t.Calaveras=123]="Calaveras"}(e.Chain||(e.Chain={})),function(t){t.Chainstart="chainstart",t.Homestead="homestead",t.Dao="dao",t.TangerineWhistle="tangerineWhistle",t.SpuriousDragon="spuriousDragon",t.Byzantium="byzantium",t.Constantinople="constantinople",t.Petersburg="petersburg",t.Istanbul="istanbul",t.MuirGlacier="muirGlacier",t.Berlin="berlin",t.London="london"}(s=e.Hardfork||(e.Hardfork={}));var p=function(e){function r(t){var r,n,i=e.call(this)||this;return i._supportedHardforks=[],i._eips=[],i._customChains=null!==(r=t.customChains)&&void 0!==r?r:[],i._chainParams=i.setChain(t.chain),i.DEFAULT_HARDFORK=null!==(n=i._chainParams.defaultHardfork)&&void 0!==n?n:s.Istanbul,i._hardfork=i.DEFAULT_HARDFORK,t.supportedHardforks&&(i._supportedHardforks=t.supportedHardforks),t.hardfork&&i.setHardfork(t.hardfork),t.eips&&i.setEIPs(t.eips),i}return n(r,e),r.custom=function(t,e){var n;void 0===e&&(e={});var o=null!==(n=e.baseChain)&&void 0!==n?n:"mainnet",s=i({},r._getChainParams(o));if(s.name="custom-chain","string"!==typeof t)return new r(i({chain:i(i({},s),t)},e));if(t===a.PolygonMainnet)return r.custom({name:a.PolygonMainnet,chainId:137,networkId:137});if(t===a.PolygonMumbai)return r.custom({name:a.PolygonMumbai,chainId:80001,networkId:80001});if(t===a.ArbitrumRinkebyTestnet)return r.custom({name:a.ArbitrumRinkebyTestnet,chainId:421611,networkId:421611});if(t===a.xDaiChain)return r.custom({name:a.xDaiChain,chainId:100,networkId:100});throw new Error("Custom chain "+t+" not supported")},r.forCustomChain=function(t,e,n,o){var a=r._getChainParams(t);return new r({chain:i(i({},a),e),hardfork:n,supportedHardforks:o})},r.isSupportedChainId=function(t){var e=l._getInitializedChains();return Boolean(e.names[t.toString()])},r._getChainParams=function(t,e){var r=l._getInitializedChains(e);if("number"===typeof t||f.BN.isBN(t)){if(t=t.toString(),r.names[t])return r[r.names[t]];throw new Error("Chain with ID "+t+" not supported")}if(r[t])return r[t];throw new Error("Chain with name "+t+" not supported")},r.prototype.setChain=function(t){var e,n;if("number"===typeof t||"string"===typeof t||f.BN.isBN(t))this._chainParams=r._getChainParams(t,this._customChains);else{if("object"!==typeof t)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 i=o(["networkId","genesis","hardforks","bootstrapNodes"]),a=i.next();!a.done;a=i.next()){var s=a.value;if(void 0===t[s])throw new Error("Missing required chain parameter: "+s)}}catch(u){e={error:u}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}this._chainParams=t}return this._chainParams},r.prototype.setHardfork=function(t){var e,r;if(!this._isSupportedHardfork(t))throw new Error("Hardfork "+t+" not set as supported in supportedHardforks");var n=!1;try{for(var i=o(c.hardforks),a=i.next();!a.done;a=i.next()){a.value[0]===t&&(this._hardfork!==t&&(this._hardfork=t,this.emit("hardforkChanged",t)),n=!0)}}catch(s){e={error:s}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}if(!n)throw new Error("Hardfork with name "+t+" not supported")},r.prototype.getHardforkByBlockNumber=function(t){var e,r;t=f.toType(t,f.TypeOutput.BN);var n=s.Chainstart;try{for(var i=o(this.hardforks()),a=i.next();!a.done;a=i.next()){var u=a.value;null!==u.block&&(t.gte(new f.BN(u.block))&&(n=u.name))}}catch(h){e={error:h}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return n},r.prototype.setHardforkByBlockNumber=function(t){t=f.toType(t,f.TypeOutput.BN);var e=this.getHardforkByBlockNumber(t);return this.setHardfork(e),e},r.prototype._chooseHardfork=function(t,e){if(void 0===e&&(e=!0),t){if(e&&!this._isSupportedHardfork(t))throw new Error("Hardfork "+t+" not set as supported in supportedHardforks")}else t=this._hardfork;return t},r.prototype._getHardfork=function(t){var e,r,n=this.hardforks();try{for(var i=o(n),a=i.next();!a.done;a=i.next()){var s=a.value;if(s.name===t)return s}}catch(u){e={error:u}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}throw new Error("Hardfork "+t+" not defined for chain "+this.chainName())},r.prototype._isSupportedHardfork=function(t){var e,r;if(!(this._supportedHardforks.length>0))return!0;try{for(var n=o(this._supportedHardforks),i=n.next();!i.done;i=n.next()){if(t===i.value)return!0}}catch(a){e={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}return!1},r.prototype.setEIPs=function(t){var e,r,n=this;void 0===t&&(t=[]);var i=function(e){if(!(e in d.EIPs))throw new Error(e+" not supported");var r=a.gteHardfork(d.EIPs[e].minimumHardfork);if(!r)throw new Error(e+" cannot be activated on hardfork "+a.hardfork()+", minimumHardfork: "+r);d.EIPs[e].requiredEIPs&&d.EIPs[e].requiredEIPs.forEach((function(r){if(!t.includes(r)&&!n.isActivatedEIP(r))throw new Error(e+" requires EIP "+r+", but is not included in the EIP list")}))},a=this;try{for(var s=o(t),u=s.next();!u.done;u=s.next()){i(u.value)}}catch(h){e={error:h}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}this._eips=t},r.prototype.param=function(t,e){var r,n,i=null;try{for(var a=o(this._eips),s=a.next();!s.done;s=a.next()){var u=s.value;if(null!==(i=this.paramByEIP(t,e,u)))return i}}catch(h){r={error:h}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return this.paramByHardfork(t,e,this._hardfork)},r.prototype.paramByHardfork=function(t,e,r){var n,i,a,s;r=this._chooseHardfork(r);var u=null;try{for(var h=o(c.hardforks),f=h.next();!f.done;f=h.next()){var l=f.value;if(l[1].hasOwnProperty("eips")){var d=l[1].eips;try{for(var p=(a=void 0,o(d)),m=p.next();!m.done;m=p.next()){var v=m.value,g=this.paramByEIP(t,e,v);u=null!==g?g:u}}catch(y){a={error:y}}finally{try{m&&!m.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}}else{if(!l[1][t])throw new Error("Topic "+t+" not defined");void 0!==l[1][t][e]&&(u=l[1][t][e].v)}if(l[0]===r)break}}catch(b){n={error:b}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}return u},r.prototype.paramByEIP=function(t,e,r){if(!(r in d.EIPs))throw new Error(r+" not supported");var n=d.EIPs[r];if(!(t in n))throw new Error("Topic "+t+" not defined");return void 0===n[t][e]?null:n[t][e].v},r.prototype.paramByBlock=function(t,e,r){var n=this.activeHardforks(r),i=n[n.length-1].name;return this.paramByHardfork(t,e,i)},r.prototype.isActivatedEIP=function(t){var e,r;if(this.eips().includes(t))return!0;try{for(var n=o(c.hardforks),i=n.next();!i.done;i=n.next()){var a=i.value[1];if(this.gteHardfork(a.name)&&"eips"in a&&a.eips.includes(t))return!0}}catch(s){e={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}return!1},r.prototype.hardforkIsActiveOnBlock=function(t,e,r){var n;void 0===r&&(r={}),e=f.toType(e,f.TypeOutput.BN);var i=null!==(n=r.onlySupported)&&void 0!==n&&n;t=this._chooseHardfork(t,i);var o=this.hardforkBlockBN(t);return!(!o||!e.gte(o))},r.prototype.activeOnBlock=function(t,e){return this.hardforkIsActiveOnBlock(null,t,e)},r.prototype.hardforkGteHardfork=function(t,e,r){var n,i;void 0===r&&(r={});var a,s=void 0!==r.onlyActive&&r.onlyActive;t=this._chooseHardfork(t,r.onlySupported),a=s?this.activeHardforks(null,r):this.hardforks();var u=-1,h=-1,f=0;try{for(var l=o(a),c=l.next();!c.done;c=l.next()){var d=c.value;d.name===t&&(u=f),d.name===e&&(h=f),f+=1}}catch(p){n={error:p}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}return u>=h&&-1!==h},r.prototype.gteHardfork=function(t,e){return this.hardforkGteHardfork(null,t,e)},r.prototype.hardforkIsActiveOnChain=function(t,e){var r,n,i;void 0===e&&(e={});var a=null!==(i=e.onlySupported)&&void 0!==i&&i;t=this._chooseHardfork(t,a);try{for(var s=o(this.hardforks()),u=s.next();!u.done;u=s.next()){var h=u.value;if(h.name===t&&null!==h.block)return!0}}catch(f){r={error:f}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!1},r.prototype.activeHardforks=function(t,e){var r,n;void 0===e&&(e={});var i=[],a=this.hardforks();try{for(var s=o(a),u=s.next();!u.done;u=s.next()){var h=u.value;if(null!==h.block){if(void 0!==t&&null!==t&&t0)return r[r.length-1].name;throw new Error("No (supported) active hardfork found")},r.prototype.hardforkBlock=function(t){return f.toType(this.hardforkBlockBN(t),f.TypeOutput.Number)},r.prototype.hardforkBlockBN=function(t){return t=this._chooseHardfork(t,!1),new f.BN(this._getHardfork(t).block)},r.prototype.isHardforkBlock=function(t,e){return t=f.toType(t,f.TypeOutput.BN),e=this._chooseHardfork(e,!1),this.hardforkBlockBN(e).eq(t)},r.prototype.nextHardforkBlock=function(t){var e=this.nextHardforkBlockBN(t);return null===e?null:f.toType(e,f.TypeOutput.Number)},r.prototype.nextHardforkBlockBN=function(t){t=this._chooseHardfork(t,!1);var e=this.hardforkBlockBN(t);return this.hardforks().reduce((function(t,r){var n=new f.BN(r.block);return n.gt(e)&&null===t?n:t}),null)},r.prototype.isNextHardforkBlock=function(t,e){t=f.toType(t,f.TypeOutput.BN),e=this._chooseHardfork(e,!1);var r=this.nextHardforkBlockBN(e);return null!==r&&r.eq(t)},r.prototype._calcForkHash=function(e){var r,n,i=t.from(this.genesis().hash.substr(2),"hex"),a=t.alloc(0),s=0;try{for(var u=o(this.hardforks()),l=u.next();!l.done;l=u.next()){var c=l.value,d=c.block;if(0!==d&&null!==d&&d!==s){var p=t.from(d.toString(16).padStart(16,"0"),"hex");a=t.concat([a,p])}if(c.name===e)break;s=d}}catch(v){r={error:v}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}var m=t.concat([i,a]);return"0x"+f.intToBuffer(h.buf(m)>>>0).toString("hex")},r.prototype.forkHash=function(t){t=this._chooseHardfork(t,!1);var e=this._getHardfork(t);if(null===e.block){throw new Error("No fork hash calculation possible for non-applied or future hardfork")}return void 0!==e.forkHash?e.forkHash:this._calcForkHash(t)},r.prototype.hardforkForForkHash=function(t){var e=this.hardforks().filter((function(e){return e.forkHash===t}));return e.length>=1?e[e.length-1]:null},r.prototype.genesis=function(){return this._chainParams.genesis},r.prototype.hardforks=function(){return this._chainParams.hardforks},r.prototype.bootstrapNodes=function(){return this._chainParams.bootstrapNodes},r.prototype.dnsNetworks=function(){return this._chainParams.dnsNetworks},r.prototype.hardfork=function(){return this._hardfork},r.prototype.chainId=function(){return f.toType(this.chainIdBN(),f.TypeOutput.Number)},r.prototype.chainIdBN=function(){return new f.BN(this._chainParams.chainId)},r.prototype.chainName=function(){return this._chainParams.name},r.prototype.networkId=function(){return f.toType(this.networkIdBN(),f.TypeOutput.Number)},r.prototype.networkIdBN=function(){return new f.BN(this._chainParams.networkId)},r.prototype.eips=function(){return this._eips},r.prototype.consensusType=function(){return this._chainParams.consensus.type},r.prototype.consensusAlgorithm=function(){return this._chainParams.consensus.algorithm},r.prototype.consensusConfig=function(){return this._chainParams.consensus[this.consensusAlgorithm()]},r.prototype.copy=function(){return Object.assign(Object.create(Object.getPrototypeOf(this)),this)},r}(u.EventEmitter);e.default=p}).call(this,r(2).Buffer)},function(t,e,r){"use strict";var n=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,i=function(t){var e={};return function(r){return void 0===e[r]&&(e[r]=t(r)),e[r]}}((function(t){return n.test(t)||111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&t.charCodeAt(2)<91}));e.a=i},function(t,e){t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}},function(t,e,r){(function(t){var n=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return t}})),u=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&e._extend(n,r),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),f(n,t,n.depth)}function u(t,e){var r=s.styles[e];return r?"\x1b["+s.colors[r][0]+"m"+t+"\x1b["+s.colors[r][1]+"m":t}function h(t,e){return t}function f(t,r,n){if(t.customInspect&&r&&k(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return g(i)||(i=f(t,i,n)),i}var o=function(t,e){if(y(e))return t.stylize("undefined","undefined");if(g(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(v(e))return t.stylize(""+e,"number");if(p(e))return t.stylize(""+e,"boolean");if(m(e))return t.stylize("null","null")}(t,r);if(o)return o;var a=Object.keys(r),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(r)),_(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return l(r);if(0===a.length){if(k(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(b(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(M(r))return t.stylize(Date.prototype.toString.call(r),"date");if(_(r))return l(r)}var h,w="",S=!1,A=["{","}"];(d(r)&&(S=!0,A=["[","]"]),k(r))&&(w=" [Function"+(r.name?": "+r.name:"")+"]");return b(r)&&(w=" "+RegExp.prototype.toString.call(r)),M(r)&&(w=" "+Date.prototype.toUTCString.call(r)),_(r)&&(w=" "+l(r)),0!==a.length||S&&0!=r.length?n<0?b(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),h=S?function(t,e,r,n,i){for(var o=[],a=0,s=e.length;a=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(h,w,A)):A[0]+w+A[1]}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function c(t,e,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),O(n,i)||(a="["+i+"]"),s||(t.seen.indexOf(u.value)<0?(s=m(r)?f(t,u.value,null):f(t,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),y(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function d(t){return Array.isArray(t)}function p(t){return"boolean"===typeof t}function m(t){return null===t}function v(t){return"number"===typeof t}function g(t){return"string"===typeof t}function y(t){return void 0===t}function b(t){return w(t)&&"[object RegExp]"===S(t)}function w(t){return"object"===typeof t&&null!==t}function M(t){return w(t)&&"[object Date]"===S(t)}function _(t){return w(t)&&("[object Error]"===S(t)||t instanceof Error)}function k(t){return"function"===typeof t}function S(t){return Object.prototype.toString.call(t)}function A(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(r){if(y(o)&&(o=Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}).NODE_DEBUG||""),r=r.toUpperCase(),!a[r])if(new RegExp("\\b"+r+"\\b","i").test(o)){var n=t.pid;a[r]=function(){var t=e.format.apply(e,arguments);console.error("%s %d: %s",r,n,t)}}else a[r]=function(){};return a[r]},e.inspect=s,s.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]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=d,e.isBoolean=p,e.isNull=m,e.isNullOrUndefined=function(t){return null==t},e.isNumber=v,e.isString=g,e.isSymbol=function(t){return"symbol"===typeof t},e.isUndefined=y,e.isRegExp=b,e.isObject=w,e.isDate=M,e.isError=_,e.isFunction=k,e.isPrimitive=function(t){return null===t||"boolean"===typeof t||"number"===typeof t||"string"===typeof t||"symbol"===typeof t||"undefined"===typeof t},e.isBuffer=r(237);var E=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function x(){var t=new Date,e=[A(t.getHours()),A(t.getMinutes()),A(t.getSeconds())].join(":");return[t.getDate(),E[t.getMonth()],e].join(" ")}function O(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",x(),e.format.apply(e,arguments))},e.inherits=r(238),e._extend=function(t,e){if(!e||!w(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var R="undefined"!==typeof Symbol?Symbol("util.promisify.custom"):void 0;function T(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!==typeof t)throw new TypeError('The "original" argument must be of type Function');if(R&&t[R]){var e;if("function"!==typeof(e=t[R]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,R,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o7&&t[r].toUpperCase()!==t[r]||parseInt(e[r],16)<=7&&t[r].toLowerCase()!==t[r])return!1;return!0},d=function(t){var e="";t=(t=(t=(t=(t=o.encode(t)).replace(/^(?:\u0000)*/,"")).split("").reverse().join("")).replace(/^(?:\u0000)*/,"")).split("").reverse().join("");for(var r=0;r>>4).toString(16)),e.push((15&t[r]).toString(16));return"0x"+e.join("")},isHex:b,isHexStrict:y,stripHexPrefix:function(t){return 0!==t&&b(t)?t.replace(/^(-)?0x/i,"$1"):t},leftPad:function(t,e,r){var n=/^0x/i.test(t)||"number"===typeof t,i=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+new Array(i).join(r||"0")+t},rightPad:function(t,e,r){var n=/^0x/i.test(t)||"number"===typeof t,i=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(i).join(r||"0")},toTwosComplement:function(t){return"0x"+f(t).toTwos(256).toString(16,64)},sha3:M,sha3Raw:function(t){return null===(t=M(t))?w:t},toNumber:function(t){return"number"===typeof t?t:p(g(t))}}}).call(this,r(2).Buffer)},function(t,e,r){"use strict";var n=r(37),i=r(38),o=r(20),a=r(254),s=function(t){var e="A".charCodeAt(0),r="Z".charCodeAt(0);return(t=(t=t.toUpperCase()).substr(4)+t.substr(0,4)).split("").map((function(t){var n=t.charCodeAt(0);return n>=e&&n<=r?n-e+10:t})).join("")},u=function(t){for(var e,r=t;r.length>2;)e=r.slice(0,9),r=parseInt(e,10)%97+r.slice(e.length);return parseInt(r,10)%97},h=function(){function t(e){n(this,t),this._iban=e}return i(t,[{key:"isValid",value:function(){return/^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(this._iban)&&1===u(s(this._iban))}},{key:"isDirect",value:function(){return 34===this._iban.length||35===this._iban.length}},{key:"isIndirect",value:function(){return 20===this._iban.length}},{key:"checksum",value:function(){return this._iban.substr(2,2)}},{key:"institution",value:function(){return this.isIndirect()?this._iban.substr(7,4):""}},{key:"client",value:function(){return this.isIndirect()?this._iban.substr(11):""}},{key:"toAddress",value:function(){if(this.isDirect()){var t=this._iban.substr(4),e=new a(t,36);return o.toChecksumAddress(e.toString(16,20))}return""}},{key:"toString",value:function(){return this._iban}}],[{key:"toAddress",value:function(e){if(!(e=new t(e)).isDirect())throw new Error("IBAN is indirect and can't be converted");return e.toAddress()}},{key:"toIban",value:function(e){return t.fromAddress(e).toString()}},{key:"fromAddress",value:function(e){if(!o.isAddress(e))throw new Error("Provided address is not a valid address: "+e);e=e.replace("0x","").replace("0X","");var r=function(t,e){for(var r=t;r.length<2*e;)r="0"+r;return r}(new a(e,16).toString(36),15);return t.fromBban(r.toUpperCase())}},{key:"fromBban",value:function(e){return new t("XE"+("0"+(98-u(s("XE00"+e)))).slice(-2)+e)}},{key:"createIndirect",value:function(e){return t.fromBban("ETH"+e.institution+e.identifier)}},{key:"isValid",value:function(e){return new t(e).isValid()}}]),t}();t.exports=h},function(t,e,r){"use strict";var n={messageId:0,toPayload:function(t,e){if(!t)throw new Error('JSONRPC method should be specified for params: "'+JSON.stringify(e)+'"!');return n.messageId++,{jsonrpc:"2.0",id:n.messageId,method:t,params:e||[]}},isValidResponse:function(t){return Array.isArray(t)?t.every(e):e(t);function e(t){return!!t&&!t.error&&"2.0"===t.jsonrpc&&("number"===typeof t.id||"string"===typeof t.id)&&void 0!==t.result}},toBatchPayload:function(t){return t.map((function(t){return n.toPayload(t.method,t.params)}))}};t.exports=n},function(t,e,r){(function(t,n){var i;!function(o){e&&e.nodeType,t&&t.nodeType;var a="object"==typeof n&&n;a.global!==a&&a.window!==a&&a.self;var s,u=2147483647,h=36,f=/^xn--/,l=/[^\x20-\x7E]/,c=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,m=String.fromCharCode;function v(t){throw new RangeError(d[t])}function g(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function y(t,e){var r=t.split("@"),n="";return r.length>1&&(n=r[0]+"@",t=r[1]),n+g((t=t.replace(c,".")).split("."),e).join(".")}function b(t){for(var e,r,n=[],i=0,o=t.length;i=55296&&e<=56319&&i65535&&(e+=m((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=m(t)})).join("")}function M(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function _(t,e,r){var n=0;for(t=r?p(t/700):t>>1,t+=p(t/e);t>455;n+=h)t=p(t/35);return p(n+36*t/(t+38))}function k(t){var e,r,n,i,o,a,s,f,l,c,d,m=[],g=t.length,y=0,b=128,M=72;for((r=t.lastIndexOf("-"))<0&&(r=0),n=0;n=128&&v("not-basic"),m.push(t.charCodeAt(n));for(i=r>0?r+1:0;i=g&&v("invalid-input"),((f=(d=t.charCodeAt(i++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:h)>=h||f>p((u-y)/a))&&v("overflow"),y+=f*a,!(f<(l=s<=M?1:s>=M+26?26:s-M));s+=h)a>p(u/(c=h-l))&&v("overflow"),a*=c;M=_(y-o,e=m.length+1,0==o),p(y/e)>u-b&&v("overflow"),b+=p(y/e),y%=e,m.splice(y++,0,b)}return w(m)}function S(t){var e,r,n,i,o,a,s,f,l,c,d,g,y,w,k,S=[];for(g=(t=b(t)).length,e=128,r=0,o=72,a=0;a=e&&dp((u-r)/(y=n+1))&&v("overflow"),r+=(s-e)*y,e=s,a=0;au&&v("overflow"),d==e){for(f=r,l=h;!(f<(c=l<=o?1:l>=o+26?26:l-o));l+=h)k=f-c,w=h-c,S.push(m(M(c+k%w,0))),f=p(k/w);S.push(m(M(f,0))),o=_(r,y,n==i),r=0,++n}++r,++e}return S.join("")}s={version:"1.4.1",ucs2:{decode:b,encode:w},decode:k,encode:S,toASCII:function(t){return y(t,(function(t){return l.test(t)?"xn--"+S(t):t}))},toUnicode:function(t){return y(t,(function(t){return f.test(t)?k(t.slice(4).toLowerCase()):t}))}},void 0===(i=function(){return s}.call(e,r,e,t))||(t.exports=i)}()}).call(this,r(17)(t),r(12))},function(t,e,r){(function(t){e.fetch=s(t.fetch)&&s(t.ReadableStream),e.writableStream=s(t.WritableStream),e.abortController=s(t.AbortController),e.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),e.blobConstructor=!0}catch(u){}var r;function n(){if(void 0!==r)return r;if(t.XMLHttpRequest){r=new t.XMLHttpRequest;try{r.open("GET",t.XDomainRequest?"/":"https://example.com")}catch(u){r=null}}else r=null;return r}function i(t){var e=n();if(!e)return!1;try{return e.responseType=t,e.responseType===t}catch(u){}return!1}var o="undefined"!==typeof t.ArrayBuffer,a=o&&s(t.ArrayBuffer.prototype.slice);function s(t){return"function"===typeof t}e.arraybuffer=e.fetch||o&&i("arraybuffer"),e.msstream=!e.fetch&&a&&i("ms-stream"),e.mozchunkedarraybuffer=!e.fetch&&o&&i("moz-chunked-arraybuffer"),e.overrideMimeType=e.fetch||!!n()&&s(n().overrideMimeType),e.vbArray=s(t.VBArray),r=null}).call(this,r(12))},function(t,e,r){(function(t,n,i){var o=r(129),a=r(4),s=r(60),u=e.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},h=e.IncomingMessage=function(e,r,a,u){var h=this;if(s.Readable.call(h),h._mode=a,h.headers={},h.rawHeaders=[],h.trailers={},h.rawTrailers=[],h.on("end",(function(){t.nextTick((function(){h.emit("close")}))})),"fetch"===a){if(h._fetchResponse=r,h.url=r.url,h.statusCode=r.status,h.statusMessage=r.statusText,r.headers.forEach((function(t,e){h.headers[e.toLowerCase()]=t,h.rawHeaders.push(e,t)})),o.writableStream){var f=new WritableStream({write:function(t){return new Promise((function(e,r){h._destroyed?r():h.push(new i(t))?e():h._resumeFetch=e}))},close:function(){n.clearTimeout(u),h._destroyed||h.push(null)},abort:function(t){h._destroyed||h.emit("error",t)}});try{return void r.body.pipeTo(f).catch((function(t){n.clearTimeout(u),h._destroyed||h.emit("error",t)}))}catch(p){}}var l=r.body.getReader();!function t(){l.read().then((function(e){if(!h._destroyed){if(e.done)return n.clearTimeout(u),void h.push(null);h.push(new i(e.value)),t()}})).catch((function(t){n.clearTimeout(u),h._destroyed||h.emit("error",t)}))}()}else{if(h._xhr=e,h._pos=0,h.url=e.responseURL,h.statusCode=e.status,h.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach((function(t){var e=t.match(/^([^:]+):\s*(.*)/);if(e){var r=e[1].toLowerCase();"set-cookie"===r?(void 0===h.headers[r]&&(h.headers[r]=[]),h.headers[r].push(e[2])):void 0!==h.headers[r]?h.headers[r]+=", "+e[2]:h.headers[r]=e[2],h.rawHeaders.push(e[1],e[2])}})),h._charset="x-user-defined",!o.overrideMimeType){var c=h.rawHeaders["mime-type"];if(c){var d=c.match(/;\s*charset=([^;])(;|$)/);d&&(h._charset=d[1].toLowerCase())}h._charset||(h._charset="utf-8")}}};a(h,s.Readable),h.prototype._read=function(){var t=this._resumeFetch;t&&(this._resumeFetch=null,t())},h.prototype._onXHRProgress=function(){var t=this,e=t._xhr,r=null;switch(t._mode){case"text:vbarray":if(e.readyState!==u.DONE)break;try{r=new n.VBArray(e.responseBody).toArray()}catch(f){}if(null!==r){t.push(new i(r));break}case"text":try{r=e.responseText}catch(f){t._mode="text:vbarray";break}if(r.length>t._pos){var o=r.substr(t._pos);if("x-user-defined"===t._charset){for(var a=new i(o.length),s=0;st._pos&&(t.push(new i(new Uint8Array(h.result.slice(t._pos)))),t._pos=h.result.byteLength)},h.onload=function(){t.push(null)},h.readAsArrayBuffer(r)}t._xhr.readyState===u.DONE&&"ms-stream"!==t._mode&&t.push(null)}}).call(this,r(11),r(12),r(2).Buffer)},function(t,e,r){"use strict";(function(e,n){var i=r(72);t.exports=b;var o,a=r(121);b.ReadableState=y;r(26).EventEmitter;var s=function(t,e){return t.listeners(e).length},u=r(132),h=r(9).Buffer,f=e.Uint8Array||function(){};var l=Object.create(r(61));l.inherits=r(4);var c=r(273),d=void 0;d=c&&c.debuglog?c.debuglog("stream"):function(){};var p,m=r(274),v=r(133);l.inherits(b,u);var g=["error","close","destroy","pause","resume"];function y(t,e){t=t||{};var n=e instanceof(o=o||r(39));this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,a=t.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(p||(p=r(29).StringDecoder),this.decoder=new p(t.encoding),this.encoding=t.encoding)}function b(t){if(o=o||r(39),!(this instanceof b))return new b(t);this._readableState=new y(t,this),this.readable=!0,t&&("function"===typeof t.read&&(this._read=t.read),"function"===typeof t.destroy&&(this._destroy=t.destroy)),u.call(this)}function w(t,e,r,n,i){var o,a=t._readableState;null===e?(a.reading=!1,function(t,e){if(e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,S(t)}(t,a)):(i||(o=function(t,e){var r;n=e,h.isBuffer(n)||n instanceof f||"string"===typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(a,e)),o?t.emit("error",o):a.objectMode||e&&e.length>0?("string"===typeof e||a.objectMode||Object.getPrototypeOf(e)===h.prototype||(e=function(t){return h.from(t)}(e)),n?a.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):M(t,a,e,!0):a.ended?t.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?M(t,a,e,!1):E(t,a)):M(t,a,e,!1))):n||(a.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=_?t=_:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function S(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(d("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(A,t):A(t))}function A(t){d("emit readable"),t.emit("readable"),T(t)}function E(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(x,t,e))}function x(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var n;to.length?o.length:t;if(a===o.length?i+=o:i+=o.slice(0,t),0===(t-=a)){a===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(a));break}++n}return e.length-=n,i}(t,e):function(t,e){var r=h.allocUnsafe(t),n=e.head,i=1;n.data.copy(r),t-=n.data.length;for(;n=n.next;){var o=n.data,a=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,a),0===(t-=a)){a===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(a));break}++i}return e.length-=i,r}(t,e);return n}(t,e.buffer,e.decoder),r);var r}function C(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i.nextTick(B,e,t))}function B(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function I(t,e){for(var r=0,n=t.length;r=e.highWaterMark||e.ended))return d("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?C(this):S(this),null;if(0===(t=k(t,e))&&e.ended)return 0===e.length&&C(this),null;var n,i=e.needReadable;return d("need readable",i),(0===e.length||e.length-t0?P(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&C(this)),null!==n&&this.emit("data",n),n},b.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(t,e){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,e);var u=(!e||!1!==e.end)&&t!==n.stdout&&t!==n.stderr?f:b;function h(e,n){d("onunpipe"),e===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,d("cleanup"),t.removeListener("close",g),t.removeListener("finish",y),t.removeListener("drain",l),t.removeListener("error",v),t.removeListener("unpipe",h),r.removeListener("end",f),r.removeListener("end",b),r.removeListener("data",m),c=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||l())}function f(){d("onend"),t.end()}o.endEmitted?i.nextTick(u):r.once("end",u),t.on("unpipe",h);var l=function(t){return function(){var e=t._readableState;d("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,T(t))}}(r);t.on("drain",l);var c=!1;var p=!1;function m(e){d("ondata"),p=!1,!1!==t.write(e)||p||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==I(o.pipes,t))&&!c&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function v(e){d("onerror",e),b(),t.removeListener("error",v),0===s(t,"error")&&t.emit("error",e)}function g(){t.removeListener("finish",y),b()}function y(){d("onfinish"),t.removeListener("close",g),b()}function b(){d("unpipe"),r.unpipe(t)}return r.on("data",m),function(t,e,r){if("function"===typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?a(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",v),t.once("close",g),t.once("finish",y),t.emit("pipe",r),o.flowing||(d("pipe resume"),r.resume()),t},b.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r(276),e.setImmediate="undefined"!==typeof self&&self.setImmediate||"undefined"!==typeof t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!==typeof self&&self.clearImmediate||"undefined"!==typeof t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(12))},function(t,e,r){"use strict";t.exports=a;var n=r(39),i=Object.create(r(61));function o(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.lengtht.length)&&(e=t.length);for(var r=0,n=new Array(e);r>>3},e.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},function(t,e,r){"use strict";var n=r(27),i=r(62),o=r(139),a=r(22),s=n.sum32,u=n.sum32_4,h=n.sum32_5,f=o.ch32,l=o.maj32,c=o.s0_256,d=o.s1_256,p=o.g0_256,m=o.g1_256,v=i.BlockHash,g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function y(){if(!(this instanceof y))return new y;v.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}n.inherits(y,v),t.exports=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n-1&&(e="tuple[]",t=t.slice(0,-2)),{type:e,name:t}},h.prototype.mapStructToCoderFormat=function(t){var e=this,r=[];return Object.keys(t).forEach((function(n){"object"!==typeof t[n]?r.push({name:n,type:t[n]}):r.push(Object.assign(e.mapStructNameAndType(n),{components:e.mapStructToCoderFormat(t[n])}))})),r},h.prototype.formatParam=function(t,e){var r=this,o=new RegExp(/^bytes([0-9]*)$/),a=new RegExp(/^bytes([0-9]*)\[\]$/),s=new RegExp(/^(u?int)([0-9]*)$/),u=new RegExp(/^(u?int)([0-9]*)\[\]$/);if(i.isBN(e)||i.isBigNumber(e))return e.toString(10);if(t.match(a)||t.match(u))return e.map((function(e){return r.formatParam(t.replace("[]",""),e)}));var h=t.match(s);if(h){var f=parseInt(h[2]||"256");f/80&&(!e||"0x"===e||"0X"===e))throw new Error("Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.");var n=s.decode(this.mapTypes(t),"0x"+e.replace(/0x/i,""),r),i=new u;return i.__length__=0,t.forEach((function(t,e){var r=n[i.__length__];r="0x"===r?null:r,i[e]=r,("function"===typeof t||t&&"object"===typeof t)&&t.name&&(i[t.name]=r),i.__length__++})),i},h.prototype.decodeLog=function(t,e,r){var n=this;r=Array.isArray(r)?r:[r],e=e||"";var i=[],o=[],a=0;t.forEach((function(t,e){t.indexed?(o[e]=["bool","int","uint","address","fixed","ufixed"].find((function(e){return-1!==t.type.indexOf(e)}))?n.decodeParameter(t.type,r[a]):r[a],a++):i[e]=t}));var s=e,h=s?this.decodeParametersWith(i,s,!0):[],f=new u;return f.__length__=0,t.forEach((function(t,e){f[e]="string"===t.type?"":null,"undefined"!==typeof h[e]&&(f[e]=h[e]),"undefined"!==typeof o[e]&&(f[e]=o[e]),t.name&&(f[t.name]=f[e]),f.__length__++})),f};var f=new h;t.exports=f},function(t,e,r){"use strict";t.exports={addresses:{main:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",ropsten:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",rinkeby:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",goerli:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},interfaceIds:{addr:"0x3b3b57de",setAddr:"0x3b3b57de",pubkey:"0xc8690233",setPubkey:"0xc8690233",contenthash:"0xbc1c58d1",setContenthash:"0xbc1c58d1",content:"0xd8389dc5",setContent:"0xd8389dc5"}}},function(t,e,r){(function(t){var n=r(307).keccak_256,i=r(308);function o(t){return t?i.toUnicode(t,{useStd3ASCII:!0,transitional:!1}):t}e.hash=function(e){for(var r="",i=0;i<32;i++)r+="00";if(name=o(e),name){var a=name.split(".");for(i=a.length-1;i>=0;i--){var s=n(a[i]);r=n(new t(r+s,"hex"))}}return"0x"+r},e.normalize=o}).call(this,r(2).Buffer)},function(t,e,r){"use strict";(function(e){var n=r(63);function i(t){return parseInt(t.toString("hex"),16)}function o(t){var r=t.toString(16);return r.length%2===1&&(r="0"+r),e.from(r,"hex")}t.exports={numberToBuffer:o,bufferToNumber:i,varintBufferEncode:function(t){return e.from(n.encode(i(t)))},varintBufferDecode:function(t){return o(n.decode(t))},varintEncode:function(t){return e.from(n.encode(t))}}}).call(this,r(2).Buffer)},function(t,e,r){"use strict";var n=r(37),i=r(38),o=r(2).Buffer,a=r(92),s=r(331),u=r(337),h=r(64),f=r(342),l=r(343),c=function(t){function e(t,r,i,h){if(n(this,e),d.isCID(t)){var f=t;return this.version=f.version,this.codec=f.codec,this.multihash=o.from(f.multihash),void(this.multibaseName=f.multibaseName||(0===f.version?"base58btc":"base32"))}if("string"===typeof t){var l=s.isEncoded(t);if(l){var c=s.decode(t);this.version=parseInt(c.slice(0,1).toString("hex"),16),this.codec=u.getCodec(c.slice(1)),this.multihash=u.rmPrefix(c.slice(1)),this.multibaseName=l}else this.version=0,this.codec="dag-pb",this.multihash=a.fromB58String(t),this.multibaseName="base58btc";return e.validateCID(this),void Object.defineProperty(this,"string",{value:t})}if(o.isBuffer(t)){var p=t.slice(0,1),m=parseInt(p.toString("hex"),16);if(1===m){var v=t;this.version=m,this.codec=u.getCodec(v.slice(1)),this.multihash=u.rmPrefix(v.slice(1)),this.multibaseName="base32"}else this.version=0,this.codec="dag-pb",this.multihash=t,this.multibaseName="base58btc";e.validateCID(this)}else this.version=t,this.codec=r,this.multihash=i,this.multibaseName=h||(0===t?"base58btc":"base32"),e.validateCID(this)}return i(e,[{key:"buffer",get:function(){var t=this._buffer;if(!t){if(0===this.version)t=this.multihash;else{if(1!==this.version)throw new Error("unsupported version");t=o.concat([o.from("01","hex"),u.getCodeVarint(this.codec),this.multihash])}Object.defineProperty(this,"_buffer",{value:t})}return t}},{key:"prefix",get:function(){return o.concat([o.from("0".concat(this.version),"hex"),u.getCodeVarint(this.codec),a.prefix(this.multihash)])}},{key:"toV0",value:function(){if("dag-pb"!==this.codec)throw new Error("Cannot convert a non dag-pb CID to CIDv0");var t=a.decode(this.multihash),e=t.name,r=t.length;if("sha2-256"!==e)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");if(32!==r)throw new Error("Cannot convert non 32 byte multihash CID to CIDv0");return new d(0,this.codec,this.multihash)}},{key:"toV1",value:function(){return new d(1,this.codec,this.multihash)}},{key:"toBaseEncodedString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.multibaseName;if(this.string&&t===this.multibaseName)return this.string;var e=null;if(0===this.version){if("base58btc"!==t)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");e=a.toB58String(this.multihash)}else{if(1!==this.version)throw new Error("unsupported version");e=s.encode(t,this.buffer).toString()}return t===this.multibaseName&&Object.defineProperty(this,"string",{value:e}),e}},{key:t,value:function(){return"CID("+this.toString()+")"}},{key:"toString",value:function(t){return this.toBaseEncodedString(t)}},{key:"toJSON",value:function(){return{codec:this.codec,version:this.version,hash:this.multihash}}},{key:"equals",value:function(t){return this.codec===t.codec&&this.version===t.version&&this.multihash.equals(t.multihash)}}],[{key:"validateCID",value:function(t){var e=f.checkCIDComponents(t);if(e)throw new Error(e)}}]),e}(Symbol.for("nodejs.util.inspect.custom")),d=l(c,{className:"CID",symbolName:"@ipld/js-cid/CID"});d.codecs=h,t.exports=d},function(t,e,r){"use strict";var n=r(9).Buffer;t.exports=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r>>0,f=new Uint8Array(a);t[r];){var l=e[t.charCodeAt(r)];if(255===l)return;for(var c=0,d=a-1;(0!==l||c>>0,f[d]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");o=c,r++}if(" "!==t[r]){for(var p=a-o;p!==a&&0===f[p];)p++;var m=n.allocUnsafe(i+(a-p));m.fill(0,0,i);for(var v=i;p!==a;)m[v++]=f[p++];return m}}}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=n.from(e)),!n.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,i=0,o=0,a=e.length;o!==a&&0===e[o];)o++,r++;for(var h=(a-o)*f+1>>>0,l=new Uint8Array(h);o!==a;){for(var c=e[o],d=0,p=h-1;(0!==c||d>>0,l[p]=c%s>>>0,c=c/s>>>0;if(0!==c)throw new Error("Non-zero carry");i=d,o++}for(var m=h-i;m!==h&&0===l[m];)m++;for(var v=u.repeat(r);m>6|192);else{if(i>55295&&i<56320){if(++n==t.length)return null;var o=t.charCodeAt(n);if(o<56320||o>57343)return null;r+=e((i=65536+((1023&i)<<10)+(1023&o))>>18|240),r+=e(i>>12&63|128)}else r+=e(i>>12|224);r+=e(i>>6&63|128)}r+=e(63&i|128)}}return r},toString:function(t){for(var e="",r=0,o=i(t);r127){if(a>191&&a<224){if(r>=o)return null;a=(31&a)<<6|63&n(t,r)}else if(a>223&&a<240){if(r+1>=o)return null;a=(15&a)<<12|(63&n(t,r))<<6|63&n(t,++r)}else{if(!(a>239&&a<248))return null;if(r+2>=o)return null;a=(7&a)<<18|(63&n(t,r))<<12|(63&n(t,++r))<<6|63&n(t,++r)}++r}if(a<=65535)e+=String.fromCharCode(a);else{if(!(a<=1114111))return null;a-=65536,e+=String.fromCharCode(a>>10|55296),e+=String.fromCharCode(1023&a|56320)}}return e},fromNumber:function(t){var e=t.toString(16);return e.length%2===0?"0x"+e:"0x0"+e},toNumber:function(t){return parseInt(t.slice(2),16)},fromNat:function(t){return"0x0"===t?"0x":t.length%2===0?t:"0x0"+t.slice(2)},toNat:function(t){return"0"===t[2]?"0x"+t.slice(3):t},fromArray:a,toArray:o,fromUint8Array:function(t){return a([].slice.call(t,0))},toUint8Array:function(t){return new Uint8Array(o(t))}}},function(t,e,r){"use strict";var n=r(356).Buffer,i=r(357).Transform;function o(t){i.call(this),this._block=n.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(4)(o,i),o.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(i){n=i}r(n)},o.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(r){e=r}t(e)},o.prototype.update=function(t,e){if(function(t,e){if(!n.isBuffer(t)&&"string"!==typeof t)throw new TypeError(e+" must be a string or a buffer")}(t,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(t)||(t=n.from(t,e));for(var r=this._block,i=0;this._blockOffset+t.length-i>=this._blockSize;){for(var o=this._blockOffset;o0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=o},function(t,e,r){"use strict";(function(e,n){var i;t.exports=A,A.ReadableState=S;r(26).EventEmitter;var o=function(t,e){return t.listeners(e).length},a=r(156),s=r(2).Buffer,u=e.Uint8Array||function(){};var h,f=r(358);h=f&&f.debuglog?f.debuglog("stream"):function(){};var l,c,d,p=r(359),m=r(157),v=r(158).getHighWaterMark,g=r(47).codes,y=g.ERR_INVALID_ARG_TYPE,b=g.ERR_STREAM_PUSH_AFTER_EOF,w=g.ERR_METHOD_NOT_IMPLEMENTED,M=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(4)(A,a);var _=m.errorOrDestroy,k=["error","close","destroy","pause","resume"];function S(t,e,n){i=i||r(48),t=t||{},"boolean"!==typeof n&&(n=e instanceof i),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=v(this,t,"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!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(l||(l=r(29).StringDecoder),this.decoder=new l(t.encoding),this.encoding=t.encoding)}function A(t){if(i=i||r(48),!(this instanceof A))return new A(t);var e=this instanceof i;this._readableState=new S(t,this,e),this.readable=!0,t&&("function"===typeof t.read&&(this._read=t.read),"function"===typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function E(t,e,r,n,i){h("readableAddChunk",e);var o,a=t._readableState;if(null===e)a.reading=!1,function(t,e){if(h("onEofChunk"),e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?T(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,P(t)))}(t,a);else if(i||(o=function(t,e){var r;n=e,s.isBuffer(n)||n instanceof u||"string"===typeof e||void 0===e||t.objectMode||(r=new y("chunk",["string","Buffer","Uint8Array"],e));var n;return r}(a,e)),o)_(t,o);else if(a.objectMode||e&&e.length>0)if("string"===typeof e||a.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),n)a.endEmitted?_(t,new M):x(t,a,e,!0);else if(a.ended)_(t,new b);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?x(t,a,e,!1):C(t,a)):x(t,a,e,!1)}else n||(a.reading=!1,C(t,a));return!a.ended&&(a.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=O?t=O:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function T(t){var e=t._readableState;h("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(h("emitReadable",e.flowing),e.emittedReadable=!0,n.nextTick(P,t))}function P(t){var e=t._readableState;h("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,U(t)}function C(t,e){e.readingMore||(e.readingMore=!0,n.nextTick(B,t,e))}function B(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function N(t){h("readable nexttick read 0"),t.read(0)}function j(t,e){h("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),U(t),e.flowing&&!e.reading&&t.read(0)}function U(t){var e=t._readableState;for(h("flow",e.flowing);e.flowing&&null!==t.read(););}function L(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function D(t){var e=t._readableState;h("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,n.nextTick(q,e,t))}function q(t,e){if(h("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function F(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return h("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?D(this):T(this),null;if(0===(t=R(t,e))&&e.ended)return 0===e.length&&D(this),null;var n,i=e.needReadable;return h("need readable",i),(0===e.length||e.length-t0?L(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&D(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(t){_(this,new w("_read()"))},A.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,h("pipe count=%d opts=%j",i.pipesCount,e);var a=(!e||!1!==e.end)&&t!==n.stdout&&t!==n.stderr?u:v;function s(e,n){h("onunpipe"),e===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,h("cleanup"),t.removeListener("close",p),t.removeListener("finish",m),t.removeListener("drain",f),t.removeListener("error",d),t.removeListener("unpipe",s),r.removeListener("end",u),r.removeListener("end",v),r.removeListener("data",c),l=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}function u(){h("onend"),t.end()}i.endEmitted?n.nextTick(a):r.once("end",a),t.on("unpipe",s);var f=function(t){return function(){var e=t._readableState;h("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,U(t))}}(r);t.on("drain",f);var l=!1;function c(e){h("ondata");var n=t.write(e);h("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==F(i.pipes,t))&&!l&&(h("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function d(e){h("onerror",e),v(),t.removeListener("error",d),0===o(t,"error")&&_(t,e)}function p(){t.removeListener("finish",m),v()}function m(){h("onfinish"),t.removeListener("close",p),v()}function v(){h("unpipe"),r.unpipe(t)}return r.on("data",c),function(t,e,r){if("function"===typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",d),t.once("close",p),t.once("finish",m),t.emit("pipe",r),i.flowing||(h("pipe resume"),r.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,h("on readable",i.length,i.reading),i.length?T(this):i.reading||n.nextTick(N,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,e){var r=a.prototype.removeListener.call(this,t,e);return"readable"===t&&n.nextTick(I,this),r},A.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||n.nextTick(I,this),e},A.prototype.resume=function(){var t=this._readableState;return t.flowing||(h("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,n.nextTick(j,t,e))}(this,t)),t.paused=!1,this},A.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(h("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(h("wrapped data"),r.decoder&&(i=r.decoder.write(i)),!r.objectMode||null!==i&&void 0!==i)&&((r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause())))})),t)void 0===this[i]&&"function"===typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o-1))throw new M(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(t,e,r){r(new m("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,e,r){var i=this._writableState;return"function"===typeof t?(r=t,t=null,e=null):"function"===typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,r){e.ending=!0,P(t,e),r&&(e.finished?n.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,i,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),A.prototype.destroy=l.destroy,A.prototype._undestroy=l.undestroy,A.prototype._destroy=function(t,e){e(t)}}).call(this,r(12),r(11))},function(t,e,r){"use strict";t.exports=f;var n=r(47).codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(48);function h(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function c(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function d(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}n(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,p=0|this._f,m=0|this._g,v=0|this._h,g=0;g<16;++g)r[g]=t.readInt32BE(4*g);for(;g<64;++g)r[g]=0|(((e=r[g-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[g-7]+d(r[g-15])+r[g-16];for(var y=0;y<64;++y){var b=v+c(u)+h(u,p,m)+a[y]+r[y]|0,w=l(n)+f(n,i,o)|0;v=m,m=p,p=u,u=s+b|0,s=o,o=i,i=n,n=b+w|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0,this._f=p+this._f|0,this._g=m+this._g|0,this._h=v+this._h|0},u.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=u},function(t,e,r){var n=r(4),i=r(49),o=r(9).Buffer,a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function u(){this.init(),this._w=s,i.call(this,128,112)}function h(t,e,r){return r^t&(e^r)}function f(t,e,r){return t&e|r&(t|e)}function l(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function c(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function m(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function v(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function g(t,e){return t>>>0>>0?1:0}n(u,i),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,u=0|this._fh,y=0|this._gh,b=0|this._hh,w=0|this._al,M=0|this._bl,_=0|this._cl,k=0|this._dl,S=0|this._el,A=0|this._fl,E=0|this._gl,x=0|this._hl,O=0;O<32;O+=2)e[O]=t.readInt32BE(4*O),e[O+1]=t.readInt32BE(4*O+4);for(;O<160;O+=2){var R=e[O-30],T=e[O-30+1],P=d(R,T),C=p(T,R),B=m(R=e[O-4],T=e[O-4+1]),I=v(T,R),N=e[O-14],j=e[O-14+1],U=e[O-32],L=e[O-32+1],D=C+j|0,q=P+N+g(D,C)|0;q=(q=q+B+g(D=D+I|0,I)|0)+U+g(D=D+L|0,L)|0,e[O]=q,e[O+1]=D}for(var F=0;F<160;F+=2){q=e[F],D=e[F+1];var z=f(r,n,i),H=f(w,M,_),K=l(r,w),Z=l(w,r),W=c(s,S),V=c(S,s),G=a[F],J=a[F+1],X=h(s,u,y),$=h(S,A,E),Y=x+V|0,Q=b+W+g(Y,x)|0;Q=(Q=(Q=Q+X+g(Y=Y+$|0,$)|0)+G+g(Y=Y+J|0,J)|0)+q+g(Y=Y+D|0,D)|0;var tt=Z+H|0,et=K+z+g(tt,Z)|0;b=y,x=E,y=u,E=A,u=s,A=S,s=o+Q+g(S=k+Y|0,k)|0,o=i,k=_,i=n,_=M,n=r,M=w,r=Q+et+g(w=Y+tt|0,Y)|0}this._al=this._al+w|0,this._bl=this._bl+M|0,this._cl=this._cl+_|0,this._dl=this._dl+k|0,this._el=this._el+S|0,this._fl=this._fl+A|0,this._gl=this._gl+E|0,this._hl=this._hl+x|0,this._ah=this._ah+r+g(this._al,w)|0,this._bh=this._bh+n+g(this._bl,M)|0,this._ch=this._ch+i+g(this._cl,_)|0,this._dh=this._dh+o+g(this._dl,k)|0,this._eh=this._eh+s+g(this._el,S)|0,this._fh=this._fh+u+g(this._fl,A)|0,this._gh=this._gh+y+g(this._gl,E)|0,this._hh=this._hh+b+g(this._hl,x)|0},u.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=u},function(t,e,r){"use strict";var n=r(4),i=r(374),o=r(33),a=r(9).Buffer,s=r(164),u=r(97),h=r(98),f=a.alloc(128);function l(t,e){o.call(this,"digest"),"string"===typeof e&&(e=a.from(e));var r="sha512"===t||"sha384"===t?128:64;(this._alg=t,this._key=e,e.length>r)?e=("rmd160"===t?new u:h(t)).update(e).digest():e.lengthr||e!==e)throw new TypeError("Bad key length")}},function(t,e,r){(function(e,r){var n;if(e.process&&e.process.browser)n="utf-8";else if(e.process&&e.process.version){n=parseInt(r.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else n="utf-8";t.exports=n}).call(this,r(12),r(11))},function(t,e,r){var n=r(164),i=r(97),o=r(98),a=r(9).Buffer,s=r(167),u=r(168),h=r(170),f=a.alloc(128),l={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function c(t,e,r){var s=function(t){function e(e){return o(t).update(e).digest()}function r(t){return(new i).update(t).digest()}return"rmd160"===t||"ripemd160"===t?r:"md5"===t?n:e}(t),u="sha512"===t||"sha384"===t?128:64;e.length>u?e=s(e):e.length>>0},e.writeUInt32BE=function(t,e,r){t[0+r]=e>>>24,t[1+r]=e>>>16&255,t[2+r]=e>>>8&255,t[3+r]=255&e},e.ip=function(t,e,r,n){for(var i=0,o=0,a=6;a>=0;a-=2){for(var s=0;s<=24;s+=8)i<<=1,i|=e>>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=t>>>s+a&1}for(a=6;a>=0;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1}r[n+0]=i>>>0,r[n+1]=o>>>0},e.rip=function(t,e,r,n){for(var i=0,o=0,a=0;a<4;a++)for(var s=24;s>=0;s-=8)i<<=1,i|=e>>>s+a&1,i<<=1,i|=t>>>s+a&1;for(a=4;a<8;a++)for(s=24;s>=0;s-=8)o<<=1,o|=e>>>s+a&1,o<<=1,o|=t>>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},e.pc1=function(t,e,r,n){for(var i=0,o=0,a=7;a>=5;a--){for(var s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1}for(s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},e.r28shl=function(t,e){return t<>>28-e};var n=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];e.pc2=function(t,e,r,i){for(var o=0,a=0,s=n.length>>>1,u=0;u>>n[u]&1;for(u=s;u>>n[u]&1;r[i+0]=o>>>0,r[i+1]=a>>>0},e.expand=function(t,e,r){var n=0,i=0;n=(1&t)<<5|t>>>27;for(var o=23;o>=15;o-=4)n<<=6,n|=t>>>o&63;for(o=11;o>=3;o-=4)i|=t>>>o&63,i<<=6;i|=(31&t)<<1|t>>>31,e[r+0]=n>>>0,e[r+1]=i>>>0};var i=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];e.substitute=function(t,e){for(var r=0,n=0;n<4;n++){r<<=4,r|=i[64*n+(t>>>18-6*n&63)]}for(n=0;n<4;n++){r<<=4,r|=i[256+64*n+(e>>>18-6*n&63)]}return r>>>0};var o=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];e.permute=function(t){for(var e=0,r=0;r>>o[r]&1;return e>>>0},e.padSplit=function(t,e,r){for(var n=t.toString(2);n.length>>1];r=o.r28shl(r,s),i=o.r28shl(i,s),o.pc2(r,i,t.keys,a)}},u.prototype._update=function(t,e,r,n){var i=this._desState,a=o.readUInt32BE(t,e),s=o.readUInt32BE(t,e+4);o.ip(a,s,i.tmp,0),a=i.tmp[0],s=i.tmp[1],"encrypt"===this.type?this._encrypt(i,a,s,i.tmp,0):this._decrypt(i,a,s,i.tmp,0),a=i.tmp[0],s=i.tmp[1],o.writeUInt32BE(r,a,n),o.writeUInt32BE(r,s,n+4)},u.prototype._pad=function(t,e){for(var r=t.length-e,n=e;n>>0,a=c}o.rip(s,a,n,i)},u.prototype._decrypt=function(t,e,r,n,i){for(var a=r,s=e,u=t.keys.length-2;u>=0;u-=2){var h=t.keys[u],f=t.keys[u+1];o.expand(a,t.tmp,0),h^=t.tmp[0],f^=t.tmp[1];var l=o.substitute(h,f),c=a;a=(s^o.permute(l))>>>0,s=c}o.rip(a,s,n,i)}},function(t,e,r){var n=r(65),i=r(9).Buffer,o=r(174);function a(t){var e=t._cipher.encryptBlockRaw(t._prev);return o(t._prev),e}e.encrypt=function(t,e){var r=Math.ceil(e.length/16),o=t._cache.length;t._cache=i.concat([t._cache,i.allocUnsafe(16*r)]);for(var s=0;st;)r.ishrn(1);if(r.isEven()&&r.iadd(s),r.testn(1)||r.iadd(u),e.cmp(u)){if(!e.cmp(h))for(;r.mod(f).cmp(l);)r.iadd(d)}else for(;r.mod(o).cmp(c);)r.iadd(d);if(v(p=r.shrn(1))&&v(r)&&g(p)&&g(r)&&a.test(p)&&a.test(r))return r}}},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"===typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(393).Buffer}catch(A){}function s(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function h(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=u(t,e,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(t.length-e)%2===0?e+1:e;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var f=["","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"],l=[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 d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var h=1;h>>26,l=67108863&u,c=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=c;d++){var p=h-d|0;f+=(a=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&a}r.words[h]=0|l,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?f[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=l[t],d=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:f[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n("undefined"!==typeof a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===e,h=new t(o),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),h[s]=a;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"===typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,v=0|a[2],g=8191&v,y=v>>>13,b=0|a[3],w=8191&b,M=b>>>13,_=0|a[4],k=8191&_,S=_>>>13,A=0|a[5],E=8191&A,x=A>>>13,O=0|a[6],R=8191&O,T=O>>>13,P=0|a[7],C=8191&P,B=P>>>13,I=0|a[8],N=8191&I,j=I>>>13,U=0|a[9],L=8191&U,D=U>>>13,q=0|s[0],F=8191&q,z=q>>>13,H=0|s[1],K=8191&H,Z=H>>>13,W=0|s[2],V=8191&W,G=W>>>13,J=0|s[3],X=8191&J,$=J>>>13,Y=0|s[4],Q=8191&Y,tt=Y>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ht=st>>>13,ft=0|s[8],lt=8191&ft,ct=ft>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(n=Math.imul(l,F))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;h=((o=Math.imul(c,z))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(h+(n=n+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,Z)|0)+Math.imul(c,K)|0))<<13)|0;h=((o=o+Math.imul(c,Z)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,F),i=(i=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,Z)|0;var yt=(h+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;h=((o=o+Math.imul(c,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,Z)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,Z)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(h+(n=n+Math.imul(l,X)|0)|0)+((8191&(i=(i=i+Math.imul(l,$)|0)+Math.imul(c,X)|0))<<13)|0;h=((o=o+Math.imul(c,$)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(k,F),i=(i=Math.imul(k,z))+Math.imul(S,F)|0,o=Math.imul(S,z),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(M,K)|0,o=o+Math.imul(M,Z)|0,n=n+Math.imul(g,V)|0,i=(i=i+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,$)|0;var wt=(h+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,z))+Math.imul(x,F)|0,o=Math.imul(x,z),n=n+Math.imul(k,K)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,n=n+Math.imul(g,X)|0,i=(i=i+Math.imul(g,$)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(h+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(c,rt)|0))<<13)|0;h=((o=o+Math.imul(c,nt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,F),i=(i=Math.imul(R,z))+Math.imul(T,F)|0,o=Math.imul(T,z),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,Z)|0,n=n+Math.imul(k,V)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,$)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var _t=(h+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,at)|0)+Math.imul(c,ot)|0))<<13)|0;h=((o=o+Math.imul(c,at)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,z))+Math.imul(B,F)|0,o=Math.imul(B,z),n=n+Math.imul(R,K)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(T,K)|0,o=o+Math.imul(T,Z)|0,n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,n=n+Math.imul(k,X)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,$)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var kt=(h+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(c,ut)|0))<<13)|0;h=((o=o+Math.imul(c,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(N,F),i=(i=Math.imul(N,z))+Math.imul(j,F)|0,o=Math.imul(j,z),n=n+Math.imul(C,K)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,G)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,$)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var St=(h+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;h=((o=o+Math.imul(c,ct)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(L,F),i=(i=Math.imul(L,z))+Math.imul(D,F)|0,o=Math.imul(D,z),n=n+Math.imul(N,K)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(j,K)|0,o=o+Math.imul(j,Z)|0,n=n+Math.imul(C,V)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(B,V)|0,o=o+Math.imul(B,G)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,$)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,$)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,at)|0,n=n+Math.imul(g,ut)|0,i=(i=i+Math.imul(g,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var At=(h+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;h=((o=o+Math.imul(c,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(L,K),i=(i=Math.imul(L,Z))+Math.imul(D,K)|0,o=Math.imul(D,Z),n=n+Math.imul(N,V)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,$)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,$)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,at)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,at)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ht)|0,n=n+Math.imul(g,lt)|0,i=(i=i+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var Et=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(L,V),i=(i=Math.imul(L,G))+Math.imul(D,V)|0,o=Math.imul(D,G),n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,$)|0)+Math.imul(j,X)|0,o=o+Math.imul(j,$)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,at)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ht)|0,n=n+Math.imul(w,lt)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var xt=(h+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(L,X),i=(i=Math.imul(L,$))+Math.imul(D,X)|0,o=Math.imul(D,$),n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,at)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ht)|0,n=n+Math.imul(k,lt)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(S,lt)|0,o=o+Math.imul(S,ct)|0;var Ot=(h+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;h=((o=o+Math.imul(M,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(L,Q),i=(i=Math.imul(L,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(N,rt)|0,i=(i=i+Math.imul(N,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,at)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,at)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ht)|0,n=n+Math.imul(E,lt)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Rt=(h+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,mt)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(L,rt),i=(i=Math.imul(L,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(N,ot)|0,i=(i=i+Math.imul(N,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,n=n+Math.imul(C,ut)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ht)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(T,lt)|0,o=o+Math.imul(T,ct)|0;var Tt=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((o=o+Math.imul(x,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(L,ot),i=(i=Math.imul(L,at))+Math.imul(D,ot)|0,o=Math.imul(D,at),n=n+Math.imul(N,ut)|0,i=(i=i+Math.imul(N,ht)|0)+Math.imul(j,ut)|0,o=o+Math.imul(j,ht)|0,n=n+Math.imul(C,lt)|0,i=(i=i+Math.imul(C,ct)|0)+Math.imul(B,lt)|0,o=o+Math.imul(B,ct)|0;var Pt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(T,pt)|0))<<13)|0;h=((o=o+Math.imul(T,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(L,ut),i=(i=Math.imul(L,ht))+Math.imul(D,ut)|0,o=Math.imul(D,ht),n=n+Math.imul(N,lt)|0,i=(i=i+Math.imul(N,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var Ct=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(B,pt)|0))<<13)|0;h=((o=o+Math.imul(B,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(L,lt),i=(i=Math.imul(L,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var Bt=(h+(n=n+Math.imul(N,pt)|0)|0)+((8191&(i=(i=i+Math.imul(N,mt)|0)+Math.imul(j,pt)|0))<<13)|0;h=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var It=(h+(n=Math.imul(L,pt))|0)+((8191&(i=(i=Math.imul(L,mt))+Math.imul(D,pt)|0))<<13)|0;return h=((o=Math.imul(D,mt))+(i>>>13)|0)+(It>>>26)|0,It&=67108863,u[0]=vt,u[1]=gt,u[2]=yt,u[3]=bt,u[4]=wt,u[5]=Mt,u[6]=_t,u[7]=kt,u[8]=St,u[9]=At,u[10]=Et,u[11]=xt,u[12]=Ot,u[13]=Rt,u[14]=Tt,u[15]=Pt,u[16]=Ct,u[17]=Bt,u[18]=It,0!==h&&(u[19]=h,r.length++),r};function m(t,e,r){return(new v).mulp(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(p=d),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):m(this,t,e),r},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},v.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,h=0;h=0&&(0!==f||h>=i);h--){var l=0|this.words[h];this.words[h]=f<<26-o|l>>>o,f=l&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"===typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var h=0;h=0;l--){var c=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(c=Math.min(c/a|0,67108863),n._ishlnsubmul(i,c,l);0!==n.negative;)c--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=c)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0===(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(l)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,f=1;0===(e.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(e.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,c=1;0===(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"===typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new k(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(b,y),b.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return g[t]=e,e},k.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,i),c=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=a;0!==d.cmp(s);){for(var m=d,v=0;0!==m.cmp(s);v++)m=m.redSqr();n(v=0;n--){for(var h=e.words[n],f=u-1;f>=0;f--){var l=h>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===n&&0===f)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},i(S,k),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(17)(t))},function(t,e,r){var n=r(394),i=r(102);function o(t){this.rand=t||new i.Rand}t.exports=o,o.create=function(t){return new o(t)},o.prototype._randbelow=function(t){var e=t.bitLength(),r=Math.ceil(e/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(t)>=0);return i},o.prototype._randrange=function(t,e){var r=e.sub(t);return t.add(this._randbelow(r))},o.prototype.test=function(t,e,r){var i=t.bitLength(),o=n.mont(t),a=new n(1).toRed(o);e||(e=Math.max(1,i/48|0));for(var s=t.subn(1),u=0;!s.testn(u);u++);for(var h=t.shrn(u),f=s.toRed(o);e>0;e--){var l=this._randrange(new n(2),s);r&&r(l);var c=l.toRed(o).redPow(h);if(0!==c.cmp(a)&&0!==c.cmp(f)){for(var d=1;d0;e--){var f=this._randrange(new n(2),a),l=t.gcd(f);if(0!==l.cmpn(1))return l;var c=f.toRed(i).redPow(u);if(0!==c.cmp(o)&&0!==c.cmp(h)){for(var d=1;d0)if("string"===typeof e||a.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),n)a.endEmitted?_(t,new M):x(t,a,e,!0);else if(a.ended)_(t,new b);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?x(t,a,e,!1):C(t,a)):x(t,a,e,!1)}else n||(a.reading=!1,C(t,a));return!a.ended&&(a.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=O?t=O:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function T(t){var e=t._readableState;h("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(h("emitReadable",e.flowing),e.emittedReadable=!0,n.nextTick(P,t))}function P(t){var e=t._readableState;h("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,U(t)}function C(t,e){e.readingMore||(e.readingMore=!0,n.nextTick(B,t,e))}function B(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function N(t){h("readable nexttick read 0"),t.read(0)}function j(t,e){h("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),U(t),e.flowing&&!e.reading&&t.read(0)}function U(t){var e=t._readableState;for(h("flow",e.flowing);e.flowing&&null!==t.read(););}function L(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function D(t){var e=t._readableState;h("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,n.nextTick(q,e,t))}function q(t,e){if(h("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function F(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return h("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?D(this):T(this),null;if(0===(t=R(t,e))&&e.ended)return 0===e.length&&D(this),null;var n,i=e.needReadable;return h("need readable",i),(0===e.length||e.length-t0?L(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&D(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(t){_(this,new w("_read()"))},A.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,h("pipe count=%d opts=%j",i.pipesCount,e);var a=(!e||!1!==e.end)&&t!==n.stdout&&t!==n.stderr?u:v;function s(e,n){h("onunpipe"),e===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,h("cleanup"),t.removeListener("close",p),t.removeListener("finish",m),t.removeListener("drain",f),t.removeListener("error",d),t.removeListener("unpipe",s),r.removeListener("end",u),r.removeListener("end",v),r.removeListener("data",c),l=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}function u(){h("onend"),t.end()}i.endEmitted?n.nextTick(a):r.once("end",a),t.on("unpipe",s);var f=function(t){return function(){var e=t._readableState;h("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,U(t))}}(r);t.on("drain",f);var l=!1;function c(e){h("ondata");var n=t.write(e);h("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==F(i.pipes,t))&&!l&&(h("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function d(e){h("onerror",e),v(),t.removeListener("error",d),0===o(t,"error")&&_(t,e)}function p(){t.removeListener("finish",m),v()}function m(){h("onfinish"),t.removeListener("close",p),v()}function v(){h("unpipe"),r.unpipe(t)}return r.on("data",c),function(t,e,r){if("function"===typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",d),t.once("close",p),t.once("finish",m),t.emit("pipe",r),i.flowing||(h("pipe resume"),r.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,h("on readable",i.length,i.reading),i.length?T(this):i.reading||n.nextTick(N,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,e){var r=a.prototype.removeListener.call(this,t,e);return"readable"===t&&n.nextTick(I,this),r},A.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||n.nextTick(I,this),e},A.prototype.resume=function(){var t=this._readableState;return t.flowing||(h("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,n.nextTick(j,t,e))}(this,t)),t.paused=!1,this},A.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(h("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(h("wrapped data"),r.decoder&&(i=r.decoder.write(i)),!r.objectMode||null!==i&&void 0!==i)&&((r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause())))})),t)void 0===this[i]&&"function"===typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o-1))throw new M(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(t,e,r){r(new m("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,e,r){var i=this._writableState;return"function"===typeof t?(r=t,t=null,e=null):"function"===typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,r){e.ending=!0,P(t,e),r&&(e.finished?n.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,i,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),A.prototype.destroy=l.destroy,A.prototype._undestroy=l.undestroy,A.prototype._destroy=function(t,e){e(t)}}).call(this,r(12),r(11))},function(t,e,r){"use strict";t.exports=f;var n=r(50).codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(51);function h(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length>8,a=255&i;o?r.push(o,a):r.push(a)}return r},n.zero2=i,n.toHex=o,n.encode=function(t,e){return"hex"===e?o(t):t}},function(t,e,r){"use strict";var n=e;n.base=r(81),n.short=r(412),n.mont=r(413),n.edwards=r(414)},function(t,e,r){"use strict";var n=e;n.bignum=r(190),n.define=r(425).define,n.base=r(428),n.constants=r(429),n.decoders=r(193),n.encoders=r(191)},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"===typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(424).Buffer}catch(A){}function s(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function h(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=u(t,e,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(t.length-e)%2===0?e+1:e;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var f=["","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"],l=[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 d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var h=1;h>>26,l=67108863&u,c=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=c;d++){var p=h-d|0;f+=(a=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&a}r.words[h]=0|l,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?f[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=l[t],d=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:f[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n("undefined"!==typeof a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===e,h=new t(o),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),h[s]=a;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"===typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,v=0|a[2],g=8191&v,y=v>>>13,b=0|a[3],w=8191&b,M=b>>>13,_=0|a[4],k=8191&_,S=_>>>13,A=0|a[5],E=8191&A,x=A>>>13,O=0|a[6],R=8191&O,T=O>>>13,P=0|a[7],C=8191&P,B=P>>>13,I=0|a[8],N=8191&I,j=I>>>13,U=0|a[9],L=8191&U,D=U>>>13,q=0|s[0],F=8191&q,z=q>>>13,H=0|s[1],K=8191&H,Z=H>>>13,W=0|s[2],V=8191&W,G=W>>>13,J=0|s[3],X=8191&J,$=J>>>13,Y=0|s[4],Q=8191&Y,tt=Y>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ht=st>>>13,ft=0|s[8],lt=8191&ft,ct=ft>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(n=Math.imul(l,F))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;h=((o=Math.imul(c,z))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(h+(n=n+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,Z)|0)+Math.imul(c,K)|0))<<13)|0;h=((o=o+Math.imul(c,Z)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,F),i=(i=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,Z)|0;var yt=(h+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;h=((o=o+Math.imul(c,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,Z)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,Z)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(h+(n=n+Math.imul(l,X)|0)|0)+((8191&(i=(i=i+Math.imul(l,$)|0)+Math.imul(c,X)|0))<<13)|0;h=((o=o+Math.imul(c,$)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(k,F),i=(i=Math.imul(k,z))+Math.imul(S,F)|0,o=Math.imul(S,z),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(M,K)|0,o=o+Math.imul(M,Z)|0,n=n+Math.imul(g,V)|0,i=(i=i+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,$)|0;var wt=(h+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,z))+Math.imul(x,F)|0,o=Math.imul(x,z),n=n+Math.imul(k,K)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,n=n+Math.imul(g,X)|0,i=(i=i+Math.imul(g,$)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(h+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(c,rt)|0))<<13)|0;h=((o=o+Math.imul(c,nt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,F),i=(i=Math.imul(R,z))+Math.imul(T,F)|0,o=Math.imul(T,z),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,Z)|0,n=n+Math.imul(k,V)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,$)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var _t=(h+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,at)|0)+Math.imul(c,ot)|0))<<13)|0;h=((o=o+Math.imul(c,at)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,z))+Math.imul(B,F)|0,o=Math.imul(B,z),n=n+Math.imul(R,K)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(T,K)|0,o=o+Math.imul(T,Z)|0,n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,n=n+Math.imul(k,X)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,$)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var kt=(h+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(c,ut)|0))<<13)|0;h=((o=o+Math.imul(c,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(N,F),i=(i=Math.imul(N,z))+Math.imul(j,F)|0,o=Math.imul(j,z),n=n+Math.imul(C,K)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,G)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,$)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var St=(h+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;h=((o=o+Math.imul(c,ct)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(L,F),i=(i=Math.imul(L,z))+Math.imul(D,F)|0,o=Math.imul(D,z),n=n+Math.imul(N,K)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(j,K)|0,o=o+Math.imul(j,Z)|0,n=n+Math.imul(C,V)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(B,V)|0,o=o+Math.imul(B,G)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,$)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,$)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,at)|0,n=n+Math.imul(g,ut)|0,i=(i=i+Math.imul(g,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var At=(h+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;h=((o=o+Math.imul(c,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(L,K),i=(i=Math.imul(L,Z))+Math.imul(D,K)|0,o=Math.imul(D,Z),n=n+Math.imul(N,V)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,$)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,$)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,at)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,at)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ht)|0,n=n+Math.imul(g,lt)|0,i=(i=i+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var Et=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(L,V),i=(i=Math.imul(L,G))+Math.imul(D,V)|0,o=Math.imul(D,G),n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,$)|0)+Math.imul(j,X)|0,o=o+Math.imul(j,$)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,at)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ht)|0,n=n+Math.imul(w,lt)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var xt=(h+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(L,X),i=(i=Math.imul(L,$))+Math.imul(D,X)|0,o=Math.imul(D,$),n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,at)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ht)|0,n=n+Math.imul(k,lt)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(S,lt)|0,o=o+Math.imul(S,ct)|0;var Ot=(h+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;h=((o=o+Math.imul(M,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(L,Q),i=(i=Math.imul(L,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(N,rt)|0,i=(i=i+Math.imul(N,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,at)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,at)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ht)|0,n=n+Math.imul(E,lt)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Rt=(h+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,mt)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(L,rt),i=(i=Math.imul(L,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(N,ot)|0,i=(i=i+Math.imul(N,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,n=n+Math.imul(C,ut)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ht)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(T,lt)|0,o=o+Math.imul(T,ct)|0;var Tt=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((o=o+Math.imul(x,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(L,ot),i=(i=Math.imul(L,at))+Math.imul(D,ot)|0,o=Math.imul(D,at),n=n+Math.imul(N,ut)|0,i=(i=i+Math.imul(N,ht)|0)+Math.imul(j,ut)|0,o=o+Math.imul(j,ht)|0,n=n+Math.imul(C,lt)|0,i=(i=i+Math.imul(C,ct)|0)+Math.imul(B,lt)|0,o=o+Math.imul(B,ct)|0;var Pt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(T,pt)|0))<<13)|0;h=((o=o+Math.imul(T,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(L,ut),i=(i=Math.imul(L,ht))+Math.imul(D,ut)|0,o=Math.imul(D,ht),n=n+Math.imul(N,lt)|0,i=(i=i+Math.imul(N,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var Ct=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(B,pt)|0))<<13)|0;h=((o=o+Math.imul(B,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(L,lt),i=(i=Math.imul(L,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var Bt=(h+(n=n+Math.imul(N,pt)|0)|0)+((8191&(i=(i=i+Math.imul(N,mt)|0)+Math.imul(j,pt)|0))<<13)|0;h=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var It=(h+(n=Math.imul(L,pt))|0)+((8191&(i=(i=Math.imul(L,mt))+Math.imul(D,pt)|0))<<13)|0;return h=((o=Math.imul(D,mt))+(i>>>13)|0)+(It>>>26)|0,It&=67108863,u[0]=vt,u[1]=gt,u[2]=yt,u[3]=bt,u[4]=wt,u[5]=Mt,u[6]=_t,u[7]=kt,u[8]=St,u[9]=At,u[10]=Et,u[11]=xt,u[12]=Ot,u[13]=Rt,u[14]=Tt,u[15]=Pt,u[16]=Ct,u[17]=Bt,u[18]=It,0!==h&&(u[19]=h,r.length++),r};function m(t,e,r){return(new v).mulp(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(p=d),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):m(this,t,e),r},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},v.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,h=0;h=0&&(0!==f||h>=i);h--){var l=0|this.words[h];this.words[h]=f<<26-o|l>>>o,f=l&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"===typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var h=0;h=0;l--){var c=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(c=Math.min(c/a|0,67108863),n._ishlnsubmul(i,c,l);0!==n.negative;)c--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=c)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0===(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(l)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,f=1;0===(e.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(e.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,c=1;0===(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"===typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new k(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(b,y),b.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return g[t]=e,e},k.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,i),c=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=a;0!==d.cmp(s);){for(var m=d,v=0;0!==m.cmp(s);v++)m=m.redSqr();n(v=0;n--){for(var h=e.words[n],f=u-1;f>=0;f--){var l=h>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===n&&0===f)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},i(S,k),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(17)(t))},function(t,e,r){"use strict";var n=e;n.der=r(192),n.pem=r(426)},function(t,e,r){"use strict";var n=r(4),i=r(107).Buffer,o=r(108),a=r(110);function s(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new u,this.tree._init(t.body)}function u(t){o.call(this,"der",t)}function h(t){return t<10?"0"+t:t}t.exports=s,s.prototype.encode=function(t,e){return this.tree._encode(t,e).join()},n(u,o),u.prototype._encodeComposite=function(t,e,r,n){var o=function(t,e,r,n){var i;"seqof"===t?t="seq":"setof"===t&&(t="set");if(a.tagByName.hasOwnProperty(t))i=a.tagByName[t];else{if("number"!==typeof t||(0|t)!==t)return n.error("Unknown tag: "+t);i=t}if(i>=31)return n.error("Multi-octet tag encoding unsupported");e||(i|=32);return i|=a.tagClassByName[r||"universal"]<<6}(t,e,r,this.reporter);if(n.length<128){var s=i.alloc(2);return s[0]=o,s[1]=n.length,this._createEncoderBuffer([s,n])}for(var u=1,h=n.length;h>=256;h>>=8)u++;var f=i.alloc(2+u);f[0]=o,f[1]=128|u;for(var l=1+u,c=n.length;c>0;l--,c>>=8)f[l]=255&c;return this._createEncoderBuffer([f,n])},u.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){for(var r=i.alloc(2*t.length),n=0;n=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}for(var a=0,s=0;s=128;u>>=7)a++}for(var h=i.alloc(a),f=h.length-1,l=t.length-1;l>=0;l--){var c=t[l];for(h[f--]=127&c;(c>>=7)>0;)h[f--]=128|127&c}return this._createEncoderBuffer(h)},u.prototype._encodeTime=function(t,e){var r,n=new Date(t);return"gentime"===e?r=[h(n.getUTCFullYear()),h(n.getUTCMonth()+1),h(n.getUTCDate()),h(n.getUTCHours()),h(n.getUTCMinutes()),h(n.getUTCSeconds()),"Z"].join(""):"utctime"===e?r=[h(n.getUTCFullYear()%100),h(n.getUTCMonth()+1),h(n.getUTCDate()),h(n.getUTCHours()),h(n.getUTCMinutes()),h(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(r,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.prototype._encodeInt=function(t,e){if("string"===typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!==typeof t&&!i.isBuffer(t)){var r=t.toArray();!t.sign&&128&r[0]&&r.unshift(0),t=i.from(r)}if(i.isBuffer(t)){var n=t.length;0===t.length&&n++;var o=i.alloc(n);return t.copy(o),0===t.length&&(o[0]=0),this._createEncoderBuffer(o)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);for(var a=1,s=t;s>=256;s>>=8)a++;for(var u=new Array(a),h=u.length-1;h>=0;h--)u[h]=255&t,t>>=8;return 128&u[0]&&u.unshift(0),this._createEncoderBuffer(i.from(u))},u.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},u.prototype._use=function(t,e){return"function"===typeof t&&(t=t(e)),t._getEncoder("der").tree},u.prototype._skipDefault=function(t,e,r){var n,i=this._baseState;if(null===i.default)return!1;var o=t.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,e,r).join()),o.length!==i.defaultBuffer.length)return!1;for(n=0;n>6],i=0===(32&r);if(31===(31&r)){var o=r;for(r=0;128===(128&o);){if(o=t.readUInt8(e),t.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:s.tag[r]}}function l(t,e,r){var n=t.readUInt8(r);if(t.isError(n))return n;if(!e&&128===n)return null;if(0===(128&n))return n;var i=127&n;if(i>4)return t.error("length octect is too long");n=0;for(var o=0;o>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(h<<1|f>>>31),r=a^(f<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(l<<1|c>>>31),r=u^(c<<1|l>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(d<<1|p>>>31),r=f^(p<<1|d>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=l^(i<<1|a>>>31),r=c^(a<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,m=t[0],v=t[1],V=t[11]<<4|t[10]>>>28,G=t[10]<<4|t[11]>>>28,R=t[20]<<3|t[21]>>>29,T=t[21]<<3|t[20]>>>29,st=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,H=t[40]<<18|t[41]>>>14,K=t[41]<<18|t[40]>>>14,N=t[2]<<1|t[3]>>>31,j=t[3]<<1|t[2]>>>31,g=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,X=t[23]<<10|t[22]>>>22,P=t[33]<<13|t[32]>>>19,C=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,ft=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,U=t[14]<<6|t[15]>>>26,L=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,B=t[45]<<29|t[44]>>>3,I=t[44]<<29|t[45]>>>3,A=t[6]<<28|t[7]>>>4,E=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,q=t[27]<<25|t[26]>>>7,M=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,Z=t[8]<<27|t[9]>>>5,W=t[9]<<27|t[8]>>>5,x=t[18]<<20|t[19]>>>12,O=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,at=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,z=t[39]<<8|t[38]>>>24,k=t[48]<<14|t[49]>>>18,S=t[49]<<14|t[48]>>>18,t[0]=m^~g&b,t[1]=v^~y&w,t[10]=A^~x&R,t[11]=E^~O&T,t[20]=N^~U&D,t[21]=j^~L&q,t[30]=Z^~V&J,t[31]=W^~G&X,t[40]=et^~nt&ot,t[41]=rt^~it&at,t[2]=g^~b&M,t[3]=y^~w&_,t[12]=x^~R&P,t[13]=O^~T&C,t[22]=U^~D&F,t[23]=L^~q&z,t[32]=V^~J&$,t[33]=G^~X&Y,t[42]=nt^~ot&st,t[43]=it^~at&ut,t[4]=b^~M&k,t[5]=w^~_&S,t[14]=R^~P&B,t[15]=T^~C&I,t[24]=D^~F&H,t[25]=q^~z&K,t[34]=J^~$&Q,t[35]=X^~Y&tt,t[44]=ot^~st&ht,t[45]=at^~ut&ft,t[6]=M^~k&m,t[7]=_^~S&v,t[16]=P^~B&A,t[17]=C^~I&E,t[26]=F^~H&N,t[27]=z^~K&j,t[36]=$^~Q&Z,t[37]=Y^~tt&W,t[46]=st^~ht&et,t[47]=ut^~ft&rt,t[8]=k^~m&g,t[9]=S^~v&y,t[18]=B^~A&x,t[19]=I^~E&O,t[28]=H^~N&U,t[29]=K^~j&L,t[38]=Q^~Z&V,t[39]=tt^~W&G,t[48]=ht^~et&nt,t[49]=ft^~rt&it,t[0]^=o[n],t[1]^=o[n+1]},s=function(t){return function(e){var o;if("0x"===e.slice(0,2)){o=[];for(var s=2,u=e.length;s>2]|=e[d]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(u[v>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=h){for(t.start=v-h,t.block=u[f],v=0;v>2]|=n[3&v],t.lastByteIndex===h)for(u[0]=u[f],v=1;v>4&15]+r[15&p]+r[p>>12&15]+r[p>>8&15]+r[p>>20&15]+r[p>>16&15]+r[p>>28&15]+r[p>>24&15];g%f===0&&(a(c),v=0)}return"0x"+m}(function(t){return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(e=[0,0,0,0,0,0,0,0,0,0],[].concat(e,e,e,e,e))};var e}(t),o)}};t.exports={keccak256:s(256),keccak512:s(512),keccak256s:s(256),keccak512s:s(512)}},function(t,e){var r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(r){var n=new Uint8Array(16);t.exports=function(){return r(n),n}}else{var i=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0===(3&e)&&(t=4294967296*Math.random()),i[e]=t>>>((3&e)<<3)&255;return i}}},function(t,e){for(var r=[],n=0;n<256;++n)r[n]=(n+256).toString(16).substr(1);t.exports=function(t,e){var n=e||0,i=r;return[i[t[n++]],i[t[n++]],i[t[n++]],i[t[n++]],"-",i[t[n++]],i[t[n++]],"-",i[t[n++]],i[t[n++]],"-",i[t[n++]],i[t[n++]],"-",i[t[n++]],i[t[n++]],i[t[n++]],i[t[n++]],i[t[n++]],i[t[n++]]].join("")}},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||e.hasOwnProperty(r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0});var o=r(450);Object.defineProperty(e,"Transaction",{enumerable:!0,get:function(){return o.default}});var a=r(508);Object.defineProperty(e,"AccessListEIP2930Transaction",{enumerable:!0,get:function(){return a.default}});var s=r(509);Object.defineProperty(e,"TransactionFactory",{enumerable:!0,get:function(){return s.default}});var u=r(510);Object.defineProperty(e,"FeeMarketEIP1559Transaction",{enumerable:!0,get:function(){return u.default}}),i(r(55),e)},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.KECCAK256_RLP=e.KECCAK256_RLP_S=e.KECCAK256_RLP_ARRAY=e.KECCAK256_RLP_ARRAY_S=e.KECCAK256_NULL=e.KECCAK256_NULL_S=e.TWO_POW256=e.MAX_INTEGER=void 0;var i=r(2).Buffer,o=n(r(28));e.MAX_INTEGER=new o.default("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),e.TWO_POW256=new o.default("10000000000000000000000000000000000000000000000000000000000000000",16),e.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",e.KECCAK256_NULL=i.from(e.KECCAK256_NULL_S,"hex"),e.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",e.KECCAK256_RLP_ARRAY=i.from(e.KECCAK256_RLP_ARRAY_S,"hex"),e.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",e.KECCAK256_RLP=i.from(e.KECCAK256_RLP_S,"hex")},function(t,e,r){"use strict";(function(t){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},a=this&&this.__read||function(t,e){var r="function"===typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(s){i={error:s}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.isZeroAddress=e.zeroAddress=e.importPublic=e.privateToAddress=e.privateToPublic=e.publicToAddress=e.pubToAddress=e.isValidPublic=e.isValidPrivate=e.generateAddress2=e.generateAddress=e.isValidChecksumAddress=e.toChecksumAddress=e.isValidAddress=e.Account=void 0;var u=s(r(112)),h=s(r(28)),f=o(r(83)),l=r(205),c=r(52),d=r(203),p=r(42),m=r(113),v=r(84),g=r(115),y=function(){function t(t,e,r,n){void 0===t&&(t=new h.default(0)),void 0===e&&(e=new h.default(0)),void 0===r&&(r=d.KECCAK256_RLP),void 0===n&&(n=d.KECCAK256_NULL),this.nonce=t,this.balance=e,this.stateRoot=r,this.codeHash=n,this._validate()}return t.fromAccountData=function(e){var r=e.nonce,n=e.balance,i=e.stateRoot,o=e.codeHash;return new t(r?new h.default(p.toBuffer(r)):void 0,n?new h.default(p.toBuffer(n)):void 0,i?p.toBuffer(i):void 0,o?p.toBuffer(o):void 0)},t.fromRlpSerializedAccount=function(t){var e=f.decode(t);if(!Array.isArray(e))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(e)},t.fromValuesArray=function(e){var r=a(e,4),n=r[0],i=r[1],o=r[2],s=r[3];return new t(new h.default(n),new h.default(i),o,s)},t.prototype._validate=function(){if(this.nonce.lt(new h.default(0)))throw new Error("nonce must be greater than zero");if(this.balance.lt(new h.default(0)))throw new Error("balance must be greater than zero");if(32!==this.stateRoot.length)throw new Error("stateRoot must have a length of 32");if(32!==this.codeHash.length)throw new Error("codeHash must have a length of 32")},t.prototype.raw=function(){return[g.bnToUnpaddedBuffer(this.nonce),g.bnToUnpaddedBuffer(this.balance),this.stateRoot,this.codeHash]},t.prototype.serialize=function(){return f.encode(this.raw())},t.prototype.isContract=function(){return!this.codeHash.equals(d.KECCAK256_NULL)},t.prototype.isEmpty=function(){return this.balance.isZero()&&this.nonce.isZero()&&this.codeHash.equals(d.KECCAK256_NULL)},t}();e.Account=y,e.isValidAddress=function(t){try{v.assertIsString(t)}catch(e){return!1}return/^0x[0-9a-fA-F]{40}$/.test(t)},e.toChecksumAddress=function(t,e){v.assertIsHexString(t);var r=c.stripHexPrefix(t).toLowerCase(),n="";e&&(n=g.toType(e,g.TypeOutput.BN).toString()+"0x");for(var i=m.keccakFromString(n+r).toString("hex"),o="0x",a=0;a=8?o+=r[a].toUpperCase():o+=r[a];return o},e.isValidChecksumAddress=function(t,r){return e.isValidAddress(t)&&e.toChecksumAddress(t,r)===t},e.generateAddress=function(e,r){v.assertIsBuffer(e),v.assertIsBuffer(r);var n=new h.default(r);return n.isZero()?m.rlphash([e,null]).slice(-20):m.rlphash([e,t.from(n.toArray())]).slice(-20)},e.generateAddress2=function(e,r,n){return v.assertIsBuffer(e),v.assertIsBuffer(r),v.assertIsBuffer(n),u.default(20===e.length),u.default(32===r.length),m.keccak256(t.concat([t.from("ff","hex"),e,r,m.keccak256(n)])).slice(-20)},e.isValidPrivate=function(t){return l.privateKeyVerify(t)},e.isValidPublic=function(e,r){return void 0===r&&(r=!1),v.assertIsBuffer(e),64===e.length?l.publicKeyVerify(t.concat([t.from([4]),e])):!!r&&l.publicKeyVerify(e)},e.pubToAddress=function(e,r){return void 0===r&&(r=!1),v.assertIsBuffer(e),r&&64!==e.length&&(e=t.from(l.publicKeyConvert(e,!1).slice(1))),u.default(64===e.length),m.keccak(e).slice(-20)},e.publicToAddress=e.pubToAddress,e.privateToPublic=function(e){return v.assertIsBuffer(e),t.from(l.publicKeyCreate(e,!1)).slice(1)},e.privateToAddress=function(t){return e.publicToAddress(e.privateToPublic(t))},e.importPublic=function(e){return v.assertIsBuffer(e),64!==e.length&&(e=t.from(l.publicKeyConvert(e,!1).slice(1))),e},e.zeroAddress=function(){var t=p.zeros(20);return p.bufferToHex(t)},e.isZeroAddress=function(t){try{v.assertIsString(t)}catch(r){return!1}return e.zeroAddress()===t}}).call(this,r(2).Buffer)},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(e){o(e)}}function s(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)if("string"===typeof e||a.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),n)a.endEmitted?_(t,new M):x(t,a,e,!0);else if(a.ended)_(t,new b);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?x(t,a,e,!1):C(t,a)):x(t,a,e,!1)}else n||(a.reading=!1,C(t,a));return!a.ended&&(a.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=O?t=O:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function T(t){var e=t._readableState;h("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(h("emitReadable",e.flowing),e.emittedReadable=!0,n.nextTick(P,t))}function P(t){var e=t._readableState;h("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,U(t)}function C(t,e){e.readingMore||(e.readingMore=!0,n.nextTick(B,t,e))}function B(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function N(t){h("readable nexttick read 0"),t.read(0)}function j(t,e){h("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),U(t),e.flowing&&!e.reading&&t.read(0)}function U(t){var e=t._readableState;for(h("flow",e.flowing);e.flowing&&null!==t.read(););}function L(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function D(t){var e=t._readableState;h("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,n.nextTick(q,e,t))}function q(t,e){if(h("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function F(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return h("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?D(this):T(this),null;if(0===(t=R(t,e))&&e.ended)return 0===e.length&&D(this),null;var n,i=e.needReadable;return h("need readable",i),(0===e.length||e.length-t0?L(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&D(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(t){_(this,new w("_read()"))},A.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,h("pipe count=%d opts=%j",i.pipesCount,e);var a=(!e||!1!==e.end)&&t!==n.stdout&&t!==n.stderr?u:v;function s(e,n){h("onunpipe"),e===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,h("cleanup"),t.removeListener("close",p),t.removeListener("finish",m),t.removeListener("drain",f),t.removeListener("error",d),t.removeListener("unpipe",s),r.removeListener("end",u),r.removeListener("end",v),r.removeListener("data",c),l=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}function u(){h("onend"),t.end()}i.endEmitted?n.nextTick(a):r.once("end",a),t.on("unpipe",s);var f=function(t){return function(){var e=t._readableState;h("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,U(t))}}(r);t.on("drain",f);var l=!1;function c(e){h("ondata");var n=t.write(e);h("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==F(i.pipes,t))&&!l&&(h("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function d(e){h("onerror",e),v(),t.removeListener("error",d),0===o(t,"error")&&_(t,e)}function p(){t.removeListener("finish",m),v()}function m(){h("onfinish"),t.removeListener("close",p),v()}function v(){h("unpipe"),r.unpipe(t)}return r.on("data",c),function(t,e,r){if("function"===typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",d),t.once("close",p),t.once("finish",m),t.emit("pipe",r),i.flowing||(h("pipe resume"),r.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,h("on readable",i.length,i.reading),i.length?T(this):i.reading||n.nextTick(N,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,e){var r=a.prototype.removeListener.call(this,t,e);return"readable"===t&&n.nextTick(I,this),r},A.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||n.nextTick(I,this),e},A.prototype.resume=function(){var t=this._readableState;return t.flowing||(h("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,n.nextTick(j,t,e))}(this,t)),t.paused=!1,this},A.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(h("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(h("wrapped data"),r.decoder&&(i=r.decoder.write(i)),!r.objectMode||null!==i&&void 0!==i)&&((r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause())))})),t)void 0===this[i]&&"function"===typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o-1))throw new M(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(t,e,r){r(new m("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,e,r){var i=this._writableState;return"function"===typeof t?(r=t,t=null,e=null):"function"===typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,r){e.ending=!0,P(t,e),r&&(e.finished?n.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,i,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),A.prototype.destroy=l.destroy,A.prototype._undestroy=l.undestroy,A.prototype._destroy=function(t,e){e(t)}}).call(this,r(12),r(11))},function(t,e,r){"use strict";t.exports=f;var n=r(53).codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(54);function h(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length>6|192);else{if(i>55295&&i<56320){if(++n==t.length)return null;var o=t.charCodeAt(n);if(o<56320||o>57343)return null;r+=e((i=65536+((1023&i)<<10)+(1023&o))>>18|240),r+=e(i>>12&63|128)}else r+=e(i>>12|224);r+=e(i>>6&63|128)}r+=e(63&i|128)}}return r},toString:function(t){for(var e="",r=0,o=i(t);r127){if(a>191&&a<224){if(r>=o)return null;a=(31&a)<<6|63&n(t,r)}else if(a>223&&a<240){if(r+1>=o)return null;a=(15&a)<<12|(63&n(t,r))<<6|63&n(t,++r)}else{if(!(a>239&&a<248))return null;if(r+2>=o)return null;a=(7&a)<<18|(63&n(t,r))<<12|(63&n(t,++r))<<6|63&n(t,++r)}++r}if(a<=65535)e+=String.fromCharCode(a);else{if(!(a<=1114111))return null;a-=65536,e+=String.fromCharCode(a>>10|55296),e+=String.fromCharCode(1023&a|56320)}}return e},fromNumber:function(t){var e=t.toString(16);return e.length%2===0?"0x"+e:"0x0"+e},toNumber:function(t){return parseInt(t.slice(2),16)},fromNat:function(t){return"0x0"===t?"0x":t.length%2===0?t:"0x0"+t.slice(2)},toNat:function(t){return"0"===t[2]?"0x"+t.slice(3):t},fromArray:a,toArray:o,fromUint8Array:function(t){return a([].slice.call(t,0))},toUint8Array:function(t){return new Uint8Array(o(t))}}},function(t,e,r){"use strict";function n(t,e){return n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(t,e)}function i(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&n(t,e)}function o(t){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},o(t)}function a(t){return a="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(t,e){return!e||"object"!==a(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function u(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=o(t);if(e){var i=o(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return s(this,r)}}r.r(e),r.d(e,"ConstructorFragment",(function(){return T})),r.d(e,"EventFragment",(function(){return E})),r.d(e,"Fragment",(function(){return A})),r.d(e,"FunctionFragment",(function(){return P})),r.d(e,"ParamType",(function(){return k})),r.d(e,"FormatTypes",(function(){return M})),r.d(e,"AbiCoder",(function(){return vt})),r.d(e,"defaultAbiCoder",(function(){return gt})),r.d(e,"Interface",(function(){return At})),r.d(e,"Indexed",(function(){return kt})),r.d(e,"checkResultErrors",(function(){return L})),r.d(e,"LogDescription",(function(){return Mt})),r.d(e,"TransactionDescription",(function(){return _t}));var h=r(6),f=r(8),l=r(35),c=r(10),d=r(5),p="abi/5.0.7",m=new d.a(p),v={},g={calldata:!0,memory:!0,storage:!0},y={calldata:!0,memory:!0};function b(t,e){if("bytes"===t||"string"===t){if(g[e])return!0}else if("address"===t){if("payable"===e)return!0}else if((t.indexOf("[")>=0||"tuple"===t)&&y[e])return!0;return(g[e]||"payable"===e)&&m.throwArgumentError("invalid modifier","name",e),!1}function w(t,e){for(var r in e)Object(c.c)(t,r,e[r])}var M=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),_=new RegExp(/^(.*)\[([0-9]*)\]$/),k=function(){function t(e,r){Object(h.a)(this,t),e!==v&&m.throwError("use fromString",d.a.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),w(this,r);var n=this.type.match(_);w(this,n?{arrayLength:parseInt(n[2]||"-1"),arrayChildren:t.fromObject({type:n[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}return Object(f.a)(t,[{key:"format",value:function(t){if(t||(t=M.sighash),M[t]||m.throwArgumentError("invalid format type","format",t),t===M.json){var e={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"===typeof this.indexed&&(e.indexed=this.indexed),this.components&&(e.components=this.components.map((function(e){return JSON.parse(e.format(t))}))),JSON.stringify(e)}var r="";return"array"===this.baseType?(r+=this.arrayChildren.format(t),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(t!==M.sighash&&(r+=this.type),r+="("+this.components.map((function(e){return e.format(t)})).join(t===M.full?", ":",")+")"):r+=this.type,t!==M.sighash&&(!0===this.indexed&&(r+=" indexed"),t===M.full&&this.name&&(r+=" "+this.name)),r}}],[{key:"from",value:function(e,r){return"string"===typeof e?t.fromString(e,r):t.fromObject(e)}},{key:"fromObject",value:function(e){return t.isParamType(e)?e:new t(v,{name:e.name||null,type:C(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(t.fromObject):null})}},{key:"fromString",value:function(e,r){return n=function(t,e){var r=t;function n(e){m.throwArgumentError("unexpected character at position ".concat(e),"param",t)}function i(t){var r={type:"",name:"",parent:t,state:{allowType:!0}};return e&&(r.indexed=!1),r}t=t.replace(/\s/g," ");for(var o={type:"",name:"",state:{allowType:!0}},a=o,s=0;s2&&m.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||m.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=l.a.from(r[1]),r[0]):t}function O(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach((function(t){switch(t.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+t)}}))}function R(t){var e={constant:!1,payable:!0,stateMutability:"payable"};return null!=t.stateMutability?(e.stateMutability=t.stateMutability,e.constant="view"===e.stateMutability||"pure"===e.stateMutability,null!=t.constant&&!!t.constant!==e.constant&&m.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable="payable"===e.stateMutability,null!=t.payable&&!!t.payable!==e.payable&&m.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):null!=t.payable?(e.payable=!!t.payable,null!=t.constant||e.payable||"constructor"===t.type||m.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&m.throwArgumentError("cannot have constant payable function","value",t)):null!=t.constant?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):"constructor"!==t.type&&m.throwArgumentError("unable to determine stateMutability","value",t),e}var T=function(t){i(r,t);var e=u(r);function r(){return Object(h.a)(this,r),e.apply(this,arguments)}return Object(f.a)(r,[{key:"format",value:function(t){if(t||(t=M.sighash),M[t]||m.throwArgumentError("invalid format type","format",t),t===M.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payble:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(e){return JSON.parse(e.format(t))}))});t===M.sighash&&m.throwError("cannot format a constructor for sighash",d.a.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});var e="constructor("+this.inputs.map((function(e){return e.format(t)})).join(t===M.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "),e.trim()}}],[{key:"from",value:function(t){return"string"===typeof t?r.fromString(t):r.fromObject(t)}},{key:"fromObject",value:function(t){if(r.isConstructorFragment(t))return t;"constructor"!==t.type&&m.throwArgumentError("invalid constructor object","value",t);var e=R(t);e.constant&&m.throwArgumentError("constructor cannot be constant","value",t);var n={name:null,type:t.type,inputs:t.inputs?t.inputs.map(k.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?l.a.from(t.gas):null};return new r(v,n)}},{key:"fromString",value:function(t){var e={type:"constructor"},n=(t=x(t,e)).match(N);return n&&"constructor"===n[1].trim()||m.throwArgumentError("invalid constructor string","value",t),e.inputs=S(n[2].trim(),!1),O(n[3].trim(),e),r.fromObject(e)}},{key:"isConstructorFragment",value:function(t){return t&&t._isFragment&&"constructor"===t.type}}]),r}(A),P=function(t){i(r,t);var e=u(r);function r(){return Object(h.a)(this,r),e.apply(this,arguments)}return Object(f.a)(r,[{key:"format",value:function(t){if(t||(t=M.sighash),M[t]||m.throwArgumentError("invalid format type","format",t),t===M.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payble:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(e){return JSON.parse(e.format(t))})),ouputs:this.outputs.map((function(e){return JSON.parse(e.format(t))}))});var e="";return t!==M.sighash&&(e+="function "),e+=this.name+"("+this.inputs.map((function(e){return e.format(t)})).join(t===M.full?", ":",")+") ",t!==M.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "):this.constant&&(e+="view "),this.outputs&&this.outputs.length&&(e+="returns ("+this.outputs.map((function(e){return e.format(t)})).join(", ")+") "),null!=this.gas&&(e+="@"+this.gas.toString()+" ")),e.trim()}}],[{key:"from",value:function(t){return"string"===typeof t?r.fromString(t):r.fromObject(t)}},{key:"fromObject",value:function(t){if(r.isFunctionFragment(t))return t;"function"!==t.type&&m.throwArgumentError("invalid function object","value",t);var e=R(t),n={type:t.type,name:I(t.name),constant:e.constant,inputs:t.inputs?t.inputs.map(k.fromObject):[],outputs:t.outputs?t.outputs.map(k.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?l.a.from(t.gas):null};return new r(v,n)}},{key:"fromString",value:function(t){var e={type:"function"},n=(t=x(t,e)).split(" returns ");n.length>2&&m.throwArgumentError("invalid function string","value",t);var i=n[0].match(N);if(i||m.throwArgumentError("invalid function signature","value",t),e.name=i[1].trim(),e.name&&I(e.name),e.inputs=S(i[2],!1),O(i[3].trim(),e),n.length>1){var o=n[1].match(N);""==o[1].trim()&&""==o[3].trim()||m.throwArgumentError("unexpected tokens","value",t),e.outputs=S(o[2],!1)}else e.outputs=[];return r.fromObject(e)}},{key:"isFunctionFragment",value:function(t){return t&&t._isFragment&&"function"===t.type}}]),r}(T);function C(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}var B=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function I(t){return t&&t.match(B)||m.throwArgumentError('invalid identifier "'.concat(t,'"'),"value",t),t}var N=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");var j=r(0),U=new d.a(p);function L(t){var e=[];return function t(r,n){if(Array.isArray(n))for(var i in n){var o=r.slice();o.push(i);try{t(o,n[i])}catch(a){e.push({path:o,error:a})}}}([],t),e}var D=function(){function t(e,r,n,i){Object(h.a)(this,t),this.name=e,this.type=r,this.localName=n,this.dynamic=i}return Object(f.a)(t,[{key:"_throwError",value:function(t,e){U.throwArgumentError(t,this.localName,e)}}]),t}(),q=function(){function t(e){Object(h.a)(this,t),Object(c.c)(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}return Object(f.a)(t,[{key:"data",get:function(){return Object(j.c)(this._data)}},{key:"length",get:function(){return this._dataLength}},{key:"_writeData",value:function(t){return this._data.push(t),this._dataLength+=t.length,t.length}},{key:"appendWriter",value:function(t){return this._writeData(Object(j.b)(t._data))}},{key:"writeBytes",value:function(t){var e=Object(j.a)(t),r=e.length%this.wordSize;return r&&(e=Object(j.b)([e,this._padding.slice(r)])),this._writeData(e)}},{key:"_getValue",value:function(t){var e=Object(j.a)(l.a.from(t));return e.length>this.wordSize&&U.throwError("value out-of-bounds",d.a.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:e.length}),e.length%this.wordSize&&(e=Object(j.b)([this._padding.slice(e.length%this.wordSize),e])),e}},{key:"writeValue",value:function(t){return this._writeData(this._getValue(t))}},{key:"writeUpdatableValue",value:function(){var t=this,e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,function(r){t._data[e]=t._getValue(r)}}}]),t}(),F=function(){function t(e,r,n,i){Object(h.a)(this,t),Object(c.c)(this,"_data",Object(j.a)(e)),Object(c.c)(this,"wordSize",r||32),Object(c.c)(this,"_coerceFunc",n),Object(c.c)(this,"allowLoose",i),this._offset=0}return Object(f.a)(t,[{key:"data",get:function(){return Object(j.g)(this._data)}},{key:"consumed",get:function(){return this._offset}},{key:"coerce",value:function(e,r){return this._coerceFunc?this._coerceFunc(e,r):t.coerce(e,r)}},{key:"_peekBytes",value:function(t,e,r){var n=Math.ceil(e/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+e<=this._data.length?n=e:U.throwError("data out-of-bounds",d.a.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}},{key:"subReader",value:function(e){return new t(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}},{key:"readBytes",value:function(t,e){var r=this._peekBytes(0,t,!!e);return this._offset+=r.length,r.slice(0,t)}},{key:"readValue",value:function(){return l.a.from(this.readBytes(this.wordSize))}}],[{key:"coerce",value:function(t,e){var r=t.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(e=e.toNumber()),e}}]),t}(),z=r(24),H=function(t){i(r,t);var e=u(r);function r(t){return Object(h.a)(this,r),e.call(this,"address","address",t,!1)}return Object(f.a)(r,[{key:"encode",value:function(t,e){try{Object(z.a)(e)}catch(r){this._throwError(r.message,e)}return t.writeValue(e)}},{key:"decode",value:function(t){return Object(z.a)(Object(j.f)(t.readValue().toHexString(),20))}}]),r}(D),K=function(t){i(r,t);var e=u(r);function r(t){var n;return Object(h.a)(this,r),(n=e.call(this,t.name,t.type,void 0,t.dynamic)).coder=t,n}return Object(f.a)(r,[{key:"encode",value:function(t,e){return this.coder.encode(t,e)}},{key:"decode",value:function(t){return this.coder.decode(t)}}]),r}(D),Z=new d.a(p);function W(t,e,r){var n=null;if(Array.isArray(r))n=r;else if(r&&"object"===typeof r){var i={};n=e.map((function(t){var e=t.localName;return e||Z.throwError("cannot encode object for signature with missing names",d.a.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),i[e]&&Z.throwError("cannot encode object for signature with duplicate names",d.a.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),i[e]=!0,r[e]}))}else Z.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&Z.throwArgumentError("types/value length mismatch","tuple",r);var o=new q(t.wordSize),a=new q(t.wordSize),s=[];e.forEach((function(t,e){var r=n[e];if(t.dynamic){var i=a.length;t.encode(a,r);var u=o.writeUpdatableValue();s.push((function(t){u(t+i)}))}else t.encode(o,r)})),s.forEach((function(t){t(o.length)}));var u=t.appendWriter(o);return u+=t.appendWriter(a)}function V(t,e){var r=[],n=t.subReader(0);e.forEach((function(e){var i=null;if(e.dynamic){var o=t.readValue(),a=n.subReader(o.toNumber());try{i=e.decode(a)}catch(s){if(s.code===d.a.errors.BUFFER_OVERRUN)throw s;(i=s).baseType=e.name,i.name=e.localName,i.type=e.type}}else try{i=e.decode(t)}catch(s){if(s.code===d.a.errors.BUFFER_OVERRUN)throw s;(i=s).baseType=e.name,i.name=e.localName,i.type=e.type}void 0!=i&&r.push(i)}));var i=e.reduce((function(t,e){var r=e.localName;return r&&(t[r]||(t[r]=0),t[r]++),t}),{});e.forEach((function(t,e){var n=t.localName;if(n&&1===i[n]&&("length"===n&&(n="_length"),null==r[n])){var o=r[e];o instanceof Error?Object.defineProperty(r,n,{get:function(){throw o}}):r[n]=o}}));for(var o=function(t){var e=r[t];e instanceof Error&&Object.defineProperty(r,t,{get:function(){throw e}})},a=0;a=0?n:"")+"]",s=-1===n||t.dynamic;return(o=e.call(this,"array",a,i,s)).coder=t,o.length=n,o}return Object(f.a)(r,[{key:"encode",value:function(t,e){Array.isArray(e)||this._throwError("expected array value",e);var r=this.length;-1===r&&(r=e.length,t.writeValue(e.length)),Z.checkArgumentCount(e.length,r,"coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i>6===2;a++)o++;return o}return t===Y.OVERRUN?r.length-e-1:0}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}($||($={})),function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"}(Y||(Y={}));var st=Object.freeze({error:function(t,e,r,n,i){return ot.throwArgumentError("invalid codepoint at offset ".concat(e,"; ").concat(t),"bytes",r)},ignore:at,replace:function(t,e,r,n,i){return t===Y.OVERLONG?(n.push(i),0):(n.push(65533),at(t,e,r))}});function ut(t,e){null==e&&(e=st.error),t=Object(j.a)(t);for(var r=[],n=0;n>7!==0){var o=null,a=null;if(192===(224&i))o=1,a=127;else if(224===(240&i))o=2,a=2047;else{if(240!==(248&i)){n+=e(128===(192&i)?Y.UNEXPECTED_CONTINUE:Y.BAD_PREFIX,n-1,t,r);continue}o=3,a=65535}if(n-1+o>=t.length)n+=e(Y.OVERRUN,n-1,t,r);else{for(var s=i&(1<<8-o-1)-1,u=0;u1114111?n+=e(Y.OUT_OF_RANGE,n-1-o,t,r,s):s>=55296&&s<=57343?n+=e(Y.UTF16_SURROGATE,n-1-o,t,r,s):s<=a?n+=e(Y.OVERLONG,n-1-o,t,r,s):r.push(s))}}else r.push(i)}return r}function ht(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$.current;e!=$.current&&(ot.checkNormalize(),t=t.normalize(e));for(var r=[],n=0;n>6|192),r.push(63&i|128);else if(55296==(64512&i)){n++;var o=t.charCodeAt(n);if(n>=t.length||56320!==(64512&o))throw new Error("invalid utf-8 string");var a=65536+((1023&i)<<10)+(1023&o);r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(63&i|128)}return Object(j.a)(r)}function ft(t,e){return ut(t,e).map((function(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10&1023),56320+(1023&t)))})).join("")}var lt=function(t){i(r,t);var e=u(r);function r(t){return Object(h.a)(this,r),e.call(this,"string",t)}return Object(f.a)(r,[{key:"encode",value:function(t,e){return X(o(r.prototype),"encode",this).call(this,t,ht(e))}},{key:"decode",value:function(t){return ft(X(o(r.prototype),"decode",this).call(this,t))}}]),r}(Q),ct=function(t){i(r,t);var e=u(r);function r(t,n){var i;Object(h.a)(this,r);var o=!1,a=[];t.forEach((function(t){t.dynamic&&(o=!0),a.push(t.type)}));var s="tuple("+a.join(",")+")";return(i=e.call(this,"tuple",s,n,o)).coders=t,i}return Object(f.a)(r,[{key:"encode",value:function(t,e){return W(t,this.coders,e)}},{key:"decode",value:function(t){return t.coerce(this.name,V(t,this.coders))}}]),r}(D),dt=new d.a(p),pt=new RegExp(/^bytes([0-9]*)$/),mt=new RegExp(/^(u?int)([0-9]*)$/),vt=function(){function t(e){Object(h.a)(this,t),dt.checkNew(this instanceof t?this.constructor:void 0,t),Object(c.c)(this,"coerceFunc",e||null)}return Object(f.a)(t,[{key:"_getCoder",value:function(t){var e=this;switch(t.baseType){case"address":return new H(t.name);case"bool":return new J(t.name);case"string":return new lt(t.name);case"bytes":return new tt(t.name);case"array":return new G(this._getCoder(t.arrayChildren),t.arrayLength,t.name);case"tuple":return new ct((t.components||[]).map((function(t){return e._getCoder(t)})),t.name);case"":return new rt(t.name)}var r=t.type.match(mt);if(r){var n=parseInt(r[2]||"256");return(0===n||n>256||n%8!==0)&&dt.throwArgumentError("invalid "+r[1]+" bit length","param",t),new it(n/8,"int"===r[1],t.name)}if(r=t.type.match(pt)){var i=parseInt(r[1]);return(0===i||i>32)&&dt.throwArgumentError("invalid bytes length","param",t),new et(i,t.name)}return dt.throwArgumentError("invalid type","type",t.type)}},{key:"_getWordSize",value:function(){return 32}},{key:"_getReader",value:function(t,e){return new F(t,this._getWordSize(),this.coerceFunc,e)}},{key:"_getWriter",value:function(){return new q(this._getWordSize())}},{key:"encode",value:function(t,e){var r=this;t.length!==e.length&&dt.throwError("types/values length mismatch",d.a.errors.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var n=t.map((function(t){return r._getCoder(k.from(t))})),i=new ct(n,"_"),o=this._getWriter();return i.encode(o,e),o.data}},{key:"decode",value:function(t,e,r){var n=this,i=t.map((function(t){return n._getCoder(k.from(t))}));return new ct(i,"_").decode(this._getReader(Object(j.a)(e),r))}}]),t}(),gt=new vt,yt=r(18);function bt(t){return Object(yt.a)(ht(t))}var wt=new d.a(p),Mt=function(t){i(r,t);var e=u(r);function r(){return Object(h.a)(this,r),e.apply(this,arguments)}return r}(c.a),_t=function(t){i(r,t);var e=u(r);function r(){return Object(h.a)(this,r),e.apply(this,arguments)}return r}(c.a),kt=function(t){i(r,t);var e=u(r);function r(){return Object(h.a)(this,r),e.apply(this,arguments)}return Object(f.a)(r,null,[{key:"isIndexed",value:function(t){return!(!t||!t._isIndexed)}}]),r}(c.a);function St(t,e){var r=new Error("deferred error during ABI decoding triggered accessing ".concat(t));return r.error=e,r}var At=function(){function t(e){var r=this;Object(h.a)(this,t),wt.checkNew(this instanceof t?this.constructor:void 0,t);var n=[];n="string"===typeof e?JSON.parse(e):e,Object(c.c)(this,"fragments",n.map((function(t){return A.from(t)})).filter((function(t){return null!=t}))),Object(c.c)(this,"_abiCoder",Object(c.d)(this instanceof t?this.constructor:void 0,"getAbiCoder")()),Object(c.c)(this,"functions",{}),Object(c.c)(this,"errors",{}),Object(c.c)(this,"events",{}),Object(c.c)(this,"structs",{}),this.fragments.forEach((function(t){var e=null;switch(t.type){case"constructor":return r.deploy?void wt.warn("duplicate definition - constructor"):void Object(c.c)(r,"deploy",t);case"function":e=r.functions;break;case"event":e=r.events;break;default:return}var n=t.format();e[n]?wt.warn("duplicate definition - "+n):e[n]=t})),this.deploy||Object(c.c)(this,"deploy",T.from({payable:!1,type:"constructor"})),Object(c.c)(this,"_isInterface",!0)}return Object(f.a)(t,[{key:"format",value:function(t){t||(t=M.full),t===M.sighash&&wt.throwArgumentError("interface does not support formatting sighash","format",t);var e=this.fragments.map((function(e){return e.format(t)}));return t===M.json?JSON.stringify(e.map((function(t){return JSON.parse(t)}))):e}},{key:"getFunction",value:function(t){if(Object(j.j)(t)){for(var e in this.functions)if(t===this.getSighash(e))return this.functions[e];wt.throwArgumentError("no matching function","sighash",t)}if(-1===t.indexOf("(")){var r=t.trim(),n=Object.keys(this.functions).filter((function(t){return t.split("(")[0]===r}));return 0===n.length?wt.throwArgumentError("no matching function","name",r):n.length>1&&wt.throwArgumentError("multiple matching functions","name",r),this.functions[n[0]]}var i=this.functions[P.fromString(t).format()];return i||wt.throwArgumentError("no matching function","signature",t),i}},{key:"getEvent",value:function(t){if(Object(j.j)(t)){var e=t.toLowerCase();for(var r in this.events)if(e===this.getEventTopic(r))return this.events[r];wt.throwArgumentError("no matching event","topichash",e)}if(-1===t.indexOf("(")){var n=t.trim(),i=Object.keys(this.events).filter((function(t){return t.split("(")[0]===n}));return 0===i.length?wt.throwArgumentError("no matching event","name",n):i.length>1&&wt.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}var o=this.events[E.fromString(t).format()];return o||wt.throwArgumentError("no matching event","signature",t),o}},{key:"getSighash",value:function(t){return"string"===typeof t&&(t=this.getFunction(t)),Object(c.d)(this.constructor,"getSighash")(t)}},{key:"getEventTopic",value:function(t){return"string"===typeof t&&(t=this.getEvent(t)),Object(c.d)(this.constructor,"getEventTopic")(t)}},{key:"_decodeParams",value:function(t,e){return this._abiCoder.decode(t,e)}},{key:"_encodeParams",value:function(t,e){return this._abiCoder.encode(t,e)}},{key:"encodeDeploy",value:function(t){return this._encodeParams(this.deploy.inputs,t||[])}},{key:"decodeFunctionData",value:function(t,e){"string"===typeof t&&(t=this.getFunction(t));var r=Object(j.a)(e);return Object(j.g)(r.slice(0,4))!==this.getSighash(t)&&wt.throwArgumentError("data signature does not match function ".concat(t.name,"."),"data",Object(j.g)(r)),this._decodeParams(t.inputs,r.slice(4))}},{key:"encodeFunctionData",value:function(t,e){return"string"===typeof t&&(t=this.getFunction(t)),Object(j.g)(Object(j.b)([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}},{key:"decodeFunctionResult",value:function(t,e){"string"===typeof t&&(t=this.getFunction(t));var r=Object(j.a)(e),n=null,i=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(t.outputs,r)}catch(o){}break;case 4:"0x08c379a0"===Object(j.g)(r.slice(0,4))&&(i="Error(string)",n=this._abiCoder.decode(["string"],r.slice(4))[0])}return wt.throwError("call revert exception",d.a.errors.CALL_EXCEPTION,{method:t.format(),errorSignature:i,errorArgs:[n],reason:n})}},{key:"encodeFunctionResult",value:function(t,e){return"string"===typeof t&&(t=this.getFunction(t)),Object(j.g)(this._abiCoder.encode(t.outputs,e||[]))}},{key:"encodeFilterTopics",value:function(t,e){var r=this;"string"===typeof t&&(t=this.getEvent(t)),e.length>t.inputs.length&&wt.throwError("too many arguments for "+t.format(),d.a.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:e});var n=[];t.anonymous||n.push(this.getEventTopic(t));var i=function(t,e){return"string"===t.type?bt(e):"bytes"===t.type?Object(yt.a)(Object(j.g)(e)):("address"===t.type&&r._abiCoder.encode(["address"],[e]),Object(j.f)(Object(j.g)(e),32))};for(e.forEach((function(e,r){var o=t.inputs[r];o.indexed?null==e?n.push(null):"array"===o.baseType||"tuple"===o.baseType?wt.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,e):Array.isArray(e)?n.push(e.map((function(t){return i(o,t)}))):n.push(i(o,e)):null!=e&&wt.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,e)}));n.length&&null===n[n.length-1];)n.pop();return n}},{key:"encodeEventLog",value:function(t,e){var r=this;"string"===typeof t&&(t=this.getEvent(t));var n=[],i=[],o=[];return t.anonymous||n.push(this.getEventTopic(t)),e.length!==t.inputs.length&&wt.throwArgumentError("event arguments/values mismatch","values",e),t.inputs.forEach((function(t,a){var s=e[a];if(t.indexed)if("string"===t.type)n.push(bt(s));else if("bytes"===t.type)n.push(Object(yt.a)(s));else{if("tuple"===t.baseType||"array"===t.baseType)throw new Error("not implemented");n.push(r._abiCoder.encode([t.type],[s]))}else i.push(t),o.push(s)})),{data:this._abiCoder.encode(i,o),topics:n}}},{key:"decodeEventLog",value:function(t,e,r){if("string"===typeof t&&(t=this.getEvent(t)),null!=r&&!t.anonymous){var n=this.getEventTopic(t);Object(j.j)(r[0],32)&&r[0].toLowerCase()===n||wt.throwError("fragment/topic mismatch",d.a.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:n,value:r[0]}),r=r.slice(1)}var i=[],o=[],a=[];t.inputs.forEach((function(t,e){t.indexed?"string"===t.type||"bytes"===t.type||"tuple"===t.baseType||"array"===t.baseType?(i.push(k.fromObject({type:"bytes32",name:t.name})),a.push(!0)):(i.push(t),a.push(!1)):(o.push(t),a.push(!1))}));var s=null!=r?this._abiCoder.decode(i,Object(j.b)(r)):null,u=this._abiCoder.decode(o,e,!0),h=[],f=0,l=0;t.inputs.forEach((function(t,e){if(t.indexed)if(null==s)h[e]=new kt({_isIndexed:!0,hash:null});else if(a[e])h[e]=new kt({_isIndexed:!0,hash:s[l++]});else try{h[e]=s[l++]}catch(n){h[e]=n}else try{h[e]=u[f++]}catch(n){h[e]=n}if(t.name&&null==h[t.name]){var r=h[e];r instanceof Error?Object.defineProperty(h,t.name,{get:function(){throw St("property ".concat(JSON.stringify(t.name)),r)}}):h[t.name]=r}}));for(var c=function(t){var e=h[t];e instanceof Error&&Object.defineProperty(h,t,{get:function(){throw St("index ".concat(t),e)}})},p=0;p>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}M.prototype.update=function(t){var e="string"!==typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,n,i=t.length,o=this.blocks,s=this.byteCount,u=this.blockCount,h=0,f=this.s;h>2]|=t[h]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(o[r>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=s){for(this.start=r-s,this.block=o[u],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];s%e===0&&(_(r),a=0)}return i&&(t=r[a],i>0&&(u+=o[t>>4&15]+o[15&t]),i>1&&(u+=o[t>>12&15]+o[t>>8&15]),i>2&&(u+=o[t>>20&15]+o[t>>16&15])),u},M.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(t);a>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;s%r===0&&_(n)}return o&&(t=s<<2,e=n[a],o>0&&(u[t]=255&e),o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u};var _=function(t){var e,r,n,i,o,a,u,h,f,l,c,d,p,m,v,g,y,b,w,M,_,k,S,A,E,x,O,R,T,P,C,B,I,N,j,U,L,D,q,F,z,H,K,Z,W,V,G,J,X,$,Y,Q,tt,et,rt,nt,it,ot,at,st,ut,ht,ft;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],f=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(h<<1|f>>>31),r=o^(f<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(l<<1|c>>>31),r=u^(c<<1|l>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(d<<1|p>>>31),r=f^(p<<1|d>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=l^(i<<1|o>>>31),r=c^(o<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,m=t[0],v=t[1],V=t[11]<<4|t[10]>>>28,G=t[10]<<4|t[11]>>>28,R=t[20]<<3|t[21]>>>29,T=t[21]<<3|t[20]>>>29,st=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,H=t[40]<<18|t[41]>>>14,K=t[41]<<18|t[40]>>>14,N=t[2]<<1|t[3]>>>31,j=t[3]<<1|t[2]>>>31,g=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,X=t[23]<<10|t[22]>>>22,P=t[33]<<13|t[32]>>>19,C=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,ft=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,U=t[14]<<6|t[15]>>>26,L=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,B=t[45]<<29|t[44]>>>3,I=t[44]<<29|t[45]>>>3,A=t[6]<<28|t[7]>>>4,E=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,q=t[27]<<25|t[26]>>>7,M=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,Z=t[8]<<27|t[9]>>>5,W=t[9]<<27|t[8]>>>5,x=t[18]<<20|t[19]>>>12,O=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,at=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,z=t[39]<<8|t[38]>>>24,k=t[48]<<14|t[49]>>>18,S=t[49]<<14|t[48]>>>18,t[0]=m^~g&b,t[1]=v^~y&w,t[10]=A^~x&R,t[11]=E^~O&T,t[20]=N^~U&D,t[21]=j^~L&q,t[30]=Z^~V&J,t[31]=W^~G&X,t[40]=et^~nt&ot,t[41]=rt^~it&at,t[2]=g^~b&M,t[3]=y^~w&_,t[12]=x^~R&P,t[13]=O^~T&C,t[22]=U^~D&F,t[23]=L^~q&z,t[32]=V^~J&$,t[33]=G^~X&Y,t[42]=nt^~ot&st,t[43]=it^~at&ut,t[4]=b^~M&k,t[5]=w^~_&S,t[14]=R^~P&B,t[15]=T^~C&I,t[24]=D^~F&H,t[25]=q^~z&K,t[34]=J^~$&Q,t[35]=X^~Y&tt,t[44]=ot^~st&ht,t[45]=at^~ut&ft,t[6]=M^~k&m,t[7]=_^~S&v,t[16]=P^~B&A,t[17]=C^~I&E,t[26]=F^~H&N,t[27]=z^~K&j,t[36]=$^~Q&Z,t[37]=Y^~tt&W,t[46]=st^~ht&et,t[47]=ut^~ft&rt,t[8]=k^~m&g,t[9]=S^~v&y,t[18]=B^~A&x,t[19]=I^~E&O,t[28]=H^~N&U,t[29]=K^~j&L,t[38]=Q^~Z&V,t[39]=tt^~W&G,t[48]=ht^~et&nt,t[49]=ft^~rt&it,t[0]^=s[n],t[1]^=s[n+1]};if(i)t.exports=p;else for(v=0;v=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function h(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=u(t,e,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(t.length-e)%2===0?e+1:e;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var f=["","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"],l=[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 d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var h=1;h>>26,l=67108863&u,c=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=c;d++){var p=h-d|0;f+=(a=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&a}r.words[h]=0|l,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?f[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=l[t],d=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:f[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n("undefined"!==typeof a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===e,h=new t(o),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),h[s]=a;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"===typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,v=0|a[2],g=8191&v,y=v>>>13,b=0|a[3],w=8191&b,M=b>>>13,_=0|a[4],k=8191&_,S=_>>>13,A=0|a[5],E=8191&A,x=A>>>13,O=0|a[6],R=8191&O,T=O>>>13,P=0|a[7],C=8191&P,B=P>>>13,I=0|a[8],N=8191&I,j=I>>>13,U=0|a[9],L=8191&U,D=U>>>13,q=0|s[0],F=8191&q,z=q>>>13,H=0|s[1],K=8191&H,Z=H>>>13,W=0|s[2],V=8191&W,G=W>>>13,J=0|s[3],X=8191&J,$=J>>>13,Y=0|s[4],Q=8191&Y,tt=Y>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ht=st>>>13,ft=0|s[8],lt=8191&ft,ct=ft>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(n=Math.imul(l,F))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;h=((o=Math.imul(c,z))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(h+(n=n+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,Z)|0)+Math.imul(c,K)|0))<<13)|0;h=((o=o+Math.imul(c,Z)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,F),i=(i=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,Z)|0;var yt=(h+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;h=((o=o+Math.imul(c,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,Z)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,Z)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(h+(n=n+Math.imul(l,X)|0)|0)+((8191&(i=(i=i+Math.imul(l,$)|0)+Math.imul(c,X)|0))<<13)|0;h=((o=o+Math.imul(c,$)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(k,F),i=(i=Math.imul(k,z))+Math.imul(S,F)|0,o=Math.imul(S,z),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(M,K)|0,o=o+Math.imul(M,Z)|0,n=n+Math.imul(g,V)|0,i=(i=i+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,$)|0;var wt=(h+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,z))+Math.imul(x,F)|0,o=Math.imul(x,z),n=n+Math.imul(k,K)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,n=n+Math.imul(g,X)|0,i=(i=i+Math.imul(g,$)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(h+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(c,rt)|0))<<13)|0;h=((o=o+Math.imul(c,nt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,F),i=(i=Math.imul(R,z))+Math.imul(T,F)|0,o=Math.imul(T,z),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,Z)|0,n=n+Math.imul(k,V)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,$)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var _t=(h+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,at)|0)+Math.imul(c,ot)|0))<<13)|0;h=((o=o+Math.imul(c,at)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,z))+Math.imul(B,F)|0,o=Math.imul(B,z),n=n+Math.imul(R,K)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(T,K)|0,o=o+Math.imul(T,Z)|0,n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,n=n+Math.imul(k,X)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,$)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var kt=(h+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(c,ut)|0))<<13)|0;h=((o=o+Math.imul(c,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(N,F),i=(i=Math.imul(N,z))+Math.imul(j,F)|0,o=Math.imul(j,z),n=n+Math.imul(C,K)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,G)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,$)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var St=(h+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;h=((o=o+Math.imul(c,ct)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(L,F),i=(i=Math.imul(L,z))+Math.imul(D,F)|0,o=Math.imul(D,z),n=n+Math.imul(N,K)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(j,K)|0,o=o+Math.imul(j,Z)|0,n=n+Math.imul(C,V)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(B,V)|0,o=o+Math.imul(B,G)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,$)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,$)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,at)|0,n=n+Math.imul(g,ut)|0,i=(i=i+Math.imul(g,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var At=(h+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;h=((o=o+Math.imul(c,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(L,K),i=(i=Math.imul(L,Z))+Math.imul(D,K)|0,o=Math.imul(D,Z),n=n+Math.imul(N,V)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,$)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,$)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,at)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,at)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ht)|0,n=n+Math.imul(g,lt)|0,i=(i=i+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var Et=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(L,V),i=(i=Math.imul(L,G))+Math.imul(D,V)|0,o=Math.imul(D,G),n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,$)|0)+Math.imul(j,X)|0,o=o+Math.imul(j,$)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,at)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ht)|0,n=n+Math.imul(w,lt)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var xt=(h+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(L,X),i=(i=Math.imul(L,$))+Math.imul(D,X)|0,o=Math.imul(D,$),n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,at)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ht)|0,n=n+Math.imul(k,lt)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(S,lt)|0,o=o+Math.imul(S,ct)|0;var Ot=(h+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;h=((o=o+Math.imul(M,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(L,Q),i=(i=Math.imul(L,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(N,rt)|0,i=(i=i+Math.imul(N,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,at)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,at)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ht)|0,n=n+Math.imul(E,lt)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Rt=(h+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,mt)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(L,rt),i=(i=Math.imul(L,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(N,ot)|0,i=(i=i+Math.imul(N,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,n=n+Math.imul(C,ut)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ht)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(T,lt)|0,o=o+Math.imul(T,ct)|0;var Tt=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((o=o+Math.imul(x,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(L,ot),i=(i=Math.imul(L,at))+Math.imul(D,ot)|0,o=Math.imul(D,at),n=n+Math.imul(N,ut)|0,i=(i=i+Math.imul(N,ht)|0)+Math.imul(j,ut)|0,o=o+Math.imul(j,ht)|0,n=n+Math.imul(C,lt)|0,i=(i=i+Math.imul(C,ct)|0)+Math.imul(B,lt)|0,o=o+Math.imul(B,ct)|0;var Pt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(T,pt)|0))<<13)|0;h=((o=o+Math.imul(T,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(L,ut),i=(i=Math.imul(L,ht))+Math.imul(D,ut)|0,o=Math.imul(D,ht),n=n+Math.imul(N,lt)|0,i=(i=i+Math.imul(N,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var Ct=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(B,pt)|0))<<13)|0;h=((o=o+Math.imul(B,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(L,lt),i=(i=Math.imul(L,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var Bt=(h+(n=n+Math.imul(N,pt)|0)|0)+((8191&(i=(i=i+Math.imul(N,mt)|0)+Math.imul(j,pt)|0))<<13)|0;h=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var It=(h+(n=Math.imul(L,pt))|0)+((8191&(i=(i=Math.imul(L,mt))+Math.imul(D,pt)|0))<<13)|0;return h=((o=Math.imul(D,mt))+(i>>>13)|0)+(It>>>26)|0,It&=67108863,u[0]=vt,u[1]=gt,u[2]=yt,u[3]=bt,u[4]=wt,u[5]=Mt,u[6]=_t,u[7]=kt,u[8]=St,u[9]=At,u[10]=Et,u[11]=xt,u[12]=Ot,u[13]=Rt,u[14]=Tt,u[15]=Pt,u[16]=Ct,u[17]=Bt,u[18]=It,0!==h&&(u[19]=h,r.length++),r};function m(t,e,r){return(new v).mulp(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(p=d),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):m(this,t,e),r},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},v.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,h=0;h=0&&(0!==f||h>=i);h--){var l=0|this.words[h];this.words[h]=f<<26-o|l>>>o,f=l&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"===typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var h=0;h=0;l--){var c=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(c=Math.min(c/a|0,67108863),n._ishlnsubmul(i,c,l);0!==n.negative;)c--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=c)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0===(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(l)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,f=1;0===(e.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(e.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,c=1;0===(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"===typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new k(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(b,y),b.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return g[t]=e,e},k.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,i),c=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=a;0!==d.cmp(s);){for(var m=d,v=0;0!==m.cmp(s);v++)m=m.redSqr();n(v=0;n--){for(var h=e.words[n],f=u-1;f>=0;f--){var l=h>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===n&&0===f)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},i(S,k),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(17)(t))},function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return z}));var n=r(7),i=r.n(n),o=r(21),a=r.n(o);"undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof t||"undefined"!==typeof self&&self;function s(t,e,r){return r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}((void 0===e||null===e)&&r.path)}},t(r,r.exports),r.exports}var u=h;function h(t,e){if(!t)throw new Error(e||"Assertion failed")}h.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var f=s((function(t,e){var r=e;function n(t){return 1===t.length?"0"+t:t}function i(t){for(var e="",r=0;r>8,a=255&i;o?r.push(o,a):r.push(a)}return r},r.zero2=n,r.toHex=i,r.encode=function(t,e){return"hex"===e?i(t):t}})),l=s((function(t,e){var r=e;r.assert=u,r.toArray=f.toArray,r.zero2=f.zero2,r.toHex=f.toHex,r.encode=f.encode,r.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},r.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n,i=0,o=0;t.cmpn(-i)>0||e.cmpn(-o)>0;){var a,s,u=t.andln(3)+i&3,h=e.andln(3)+o&3;3===u&&(u=-1),3===h&&(h=-1),a=0===(1&u)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==h?u:-u,r[0].push(a),s=0===(1&h)?0:3!==(n=e.andln(7)+o&7)&&5!==n||2!==u?h:-h,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return r},r.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(t){return"string"===typeof t?r.toArray(t,"hex"):t},r.intFromLE=function(t){return new i.a(t,"hex","le")}})),c=l.getNAF,d=l.getJSF,p=l.assert;function m(t,e){this.type=t,this.p=new i.a(e.p,16),this.red=e.prime?i.a.red(e.prime):i.a.mont(this.p),this.zero=new i.a(0).toRed(this.red),this.one=new i.a(1).toRed(this.red),this.two=new i.a(2).toRed(this.red),this.n=e.n&&new i.a(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.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 r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var v=m;function g(t,e){this.curve=t,this.type=e,this.precomputed=null}m.prototype.point=function(){throw new Error("Not implemented")},m.prototype.validate=function(){throw new Error("Not implemented")},m.prototype._fixedNafMul=function(t,e){p(t.precomputed);var r=t._getDoubles(),n=c(e,1,this._bitLength),i=(1<=o;u--)a=(a<<1)+n[u];s.push(a)}for(var h=this.jpoint(null,null,null),f=this.jpoint(null,null,null),l=i;l>0;l--){for(o=0;o=0;s--){for(var u=0;s>=0&&0===o[s];s--)u++;if(s>=0&&u++,a=a.dblp(u),s<0)break;var h=o[s];p(0!==h),a="affine"===t.type?h>0?a.mixedAdd(i[h-1>>1]):a.mixedAdd(i[-h-1>>1].neg()):h>0?a.add(i[h-1>>1]):a.add(i[-h-1>>1].neg())}return"affine"===t.type?a.toP():a},m.prototype._wnafMulAdd=function(t,e,r,n,i){var o,a,s,u=this._wnafT1,h=this._wnafT2,f=this._wnafT3,l=0;for(o=0;o=1;o-=2){var m=o-1,v=o;if(1===u[m]&&1===u[v]){var g=[e[m],null,null,e[v]];0===e[m].y.cmp(e[v].y)?(g[1]=e[m].add(e[v]),g[2]=e[m].toJ().mixedAdd(e[v].neg())):0===e[m].y.cmp(e[v].y.redNeg())?(g[1]=e[m].toJ().mixedAdd(e[v]),g[2]=e[m].add(e[v].neg())):(g[1]=e[m].toJ().mixedAdd(e[v]),g[2]=e[m].toJ().mixedAdd(e[v].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],b=d(r[m],r[v]);for(l=Math.max(b[0].length,l),f[m]=new Array(l),f[v]=new Array(l),a=0;a=0;o--){for(var S=0;o>=0;){var A=!0;for(a=0;a=0&&S++,_=_.dblp(S),o<0)break;for(a=0;a0?s=h[a][E-1>>1]:E<0&&(s=h[a][-E-1>>1].neg()),_="affine"===s.type?_.mixedAdd(s):_.add(s))}}for(o=0;o=Math.ceil((t.bitLength()+1)/e.step)},g.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(a=e,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a:a,b:s}]},w.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),h=o.mul(n.b);return{k1:t.sub(a).sub(s),k2:u.add(h).neg()}},w.prototype.pointFromX=function(t,e){(t=new i.a(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(e&&!o||!e&&o)&&(n=n.redNeg()),this.point(t,n)},w.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},w.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},_.prototype.isInfinity=function(){return this.inf},_.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},_.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},_.prototype.getX=function(){return this.x.fromRed()},_.prototype.getY=function(){return this.y.fromRed()},_.prototype.mul=function(t){return t=new i.a(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},_.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},_.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},_.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},_.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},_.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},y(k,v.BasePoint),w.prototype.jpoint=function(t,e,r){return new k(this,t,e,r)},k.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},k.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},k.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),a=t.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=s.redSqr(),f=h.redMul(s),l=n.redMul(h),c=u.redSqr().redIAdd(f).redISub(l).redISub(l),d=u.redMul(l.redISub(c)).redISub(o.redMul(f)),p=this.z.redMul(t.z).redMul(s);return this.curve.jpoint(c,d,p)},k.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),h=u.redMul(a),f=r.redMul(u),l=s.redSqr().redIAdd(h).redISub(f).redISub(f),c=s.redMul(f.redISub(l)).redISub(i.redMul(h)),d=this.z.redMul(a);return this.curve.jpoint(l,c,d)},k.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},k.prototype.inspect=function(){return this.isInfinity()?"":""},k.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var S=s((function(t,e){var r=e;r.base=v,r.short=M,r.mont=null,r.edwards=null})),A=s((function(t,e){var r,n=e,i=l.assert;function o(t){"short"===t.type?this.curve=new S.short(t):"edwards"===t.type?this.curve=new S.edwards(t):this.curve=new S.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(t,e){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var r=new o(e);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,s("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:a.a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("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:a.a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("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:a.a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("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:a.a.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"]}),s("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:a.a.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"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.a.sha256,gRed:!1,g:["9"]}),s("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:a.a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(u){r=void 0}s("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:a.a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function E(t){if(!(this instanceof E))return new E(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=f.toArray(t.entropy,t.entropyEnc||"hex"),r=f.toArray(t.nonce,t.nonceEnc||"hex"),n=f.toArray(t.pers,t.persEnc||"hex");u(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var x=E;E.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},E.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!==typeof e&&(n=r,r=e,e=null),r&&(r=f.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var P=l.assert;function C(t,e){if(t instanceof C)return t;this._importDER(t,e)||(P(t.r&&t.s,"Signature without r or s"),this.r=new i.a(t.r,16),this.s=new i.a(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var B=C;function I(){this.place=0}function N(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=e.place;o>>=0;return!(i<=127)&&(e.place=a,i)}function j(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}C.prototype._importDER=function(t,e){t=l.toArray(t,e);var r=new I;if(48!==t[r.place++])return!1;var n=N(t,r);if(!1===n)return!1;if(n+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var o=N(t,r);if(!1===o)return!1;var a=t.slice(r.place,o+r.place);if(r.place+=o,2!==t[r.place++])return!1;var s=N(t,r);if(!1===s)return!1;if(t.length!==s+r.place)return!1;var u=t.slice(r.place,s+r.place);if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}return this.r=new i.a(a),this.s=new i.a(u),this.recoveryParam=null,!0},C.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=j(e),r=j(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var n=[2];U(n,e.length),(n=n.concat(e)).push(2),U(n,r.length);var i=n.concat(r),o=[48];return U(o,i.length),o=o.concat(i),l.encode(o,t)};var L=function(){throw new Error("unsupported")},D=l.assert;function q(t){if(!(this instanceof q))return new q(t);"string"===typeof t&&(D(Object.prototype.hasOwnProperty.call(A,t),"Unknown curve "+t),t=A[t]),t instanceof A.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var F=q;q.prototype.keyPair=function(t){return new T(this,t)},q.prototype.keyFromPrivate=function(t,e){return T.fromPrivate(this,t,e)},q.prototype.keyFromPublic=function(t,e){return T.fromPublic(this,t,e)},q.prototype.genKeyPair=function(t){t||(t={});for(var e=new x({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||L(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new i.a(2));;){var o=new i.a(e.generate(r));if(!(o.cmp(n)>0))return o.iaddn(1),this.keyFromPrivate(o)}},q.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},q.prototype.sign=function(t,e,r,n){"object"===typeof r&&(n=r,r=null),n||(n={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new i.a(t,16));for(var o=this.n.byteLength(),a=e.getPrivate().toArray("be",o),s=t.toArray("be",o),u=new x({hash:this.hash,entropy:a,nonce:s,pers:n.pers,persEnc:n.persEnc||"utf8"}),h=this.n.sub(new i.a(1)),f=0;;f++){var l=n.k?n.k(f):new i.a(u.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(h)>=0)){var c=this.g.mul(l);if(!c.isInfinity()){var d=c.getX(),p=d.umod(this.n);if(0!==p.cmpn(0)){var m=l.invm(this.n).mul(p.mul(e.getPrivate()).iadd(t));if(0!==(m=m.umod(this.n)).cmpn(0)){var v=(c.getY().isOdd()?1:0)|(0!==d.cmp(p)?2:0);return n.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),v^=1),new B({r:p,s:m,recoveryParam:v})}}}}}},q.prototype.verify=function(t,e,r,n){t=this._truncateToN(new i.a(t,16)),r=this.keyFromPublic(r,n);var o=(e=new B(e,"hex")).r,a=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,u=a.invm(this.n),h=u.mul(t).umod(this.n),f=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(h,r.getPublic(),f)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(h,r.getPublic(),f)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},q.prototype.recoverPubKey=function(t,e,r,n){D((3&r)===r,"The recovery param is more than two bits"),e=new B(e,n);var o=this.n,a=new i.a(t),s=e.r,u=e.s,h=1&r,f=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw new Error("Unable to find sencond key candinate");s=f?this.curve.pointFromX(s.add(this.curve.n),h):this.curve.pointFromX(s,h);var l=e.r.invm(o),c=o.sub(a).mul(l).umod(o),d=u.mul(l).umod(o);return this.g.mulAdd(c,s,d)},q.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new B(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var z=s((function(t,e){var r=e;r.version="6.5.4",r.utils=l,r.rand=function(){throw new Error("unsupported")},r.curve=S,r.curves=A,r.ec=F,r.eddsa=null})).ec}).call(this,r(12))},function(t,e,r){"use strict";var n=r(302).version,i=r(36),o=r(303),a=r(76),s=r(152),u=r(512),h=r(513),f=r(20),l=function(){var t=this;i.packageInit(this,arguments),this.version=n,this.utils=f,this.eth=new o(this),this.shh=new u(this),this.bzz=new h(this);var e=this.setProvider;this.setProvider=function(r,n){return e.apply(t,arguments),t.eth.setRequestManager(t._requestManager),t.shh.setRequestManager(t._requestManager),t.bzz.setProvider(r),!0}};l.version=n,l.utils=f,l.modules={Eth:o,Net:a,Personal:s,Shh:u,Bzz:h},i.addProviders(l),t.exports=l},function(t,e,r){"use strict";function n(t){return function(e){var r=e.dispatch,n=e.getState;return function(e){return function(i){return"function"===typeof i?i(r,n,t):e(i)}}}}var i=n();i.withExtraArgument=n,e.a=i},function(t,e){t.exports=function(t,e,r,n){var i=r?r.call(n,t,e):void 0;if(void 0!==i)return!!i;if(t===e)return!0;if("object"!==typeof t||!t||"object"!==typeof e||!e)return!1;var o=Object.keys(t),a=Object.keys(e);if(o.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(e),u=0;ud)&&(D=(z=z.replace(" ",":")).length),0n&&(n=(e=e.trim()).charCodeAt(0)),n){case 38:return e.replace(v,"$1"+t.trim());case 58:return t.trim()+e.replace(v,"$1"+t.trim());default:if(0<1*r&&0u.charCodeAt(8))break;case 115:a=a.replace(u,"-webkit-"+u)+";"+a;break;case 207:case 102:a=a.replace(u,"-webkit-"+(102n.charCodeAt(0)&&(n=n.trim()),n=[n],0