!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=184)}([function(e,t,r){"use strict";(function(e){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ var n=r(185),i=r(186),o=r(107);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(e).length;default:if(n)return U(e).length;t=(""+t).toLowerCase(),n=!0}}function b(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){if(0===e.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:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:g(e,t,r,n,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,n,i){var o,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function f(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var h=!0,d=0;di&&(n=i):n=i;var o=t.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}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:f>223?3:f>191?2:1;if(i+h<=r)switch(h){case 1:f<128&&(c=f);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&f)<<6|63&o)>127&&(c=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&f)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&f)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}return function(e){var t=e.length;if(t<=E)return String.fromCharCode.apply(String,e);var r="",n=0;for(;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return k(this,t,r);case"latin1":case"binary":return I(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},u.prototype.compare=function(e,t,r,n,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var o=i-n,a=r-t,s=Math.min(o,a),f=this.slice(n,i),c=e.slice(t,r),h=0;hi)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return y(this,e,t,r);case"ascii":return w(this,e,t,r);case"latin1":case"binary":return _(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,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 E=4096;function k(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function O(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function R(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function N(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function C(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,n,o){return o||C(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function j(e,t,r,n,o){return o||C(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r,n=this.length;if(e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUInt8=function(e,t){return t||T(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||T(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||T(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||T(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||T(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||T(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||T(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||T(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||T(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||O(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||O(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||O(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||O(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||O(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):N(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||O(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);O(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);O(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||O(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||O(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||O(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||O(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):N(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||O(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return j(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return j(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=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),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=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((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function F(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(this,r(7))},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t,r){var n=r(0),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){(function(e){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a=r(239).Buffer}catch(e){}function s(e,t,r){for(var n=0,i=Math.min(e.length,r),o=t;o=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function u(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=e[i]|e[i-1]<<8|e[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(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)i=s(e,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==t&&(i=s(e,t,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,f=0,c=r;c1&&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"],c=[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],h=[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(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var f=1;f>>26,h=67108863&u,d=Math.min(f,t.length-1),l=Math.max(0,f-e.length+1);l<=d;l++){var p=f-l|0;c+=(a=(i=0|e.words[p])*(o=0|t.words[l])+h)/67108864|0,h=67108863&a}r.words[f]=0|h,u=0|c}return 0!==u?r.words[f]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(e=e||10,t=0|t||1,16===e||"hex"===e){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%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=c[e],l=h[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(e);r=(p=p.idivn(l)).isZero()?b+r:f[d-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=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 e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==a),this.toArrayLike(a,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,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"===t,f=new e(o),c=this.clone();if(u){for(s=0;!c.isZero();s++)a=c.andln(255),c.iushrn(8),f[s]=a;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,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(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,l=0|a[1],p=8191&l,b=l>>>13,m=0|a[2],g=8191&m,v=m>>>13,y=0|a[3],w=8191&y,_=y>>>13,S=0|a[4],M=8191&S,A=S>>>13,x=0|a[5],E=8191&x,k=x>>>13,I=0|a[6],P=8191&I,B=I>>>13,T=0|a[7],O=8191&T,R=T>>>13,N=0|a[8],C=8191&N,L=N>>>13,j=0|a[9],z=8191&j,D=j>>>13,U=0|s[0],F=8191&U,q=U>>>13,H=0|s[1],K=8191&H,V=H>>>13,G=0|s[2],Y=8191&G,W=G>>>13,Z=0|s[3],X=8191&Z,J=Z>>>13,$=0|s[4],Q=8191&$,ee=$>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,fe=se>>>13,ce=0|s[8],he=8191&ce,de=ce>>>13,le=0|s[9],pe=8191&le,be=le>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(f+(n=Math.imul(h,F))|0)+((8191&(i=(i=Math.imul(h,q))+Math.imul(d,F)|0))<<13)|0;f=((o=Math.imul(d,q))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,q))+Math.imul(b,F)|0,o=Math.imul(b,q);var ge=(f+(n=n+Math.imul(h,K)|0)|0)+((8191&(i=(i=i+Math.imul(h,V)|0)+Math.imul(d,K)|0))<<13)|0;f=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,F),i=(i=Math.imul(g,q))+Math.imul(v,F)|0,o=Math.imul(v,q),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,V)|0;var ve=(f+(n=n+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,W)|0)+Math.imul(d,Y)|0))<<13)|0;f=((o=o+Math.imul(d,W)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,q))+Math.imul(_,F)|0,o=Math.imul(_,q),n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,V)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,W)|0;var ye=(f+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(d,X)|0))<<13)|0;f=((o=o+Math.imul(d,J)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(M,F),i=(i=Math.imul(M,q))+Math.imul(A,F)|0,o=Math.imul(A,q),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,W)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,J)|0;var we=(f+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(d,Q)|0))<<13)|0;f=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,q))+Math.imul(k,F)|0,o=Math.imul(k,q),n=n+Math.imul(M,K)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(g,X)|0,i=(i=i+Math.imul(g,J)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,J)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0;var _e=(f+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(d,re)|0))<<13)|0;f=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(P,F),i=(i=Math.imul(P,q))+Math.imul(B,F)|0,o=Math.imul(B,q),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,W)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,W)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0;var Se=(f+(n=n+Math.imul(h,oe)|0)|0)+((8191&(i=(i=i+Math.imul(h,ae)|0)+Math.imul(d,oe)|0))<<13)|0;f=((o=o+Math.imul(d,ae)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(O,F),i=(i=Math.imul(O,q))+Math.imul(R,F)|0,o=Math.imul(R,q),n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,V)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,V)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(M,X)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,J)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0;var Me=(f+(n=n+Math.imul(h,ue)|0)|0)+((8191&(i=(i=i+Math.imul(h,fe)|0)+Math.imul(d,ue)|0))<<13)|0;f=((o=o+Math.imul(d,fe)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,q))+Math.imul(L,F)|0,o=Math.imul(L,q),n=n+Math.imul(O,K)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,V)|0,n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(B,Y)|0,o=o+Math.imul(B,W)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,fe)|0;var Ae=(f+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,de)|0)+Math.imul(d,he)|0))<<13)|0;f=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(z,F),i=(i=Math.imul(z,q))+Math.imul(D,F)|0,o=Math.imul(D,q),n=n+Math.imul(C,K)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(L,K)|0,o=o+Math.imul(L,V)|0,n=n+Math.imul(O,Y)|0,i=(i=i+Math.imul(O,W)|0)+Math.imul(R,Y)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(P,X)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,J)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(M,re)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,n=n+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,fe)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,fe)|0,n=n+Math.imul(p,he)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(b,he)|0,o=o+Math.imul(b,de)|0;var xe=(f+(n=n+Math.imul(h,pe)|0)|0)+((8191&(i=(i=i+Math.imul(h,be)|0)+Math.imul(d,pe)|0))<<13)|0;f=((o=o+Math.imul(d,be)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(z,K),i=(i=Math.imul(z,V))+Math.imul(D,K)|0,o=Math.imul(D,V),n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,W)|0,n=n+Math.imul(O,X)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,J)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,fe)|0,n=n+Math.imul(g,he)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(v,he)|0,o=o+Math.imul(v,de)|0;var Ee=(f+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;f=((o=o+Math.imul(b,be)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(z,Y),i=(i=Math.imul(z,W))+Math.imul(D,Y)|0,o=Math.imul(D,W),n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,J)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(P,re)|0,i=(i=i+Math.imul(P,ne)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,n=n+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,fe)|0)+Math.imul(A,ue)|0,o=o+Math.imul(A,fe)|0,n=n+Math.imul(w,he)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(_,he)|0,o=o+Math.imul(_,de)|0;var ke=(f+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,be)|0)+Math.imul(v,pe)|0))<<13)|0;f=((o=o+Math.imul(v,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(z,X),i=(i=Math.imul(z,J))+Math.imul(D,X)|0,o=Math.imul(D,J),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ne)|0,n=n+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,ae)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,ae)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,fe)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,fe)|0,n=n+Math.imul(M,he)|0,i=(i=i+Math.imul(M,de)|0)+Math.imul(A,he)|0,o=o+Math.imul(A,de)|0;var Ie=(f+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,be)|0)+Math.imul(_,pe)|0))<<13)|0;f=((o=o+Math.imul(_,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(z,Q),i=(i=Math.imul(z,ee))+Math.imul(D,Q)|0,o=Math.imul(D,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(L,re)|0,o=o+Math.imul(L,ne)|0,n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,ae)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,ae)|0,n=n+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,fe)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,fe)|0,n=n+Math.imul(E,he)|0,i=(i=i+Math.imul(E,de)|0)+Math.imul(k,he)|0,o=o+Math.imul(k,de)|0;var Pe=(f+(n=n+Math.imul(M,pe)|0)|0)+((8191&(i=(i=i+Math.imul(M,be)|0)+Math.imul(A,pe)|0))<<13)|0;f=((o=o+Math.imul(A,be)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(z,re),i=(i=Math.imul(z,ne))+Math.imul(D,re)|0,o=Math.imul(D,ne),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,ae)|0,n=n+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,fe)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,fe)|0,n=n+Math.imul(P,he)|0,i=(i=i+Math.imul(P,de)|0)+Math.imul(B,he)|0,o=o+Math.imul(B,de)|0;var Be=(f+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,be)|0)+Math.imul(k,pe)|0))<<13)|0;f=((o=o+Math.imul(k,be)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(z,oe),i=(i=Math.imul(z,ae))+Math.imul(D,oe)|0,o=Math.imul(D,ae),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,fe)|0)+Math.imul(L,ue)|0,o=o+Math.imul(L,fe)|0,n=n+Math.imul(O,he)|0,i=(i=i+Math.imul(O,de)|0)+Math.imul(R,he)|0,o=o+Math.imul(R,de)|0;var Te=(f+(n=n+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,be)|0)+Math.imul(B,pe)|0))<<13)|0;f=((o=o+Math.imul(B,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(z,ue),i=(i=Math.imul(z,fe))+Math.imul(D,ue)|0,o=Math.imul(D,fe),n=n+Math.imul(C,he)|0,i=(i=i+Math.imul(C,de)|0)+Math.imul(L,he)|0,o=o+Math.imul(L,de)|0;var Oe=(f+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,be)|0)+Math.imul(R,pe)|0))<<13)|0;f=((o=o+Math.imul(R,be)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(z,he),i=(i=Math.imul(z,de))+Math.imul(D,he)|0,o=Math.imul(D,de);var Re=(f+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,be)|0)+Math.imul(L,pe)|0))<<13)|0;f=((o=o+Math.imul(L,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Ne=(f+(n=Math.imul(z,pe))|0)+((8191&(i=(i=Math.imul(z,be))+Math.imul(D,pe)|0))<<13)|0;return f=((o=Math.imul(D,be))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=me,u[1]=ge,u[2]=ve,u[3]=ye,u[4]=we,u[5]=_e,u[6]=Se,u[7]=Me,u[8]=Ae,u[9]=xe,u[10]=Ee,u[11]=ke,u[12]=Ie,u[13]=Pe,u[14]=Be,u[15]=Te,u[16]=Oe,u[17]=Re,u[18]=Ne,0!==f&&(u[19]=f,r.length++),r};function p(e,t,r){return(new b).mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(l=d),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?l(this,e,t):r<63?d(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.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,e,t):p(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},b.prototype.permute=function(e,t,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*t;a>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,f=0;f=0&&(0!==c||f>=i);f--){var h=0|this.words[f];this.words[f]=c<<26-o|h>>>o,c=h&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(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(e,t){var r=(this.length,e.length),n=this.clone(),i=e,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"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var f=0;f=0;h--){var d=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(i,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=d)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),f=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++f;for(var c=r.clone(),h=t.clone();!t.isZero();){for(var d=0,l=1;0==(t.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(c),a.isub(h)),i.iushrn(1),a.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(h)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(u)):(r.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(f)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,c=1;0==(t.words[0]&c)&&f<26;++f,c<<=1);if(f>0)for(t.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var h=0,d=1;0==(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/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(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new S(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},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(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){S.call(this,e),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)}g.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):r.strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},i(v,g),v.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new y;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return m[e]=t,t},S.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,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(),f=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,f).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,i),d=this.pow(e,i.addn(1).iushrn(1)),l=this.pow(e,i),p=a;0!==l.cmp(s);){for(var b=l,m=0;0!==b.cmp(s);m++)b=b.redSqr();n(m=0;n--){for(var f=t.words[n],c=u-1;c>=0;c--){var h=f>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new M(e)},i(M,S),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},M.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),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)},M.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),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)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(24)(e))},function(e,t,r){e.exports=function(){var e=e||function(e,t){var r=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),n={},i=n.lib={},o=i.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},a=i.WordArray=o.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=void 0!=t?t:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var o=0;o>>2]>>>24-o%4*8&255;t[n+o>>>2]|=a<<24-(n+o)%4*8}else for(var o=0;o>>2]=r[o>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r,n=[],i=function(t){var t=t,r=987654321,n=4294967295;return function(){var i=((r=36969*(65535&r)+(r>>16)&n)<<16)+(t=18e3*(65535&t)+(t>>16)&n)&n;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}},o=0;o>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new a.init(r,t/2)}},f=s.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new a.init(r,t)}},c=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(f.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return f.parse(unescape(encodeURIComponent(e)))}},h=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=c.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,n=r.words,i=r.sigBytes,o=this.blockSize,s=4*o,u=i/s,f=(u=t?e.ceil(u):e.max((0|u)-this._minBufferSize,0))*o,c=e.min(4*f,i);if(f){for(var h=0;h * Copyright JS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */(function(){var o,a=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",u="Expected a function",f="__lodash_hash_undefined__",c=500,h="__lodash_placeholder__",d=1,l=2,p=4,b=1,m=2,g=1,v=2,y=4,w=8,_=16,S=32,M=64,A=128,x=256,E=512,k=30,I="...",P=800,B=16,T=1,O=2,R=1/0,N=9007199254740991,C=1.7976931348623157e308,L=NaN,j=4294967295,z=j-1,D=j>>>1,U=[["ary",A],["bind",g],["bindKey",v],["curry",w],["curryRight",_],["flip",E],["partial",S],["partialRight",M],["rearg",x]],F="[object Arguments]",q="[object Array]",H="[object AsyncFunction]",K="[object Boolean]",V="[object Date]",G="[object DOMException]",Y="[object Error]",W="[object Function]",Z="[object GeneratorFunction]",X="[object Map]",J="[object Number]",$="[object Null]",Q="[object Object]",ee="[object Proxy]",te="[object RegExp]",re="[object Set]",ne="[object String]",ie="[object Symbol]",oe="[object Undefined]",ae="[object WeakMap]",se="[object WeakSet]",ue="[object ArrayBuffer]",fe="[object DataView]",ce="[object Float32Array]",he="[object Float64Array]",de="[object Int8Array]",le="[object Int16Array]",pe="[object Int32Array]",be="[object Uint8Array]",me="[object Uint8ClampedArray]",ge="[object Uint16Array]",ve="[object Uint32Array]",ye=/\b__p \+= '';/g,we=/\b(__p \+=) '' \+/g,_e=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Se=/&(?:amp|lt|gt|quot|#39);/g,Me=/[&<>"']/g,Ae=RegExp(Se.source),xe=RegExp(Me.source),Ee=/<%-([\s\S]+?)%>/g,ke=/<%([\s\S]+?)%>/g,Ie=/<%=([\s\S]+?)%>/g,Pe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Be=/^\w*$/,Te=/^\./,Oe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Re=/[\\^$.*+?()[\]{}|]/g,Ne=RegExp(Re.source),Ce=/^\s+|\s+$/g,Le=/^\s+/,je=/\s+$/,ze=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,De=/\{\n\/\* \[wrapped with (.+)\] \*/,Ue=/,? & /,Fe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,qe=/\\(\\)?/g,He=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ke=/\w*$/,Ve=/^[-+]0x[0-9a-f]+$/i,Ge=/^0b[01]+$/i,Ye=/^\[object .+?Constructor\]$/,We=/^0o[0-7]+$/i,Ze=/^(?:0|[1-9]\d*)$/,Xe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Je=/($^)/,$e=/['\n\r\u2028\u2029\\]/g,Qe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",et="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",tt="[\\ud800-\\udfff]",rt="["+et+"]",nt="["+Qe+"]",it="\\d+",ot="[\\u2700-\\u27bf]",at="[a-z\\xdf-\\xf6\\xf8-\\xff]",st="[^\\ud800-\\udfff"+et+it+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ut="\\ud83c[\\udffb-\\udfff]",ft="[^\\ud800-\\udfff]",ct="(?:\\ud83c[\\udde6-\\uddff]){2}",ht="[\\ud800-\\udbff][\\udc00-\\udfff]",dt="[A-Z\\xc0-\\xd6\\xd8-\\xde]",lt="(?:"+at+"|"+st+")",pt="(?:"+dt+"|"+st+")",bt="(?:"+nt+"|"+ut+")"+"?",mt="[\\ufe0e\\ufe0f]?"+bt+("(?:\\u200d(?:"+[ft,ct,ht].join("|")+")[\\ufe0e\\ufe0f]?"+bt+")*"),gt="(?:"+[ot,ct,ht].join("|")+")"+mt,vt="(?:"+[ft+nt+"?",nt,ct,ht,tt].join("|")+")",yt=RegExp("['’]","g"),wt=RegExp(nt,"g"),_t=RegExp(ut+"(?="+ut+")|"+vt+mt,"g"),St=RegExp([dt+"?"+at+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[rt,dt,"$"].join("|")+")",pt+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[rt,dt+lt,"$"].join("|")+")",dt+"?"+lt+"+(?:['’](?:d|ll|m|re|s|t|ve))?",dt+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)","\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)",it,gt].join("|"),"g"),Mt=RegExp("[\\u200d\\ud800-\\udfff"+Qe+"\\ufe0e\\ufe0f]"),At=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,xt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Et=-1,kt={};kt[ce]=kt[he]=kt[de]=kt[le]=kt[pe]=kt[be]=kt[me]=kt[ge]=kt[ve]=!0,kt[F]=kt[q]=kt[ue]=kt[K]=kt[fe]=kt[V]=kt[Y]=kt[W]=kt[X]=kt[J]=kt[Q]=kt[te]=kt[re]=kt[ne]=kt[ae]=!1;var It={};It[F]=It[q]=It[ue]=It[fe]=It[K]=It[V]=It[ce]=It[he]=It[de]=It[le]=It[pe]=It[X]=It[J]=It[Q]=It[te]=It[re]=It[ne]=It[ie]=It[be]=It[me]=It[ge]=It[ve]=!0,It[Y]=It[W]=It[ae]=!1;var Pt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Bt=parseFloat,Tt=parseInt,Ot="object"==typeof e&&e&&e.Object===Object&&e,Rt="object"==typeof self&&self&&self.Object===Object&&self,Nt=Ot||Rt||Function("return this")(),Ct=t&&!t.nodeType&&t,Lt=Ct&&"object"==typeof n&&n&&!n.nodeType&&n,jt=Lt&&Lt.exports===Ct,zt=jt&&Ot.process,Dt=function(){try{return zt&&zt.binding&&zt.binding("util")}catch(e){}}(),Ut=Dt&&Dt.isArrayBuffer,Ft=Dt&&Dt.isDate,qt=Dt&&Dt.isMap,Ht=Dt&&Dt.isRegExp,Kt=Dt&&Dt.isSet,Vt=Dt&&Dt.isTypedArray;function Gt(e,t){return e.set(t[0],t[1]),e}function Yt(e,t){return e.add(t),e}function Wt(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Zt(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i-1}function tr(e,t,r){for(var n=-1,i=null==e?0:e.length;++n-1;);return r}function Mr(e,t){for(var r=e.length;r--&&cr(t,e[r],0)>-1;);return r}var Ar=br({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),xr=br({"&":"&","<":"<",">":">",'"':""","'":"'"});function Er(e){return"\\"+Pt[e]}function kr(e){return Mt.test(e)}function Ir(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}function Pr(e,t){return function(r){return e(t(r))}}function Br(e,t){for(var r=-1,n=e.length,i=0,o=[];++r",""":'"',"'":"'"});var Lr=function e(t){var r=(t=null==t?Nt:Lr.defaults(Nt.Object(),t,Lr.pick(Nt,xt))).Array,n=t.Date,i=t.Error,Qe=t.Function,et=t.Math,tt=t.Object,rt=t.RegExp,nt=t.String,it=t.TypeError,ot=r.prototype,at=Qe.prototype,st=tt.prototype,ut=t["__core-js_shared__"],ft=at.toString,ct=st.hasOwnProperty,ht=0,dt=function(){var e=/[^.]+$/.exec(ut&&ut.keys&&ut.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),lt=st.toString,pt=ft.call(tt),bt=Nt._,mt=rt("^"+ft.call(ct).replace(Re,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gt=jt?t.Buffer:o,vt=t.Symbol,_t=t.Uint8Array,Mt=gt?gt.allocUnsafe:o,Pt=Pr(tt.getPrototypeOf,tt),Ot=tt.create,Rt=st.propertyIsEnumerable,Ct=ot.splice,Lt=vt?vt.isConcatSpreadable:o,zt=vt?vt.iterator:o,Dt=vt?vt.toStringTag:o,sr=function(){try{var e=Fo(tt,"defineProperty");return e({},"",{}),e}catch(e){}}(),br=t.clearTimeout!==Nt.clearTimeout&&t.clearTimeout,jr=n&&n.now!==Nt.Date.now&&n.now,zr=t.setTimeout!==Nt.setTimeout&&t.setTimeout,Dr=et.ceil,Ur=et.floor,Fr=tt.getOwnPropertySymbols,qr=gt?gt.isBuffer:o,Hr=t.isFinite,Kr=ot.join,Vr=Pr(tt.keys,tt),Gr=et.max,Yr=et.min,Wr=n.now,Zr=t.parseInt,Xr=et.random,Jr=ot.reverse,$r=Fo(t,"DataView"),Qr=Fo(t,"Map"),en=Fo(t,"Promise"),tn=Fo(t,"Set"),rn=Fo(t,"WeakMap"),nn=Fo(tt,"create"),on=rn&&new rn,an={},sn=da($r),un=da(Qr),fn=da(en),cn=da(tn),hn=da(rn),dn=vt?vt.prototype:o,ln=dn?dn.valueOf:o,pn=dn?dn.toString:o;function bn(e){if(Ps(e)&&!vs(e)&&!(e instanceof yn)){if(e instanceof vn)return e;if(ct.call(e,"__wrapped__"))return la(e)}return new vn(e)}var mn=function(){function e(){}return function(t){if(!Is(t))return{};if(Ot)return Ot(t);e.prototype=t;var r=new e;return e.prototype=o,r}}();function gn(){}function vn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=o}function yn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=j,this.__views__=[]}function wn(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function jn(e,t,r,n,i,a){var s,u=t&d,f=t&l,c=t&p;if(r&&(s=i?r(e,n,i,a):r(e)),s!==o)return s;if(!Is(e))return e;var h=vs(e);if(h){if(s=function(e){var t=e.length,r=e.constructor(t);return t&&"string"==typeof e[0]&&ct.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!u)return io(e,s)}else{var b=Ko(e),m=b==W||b==Z;if(Ss(e))return $i(e,u);if(b==Q||b==F||m&&!i){if(s=f||m?{}:Go(e),!u)return f?function(e,t){return oo(e,Ho(e),t)}(e,function(e,t){return e&&oo(t,au(t),e)}(s,e)):function(e,t){return oo(e,qo(e),t)}(e,Rn(s,e))}else{if(!It[b])return i?e:{};s=function(e,t,r,n){var i=e.constructor;switch(t){case ue:return Qi(e);case K:case V:return new i(+e);case fe:return function(e,t){var r=t?Qi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,n);case ce:case he:case de:case le:case pe:case be:case me:case ge:case ve:return eo(e,n);case X:return function(e,t,r){return ir(t?r(Ir(e),d):Ir(e),Gt,new e.constructor)}(e,n,r);case J:case ne:return new i(e);case te:return function(e){var t=new e.constructor(e.source,Ke.exec(e));return t.lastIndex=e.lastIndex,t}(e);case re:return function(e,t,r){return ir(t?r(Tr(e),d):Tr(e),Yt,new e.constructor)}(e,n,r);case ie:return function(e){return ln?tt(ln.call(e)):{}}(e)}}(e,b,jn,u)}}a||(a=new An);var g=a.get(e);if(g)return g;a.set(e,s);var v=h?o:(c?f?No:Ro:f?au:ou)(e);return Xt(v||e,function(n,i){v&&(n=e[i=n]),Bn(s,i,jn(n,t,r,i,e,a))}),s}function zn(e,t,r){var n=r.length;if(null==e)return!n;for(e=tt(e);n--;){var i=r[n],a=t[i],s=e[i];if(s===o&&!(i in e)||!a(s))return!1}return!0}function Dn(e,t,r){if("function"!=typeof e)throw new it(u);return oa(function(){e.apply(o,r)},t)}function Un(e,t,r,n){var i=-1,o=er,s=!0,u=e.length,f=[],c=t.length;if(!u)return f;r&&(t=rr(t,yr(r))),n?(o=tr,s=!1):t.length>=a&&(o=_r,s=!1,t=new Mn(t));e:for(;++i-1},_n.prototype.set=function(e,t){var r=this.__data__,n=Tn(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Sn.prototype.clear=function(){this.size=0,this.__data__={hash:new wn,map:new(Qr||_n),string:new wn}},Sn.prototype.delete=function(e){var t=Do(this,e).delete(e);return this.size-=t?1:0,t},Sn.prototype.get=function(e){return Do(this,e).get(e)},Sn.prototype.has=function(e){return Do(this,e).has(e)},Sn.prototype.set=function(e,t){var r=Do(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Mn.prototype.add=Mn.prototype.push=function(e){return this.__data__.set(e,f),this},Mn.prototype.has=function(e){return this.__data__.has(e)},An.prototype.clear=function(){this.__data__=new _n,this.size=0},An.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},An.prototype.get=function(e){return this.__data__.get(e)},An.prototype.has=function(e){return this.__data__.has(e)},An.prototype.set=function(e,t){var r=this.__data__;if(r instanceof _n){var n=r.__data__;if(!Qr||n.length0&&r(s)?t>1?Gn(s,t-1,r,n,i):nr(i,s):n||(i[i.length]=s)}return i}var Yn=fo(),Wn=fo(!0);function Zn(e,t){return e&&Yn(e,t,ou)}function Xn(e,t){return e&&Wn(e,t,ou)}function Jn(e,t){return Qt(t,function(t){return xs(e[t])})}function $n(e,t){for(var r=0,n=(t=Wi(t,e)).length;null!=e&&rt}function ri(e,t){return null!=e&&ct.call(e,t)}function ni(e,t){return null!=e&&t in tt(e)}function ii(e,t,n){for(var i=n?tr:er,a=e[0].length,s=e.length,u=s,f=r(s),c=1/0,h=[];u--;){var d=e[u];u&&t&&(d=rr(d,yr(t))),c=Yr(d.length,c),f[u]=!n&&(t||a>=120&&d.length>=120)?new Mn(u&&d):o}d=e[0];var l=-1,p=f[0];e:for(;++l=s)return u;var f=r[n];return u*("desc"==f?-1:1)}}return e.index-t.index}(e,t,r)})}function wi(e,t,r){for(var n=-1,i=t.length,o={};++n-1;)s!==e&&Ct.call(s,u,1),Ct.call(e,u,1);return e}function Si(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;Wo(i)?Ct.call(e,i,1):Ui(e,i)}}return e}function Mi(e,t){return e+Ur(Xr()*(t-e+1))}function Ai(e,t){var r="";if(!e||t<1||t>N)return r;do{t%2&&(r+=e),(t=Ur(t/2))&&(e+=e)}while(t);return r}function xi(e,t){return aa(ra(e,t,Tu),e+"")}function Ei(e){return En(pu(e))}function ki(e,t){var r=pu(e);return fa(r,Ln(t,0,r.length))}function Ii(e,t,r,n){if(!Is(e))return e;for(var i=-1,a=(t=Wi(t,e)).length,s=a-1,u=e;null!=u&&++io?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=r(o);++i>>1,a=e[o];null!==a&&!Ls(a)&&(r?a<=t:a=a){var c=t?null:xo(e);if(c)return Tr(c);s=!1,i=_r,f=new Mn}else f=t?[]:u;e:for(;++n=n?e:Oi(e,t,r)}var Ji=br||function(e){return Nt.clearTimeout(e)};function $i(e,t){if(t)return e.slice();var r=e.length,n=Mt?Mt(r):new e.constructor(r);return e.copy(n),n}function Qi(e){var t=new e.constructor(e.byteLength);return new _t(t).set(new _t(e)),t}function eo(e,t){var r=t?Qi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function to(e,t){if(e!==t){var r=e!==o,n=null===e,i=e==e,a=Ls(e),s=t!==o,u=null===t,f=t==t,c=Ls(t);if(!u&&!c&&!a&&e>t||a&&s&&f&&!u&&!c||n&&s&&f||!r&&f||!i)return 1;if(!n&&!a&&!c&&e1?r[i-1]:o,s=i>2?r[2]:o;for(a=e.length>3&&"function"==typeof a?(i--,a):o,s&&Zo(r[0],r[1],s)&&(a=i<3?o:a,i=1),t=tt(t);++n-1?i[a?t[s]:s]:o}}function bo(e){return Oo(function(t){var r=t.length,n=r,i=vn.prototype.thru;for(e&&t.reverse();n--;){var a=t[n];if("function"!=typeof a)throw new it(u);if(i&&!s&&"wrapper"==Lo(a))var s=new vn([],!0)}for(n=s?n:r;++n1&&w.reverse(),d&&cu))return!1;var c=a.get(e);if(c&&a.get(t))return c==t;var h=-1,d=!0,l=r&m?new Mn:o;for(a.set(e,t),a.set(t,e);++h-1&&e%1==0&&e1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(ze,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Xt(U,function(r){var n="_."+r[0];t&r[1]&&!er(e,n)&&e.push(n)}),e.sort()}(function(e){var t=e.match(De);return t?t[1].split(Ue):[]}(n),r)))}function ua(e){var t=0,r=0;return function(){var n=Wr(),i=B-(n-r);if(r=n,i>0){if(++t>=P)return arguments[0]}else t=0;return e.apply(o,arguments)}}function fa(e,t){var r=-1,n=e.length,i=n-1;for(t=t===o?n:t;++r1?e[t-1]:o;return Ra(e,r="function"==typeof r?(e.pop(),r):o)});function Ua(e){var t=bn(e);return t.__chain__=!0,t}function Fa(e,t){return t(e)}var qa=Oo(function(e){var t=e.length,r=t?e[0]:0,n=this.__wrapped__,i=function(t){return Cn(t,e)};return!(t>1||this.__actions__.length)&&n instanceof yn&&Wo(r)?((n=n.slice(r,+r+(t?1:0))).__actions__.push({func:Fa,args:[i],thisArg:o}),new vn(n,this.__chain__).thru(function(e){return t&&!e.length&&e.push(o),e})):this.thru(i)});var Ha=ao(function(e,t,r){ct.call(e,r)?++e[r]:Nn(e,r,1)});var Ka=po(ga),Va=po(va);function Ga(e,t){return(vs(e)?Xt:Fn)(e,zo(t,3))}function Ya(e,t){return(vs(e)?Jt:qn)(e,zo(t,3))}var Wa=ao(function(e,t,r){ct.call(e,r)?e[r].push(t):Nn(e,r,[t])});var Za=xi(function(e,t,n){var i=-1,o="function"==typeof t,a=ws(e)?r(e.length):[];return Fn(e,function(e){a[++i]=o?Wt(t,e,n):oi(e,t,n)}),a}),Xa=ao(function(e,t,r){Nn(e,r,t)});function Ja(e,t){return(vs(e)?rr:pi)(e,zo(t,3))}var $a=ao(function(e,t,r){e[r?0:1].push(t)},function(){return[[],[]]});var Qa=xi(function(e,t){if(null==e)return[];var r=t.length;return r>1&&Zo(e,t[0],t[1])?t=[]:r>2&&Zo(t[0],t[1],t[2])&&(t=[t[0]]),yi(e,Gn(t,1),[])}),es=jr||function(){return Nt.Date.now()};function ts(e,t,r){return t=r?o:t,t=e&&null==t?e.length:t,ko(e,A,o,o,o,o,t)}function rs(e,t){var r;if("function"!=typeof t)throw new it(u);return e=qs(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=o),r}}var ns=xi(function(e,t,r){var n=g;if(r.length){var i=Br(r,jo(ns));n|=S}return ko(e,n,t,r,i)}),is=xi(function(e,t,r){var n=g|v;if(r.length){var i=Br(r,jo(is));n|=S}return ko(t,n,e,r,i)});function os(e,t,r){var n,i,a,s,f,c,h=0,d=!1,l=!1,p=!0;if("function"!=typeof e)throw new it(u);function b(t){var r=n,a=i;return n=i=o,h=t,s=e.apply(a,r)}function m(e){var r=e-c;return c===o||r>=t||r<0||l&&e-h>=a}function g(){var e=es();if(m(e))return v(e);f=oa(g,function(e){var r=t-(e-c);return l?Yr(r,a-(e-h)):r}(e))}function v(e){return f=o,p&&n?b(e):(n=i=o,s)}function y(){var e=es(),r=m(e);if(n=arguments,i=this,c=e,r){if(f===o)return function(e){return h=e,f=oa(g,t),d?b(e):s}(c);if(l)return f=oa(g,t),b(c)}return f===o&&(f=oa(g,t)),s}return t=Ks(t)||0,Is(r)&&(d=!!r.leading,a=(l="maxWait"in r)?Gr(Ks(r.maxWait)||0,t):a,p="trailing"in r?!!r.trailing:p),y.cancel=function(){f!==o&&Ji(f),h=0,n=c=i=f=o},y.flush=function(){return f===o?s:v(es())},y}var as=xi(function(e,t){return Dn(e,1,t)}),ss=xi(function(e,t,r){return Dn(e,Ks(t)||0,r)});function us(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new it(u);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(us.Cache||Sn),r}function fs(e){if("function"!=typeof e)throw new it(u);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}us.Cache=Sn;var cs=Zi(function(e,t){var r=(t=1==t.length&&vs(t[0])?rr(t[0],yr(zo())):rr(Gn(t,1),yr(zo()))).length;return xi(function(n){for(var i=-1,o=Yr(n.length,r);++i=t}),gs=ai(function(){return arguments}())?ai:function(e){return Ps(e)&&ct.call(e,"callee")&&!Rt.call(e,"callee")},vs=r.isArray,ys=Ut?yr(Ut):function(e){return Ps(e)&&ei(e)==ue};function ws(e){return null!=e&&ks(e.length)&&!xs(e)}function _s(e){return Ps(e)&&ws(e)}var Ss=qr||Ku,Ms=Ft?yr(Ft):function(e){return Ps(e)&&ei(e)==V};function As(e){if(!Ps(e))return!1;var t=ei(e);return t==Y||t==G||"string"==typeof e.message&&"string"==typeof e.name&&!Os(e)}function xs(e){if(!Is(e))return!1;var t=ei(e);return t==W||t==Z||t==H||t==ee}function Es(e){return"number"==typeof e&&e==qs(e)}function ks(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=N}function Is(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ps(e){return null!=e&&"object"==typeof e}var Bs=qt?yr(qt):function(e){return Ps(e)&&Ko(e)==X};function Ts(e){return"number"==typeof e||Ps(e)&&ei(e)==J}function Os(e){if(!Ps(e)||ei(e)!=Q)return!1;var t=Pt(e);if(null===t)return!0;var r=ct.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&ft.call(r)==pt}var Rs=Ht?yr(Ht):function(e){return Ps(e)&&ei(e)==te};var Ns=Kt?yr(Kt):function(e){return Ps(e)&&Ko(e)==re};function Cs(e){return"string"==typeof e||!vs(e)&&Ps(e)&&ei(e)==ne}function Ls(e){return"symbol"==typeof e||Ps(e)&&ei(e)==ie}var js=Vt?yr(Vt):function(e){return Ps(e)&&ks(e.length)&&!!kt[ei(e)]};var zs=So(li),Ds=So(function(e,t){return e<=t});function Us(e){if(!e)return[];if(ws(e))return Cs(e)?Nr(e):io(e);if(zt&&e[zt])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[zt]());var t=Ko(e);return(t==X?Ir:t==re?Tr:pu)(e)}function Fs(e){return e?(e=Ks(e))===R||e===-R?(e<0?-1:1)*C:e==e?e:0:0===e?e:0}function qs(e){var t=Fs(e),r=t%1;return t==t?r?t-r:t:0}function Hs(e){return e?Ln(qs(e),0,j):0}function Ks(e){if("number"==typeof e)return e;if(Ls(e))return L;if(Is(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Is(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Ce,"");var r=Ge.test(e);return r||We.test(e)?Tt(e.slice(2),r?2:8):Ve.test(e)?L:+e}function Vs(e){return oo(e,au(e))}function Gs(e){return null==e?"":zi(e)}var Ys=so(function(e,t){if(Qo(t)||ws(t))oo(t,ou(t),e);else for(var r in t)ct.call(t,r)&&Bn(e,r,t[r])}),Ws=so(function(e,t){oo(t,au(t),e)}),Zs=so(function(e,t,r,n){oo(t,au(t),e,n)}),Xs=so(function(e,t,r,n){oo(t,ou(t),e,n)}),Js=Oo(Cn);var $s=xi(function(e){return e.push(o,Io),Wt(Zs,o,e)}),Qs=xi(function(e){return e.push(o,Po),Wt(uu,o,e)});function eu(e,t,r){var n=null==e?o:$n(e,t);return n===o?r:n}function tu(e,t){return null!=e&&Vo(e,t,ni)}var ru=go(function(e,t,r){e[t]=r},Iu(Tu)),nu=go(function(e,t,r){ct.call(e,t)?e[t].push(r):e[t]=[r]},zo),iu=xi(oi);function ou(e){return ws(e)?xn(e):hi(e)}function au(e){return ws(e)?xn(e,!0):di(e)}var su=so(function(e,t,r){gi(e,t,r)}),uu=so(function(e,t,r,n){gi(e,t,r,n)}),fu=Oo(function(e,t){var r={};if(null==e)return r;var n=!1;t=rr(t,function(t){return t=Wi(t,e),n||(n=t.length>1),t}),oo(e,No(e),r),n&&(r=jn(r,d|l|p,Bo));for(var i=t.length;i--;)Ui(r,t[i]);return r});var cu=Oo(function(e,t){return null==e?{}:function(e,t){return wi(e,t,function(t,r){return tu(e,r)})}(e,t)});function hu(e,t){if(null==e)return{};var r=rr(No(e),function(e){return[e]});return t=zo(t),wi(e,r,function(e,r){return t(e,r[0])})}var du=Eo(ou),lu=Eo(au);function pu(e){return null==e?[]:wr(e,ou(e))}var bu=ho(function(e,t,r){return t=t.toLowerCase(),e+(r?mu(t):t)});function mu(e){return Au(Gs(e).toLowerCase())}function gu(e){return(e=Gs(e))&&e.replace(Xe,Ar).replace(wt,"")}var vu=ho(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()}),yu=ho(function(e,t,r){return e+(r?" ":"")+t.toLowerCase()}),wu=co("toLowerCase");var _u=ho(function(e,t,r){return e+(r?"_":"")+t.toLowerCase()});var Su=ho(function(e,t,r){return e+(r?" ":"")+Au(t)});var Mu=ho(function(e,t,r){return e+(r?" ":"")+t.toUpperCase()}),Au=co("toUpperCase");function xu(e,t,r){return e=Gs(e),(t=r?o:t)===o?function(e){return At.test(e)}(e)?function(e){return e.match(St)||[]}(e):function(e){return e.match(Fe)||[]}(e):e.match(t)||[]}var Eu=xi(function(e,t){try{return Wt(e,o,t)}catch(e){return As(e)?e:new i(e)}}),ku=Oo(function(e,t){return Xt(t,function(t){t=ha(t),Nn(e,t,ns(e[t],e))}),e});function Iu(e){return function(){return e}}var Pu=bo(),Bu=bo(!0);function Tu(e){return e}function Ou(e){return ci("function"==typeof e?e:jn(e,d))}var Ru=xi(function(e,t){return function(r){return oi(r,e,t)}}),Nu=xi(function(e,t){return function(r){return oi(e,r,t)}});function Cu(e,t,r){var n=ou(t),i=Jn(t,n);null!=r||Is(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=Jn(t,ou(t)));var o=!(Is(r)&&"chain"in r&&!r.chain),a=xs(e);return Xt(i,function(r){var n=t[r];e[r]=n,a&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__);return(r.__actions__=io(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,nr([this.value()],arguments))})}),e}function Lu(){}var ju=yo(rr),zu=yo($t),Du=yo(ar);function Uu(e){return Xo(e)?pr(ha(e)):function(e){return function(t){return $n(t,e)}}(e)}var Fu=_o(),qu=_o(!0);function Hu(){return[]}function Ku(){return!1}var Vu=vo(function(e,t){return e+t},0),Gu=Ao("ceil"),Yu=vo(function(e,t){return e/t},1),Wu=Ao("floor");var Zu=vo(function(e,t){return e*t},1),Xu=Ao("round"),Ju=vo(function(e,t){return e-t},0);return bn.after=function(e,t){if("function"!=typeof t)throw new it(u);return e=qs(e),function(){if(--e<1)return t.apply(this,arguments)}},bn.ary=ts,bn.assign=Ys,bn.assignIn=Ws,bn.assignInWith=Zs,bn.assignWith=Xs,bn.at=Js,bn.before=rs,bn.bind=ns,bn.bindAll=ku,bn.bindKey=is,bn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return vs(e)?e:[e]},bn.chain=Ua,bn.chunk=function(e,t,n){t=(n?Zo(e,t,n):t===o)?1:Gr(qs(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var a=0,s=0,u=r(Dr(i/t));ai?0:i+r),(n=n===o||n>i?i:qs(n))<0&&(n+=i),n=r>n?0:Hs(n);r>>0)?(e=Gs(e))&&("string"==typeof t||null!=t&&!Rs(t))&&!(t=zi(t))&&kr(e)?Xi(Nr(e),0,r):e.split(t,r):[]},bn.spread=function(e,t){if("function"!=typeof e)throw new it(u);return t=null==t?0:Gr(qs(t),0),xi(function(r){var n=r[t],i=Xi(r,0,t);return n&&nr(i,n),Wt(e,this,i)})},bn.tail=function(e){var t=null==e?0:e.length;return t?Oi(e,1,t):[]},bn.take=function(e,t,r){return e&&e.length?Oi(e,0,(t=r||t===o?1:qs(t))<0?0:t):[]},bn.takeRight=function(e,t,r){var n=null==e?0:e.length;return n?Oi(e,(t=n-(t=r||t===o?1:qs(t)))<0?0:t,n):[]},bn.takeRightWhile=function(e,t){return e&&e.length?qi(e,zo(t,3),!1,!0):[]},bn.takeWhile=function(e,t){return e&&e.length?qi(e,zo(t,3)):[]},bn.tap=function(e,t){return t(e),e},bn.throttle=function(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new it(u);return Is(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),os(e,t,{leading:n,maxWait:t,trailing:i})},bn.thru=Fa,bn.toArray=Us,bn.toPairs=du,bn.toPairsIn=lu,bn.toPath=function(e){return vs(e)?rr(e,ha):Ls(e)?[e]:io(ca(Gs(e)))},bn.toPlainObject=Vs,bn.transform=function(e,t,r){var n=vs(e),i=n||Ss(e)||js(e);if(t=zo(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:Is(e)&&xs(o)?mn(Pt(e)):{}}return(i?Xt:Zn)(e,function(e,n,i){return t(r,e,n,i)}),r},bn.unary=function(e){return ts(e,1)},bn.union=Pa,bn.unionBy=Ba,bn.unionWith=Ta,bn.uniq=function(e){return e&&e.length?Di(e):[]},bn.uniqBy=function(e,t){return e&&e.length?Di(e,zo(t,2)):[]},bn.uniqWith=function(e,t){return t="function"==typeof t?t:o,e&&e.length?Di(e,o,t):[]},bn.unset=function(e,t){return null==e||Ui(e,t)},bn.unzip=Oa,bn.unzipWith=Ra,bn.update=function(e,t,r){return null==e?e:Fi(e,t,Yi(r))},bn.updateWith=function(e,t,r,n){return n="function"==typeof n?n:o,null==e?e:Fi(e,t,Yi(r),n)},bn.values=pu,bn.valuesIn=function(e){return null==e?[]:wr(e,au(e))},bn.without=Na,bn.words=xu,bn.wrap=function(e,t){return hs(Yi(t),e)},bn.xor=Ca,bn.xorBy=La,bn.xorWith=ja,bn.zip=za,bn.zipObject=function(e,t){return Vi(e||[],t||[],Bn)},bn.zipObjectDeep=function(e,t){return Vi(e||[],t||[],Ii)},bn.zipWith=Da,bn.entries=du,bn.entriesIn=lu,bn.extend=Ws,bn.extendWith=Zs,Cu(bn,bn),bn.add=Vu,bn.attempt=Eu,bn.camelCase=bu,bn.capitalize=mu,bn.ceil=Gu,bn.clamp=function(e,t,r){return r===o&&(r=t,t=o),r!==o&&(r=(r=Ks(r))==r?r:0),t!==o&&(t=(t=Ks(t))==t?t:0),Ln(Ks(e),t,r)},bn.clone=function(e){return jn(e,p)},bn.cloneDeep=function(e){return jn(e,d|p)},bn.cloneDeepWith=function(e,t){return jn(e,d|p,t="function"==typeof t?t:o)},bn.cloneWith=function(e,t){return jn(e,p,t="function"==typeof t?t:o)},bn.conformsTo=function(e,t){return null==t||zn(e,t,ou(t))},bn.deburr=gu,bn.defaultTo=function(e,t){return null==e||e!=e?t:e},bn.divide=Yu,bn.endsWith=function(e,t,r){e=Gs(e),t=zi(t);var n=e.length,i=r=r===o?n:Ln(qs(r),0,n);return(r-=t.length)>=0&&e.slice(r,i)==t},bn.eq=ps,bn.escape=function(e){return(e=Gs(e))&&xe.test(e)?e.replace(Me,xr):e},bn.escapeRegExp=function(e){return(e=Gs(e))&&Ne.test(e)?e.replace(Re,"\\$&"):e},bn.every=function(e,t,r){var n=vs(e)?$t:Hn;return r&&Zo(e,t,r)&&(t=o),n(e,zo(t,3))},bn.find=Ka,bn.findIndex=ga,bn.findKey=function(e,t){return ur(e,zo(t,3),Zn)},bn.findLast=Va,bn.findLastIndex=va,bn.findLastKey=function(e,t){return ur(e,zo(t,3),Xn)},bn.floor=Wu,bn.forEach=Ga,bn.forEachRight=Ya,bn.forIn=function(e,t){return null==e?e:Yn(e,zo(t,3),au)},bn.forInRight=function(e,t){return null==e?e:Wn(e,zo(t,3),au)},bn.forOwn=function(e,t){return e&&Zn(e,zo(t,3))},bn.forOwnRight=function(e,t){return e&&Xn(e,zo(t,3))},bn.get=eu,bn.gt=bs,bn.gte=ms,bn.has=function(e,t){return null!=e&&Vo(e,t,ri)},bn.hasIn=tu,bn.head=wa,bn.identity=Tu,bn.includes=function(e,t,r,n){e=ws(e)?e:pu(e),r=r&&!n?qs(r):0;var i=e.length;return r<0&&(r=Gr(i+r,0)),Cs(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&cr(e,t,r)>-1},bn.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:qs(r);return i<0&&(i=Gr(n+i,0)),cr(e,t,i)},bn.inRange=function(e,t,r){return t=Fs(t),r===o?(r=t,t=0):r=Fs(r),function(e,t,r){return e>=Yr(t,r)&&e=-N&&e<=N},bn.isSet=Ns,bn.isString=Cs,bn.isSymbol=Ls,bn.isTypedArray=js,bn.isUndefined=function(e){return e===o},bn.isWeakMap=function(e){return Ps(e)&&Ko(e)==ae},bn.isWeakSet=function(e){return Ps(e)&&ei(e)==se},bn.join=function(e,t){return null==e?"":Kr.call(e,t)},bn.kebabCase=vu,bn.last=Aa,bn.lastIndexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=n;return r!==o&&(i=(i=qs(r))<0?Gr(n+i,0):Yr(i,n-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,i):fr(e,dr,i,!0)},bn.lowerCase=yu,bn.lowerFirst=wu,bn.lt=zs,bn.lte=Ds,bn.max=function(e){return e&&e.length?Kn(e,Tu,ti):o},bn.maxBy=function(e,t){return e&&e.length?Kn(e,zo(t,2),ti):o},bn.mean=function(e){return lr(e,Tu)},bn.meanBy=function(e,t){return lr(e,zo(t,2))},bn.min=function(e){return e&&e.length?Kn(e,Tu,li):o},bn.minBy=function(e,t){return e&&e.length?Kn(e,zo(t,2),li):o},bn.stubArray=Hu,bn.stubFalse=Ku,bn.stubObject=function(){return{}},bn.stubString=function(){return""},bn.stubTrue=function(){return!0},bn.multiply=Zu,bn.nth=function(e,t){return e&&e.length?vi(e,qs(t)):o},bn.noConflict=function(){return Nt._===this&&(Nt._=bt),this},bn.noop=Lu,bn.now=es,bn.pad=function(e,t,r){e=Gs(e);var n=(t=qs(t))?Rr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return wo(Ur(i),r)+e+wo(Dr(i),r)},bn.padEnd=function(e,t,r){e=Gs(e);var n=(t=qs(t))?Rr(e):0;return t&&nt){var n=e;e=t,t=n}if(r||e%1||t%1){var i=Xr();return Yr(e+i*(t-e+Bt("1e-"+((i+"").length-1))),t)}return Mi(e,t)},bn.reduce=function(e,t,r){var n=vs(e)?ir:mr,i=arguments.length<3;return n(e,zo(t,4),r,i,Fn)},bn.reduceRight=function(e,t,r){var n=vs(e)?or:mr,i=arguments.length<3;return n(e,zo(t,4),r,i,qn)},bn.repeat=function(e,t,r){return t=(r?Zo(e,t,r):t===o)?1:qs(t),Ai(Gs(e),t)},bn.replace=function(){var e=arguments,t=Gs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},bn.result=function(e,t,r){var n=-1,i=(t=Wi(t,e)).length;for(i||(i=1,e=o);++nN)return[];var r=j,n=Yr(e,j);t=zo(t),e-=j;for(var i=vr(n,t);++r=a)return e;var u=r-Rr(n);if(u<1)return n;var f=s?Xi(s,0,u).join(""):e.slice(0,u);if(i===o)return f+n;if(s&&(u+=f.length-u),Rs(i)){if(e.slice(u).search(i)){var c,h=f;for(i.global||(i=rt(i.source,Gs(Ke.exec(i))+"g")),i.lastIndex=0;c=i.exec(h);)var d=c.index;f=f.slice(0,d===o?u:d)}}else if(e.indexOf(zi(i),u)!=u){var l=f.lastIndexOf(i);l>-1&&(f=f.slice(0,l))}return f+n},bn.unescape=function(e){return(e=Gs(e))&&Ae.test(e)?e.replace(Se,Cr):e},bn.uniqueId=function(e){var t=++ht;return Gs(e)+t},bn.upperCase=Mu,bn.upperFirst=Au,bn.each=Ga,bn.eachRight=Ya,bn.first=wa,Cu(bn,function(){var e={};return Zn(bn,function(t,r){ct.call(bn.prototype,r)||(e[r]=t)}),e}(),{chain:!1}),bn.VERSION="4.17.4",Xt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){bn[e].placeholder=bn}),Xt(["drop","take"],function(e,t){yn.prototype[e]=function(r){r=r===o?1:Gr(qs(r),0);var n=this.__filtered__&&!t?new yn(this):this.clone();return n.__filtered__?n.__takeCount__=Yr(r,n.__takeCount__):n.__views__.push({size:Yr(r,j),type:e+(n.__dir__<0?"Right":"")}),n},yn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),Xt(["filter","map","takeWhile"],function(e,t){var r=t+1,n=r==T||3==r;yn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:zo(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}}),Xt(["head","last"],function(e,t){var r="take"+(t?"Right":"");yn.prototype[e]=function(){return this[r](1).value()[0]}}),Xt(["initial","tail"],function(e,t){var r="drop"+(t?"":"Right");yn.prototype[e]=function(){return this.__filtered__?new yn(this):this[r](1)}}),yn.prototype.compact=function(){return this.filter(Tu)},yn.prototype.find=function(e){return this.filter(e).head()},yn.prototype.findLast=function(e){return this.reverse().find(e)},yn.prototype.invokeMap=xi(function(e,t){return"function"==typeof e?new yn(this):this.map(function(r){return oi(r,e,t)})}),yn.prototype.reject=function(e){return this.filter(fs(zo(e)))},yn.prototype.slice=function(e,t){e=qs(e);var r=this;return r.__filtered__&&(e>0||t<0)?new yn(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==o&&(r=(t=qs(t))<0?r.dropRight(-t):r.take(t-e)),r)},yn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},yn.prototype.toArray=function(){return this.take(j)},Zn(yn.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),i=bn[n?"take"+("last"==t?"Right":""):t],a=n||/^find/.test(t);i&&(bn.prototype[t]=function(){var t=this.__wrapped__,s=n?[1]:arguments,u=t instanceof yn,f=s[0],c=u||vs(t),h=function(e){var t=i.apply(bn,nr([e],s));return n&&d?t[0]:t};c&&r&&"function"==typeof f&&1!=f.length&&(u=c=!1);var d=this.__chain__,l=!!this.__actions__.length,p=a&&!d,b=u&&!l;if(!a&&c){t=b?t:new yn(this);var m=e.apply(t,s);return m.__actions__.push({func:Fa,args:[h],thisArg:o}),new vn(m,d)}return p&&b?e.apply(this,s):(m=this.thru(h),p?n?m.value()[0]:m.value():m)})}),Xt(["pop","push","shift","sort","splice","unshift"],function(e){var t=ot[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);bn.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(vs(i)?i:[],e)}return this[r](function(r){return t.apply(vs(r)?r:[],e)})}}),Zn(yn.prototype,function(e,t){var r=bn[t];if(r){var n=r.name+"";(an[n]||(an[n]=[])).push({name:t,func:r})}}),an[mo(o,v).name]=[{name:"wrapper",func:o}],yn.prototype.clone=function(){var e=new yn(this.__wrapped__);return e.__actions__=io(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=io(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=io(this.__views__),e},yn.prototype.reverse=function(){if(this.__filtered__){var e=new yn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},yn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=vs(e),n=t<0,i=r?e.length:0,o=function(e,t,r){for(var n=-1,i=r.length;++n=this.__values__.length;return{done:e,value:e?o:this.__values__[this.__index__++]}},bn.prototype.plant=function(e){for(var t,r=this;r instanceof gn;){var n=la(r);n.__index__=0,n.__values__=o,t?i.__wrapped__=n:t=n;var i=n;r=r.__wrapped__}return i.__wrapped__=e,t},bn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof yn){var t=e;return this.__actions__.length&&(t=new yn(this)),(t=t.reverse()).__actions__.push({func:Fa,args:[Ia],thisArg:o}),new vn(t,this.__chain__)}return this.thru(Ia)},bn.prototype.toJSON=bn.prototype.valueOf=bn.prototype.value=function(){return Hi(this.__wrapped__,this.__actions__)},bn.prototype.first=bn.prototype.head,zt&&(bn.prototype[zt]=function(){return this}),bn}();Nt._=Lr,(i=function(){return Lr}.call(t,r,t,n))===o||(n.exports=i)}).call(this)}).call(this,r(7),r(24)(e))},function(e,t,r){"use strict";var n=r(19),i=r(5);e.exports={checkState:function(e,t){if(!e)throw new n.InvalidState(t)},checkArgument:function(e,t,r,i){if(!e)throw new n.InvalidArgument(t,r,i)},checkArgumentType:function(e,t,o){if(o=o||"(unknown name)",i.isString(t)){if("Buffer"===t){if(!r(0).Buffer.isBuffer(e))throw new n.InvalidArgumentType(e,t,o)}else if(typeof e!==t)throw new n.InvalidArgumentType(e,t,o)}else if(!(e instanceof t))throw new n.InvalidArgumentType(e,t.name,o)}}},function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";(function(t){var n=r(0),i=r(48),o=r(9),a=r(6);function s(e,t){if(e.length!==t.length)return!1;for(var r=e.length,n=0;n>24&255),r.push(e>>16&255),r.push(e>>8&255),r.push(255&e),new t(r)},integerFromBuffer:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e[0]<<24|e[1]<<16|e[2]<<8|e[3]},integerFromSingleByteBuffer:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e[0]},bufferToHex:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e.toString("hex")},reverse:function(e){for(var t=new n.Buffer(e.length),r=0;r=0}}},function(e,t,r){e.exports=function(e){e.lib.Cipher||function(t){var r=e,n=r.lib,i=n.Base,o=n.WordArray,a=n.BufferedBlockAlgorithm,s=r.enc,u=(s.Utf8,s.Base64),f=r.algo,c=f.EvpKDF,h=n.Cipher=a.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){a.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){e&&this._append(e);var t=this._doFinalize();return t},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?M:w}return function(t){return{encrypt:function(r,n,i){return e(n).encrypt(t,r,n,i)},decrypt:function(r,n,i){return e(n).decrypt(t,r,n,i)}}}}()}),d=(n.StreamCipher=h.extend({_doFinalize:function(){var e=this._process(!0);return e},blockSize:1}),r.mode={}),l=n.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),p=d.CBC=function(){var e=l.extend();function r(e,r,n){var i=this._iv;if(i){var o=i;this._iv=t}else var o=this._prevBlock;for(var a=0;a>>2];e.sigBytes-=t}},g=(n.BlockCipher=h.extend({cfg:h.cfg.extend({mode:p,padding:m}),reset:function(){h.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=r.createEncryptor;else{var n=r.createDecryptor;this._minBufferSize=1}this._mode=n.call(r,this,t&&t.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{var t=this._process(!0);e.unpad(t)}return t},blockSize:4}),n.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),v=r.format={},y=v.OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var n=o.create([1398893684,1701076831]).concat(r).concat(t);else var n=t;return n.toString(u)},parse:function(e){var t=u.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var n=o.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return g.create({ciphertext:t,salt:n})}},w=n.SerializableCipher=i.extend({cfg:i.extend({format:y}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),o=i.finalize(t),a=i.cfg;return g.create({ciphertext:o,key:r,iv:a.iv,algorithm:e,mode:a.mode,padding:a.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=e.createDecryptor(r,n).finalize(t.ciphertext);return i},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),_=r.kdf={},S=_.OpenSSL={execute:function(e,t,r,n){n||(n=o.random(8));var i=c.create({keySize:t+r}).compute(e,n),a=o.create(i.words.slice(t),4*r);return i.sigBytes=4*t,g.create({key:i,iv:a,salt:n})}},M=n.PasswordBasedCipher=w.extend({cfg:w.cfg.extend({kdf:S}),encrypt:function(e,t,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,e.keySize,e.ivSize);n.iv=i.iv;var o=w.encrypt.call(this,e,t,i.key,n);return o.mixIn(i),o},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt);n.iv=i.iv;var o=w.decrypt.call(this,e,t,i.key,n);return o}})}()}(r(4))},function(e,t,r){"use strict";var n=t;n.version=r(284).version,n.utils=r(285),n.rand=r(70),n.curve=r(71),n.curves=r(290),n.ec=r(298),n.eddsa=r(301)},function(e,t,r){"use strict";(function(t){var n=r(3),i=r(6),o=r(5),a=function(e){for(var r=new t(e.length),n=0;ne.size?r=n.trim(r,o):o0&&0==(127&e[e.length-1])&&(e.length<=1||0==(128&e[e.length-2])))throw new Error("non-minimally encoded script number");return n.fromSM(e,{endian:"little"})},n.prototype.toScriptNumBuffer=function(){return this.toSM({endian:"little"})},n.prototype.gt=function(e){return this.cmp(e)>0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.lt=function(e){return this.cmp(e)<0},n.trim=function(e,t){return e.slice(t-e.length,e.length)},n.pad=function(e,r,n){for(var i=new t(n),o=0;oa)n=e(n);else if(n1)for(var r=1;r=0&&t<=M};function E(e){return function(t,r,n,i){r=v(r,i,4);var o=!x(t)&&g.keys(t),a=(o||t).length,s=e>0?0:a-1;return arguments.length<3&&(n=t[o?o[s]:s],s+=e),function(t,r,n,i,o,a){for(;o>=0&&o=0},g.invoke=function(e,t){var r=f.call(arguments,2),n=g.isFunction(t);return g.map(e,function(e){var i=n?t:e[t];return null==i?i:i.apply(e,r)})},g.pluck=function(e,t){return g.map(e,g.property(t))},g.where=function(e,t){return g.filter(e,g.matcher(t))},g.findWhere=function(e,t){return g.find(e,g.matcher(t))},g.max=function(e,t,r){var n,i,o=-1/0,a=-1/0;if(null==t&&null!=e)for(var s=0,u=(e=x(e)?e:g.values(e)).length;so&&(o=n);else t=y(t,r),g.each(e,function(e,r,n){((i=t(e,r,n))>a||i===-1/0&&o===-1/0)&&(o=e,a=i)});return o},g.min=function(e,t,r){var n,i,o=1/0,a=1/0;if(null==t&&null!=e)for(var s=0,u=(e=x(e)?e:g.values(e)).length;sn||void 0===r)return 1;if(r0?0:i-1;o>=0&&o0?a=o>=0?o:Math.max(o+s,a):s=o>=0?Math.min(o+1,s):o+s+1;else if(r&&o&&s)return n[o=r(n,i)]===i?o:-1;if(i!=i)return(o=t(f.call(n,a,s),g.isNaN))>=0?o+a:-1;for(o=e>0?a:s-1;o>=0&&ot?(a&&(clearTimeout(a),a=null),s=f,o=e.apply(n,i),a||(n=i=null)):a||!1===r.trailing||(a=setTimeout(u,c)),o}},g.debounce=function(e,t,r){var n,i,o,a,s,u=function(){var f=g.now()-a;f=0?n=setTimeout(u,t-f):(n=null,r||(s=e.apply(o,i),n||(o=i=null)))};return function(){o=this,i=arguments,a=g.now();var f=r&&!n;return n||(n=setTimeout(u,t)),f&&(s=e.apply(o,i),o=i=null),s}},g.wrap=function(e,t){return g.partial(t,e)},g.negate=function(e){return function(){return!e.apply(this,arguments)}},g.compose=function(){var e=arguments,t=e.length-1;return function(){for(var r=t,n=e[t].apply(this,arguments);r--;)n=e[r].call(this,n);return n}},g.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},g.before=function(e,t){var r;return function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=null),r}},g.once=g.partial(g.before,2);var O=!{toString:null}.propertyIsEnumerable("toString"),R=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];function N(e,t){var r=R.length,n=e.constructor,i=g.isFunction(n)&&n.prototype||a,o="constructor";for(g.has(e,o)&&!g.contains(t,o)&&t.push(o);r--;)(o=R[r])in e&&e[o]!==i[o]&&!g.contains(t,o)&&t.push(o)}g.keys=function(e){if(!g.isObject(e))return[];if(l)return l(e);var t=[];for(var r in e)g.has(e,r)&&t.push(r);return O&&N(e,t),t},g.allKeys=function(e){if(!g.isObject(e))return[];var t=[];for(var r in e)t.push(r);return O&&N(e,t),t},g.values=function(e){for(var t=g.keys(e),r=t.length,n=Array(r),i=0;i":">",'"':""","'":"'","`":"`"},j=g.invert(L),z=function(e){var t=function(t){return e[t]},r="(?:"+g.keys(e).join("|")+")",n=RegExp(r),i=RegExp(r,"g");return function(e){return e=null==e?"":""+e,n.test(e)?e.replace(i,t):e}};g.escape=z(L),g.unescape=z(j),g.result=function(e,t,r){var n=null==e?void 0:e[t];return void 0===n&&(n=r),g.isFunction(n)?n.call(e):n};var D=0;g.uniqueId=function(e){var t=++D+"";return e?e+t:t},g.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var U=/(.)^/,F={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},q=/\\|'|\r|\n|\u2028|\u2029/g,H=function(e){return"\\"+F[e]};g.template=function(e,t,r){!t&&r&&(t=r),t=g.defaults({},t,g.templateSettings);var n=RegExp([(t.escape||U).source,(t.interpolate||U).source,(t.evaluate||U).source].join("|")+"|$","g"),i=0,o="__p+='";e.replace(n,function(t,r,n,a,s){return o+=e.slice(i,s).replace(q,H),i=s+t.length,r?o+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":n?o+="'+\n((__t=("+n+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),t}),o+="';\n",t.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{var a=new Function(t.variable||"obj","_",o)}catch(e){throw e.source=o,e}var s=function(e){return a.call(this,e,g)},u=t.variable||"obj";return s.source="function("+u+"){\n"+o+"}",s},g.chain=function(e){var t=g(e);return t._chain=!0,t};var K=function(e,t){return e._chain?g(t).chain():t};g.mixin=function(e){g.each(g.functions(e),function(t){var r=g[t]=e[t];g.prototype[t]=function(){var e=[this._wrapped];return u.apply(e,arguments),K(this,r.apply(g,e))}})},g.mixin(g),g.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=o[e];g.prototype[e]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!==e&&"splice"!==e||0!==r.length||delete r[0],K(this,r)}}),g.each(["concat","join","slice"],function(e){var t=o[e];g.prototype[e]=function(){return K(this,t.apply(this._wrapped,arguments))}}),g.prototype.value=function(){return this._wrapped},g.prototype.valueOf=g.prototype.toJSON=g.prototype.value,g.prototype.toString=function(){return""+this._wrapped},void 0===(n=function(){return g}.apply(t,[]))||(e.exports=n)}).call(this)},function(e,t,r){"use strict";var n=r(5);var i=function(e,t){var r=function(){if(n.isString(t.message))this.message=function(e,t){return e.replace("{0}",t[0]).replace("{1}",t[1]).replace("{2}",t[2])}(t.message,arguments);else{if(!n.isFunction(t.message))throw new Error("Invalid error definition for "+t.name);this.message=t.message.apply(null,arguments)}this.stack=this.message+"\n"+(new Error).stack};return(r.prototype=Object.create(e.prototype)).name=e.prototype.name+t.name,e[t.name]=r,t.errors&&o(r,t.errors),r},o=function(e,t){n.each(t,function(t){i(e,t)})},a={Error:function(){this.message="Internal error",this.stack=this.message+"\n"+(new Error).stack}};a.Error.prototype=Object.create(Error.prototype),a.Error.prototype.name="bitcore.Error";var s=r(418);!function(e,t){o(e,t)}(a.Error,s),e.exports=a.Error,e.exports.extend=function(e){return i(a.Error,e)}},function(e,t,r){var n=r(18),i=r(192),o=r(111),a=r(196),s=r(197),u=function(e,t){var r=[];return t.forEach(function(t){if("object"==typeof t.components){if("tuple"!==t.type.substring(0,5))throw new Error("components found but type is not tuple; report on GitHub");var i="",o=t.type.indexOf("[");o>=0&&(i=t.type.substring(o));var a=u(e,t.components);n.isArray(a)&&e?r.push("tuple("+a.join(",")+")"+i):e?r.push("("+a+")"):r.push("("+a.join(",")+")"+i)}else r.push(t.type)}),r},f=function(e){if(!o.isHexStrict(e))throw new Error("The parameter must be a valid HEX string.");var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r7?r+=e[n].toUpperCase():r+=e[n];return r},toHex:o.toHex,toBN:o.toBN,bytesToHex:o.bytesToHex,hexToBytes:o.hexToBytes,hexToNumberString:o.hexToNumberString,hexToNumber:o.hexToNumber,toDecimal:o.hexToNumber,numberToHex:o.numberToHex,fromDecimal:o.numberToHex,hexToUtf8:o.hexToUtf8,hexToString:o.hexToUtf8,toUtf8:o.hexToUtf8,utf8ToHex:o.utf8ToHex,stringToHex:o.utf8ToHex,fromUtf8:o.utf8ToHex,hexToAscii:f,toAscii:f,asciiToHex:c,fromAscii:c,unitMap:i.unitMap,toWei:function(e,t){if(t=h(t),!o.isBN(e)&&!n.isString(e))throw new Error("Please pass numbers as strings or BigNumber objects to avoid precision errors.");return o.isBN(e)?i.toWei(e,t):i.toWei(e,t).toString(10)},fromWei:function(e,t){if(t=h(t),!o.isBN(e)&&!n.isString(e))throw new Error("Please pass numbers as strings or BigNumber objects to avoid precision errors.");return o.isBN(e)?i.fromWei(e,t):i.fromWei(e,t).toString(10)},padLeft:o.leftPad,leftPad:o.leftPad,padRight:o.rightPad,rightPad:o.rightPad,toTwosComplement:o.toTwosComplement}},function(e,t,r){var n=r(99),i=r(167),o=r(394),a=r(171),s=function(e){n.config(o.ETH_BIGNUMBER_ROUNDING_MODE);var t=i.padLeft(i.toTwosComplement(e).toString(16),64);return new a(t)},u=function(e){var t=e.staticPart()||"0";return function(e){return"1"===new n(e.substr(0,1),16).toString(2).substr(0,1)}(t)?new n(t,16).minus(new n("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16)).minus(1):new n(t,16)},f=function(e){var t=e.staticPart()||"0";return new n(t,16)};e.exports={formatInputInt:s,formatInputBytes:function(e){var t=i.toHex(e).substr(2),r=Math.floor((t.length+63)/64);return t=i.padRight(t,64*r),new a(t)},formatInputDynamicBytes:function(e){var t=i.toHex(e).substr(2),r=t.length/2,n=Math.floor((t.length+63)/64);return t=i.padRight(t,64*n),new a(s(r).value+t)},formatInputString:function(e){var t=i.fromUtf8(e).substr(2),r=t.length/2,n=Math.floor((t.length+63)/64);return t=i.padRight(t,64*n),new a(s(r).value+t)},formatInputBool:function(e){return new a("000000000000000000000000000000000000000000000000000000000000000"+(e?"1":"0"))},formatInputReal:function(e){return s(new n(e).times(new n(2).pow(128)))},formatOutputInt:u,formatOutputUInt:f,formatOutputReal:function(e){return u(e).dividedBy(new n(2).pow(128))},formatOutputUReal:function(e){return f(e).dividedBy(new n(2).pow(128))},formatOutputBool:function(e){return"0000000000000000000000000000000000000000000000000000000000000001"===e.staticPart()},formatOutputBytes:function(e,t){var r=t.match(/^bytes([0-9]*)/),n=parseInt(r[1]);return"0x"+e.staticPart().slice(0,2*n)},formatOutputDynamicBytes:function(e){var t=2*new n(e.dynamicPart().slice(0,64),16).toNumber();return"0x"+e.dynamicPart().substr(64,t)},formatOutputString:function(e){var t=2*new n(e.dynamicPart().slice(0,64),16).toNumber();return i.toUtf8(e.dynamicPart().substr(64,t))},formatOutputAddress:function(e){var t=e.staticPart();return"0x"+t.slice(t.length-40,t.length)}}},function(e,t,r){"use strict";(function(t){var n=r(12),i=r(5),o=r(6),a=r(8),s=r(9),u=function e(t,r){if(!(this instanceof e))return new e(t,r);if(t instanceof n)this.set({r:t,s:r});else if(t){var i=t;this.set(i)}};u.prototype.set=function(e){return this.r=e.r||this.r||void 0,this.s=e.s||this.s||void 0,this.i=void 0!==e.i?e.i:this.i,this.compressed=void 0!==e.compressed?e.compressed:this.compressed,this.nhashtype=e.nhashtype||this.nhashtype||void 0,this},u.fromCompact=function(e){o.checkArgument(a.isBuffer(e),"Argument is expected to be a Buffer");var t=new u,r=!0,i=e.slice(0,1)[0]-27-4;i<0&&(r=!1,i+=4);var s=e.slice(1,33),f=e.slice(33,65);return o.checkArgument(0===i||1===i||2===i||3===i,new Error("i must be 0, 1, 2, or 3")),o.checkArgument(32===s.length,new Error("r must be 32 bytes")),o.checkArgument(32===f.length,new Error("s must be 32 bytes")),t.compressed=r,t.i=i,t.r=n.fromBuffer(s),t.s=n.fromBuffer(f),t},u.fromDER=u.fromBuffer=function(e,t){var r=u.parseDER(e,t),n=new u;return n.r=r.r,n.s=r.s,n},u.fromTxFormat=function(e){var t=e.readUInt8(e.length-1),r=e.slice(0,e.length-1),n=new u.fromDER(r,!1);return n.nhashtype=t,n},u.fromString=function(e){var r=new t(e,"hex");return u.fromDER(r)},u.parseDER=function(e,t){o.checkArgument(a.isBuffer(e),new Error("DER formatted signature should be a buffer")),i.isUndefined(t)&&(t=!0);var r=e[0];o.checkArgument(48===r,new Error("Header byte should be 0x30"));var s=e[1],u=e.slice(2).length;o.checkArgument(!t||s===u,new Error("Length byte should length of what follows")),s=s73)return!1;if(48!==e[0])return!1;if(e[1]!==e.length-3)return!1;var t=e[3];if(5+t>=e.length)return!1;var r=e[5+t];if(t+r+7!==e.length)return!1;var n=e.slice(4);if(2!==e[2])return!1;if(0===t)return!1;if(128&n[0])return!1;if(t>1&&0===n[0]&&!(128&n[1]))return!1;var i=e.slice(6+t);return 2===e[6+t-2]&&(0!==r&&(!(128&i[0])&&!(r>1&&0===i[0]&&!(128&i[1]))))},u.prototype.hasLowS=function(){return!this.s.lt(new n(1))&&!this.s.gt(new n("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex"))},u.prototype.hasDefinedHashtype=function(){if(!s.isNaturalNumber(this.nhashtype))return!1;var e=this.nhashtype&~u.SIGHASH_ANYONECANPAY;return!(eu.SIGHASH_SINGLE)},u.prototype.toTxFormat=function(){var e=this.toDER(),r=new t(1);return r.writeUInt8(this.nhashtype,0),t.concat([e,r])},u.SIGHASH_ALL=1,u.SIGHASH_NONE=2,u.SIGHASH_SINGLE=3,u.SIGHASH_ANYONECANPAY=128,e.exports=u}).call(this,r(0).Buffer)},function(e,t,r){e.exports=r(177),e.exports.Interpreter=r(434)},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";var n=r(16),i=r(1);function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function a(e){return 1===e.length?"0"+e:e}function s(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n>8,a=255&i;o?r.push(o,a):r.push(a)}else for(n=0;n>>0}return a},t.split32=function(e,t){for(var r=new Array(4*e.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},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,a,s){var u=0,f=t;return u+=(f=f+n>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,a,s,u,f){var c=0,h=t;return c+=(h=h+n>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,i,o,a,s,u,f){return t+n+o+s+f>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},function(e,t,r){"use strict";var n=t;n.version=r(405).version,n.utils=r(406),n.rand=r(70),n.hmacDRBG=r(407),n.curve=r(75),n.curves=r(412),n.ec=r(414)},function(e,t,r){"use strict";(function(t){var n=r(12),i=r(52),o=r(13),a=r(9),s=r(42),u=r(5),f=r(6);function c(e,t){if(!(this instanceof c))return new c(e,t);if(f.checkArgument(e,"First argument is required, please include public key data."),e instanceof c)return e;t=t||{};var r=this._classifyArgs(e,t);return r.point.validate(),a.defineImmutable(this,{point:r.point,compressed:r.compressed,network:r.network||s.defaultNetwork}),this}c.prototype._classifyArgs=function(e,r){var n={compressed:u.isUndefined(r.compressed)||r.compressed};if(e instanceof i)n.point=e;else if(e.x&&e.y)n=c._transformObject(e);else if("string"==typeof e)n=c._transformDER(new t(e,"hex"));else if(c._isBuffer(e))n=c._transformDER(e);else{if(!c._isPrivateKey(e))throw new TypeError("First argument is an unrecognized data format.");n=c._transformPrivateKey(e)}return n.network||(n.network=u.isUndefined(r.network)?void 0:s.get(r.network)),n},c._isPrivateKey=function(e){return e instanceof r(78)},c._isBuffer=function(e){return e instanceof t||e instanceof Uint8Array},c._transformPrivateKey=function(e){f.checkArgument(c._isPrivateKey(e),"Must be an instance of PrivateKey");var t={};return t.point=i.getG().mul(e.bn),t.compressed=e.compressed,t.network=e.network,t},c._transformDER=function(e,t){f.checkArgument(c._isBuffer(e),"Must be a hex buffer of DER encoded public key");var r,o,a,s,h={};if(t=!!u.isUndefined(t)||t,4!==e[0]&&(t||6!==e[0]&&7!==e[0]))if(3===e[0])a=e.slice(1),r=new n(a),(h=c._transformX(!0,r)).compressed=!0;else{if(2!==e[0])throw new TypeError("Invalid DER format public key");a=e.slice(1),r=new n(a),(h=c._transformX(!1,r)).compressed=!0}else{if(a=e.slice(1,33),s=e.slice(33,65),32!==a.length||32!==s.length||65!==e.length)throw new TypeError("Length of x and y must be 32 bytes");r=new n(a),o=new n(s),h.point=new i(r,o),h.compressed=!1}return h},c._transformX=function(e,t){f.checkArgument("boolean"==typeof e,"Must specify whether y is odd or not (true or false)");var r={};return r.point=i.fromX(e,t),r},c._transformObject=function(e){var t=new n(e.x,"hex"),r=new n(e.y,"hex");return new c(new i(t,r),{compressed:e.compressed})},c.fromPrivateKey=function(e){f.checkArgument(c._isPrivateKey(e),"Must be an instance of PrivateKey");var t=c._transformPrivateKey(e);return new c(t.point,{compressed:t.compressed,network:t.network})},c.fromDER=c.fromBuffer=function(e,t){f.checkArgument(c._isBuffer(e),"Must be a hex buffer of DER encoded public key");var r=c._transformDER(e,t);return new c(r.point,{compressed:r.compressed})},c.fromPoint=function(e,t){return f.checkArgument(e instanceof i,"First argument must be an instance of Point."),new c(e,{compressed:t})},c.fromString=function(e,r){var n=new t(e,r||"hex"),i=c._transformDER(n);return new c(i.point,{compressed:i.compressed})},c.fromX=function(e,t){var r=c._transformX(e,t);return new c(r.point,{compressed:r.compressed})},c.getValidationError=function(e){var t;try{new c(e)}catch(e){t=e}return t},c.isValid=function(e){return!c.getValidationError(e)},c.prototype.toObject=c.prototype.toJSON=function(){return{x:this.point.getX().toString("hex",2),y:this.point.getY().toString("hex",2),compressed:this.compressed}},c.prototype.toBuffer=c.prototype.toDER=function(){var e,r=this.point.getX(),n=this.point.getY(),i=r.toBuffer({size:32}),o=n.toBuffer({size:32});if(this.compressed){var a=o[o.length-1]%2;return e=new t(a?[3]:[2]),t.concat([e,i])}return e=new t([4]),t.concat([e,i,o])},c.prototype._getID=function(){return o.sha256ripemd160(this.toBuffer())},c.prototype.toAddress=function(e){return r(43).fromPublicKey(this,e||this.network)},c.prototype.toString=function(){return this.toDER().toString("hex")},c.prototype.inspect=function(){return""},e.exports=c}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(t){var n=r(8),i=r(48),o=function e(t){if(!(this instanceof e))return new e(t);t?this.set(t):this.bufs=[]};o.prototype.set=function(e){return this.bufs=e.bufs||this.bufs||[],this},o.prototype.toBuffer=function(){return this.concat()},o.prototype.concat=function(){return t.concat(this.bufs)},o.prototype.write=function(e){return i(n.isBuffer(e)),this.bufs.push(e),this},o.prototype.writeReverse=function(e){return i(n.isBuffer(e)),this.bufs.push(n.reverse(e)),this},o.prototype.writeUInt8=function(e){var r=new t(1);return r.writeUInt8(e,0),this.write(r),this},o.prototype.writeUInt16BE=function(e){var r=new t(2);return r.writeUInt16BE(e,0),this.write(r),this},o.prototype.writeUInt16LE=function(e){var r=new t(2);return r.writeUInt16LE(e,0),this.write(r),this},o.prototype.writeUInt32BE=function(e){var r=new t(4);return r.writeUInt32BE(e,0),this.write(r),this},o.prototype.writeInt32LE=function(e){var r=new t(4);return r.writeInt32LE(e,0),this.write(r),this},o.prototype.writeUInt32LE=function(e){var r=new t(4);return r.writeUInt32LE(e,0),this.write(r),this},o.prototype.writeUInt64BEBN=function(e){var t=e.toBuffer({size:8});return this.write(t),this},o.prototype.writeUInt64LEBN=function(e){var t=e.toBuffer({size:8});return this.writeReverse(t),this},o.prototype.writeVarintNum=function(e){var t=o.varintBufNum(e);return this.write(t),this},o.prototype.writeVarintBN=function(e){var t=o.varintBufBN(e);return this.write(t),this},o.varintBufNum=function(e){var r=void 0;return e<253?(r=new t(1)).writeUInt8(e,0):e<65536?((r=new t(3)).writeUInt8(253,0),r.writeUInt16LE(e,1)):e<4294967296?((r=new t(5)).writeUInt8(254,0),r.writeUInt32LE(e,1)):((r=new t(9)).writeUInt8(255,0),r.writeInt32LE(-1&e,1),r.writeUInt32LE(Math.floor(e/4294967296),5)),r},o.varintBufBN=function(e){var r=void 0,n=e.toNumber();if(n<253)(r=new t(1)).writeUInt8(n,0);else if(n<65536)(r=new t(3)).writeUInt8(253,0),r.writeUInt16LE(n,1);else if(n<4294967296)(r=new t(5)).writeUInt8(254,0),r.writeUInt32LE(n,1);else{var i=new o;i.writeUInt8(255),i.writeUInt64LEBN(e);r=i.concat()}return r},e.exports=o}).call(this,r(0).Buffer)},function(e,t,r){var n=r(21),i=r(171),o=function(e){this._inputFormatter=e.inputFormatter,this._outputFormatter=e.outputFormatter};o.prototype.isType=function(e){throw"this method should be overrwritten for type "+e},o.prototype.staticPartLength=function(e){return(this.nestedTypes(e)||["[1]"]).map(function(e){return parseInt(e.slice(1,-1),10)||1}).reduce(function(e,t){return e*t},32)},o.prototype.isDynamicArray=function(e){var t=this.nestedTypes(e);return!!t&&!t[t.length-1].match(/[0-9]{1,}/g)},o.prototype.isStaticArray=function(e){var t=this.nestedTypes(e);return!!t&&!!t[t.length-1].match(/[0-9]{1,}/g)},o.prototype.staticArrayLength=function(e){var t=this.nestedTypes(e);return t?parseInt(t[t.length-1].match(/[0-9]{1,}/g)||1):1},o.prototype.nestedName=function(e){var t=this.nestedTypes(e);return t?e.substr(0,e.length-t[t.length-1].length):e},o.prototype.isDynamicType=function(){return!1},o.prototype.nestedTypes=function(e){return e.match(/(\[[0-9]*\])/g)},o.prototype.encode=function(e,t){var r=this;return this.isDynamicArray(t)?function(){var i=e.length,o=r.nestedName(t),a=[];return a.push(n.formatInputInt(i).encode()),e.forEach(function(e){a.push(r.encode(e,o))}),a}():this.isStaticArray(t)?function(){for(var n=r.staticArrayLength(t),i=r.nestedName(t),o=[],a=0;a=this.buf.length},s.prototype.finished=s.prototype.eof,s.prototype.read=function(e){i.checkArgument(!n.isUndefined(e),"Must specify a length");var t=this.buf.slice(this.pos,this.pos+e);return this.pos=this.pos+e,t},s.prototype.readAll=function(){var e=this.buf.slice(this.pos,this.buf.length);return this.pos=this.buf.length,e},s.prototype.readUInt8=function(){var e=this.buf.readUInt8(this.pos);return this.pos=this.pos+1,e},s.prototype.readUInt16BE=function(){var e=this.buf.readUInt16BE(this.pos);return this.pos=this.pos+2,e},s.prototype.readUInt16LE=function(){var e=this.buf.readUInt16LE(this.pos);return this.pos=this.pos+2,e},s.prototype.readUInt32BE=function(){var e=this.buf.readUInt32BE(this.pos);return this.pos=this.pos+4,e},s.prototype.readUInt32LE=function(){var e=this.buf.readUInt32LE(this.pos);return this.pos=this.pos+4,e},s.prototype.readInt32LE=function(){var e=this.buf.readInt32LE(this.pos);return this.pos=this.pos+4,e},s.prototype.readUInt64BEBN=function(){var e=this.buf.slice(this.pos,this.pos+8),t=a.fromBuffer(e);return this.pos=this.pos+8,t},s.prototype.readUInt64LEBN=function(){var e,t=this.buf.readUInt32LE(this.pos),r=4294967296*this.buf.readUInt32LE(this.pos+4)+t;if(r<=9007199254740991)e=new a(r);else{var n=Array.prototype.slice.call(this.buf,this.pos,this.pos+8);e=new a(n,10,"le")}return this.pos=this.pos+8,e},s.prototype.readVarintNum=function(){var e=this.readUInt8();switch(e){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:var t=this.readUInt64LEBN().toNumber();if(t<=Math.pow(2,53))return t;throw new Error("number too large to retain precision - use readVarintBN");default:return e}},s.prototype.readVarLengthBuffer=function(){var e=this.readVarintNum(),t=this.read(e);return i.checkState(t.length===e,"Invalid length while reading varlength buffer. Expected to read: "+e+" and read "+t.length),t},s.prototype.readVarintBuf=function(){switch(this.buf.readUInt8(this.pos)){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}},s.prototype.readVarintBN=function(){var e=this.readUInt8();switch(e){case 253:return new a(this.readUInt16LE());case 254:return new a(this.readUInt32LE());case 255:return this.readUInt64LEBN();default:return new a(e)}},s.prototype.reverse=function(){for(var e=new t(this.buf.length),r=0;r=g.outputs.length)return new t("0000000000000000000000000000000000000000000000000000000000000001","hex");for(g.outputs.length=d+1,p=0;p9007199254740991?"transaction txout satoshis greater than max safe integer":this._satoshis!==this._satoshisBN.toNumber()?"transaction txout satoshis has corrupted value":this._satoshis<0&&"transaction txout negative"},d.prototype.toObject=d.prototype.toJSON=function(){var e={satoshis:this.satoshis};return e.script=this._scriptBuffer.toString("hex"),e},d.fromObject=function(e){return new d(e)},d.prototype.setScriptFromBuffer=function(e){this._scriptBuffer=e;try{this._script=f.fromBuffer(this._scriptBuffer),this._script._isOutput=!0}catch(e){if(!(e instanceof h.Script.InvalidBuffer))throw e;this._script=null}},d.prototype.setScript=function(e){if(e instanceof f)this._scriptBuffer=e.toBuffer(),this._script=e,this._script._isOutput=!0;else if(n.isString(e))this._script=f.fromString(e),this._scriptBuffer=this._script.toBuffer(),this._script._isOutput=!0;else{if(!a.isBuffer(e))throw new TypeError("Invalid argument type: script");this.setScriptFromBuffer(e)}return this},d.prototype.inspect=function(){var e;return e=this.script?this.script.inspect():this._scriptBuffer.toString("hex"),""},d.fromBufferReader=function(e){var t={};t.satoshis=e.readUInt64LEBN();var r=e.readVarintNum();return t.script=0!==r?e.read(r):new o.Buffer([]),new d(t)},d.prototype.toBufferWriter=function(e){e||(e=new u),e.writeUInt64LEBN(this._satoshisBN);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e},e.exports=d},function(e,t,r){"use strict";var n=r(189),i=r(231);e.exports={packageInit:function(e,t){if(t=Array.prototype.slice.call(t),!e)throw new Error('You need to instantiate using the "new" keyword.');Object.defineProperty(e,"currentProvider",{get:function(){return e._provider},set:function(t){return e.setProvider(t)},enumerable:!0,configurable:!0}),t[0]&&t[0]._requestManager?e._requestManager=new n.Manager(t[0].currentProvider):(e._requestManager=new n.Manager,e._requestManager.setProvider(t[0],t[1])),e.givenProvider=n.Manager.givenProvider,e.providers=n.Manager.providers,e._provider=e._requestManager.provider,e.setProvider||(e.setProvider=function(t,r){return e._requestManager.setProvider(t,r),e._provider=e._requestManager.provider,!0}),e.BatchRequest=n.BatchManager.bind(null,e._requestManager),e.extend=i(e)},addProviders:function(e){e.givenProvider=n.Manager.givenProvider,e.providers=n.Manager.providers}}},function(e,t,r){"use strict";var n=r(64),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=h;var o=r(54);o.inherits=r(1);var a=r(118),s=r(85);o.inherits(h,a);for(var u=i(s.prototype),f=0;f1?(e[r[0]]=e[r[0]]||{},e[r[0]][r[1]]=t):e[r[0]]=t},f.prototype.getCall=function(e){return n.isFunction(this.call)?this.call(e):this.call},f.prototype.extractCallback=function(e){if(n.isFunction(e[e.length-1]))return e.pop()},f.prototype.validateArgs=function(e){if(e.length!==this.params)throw i.InvalidNumberOfParams(e.length,this.params,this.name)},f.prototype.formatInput=function(e){var t=this;return this.inputFormatter?this.inputFormatter.map(function(r,n){return r?r.call(t,e[n]):e[n]}):e},f.prototype.formatOutput=function(e){var t=this;return n.isArray(e)?e.map(function(e){return t.outputFormatter&&e?t.outputFormatter(e):e}):this.outputFormatter&&e?this.outputFormatter(e):e},f.prototype.toPayload=function(e){var t=this.getCall(e),r=this.extractCallback(e),n=this.formatInput(e);this.validateArgs(n);var i={method:t,params:n,callback:r};return this.transformPayload&&(i=this.transformPayload(i)),i},f.prototype._confirmTransaction=function(e,t,r){var i=this,c=!1,h=!0,d=0,l=0,p=null,b="",m=n.isObject(r.params[0])&&r.params[0].gas?r.params[0].gas:null,g=n.isObject(r.params[0])&&r.params[0].data&&r.params[0].from&&!r.params[0].to,v=[new f({name:"getTransactionReceipt",call:"eth_getTransactionReceipt",params:1,inputFormatter:[null],outputFormatter:o.outputTransactionReceiptFormatter}),new f({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[o.inputAddressFormatter,o.inputDefaultBlockNumberFormatter]}),new u({name:"subscribe",type:"eth",subscriptions:{newBlockHeaders:{subscriptionName:"newHeads",params:0,outputFormatter:o.outputBlockFormatter}}})],y={};n.each(v,function(e){e.attachToObject(y),e.requestManager=i.requestManager});var w=function(r,n,o,u,f){if(!o)return f||(f={unsubscribe:function(){clearInterval(p)}}),(r?s.resolve(r):y.getTransactionReceipt(t)).catch(function(t){f.unsubscribe(),c=!0,a._fireError({message:"Failed to check for transaction receipt:",data:t},e.eventEmitter,e.reject)}).then(function(t){if(!t||!t.blockHash)throw new Error("Receipt missing or blockHash null");return i.extraFormatters&&i.extraFormatters.receiptFormatter&&(t=i.extraFormatters.receiptFormatter(t)),e.eventEmitter.listeners("confirmation").length>0&&(void 0!==r&&0===l||e.eventEmitter.emit("confirmation",l,t),h=!1,25===++l&&(f.unsubscribe(),e.eventEmitter.removeAllListeners())),t}).then(function(t){if(g&&!c){if(!t.contractAddress)return h&&(f.unsubscribe(),c=!0),void a._fireError(new Error("The transaction receipt didn't contain a contract address."),e.eventEmitter,e.reject);y.getCode(t.contractAddress,function(r,n){n&&(n.length>2?(e.eventEmitter.emit("receipt",t),i.extraFormatters&&i.extraFormatters.contractDeployFormatter?e.resolve(i.extraFormatters.contractDeployFormatter(t)):e.resolve(t),h&&e.eventEmitter.removeAllListeners()):a._fireError(new Error("The contract code couldn't be stored, please check your gas limit."),e.eventEmitter,e.reject),h&&f.unsubscribe(),c=!0)})}return t}).then(function(t){g||c||(t.outOfGas||m&&m===t.gasUsed||!0!==t.status&&"0x1"!==t.status&&void 0!==t.status?(b=JSON.stringify(t,null,2),!1===t.status||"0x0"===t.status?a._fireError(new Error("Transaction has been reverted by the EVM:\n"+b),e.eventEmitter,e.reject):a._fireError(new Error("Transaction ran out of gas. Please provide more gas:\n"+b),e.eventEmitter,e.reject)):(e.eventEmitter.emit("receipt",t),e.resolve(t),h&&e.eventEmitter.removeAllListeners()),h&&f.unsubscribe(),c=!0)}).catch(function(){d++,n?d-1>=750&&(f.unsubscribe(),c=!0,a._fireError(new Error("Transaction was not mined within750 seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!"),e.eventEmitter,e.reject)):d-1>=50&&(f.unsubscribe(),c=!0,a._fireError(new Error("Transaction was not mined within 50 blocks, please make sure your transaction was properly sent. Be aware that it might still be mined!"),e.eventEmitter,e.reject))});f.unsubscribe(),c=!0,a._fireError({message:"Failed to subscribe to new newBlockHeaders to confirm the transaction receipts.",data:o},e.eventEmitter,e.reject)},_=function(e){n.isFunction(this.requestManager.provider.on)?y.subscribe("newBlockHeaders",w.bind(null,e,!1)):p=setInterval(w.bind(null,e,!0),1e3)}.bind(this);y.getTransactionReceipt(t).then(function(t){t&&t.blockHash?(e.eventEmitter.listeners("confirmation").length>0&&_(t),w(t,!1)):c||_()}).catch(function(){c||_()})};var c=function(e,t){return n.isNumber(e)?t.wallet[e]:n.isObject(e)&&e.address&&e.privateKey?e:t.wallet[e.toLowerCase()]};f.prototype.buildCall=function(){var e=this,t="eth_sendTransaction"===e.call||"eth_sendRawTransaction"===e.call,r=function(){var r=s(!t),i=e.toPayload(Array.prototype.slice.call(arguments)),o=function(n,o){try{o=e.formatOutput(o)}catch(e){n=e}if(o instanceof Error&&(n=o),n)return n.error&&(n=n.error),a._fireError(n,r.eventEmitter,r.reject,i.callback);i.callback&&i.callback(null,o),t?(r.eventEmitter.emit("transactionHash",o),e._confirmTransaction(r,o,i)):n||r.resolve(o)},u=function(t){var r=n.extend({},i,{method:"eth_sendRawTransaction",params:[t.rawTransaction]});e.requestManager.send(r,o)},h=function(e,t){var i;if(t&&t.accounts&&t.accounts.wallet&&t.accounts.wallet.length)if("eth_sendTransaction"===e.method){var a=e.params[0];if((i=c(n.isObject(a)?a.from:null,t.accounts))&&i.privateKey)return t.accounts.signTransaction(n.omit(a,"from"),i.privateKey).then(u)}else if("eth_sign"===e.method){var s=e.params[1];if((i=c(e.params[0],t.accounts))&&i.privateKey){var f=t.accounts.sign(s,i.privateKey);return e.callback&&e.callback(null,f.signature),void r.resolve(f.signature)}}return t.requestManager.send(e,o)};t&&n.isObject(i.params[0])&&void 0===i.params[0].gasPrice?new f({name:"getGasPrice",call:"eth_gasPrice",params:0}).createFunction(e.requestManager)(function(t,r){r&&(i.params[0].gasPrice=r),h(i,e)}):h(i,e);return r.eventEmitter};return r.method=e,r.request=this.request.bind(this),r},f.prototype.request=function(){var e=this.toPayload(Array.prototype.slice.call(arguments));return e.format=this.formatOutput.bind(this),e},e.exports=f},function(e,t,r){"use strict";t.randomBytes=t.rng=t.pseudoRandomBytes=t.prng=r(46),t.createHash=t.Hash=r(39),t.createHmac=t.Hmac=r(135);var n=r(259),i=Object.keys(n),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);t.getHashes=function(){return o};var a=r(92);t.pbkdf2=a.pbkdf2,t.pbkdf2Sync=a.pbkdf2Sync;var s=r(261);t.Cipher=s.Cipher,t.createCipher=s.createCipher,t.Cipheriv=s.Cipheriv,t.createCipheriv=s.createCipheriv,t.Decipher=s.Decipher,t.createDecipher=s.createDecipher,t.Decipheriv=s.Decipheriv,t.createDecipheriv=s.createDecipheriv,t.getCiphers=s.getCiphers,t.listCiphers=s.listCiphers;var u=r(278);t.DiffieHellmanGroup=u.DiffieHellmanGroup,t.createDiffieHellmanGroup=u.createDiffieHellmanGroup,t.getDiffieHellman=u.getDiffieHellman,t.createDiffieHellman=u.createDiffieHellman,t.DiffieHellman=u.DiffieHellman;var f=r(282);t.createSign=f.createSign,t.Sign=f.Sign,t.createVerify=f.createVerify,t.Verify=f.Verify,t.createECDH=r(319);var c=r(320);t.publicEncrypt=c.publicEncrypt,t.privateEncrypt=c.privateEncrypt,t.publicDecrypt=c.publicDecrypt,t.privateDecrypt=c.privateDecrypt;var h=r(323);t.randomFill=h.randomFill,t.randomFillSync=h.randomFillSync,t.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},t.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(e,t,r){"use strict";var n=r(1),i=r(89),o=r(90),a=r(91),s=r(30);function u(e){s.call(this,"digest"),this._hash=e}n(u,s),u.prototype._update=function(e){this._hash.update(e)},u.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new i:"rmd160"===e||"ripemd160"===e?new o:new u(a(e))}},function(e,t,r){var n=t;n.utils=r(25),n.common=r(57),n.sha=r(291),n.ripemd=r(295),n.hmac=r(296),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(e,t,r){(function(e){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(null!==e&&"object"==typeof e&&Array.isArray(e.words))return e;this.sign=!1,this.words=null,this.length=0,this.red=null,"le"!==t&&"be"!==t||(r=t,t=10),null!==e&&this._init(e||0,t||10,r||"be")}function o(e,t,r){for(var n=0,i=Math.min(e.length,r),o=t;o=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function a(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26,i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.sign=!0),this.strip(),"le"===n&&this._initArray(this.toArray(),t,n)},i.prototype._initNumber=function(e,t,n){e<0&&(this.sign=!0,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},i.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3){var s=e[i]|e[i-1]<<8|e[i-2]<<16;this.words[a]|=s<>>26-o&67108863,(o+=24)>=26&&(o-=26,a++)}}else if("le"===n)for(i=0,a=0;i>>26-o&67108863,(o+=24)>=26&&(o-=26,a++)}return this.strip()},i.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6){var a=o(e,r,r+6);this.words[i]|=a<>>26-n&4194303,(n+=24)>=26&&(n-=26,i++)}if(r+6!==t){a=o(e,t,r+6);this.words[i]|=a<>>26-n&4194303}this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,u=Math.min(o,o-s)+r,f=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.sign=!1),this},i.prototype.inspect=function(){return(this.red?""};var s=["","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"],u=[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],f=[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];i.prototype.toString=function(e,t){if(16===(e=e||10)||"hex"===e){for(var n="",i=0,o=(t=0|t||1,0),a=0;a>>24-i&16777215)||a!==this.length-1?s[6-h.length]+h+n:h+n,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(n=o.toString(16)+n);n.length%t!=0;)n="0"+n;return this.sign&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var d=u[e],l=f[e],p=(n="",this.clone());for(p.sign=!1;0!==p.cmpn(0);){var b=p.modn(l).toString(e);n=0!==(p=p.idivn(l)).cmpn(0)?s[d-b.length]+b+n:b+n}return 0===this.cmpn(0)&&(n="0"+n),this.sign&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toArray=function(e){this.strip();var t=new Array(this.byteLength());t[0]=0;var r=this.clone();if("le"!==e)for(var n=0;0!==r.cmpn(0);n++){var i=r.andln(255);r.ishrn(8),t[t.length-n-1]=i}else for(n=0;0!==r.cmpn(0);n++){i=r.andln(255);r.ishrn(8),t[n]=i}return t},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(0===this.cmpn(0))return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.iand=function(e){var t;this.sign=this.sign&&e.sign,t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.ixor=function(e){var t,r;this.sign=this.sign||e.sign,this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);for(var n=e/26|0,i=e%26;this.length<=n;)this.words[this.length++]=0;return this.words[n]=t?this.words[n]|1<e.length?(r=this,n=e):(r=e,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(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(e.sign){e.sign=!1;var t=this.iadd(e);return e.sign=!0,t._normSign()}if(this.sign)return this.sign=!1,this.iadd(e),this.sign=!0,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.sign=!1,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t}for(;0!==o&&a>26,this.words[a]=67108863&t}if(0===o&&a>>26,o=67108863&r,a=Math.min(n,e.length-1),s=Math.max(0,n-this.length+1);s<=a;s++){var u=n-s,f=(0|this.words[u])*(0|e.words[s]),c=67108863&f;o=67108863&(c=c+o|0),i=(i=i+(f/67108864|0)|0)+(c>>>26)|0}t.words[n]=o,r=i}return 0!==r?t.words[n]=r:t.length--,t.strip()},i.prototype._bigMulTo=function(e,t){t.sign=e.sign!==this.sign,t.length=this.length+e.length;for(var r=0,n=0,i=0;i>>26)|0)>>>26,o&=67108863}t.words[i]=a,r=o,o=n}return 0!==r?t.words[i]=r:t.length--,t.strip()},i.prototype.mulTo=function(e,t){return this.length+e.length<63?this._smallMulTo(e,t):this._bigMulTo(e,t)},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.imul=function(e){if(0===this.cmpn(0)||0===e.cmpn(0))return this.words[0]=0,this.length=1,this;var t=this.length,r=e.length;this.sign=e.sign!==this.sign,this.length=this.length+e.length,this.words[this.length-1]=0;for(var n=this.length-2;n>=0;n--){for(var i=0,o=0,a=Math.min(n,r-1),s=Math.max(0,n-t+1);s<=a;s++){var u=n-s,f=this.words[u]*e.words[s],c=67108863&f;i+=f/67108864|0,o=67108863&(c+=o),i+=c>>>26}this.words[n]=o,this.words[n+1]+=i,i=0}for(i=0,u=1;u>>26}return this.strip()},i.prototype.imuln=function(e){r("number"==typeof e);for(var t=0,n=0;n>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.mul(this)},i.prototype.ishln=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=67108863>>>26-t<<26-t;if(0!==t){for(var o=0,a=0;a>>26-t}o&&(this.words[a]=o,this.length++)}if(0!==n){for(a=this.length-1;a>=0;a--)this.words[a+n]=this.words[a];for(a=0;a=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a){this.length-=a;for(f=0;f=0&&(0!==c||f>=i);f--){var h=this.words[f];this.words[f]=c<<26-o|h>>>o,c=h&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip(),this},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(!this.sign,"imaskn works only with positive numbers"),0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),e<0)return this.iaddn(-e);if(this.sign)return this.sign=!1,this.iaddn(e),this.sign=!0,this;this.words[0]-=e;for(var t=0;t>26)-(f/67108864|0),this.words[a+n]=67108863&u}for(;a>26,this.words[a+n]=67108863&u}if(0===s)return this.strip();r(-1===s),s=0;for(a=0;a>26,this.words[a]=67108863&u}return this.sign=!0,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=o.words[o.length-1];0!==(r=26-this._countBits(a))&&(o=o.shln(r),n.ishln(r),a=o.words[o.length-1]);var s,u=n.length-o.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var f=0;f=0;h--){var d=67108864*n.words[o.length+h]+n.words[o.length+h-1];for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(o,d,h);n.sign;)d--,n.sign=!1,n._ishlnsubmul(o,1,h),0!==n.cmpn(0)&&(n.sign=!n.sign);s&&(s.words[h]=d)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.ishrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t){if(r(0!==e.cmpn(0)),this.sign&&!e.sign){var n,o=this.neg().divmod(e,t);return"mod"!==t&&(a=o.div.neg()),"div"!==t&&(n=0===o.mod.cmpn(0)?o.mod:e.sub(o.mod)),{div:a,mod:n}}if(!this.sign&&e.sign){var a;o=this.divmod(e.neg(),t);return"mod"!==t&&(a=o.div.neg()),{div:a,mod:o.mod}}return this.sign&&e.sign?this.neg().divmod(e.neg(),t):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t)},i.prototype.div=function(e){return this.divmod(e,"div").div},i.prototype.mod=function(e){return this.divmod(e,"mod").mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(0===t.mod.cmpn(0))return t.div;var r=t.div.sign?t.mod.isub(e):t.mod,n=e.shrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:t.div.sign?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+this.words[i])%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=this.words[n]+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(!e.sign),r(0!==e.cmpn(0));var t=this,n=e.clone();t=t.sign?t.mod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),f=0;t.isEven()&&n.isEven();)t.ishrn(1),n.ishrn(1),++f;for(var c=n.clone(),h=t.clone();0!==t.cmpn(0);){for(;t.isEven();)t.ishrn(1),o.isEven()&&a.isEven()?(o.ishrn(1),a.ishrn(1)):(o.iadd(c).ishrn(1),a.isub(h).ishrn(1));for(;n.isEven();)n.ishrn(1),s.isEven()&&u.isEven()?(s.ishrn(1),u.ishrn(1)):(s.iadd(c).ishrn(1),u.isub(h).ishrn(1));t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(u)):(n.isub(t),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:n.ishln(f)}},i.prototype._invmp=function(e){r(!e.sign),r(0!==e.cmpn(0));var t=this,n=e.clone();t=t.sign?t.mod(e):t.clone();for(var o=new i(1),a=new i(0),s=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(;t.isEven();)t.ishrn(1),o.isEven()?o.ishrn(1):o.iadd(s).ishrn(1);for(;n.isEven();)n.ishrn(1),a.isEven()?a.ishrn(1):a.iadd(s).ishrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(a)):(n.isub(t),a.isub(o))}return 0===t.cmpn(1)?o:a},i.prototype.gcd=function(e){if(0===this.cmpn(0))return e.clone();if(0===e.cmpn(0))return this.clone();var t=this.clone(),r=e.clone();t.sign=!1,r.sign=!1;for(var n=0;t.isEven()&&r.isEven();n++)t.ishrn(1),r.ishrn(1);for(;;){for(;t.isEven();)t.ishrn(1);for(;r.isEven();)r.ishrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.ishln(n)},i.prototype.invm=function(e){return this.egcd(e).a.mod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},i.prototype.cmpn=function(e){var t,r=e<0;if(r&&(e=-e),this.sign&&!r)return-1;if(!this.sign&&r)return 1;if(e&=67108863,this.strip(),this.length>1)t=1;else{var n=this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var n=this.words[r],i=e.words[r];if(n!==i){ni&&(t=1);break}}return t},i.red=function(e){return new m(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(!this.sign,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var c={k256:null,p224:null,p192:null,p25519:null};function h(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).ishln(this.n).isub(this.p),this.tmp=this._tmp()}function d(){h.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function l(){h.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function p(){h.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function b(){h.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function m(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else this.m=e,this.prime=null}function g(e){m.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).ishln(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.sign=!0,this.minv=this.minv.mod(this.r)}h.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},h.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):r.strip(),r},h.prototype.split=function(e,t){e.ishrn(this.n,0,t)},h.prototype.imulK=function(e){return e.imul(this.k)},n(d,h),d.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=o}e.words[n-10]=i>>>22,e.length-=9},d.prototype.imulK=function(e){var t;e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var r=0,n=0;n>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(c[e])return c[e];var t;if("k256"===e)t=new d;else if("p224"===e)t=new l;else if("p192"===e)t=new p;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new b}return c[e]=t,t},m.prototype._verify1=function(e){r(!e.sign,"red works only with positives"),r(e.red,"red works only with red numbers")},m.prototype._verify2=function(e,t){r(!e.sign&&!t.sign,"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},m.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.mod(this.m)._forceRed(this)},m.prototype.neg=function(e){var t=e.clone();return t.sign=!t.sign,t.iadd(this.m)._forceRed(this)},m.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},m.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},m.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},m.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},m.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.shln(t))},m.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},m.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},m.prototype.isqr=function(e){return this.imul(e,e)},m.prototype.sqr=function(e){return this.mul(e,e)},m.prototype.sqrt=function(e){if(0===e.cmpn(0))return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).ishrn(2);return d=this.pow(e,n)}for(var o=this.m.subn(1),a=0;0!==o.cmpn(0)&&0===o.andln(1);)a++,o.ishrn(1);r(0!==o.cmpn(0));var s=new i(1).toRed(this),u=s.redNeg(),f=this.m.subn(1).ishrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);0!==this.pow(c,f).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,o),d=this.pow(e,o.addn(1).ishrn(1)),l=this.pow(e,o),p=a;0!==l.cmp(s);){for(var b=l,m=0;0!==b.cmp(s);m++)b=b.redSqr();r(m=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},g.prototype.mul=function(e,t){if(0===e.cmpn(0)||0===t.cmpn(0))return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).ishrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},g.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(24)(e))},function(e,t,r){"use strict";var n=r(5),i=r(8),o=r(9),a=[],s={};function u(){}function f(e,t){if(~a.indexOf(e))return e;if(!t)return s[e];n.isArray(t)||(t=[t]);var r=function(t){return a[i][t]===e};for(var i in a)if(n.some(t,r))return a[i]}function c(e){var t=new u;return o.defineImmutable(t,{name:e.name,alias:e.alias,pubkeyhash:e.pubkeyhash,privatekey:e.privatekey,scripthash:e.scripthash,xpubkey:e.xpubkey,xprivkey:e.xprivkey}),e.networkMagic&&o.defineImmutable(t,{networkMagic:i.integerAsBuffer(e.networkMagic)}),e.port&&o.defineImmutable(t,{port:e.port}),e.dnsSeeds&&o.defineImmutable(t,{dnsSeeds:e.dnsSeeds}),n.each(t,function(e){n.isUndefined(e)||n.isObject(e)||(s[e]=t)}),a.push(t),t}u.prototype.toString=function(){return this.name},c({name:"livenet",alias:"mainnet",pubkeyhash:0,privatekey:128,scripthash:5,xpubkey:76067358,xprivkey:76066276,networkMagic:4190024921,port:8333,dnsSeeds:["seed.bitcoin.sipa.be","dnsseed.bluematt.me","dnsseed.bitcoin.dashjr.org","seed.bitcoinstats.com","seed.bitnodes.io","bitseed.xf2.org"]});var h=f("livenet");c({name:"testnet",alias:"regtest",pubkeyhash:111,privatekey:239,scripthash:196,xpubkey:70617039,xprivkey:70615956});var d=f("testnet"),l={PORT:18333,NETWORK_MAGIC:i.integerAsBuffer(185665799),DNS_SEEDS:["testnet-seed.bitcoin.petertodd.org","testnet-seed.bluematt.me","testnet-seed.alexykot.me","testnet-seed.bitcoin.schildbach.de"]};for(var p in l)n.isObject(l[p])||(s[l[p]]=d);var b={PORT:18444,NETWORK_MAGIC:i.integerAsBuffer(4206867930),DNS_SEEDS:[]};for(var p in b)n.isObject(b[p])||(s[b[p]]=d);Object.defineProperty(d,"port",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?b.PORT:l.PORT}}),Object.defineProperty(d,"networkMagic",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?b.NETWORK_MAGIC:l.NETWORK_MAGIC}}),Object.defineProperty(d,"dnsSeeds",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?b.DNS_SEEDS:l.DNS_SEEDS}}),e.exports={add:c,remove:function(e){for(var t=0;t"},e.exports=h;var d=r(23)}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=r(207),i=r(208);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=y,t.resolve=function(e,t){return y(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?y(e,!1,!0).resolveObject(t):t},t.format=function(e){i.isString(e)&&(e=y(e));return e instanceof o?e.format():o.prototype.format.call(e)},t.Url=o;var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,f=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(f),h=["%","/","?",";","#"].concat(c),d=["/","?","#"],l=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,b={javascript:!0,"javascript:":!0},m={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},v=r(209);function y(e,t,r){if(e&&i.isObject(e)&&e instanceof o)return e;var n=new o;return n.parse(e,t,r),n}o.prototype.parse=function(e,t,r){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),s=-1!==o&&o127?R+="x":R+=O[N];if(!R.match(l)){var L=B.slice(0,k),j=B.slice(k+1),z=O.match(p);z&&(L.push(z[1]),j.unshift(z[2])),j.length&&(y="/"+j.join(".")+y),this.hostname=L.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),P||(this.hostname=n.toASCII(this.hostname));var D=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+D,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==y[0]&&(y="/"+y))}if(!b[S])for(k=0,T=c.length;k0)&&r.host.split("@"))&&(r.auth=P.shift(),r.host=r.hostname=P.shift());return r.search=e.search,r.query=e.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(!M.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var x=M.slice(-1)[0],E=(r.host||e.host||M.length>1)&&("."===x||".."===x)||""===x,k=0,I=M.length;I>=0;I--)"."===(x=M[I])?M.splice(I,1):".."===x?(M.splice(I,1),k++):k&&(M.splice(I,1),k--);if(!_&&!S)for(;k--;k)M.unshift("..");!_||""===M[0]||M[0]&&"/"===M[0].charAt(0)||M.unshift(""),E&&"/"!==M.join("/").substr(-1)&&M.push("");var P,B=""===M[0]||M[0]&&"/"===M[0].charAt(0);A&&(r.hostname=r.host=B?"":M.length?M.shift():"",(P=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=P.shift(),r.host=r.hostname=P.shift()));return(_=_||r.host&&M.length)&&!B&&M.unshift(""),M.length?r.pathname=M.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=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(67);function i(e){return!!e._bn}function o(e){return e.slice?e:(e.slice=function(){var t=Array.prototype.slice.call(arguments);return new Uint8Array(Array.prototype.slice.apply(e,t))},e)}function a(e){if(!e||parseInt(String(e.length))!=e.length||"string"==typeof e)return!1;for(var t=0;t=256||parseInt(String(r))!=r)return!1}return!0}function s(e){if(null==e&&n.throwError("cannot convert null value to array",n.INVALID_ARGUMENT,{arg:"value",value:e}),i(e)&&(e=e.toHexString()),"string"==typeof e){var t=e.match(/^(0x)?[0-9a-fA-F]*$/);t||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:e}),"0x"!==t[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:e}),(e=e.substring(2)).length%2&&(e="0"+e);for(var r=[],s=0;s>4]+c[15&u])}return"0x"+o.join("")}return n.throwError("invalid hexlify value",null,{arg:"value",value:e}),"never"}function d(e,t){for(f(e)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:e});e.length<2*t+2;)e="0x0"+e.substring(2);return e}function l(e){var t=0,r="0x",i="0x";if(function(e){return e&&null!=e.r&&null!=e.s}(e)){null==e.v&&null==e.recoveryParam&&n.throwError("at least on of recoveryParam or v must be specified",n.INVALID_ARGUMENT,{argument:"signature",value:e}),r=d(e.r,32),i=d(e.s,32),"string"==typeof(t=e.v)&&(t=parseInt(t,16));var o=e.recoveryParam;null==o&&null!=e.v&&(o=1-t%2),t=27+o}else{var a=s(e);if(65!==a.length)throw new Error("invalid signature");r=h(a.slice(0,32)),i=h(a.slice(32,64)),27!==(t=a[64])&&28!==t&&(t=27+t%2)}return{r:r,s:i,recoveryParam:t-27,v:t}}t.hexlify=h,t.hexDataLength=function(e){return f(e)&&e.length%2==0?(e.length-2)/2:null},t.hexDataSlice=function(e,t,r){return f(e)||n.throwError("invalid hex data",n.INVALID_ARGUMENT,{arg:"value",value:e}),e.length%2!=0&&n.throwError("hex data length must be even",n.INVALID_ARGUMENT,{arg:"value",value:e}),t=2+2*t,null!=r?"0x"+e.substring(t,t+2*r):"0x"+e.substring(t)},t.hexStripZeros=function(e){for(f(e)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:e});e.length>3&&"0x0"===e.substring(0,3);)e="0x"+e.substring(3);return e},t.hexZeroPad=d,t.splitSignature=l,t.joinSignature=function(e){return h(u([(e=l(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},function(e,t,r){"use strict";(function(t,n){var i=r(2).Buffer,o=t.crypto||t.msCrypto;o&&o.getRandomValues?e.exports=function(e,r){if(e>65536)throw new Error("requested too many random bytes");var a=new t.Uint8Array(e);e>0&&o.getRandomValues(a);var s=i.from(a.buffer);if("function"==typeof r)return n.nextTick(function(){r(null,s)});return s}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,r(7),r(15))},function(e,t,r){var n=r(2).Buffer;function i(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=n.from(e,t));for(var r=this._block,i=this._blockSize,o=e.length,a=this._len,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 e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},function(e,t,r){"use strict";(function(t){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ function n(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i=0;f--)if(c[f]!==h[f])return!1;for(f=c.length-1;f>=0;f--)if(u=c[f],!v(e[u],t[u],r,n))return!1;return!0}(e,t,r,a))}return r?e===t:e==t}function y(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function w(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function _(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(e){var t;try{e()}catch(e){t=e}return t}(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&m(i,r,"Missing expected exception"+n);var a="string"==typeof n,s=!e&&o.isError(i),u=!e&&i&&!r;if((s&&a&&w(i,r)||u)&&m(i,r,"Got unwanted exception"+n),e&&i&&r&&!w(i,r)||!e&&i)throw i}h.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return p(b(e.actual),128)+" "+e.operator+" "+p(b(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||m;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,i=l(t),o=n.indexOf("\n"+i);if(o>=0){var a=n.indexOf("\n",o+1);n=n.substring(a+1)}this.stack=n}}},o.inherits(h.AssertionError,Error),h.fail=m,h.ok=g,h.equal=function(e,t,r){e!=t&&m(e,t,r,"==",h.equal)},h.notEqual=function(e,t,r){e==t&&m(e,t,r,"!=",h.notEqual)},h.deepEqual=function(e,t,r){v(e,t,!1)||m(e,t,r,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(e,t,r){v(e,t,!0)||m(e,t,r,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(e,t,r){v(e,t,!1)&&m(e,t,r,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function e(t,r,n){v(t,r,!0)&&m(t,r,n,"notDeepStrictEqual",e)},h.strictEqual=function(e,t,r){e!==t&&m(e,t,r,"===",h.strictEqual)},h.notStrictEqual=function(e,t,r){e===t&&m(e,t,r,"!==",h.notStrictEqual)},h.throws=function(e,t,r){_(!0,e,t,r)},h.doesNotThrow=function(e,t,r){_(!1,e,t,r)},h.ifError=function(e){if(e)throw e};var S=Object.keys||function(e){var t=[];for(var r in e)a.call(e,r)&&t.push(r);return t}}).call(this,r(7))},function(e,t,r){e.exports=function(e){return function(){var t=e,r=t.lib.WordArray;t.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],o=0;o>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s>>6*(3-s)&63));var u=n.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(e){var t=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o>>6-a%4*2;i[o>>>2]|=(s|u)<<24-o%4*8,o++}return r.create(i,o)}(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.enc.Base64}(r(4))},function(e,t,r){e.exports=function(e){return function(t){var r=e,n=r.lib,i=n.WordArray,o=n.Hasher,a=r.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*t.abs(t.sin(e+1))|0}();var u=a.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,a=e[t+0],u=e[t+1],l=e[t+2],p=e[t+3],b=e[t+4],m=e[t+5],g=e[t+6],v=e[t+7],y=e[t+8],w=e[t+9],_=e[t+10],S=e[t+11],M=e[t+12],A=e[t+13],x=e[t+14],E=e[t+15],k=o[0],I=o[1],P=o[2],B=o[3];I=d(I=d(I=d(I=d(I=h(I=h(I=h(I=h(I=c(I=c(I=c(I=c(I=f(I=f(I=f(I=f(I,P=f(P,B=f(B,k=f(k,I,P,B,a,7,s[0]),I,P,u,12,s[1]),k,I,l,17,s[2]),B,k,p,22,s[3]),P=f(P,B=f(B,k=f(k,I,P,B,b,7,s[4]),I,P,m,12,s[5]),k,I,g,17,s[6]),B,k,v,22,s[7]),P=f(P,B=f(B,k=f(k,I,P,B,y,7,s[8]),I,P,w,12,s[9]),k,I,_,17,s[10]),B,k,S,22,s[11]),P=f(P,B=f(B,k=f(k,I,P,B,M,7,s[12]),I,P,A,12,s[13]),k,I,x,17,s[14]),B,k,E,22,s[15]),P=c(P,B=c(B,k=c(k,I,P,B,u,5,s[16]),I,P,g,9,s[17]),k,I,S,14,s[18]),B,k,a,20,s[19]),P=c(P,B=c(B,k=c(k,I,P,B,m,5,s[20]),I,P,_,9,s[21]),k,I,E,14,s[22]),B,k,b,20,s[23]),P=c(P,B=c(B,k=c(k,I,P,B,w,5,s[24]),I,P,x,9,s[25]),k,I,p,14,s[26]),B,k,y,20,s[27]),P=c(P,B=c(B,k=c(k,I,P,B,A,5,s[28]),I,P,l,9,s[29]),k,I,v,14,s[30]),B,k,M,20,s[31]),P=h(P,B=h(B,k=h(k,I,P,B,m,4,s[32]),I,P,y,11,s[33]),k,I,S,16,s[34]),B,k,x,23,s[35]),P=h(P,B=h(B,k=h(k,I,P,B,u,4,s[36]),I,P,b,11,s[37]),k,I,v,16,s[38]),B,k,_,23,s[39]),P=h(P,B=h(B,k=h(k,I,P,B,A,4,s[40]),I,P,a,11,s[41]),k,I,p,16,s[42]),B,k,g,23,s[43]),P=h(P,B=h(B,k=h(k,I,P,B,w,4,s[44]),I,P,M,11,s[45]),k,I,E,16,s[46]),B,k,l,23,s[47]),P=d(P,B=d(B,k=d(k,I,P,B,a,6,s[48]),I,P,v,10,s[49]),k,I,x,15,s[50]),B,k,m,21,s[51]),P=d(P,B=d(B,k=d(k,I,P,B,M,6,s[52]),I,P,p,10,s[53]),k,I,_,15,s[54]),B,k,u,21,s[55]),P=d(P,B=d(B,k=d(k,I,P,B,y,6,s[56]),I,P,E,10,s[57]),k,I,g,15,s[58]),B,k,A,21,s[59]),P=d(P,B=d(B,k=d(k,I,P,B,b,6,s[60]),I,P,S,10,s[61]),k,I,l,15,s[62]),B,k,w,21,s[63]),o[0]=o[0]+k|0,o[1]=o[1]+I|0,o[2]=o[2]+P|0,o[3]=o[3]+B|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;r[i>>>5]|=128<<24-i%32;var o=t.floor(n/4294967296),a=n;r[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,u=s.words,f=0;f<4;f++){var c=u[f];u[f]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}return s},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function f(e,t,r,n,i,o,a){var s=e+(t&r|~t&n)+i+a;return(s<>>32-o)+t}function c(e,t,r,n,i,o,a){var s=e+(t&n|r&~n)+i+a;return(s<>>32-o)+t}function h(e,t,r,n,i,o,a){var s=e+(t^r^n)+i+a;return(s<>>32-o)+t}function d(e,t,r,n,i,o,a){var s=e+(r^(t|~n))+i+a;return(s<>>32-o)+t}r.MD5=o._createHelper(u),r.HmacMD5=o._createHmacHelper(u)}(Math),e.MD5}(r(4))},function(e,t,r){e.exports=function(e){return function(){var t=e,r=t.lib,n=r.Base,i=r.WordArray,o=t.algo,a=o.MD5,s=o.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=r.hasher.create(),o=i.create(),a=o.words,s=r.keySize,u=r.iterations;a.length=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o0){var r=this.raw.slice();this.v=this._chainId,this.r=0,this.s=0,t=this.raw,this.raw=r}else t=this.raw.slice(0,6);return n.rlphash(t)},e.prototype.getChainId=function(){return this._chainId},e.prototype.getSenderAddress=function(){if(this._from)return this._from;var e=this.getSenderPublicKey();return this._from=n.publicToAddress(e),this._from},e.prototype.getSenderPublicKey=function(){if(!(this._senderPubKey&&this._senderPubKey.length||this.verifySignature()))throw new Error("Invalid Signature");return this._senderPubKey},e.prototype.verifySignature=function(){var e=this.hash(!1);if(this._homestead&&1===new o(this.s).cmp(a))return!1;try{var t=n.bufferToInt(this.v);this._chainId>0&&(t-=2*this._chainId+8),this._senderPubKey=n.ecrecover(e,t,this.r,this.s)}catch(e){return!1}return!!this._senderPubKey},e.prototype.sign=function(e){var t=this.hash(!1),r=n.ecsign(t,e);this._chainId>0&&(r.v+=2*this._chainId+8),Object.assign(this,r)},e.prototype.getDataFee=function(){for(var e=this.raw[5],t=new o(0),r=0;r0&&t.push(["gas limit is too low. Need at least "+this.getBaseFee()]),void 0===e||!1===e?0===t.length:t.join(" ")},e}();e.exports=s}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(t){var n=r(5),i=r(79),o=r(0),a=r(13).sha256sha256,s=function e(r){if(!(this instanceof e))return new e(r);if(t.isBuffer(r)){var n=r;this.fromBuffer(n)}else if("string"==typeof r){var i=r;this.fromString(i)}else r&&this.set(r)};s.prototype.set=function(e){return this.buf=e.buf||this.buf||void 0,this},s.validChecksum=function(e,t){return n.isString(e)&&(e=new o.Buffer(i.decode(e))),n.isString(t)&&(t=new o.Buffer(i.decode(t))),t||(t=e.slice(-4),e=e.slice(0,-4)),s.checksum(e).toString("hex")===t.toString("hex")},s.decode=function(e){if("string"!=typeof e)throw new Error("Input must be a string");var r=new t(i.decode(e));if(r.length<4)throw new Error("Input string too short");var n=r.slice(0,-4),o=r.slice(-4),s=a(n).slice(0,4);if(o.toString("hex")!==s.toString("hex"))throw new Error("Checksum mismatch");return n},s.checksum=function(e){return a(e).slice(0,4)},s.encode=function(e){if(!t.isBuffer(e))throw new Error("Input must be a buffer");var r=new t(e.length+4),n=s.checksum(e);return e.copy(r),n.copy(r,e.length),i.encode(r)},s.prototype.fromBuffer=function(e){return this.buf=e,this},s.prototype.fromString=function(e){var t=s.decode(e);return this.buf=t,this},s.prototype.toBuffer=function(){return this.buf},s.prototype.toString=function(){return s.encode(this.buf)},e.exports=s}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=r(5),i=r(6),o=r(19),a=r(28),s=r(0),u=r(8),f=r(9),c=r(23),h=r(33),d=r(34);function l(e){return this instanceof l?e?this._fromObject(e):void 0:new l(e)}l.MAXINT=4294967295,l.DEFAULT_SEQNUMBER=4294967295,l.DEFAULT_LOCKTIME_SEQNUMBER=4294967294,l.DEFAULT_RBF_SEQNUMBER=4294967293,Object.defineProperty(l.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this.isNull()?null:(this._script||(this._script=new c(this._scriptBuffer),this._script._isInput=!0),this._script)}}),l.fromObject=function(e){return i.checkArgument(n.isObject(e)),(new l)._fromObject(e)},l.prototype._fromObject=function(e){var t;if(t=n.isString(e.prevTxId)&&f.isHexa(e.prevTxId)?new s.Buffer(e.prevTxId,"hex"):e.prevTxId,this.output=e.output?e.output instanceof d?e.output:new d(e.output):void 0,this.prevTxId=t||e.txidbuf,this.outputIndex=n.isUndefined(e.outputIndex)?e.txoutnum:e.outputIndex,this.sequenceNumber=n.isUndefined(e.sequenceNumber)?n.isUndefined(e.seqnum)?4294967295:e.seqnum:e.sequenceNumber,n.isUndefined(e.script)&&n.isUndefined(e.scriptBuffer))throw new o.Transaction.Input.MissingScript;return this.setScript(e.scriptBuffer||e.script),this},l.prototype.toObject=l.prototype.toJSON=function(){var e={prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,sequenceNumber:this.sequenceNumber,script:this._scriptBuffer.toString("hex")};return this.script&&(e.scriptString=this.script.toString()),this.output&&(e.output=this.output.toObject()),e},l.fromBufferReader=function(e){var t=new l;return t.prevTxId=e.readReverse(32),t.outputIndex=e.readUInt32LE(),t._scriptBuffer=e.readVarLengthBuffer(),t.sequenceNumber=e.readUInt32LE(),t},l.prototype.toBufferWriter=function(e){e||(e=new a),e.writeReverse(this.prevTxId),e.writeUInt32LE(this.outputIndex);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e.writeUInt32LE(this.sequenceNumber),e},l.prototype.setScript=function(e){if(this._script=null,e instanceof c)this._script=e,this._script._isInput=!0,this._scriptBuffer=e.toBuffer();else if(f.isHexa(e))this._scriptBuffer=new s.Buffer(e,"hex");else if(n.isString(e))this._script=new c(e),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else{if(!u.isBuffer(e))throw new TypeError("Invalid argument type: script");this._scriptBuffer=new s.Buffer(e)}return this},l.prototype.getSignatures=function(){throw new o.AbstractMethodInvoked("Trying to sign unsupported output type (only P2PKH and P2SH multisig inputs are supported) for input: "+JSON.stringify(this))},l.prototype.isFullySigned=function(){throw new o.AbstractMethodInvoked("Input#isFullySigned")},l.prototype.isFinal=function(){return 4294967295!==this.sequenceNumber},l.prototype.addSignature=function(){throw new o.AbstractMethodInvoked("Input#addSignature")},l.prototype.clearSignatures=function(){throw new o.AbstractMethodInvoked("Input#clearSignatures")},l.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,h.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)},l.prototype.isNull=function(){return"0000000000000000000000000000000000000000000000000000000000000000"===this.prevTxId.toString("hex")&&4294967295===this.outputIndex},l.prototype._estimateSize=function(){return this.toBufferWriter().toBuffer().length},e.exports=l},function(e,t,r){"use strict";(function(t){var n=r(5),i=r(6),o=r(31),a=r(8),s=r(9),u=r(27),f=r(19),c=r(22);function h(e){if(!(this instanceof h))return new h(e);if(e instanceof h)return e;if(n.isObject(e))return this._fromObject(e);throw new f.InvalidArgument("TransactionSignatures must be instantiated from an object")}o(h,c),h.prototype._fromObject=function(e){return this._checkObjectArgs(e),this.publicKey=new u(e.publicKey),this.prevTxId=a.isBuffer(e.prevTxId)?e.prevTxId:new t(e.prevTxId,"hex"),this.outputIndex=e.outputIndex,this.inputIndex=e.inputIndex,this.signature=e.signature instanceof c?e.signature:a.isBuffer(e.signature)?c.fromBuffer(e.signature):c.fromString(e.signature),this.sigtype=e.sigtype,this},h.prototype._checkObjectArgs=function(e){i.checkArgument(u(e.publicKey),"publicKey"),i.checkArgument(!n.isUndefined(e.inputIndex),"inputIndex"),i.checkArgument(!n.isUndefined(e.outputIndex),"outputIndex"),i.checkState(n.isNumber(e.inputIndex),"inputIndex must be a number"),i.checkState(n.isNumber(e.outputIndex),"outputIndex must be a number"),i.checkArgument(e.signature,"signature"),i.checkArgument(e.prevTxId,"prevTxId"),i.checkState(e.signature instanceof c||a.isBuffer(e.signature)||s.isHexa(e.signature),"signature must be a buffer or hexa value"),i.checkState(a.isBuffer(e.prevTxId)||s.isHexa(e.prevTxId),"prevTxId must be a buffer or hexa value"),i.checkArgument(e.sigtype,"sigtype"),i.checkState(n.isNumber(e.sigtype),"sigtype must be a number")},h.prototype.toObject=h.prototype.toJSON=function(){return{publicKey:this.publicKey.toString(),prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,inputIndex:this.inputIndex,signature:this.signature.toString(),sigtype:this.sigtype}},h.fromObject=function(e){return i.checkArgument(e),new h(e)},e.exports=h}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(t){!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,r)});case 3:return t.nextTick(function(){e.call(null,r,n)});case 4:return t.nextTick(function(){e.call(null,r,n,i)});default:for(o=new Array(s-1),a=0;a1?(e[r[0]]=e[r[0]]||{},e[r[0]][r[1]]=t):e[r[0]]=t},i.prototype.buildCall=function(){var e=this;return function(){e.subscriptions[arguments[0]]||console.warn("Subscription "+JSON.stringify(arguments[0])+" doesn't exist. Subscribing anyway.");var t=new n({subscription:e.subscriptions[arguments[0]],requestManager:e.requestManager,type:e.type});return t.subscribe.apply(t,arguments)}},e.exports={subscriptions:i,subscription:n}},function(e,t,r){"use strict";var n=r(35),i=r(37),o=r(20),a=function(){var e=this;n.packageInit(this,arguments),[new i({name:"getId",call:"net_version",params:0,outputFormatter:o.hexToNumber}),new i({name:"isListening",call:"net_listening",params:0}),new i({name:"getPeerCount",call:"net_peerCount",params:0,outputFormatter:o.hexToNumber})].forEach(function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)})};n.addProviders(a),e.exports=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.MISSING_NEW="MISSING_NEW",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.NUMERIC_FAULT="NUMERIC_FAULT",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,i=!1;function o(e,r,n){if(i)throw new Error("unknown error");r||(r=t.UNKNOWN_ERROR),n||(n={});var o=[];Object.keys(n).forEach(function(e){try{o.push(e+"="+JSON.stringify(n[e]))}catch(t){o.push(e+"="+JSON.stringify(n[e].toString()))}});var a=e;o.length&&(e+=" ("+o.join(", ")+")");var s=new Error(e);throw s.reason=a,s.code=r,Object.keys(n).forEach(function(e){s[e]=n[e]}),s}t.throwError=o,t.checkNew=function(e,r){e instanceof r||o("missing new",t.MISSING_NEW,{name:r.name})},t.checkArgumentCount=function(e,r,n){n||(n=""),er&&o("too many arguments"+n,t.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})},t.setCensorship=function(e,r){n&&o("error censorship permanent",t.UNSUPPORTED_OPERATION,{operation:"setCersorship"}),i=!!e,n=!!r}},function(e,t,r){var n=r(2).Buffer;function i(e){n.isBuffer(e)||(e=n.from(e));for(var t=e.length/4|0,r=new Array(t),i=0;i>>24]^c[p>>>16&255]^h[b>>>8&255]^d[255&m]^t[g++],a=f[p>>>24]^c[b>>>16&255]^h[m>>>8&255]^d[255&l]^t[g++],s=f[b>>>24]^c[m>>>16&255]^h[l>>>8&255]^d[255&p]^t[g++],u=f[m>>>24]^c[l>>>16&255]^h[p>>>8&255]^d[255&b]^t[g++],l=o,p=a,b=s,m=u;return o=(n[l>>>24]<<24|n[p>>>16&255]<<16|n[b>>>8&255]<<8|n[255&m])^t[g++],a=(n[p>>>24]<<24|n[b>>>16&255]<<16|n[m>>>8&255]<<8|n[255&l])^t[g++],s=(n[b>>>24]<<24|n[m>>>16&255]<<16|n[l>>>8&255]<<8|n[255&p])^t[g++],u=(n[m>>>24]<<24|n[l>>>16&255]<<16|n[p>>>8&255]<<8|n[255&b])^t[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 e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,u=0;u<256;++u){var f=s^s<<1^s<<2^s<<3^s<<4;f=f>>>8^255&f^99,r[a]=f,n[f]=a;var c=e[a],h=e[c],d=e[h],l=257*e[f]^16843008*f;i[0][a]=l<<24|l>>>8,i[1][a]=l<<16|l>>>16,i[2][a]=l<<8|l>>>24,i[3][a]=l,l=16843009*d^65537*h^257*c^16843008*a,o[0][f]=l<<24|l>>>8,o[1][f]=l<<16|l>>>16,o[2][f]=l<<8|l>>>24,o[3][f]=l,0===a?a=s=1:(a=c^e[e[e[d^c]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function f(e){this._key=i(e),this._reset()}f.blockSize=16,f.keySize=32,f.prototype.blockSize=f.blockSize,f.prototype.keySize=f.keySize,f.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+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/t|0]<<24):t>6&&o%t==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-t]^a}for(var f=[],c=0;c>>24]]^u.INV_SUB_MIX[1][u.SBOX[d>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[d>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&d]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=f},f.prototype.encryptBlockRaw=function(e){return a(e=i(e),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},f.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},f.prototype.decryptBlock=function(e){var t=(e=i(e))[1];e[1]=e[3],e[3]=t;var r=a(e,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},f.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},e.exports.AES=f},function(e,t,r){var n=r(2).Buffer,i=r(89);e.exports=function(e,t,r,o){if(n.isBuffer(e)||(e=n.from(e,"binary")),t&&(n.isBuffer(t)||(t=n.from(t,"binary")),8!==t.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),f=n.alloc(0);a>0||o>0;){var c=new i;c.update(f),c.update(e),t&&c.update(t),f=c.digest();var h=0;if(a>0){var d=s.length-a;h=Math.min(a,f.length),f.copy(s,d,0,h),a-=h}if(h0){var l=u.length-o,p=Math.min(o,f.length-h);f.copy(u,l,h,h+p),o-=p}}return f.fill(0),{key:s,iv:u}}},function(e,t,r){var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r"},e.exports=l}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(t){var n=r(5),i=r(176),o=r(0),a="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".split(""),s=function e(r){if(!(this instanceof e))return new e(r);if(t.isBuffer(r)){var n=r;this.fromBuffer(n)}else if("string"==typeof r){var i=r;this.fromString(i)}else r&&this.set(r)};s.validCharacters=function(e){return o.Buffer.isBuffer(e)&&(e=e.toString()),n.every(n.map(e,function(e){return n.includes(a,e)}))},s.prototype.set=function(e){return this.buf=e.buf||this.buf||void 0,this},s.encode=function(e){if(!o.Buffer.isBuffer(e))throw new Error("Input should be a buffer");return i.encode(e)},s.decode=function(e){if("string"!=typeof e)throw new Error("Input should be a string");return new t(i.decode(e))},s.prototype.fromBuffer=function(e){return this.buf=e,this},s.prototype.fromString=function(e){var t=s.decode(e);return this.buf=t,this},s.prototype.toBuffer=function(){return this.buf},s.prototype.toString=function(){return s.encode(this.buf)},e.exports=s}).call(this,r(0).Buffer)},function(e,t,r){e.exports=r(104),e.exports.Input=r(105),e.exports.Output=r(34),e.exports.UnspentOutput=r(178),e.exports.Signature=r(63),e.exports.Sighash=r(33)},function(e,t,r){"use strict";(function(t,n){function i(){}i.getRandomBuffer=function(e){return t.browser?i.getRandomBufferBrowser(e):i.getRandomBufferNode(e)},i.getRandomBufferNode=function(e){return r(38).randomBytes(e)},i.getRandomBufferBrowser=function(e){if(!window.crypto&&!window.msCrypto)throw new Error("window.crypto not available");if(window.crypto&&window.crypto.getRandomValues)var t=window.crypto;else{if(!window.msCrypto||!window.msCrypto.getRandomValues)throw new Error("window.crypto.getRandomValues not available");t=window.msCrypto}var r=new Uint8Array(e);return t.getRandomValues(r),new n(r)},i.getPseudoRandomBuffer=function(e){for(var t,r=new n(e),i=0;i<=e;i++){0===i-4*Math.floor(i/4)?(t=4294967296*Math.random(),r[i]=255&t):r[i]=255&(t>>>=8)}return r},e.exports=i}).call(this,r(15),r(0).Buffer)},function(e,t,r){"use strict";(function(t){var n=r(5),i=r(12),o=r(8),a=r(32),s=r(28),u=r(13),f=(r(9),r(6)),c=function e(t){if(!(this instanceof e))return new e(t);var r=e._from(t);return this.version=r.version,this.prevHash=r.prevHash,this.merkleRoot=r.merkleRoot,this.time=r.time,this.timestamp=r.time,this.bits=r.bits,this.nonce=r.nonce,r.hash&&f.checkState(this.hash===r.hash,"Argument object hash property does not match block hash."),this};c._from=function(e){var t={};if(o.isBuffer(e))t=c._fromBufferReader(a(e));else{if(!n.isObject(e))throw new TypeError("Unrecognized argument for BlockHeader");t=c._fromObject(e)}return t},c._fromObject=function(e){f.checkArgument(e,"data is required");var r=e.prevHash,i=e.merkleRoot;return n.isString(e.prevHash)&&(r=o.reverse(new t(e.prevHash,"hex"))),n.isString(e.merkleRoot)&&(i=o.reverse(new t(e.merkleRoot,"hex"))),{hash:e.hash,version:e.version,prevHash:r,merkleRoot:i,time:e.time,timestamp:e.time,bits:e.bits,nonce:e.nonce}},c.fromObject=function(e){var t=c._fromObject(e);return new c(t)},c.fromRawBlock=function(e){o.isBuffer(e)||(e=new t(e,"binary"));var r=a(e);r.pos=c.Constants.START_OF_HEADER;var n=c._fromBufferReader(r);return new c(n)},c.fromBuffer=function(e){var t=c._fromBufferReader(a(e));return new c(t)},c.fromString=function(e){var r=new t(e,"hex");return c.fromBuffer(r)},c._fromBufferReader=function(e){var t={};return t.version=e.readInt32LE(),t.prevHash=e.read(32),t.merkleRoot=e.read(32),t.time=e.readUInt32LE(),t.bits=e.readUInt32LE(),t.nonce=e.readUInt32LE(),t},c.fromBufferReader=function(e){var t=c._fromBufferReader(e);return new c(t)},c.prototype.toObject=c.prototype.toJSON=function(){return{hash:this.hash,version:this.version,prevHash:o.reverse(this.prevHash).toString("hex"),merkleRoot:o.reverse(this.merkleRoot).toString("hex"),time:this.time,bits:this.bits,nonce:this.nonce}},c.prototype.toBuffer=function(){return this.toBufferWriter().concat()},c.prototype.toString=function(){return this.toBuffer().toString("hex")},c.prototype.toBufferWriter=function(e){return e||(e=new s),e.writeInt32LE(this.version),e.write(this.prevHash),e.write(this.merkleRoot),e.writeUInt32LE(this.time),e.writeUInt32LE(this.bits),e.writeUInt32LE(this.nonce),e},c.prototype.getTargetDifficulty=function(e){e=e||this.bits;for(var t=new i(16777215&e),r=8*((e>>>24)-3);r-- >0;)t=t.mul(new i(2));return t},c.prototype.getDifficulty=function(){var e=this.getTargetDifficulty(486604799).mul(new i(Math.pow(10,8))),t=this.getTargetDifficulty(),r=e.div(t).toString(10),n=r.length-8;return r=r.slice(0,n)+"."+r.slice(n),parseFloat(r)},c.prototype._getHash=function(){var e=this.toBuffer();return u.sha256sha256(e)};var h={configurable:!1,enumerable:!0,get:function(){return this._id||(this._id=a(this._getHash()).readReverse().toString("hex")),this._id},set:n.noop};Object.defineProperty(c.prototype,"id",h),Object.defineProperty(c.prototype,"hash",h),c.prototype.validTimestamp=function(){var e=Math.round((new Date).getTime()/1e3);return!(this.time>e+c.Constants.MAX_TIME_OFFSET)},c.prototype.validProofOfWork=function(){var e=new i(this.id,"hex"),t=this.getTargetDifficulty();return!(e.cmp(t)>0)},c.prototype.inspect=function(){return""},c.Constants={START_OF_HEADER:8,MAX_TIME_OFFSET:7200,LARGEST_HASH:new i("10000000000000000000000000000000000000000000000000000000000000000","hex")},e.exports=c}).call(this,r(0).Buffer)},function(e,t,r){(function(e){var n=r(215),i=r(117),o=r(123),a=r(223),s=r(44),u=t;u.request=function(t,r){t="string"==typeof t?s.parse(t):o(t);var i=-1===e.location.protocol.search(/^https?:$/)?"http:":"",a=t.protocol||i,u=t.hostname||t.host,f=t.port,c=t.path||"/";u&&-1!==u.indexOf(":")&&(u="["+u+"]"),t.url=(u?a+"//"+u:"")+(f?":"+f:"")+c,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var h=new n(t);return r&&h.on("response",r),h},u.get=function(e,t){var r=u.request(e,t);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(7))},function(e,t){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(e){return"function"==typeof e}function i(e){return"object"==typeof e&&null!==e}function o(e){return void 0===e}e.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!function(e){return"number"==typeof e}(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,r,a,s,u,f;if(this._events||(this._events={}),"error"===e&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(o(r=this._events[e]))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),r.apply(this,s)}else if(i(r))for(s=Array.prototype.slice.call(arguments,1),a=(f=r.slice()).length,u=0;u0&&this._events[e].length>a&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){if(!n(t))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},r.prototype.removeListener=function(e,t){var r,o,a,s;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(a=(r=this._events[e]).length,o=-1,r===t||n(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(i(r)){for(s=a;s-- >0;)if(r[s]===t||r[s].listener&&r[s].listener===t){o=s;break}if(o<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(o,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n(r=this._events[e]))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){return this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(n(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,r){"use strict";(function(t,n,i){var o=r(64);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=v;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?n:o.nextTick;v.WritableState=g;var f=r(54);f.inherits=r(1);var c={deprecate:r(220)},h=r(119),d=r(2).Buffer,l=i.Uint8Array||function(){};var p,b=r(120);function m(){}function g(e,t){s=s||r(36),e=e||{};var n=t instanceof s;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,f=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(f||0===f)?f:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var h=!1===e.decodeStrings;this.decodeStrings=!h,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(o.nextTick(i,n),o.nextTick(A,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),A(e,t))}(e,r,n,t,i);else{var a=S(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||_(e,r),n?u(w,e,r,a,i):w(e,r,a,i)}}(t,e)},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 v(e){if(s=s||r(36),!(p.call(v,this)||this instanceof s))return new v(e);this._writableState=new g(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),h.call(this)}function y(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function w(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),A(e,t)}function _(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.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,y(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,c=r.encoding,h=r.callback;if(y(e,t,!1,t.objectMode?1:f.length,f,c,h),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function S(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function M(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),A(e,t)})}function A(e,t){var r=S(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(M,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}f.inherits(v,h),g.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(g.prototype,"buffer",{get:c.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===v&&(e&&e._writableState instanceof g)}})):p=function(e){return e instanceof this},v.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},v.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&function(e){return d.isBuffer(e)||e instanceof l}(e);return a&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=m),n.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),o.nextTick(t,r)}(this,r):(a||function(e,t,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||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(n,a),i=!1),i}(this,n,e,r))&&(n.pendingcb++,i=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,r));return t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!==e&&void 0!==e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,A(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),v.prototype.destroy=b.destroy,v.prototype._undestroy=b.undestroy,v.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(15),r(121).setImmediate,r(7))},function(e,t,r){"use strict";var n=r(2).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.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(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){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 e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=f,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=c,this.end=h,t=3;break;default:return this.write=d,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function f(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function l(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(e.lastNeed=i-1),i;if(--n=0)return i>0&&(e.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){this.listeners={}}return e.prototype.addEventListener=function(e,t){e=e.toLowerCase(),this.listeners[e]=this.listeners[e]||[],this.listeners[e].push(t.handleEvent||t)},e.prototype.removeEventListener=function(e,t){if(e=e.toLowerCase(),this.listeners[e]){var r=this.listeners[e].indexOf(t.handleEvent||t);r<0||this.listeners[e].splice(r,1)}},e.prototype.dispatchEvent=function(e){var t=e.type.toLowerCase();if(e.target=this,this.listeners[t])for(var r=0,n=this.listeners[t];r>6|192);else{if(i>55295&&i<56320){if(++n==e.length)return null;var o=e.charCodeAt(n);if(o<56320||o>57343)return null;r+=t((i=65536+((1023&i)<<10)+(1023&o))>>18|240),r+=t(i>>12&63|128)}else r+=t(i>>12|224);r+=t(i>>6&63|128)}r+=t(63&i|128)}}return r},toString:function(e){for(var t="",r=0,o=i(e);r127){if(a>191&&a<224){if(r>=o)return null;a=(31&a)<<6|63&n(e,r)}else if(a>223&&a<240){if(r+1>=o)return null;a=(15&a)<<12|(63&n(e,r))<<6|63&n(e,++r)}else{if(!(a>239&&a<248))return null;if(r+2>=o)return null;a=(7&a)<<18|(63&n(e,r))<<12|(63&n(e,++r))<<6|63&n(e,++r)}++r}if(a<=65535)t+=String.fromCharCode(a);else{if(!(a<=1114111))return null;a-=65536,t+=String.fromCharCode(a>>10|55296),t+=String.fromCharCode(1023&a|56320)}}return t},fromNumber:function(e){var t=e.toString(16);return t.length%2==0?"0x"+t:"0x0"+t},toNumber:function(e){return parseInt(e.slice(2),16)},fromNat:function(e){return"0x0"===e?"0x":e.length%2==0?e:"0x0"+e.slice(2)},toNat:function(e){return"0"===e[2]?"0x"+e.slice(3):e},fromArray:a,toArray:o,fromUint8Array:function(e){return a([].slice.call(e,0))},toUint8Array:function(e){return new Uint8Array(o(e))}}},function(e,t,r){"use strict";var n=r(1),i=r(132),o=r(2).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(e,t){return e<>>32-t}function f(e,t,r,n,i,o,a){return u(e+(t&r|~t&n)+i+o|0,a)+t|0}function c(e,t,r,n,i,o,a){return u(e+(t&n|r&~n)+i+o|0,a)+t|0}function h(e,t,r,n,i,o,a){return u(e+(t^r^n)+i+o|0,a)+t|0}function d(e,t,r,n,i,o,a){return u(e+(r^(t|~n))+i+o|0,a)+t|0}n(s,i),s.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,o=this._d;n=d(n=d(n=d(n=d(n=h(n=h(n=h(n=h(n=c(n=c(n=c(n=c(n=f(n=f(n=f(n=f(n,i=f(i,o=f(o,r=f(r,n,i,o,e[0],3614090360,7),n,i,e[1],3905402710,12),r,n,e[2],606105819,17),o,r,e[3],3250441966,22),i=f(i,o=f(o,r=f(r,n,i,o,e[4],4118548399,7),n,i,e[5],1200080426,12),r,n,e[6],2821735955,17),o,r,e[7],4249261313,22),i=f(i,o=f(o,r=f(r,n,i,o,e[8],1770035416,7),n,i,e[9],2336552879,12),r,n,e[10],4294925233,17),o,r,e[11],2304563134,22),i=f(i,o=f(o,r=f(r,n,i,o,e[12],1804603682,7),n,i,e[13],4254626195,12),r,n,e[14],2792965006,17),o,r,e[15],1236535329,22),i=c(i,o=c(o,r=c(r,n,i,o,e[1],4129170786,5),n,i,e[6],3225465664,9),r,n,e[11],643717713,14),o,r,e[0],3921069994,20),i=c(i,o=c(o,r=c(r,n,i,o,e[5],3593408605,5),n,i,e[10],38016083,9),r,n,e[15],3634488961,14),o,r,e[4],3889429448,20),i=c(i,o=c(o,r=c(r,n,i,o,e[9],568446438,5),n,i,e[14],3275163606,9),r,n,e[3],4107603335,14),o,r,e[8],1163531501,20),i=c(i,o=c(o,r=c(r,n,i,o,e[13],2850285829,5),n,i,e[2],4243563512,9),r,n,e[7],1735328473,14),o,r,e[12],2368359562,20),i=h(i,o=h(o,r=h(r,n,i,o,e[5],4294588738,4),n,i,e[8],2272392833,11),r,n,e[11],1839030562,16),o,r,e[14],4259657740,23),i=h(i,o=h(o,r=h(r,n,i,o,e[1],2763975236,4),n,i,e[4],1272893353,11),r,n,e[7],4139469664,16),o,r,e[10],3200236656,23),i=h(i,o=h(o,r=h(r,n,i,o,e[13],681279174,4),n,i,e[0],3936430074,11),r,n,e[3],3572445317,16),o,r,e[6],76029189,23),i=h(i,o=h(o,r=h(r,n,i,o,e[9],3654602809,4),n,i,e[12],3873151461,11),r,n,e[15],530742520,16),o,r,e[2],3299628645,23),i=d(i,o=d(o,r=d(r,n,i,o,e[0],4096336452,6),n,i,e[7],1126891415,10),r,n,e[14],2878612391,15),o,r,e[5],4237533241,21),i=d(i,o=d(o,r=d(r,n,i,o,e[12],1700485571,6),n,i,e[3],2399980690,10),r,n,e[10],4293915773,15),o,r,e[1],2240044497,21),i=d(i,o=d(o,r=d(r,n,i,o,e[8],1873313359,6),n,i,e[15],4264355552,10),r,n,e[6],2734768916,15),o,r,e[13],1309151649,21),i=d(i,o=d(o,r=d(r,n,i,o,e[4],4149444226,6),n,i,e[11],3174756917,10),r,n,e[2],718787259,15),o,r,e[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 e=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s},function(e,t,r){"use strict";var n=r(0).Buffer,i=r(1),o=r(132),a=new Array(16),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],u=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],f=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],c=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],h=[0,1518500249,1859775393,2400959708,2840853838],d=[1352829926,1548603684,1836072691,2053994217,0];function l(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(e,t){return e<>>32-t}function b(e,t,r,n,i,o,a,s){return p(e+(t^r^n)+o+a|0,s)+i|0}function m(e,t,r,n,i,o,a,s){return p(e+(t&r|~t&n)+o+a|0,s)+i|0}function g(e,t,r,n,i,o,a,s){return p(e+((t|~r)^n)+o+a|0,s)+i|0}function v(e,t,r,n,i,o,a,s){return p(e+(t&n|r&~n)+o+a|0,s)+i|0}function y(e,t,r,n,i,o,a,s){return p(e+(t^(r|~n))+o+a|0,s)+i|0}i(l,o),l.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,l=0|this._e,w=0|this._a,_=0|this._b,S=0|this._c,M=0|this._d,A=0|this._e,x=0;x<80;x+=1){var E,k;x<16?(E=b(r,n,i,o,l,e[s[x]],h[0],f[x]),k=y(w,_,S,M,A,e[u[x]],d[0],c[x])):x<32?(E=m(r,n,i,o,l,e[s[x]],h[1],f[x]),k=v(w,_,S,M,A,e[u[x]],d[1],c[x])):x<48?(E=g(r,n,i,o,l,e[s[x]],h[2],f[x]),k=g(w,_,S,M,A,e[u[x]],d[2],c[x])):x<64?(E=v(r,n,i,o,l,e[s[x]],h[3],f[x]),k=m(w,_,S,M,A,e[u[x]],d[3],c[x])):(E=y(r,n,i,o,l,e[s[x]],h[4],f[x]),k=b(w,_,S,M,A,e[u[x]],d[4],c[x])),r=l,l=o,o=p(i,10),i=n,n=E,w=A,A=M,M=p(S,10),S=_,_=k}var I=this._b+i+M|0;this._b=this._c+o+A|0,this._c=this._d+l+w|0,this._d=this._e+r+_|0,this._e=this._a+n+S|0,this._a=I},l.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=n.alloc?n.alloc(20):new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=l},function(e,t,r){(t=e.exports=function(e){e=e.toLowerCase();var r=t[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r}).sha=r(254),t.sha1=r(255),t.sha224=r(256),t.sha256=r(133),t.sha384=r(257),t.sha512=r(134)},function(e,t,r){t.pbkdf2=r(260),t.pbkdf2Sync=r(140)},function(e,t,r){"use strict";t.utils=r(263),t.Cipher=r(264),t.DES=r(265),t.CBC=r(266),t.EDE=r(267)},function(e,t,r){var n=r(268),i=r(276),o=r(143);t.createCipher=t.Cipher=n.createCipher,t.createCipheriv=t.Cipheriv=n.createCipheriv,t.createDecipher=t.Decipher=i.createDecipher,t.createDecipheriv=t.Decipheriv=i.createDecipheriv,t.listCiphers=t.getCiphers=function(){return Object.keys(o)}},function(e,t,r){var n={ECB:r(269),CBC:r(270),CFB:r(271),CFB8:r(272),CFB1:r(273),OFB:r(274),CTR:r(141),GCM:r(141)},i=r(143);for(var o in i)i[o].module=n[i[o].mode];e.exports=i},function(e,t,r){(function(t){var n=r(3),i=r(46);function o(e,r){var i=function(e){var t=a(e);return{blinder:t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(r),o=r.modulus.byteLength(),s=(n.mont(r.modulus),new n(e).mul(i.blinder).umod(r.modulus)),u=s.toRed(n.mont(r.prime1)),f=s.toRed(n.mont(r.prime2)),c=r.coefficient,h=r.prime1,d=r.prime2,l=u.redPow(r.exponent1),p=f.redPow(r.exponent2);l=l.fromRed(),p=p.fromRed();var b=l.isub(p).imul(c).umod(h);return b.imul(d),p.iadd(b),new t(p.imul(i.unblinder).umod(r.modulus).toArray(!1,o))}function a(e){for(var t=e.modulus.byteLength(),r=new n(i(t));r.cmp(e.modulus)>=0||!r.umod(e.prime1)||!r.umod(e.prime2);)r=new n(i(t));return r}e.exports=o,o.getr=a}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=t;function i(e){return 1===e.length?"0"+e:e}function o(e){for(var t="",r=0;r>8,a=255&i;o?r.push(o,a):r.push(a)}return r},n.zero2=i,n.toHex=o,n.encode=function(e,t){return"hex"===t?o(e):e}},function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(351),o=r(357),a=r(48),s=r(166),u=r(3),f=r(39),c=r(2).Buffer;Object.assign(t,r(365)),t.MAX_INTEGER=new u("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),t.TWO_POW256=new u("10000000000000000000000000000000000000000000000000000000000000000",16),t.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",t.SHA3_NULL_S=t.KECCAK256_NULL_S,t.KECCAK256_NULL=c.from(t.KECCAK256_NULL_S,"hex"),t.SHA3_NULL=t.KECCAK256_NULL,t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.SHA3_RLP_ARRAY_S=t.KECCAK256_RLP_ARRAY_S,t.KECCAK256_RLP_ARRAY=c.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.SHA3_RLP_ARRAY=t.KECCAK256_RLP_ARRAY,t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.SHA3_RLP_S=t.KECCAK256_RLP_S,t.KECCAK256_RLP=c.from(t.KECCAK256_RLP_S,"hex"),t.SHA3_RLP=t.KECCAK256_RLP,t.BN=u,t.rlp=s,t.secp256k1=o,t.zeros=function(e){return c.allocUnsafe(e).fill(0)},t.zeroAddress=function(){var e=t.zeros(20);return t.bufferToHex(e)},t.setLengthLeft=t.setLength=function(e,r,n){var i=t.zeros(r);return e=t.toBuffer(e),n?e.length0&&"0"===r.toString();)r=(e=e.slice(1))[0];return e},t.toBuffer=function(e){if(!c.isBuffer(e))if(Array.isArray(e))e=c.from(e);else if("string"==typeof e)e=t.isHexString(e)?c.from(t.padToEven(t.stripHexPrefix(e)),"hex"):c.from(e);else if("number"==typeof e)e=t.intToBuffer(e);else if(null===e||void 0===e)e=c.allocUnsafe(0);else if(u.isBN(e))e=e.toArrayLike(c);else{if(!e.toArray)throw new Error("invalid type");e=c.from(e.toArray())}return e},t.bufferToInt=function(e){return new u(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new u(e).fromTwos(256)},t.toUnsigned=function(e){return c.from(e.toTwos(256).toArray())},t.keccak=function(e,r){return e=t.toBuffer(e),r||(r=256),i("keccak"+r).update(e).digest()},t.keccak256=function(e){return t.keccak(e)},t.sha3=t.keccak,t.sha256=function(e){return e=t.toBuffer(e),f("sha256").update(e).digest()},t.ripemd160=function(e,r){e=t.toBuffer(e);var n=f("rmd160").update(e).digest();return!0===r?t.setLength(n,32):n},t.rlphash=function(e){return t.keccak(s.encode(e))},t.isValidPrivate=function(e){return o.privateKeyVerify(e)},t.isValidPublic=function(e,t){return 64===e.length?o.publicKeyVerify(c.concat([c.from([4]),e])):!!t&&o.publicKeyVerify(e)},t.pubToAddress=t.publicToAddress=function(e,r){return e=t.toBuffer(e),r&&64!==e.length&&(e=o.publicKeyConvert(e,!1).slice(1)),a(64===e.length),t.keccak(e).slice(-20)};var h=t.privateToPublic=function(e){return e=t.toBuffer(e),o.publicKeyCreate(e,!1).slice(1)};t.importPublic=function(e){return 64!==(e=t.toBuffer(e)).length&&(e=o.publicKeyConvert(e,!1).slice(1)),e},t.ecsign=function(e,t){var r=o.sign(e,t),n={};return n.r=r.signature.slice(0,32),n.s=r.signature.slice(32,64),n.v=r.recovery+27,n},t.hashPersonalMessage=function(e){var r=t.toBuffer("Ethereum Signed Message:\n"+e.length.toString());return t.keccak(c.concat([r,e]))},t.ecrecover=function(e,r,n,i){var a=c.concat([t.setLength(n,32),t.setLength(i,32)],64),s=r-27;if(0!==s&&1!==s)throw new Error("Invalid signature v value");var u=o.recover(e,a,s);return o.publicKeyConvert(u,!1).slice(1)},t.toRpcSig=function(e,r,n){if(27!==e&&28!==e)throw new Error("Invalid recovery id");return t.bufferToHex(c.concat([t.setLengthLeft(r,32),t.setLengthLeft(n,32),t.toBuffer(e-27)]))},t.fromRpcSig=function(e){if(65!==(e=t.toBuffer(e)).length)throw new Error("Invalid signature length");var r=e[64];return r<27&&(r+=27),{v:r,r:e.slice(0,32),s:e.slice(32,64)}},t.privateToAddress=function(e){return t.publicToAddress(h(e))},t.isValidAddress=function(e){return/^0x[0-9a-fA-F]{40}$/.test(e)},t.isZeroAddress=function(e){return t.zeroAddress()===t.addHexPrefix(e)},t.toChecksumAddress=function(e){e=t.stripHexPrefix(e).toLowerCase();for(var r=t.keccak(e).toString("hex"),n="0x",i=0;i=8?n+=e[i].toUpperCase():n+=e[i];return n},t.isValidChecksumAddress=function(e){return t.isValidAddress(e)&&t.toChecksumAddress(e)===e},t.generateAddress=function(e,r){return e=t.toBuffer(e),r=(r=new u(r)).isZero()?null:c.from(r.toArray()),t.rlphash([e,r]).slice(-20)},t.isPrecompiled=function(e){var r=t.unpad(e);return 1===r.length&&r[0]>=1&&r[0]<=8},t.addHexPrefix=function(e){return"string"!=typeof e?e:t.isHexPrefixed(e)?e:"0x"+e},t.isValidSignature=function(e,t,r,n){var i=new u("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),o=new u("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return 32===t.length&&32===r.length&&((27===e||28===e)&&(t=new u(t),r=new u(r),!(t.isZero()||t.gt(o)||r.isZero()||r.gt(o))&&(!1!==n||1!==new u(r).cmp(i))))},t.baToJSON=function(e){if(c.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var r=[],n=0;n=i.length,"The field "+r.name+" must not have more "+r.length+" bytes")):r.allowZero&&0===i.length||!r.length||a(r.length===i.length,"The field "+r.name+" must have byte length of "+r.length),e.raw[n]=i}e._fields.push(r.name),Object.defineProperty(e,r.name,{enumerable:!0,configurable:!0,get:i,set:o}),r.default&&(e[r.name]=r.default),r.alias&&Object.defineProperty(e,r.alias,{enumerable:!1,configurable:!0,set:o,get:i})}),i)if("string"==typeof i&&(i=c.from(t.stripHexPrefix(i),"hex")),c.isBuffer(i)&&(i=s.decode(i)),Array.isArray(i)){if(i.length>e._fields.length)throw new Error("wrong number of fields in data");i.forEach(function(r,n){e[e._fields[n]]=t.toBuffer(r)})}else{if("object"!==(void 0===i?"undefined":n(i)))throw new Error("invalid data");var o=Object.keys(i);r.forEach(function(t){-1!==o.indexOf(t.name)&&(e[t.name]=i[t.name]),-1!==o.indexOf(t.alias)&&(e[t.alias]=i[t.alias])})}}},function(e,t,r){var n;/*! bignumber.js v2.0.7 https://github.com/MikeMcl/bignumber.js/LICENCE */!function(i){"use strict";var o,a,s,u=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,f=Math.ceil,c=Math.floor,h=" not a boolean or binary digit",d="rounding mode",l="number type has more than 15 significant digits",p="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",b=1e14,m=14,g=9007199254740991,v=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],y=1e7,w=1e9;function _(e){var t=0|e;return e>0||e===t?t:t-1}function S(e){for(var t,r,n=1,i=e.length,o=e[0]+"";nf^r?1:-1;for(s=(u=i.length)<(f=o.length)?u:f,a=0;ao[a]^r?1:-1;return u==f?0:u>f^r?1:-1}function A(e,t,r){return(e=P(e))>=t&&e<=r}function x(e){return"[object Array]"==Object.prototype.toString.call(e)}function E(e,t,r){for(var n,i,o=[0],a=0,s=e.length;ar-1&&(null==o[n+1]&&(o[n+1]=0),o[n+1]+=o[n]/r|0,o[n]%=r)}return o.reverse()}function k(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function I(e,t){var r,n;if(t<0){for(n="0.";++t;n+="0");e=n+e}else if(++t>(r=e.length)){for(n="0",t-=r;--t;n+="0");e+=n}else t15&&W(n,l,e),a=!1):h.s=45===c.charCodeAt(0)?(c=c.slice(1),-1):1,c=H(c,10,t,h.s)}else{if(e instanceof q)return h.s=e.s,h.e=e.e,h.c=(e=e.c)?e.slice():e,void(n=0);if((a="number"==typeof e)&&0*e==0){if(h.s=1/e<0?(e=-e,-1):1,e===~~e){for(i=0,o=e;o>=10;o/=10,i++);return h.e=i,h.c=[e],void(n=0)}c=e+""}else{if(!u.test(c=e+""))return s(h,c,a);h.s=45===c.charCodeAt(0)?(c=c.slice(1),-1):1}}for((i=c.indexOf("."))>-1&&(c=c.replace(".","")),(o=c.search(/e/i))>0?(i<0&&(i=o),i+=+c.slice(o+1),c=c.substring(0,o)):i<0&&(i=c.length),o=0;48===c.charCodeAt(o);o++);for(f=c.length;48===c.charCodeAt(--f););if(c=c.slice(o,f+1))if(f=c.length,a&&L&&f>15&&W(n,l,h.s*e),(i=i-o-1)>C)h.c=h.e=null;else if(i=0&&(s=U,U=0,e=e.replace(".",""),f=(h=new q(n)).pow(e.length-d),U=s,h.c=E(I(S(f.c),f.e),10,t),h.e=h.c.length),a=s=(c=E(e,n,t)).length;0==c[--s];c.pop());if(!c[0])return"0";if(d<0?--a:(f.c=c,f.e=a,f.s=i,c=(f=r(f,h,l,b,t)).c,u=f.r,a=f.e),d=c[o=a+l+1],s=t/2,u=u||o<0||null!=c[o+1],u=b<4?(null!=d||u)&&(0==b||b==(f.s<0?3:2)):d>s||d==s&&(4==b||u||6==b&&1&c[o-1]||b==(f.s<0?8:7)),o<1||!c[0])e=u?I("1",-l):"0";else{if(c.length=o,u)for(--t;++c[--o]>t;)c[o]=0,o||(++a,c.unshift(1));for(s=c.length;!c[--s];);for(d=0,e="";d<=s;e+=p.charAt(c[d++]));e=I(e,a)}return e}function K(e,t,r,n){var i,o,a,s,u;if(r=null!=r&&j(r,0,8,n,d)?0|r:T,!e.c)return e.toString();if(i=e.c[0],a=e.e,null==t)u=S(e.c),u=19==n||24==n&&a<=O?k(u,a):I(u,a);else if(o=(e=Z(new q(e),t,r)).e,s=(u=S(e.c)).length,19==n||24==n&&(t<=o||o<=O)){for(;ss){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=o-s)>0)for(o+1==s&&(u+=".");t--;u+="0");return e.s<0&&i?"-"+u:u}function V(e,t){var r,n,i=0;for(x(e[0])&&(e=e[0]),r=new q(e[0]);++ir||e!=P(e))&&W(n,(i||"decimal places")+(er?" out of range":" not an integer"),e),!0}function Y(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*m-1)>C?e.c=e.e=null:r=10;s/=10,i++);if((o=t-i)<0)o+=m,a=t,d=(u=l[h=0])/p[i-a-1]%10|0;else if((h=f((o+1)/m))>=l.length){if(!n)break e;for(;l.length<=h;l.push(0));u=d=0,i=1,a=(o%=m)-m+1}else{for(u=s=l[h],i=1;s>=10;s/=10,i++);d=(a=(o%=m)-m+i)<0?0:u/p[i-a-1]%10|0}if(n=n||t<0||null!=l[h+1]||(a<0?u:u%p[i-a-1]),n=r<4?(d||n)&&(0==r||r==(e.s<0?3:2)):d>5||5==d&&(4==r||n||6==r&&(o>0?a>0?u/p[i-a]:0:l[h-1])%10&1||r==(e.s<0?8:7)),t<1||!l[0])return l.length=0,n?(t-=e.e+1,l[0]=p[t%m],e.e=-t||0):l[0]=e.e=0,e;if(0==o?(l.length=h,s=1,h--):(l.length=h+1,s=p[m-o],l[h]=a>0?c(u/p[i-a]%p[a])*s:0),n)for(;;){if(0==h){for(o=1,a=l[0];a>=10;a/=10,o++);for(a=l[0]+=s,s=1;a>=10;a/=10,s++);o!=s&&(e.e++,l[0]==b&&(l[0]=1));break}if(l[h]+=s,l[h]!=b)break;l[h--]=0,s=1}for(o=l.length;0===l[--o];l.pop());}e.e>C?e.c=e.e=null:e.er)return null!=(e=o[r++])};return u(t="DECIMAL_PLACES")&&j(e,0,w,2,t)&&(B=0|e),i[t]=B,u(t="ROUNDING_MODE")&&j(e,0,8,2,t)&&(T=0|e),i[t]=T,u(t="EXPONENTIAL_AT")&&(x(e)?j(e[0],-w,0,2,t)&&j(e[1],0,w,2,t)&&(O=0|e[0],R=0|e[1]):j(e,-w,w,2,t)&&(O=-(R=0|(e<0?-e:e)))),i[t]=[O,R],u(t="RANGE")&&(x(e)?j(e[0],-w,-1,2,t)&&j(e[1],1,w,2,t)&&(N=0|e[0],C=0|e[1]):j(e,-w,w,2,t)&&(0|e?N=-(C=0|(e<0?-e:e)):L&&W(2,t+" cannot be zero",e))),i[t]=[N,C],u(t="ERRORS")&&(e===!!e||1===e||0===e?(n=0,j=(L=!!e)?G:A):L&&W(2,t+h,e)),i[t]=L,u(t="CRYPTO")&&(e===!!e||1===e||0===e?(z=!(!e||!a||"object"!=typeof a),e&&!z&&L&&W(2,"crypto unavailable",a)):L&&W(2,t+h,e)),i[t]=z,u(t="MODULO_MODE")&&j(e,0,9,2,t)&&(D=0|e),i[t]=D,u(t="POW_PRECISION")&&j(e,0,w,2,t)&&(U=0|e),i[t]=U,u(t="FORMAT")&&("object"==typeof e?F=e:L&&W(2,t+" not an object",e)),i[t]=F,i},q.max=function(){return V(arguments,i.lt)},q.min=function(){return V(arguments,i.gt)},q.random=function(){var e=9007199254740992*Math.random()&2097151?function(){return c(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(t){var r,n,i,s,u,h=0,d=[],l=new q(o);if(t=null!=t&&j(t,0,w,14)?0|t:B,s=f(t/m),z)if(a&&a.getRandomValues){for(r=a.getRandomValues(new Uint32Array(s*=2));h>>11))>=9e15?(n=a.getRandomValues(new Uint32Array(2)),r[h]=n[0],r[h+1]=n[1]):(d.push(u%1e14),h+=2);h=s/2}else if(a&&a.randomBytes){for(r=a.randomBytes(s*=7);h=9e15?a.randomBytes(7).copy(r,h):(d.push(u%1e14),h+=7);h=s/7}else L&&W(14,"crypto unavailable",a);if(!h)for(;h=10;u/=10,h++);hn?1:-1;else for(i=o=0;it[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]1;e.shift());}return function(n,i,o,a,s){var u,f,h,d,l,p,g,v,y,w,S,M,A,x,E,k,I,P=n.s==i.s?1:-1,B=n.c,T=i.c;if(!(B&&B[0]&&T&&T[0]))return new q(n.s&&i.s&&(B?!T||B[0]!=T[0]:T)?B&&0==B[0]||!T?0*P:P/0:NaN);for(y=(v=new q(P)).c=[],P=o+(f=n.e-i.e)+1,s||(s=b,f=_(n.e/m)-_(i.e/m),P=P/m|0),h=0;T[h]==(B[h]||0);h++);if(T[h]>(B[h]||0)&&f--,P<0)y.push(1),d=!0;else{for(x=B.length,k=T.length,h=0,P+=2,(l=c(s/(T[0]+1)))>1&&(T=e(T,l,s),B=e(B,l,s),k=T.length,x=B.length),A=k,S=(w=B.slice(0,k)).length;S=s/2&&E++;do{if(l=0,(u=t(T,w,k,S))<0){if(M=w[0],k!=S&&(M=M*s+(w[1]||0)),(l=c(M/E))>1)for(l>=s&&(l=s-1),g=(p=e(T,l,s)).length,S=w.length;1==t(p,w,g,S);)l--,r(p,k=10;P/=10,h++);Z(v,o+(v.e=h+f*m-1)+1,a,d)}else v.e=f,v.r=+d;return v}}(),s=function(){var e=/^(-?)0([xbo])/i,t=/^([^.]+)\.$/,r=/^\.([^.]+)$/,i=/^-?(Infinity|NaN)$/,o=/^\s*\+|^\s+|\s+$/g;return function(a,s,u,f){var c,h=u?s:s.replace(o,"");if(i.test(h))a.s=isNaN(h)?null:h<0?-1:1;else{if(!u&&(h=h.replace(e,function(e,t,r){return c="x"==(r=r.toLowerCase())?16:"b"==r?2:8,f&&f!=c?e:t}),f&&(c=f,h=h.replace(t,"$1").replace(r,"0.$1")),s!=h))return new q(h,c);L&&W(n,"not a"+(f?" base "+f:"")+" number",s),a.s=null}a.c=a.e=null,n=0}}(),i.absoluteValue=i.abs=function(){var e=new q(this);return e.s<0&&(e.s=1),e},i.ceil=function(){return Z(new q(this),this.e+1,2)},i.comparedTo=i.cmp=function(e,t){return n=1,M(this,new q(e,t))},i.decimalPlaces=i.dp=function(){var e,t,r=this.c;if(!r)return null;if(e=((t=r.length-1)-_(this.e/m))*m,t=r[t])for(;t%10==0;t/=10,e--);return e<0&&(e=0),e},i.dividedBy=i.div=function(e,t){return n=3,r(this,new q(e,t),B,T)},i.dividedToIntegerBy=i.divToInt=function(e,t){return n=4,r(this,new q(e,t),0,1)},i.equals=i.eq=function(e,t){return n=5,0===M(this,new q(e,t))},i.floor=function(){return Z(new q(this),this.e+1,3)},i.greaterThan=i.gt=function(e,t){return n=6,M(this,new q(e,t))>0},i.greaterThanOrEqualTo=i.gte=function(e,t){return n=7,1===(t=M(this,new q(e,t)))||0===t},i.isFinite=function(){return!!this.c},i.isInteger=i.isInt=function(){return!!this.c&&_(this.e/m)>this.c.length-2},i.isNaN=function(){return!this.s},i.isNegative=i.isNeg=function(){return this.s<0},i.isZero=function(){return!!this.c&&0==this.c[0]},i.lessThan=i.lt=function(e,t){return n=8,M(this,new q(e,t))<0},i.lessThanOrEqualTo=i.lte=function(e,t){return n=9,-1===(t=M(this,new q(e,t)))||0===t},i.minus=i.sub=function(e,t){var r,i,o,a,s=this,u=s.s;if(n=10,t=(e=new q(e,t)).s,!u||!t)return new q(NaN);if(u!=t)return e.s=-t,s.plus(e);var f=s.e/m,c=e.e/m,h=s.c,d=e.c;if(!f||!c){if(!h||!d)return h?(e.s=-t,e):new q(d?s:NaN);if(!h[0]||!d[0])return d[0]?(e.s=-t,e):new q(h[0]?s:3==T?-0:0)}if(f=_(f),c=_(c),h=h.slice(),u=f-c){for((a=u<0)?(u=-u,o=h):(c=f,o=d),o.reverse(),t=u;t--;o.push(0));o.reverse()}else for(i=(a=(u=h.length)<(t=d.length))?u:t,u=t=0;t0)for(;t--;h[r++]=0);for(t=b-1;i>u;){if(h[--i]0?(s=a,r=f):(o=-o,r=u),r.reverse();o--;r.push(0));r.reverse()}for((o=u.length)-(t=f.length)<0&&(r=f,f=u,u=r,t=o),o=0;t;)o=(u[--t]=u[t]+f[t]+o)/b|0,u[t]%=b;return o&&(u.unshift(o),++s),Y(e,u,s)},i.precision=i.sd=function(e){var t,r,n=this,i=n.c;if(null!=e&&e!==!!e&&1!==e&&0!==e&&(L&&W(13,"argument"+h,e),e!=!!e&&(e=null)),!i)return null;if(t=(r=i.length-1)*m+1,r=i[r]){for(;r%10==0;r/=10,t--);for(r=i[0];r>=10;r/=10,t++);}return e&&n.e+1>t&&(t=n.e+1),t},i.round=function(e,t){var r=new q(this);return(null==e||j(e,0,w,15))&&Z(r,~~e+this.e+1,null!=t&&j(t,0,8,15,d)?0|t:T),r},i.shift=function(e){var t=this;return j(e,-g,g,16,"argument")?t.times("1e"+P(e)):new q(t.c&&t.c[0]&&(e<-g||e>g)?t.s*(e<0?0:1/0):t)},i.squareRoot=i.sqrt=function(){var e,t,n,i,o,a=this,s=a.c,u=a.s,f=a.e,c=B+4,h=new q("0.5");if(1!==u||!s||!s[0])return new q(!u||u<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(u=Math.sqrt(+a))||u==1/0?(((t=S(s)).length+f)%2==0&&(t+="0"),u=Math.sqrt(t),f=_((f+1)/2)-(f<0||f%2),n=new q(t=u==1/0?"1e"+f:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+f)):n=new q(u+""),n.c[0])for((u=(f=n.e)+c)<3&&(u=0);;)if(o=n,n=h.times(o.plus(r(a,o,c,1))),S(o.c).slice(0,u)===(t=S(n.c)).slice(0,u)){if(n.e=0;){for(r=0,l=A[o]%w,p=A[o]/w|0,a=o+(s=f);a>o;)r=((c=l*(c=M[--s]%w)+(u=p*c+(h=M[s]/w|0)*l)%w*w+g[a]+r)/v|0)+(u/w|0)+p*h,g[a--]=c%v;g[a]=r}return r?++i:g.shift(),Y(e,g,i)},i.toDigits=function(e,t){var r=new q(this);return e=null!=e&&j(e,1,w,18,"precision")?0|e:null,t=null!=t&&j(t,0,8,18,d)?0|t:T,e?Z(r,e,t):r},i.toExponential=function(e,t){return K(this,null!=e&&j(e,0,w,19)?1+~~e:null,t,19)},i.toFixed=function(e,t){return K(this,null!=e&&j(e,0,w,20)?~~e+this.e+1:null,t,20)},i.toFormat=function(e,t){var r=K(this,null!=e&&j(e,0,w,21)?~~e+this.e+1:null,t,21);if(this.c){var n,i=r.split("."),o=+F.groupSize,a=+F.secondaryGroupSize,s=F.groupSeparator,u=i[0],f=i[1],c=this.s<0,h=c?u.slice(1):u,d=h.length;if(a&&(n=o,o=a,a=n,d-=n),o>0&&d>0){for(n=d%o||o,u=h.substr(0,n);n0&&(u+=s+h.slice(n)),c&&(u="-"+u)}r=f?u+F.decimalSeparator+((a=+F.fractionGroupSize)?f.replace(new RegExp("\\d{"+a+"}\\B","g"),"$&"+F.fractionGroupSeparator):f):u}return r},i.toFraction=function(e){var t,n,i,a,s,u,f,c,h,d=L,l=this,p=l.c,b=new q(o),g=n=new q(o),y=f=new q(o);if(null!=e&&(L=!1,u=new q(e),L=d,(d=u.isInt())&&!u.lt(o)||(L&&W(22,"max denominator "+(d?"out of range":"not an integer"),e),e=!d&&u.c&&Z(u,u.e+1,1).gte(o)?u:null)),!p)return l.toString();for(h=S(p),a=b.e=h.length-l.e-1,b.c[0]=v[(s=a%m)<0?m+s:s],e=!e||u.cmp(b)>0?a>0?b:g:u,s=C,C=1/0,u=new q(h),f.c[0]=0;c=r(u,b,0,1),1!=(i=n.plus(c.times(y))).cmp(e);)n=y,y=i,g=f.plus(c.times(i=g)),f=i,b=u.minus(c.times(i=b)),u=i;return i=r(e.minus(n),y,0,1),f=f.plus(i.times(g)),n=n.plus(i.times(y)),f.s=g.s=l.s,t=r(g,y,a*=2,T).minus(l).abs().cmp(r(f,n,a,T).minus(l).abs())<1?[g.toString(),y.toString()]:[f.toString(),n.toString()],C=s,t},i.toNumber=function(){var e=this;return+e||(e.s?0*e.s:NaN)},i.toPower=i.pow=function(e){var t,r,n=c(e<0?-e:+e),i=this;if(!j(e,-g,g,23,"exponent")&&(!isFinite(e)||n>g&&(e/=0)||parseFloat(e)!=e&&!(e=NaN)))return new q(Math.pow(+i,e));for(t=U?f(U/m+2):0,r=new q(o);;){if(n%2){if(!(r=r.times(i)).c)break;t&&r.c.length>t&&(r.c.length=t)}if(!(n=c(n/2)))break;i=i.times(i),t&&i.c&&i.c.length>t&&(i.c.length=t)}return e<0&&(r=o.div(r)),t?Z(r,U,T):r},i.toPrecision=function(e,t){return K(this,null!=e&&j(e,1,w,24,"precision")?0|e:null,t,24)},i.toString=function(e){var t,r=this,n=r.s,i=r.e;return null===i?n?(t="Infinity",n<0&&(t="-"+t)):t="NaN":(t=S(r.c),t=null!=e&&j(e,2,64,25,"base")?H(I(t,i),0|e,10,n):i<=O||i>=R?k(t,i):I(t,i),n<0&&r.c[0]&&(t="-"+t)),t},i.truncated=i.trunc=function(){return Z(new q(this),this.e+1,1)},i.valueOf=i.toJSON=function(){return this.toString()},null!=t&&q.config(t),q}(),void 0===(n=function(){return o}.call(t,r,t,e))||(e.exports=n)}()},function(e,t,r){e.exports=function(e){return function(){var t=e,r=t.lib,n=r.WordArray,i=r.Hasher,o=[],a=t.algo.SHA1=i.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],s=r[3],u=r[4],f=0;f<80;f++){if(f<16)o[f]=0|e[t+f];else{var c=o[f-3]^o[f-8]^o[f-14]^o[f-16];o[f]=c<<1|c>>>31}var h=(n<<5|n>>>27)+u+o[f];h+=f<20?1518500249+(i&a|~i&s):f<40?1859775393+(i^a^s):f<60?(i&a|i&s|a&s)-1894007588:(i^a^s)-899497514,u=s,s=a,a=i<<30|i>>>2,i=n,n=h}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+s|0,r[4]=r[4]+u|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA1=i._createHelper(a),t.HmacSHA1=i._createHmacHelper(a)}(),e.SHA1}(r(4))},function(e,t,r){e.exports=function(e){!function(){var t=e,r=t.lib,n=r.Base,i=t.enc,o=i.Utf8,a=t.algo;a.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=o.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),a=this._iKey=t.clone(),s=i.words,u=a.words,f=0;f>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=n>>24&255,e[t+5]=n>>16&255,e[t+6]=n>>8&255,e[t+7]=255&n}function m(e,t,r,n,i){var o,a=0;for(o=0;o>>8)-1}function g(e,t,r,n){return m(e,t,r,n,16)}function v(e,t,r,n){return m(e,t,r,n,32)}function y(e,t,r,n){!function(e,t,r,n){for(var i,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,u=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,f=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,c=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,h=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,d=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,b=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,m=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,g=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,v=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,y=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,_=o,S=a,M=s,A=u,x=f,E=c,k=h,I=d,P=l,B=p,T=b,O=m,R=g,N=v,C=y,L=w,j=0;j<20;j+=2)_^=(i=(R^=(i=(P^=(i=(x^=(i=_+R|0)<<7|i>>>25)+_|0)<<9|i>>>23)+x|0)<<13|i>>>19)+P|0)<<18|i>>>14,E^=(i=(S^=(i=(N^=(i=(B^=(i=E+S|0)<<7|i>>>25)+E|0)<<9|i>>>23)+B|0)<<13|i>>>19)+N|0)<<18|i>>>14,T^=(i=(k^=(i=(M^=(i=(C^=(i=T+k|0)<<7|i>>>25)+T|0)<<9|i>>>23)+C|0)<<13|i>>>19)+M|0)<<18|i>>>14,L^=(i=(O^=(i=(I^=(i=(A^=(i=L+O|0)<<7|i>>>25)+L|0)<<9|i>>>23)+A|0)<<13|i>>>19)+I|0)<<18|i>>>14,_^=(i=(A^=(i=(M^=(i=(S^=(i=_+A|0)<<7|i>>>25)+_|0)<<9|i>>>23)+S|0)<<13|i>>>19)+M|0)<<18|i>>>14,E^=(i=(x^=(i=(I^=(i=(k^=(i=E+x|0)<<7|i>>>25)+E|0)<<9|i>>>23)+k|0)<<13|i>>>19)+I|0)<<18|i>>>14,T^=(i=(B^=(i=(P^=(i=(O^=(i=T+B|0)<<7|i>>>25)+T|0)<<9|i>>>23)+O|0)<<13|i>>>19)+P|0)<<18|i>>>14,L^=(i=(C^=(i=(N^=(i=(R^=(i=L+C|0)<<7|i>>>25)+L|0)<<9|i>>>23)+R|0)<<13|i>>>19)+N|0)<<18|i>>>14;_=_+o|0,S=S+a|0,M=M+s|0,A=A+u|0,x=x+f|0,E=E+c|0,k=k+h|0,I=I+d|0,P=P+l|0,B=B+p|0,T=T+b|0,O=O+m|0,R=R+g|0,N=N+v|0,C=C+y|0,L=L+w|0,e[0]=_>>>0&255,e[1]=_>>>8&255,e[2]=_>>>16&255,e[3]=_>>>24&255,e[4]=S>>>0&255,e[5]=S>>>8&255,e[6]=S>>>16&255,e[7]=S>>>24&255,e[8]=M>>>0&255,e[9]=M>>>8&255,e[10]=M>>>16&255,e[11]=M>>>24&255,e[12]=A>>>0&255,e[13]=A>>>8&255,e[14]=A>>>16&255,e[15]=A>>>24&255,e[16]=x>>>0&255,e[17]=x>>>8&255,e[18]=x>>>16&255,e[19]=x>>>24&255,e[20]=E>>>0&255,e[21]=E>>>8&255,e[22]=E>>>16&255,e[23]=E>>>24&255,e[24]=k>>>0&255,e[25]=k>>>8&255,e[26]=k>>>16&255,e[27]=k>>>24&255,e[28]=I>>>0&255,e[29]=I>>>8&255,e[30]=I>>>16&255,e[31]=I>>>24&255,e[32]=P>>>0&255,e[33]=P>>>8&255,e[34]=P>>>16&255,e[35]=P>>>24&255,e[36]=B>>>0&255,e[37]=B>>>8&255,e[38]=B>>>16&255,e[39]=B>>>24&255,e[40]=T>>>0&255,e[41]=T>>>8&255,e[42]=T>>>16&255,e[43]=T>>>24&255,e[44]=O>>>0&255,e[45]=O>>>8&255,e[46]=O>>>16&255,e[47]=O>>>24&255,e[48]=R>>>0&255,e[49]=R>>>8&255,e[50]=R>>>16&255,e[51]=R>>>24&255,e[52]=N>>>0&255,e[53]=N>>>8&255,e[54]=N>>>16&255,e[55]=N>>>24&255,e[56]=C>>>0&255,e[57]=C>>>8&255,e[58]=C>>>16&255,e[59]=C>>>24&255,e[60]=L>>>0&255,e[61]=L>>>8&255,e[62]=L>>>16&255,e[63]=L>>>24&255}(e,t,r,n)}function w(e,t,r,n){!function(e,t,r,n){for(var i,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,u=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,f=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,c=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,h=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,d=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,b=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,m=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,g=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,v=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,y=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,_=0;_<20;_+=2)o^=(i=(g^=(i=(l^=(i=(f^=(i=o+g|0)<<7|i>>>25)+o|0)<<9|i>>>23)+f|0)<<13|i>>>19)+l|0)<<18|i>>>14,c^=(i=(a^=(i=(v^=(i=(p^=(i=c+a|0)<<7|i>>>25)+c|0)<<9|i>>>23)+p|0)<<13|i>>>19)+v|0)<<18|i>>>14,b^=(i=(h^=(i=(s^=(i=(y^=(i=b+h|0)<<7|i>>>25)+b|0)<<9|i>>>23)+y|0)<<13|i>>>19)+s|0)<<18|i>>>14,w^=(i=(m^=(i=(d^=(i=(u^=(i=w+m|0)<<7|i>>>25)+w|0)<<9|i>>>23)+u|0)<<13|i>>>19)+d|0)<<18|i>>>14,o^=(i=(u^=(i=(s^=(i=(a^=(i=o+u|0)<<7|i>>>25)+o|0)<<9|i>>>23)+a|0)<<13|i>>>19)+s|0)<<18|i>>>14,c^=(i=(f^=(i=(d^=(i=(h^=(i=c+f|0)<<7|i>>>25)+c|0)<<9|i>>>23)+h|0)<<13|i>>>19)+d|0)<<18|i>>>14,b^=(i=(p^=(i=(l^=(i=(m^=(i=b+p|0)<<7|i>>>25)+b|0)<<9|i>>>23)+m|0)<<13|i>>>19)+l|0)<<18|i>>>14,w^=(i=(y^=(i=(v^=(i=(g^=(i=w+y|0)<<7|i>>>25)+w|0)<<9|i>>>23)+g|0)<<13|i>>>19)+v|0)<<18|i>>>14;e[0]=o>>>0&255,e[1]=o>>>8&255,e[2]=o>>>16&255,e[3]=o>>>24&255,e[4]=c>>>0&255,e[5]=c>>>8&255,e[6]=c>>>16&255,e[7]=c>>>24&255,e[8]=b>>>0&255,e[9]=b>>>8&255,e[10]=b>>>16&255,e[11]=b>>>24&255,e[12]=w>>>0&255,e[13]=w>>>8&255,e[14]=w>>>16&255,e[15]=w>>>24&255,e[16]=h>>>0&255,e[17]=h>>>8&255,e[18]=h>>>16&255,e[19]=h>>>24&255,e[20]=d>>>0&255,e[21]=d>>>8&255,e[22]=d>>>16&255,e[23]=d>>>24&255,e[24]=l>>>0&255,e[25]=l>>>8&255,e[26]=l>>>16&255,e[27]=l>>>24&255,e[28]=p>>>0&255,e[29]=p>>>8&255,e[30]=p>>>16&255,e[31]=p>>>24&255}(e,t,r,n)}var _=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function S(e,t,r,n,i,o,a){var s,u,f=new Uint8Array(16),c=new Uint8Array(64);for(u=0;u<16;u++)f[u]=0;for(u=0;u<8;u++)f[u]=o[u];for(;i>=64;){for(y(c,f,a,_),u=0;u<64;u++)e[t+u]=r[n+u]^c[u];for(s=1,u=8;u<16;u++)s=s+(255&f[u])|0,f[u]=255&s,s>>>=8;i-=64,t+=64,n+=64}if(i>0)for(y(c,f,a,_),u=0;u=64;){for(y(u,s,i,_),a=0;a<64;a++)e[t+a]=u[a];for(o=1,a=8;a<16;a++)o=o+(255&s[a])|0,s[a]=255&o,o>>>=8;r-=64,t+=64}if(r>0)for(y(u,s,i,_),a=0;a>>13|r<<3),n=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|n<<6),i=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(n>>>7|i<<9),o=255&e[8]|(255&e[9])<<8,this.r[4]=255&(i>>>4|o<<12),this.r[5]=o>>>1&8190,a=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(o>>>14|a<<2),s=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(a>>>11|s<<5),u=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(s>>>8|u<<8),this.r[9]=u>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function k(e,t,r,n,i,o){var a=new E(o);return a.update(r,n,i),a.finish(e,t),0}function I(e,t,r,n,i,o){var a=new Uint8Array(16);return k(a,0,r,n,i,o),g(e,t,a,0)}function P(e,t,r,n,i){var o;if(r<32)return-1;for(x(e,0,t,0,r,n,i),k(e,16,e,32,r-32,e),o=0;o<16;o++)e[o]=0;return 0}function B(e,t,r,n,i){var o,a=new Uint8Array(32);if(r<32)return-1;if(A(a,0,32,n,i),0!==I(t,16,t,32,r-32,a))return-1;for(x(e,0,t,0,r,n,i),o=0;o<32;o++)e[o]=0;return 0}function T(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function O(e){var t,r,n=1;for(t=0;t<16;t++)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function R(e,t,r){for(var n,i=~(r-1),o=0;o<16;o++)n=i&(e[o]^t[o]),e[o]^=n,t[o]^=n}function N(e,t){var r,i,o,a=n(),s=n();for(r=0;r<16;r++)s[r]=t[r];for(O(s),O(s),O(s),i=0;i<2;i++){for(a[0]=s[0]-65517,r=1;r<15;r++)a[r]=s[r]-65535-(a[r-1]>>16&1),a[r-1]&=65535;a[15]=s[15]-32767-(a[14]>>16&1),o=a[15]>>16&1,a[14]&=65535,R(s,a,1-o)}for(r=0;r<16;r++)e[2*r]=255&s[r],e[2*r+1]=s[r]>>8}function C(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return N(r,e),N(n,t),v(r,0,n,0)}function L(e){var t=new Uint8Array(32);return N(t,e),1&t[0]}function j(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function z(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]+r[n]}function D(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]-r[n]}function U(e,t,r){var n,i,o=0,a=0,s=0,u=0,f=0,c=0,h=0,d=0,l=0,p=0,b=0,m=0,g=0,v=0,y=0,w=0,_=0,S=0,M=0,A=0,x=0,E=0,k=0,I=0,P=0,B=0,T=0,O=0,R=0,N=0,C=0,L=r[0],j=r[1],z=r[2],D=r[3],U=r[4],F=r[5],q=r[6],H=r[7],K=r[8],V=r[9],G=r[10],Y=r[11],W=r[12],Z=r[13],X=r[14],J=r[15];o+=(n=t[0])*L,a+=n*j,s+=n*z,u+=n*D,f+=n*U,c+=n*F,h+=n*q,d+=n*H,l+=n*K,p+=n*V,b+=n*G,m+=n*Y,g+=n*W,v+=n*Z,y+=n*X,w+=n*J,a+=(n=t[1])*L,s+=n*j,u+=n*z,f+=n*D,c+=n*U,h+=n*F,d+=n*q,l+=n*H,p+=n*K,b+=n*V,m+=n*G,g+=n*Y,v+=n*W,y+=n*Z,w+=n*X,_+=n*J,s+=(n=t[2])*L,u+=n*j,f+=n*z,c+=n*D,h+=n*U,d+=n*F,l+=n*q,p+=n*H,b+=n*K,m+=n*V,g+=n*G,v+=n*Y,y+=n*W,w+=n*Z,_+=n*X,S+=n*J,u+=(n=t[3])*L,f+=n*j,c+=n*z,h+=n*D,d+=n*U,l+=n*F,p+=n*q,b+=n*H,m+=n*K,g+=n*V,v+=n*G,y+=n*Y,w+=n*W,_+=n*Z,S+=n*X,M+=n*J,f+=(n=t[4])*L,c+=n*j,h+=n*z,d+=n*D,l+=n*U,p+=n*F,b+=n*q,m+=n*H,g+=n*K,v+=n*V,y+=n*G,w+=n*Y,_+=n*W,S+=n*Z,M+=n*X,A+=n*J,c+=(n=t[5])*L,h+=n*j,d+=n*z,l+=n*D,p+=n*U,b+=n*F,m+=n*q,g+=n*H,v+=n*K,y+=n*V,w+=n*G,_+=n*Y,S+=n*W,M+=n*Z,A+=n*X,x+=n*J,h+=(n=t[6])*L,d+=n*j,l+=n*z,p+=n*D,b+=n*U,m+=n*F,g+=n*q,v+=n*H,y+=n*K,w+=n*V,_+=n*G,S+=n*Y,M+=n*W,A+=n*Z,x+=n*X,E+=n*J,d+=(n=t[7])*L,l+=n*j,p+=n*z,b+=n*D,m+=n*U,g+=n*F,v+=n*q,y+=n*H,w+=n*K,_+=n*V,S+=n*G,M+=n*Y,A+=n*W,x+=n*Z,E+=n*X,k+=n*J,l+=(n=t[8])*L,p+=n*j,b+=n*z,m+=n*D,g+=n*U,v+=n*F,y+=n*q,w+=n*H,_+=n*K,S+=n*V,M+=n*G,A+=n*Y,x+=n*W,E+=n*Z,k+=n*X,I+=n*J,p+=(n=t[9])*L,b+=n*j,m+=n*z,g+=n*D,v+=n*U,y+=n*F,w+=n*q,_+=n*H,S+=n*K,M+=n*V,A+=n*G,x+=n*Y,E+=n*W,k+=n*Z,I+=n*X,P+=n*J,b+=(n=t[10])*L,m+=n*j,g+=n*z,v+=n*D,y+=n*U,w+=n*F,_+=n*q,S+=n*H,M+=n*K,A+=n*V,x+=n*G,E+=n*Y,k+=n*W,I+=n*Z,P+=n*X,B+=n*J,m+=(n=t[11])*L,g+=n*j,v+=n*z,y+=n*D,w+=n*U,_+=n*F,S+=n*q,M+=n*H,A+=n*K,x+=n*V,E+=n*G,k+=n*Y,I+=n*W,P+=n*Z,B+=n*X,T+=n*J,g+=(n=t[12])*L,v+=n*j,y+=n*z,w+=n*D,_+=n*U,S+=n*F,M+=n*q,A+=n*H,x+=n*K,E+=n*V,k+=n*G,I+=n*Y,P+=n*W,B+=n*Z,T+=n*X,O+=n*J,v+=(n=t[13])*L,y+=n*j,w+=n*z,_+=n*D,S+=n*U,M+=n*F,A+=n*q,x+=n*H,E+=n*K,k+=n*V,I+=n*G,P+=n*Y,B+=n*W,T+=n*Z,O+=n*X,R+=n*J,y+=(n=t[14])*L,w+=n*j,_+=n*z,S+=n*D,M+=n*U,A+=n*F,x+=n*q,E+=n*H,k+=n*K,I+=n*V,P+=n*G,B+=n*Y,T+=n*W,O+=n*Z,R+=n*X,N+=n*J,w+=(n=t[15])*L,a+=38*(S+=n*z),s+=38*(M+=n*D),u+=38*(A+=n*U),f+=38*(x+=n*F),c+=38*(E+=n*q),h+=38*(k+=n*H),d+=38*(I+=n*K),l+=38*(P+=n*V),p+=38*(B+=n*G),b+=38*(T+=n*Y),m+=38*(O+=n*W),g+=38*(R+=n*Z),v+=38*(N+=n*X),y+=38*(C+=n*J),o=(n=(o+=38*(_+=n*j))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o=(n=(o+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o+=i-1+37*(i-1),e[0]=o,e[1]=a,e[2]=s,e[3]=u,e[4]=f,e[5]=c,e[6]=h,e[7]=d,e[8]=l,e[9]=p,e[10]=b,e[11]=m,e[12]=g,e[13]=v,e[14]=y,e[15]=w}function F(e,t){U(e,t,t)}function q(e,t){var r,i=n();for(r=0;r<16;r++)i[r]=t[r];for(r=253;r>=0;r--)F(i,i),2!==r&&4!==r&&U(i,i,t);for(r=0;r<16;r++)e[r]=i[r]}function H(e,t,r){var i,o,a=new Uint8Array(32),s=new Float64Array(80),u=n(),c=n(),h=n(),d=n(),l=n(),p=n();for(o=0;o<31;o++)a[o]=t[o];for(a[31]=127&t[31]|64,a[0]&=248,j(s,r),o=0;o<16;o++)c[o]=s[o],d[o]=u[o]=h[o]=0;for(u[0]=d[0]=1,o=254;o>=0;--o)R(u,c,i=a[o>>>3]>>>(7&o)&1),R(h,d,i),z(l,u,h),D(u,u,h),z(h,c,d),D(c,c,d),F(d,l),F(p,u),U(u,h,u),U(h,c,l),z(l,u,h),D(u,u,h),F(c,u),D(h,d,p),U(u,h,f),z(u,u,d),U(h,h,u),U(u,d,p),U(d,c,s),F(c,l),R(u,c,i),R(h,d,i);for(o=0;o<16;o++)s[o+16]=u[o],s[o+32]=h[o],s[o+48]=c[o],s[o+64]=d[o];var b=s.subarray(32),m=s.subarray(16);return q(b,b),U(m,m,b),N(e,m),0}function K(e,t){return H(e,t,a)}function V(e,t){return i(t,32),K(e,t)}function G(e,t,r){var n=new Uint8Array(32);return H(n,r,t),w(e,o,n,_)}E.prototype.blocks=function(e,t,r){for(var n,i,o,a,s,u,f,c,h,d,l,p,b,m,g,v,y,w,_,S=this.fin?0:2048,M=this.h[0],A=this.h[1],x=this.h[2],E=this.h[3],k=this.h[4],I=this.h[5],P=this.h[6],B=this.h[7],T=this.h[8],O=this.h[9],R=this.r[0],N=this.r[1],C=this.r[2],L=this.r[3],j=this.r[4],z=this.r[5],D=this.r[6],U=this.r[7],F=this.r[8],q=this.r[9];r>=16;)M+=8191&(n=255&e[t+0]|(255&e[t+1])<<8),A+=8191&(n>>>13|(i=255&e[t+2]|(255&e[t+3])<<8)<<3),x+=8191&(i>>>10|(o=255&e[t+4]|(255&e[t+5])<<8)<<6),E+=8191&(o>>>7|(a=255&e[t+6]|(255&e[t+7])<<8)<<9),k+=8191&(a>>>4|(s=255&e[t+8]|(255&e[t+9])<<8)<<12),I+=s>>>1&8191,P+=8191&(s>>>14|(u=255&e[t+10]|(255&e[t+11])<<8)<<2),B+=8191&(u>>>11|(f=255&e[t+12]|(255&e[t+13])<<8)<<5),c=255&e[t+14]|(255&e[t+15])<<8,d=h=0,d+=M*R,d+=A*(5*q),d+=x*(5*F),d+=E*(5*U),h=(d+=k*(5*D))>>>13,d&=8191,d+=I*(5*z),d+=P*(5*j),d+=B*(5*L),d+=(T+=8191&(f>>>8|c<<8))*(5*C),l=h+=(d+=(O+=c>>>5|S)*(5*N))>>>13,l+=M*N,l+=A*R,l+=x*(5*q),l+=E*(5*F),h=(l+=k*(5*U))>>>13,l&=8191,l+=I*(5*D),l+=P*(5*z),l+=B*(5*j),l+=T*(5*L),h+=(l+=O*(5*C))>>>13,l&=8191,p=h,p+=M*C,p+=A*N,p+=x*R,p+=E*(5*q),h=(p+=k*(5*F))>>>13,p&=8191,p+=I*(5*U),p+=P*(5*D),p+=B*(5*z),p+=T*(5*j),b=h+=(p+=O*(5*L))>>>13,b+=M*L,b+=A*C,b+=x*N,b+=E*R,h=(b+=k*(5*q))>>>13,b&=8191,b+=I*(5*F),b+=P*(5*U),b+=B*(5*D),b+=T*(5*z),m=h+=(b+=O*(5*j))>>>13,m+=M*j,m+=A*L,m+=x*C,m+=E*N,h=(m+=k*R)>>>13,m&=8191,m+=I*(5*q),m+=P*(5*F),m+=B*(5*U),m+=T*(5*D),g=h+=(m+=O*(5*z))>>>13,g+=M*z,g+=A*j,g+=x*L,g+=E*C,h=(g+=k*N)>>>13,g&=8191,g+=I*R,g+=P*(5*q),g+=B*(5*F),g+=T*(5*U),v=h+=(g+=O*(5*D))>>>13,v+=M*D,v+=A*z,v+=x*j,v+=E*L,h=(v+=k*C)>>>13,v&=8191,v+=I*N,v+=P*R,v+=B*(5*q),v+=T*(5*F),y=h+=(v+=O*(5*U))>>>13,y+=M*U,y+=A*D,y+=x*z,y+=E*j,h=(y+=k*L)>>>13,y&=8191,y+=I*C,y+=P*N,y+=B*R,y+=T*(5*q),w=h+=(y+=O*(5*F))>>>13,w+=M*F,w+=A*U,w+=x*D,w+=E*z,h=(w+=k*j)>>>13,w&=8191,w+=I*L,w+=P*C,w+=B*N,w+=T*R,_=h+=(w+=O*(5*q))>>>13,_+=M*q,_+=A*F,_+=x*U,_+=E*D,h=(_+=k*z)>>>13,_&=8191,_+=I*j,_+=P*L,_+=B*C,_+=T*N,M=d=8191&(h=(h=((h+=(_+=O*R)>>>13)<<2)+h|0)+(d&=8191)|0),A=l+=h>>>=13,x=p&=8191,E=b&=8191,k=m&=8191,I=g&=8191,P=v&=8191,B=y&=8191,T=w&=8191,O=_&=8191,t+=16,r-=16;this.h[0]=M,this.h[1]=A,this.h[2]=x,this.h[3]=E,this.h[4]=k,this.h[5]=I,this.h[6]=P,this.h[7]=B,this.h[8]=T,this.h[9]=O},E.prototype.finish=function(e,t){var r,n,i,o,a=new Uint16Array(10);if(this.leftover){for(o=this.leftover,this.buffer[o++]=1;o<16;o++)this.buffer[o]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,o=2;o<10;o++)this.h[o]+=r,r=this.h[o]>>>13,this.h[o]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,a[0]=this.h[0]+5,r=a[0]>>>13,a[0]&=8191,o=1;o<10;o++)a[o]=this.h[o]+r,r=a[o]>>>13,a[o]&=8191;for(a[9]-=8192,n=(a[9]>>>15)-1,o=0;o<10;o++)a[o]&=n;for(n=~n,o=0;o<10;o++)this.h[o]=this.h[o]&n|a[o];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),i=this.h[0]+this.pad[0],this.h[0]=65535&i,o=1;o<8;o++)i=(this.h[o]+this.pad[o]|0)+(i>>>16)|0,this.h[o]=65535&i;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},E.prototype.update=function(e,t,r){var n,i;if(this.leftover){for((i=16-this.leftover)>r&&(i=r),n=0;n=16&&(i=r-r%16,this.blocks(e,t,i),t+=i,r-=i),r){for(n=0;n=128;){for(S=0;S<16;S++)M=8*S+W,B[S]=r[M+0]<<24|r[M+1]<<16|r[M+2]<<8|r[M+3],T[S]=r[M+4]<<24|r[M+5]<<16|r[M+6]<<8|r[M+7];for(S=0;S<80;S++)if(i=O,o=R,a=N,s=C,u=L,f=j,c=z,h=D,d=U,l=F,p=q,b=H,m=K,g=V,v=G,y=Y,E=65535&(x=Y),k=x>>>16,I=65535&(A=D),P=A>>>16,E+=65535&(x=(K>>>14|L<<18)^(K>>>18|L<<14)^(L>>>9|K<<23)),k+=x>>>16,I+=65535&(A=(L>>>14|K<<18)^(L>>>18|K<<14)^(K>>>9|L<<23)),P+=A>>>16,E+=65535&(x=K&V^~K&G),k+=x>>>16,I+=65535&(A=L&j^~L&z),P+=A>>>16,A=Z[2*S],E+=65535&(x=Z[2*S+1]),k+=x>>>16,I+=65535&A,P+=A>>>16,A=B[S%16],k+=(x=T[S%16])>>>16,I+=65535&A,P+=A>>>16,I+=(k+=(E+=65535&x)>>>16)>>>16,E=65535&(x=_=65535&E|k<<16),k=x>>>16,I=65535&(A=w=65535&I|(P+=I>>>16)<<16),P=A>>>16,E+=65535&(x=(U>>>28|O<<4)^(O>>>2|U<<30)^(O>>>7|U<<25)),k+=x>>>16,I+=65535&(A=(O>>>28|U<<4)^(U>>>2|O<<30)^(U>>>7|O<<25)),P+=A>>>16,k+=(x=U&F^U&q^F&q)>>>16,I+=65535&(A=O&R^O&N^R&N),P+=A>>>16,h=65535&(I+=(k+=(E+=65535&x)>>>16)>>>16)|(P+=I>>>16)<<16,y=65535&E|k<<16,E=65535&(x=b),k=x>>>16,I=65535&(A=s),P=A>>>16,k+=(x=_)>>>16,I+=65535&(A=w),P+=A>>>16,R=i,N=o,C=a,L=s=65535&(I+=(k+=(E+=65535&x)>>>16)>>>16)|(P+=I>>>16)<<16,j=u,z=f,D=c,O=h,F=d,q=l,H=p,K=b=65535&E|k<<16,V=m,G=g,Y=v,U=y,S%16==15)for(M=0;M<16;M++)A=B[M],E=65535&(x=T[M]),k=x>>>16,I=65535&A,P=A>>>16,A=B[(M+9)%16],E+=65535&(x=T[(M+9)%16]),k+=x>>>16,I+=65535&A,P+=A>>>16,w=B[(M+1)%16],E+=65535&(x=((_=T[(M+1)%16])>>>1|w<<31)^(_>>>8|w<<24)^(_>>>7|w<<25)),k+=x>>>16,I+=65535&(A=(w>>>1|_<<31)^(w>>>8|_<<24)^w>>>7),P+=A>>>16,w=B[(M+14)%16],k+=(x=((_=T[(M+14)%16])>>>19|w<<13)^(w>>>29|_<<3)^(_>>>6|w<<26))>>>16,I+=65535&(A=(w>>>19|_<<13)^(_>>>29|w<<3)^w>>>6),P+=A>>>16,P+=(I+=(k+=(E+=65535&x)>>>16)>>>16)>>>16,B[M]=65535&I|P<<16,T[M]=65535&E|k<<16;E=65535&(x=U),k=x>>>16,I=65535&(A=O),P=A>>>16,A=e[0],k+=(x=t[0])>>>16,I+=65535&A,P+=A>>>16,P+=(I+=(k+=(E+=65535&x)>>>16)>>>16)>>>16,e[0]=O=65535&I|P<<16,t[0]=U=65535&E|k<<16,E=65535&(x=F),k=x>>>16,I=65535&(A=R),P=A>>>16,A=e[1],k+=(x=t[1])>>>16,I+=65535&A,P+=A>>>16,P+=(I+=(k+=(E+=65535&x)>>>16)>>>16)>>>16,e[1]=R=65535&I|P<<16,t[1]=F=65535&E|k<<16,E=65535&(x=q),k=x>>>16,I=65535&(A=N),P=A>>>16,A=e[2],k+=(x=t[2])>>>16,I+=65535&A,P+=A>>>16,P+=(I+=(k+=(E+=65535&x)>>>16)>>>16)>>>16,e[2]=N=65535&I|P<<16,t[2]=q=65535&E|k<<16,E=65535&(x=H),k=x>>>16,I=65535&(A=C),P=A>>>16,A=e[3],k+=(x=t[3])>>>16,I+=65535&A,P+=A>>>16,P+=(I+=(k+=(E+=65535&x)>>>16)>>>16)>>>16,e[3]=C=65535&I|P<<16,t[3]=H=65535&E|k<<16,E=65535&(x=K),k=x>>>16,I=65535&(A=L),P=A>>>16,A=e[4],k+=(x=t[4])>>>16,I+=65535&A,P+=A>>>16,P+=(I+=(k+=(E+=65535&x)>>>16)>>>16)>>>16,e[4]=L=65535&I|P<<16,t[4]=K=65535&E|k<<16,E=65535&(x=V),k=x>>>16,I=65535&(A=j),P=A>>>16,A=e[5],k+=(x=t[5])>>>16,I+=65535&A,P+=A>>>16,P+=(I+=(k+=(E+=65535&x)>>>16)>>>16)>>>16,e[5]=j=65535&I|P<<16,t[5]=V=65535&E|k<<16,E=65535&(x=G),k=x>>>16,I=65535&(A=z),P=A>>>16,A=e[6],k+=(x=t[6])>>>16,I+=65535&A,P+=A>>>16,P+=(I+=(k+=(E+=65535&x)>>>16)>>>16)>>>16,e[6]=z=65535&I|P<<16,t[6]=G=65535&E|k<<16,E=65535&(x=Y),k=x>>>16,I=65535&(A=D),P=A>>>16,A=e[7],k+=(x=t[7])>>>16,I+=65535&A,P+=A>>>16,P+=(I+=(k+=(E+=65535&x)>>>16)>>>16)>>>16,e[7]=D=65535&I|P<<16,t[7]=Y=65535&E|k<<16,W+=128,n-=128}return n}function J(e,t,r){var n,i=new Int32Array(8),o=new Int32Array(8),a=new Uint8Array(256),s=r;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,o[0]=4089235720,o[1]=2227873595,o[2]=4271175723,o[3]=1595750129,o[4]=2917565137,o[5]=725511199,o[6]=4215389547,o[7]=327033209,X(i,o,t,r),r%=128,n=0;n=0;--i)Q(e,t,n=r[i/8|0]>>(7&i)&1),$(t,e),$(e,e),Q(e,t,n)}function re(e,t){var r=[n(),n(),n(),n()];T(r[0],d),T(r[1],l),T(r[2],u),U(r[3],d,l),te(e,r,t)}function ne(e,t,r){var o,a=new Uint8Array(64),s=[n(),n(),n(),n()];for(r||i(t,32),J(a,t,32),a[0]&=248,a[31]&=127,a[31]|=64,re(s,a),ee(e,s),o=0;o<32;o++)t[o+32]=e[o];return 0}var ie=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function oe(e,t){var r,n,i,o;for(n=63;n>=32;--n){for(r=0,i=n-32,o=n-12;i>8,t[i]-=256*r;t[i]+=r,t[n]=0}for(r=0,i=0;i<32;i++)t[i]+=r-(t[31]>>4)*ie[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=r*ie[i];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function ae(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;oe(e,r)}function se(e,t,r,i){var o,a,s=new Uint8Array(64),u=new Uint8Array(64),f=new Uint8Array(64),c=new Float64Array(64),h=[n(),n(),n(),n()];J(s,i,32),s[0]&=248,s[31]&=127,s[31]|=64;var d=r+64;for(o=0;o=0;r--)F(i,i),1!==r&&U(i,i,t);for(r=0;r<16;r++)e[r]=i[r]}(r,r),U(r,r,o),U(r,r,a),U(r,r,a),U(e[0],r,a),F(i,e[0]),U(i,i,a),C(i,o)&&U(e[0],e[0],p),F(i,e[0]),U(i,i,a),C(i,o)?-1:(L(e[0])===t[31]>>7&&D(e[0],s,e[0]),U(e[3],e[0],e[1]),0)}function fe(e,t,r,i){var o,a=new Uint8Array(32),s=new Uint8Array(64),u=[n(),n(),n(),n()],f=[n(),n(),n(),n()];if(-1,r<64)return-1;if(ue(f,i))return-1;for(o=0;o=0},e.sign.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(64);return ne(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(me(e),64!==e.length)throw new Error("bad secret key size");for(var t=new Uint8Array(32),r=0;r=0&&e<=16,"Invalid Argument: n must be between 0 and 16"),0===e?s("OP_0"):new s(s.map.OP_1+e-1)},s.map={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SUBSTR:127,OP_LEFT:128,OP_RIGHT:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP1:176,OP_NOP2:177,OP_NOP3:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255},s.reverseMap=[],s.map)s.reverseMap[s.map[u]]=u;n.extend(s,s.map),s.isSmallIntOp=function(e){return e instanceof s&&(e=e.toNumber()),e===s.map.OP_0||e>=s.map.OP_1&&e<=s.map.OP_16},s.prototype.inspect=function(){return""},e.exports=s}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(t){var n=r(5),i=r(6),o=r(0),a=t.compare||r(435),s=r(19),u=r(8),f=r(9),c=r(32),h=r(28),d=r(13),l=r(22),p=r(33),b=r(43),m=r(178),g=r(105),v=g.PublicKeyHash,y=g.PublicKey,w=g.MultiSigScriptHash,_=g.MultiSig,S=r(34),M=r(23),A=r(78),x=r(12);function E(e){if(!(this instanceof E))return new E(e);if(this.inputs=[],this.outputs=[],this._inputAmount=void 0,this._outputAmount=void 0,e){if(e instanceof E)return E.shallowCopy(e);if(f.isHexa(e))this.fromString(e);else if(u.isBuffer(e))this.fromBuffer(e);else{if(!n.isObject(e))throw new s.InvalidArgument("Must provide an object or string to deserialize a transaction");this.fromObject(e)}}else this._newTransaction()}E.DUST_AMOUNT=546,E.FEE_SECURITY_MARGIN=150,E.MAX_MONEY=21e14,E.NLOCKTIME_BLOCKHEIGHT_LIMIT=5e8,E.NLOCKTIME_MAX_VALUE=4294967295,E.FEE_PER_KB=1e5,E.CHANGE_OUTPUT_MAX_SIZE=62,E.MAXIMUM_EXTRA_SIZE=26,E.shallowCopy=function(e){return new E(e.toBuffer())};var k={configurable:!1,enumerable:!0,get:function(){return new c(this._getHash()).readReverse().toString("hex")}};Object.defineProperty(E.prototype,"hash",k),Object.defineProperty(E.prototype,"id",k);var I={configurable:!1,enumerable:!0,get:function(){return this._getInputAmount()}};Object.defineProperty(E.prototype,"inputAmount",I),I.get=function(){return this._getOutputAmount()},Object.defineProperty(E.prototype,"outputAmount",I),E.prototype._getHash=function(){return d.sha256sha256(this.toBuffer())},E.prototype.serialize=function(e){return!0===e||e&&e.disableAll?this.uncheckedSerialize():this.checkedSerialize(e)},E.prototype.uncheckedSerialize=E.prototype.toString=function(){return this.toBuffer().toString("hex")},E.prototype.checkedSerialize=function(e){var t=this.getSerializationError(e);if(t)throw t.message+=" - For more information please see: https://bitcore.io/api/lib/transaction#serialization-checks",t;return this.uncheckedSerialize()},E.prototype.invalidSatoshis=function(){for(var e=!1,t=0;tr)return this._missingChange()?new s.Transaction.ChangeAddressMissing("Fee is too large and no change address was provided"):new s.Transaction.FeeError.TooLarge("expected less than "+r+" but got "+t)}if(!e.disableSmallFees){var i=Math.ceil(this._estimateFee()/E.FEE_SECURITY_MARGIN);if(t"},E.prototype.toBuffer=function(){var e=new h;return this.toBufferWriter(e).toBuffer()},E.prototype.toBufferWriter=function(e){return e.writeInt32LE(this.version),e.writeVarintNum(this.inputs.length),n.each(this.inputs,function(t){t.toBufferWriter(e)}),e.writeVarintNum(this.outputs.length),n.each(this.outputs,function(t){t.toBufferWriter(e)}),e.writeUInt32LE(this.nLockTime),e},E.prototype.fromBuffer=function(e){var t=new c(e);return this.fromBufferReader(t)},E.prototype.fromBufferReader=function(e){var t,r,n;for(i.checkArgument(!e.finished(),"No transaction data received"),this.version=e.readInt32LE(),r=e.readVarintNum(),t=0;t=E.NLOCKTIME_BLOCKHEIGHT_LIMIT)throw new s.Transaction.BlockHeightTooHigh;if(e<0)throw new s.Transaction.NLockTimeOutOfRange;for(var t=0;t0?(this._changeIndex=this.outputs.length,this._addOutput(new S({script:this._changeScript,satoshis:e}))):this._changeIndex=void 0}},E.prototype.getFee=function(){return this.isCoinbase()?0:n.isUndefined(this._fee)?this._changeScript?this._estimateFee():this._getUnspentValue():this._fee},E.prototype._estimateFee=function(){var e=this._estimateSize(),t=this._getUnspentValue();return E._estimateFee(e,t,this._feePerKb)},E.prototype._getUnspentValue=function(){return this._getInputAmount()-this._getOutputAmount()},E.prototype._clearSignatures=function(){n.each(this.inputs,function(e){e.clearSignatures()})},E._estimateFee=function(e,t,r){return t>Math.ceil(e/1e3)*(r||E.FEE_PER_KB)&&(e+=E.CHANGE_OUTPUT_MAX_SIZE),Math.ceil(e/1e3)*(r||E.FEE_PER_KB)},E.prototype._estimateSize=function(){var e=E.MAXIMUM_EXTRA_SIZE;return n.each(this.inputs,function(t){e+=t._estimateSize()}),n.each(this.outputs,function(t){e+=t.script.toBuffer().length+9}),e},E.prototype._removeOutput=function(e){var t=this.outputs[e];this.outputs=n.without(this.outputs,t),this._outputAmount=void 0},E.prototype.removeOutput=function(e){this._removeOutput(e),this._updateChangeOutput()},E.prototype.sort=function(){return this.sortInputs(function(e){var t=Array.prototype.concat.apply([],e);return t.sort(function(e,t){return a(e.prevTxId,t.prevTxId)||e.outputIndex-t.outputIndex}),t}),this.sortOutputs(function(e){var t=Array.prototype.concat.apply([],e);return t.sort(function(e,t){return e.satoshis-t.satoshis||a(e.script.toBuffer(),t.script.toBuffer())}),t}),this},E.prototype.shuffleOutputs=function(){return this.sortOutputs(n.shuffle)},E.prototype.sortOutputs=function(e){var t=e(this.outputs);return this._newOutputOrder(t)},E.prototype.sortInputs=function(e){return this.inputs=e(this.inputs),this._clearSignatures(),this},E.prototype._newOutputOrder=function(e){if(this.outputs.length!==e.length||0!==n.difference(this.outputs,e).length)throw new s.Transaction.InvalidSorting;if(!n.isUndefined(this._changeIndex)){var t=this.outputs[this._changeIndex];this._changeIndex=n.findIndex(e,t)}return this.outputs=e,this},E.prototype.removeInput=function(e,t){var r;if((r=!t&&n.isNumber(e)?e:n.findIndex(this.inputs,function(r){return r.prevTxId.toString("hex")===e&&r.outputIndex===t}))<0||r>=this.inputs.length)throw new s.Transaction.InvalidIndex(r,this.inputs.length);var i=this.inputs[r];this.inputs=n.without(this.inputs,i),this._inputAmount=void 0,this._updateChangeOutput()},E.prototype.sign=function(e,t){i.checkState(this.hasAllUtxoInfo(),"Not all utxo information is available to sign the transaction.");var r=this;return n.isArray(e)?(n.each(e,function(e){r.sign(e,t)}),this):(n.each(this.getSignatures(e,t),function(e){r.applySignature(e)}),this)},E.prototype.getSignatures=function(e,t){e=new A(e),t=t||l.SIGHASH_ALL;var r=this,i=[],o=d.sha256ripemd160(e.publicKey.toBuffer());return n.each(this.inputs,function(a,s){n.each(a.getSignatures(r,e,s,t,o),function(e){i.push(e)})}),i},E.prototype.applySignature=function(e){return this.inputs[e.inputIndex].addSignature(this,e),this},E.prototype.isFullySigned=function(){return n.each(this.inputs,function(e){if(e.isFullySigned===g.prototype.isFullySigned)throw new s.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction")}),n.every(n.map(this.inputs,function(e){return e.isFullySigned()}))},E.prototype.isValidSignature=function(e){if(this.inputs[e.inputIndex].isValidSignature===g.prototype.isValidSignature)throw new s.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction");return this.inputs[e.inputIndex].isValidSignature(this,e)},E.prototype.verifySignature=function(e,t,r,n){return p.verify(this,e,t,r,n)},E.prototype.verify=function(){if(0===this.inputs.length)return"transaction txins empty";if(0===this.outputs.length)return"transaction txouts empty";for(var e=new x(0),t=0;t1e6)return"transaction over the maximum block size";var i={};for(t=0;t100)return"coinbase transaction script size invalid"}else for(t=0;t=g.MAXINT-1&&(t.sequenceNumber=g.DEFAULT_RBF_SEQNUMBER)}return this},e.exports=E}).call(this,r(0).Buffer)},function(e,t,r){e.exports=r(62),e.exports.PublicKey=r(436),e.exports.PublicKeyHash=r(437),e.exports.MultiSig=r(438),e.exports.MultiSigScriptHash=r(439)},function(e,t,r){"use strict";var n=r(5),i=r(19),o=r(6),a={BTC:[1e8,8],mBTC:[1e5,5],uBTC:[100,2],bits:[100,2],satoshis:[1,0]};function s(e,t){if(!(this instanceof s))return new s(e,t);if(n.isNumber(t)){if(t<=0)throw new i.Unit.InvalidRate(t);e/=t,t=s.BTC}this._value=this._from(e,t);var r=this;Object.keys(a).forEach(function(e){Object.defineProperty(r,e,{get:function(){return r.to(e)},enumerable:!0})})}Object.keys(a).forEach(function(e){s[e]=e}),s.fromObject=function(e){return o.checkArgument(n.isObject(e),"Argument is expected to be an object"),new s(e.amount,e.code)},s.fromBTC=function(e){return new s(e,s.BTC)},s.fromMillis=s.fromMilis=function(e){return new s(e,s.mBTC)},s.fromMicros=s.fromBits=function(e){return new s(e,s.bits)},s.fromSatoshis=function(e){return new s(e,s.satoshis)},s.fromFiat=function(e,t){return new s(e,t)},s.prototype._from=function(e,t){if(!a[t])throw new i.Unit.UnknownCode(t);return parseInt((e*a[t][0]).toFixed())},s.prototype.to=function(e){if(n.isNumber(e)){if(e<=0)throw new i.Unit.InvalidRate(e);return parseFloat((this.BTC*e).toFixed(2))}if(!a[e])throw new i.Unit.UnknownCode(e);var t=this._value/a[e][0];return parseFloat(t.toFixed(a[e][1]))},s.prototype.toBTC=function(){return this.to(s.BTC)},s.prototype.toMillis=s.prototype.toMilis=function(){return this.to(s.mBTC)},s.prototype.toMicros=s.prototype.toBits=function(){return this.to(s.bits)},s.prototype.toSatoshis=function(){return this.to(s.satoshis)},s.prototype.atRate=function(e){return this.to(e)},s.prototype.toString=function(){return this.satoshis+" satoshis"},s.prototype.toObject=s.prototype.toJSON=function(){return{amount:this.BTC,code:s.BTC}},s.prototype.inspect=function(){return""},e.exports=s},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){var n=r(194),i=r(109);e.exports=function(e){if("string"==typeof e||"number"==typeof e){var t=new n(1),r=String(e).toLowerCase().trim(),o="0x"===r.substr(0,2)||"-0x"===r.substr(0,3),a=i(r);if("-"===a.substr(0,1)&&(a=i(a.slice(1)),t=new n(-1,10)),!(a=""===a?"0":a).match(/^-?[0-9]+$/)&&a.match(/^[0-9A-Fa-f]+$/)||a.match(/^[a-fA-F]+$/)||!0===o&&a.match(/^[0-9A-Fa-f]+$/))return new n(a,16).mul(t);if((a.match(/^-?[0-9]+$/)||""===a)&&!1===o)return new n(a,10).mul(t)}else if("object"==typeof e&&e.toString&&!e.pop&&!e.push&&e.toString(10).match(/^-?[0-9]+$/)&&(e.mul||e.dividedToIntegerBy))return new n(e.toString(10),10);throw new Error("[number-to-bn] while converting number "+JSON.stringify(e)+" to BN.js instance, error: invalid number value. Value must be an integer, hex string, BN or BigNumber instance. Note, decimals are not supported.")}},function(e,t,r){var n=r(110);e.exports=function(e){return"string"!=typeof e?e:n(e)?e.slice(2):e}},function(e,t){e.exports=function(e){if("string"!=typeof e)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof e+", while checking isHexPrefixed.");return"0x"===e.slice(0,2)}},function(e,t,r){var n=r(18),i=r(112),o=r(108),a=r(195),s=r(113),u=function(e){return e instanceof i||e&&e.constructor&&"BN"===e.constructor.name},f=function(e){return e&&e.constructor&&"BigNumber"===e.constructor.name},c=function(e){try{return o.apply(null,arguments)}catch(t){throw new Error(t+' Given value: "'+e+'"')}},h=function(e){return!!/^(0x)?[0-9a-f]{40}$/i.test(e)&&(!(!/^(0x|0X)?[0-9a-f]{40}$/.test(e)&&!/^(0x|0X)?[0-9A-F]{40}$/.test(e))||d(e))},d=function(e){e=e.replace(/^0x/i,"");for(var t=g(e.toLowerCase()).replace(/^0x/i,""),r=0;r<40;r++)if(parseInt(t[r],16)>7&&e[r].toUpperCase()!==e[r]||parseInt(t[r],16)<=7&&e[r].toLowerCase()!==e[r])return!1;return!0},l=function(e){var t="";e=(e=(e=(e=(e=a.encode(e)).replace(/^(?:\u0000)*/,"")).split("").reverse().join("")).replace(/^(?:\u0000)*/,"")).split("").reverse().join("");for(var r=0;r>>4).toString(16)),t.push((15&e[r]).toString(16));return"0x"+t.join("")},isHex:function(e){return(n.isString(e)||n.isNumber(e))&&/^(-0x|0x)?[0-9a-f]*$/i.test(e)},isHexStrict:m,leftPad:function(e,t,r){var n=/^0x/i.test(e)||"number"==typeof e,i=t-(e=e.toString(16).replace(/^0x/i,"")).length+1>=0?t-e.length+1:0;return(n?"0x":"")+new Array(i).join(r||"0")+e},rightPad:function(e,t,r){var n=/^0x/i.test(e)||"number"==typeof e,i=t-(e=e.toString(16).replace(/^0x/i,"")).length+1>=0?t-e.length+1:0;return(n?"0x":"")+e+new Array(i).join(r||"0")},toTwosComplement:function(e){return"0x"+c(e).toTwos(256).toString(16,64)},sha3:g}},function(e,t,r){(function(e){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a=r(0).Buffer}catch(e){}function s(e,t,r){for(var n=0,i=Math.min(e.length,r),o=t;o=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function u(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=e[i]|e[i-1]<<8|e[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(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)i=s(e,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==t&&(i=s(e,t,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,f=0,c=r;c1&&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"],c=[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],h=[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(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var f=1;f>>26,h=67108863&u,d=Math.min(f,t.length-1),l=Math.max(0,f-e.length+1);l<=d;l++){var p=f-l|0;c+=(a=(i=0|e.words[p])*(o=0|t.words[l])+h)/67108864|0,h=67108863&a}r.words[f]=0|h,u=0|c}return 0!==u?r.words[f]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(e=e||10,t=0|t||1,16===e||"hex"===e){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%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=c[e],l=h[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(e);r=(p=p.idivn(l)).isZero()?b+r:f[d-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=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 e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==a),this.toArrayLike(a,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,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"===t,f=new e(o),c=this.clone();if(u){for(s=0;!c.isZero();s++)a=c.andln(255),c.iushrn(8),f[s]=a;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,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(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,l=0|a[1],p=8191&l,b=l>>>13,m=0|a[2],g=8191&m,v=m>>>13,y=0|a[3],w=8191&y,_=y>>>13,S=0|a[4],M=8191&S,A=S>>>13,x=0|a[5],E=8191&x,k=x>>>13,I=0|a[6],P=8191&I,B=I>>>13,T=0|a[7],O=8191&T,R=T>>>13,N=0|a[8],C=8191&N,L=N>>>13,j=0|a[9],z=8191&j,D=j>>>13,U=0|s[0],F=8191&U,q=U>>>13,H=0|s[1],K=8191&H,V=H>>>13,G=0|s[2],Y=8191&G,W=G>>>13,Z=0|s[3],X=8191&Z,J=Z>>>13,$=0|s[4],Q=8191&$,ee=$>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,fe=se>>>13,ce=0|s[8],he=8191&ce,de=ce>>>13,le=0|s[9],pe=8191&le,be=le>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(f+(n=Math.imul(h,F))|0)+((8191&(i=(i=Math.imul(h,q))+Math.imul(d,F)|0))<<13)|0;f=((o=Math.imul(d,q))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,q))+Math.imul(b,F)|0,o=Math.imul(b,q);var ge=(f+(n=n+Math.imul(h,K)|0)|0)+((8191&(i=(i=i+Math.imul(h,V)|0)+Math.imul(d,K)|0))<<13)|0;f=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,F),i=(i=Math.imul(g,q))+Math.imul(v,F)|0,o=Math.imul(v,q),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,V)|0;var ve=(f+(n=n+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,W)|0)+Math.imul(d,Y)|0))<<13)|0;f=((o=o+Math.imul(d,W)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,q))+Math.imul(_,F)|0,o=Math.imul(_,q),n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,V)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,W)|0;var ye=(f+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(d,X)|0))<<13)|0;f=((o=o+Math.imul(d,J)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(M,F),i=(i=Math.imul(M,q))+Math.imul(A,F)|0,o=Math.imul(A,q),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,W)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,J)|0;var we=(f+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(d,Q)|0))<<13)|0;f=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,q))+Math.imul(k,F)|0,o=Math.imul(k,q),n=n+Math.imul(M,K)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(g,X)|0,i=(i=i+Math.imul(g,J)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,J)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0;var _e=(f+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(d,re)|0))<<13)|0;f=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(P,F),i=(i=Math.imul(P,q))+Math.imul(B,F)|0,o=Math.imul(B,q),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,W)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,W)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0;var Se=(f+(n=n+Math.imul(h,oe)|0)|0)+((8191&(i=(i=i+Math.imul(h,ae)|0)+Math.imul(d,oe)|0))<<13)|0;f=((o=o+Math.imul(d,ae)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(O,F),i=(i=Math.imul(O,q))+Math.imul(R,F)|0,o=Math.imul(R,q),n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,V)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,V)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(M,X)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,J)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0;var Me=(f+(n=n+Math.imul(h,ue)|0)|0)+((8191&(i=(i=i+Math.imul(h,fe)|0)+Math.imul(d,ue)|0))<<13)|0;f=((o=o+Math.imul(d,fe)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,q))+Math.imul(L,F)|0,o=Math.imul(L,q),n=n+Math.imul(O,K)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,V)|0,n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(B,Y)|0,o=o+Math.imul(B,W)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,fe)|0;var Ae=(f+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,de)|0)+Math.imul(d,he)|0))<<13)|0;f=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(z,F),i=(i=Math.imul(z,q))+Math.imul(D,F)|0,o=Math.imul(D,q),n=n+Math.imul(C,K)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(L,K)|0,o=o+Math.imul(L,V)|0,n=n+Math.imul(O,Y)|0,i=(i=i+Math.imul(O,W)|0)+Math.imul(R,Y)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(P,X)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,J)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(M,re)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,n=n+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,fe)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,fe)|0,n=n+Math.imul(p,he)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(b,he)|0,o=o+Math.imul(b,de)|0;var xe=(f+(n=n+Math.imul(h,pe)|0)|0)+((8191&(i=(i=i+Math.imul(h,be)|0)+Math.imul(d,pe)|0))<<13)|0;f=((o=o+Math.imul(d,be)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(z,K),i=(i=Math.imul(z,V))+Math.imul(D,K)|0,o=Math.imul(D,V),n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,W)|0,n=n+Math.imul(O,X)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,J)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,fe)|0,n=n+Math.imul(g,he)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(v,he)|0,o=o+Math.imul(v,de)|0;var Ee=(f+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;f=((o=o+Math.imul(b,be)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(z,Y),i=(i=Math.imul(z,W))+Math.imul(D,Y)|0,o=Math.imul(D,W),n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,J)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(P,re)|0,i=(i=i+Math.imul(P,ne)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,n=n+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,fe)|0)+Math.imul(A,ue)|0,o=o+Math.imul(A,fe)|0,n=n+Math.imul(w,he)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(_,he)|0,o=o+Math.imul(_,de)|0;var ke=(f+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,be)|0)+Math.imul(v,pe)|0))<<13)|0;f=((o=o+Math.imul(v,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(z,X),i=(i=Math.imul(z,J))+Math.imul(D,X)|0,o=Math.imul(D,J),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ne)|0,n=n+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,ae)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,ae)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,fe)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,fe)|0,n=n+Math.imul(M,he)|0,i=(i=i+Math.imul(M,de)|0)+Math.imul(A,he)|0,o=o+Math.imul(A,de)|0;var Ie=(f+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,be)|0)+Math.imul(_,pe)|0))<<13)|0;f=((o=o+Math.imul(_,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(z,Q),i=(i=Math.imul(z,ee))+Math.imul(D,Q)|0,o=Math.imul(D,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(L,re)|0,o=o+Math.imul(L,ne)|0,n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,ae)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,ae)|0,n=n+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,fe)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,fe)|0,n=n+Math.imul(E,he)|0,i=(i=i+Math.imul(E,de)|0)+Math.imul(k,he)|0,o=o+Math.imul(k,de)|0;var Pe=(f+(n=n+Math.imul(M,pe)|0)|0)+((8191&(i=(i=i+Math.imul(M,be)|0)+Math.imul(A,pe)|0))<<13)|0;f=((o=o+Math.imul(A,be)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(z,re),i=(i=Math.imul(z,ne))+Math.imul(D,re)|0,o=Math.imul(D,ne),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,ae)|0,n=n+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,fe)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,fe)|0,n=n+Math.imul(P,he)|0,i=(i=i+Math.imul(P,de)|0)+Math.imul(B,he)|0,o=o+Math.imul(B,de)|0;var Be=(f+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,be)|0)+Math.imul(k,pe)|0))<<13)|0;f=((o=o+Math.imul(k,be)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(z,oe),i=(i=Math.imul(z,ae))+Math.imul(D,oe)|0,o=Math.imul(D,ae),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,fe)|0)+Math.imul(L,ue)|0,o=o+Math.imul(L,fe)|0,n=n+Math.imul(O,he)|0,i=(i=i+Math.imul(O,de)|0)+Math.imul(R,he)|0,o=o+Math.imul(R,de)|0;var Te=(f+(n=n+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,be)|0)+Math.imul(B,pe)|0))<<13)|0;f=((o=o+Math.imul(B,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(z,ue),i=(i=Math.imul(z,fe))+Math.imul(D,ue)|0,o=Math.imul(D,fe),n=n+Math.imul(C,he)|0,i=(i=i+Math.imul(C,de)|0)+Math.imul(L,he)|0,o=o+Math.imul(L,de)|0;var Oe=(f+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,be)|0)+Math.imul(R,pe)|0))<<13)|0;f=((o=o+Math.imul(R,be)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(z,he),i=(i=Math.imul(z,de))+Math.imul(D,he)|0,o=Math.imul(D,de);var Re=(f+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,be)|0)+Math.imul(L,pe)|0))<<13)|0;f=((o=o+Math.imul(L,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Ne=(f+(n=Math.imul(z,pe))|0)+((8191&(i=(i=Math.imul(z,be))+Math.imul(D,pe)|0))<<13)|0;return f=((o=Math.imul(D,be))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=me,u[1]=ge,u[2]=ve,u[3]=ye,u[4]=we,u[5]=_e,u[6]=Se,u[7]=Me,u[8]=Ae,u[9]=xe,u[10]=Ee,u[11]=ke,u[12]=Ie,u[13]=Pe,u[14]=Be,u[15]=Te,u[16]=Oe,u[17]=Re,u[18]=Ne,0!==f&&(u[19]=f,r.length++),r};function p(e,t,r){return(new b).mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(l=d),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?l(this,e,t):r<63?d(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.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,e,t):p(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},b.prototype.permute=function(e,t,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*t;a>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,f=0;f=0&&(0!==c||f>=i);f--){var h=0|this.words[f];this.words[f]=c<<26-o|h>>>o,c=h&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(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(e,t){var r=(this.length,e.length),n=this.clone(),i=e,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"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var f=0;f=0;h--){var d=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(i,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=d)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),f=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++f;for(var c=r.clone(),h=t.clone();!t.isZero();){for(var d=0,l=1;0==(t.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(c),a.isub(h)),i.iushrn(1),a.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(h)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(u)):(r.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(f)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,c=1;0==(t.words[0]&c)&&f<26;++f,c<<=1);if(f>0)for(t.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var h=0,d=1;0==(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/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(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new S(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},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(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){S.call(this,e),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)}g.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):r.strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},i(v,g),v.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new y;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return m[e]=t,t},S.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,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(),f=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,f).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,i),d=this.pow(e,i.addn(1).iushrn(1)),l=this.pow(e,i),p=a;0!==l.cmp(s);){for(var b=l,m=0;0!==b.cmp(s);m++)b=b.redSqr();n(m=0;n--){for(var f=t.words[n],c=u-1;c>=0;c--){var h=f>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new M(e)},i(M,S),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},M.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),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)},M.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),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)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(24)(e))},function(e,t){var r="0123456789abcdef".split(""),n=[1,256,65536,16777216],i=[0,8,16,24],o=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],a=function(e){var t,r,n,i,a,s,u,f,c,h,d,l,p,b,m,g,v,y,w,_,S,M,A,x,E,k,I,P,B,T,O,R,N,C,L,j,z,D,U,F,q,H,K,V,G,Y,W,Z,X,J,$,Q,ee,te,re,ne,ie,oe,ae,se,ue,fe,ce;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],a=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],u=e[3]^e[13]^e[23]^e[33]^e[43],f=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],d=e[7]^e[17]^e[27]^e[37]^e[47],t=(l=e[8]^e[18]^e[28]^e[38]^e[48])^(s<<1|u>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(u<<1|s>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(f<<1|c>>>31),r=a^(c<<1|f>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=s^(h<<1|d>>>31),r=u^(d<<1|h>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=f^(l<<1|p>>>31),r=c^(p<<1|l>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=h^(i<<1|a>>>31),r=d^(a<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,b=e[0],m=e[1],Y=e[11]<<4|e[10]>>>28,W=e[10]<<4|e[11]>>>28,P=e[20]<<3|e[21]>>>29,B=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,H=e[40]<<18|e[41]>>>14,K=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,L=e[3]<<1|e[2]>>>31,g=e[13]<<12|e[12]>>>20,v=e[12]<<12|e[13]>>>20,Z=e[22]<<10|e[23]>>>22,X=e[23]<<10|e[22]>>>22,T=e[33]<<13|e[32]>>>19,O=e[32]<<13|e[33]>>>19,fe=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,j=e[14]<<6|e[15]>>>26,z=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,J=e[34]<<15|e[35]>>>17,$=e[35]<<15|e[34]>>>17,R=e[45]<<29|e[44]>>>3,N=e[44]<<29|e[45]>>>3,x=e[6]<<28|e[7]>>>4,E=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,D=e[26]<<25|e[27]>>>7,U=e[27]<<25|e[26]>>>7,_=e[36]<<21|e[37]>>>11,S=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,V=e[8]<<27|e[9]>>>5,G=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,I=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,F=e[38]<<8|e[39]>>>24,q=e[39]<<8|e[38]>>>24,M=e[48]<<14|e[49]>>>18,A=e[49]<<14|e[48]>>>18,e[0]=b^~g&y,e[1]=m^~v&w,e[10]=x^~k&P,e[11]=E^~I&B,e[20]=C^~j&D,e[21]=L^~z&U,e[30]=V^~Y&Z,e[31]=G^~W&X,e[40]=te^~ne&oe,e[41]=re^~ie&ae,e[2]=g^~y&_,e[3]=v^~w&S,e[12]=k^~P&T,e[13]=I^~B&O,e[22]=j^~D&F,e[23]=z^~U&q,e[32]=Y^~Z&J,e[33]=W^~X&$,e[42]=ne^~oe&se,e[43]=ie^~ae&ue,e[4]=y^~_&M,e[5]=w^~S&A,e[14]=P^~T&R,e[15]=B^~O&N,e[24]=D^~F&H,e[25]=U^~q&K,e[34]=Z^~J&Q,e[35]=X^~$&ee,e[44]=oe^~se&fe,e[45]=ae^~ue&ce,e[6]=_^~M&b,e[7]=S^~A&m,e[16]=T^~R&x,e[17]=O^~N&E,e[26]=F^~H&C,e[27]=q^~K&L,e[36]=J^~Q&V,e[37]=$^~ee&G,e[46]=se^~fe&te,e[47]=ue^~ce&re,e[8]=M^~b&g,e[9]=A^~m&v,e[18]=R^~x&k,e[19]=N^~E&I,e[28]=H^~C&j,e[29]=K^~L&z,e[38]=Q^~V&Y,e[39]=ee^~G&W,e[48]=fe^~te&ne,e[49]=ce^~re&ie,e[0]^=o[n],e[1]^=o[n+1]},s=function(e){return function(t){var o;if("0x"===t.slice(0,2)){o=[];for(var s=2,u=t.length;s>2]|=t[l]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(u[m>>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)<=f){for(e.start=m-f,e.block=u[c],m=0;m>2]|=n[3&m],e.lastByteIndex===f)for(u[0]=u[c],m=1;m>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%c==0&&(a(d),m=0)}return"0x"+b}(function(e){return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(e<<1)>>5,outputBlocks:e>>5,s:function(e){return[].concat(e,e,e,e,e)}([0,0,0,0,0,0,0,0,0,0])}}(e),o)}};e.exports={keccak256:s(256),keccak512:s(512),keccak256s:s(256),keccak512s:s(512)}},function(e,t,r){"use strict";var n=r(20),i=r(200),o=function(e){var t="A".charCodeAt(0),r="Z".charCodeAt(0);return(e=(e=e.toUpperCase()).substr(4)+e.substr(0,4)).split("").map(function(e){var n=e.charCodeAt(0);return n>=t&&n<=r?n-t+10:e}).join("")},a=function(e){for(var t,r=e;r.length>2;)t=r.slice(0,9),r=parseInt(t,10)%97+r.slice(t.length);return parseInt(r,10)%97},s=function(e){this._iban=e};s.toAddress=function(e){if(!(e=new s(e)).isDirect())throw new Error("IBAN is indirect and can't be converted");return e.toAddress()},s.toIban=function(e){return s.fromAddress(e).toString()},s.fromAddress=function(e){if(!n.isAddress(e))throw new Error("Provided address is not a valid address: "+e);e=e.replace("0x","").replace("0X","");var t=function(e,t){for(var r=e;r.length<2*t;)r="0"+r;return r}(new i(e,16).toString(36),15);return s.fromBban(t.toUpperCase())},s.fromBban=function(e){var t=("0"+(98-a(o("XE00"+e)))).slice(-2);return new s("XE"+t+e)},s.createIndirect=function(e){return s.fromBban("ETH"+e.institution+e.identifier)},s.isValid=function(e){return new s(e).isValid()},s.prototype.isValid=function(){return/^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(this._iban)&&1===a(o(this._iban))},s.prototype.isDirect=function(){return 34===this._iban.length||35===this._iban.length},s.prototype.isIndirect=function(){return 20===this._iban.length},s.prototype.checksum=function(){return this._iban.substr(2,2)},s.prototype.institution=function(){return this.isIndirect()?this._iban.substr(7,4):""},s.prototype.client=function(){return this.isIndirect()?this._iban.substr(11):""},s.prototype.toAddress=function(){if(this.isDirect()){var e=this._iban.substr(4),t=new i(e,36);return n.toChecksumAddress(t.toString(16,20))}return""},s.prototype.toString=function(){return this._iban},e.exports=s},function(e,t,r){"use strict";var n={messageId:0,toPayload:function(e,t){if(!e)throw new Error('JSONRPC method should be specified for params: "'+JSON.stringify(t)+'"!');return n.messageId++,{jsonrpc:"2.0",id:n.messageId,method:e,params:t||[]}},isValidResponse:function(e){return Array.isArray(e)?e.every(t):t(e);function t(e){return!(!e||e.error||"2.0"!==e.jsonrpc||"number"!=typeof e.id&&"string"!=typeof e.id||void 0===e.result)}},toBatchPayload:function(e){return e.map(function(e){return n.toPayload(e.method,e.params)})}};e.exports=n},function(e,t,r){(function(e){t.fetch=s(e.fetch)&&s(e.ReadableStream),t.writableStream=s(e.WritableStream),t.abortController=s(e.AbortController),t.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),t.blobConstructor=!0}catch(e){}var r;function n(){if(void 0!==r)return r;if(e.XMLHttpRequest){r=new e.XMLHttpRequest;try{r.open("GET",e.XDomainRequest?"/":"https://example.com")}catch(e){r=null}}else r=null;return r}function i(e){var t=n();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}var o=void 0!==e.ArrayBuffer,a=o&&s(e.ArrayBuffer.prototype.slice);function s(e){return"function"==typeof e}t.arraybuffer=t.fetch||o&&i("arraybuffer"),t.msstream=!t.fetch&&a&&i("ms-stream"),t.mozchunkedarraybuffer=!t.fetch&&o&&i("moz-chunked-arraybuffer"),t.overrideMimeType=t.fetch||!!n()&&s(n().overrideMimeType),t.vbArray=s(e.VBArray),r=null}).call(this,r(7))},function(e,t,r){(function(e,n,i){var o=r(116),a=r(1),s=r(53),u=t.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},f=t.IncomingMessage=function(t,r,a,u){var f=this;if(s.Readable.call(f),f._mode=a,f.headers={},f.rawHeaders=[],f.trailers={},f.rawTrailers=[],f.on("end",function(){e.nextTick(function(){f.emit("close")})}),"fetch"===a){if(f._fetchResponse=r,f.url=r.url,f.statusCode=r.status,f.statusMessage=r.statusText,r.headers.forEach(function(e,t){f.headers[t.toLowerCase()]=e,f.rawHeaders.push(t,e)}),o.writableStream){var c=new WritableStream({write:function(e){return new Promise(function(t,r){f._destroyed?r():f.push(new n(e))?t():f._resumeFetch=t})},close:function(){i.clearTimeout(u),f._destroyed||f.push(null)},abort:function(e){f._destroyed||f.emit("error",e)}});try{return void r.body.pipeTo(c).catch(function(e){i.clearTimeout(u),f._destroyed||f.emit("error",e)})}catch(e){}}var h=r.body.getReader();!function e(){h.read().then(function(t){if(!f._destroyed){if(t.done)return i.clearTimeout(u),void f.push(null);f.push(new n(t.value)),e()}}).catch(function(e){i.clearTimeout(u),f._destroyed||f.emit("error",e)})}()}else{if(f._xhr=t,f._pos=0,f.url=t.responseURL,f.statusCode=t.status,f.statusMessage=t.statusText,t.getAllResponseHeaders().split(/\r?\n/).forEach(function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var r=t[1].toLowerCase();"set-cookie"===r?(void 0===f.headers[r]&&(f.headers[r]=[]),f.headers[r].push(t[2])):void 0!==f.headers[r]?f.headers[r]+=", "+t[2]:f.headers[r]=t[2],f.rawHeaders.push(t[1],t[2])}}),f._charset="x-user-defined",!o.overrideMimeType){var d=f.rawHeaders["mime-type"];if(d){var l=d.match(/;\s*charset=([^;])(;|$)/);l&&(f._charset=l[1].toLowerCase())}f._charset||(f._charset="utf-8")}}};a(f,s.Readable),f.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},f.prototype._onXHRProgress=function(){var e=this,t=e._xhr,r=null;switch(e._mode){case"text:vbarray":if(t.readyState!==u.DONE)break;try{r=new i.VBArray(t.responseBody).toArray()}catch(e){}if(null!==r){e.push(new n(r));break}case"text":try{r=t.responseText}catch(t){e._mode="text:vbarray";break}if(r.length>e._pos){var o=r.substr(e._pos);if("x-user-defined"===e._charset){for(var a=new n(o.length),s=0;se._pos&&(e.push(new n(new Uint8Array(f.result.slice(e._pos)))),e._pos=f.result.byteLength)},f.onload=function(){e.push(null)},f.readAsArrayBuffer(r)}e._xhr.readyState===u.DONE&&"ms-stream"!==e._mode&&e.push(null)}}).call(this,r(15),r(0).Buffer,r(7))},function(e,t,r){"use strict";(function(t,n){var i=r(64);e.exports=y;var o,a=r(107);y.ReadableState=v;r(84).EventEmitter;var s=function(e,t){return e.listeners(t).length},u=r(119),f=r(2).Buffer,c=t.Uint8Array||function(){};var h=r(54);h.inherits=r(1);var d=r(216),l=void 0;l=d&&d.debuglog?d.debuglog("stream"):function(){};var p,b=r(217),m=r(120);h.inherits(y,u);var g=["error","close","destroy","pause","resume"];function v(e,t){o=o||r(36),e=e||{};var n=t instanceof o;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,a=e.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 b,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=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=r(86).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function y(e){if(o=o||r(36),!(this instanceof y))return new y(e);this._readableState=new v(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function w(e,t,r,n,i){var o,a=e._readableState;null===t?(a.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,A(e)}(e,a)):(i||(o=function(e,t){var r;(function(e){return f.isBuffer(e)||e instanceof c})(t)||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));return r}(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===f.prototype||(t=function(e){return f.from(e)}(t)),n?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):_(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?_(e,a,t,!1):E(e,a)):_(e,a,t,!1))):n||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=S?e=S:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function A(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(l("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(x,e):x(e))}function x(e){l("emit readable"),e.emit("readable"),B(e)}function E(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(k,e,t))}function k(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;eo.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=f.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0===(e-=a)){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function O(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(R,t,e))}function R(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function N(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return l("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):A(this),null;if(0===(e=M(e,t))&&t.ended)return 0===t.length&&O(this),null;var n,i=t.needReadable;return l("need readable",i),(0===t.length||t.length-e0?T(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&O(this)),null!==n&&this.emit("data",n),n},y.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},y.prototype.pipe=function(e,t){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,l("pipe count=%d opts=%j",o.pipesCount,t);var u=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?c:y;function f(t,n){l("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,l("cleanup"),e.removeListener("close",g),e.removeListener("finish",v),e.removeListener("drain",h),e.removeListener("error",m),e.removeListener("unpipe",f),r.removeListener("end",c),r.removeListener("end",y),r.removeListener("data",b),d=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||h())}function c(){l("onend"),e.end()}o.endEmitted?i.nextTick(u):r.once("end",u),e.on("unpipe",f);var h=function(e){return function(){var t=e._readableState;l("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,B(e))}}(r);e.on("drain",h);var d=!1;var p=!1;function b(t){l("ondata"),p=!1,!1!==e.write(t)||p||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==N(o.pipes,e))&&!d&&(l("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function m(t){l("onerror",t),y(),e.removeListener("error",m),0===s(e,"error")&&e.emit("error",t)}function g(){e.removeListener("finish",v),y()}function v(){l("onfinish"),e.removeListener("close",g),y()}function y(){l("unpipe"),r.unpipe(e)}return r.on("data",b),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",m),e.once("close",g),e.once("finish",v),e.emit("pipe",r),o.flowing||(l("pipe resume"),r.resume()),e},y.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},r(219),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(7))},function(e,t,r){"use strict";e.exports=o;var n=r(36),i=r(54);function o(e){if(!(this instanceof o))return new o(e);n.call(this,e),this._transformState={afterTransform:function(e,t){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!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length=0&&t<=M};function E(e){return function(t,r,n,i){r=v(r,i,4);var o=!x(t)&&g.keys(t),a=(o||t).length,s=e>0?0:a-1;return arguments.length<3&&(n=t[o?o[s]:s],s+=e),function(t,r,n,i,o,a){for(;o>=0&&o=0},g.invoke=function(e,t){var r=f.call(arguments,2),n=g.isFunction(t);return g.map(e,function(e){var i=n?t:e[t];return null==i?i:i.apply(e,r)})},g.pluck=function(e,t){return g.map(e,g.property(t))},g.where=function(e,t){return g.filter(e,g.matcher(t))},g.findWhere=function(e,t){return g.find(e,g.matcher(t))},g.max=function(e,t,r){var n,i,o=-1/0,a=-1/0;if(null==t&&null!=e)for(var s=0,u=(e=x(e)?e:g.values(e)).length;so&&(o=n);else t=y(t,r),g.each(e,function(e,r,n){((i=t(e,r,n))>a||i===-1/0&&o===-1/0)&&(o=e,a=i)});return o},g.min=function(e,t,r){var n,i,o=1/0,a=1/0;if(null==t&&null!=e)for(var s=0,u=(e=x(e)?e:g.values(e)).length;sn||void 0===r)return 1;if(r0?0:i-1;o>=0&&o0?a=o>=0?o:Math.max(o+s,a):s=o>=0?Math.min(o+1,s):o+s+1;else if(r&&o&&s)return n[o=r(n,i)]===i?o:-1;if(i!=i)return(o=t(f.call(n,a,s),g.isNaN))>=0?o+a:-1;for(o=e>0?a:s-1;o>=0&&ot?(a&&(clearTimeout(a),a=null),s=f,o=e.apply(n,i),a||(n=i=null)):a||!1===r.trailing||(a=setTimeout(u,c)),o}},g.debounce=function(e,t,r){var n,i,o,a,s,u=function(){var f=g.now()-a;f=0?n=setTimeout(u,t-f):(n=null,r||(s=e.apply(o,i),n||(o=i=null)))};return function(){o=this,i=arguments,a=g.now();var f=r&&!n;return n||(n=setTimeout(u,t)),f&&(s=e.apply(o,i),o=i=null),s}},g.wrap=function(e,t){return g.partial(t,e)},g.negate=function(e){return function(){return!e.apply(this,arguments)}},g.compose=function(){var e=arguments,t=e.length-1;return function(){for(var r=t,n=e[t].apply(this,arguments);r--;)n=e[r].call(this,n);return n}},g.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},g.before=function(e,t){var r;return function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=null),r}},g.once=g.partial(g.before,2);var O=!{toString:null}.propertyIsEnumerable("toString"),R=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];function N(e,t){var r=R.length,n=e.constructor,i=g.isFunction(n)&&n.prototype||a,o="constructor";for(g.has(e,o)&&!g.contains(t,o)&&t.push(o);r--;)(o=R[r])in e&&e[o]!==i[o]&&!g.contains(t,o)&&t.push(o)}g.keys=function(e){if(!g.isObject(e))return[];if(l)return l(e);var t=[];for(var r in e)g.has(e,r)&&t.push(r);return O&&N(e,t),t},g.allKeys=function(e){if(!g.isObject(e))return[];var t=[];for(var r in e)t.push(r);return O&&N(e,t),t},g.values=function(e){for(var t=g.keys(e),r=t.length,n=Array(r),i=0;i":">",'"':""","'":"'","`":"`"},j=g.invert(L),z=function(e){var t=function(t){return e[t]},r="(?:"+g.keys(e).join("|")+")",n=RegExp(r),i=RegExp(r,"g");return function(e){return e=null==e?"":""+e,n.test(e)?e.replace(i,t):e}};g.escape=z(L),g.unescape=z(j),g.result=function(e,t,r){var n=null==e?void 0:e[t];return void 0===n&&(n=r),g.isFunction(n)?n.call(e):n};var D=0;g.uniqueId=function(e){var t=++D+"";return e?e+t:t},g.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var U=/(.)^/,F={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},q=/\\|'|\r|\n|\u2028|\u2029/g,H=function(e){return"\\"+F[e]};g.template=function(e,t,r){!t&&r&&(t=r),t=g.defaults({},t,g.templateSettings);var n=RegExp([(t.escape||U).source,(t.interpolate||U).source,(t.evaluate||U).source].join("|")+"|$","g"),i=0,o="__p+='";e.replace(n,function(t,r,n,a,s){return o+=e.slice(i,s).replace(q,H),i=s+t.length,r?o+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":n?o+="'+\n((__t=("+n+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),t}),o+="';\n",t.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{var a=new Function(t.variable||"obj","_",o)}catch(e){throw e.source=o,e}var s=function(e){return a.call(this,e,g)},u=t.variable||"obj";return s.source="function("+u+"){\n"+o+"}",s},g.chain=function(e){var t=g(e);return t._chain=!0,t};var K=function(e,t){return e._chain?g(t).chain():t};g.mixin=function(e){g.each(g.functions(e),function(t){var r=g[t]=e[t];g.prototype[t]=function(){var e=[this._wrapped];return u.apply(e,arguments),K(this,r.apply(g,e))}})},g.mixin(g),g.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=o[e];g.prototype[e]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!==e&&"splice"!==e||0!==r.length||delete r[0],K(this,r)}}),g.each(["concat","join","slice"],function(e){var t=o[e];g.prototype[e]=function(){return K(this,t.apply(this._wrapped,arguments))}}),g.prototype.value=function(){return this._wrapped},g.prototype.valueOf=g.prototype.toJSON=g.prototype.value,g.prototype.toString=function(){return""+this._wrapped},void 0===(n=function(){return g}.apply(t,[]))||(e.exports=n)}).call(this)},function(e,t,r){"use strict";var n=r(35),i=r(37),o=r(20),a=r(66),s=r(14).formatters,u=function(){var e=this;n.packageInit(this,arguments),this.net=new a(this.currentProvider);var t=null,r="latest";Object.defineProperty(this,"defaultAccount",{get:function(){return t},set:function(e){return e&&(t=o.toChecksumAddress(s.inputAddressFormatter(e))),u.forEach(function(e){e.defaultAccount=t}),e},enumerable:!0}),Object.defineProperty(this,"defaultBlock",{get:function(){return r},set:function(e){return r=e,u.forEach(function(e){e.defaultBlock=r}),e},enumerable:!0});var u=[new i({name:"getAccounts",call:"personal_listAccounts",params:0,outputFormatter:o.toChecksumAddress}),new i({name:"newAccount",call:"personal_newAccount",params:1,inputFormatter:[null],outputFormatter:o.toChecksumAddress}),new i({name:"unlockAccount",call:"personal_unlockAccount",params:3,inputFormatter:[s.inputAddressFormatter,null,null]}),new i({name:"lockAccount",call:"personal_lockAccount",params:1,inputFormatter:[s.inputAddressFormatter]}),new i({name:"importRawKey",call:"personal_importRawKey",params:2}),new i({name:"sendTransaction",call:"personal_sendTransaction",params:2,inputFormatter:[s.inputTransactionFormatter,null]}),new i({name:"signTransaction",call:"personal_signTransaction",params:2,inputFormatter:[s.inputTransactionFormatter,null]}),new i({name:"sign",call:"personal_sign",params:3,inputFormatter:[s.inputSignFormatter,s.inputAddressFormatter,null]}),new i({name:"ecRecover",call:"personal_ecRecover",params:2,inputFormatter:[s.inputSignFormatter,null]})];u.forEach(function(t){t.attachToObject(e),t.setRequestManager(e._requestManager),t.defaultBlock=e.defaultBlock,t.defaultAccount=e.defaultAccount})};n.addProviders(u),e.exports=u},function(e,t,r){var n=r(18),i=r(20),o=new(0,r(237).AbiCoder)(function(e,t){return!e.match(/^u?int/)||n.isArray(t)||n.isObject(t)&&"BN"===t.constructor.name?t:t.toString()});function a(){}var s=function(){};s.prototype.encodeFunctionSignature=function(e){return n.isObject(e)&&(e=i._jsonInterfaceMethodToString(e)),i.sha3(e).slice(0,10)},s.prototype.encodeEventSignature=function(e){return n.isObject(e)&&(e=i._jsonInterfaceMethodToString(e)),i.sha3(e)},s.prototype.encodeParameter=function(e,t){return this.encodeParameters([e],[t])},s.prototype.encodeParameters=function(e,t){return o.encode(this.mapTypes(e),t)},s.prototype.mapTypes=function(e){var t=this,r=[];return e.forEach(function(e){if(t.isSimplifiedStructFormat(e)){var n=Object.keys(e)[0];r.push(Object.assign(t.mapStructNameAndType(n),{components:t.mapStructToCoderFormat(e[n])}))}else r.push(e)}),r},s.prototype.isSimplifiedStructFormat=function(e){return"object"==typeof e&&void 0===e.components&&void 0===e.name},s.prototype.mapStructNameAndType=function(e){var t="tuple";return e.indexOf("[]")>-1&&(t="tuple[]",e=e.slice(0,-2)),{type:t,name:e}},s.prototype.mapStructToCoderFormat=function(e){var t=this,r=[];return Object.keys(e).forEach(function(n){"object"!=typeof e[n]?r.push({name:n,type:e[n]}):r.push(Object.assign(t.mapStructNameAndType(n),{components:t.mapStructToCoderFormat(e[n])}))}),r},s.prototype.encodeFunctionCall=function(e,t){return this.encodeFunctionSignature(e)+this.encodeParameters(e.inputs,t).replace("0x","")},s.prototype.decodeParameter=function(e,t){return this.decodeParameters([e],t)[0]},s.prototype.decodeParameters=function(e,t){if(!t||"0x"===t||"0X"===t)throw new Error("Returned values aren't valid, did it run Out of Gas?");var r=o.decode(this.mapTypes(e),"0x"+t.replace(/0x/i,"")),i=new a;return i.__length__=0,e.forEach(function(e,t){var o=r[i.__length__];o="0x"===o?null:o,i[t]=o,n.isObject(e)&&e.name&&(i[e.name]=o),i.__length__++}),i},s.prototype.decodeLog=function(e,t,r){var i=this;r=n.isArray(r)?r:[r],t=t||"";var o=[],s=[],u=0;e.forEach(function(e,t){e.indexed?(s[t]=["bool","int","uint","address","fixed","ufixed"].find(function(t){return-1!==e.type.indexOf(t)})?i.decodeParameter(e.type,r[u]):r[u],u++):o[t]=e});var f=t,c=f?this.decodeParameters(o,f):[],h=new a;return h.__length__=0,e.forEach(function(e,t){h[t]="string"===e.type?"":null,void 0!==c[t]&&(h[t]=c[t]),void 0!==s[t]&&(h[t]=s[t]),e.name&&(h[e.name]=h[t]),h.__length__++}),h};var u=new s;e.exports=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defineReadOnly=function(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})},t.defineFrozen=function(e,t,r){var n=JSON.stringify(r);Object.defineProperty(e,t,{enumerable:!0,get:function(){return JSON.parse(n)}})},t.resolveProperties=function(e){var t={},r=[];return Object.keys(e).forEach(function(n){var i=e[n];i instanceof Promise?r.push(i.then(function(e){return t[n]=e,null})):t[n]=i}),Promise.all(r).then(function(){return t})},t.shallowCopy=function(e){var t={};for(var r in e)t[r]=e[r];return t},t.jsonCopy=function(e){return JSON.parse(JSON.stringify(e))}},function(e,t,r){"use strict";var n=r(2).Buffer,i=r(55).Transform;function o(e){i.call(this),this._block=n.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(1)(o,i),o.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},o.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},o.prototype.update=function(e,t){if(function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(e)||(e=n.from(e,t));for(var r=this._block,i=0;this._blockOffset+e.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(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},o.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=o},function(e,t,r){var n=r(1),i=r(47),o=r(2).Buffer,a=[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],s=new Array(64);function u(){this.init(),this._w=s,i.call(this,64,56)}function f(e,t,r){return r^e&(t^r)}function c(e,t,r){return e&t|r&(e|t)}function h(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function d(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function l(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function p(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}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(e){for(var t=this._w,r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,s=0|this._e,u=0|this._f,b=0|this._g,m=0|this._h,g=0;g<16;++g)t[g]=e.readInt32BE(4*g);for(;g<64;++g)t[g]=p(t[g-2])+t[g-7]+l(t[g-15])+t[g-16]|0;for(var v=0;v<64;++v){var y=m+d(s)+f(s,u,b)+a[v]+t[v]|0,w=h(r)+c(r,n,i)|0;m=b,b=u,u=s,s=o+y|0,o=i,i=n,n=r,r=y+w|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0,this._f=u+this._f|0,this._g=b+this._g|0,this._h=m+this._h|0},u.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=u},function(e,t,r){var n=r(1),i=r(47),o=r(2).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 f(e,t,r){return r^e&(t^r)}function c(e,t,r){return e&t|r&(e|t)}function h(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function d(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function l(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function b(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function g(e,t){return e>>>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(e){for(var t=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,v=0|this._gh,y=0|this._hh,w=0|this._al,_=0|this._bl,S=0|this._cl,M=0|this._dl,A=0|this._el,x=0|this._fl,E=0|this._gl,k=0|this._hl,I=0;I<32;I+=2)t[I]=e.readInt32BE(4*I),t[I+1]=e.readInt32BE(4*I+4);for(;I<160;I+=2){var P=t[I-30],B=t[I-30+1],T=l(P,B),O=p(B,P),R=b(P=t[I-4],B=t[I-4+1]),N=m(B,P),C=t[I-14],L=t[I-14+1],j=t[I-32],z=t[I-32+1],D=O+L|0,U=T+C+g(D,O)|0;U=(U=U+R+g(D=D+N|0,N)|0)+j+g(D=D+z|0,z)|0,t[I]=U,t[I+1]=D}for(var F=0;F<160;F+=2){U=t[F],D=t[F+1];var q=c(r,n,i),H=c(w,_,S),K=h(r,w),V=h(w,r),G=d(s,A),Y=d(A,s),W=a[F],Z=a[F+1],X=f(s,u,v),J=f(A,x,E),$=k+Y|0,Q=y+G+g($,k)|0;Q=(Q=(Q=Q+X+g($=$+J|0,J)|0)+W+g($=$+Z|0,Z)|0)+U+g($=$+D|0,D)|0;var ee=V+H|0,te=K+q+g(ee,V)|0;y=v,k=E,v=u,E=x,u=s,x=A,s=o+Q+g(A=M+$|0,M)|0,o=i,M=S,i=n,S=_,n=r,_=w,r=Q+te+g(w=$+ee|0,$)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+S|0,this._dl=this._dl+M|0,this._el=this._el+A|0,this._fl=this._fl+x|0,this._gl=this._gl+E|0,this._hl=this._hl+k|0,this._ah=this._ah+r+g(this._al,w)|0,this._bh=this._bh+n+g(this._bl,_)|0,this._ch=this._ch+i+g(this._cl,S)|0,this._dh=this._dh+o+g(this._dl,M)|0,this._eh=this._eh+s+g(this._el,A)|0,this._fh=this._fh+u+g(this._fl,x)|0,this._gh=this._gh+v+g(this._gl,E)|0,this._hh=this._hh+y+g(this._hl,k)|0},u.prototype._hash=function(){var e=o.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=u},function(e,t,r){"use strict";var n=r(1),i=r(258),o=r(30),a=r(2).Buffer,s=r(136),u=r(90),f=r(91),c=a.alloc(128);function h(e,t){o.call(this,"digest"),"string"==typeof t&&(t=a.from(t));var r="sha512"===e||"sha384"===e?128:64;(this._alg=e,this._key=t,t.length>r)?t=("rmd160"===e?new u:f(e)).update(t).digest():t.lengthr||o!=o)throw new TypeError("Bad key length")}}).call(this,r(0).Buffer)},function(e,t,r){(function(t){var r;t.browser?r="utf-8":r=parseInt(t.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary";e.exports=r}).call(this,r(15))},function(e,t,r){var n=r(136),i=r(90),o=r(91),a=r(138),s=r(139),u=r(2).Buffer,f=u.alloc(128),c={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function h(e,t,r){var a=function(e){return"rmd160"===e||"ripemd160"===e?function(e){return(new i).update(e).digest()}:"md5"===e?n:function(t){return o(e).update(t).digest()}}(e),s="sha512"===e||"sha384"===e?128:64;t.length>s?t=a(t):t.lengthe;)r.ishrn(1);if(r.isEven()&&r.iadd(s),r.testn(1)||r.iadd(u),t.cmp(u)){if(!t.cmp(f))for(;r.mod(c).cmp(h);)r.iadd(l)}else for(;r.mod(o).cmp(d);)r.iadd(l);if(m(p=r.shrn(1))&&m(r)&&g(p)&&g(r)&&a.test(p)&&a.test(r))return r}}},function(e,t,r){var n=r(3),i=r(70);function o(e){this.rand=e||new i.Rand}e.exports=o,o.create=function(e){return new o(e)},o.prototype._randbelow=function(e){var t=e.bitLength(),r=Math.ceil(t/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(e)>=0);return i},o.prototype._randrange=function(e,t){var r=t.sub(e);return e.add(this._randbelow(r))},o.prototype.test=function(e,t,r){var i=e.bitLength(),o=n.mont(e),a=new n(1).toRed(o);t||(t=Math.max(1,i/48|0));for(var s=e.subn(1),u=0;!s.testn(u);u++);for(var f=e.shrn(u),c=s.toRed(o);t>0;t--){var h=this._randrange(new n(2),s);r&&r(h);var d=h.toRed(o).redPow(f);if(0!==d.cmp(a)&&0!==d.cmp(c)){for(var l=1;l0;t--){var c=this._randrange(new n(2),a),h=e.gcd(c);if(0!==h.cmpn(1))return h;var d=c.toRed(i).redPow(u);if(0!==d.cmp(o)&&0!==d.cmp(f)){for(var l=1;l>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},function(e,t,r){"use strict";var n=r(25),i=r(57),o=r(148),a=r(16),s=n.sum32,u=n.sum32_4,f=n.sum32_5,c=o.ch32,h=o.maj32,d=o.s0_256,l=o.s1_256,p=o.g0_256,b=o.g1_256,m=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 v(){if(!(this instanceof v))return new v;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}n.inherits(v,m),e.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=a,a.prototype._init=function(e,t,r){var n=e.concat(t).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(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length>6],i=0==(32&r);if(31==(31&r)){var o=r;for(r=0;128==(128&o);){if(o=e.readUInt8(t),e.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:s.tag[r]}}function h(e,t,r){var n=e.readUInt8(r);if(e.isError(n))return n;if(!t&&128===n)return null;if(0==(128&n))return n;var i=127&n;if(i>4)return e.error("length octect is too long");n=0;for(var o=0;o=31)return n.error("Multi-octet tag encoding unsupported");t||(i|=32);return i|=s.tagClassByName[r||"universal"]<<6}(e,t,r,this.reporter);if(n.length<128)return(o=new i(2))[0]=a,o[1]=n.length,this._createEncoderBuffer([o,n]);for(var u=1,f=n.length;f>=256;f>>=8)u++;(o=new i(2+u))[0]=a,o[1]=128|u;f=1+u;for(var c=n.length;c>0;f--,c>>=8)o[f]=255&c;return this._createEncoderBuffer([o,n])},f.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var r=new i(2*e.length),n=0;n=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}var o=0;for(n=0;n=128;a>>=7)o++}var s=new i(o),u=s.length-1;for(n=e.length-1;n>=0;n--){a=e[n];for(s[u--]=127&a;(a>>=7)>0;)s[u--]=128|127&a}return this._createEncoderBuffer(s)},f.prototype._encodeTime=function(e,t){var r,n=new Date(e);return"gentime"===t?r=[c(n.getFullYear()),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[c(n.getFullYear()%100),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},f.prototype._encodeNull=function(){return this._createEncoderBuffer("")},f.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!i.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new i(r)}if(i.isBuffer(e)){var n=e.length;0===e.length&&n++;var o=new i(n);return e.copy(o),0===e.length&&(o[0]=0),this._createEncoderBuffer(o)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);n=1;for(var a=e;a>=256;a>>=8)n++;for(a=(o=new Array(n)).length-1;a>=0;a--)o[a]=255&e,e>>=8;return 128&o[0]&&o.unshift(0),this._createEncoderBuffer(new i(o))},f.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},f.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},f.prototype._skipDefault=function(e,t,r){var n,i=this._baseState;if(null===i.default)return!1;var o=e.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,t,r).join()),o.length!==i.defaultBuffer.length)return!1;for(n=0;n="80"?r(n.length/2,128):"")+n}var i=t.map(e).join("");return r(i.length/2,192)+i}(e)},decode:function(e){var t=2,r=function(){if(t>=e.length)throw"";var r=e.slice(t,t+2);return r<"80"?(t+=2,"0x"+r):r<"c0"?i():o()},n=function(){var r=parseInt(e.slice(t,t+=2),16)%64;return r<56?r:parseInt(e.slice(t,t+=2*(r-55)),16)},i=function(){var r=n();return"0x"+e.slice(t,t+=2*r)},o=function(){for(var e=2*n()+t,i=[];t>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(u<<1|s>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(f<<1|c>>>31),r=a^(c<<1|f>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=s^(h<<1|d>>>31),r=u^(d<<1|h>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=f^(l<<1|p>>>31),r=c^(p<<1|l>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=h^(i<<1|a>>>31),r=d^(a<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,b=e[0],m=e[1],Y=e[11]<<4|e[10]>>>28,W=e[10]<<4|e[11]>>>28,P=e[20]<<3|e[21]>>>29,B=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,H=e[40]<<18|e[41]>>>14,K=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,L=e[3]<<1|e[2]>>>31,g=e[13]<<12|e[12]>>>20,v=e[12]<<12|e[13]>>>20,Z=e[22]<<10|e[23]>>>22,X=e[23]<<10|e[22]>>>22,T=e[33]<<13|e[32]>>>19,O=e[32]<<13|e[33]>>>19,fe=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,j=e[14]<<6|e[15]>>>26,z=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,J=e[34]<<15|e[35]>>>17,$=e[35]<<15|e[34]>>>17,R=e[45]<<29|e[44]>>>3,N=e[44]<<29|e[45]>>>3,x=e[6]<<28|e[7]>>>4,E=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,D=e[26]<<25|e[27]>>>7,U=e[27]<<25|e[26]>>>7,_=e[36]<<21|e[37]>>>11,S=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,V=e[8]<<27|e[9]>>>5,G=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,I=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,F=e[38]<<8|e[39]>>>24,q=e[39]<<8|e[38]>>>24,M=e[48]<<14|e[49]>>>18,A=e[49]<<14|e[48]>>>18,e[0]=b^~g&y,e[1]=m^~v&w,e[10]=x^~k&P,e[11]=E^~I&B,e[20]=C^~j&D,e[21]=L^~z&U,e[30]=V^~Y&Z,e[31]=G^~W&X,e[40]=te^~ne&oe,e[41]=re^~ie&ae,e[2]=g^~y&_,e[3]=v^~w&S,e[12]=k^~P&T,e[13]=I^~B&O,e[22]=j^~D&F,e[23]=z^~U&q,e[32]=Y^~Z&J,e[33]=W^~X&$,e[42]=ne^~oe&se,e[43]=ie^~ae&ue,e[4]=y^~_&M,e[5]=w^~S&A,e[14]=P^~T&R,e[15]=B^~O&N,e[24]=D^~F&H,e[25]=U^~q&K,e[34]=Z^~J&Q,e[35]=X^~$&ee,e[44]=oe^~se&fe,e[45]=ae^~ue&ce,e[6]=_^~M&b,e[7]=S^~A&m,e[16]=T^~R&x,e[17]=O^~N&E,e[26]=F^~H&C,e[27]=q^~K&L,e[36]=J^~Q&V,e[37]=$^~ee&G,e[46]=se^~fe&te,e[47]=ue^~ce&re,e[8]=M^~b&g,e[9]=A^~m&v,e[18]=R^~x&k,e[19]=N^~E&I,e[28]=H^~C&j,e[29]=K^~L&z,e[38]=Q^~V&Y,e[39]=ee^~G&W,e[48]=fe^~te&ne,e[49]=ce^~re&ie,e[0]^=o[n],e[1]^=o[n+1]},s=function(e){return function(t){var o;if("0x"===t.slice(0,2)){o=[];for(var s=2,u=t.length;s>2]|=t[l]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(u[m>>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)<=f){for(e.start=m-f,e.block=u[c],m=0;m>2]|=n[3&m],e.lastByteIndex===f)for(u[0]=u[c],m=1;m>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%c==0&&(a(d),m=0)}return"0x"+b}(function(e){return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(e<<1)>>5,outputBlocks:e>>5,s:function(e){return[].concat(e,e,e,e,e)}([0,0,0,0,0,0,0,0,0,0])}}(e),o)}};e.exports={keccak256:s(256),keccak512:s(512),keccak256s:s(256),keccak512s:s(512)}},function(e,t,r){"use strict"; /* object-assign (c) Sindre Sorhus @license MIT */var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,a,s=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),u=1;u>6|192);else{if(i>55295&&i<56320){if(++n==e.length)return null;var o=e.charCodeAt(n);if(o<56320||o>57343)return null;r+=t((i=65536+((1023&i)<<10)+(1023&o))>>18|240),r+=t(i>>12&63|128)}else r+=t(i>>12|224);r+=t(i>>6&63|128)}r+=t(63&i|128)}}return r},toString:function(e){for(var t="",r=0,o=i(e);r127){if(a>191&&a<224){if(r>=o)return null;a=(31&a)<<6|63&n(e,r)}else if(a>223&&a<240){if(r+1>=o)return null;a=(15&a)<<12|(63&n(e,r))<<6|63&n(e,++r)}else{if(!(a>239&&a<248))return null;if(r+2>=o)return null;a=(7&a)<<18|(63&n(e,r))<<12|(63&n(e,++r))<<6|63&n(e,++r)}++r}if(a<=65535)t+=String.fromCharCode(a);else{if(!(a<=1114111))return null;a-=65536,t+=String.fromCharCode(a>>10|55296),t+=String.fromCharCode(1023&a|56320)}}return t},fromNumber:function(e){var t=e.toString(16);return t.length%2==0?"0x"+t:"0x0"+t},toNumber:function(e){return parseInt(e.slice(2),16)},fromNat:function(e){return"0x0"===e?"0x":e.length%2==0?e:"0x0"+e.slice(2)},toNat:function(e){return"0"===e[2]?"0x"+e.slice(3):e},fromArray:a,toArray:o,fromUint8Array:function(e){return a([].slice.call(e,0))},toUint8Array:function(e){return new Uint8Array(o(e))}}},function(e){e.exports={COMPRESSED_TYPE_INVALID:"compressed should be a boolean",EC_PRIVATE_KEY_TYPE_INVALID:"private key should be a Buffer",EC_PRIVATE_KEY_LENGTH_INVALID:"private key length is invalid",EC_PRIVATE_KEY_RANGE_INVALID:"private key range is invalid",EC_PRIVATE_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting private key is invalid",EC_PRIVATE_KEY_TWEAK_MUL_FAIL:"tweak out of range",EC_PRIVATE_KEY_EXPORT_DER_FAIL:"couldn't export to DER format",EC_PRIVATE_KEY_IMPORT_DER_FAIL:"couldn't import from DER format",EC_PUBLIC_KEYS_TYPE_INVALID:"public keys should be an Array",EC_PUBLIC_KEYS_LENGTH_INVALID:"public keys Array should have at least 1 element",EC_PUBLIC_KEY_TYPE_INVALID:"public key should be a Buffer",EC_PUBLIC_KEY_LENGTH_INVALID:"public key length is invalid",EC_PUBLIC_KEY_PARSE_FAIL:"the public key could not be parsed or is invalid",EC_PUBLIC_KEY_CREATE_FAIL:"private was invalid, try again",EC_PUBLIC_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting public key is invalid",EC_PUBLIC_KEY_TWEAK_MUL_FAIL:"tweak out of range",EC_PUBLIC_KEY_COMBINE_FAIL:"the sum of the public keys is not valid",ECDH_FAIL:"scalar was invalid (zero or overflow)",ECDSA_SIGNATURE_TYPE_INVALID:"signature should be a Buffer",ECDSA_SIGNATURE_LENGTH_INVALID:"signature length is invalid",ECDSA_SIGNATURE_PARSE_FAIL:"couldn't parse signature",ECDSA_SIGNATURE_PARSE_DER_FAIL:"couldn't parse DER signature",ECDSA_SIGNATURE_SERIALIZE_DER_FAIL:"couldn't serialize signature to DER format",ECDSA_SIGN_FAIL:"nonce generation function failed or private key is invalid",ECDSA_RECOVER_FAIL:"couldn't recover public key from signature",MSG32_TYPE_INVALID:"message should be a Buffer",MSG32_LENGTH_INVALID:"message length is invalid",OPTIONS_TYPE_INVALID:"options should be an Object",OPTIONS_DATA_TYPE_INVALID:"options.data should be a Buffer",OPTIONS_DATA_LENGTH_INVALID:"options.data length is invalid",OPTIONS_NONCEFN_TYPE_INVALID:"options.noncefn should be a Function",RECOVERY_ID_TYPE_INVALID:"recovery should be a Number",RECOVERY_ID_VALUE_INVALID:"recovery should have value between -1 and 4",TWEAK_TYPE_INVALID:"tweak should be a Buffer",TWEAK_LENGTH_INVALID:"tweak length is invalid"}},function(e,t,r){const n=r(48),i=r(2).Buffer;function o(e,t){if("00"===e.slice(0,2))throw new Error("invalid RLP: extra zeros");return parseInt(e,t)}function a(e,t){if(e<56)return i.from([e+t]);var r=u(e),n=u(t+55+r.length/2);return i.from(n+r,"hex")}function s(e){return"0x"===e.slice(0,2)}function u(e){var t=e.toString(16);return t.length%2&&(t="0"+t),t}function f(e){if(!i.isBuffer(e))if("string"==typeof e)e=s(e)?i.from(function(e){return e.length%2&&(e="0"+e),e}(function(e){return"string"!=typeof e?e:s(e)?e.slice(2):e}(e)),"hex"):i.from(e);else if("number"==typeof e)e=e?function(e){var t=u(e);return i.from(t,"hex")}(e):i.from([]);else if(null===e||void 0===e)e=i.from([]);else{if(!e.toArray)throw new Error("invalid type");e=i.from(e.toArray())}return e}t.encode=function(e){if(e instanceof Array){for(var r=[],n=0;nt.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(s=t.slice(n,h)).length)throw new Error("invalid rlp, List has a invalid length");for(;s.length;)u=e(s),f.push(u.data),s=u.remainder;return{data:f,remainder:t.slice(h)}}(e=f(e));return t?r:(n.equal(r.remainder.length,0,"invalid remainder"),r.data)},t.getLength=function(e){if(!e||0===e.length)return i.from([]);var t=(e=f(e))[0];if(t<=127)return e.length;if(t<=183)return t-127;if(t<=191)return t-182;if(t<=247)return t-191;var r=t-246;return r+o(e.slice(1,r).toString("hex"),16)}},function(e,t,r){var n=r(99),i=r(370),o=r(393),a={noether:"0",wei:"1",kwei:"1000",Kwei:"1000",babbage:"1000",femtoether:"1000",mwei:"1000000",Mwei:"1000000",lovelace:"1000000",picoether:"1000000",gwei:"1000000000",Gwei:"1000000000",shannon:"1000000000",nanoether:"1000000000",nano:"1000000000",szabo:"1000000000000",microether:"1000000000000",micro:"1000000000000",finney:"1000000000000000",milliether:"1000000000000000",milli:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"},s=function(e,t,r){return new Array(t-e.length+1).join(r||"0")+e},u=function(e){e=o.encode(e);for(var t="",r=0;r7&&e[r].toUpperCase()!==e[r]||parseInt(t[r],16)<=7&&e[r].toLowerCase()!==e[r])return!1;return!0},m=function(e){return e instanceof n||e&&e.constructor&&"BigNumber"===e.constructor.name},g=function(e){return"string"==typeof e||e&&e.constructor&&"String"===e.constructor.name},v=function(e){return"boolean"==typeof e};e.exports={padLeft:s,padRight:function(e,t,r){return e+new Array(t-e.length+1).join(r||"0")},toHex:h,toDecimal:function(e){return l(e).toNumber()},fromDecimal:c,toUtf8:function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r7?r+=e[n].toUpperCase():r+=e[n];return r},isFunction:function(e){return"function"==typeof e},isString:g,isObject:function(e){return null!==e&&!Array.isArray(e)&&"object"==typeof e},isBoolean:v,isArray:function(e){return Array.isArray(e)},isJson:function(e){try{return!!JSON.parse(e)}catch(e){return!1}},isBloom:function(e){return!(!/^(0x)?[0-9a-f]{512}$/i.test(e)||!/^(0x)?[0-9a-f]{512}$/.test(e)&&!/^(0x)?[0-9A-F]{512}$/.test(e))},isTopic:function(e){return!(!/^(0x)?[0-9a-f]{64}$/i.test(e)||!/^(0x)?[0-9a-f]{64}$/.test(e)&&!/^(0x)?[0-9A-F]{64}$/.test(e))}}},function(e,t,r){e.exports=function(e){return function(t){var r=e,n=r.lib,i=n.WordArray,o=n.Hasher,a=r.algo,s=[],u=[];!function(){function e(e){for(var r=t.sqrt(e),n=2;n<=r;n++)if(!(e%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,i=0;i<64;)e(n)&&(i<8&&(s[i]=r(t.pow(n,.5))),u[i]=r(t.pow(n,1/3)),i++),n++}();var f=[],c=a.SHA256=o.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],c=r[5],h=r[6],d=r[7],l=0;l<64;l++){if(l<16)f[l]=0|e[t+l];else{var p=f[l-15],b=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,m=f[l-2],g=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;f[l]=b+f[l-7]+g+f[l-16]}var v=n&i^n&o^i&o,y=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),w=d+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&c^~s&h)+u[l]+f[l];d=h,h=c,c=s,s=a+w|0,a=o,o=i,i=n,n=w+(y+v)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0,r[5]=r[5]+c|0,r[6]=r[6]+h|0,r[7]=r[7]+d|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=t.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});r.SHA256=o._createHelper(c),r.HmacSHA256=o._createHmacHelper(c)}(Math),e.SHA256}(r(4))},function(e,t,r){e.exports=function(e){return function(){var t=e,r=t.lib.Hasher,n=t.x64,i=n.Word,o=n.WordArray,a=t.algo;function s(){return i.create.apply(i,arguments)}var u=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],f=[];!function(){for(var e=0;e<80;e++)f[e]=s()}();var c=a.SHA512=r.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],c=r[5],h=r[6],d=r[7],l=n.high,p=n.low,b=i.high,m=i.low,g=o.high,v=o.low,y=a.high,w=a.low,_=s.high,S=s.low,M=c.high,A=c.low,x=h.high,E=h.low,k=d.high,I=d.low,P=l,B=p,T=b,O=m,R=g,N=v,C=y,L=w,j=_,z=S,D=M,U=A,F=x,q=E,H=k,K=I,V=0;V<80;V++){var G=f[V];if(V<16)var Y=G.high=0|e[t+2*V],W=G.low=0|e[t+2*V+1];else{var Z=f[V-15],X=Z.high,J=Z.low,$=(X>>>1|J<<31)^(X>>>8|J<<24)^X>>>7,Q=(J>>>1|X<<31)^(J>>>8|X<<24)^(J>>>7|X<<25),ee=f[V-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),oe=f[V-7],ae=oe.high,se=oe.low,ue=f[V-16],fe=ue.high,ce=ue.low;Y=(Y=(Y=$+ae+((W=Q+se)>>>0>>0?1:0))+ne+((W+=ie)>>>0>>0?1:0))+fe+((W+=ce)>>>0>>0?1:0),G.high=Y,G.low=W}var he,de=j&D^~j&F,le=z&U^~z&q,pe=P&T^P&R^T&R,be=B&O^B&N^O&N,me=(P>>>28|B<<4)^(P<<30|B>>>2)^(P<<25|B>>>7),ge=(B>>>28|P<<4)^(B<<30|P>>>2)^(B<<25|P>>>7),ve=(j>>>14|z<<18)^(j>>>18|z<<14)^(j<<23|z>>>9),ye=(z>>>14|j<<18)^(z>>>18|j<<14)^(z<<23|j>>>9),we=u[V],_e=we.high,Se=we.low,Me=H+ve+((he=K+ye)>>>0>>0?1:0),Ae=ge+be;H=F,K=q,F=D,q=U,D=j,U=z,j=C+(Me=(Me=(Me=Me+de+((he+=le)>>>0>>0?1:0))+_e+((he+=Se)>>>0>>0?1:0))+Y+((he+=W)>>>0>>0?1:0))+((z=L+he|0)>>>0>>0?1:0)|0,C=R,L=N,R=T,N=O,T=P,O=B,P=Me+(me+pe+(Ae>>>0>>0?1:0))+((B=he+Ae|0)>>>0>>0?1:0)|0}p=n.low=p+B,n.high=l+P+(p>>>0>>0?1:0),m=i.low=m+O,i.high=b+T+(m>>>0>>0?1:0),v=o.low=v+N,o.high=g+R+(v>>>0>>0?1:0),w=a.low=w+L,a.high=y+C+(w>>>0>>0?1:0),S=s.low=S+z,s.high=_+j+(S>>>0>>0?1:0),A=c.low=A+U,c.high=M+D+(A>>>0>>0?1:0),E=h.low=E+q,h.high=x+F+(E>>>0>>0?1:0),I=d.low=I+K,d.high=k+H+(I>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});t.SHA512=r._createHelper(c),t.HmacSHA512=r._createHmacHelper(c)}(),e.SHA512}(r(4),r(74))},function(e,t,r){e.exports=function(e){return function(t){var r=e,n=r.lib,i=n.WordArray,o=n.Hasher,a=r.x64.Word,s=r.algo,u=[],f=[],c=[];!function(){for(var e=1,t=0,r=0;r<24;r++){u[e+5*t]=(r+1)*(r+2)/2%64;var n=(2*e+3*t)%5;e=t%5,t=n}for(e=0;e<5;e++)for(t=0;t<5;t++)f[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,o=0;o<24;o++){for(var s=0,h=0,d=0;d<7;d++){if(1&i){var l=(1<>>24)|4278255360&(o<<24|o>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(I=r[i]).high^=a,I.low^=o}for(var s=0;s<24;s++){for(var d=0;d<5;d++){for(var l=0,p=0,b=0;b<5;b++)l^=(I=r[d+5*b]).high,p^=I.low;var m=h[d];m.high=l,m.low=p}for(d=0;d<5;d++){var g=h[(d+4)%5],v=h[(d+1)%5],y=v.high,w=v.low;for(l=g.high^(y<<1|w>>>31),p=g.low^(w<<1|y>>>31),b=0;b<5;b++)(I=r[d+5*b]).high^=l,I.low^=p}for(var _=1;_<25;_++){var S=(I=r[_]).high,M=I.low,A=u[_];A<32?(l=S<>>32-A,p=M<>>32-A):(l=M<>>64-A,p=S<>>64-A);var x=h[f[_]];x.high=l,x.low=p}var E=h[0],k=r[0];for(E.high=k.high,E.low=k.low,d=0;d<5;d++)for(b=0;b<5;b++){var I=r[_=d+5*b],P=h[_],B=h[(d+1)%5+5*b],T=h[(d+2)%5+5*b];I.high=P.high^~B.high&T.high,I.low=P.low^~B.low&T.low}I=r[0];var O=c[s];I.high^=O.high,I.low^=O.low}},_doFinalize:function(){var e=this._data,r=e.words,n=(this._nDataBytes,8*e.sigBytes),o=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(t.ceil((n+1)/o)*o>>>5)-1]|=128,e.sigBytes=4*r.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,u=s/8,f=[],c=0;c>>24)|4278255360&(d<<24|d>>>8),l=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8),f.push(l),f.push(d)}return new i.init(f,s)},clone:function(){for(var e=o.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});r.SHA3=o._createHelper(d),r.HmacSHA3=o._createHmacHelper(d)}(Math),e.SHA3}(r(4),r(74))},function(e,t,r){var n=r(167),i=function(e,t){this.value=e||"",this.offset=t};i.prototype.dynamicPartLength=function(){return this.dynamicPart().length/2},i.prototype.withOffset=function(e){return new i(this.value,e)},i.prototype.combine=function(e){return new i(this.value+e.value)},i.prototype.isDynamic=function(){return void 0!==this.offset},i.prototype.offsetAsBytes=function(){return this.isDynamic()?n.padLeft(n.toTwosComplement(this.offset).toString(16),64):""},i.prototype.staticPart=function(){return this.isDynamic()?this.offsetAsBytes():this.value},i.prototype.dynamicPart=function(){return this.isDynamic()?this.value:""},i.prototype.encode=function(){return this.staticPart()+this.dynamicPart()},i.encodeList=function(e){var t=32*e.length,r=e.map(function(e){if(!e.isDynamic())return e;var r=t;return t+=e.dynamicPartLength(),e.withOffset(r)});return r.reduce(function(e,t){return e+t.dynamicPart()},r.reduce(function(e,t){return e+t.staticPart()},""))},e.exports=i},function(e,t,r){(function(t){r(98);var n=r(102);function i(e){var r=new t(e,"hex").toString("base64");return n.util.decodeBase64(r)}function o(e,t,r,o,a){if(!e.isDerivedKeyCorrect(t))throw new Error("Incorrect derived key!");var s=i(e.exportPrivateKey(o,t)),u=i(a),f=n.randomBytes(n.box.nonceLength),c=n.box(r,f,u,s);return{alg:"curve25519-xsalsa20-poly1305",nonce:n.util.encodeBase64(f),ciphertext:n.util.encodeBase64(c)}}function a(e,t,r,o,a){if(!e.isDerivedKeyCorrect(t))throw new Error("Incorrect derived key!");var s=i(e.exportPrivateKey(a,t)),u=i(o),f=n.util.decodeBase64(r.nonce),c=n.util.decodeBase64(r.ciphertext);return n.box.open(c,f,u,s)}e.exports={asymEncryptString:function(e,t,r,i,a){if(!e.isDerivedKeyCorrect(t))throw new Error("Incorrect derived key!");return o(e,t,n.util.decodeUTF8(r),i,a)},asymDecryptString:function(e,t,r,i,o){if(!e.isDerivedKeyCorrect(t))throw new Error("Incorrect derived key!");var s=a(e,t,r,i,o);return!1!==s&&n.util.encodeUTF8(s)},multiEncryptString:function(e,t,r,i,a){if(!e.isDerivedKeyCorrect(t))throw new Error("Incorrect derived key!");var s=n.util.decodeUTF8(r),u=n.randomBytes(n.secretbox.keyLength),f=n.randomBytes(n.secretbox.nonceLength),c=n.secretbox(s,f,u);if(a.length<1)throw new Error("Found no pubkeys to encrypt to.");var h={};h=[];for(var d=0;d=2&&"0x"===e.slice(0,2)?e.slice(2):e}function p(e){return"string"!=typeof e?e:e.length<2||"0x"!==e.slice(0,2)?"0x"+e:e}function b(e,t,r){for(var n="",i=0;i0},m._encryptString=v,m._decryptString=function(e,t){var r=c.util.decodeBase64(e.encStr),n=c.util.decodeBase64(e.nonce),i=c.secretbox.open(r,n,t);if(void 0===i)throw new Error("Decryption failed!");return c.util.encodeUTF8(i)},m._encryptKey=function(e,r){var n=function(e){var r=new t(e,"hex").toString("base64");return c.util.decodeBase64(r)}(e),i=c.randomBytes(c.secretbox.nonceLength),o=c.secretbox(n,i,r);return o={key:c.util.encodeBase64(o),nonce:c.util.encodeBase64(i)}},m._decryptKey=function(e,r){var n=c.util.decodeBase64(e.key),i=c.util.decodeBase64(e.nonce),o=c.secretbox.open(n,i,r);if(void 0===o)throw new Error("Decryption failed!");return function(e){var r=c.util.encodeBase64(e);return new t(r,"base64").toString("hex")}(o)},m._computeAddressFromPrivKey=function(e){var t=o.genKeyPair();t._importPrivate(e,"hex");var r=t.getPublic(!1,"hex").slice(2),i=n.enc.Hex.parse(r);return n.SHA3(i,{outputLength:256}).toString(n.enc.Hex).slice(24)},m._computePubkeyFromPrivKey=function(e,r){if("curve25519"!==r)throw new Error('KeyStore._computePubkeyFromPrivKey: Only "curve25519" supported.');var n=new t(e,"hex").toString("base64"),i=c.util.decodeBase64(n),o=c.box.keyPair.fromSecretKey(i).publicKey,a=c.util.encodeBase64(o);return new t(a,"base64").toString("hex")},m.prototype._generatePrivKeys=function(e,t){if(!this.isDerivedKeyCorrect(e))throw new Error("Incorrect derived key!");var r=m._decryptString(this.encHdRootPriv,e);if(0===r.length)throw new Error("Provided password derived key is wrong");for(var n=[],i=0;i32)throw new Error("Private key larger than 32 bytes. Aborting!");var u=m._encryptKey(s,e);n[i]={privKey:s,encPrivKey:u}}return n},m._concatAndSha256=function(e,r){var n=t.concat([e,r]);if(n.length!==e.length+r.length)throw new Error("generateRandomSeed: Logic error! Concatenation of entropy sources failed.");return u.sha256(n)},m.generateRandomSeed=function(e){var r="";if(void 0===e)r=new f(f.Words.ENGLISH);else{if("string"!=typeof e)throw new Error("generateRandomSeed: extraEntropy is set but not a string.");var n=new t(e),i=s.getRandomBuffer(32),o=this._concatAndSha256(i,n).slice(0,16);r=new f(o,f.Words.ENGLISH)}return r.toString()},m.isSeedValid=function(e){return f.isValid(e,f.Words.ENGLISH)},m.deserialize=function(e){var t=JSON.parse(e);if(void 0===t.version||3!==t.version)throw new Error("Old version of serialized keystore. Please use KeyStore.upgradeOldSerialized() to convert it to the latest version.");var r=new m;return r.salt=t.salt,r.hdPathString=t.hdPathString,r.encSeed=t.encSeed,r.encHdRootPriv=t.encHdRootPriv,r.version=t.version,r.hdIndex=t.hdIndex,r.encPrivKeys=t.encPrivKeys,r.addresses=t.addresses,r},m.deriveKeyFromPasswordAndSalt=function(e,t,r){r||"function"!=typeof t?t||"function"!=typeof r||(t="lightwalletSalt"):(r=t,t="lightwalletSalt");h(e,t,14,8,32,200,function(e){var t=null,n=null;try{n=new Uint8Array(e)}catch(e){t=e}r(t,n)},null)},m.prototype.serialize=function(){var e={encSeed:this.encSeed,encHdRootPriv:this.encHdRootPriv,addresses:this.addresses,encPrivKeys:this.encPrivKeys,hdPathString:this.hdPathString,salt:this.salt,hdIndex:this.hdIndex,version:this.version};return JSON.stringify(e)},m.prototype.getAddresses=function(){return this.addresses.map(function(e){return p(e)})},m.prototype.getSeed=function(e){if(!this.isDerivedKeyCorrect(e))throw new Error("Incorrect derived key!");return m._decryptString(this.encSeed,e).trim()},m.prototype.exportPrivateKey=function(e,t){if(!this.isDerivedKeyCorrect(t))throw new Error("Incorrect derived key!");e=l(e);if(void 0===this.encPrivKeys[e])throw new Error("KeyStore.exportPrivateKey: Address not found in KeyStore");var r=this.encPrivKeys[e];return m._decryptKey(r,t)},m.prototype.generateNewAddress=function(e,t){if(!this.isDerivedKeyCorrect(e))throw new Error("Incorrect derived key!");if(!this.encSeed)throw new Error("KeyStore.generateNewAddress: No seed set");t=t||1;for(var r=this._generatePrivKeys(e,t),n=0;n>1,f=i.getN(),c=i.getG(),d=u?r.add(f):r,l=i.fromX(s,d);if(!l.mul(f).isInfinity())throw new Error("nR is not a valid curve point");var p=t.neg().umod(f),b=r.invm(f),m=l.mul(o).add(c.mul(p)).mul(b);return a.fromPoint(m,this.sig.compressed)},d.prototype.sigError=function(){if(!f.isBuffer(this.hashbuf)||32!==this.hashbuf.length)return"hashbuf must be a 32 byte buffer";var e=this.sig.r,t=this.sig.s;if(!(e.gt(n.Zero)&&e.lt(i.getN())&&t.gt(n.Zero)&&t.lt(i.getN())))return"r and s not in range";var r=n.fromBuffer(this.hashbuf,this.endian?{endian:this.endian}:void 0),o=i.getN(),a=t.invm(o),s=a.mul(r).umod(o),u=a.mul(e).umod(o),c=i.getG().mulAdd(s,this.pubkey.point,u);return c.isInfinity()?"p is infinity":0!==c.getX().umod(o).cmp(e)&&"Invalid signature"},d.toLowS=function(e){return e.gt(n.fromBuffer(new t("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))&&(e=i.getN().sub(e)),e},d.prototype._findSignature=function(e,t){var r,o,a,s=i.getN(),u=i.getG(),f=0;do{(!this.k||f>0)&&this.deterministicK(f),f++,r=this.k,o=u.mul(r).x.umod(s),a=r.invm(s).mul(t.add(e.mul(o))).umod(s)}while(o.cmp(n.Zero)<=0||a.cmp(n.Zero)<=0);return{s:a=d.toLowS(a),r:o}},d.prototype.sign=function(){var e=this.hashbuf,t=this.privkey,r=t.bn;h.checkState(e&&t&&r,new Error("invalid parameters")),h.checkState(f.isBuffer(e)&&32===e.length,new Error("hashbuf must be a 32 byte buffer"));var i=n.fromBuffer(e,this.endian?{endian:this.endian}:void 0),a=this._findSignature(r,i);return a.compressed=this.pubkey.compressed,this.sig=new o(a),this},d.prototype.signRandomK=function(){return this.randomK(),this.sign()},d.prototype.toString=function(){var e={};return this.hashbuf&&(e.hashbuf=this.hashbuf.toString("hex")),this.privkey&&(e.privkey=this.privkey.toString()),this.pubkey&&(e.pubkey=this.pubkey.toString()),this.sig&&(e.sig=this.sig.toString()),this.k&&(e.k=this.k.toString()),JSON.stringify(e)},d.prototype.verify=function(){return this.sigError()?this.verified=!1:this.verified=!0,this},d.sign=function(e,t,r){return d().set({hashbuf:e,endian:r,privkey:t}).sign().sig},d.verify=function(e,t,r,n){return d().set({hashbuf:e,endian:n,sig:t,pubkey:r}).verify().verified},e.exports=d}).call(this,r(0).Buffer)},function(e,t,r){var n=r(433);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},function(e,t,r){"use strict";(function(t){var n=r(43),i=r(32),o=r(28),a=r(13),s=r(103),u=r(27),f=r(22),c=r(42),h=r(6),d=r(5),l=r(19),p=r(0),b=r(8),m=r(9),g=function e(t){return this instanceof e?(this.chunks=[],b.isBuffer(t)?e.fromBuffer(t):t instanceof n?e.fromAddress(t):t instanceof e?e.fromBuffer(t.toBuffer()):d.isString(t)?e.fromString(t):void(d.isObject(t)&&d.isArray(t.chunks)&&this.set(t))):new e(t)};g.prototype.set=function(e){return h.checkArgument(d.isObject(e)),h.checkArgument(d.isArray(e.chunks)),this.chunks=e.chunks,this},g.fromBuffer=function(e){var t=new g;t.chunks=[];for(var r=new i(e);!r.finished();)try{var n,o,a=r.readUInt8();a>0&&a0&&a0&&(i=n?i+" "+e.buf.toString("hex"):i+" "+e.len+" 0x"+e.buf.toString("hex"));else if(void 0!==s.reverseMap[r])n?0===r?i+=" 0":79===r?i+=" -1":i=i+" "+s(r).toString():i=i+" "+s(r).toString();else{var o=r.toString(16);o.length%2!=0&&(o="0"+o),i=n?i+" "+o:i+" 0x"+o}return i},g.prototype.toASM=function(){for(var e="",t=0;t"},g.prototype.isPublicKeyHashOut=function(){return!(5!==this.chunks.length||this.chunks[0].opcodenum!==s.OP_DUP||this.chunks[1].opcodenum!==s.OP_HASH160||!this.chunks[2].buf||20!==this.chunks[2].buf.length||this.chunks[3].opcodenum!==s.OP_EQUALVERIFY||this.chunks[4].opcodenum!==s.OP_CHECKSIG)},g.prototype.isPublicKeyHashIn=function(){if(2===this.chunks.length){var e=this.chunks[0].buf,t=this.chunks[1].buf;if(e&&e.length&&48===e[0]&&t&&t.length){var r=t[0];if((4===r||6===r||7===r)&&65===t.length)return!0;if((3===r||2===r)&&33===t.length)return!0}}return!1},g.prototype.getPublicKey=function(){return h.checkState(this.isPublicKeyOut(),"Can't retrieve PublicKey from a non-PK output"),this.chunks[0].buf},g.prototype.getPublicKeyHash=function(){return h.checkState(this.isPublicKeyHashOut(),"Can't retrieve PublicKeyHash from a non-PKH output"),this.chunks[2].buf},g.prototype.isPublicKeyOut=function(){if(2===this.chunks.length&&this.chunks[0].buf&&this.chunks[0].buf.length&&this.chunks[1].opcodenum===s.OP_CHECKSIG){var e=this.chunks[0].buf,t=e[0],r=!1;if((4!==t&&6!==t&&7!==t||65!==e.length)&&(3!==t&&2!==t||33!==e.length)||(r=!0),r)return u.isValid(e)}return!1},g.prototype.isPublicKeyIn=function(){if(1===this.chunks.length){var e=this.chunks[0].buf;if(e&&e.length&&48===e[0])return!0}return!1},g.prototype.isScriptHashOut=function(){var e=this.toBuffer();return 23===e.length&&e[0]===s.OP_HASH160&&20===e[1]&&e[e.length-1]===s.OP_EQUAL},g.prototype.isScriptHashIn=function(){if(this.chunks.length<=1)return!1;var e,t=this.chunks[this.chunks.length-1].buf;if(!t)return!1;try{e=g.fromBuffer(t)}catch(e){if(e instanceof l.Script.InvalidBuffer)return!1;throw e}return e.classify()!==g.types.UNKNOWN},g.prototype.isMultisigOut=function(){return this.chunks.length>3&&s.isSmallIntOp(this.chunks[0].opcodenum)&&this.chunks.slice(1,this.chunks.length-2).every(function(e){return e.buf&&b.isBuffer(e.buf)})&&s.isSmallIntOp(this.chunks[this.chunks.length-2].opcodenum)&&this.chunks[this.chunks.length-1].opcodenum===s.OP_CHECKMULTISIG},g.prototype.isMultisigIn=function(){return this.chunks.length>=2&&0===this.chunks[0].opcodenum&&this.chunks.slice(1,this.chunks.length).every(function(e){return e.buf&&b.isBuffer(e.buf)&&f.isTxDER(e.buf)})},g.prototype.isDataOut=function(){return this.chunks.length>=1&&this.chunks[0].opcodenum===s.OP_RETURN&&(1===this.chunks.length||2===this.chunks.length&&this.chunks[1].buf&&this.chunks[1].buf.length<=g.OP_RETURN_STANDARD_SIZE&&this.chunks[1].length===this.chunks.len)},g.prototype.getData=function(){if(this.isDataOut()||this.isScriptHashOut())return d.isUndefined(this.chunks[1])?new t(0):new t(this.chunks[1].buf);if(this.isPublicKeyHashOut())return new t(this.chunks[2].buf);throw new Error("Unrecognized script type to get data from")},g.prototype.isPushOnly=function(){return d.every(this.chunks,function(e){return e.opcodenum<=s.OP_16})},(g.types={}).UNKNOWN="Unknown",g.types.PUBKEY_OUT="Pay to public key",g.types.PUBKEY_IN="Spend from public key",g.types.PUBKEYHASH_OUT="Pay to public key hash",g.types.PUBKEYHASH_IN="Spend from public key hash",g.types.SCRIPTHASH_OUT="Pay to script hash",g.types.SCRIPTHASH_IN="Spend from script hash",g.types.MULTISIG_OUT="Pay to multisig",g.types.MULTISIG_IN="Spend from multisig",g.types.DATA_OUT="Data push",g.OP_RETURN_STANDARD_SIZE=80,g.prototype.classify=function(){if(this._isInput)return this.classifyInput();if(this._isOutput)return this.classifyOutput();var e=this.classifyOutput();return e!=g.types.UNKNOWN?e:this.classifyInput()},(g.outputIdentifiers={}).PUBKEY_OUT=g.prototype.isPublicKeyOut,g.outputIdentifiers.PUBKEYHASH_OUT=g.prototype.isPublicKeyHashOut,g.outputIdentifiers.MULTISIG_OUT=g.prototype.isMultisigOut,g.outputIdentifiers.SCRIPTHASH_OUT=g.prototype.isScriptHashOut,g.outputIdentifiers.DATA_OUT=g.prototype.isDataOut,g.prototype.classifyOutput=function(){for(var e in g.outputIdentifiers)if(g.outputIdentifiers[e].bind(this)())return g.types[e];return g.types.UNKNOWN},(g.inputIdentifiers={}).PUBKEY_IN=g.prototype.isPublicKeyIn,g.inputIdentifiers.PUBKEYHASH_IN=g.prototype.isPublicKeyHashIn,g.inputIdentifiers.MULTISIG_IN=g.prototype.isMultisigIn,g.inputIdentifiers.SCRIPTHASH_IN=g.prototype.isScriptHashIn,g.prototype.classifyInput=function(){for(var e in g.inputIdentifiers)if(g.inputIdentifiers[e].bind(this)())return g.types[e];return g.types.UNKNOWN},g.prototype.isStandard=function(){return this.classify()!==g.types.UNKNOWN},g.prototype.prepend=function(e){return this._addByType(e,!0),this},g.prototype.equals=function(e){if(h.checkState(e instanceof g,"Must provide another script"),this.chunks.length!==e.chunks.length)return!1;var t;for(t=0;t=0&&n=1&&r[0]<=16?n===s.OP_1+(r[0]-1):1===r.length&&129===r[0]?n===s.OP_1NEGATE:r.length<=75?n===r.length:r.length<=255?n===s.OP_PUSHDATA1:!(r.length<=65535)||n===s.OP_PUSHDATA2)},g.prototype._decodeOP_N=function(e){if(e===s.OP_0)return 0;if(e>=s.OP_1&&e<=s.OP_16)return e-(s.OP_1-1);throw new Error("Invalid opcode: "+JSON.stringify(e))},g.prototype.getSignatureOperationsCount=function(e){e=!!d.isUndefined(e)||e;var t=this,r=0,n=s.OP_INVALIDOPCODE;return d.each(t.chunks,function(i){var o=i.opcodenum;o==s.OP_CHECKSIG||o==s.OP_CHECKSIGVERIFY?r++:o!=s.OP_CHECKMULTISIG&&o!=s.OP_CHECKMULTISIGVERIFY||(e&&n>=s.OP_1&&n<=s.OP_16?r+=t._decodeOP_N(n):r+=20),n=o}),r},e.exports=g}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=r(5),i=r(6),o=r(9),a=r(23),s=r(43),u=r(106);function f(e){if(!(this instanceof f))return new f(e);i.checkArgument(n.isObject(e),"Must provide an object from where to extract data");var t=e.address?new s(e.address):void 0,r=e.txid?e.txid:e.txId;if(!r||!o.isHexaString(r)||r.length>64)throw new Error("Invalid TXID in object",e);var c=n.isUndefined(e.vout)?e.outputIndex:e.vout;if(!n.isNumber(c))throw new Error("Invalid outputIndex, received "+c);i.checkArgument(!n.isUndefined(e.scriptPubKey)||!n.isUndefined(e.script),"Must provide the scriptPubKey for that output!");var h=new a(e.scriptPubKey||e.script);i.checkArgument(!n.isUndefined(e.amount)||!n.isUndefined(e.satoshis),"Must provide an amount for the output");var d=n.isUndefined(e.amount)?e.satoshis:new u.fromBTC(e.amount).toSatoshis();i.checkArgument(n.isNumber(d),"Amount must be a number"),o.defineImmutable(this,{address:t,txId:r,outputIndex:c,script:h,satoshis:d})}f.prototype.inspect=function(){return""},f.prototype.toString=function(){return this.txId+":"+this.outputIndex},f.fromObject=function(e){return new f(e)},f.prototype.toObject=f.prototype.toJSON=function(){return{address:this.address?this.address.toString():void 0,txid:this.txId,vout:this.outputIndex,scriptPubKey:this.script.toBuffer().toString("hex"),amount:u.fromSatoshis(this.satoshis).toBTC()}},e.exports=f},function(e,t,r){"use strict";(function(t){var n=r(5),i=r(82),o=r(8),a=r(32),s=r(28),u=r(13),f=(r(9),r(80)),c=r(19),h=r(6);function d(e){if(!(this instanceof d))return new d(e);var t={};if(o.isBuffer(e))t=d._fromBufferReader(a(e));else{if(!n.isObject(e))throw new TypeError("Unrecognized argument for MerkleBlock");t={header:e.header instanceof i?e.header:i.fromObject(e.header),numTransactions:e.numTransactions,hashes:e.hashes,flags:e.flags}}return n.extend(this,t),this._flagBitsUsed=0,this._hashesUsed=0,this}d.fromBuffer=function(e){return d.fromBufferReader(a(e))},d.fromBufferReader=function(e){return new d(d._fromBufferReader(e))},d.prototype.toBuffer=function(){return this.toBufferWriter().concat()},d.prototype.toBufferWriter=function(e){e||(e=new s),e.write(this.header.toBuffer()),e.writeUInt32LE(this.numTransactions),e.writeVarintNum(this.hashes.length);for(var r=0;rthis.numTransactions)return!1;if(8*this.flags.lengththis.numTransactions)throw new c.MerkleBlock.InvalidMerkleTree;if(8*this.flags.length8*this.flags.length)return null;var o=this.flags[n.flagBitsUsed>>3]>>>(7&n.flagBitsUsed++)&1;if(0!==e&&o){var a=this._traverseMerkleTree(e-1,2*r,n),s=a;return 2*r+1=this.hashes.length)return null;var f=this.hashes[n.hashesUsed++];return 0===e&&o&&n.txs.push(f),new t(f,"hex")},d.prototype._calcTreeWidth=function(e){return this.numTransactions+(1<>e},d.prototype._calcTreeHeight=function(){for(var e=0;this._calcTreeWidth(e)>1;)e++;return e},d.prototype.hasTransaction=function(e){h.checkArgument(!n.isUndefined(e),"tx cannot be undefined"),h.checkArgument(e instanceof f||"string"==typeof e,'Invalid tx given, tx must be a "string" or "Transaction"');var r=e;e instanceof f&&(r=o.reverse(new t(e.id,"hex")).toString("hex"));var i=[],a=this._calcTreeHeight();return this._traverseMerkleTree(a,0,{txs:i}),-1!==i.indexOf(r)},d._fromBufferReader=function(e){h.checkState(!e.finished(),"No merkleblock data received");var t={};t.header=i.fromBufferReader(e),t.numTransactions=e.readUInt32LE();var r=e.readVarintNum();t.hashes=[];for(var n=0;n=0&&e=y.Hardened||t,e64)throw new m.InvalidEntropyArgument.TooMuchEntropy(e);var n=c.sha512hmac(e,new i.Buffer("Bitcoin seed"));return new y({network:h.get(r)||h.defaultNetwork,depth:0,parentFingerPrint:0,childIndex:0,privateKey:n.slice(0,32),chainCode:n.slice(32,64)})},y.prototype._calcHDPublicKey=function(){if(!this._hdPublicKey){var e=r(181);this._hdPublicKey=new e(this)}},y.prototype._buildFromBuffers=function(e){y._validateBufferArguments(e),v.defineImmutable(this,{_buffers:e});var r=[e.version,e.depth,e.parentFingerPrint,e.childIndex,e.chainCode,g.emptyBuffer(1),e.privateKey],n=i.Buffer.concat(r);if(e.checksum&&e.checksum.length){if(e.checksum.toString()!==f.checksum(n).toString())throw new b.InvalidB58Checksum(n)}else e.checksum=f.checksum(n);var o,a=h.get(g.integerFromBuffer(e.version));o=f.encode(i.Buffer.concat(r)),e.xprivkey=new t(o);var u=new l(s.fromBuffer(e.privateKey),a),d=u.toPublicKey(),p=y.ParentFingerPrintSize,m=c.sha256ripemd160(d.toBuffer()).slice(0,p);return v.defineImmutable(this,{xprivkey:o,network:a,depth:g.integerFromSingleByteBuffer(e.depth),privateKey:u,publicKey:d,fingerPrint:m}),this._hdPublicKey=null,Object.defineProperty(this,"hdPublicKey",{configurable:!1,enumerable:!0,get:function(){return this._calcHDPublicKey(),this._hdPublicKey}}),Object.defineProperty(this,"xpubkey",{configurable:!1,enumerable:!0,get:function(){return this._calcHDPublicKey(),this._hdPublicKey.xpubkey}}),this},y._validateBufferArguments=function(e){var t=function(t,r){var i=e[t];n(g.isBuffer(i),t+" argument is not a buffer"),n(i.length===r,t+" has not the expected size: found "+i.length+", expected "+r)};t("version",y.VersionSize),t("depth",y.DepthSize),t("parentFingerPrint",y.ParentFingerPrintSize),t("childIndex",y.ChildIndexSize),t("chainCode",y.ChainCodeSize),t("privateKey",y.PrivateKeySize),e.checksum&&e.checksum.length&&t("checksum",y.CheckSumSize)},y.prototype.toString=function(){return this.xprivkey},y.prototype.inspect=function(){return""},y.prototype.toObject=y.prototype.toJSON=function(){return{network:h.get(g.integerFromBuffer(this._buffers.version),"xprivkey").name,depth:g.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:g.integerFromBuffer(this.fingerPrint),parentFingerPrint:g.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:g.integerFromBuffer(this._buffers.childIndex),chainCode:g.bufferToHex(this._buffers.chainCode),privateKey:this.privateKey.toBuffer().toString("hex"),checksum:g.integerFromBuffer(this._buffers.checksum),xprivkey:this.xprivkey}},y.fromBuffer=function(e){return new y(e.toString())},y.prototype.toBuffer=function(){return g.copy(this._buffers.xprivkey)},y.DefaultDepth=0,y.DefaultFingerprint=0,y.DefaultChildIndex=0,y.Hardened=2147483648,y.MaxIndex=2*y.Hardened,y.RootElementAlias=["m","M","m'","M'"],y.VersionSize=4,y.DepthSize=1,y.ParentFingerPrintSize=4,y.ChildIndexSize=4,y.ChainCodeSize=32,y.PrivateKeySize=32,y.CheckSumSize=4,y.DataLength=78,y.SerializedByteSize=82,y.VersionStart=0,y.VersionEnd=y.VersionStart+y.VersionSize,y.DepthStart=y.VersionEnd,y.DepthEnd=y.DepthStart+y.DepthSize,y.ParentFingerPrintStart=y.DepthEnd,y.ParentFingerPrintEnd=y.ParentFingerPrintStart+y.ParentFingerPrintSize,y.ChildIndexStart=y.ParentFingerPrintEnd,y.ChildIndexEnd=y.ChildIndexStart+y.ChildIndexSize,y.ChainCodeStart=y.ChildIndexEnd,y.ChainCodeEnd=y.ChainCodeStart+y.ChainCodeSize,y.PrivateKeyStart=y.ChainCodeEnd+1,y.PrivateKeyEnd=y.PrivateKeyStart+y.PrivateKeySize,y.ChecksumStart=y.PrivateKeyEnd,y.ChecksumEnd=y.ChecksumStart+y.CheckSumSize,n(y.ChecksumEnd===y.SerializedByteSize),e.exports=y}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(t){var n=r(5),i=r(6),o=r(12),a=r(79),s=r(61),u=r(13),f=r(180),c=r(42),h=r(52),d=r(27),l=r(19),p=l,b=l.HDPublicKey,m=r(48),g=r(9),v=r(8);function y(e){if(e instanceof y)return e;if(!(this instanceof y))return new y(e);if(e){if(n.isString(e)||v.isBuffer(e)){var t=y.getSerializedError(e);if(t){if(v.isBuffer(e)&&!y.getSerializedError(e.toString()))return this._buildFromSerialized(e.toString());if(t instanceof b.ArgumentIsPrivateExtended)return new f(e).hdPublicKey;throw t}return this._buildFromSerialized(e)}if(n.isObject(e))return e instanceof f?this._buildFromPrivate(e):this._buildFromObject(e);throw new b.UnrecognizedArgument(e)}throw new b.MustSupplyArgument}y.isValidPath=function(e){if(n.isString(e)){var t=f._getDerivationIndexes(e);return null!==t&&n.every(t,y.isValidPath)}return!!n.isNumber(e)&&(e>=0&&e=y.Hardened||t)throw new b.InvalidIndexCantDeriveHardened;if(e<0)throw new b.InvalidPath(e);var r,n=v.integerAsBuffer(e),i=v.concat([this.publicKey.toBuffer(),n]),a=u.sha512hmac(i,this._buffers.chainCode),s=o.fromBuffer(a.slice(0,32),{size:32}),f=a.slice(32,64);try{r=d.fromPoint(h.getG().mul(s).add(this.publicKey.point))}catch(t){return this._deriveWithNumber(e+1)}return new y({network:this.network,depth:this.depth+1,parentFingerPrint:this.fingerPrint,childIndex:e,chainCode:f,publicKey:r})},y.prototype._deriveFromString=function(e){if(n.includes(e,"'"))throw new b.InvalidIndexCantDeriveHardened;if(!y.isValidPath(e))throw new b.InvalidPath(e);return f._getDerivationIndexes(e).reduce(function(e,t){return e._deriveWithNumber(t)},this)},y.isValidSerialized=function(e,t){return n.isNull(y.getSerializedError(e,t))},y.getSerializedError=function(e,t){if(!n.isString(e)&&!v.isBuffer(e))return new b.UnrecognizedArgument("expected buffer or string");if(!a.validCharacters(e))return new p.InvalidB58Char("(unknown)",e);try{e=s.decode(e)}catch(t){return new p.InvalidB58Checksum(e)}if(e.length!==y.DataSize)return new b.InvalidLength(e);if(!n.isUndefined(t)){var r=y._validateNetwork(e,t);if(r)return r}var i=v.integerFromBuffer(e.slice(0,4));return i===c.livenet.xprivkey||i===c.testnet.xprivkey?new b.ArgumentIsPrivateExtended:null},y._validateNetwork=function(e,t){var r=c.get(t);if(!r)return new p.InvalidNetworkArgument(t);var n=e.slice(y.VersionStart,y.VersionEnd);return v.integerFromBuffer(n)!==r.xpubkey?new p.InvalidNetwork(n):null},y.prototype._buildFromPrivate=function(e){var t=n.clone(e._buffers),r=h.getG().mul(o.fromBuffer(t.privateKey));return t.publicKey=h.pointToCompressed(r),t.version=v.integerAsBuffer(c.get(v.integerFromBuffer(t.version)).xpubkey),t.privateKey=void 0,t.checksum=void 0,t.xprivkey=void 0,this._buildFromBuffers(t)},y.prototype._buildFromObject=function(e){var t={version:e.network?v.integerAsBuffer(c.get(e.network).xpubkey):e.version,depth:n.isNumber(e.depth)?v.integerAsSingleByteBuffer(e.depth):e.depth,parentFingerPrint:n.isNumber(e.parentFingerPrint)?v.integerAsBuffer(e.parentFingerPrint):e.parentFingerPrint,childIndex:n.isNumber(e.childIndex)?v.integerAsBuffer(e.childIndex):e.childIndex,chainCode:n.isString(e.chainCode)?v.hexToBuffer(e.chainCode):e.chainCode,publicKey:n.isString(e.publicKey)?v.hexToBuffer(e.publicKey):v.isBuffer(e.publicKey)?e.publicKey:e.publicKey.toBuffer(),checksum:n.isNumber(e.checksum)?v.integerAsBuffer(e.checksum):e.checksum};return this._buildFromBuffers(t)},y.prototype._buildFromSerialized=function(e){var t=s.decode(e),r={version:t.slice(y.VersionStart,y.VersionEnd),depth:t.slice(y.DepthStart,y.DepthEnd),parentFingerPrint:t.slice(y.ParentFingerPrintStart,y.ParentFingerPrintEnd),childIndex:t.slice(y.ChildIndexStart,y.ChildIndexEnd),chainCode:t.slice(y.ChainCodeStart,y.ChainCodeEnd),publicKey:t.slice(y.PublicKeyStart,y.PublicKeyEnd),checksum:t.slice(y.ChecksumStart,y.ChecksumEnd),xpubkey:e};return this._buildFromBuffers(r)},y.prototype._buildFromBuffers=function(e){y._validateBufferArguments(e),g.defineImmutable(this,{_buffers:e});var r=[e.version,e.depth,e.parentFingerPrint,e.childIndex,e.chainCode,e.publicKey],n=v.concat(r),i=s.checksum(n);if(e.checksum&&e.checksum.length){if(e.checksum.toString("hex")!==i.toString("hex"))throw new p.InvalidB58Checksum(n,i)}else e.checksum=i;var o,a=c.get(v.integerFromBuffer(e.version));o=s.encode(v.concat(r)),e.xpubkey=new t(o);var f=new d(e.publicKey,{network:a}),h=y.ParentFingerPrintSize,l=u.sha256ripemd160(f.toBuffer()).slice(0,h);return g.defineImmutable(this,{xpubkey:o,network:a,depth:v.integerFromSingleByteBuffer(e.depth),publicKey:f,fingerPrint:l}),this},y._validateBufferArguments=function(e){var t=function(t,r){var n=e[t];m(v.isBuffer(n),t+" argument is not a buffer, it's "+typeof n),m(n.length===r,t+" has not the expected size: found "+n.length+", expected "+r)};t("version",y.VersionSize),t("depth",y.DepthSize),t("parentFingerPrint",y.ParentFingerPrintSize),t("childIndex",y.ChildIndexSize),t("chainCode",y.ChainCodeSize),t("publicKey",y.PublicKeySize),e.checksum&&e.checksum.length&&t("checksum",y.CheckSumSize)},y.fromString=function(e){return i.checkArgument(n.isString(e),"No valid string was provided"),new y(e)},y.fromObject=function(e){return i.checkArgument(n.isObject(e),"No valid argument was provided"),new y(e)},y.prototype.toString=function(){return this.xpubkey},y.prototype.inspect=function(){return""},y.prototype.toObject=y.prototype.toJSON=function(){return{network:c.get(v.integerFromBuffer(this._buffers.version)).name,depth:v.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:v.integerFromBuffer(this.fingerPrint),parentFingerPrint:v.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:v.integerFromBuffer(this._buffers.childIndex),chainCode:v.bufferToHex(this._buffers.chainCode),publicKey:this.publicKey.toString(),checksum:v.integerFromBuffer(this._buffers.checksum),xpubkey:this.xpubkey}},y.fromBuffer=function(e){return new y(e)},y.prototype.toBuffer=function(){return v.copy(this._buffers.xpubkey)},y.Hardened=2147483648,y.RootElementAlias=["m","M"],y.VersionSize=4,y.DepthSize=1,y.ParentFingerPrintSize=4,y.ChildIndexSize=4,y.ChainCodeSize=32,y.PublicKeySize=33,y.CheckSumSize=4,y.DataSize=78,y.SerializedByteSize=82,y.VersionStart=0,y.VersionEnd=y.VersionStart+y.VersionSize,y.DepthStart=y.VersionEnd,y.DepthEnd=y.DepthStart+y.DepthSize,y.ParentFingerPrintStart=y.DepthEnd,y.ParentFingerPrintEnd=y.ParentFingerPrintStart+y.ParentFingerPrintSize,y.ChildIndexStart=y.ParentFingerPrintEnd,y.ChildIndexEnd=y.ChildIndexStart+y.ChildIndexSize,y.ChainCodeStart=y.ChildIndexEnd,y.ChainCodeEnd=y.ChainCodeStart+y.ChainCodeSize,y.PublicKeyStart=y.ChainCodeEnd,y.PublicKeyEnd=y.PublicKeyStart+y.PublicKeySize,y.ChecksumStart=y.PublicKeyEnd,y.ChecksumEnd=y.ChecksumStart+y.CheckSumSize,m(y.PublicKeyEnd===y.DataSize),m(y.ChecksumEnd===y.SerializedByteSize),e.exports=y}).call(this,r(0).Buffer)},function(e,t,r){e.exports=r(444)},function(e,t,r){(function(t){e.exports= /*! * Fast "async" scrypt implementation in JavaScript. * Copyright (c) 2013-2016 Dmitry Chestnykh | BSD License * https://github.com/dchest/scrypt-async-js */ function(e,r,n,i,o,a,s,u){"use strict";function f(e){var t=[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],r=1779033703,n=3144134277,i=1013904242,o=2773480762,a=1359893119,s=2600822924,u=528734635,f=1541459225,c=new Array(64);function h(e){for(var h=0,d=e.length;d>=64;){var l,p,b,m,g,v=r,y=n,w=i,_=o,S=a,M=s,A=u,x=f;for(p=0;p<16;p++)b=h+4*p,c[p]=(255&e[b])<<24|(255&e[b+1])<<16|(255&e[b+2])<<8|255&e[b+3];for(p=16;p<64;p++)m=((l=c[p-2])>>>17|l<<15)^(l>>>19|l<<13)^l>>>10,g=((l=c[p-15])>>>7|l<<25)^(l>>>18|l<<14)^l>>>3,c[p]=(m+c[p-7]|0)+(g+c[p-16]|0)|0;for(p=0;p<64;p++)m=(((S>>>6|S<<26)^(S>>>11|S<<21)^(S>>>25|S<<7))+(S&M^~S&A)|0)+(x+(t[p]+c[p]|0)|0)|0,g=((v>>>2|v<<30)^(v>>>13|v<<19)^(v>>>22|v<<10))+(v&y^v&w^y&w)|0,x=A,A=M,M=S,S=_+m|0,_=w,w=y,y=v,v=m+g|0;r=r+v|0,n=n+y|0,i=i+w|0,o=o+_|0,a=a+S|0,s=s+M|0,u=u+A|0,f=f+x|0,h+=64,d-=64}}h(e);var d,l=e.length%64,p=e.length/536870912|0,b=e.length<<3,m=l<56?56:120,g=e.slice(e.length-l,e.length);for(g.push(128),d=l+1;d>>24&255),g.push(p>>>16&255),g.push(p>>>8&255),g.push(p>>>0&255),g.push(b>>>24&255),g.push(b>>>16&255),g.push(b>>>8&255),g.push(b>>>0&255),h(g),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255,f>>>24&255,f>>>16&255,f>>>8&255,f>>>0&255]}function c(e,t,r){e=e.length<=64?e:f(e);var n,i=64+t.length+4,o=new Array(i),a=new Array(64),s=[];for(n=0;n<64;n++)o[n]=54;for(n=0;n=i-4;e--){if(o[e]++,o[e]<=255)return;o[e]=0}}for(;r>=32;)u(),s=s.concat(f(a.concat(f(o)))),r-=32;return r>0&&(u(),s=s.concat(f(a.concat(f(o))).slice(0,r))),s}function h(e,t,r,n){var i,o,a=e[0]^t[r++],s=e[1]^t[r++],u=e[2]^t[r++],f=e[3]^t[r++],c=e[4]^t[r++],h=e[5]^t[r++],d=e[6]^t[r++],l=e[7]^t[r++],p=e[8]^t[r++],b=e[9]^t[r++],m=e[10]^t[r++],g=e[11]^t[r++],v=e[12]^t[r++],y=e[13]^t[r++],w=e[14]^t[r++],_=e[15]^t[r++],S=a,M=s,A=u,x=f,E=c,k=h,I=d,P=l,B=p,T=b,O=m,R=g,N=v,C=y,L=w,j=_;for(o=0;o<8;o+=2)S^=(i=(N^=(i=(B^=(i=(E^=(i=S+N)<<7|i>>>25)+S)<<9|i>>>23)+E)<<13|i>>>19)+B)<<18|i>>>14,k^=(i=(M^=(i=(C^=(i=(T^=(i=k+M)<<7|i>>>25)+k)<<9|i>>>23)+T)<<13|i>>>19)+C)<<18|i>>>14,O^=(i=(I^=(i=(A^=(i=(L^=(i=O+I)<<7|i>>>25)+O)<<9|i>>>23)+L)<<13|i>>>19)+A)<<18|i>>>14,j^=(i=(R^=(i=(P^=(i=(x^=(i=j+R)<<7|i>>>25)+j)<<9|i>>>23)+x)<<13|i>>>19)+P)<<18|i>>>14,S^=(i=(x^=(i=(A^=(i=(M^=(i=S+x)<<7|i>>>25)+S)<<9|i>>>23)+M)<<13|i>>>19)+A)<<18|i>>>14,k^=(i=(E^=(i=(P^=(i=(I^=(i=k+E)<<7|i>>>25)+k)<<9|i>>>23)+I)<<13|i>>>19)+P)<<18|i>>>14,O^=(i=(T^=(i=(B^=(i=(R^=(i=O+T)<<7|i>>>25)+O)<<9|i>>>23)+R)<<13|i>>>19)+B)<<18|i>>>14,j^=(i=(L^=(i=(C^=(i=(N^=(i=j+L)<<7|i>>>25)+j)<<9|i>>>23)+N)<<13|i>>>19)+C)<<18|i>>>14;t[n++]=e[0]=S+a|0,t[n++]=e[1]=M+s|0,t[n++]=e[2]=A+u|0,t[n++]=e[3]=x+f|0,t[n++]=e[4]=E+c|0,t[n++]=e[5]=k+h|0,t[n++]=e[6]=I+d|0,t[n++]=e[7]=P+l|0,t[n++]=e[8]=B+p|0,t[n++]=e[9]=T+b|0,t[n++]=e[10]=O+m|0,t[n++]=e[11]=R+g|0,t[n++]=e[12]=N+v|0,t[n++]=e[13]=C+y|0,t[n++]=e[14]=L+w|0,t[n++]=e[15]=j+_|0}function d(e,t,r,n,i){for(;i--;)e[t++]=r[n++]}function l(e,t,r,n,i){for(;i--;)e[t++]^=r[n++]}function p(e,t,r,n,i){d(e,0,t,r+16*(2*i-1),16);for(var o=0;o<2*i;o+=2)h(e,t,r+16*o,n+8*o),h(e,t,r+16*o+16,n+8*o+16*i)}function b(e,t,r){return e[t+16*(2*r-1)]}function m(e){for(var t=[],r=0;r127&&n<2048?(t.push(n>>6|192),t.push(63&n|128)):(t.push(n>>12|224),t.push(n>>6&63|128),t.push(63&n|128))}return t}var g=1;if("object"==typeof n){if(arguments.length>4)throw new Error("scrypt: incorrect number of arguments");var v=n;if(s=i,void 0===(n=v.logN)){if(void 0===v.N)throw new Error("scrypt: missing N parameter");if(v.N<2||v.N>-1>>>0)throw new Error("scrypt: N is out of range");if(0!=(v.N&v.N-1))throw new Error("scrypt: N is not a power of 2");n=Math.log(v.N)/Math.LN2}g=v.p||1,i=v.r,o=v.dkLen||32,a=v.interruptStep||0,u=v.encoding}if(g<1)throw new Error("scrypt: invalid p");if(i<=0)throw new Error("scrypt: invalid r");if(n<1||n>31)throw new Error("scrypt: logN must be between 1 and 31");var y,w,_,S,M=1<>>0;if(i*g>=1<<30||i>(-1>>>0)/128/g||i>(-1>>>0)/256||M>(-1>>>0)/128/i)throw new Error("scrypt: parameters are too large");"string"==typeof e&&(e=m(e)),"string"==typeof r&&(r=m(r)),"undefined"!=typeof Int32Array?(y=new Int32Array(64*i),w=new Int32Array(32*M*i),S=new Int32Array(16)):(y=[],w=[],S=new Array(16)),_=c(e,r,128*g*i);var A=0,x=32*i;function E(e){for(var t=0;t<32*i;t++){var r=e+4*t;y[A+t]=(255&_[r+3])<<24|(255&_[r+2])<<16|(255&_[r+1])<<8|(255&_[r+0])<<0}}function k(e,t){for(var r=e;r>>0&255,_[e+4*t+1]=r>>>8&255,_[e+4*t+2]=r>>>16&255,_[e+4*t+3]=r>>>24&255}}var B=void 0!==t?t:setTimeout;function T(e,t,r,n,i){!function o(){B(function(){n(e,e+r>>18&63]),i.push(r[t>>>12&63]),i.push(r[t>>>6&63]),i.push(r[t>>>0&63]);return n%3>0&&(i[i.length-1]="=",n%3==1&&(i[i.length-2]="=")),i.join("")}(r):"hex"===t?function(e){for(var t="0123456789abcdef".split(""),r=e.length,n=[],i=0;i>>4&15]),n.push(t[e[i]>>>0&15]);return n.join("")}(r):"binary"===t?new Uint8Array(r):r}"function"==typeof a&&(u=s,s=a,a=1e3),a<=0?function(){for(var e=0;e0?n-4:n,h=0;h>16&255,s[u++]=t>>8&255,s[u++]=255&t;2===a&&(t=i[e.charCodeAt(h)]<<2|i[e.charCodeAt(h+1)]>>4,s[u++]=255&t);1===a&&(t=i[e.charCodeAt(h)]<<10|i[e.charCodeAt(h+1)]<<4|i[e.charCodeAt(h+2)]>>2,s[u++]=t>>8&255,s[u++]=255&t);return s},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=0,s=r-i;as?s:a+16383));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function h(e,t,r){for(var n,i=[],o=t;o>1,c=-7,h=r?i-1:0,d=r?-1:1,l=e[t+h];for(h+=d,o=l&(1<<-c)-1,l>>=-c,c+=s;c>0;o=256*o+e[t+h],h+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+e[t+h],h+=d,c-=8);if(0===o)o=1-f;else{if(o===u)return a?NaN:1/0*(l?-1:1);a+=Math.pow(2,n),o-=f}return(l?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,u,f=8*o-i-1,c=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:o-1,p=n?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+h>=1?d/u:d*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(t*u-1)*Math.pow(2,i),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;e[r+l]=255&s,l+=p,s/=256,i-=8);for(a=a<0;e[r+l]=255&a,l+=p,a/=256,f-=8);e[r+l-p]|=128*b}},function(e,t,r){"use strict";var n=r(188).version,i=r(35),o=r(235),a=r(66),s=r(129),u=r(328),f=r(329),c=r(20),h=function(){var e=this;i.packageInit(this,arguments),this.version=n,this.utils=c,this.eth=new o(this),this.shh=new u(this),this.bzz=new f(this);var t=this.setProvider;this.setProvider=function(r,n){return t.apply(e,arguments),this.eth.setProvider(r,n),this.shh.setProvider(r,n),this.bzz.setProvider(r),!0}};h.version=n,h.utils=c,h.modules={Eth:o,Net:a,Personal:s,Shh:u,Bzz:f},i.addProviders(h),e.exports=h},function(e){e.exports={_from:"web3",_id:"web3@1.0.0-beta.35",_inBundle:!1,_integrity:"sha512-xwDmUhvTcHQvvNnOPcPZZgCxKUsI2e+GbHy7JkTK3/Rmnutazy8x7fsAXT9myw7V1qpi3GgLoZ3fkglSUbg1Mg==",_location:"/web3",_phantomChildren:{},_requested:{type:"tag",registry:!0,raw:"web3",name:"web3",escapedName:"web3",rawSpec:"",saveSpec:null,fetchSpec:"latest"},_requiredBy:["#USER","/"],_resolved:"https://registry.npmjs.org/web3/-/web3-1.0.0-beta.35.tgz",_shasum:"6475095bd451a96e50a32b997ddee82279292f11",_spec:"web3",_where:"D:\\blockchain\\bingo\\app",author:{name:"ethereum.org"},authors:[{name:"Fabian Vogelsteller",email:"fabian@ethereum.org",homepage:"http://frozeman.de"},{name:"Marek Kotewicz",email:"marek@parity.io",url:"https://github.com/debris"},{name:"Marian Oancea",url:"https://github.com/cubedro"},{name:"Gav Wood",email:"g@parity.io",homepage:"http://gavwood.com"},{name:"Jeffery Wilcke",email:"jeffrey.wilcke@ethereum.org",url:"https://github.com/obscuren"}],bugs:{url:"https://github.com/ethereum/web3.js/issues"},bundleDependencies:!1,dependencies:{"web3-bzz":"1.0.0-beta.35","web3-core":"1.0.0-beta.35","web3-eth":"1.0.0-beta.35","web3-eth-personal":"1.0.0-beta.35","web3-net":"1.0.0-beta.35","web3-shh":"1.0.0-beta.35","web3-utils":"1.0.0-beta.35"},deprecated:!1,description:"Ethereum JavaScript API",keywords:["Ethereum","JavaScript","API"],license:"LGPL-3.0",main:"src/index.js",name:"web3",namespace:"ethereum",repository:{type:"git",url:"https://github.com/ethereum/web3.js/tree/master/packages/web3"},types:"index.d.ts",version:"1.0.0-beta.35"}},function(e,t,r){"use strict";var n=r(18),i=r(14).errors,o=r(115),a=r(201),s=r(202),u=function e(t){this.provider=null,this.providers=e.providers,this.setProvider(t),this.subscriptions={}};u.givenProvider=s,u.providers={WebsocketProvider:r(203),HttpProvider:r(212),IpcProvider:r(229)},u.prototype.setProvider=function(e,t){var r=this;if(e&&"string"==typeof e&&this.providers)if(/^http(s)?:\/\//i.test(e))e=new this.providers.HttpProvider(e);else if(/^ws(s)?:\/\//i.test(e))e=new this.providers.WebsocketProvider(e);else if(e&&"object"==typeof t&&"function"==typeof t.connect)e=new this.providers.IpcProvider(e,t);else if(e)throw new Error("Can't autodetect provider for \""+e+'"');this.provider&&this.provider.connected&&this.clearSubscriptions(),this.provider=e||null,this.provider&&this.provider.on&&this.provider.on("data",function(e,t){(e=e||t).method&&r.subscriptions[e.params.subscription]&&r.subscriptions[e.params.subscription].callback&&r.subscriptions[e.params.subscription].callback(null,e.params.result)})},u.prototype.send=function(e,t){if(t=t||function(){},!this.provider)return t(i.InvalidProvider());var r=o.toPayload(e.method,e.params);this.provider[this.provider.sendAsync?"sendAsync":"send"](r,function(e,n){return n&&n.id&&r.id!==n.id?t(new Error('Wrong response id "'+n.id+'" (expected: "'+r.id+'") in '+JSON.stringify(r))):e?t(e):n&&n.error?t(i.ErrorResponse(n)):o.isValidResponse(n)?void t(null,n.result):t(i.InvalidResponse(n))})},u.prototype.sendBatch=function(e,t){if(!this.provider)return t(i.InvalidProvider());var r=o.toBatchPayload(e);this.provider[this.provider.sendAsync?"sendAsync":"send"](r,function(e,r){return e?t(e):n.isArray(r)?void t(null,r):t(i.InvalidResponse(r))})},u.prototype.addSubscription=function(e,t,r,n){if(!this.provider.on)throw new Error("The provider doesn't support subscriptions: "+this.provider.constructor.name);this.subscriptions[e]={callback:n,type:r,name:t}},u.prototype.removeSubscription=function(e,t){this.subscriptions[e]&&(this.send({method:this.subscriptions[e].type+"_unsubscribe",params:[e]},t),delete this.subscriptions[e])},u.prototype.clearSubscriptions=function(e){var t=this;Object.keys(this.subscriptions).forEach(function(r){e&&"syncing"===t.subscriptions[r].name||t.removeSubscription(r)}),this.provider.reset&&this.provider.reset()},e.exports={Manager:u,BatchManager:a}},function(e,t,r){"use strict";e.exports={ErrorResponse:function(e){var t=e&&e.error&&e.error.message?e.error.message:JSON.stringify(e);return new Error("Returned error: "+t)},InvalidNumberOfParams:function(e,t,r){return new Error('Invalid number of parameters for "'+r+'". Got '+e+" expected "+t+"!")},InvalidConnection:function(e){return new Error("CONNECTION ERROR: Couldn't connect to node "+e+".")},InvalidProvider:function(){return new Error("Provider not set or invalid")},InvalidResponse:function(e){var t=e&&e.error&&e.error.message?e.error.message:"Invalid JSON RPC response: "+JSON.stringify(e);return new Error(t)},ConnectionTimeout:function(e){return new Error("CONNECTION TIMEOUT: timeout of "+e+" ms achived")}}},function(e,t,r){"use strict";var n=r(18),i=r(20),o=r(114),a=function(e){return i.toBN(e).toString(10)},s=function(e){if(void 0!==e)return function(e){return"latest"===e||"pending"===e||"earliest"===e}(e)?e:i.isHexStrict(e)?n.isString(e)?e.toLowerCase():e:i.numberToHex(e)},u=function(e){if(e.to&&(e.to=h(e.to)),e.data&&e.input)throw new Error('You can\'t have "data" and "input" as properties of transactions at the same time, please use either "data" or "input" instead.');if(!e.data&&e.input&&(e.data=e.input,delete e.input),e.data&&!i.isHex(e.data))throw new Error("The data field must be HEX encoded data.");return(e.gas||e.gasLimit)&&(e.gas=e.gas||e.gasLimit),["gasPrice","gas","value","nonce"].filter(function(t){return void 0!==e[t]}).forEach(function(t){e[t]=i.numberToHex(e[t])}),e},f=function(e){return null!==e.blockNumber&&(e.blockNumber=i.hexToNumber(e.blockNumber)),null!==e.transactionIndex&&(e.transactionIndex=i.hexToNumber(e.transactionIndex)),e.nonce=i.hexToNumber(e.nonce),e.gas=i.hexToNumber(e.gas),e.gasPrice=a(e.gasPrice),e.value=a(e.value),e.to&&i.isAddress(e.to)?e.to=i.toChecksumAddress(e.to):e.to=null,e.from&&(e.from=i.toChecksumAddress(e.from)),e},c=function(e){if("string"==typeof e.blockHash&&"string"==typeof e.transactionHash&&"string"==typeof e.logIndex){var t=i.sha3(e.blockHash.replace("0x","")+e.transactionHash.replace("0x","")+e.logIndex.replace("0x",""));e.id="log_"+t.replace("0x","").substr(0,8)}else e.id||(e.id=null);return null!==e.blockNumber&&(e.blockNumber=i.hexToNumber(e.blockNumber)),null!==e.transactionIndex&&(e.transactionIndex=i.hexToNumber(e.transactionIndex)),null!==e.logIndex&&(e.logIndex=i.hexToNumber(e.logIndex)),e.address&&(e.address=i.toChecksumAddress(e.address)),e},h=function(e){var t=new o(e);if(t.isValid()&&t.isDirect())return t.toAddress().toLowerCase();if(i.isAddress(e))return"0x"+e.toLowerCase().replace("0x","");throw new Error('Provided address "'+e+"\" is invalid, the capitalization checksum test failed, or its an indrect IBAN address which can't be converted.")};e.exports={inputDefaultBlockNumberFormatter:function(e){return!this||void 0!==e&&null!==e?"genesis"===e||"earliest"===e?"0x0":s(e):this.defaultBlock},inputBlockNumberFormatter:s,inputCallFormatter:function(e){var t=(e=u(e)).from||(this?this.defaultAccount:null);return t&&(e.from=h(t)),e},inputTransactionFormatter:function(e){if(e=u(e),!n.isNumber(e.from)&&!n.isObject(e.from)){if(e.from=e.from||(this?this.defaultAccount:null),!e.from&&!n.isNumber(e.from))throw new Error('The send transactions "from" field must be defined!');e.from=h(e.from)}return e},inputAddressFormatter:h,inputPostFormatter:function(e){return e.ttl&&(e.ttl=i.numberToHex(e.ttl)),e.workToProve&&(e.workToProve=i.numberToHex(e.workToProve)),e.priority&&(e.priority=i.numberToHex(e.priority)),n.isArray(e.topics)||(e.topics=e.topics?[e.topics]:[]),e.topics=e.topics.map(function(e){return 0===e.indexOf("0x")?e:i.fromUtf8(e)}),e},inputLogFormatter:function(e){var t=function(e){return null===e||void 0===e?null:0===(e=String(e)).indexOf("0x")?e:i.fromUtf8(e)};return e.fromBlock&&(e.fromBlock=s(e.fromBlock)),e.toBlock&&(e.toBlock=s(e.toBlock)),e.topics=e.topics||[],e.topics=e.topics.map(function(e){return n.isArray(e)?e.map(t):t(e)}),t=null,e.address&&(e.address=n.isArray(e.address)?e.address.map(function(e){return h(e)}):h(e.address)),e},inputSignFormatter:function(e){return i.isHexStrict(e)?e:i.utf8ToHex(e)},outputBigNumberFormatter:a,outputTransactionFormatter:f,outputTransactionReceiptFormatter:function(e){if("object"!=typeof e)throw new Error("Received receipt is invalid: "+e);return null!==e.blockNumber&&(e.blockNumber=i.hexToNumber(e.blockNumber)),null!==e.transactionIndex&&(e.transactionIndex=i.hexToNumber(e.transactionIndex)),e.cumulativeGasUsed=i.hexToNumber(e.cumulativeGasUsed),e.gasUsed=i.hexToNumber(e.gasUsed),n.isArray(e.logs)&&(e.logs=e.logs.map(c)),e.contractAddress&&(e.contractAddress=i.toChecksumAddress(e.contractAddress)),void 0!==e.status&&(e.status=Boolean(parseInt(e.status))),e},outputBlockFormatter:function(e){return e.gasLimit=i.hexToNumber(e.gasLimit),e.gasUsed=i.hexToNumber(e.gasUsed),e.size=i.hexToNumber(e.size),e.timestamp=i.hexToNumber(e.timestamp),null!==e.number&&(e.number=i.hexToNumber(e.number)),e.difficulty&&(e.difficulty=a(e.difficulty)),e.totalDifficulty&&(e.totalDifficulty=a(e.totalDifficulty)),n.isArray(e.transactions)&&e.transactions.forEach(function(e){if(!n.isString(e))return f(e)}),e.miner&&(e.miner=i.toChecksumAddress(e.miner)),e},outputLogFormatter:c,outputPostFormatter:function(e){return e.expiry=i.hexToNumber(e.expiry),e.sent=i.hexToNumber(e.sent),e.ttl=i.hexToNumber(e.ttl),e.workProved=i.hexToNumber(e.workProved),e.topics||(e.topics=[]),e.topics=e.topics.map(function(e){return i.toUtf8(e)}),e},outputSyncingFormatter:function(e){return e.startingBlock=i.hexToNumber(e.startingBlock),e.currentBlock=i.hexToNumber(e.currentBlock),e.highestBlock=i.hexToNumber(e.highestBlock),e.knownStates&&(e.knownStates=i.hexToNumber(e.knownStates),e.pulledStates=i.hexToNumber(e.pulledStates)),e}}},function(e,t,r){"use strict";var n=r(193),i=r(108),o=new n(0),a=new n(-1),s={noether:"0",wei:"1",kwei:"1000",Kwei:"1000",babbage:"1000",femtoether:"1000",mwei:"1000000",Mwei:"1000000",lovelace:"1000000",picoether:"1000000",gwei:"1000000000",Gwei:"1000000000",shannon:"1000000000",nanoether:"1000000000",nano:"1000000000",szabo:"1000000000000",microether:"1000000000000",micro:"1000000000000",finney:"1000000000000000",milliether:"1000000000000000",milli:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"};function u(e){var t=e?e.toLowerCase():"ether",r=s[t];if("string"!=typeof r)throw new Error("[ethjs-unit] the unit provided "+e+" doesn't exists, please use the one of the following units "+JSON.stringify(s,null,2));return new n(r,10)}function f(e){if("string"==typeof e){if(!e.match(/^-?[0-9.]+$/))throw new Error("while converting number to string, invalid number value '"+e+"', should be a number matching (^-?[0-9.]+).");return e}if("number"==typeof e)return String(e);if("object"==typeof e&&e.toString&&(e.toTwos||e.dividedToIntegerBy))return e.toPrecision?String(e.toPrecision()):e.toString(10);throw new Error("while converting number to string, invalid number value '"+e+"' type "+typeof e+".")}e.exports={unitMap:s,numberToString:f,getValueOfUnit:u,fromWei:function(e,t,r){var n=i(e),f=n.lt(o),c=u(t),h=s[t].length-1||1,d=r||{};f&&(n=n.mul(a));for(var l=n.mod(c).toString(10);l.length2)throw new Error("[ethjs-unit] while converting number "+e+" to wei, too many decimal points");var d=h[0],l=h[1];if(d||(d="0"),l||(l="0"),l.length>o)throw new Error("[ethjs-unit] while converting number "+e+" to wei, too many decimal places");for(;l.length=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function u(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=e[i]|e[i-1]<<8|e[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(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)i=s(e,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==t&&(i=s(e,t,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,f=0,c=r;c1&&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"],c=[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],h=[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(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var f=1;f>>26,h=67108863&u,d=Math.min(f,t.length-1),l=Math.max(0,f-e.length+1);l<=d;l++){var p=f-l|0;c+=(a=(i=0|e.words[p])*(o=0|t.words[l])+h)/67108864|0,h=67108863&a}r.words[f]=0|h,u=0|c}return 0!==u?r.words[f]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(e=e||10,t=0|t||1,16===e||"hex"===e){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%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=c[e],l=h[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(e);r=(p=p.idivn(l)).isZero()?b+r:f[d-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=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 e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==a),this.toArrayLike(a,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,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"===t,f=new e(o),c=this.clone();if(u){for(s=0;!c.isZero();s++)a=c.andln(255),c.iushrn(8),f[s]=a;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,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(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,l=0|a[1],p=8191&l,b=l>>>13,m=0|a[2],g=8191&m,v=m>>>13,y=0|a[3],w=8191&y,_=y>>>13,S=0|a[4],M=8191&S,A=S>>>13,x=0|a[5],E=8191&x,k=x>>>13,I=0|a[6],P=8191&I,B=I>>>13,T=0|a[7],O=8191&T,R=T>>>13,N=0|a[8],C=8191&N,L=N>>>13,j=0|a[9],z=8191&j,D=j>>>13,U=0|s[0],F=8191&U,q=U>>>13,H=0|s[1],K=8191&H,V=H>>>13,G=0|s[2],Y=8191&G,W=G>>>13,Z=0|s[3],X=8191&Z,J=Z>>>13,$=0|s[4],Q=8191&$,ee=$>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,fe=se>>>13,ce=0|s[8],he=8191&ce,de=ce>>>13,le=0|s[9],pe=8191&le,be=le>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(f+(n=Math.imul(h,F))|0)+((8191&(i=(i=Math.imul(h,q))+Math.imul(d,F)|0))<<13)|0;f=((o=Math.imul(d,q))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,q))+Math.imul(b,F)|0,o=Math.imul(b,q);var ge=(f+(n=n+Math.imul(h,K)|0)|0)+((8191&(i=(i=i+Math.imul(h,V)|0)+Math.imul(d,K)|0))<<13)|0;f=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,F),i=(i=Math.imul(g,q))+Math.imul(v,F)|0,o=Math.imul(v,q),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,V)|0;var ve=(f+(n=n+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,W)|0)+Math.imul(d,Y)|0))<<13)|0;f=((o=o+Math.imul(d,W)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,q))+Math.imul(_,F)|0,o=Math.imul(_,q),n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,V)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,W)|0;var ye=(f+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(d,X)|0))<<13)|0;f=((o=o+Math.imul(d,J)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(M,F),i=(i=Math.imul(M,q))+Math.imul(A,F)|0,o=Math.imul(A,q),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,W)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,J)|0;var we=(f+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(d,Q)|0))<<13)|0;f=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,q))+Math.imul(k,F)|0,o=Math.imul(k,q),n=n+Math.imul(M,K)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(g,X)|0,i=(i=i+Math.imul(g,J)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,J)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0;var _e=(f+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(d,re)|0))<<13)|0;f=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(P,F),i=(i=Math.imul(P,q))+Math.imul(B,F)|0,o=Math.imul(B,q),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,W)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,W)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0;var Se=(f+(n=n+Math.imul(h,oe)|0)|0)+((8191&(i=(i=i+Math.imul(h,ae)|0)+Math.imul(d,oe)|0))<<13)|0;f=((o=o+Math.imul(d,ae)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(O,F),i=(i=Math.imul(O,q))+Math.imul(R,F)|0,o=Math.imul(R,q),n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,V)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,V)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(M,X)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,J)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0;var Me=(f+(n=n+Math.imul(h,ue)|0)|0)+((8191&(i=(i=i+Math.imul(h,fe)|0)+Math.imul(d,ue)|0))<<13)|0;f=((o=o+Math.imul(d,fe)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,q))+Math.imul(L,F)|0,o=Math.imul(L,q),n=n+Math.imul(O,K)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,V)|0,n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(B,Y)|0,o=o+Math.imul(B,W)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,fe)|0;var Ae=(f+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,de)|0)+Math.imul(d,he)|0))<<13)|0;f=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(z,F),i=(i=Math.imul(z,q))+Math.imul(D,F)|0,o=Math.imul(D,q),n=n+Math.imul(C,K)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(L,K)|0,o=o+Math.imul(L,V)|0,n=n+Math.imul(O,Y)|0,i=(i=i+Math.imul(O,W)|0)+Math.imul(R,Y)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(P,X)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,J)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(M,re)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,n=n+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,fe)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,fe)|0,n=n+Math.imul(p,he)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(b,he)|0,o=o+Math.imul(b,de)|0;var xe=(f+(n=n+Math.imul(h,pe)|0)|0)+((8191&(i=(i=i+Math.imul(h,be)|0)+Math.imul(d,pe)|0))<<13)|0;f=((o=o+Math.imul(d,be)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(z,K),i=(i=Math.imul(z,V))+Math.imul(D,K)|0,o=Math.imul(D,V),n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,W)|0,n=n+Math.imul(O,X)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,J)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,fe)|0,n=n+Math.imul(g,he)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(v,he)|0,o=o+Math.imul(v,de)|0;var Ee=(f+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;f=((o=o+Math.imul(b,be)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(z,Y),i=(i=Math.imul(z,W))+Math.imul(D,Y)|0,o=Math.imul(D,W),n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,J)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(P,re)|0,i=(i=i+Math.imul(P,ne)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,n=n+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,fe)|0)+Math.imul(A,ue)|0,o=o+Math.imul(A,fe)|0,n=n+Math.imul(w,he)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(_,he)|0,o=o+Math.imul(_,de)|0;var ke=(f+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,be)|0)+Math.imul(v,pe)|0))<<13)|0;f=((o=o+Math.imul(v,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(z,X),i=(i=Math.imul(z,J))+Math.imul(D,X)|0,o=Math.imul(D,J),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ne)|0,n=n+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,ae)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,ae)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,fe)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,fe)|0,n=n+Math.imul(M,he)|0,i=(i=i+Math.imul(M,de)|0)+Math.imul(A,he)|0,o=o+Math.imul(A,de)|0;var Ie=(f+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,be)|0)+Math.imul(_,pe)|0))<<13)|0;f=((o=o+Math.imul(_,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(z,Q),i=(i=Math.imul(z,ee))+Math.imul(D,Q)|0,o=Math.imul(D,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(L,re)|0,o=o+Math.imul(L,ne)|0,n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,ae)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,ae)|0,n=n+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,fe)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,fe)|0,n=n+Math.imul(E,he)|0,i=(i=i+Math.imul(E,de)|0)+Math.imul(k,he)|0,o=o+Math.imul(k,de)|0;var Pe=(f+(n=n+Math.imul(M,pe)|0)|0)+((8191&(i=(i=i+Math.imul(M,be)|0)+Math.imul(A,pe)|0))<<13)|0;f=((o=o+Math.imul(A,be)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(z,re),i=(i=Math.imul(z,ne))+Math.imul(D,re)|0,o=Math.imul(D,ne),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,ae)|0,n=n+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,fe)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,fe)|0,n=n+Math.imul(P,he)|0,i=(i=i+Math.imul(P,de)|0)+Math.imul(B,he)|0,o=o+Math.imul(B,de)|0;var Be=(f+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,be)|0)+Math.imul(k,pe)|0))<<13)|0;f=((o=o+Math.imul(k,be)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(z,oe),i=(i=Math.imul(z,ae))+Math.imul(D,oe)|0,o=Math.imul(D,ae),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,fe)|0)+Math.imul(L,ue)|0,o=o+Math.imul(L,fe)|0,n=n+Math.imul(O,he)|0,i=(i=i+Math.imul(O,de)|0)+Math.imul(R,he)|0,o=o+Math.imul(R,de)|0;var Te=(f+(n=n+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,be)|0)+Math.imul(B,pe)|0))<<13)|0;f=((o=o+Math.imul(B,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(z,ue),i=(i=Math.imul(z,fe))+Math.imul(D,ue)|0,o=Math.imul(D,fe),n=n+Math.imul(C,he)|0,i=(i=i+Math.imul(C,de)|0)+Math.imul(L,he)|0,o=o+Math.imul(L,de)|0;var Oe=(f+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,be)|0)+Math.imul(R,pe)|0))<<13)|0;f=((o=o+Math.imul(R,be)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(z,he),i=(i=Math.imul(z,de))+Math.imul(D,he)|0,o=Math.imul(D,de);var Re=(f+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,be)|0)+Math.imul(L,pe)|0))<<13)|0;f=((o=o+Math.imul(L,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Ne=(f+(n=Math.imul(z,pe))|0)+((8191&(i=(i=Math.imul(z,be))+Math.imul(D,pe)|0))<<13)|0;return f=((o=Math.imul(D,be))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=me,u[1]=ge,u[2]=ve,u[3]=ye,u[4]=we,u[5]=_e,u[6]=Se,u[7]=Me,u[8]=Ae,u[9]=xe,u[10]=Ee,u[11]=ke,u[12]=Ie,u[13]=Pe,u[14]=Be,u[15]=Te,u[16]=Oe,u[17]=Re,u[18]=Ne,0!==f&&(u[19]=f,r.length++),r};function p(e,t,r){return(new b).mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(l=d),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?l(this,e,t):r<63?d(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.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,e,t):p(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},b.prototype.permute=function(e,t,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*t;a>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,f=0;f=0&&(0!==c||f>=i);f--){var h=0|this.words[f];this.words[f]=c<<26-o|h>>>o,c=h&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(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(e,t){var r=(this.length,e.length),n=this.clone(),i=e,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"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var f=0;f=0;h--){var d=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(i,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=d)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),f=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++f;for(var c=r.clone(),h=t.clone();!t.isZero();){for(var d=0,l=1;0==(t.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(c),a.isub(h)),i.iushrn(1),a.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(h)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(u)):(r.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(f)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,c=1;0==(t.words[0]&c)&&f<26;++f,c<<=1);if(f>0)for(t.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var h=0,d=1;0==(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/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(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new S(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},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(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){S.call(this,e),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)}g.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):r.strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},i(v,g),v.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new y;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return m[e]=t,t},S.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,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(),f=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,f).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,i),d=this.pow(e,i.addn(1).iushrn(1)),l=this.pow(e,i),p=a;0!==l.cmp(s);){for(var b=l,m=0;0!==b.cmp(s);m++)b=b.redSqr();n(m=0;n--){for(var f=t.words[n],c=u-1;c>=0;c--){var h=f>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new M(e)},i(M,S),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},M.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),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)},M.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),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)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(24)(e))},function(e,t,r){(function(e){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a=r(0).Buffer}catch(e){}function s(e,t,r){for(var n=0,i=Math.min(e.length,r),o=t;o=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function u(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=e[i]|e[i-1]<<8|e[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(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)i=s(e,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==t&&(i=s(e,t,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,f=0,c=r;c1&&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"],c=[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],h=[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(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var f=1;f>>26,h=67108863&u,d=Math.min(f,t.length-1),l=Math.max(0,f-e.length+1);l<=d;l++){var p=f-l|0;c+=(a=(i=0|e.words[p])*(o=0|t.words[l])+h)/67108864|0,h=67108863&a}r.words[f]=0|h,u=0|c}return 0!==u?r.words[f]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(e=e||10,t=0|t||1,16===e||"hex"===e){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%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=c[e],l=h[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(e);r=(p=p.idivn(l)).isZero()?b+r:f[d-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=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 e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==a),this.toArrayLike(a,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,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"===t,f=new e(o),c=this.clone();if(u){for(s=0;!c.isZero();s++)a=c.andln(255),c.iushrn(8),f[s]=a;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,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(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,l=0|a[1],p=8191&l,b=l>>>13,m=0|a[2],g=8191&m,v=m>>>13,y=0|a[3],w=8191&y,_=y>>>13,S=0|a[4],M=8191&S,A=S>>>13,x=0|a[5],E=8191&x,k=x>>>13,I=0|a[6],P=8191&I,B=I>>>13,T=0|a[7],O=8191&T,R=T>>>13,N=0|a[8],C=8191&N,L=N>>>13,j=0|a[9],z=8191&j,D=j>>>13,U=0|s[0],F=8191&U,q=U>>>13,H=0|s[1],K=8191&H,V=H>>>13,G=0|s[2],Y=8191&G,W=G>>>13,Z=0|s[3],X=8191&Z,J=Z>>>13,$=0|s[4],Q=8191&$,ee=$>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,fe=se>>>13,ce=0|s[8],he=8191&ce,de=ce>>>13,le=0|s[9],pe=8191&le,be=le>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(f+(n=Math.imul(h,F))|0)+((8191&(i=(i=Math.imul(h,q))+Math.imul(d,F)|0))<<13)|0;f=((o=Math.imul(d,q))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,q))+Math.imul(b,F)|0,o=Math.imul(b,q);var ge=(f+(n=n+Math.imul(h,K)|0)|0)+((8191&(i=(i=i+Math.imul(h,V)|0)+Math.imul(d,K)|0))<<13)|0;f=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,F),i=(i=Math.imul(g,q))+Math.imul(v,F)|0,o=Math.imul(v,q),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,V)|0;var ve=(f+(n=n+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,W)|0)+Math.imul(d,Y)|0))<<13)|0;f=((o=o+Math.imul(d,W)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,q))+Math.imul(_,F)|0,o=Math.imul(_,q),n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,V)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,W)|0;var ye=(f+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(d,X)|0))<<13)|0;f=((o=o+Math.imul(d,J)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(M,F),i=(i=Math.imul(M,q))+Math.imul(A,F)|0,o=Math.imul(A,q),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,W)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,J)|0;var we=(f+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(d,Q)|0))<<13)|0;f=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,q))+Math.imul(k,F)|0,o=Math.imul(k,q),n=n+Math.imul(M,K)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(g,X)|0,i=(i=i+Math.imul(g,J)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,J)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0;var _e=(f+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(d,re)|0))<<13)|0;f=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(P,F),i=(i=Math.imul(P,q))+Math.imul(B,F)|0,o=Math.imul(B,q),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,W)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,W)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0;var Se=(f+(n=n+Math.imul(h,oe)|0)|0)+((8191&(i=(i=i+Math.imul(h,ae)|0)+Math.imul(d,oe)|0))<<13)|0;f=((o=o+Math.imul(d,ae)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(O,F),i=(i=Math.imul(O,q))+Math.imul(R,F)|0,o=Math.imul(R,q),n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,V)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,V)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(M,X)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,J)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0;var Me=(f+(n=n+Math.imul(h,ue)|0)|0)+((8191&(i=(i=i+Math.imul(h,fe)|0)+Math.imul(d,ue)|0))<<13)|0;f=((o=o+Math.imul(d,fe)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,q))+Math.imul(L,F)|0,o=Math.imul(L,q),n=n+Math.imul(O,K)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,V)|0,n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(B,Y)|0,o=o+Math.imul(B,W)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,fe)|0;var Ae=(f+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,de)|0)+Math.imul(d,he)|0))<<13)|0;f=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(z,F),i=(i=Math.imul(z,q))+Math.imul(D,F)|0,o=Math.imul(D,q),n=n+Math.imul(C,K)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(L,K)|0,o=o+Math.imul(L,V)|0,n=n+Math.imul(O,Y)|0,i=(i=i+Math.imul(O,W)|0)+Math.imul(R,Y)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(P,X)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,J)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(M,re)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,n=n+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,fe)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,fe)|0,n=n+Math.imul(p,he)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(b,he)|0,o=o+Math.imul(b,de)|0;var xe=(f+(n=n+Math.imul(h,pe)|0)|0)+((8191&(i=(i=i+Math.imul(h,be)|0)+Math.imul(d,pe)|0))<<13)|0;f=((o=o+Math.imul(d,be)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(z,K),i=(i=Math.imul(z,V))+Math.imul(D,K)|0,o=Math.imul(D,V),n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,W)|0,n=n+Math.imul(O,X)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,J)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,fe)|0,n=n+Math.imul(g,he)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(v,he)|0,o=o+Math.imul(v,de)|0;var Ee=(f+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;f=((o=o+Math.imul(b,be)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(z,Y),i=(i=Math.imul(z,W))+Math.imul(D,Y)|0,o=Math.imul(D,W),n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,J)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(P,re)|0,i=(i=i+Math.imul(P,ne)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,n=n+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,fe)|0)+Math.imul(A,ue)|0,o=o+Math.imul(A,fe)|0,n=n+Math.imul(w,he)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(_,he)|0,o=o+Math.imul(_,de)|0;var ke=(f+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,be)|0)+Math.imul(v,pe)|0))<<13)|0;f=((o=o+Math.imul(v,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(z,X),i=(i=Math.imul(z,J))+Math.imul(D,X)|0,o=Math.imul(D,J),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ne)|0,n=n+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,ae)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,ae)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,fe)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,fe)|0,n=n+Math.imul(M,he)|0,i=(i=i+Math.imul(M,de)|0)+Math.imul(A,he)|0,o=o+Math.imul(A,de)|0;var Ie=(f+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,be)|0)+Math.imul(_,pe)|0))<<13)|0;f=((o=o+Math.imul(_,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(z,Q),i=(i=Math.imul(z,ee))+Math.imul(D,Q)|0,o=Math.imul(D,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(L,re)|0,o=o+Math.imul(L,ne)|0,n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,ae)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,ae)|0,n=n+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,fe)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,fe)|0,n=n+Math.imul(E,he)|0,i=(i=i+Math.imul(E,de)|0)+Math.imul(k,he)|0,o=o+Math.imul(k,de)|0;var Pe=(f+(n=n+Math.imul(M,pe)|0)|0)+((8191&(i=(i=i+Math.imul(M,be)|0)+Math.imul(A,pe)|0))<<13)|0;f=((o=o+Math.imul(A,be)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(z,re),i=(i=Math.imul(z,ne))+Math.imul(D,re)|0,o=Math.imul(D,ne),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,ae)|0,n=n+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,fe)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,fe)|0,n=n+Math.imul(P,he)|0,i=(i=i+Math.imul(P,de)|0)+Math.imul(B,he)|0,o=o+Math.imul(B,de)|0;var Be=(f+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,be)|0)+Math.imul(k,pe)|0))<<13)|0;f=((o=o+Math.imul(k,be)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(z,oe),i=(i=Math.imul(z,ae))+Math.imul(D,oe)|0,o=Math.imul(D,ae),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,fe)|0)+Math.imul(L,ue)|0,o=o+Math.imul(L,fe)|0,n=n+Math.imul(O,he)|0,i=(i=i+Math.imul(O,de)|0)+Math.imul(R,he)|0,o=o+Math.imul(R,de)|0;var Te=(f+(n=n+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,be)|0)+Math.imul(B,pe)|0))<<13)|0;f=((o=o+Math.imul(B,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(z,ue),i=(i=Math.imul(z,fe))+Math.imul(D,ue)|0,o=Math.imul(D,fe),n=n+Math.imul(C,he)|0,i=(i=i+Math.imul(C,de)|0)+Math.imul(L,he)|0,o=o+Math.imul(L,de)|0;var Oe=(f+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,be)|0)+Math.imul(R,pe)|0))<<13)|0;f=((o=o+Math.imul(R,be)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(z,he),i=(i=Math.imul(z,de))+Math.imul(D,he)|0,o=Math.imul(D,de);var Re=(f+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,be)|0)+Math.imul(L,pe)|0))<<13)|0;f=((o=o+Math.imul(L,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Ne=(f+(n=Math.imul(z,pe))|0)+((8191&(i=(i=Math.imul(z,be))+Math.imul(D,pe)|0))<<13)|0;return f=((o=Math.imul(D,be))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=me,u[1]=ge,u[2]=ve,u[3]=ye,u[4]=we,u[5]=_e,u[6]=Se,u[7]=Me,u[8]=Ae,u[9]=xe,u[10]=Ee,u[11]=ke,u[12]=Ie,u[13]=Pe,u[14]=Be,u[15]=Te,u[16]=Oe,u[17]=Re,u[18]=Ne,0!==f&&(u[19]=f,r.length++),r};function p(e,t,r){return(new b).mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(l=d),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?l(this,e,t):r<63?d(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.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,e,t):p(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},b.prototype.permute=function(e,t,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*t;a>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,f=0;f=0&&(0!==c||f>=i);f--){var h=0|this.words[f];this.words[f]=c<<26-o|h>>>o,c=h&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(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(e,t){var r=(this.length,e.length),n=this.clone(),i=e,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"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var f=0;f=0;h--){var d=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(i,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=d)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),f=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++f;for(var c=r.clone(),h=t.clone();!t.isZero();){for(var d=0,l=1;0==(t.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(c),a.isub(h)),i.iushrn(1),a.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(h)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(u)):(r.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(f)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,c=1;0==(t.words[0]&c)&&f<26;++f,c<<=1);if(f>0)for(t.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var h=0,d=1;0==(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/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(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new S(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},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(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){S.call(this,e),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)}g.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):r.strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},i(v,g),v.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new y;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return m[e]=t,t},S.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,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(),f=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,f).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,i),d=this.pow(e,i.addn(1).iushrn(1)),l=this.pow(e,i),p=a;0!==l.cmp(s);){for(var b=l,m=0;0!==b.cmp(s);m++)b=b.redSqr();n(m=0;n--){for(var f=t.words[n],c=u-1;c>=0;c--){var h=f>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new M(e)},i(M,S),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},M.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),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)},M.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),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)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(24)(e))},function(e,t,r){(function(e,n){var i;/*! https://mths.be/utf8js v2.0.0 by @mathias */!function(o){var a=t,s=(e&&e.exports,"object"==typeof n&&n);s.global!==s&&s.window;var u,f,c,h=String.fromCharCode;function d(e){for(var t,r,n=[],i=0,o=e.length;i=55296&&t<=56319&&i=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function p(e,t){return h(e>>t&63|128)}function b(e){if(0==(4294967168&e))return h(e);var t="";return 0==(4294965248&e)?t=h(e>>6&31|192):0==(4294901760&e)?(l(e),t=h(e>>12&15|224),t+=p(e,6)):0==(4292870144&e)&&(t=h(e>>18&7|240),t+=p(e,12),t+=p(e,6)),t+=h(63&e|128)}function m(){if(c>=f)throw Error("Invalid byte index");var e=255&u[c];if(c++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function g(){var e,t;if(c>f)throw Error("Invalid byte index");if(c==f)return!1;if(e=255&u[c],c++,0==(128&e))return e;if(192==(224&e)){if((t=(31&e)<<6|m())>=128)return t;throw Error("Invalid continuation byte")}if(224==(240&e)){if((t=(15&e)<<12|m()<<6|m())>=2048)return l(t),t;throw Error("Invalid continuation byte")}if(240==(248&e)&&(t=(15&e)<<18|m()<<12|m()<<6|m())>=65536&&t<=1114111)return t;throw Error("Invalid UTF-8 detected")}var v={version:"2.0.0",encode:function(e){for(var t=d(e),r=t.length,n=-1,i="";++n65535&&(i+=h((t-=65536)>>>10&1023|55296),t=56320|1023&t),i+=h(t);return i}(r)}};void 0===(i=function(){return v}.call(t,r,t,e))||(e.exports=i)}()}).call(this,r(24)(e),r(7))},function(e,t,r){var n=r(18),i=r(112),o=r(111),a=function(e){var t=typeof e;if("string"===t)return o.isHexStrict(e)?new i(e.replace(/0x/i,""),16):new i(e,10);if("number"===t)return new i(e);if(o.isBigNumber(e))return new i(e.toString(10));if(o.isBN(e))return e;throw new Error(e+" is not a number")},s=function(e,t,r){var n,s;if("bytes"===(e=function(e){return e.startsWith("int[")?"int256"+e.slice(3):"int"===e?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):"uint"===e?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):"fixed"===e?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):"ufixed"===e?"ufixed128x128":e}(e))){if(t.replace(/^0x/i,"").length%2!=0)throw new Error("Invalid bytes characters "+t.length);return t}if("string"===e)return o.utf8ToHex(t);if("bool"===e)return t?"01":"00";if(e.startsWith("address")){if(n=r?64:40,!o.isAddress(t))throw new Error(t+" is not a valid address, or the checksum is invalid.");return o.leftPad(t.toLowerCase(),n)}if(n=function(e){var t=/^\D+(\d+).*$/.exec(e);return t?parseInt(t[1],10):null}(e),e.startsWith("bytes")){if(!n)throw new Error("bytes[] not yet supported in solidity");if(r&&(n=32),n<1||n>32||n256)throw new Error("Invalid uint"+n+" size");if((s=a(t)).bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+s.bitLength());if(s.lt(new i(0)))throw new Error("Supplied uint "+s.toString()+" is negative");return n?o.leftPad(s.toString("hex"),n/8*2):s}if(e.startsWith("int")){if(n%8||n<8||n>256)throw new Error("Invalid int"+n+" size");if((s=a(t)).bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+s.bitLength());return s.lt(new i(0))?s.toTwos(n).toString("hex"):n?o.leftPad(s.toString("hex"),n/8*2):s}throw new Error("Unsupported or invalid type: "+e)},u=function(e){if(n.isArray(e))throw new Error("Autodetection of array types is not supported.");var t,r,a="";if(n.isObject(e)&&(e.hasOwnProperty("v")||e.hasOwnProperty("t")||e.hasOwnProperty("value")||e.hasOwnProperty("type"))?(t=e.hasOwnProperty("t")?e.t:e.type,a=e.hasOwnProperty("v")?e.v:e.value):(t=o.toHex(e,!0),a=o.toHex(e),t.startsWith("int")||t.startsWith("uint")||(t="bytes")),!t.startsWith("int")&&!t.startsWith("uint")||"string"!=typeof a||/^(-)?0x/i.test(a)||(a=new i(a)),n.isArray(a)){if((r=function(e){var t=/^\D+\d*\[(\d+)\]$/.exec(e);return t?parseInt(t[1],10):null}(t))&&a.length!==r)throw new Error(t+" is not matching the given array "+JSON.stringify(a));r=a.length}return n.isArray(a)?a.map(function(e){return s(t,e,r).toString("hex").replace("0x","")}).join(""):s(t,a,r).toString("hex").replace("0x","")};e.exports=function(){var e=Array.prototype.slice.call(arguments),t=n.map(e,u);return o.sha3("0x"+t.join(""))}},function(e,t,r){e.exports=function(e,t){var n=r(198),i="function"==typeof t;if(e>65536){if(!i)throw new Error("Requested too many random bytes.");t(new Error("Requested too many random bytes."))}if(void 0!==n&&n.randomBytes){if(!i)return"0x"+n.randomBytes(e).toString("hex");n.randomBytes(e,function(e,r){e?t(u):t(null,"0x"+r.toString("hex"))})}else{var o;if(void 0!==n?o=n:"undefined"!=typeof msCrypto&&(o=msCrypto),o&&o.getRandomValues){var a=o.getRandomValues(new Uint8Array(e)),s="0x"+Array.from(a).map(function(e){return e.toString(16)}).join("");if(!i)return s;t(null,s)}else{var u=new Error('No "crypto" object available. This Browser doesn\'t support generating secure random bytes.');if(!i)throw u;t(u)}}}},function(e,t,r){e.exports=r(199)},function(e,t){e.exports=window.crypto},function(e,t,r){(function(e){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a=r(0).Buffer}catch(e){}function s(e,t,r){for(var n=0,i=Math.min(e.length,r),o=t;o=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function u(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=e[i]|e[i-1]<<8|e[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(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)i=s(e,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==t&&(i=s(e,t,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,f=0,c=r;c1&&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"],c=[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],h=[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(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var f=1;f>>26,h=67108863&u,d=Math.min(f,t.length-1),l=Math.max(0,f-e.length+1);l<=d;l++){var p=f-l|0;c+=(a=(i=0|e.words[p])*(o=0|t.words[l])+h)/67108864|0,h=67108863&a}r.words[f]=0|h,u=0|c}return 0!==u?r.words[f]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(e=e||10,t=0|t||1,16===e||"hex"===e){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%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=c[e],l=h[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(e);r=(p=p.idivn(l)).isZero()?b+r:f[d-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=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 e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==a),this.toArrayLike(a,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,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"===t,f=new e(o),c=this.clone();if(u){for(s=0;!c.isZero();s++)a=c.andln(255),c.iushrn(8),f[s]=a;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,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(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,l=0|a[1],p=8191&l,b=l>>>13,m=0|a[2],g=8191&m,v=m>>>13,y=0|a[3],w=8191&y,_=y>>>13,S=0|a[4],M=8191&S,A=S>>>13,x=0|a[5],E=8191&x,k=x>>>13,I=0|a[6],P=8191&I,B=I>>>13,T=0|a[7],O=8191&T,R=T>>>13,N=0|a[8],C=8191&N,L=N>>>13,j=0|a[9],z=8191&j,D=j>>>13,U=0|s[0],F=8191&U,q=U>>>13,H=0|s[1],K=8191&H,V=H>>>13,G=0|s[2],Y=8191&G,W=G>>>13,Z=0|s[3],X=8191&Z,J=Z>>>13,$=0|s[4],Q=8191&$,ee=$>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,fe=se>>>13,ce=0|s[8],he=8191&ce,de=ce>>>13,le=0|s[9],pe=8191&le,be=le>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(f+(n=Math.imul(h,F))|0)+((8191&(i=(i=Math.imul(h,q))+Math.imul(d,F)|0))<<13)|0;f=((o=Math.imul(d,q))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,q))+Math.imul(b,F)|0,o=Math.imul(b,q);var ge=(f+(n=n+Math.imul(h,K)|0)|0)+((8191&(i=(i=i+Math.imul(h,V)|0)+Math.imul(d,K)|0))<<13)|0;f=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,F),i=(i=Math.imul(g,q))+Math.imul(v,F)|0,o=Math.imul(v,q),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,V)|0;var ve=(f+(n=n+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,W)|0)+Math.imul(d,Y)|0))<<13)|0;f=((o=o+Math.imul(d,W)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,q))+Math.imul(_,F)|0,o=Math.imul(_,q),n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,V)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,W)|0;var ye=(f+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(d,X)|0))<<13)|0;f=((o=o+Math.imul(d,J)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(M,F),i=(i=Math.imul(M,q))+Math.imul(A,F)|0,o=Math.imul(A,q),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,W)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,J)|0;var we=(f+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(d,Q)|0))<<13)|0;f=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,q))+Math.imul(k,F)|0,o=Math.imul(k,q),n=n+Math.imul(M,K)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(g,X)|0,i=(i=i+Math.imul(g,J)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,J)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0;var _e=(f+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(d,re)|0))<<13)|0;f=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(P,F),i=(i=Math.imul(P,q))+Math.imul(B,F)|0,o=Math.imul(B,q),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,W)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,W)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0;var Se=(f+(n=n+Math.imul(h,oe)|0)|0)+((8191&(i=(i=i+Math.imul(h,ae)|0)+Math.imul(d,oe)|0))<<13)|0;f=((o=o+Math.imul(d,ae)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(O,F),i=(i=Math.imul(O,q))+Math.imul(R,F)|0,o=Math.imul(R,q),n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,V)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,V)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(M,X)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,J)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0;var Me=(f+(n=n+Math.imul(h,ue)|0)|0)+((8191&(i=(i=i+Math.imul(h,fe)|0)+Math.imul(d,ue)|0))<<13)|0;f=((o=o+Math.imul(d,fe)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,q))+Math.imul(L,F)|0,o=Math.imul(L,q),n=n+Math.imul(O,K)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,V)|0,n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(B,Y)|0,o=o+Math.imul(B,W)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,fe)|0;var Ae=(f+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,de)|0)+Math.imul(d,he)|0))<<13)|0;f=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(z,F),i=(i=Math.imul(z,q))+Math.imul(D,F)|0,o=Math.imul(D,q),n=n+Math.imul(C,K)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(L,K)|0,o=o+Math.imul(L,V)|0,n=n+Math.imul(O,Y)|0,i=(i=i+Math.imul(O,W)|0)+Math.imul(R,Y)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(P,X)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,J)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(M,re)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,n=n+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,fe)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,fe)|0,n=n+Math.imul(p,he)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(b,he)|0,o=o+Math.imul(b,de)|0;var xe=(f+(n=n+Math.imul(h,pe)|0)|0)+((8191&(i=(i=i+Math.imul(h,be)|0)+Math.imul(d,pe)|0))<<13)|0;f=((o=o+Math.imul(d,be)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(z,K),i=(i=Math.imul(z,V))+Math.imul(D,K)|0,o=Math.imul(D,V),n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,W)|0,n=n+Math.imul(O,X)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,J)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,fe)|0,n=n+Math.imul(g,he)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(v,he)|0,o=o+Math.imul(v,de)|0;var Ee=(f+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;f=((o=o+Math.imul(b,be)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(z,Y),i=(i=Math.imul(z,W))+Math.imul(D,Y)|0,o=Math.imul(D,W),n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,J)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(P,re)|0,i=(i=i+Math.imul(P,ne)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,n=n+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,fe)|0)+Math.imul(A,ue)|0,o=o+Math.imul(A,fe)|0,n=n+Math.imul(w,he)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(_,he)|0,o=o+Math.imul(_,de)|0;var ke=(f+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,be)|0)+Math.imul(v,pe)|0))<<13)|0;f=((o=o+Math.imul(v,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(z,X),i=(i=Math.imul(z,J))+Math.imul(D,X)|0,o=Math.imul(D,J),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ne)|0,n=n+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,ae)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,ae)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,fe)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,fe)|0,n=n+Math.imul(M,he)|0,i=(i=i+Math.imul(M,de)|0)+Math.imul(A,he)|0,o=o+Math.imul(A,de)|0;var Ie=(f+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,be)|0)+Math.imul(_,pe)|0))<<13)|0;f=((o=o+Math.imul(_,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(z,Q),i=(i=Math.imul(z,ee))+Math.imul(D,Q)|0,o=Math.imul(D,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(L,re)|0,o=o+Math.imul(L,ne)|0,n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,ae)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,ae)|0,n=n+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,fe)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,fe)|0,n=n+Math.imul(E,he)|0,i=(i=i+Math.imul(E,de)|0)+Math.imul(k,he)|0,o=o+Math.imul(k,de)|0;var Pe=(f+(n=n+Math.imul(M,pe)|0)|0)+((8191&(i=(i=i+Math.imul(M,be)|0)+Math.imul(A,pe)|0))<<13)|0;f=((o=o+Math.imul(A,be)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(z,re),i=(i=Math.imul(z,ne))+Math.imul(D,re)|0,o=Math.imul(D,ne),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,ae)|0,n=n+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,fe)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,fe)|0,n=n+Math.imul(P,he)|0,i=(i=i+Math.imul(P,de)|0)+Math.imul(B,he)|0,o=o+Math.imul(B,de)|0;var Be=(f+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,be)|0)+Math.imul(k,pe)|0))<<13)|0;f=((o=o+Math.imul(k,be)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(z,oe),i=(i=Math.imul(z,ae))+Math.imul(D,oe)|0,o=Math.imul(D,ae),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,fe)|0)+Math.imul(L,ue)|0,o=o+Math.imul(L,fe)|0,n=n+Math.imul(O,he)|0,i=(i=i+Math.imul(O,de)|0)+Math.imul(R,he)|0,o=o+Math.imul(R,de)|0;var Te=(f+(n=n+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,be)|0)+Math.imul(B,pe)|0))<<13)|0;f=((o=o+Math.imul(B,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(z,ue),i=(i=Math.imul(z,fe))+Math.imul(D,ue)|0,o=Math.imul(D,fe),n=n+Math.imul(C,he)|0,i=(i=i+Math.imul(C,de)|0)+Math.imul(L,he)|0,o=o+Math.imul(L,de)|0;var Oe=(f+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,be)|0)+Math.imul(R,pe)|0))<<13)|0;f=((o=o+Math.imul(R,be)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(z,he),i=(i=Math.imul(z,de))+Math.imul(D,he)|0,o=Math.imul(D,de);var Re=(f+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,be)|0)+Math.imul(L,pe)|0))<<13)|0;f=((o=o+Math.imul(L,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Ne=(f+(n=Math.imul(z,pe))|0)+((8191&(i=(i=Math.imul(z,be))+Math.imul(D,pe)|0))<<13)|0;return f=((o=Math.imul(D,be))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=me,u[1]=ge,u[2]=ve,u[3]=ye,u[4]=we,u[5]=_e,u[6]=Se,u[7]=Me,u[8]=Ae,u[9]=xe,u[10]=Ee,u[11]=ke,u[12]=Ie,u[13]=Pe,u[14]=Be,u[15]=Te,u[16]=Oe,u[17]=Re,u[18]=Ne,0!==f&&(u[19]=f,r.length++),r};function p(e,t,r){return(new b).mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(l=d),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?l(this,e,t):r<63?d(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.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,e,t):p(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},b.prototype.permute=function(e,t,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*t;a>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,f=0;f=0&&(0!==c||f>=i);f--){var h=0|this.words[f];this.words[f]=c<<26-o|h>>>o,c=h&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(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(e,t){var r=(this.length,e.length),n=this.clone(),i=e,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"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var f=0;f=0;h--){var d=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(i,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=d)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),f=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++f;for(var c=r.clone(),h=t.clone();!t.isZero();){for(var d=0,l=1;0==(t.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(c),a.isub(h)),i.iushrn(1),a.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(h)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(u)):(r.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(f)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,c=1;0==(t.words[0]&c)&&f<26;++f,c<<=1);if(f>0)for(t.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var h=0,d=1;0==(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/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(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new S(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},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(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){S.call(this,e),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)}g.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):r.strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},i(v,g),v.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new y;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return m[e]=t,t},S.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,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(),f=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,f).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,i),d=this.pow(e,i.addn(1).iushrn(1)),l=this.pow(e,i),p=a;0!==l.cmp(s);){for(var b=l,m=0;0!==b.cmp(s);m++)b=b.redSqr();n(m=0;n--){for(var f=t.words[n],c=u-1;c>=0;c--){var h=f>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new M(e)},i(M,S),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},M.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),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)},M.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),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)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(24)(e))},function(e,t,r){"use strict";var n=r(115),i=r(14).errors,o=function(e){this.requestManager=e,this.requests=[]};o.prototype.add=function(e){this.requests.push(e)},o.prototype.execute=function(){var e=this.requests;this.requestManager.sendBatch(e,function(t,r){r=r||[],e.map(function(e,t){return r[t]||{}}).forEach(function(t,r){if(e[r].callback){if(t&&t.error)return e[r].callback(i.ErrorResponse(t));if(!n.isValidResponse(t))return e[r].callback(i.InvalidResponse(t));try{e[r].callback(null,e[r].format?e[r].format(t.result):t.result)}catch(t){e[r].callback(t)}}})})},e.exports=o},function(e,t,r){"use strict";var n=null,i=Function("return this")();void 0!==i.ethereumProvider?n=i.ethereumProvider:void 0!==i.web3&&i.web3.currentProvider&&(i.web3.currentProvider.sendAsync&&(i.web3.currentProvider.send=i.web3.currentProvider.sendAsync,delete i.web3.currentProvider.sendAsync),!i.web3.currentProvider.on&&i.web3.currentProvider.connection&&"ipcProviderWrapper"===i.web3.currentProvider.connection.constructor.name&&(i.web3.currentProvider.on=function(e,t){if("function"!=typeof t)throw new Error("The second parameter callback must be a function.");switch(e){case"data":this.connection.on("data",function(e){var r="";e=e.toString();try{r=JSON.parse(e)}catch(r){return t(new Error("Couldn't parse response data"+e))}r.id||-1===r.method.indexOf("_subscription")||t(null,r)});break;default:this.connection.on(e,t)}}),n=i.web3.currentProvider),e.exports=n},function(e,t,r){"use strict";(function(t){var n=r(18),i=r(14).errors,o=null,a=null,s=null;if("undefined"!=typeof window&&void 0!==window.WebSocket)o=function(e,t){return new window.WebSocket(e,t)},a=btoa,s=function(e){return new URL(e)};else{o=r(204).w3cwebsocket,a=function(e){return t(e).toString("base64")};var u=r(44);if(u.URL){var f=u.URL;s=function(e){return new f(e)}}else s=r(44).parse}var c=function(e,t){var r=this;this.responseCallbacks={},this.notificationCallbacks=[],t=t||{},this._customTimeout=t.timeout;var i=s(e),u=t.headers||{},f=t.protocol||void 0;i.username&&i.password&&(u.authorization="Basic "+a(i.username+":"+i.password));var c=t.clientConfig||void 0;i.auth&&(u.authorization="Basic "+a(i.auth)),this.connection=new o(e,f,void 0,u,void 0,c),this.addDefaultEvents(),this.connection.onmessage=function(e){var t="string"==typeof e.data?e.data:"";r._parseResponse(t).forEach(function(e){var t=null;n.isArray(e)?e.forEach(function(e){r.responseCallbacks[e.id]&&(t=e.id)}):t=e.id,!t&&e&&e.method&&-1!==e.method.indexOf("_subscription")?r.notificationCallbacks.forEach(function(t){n.isFunction(t)&&t(e)}):r.responseCallbacks[t]&&(r.responseCallbacks[t](null,e),delete r.responseCallbacks[t])})},Object.defineProperty(this,"connected",{get:function(){return this.connection&&this.connection.readyState===this.connection.OPEN},enumerable:!0})};c.prototype.addDefaultEvents=function(){var e=this;this.connection.onerror=function(){e._timeout()},this.connection.onclose=function(){e._timeout(),e.reset()}},c.prototype._parseResponse=function(e){var t=this,r=[];return e.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|").forEach(function(e){t.lastChunk&&(e=t.lastChunk+e);var n=null;try{n=JSON.parse(e)}catch(r){return t.lastChunk=e,clearTimeout(t.lastChunkTimeout),void(t.lastChunkTimeout=setTimeout(function(){throw t._timeout(),i.InvalidResponse(e)},15e3))}clearTimeout(t.lastChunkTimeout),t.lastChunk=null,n&&r.push(n)}),r},c.prototype._addResponseCallback=function(e,t){var r=e.id||e[0].id,n=e.method||e[0].method;this.responseCallbacks[r]=t,this.responseCallbacks[r].method=n;var o=this;this._customTimeout&&setTimeout(function(){o.responseCallbacks[r]&&(o.responseCallbacks[r](i.ConnectionTimeout(o._customTimeout)),delete o.responseCallbacks[r])},this._customTimeout)},c.prototype._timeout=function(){for(var e in this.responseCallbacks)this.responseCallbacks.hasOwnProperty(e)&&(this.responseCallbacks[e](i.InvalidConnection("on WS")),delete this.responseCallbacks[e])},c.prototype.send=function(e,t){var r=this;if(this.connection.readyState!==this.connection.CONNECTING){if(this.connection.readyState!==this.connection.OPEN)return console.error("connection not open on send()"),"function"==typeof this.connection.onerror?this.connection.onerror(new Error("connection not open")):console.error("no error callback"),void t(new Error("connection not open"));this.connection.send(JSON.stringify(e)),this._addResponseCallback(e,t)}else setTimeout(function(){r.send(e,t)},10)},c.prototype.on=function(e,t){if("function"!=typeof t)throw new Error("The second parameter callback must be a function.");switch(e){case"data":this.notificationCallbacks.push(t);break;case"connect":this.connection.onopen=t;break;case"end":this.connection.onclose=t;break;case"error":this.connection.onerror=t}},c.prototype.removeListener=function(e,t){var r=this;switch(e){case"data":this.notificationCallbacks.forEach(function(e,n){e===t&&r.notificationCallbacks.splice(n,1)})}},c.prototype.removeAllListeners=function(e){switch(e){case"data":this.notificationCallbacks=[];break;case"connect":this.connection.onopen=null;break;case"end":this.connection.onclose=null;break;case"error":this.connection.onerror=null}},c.prototype.reset=function(){this._timeout(),this.notificationCallbacks=[],this.addDefaultEvents()},c.prototype.disconnect=function(){this.connection&&this.connection.close()},e.exports=c}).call(this,r(0).Buffer)},function(e,t,r){var n=function(){return this||{}}(),i=n.WebSocket||n.MozWebSocket,o=r(205);function a(e,t){return t?new i(e,t):new i(e)}i&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach(function(e){Object.defineProperty(a,e,{get:function(){return i[e]}})}),e.exports={w3cwebsocket:i?a:null,version:o}},function(e,t,r){e.exports=r(206).version},function(e){e.exports={_from:"git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible",_id:"websocket@1.0.26",_inBundle:!1,_integrity:"",_location:"/websocket",_phantomChildren:{},_requested:{type:"git",raw:"websocket@git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible",name:"websocket",escapedName:"websocket",rawSpec:"git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible",saveSpec:"git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible",fetchSpec:"git://github.com/frozeman/WebSocket-Node.git",gitCommittish:"browserifyCompatible"},_requiredBy:["/web3-providers-ws"],_resolved:"git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2",_spec:"websocket@git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible",_where:"E:\\web3\\web3j\\node_modules\\web3-providers-ws",author:{name:"Brian McKelvey",email:"brian@worlize.com",url:"https://www.worlize.com/"},browser:"lib/browser.js",bugs:{url:"https://github.com/theturtle32/WebSocket-Node/issues"},bundleDependencies:!1,config:{verbose:!1},contributors:[{name:"Iñaki Baz Castillo",email:"ibc@aliax.net",url:"http://dev.sipdoc.net"}],dependencies:{debug:"^2.2.0",nan:"^2.3.3","typedarray-to-buffer":"^3.1.2",yaeti:"^0.0.6"},deprecated:!1,description:"Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.",devDependencies:{"buffer-equal":"^1.0.0",faucet:"^0.0.1",gulp:"git+https://github.com/gulpjs/gulp.git#4.0","gulp-jshint":"^2.0.4",jshint:"^2.0.0","jshint-stylish":"^2.2.1",tape:"^4.0.1"},directories:{lib:"./lib"},engines:{node:">=0.10.0"},homepage:"https://github.com/theturtle32/WebSocket-Node",keywords:["websocket","websockets","socket","networking","comet","push","RFC-6455","realtime","server","client"],license:"Apache-2.0",main:"index",name:"websocket",repository:{type:"git",url:"git+https://github.com/theturtle32/WebSocket-Node.git"},scripts:{gulp:"gulp",install:"(node-gyp rebuild 2> builderror.log) || (exit 0)",test:"faucet test/unit"},version:"1.0.26"}},function(e,t,r){(function(e,n){var i;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(o){t&&t.nodeType,e&&e.nodeType;var a="object"==typeof n&&n;a.global!==a&&a.window!==a&&a.self;var s,u=2147483647,f=36,c=1,h=26,d=38,l=700,p=72,b=128,m="-",g=/^xn--/,v=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},_=f-c,S=Math.floor,M=String.fromCharCode;function A(e){throw new RangeError(w[e])}function x(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function E(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+x((e=e.replace(y,".")).split("."),t).join(".")}function k(e){for(var t,r,n=[],i=0,o=e.length;i=55296&&t<=56319&&i65535&&(t+=M((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=M(e)}).join("")}function P(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:f}function B(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function T(e,t,r){var n=0;for(e=r?S(e/l):e>>1,e+=S(e/t);e>_*h>>1;n+=f)e=S(e/_);return S(n+(_+1)*e/(e+d))}function O(e){var t,r,n,i,o,a,s,d,l,g,v=[],y=e.length,w=0,_=b,M=p;for((r=e.lastIndexOf(m))<0&&(r=0),n=0;n=128&&A("not-basic"),v.push(e.charCodeAt(n));for(i=r>0?r+1:0;i=y&&A("invalid-input"),((d=P(e.charCodeAt(i++)))>=f||d>S((u-w)/a))&&A("overflow"),w+=d*a,!(d<(l=s<=M?c:s>=M+h?h:s-M));s+=f)a>S(u/(g=f-l))&&A("overflow"),a*=g;M=T(w-o,t=v.length+1,0==o),S(w/t)>u-_&&A("overflow"),_+=S(w/t),w%=t,v.splice(w++,0,_)}return I(v)}function R(e){var t,r,n,i,o,a,s,d,l,g,v,y,w,_,x,E=[];for(y=(e=k(e)).length,t=b,r=0,o=p,a=0;a=t&&vS((u-r)/(w=n+1))&&A("overflow"),r+=(s-t)*w,t=s,a=0;au&&A("overflow"),v==t){for(d=r,l=f;!(d<(g=l<=o?c:l>=o+h?h:l-o));l+=f)x=d-g,_=f-g,E.push(M(B(g+x%_,0))),d=S(x/_);E.push(M(B(d,0))),o=T(r,w,n==i),r=0,++n}++r,++t}return E.join("")}s={version:"1.4.1",ucs2:{decode:k,encode:I},decode:O,encode:R,toASCII:function(e){return E(e,function(e){return v.test(e)?"xn--"+R(e):e})},toUnicode:function(e){return E(e,function(e){return g.test(e)?O(e.slice(4).toLowerCase()):e})}},void 0===(i=function(){return s}.call(t,r,t,e))||(e.exports=i)}()}).call(this,r(24)(e),r(7))},function(e,t,r){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,r){"use strict";t.decode=t.parse=r(210),t.encode=t.stringify=r(211)},function(e,t,r){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,r,o){t=t||"&",r=r||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var u=1e3;o&&"number"==typeof o.maxKeys&&(u=o.maxKeys);var f=e.length;u>0&&f>u&&(f=u);for(var c=0;c=0?(h=b.substr(0,m),d=b.substr(m+1)):(h=b,d=""),l=decodeURIComponent(h),p=decodeURIComponent(d),n(a,l)?i(a[l])?a[l].push(p):a[l]=[a[l],p]:a[l]=p}return a};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,r){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,r,s){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?o(a(e),function(a){var s=encodeURIComponent(n(a))+r;return i(e[a])?o(e[a],function(e){return s+encodeURIComponent(n(e))}).join(t):s+encodeURIComponent(n(e[a]))}).join(t):s?encodeURIComponent(n(s))+r+encodeURIComponent(n(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n=0)return this._url=this._parseUrl(t.headers.location),this._method="GET",this._loweredHeaders["content-type"]&&(delete this._headers[this._loweredHeaders["content-type"]],delete this._loweredHeaders["content-type"]),null!=this._headers["Content-Type"]&&delete this._headers["Content-Type"],delete this._headers["Content-Length"],this.upload._reset(),this._finalizeHeaders(),void this._sendHxxpRequest();this._response=t,this._response.on("data",function(e){return n._onHttpResponseData(t,e)}),this._response.on("end",function(){return n._onHttpResponseEnd(t)}),this._response.on("close",function(){return n._onHttpResponseClose(t)}),this.responseUrl=this._url.href.split("#")[0],this.status=t.statusCode,this.statusText=a.STATUS_CODES[this.status],this._parseResponseHeaders(t);var i=this._responseHeaders["content-length"]||"";this._totalBytes=+i,this._lengthComputable=!!i,this._setReadyState(r.HEADERS_RECEIVED)}},r.prototype._onHttpResponseData=function(e,t){this._response===e&&(this._responseParts.push(new n(t)),this._loadedBytes+=t.length,this.readyState!==r.LOADING&&this._setReadyState(r.LOADING),this._dispatchProgress("progress"))},r.prototype._onHttpResponseEnd=function(e){this._response===e&&(this._parseResponse(),this._request=null,this._response=null,this._setReadyState(r.DONE),this._dispatchProgress("load"),this._dispatchProgress("loadend"))},r.prototype._onHttpResponseClose=function(e){if(this._response===e){var t=this._request;this._setError(),t.abort(),this._setReadyState(r.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend")}},r.prototype._onHttpTimeout=function(e){this._request===e&&(this._setError(),e.abort(),this._setReadyState(r.DONE),this._dispatchProgress("timeout"),this._dispatchProgress("loadend"))},r.prototype._onHttpRequestError=function(e,t){this._request===e&&(this._setError(),e.abort(),this._setReadyState(r.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend"))},r.prototype._dispatchProgress=function(e){var t=new r.ProgressEvent(e);t.lengthComputable=this._lengthComputable,t.loaded=this._loadedBytes,t.total=this._totalBytes,this.dispatchEvent(t)},r.prototype._setError=function(){this._request=null,this._response=null,this._responseHeaders=null,this._responseParts=null},r.prototype._parseUrl=function(e,t,r){var n=null==this.nodejsBaseUrl?e:f.resolve(this.nodejsBaseUrl,e),i=f.parse(n,!1,!0);i.hash=null;var o=(i.auth||"").split(":"),a=o[0],s=o[1];return(a||s||t||r)&&(i.auth=(t||a||"")+":"+(r||s||"")),i},r.prototype._parseResponseHeaders=function(e){for(var t in this._responseHeaders={},e.headers){var r=t.toLowerCase();this._privateHeaders[r]||(this._responseHeaders[r]=e.headers[t])}null!=this._mimeOverride&&(this._responseHeaders["content-type"]=this._mimeOverride)},r.prototype._parseResponse=function(){var e=n.concat(this._responseParts);switch(this._responseParts=null,this.responseType){case"json":this.responseText=null;try{this.response=JSON.parse(e.toString("utf-8"))}catch(e){this.response=null}return;case"buffer":return this.responseText=null,void(this.response=e);case"arraybuffer":this.responseText=null;for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),i=0;i0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t=n.allocUnsafe(e>>>0),r=this.head,i=0;r;)o(r.data,t,i),i+=r.data.length,r=r.next;return t},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n,i=1,o={},a=!1,s=e.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(e);u=u&&u.setTimeout?u:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick(function(){c(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?function(){var t="setImmediate$"+Math.random()+"$",r=function(r){r.source===e&&"string"==typeof r.data&&0===r.data.indexOf(t)&&c(+r.data.slice(t.length))};e.addEventListener?e.addEventListener("message",r,!1):e.attachEvent("onmessage",r),n=function(r){e.postMessage(t+r,"*")}}():e.MessageChannel?function(){var e=new MessageChannel;e.port1.onmessage=function(e){c(e.data)},n=function(t){e.port2.postMessage(t)}}():s&&"onreadystatechange"in s.createElement("script")?function(){var e=s.documentElement;n=function(t){var r=s.createElement("script");r.onreadystatechange=function(){c(t),r.onreadystatechange=null,e.removeChild(r),r=null},e.appendChild(r)}}():n=function(e){setTimeout(c,0,e)},u.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r0;)if(F+=r,r=e.charAt(a++),4===q?(C+=String.fromCharCode(parseInt(F,16)),q=0,f=a-1):q++,!r)break e;if('"'===r&&!j){D=U.pop()||p,C+=e.substring(f,a-1);break}if(!("\\"!==r||j||(j=!0,C+=e.substring(f,a-1),r=e.charAt(a++))))break;if(j){if(j=!1,"n"===r?C+="\n":"r"===r?C+="\r":"t"===r?C+="\t":"f"===r?C+="\f":"b"===r?C+="\b":"u"===r?(q=1,F=""):C+=r,r=e.charAt(a++),f=a-1,r)continue;break}h.lastIndex=a;var d=h.exec(e);if(!d){a=e.length+1,C+=e.substring(f,a-1);break}if(a=d.index+1,!(r=e.charAt(d.index))){C+=e.substring(f,a-1);break}}continue;case S:if(!r)continue;if("r"!==r)return Y("Invalid true started with t"+r);D=M;continue;case M:if(!r)continue;if("u"!==r)return Y("Invalid true started with tr"+r);D=A;continue;case A:if(!r)continue;if("e"!==r)return Y("Invalid true started with tru"+r);o(!0),s(),D=U.pop()||p;continue;case x:if(!r)continue;if("a"!==r)return Y("Invalid false started with f"+r);D=E;continue;case E:if(!r)continue;if("l"!==r)return Y("Invalid false started with fa"+r);D=k;continue;case k:if(!r)continue;if("s"!==r)return Y("Invalid false started with fal"+r);D=I;continue;case I:if(!r)continue;if("e"!==r)return Y("Invalid false started with fals"+r);o(!1),s(),D=U.pop()||p;continue;case P:if(!r)continue;if("u"!==r)return Y("Invalid null started with n"+r);D=B;continue;case B:if(!r)continue;if("l"!==r)return Y("Invalid null started with nu"+r);D=T;continue;case T:if(!r)continue;if("l"!==r)return Y("Invalid null started with nul"+r);o(null),s(),D=U.pop()||p;continue;case O:if("."!==r)return Y("Leading zero not followed by .");L+=r,D=R;continue;case R:if(-1!=="0123456789".indexOf(r))L+=r;else if("."===r){if(-1!==L.indexOf("."))return Y("Invalid number has two dots");L+=r}else if("e"===r||"E"===r){if(-1!==L.indexOf("e")||-1!==L.indexOf("E"))return Y("Invalid number has two exponential");L+=r}else if("+"===r||"-"===r){if("e"!==n&&"E"!==n)return Y("Invalid symbol in number");L+=r}else L&&(o(parseFloat(L)),s(),L=""),a--,D=U.pop()||p;continue;default:return Y("Unknown state: "+D)}K>=N&&function(){var e=0;C!==u&&C.length>c&&(Y("Max buffer length exceeded: textNode"),e=Math.max(e,C.length)),L.length>c&&(Y("Max buffer length exceeded: numberNode"),e=Math.max(e,L.length)),N=c-e+K}()}),e(Q).on(function(){if(D==l)return o({}),s(),void(z=!0);D===p&&0===H||Y("Unexpected end");C!==u&&(o(C),s(),C=u);z=!0})}var C=function(){var e=p(function(e){return e.unshift(/^/),function(e){return e.exec.bind(e)}(RegExp(e.map(h("source")).join("")))}),t=/(\$?)/,r=/(?:{([\w ]*?)})?/,n=e(t,/([\w-_]+|\*)/,r),i=e(t,/\["([^"]+)"\]/,r),o=e(t,/\[(\d+|\*)\]/,r),a=e(t,/()/,/{([\w ]*?)}/),s=e(/\.\./),u=e(/\./),f=e(t,/!/),c=e(/$/);return function(e){return e(d(n,i,o,a),s,u,f,c)}}();function L(e,t){return{key:e,node:t}}var j=h("key"),z=h("node"),D={};function U(e){var t=e(K).emit,r=e(V).emit,n=e(X).emit,i=e(Z).emit;function a(e,t,r){z(x(e))[t]=r}function s(e,r,n){e&&a(e,r,n);var i=M(L(r,n),e);return t(i),i}var u={};return u[re]=function(e,t){if(!e)return n(t),s(e,D,t);var r=function(e,t){var r=z(x(e));return v(o,r)?s(e,y(r),t):e}(e,t),i=E(r),u=j(x(r));return a(i,u,t),M(L(u,t),i)},u[ne]=function(e){return r(e),E(e)||i(z(x(e)))},u[te]=s,u}var F=C(function(e,t,r,n,i){var o=1,s=2,u=3,h=c(j,x),l=c(z,x);function p(e,t){return!!t[o]?b(e,x):e}function m(e){if(e==g)return g;return b(function(e){return h(e)!=D},c(e,E))}function v(){return function(e){return h(e)==D}}function w(e,t,r,n,i){var o=e(r);if(o){var a=function(e,t,r){return T(function(e,t){return t(e,r)},t,e)}(t,n,o);return i(r.substr(y(o[0])),a)}}function _(e,t){return f(w,e,t)}var M=d(_(e,I(p,function(e,t){var r=t[u];return r?b(c(f(S,k(r.split(/\W+/))),l),e):e},function(e,t){var r=t[s];return b(r&&"*"!=r?function(e){return h(e)==r}:g,e)},m)),_(t,I(function(e){if(e==g)return g;var t=v(),r=e,n=m(function(e){return i(e)}),i=d(t,r,n);return i})),_(r,I()),_(n,I(p,v)),_(i,I(function(e){return function(t){var r=e(t);return!0===r?x(t):r}})),function(e){throw a('"'+e+'" could not be tokenised')});function A(e,t){return t}function P(e,t){return M(e,t,e?P:A)}return function(e){try{return P(e,g)}catch(t){throw a('Could not compile "'+e+'" because '+t.message)}}});function q(e,t,r){var n,i;function o(e){return function(t){return t.id==e}}return{on:function(r,o){var a={listener:r,id:o||r};return t&&t.emit(e,r,a.id),n=M(a,n),i=M(r,i),this},emit:function(){!function e(t,r){t&&(x(t).apply(null,r),e(E(t),r))}(i,arguments)},un:function(t){var a;n=O(n,o(t),function(e){a=e}),a&&(i=O(i,function(e){return e==a.listener}),r&&r.emit(e,a.listener,a.id))},listeners:function(){return i},hasListener:function(e){return _(function e(t,r){return r&&(t(x(r))?x(r):e(t,E(r)))}(e?o(e):g,n))}}}var H=1,K=H++,V=H++,G=H++,Y=H++,W="fail",Z=H++,X=H++,J="start",$="data",Q="end",ee=H++,te=H++,re=H++,ne=H++;function ie(e,t,r){try{var n=s.parse(t)}catch(e){}return{statusCode:e,body:t,jsonBody:n,thrown:r}}function oe(e,t){var r={node:e(V),path:e(K)};function n(t,r,n){var i=e(t).emit;r.on(function(e){var t=n(e);!1!==t&&function(e,t,r){var n=R(r);e(t,P(E(B(j,n))),P(B(z,n)))}(i,z(t),e)},t),e("removeListener").on(function(n){n==t&&(e(n).listeners()||r.un(t))})}e("newListener").on(function(e){var i=/(node|path):(.*)/.exec(e);if(i){var o=r[i[1]];o.hasListener(e)||n(e,o,t(i[2]))}})}function ae(e,t){var r,n=/^(node|path):./,i=e(Z),o=e(Y).emit,a=e(G).emit,s=p(function(t,i){if(r[t])l(i,r[t]);else{var o=e(t),a=i[0];n.test(t)?u(o,a):o.on(a)}return r});function u(e,t,n){n=n||t;var i=c(t);return e.on(function(){var t=!1;r.forget=function(){t=!0},l(arguments,i),delete r.forget,t&&e.un(n)},n),r}function c(e){return function(){try{return e.apply(r,arguments)}catch(e){setTimeout(function(){throw e})}}}function h(t,r,n){var i;i="node"==t?function(e){return function(){var t=e.apply(this,arguments);_(t)&&(t==fe.drop?o():a(t))}}(n):n,u(function(t,r){return e(t+":"+r)}(t,r),i,n)}function d(e,t,n){return w(t)?h(e,t,n):function(e,t){for(var r in t)h(e,r,t[r])}(e,t),r}return e(X).on(function(e){r.root=function(e){return function(){return e}}(e)}),e(J).on(function(e,t){r.header=function(e){return e?t[e]:t}}),r={on:s,addListener:s,removeListener:function(t,n,o){if("done"==t)i.un(n);else if("node"==t||"path"==t)e.un(t+":"+n,o);else{var a=n;e(t).un(a)}return r},emit:e.emit,node:f(d,"node"),path:f(d,"path"),done:f(u,i),start:f(function(t,n){return e(t).on(c(n),n),r},J),fail:e(W).on,abort:e(ee).emit,header:m,root:m,source:t}}function se(e,t,n,i,o){var a=function(){var e={},t=n("newListener"),r=n("removeListener");function n(n){return e[n]=q(n,t,r)}function i(t){return e[t]||n(t)}return["emit","on","un"].forEach(function(e){i[e]=p(function(t,r){l(r,i(t)[e])})}),i}();return t&&function(e,t,n,i,o,a,s){"use strict";var c=e($).emit,h=e(W).emit,d=0,l=!0;function p(){var e=t.responseText,r=e.substr(d);r&&c(r),d=y(e)}e(ee).on(function(){t.onreadystatechange=null,t.abort()}),"onprogress"in t&&(t.onprogress=p),t.onreadystatechange=function(){function r(){try{l&&e(J).emit(t.status,function(e){var t={};return e&&e.split("\r\n").forEach(function(e){var r=e.indexOf(": ");t[e.substring(0,r)]=e.substring(r+2)}),t}(t.getAllResponseHeaders())),l=!1}catch(e){}}switch(t.readyState){case 2:case 3:return r();case 4:r(),2==String(t.status)[0]?(p(),e(Q).emit()):h(ie(t.status,t.responseText))}};try{for(var b in t.open(n,i,!0),a)t.setRequestHeader(b,a[b]);(function(e,t){function r(t){return t.port||function(e){return{"http:":80,"https:":443}[e]}(t.protocol||e.protocol)}return!!(t.protocol&&t.protocol!=e.protocol||t.host&&t.host!=e.host||t.host&&r(t)!=r(e))})(r.location,function(e){var t=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(e)||[];return{protocol:t[1]||"",host:t[2]||"",port:t[3]||""}}(i))||t.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.withCredentials=s,t.send(o)}catch(e){r.setTimeout(f(h,ie(u,u,e)),0)}}(a,new XMLHttpRequest,e,t,n,i,o),N(a),function(e,t){"use strict";var r,n={};function i(e){return function(t){r=e(r,t)}}for(var o in t)e(o).on(i(t[o]),n);e(G).on(function(e){var t=x(r),n=j(t),i=E(r);i&&(z(x(i))[n]=e)}),e(Y).on(function(){var e=x(r),t=j(e),n=E(r);n&&delete z(x(n))[t]}),e(ee).on(function(){for(var r in t)e(r).un(n)})}(a,U(a)),oe(a,F),ae(a,t)}function ue(e,t,r,n,i,o,a){return i=i?s.parse(s.stringify(i)):{},n?w(n)||(n=s.stringify(n),i["Content-Type"]=i["Content-Type"]||"application/json"):n=null,e(r||"GET",function(e,t){return!1===t&&(-1==e.indexOf("?")?e+="?":e+="&",e+="_="+(new Date).getTime()),e}(t,a),n,i,o||!1)}function fe(e){var t=I("resume","pause","pipe"),r=f(S,t);return e?r(e)||w(e)?ue(se,e):ue(se,e.url,e.method,e.body,e.headers,e.withCredentials,e.cached):se()}fe.drop=function(){return fe.drop},(n=function(){return fe}.apply(t,[]))===u||(e.exports=n)}(function(){try{return window}catch(e){return self}}(),Object,Array,Error,JSON)},function(e,t,r){"use strict";var n=r(14).formatters,i=r(37),o=r(20);e.exports=function(e){var t=function(t){var r;return t.property?(e[t.property]||(e[t.property]={}),r=e[t.property]):r=e,t.methods&&t.methods.forEach(function(t){t instanceof i||(t=new i(t)),t.attachToObject(r),t.setRequestManager(e._requestManager)}),e};return t.formatters=n,t.utils=o,t.Method=i,t}},function(e,t,r){"use strict";e.exports=r(233)(window,function(){if(void 0===window.Promise)throw new Error("any-promise browser requires a polyfill or explicit registration e.g: require('any-promise/register/bluebird')");return{Promise:window.Promise,implementation:"window.Promise"}})},function(e,t,r){"use strict";var n=null;e.exports=function(e,t){return function(r,i){r=r||null;var o=!1!==(i=i||{}).global;if(null===n&&o&&(n=e["@@any-promise/REGISTRATION"]||null),null!==n&&null!==r&&n.implementation!==r)throw new Error('any-promise already defined as "'+n.implementation+'". You can only register an implementation before the first call to require("any-promise") and an implementation cannot be changed');return null===n&&(n=null!==r&&void 0!==i.Promise?{Promise:i.Promise,implementation:r}:t(r),o&&(e["@@any-promise/REGISTRATION"]=n)),n}}},function(e,t,r){"use strict";var n=r(18),i=r(14).errors,o=r(126);function a(e){o.call(this),this.id=null,this.callback=n.identity,this.arguments=null,this._reconnectIntervalId=null,this.options={subscription:e.subscription,type:e.type,requestManager:e.requestManager}}a.prototype=Object.create(o.prototype),a.prototype.constructor=a,a.prototype._extractCallback=function(e){if(n.isFunction(e[e.length-1]))return e.pop()},a.prototype._validateArgs=function(e){var t=this.options.subscription;if(t||(t={}),t.params||(t.params=0),e.length!==t.params)throw i.InvalidNumberOfParams(e.length,t.params+1,e[0])},a.prototype._formatInput=function(e){var t=this.options.subscription;return t&&t.inputFormatter?t.inputFormatter.map(function(t,r){return t?t(e[r]):e[r]}):e},a.prototype._formatOutput=function(e){var t=this.options.subscription;return t&&t.outputFormatter&&e?t.outputFormatter(e):e},a.prototype._toPayload=function(e){var t=[];if(this.callback=this._extractCallback(e)||n.identity,this.subscriptionMethod||(this.subscriptionMethod=e.shift(),this.options.subscription.subscriptionName&&(this.subscriptionMethod=this.options.subscription.subscriptionName)),this.arguments||(this.arguments=this._formatInput(e),this._validateArgs(this.arguments),e=[]),t.push(this.subscriptionMethod),t=t.concat(this.arguments),e.length)throw new Error("Only a callback is allowed as parameter on an already instantiated subscription.");return{method:this.options.type+"_subscribe",params:t}},a.prototype.unsubscribe=function(e){this.options.requestManager.removeSubscription(this.id,e),this.id=null,this.removeAllListeners(),clearInterval(this._reconnectIntervalId)},a.prototype.subscribe=function(){var e=this,t=Array.prototype.slice.call(arguments),r=this._toPayload(t);if(!r)return this;if(!this.options.requestManager.provider){var i=new Error("No provider set.");return this.callback(i,null,this),this.emit("error",i),this}if(!this.options.requestManager.provider.on){var o=new Error("The current provider doesn't support subscriptions: "+this.options.requestManager.provider.constructor.name);return this.callback(o,null,this),this.emit("error",o),this}return this.id&&this.unsubscribe(),this.options.params=r.params[1],"logs"===r.params[0]&&n.isObject(r.params[1])&&r.params[1].hasOwnProperty("fromBlock")&&isFinite(r.params[1].fromBlock)&&this.options.requestManager.send({method:"eth_getLogs",params:[r.params[1]]},function(t,r){t?(e.callback(t,null,e),e.emit("error",t)):r.forEach(function(t){var r=e._formatOutput(t);e.callback(null,r,e),e.emit("data",r)})}),"object"==typeof r.params[1]&&delete r.params[1].fromBlock,this.options.requestManager.send(r,function(t,i){!t&&i?(e.id=i,e.options.requestManager.addSubscription(e.id,r.params[0],e.options.type,function(t,r){t?(e.options.requestManager.removeSubscription(e.id),e.options.requestManager.provider.once&&(e._reconnectIntervalId=setInterval(function(){e.options.requestManager.provider.reconnect&&e.options.requestManager.provider.reconnect()},500),e.options.requestManager.provider.once("connect",function(){clearInterval(e._reconnectIntervalId),e.subscribe(e.callback)})),e.emit("error",t),e.callback(t,null,e)):(n.isArray(r)||(r=[r]),r.forEach(function(t){var r=e._formatOutput(t);if(n.isFunction(e.options.subscription.subscriptionHandler))return e.options.subscription.subscriptionHandler.call(e,r);e.emit("data",r),e.callback(null,r,e)}))})):(e.callback(t,null,e),e.emit("error",t))}),this},e.exports=a},function(e,t,r){"use strict";var n=r(128),i=r(35),o=r(14),a=r(65).subscriptions,s=r(37),u=r(20),f=r(66),c=r(129),h=r(236),d=r(114),l=r(246),p=r(130),b=r(327),m=o.formatters,g=function(e){return n.isString(e[0])&&0===e[0].indexOf("0x")?"eth_getBlockByHash":"eth_getBlockByNumber"},v=function(e){return n.isString(e[0])&&0===e[0].indexOf("0x")?"eth_getTransactionByBlockHashAndIndex":"eth_getTransactionByBlockNumberAndIndex"},y=function(e){return n.isString(e[0])&&0===e[0].indexOf("0x")?"eth_getUncleByBlockHashAndIndex":"eth_getUncleByBlockNumberAndIndex"},w=function(e){return n.isString(e[0])&&0===e[0].indexOf("0x")?"eth_getBlockTransactionCountByHash":"eth_getBlockTransactionCountByNumber"},_=function(e){return n.isString(e[0])&&0===e[0].indexOf("0x")?"eth_getUncleCountByBlockHash":"eth_getUncleCountByBlockNumber"},S=function(){var e=this;i.packageInit(this,arguments);var t=this.setProvider;this.setProvider=function(){t.apply(e,arguments),e.net.setProvider.apply(e,arguments),e.personal.setProvider.apply(e,arguments),e.accounts.setProvider.apply(e,arguments),e.Contract.setProvider(e.currentProvider,e.accounts)};var r=null,o="latest";Object.defineProperty(this,"defaultAccount",{get:function(){return r},set:function(t){return t&&(r=u.toChecksumAddress(m.inputAddressFormatter(t))),e.Contract.defaultAccount=r,e.personal.defaultAccount=r,A.forEach(function(e){e.defaultAccount=r}),t},enumerable:!0}),Object.defineProperty(this,"defaultBlock",{get:function(){return o},set:function(t){return o=t,e.Contract.defaultBlock=o,e.personal.defaultBlock=o,A.forEach(function(e){e.defaultBlock=o}),t},enumerable:!0}),this.clearSubscriptions=e._requestManager.clearSubscriptions,this.net=new f(this.currentProvider),this.net.getNetworkType=b.bind(this),this.accounts=new l(this.currentProvider),this.personal=new c(this.currentProvider),this.personal.defaultAccount=this.defaultAccount;var S=this,M=function(){h.apply(this,arguments);var e=this,t=S.setProvider;S.setProvider=function(){t.apply(S,arguments),i.packageInit(e,[S.currentProvider])}};M.setProvider=function(){h.setProvider.apply(this,arguments)},(M.prototype=Object.create(h.prototype)).constructor=M,this.Contract=M,this.Contract.defaultAccount=this.defaultAccount,this.Contract.defaultBlock=this.defaultBlock,this.Contract.setProvider(this.currentProvider,this.accounts),this.Iban=d,this.abi=p;var A=[new s({name:"getNodeInfo",call:"web3_clientVersion"}),new s({name:"getProtocolVersion",call:"eth_protocolVersion",params:0}),new s({name:"getCoinbase",call:"eth_coinbase",params:0}),new s({name:"isMining",call:"eth_mining",params:0}),new s({name:"getHashrate",call:"eth_hashrate",params:0,outputFormatter:u.hexToNumber}),new s({name:"isSyncing",call:"eth_syncing",params:0,outputFormatter:m.outputSyncingFormatter}),new s({name:"getGasPrice",call:"eth_gasPrice",params:0,outputFormatter:m.outputBigNumberFormatter}),new s({name:"getAccounts",call:"eth_accounts",params:0,outputFormatter:u.toChecksumAddress}),new s({name:"getBlockNumber",call:"eth_blockNumber",params:0,outputFormatter:u.hexToNumber}),new s({name:"getBalance",call:"eth_getBalance",params:2,inputFormatter:[m.inputAddressFormatter,m.inputDefaultBlockNumberFormatter],outputFormatter:m.outputBigNumberFormatter}),new s({name:"getStorageAt",call:"eth_getStorageAt",params:3,inputFormatter:[m.inputAddressFormatter,u.numberToHex,m.inputDefaultBlockNumberFormatter]}),new s({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[m.inputAddressFormatter,m.inputDefaultBlockNumberFormatter]}),new s({name:"getBlock",call:g,params:2,inputFormatter:[m.inputBlockNumberFormatter,function(e){return!!e}],outputFormatter:m.outputBlockFormatter}),new s({name:"getUncle",call:y,params:2,inputFormatter:[m.inputBlockNumberFormatter,u.numberToHex],outputFormatter:m.outputBlockFormatter}),new s({name:"getBlockTransactionCount",call:w,params:1,inputFormatter:[m.inputBlockNumberFormatter],outputFormatter:u.hexToNumber}),new s({name:"getBlockUncleCount",call:_,params:1,inputFormatter:[m.inputBlockNumberFormatter],outputFormatter:u.hexToNumber}),new s({name:"getTransaction",call:"eth_getTransactionByHash",params:1,inputFormatter:[null],outputFormatter:m.outputTransactionFormatter}),new s({name:"getTransactionFromBlock",call:v,params:2,inputFormatter:[m.inputBlockNumberFormatter,u.numberToHex],outputFormatter:m.outputTransactionFormatter}),new s({name:"getTransactionReceipt",call:"eth_getTransactionReceipt",params:1,inputFormatter:[null],outputFormatter:m.outputTransactionReceiptFormatter}),new s({name:"getTransactionCount",call:"eth_getTransactionCount",params:2,inputFormatter:[m.inputAddressFormatter,m.inputDefaultBlockNumberFormatter],outputFormatter:u.hexToNumber}),new s({name:"sendSignedTransaction",call:"eth_sendRawTransaction",params:1,inputFormatter:[null]}),new s({name:"signTransaction",call:"eth_signTransaction",params:1,inputFormatter:[m.inputTransactionFormatter]}),new s({name:"sendTransaction",call:"eth_sendTransaction",params:1,inputFormatter:[m.inputTransactionFormatter]}),new s({name:"sign",call:"eth_sign",params:2,inputFormatter:[m.inputSignFormatter,m.inputAddressFormatter],transformPayload:function(e){return e.params.reverse(),e}}),new s({name:"call",call:"eth_call",params:2,inputFormatter:[m.inputCallFormatter,m.inputDefaultBlockNumberFormatter]}),new s({name:"estimateGas",call:"eth_estimateGas",params:1,inputFormatter:[m.inputCallFormatter],outputFormatter:u.hexToNumber}),new s({name:"getCompilers",call:"eth_getCompilers",params:0}),new s({name:"compile.solidity",call:"eth_compileSolidity",params:1}),new s({name:"compile.lll",call:"eth_compileLLL",params:1}),new s({name:"compile.serpent",call:"eth_compileSerpent",params:1}),new s({name:"submitWork",call:"eth_submitWork",params:3}),new s({name:"getWork",call:"eth_getWork",params:0}),new s({name:"getPastLogs",call:"eth_getLogs",params:1,inputFormatter:[m.inputLogFormatter],outputFormatter:m.outputLogFormatter}),new a({name:"subscribe",type:"eth",subscriptions:{newBlockHeaders:{subscriptionName:"newHeads",params:0,outputFormatter:m.outputBlockFormatter},pendingTransactions:{subscriptionName:"newPendingTransactions",params:0},logs:{params:1,inputFormatter:[m.inputLogFormatter],outputFormatter:m.outputLogFormatter,subscriptionHandler:function(e){e.removed?this.emit("changed",e):this.emit("data",e),n.isFunction(this.callback)&&this.callback(null,e,this)}},syncing:{params:0,outputFormatter:m.outputSyncingFormatter,subscriptionHandler:function(e){var t=this;!0!==this._isSyncing?(this._isSyncing=!0,this.emit("changed",t._isSyncing),n.isFunction(this.callback)&&this.callback(null,t._isSyncing,this),setTimeout(function(){t.emit("data",e),n.isFunction(t.callback)&&t.callback(null,e,t)},0)):(this.emit("data",e),n.isFunction(t.callback)&&this.callback(null,e,this),clearTimeout(this._isSyncingTimeout),this._isSyncingTimeout=setTimeout(function(){e.currentBlock>e.highestBlock-200&&(t._isSyncing=!1,t.emit("changed",t._isSyncing),n.isFunction(t.callback)&&t.callback(null,t._isSyncing,t))},500))}}}})];A.forEach(function(t){t.attachToObject(e),t.setRequestManager(e._requestManager,e.accounts),t.defaultBlock=e.defaultBlock,t.defaultAccount=e.defaultAccount})};i.addProviders(S),e.exports=S},function(e,t,r){"use strict";var n=r(18),i=r(35),o=r(37),a=r(20),s=r(65).subscription,u=r(14).formatters,f=r(14).errors,c=r(125),h=r(130),d=function e(t,r,o){var s=this,f=Array.prototype.slice.call(arguments);if(!(this instanceof e))throw new Error('Please use the "new" keyword to instantiate a web3.eth.contract() object!');if(i.packageInit(this,[this.constructor.currentProvider]),this.clearSubscriptions=this._requestManager.clearSubscriptions,!t||!Array.isArray(t))throw new Error("You must provide the json interface of the contract when instantiating a contract object.");this.options={};var c=f[f.length-1];n.isObject(c)&&!n.isArray(c)&&(o=c,this.options=n.extend(this.options,this._getOrSetDefaultOptions(o)),n.isObject(r)&&(r=null)),Object.defineProperty(this.options,"address",{set:function(e){e&&(s._address=a.toChecksumAddress(u.inputAddressFormatter(e)))},get:function(){return s._address},enumerable:!0}),Object.defineProperty(this.options,"jsonInterface",{set:function(e){return s.methods={},s.events={},s._jsonInterface=e.map(function(e){var t,r;if(e.constant="view"===e.stateMutability||"pure"===e.stateMutability||e.constant,e.payable="payable"===e.stateMutability||e.payable,e.name&&(r=a._jsonInterfaceMethodToString(e)),"function"===e.type){if(e.signature=h.encodeFunctionSignature(r),t=s._createTxObject.bind({method:e,parent:s}),s.methods[e.name]){var n=s._createTxObject.bind({method:e,parent:s,nextMethod:s.methods[e.name]});s.methods[e.name]=n}else s.methods[e.name]=t;s.methods[e.signature]=t,s.methods[r]=t}else if("event"===e.type){e.signature=h.encodeEventSignature(r);var i=s._on.bind(s,e.signature);s.events[e.name]&&"bound "!==s.events[e.name].name||(s.events[e.name]=i),s.events[e.signature]=i,s.events[r]=i}return e}),s.events.allEvents=s._on.bind(s,"allevents"),s._jsonInterface},get:function(){return s._jsonInterface},enumerable:!0});var d=this.constructor.defaultAccount,l=this.constructor.defaultBlock||"latest";Object.defineProperty(this,"defaultAccount",{get:function(){return d},set:function(e){return e&&(d=a.toChecksumAddress(u.inputAddressFormatter(e))),e},enumerable:!0}),Object.defineProperty(this,"defaultBlock",{get:function(){return l},set:function(e){return l=e,e},enumerable:!0}),this.methods={},this.events={},this._address=null,this._jsonInterface=[],this.options.address=r,this.options.jsonInterface=t};d.setProvider=function(e,t){i.packageInit(this,[e]),this._ethAccounts=t},d.prototype._getCallback=function(e){if(e&&n.isFunction(e[e.length-1]))return e.pop()},d.prototype._checkListener=function(e,t){if(t===e)throw new Error('The event "'+e+"\" is a reserved event name, you can't use it.")},d.prototype._getOrSetDefaultOptions=function(e){var t=e.gasPrice?String(e.gasPrice):null,r=e.from?a.toChecksumAddress(u.inputAddressFormatter(e.from)):null;return e.data=e.data||this.options.data,e.from=r||this.options.from,e.gasPrice=t||this.options.gasPrice,e.gas=e.gas||e.gasLimit||this.options.gas,delete e.gasLimit,e},d.prototype._encodeEventABI=function(e,t){var r=(t=t||{}).filter||{},i={};if(["fromBlock","toBlock"].filter(function(e){return void 0!==t[e]}).forEach(function(e){i[e]=u.inputBlockNumberFormatter(t[e])}),n.isArray(t.topics))i.topics=t.topics;else{if(i.topics=[],e&&!e.anonymous&&"ALLEVENTS"!==e.name&&i.topics.push(e.signature),"ALLEVENTS"!==e.name){var o=e.inputs.filter(function(e){return!0===e.indexed}).map(function(e){var t=r[e.name];return t?n.isArray(t)?t.map(function(t){return h.encodeParameter(e.type,t)}):h.encodeParameter(e.type,t):null});i.topics=i.topics.concat(o)}i.topics.length||delete i.topics}return this.options.address&&(i.address=this.options.address.toLowerCase()),i},d.prototype._decodeEventABI=function(e){var t=this;e.data=e.data||"",e.topics=e.topics||[];var r=u.outputLogFormatter(e);"ALLEVENTS"===t.name&&(t=t.jsonInterface.find(function(t){return t.signature===e.topics[0]})||{anonymous:!0}),t.inputs=t.inputs||[];var n=t.anonymous?e.topics:e.topics.slice(1);return r.returnValues=h.decodeLog(t.inputs,e.data,n),delete r.returnValues.__length__,r.event=t.name,r.signature=t.anonymous||!e.topics[0]?null:e.topics[0],r.raw={data:r.data,topics:r.topics},delete r.data,delete r.topics,r},d.prototype._encodeMethodABI=function(){var e=this._method.signature,t=this.arguments||[],r=!1,i=this._parent.options.jsonInterface.filter(function(t){return"constructor"===e&&t.type===e||(t.signature===e||t.signature===e.replace("0x","")||t.name===e)&&"function"===t.type}).map(function(e){var i=n.isArray(e.inputs)?e.inputs.length:0;if(i!==t.length)throw new Error("The number of arguments is not matching the methods required number. You need to pass "+i+" arguments.");return"function"===e.type&&(r=e.signature),n.isArray(e.inputs)?e.inputs:[]}).map(function(e){return h.encodeParameters(e,t).replace("0x","")})[0]||"";if("constructor"===e){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+i}var o=r?r+i:i;if(o)return o;throw new Error("Couldn't find a matching contract method named \""+this._method.name+'".')},d.prototype._decodeMethodReturn=function(e,t){if(!t)return null;t=t.length>=2?t.slice(2):t;var r=h.decodeParameters(e,t);return 1===r.__length__?r[0]:(delete r.__length__,r)},d.prototype.deploy=function(e,t){if((e=e||{}).arguments=e.arguments||[],!(e=this._getOrSetDefaultOptions(e)).data)return a._fireError(new Error('No "data" specified in neither the given options, nor the default options.'),null,null,t);var r=n.find(this.options.jsonInterface,function(e){return"constructor"===e.type})||{};return r.signature="constructor",this._createTxObject.apply({method:r,parent:this,deployData:e.data,_ethAccounts:this.constructor._ethAccounts},e.arguments)},d.prototype._generateEventOptions=function(){var e=Array.prototype.slice.call(arguments),t=this._getCallback(e),r=n.isObject(e[e.length-1])?e.pop():{},i=n.isString(e[0])?e[0]:"allevents";if(!(i="allevents"===i.toLowerCase()?{name:"ALLEVENTS",jsonInterface:this.options.jsonInterface}:this.options.jsonInterface.find(function(e){return"event"===e.type&&(e.name===i||e.signature==="0x"+i.replace("0x",""))})))throw new Error('Event "'+i.name+"\" doesn't exist in this contract.");if(!a.isAddress(this.options.address))throw new Error("This contract object doesn't have address set yet, please set an address first.");return{params:this._encodeEventABI(i,r),event:i,callback:t}},d.prototype.clone=function(){return new this.constructor(this.options.jsonInterface,this.options.address,this.options)},d.prototype.once=function(e,t,r){var i=Array.prototype.slice.call(arguments);if(!(r=this._getCallback(i)))throw new Error("Once requires a callback as the second parameter.");t&&delete t.fromBlock,this._on(e,t,function(e,t,i){i.unsubscribe(),n.isFunction(r)&&r(e,t,i)})},d.prototype._on=function(){var e=this._generateEventOptions.apply(this,arguments);this._checkListener("newListener",e.event.name,e.callback),this._checkListener("removeListener",e.event.name,e.callback);var t=new s({subscription:{params:1,inputFormatter:[u.inputLogFormatter],outputFormatter:this._decodeEventABI.bind(e.event),subscriptionHandler:function(e){e.removed?this.emit("changed",e):this.emit("data",e),n.isFunction(this.callback)&&this.callback(null,e,this)}},type:"eth",requestManager:this._requestManager});return t.subscribe("logs",e.params,e.callback||function(){}),t},d.prototype.getPastEvents=function(){var e=this._generateEventOptions.apply(this,arguments),t=new o({name:"getPastLogs",call:"eth_getLogs",params:1,inputFormatter:[u.inputLogFormatter],outputFormatter:this._decodeEventABI.bind(e.event)});t.setRequestManager(this._requestManager);var r=t.buildCall();return t=null,r(e.params,e.callback)},d.prototype._createTxObject=function(){var e=Array.prototype.slice.call(arguments),t={};if("function"===this.method.type&&(t.call=this.parent._executeMethod.bind(t,"call"),t.call.request=this.parent._executeMethod.bind(t,"call",!0)),t.send=this.parent._executeMethod.bind(t,"send"),t.send.request=this.parent._executeMethod.bind(t,"send",!0),t.encodeABI=this.parent._encodeMethodABI.bind(t),t.estimateGas=this.parent._executeMethod.bind(t,"estimate"),e&&this.method.inputs&&e.length!==this.method.inputs.length){if(this.nextMethod)return this.nextMethod.apply(null,e);throw f.InvalidNumberOfParams(e.length,this.method.inputs.length,this.method.name)}return t.arguments=e||[],t._method=this.method,t._parent=this.parent,t._ethAccounts=this.parent.constructor._ethAccounts||this._ethAccounts,this.deployData&&(t._deployData=this.deployData),t},d.prototype._processExecuteArguments=function(e,t){var r={};if(r.type=e.shift(),r.callback=this._parent._getCallback(e),"call"===r.type&&!0!==e[e.length-1]&&(n.isString(e[e.length-1])||isFinite(e[e.length-1]))&&(r.defaultBlock=e.pop()),r.options=n.isObject(e[e.length-1])?e.pop():{},r.generateRequest=!0===e[e.length-1]&&e.pop(),r.options=this._parent._getOrSetDefaultOptions(r.options),r.options.data=this.encodeABI(),!this._deployData&&!a.isAddress(this._parent.options.address))throw new Error("This contract object doesn't have address set yet, please set an address first.");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."),t.eventEmitter,t.reject,r.callback)},d.prototype._executeMethod=function(){var e=this,t=this._parent._processExecuteArguments.call(this,Array.prototype.slice.call(arguments),r),r=c("send"!==t.type),i=e.constructor._ethAccounts||e._ethAccounts;if(t.generateRequest){var s={params:[u.inputCallFormatter.call(this._parent,t.options)],callback:t.callback};return"call"===t.type?(s.params.push(u.inputDefaultBlockNumberFormatter.call(this._parent,t.defaultBlock)),s.method="eth_call",s.format=this._parent._decodeMethodReturn.bind(null,this._method.outputs)):s.method="eth_sendTransaction",s}switch(t.type){case"estimate":return new o({name:"estimateGas",call:"eth_estimateGas",params:1,inputFormatter:[u.inputCallFormatter],outputFormatter:a.hexToNumber,requestManager:e._parent._requestManager,accounts:i,defaultAccount:e._parent.defaultAccount,defaultBlock:e._parent.defaultBlock}).createFunction()(t.options,t.callback);case"call":return new o({name:"call",call:"eth_call",params:2,inputFormatter:[u.inputCallFormatter,u.inputDefaultBlockNumberFormatter],outputFormatter:function(t){return e._parent._decodeMethodReturn(e._method.outputs,t)},requestManager:e._parent._requestManager,accounts:i,defaultAccount:e._parent.defaultAccount,defaultBlock:e._parent.defaultBlock}).createFunction()(t.options,t.defaultBlock,t.callback);case"send":if(!a.isAddress(t.options.from))return a._fireError(new Error('No "from" address specified in neither the given options, nor the default options.'),r.eventEmitter,r.reject,t.callback);if(n.isBoolean(this._method.payable)&&!this._method.payable&&t.options.value&&t.options.value>0)return a._fireError(new Error("Can not send value to non-payable contract method or constructor"),r.eventEmitter,r.reject,t.callback);var f={receiptFormatter:function(t){if(n.isArray(t.logs)){var r=n.map(t.logs,function(t){return e._parent._decodeEventABI.call({name:"ALLEVENTS",jsonInterface:e._parent.options.jsonInterface},t)});t.events={};var i=0;r.forEach(function(e){e.event?t.events[e.event]?Array.isArray(t.events[e.event])?t.events[e.event].push(e):t.events[e.event]=[t.events[e.event],e]:t.events[e.event]=e:(t.events[i]=e,i++)}),delete t.logs}return t},contractDeployFormatter:function(t){var r=e._parent.clone();return r.options.address=t.contractAddress,r}};return new o({name:"sendTransaction",call:"eth_sendTransaction",params:1,inputFormatter:[u.inputTransactionFormatter],requestManager:e._parent._requestManager,accounts:e.constructor._ethAccounts||e._ethAccounts,defaultAccount:e._parent.defaultAccount,defaultBlock:e._parent.defaultBlock,extraFormatters:f}).createFunction()(t.options,t.callback)}},e.exports=d},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var o=r(238),a=r(243),s=r(45),u=r(245),f=r(131),c=i(r(67)),h=new RegExp(/^bytes([0-9]*)$/),d=new RegExp(/^(u?int)([0-9]*)$/),l=new RegExp(/^(.*)\[([0-9]*)\]$/);t.defaultCoerceFunc=function(e,t){var r=e.match(d);return r&&parseInt(r[2])<=48?t.toNumber():t};var p=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),b=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function m(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}function g(e,t){function r(t){throw new Error('unexpected character "'+e[t]+'" at position '+t+' in "'+e+'"')}for(var n={type:"",name:"",state:{allowType:!0}},i=n,o=0;o1){var i=r[1].match(p);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");L(i[2]).forEach(function(e){t.outputs.push(g(e))})}return t}(e.trim()));throw new Error("unknown signature")};var y=function(){return function(e,t,r,n,i){this.coerceFunc=e,this.name=t,this.type=r,this.localName=n,this.dynamic=i}}(),w=function(e){function t(t){var r=e.call(this,t.coerceFunc,t.name,t.type,void 0,t.dynamic)||this;return f.defineReadOnly(r,"coder",t),r}return n(t,e),t.prototype.encode=function(e){return this.coder.encode(e)},t.prototype.decode=function(e,t){return this.coder.decode(e,t)},t}(y),_=function(e){function t(t,r){return e.call(this,t,"null","",r,!1)||this}return n(t,e),t.prototype.encode=function(e){return s.arrayify([])},t.prototype.decode=function(e,t){if(t>e.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},t}(y),S=function(e){function t(t,r,n,i){var o=this,a=(n?"int":"uint")+8*r;return(o=e.call(this,t,a,a,i,!1)||this).size=r,o.signed=n,o}return n(t,e),t.prototype.encode=function(e){try{var t=a.bigNumberify(e);return t=t.toTwos(8*this.size).maskn(8*this.size),this.signed&&(t=t.fromTwos(8*this.size).toTwos(256)),s.padZeros(s.arrayify(t),32)}catch(t){c.throwError("invalid number value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e})}return null},t.prototype.decode=function(e,t){e.length32)throw new Error;t.set(r)}catch(t){c.throwError("invalid "+this.name+" value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t.value||e})}return t},t.prototype.decode=function(e,t){return e.length=0?n:"")+"]",s=-1===n||r.dynamic;return(o=e.call(this,t,"array",a,i,s)||this).coder=r,o.length=n,o}return n(t,e),t.prototype.encode=function(e){Array.isArray(e)||c.throwError("expected array value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:e});var t=this.length,r=new Uint8Array(0);-1===t&&(t=e.length,r=M.encode(t)),c.checkArgumentCount(t,e.length,"in coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i256||i%8!=0)&&c.throwError("invalid "+r[1]+" bit length",c.INVALID_ARGUMENT,{arg:"param",value:t}),new S(e,i/8,"int"===r[1],t.name);if(r=t.type.match(h))return(0===(i=parseInt(r[1]))||i>32)&&c.throwError("invalid bytes length",c.INVALID_ARGUMENT,{arg:"param",value:t}),new x(e,i,t.name);if(r=t.type.match(l)){var i=parseInt(r[2]||"-1");return(t=f.jsonCopy(t)).type=r[1],new N(e,z(e,t),i,t.name)}return"tuple"===t.type.substring(0,5)?function(e,t,r){t||(t=[]);var n=[];return t.forEach(function(t){n.push(z(e,t))}),new C(e,n,r)}(e,t.components,t.name):""===t.type?new _(e,t.name):(c.throwError("invalid type",c.INVALID_ARGUMENT,{arg:"type",value:t.type}),null)}var D=function(){function e(r){c.checkNew(this,e),r||(r=t.defaultCoerceFunc),f.defineReadOnly(this,"coerceFunc",r)}return e.prototype.encode=function(e,t){e.length!==t.length&&c.throwError("types/values length mismatch",c.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});var r=[];return e.forEach(function(e){var t=null;t="string"==typeof e?g(e):e,r.push(z(this.coerceFunc,t))},this),s.hexlify(new C(this.coerceFunc,r,"_").encode(t))},e.prototype.decode=function(e,t){var r=[];return e.forEach(function(e){var t=null;t="string"==typeof e?g(e):f.jsonCopy(e),r.push(z(this.coerceFunc,t))},this),new C(this.coerceFunc,r,"_").decode(s.arrayify(t),0).value},e}();t.AbiCoder=D,t.defaultAbiCoder=new D},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(3)),o=r(45),a=r(240),s=r(242),u=r(67);function f(e){"string"==typeof e&&e.match(/^0x[0-9A-Fa-f]{40}$/)||u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e});for(var t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=t[n].charCodeAt(0);r=o.arrayify(a.keccak256(r));for(var i=0;i<40;i+=2)r[i>>1]>>4>=8&&(t[i]=t[i].toUpperCase()),(15&r[i>>1])>=8&&(t[i+1]=t[i+1].toUpperCase());return"0x"+t.join("")}for(var c={},h=0;h<10;h++)c[String(h)]=String(h);for(h=0;h<26;h++)c[String.fromCharCode(65+h)]=String(10+h);var d=Math.floor(function(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}(9007199254740991));function l(e){var t="";for((e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").forEach(function(e){t+=c[e]});t.length>=d;){var r=t.substring(0,d);t=parseInt(r,10)%97+t.substring(r.length)}for(var n=String(98-parseInt(t,10)%97);n.length<2;)n="0"+n;return n}function p(e){var t=null;if("string"!=typeof e&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e}),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=f(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:e});else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==l(e)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:e}),t=new i.default.BN(e.substring(4),36).toString(16);t.length<40;)t="0"+t;t=f("0x"+t)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e});return t}t.getAddress=p,t.getIcapAddress=function(e){for(var t=new i.default.BN(p(e).substring(2),16).toString(36).toUpperCase();t.length<30;)t="0"+t;return"XE"+l("XE00"+t)+t},t.getContractAddress=function(e){if(!e.from)throw new Error("missing from address");var t=e.nonce;return p("0x"+a.keccak256(s.encode([p(e.from),o.stripZeros(o.hexlify(t))])).substring(26))}},function(e,t){},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(241),i=r(45);t.keccak256=function(e){return"0x"+n.keccak_256(i.arrayify(e))}},function(e,t,r){(function(t,r){ /** * [js-sha3]{@link https://github.com/emn178/js-sha3} * * @version 0.5.7 * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2015-2016 * @license MIT */ !function(){"use strict";var n="object"==typeof window?window:{};!n.JS_SHA3_NO_NODE_JS&&"object"==typeof t&&t.versions&&t.versions.node&&(n=r);for(var i=!n.JS_SHA3_NO_COMMON_JS&&"object"==typeof e&&e.exports,o="0123456789abcdef".split(""),a=[0,8,16,24],s=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],u=[224,256,384,512],f=["hex","buffer","arrayBuffer","array"],c=function(e,t,r){return function(n){return new _(e,t,e).update(n)[r]()}},h=function(e,t,r){return function(n,i){return new _(e,t,i).update(n)[r]()}},d=function(e,t){var r=c(e,t,"hex");r.create=function(){return new _(e,t,e)},r.update=function(e){return r.create().update(e)};for(var n=0;n>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}_.prototype.update=function(e){var t="string"!=typeof e;t&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e));for(var r,n,i=e.length,o=this.blocks,s=this.byteCount,u=this.blockCount,f=0,c=this.s;f>2]|=e[f]<>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&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>4&15]+o[15&e]+o[e>>12&15]+o[e>>8&15]+o[e>>20&15]+o[e>>16&15]+o[e>>28&15]+o[e>>24&15];s%t==0&&(S(r),a=0)}return i&&(e=r[a],i>0&&(u+=o[e>>4&15]+o[15&e]),i>1&&(u+=o[e>>12&15]+o[e>>8&15]),i>2&&(u+=o[e>>20&15]+o[e>>16&15])),u},_.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(e);a>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;s%r==0&&S(n)}return o&&(e=s<<2,t=n[a],o>0&&(u[e]=255&t),o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u};var S=function(e){var t,r,n,i,o,a,u,f,c,h,d,l,p,b,m,g,v,y,w,_,S,M,A,x,E,k,I,P,B,T,O,R,N,C,L,j,z,D,U,F,q,H,K,V,G,Y,W,Z,X,J,$,Q,ee,te,re,ne,ie,oe,ae,se,ue,fe,ce;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],u=e[3]^e[13]^e[23]^e[33]^e[43],f=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],d=e[7]^e[17]^e[27]^e[37]^e[47],t=(l=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|u>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(u<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(f<<1|c>>>31),r=o^(c<<1|f>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(h<<1|d>>>31),r=u^(d<<1|h>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=f^(l<<1|p>>>31),r=c^(p<<1|l>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=h^(i<<1|o>>>31),r=d^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,b=e[0],m=e[1],Y=e[11]<<4|e[10]>>>28,W=e[10]<<4|e[11]>>>28,P=e[20]<<3|e[21]>>>29,B=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,H=e[40]<<18|e[41]>>>14,K=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,L=e[3]<<1|e[2]>>>31,g=e[13]<<12|e[12]>>>20,v=e[12]<<12|e[13]>>>20,Z=e[22]<<10|e[23]>>>22,X=e[23]<<10|e[22]>>>22,T=e[33]<<13|e[32]>>>19,O=e[32]<<13|e[33]>>>19,fe=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,j=e[14]<<6|e[15]>>>26,z=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,J=e[34]<<15|e[35]>>>17,$=e[35]<<15|e[34]>>>17,R=e[45]<<29|e[44]>>>3,N=e[44]<<29|e[45]>>>3,x=e[6]<<28|e[7]>>>4,E=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,D=e[26]<<25|e[27]>>>7,U=e[27]<<25|e[26]>>>7,_=e[36]<<21|e[37]>>>11,S=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,V=e[8]<<27|e[9]>>>5,G=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,I=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,F=e[38]<<8|e[39]>>>24,q=e[39]<<8|e[38]>>>24,M=e[48]<<14|e[49]>>>18,A=e[49]<<14|e[48]>>>18,e[0]=b^~g&y,e[1]=m^~v&w,e[10]=x^~k&P,e[11]=E^~I&B,e[20]=C^~j&D,e[21]=L^~z&U,e[30]=V^~Y&Z,e[31]=G^~W&X,e[40]=te^~ne&oe,e[41]=re^~ie&ae,e[2]=g^~y&_,e[3]=v^~w&S,e[12]=k^~P&T,e[13]=I^~B&O,e[22]=j^~D&F,e[23]=z^~U&q,e[32]=Y^~Z&J,e[33]=W^~X&$,e[42]=ne^~oe&se,e[43]=ie^~ae&ue,e[4]=y^~_&M,e[5]=w^~S&A,e[14]=P^~T&R,e[15]=B^~O&N,e[24]=D^~F&H,e[25]=U^~q&K,e[34]=Z^~J&Q,e[35]=X^~$&ee,e[44]=oe^~se&fe,e[45]=ae^~ue&ce,e[6]=_^~M&b,e[7]=S^~A&m,e[16]=T^~R&x,e[17]=O^~N&E,e[26]=F^~H&C,e[27]=q^~K&L,e[36]=J^~Q&V,e[37]=$^~ee&G,e[46]=se^~fe&te,e[47]=ue^~ce&re,e[8]=M^~b&g,e[9]=A^~m&v,e[18]=R^~x&k,e[19]=N^~E&I,e[28]=H^~C&j,e[29]=K^~L&z,e[38]=Q^~V&Y,e[39]=ee^~G&W,e[48]=fe^~te&ne,e[49]=ce^~re&ie,e[0]^=s[n],e[1]^=s[n+1]};if(i)e.exports=p;else for(m=0;m>=8;return t}function o(e,t,r){for(var n=0,i=0;it+1+n)throw new Error("invalid rlp")}return{consumed:1+n,result:i}}function s(e,t){if(0===e.length)throw new Error("invalid rlp data");if(e[t]>=248){if(t+1+(r=e[t]-247)>e.length)throw new Error("too short");if(t+1+r+(i=o(e,t+1,r))>e.length)throw new Error("to short");return a(e,t,t+1+r,r+i)}if(e[t]>=192){if(t+1+(i=e[t]-192)>e.length)throw new Error("invalid rlp data");return a(e,t,t+1,i)}if(e[t]>=184){var r;if(t+1+(r=e[t]-183)>e.length)throw new Error("invalid rlp data");if(t+1+r+(i=o(e,t+1,r))>e.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(e.slice(t+1+r,t+1+r+i))}}if(e[t]>=128){var i;if(t+1+(i=e[t]-128)>e.length)throw new Error("invlaid rlp data");return{consumed:1+i,result:n.hexlify(e.slice(t+1,t+1+i))}}return{consumed:1,result:n.hexlify(e[t])}}t.encode=function(e){return n.hexlify(function e(t){if(Array.isArray(t)){var r=[];return t.forEach(function(t){r=r.concat(e(t))}),r.length<=55?(r.unshift(192+r.length),r):((o=i(r.length)).unshift(247+o.length),o.concat(r))}var o,a=Array.prototype.slice.call(n.arrayify(t));return 1===a.length&&a[0]<=127?a:a.length<=55?(a.unshift(128+a.length),a):((o=i(a.length)).unshift(183+o.length),o.concat(a))}(e))},t.decode=function(e){var t=n.arrayify(e),r=s(t,0);if(r.consumed!==t.length)throw new Error("invalid rlp data");return r.result}},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var a=i(r(3)),s=r(45),u=r(131),f=r(244),c=o(r(67)),h=new a.default.BN(-1);function d(e){var t=e.toString(16);return"-"===t[0]?t.length%2==0?"-0x0"+t.substring(1):"-0x"+t.substring(1):t.length%2==1?"0x0"+t:"0x"+t}function l(e){return m(e)._bn}function p(e){return new b(d(e))}var b=function(e){function t(r){var n=e.call(this)||this;if(c.checkNew(n,t),"string"==typeof r)s.isHexString(r)?("0x"==r&&(r="0x0"),u.defineReadOnly(n,"_hex",r)):"-"===r[0]&&s.isHexString(r.substring(1))?u.defineReadOnly(n,"_hex",r):r.match(/^-?[0-9]*$/)?(""==r&&(r="0"),u.defineReadOnly(n,"_hex",d(new a.default.BN(r)))):c.throwError("invalid BigNumber string value",c.INVALID_ARGUMENT,{arg:"value",value:r});else if("number"==typeof r){parseInt(String(r))!==r&&c.throwError("underflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:r,outputValue:parseInt(String(r))});try{u.defineReadOnly(n,"_hex",d(new a.default.BN(r)))}catch(e){c.throwError("overflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:e.message})}}else r instanceof t?u.defineReadOnly(n,"_hex",r._hex):r.toHexString?u.defineReadOnly(n,"_hex",d(l(r.toHexString()))):s.isArrayish(r)?u.defineReadOnly(n,"_hex",d(new a.default.BN(s.hexlify(r).substring(2),16))):c.throwError("invalid BigNumber value",c.INVALID_ARGUMENT,{arg:"value",value:r});return n}return n(t,e),Object.defineProperty(t.prototype,"_bn",{get:function(){return"-"===this._hex[0]?new a.default.BN(this._hex.substring(3),16).mul(h):new a.default.BN(this._hex.substring(2),16)},enumerable:!0,configurable:!0}),t.prototype.fromTwos=function(e){return p(this._bn.fromTwos(e))},t.prototype.toTwos=function(e){return p(this._bn.toTwos(e))},t.prototype.add=function(e){return p(this._bn.add(l(e)))},t.prototype.sub=function(e){return p(this._bn.sub(l(e)))},t.prototype.div=function(e){return m(e).isZero()&&c.throwError("division by zero",c.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),p(this._bn.div(l(e)))},t.prototype.mul=function(e){return p(this._bn.mul(l(e)))},t.prototype.mod=function(e){return p(this._bn.mod(l(e)))},t.prototype.pow=function(e){return p(this._bn.pow(l(e)))},t.prototype.maskn=function(e){return p(this._bn.maskn(e))},t.prototype.eq=function(e){return this._bn.eq(l(e))},t.prototype.lt=function(e){return this._bn.lt(l(e))},t.prototype.lte=function(e){return this._bn.lte(l(e))},t.prototype.gt=function(e){return this._bn.gt(l(e))},t.prototype.gte=function(e){return this._bn.gte(l(e))},t.prototype.isZero=function(){return this._bn.isZero()},t.prototype.toNumber=function(){try{return this._bn.toNumber()}catch(e){c.throwError("overflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:e.message})}return null},t.prototype.toString=function(){return this._bn.toString(10)},t.prototype.toHexString=function(){return this._hex},t}(f.BigNumber);function m(e){return e instanceof b?e:new b(e)}t.bigNumberify=m,t.ConstantNegativeOne=m(-1),t.ConstantZero=m(0),t.ConstantOne=m(1),t.ConstantTwo=m(2),t.ConstantWeiPerEther=m("1000000000000000000")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){return function(){}}();t.BigNumber=n;var i=function(){return function(){}}();t.Indexed=i;var o=function(){return function(){}}();t.MinimalProvider=o;var a=function(){return function(){}}();t.Signer=a;var s=function(){return function(){}}();t.HDNode=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(45);!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(n=t.UnicodeNormalizationForm||(t.UnicodeNormalizationForm={})),t.toUtf8Bytes=function(e,t){void 0===t&&(t=n.current),t!=n.current&&(e=e.normalize(t));for(var r=[],o=0,a=0;a>6|192,r[o++]=63&s|128):55296==(64512&s)&&a+1>18|240,r[o++]=s>>12&63|128,r[o++]=s>>6&63|128,r[o++]=63&s|128):(r[o++]=s>>12|224,r[o++]=s>>6&63|128,r[o++]=63&s|128)}return i.arrayify(r)},t.toUtf8String=function(e){e=i.arrayify(e);for(var t="",r=0;r>7!=0){if(n>>6!=2){var o=null;if(n>>5==6)o=1;else if(n>>4==14)o=2;else if(n>>3==30)o=3;else if(n>>2==62)o=4;else{if(n>>1!=126)continue;o=5}if(r+o>e.length){for(;r>6==2;r++);if(r!=e.length)continue;return t}var a,s=n&(1<<8-o-1)-1;for(a=0;a>6!=2)break;s=s<<6|63&u}a==o?s<=65535?t+=String.fromCharCode(s):(s-=65536,t+=String.fromCharCode(55296+(s>>10&1023),56320+(1023&s))):r--}}else t+=String.fromCharCode(n)}return t}},function(e,t,r){"use strict";(function(t,n){var i=r(247),o=r(35),a=r(37),s=r(127),u=r(248),f=r(162),c=r(161),h=r(160),d=r(88),l=r(38),p=r(324),b=r(325),m=r(20),g=r(14),v=function(e){return i.isUndefined(e)||i.isNull(e)},y=function(e){for(;e&&e.startsWith("0x0");)e="0x"+e.slice(3);return e},w=function(e){return e.length%2==1&&(e=e.replace("0x","0x0")),e},_=function(){var e=this;o.packageInit(this,arguments),delete this.BatchRequest,delete this.extend;var t=[new a({name:"getId",call:"net_version",params:0,outputFormatter:m.hexToNumber}),new a({name:"getGasPrice",call:"eth_gasPrice",params:0}),new a({name:"getTransactionCount",call:"eth_getTransactionCount",params:2,inputFormatter:[function(e){if(m.isAddress(e))return e;throw new Error("Address "+e+' is not a valid address to get the "transactionCount".')},function(){return"latest"}]})];this._ethereumCall={},i.each(t,function(t){t.attachToObject(e._ethereumCall),t.setRequestManager(e._requestManager)}),this.wallet=new S(this)};function S(e){this._accounts=e,this.length=0,this.defaultKeyName="web3js_wallet"}_.prototype._addAccountFunctions=function(e){var t=this;return e.signTransaction=function(r,n){return t.signTransaction(r,e.privateKey,n)},e.sign=function(r){return t.sign(r,e.privateKey)},e.encrypt=function(r,n){return t.encrypt(e.privateKey,r,n)},e},_.prototype.create=function(e){return this._addAccountFunctions(u.create(e||m.randomHex(32)))},_.prototype.privateKeyToAccount=function(e){return this._addAccountFunctions(u.fromPrivate(e))},_.prototype.signTransaction=function(e,t,r){var n,o=!1;if(r=r||function(){},!e)return o=new Error("No transaction object given!"),r(o),s.reject(o);function a(e){if(e.gas||e.gasLimit||(o=new Error('"gas" is missing')),(e.nonce<0||e.gas<0||e.gasPrice<0||e.chainId<0)&&(o=new Error("Gas, gasPrice, nonce or chainId is lower than 0")),o)return r(o),s.reject(new Error('"gas" is missing'));try{var i=e=g.formatters.inputCallFormatter(e);i.to=e.to||"0x",i.data=e.data||"0x",i.value=e.value||"0x",i.chainId=m.numberToHex(e.chainId);var a=c.encode([d.fromNat(i.nonce),d.fromNat(i.gasPrice),d.fromNat(i.gas),i.to.toLowerCase(),d.fromNat(i.value),i.data,d.fromNat(i.chainId||"0x1"),"0x","0x"]),l=f.keccak256(a),p=u.makeSigner(2*h.toNumber(i.chainId||"0x1")+35)(f.keccak256(a),t),b=c.decode(a).slice(0,6).concat(u.decodeSignature(p));b[6]=w(y(b[6])),b[7]=w(y(b[7])),b[8]=w(y(b[8]));var v=c.encode(b),_=c.decode(v);n={messageHash:l,v:y(_[6]),r:y(_[7]),s:y(_[8]),rawTransaction:v}}catch(e){return r(e),s.reject(e)}return r(null,n),n}return void 0!==e.nonce&&void 0!==e.chainId&&void 0!==e.gasPrice?s.resolve(a(e)):s.all([v(e.chainId)?this._ethereumCall.getId():e.chainId,v(e.gasPrice)?this._ethereumCall.getGasPrice():e.gasPrice,v(e.nonce)?this._ethereumCall.getTransactionCount(this.privateKeyToAccount(t).address):e.nonce]).then(function(t){if(v(t[0])||v(t[1])||v(t[2]))throw new Error('One of the values "chainId", "gasPrice", or "nonce" couldn\'t be fetched: '+JSON.stringify(t));return a(i.extend(e,{chainId:t[0],gasPrice:t[1],nonce:t[2]}))})},_.prototype.recoverTransaction=function(e){var t=c.decode(e),r=u.encodeSignature(t.slice(6,9)),n=d.toNumber(t[6]),i=n<35?[]:[d.fromNumber(n-35>>1),"0x","0x"],o=t.slice(0,6).concat(i),a=c.encode(o);return u.recover(f.keccak256(a),r)},_.prototype.hashMessage=function(e){var t=m.isHexStrict(e)?m.hexToBytes(e):e,r=n.from(t),i="Ethereum Signed Message:\n"+t.length,o=n.from(i),a=n.concat([o,r]);return f.keccak256s(a)},_.prototype.sign=function(e,t){var r=this.hashMessage(e),n=u.sign(r,t),i=u.decodeSignature(n);return{message:e,messageHash:r,v:i[0],r:i[1],s:i[2],signature:n}},_.prototype.recover=function(e,t,r){var n=[].slice.apply(arguments);return i.isObject(e)?this.recover(e.messageHash,u.encodeSignature([e.v,e.r,e.s]),!0):(r||(e=this.hashMessage(e)),n.length>=4?(r=n.slice(-1)[0],r=!!i.isBoolean(r)&&!!r,this.recover(e,u.encodeSignature(n.slice(1,4)),r)):u.recover(e,t))},_.prototype.decrypt=function(e,t,r){if(!i.isString(t))throw new Error("No password given.");var o,a,s=i.isObject(e)?e:JSON.parse(r?e.toLowerCase():e);if(3!==s.version)throw new Error("Not a valid V3 wallet");if("scrypt"===s.crypto.kdf)a=s.crypto.kdfparams,o=p(new n(t),new n(a.salt,"hex"),a.n,a.r,a.p,a.dklen);else{if("pbkdf2"!==s.crypto.kdf)throw new Error("Unsupported key derivation scheme");if("hmac-sha256"!==(a=s.crypto.kdfparams).prf)throw new Error("Unsupported parameters to PBKDF2");o=l.pbkdf2Sync(new n(t),new n(a.salt,"hex"),a.c,a.dklen,"sha256")}var u=new n(s.crypto.ciphertext,"hex");if(m.sha3(n.concat([o.slice(16,32),u])).replace("0x","")!==s.crypto.mac)throw new Error("Key derivation failed - possibly wrong password");var f=l.createDecipheriv(s.crypto.cipher,o.slice(0,16),new n(s.crypto.cipherparams.iv,"hex")),c="0x"+n.concat([f.update(u),f.final()]).toString("hex");return this.privateKeyToAccount(c)},_.prototype.encrypt=function(e,t,r){var i,o=this.privateKeyToAccount(e),a=(r=r||{}).salt||l.randomBytes(32),s=r.iv||l.randomBytes(16),u=r.kdf||"scrypt",f={dklen:r.dklen||32,salt:a.toString("hex")};if("pbkdf2"===u)f.c=r.c||262144,f.prf="hmac-sha256",i=l.pbkdf2Sync(new n(t),a,f.c,f.dklen,"sha256");else{if("scrypt"!==u)throw new Error("Unsupported kdf");f.n=r.n||8192,f.r=r.r||8,f.p=r.p||1,i=p(new n(t),a,f.n,f.r,f.p,f.dklen)}var c=l.createCipheriv(r.cipher||"aes-128-ctr",i.slice(0,16),s);if(!c)throw new Error("Unsupported cipher");var h=n.concat([c.update(new n(o.privateKey.replace("0x",""),"hex")),c.final()]),d=m.sha3(n.concat([i.slice(16,32),new n(h,"hex")])).replace("0x","");return{version:3,id:b.v4({random:r.uuid||l.randomBytes(16)}),address:o.address.toLowerCase().replace("0x",""),crypto:{ciphertext:h.toString("hex"),cipherparams:{iv:s.toString("hex")},cipher:r.cipher||"aes-128-ctr",kdf:u,kdfparams:f,mac:d.toString("hex")}}},S.prototype._findSafeIndex=function(e){return e=e||0,i.has(this,e)?this._findSafeIndex(e+1):e},S.prototype._currentIndexes=function(){return Object.keys(this).map(function(e){return parseInt(e)}).filter(function(e){return e<9e20})},S.prototype.create=function(e,t){for(var r=0;r=0&&t<=M};function E(e){return function(t,r,n,i){r=v(r,i,4);var o=!x(t)&&g.keys(t),a=(o||t).length,s=e>0?0:a-1;return arguments.length<3&&(n=t[o?o[s]:s],s+=e),function(t,r,n,i,o,a){for(;o>=0&&o=0},g.invoke=function(e,t){var r=f.call(arguments,2),n=g.isFunction(t);return g.map(e,function(e){var i=n?t:e[t];return null==i?i:i.apply(e,r)})},g.pluck=function(e,t){return g.map(e,g.property(t))},g.where=function(e,t){return g.filter(e,g.matcher(t))},g.findWhere=function(e,t){return g.find(e,g.matcher(t))},g.max=function(e,t,r){var n,i,o=-1/0,a=-1/0;if(null==t&&null!=e)for(var s=0,u=(e=x(e)?e:g.values(e)).length;so&&(o=n);else t=y(t,r),g.each(e,function(e,r,n){((i=t(e,r,n))>a||i===-1/0&&o===-1/0)&&(o=e,a=i)});return o},g.min=function(e,t,r){var n,i,o=1/0,a=1/0;if(null==t&&null!=e)for(var s=0,u=(e=x(e)?e:g.values(e)).length;sn||void 0===r)return 1;if(r0?0:i-1;o>=0&&o0?a=o>=0?o:Math.max(o+s,a):s=o>=0?Math.min(o+1,s):o+s+1;else if(r&&o&&s)return n[o=r(n,i)]===i?o:-1;if(i!=i)return(o=t(f.call(n,a,s),g.isNaN))>=0?o+a:-1;for(o=e>0?a:s-1;o>=0&&ot?(a&&(clearTimeout(a),a=null),s=f,o=e.apply(n,i),a||(n=i=null)):a||!1===r.trailing||(a=setTimeout(u,c)),o}},g.debounce=function(e,t,r){var n,i,o,a,s,u=function(){var f=g.now()-a;f=0?n=setTimeout(u,t-f):(n=null,r||(s=e.apply(o,i),n||(o=i=null)))};return function(){o=this,i=arguments,a=g.now();var f=r&&!n;return n||(n=setTimeout(u,t)),f&&(s=e.apply(o,i),o=i=null),s}},g.wrap=function(e,t){return g.partial(t,e)},g.negate=function(e){return function(){return!e.apply(this,arguments)}},g.compose=function(){var e=arguments,t=e.length-1;return function(){for(var r=t,n=e[t].apply(this,arguments);r--;)n=e[r].call(this,n);return n}},g.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},g.before=function(e,t){var r;return function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=null),r}},g.once=g.partial(g.before,2);var O=!{toString:null}.propertyIsEnumerable("toString"),R=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];function N(e,t){var r=R.length,n=e.constructor,i=g.isFunction(n)&&n.prototype||a,o="constructor";for(g.has(e,o)&&!g.contains(t,o)&&t.push(o);r--;)(o=R[r])in e&&e[o]!==i[o]&&!g.contains(t,o)&&t.push(o)}g.keys=function(e){if(!g.isObject(e))return[];if(l)return l(e);var t=[];for(var r in e)g.has(e,r)&&t.push(r);return O&&N(e,t),t},g.allKeys=function(e){if(!g.isObject(e))return[];var t=[];for(var r in e)t.push(r);return O&&N(e,t),t},g.values=function(e){for(var t=g.keys(e),r=t.length,n=Array(r),i=0;i":">",'"':""","'":"'","`":"`"},j=g.invert(L),z=function(e){var t=function(t){return e[t]},r="(?:"+g.keys(e).join("|")+")",n=RegExp(r),i=RegExp(r,"g");return function(e){return e=null==e?"":""+e,n.test(e)?e.replace(i,t):e}};g.escape=z(L),g.unescape=z(j),g.result=function(e,t,r){var n=null==e?void 0:e[t];return void 0===n&&(n=r),g.isFunction(n)?n.call(e):n};var D=0;g.uniqueId=function(e){var t=++D+"";return e?e+t:t},g.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var U=/(.)^/,F={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},q=/\\|'|\r|\n|\u2028|\u2029/g,H=function(e){return"\\"+F[e]};g.template=function(e,t,r){!t&&r&&(t=r),t=g.defaults({},t,g.templateSettings);var n=RegExp([(t.escape||U).source,(t.interpolate||U).source,(t.evaluate||U).source].join("|")+"|$","g"),i=0,o="__p+='";e.replace(n,function(t,r,n,a,s){return o+=e.slice(i,s).replace(q,H),i=s+t.length,r?o+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":n?o+="'+\n((__t=("+n+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),t}),o+="';\n",t.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{var a=new Function(t.variable||"obj","_",o)}catch(e){throw e.source=o,e}var s=function(e){return a.call(this,e,g)},u=t.variable||"obj";return s.source="function("+u+"){\n"+o+"}",s},g.chain=function(e){var t=g(e);return t._chain=!0,t};var K=function(e,t){return e._chain?g(t).chain():t};g.mixin=function(e){g.each(g.functions(e),function(t){var r=g[t]=e[t];g.prototype[t]=function(){var e=[this._wrapped];return u.apply(e,arguments),K(this,r.apply(g,e))}})},g.mixin(g),g.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=o[e];g.prototype[e]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!==e&&"splice"!==e||0!==r.length||delete r[0],K(this,r)}}),g.each(["concat","join","slice"],function(e){var t=o[e];g.prototype[e]=function(){return K(this,t.apply(this._wrapped,arguments))}}),g.prototype.value=function(){return this._wrapped},g.prototype.valueOf=g.prototype.toJSON=g.prototype.value,g.prototype.toString=function(){return""+this._wrapped},void 0===(n=function(){return g}.apply(t,[]))||(e.exports=n)}).call(this)},function(e,t,r){(function(t){var n=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=r(88),o=r(160),a=r(11),s=(r(161),new a.ec("secp256k1")),u=r(162),f=u.keccak256,c=u.keccak256s,h=function(e){for(var t=c(e.slice(2)),r="0x",n=0;n<40;n++)r+=parseInt(t[n+2],16)>7?e[n+2].toUpperCase():e[n+2];return r},d=function(e){var r=new t(e.slice(2),"hex"),n="0x"+s.keyFromPrivate(r).getPublic(!1,"hex").slice(2),i=f(n);return{address:h("0x"+i.slice(-40)),privateKey:e}},l=function(e){var t=n(e,3),r=t[0],o=i.pad(32,t[1]),a=i.pad(32,t[2]);return i.flatten([o,a,r])},p=function(e){return[i.slice(64,i.length(e),e),i.slice(0,32,e),i.slice(32,64,e)]},b=function(e){return function(r,n){var a=s.keyFromPrivate(new t(n.slice(2),"hex")).sign(new t(r.slice(2),"hex"),{canonical:!0});return l([o.fromString(i.fromNumber(e+a.recoveryParam)),i.pad(32,i.fromNat("0x"+a.r.toString(16))),i.pad(32,i.fromNat("0x"+a.s.toString(16)))])}},m=b(27);e.exports={create:function(e){var t=f(i.concat(i.random(32),e||i.random(32))),r=i.concat(i.concat(i.random(32),t),i.random(32)),n=f(r);return d(n)},toChecksum:h,fromPrivate:d,sign:m,makeSigner:b,recover:function(e,r){var n=p(r),o={v:i.toNumber(n[0]),r:n[1].slice(2),s:n[2].slice(2)},a="0x"+s.recoverPubKey(new t(e.slice(2),"hex"),o,o.v<2?o.v:1-o.v%2).encode("hex",!1).slice(2),u=f(a);return h("0x"+u.slice(-40))},encodeSignature:l,decodeSignature:p}}).call(this,r(0).Buffer)},function(e,t){var r=function(e,t){for(var r=[],n=0;n>>27}function c(e){return e<<30|e>>>2}function h(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,s=0|this._e,u=0;u<16;++u)t[u]=e.readInt32BE(4*u);for(;u<80;++u)t[u]=t[u-3]^t[u-8]^t[u-14]^t[u-16];for(var d=0;d<80;++d){var l=~~(d/20),p=f(r)+h(l,n,i,o)+s+t[d]+a[l]|0;s=o,o=i,i=c(n),n=r,r=p}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0},u.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},function(e,t,r){var n=r(1),i=r(47),o=r(2).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function f(e){return e<<1|e>>>31}function c(e){return e<<5|e>>>27}function h(e){return e<<30|e>>>2}function d(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,s=0|this._e,u=0;u<16;++u)t[u]=e.readInt32BE(4*u);for(;u<80;++u)t[u]=f(t[u-3]^t[u-8]^t[u-14]^t[u-16]);for(var l=0;l<80;++l){var p=~~(l/20),b=c(r)+d(p,n,i,o)+s+t[l]+a[p]|0;s=o,o=i,i=h(n),n=r,r=b}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0},u.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},function(e,t,r){var n=r(1),i=r(133),o=r(47),a=r(2).Buffer,s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}n(u,i),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=u},function(e,t,r){var n=r(1),i=r(134),o=r(47),a=r(2).Buffer,s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}n(u,i),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=u},function(e,t,r){"use strict";var n=r(1),i=r(2).Buffer,o=r(30),a=i.alloc(128),s=64;function u(e,t){o.call(this,"digest"),"string"==typeof t&&(t=i.from(t)),this._alg=e,this._key=t,t.length>s?t=e(t):t.length>>0},t.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},t.ip=function(e,t,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|=t>>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=e>>>s+a&1}for(a=6;a>=0;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1}r[n+0]=i>>>0,r[n+1]=o>>>0},t.rip=function(e,t,r,n){for(var i=0,o=0,a=0;a<4;a++)for(var s=24;s>=0;s-=8)i<<=1,i|=t>>>s+a&1,i<<=1,i|=e>>>s+a&1;for(a=4;a<8;a++)for(s=24;s>=0;s-=8)o<<=1,o|=t>>>s+a&1,o<<=1,o|=e>>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},t.pc1=function(e,t,r,n){for(var i=0,o=0,a=7;a>=5;a--){for(var 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(s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},t.r28shl=function(e,t){return e<>>28-t};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];t.pc2=function(e,t,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},t.expand=function(e,t,r){var n=0,i=0;n=(1&e)<<5|e>>>27;for(var o=23;o>=15;o-=4)n<<=6,n|=e>>>o&63;for(o=11;o>=3;o-=4)i|=e>>>o&63,i<<=6;i|=(31&e)<<1|e>>>31,t[r+0]=n>>>0,t[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];t.substitute=function(e,t){for(var r=0,n=0;n<4;n++){r<<=4,r|=i[64*n+(e>>>18-6*n&63)]}for(n=0;n<4;n++){r<<=4,r|=i[256+64*n+(t>>>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];t.permute=function(e){for(var t=0,r=0;r>>o[r]&1;return t>>>0},t.padSplit=function(e,t,r){for(var n=e.toString(2);n.length0;n--)t+=this._buffer(e,t),r+=this._flushBuffer(i,r);return t+=this._buffer(e,t),i},i.prototype.final=function(e){var t,r;return e&&(t=this.update(e)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(r):r},i.prototype._pad=function(e,t){if(0===t)return!1;for(;t>>1];r=a.r28shl(r,s),i=a.r28shl(i,s),a.pc2(r,i,e.keys,o)}},u.prototype._update=function(e,t,r,n){var i=this._desState,o=a.readUInt32BE(e,t),s=a.readUInt32BE(e,t+4);a.ip(o,s,i.tmp,0),o=i.tmp[0],s=i.tmp[1],"encrypt"===this.type?this._encrypt(i,o,s,i.tmp,0):this._decrypt(i,o,s,i.tmp,0),o=i.tmp[0],s=i.tmp[1],a.writeUInt32BE(r,o,n),a.writeUInt32BE(r,s,n+4)},u.prototype._pad=function(e,t){for(var r=e.length-t,n=t;n>>0,o=d}a.rip(s,o,n,i)},u.prototype._decrypt=function(e,t,r,n,i){for(var o=r,s=t,u=e.keys.length-2;u>=0;u-=2){var f=e.keys[u],c=e.keys[u+1];a.expand(o,e.tmp,0),f^=e.tmp[0],c^=e.tmp[1];var h=a.substitute(f,c),d=o;o=(s^a.permute(h))>>>0,s=d}a.rip(o,s,n,i)}},function(e,t,r){"use strict";var n=r(16),i=r(1),o={};t.instantiate=function(e){function t(t){e.call(this,t),this._cbcInit()}i(t,e);for(var r=Object.keys(o),n=0;n15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},d.prototype.flush=function(){for(var e=16-this.cache.length,t=o.allocUnsafe(e),r=-1;++r>s%8,e._prev=o(e._prev,r?i:a);return u}function o(e,t){var r=e.length,i=-1,o=n.allocUnsafe(e.length);for(e=n.concat([e,n.from([t])]);++i>7;return o}t.encrypt=function(e,t,r){for(var o=t.length,a=n.allocUnsafe(o),s=-1;++s>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t0;e--)r[e]=r[e]>>>1|(1&r[e-1])<<31;r[0]=r[0]>>>1,t&&(r[0]=r[0]^225<<24)}this.state=o(n)},a.prototype.update=function(e){var t;for(this.cache=n.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(o([0,e,0,t])),this.state},e.exports=a},function(e,t,r){var n=r(144),i=r(2).Buffer,o=r(95),a=r(145),s=r(30),u=r(68),f=r(69);function c(e,t,r){s.call(this),this._cache=new h,this._last=void 0,this._cipher=new u.AES(t),this._prev=i.from(r),this._mode=e,this._autopadding=!0}function h(){this.cache=i.allocUnsafe(0)}function d(e,t,r){var s=o[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=i.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof t&&(t=i.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===s.type?new a(s.module,t,r,!0):"auth"===s.type?new n(s.module,t,r,!0):new c(s.module,t,r)}r(1)(c,s),c.prototype._update=function(e){var t,r;this._cache.add(e);for(var n=[];t=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,t),n.push(r);return i.concat(n)},c.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");var r=-1;for(;++r16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},h.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=function(e,t){var r=o[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=f(t,!1,r.key,r.iv);return d(e,n.key,n.iv)},t.createDecipheriv=d},function(e,t){t["des-ecb"]={key:8,iv:0},t["des-cbc"]=t.des={key:8,iv:8},t["des-ede3-cbc"]=t.des3={key:24,iv:8},t["des-ede3"]={key:24,iv:0},t["des-ede-cbc"]={key:16,iv:8},t["des-ede"]={key:16,iv:0}},function(e,t,r){(function(e){var n=r(146),i=r(280),o=r(281);var a={binary:!0,hex:!0,base64:!0};t.DiffieHellmanGroup=t.createDiffieHellmanGroup=t.getDiffieHellman=function(t){var r=new e(i[t].prime,"hex"),n=new e(i[t].gen,"hex");return new o(r,n)},t.createDiffieHellman=t.DiffieHellman=function t(r,i,s,u){return e.isBuffer(i)||void 0===a[i]?t(r,"binary",i,s):(i=i||"binary",u=u||"binary",s=s||new e([2]),e.isBuffer(s)||(s=new e(s,u)),"number"==typeof r?new o(n(r,s),s,!0):(e.isBuffer(r)||(r=new e(r,i)),new o(r,s,!0)))}}).call(this,r(0).Buffer)},function(e,t){},function(e){e.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},function(e,t,r){(function(t){var n=r(3),i=new(r(147)),o=new n(24),a=new n(11),s=new n(10),u=new n(3),f=new n(7),c=r(146),h=r(46);function d(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this._pub=new n(e),this}function l(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this._priv=new n(e),this}e.exports=b;var p={};function b(e,t,r){this.setGenerator(t),this.__prime=new n(e),this._prime=n.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=d,this.setPrivateKey=l):this._primeCode=8}function m(e,r){var n=new t(e.toArray());return r?n.toString(r):n}Object.defineProperty(b.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,t){var r=t.toString("hex"),n=[r,e.toString(16)].join("_");if(n in p)return p[n];var h,d=0;if(e.isEven()||!c.simpleSieve||!c.fermatTest(e)||!i.test(e))return d+=1,d+="02"===r||"05"===r?8:4,p[n]=d,d;switch(i.test(e.shrn(1))||(d+=2),r){case"02":e.mod(o).cmp(a)&&(d+=8);break;case"05":(h=e.mod(s)).cmp(u)&&h.cmp(f)&&(d+=8);break;default:d+=4}return p[n]=d,d}(this.__prime,this.__gen)),this._primeCode}}),b.prototype.generateKeys=function(){return this._priv||(this._priv=new n(h(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},b.prototype.computeSecret=function(e){var r=(e=(e=new n(e)).toRed(this._prime)).redPow(this._priv).fromRed(),i=new t(r.toArray()),o=this.getPrime();if(i.length0&&r.ishrn(n),r}function h(e,r,i){var o,a;do{for(o=new t(0);8*o.length=0;){var o;if(i.isOdd()){var a=i.andln(n-1);o=a>(n>>1)-1?(n>>1)-a:a,i.isubn(o)}else o=0;r.push(o);for(var s=0!==i.cmpn(0)&&0===i.andln(n-1)?t+1:1,u=1;u0||t.cmpn(-i)>0;){var o,a,s,u=e.andln(3)+n&3,f=t.andln(3)+i&3;3===u&&(u=-1),3===f&&(f=-1),o=0==(1&u)?0:3!=(s=e.andln(7)+n&7)&&5!==s||2!==f?u:-u,r[0].push(o),a=0==(1&f)?0:3!=(s=t.andln(7)+i&7)&&5!==s||2!==u?f:-f,r[1].push(a),2*n===o+1&&(n=1-n),2*i===a+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new i(e,"hex","le")}},function(e,t,r){"use strict";var n=r(3),i=r(11).utils,o=i.getNAF,a=i.getJSF,s=i.assert;function u(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.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=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);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 f(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(e,t){s(e.precomputed);var r=e._getDoubles(),n=o(t,1),i=(1<=u;t--)f=(f<<1)+n[t];a.push(f)}for(var c=this.jpoint(null,null,null),h=this.jpoint(null,null,null),d=i;d>0;d--){for(u=0;u=0;f--){for(t=0;f>=0&&0===a[f];f--)t++;if(f>=0&&t++,u=u.dblp(t),f<0)break;var c=a[f];s(0!==c),u="affine"===e.type?c>0?u.mixedAdd(i[c-1>>1]):u.mixedAdd(i[-c-1>>1].neg()):c>0?u.add(i[c-1>>1]):u.add(i[-c-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,r,n,i){for(var s=this._wnafT1,u=this._wnafT2,f=this._wnafT3,c=0,h=0;h=1;h-=2){var l=h-1,p=h;if(1===s[l]&&1===s[p]){var b=[t[l],null,null,t[p]];0===t[l].y.cmp(t[p].y)?(b[1]=t[l].add(t[p]),b[2]=t[l].toJ().mixedAdd(t[p].neg())):0===t[l].y.cmp(t[p].y.redNeg())?(b[1]=t[l].toJ().mixedAdd(t[p]),b[2]=t[l].add(t[p].neg())):(b[1]=t[l].toJ().mixedAdd(t[p]),b[2]=t[l].toJ().mixedAdd(t[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],g=a(r[l],r[p]);c=Math.max(g[0].length,c),f[l]=new Array(c),f[p]=new Array(c);for(var v=0;v=0;h--){for(var M=0;h>=0;){var A=!0;for(v=0;v=0&&M++,_=_.dblp(M),h<0)break;for(v=0;v0?x=u[v][E-1>>1]:E<0&&(x=u[v][-E-1>>1].neg()),_="affine"===x.type?_.mixedAdd(x):_.add(x))}}for(h=0;h=Math.ceil((e.bitLength()+1)/t.step)},f.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(a=t,s=r),n.negative&&(n=n.neg(),i=i.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:i},{a:a,b:s}]},f.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),f=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:u.add(f).neg()}},f.prototype.pointFromX=function(e,t){(e=new o(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},f.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},f.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).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)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new o(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},c.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.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 t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(h,s.BasePoint),f.prototype.jpoint=function(e,t,r){return new h(this,e,t,r)},h.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.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 f=s.redSqr(),c=f.redMul(s),h=n.redMul(f),d=u.redSqr().redIAdd(c).redISub(h).redISub(h),l=u.redMul(h.redISub(d)).redISub(o.redMul(c)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(d,l,p)},h.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).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(),f=u.redMul(a),c=r.redMul(u),h=s.redSqr().redIAdd(f).redISub(c).redISub(c),d=s.redMul(c.redISub(h)).redISub(i.redMul(f)),l=this.z.redMul(a);return this.curve.jpoint(h,d,l)},h.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},h.prototype.inspect=function(){return this.isInfinity()?"":""},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t,r){"use strict";var n=r(71),i=r(3),o=r(1),a=n.base,s=r(11).utils;function u(e){a.call(this,"mont",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function f(e,t,r){a.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(t,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(u,a),e.exports=u,u.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},o(f,a.BasePoint),u.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},u.prototype.point=function(e,t){return new f(this,e,t)},u.prototype.pointFromJSON=function(e){return f.fromJSON(this,e)},f.prototype.precompute=function(){},f.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},f.fromJSON=function(e,t){return new f(e,t[0],t[1]||e.one)},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},f.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},f.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),u=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},f.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},f.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},f.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(e,t,r){"use strict";var n=r(71),i=r(11),o=r(3),a=r(1),s=n.base,u=i.utils.assert;function f(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,s.call(this,"edwards",e),this.a=new o(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new o(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new o(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),u(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function c(e,t,r,n,i){s.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new o(t,16),this.y=new o(r,16),this.z=n?new o(n,16):this.curve.one,this.t=i&&new o(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}a(f,s),e.exports=f,f.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},f.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},f.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},f.prototype.pointFromX=function(e,t){(e=new o(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(i.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var u=s.fromRed().isOdd();return(t&&!u||!t&&u)&&(s=s.redNeg()),this.point(e,s)},f.prototype.pointFromY=function(e,t){(e=new o(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),i=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(i.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},f.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},a(c,s.BasePoint),f.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},f.prototype.point=function(e,t,r,n){return new c(this,e,t,r,n)},c.fromJSON=function(e,t){return new c(e,t[0],t[1],t[2])},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),u=i.redMul(a),f=o.redMul(s),c=i.redMul(s),h=a.redMul(o);return this.curve.point(u,f,h,c)},c.prototype._projDbl=function(){var e,t,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(f=this.curve._mulA(i)).redAdd(o);if(this.zOne)e=n.redSub(i).redSub(o).redMul(a.redSub(this.curve.two)),t=a.redMul(f.redSub(o)),r=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),u=a.redSub(s).redISub(s);e=n.redSub(i).redISub(o).redMul(u),t=a.redMul(f.redSub(o)),r=a.redMul(u)}}else{var f=i.redAdd(o);s=this.curve._mulC(this.z).redSqr(),u=f.redSub(s).redSub(s);e=this.curve._mulC(n.redISub(f)).redMul(u),t=this.curve._mulC(f).redMul(i.redISub(o)),r=f.redMul(u)}return this.curve.point(e,t,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),u=r.redAdd(t),f=o.redMul(a),c=s.redMul(u),h=o.redMul(u),d=a.redMul(s);return this.curve.point(f,c,d,h)},c.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),f=i.redAdd(s),c=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),h=n.redMul(u).redMul(c);return this.curve.twisted?(t=n.redMul(f).redMul(a.redSub(this.curve._mulA(o))),r=u.redMul(f)):(t=n.redMul(f).redMul(a.redSub(o)),r=this.curve._mulC(u).redMul(f)),this.curve.point(h,t,r)},c.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},c.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},c.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},c.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},function(e,t,r){"use strict";var n,i=t,o=r(40),a=r(11),s=a.utils.assert;function u(e){"short"===e.type?this.curve=new a.curve.short(e):"edwards"===e.type?this.curve=new a.curve.edwards(e):this.curve=new a.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function f(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new u(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,f("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"]}),f("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"]}),f("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"]}),f("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"]}),f("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"]}),f("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"]}),f("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(297)}catch(e){n=void 0}f("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(e,t,r){"use strict";t.sha1=r(292),t.sha224=r(293),t.sha256=r(149),t.sha384=r(294),t.sha512=r(150)},function(e,t,r){"use strict";var n=r(25),i=r(57),o=r(148),a=n.rotl32,s=n.sum32,u=n.sum32_5,f=o.ft_1,c=i.BlockHash,h=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,c),e.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;nthis.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t0))return s.iaddn(1),this.keyFromPrivate(s)}},f.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},f.prototype.sign=function(e,t,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var a=this.n.byteLength(),s=t.getPrivate().toArray("be",a),f=e.toArray("be",a),c=new i({hash:this.hash,entropy:s,nonce:f,pers:o.pers,persEnc:o.persEnc||"utf8"}),h=this.n.sub(new n(1)),d=0;;d++){var l=o.k?o.k(d):new n(c.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(h)>=0)){var p=this.g.mul(l);if(!p.isInfinity()){var b=p.getX(),m=b.umod(this.n);if(0!==m.cmpn(0)){var g=l.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e));if(0!==(g=g.umod(this.n)).cmpn(0)){var v=(p.getY().isOdd()?1:0)|(0!==b.cmp(m)?2:0);return o.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),v^=1),new u({r:m,s:g,recoveryParam:v})}}}}}},f.prototype.verify=function(e,t,r,i){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,i);var o=(t=new u(t,"hex")).r,a=t.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,f=a.invm(this.n),c=f.mul(e).umod(this.n),h=f.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),h)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(c,r.getPublic(),h)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},f.prototype.recoverPubKey=function(e,t,r,i){a((3&r)===r,"The recovery param is more than two bits"),t=new u(t,i);var o=this.n,s=new n(e),f=t.r,c=t.s,h=1&r,d=r>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");f=d?this.curve.pointFromX(f.add(this.curve.n),h):this.curve.pointFromX(f,h);var l=t.r.invm(o),p=o.sub(s).mul(l).umod(o),b=c.mul(l).umod(o);return this.g.mulAdd(p,f,b)},f.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new u(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t,r){"use strict";var n=r(3),i=r(11).utils.assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=o,o.fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return""}},function(e,t,r){"use strict";var n=r(3),i=r(11).utils,o=i.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(e,t){var r=e[t.place++];if(!(128&r))return r;for(var n=15&r,i=0,o=0,a=t.place;o>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=a,a.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new function(){this.place=0};if(48!==e[r.place++])return!1;if(s(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var o=s(e,r),a=e.slice(r.place,o+r.place);if(r.place+=o,2!==e[r.place++])return!1;var u=s(e,r);if(e.length!==u+r.place)return!1;var f=e.slice(r.place,u+r.place);return 0===a[0]&&128&a[1]&&(a=a.slice(1)),0===f[0]&&128&f[1]&&(f=f.slice(1)),this.r=new n(a),this.s=new n(f),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=u(t),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];f(n,t.length),(n=n.concat(t)).push(2),f(n,r.length);var o=n.concat(r),a=[48];return f(a,o.length),a=a.concat(o),i.encode(a,e)}},function(e,t,r){"use strict";var n=r(40),i=r(11),o=i.utils,a=o.assert,s=o.parseBytes,u=r(302),f=r(303);function c(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof c))return new c(e);e=i.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=c,c.prototype.sign=function(e,t){e=s(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),u=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},c.prototype.verify=function(e,t,r){e=s(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},c.prototype.hashInt=function(){for(var e=this.hash(),t=0;t=t)throw new Error("invalid sig")}e.exports=function(e,r,u,f,c){var h=o(u);if("ec"===h.type){if("ecdsa"!==f&&"ecdsa/rsa"!==f)throw new Error("wrong public key type");return function(e,t,r){var n=a[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var o=new i(n),s=r.data.subjectPrivateKey.data;return o.verify(t,e,s)}(e,r,h)}if("dsa"===h.type){if("dsa"!==f)throw new Error("wrong public key type");return function(e,t,r){var i=r.data.p,a=r.data.q,u=r.data.g,f=r.data.pub_key,c=o.signature.decode(e,"der"),h=c.s,d=c.r;s(h,a),s(d,a);var l=n.mont(i),p=h.invm(a);return 0===u.toRed(l).redPow(new n(t).mul(p).mod(a)).fromRed().mul(f.toRed(l).redPow(d.mul(p).mod(a)).fromRed()).mod(i).mod(a).cmp(d)}(e,r,h)}if("rsa"!==f&&"ecdsa/rsa"!==f)throw new Error("wrong public key type");r=t.concat([c,r]);for(var d=h.modulus.byteLength(),l=[1],p=0;r.length+l.length+2r-d-2)throw new Error("message too long");var l=h.alloc(r-n-d-2),p=r-c-1,b=i(c),m=s(h.concat([f,l,h.alloc(1,1),t],p),a(b,p)),g=s(b,a(m,c));return new u(h.concat([h.alloc(1),g,m],r))}(p,t);else if(1===d)l=function(e,t,r){var n,o=t.length,a=e.modulus.byteLength();if(o>a-11)throw new Error("message too long");n=r?h.alloc(a-o-3,255):function(e){var t,r=h.allocUnsafe(e),n=0,o=i(2*e),a=0;for(;n=0)throw new Error("data too long for modulus")}return r?c(l,p):f(l,p)}},function(e,t,r){var n=r(72),i=r(157),o=r(158),a=r(3),s=r(96),u=r(39),f=r(159),c=r(2).Buffer;e.exports=function(e,t,r){var h;h=e.padding?e.padding:r?1:4;var d,l=n(e),p=l.modulus.byteLength();if(t.length>p||new a(t).cmp(l.modulus)>=0)throw new Error("decryption error");d=r?f(new a(t),l):s(t,l);var b=c.alloc(p-d.length);if(d=c.concat([b,d],p),4===h)return function(e,t){var r=e.modulus.byteLength(),n=u("sha1").update(c.alloc(0)).digest(),a=n.length;if(0!==t[0])throw new Error("decryption error");var s=t.slice(1,a+1),f=t.slice(a+1),h=o(s,i(f,a)),d=o(f,i(h,r-a-1));if(function(e,t){e=c.from(e),t=c.from(t);var r=0,n=e.length;e.length!==t.length&&(r++,n=Math.min(e.length,t.length));var i=-1;for(;++i=t.length){o++;break}var a=t.slice(2,i-1);("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return t.slice(i)}(0,d,r);if(3===h)return d;throw new Error("unknown padding")}},function(e,t,r){"use strict";(function(e,n){function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=r(2),a=r(46),s=o.Buffer,u=o.kMaxLength,f=e.crypto||e.msCrypto,c=Math.pow(2,32)-1;function h(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>c||e<0)throw new TypeError("offset must be a uint32");if(e>u||e>t)throw new RangeError("offset out of range")}function d(e,t,r){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>c||e<0)throw new TypeError("size must be a uint32");if(e+t>r||e>u)throw new RangeError("buffer too small")}function l(e,t,r,i){if(n.browser){var o=e.buffer,s=new Uint8Array(o,t,r);return f.getRandomValues(s),i?void n.nextTick(function(){i(null,e)}):e}if(!i)return a(r).copy(e,t),e;a(r,function(r,n){if(r)return i(r);n.copy(e,t),i(null,e)})}f&&f.getRandomValues||!n.browser?(t.randomFill=function(t,r,n,i){if(!(s.isBuffer(t)||t instanceof e.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof r)i=r,r=0,n=t.length;else if("function"==typeof n)i=n,n=t.length-r;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return h(r,t.length),d(n,r,t.length),l(t,r,n,i)},t.randomFillSync=function(t,r,n){void 0===r&&(r=0);if(!(s.isBuffer(t)||t instanceof e.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');h(r,t.length),void 0===n&&(n=t.length-r);return d(n,r,t.length),l(t,r,n)}):(t.randomFill=i,t.randomFillSync=i)}).call(this,r(7),r(15))},function(e,t,r){(function(t){var n=r(92).pbkdf2Sync,i=2147483647;function o(e,r,n,i,o){if(t.isBuffer(e)&&t.isBuffer(n))e.copy(n,i,r,r+o);else for(;o--;)n[i++]=e[r++]}e.exports=function(e,r,a,s,u,f,c){if(0===a||0!=(a&a-1))throw Error("N must be > 0 and a power of 2");if(a>i/128/s)throw Error("Parameter N is too large");if(s>i/128/u)throw Error("Parameter r is too large");var h,d=new t(256*s),l=new t(128*s*a),p=new Int32Array(16),b=new Int32Array(16),m=new t(64),g=n(e,r,1,128*u*s,"sha256");if(c){var v=u*a*2,y=0;h=function(){++y%1e3==0&&c({current:y,total:v,percent:y/v*100})}}for(var w=0;w>>32-t}function A(e){var t;for(t=0;t<16;t++)p[t]=(255&e[4*t+0])<<0,p[t]|=(255&e[4*t+1])<<8,p[t]|=(255&e[4*t+2])<<16,p[t]|=(255&e[4*t+3])<<24;for(o(p,0,b,0,16),t=8;t>0;t-=2)b[4]^=M(b[0]+b[12],7),b[8]^=M(b[4]+b[0],9),b[12]^=M(b[8]+b[4],13),b[0]^=M(b[12]+b[8],18),b[9]^=M(b[5]+b[1],7),b[13]^=M(b[9]+b[5],9),b[1]^=M(b[13]+b[9],13),b[5]^=M(b[1]+b[13],18),b[14]^=M(b[10]+b[6],7),b[2]^=M(b[14]+b[10],9),b[6]^=M(b[2]+b[14],13),b[10]^=M(b[6]+b[2],18),b[3]^=M(b[15]+b[11],7),b[7]^=M(b[3]+b[15],9),b[11]^=M(b[7]+b[3],13),b[15]^=M(b[11]+b[7],18),b[1]^=M(b[0]+b[3],7),b[2]^=M(b[1]+b[0],9),b[3]^=M(b[2]+b[1],13),b[0]^=M(b[3]+b[2],18),b[6]^=M(b[5]+b[4],7),b[7]^=M(b[6]+b[5],9),b[4]^=M(b[7]+b[6],13),b[5]^=M(b[4]+b[7],18),b[11]^=M(b[10]+b[9],7),b[8]^=M(b[11]+b[10],9),b[9]^=M(b[8]+b[11],13),b[10]^=M(b[9]+b[8],18),b[12]^=M(b[15]+b[14],7),b[13]^=M(b[12]+b[15],9),b[14]^=M(b[13]+b[12],13),b[15]^=M(b[14]+b[13],18);for(t=0;t<16;++t)p[t]=b[t]+p[t];for(t=0;t<16;t++){var r=4*t;e[r+0]=p[t]>>0&255,e[r+1]=p[t]>>8&255,e[r+2]=p[t]>>16&255,e[r+3]=p[t]>>24&255}}function x(e,t,r,n,i){for(var o=0;oh)&&void 0===e.nsecs&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");h=a,d=u,c=o;var p=(1e4*(268435455&(a+=122192928e5))+u)%4294967296;i[n++]=p>>>24&255,i[n++]=p>>>16&255,i[n++]=p>>>8&255,i[n++]=255&p;var b=a/4294967296*1e4&268435455;i[n++]=b>>>8&255,i[n++]=255&b,i[n++]=b>>>24&15|16,i[n++]=b>>>16&255,i[n++]=o>>>8|128,i[n++]=255&o;for(var m=e.node||f,g=0;g<6;g++)i[n+g]=m[g];return t||s(i)},p.v4=l,p.parse=function(e,t,r){var n=t&&r||0,i=0;for(t=t||[],e.toLowerCase().replace(/[0-9a-f]{2}/g,function(e){i<16&&(t[n+i++]=o[e])});i<16;)t[n+i++]=0;return t},p.unparse=s,e.exports=p},function(e,t,r){(function(t){var r;if(t.crypto&&crypto.getRandomValues){var n=new Uint8Array(16);r=function(){return crypto.getRandomValues(n),n}}if(!r){var i=new Array(16);r=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),i[t]=e>>>((3&t)<<3)&255;return i}}e.exports=r}).call(this,r(7))},function(e,t,r){"use strict";var n=r(128);e.exports=function(e){var t,r=this;return this.net.getId().then(function(e){return t=e,r.getBlock(0)}).then(function(r){var i="private";return"0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3"===r.hash&&1===t&&(i="main"),"0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303"===r.hash&&2===t&&(i="morden"),"0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d"===r.hash&&3===t&&(i="ropsten"),"0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177"===r.hash&&4===t&&(i="rinkeby"),"0xa3c565fc15c7478862d50ccd6561e3c06b24cc509bf388941c25ea985ce32cb9"===r.hash&&42===t&&(i="kovan"),n.isFunction(e)&&e(null,i),i}).catch(function(t){if(!n.isFunction(e))throw t;e(t)})}},function(e,t,r){"use strict";var n=r(35),i=r(65).subscriptions,o=r(37),a=r(66),s=function(){var e=this;n.packageInit(this,arguments);var t=this.setProvider;this.setProvider=function(){t.apply(e,arguments),e.net.setProvider.apply(e,arguments)},this.clearSubscriptions=e._requestManager.clearSubscriptions,this.net=new a(this.currentProvider),[new i({name:"subscribe",type:"shh",subscriptions:{messages:{params:1}}}),new o({name:"getVersion",call:"shh_version",params:0}),new o({name:"getInfo",call:"shh_info",params:0}),new o({name:"setMaxMessageSize",call:"shh_setMaxMessageSize",params:1}),new o({name:"setMinPoW",call:"shh_setMinPoW",params:1}),new o({name:"markTrustedPeer",call:"shh_markTrustedPeer",params:1}),new o({name:"newKeyPair",call:"shh_newKeyPair",params:0}),new o({name:"addPrivateKey",call:"shh_addPrivateKey",params:1}),new o({name:"deleteKeyPair",call:"shh_deleteKeyPair",params:1}),new o({name:"hasKeyPair",call:"shh_hasKeyPair",params:1}),new o({name:"getPublicKey",call:"shh_getPublicKey",params:1}),new o({name:"getPrivateKey",call:"shh_getPrivateKey",params:1}),new o({name:"newSymKey",call:"shh_newSymKey",params:0}),new o({name:"addSymKey",call:"shh_addSymKey",params:1}),new o({name:"generateSymKeyFromPassword",call:"shh_generateSymKeyFromPassword",params:1}),new o({name:"hasSymKey",call:"shh_hasSymKey",params:1}),new o({name:"getSymKey",call:"shh_getSymKey",params:1}),new o({name:"deleteSymKey",call:"shh_deleteSymKey",params:1}),new o({name:"newMessageFilter",call:"shh_newMessageFilter",params:1}),new o({name:"getFilterMessages",call:"shh_getFilterMessages",params:1}),new o({name:"deleteMessageFilter",call:"shh_deleteMessageFilter",params:1}),new o({name:"post",call:"shh_post",params:1,inputFormatter:[null]}),new o({name:"unsubscribe",call:"shh_unsubscribe",params:1})].forEach(function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)})};n.addProviders(s),e.exports=s},function(e,t,r){"use strict";var n=r(18),i=r(330),o=function e(t){this.givenProvider=e.givenProvider,t&&t._requestManager&&(t=t.currentProvider),"undefined"!=typeof document&&(this.pick=i.pick),this.setProvider(t)};o.givenProvider=null,"undefined"!=typeof ethereumProvider&ðereumProvider.bzz&&(o.givenProvider=ethereumProvider.bzz),o.prototype.setProvider=function(e){if(n.isObject(e)&&n.isString(e.bzz)&&(e=e.bzz),!n.isString(e)){this.currentProvider=null;var t=new Error("No provider set, please set one using bzz.setProvider().");return this.download=this.upload=this.isAvailable=function(){throw t},!1}return this.currentProvider=e,this.download=i.at(e).download,this.upload=i.at(e).upload,this.isAvailable=i.at(e).isAvailable,!0},e.exports=o},function(e,t,r){var n=function(){throw"This swarm.js function isn't available on the browser."},i={readFile:n},o={download:n,safeDownloadArchived:n,directoryTree:n},a={platform:n,arch:n},s={join:n,slice:n},u={spawn:n},f={lookup:n},c=r(331),h=r(164),d=r(348),l=r(349),p=r(350);e.exports=p({fsp:i,files:o,os:a,path:s,child_process:u,defaultArchives:{},mimetype:f,request:c,downloadUrl:null,bytes:h,hash:d,pick:l})},function(e,t,r){var n=r(332);e.exports=function(e,t){return new Promise(function(r,i){n(e,t,function(e,t){e?i(e):r(t)})})}},function(e,t,r){var n=r(333),i=r(336),o=r(163),a=r(337),s=r(338),u="application/json",f=function(){};e.exports=function(e,t,r){if(!e||"string"!=typeof e)throw new TypeError("must specify a URL");"function"==typeof t&&(r=t,t={});if(r&&"function"!=typeof r)throw new TypeError("expected cb to be undefined or a function");r=r||f;var c=(t=t||{}).json?"json":"text",h=(t=o({responseType:c},t)).headers||{},d=(t.method||"GET").toUpperCase(),l=t.query;l&&("string"!=typeof l&&(l=n.stringify(l)),e=i(e,l));"json"===t.responseType&&a(h,"Accept",u);t.json&&"GET"!==d&&"HEAD"!==d&&(a(h,"Content-Type",u),t.body=JSON.stringify(t.body));return t.method=d,t.url=e,t.headers=h,delete t.query,delete t.json,s(t,r)}},function(e,t,r){"use strict";var n=r(334),i=r(163),o=r(335);function a(e,t){return t.encode?t.strict?n(e):encodeURIComponent(e):e}function s(e){var t=e.indexOf("?");return-1===t?"":e.slice(t+1)}function u(e,t){var r=function(e){var t;switch(e.arrayFormat){case"index":return function(e,r,n){t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===n[e]&&(n[e]={}),n[e][t[1]]=r):n[e]=r};case"bracket":return function(e,r,n){t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==n[e]?n[e]=[].concat(n[e],r):n[e]=[r]:n[e]=r};default:return function(e,t,r){void 0!==r[e]?r[e]=[].concat(r[e],t):r[e]=t}}}(t=i({arrayFormat:"none"},t)),n=Object.create(null);return"string"!=typeof e?n:(e=e.trim().replace(/^[?#&]/,""))?(e.split("&").forEach(function(e){var t=e.replace(/\+/g," ").split("="),i=t.shift(),a=t.length>0?t.join("="):void 0;a=void 0===a?null:o(a),r(o(i),a,n)}),Object.keys(n).sort().reduce(function(e,t){var r=n[t];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?e[t]=function e(t){return Array.isArray(t)?t.sort():"object"==typeof t?e(Object.keys(t)).sort(function(e,t){return Number(e)-Number(t)}).map(function(e){return t[e]}):t}(r):e[t]=r,e},Object.create(null))):n}t.extract=s,t.parse=u,t.stringify=function(e,t){!1===(t=i({encode:!0,strict:!0,arrayFormat:"none"},t)).sort&&(t.sort=function(){});var r=function(e){switch(e.arrayFormat){case"index":return function(t,r,n){return null===r?[a(t,e),"[",n,"]"].join(""):[a(t,e),"[",a(n,e),"]=",a(r,e)].join("")};case"bracket":return function(t,r){return null===r?a(t,e):[a(t,e),"[]=",a(r,e)].join("")};default:return function(t,r){return null===r?a(t,e):[a(t,e),"=",a(r,e)].join("")}}}(t);return e?Object.keys(e).sort(t.sort).map(function(n){var i=e[n];if(void 0===i)return"";if(null===i)return a(n,t);if(Array.isArray(i)){var o=[];return i.slice().forEach(function(e){void 0!==e&&o.push(r(n,e,o.length))}),o.join("&")}return a(n,t)+"="+a(i,t)}).filter(function(e){return e.length>0}).join("&"):""},t.parseUrl=function(e,t){return{url:e.split("?")[0]||"",query:u(s(e),t)}}},function(e,t,r){"use strict";e.exports=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}},function(e,t,r){"use strict";var n=new RegExp("%[a-f0-9]{2}","gi"),i=new RegExp("(%[a-f0-9]{2})+","gi");function o(e,t){try{return decodeURIComponent(e.join(""))}catch(e){}if(1===e.length)return e;t=t||1;var r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],o(r),o(n))}function a(e){try{return decodeURIComponent(e)}catch(i){for(var t=e.match(n),r=1;r0&&(c=setTimeout(function(){if(!s){s=!0,f.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",n(e)}},e.timeout)),f.setRequestHeader)for(a in p)p.hasOwnProperty(a)&&f.setRequestHeader(a,p[a]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(f.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(f),f.send(l||null),f}e.exports=u,e.exports.default=u,u.XMLHttpRequest=n.XMLHttpRequest||function(){},u.XDomainRequest="withCredentials"in new u.XMLHttpRequest?u.XMLHttpRequest:n.XDomainRequest,function(e,t){for(var r=0;r=3&&(a=r),"[object Array]"===i.call(e)?function(e,t,r){for(var n=0,i=e.length;n0){var a=i.join(r,o);n.push(y(e)(t[o])(a))}return Promise.all(n).then(function(){return r})})}}},_=function(e){return function(t){return u(e+"/bzzr:/",{body:"string"==typeof t?j(t):t,method:"POST"})}},S=function(e){return function(t){return function(r){return function(n){return function i(o){var a="/"===r[0]?r:"/"+r,s=e+"/bzz:/"+t+a,f={method:"PUT",headers:{"Content-Type":n.type},body:n.data};return u(s,f).then(function(e){if(-1!==e.indexOf("error"))throw e;return e}).catch(function(e){return o>0&&i(o-1)})}(3)}}}},M=function(e){return function(t){return x(e)({"":t})}},A=function(e){return function(r){return t.readFile(r).then(function(t){return M(e)({type:a.lookup(r),data:t})})}},x=function(e){return function(t){return _(e)("{}").then(function(r){return Object.keys(t).reduce(function(r,n){return r.then(function(r){return function(n){return S(e)(n)(r)(t[r])}}(n))},Promise.resolve(r))})}},E=function(e){return function(r){return t.readFile(r).then(_(e))}},k=function(e){return function(n){return function(i){return r.directoryTree(i).then(function(e){return Promise.all(e.map(function(e){return t.readFile(e)})).then(function(t){var r=e.map(function(e){return e.slice(i.length)}),n=e.map(function(e){return a.lookup(e)||"text/plain"});return l(r)(t.map(function(e,t){return{type:n[t],data:e}}))})}).then(function(e){return function(e){return function(t){var r={};for(var n in e)r[n]=e[n];for(var i in t)r[i]=t[i];return r}}(n?{"":e[n]}:{})(e)}).then(x(e))}}},I=function(e){return function(t){if("data"===t.pick)return d.data().then(_(e));if("file"===t.pick)return d.file().then(M(e));if("directory"===t.pick)return d.directory().then(x(e));if(t.path)switch(t.kind){case"data":return E(e)(t.path);case"file":return A(e)(t.path);case"directory":return k(e)(t.defaultFile)(t.path)}else{if(t.length||"string"==typeof t)return _(e)(t);if(t instanceof Object)return x(e)(t)}return Promise.reject(new Error("Bad arguments"))}},P=function(e){return function(t){return function(r){return N(e)(t).then(function(n){return n?r?w(e)(t)(r):v(e)(t):r?y(e)(t)(r):b(e)(t)})}}},B=function(e,t){var i=n.platform().replace("win32","windows")+"-"+("x64"===n.arch()?"amd64":"386"),o=(t||s)[i],a=f+o.archive+".tar.gz",u=o.archiveMD5,c=o.binaryMD5;return r.safeDownloadArchived(a)(u)(c)(e)},T=function(e){return new Promise(function(t,r){var n=o.spawn,i=function(e){return function(t){return-1!==(""+t).indexOf(e)}},a=e.account,s=e.password,u=e.dataDir,f=e.ensApi,c=e.privateKey,h=0,d=n(e.binPath,["--bzzaccount",a||c,"--datadir",u,"--ens-api",f]),l=function(e){0===h&&i("Passphrase")(e)?setTimeout(function(){h=1,d.stdin.write(s+"\n")},500):i("Swarm http proxy started")(e)&&(h=2,clearTimeout(p),t(d))};d.stdout.on("data",l),d.stderr.on("data",l);var p=setTimeout(function(){return r(new Error("Couldn't start swarm process."))},2e4)})},O=function(e){return new Promise(function(t,r){e.stderr.removeAllListeners("data"),e.stdout.removeAllListeners("data"),e.stdin.removeAllListeners("error"),e.removeAllListeners("error"),e.removeAllListeners("exit"),e.kill("SIGINT");var n=setTimeout(function(){return e.kill("SIGKILL")},8e3);e.once("close",function(){clearTimeout(n),t()})})},R=function(e){return _(e)("test").then(function(e){return"c9a99c7d326dcc6316f32fe2625b311f6dc49a175e6877681ded93137d3569e7"===e}).catch(function(){return!1})},N=function(e){return function(t){return b(e)(t).then(function(e){try{return!!JSON.parse(L(e)).entries}catch(e){return!1}})}},C=function(e){return function(t,r,n,i,o){var a;return void 0!==t&&(a=e(t)),void 0!==r&&(a=e(r)),void 0!==n&&(a=e(n)),void 0!==i&&(a=e(i)),void 0!==o&&(a=e(o)),a}},L=function(e){return c.toString(c.fromUint8Array(e))},j=function(e){return c.toUint8Array(c.fromString(e))},z=function(e){return{download:function(t,r){return P(e)(t)(r)},downloadData:C(b(e)),downloadDataToDisk:C(y(e)),downloadDirectory:C(v(e)),downloadDirectoryToDisk:C(w(e)),downloadEntries:C(m(e)),downloadRoutes:C(g(e)),isAvailable:function(){return R(e)},upload:function(t){return I(e)(t)},uploadData:C(_(e)),uploadFile:C(M(e)),uploadFileFromDisk:C(M(e)),uploadDataFromDisk:C(E(e)),uploadDirectory:C(x(e)),uploadDirectoryFromDisk:C(k(e)),uploadToManifest:C(S(e)),pick:d,hash:h,fromString:j,toString:L}};return{at:z,local:function(e){return function(t){return R("http://localhost:8500").then(function(r){return r?t(z("http://localhost:8500")).then(function(){}):B(e.binPath,e.archives).onData(function(t){return(e.onProgress||function(){})(t.length)}).then(function(){return T(e)}).then(function(e){return t(z("http://localhost:8500")).then(function(){return e})}).then(O)})}},download:P,downloadBinary:B,downloadData:b,downloadDataToDisk:y,downloadDirectory:v,downloadDirectoryToDisk:w,downloadEntries:m,downloadRoutes:g,isAvailable:R,startProcess:T,stopProcess:O,upload:I,uploadData:_,uploadDataFromDisk:E,uploadFile:M,uploadFileFromDisk:A,uploadDirectory:x,uploadDirectoryFromDisk:k,uploadToManifest:S,pick:d,hash:h,fromString:j,toString:L}}},function(e,t,r){"use strict";e.exports=r(352)(r(355))},function(e,t,r){"use strict";var n=r(353),i=r(354);e.exports=function(e){var t=n(e),r=i(e);return function(e,n){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new t(1152,448,null,224,n);case"keccak256":return new t(1088,512,null,256,n);case"keccak384":return new t(832,768,null,384,n);case"keccak512":return new t(576,1024,null,512,n);case"sha3-224":return new t(1152,448,6,224,n);case"sha3-256":return new t(1088,512,6,256,n);case"sha3-384":return new t(832,768,6,384,n);case"sha3-512":return new t(576,1024,6,512,n);case"shake128":return new r(1344,256,31,n);case"shake256":return new r(1088,512,31,n);default:throw new Error("Invald algorithm: "+e)}}}},function(e,t,r){"use strict";var n=r(2).Buffer,i=r(55).Transform,o=r(1);e.exports=function(e){function t(t,r,n,o,a){i.call(this,a),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._hashBitLength=o,this._options=a,this._state=new e,this._state.initialize(t,r),this._finalized=!1}return o(t,i),t.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},t.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},t.prototype.update=function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return n.isBuffer(e)||(e=n.from(e,t)),this._state.absorb(e),this},t.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},function(e,t,r){"use strict";var n=r(2).Buffer,i=r(55).Transform,o=r(1);e.exports=function(e){function t(t,r,n,o){i.call(this,o),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._options=o,this._state=new e,this._state.initialize(t,r),this._finalized=!1}return o(t,i),t.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},t.prototype._flush=function(){},t.prototype._read=function(e){this.push(this.squeeze(e))},t.prototype.update=function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return n.isBuffer(e)||(e=n.from(e,t)),this._state.absorb(e),this},t.prototype.squeeze=function(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var r=this._state.squeeze(e);return void 0!==t&&(r=r.toString(t)),r},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},function(e,t,r){"use strict";var n=r(2).Buffer,i=r(356);function o(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}o.prototype.initialize=function(e,t){for(var r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},o.prototype.absorb=function(e){for(var t=0;t>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(i.p1600(this.state),this.count=0);return t},o.prototype.copy=function(e){for(var t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},e.exports=o},function(e,t,r){"use strict";var n=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];t.p1600=function(e){for(var t=0;t<24;++t){var r=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],o=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],s=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],f=e[6]^e[16]^e[26]^e[36]^e[46],c=e[7]^e[17]^e[27]^e[37]^e[47],h=e[8]^e[18]^e[28]^e[38]^e[48],d=e[9]^e[19]^e[29]^e[39]^e[49],l=h^(o<<1|a>>>31),p=d^(a<<1|o>>>31),b=e[0]^l,m=e[1]^p,g=e[10]^l,v=e[11]^p,y=e[20]^l,w=e[21]^p,_=e[30]^l,S=e[31]^p,M=e[40]^l,A=e[41]^p;l=r^(s<<1|u>>>31),p=i^(u<<1|s>>>31);var x=e[2]^l,E=e[3]^p,k=e[12]^l,I=e[13]^p,P=e[22]^l,B=e[23]^p,T=e[32]^l,O=e[33]^p,R=e[42]^l,N=e[43]^p;l=o^(f<<1|c>>>31),p=a^(c<<1|f>>>31);var C=e[4]^l,L=e[5]^p,j=e[14]^l,z=e[15]^p,D=e[24]^l,U=e[25]^p,F=e[34]^l,q=e[35]^p,H=e[44]^l,K=e[45]^p;l=s^(h<<1|d>>>31),p=u^(d<<1|h>>>31);var V=e[6]^l,G=e[7]^p,Y=e[16]^l,W=e[17]^p,Z=e[26]^l,X=e[27]^p,J=e[36]^l,$=e[37]^p,Q=e[46]^l,ee=e[47]^p;l=f^(r<<1|i>>>31),p=c^(i<<1|r>>>31);var te=e[8]^l,re=e[9]^p,ne=e[18]^l,ie=e[19]^p,oe=e[28]^l,ae=e[29]^p,se=e[38]^l,ue=e[39]^p,fe=e[48]^l,ce=e[49]^p,he=b,de=m,le=v<<4|g>>>28,pe=g<<4|v>>>28,be=y<<3|w>>>29,me=w<<3|y>>>29,ge=S<<9|_>>>23,ve=_<<9|S>>>23,ye=M<<18|A>>>14,we=A<<18|M>>>14,_e=x<<1|E>>>31,Se=E<<1|x>>>31,Me=I<<12|k>>>20,Ae=k<<12|I>>>20,xe=P<<10|B>>>22,Ee=B<<10|P>>>22,ke=O<<13|T>>>19,Ie=T<<13|O>>>19,Pe=R<<2|N>>>30,Be=N<<2|R>>>30,Te=L<<30|C>>>2,Oe=C<<30|L>>>2,Re=j<<6|z>>>26,Ne=z<<6|j>>>26,Ce=U<<11|D>>>21,Le=D<<11|U>>>21,je=F<<15|q>>>17,ze=q<<15|F>>>17,De=K<<29|H>>>3,Ue=H<<29|K>>>3,Fe=V<<28|G>>>4,qe=G<<28|V>>>4,He=W<<23|Y>>>9,Ke=Y<<23|W>>>9,Ve=Z<<25|X>>>7,Ge=X<<25|Z>>>7,Ye=J<<21|$>>>11,We=$<<21|J>>>11,Ze=ee<<24|Q>>>8,Xe=Q<<24|ee>>>8,Je=te<<27|re>>>5,$e=re<<27|te>>>5,Qe=ne<<20|ie>>>12,et=ie<<20|ne>>>12,tt=ae<<7|oe>>>25,rt=oe<<7|ae>>>25,nt=se<<8|ue>>>24,it=ue<<8|se>>>24,ot=fe<<14|ce>>>18,at=ce<<14|fe>>>18;e[0]=he^~Me&Ce,e[1]=de^~Ae&Le,e[10]=Fe^~Qe&be,e[11]=qe^~et&me,e[20]=_e^~Re&Ve,e[21]=Se^~Ne&Ge,e[30]=Je^~le&xe,e[31]=$e^~pe&Ee,e[40]=Te^~He&tt,e[41]=Oe^~Ke&rt,e[2]=Me^~Ce&Ye,e[3]=Ae^~Le&We,e[12]=Qe^~be&ke,e[13]=et^~me&Ie,e[22]=Re^~Ve&nt,e[23]=Ne^~Ge&it,e[32]=le^~xe&je,e[33]=pe^~Ee&ze,e[42]=He^~tt&ge,e[43]=Ke^~rt&ve,e[4]=Ce^~Ye&ot,e[5]=Le^~We&at,e[14]=be^~ke&De,e[15]=me^~Ie&Ue,e[24]=Ve^~nt&ye,e[25]=Ge^~it&we,e[34]=xe^~je&Ze,e[35]=Ee^~ze&Xe,e[44]=tt^~ge&Pe,e[45]=rt^~ve&Be,e[6]=Ye^~ot&he,e[7]=We^~at&de,e[16]=ke^~De&Fe,e[17]=Ie^~Ue&qe,e[26]=nt^~ye&_e,e[27]=it^~we&Se,e[36]=je^~Ze&Je,e[37]=ze^~Xe&$e,e[46]=ge^~Pe&Te,e[47]=ve^~Be&Oe,e[8]=ot^~he&Me,e[9]=at^~de&Ae,e[18]=De^~Fe&Qe,e[19]=Ue^~qe&et,e[28]=ye^~_e&Re,e[29]=we^~Se&Ne,e[38]=Ze^~Je&le,e[39]=Xe^~$e&pe,e[48]=Pe^~Te&He,e[49]=Be^~Oe&Ke,e[0]^=n[2*t],e[1]^=n[2*t+1]}}},function(e,t,r){"use strict";e.exports=r(358)(r(362))},function(e,t,r){"use strict";var n=r(359),i=r(360),o=r(165);function a(e,t){return void 0===e?t:(n.isBoolean(e,o.COMPRESSED_TYPE_INVALID),e)}e.exports=function(e){return{privateKeyVerify:function(t){return n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),32===t.length&&e.privateKeyVerify(t)},privateKeyExport:function(t,r){n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),r=a(r,!0);var s=e.privateKeyExport(t,r);return i.privateKeyExport(t,s,r)},privateKeyImport:function(t){if(n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),(t=i.privateKeyImport(t))&&32===t.length&&e.privateKeyVerify(t))return t;throw new Error(o.EC_PRIVATE_KEY_IMPORT_DER_FAIL)},privateKeyNegate:function(t){return n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),e.privateKeyNegate(t)},privateKeyModInverse:function(t){return n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),e.privateKeyModInverse(t)},privateKeyTweakAdd:function(t,r){return n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),n.isBuffer(r,o.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,o.TWEAK_LENGTH_INVALID),e.privateKeyTweakAdd(t,r)},privateKeyTweakMul:function(t,r){return n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),n.isBuffer(r,o.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,o.TWEAK_LENGTH_INVALID),e.privateKeyTweakMul(t,r)},publicKeyCreate:function(t,r){return n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),r=a(r,!0),e.publicKeyCreate(t,r)},publicKeyConvert:function(t,r){return n.isBuffer(t,o.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(t,33,65,o.EC_PUBLIC_KEY_LENGTH_INVALID),r=a(r,!0),e.publicKeyConvert(t,r)},publicKeyVerify:function(t){return n.isBuffer(t,o.EC_PUBLIC_KEY_TYPE_INVALID),e.publicKeyVerify(t)},publicKeyTweakAdd:function(t,r,i){return n.isBuffer(t,o.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(t,33,65,o.EC_PUBLIC_KEY_LENGTH_INVALID),n.isBuffer(r,o.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,o.TWEAK_LENGTH_INVALID),i=a(i,!0),e.publicKeyTweakAdd(t,r,i)},publicKeyTweakMul:function(t,r,i){return n.isBuffer(t,o.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(t,33,65,o.EC_PUBLIC_KEY_LENGTH_INVALID),n.isBuffer(r,o.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,o.TWEAK_LENGTH_INVALID),i=a(i,!0),e.publicKeyTweakMul(t,r,i)},publicKeyCombine:function(t,r){n.isArray(t,o.EC_PUBLIC_KEYS_TYPE_INVALID),n.isLengthGTZero(t,o.EC_PUBLIC_KEYS_LENGTH_INVALID);for(var i=0;i=r)throw RangeError(n)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=r(2).Buffer,i=r(361),o=n.from([48,129,211,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),a=n.from([48,130,1,19,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);t.privateKeyExport=function(e,t,r){var i=n.from(r?o:a);return e.copy(i,r?8:9),t.copy(i,r?181:214),i},t.privateKeyImport=function(e){var t=e.length,r=0;if(!(t2||t1?e[r+n-2]<<8:0);if(!(t<(r+=n)+i||t32||t1&&0===t[o]&&!(128&t[o+1]);--r,++o);for(var a=n.concat([n.from([0]),e.s]),s=33,u=0;s>1&&0===a[u]&&!(128&a[u+1]);--s,++u);return i.encode(t.slice(o),a.slice(u))},t.signatureImport=function(e){var t=n.alloc(32,0),r=n.alloc(32,0);try{var o=i.decode(e);if(33===o.r.length&&0===o.r[0]&&(o.r=o.r.slice(1)),o.r.length>32)throw new Error("R length is too long");if(33===o.s.length&&0===o.s[0]&&(o.s=o.s.slice(1)),o.s.length>32)throw new Error("S length is too long")}catch(e){return}return o.r.copy(t,32-o.r.length),o.s.copy(r,32-o.s.length),{r:t,s:r}},t.signatureImportLax=function(e){var t=n.alloc(32,0),r=n.alloc(32,0),i=e.length,o=0;if(48===e[o++]){var a=e[o++];if(!(128&a&&(o+=a-128)>i)&&2===e[o++]){var s=e[o++];if(128&s){if(o+(a=s-128)>i)return;for(;a>0&&0===e[o];o+=1,a-=1);for(s=0;a>0;o+=1,a-=1)s=(s<<8)+e[o]}if(!(s>i-o)){var u=o;if(o+=s,2===e[o++]){var f=e[o++];if(128&f){if(o+(a=f-128)>i)return;for(;a>0&&0===e[o];o+=1,a-=1);for(f=0;a>0;o+=1,a-=1)f=(f<<8)+e[o]}if(!(f>i-o)){var c=o;for(o+=f;s>0&&0===e[u];s-=1,u+=1);if(!(s>32)){var h=e.slice(u,u+s);for(h.copy(t,32-h.length);f>0&&0===e[c];f-=1,c+=1);if(!(f>32)){var d=e.slice(c,c+f);return d.copy(r,32-d.length),{r:t,s:r}}}}}}}}}},function(e,t,r){var n=r(2).Buffer;e.exports={check:function(e){if(e.length<8)return!1;if(e.length>72)return!1;if(48!==e[0])return!1;if(e[1]!==e.length-2)return!1;if(2!==e[2])return!1;var t=e[3];if(0===t)return!1;if(5+t>=e.length)return!1;if(2!==e[4+t])return!1;var r=e[5+t];return!(0===r||6+t+r!==e.length||128&e[4]||t>1&&0===e[4]&&!(128&e[5])||128&e[t+6]||r>1&&0===e[t+6]&&!(128&e[t+7]))},decode:function(e){if(e.length<8)throw new Error("DER sequence length is too short");if(e.length>72)throw new Error("DER sequence length is too long");if(48!==e[0])throw new Error("Expected DER sequence");if(e[1]!==e.length-2)throw new Error("DER sequence length is invalid");if(2!==e[2])throw new Error("Expected DER integer");var t=e[3];if(0===t)throw new Error("R length is zero");if(5+t>=e.length)throw new Error("R length is too long");if(2!==e[4+t])throw new Error("Expected DER integer (2)");var r=e[5+t];if(0===r)throw new Error("S length is zero");if(6+t+r!==e.length)throw new Error("S length is invalid");if(128&e[4])throw new Error("R value is negative");if(t>1&&0===e[4]&&!(128&e[5]))throw new Error("R value excessively padded");if(128&e[t+6])throw new Error("S value is negative");if(r>1&&0===e[t+6]&&!(128&e[t+7]))throw new Error("S value excessively padded");return{r:e.slice(4,4+t),s:e.slice(6+t)}},encode:function(e,t){var r=e.length,i=t.length;if(0===r)throw new Error("R length is zero");if(0===i)throw new Error("S length is zero");if(r>33)throw new Error("R length is too long");if(i>33)throw new Error("S length is too long");if(128&e[0])throw new Error("R value is negative");if(128&t[0])throw new Error("S value is negative");if(r>1&&0===e[0]&&!(128&e[1]))throw new Error("R value excessively padded");if(i>1&&0===t[0]&&!(128&t[1]))throw new Error("S value excessively padded");var o=n.allocUnsafe(6+r+i);return o[0]=48,o[1]=o.length-2,o[2]=2,o[3]=e.length,e.copy(o,4),o[4+r]=2,o[5+r]=t.length,t.copy(o,6+r),o}}},function(e,t,r){"use strict";var n=r(2).Buffer,i=r(39),o=r(3),a=r(11).ec,s=r(165),u=new a("secp256k1"),f=u.curve;function c(e){var t=e[0];switch(t){case 2:case 3:return 33!==e.length?null:function(e,t){var r=new o(t);if(r.cmp(f.p)>=0)return null;var n=(r=r.toRed(f.red)).redSqr().redIMul(r).redIAdd(f.b).redSqrt();return 3===e!==n.isOdd()&&(n=n.redNeg()),u.keyPair({pub:{x:r,y:n}})}(t,e.slice(1,33));case 4:case 6:case 7:return 65!==e.length?null:function(e,t,r){var n=new o(t),i=new o(r);if(n.cmp(f.p)>=0||i.cmp(f.p)>=0)return null;if(n=n.toRed(f.red),i=i.toRed(f.red),(6===e||7===e)&&i.isOdd()!==(7===e))return null;var a=n.redSqr().redIMul(n);return i.redSqr().redISub(a.redIAdd(f.b)).isZero()?u.keyPair({pub:{x:n,y:i}}):null}(t,e.slice(1,33),e.slice(33,65));default:return null}}t.privateKeyVerify=function(e){var t=new o(e);return t.cmp(f.n)<0&&!t.isZero()},t.privateKeyExport=function(e,t){var r=new o(e);if(r.cmp(f.n)>=0||r.isZero())throw new Error(s.EC_PRIVATE_KEY_EXPORT_DER_FAIL);return n.from(u.keyFromPrivate(e).getPublic(t,!0))},t.privateKeyNegate=function(e){var t=new o(e);return t.isZero()?n.alloc(32):f.n.sub(t).umod(f.n).toArrayLike(n,"be",32)},t.privateKeyModInverse=function(e){var t=new o(e);if(t.cmp(f.n)>=0||t.isZero())throw new Error(s.EC_PRIVATE_KEY_RANGE_INVALID);return t.invm(f.n).toArrayLike(n,"be",32)},t.privateKeyTweakAdd=function(e,t){var r=new o(t);if(r.cmp(f.n)>=0)throw new Error(s.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);if(r.iadd(new o(e)),r.cmp(f.n)>=0&&r.isub(f.n),r.isZero())throw new Error(s.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);return r.toArrayLike(n,"be",32)},t.privateKeyTweakMul=function(e,t){var r=new o(t);if(r.cmp(f.n)>=0||r.isZero())throw new Error(s.EC_PRIVATE_KEY_TWEAK_MUL_FAIL);return r.imul(new o(e)),r.cmp(f.n)&&(r=r.umod(f.n)),r.toArrayLike(n,"be",32)},t.publicKeyCreate=function(e,t){var r=new o(e);if(r.cmp(f.n)>=0||r.isZero())throw new Error(s.EC_PUBLIC_KEY_CREATE_FAIL);return n.from(u.keyFromPrivate(e).getPublic(t,!0))},t.publicKeyConvert=function(e,t){var r=c(e);if(null===r)throw new Error(s.EC_PUBLIC_KEY_PARSE_FAIL);return n.from(r.getPublic(t,!0))},t.publicKeyVerify=function(e){return null!==c(e)},t.publicKeyTweakAdd=function(e,t,r){var i=c(e);if(null===i)throw new Error(s.EC_PUBLIC_KEY_PARSE_FAIL);if((t=new o(t)).cmp(f.n)>=0)throw new Error(s.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);return n.from(f.g.mul(t).add(i.pub).encode(!0,r))},t.publicKeyTweakMul=function(e,t,r){var i=c(e);if(null===i)throw new Error(s.EC_PUBLIC_KEY_PARSE_FAIL);if((t=new o(t)).cmp(f.n)>=0||t.isZero())throw new Error(s.EC_PUBLIC_KEY_TWEAK_MUL_FAIL);return n.from(i.pub.mul(t).encode(!0,r))},t.publicKeyCombine=function(e,t){for(var r=new Array(e.length),i=0;i=0||r.cmp(f.n)>=0)throw new Error(s.ECDSA_SIGNATURE_PARSE_FAIL);var i=n.from(e);return 1===r.cmp(u.nh)&&f.n.sub(r).toArrayLike(n,"be",32).copy(i,32),i},t.signatureExport=function(e){var t=e.slice(0,32),r=e.slice(32,64);if(new o(t).cmp(f.n)>=0||new o(r).cmp(f.n)>=0)throw new Error(s.ECDSA_SIGNATURE_PARSE_FAIL);return{r:t,s:r}},t.signatureImport=function(e){var t=new o(e.r);t.cmp(f.n)>=0&&(t=new o(0));var r=new o(e.s);return r.cmp(f.n)>=0&&(r=new o(0)),n.concat([t.toArrayLike(n,"be",32),r.toArrayLike(n,"be",32)])},t.sign=function(e,t,r,i){if("function"==typeof r){var a=r;r=function(r){var u=a(e,t,null,i,r);if(!n.isBuffer(u)||32!==u.length)throw new Error(s.ECDSA_SIGN_FAIL);return new o(u)}}var c=new o(t);if(c.cmp(f.n)>=0||c.isZero())throw new Error(s.ECDSA_SIGN_FAIL);var h=u.sign(e,t,{canonical:!0,k:r,pers:i});return{signature:n.concat([h.r.toArrayLike(n,"be",32),h.s.toArrayLike(n,"be",32)]),recovery:h.recoveryParam}},t.verify=function(e,t,r){var n={r:t.slice(0,32),s:t.slice(32,64)},i=new o(n.r),a=new o(n.s);if(i.cmp(f.n)>=0||a.cmp(f.n)>=0)throw new Error(s.ECDSA_SIGNATURE_PARSE_FAIL);if(1===a.cmp(u.nh)||i.isZero()||a.isZero())return!1;var h=c(r);if(null===h)throw new Error(s.EC_PUBLIC_KEY_PARSE_FAIL);return u.verify(e,n,{x:h.pub.x,y:h.pub.y})},t.recover=function(e,t,r,i){var a={r:t.slice(0,32),s:t.slice(32,64)},c=new o(a.r),h=new o(a.s);if(c.cmp(f.n)>=0||h.cmp(f.n)>=0)throw new Error(s.ECDSA_SIGNATURE_PARSE_FAIL);try{if(c.isZero()||h.isZero())throw new Error;var d=u.recoverPubKey(e,a,r);return n.from(d.encode(!0,i))}catch(e){throw new Error(s.ECDSA_RECOVER_FAIL)}},t.ecdh=function(e,r){var n=t.ecdhUnsafe(e,r,!0);return i("sha256").update(n).digest()},t.ecdhUnsafe=function(e,t,r){var i=c(e);if(null===i)throw new Error(s.EC_PUBLIC_KEY_PARSE_FAIL);var a=new o(t);if(a.cmp(f.n)>=0||a.isZero())throw new Error(s.ECDH_FAIL);return n.from(i.pub.mul(a).encode(!0,r))}},function(e,t,r){(function(e,n){var i=/%[sdj%]/g;t.format=function(e){if(!g(e)){for(var t=[],r=0;r=o)return e;switch(e){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 e}}),u=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&t._extend(n,r),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),c(n,e,n.depth)}function u(e,t){var r=s.styles[t];return r?"["+s.colors[r][0]+"m"+e+"["+s.colors[r][1]+"m":e}function f(e,t){return e}function c(e,r,n){if(e.customInspect&&r&&M(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return g(i)||(i=c(e,i,n)),i}var o=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(g(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(m(t))return e.stylize(""+t,"number");if(p(t))return e.stylize(""+t,"boolean");if(b(t))return e.stylize("null","null")}(e,r);if(o)return o;var a=Object.keys(r),s=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),S(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return h(r);if(0===a.length){if(M(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(y(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(_(r))return e.stylize(Date.prototype.toString.call(r),"date");if(S(r))return h(r)}var f,w="",A=!1,x=["{","}"];(l(r)&&(A=!0,x=["[","]"]),M(r))&&(w=" [Function"+(r.name?": "+r.name:"")+"]");return y(r)&&(w=" "+RegExp.prototype.toString.call(r)),_(r)&&(w=" "+Date.prototype.toUTCString.call(r)),S(r)&&(w=" "+h(r)),0!==a.length||A&&0!=r.length?n<0?y(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),f=A?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(f,w,x)):x[0]+w+x[1]}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),k(n,i)||(a="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=b(r)?c(e,u.value,null):c(e,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),v(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=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function l(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function b(e){return null===e}function m(e){return"number"==typeof e}function g(e){return"string"==typeof e}function v(e){return void 0===e}function y(e){return w(e)&&"[object RegExp]"===A(e)}function w(e){return"object"==typeof e&&null!==e}function _(e){return w(e)&&"[object Date]"===A(e)}function S(e){return w(e)&&("[object Error]"===A(e)||e instanceof Error)}function M(e){return"function"==typeof e}function A(e){return Object.prototype.toString.call(e)}function x(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(v(o)&&(o=n.env.NODE_DEBUG||""),e=e.toUpperCase(),!a[e])if(new RegExp("\\b"+e+"\\b","i").test(o)){var r=n.pid;a[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else a[e]=function(){};return a[e]},t.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"},t.isArray=l,t.isBoolean=p,t.isNull=b,t.isNullOrUndefined=function(e){return null==e},t.isNumber=m,t.isString=g,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=v,t.isRegExp=y,t.isObject=w,t.isDate=_,t.isError=S,t.isFunction=M,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(364);var E=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function k(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",function(){var e=new Date,t=[x(e.getHours()),x(e.getMinutes()),x(e.getSeconds())].join(":");return[e.getDate(),E[e.getMonth()],t].join(" ")}(),t.format.apply(t,arguments))},t.inherits=r(1),t._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(this,r(7),r(15))},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t,r){"use strict";(function(t){var n=r(110),i=r(109);function o(e){var t=e;if("string"!=typeof t)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof t+", while padToEven.");return t.length%2&&(t="0"+t),t}function a(e){return"0x"+e.toString(16)}e.exports={arrayContainsArray:function(e,t,r){if(!0!==Array.isArray(e))throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof e+"'");if(!0!==Array.isArray(t))throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof t+"'");return t[Boolean(r)?"some":"every"](function(t){return e.indexOf(t)>=0})},intToBuffer:function(e){var r=a(e);return new t(o(r.slice(2)),"hex")},getBinarySize:function(e){if("string"!=typeof e)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof e+"'.");return t.byteLength(e,"utf8")},isHexPrefixed:n,stripHexPrefix:i,padToEven:o,intToHex:a,fromAscii:function(e){for(var t="",r=0;r=2&&"0x"===e.slice(0,2)?e.slice(2):e}(e),"hex"),r]).toString("hex"),i=a.enc.Hex.parse(n);return"0x"+a.SHA3(i,{outputLength:256}).toString(a.enc.Hex).slice(24)}e.exports={_encodeFunctionTxData:u,_getTypesFromAbi:f,functionTx:function(e,t,r,i){var o=u(t,f(e,t),r),a={};return a.to=s(i.to),a.gasPrice=s(i.gasPrice),a.gasLimit=s(i.gasLimit),a.nonce=s(i.nonce),a.data=s(o),a.value=s(i.value),"0x"+new n(a).serialize().toString("hex")},createdContractAddress:c,createContractTx:function(e,t){var r={};r.to=s(t.to),r.gasPrice=s(t.gasPrice),r.gasLimit=s(t.gasLimit),r.nonce=s(t.nonce),r.data=s(t.data),r.value=s(t.value);var i=c(e,t.nonce);return{tx:"0x"+new n(r).serialize().toString("hex"),addr:i}},valueTx:function(e){var t={};return t.to=s(e.to),t.gasPrice=s(e.gasPrice),t.gasLimit=s(e.gasLimit),t.nonce=s(e.nonce),t.value=s(e.value),"0x"+new n(t).serialize().toString("hex")}}}).call(this,r(0).Buffer)},function(e,t,r){var n=r(21),i=r(395),o=r(396),a=r(397),s=r(398),u=r(399),f=r(400),c=r(401),h=r(402),d=r(403),l=function(e,t){return e.isDynamicType(t)||e.isDynamicArray(t)},p=function(e){this._types=e};p.prototype._requireType=function(e){var t=this._types.filter(function(t){return t.isType(e)})[0];if(!t)throw Error("invalid solidity type!: "+e);return t},p.prototype.encodeParam=function(e,t){return this.encodeParams([e],[t])},p.prototype.encodeParams=function(e,t){var r=this.getSolidityTypes(e),n=r.map(function(r,n){return r.encode(t[n],e[n])}),i=r.reduce(function(t,n,i){var o=n.staticPartLength(e[i]),a=32*Math.floor((o+31)/32);return t+(l(r[i],e[i])?32:a)},0);return this.encodeMultiWithOffset(e,r,n,i)},p.prototype.encodeMultiWithOffset=function(e,t,r,i){var o="",a=this;return e.forEach(function(s,u){if(l(t[u],e[u])){o+=n.formatInputInt(i).encode();var f=a.encodeWithOffset(e[u],t[u],r[u],i);i+=f.length/2}else o+=a.encodeWithOffset(e[u],t[u],r[u],i)}),e.forEach(function(n,s){if(l(t[s],e[s])){var u=a.encodeWithOffset(e[s],t[s],r[s],i);i+=u.length/2,o+=u}}),o},p.prototype.encodeWithOffset=function(e,t,r,i){var o=1,a=2,s=3,u=t.isDynamicArray(e)?o:t.isStaticArray(e)?a:s;if(u!==s){var f=t.nestedName(e),c=t.staticPartLength(f),h=u===o?r[0]:"";if(t.isDynamicArray(f))for(var d=u===o?2:0,l=0;l2&&"0x"===e.substr(0,2)&&(e=e.substr(2)),e=n.enc.Hex.parse(e)),i(e,{outputLength:256}).toString()}},function(e,t,r){e.exports=function(e){return function(){if("function"==typeof ArrayBuffer){var t=e.lib.WordArray,r=t.init;(t.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var t=e.byteLength,n=[],i=0;i>>2]|=e[i]<<24-i%4*8;r.call(this,n,t)}else r.apply(this,arguments)}).prototype=t}}(),e.lib.WordArray}(r(4))},function(e,t,r){e.exports=function(e){return function(){var t=e,r=t.lib.WordArray,n=t.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i>>1]|=e.charCodeAt(i)<<16-i%2*16;return r.create(n,2*t)}},n.Utf16LE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o>>2]>>>16-o%4*8&65535);n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,n=[],o=0;o>>1]|=i(e.charCodeAt(o)<<16-o%2*16);return r.create(n,2*t)}}}(),e.enc.Utf16}(r(4))},function(e,t,r){e.exports=function(e){return function(){var t=e,r=t.lib.WordArray,n=t.algo,i=n.SHA256,o=n.SHA224=i.extend({_doReset:function(){this._hash=new r.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=i._doFinalize.call(this);return e.sigBytes-=4,e}});t.SHA224=i._createHelper(o),t.HmacSHA224=i._createHmacHelper(o)}(),e.SHA224}(r(4),r(168))},function(e,t,r){e.exports=function(e){return function(){var t=e,r=t.x64,n=r.Word,i=r.WordArray,o=t.algo,a=o.SHA512,s=o.SHA384=a.extend({_doReset:function(){this._hash=new i.init([new n.init(3418070365,3238371032),new n.init(1654270250,914150663),new n.init(2438529370,812702999),new n.init(355462360,4144912697),new n.init(1731405415,4290775857),new n.init(2394180231,1750603025),new n.init(3675008525,1694076839),new n.init(1203062813,3204075428)])},_doFinalize:function(){var e=a._doFinalize.call(this);return e.sigBytes-=16,e}});t.SHA384=a._createHelper(s),t.HmacSHA384=a._createHmacHelper(s)}(),e.SHA384}(r(4),r(74),r(169))},function(e,t,r){e.exports=function(e){ /** @preserve (c) 2012 by Cédric Mesnil. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ return function(t){var r=e,n=r.lib,i=n.WordArray,o=n.Hasher,a=r.algo,s=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),u=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),f=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),c=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=i.create([0,1518500249,1859775393,2400959708,2840853838]),d=i.create([1352829926,1548603684,1836072691,2053994217,0]),l=a.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,a,l,w,_,S,M,A,x,E,k,I=this._hash.words,P=h.words,B=d.words,T=s.words,O=u.words,R=f.words,N=c.words;for(S=o=I[0],M=a=I[1],A=l=I[2],x=w=I[3],E=_=I[4],r=0;r<80;r+=1)k=o+e[t+T[r]]|0,k+=r<16?p(a,l,w)+P[0]:r<32?b(a,l,w)+P[1]:r<48?m(a,l,w)+P[2]:r<64?g(a,l,w)+P[3]:v(a,l,w)+P[4],k=(k=y(k|=0,R[r]))+_|0,o=_,_=w,w=y(l,10),l=a,a=k,k=S+e[t+O[r]]|0,k+=r<16?v(M,A,x)+B[0]:r<32?g(M,A,x)+B[1]:r<48?m(M,A,x)+B[2]:r<64?b(M,A,x)+B[3]:p(M,A,x)+B[4],k=(k=y(k|=0,N[r]))+E|0,S=E,E=x,x=y(A,10),A=M,M=k;k=I[1]+l+x|0,I[1]=I[2]+w+E|0,I[2]=I[3]+_+S|0,I[3]=I[4]+o+M|0,I[4]=I[0]+a+A|0,I[0]=k},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,o=i.words,a=0;a<5;a++){var s=o[a];o[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return i},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function p(e,t,r){return e^t^r}function b(e,t,r){return e&t|~e&r}function m(e,t,r){return(e|~t)^r}function g(e,t,r){return e&r|t&~r}function v(e,t,r){return e^(t|~r)}function y(e,t){return e<>>32-t}r.RIPEMD160=o._createHelper(l),r.HmacRIPEMD160=o._createHmacHelper(l)}(Math),e.RIPEMD160}(r(4))},function(e,t,r){e.exports=function(e){return function(){var t=e,r=t.lib,n=r.Base,i=r.WordArray,o=t.algo,a=o.SHA1,s=o.HMAC,u=o.PBKDF2=n.extend({cfg:n.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=s.create(r.hasher,e),o=i.create(),a=i.create([1]),u=o.words,f=a.words,c=r.keySize,h=r.iterations;u.length>24&255)){var t=e>>16&255,r=e>>8&255,n=255&e;255===t?(t=0,255===r?(r=0,255===n?n=0:++n):++r):++t,e=0,e+=t<<16,e+=r<<8,e+=n}else e+=1<<24;return e}var n=t.Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize,o=this._iv,a=this._counter;o&&(a=this._counter=o.slice(0),this._iv=void 0),function(e){0===(e[0]=r(e[0]))&&(e[1]=r(e[1]))}(a);var s=a.slice(0);n.encryptBlock(s,0);for(var u=0;u>>2]|=i<<24-o%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923}(r(4),r(10))},function(e,t,r){e.exports=function(e){return e.pad.Iso10126={pad:function(t,r){var n=4*r,i=n-t.sigBytes%n;t.concat(e.lib.WordArray.random(i-1)).concat(e.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Iso10126}(r(4),r(10))},function(e,t,r){e.exports=function(e){return e.pad.Iso97971={pad:function(t,r){t.concat(e.lib.WordArray.create([2147483648],1)),e.pad.ZeroPadding.pad(t,r)},unpad:function(t){e.pad.ZeroPadding.unpad(t),t.sigBytes--}},e.pad.Iso97971}(r(4),r(10))},function(e,t,r){e.exports=function(e){return e.pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){for(var t=e.words,r=e.sigBytes-1;!(t[r>>>2]>>>24-r%4*8&255);)r--;e.sigBytes=r+1}},e.pad.ZeroPadding}(r(4),r(10))},function(e,t,r){e.exports=function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding}(r(4),r(10))},function(e,t,r){e.exports=function(e){return function(t){var r=e,n=r.lib.CipherParams,i=r.enc.Hex;r.format.Hex={stringify:function(e){return e.ciphertext.toString(i)},parse:function(e){var t=i.parse(e);return n.create({ciphertext:t})}}}(),e.format.Hex}(r(4),r(10))},function(e,t,r){e.exports=function(e){return function(){var t=e,r=t.lib.BlockCipher,n=t.algo,i=[],o=[],a=[],s=[],u=[],f=[],c=[],h=[],d=[],l=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var r=0,n=0;for(t=0;t<256;t++){var p=n^n<<1^n<<2^n<<3^n<<4;p=p>>>8^255&p^99,i[r]=p,o[p]=r;var b=e[r],m=e[b],g=e[m],v=257*e[p]^16843008*p;a[r]=v<<24|v>>>8,s[r]=v<<16|v>>>16,u[r]=v<<8|v>>>24,f[r]=v,v=16843009*g^65537*m^257*b^16843008*r,c[p]=v<<24|v>>>8,h[p]=v<<16|v>>>16,d[p]=v<<8|v>>>24,l[p]=v,r?(r=b^e[e[e[g^b]]],n^=e[e[n]]):r=n=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],b=n.AES=r.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,n=4*((this._nRounds=r+6)+1),o=this._keySchedule=[],a=0;a6&&a%r==4&&(s=i[s>>>24]<<24|i[s>>>16&255]<<16|i[s>>>8&255]<<8|i[255&s]):(s=i[(s=s<<8|s>>>24)>>>24]<<24|i[s>>>16&255]<<16|i[s>>>8&255]<<8|i[255&s],s^=p[a/r|0]<<24),o[a]=o[a-r]^s}for(var u=this._invKeySchedule=[],f=0;f>>24]]^h[i[s>>>16&255]]^d[i[s>>>8&255]]^l[i[255&s]]}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,s,u,f,i)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,c,h,d,l,o),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,i,o,a,s){for(var u=this._nRounds,f=e[t]^r[0],c=e[t+1]^r[1],h=e[t+2]^r[2],d=e[t+3]^r[3],l=4,p=1;p>>24]^i[c>>>16&255]^o[h>>>8&255]^a[255&d]^r[l++],m=n[c>>>24]^i[h>>>16&255]^o[d>>>8&255]^a[255&f]^r[l++],g=n[h>>>24]^i[d>>>16&255]^o[f>>>8&255]^a[255&c]^r[l++],v=n[d>>>24]^i[f>>>16&255]^o[c>>>8&255]^a[255&h]^r[l++];f=b,c=m,h=g,d=v}b=(s[f>>>24]<<24|s[c>>>16&255]<<16|s[h>>>8&255]<<8|s[255&d])^r[l++],m=(s[c>>>24]<<24|s[h>>>16&255]<<16|s[d>>>8&255]<<8|s[255&f])^r[l++],g=(s[h>>>24]<<24|s[d>>>16&255]<<16|s[f>>>8&255]<<8|s[255&c])^r[l++],v=(s[d>>>24]<<24|s[f>>>16&255]<<16|s[c>>>8&255]<<8|s[255&h])^r[l++],e[t]=b,e[t+1]=m,e[t+2]=g,e[t+3]=v},keySize:8});t.AES=r._createHelper(b)}(),e.AES}(r(4),r(49),r(50),r(51),r(10))},function(e,t,r){e.exports=function(e){return function(){var t=e,r=t.lib,n=r.WordArray,i=r.BlockCipher,o=t.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],f=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],c=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=o.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var n=a[r]-1;t[r]=e[n>>>5]>>>31-n%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){var f=i[o]=[],c=u[o];for(r=0;r<24;r++)f[r/6|0]|=t[(s[r]-1+c)%28]<<31-r%6,f[4+(r/6|0)]|=t[28+(s[r+24]-1+c)%28]<<31-r%6;for(f[0]=f[0]<<1|f[0]>>>31,r=1;r<7;r++)f[r]=f[r]>>>4*(r-1)+3;f[7]=f[7]<<5|f[7]>>>27}var h=this._invSubKeys=[];for(r=0;r<16;r++)h[r]=i[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,r){this._lBlock=e[t],this._rBlock=e[t+1],d.call(this,4,252645135),d.call(this,16,65535),l.call(this,2,858993459),l.call(this,8,16711935),d.call(this,1,1431655765);for(var n=0;n<16;n++){for(var i=r[n],o=this._lBlock,a=this._rBlock,s=0,u=0;u<8;u++)s|=f[u][((a^i[u])&c[u])>>>0];this._lBlock=a,this._rBlock=o^s}var h=this._lBlock;this._lBlock=this._rBlock,this._rBlock=h,d.call(this,1,1431655765),l.call(this,8,16711935),l.call(this,2,858993459),d.call(this,16,65535),d.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function d(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<>>2]>>>24-a%4*8&255;o=(o+n[i]+s)%256;var u=n[i];n[i]=n[o],n[o]=u}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var e=this._S,t=this._i,r=this._j,n=0,i=0;i<4;i++){r=(r+e[t=(t+1)%256])%256;var o=e[t];e[t]=e[r],e[r]=o,n|=e[(e[t]+e[r])%256]<<24-8*i}return this._i=t,this._j=r,n}t.RC4=r._createHelper(i);var a=n.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)o.call(this)}});t.RC4Drop=r._createHelper(a)}(),e.RC4}(r(4),r(49),r(50),r(51),r(10))},function(e,t,r){e.exports=function(e){return function(){var t=e,r=t.lib.StreamCipher,n=[],i=[],o=[],a=t.algo.Rabbit=r.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=0;r<4;r++)e[r]=16711935&(e[r]<<8|e[r]>>>24)|4278255360&(e[r]<<24|e[r]>>>8);var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,r=0;r<4;r++)s.call(this);for(r=0;r<8;r++)i[r]^=n[r+4&7];if(t){var o=t.words,a=o[0],u=o[1],f=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),c=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8),h=f>>>16|4294901760&c,d=c<<16|65535&f;for(i[0]^=f,i[1]^=h,i[2]^=c,i[3]^=d,i[4]^=f,i[5]^=h,i[6]^=c,i[7]^=d,r=0;r<4;r++)s.call(this)}},_doProcessBlock:function(e,t){var r=this._X;s.call(this),n[0]=r[0]^r[5]>>>16^r[3]<<16,n[1]=r[2]^r[7]>>>16^r[5]<<16,n[2]=r[4]^r[1]>>>16^r[7]<<16,n[3]=r[6]^r[3]>>>16^r[1]<<16;for(var i=0;i<4;i++)n[i]=16711935&(n[i]<<8|n[i]>>>24)|4278255360&(n[i]<<24|n[i]>>>8),e[t+i]^=n[i]},blockSize:4,ivSize:2});function s(){for(var e=this._X,t=this._C,r=0;r<8;r++)i[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],a=65535&n,s=n>>>16,u=((a*a>>>17)+a*s>>>15)+s*s,f=((4294901760&n)*n|0)+((65535&n)*n|0);o[r]=u^f}e[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,e[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,e[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,e[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,e[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,e[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,e[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,e[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}t.Rabbit=r._createHelper(a)}(),e.Rabbit}(r(4),r(49),r(50),r(51),r(10))},function(e,t,r){e.exports=function(e){return function(){var t=e,r=t.lib.StreamCipher,n=[],i=[],o=[],a=t.algo.RabbitLegacy=r.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)s.call(this);for(i=0;i<8;i++)n[i]^=r[i+4&7];if(t){var o=t.words,a=o[0],u=o[1],f=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),c=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8),h=f>>>16|4294901760&c,d=c<<16|65535&f;for(n[0]^=f,n[1]^=h,n[2]^=c,n[3]^=d,n[4]^=f,n[5]^=h,n[6]^=c,n[7]^=d,i=0;i<4;i++)s.call(this)}},_doProcessBlock:function(e,t){var r=this._X;s.call(this),n[0]=r[0]^r[5]>>>16^r[3]<<16,n[1]=r[2]^r[7]>>>16^r[5]<<16,n[2]=r[4]^r[1]>>>16^r[7]<<16,n[3]=r[6]^r[3]>>>16^r[1]<<16;for(var i=0;i<4;i++)n[i]=16711935&(n[i]<<8|n[i]>>>24)|4278255360&(n[i]<<24|n[i]>>>8),e[t+i]^=n[i]},blockSize:4,ivSize:2});function s(){for(var e=this._X,t=this._C,r=0;r<8;r++)i[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],a=65535&n,s=n>>>16,u=((a*a>>>17)+a*s>>>15)+s*s,f=((4294901760&n)*n|0)+((65535&n)*n|0);o[r]=u^f}e[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,e[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,e[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,e[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,e[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,e[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,e[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,e[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}t.RabbitLegacy=r._createHelper(a)}(),e.RabbitLegacy}(r(4),r(49),r(50),r(51),r(10))},function(e,t,r){(function(e,n){var i;/*! https://mths.be/utf8js v2.1.2 by @mathias */!function(o){var a=t,s=(e&&e.exports,"object"==typeof n&&n);s.global!==s&&s.window;var u,f,c,h=String.fromCharCode;function d(e){for(var t,r,n=[],i=0,o=e.length;i=55296&&t<=56319&&i=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function p(e,t){return h(e>>t&63|128)}function b(e){if(0==(4294967168&e))return h(e);var t="";return 0==(4294965248&e)?t=h(e>>6&31|192):0==(4294901760&e)?(l(e),t=h(e>>12&15|224),t+=p(e,6)):0==(4292870144&e)&&(t=h(e>>18&7|240),t+=p(e,12),t+=p(e,6)),t+=h(63&e|128)}function m(){if(c>=f)throw Error("Invalid byte index");var e=255&u[c];if(c++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function g(){var e,t;if(c>f)throw Error("Invalid byte index");if(c==f)return!1;if(e=255&u[c],c++,0==(128&e))return e;if(192==(224&e)){if((t=(31&e)<<6|m())>=128)return t;throw Error("Invalid continuation byte")}if(224==(240&e)){if((t=(15&e)<<12|m()<<6|m())>=2048)return l(t),t;throw Error("Invalid continuation byte")}if(240==(248&e)&&(t=(7&e)<<18|m()<<12|m()<<6|m())>=65536&&t<=1114111)return t;throw Error("Invalid UTF-8 detected")}var v={version:"2.1.2",encode:function(e){for(var t=d(e),r=t.length,n=-1,i="";++n65535&&(i+=h((t-=65536)>>>10&1023|55296),t=56320|1023&t),i+=h(t);return i}(r)}};void 0===(i=function(){return v}.call(t,r,t,e))||(e.exports=i)}()}).call(this,r(24)(e),r(7))},function(e,t,r){var n=r(99);e.exports={ETH_PADDING:32,ETH_SIGNATURE_LENGTH:4,ETH_UNITS:["wei","kwei","Mwei","Gwei","szabo","finney","femtoether","picoether","nanoether","microether","milliether","nano","micro","milli","ether","grand","Mether","Gether","Tether","Pether","Eether","Zether","Yether","Nether","Dether","Vether","Uether"],ETH_BIGNUMBER_ROUNDING_MODE:{ROUNDING_MODE:n.ROUND_DOWN},ETH_POLLING_TIMEOUT:500,defaultBlock:"latest",defaultAccount:void 0}},function(e,t,r){var n=r(21),i=r(29),o=function(){this._inputFormatter=n.formatInputInt,this._outputFormatter=n.formatOutputAddress};(o.prototype=new i({})).constructor=o,o.prototype.isType=function(e){return!!e.match(/address(\[([0-9]*)\])?/)},e.exports=o},function(e,t,r){var n=r(21),i=r(29),o=function(){this._inputFormatter=n.formatInputBool,this._outputFormatter=n.formatOutputBool};(o.prototype=new i({})).constructor=o,o.prototype.isType=function(e){return!!e.match(/^bool(\[([0-9]*)\])*$/)},e.exports=o},function(e,t,r){var n=r(21),i=r(29),o=function(){this._inputFormatter=n.formatInputInt,this._outputFormatter=n.formatOutputInt};(o.prototype=new i({})).constructor=o,o.prototype.isType=function(e){return!!e.match(/^int([0-9]*)?(\[([0-9]*)\])*$/)},e.exports=o},function(e,t,r){var n=r(21),i=r(29),o=function(){this._inputFormatter=n.formatInputInt,this._outputFormatter=n.formatOutputUInt};(o.prototype=new i({})).constructor=o,o.prototype.isType=function(e){return!!e.match(/^uint([0-9]*)?(\[([0-9]*)\])*$/)},e.exports=o},function(e,t,r){var n=r(21),i=r(29),o=function(){this._inputFormatter=n.formatInputDynamicBytes,this._outputFormatter=n.formatOutputDynamicBytes};(o.prototype=new i({})).constructor=o,o.prototype.isType=function(e){return!!e.match(/^bytes(\[([0-9]*)\])*$/)},o.prototype.isDynamicType=function(){return!0},e.exports=o},function(e,t,r){var n=r(21),i=r(29),o=function(){this._inputFormatter=n.formatInputString,this._outputFormatter=n.formatOutputString};(o.prototype=new i({})).constructor=o,o.prototype.isType=function(e){return!!e.match(/^string(\[([0-9]*)\])*$/)},o.prototype.isDynamicType=function(){return!0},e.exports=o},function(e,t,r){var n=r(21),i=r(29),o=function(){this._inputFormatter=n.formatInputReal,this._outputFormatter=n.formatOutputReal};(o.prototype=new i({})).constructor=o,o.prototype.isType=function(e){return!!e.match(/real([0-9]*)?(\[([0-9]*)\])?/)},e.exports=o},function(e,t,r){var n=r(21),i=r(29),o=function(){this._inputFormatter=n.formatInputReal,this._outputFormatter=n.formatOutputUReal};(o.prototype=new i({})).constructor=o,o.prototype.isType=function(e){return!!e.match(/^ureal([0-9]*)?(\[([0-9]*)\])*$/)},e.exports=o},function(e,t,r){var n=r(21),i=r(29),o=function(){this._inputFormatter=n.formatInputBytes,this._outputFormatter=n.formatOutputBytes};(o.prototype=new i({})).constructor=o,o.prototype.isType=function(e){return!!e.match(/^bytes([0-9]{1,})(\[([0-9]*)\])*$/)},e.exports=o},function(e,t){},function(e){e.exports={_from:"elliptic@^3.1.0",_id:"elliptic@3.1.0",_inBundle:!1,_integrity:"sha1-whaC73YnabVqdCAWCRBdoR1fYMw=",_location:"/eth-lightwallet/elliptic",_phantomChildren:{},_requested:{type:"range",registry:!0,raw:"elliptic@^3.1.0",name:"elliptic",escapedName:"elliptic",rawSpec:"^3.1.0",saveSpec:null,fetchSpec:"^3.1.0"},_requiredBy:["/eth-lightwallet"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-3.1.0.tgz",_shasum:"c21682ef762769b56a74201609105da11d5f60cc",_spec:"elliptic@^3.1.0",_where:"E:\\web3\\web3j\\node_modules\\eth-lightwallet",author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},bundleDependencies:!1,dependencies:{"bn.js":"^2.0.3",brorand:"^1.0.1","hash.js":"^1.0.0",inherits:"^2.0.1"},deprecated:!1,description:"EC cryptography",devDependencies:{browserify:"^3.44.2",jscs:"^1.11.3",jshint:"^2.6.0",mocha:"^2.1.0","uglify-js":"^2.4.13"},homepage:"https://github.com/indutny/elliptic",keywords:["EC","Elliptic","curve","Cryptography"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{test:"make lint && mocha --reporter=spec test/*-test.js"},version:"3.1.0"}},function(e,t,r){"use strict";var n=t;function i(e){return 1===e.length?"0"+e:e}function o(e){for(var t="",r=0;r>8,a=255&i;o?r.push(o,a):r.push(a)}return r},n.zero2=i,n.toHex=o,n.encode=function(e,t){return"hex"===t?o(e):e},n.getNAF=function(e,t){for(var r=[],n=1<=0;){var o;if(i.isOdd()){var a=i.andln(n-1);o=a>(n>>1)-1?(n>>1)-a:a,i.isubn(o)}else o=0;r.push(o);for(var s=0!==i.cmpn(0)&&0===i.andln(n-1)?t+1:1,u=1;u0||t.cmpn(-i)>0;){var o,a,s,u=e.andln(3)+n&3,f=t.andln(3)+i&3;3===u&&(u=-1),3===f&&(f=-1),o=0==(1&u)?0:3!=(s=e.andln(7)+n&7)&&5!==s||2!==f?u:-u,r[0].push(o),a=0==(1&f)?0:3!=(s=t.andln(7)+i&7)&&5!==s||2!==u?f:-f,r[1].push(a),2*n===o+1&&(n=1-n),2*i===a+1&&(i=1-i),e.ishrn(1),t.ishrn(1)}return r}},function(e,t,r){"use strict";var n=r(40),i=r(26).utils,o=i.assert;function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this.reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc),r=i.toArray(e.nonce,e.nonceEnc),n=i.toArray(e.pers,e.persEnc);o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=a,a.prototype._init=function(e,t,r){var n=e.concat(t).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(e.concat(r||[])),this.reseed=1},a.prototype.generate=function(e,t,r,n){if(this.reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n),this._update(r));for(var o=[];o.length=u;t--)f=(f<<1)+n[t];a.push(f)}for(var c=this.jpoint(null,null,null),h=this.jpoint(null,null,null),d=i;d>0;d--){for(u=0;u=0;f--){for(t=0;f>=0&&0===a[f];f--)t++;if(f>=0&&t++,u=u.dblp(t),f<0)break;var c=a[f];s(0!==c),u="affine"===e.type?c>0?u.mixedAdd(i[c-1>>1]):u.mixedAdd(i[-c-1>>1].neg()):c>0?u.add(i[c-1>>1]):u.add(i[-c-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,r,n){for(var i=this._wnafT1,s=this._wnafT2,u=this._wnafT3,f=0,c=0;c=1;c-=2){var d=c-1,l=c;if(1===i[d]&&1===i[l]){var p=[t[d],null,null,t[l]];0===t[d].y.cmp(t[l].y)?(p[1]=t[d].add(t[l]),p[2]=t[d].toJ().mixedAdd(t[l].neg())):0===t[d].y.cmp(t[l].y.redNeg())?(p[1]=t[d].toJ().mixedAdd(t[l]),p[2]=t[d].add(t[l].neg())):(p[1]=t[d].toJ().mixedAdd(t[l]),p[2]=t[d].toJ().mixedAdd(t[l].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],m=a(r[d],r[l]);f=Math.max(m[0].length,f),u[d]=new Array(f),u[l]=new Array(f);for(var g=0;g=0;c--){for(var S=0;c>=0;){var M=!0;for(g=0;g=0&&S++,w=w.dblp(S),c<0)break;for(g=0;g0?A=s[g][x-1>>1]:x<0&&(A=s[g][-x-1>>1].neg()),w="affine"===A.type?w.mixedAdd(A):w.add(A))}}for(c=0;c=Math.ceil((e.bitLength()+1)/t.step)},f.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(a=t,s=r),n.sign&&(n=n.neg(),i=i.neg()),a.sign&&(a=a.neg(),s=s.neg()),[{a:n,b:i},{a:a,b:s}]},f.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),f=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:u.add(f).neg()}},f.prototype.pointFromX=function(e,t){(t=new o(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b).redSqrt(),n=r.fromRed().isOdd();return(e&&!n||!e&&n)&&(r=r.redNeg()),this.point(t,r)},f.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},f.prototype._endoWnafMulAdd=function(e,t){for(var r=this._endoWnafT1,n=this._endoWnafT2,i=0;i":""},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).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)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new o(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.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 t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(h,s.BasePoint),f.prototype.jpoint=function(e,t,r){return new h(this,e,t,r)},h.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.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 f=s.redSqr(),c=f.redMul(s),h=n.redMul(f),d=u.redSqr().redIAdd(c).redISub(h).redISub(h),l=u.redMul(h.redISub(d)).redISub(o.redMul(c)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(d,l,p)},h.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).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(),f=u.redMul(a),c=r.redMul(u),h=s.redSqr().redIAdd(f).redISub(c).redISub(c),d=s.redMul(c.redISub(h)).redISub(i.redMul(f)),l=this.z.redMul(a);return this.curve.jpoint(h,d,l)},h.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t,r){"use strict";var n=r(75),i=r(41),o=r(1),a=n.base;function s(e){a.call(this,"mont",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){a.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(t,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(s,a),e.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},o(u,a.BasePoint),s.prototype.point=function(e,t){return new u(this,e,t)},s.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),u=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},u.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.ishrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(e,t,r){"use strict";var n=r(75),i=r(26),o=r(41),a=r(1),s=n.base,u=i.utils.assert;function f(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,s.call(this,"edwards",e),this.a=new o(e.a,16).mod(this.red.m).toRed(this.red),this.c=new o(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new o(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),u(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function c(e,t,r,n,i){s.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new o(t,16),this.y=new o(r,16),this.z=n?new o(n,16):this.curve.one,this.t=i&&new o(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}a(f,s),e.exports=f,f.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},f.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},f.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},f.prototype.pointFromX=function(e,t){(t=new o(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),i=this.c2.redSub(this.a.redMul(r)),a=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=i.redMul(a.redInvm()).redSqrt(),u=s.fromRed().isOdd();return(e&&!u||!e&&u)&&(s=s.redNeg()),this.point(t,s,n.one)},f.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},a(c,s.BasePoint),f.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},f.prototype.point=function(e,t,r,n){return new c(this,e,t,r,n)},c.fromJSON=function(e,t){return new c(e,t[0],t[1],t[2])},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},c.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),u=i.redMul(a),f=o.redMul(s),c=i.redMul(s),h=a.redMul(o);return this.curve.point(u,f,h,c)},c.prototype._projDbl=function(){var e,t,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(f=this.curve._mulA(i)).redAdd(o);if(this.zOne)e=n.redSub(i).redSub(o).redMul(a.redSub(this.curve.two)),t=a.redMul(f.redSub(o)),r=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),u=a.redSub(s).redISub(s);e=n.redSub(i).redISub(o).redMul(u),t=a.redMul(f.redSub(o)),r=a.redMul(u)}}else{var f=i.redAdd(o);s=this.curve._mulC(this.c.redMul(this.z)).redSqr(),u=f.redSub(s).redSub(s);e=this.curve._mulC(n.redISub(f)).redMul(u),t=this.curve._mulC(f).redMul(i.redISub(o)),r=f.redMul(u)}return this.curve.point(e,t,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),u=r.redAdd(t),f=o.redMul(a),c=s.redMul(u),h=o.redMul(u),d=a.redMul(s);return this.curve.point(f,c,d,h)},c.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),f=i.redAdd(s),c=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),h=n.redMul(u).redMul(c);return this.curve.twisted?(t=n.redMul(f).redMul(a.redSub(this.curve._mulA(o))),r=u.redMul(f)):(t=n.redMul(f).redMul(a.redSub(o)),r=this.curve._mulC(u).redMul(f)),this.curve.point(h,t,r)},c.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},c.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2)},c.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},function(e,t,r){"use strict";var n,i=t,o=r(40),a=r(26),s=a.utils.assert;function u(e){"short"===e.type?this.curve=new a.curve.short(e):"edwards"===e.type?this.curve=new a.curve.edwards(e):this.curve=new a.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function f(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new u(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,f("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"]}),f("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"]}),f("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"]}),f("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"0",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),f("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(413)}catch(e){n=void 0}f("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(e,t){e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},function(e,t,r){"use strict";var n=r(41),i=r(26),o=i.utils.assert,a=r(415),s=r(416);function u(e){if(!(this instanceof u))return new u(e);"string"==typeof e&&(o(i.curves.hasOwnProperty(e),"Unknown curve "+e),e=i.curves[e]),e instanceof i.curves.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.shrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=u,u.prototype.keyPair=function(e){return new a(this,e)},u.prototype.keyFromPrivate=function(e,t){return a.fromPrivate(this,e,t)},u.prototype.keyFromPublic=function(e,t){return a.fromPublic(this,e,t)},u.prototype.genKeyPair=function(e){e||(e={});for(var t=new i.hmacDRBG({hash:this.hash,pers:e.pers,entropy:e.entropy||i.rand(this.hash.hmacStrength),nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var a=new n(t.generate(r));if(!(a.cmp(o)>0))return a.iaddn(1),this.keyFromPrivate(a)}},u.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.shrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},u.prototype.sign=function(e,t,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var a=this.n.byteLength(),u=t.getPrivate().toArray(),f=u.length;f<21;f++)u.unshift(0);var c=e.toArray();for(f=c.length;f=0)){var p=this.g.mul(l);if(!p.isInfinity()){var b=p.getX(),m=b.mod(this.n);if(0!==m.cmpn(0)){var g=l.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e)).mod(this.n);if(0!==g.cmpn(0)){o.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g));var v=(p.getY().isOdd()?1:0)|(0!==b.cmp(m)?2:0);return new s({r:m,s:g,recoveryParam:v})}}}}}},u.prototype.verify=function(e,t,r,i){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,i);var o=(t=new s(t,"hex")).r,a=t.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 u=a.invm(this.n),f=u.mul(e).mod(this.n),c=u.mul(o).mod(this.n),h=this.g.mulAdd(f,r.getPublic(),c);return!h.isInfinity()&&0===h.getX().mod(this.n).cmp(o)},u.prototype.recoverPubKey=function(e,t,r,i){o((3&r)===r,"The recovery param is more than two bits"),t=new s(t,i);var a=this.n,u=new n(e),f=t.r,c=t.s,h=1&r,d=r>>1;if(f.cmp(this.curve.p.mod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");f=this.curve.pointFromX(h,f);var l=u.neg().mod(a),p=t.r.invm(a);return f.mul(c).add(this.g.mul(l)).mul(p)},u.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new s(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){if(this.recoverPubKey(e,t,i).eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t,r){"use strict";var n=r(41),i=r(26).utils;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=o,o.fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){if(this.pub||(this.pub=this.ec.g.mul(this.priv)),"string"==typeof e&&(t=e,e=null),!t)return this.pub;for(var r=this.ec.curve.p.byteLength(),n=this.pub.getX().toArray(),o=n.length;o"}},function(e,t,r){"use strict";var n=r(41),i=r(26).utils,o=i.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),null!==e.recoveryParam?this.recoveryParam=e.recoveryParam:this.recoveryParam=null)}e.exports=a,a.prototype._importDER=function(e,t){if((e=i.toArray(e,t)).length<6||48!==e[0]||2!==e[2])return!1;if(1+e[1]>e.length)return!1;var r=e[3];if(r>=128)return!1;if(4+r+2>=e.length)return!1;if(2!==e[4+r])return!1;var o=e[5+r];return!(o>=128)&&(!(4+r+2+o>e.length)&&(this.r=new n(e.slice(4,4+r)),this.s=new n(e.slice(4+r+2,4+r+2+o)),this.recoveryParam=null,!0))},a.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r));var n=[48,t.length+r.length+4,2,t.length];return n=n.concat(t,[2,r.length],r),i.encode(n,e)}},function(e){e.exports={_from:"bitcore-lib@^0.15.0",_id:"bitcore-lib@0.15.0",_inBundle:!1,_integrity:"sha512-AeXLWhiivF6CDFzrABZHT4jJrflyylDWTi32o30rF92HW9msfuKpjzrHtFKYGa9w0kNVv5HABQjCB3OEav4PhQ==",_location:"/bitcore-lib",_phantomChildren:{"bn.js":"4.11.8",brorand:"1.1.0","hash.js":"1.1.5","hmac-drbg":"1.0.1","minimalistic-assert":"1.0.1","minimalistic-crypto-utils":"1.0.1"},_requested:{type:"range",registry:!0,raw:"bitcore-lib@^0.15.0",name:"bitcore-lib",escapedName:"bitcore-lib",rawSpec:"^0.15.0",saveSpec:null,fetchSpec:"^0.15.0"},_requiredBy:["/bitcore-mnemonic","/eth-lightwallet"],_resolved:"https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-0.15.0.tgz",_shasum:"f924be13869f2aab7e04aeec5642ad3359b6cec2",_spec:"bitcore-lib@^0.15.0",_where:"E:\\web3\\web3j\\node_modules\\eth-lightwallet",author:{name:"BitPay",email:"dev@bitpay.com"},browser:{request:"browser-request"},bugs:{url:"https://github.com/bitpay/bitcore-lib/issues"},bundleDependencies:!1,dependencies:{"bn.js":"=4.11.8",bs58:"=4.0.1","buffer-compare":"=1.1.1",elliptic:"=6.4.0",inherits:"=2.0.1",lodash:"=4.17.4"},deprecated:!1,description:"A pure and powerful JavaScript Bitcoin library.",devDependencies:{"bitcore-build":"git+https://github.com/bitpay/bitcore-build.git#d4e8b2b2f1e2c065c3a807dcb6a6250f61d67ab3",brfs:"^1.2.0",chai:"^1.10.0",gulp:"^3.8.10",sinon:"^1.13.0"},homepage:"https://github.com/bitpay/bitcore-lib#readme",keywords:["bitcoin","transaction","address","p2p","ecies","cryptocurrency","blockchain","payment","bip21","bip32","bip37","bip69","bip70","multisig"],license:"MIT",main:"index.js",name:"bitcore-lib",repository:{type:"git",url:"git+https://github.com/bitpay/bitcore-lib.git"},scripts:{build:"gulp",coverage:"gulp coverage",lint:"gulp lint",test:"gulp test"},version:"0.15.0"}},function(e,t,r){"use strict";e.exports=[{name:"InvalidB58Char",message:"Invalid Base58 character: {0} in {1}"},{name:"InvalidB58Checksum",message:"Invalid Base58 checksum for {0}"},{name:"InvalidNetwork",message:"Invalid version for network: got {0}"},{name:"InvalidState",message:"Invalid state: {0}"},{name:"NotImplemented",message:"Function {0} was not implemented yet"},{name:"InvalidNetworkArgument",message:'Invalid network: must be "livenet" or "testnet", got {0}'},{name:"InvalidArgument",message:function(){return"Invalid Argument"+(arguments[0]?": "+arguments[0]:"")+(arguments[1]?" Documentation: http://bitcore.io/"+arguments[1]:"")}},{name:"AbstractMethodInvoked",message:"Abstract Method Invocation: {0}"},{name:"InvalidArgumentType",message:function(){return"Invalid Argument for "+arguments[2]+", expected "+arguments[1]+" but got "+typeof arguments[0]}},{name:"Unit",message:"Internal Error on Unit {0}",errors:[{name:"UnknownCode",message:"Unrecognized unit code: {0}"},{name:"InvalidRate",message:"Invalid exchange rate: {0}"}]},{name:"MerkleBlock",message:"Internal Error on MerkleBlock {0}",errors:[{name:"InvalidMerkleTree",message:"This MerkleBlock contain an invalid Merkle Tree"}]},{name:"Transaction",message:"Internal Error on Transaction {0}",errors:[{name:"Input",message:"Internal Error on Input {0}",errors:[{name:"MissingScript",message:"Need a script to create an input"},{name:"UnsupportedScript",message:"Unsupported input script type: {0}"},{name:"MissingPreviousOutput",message:"No previous output information."}]},{name:"NeedMoreInfo",message:"{0}"},{name:"InvalidSorting",message:"The sorting function provided did not return the change output as one of the array elements"},{name:"InvalidOutputAmountSum",message:"{0}"},{name:"MissingSignatures",message:"Some inputs have not been fully signed"},{name:"InvalidIndex",message:"Invalid index: {0} is not between 0, {1}"},{name:"UnableToVerifySignature",message:"Unable to verify signature: {0}"},{name:"DustOutputs",message:"Dust amount detected in one output"},{name:"InvalidSatoshis",message:"Output satoshis are invalid"},{name:"FeeError",message:"Internal Error on Fee {0}",errors:[{name:"TooSmall",message:"Fee is too small: {0}"},{name:"TooLarge",message:"Fee is too large: {0}"},{name:"Different",message:"Unspent value is different from specified fee: {0}"}]},{name:"ChangeAddressMissing",message:"Change address is missing"},{name:"BlockHeightTooHigh",message:"Block Height can be at most 2^32 -1"},{name:"NLockTimeOutOfRange",message:"Block Height can only be between 0 and 499 999 999"},{name:"LockTimeTooEarly",message:"Lock Time can't be earlier than UNIX date 500 000 000"}]},{name:"Script",message:"Internal Error on Script {0}",errors:[{name:"UnrecognizedAddress",message:"Expected argument {0} to be an address"},{name:"CantDeriveAddress",message:"Can't derive address associated with script {0}, needs to be p2pkh in, p2pkh out, p2sh in, or p2sh out."},{name:"InvalidBuffer",message:"Invalid script buffer: can't parse valid script from given buffer {0}"}]},{name:"HDPrivateKey",message:"Internal Error on HDPrivateKey {0}",errors:[{name:"InvalidDerivationArgument",message:"Invalid derivation argument {0}, expected string, or number and boolean"},{name:"InvalidEntropyArgument",message:"Invalid entropy: must be an hexa string or binary buffer, got {0}",errors:[{name:"TooMuchEntropy",message:'Invalid entropy: more than 512 bits is non standard, got "{0}"'},{name:"NotEnoughEntropy",message:'Invalid entropy: at least 128 bits needed, got "{0}"'}]},{name:"InvalidLength",message:"Invalid length for xprivkey string in {0}"},{name:"InvalidPath",message:"Invalid derivation path: {0}"},{name:"UnrecognizedArgument",message:'Invalid argument: creating a HDPrivateKey requires a string, buffer, json or object, got "{0}"'}]},{name:"HDPublicKey",message:"Internal Error on HDPublicKey {0}",errors:[{name:"ArgumentIsPrivateExtended",message:"Argument is an extended private key: {0}"},{name:"InvalidDerivationArgument",message:"Invalid derivation argument: got {0}"},{name:"InvalidLength",message:'Invalid length for xpubkey: got "{0}"'},{name:"InvalidPath",message:'Invalid derivation path, it should look like: "m/1/100", got "{0}"'},{name:"InvalidIndexCantDeriveHardened",message:"Invalid argument: creating a hardened path requires an HDPrivateKey"},{name:"MustSupplyArgument",message:"Must supply an argument to create a HDPublicKey"},{name:"UnrecognizedArgument",message:"Invalid argument for creation, must be string, json, buffer, or object"}]}]},function(e){e.exports={_from:"elliptic@=6.4.0",_id:"elliptic@6.4.0",_inBundle:!1,_integrity:"sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=",_location:"/bitcore-lib/elliptic",_phantomChildren:{},_requested:{type:"version",registry:!0,raw:"elliptic@=6.4.0",name:"elliptic",escapedName:"elliptic",rawSpec:"=6.4.0",saveSpec:null,fetchSpec:"=6.4.0"},_requiredBy:["/bitcore-lib"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz",_shasum:"cac9af8762c85836187003c8dfe193e5e2eae5df",_spec:"elliptic@=6.4.0",_where:"E:\\web3\\web3j\\node_modules\\bitcore-lib",author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},bundleDependencies:!1,dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},deprecated:!1,description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},files:["lib"],homepage:"https://github.com/indutny/elliptic",keywords:["EC","Elliptic","curve","Cryptography"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.4.0"}},function(e,t,r){"use strict";var n=t,i=r(3),o=r(16),a=r(97);n.assert=o,n.toArray=a.toArray,n.zero2=a.zero2,n.toHex=a.toHex,n.encode=a.encode,n.getNAF=function(e,t){for(var r=[],n=1<=0;){var o;if(i.isOdd()){var a=i.andln(n-1);o=a>(n>>1)-1?(n>>1)-a:a,i.isubn(o)}else o=0;r.push(o);for(var s=0!==i.cmpn(0)&&0===i.andln(n-1)?t+1:1,u=1;u0||t.cmpn(-i)>0;){var o,a,s,u=e.andln(3)+n&3,f=t.andln(3)+i&3;3===u&&(u=-1),3===f&&(f=-1),o=0==(1&u)?0:3!=(s=e.andln(7)+n&7)&&5!==s||2!==f?u:-u,r[0].push(o),a=0==(1&f)?0:3!=(s=t.andln(7)+i&7)&&5!==s||2!==u?f:-f,r[1].push(a),2*n===o+1&&(n=1-n),2*i===a+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new i(e,"hex","le")}},function(e,t,r){"use strict";var n=r(3),i=r(17).utils,o=i.getNAF,a=i.getJSF,s=i.assert;function u(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.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=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);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 f(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(e,t){s(e.precomputed);var r=e._getDoubles(),n=o(t,1),i=(1<=u;t--)f=(f<<1)+n[t];a.push(f)}for(var c=this.jpoint(null,null,null),h=this.jpoint(null,null,null),d=i;d>0;d--){for(u=0;u=0;f--){for(t=0;f>=0&&0===a[f];f--)t++;if(f>=0&&t++,u=u.dblp(t),f<0)break;var c=a[f];s(0!==c),u="affine"===e.type?c>0?u.mixedAdd(i[c-1>>1]):u.mixedAdd(i[-c-1>>1].neg()):c>0?u.add(i[c-1>>1]):u.add(i[-c-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,r,n,i){for(var s=this._wnafT1,u=this._wnafT2,f=this._wnafT3,c=0,h=0;h=1;h-=2){var l=h-1,p=h;if(1===s[l]&&1===s[p]){var b=[t[l],null,null,t[p]];0===t[l].y.cmp(t[p].y)?(b[1]=t[l].add(t[p]),b[2]=t[l].toJ().mixedAdd(t[p].neg())):0===t[l].y.cmp(t[p].y.redNeg())?(b[1]=t[l].toJ().mixedAdd(t[p]),b[2]=t[l].add(t[p].neg())):(b[1]=t[l].toJ().mixedAdd(t[p]),b[2]=t[l].toJ().mixedAdd(t[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],g=a(r[l],r[p]);c=Math.max(g[0].length,c),f[l]=new Array(c),f[p]=new Array(c);for(var v=0;v=0;h--){for(var M=0;h>=0;){var A=!0;for(v=0;v=0&&M++,_=_.dblp(M),h<0)break;for(v=0;v0?x=u[v][E-1>>1]:E<0&&(x=u[v][-E-1>>1].neg()),_="affine"===x.type?_.mixedAdd(x):_.add(x))}}for(h=0;h=Math.ceil((e.bitLength()+1)/t.step)},f.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(a=t,s=r),n.negative&&(n=n.neg(),i=i.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:i},{a:a,b:s}]},f.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),f=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:u.add(f).neg()}},f.prototype.pointFromX=function(e,t){(e=new o(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},f.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},f.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).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)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new o(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},c.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.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 t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(h,s.BasePoint),f.prototype.jpoint=function(e,t,r){return new h(this,e,t,r)},h.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.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 f=s.redSqr(),c=f.redMul(s),h=n.redMul(f),d=u.redSqr().redIAdd(c).redISub(h).redISub(h),l=u.redMul(h.redISub(d)).redISub(o.redMul(c)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(d,l,p)},h.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).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(),f=u.redMul(a),c=r.redMul(u),h=s.redSqr().redIAdd(f).redISub(c).redISub(c),d=s.redMul(c.redISub(h)).redISub(i.redMul(f)),l=this.z.redMul(a);return this.curve.jpoint(h,d,l)},h.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}return!1},h.prototype.inspect=function(){return this.isInfinity()?"":""},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t,r){"use strict";var n=r(77),i=r(3),o=r(31),a=n.base,s=r(17).utils;function u(e){a.call(this,"mont",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function f(e,t,r){a.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(t,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(u,a),e.exports=u,u.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},o(f,a.BasePoint),u.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},u.prototype.point=function(e,t){return new f(this,e,t)},u.prototype.pointFromJSON=function(e){return f.fromJSON(this,e)},f.prototype.precompute=function(){},f.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},f.fromJSON=function(e,t){return new f(e,t[0],t[1]||e.one)},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},f.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},f.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),u=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},f.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},f.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},f.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(e,t,r){"use strict";var n=r(77),i=r(17),o=r(3),a=r(31),s=n.base,u=i.utils.assert;function f(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,s.call(this,"edwards",e),this.a=new o(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new o(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new o(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),u(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function c(e,t,r,n,i){s.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new o(t,16),this.y=new o(r,16),this.z=n?new o(n,16):this.curve.one,this.t=i&&new o(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}a(f,s),e.exports=f,f.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},f.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},f.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},f.prototype.pointFromX=function(e,t){(e=new o(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(i.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var u=s.fromRed().isOdd();return(t&&!u||!t&&u)&&(s=s.redNeg()),this.point(e,s)},f.prototype.pointFromY=function(e,t){(e=new o(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.one),i=r.redMul(this.d).redAdd(this.one),a=n.redMul(i.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},f.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},a(c,s.BasePoint),f.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},f.prototype.point=function(e,t,r,n){return new c(this,e,t,r,n)},c.fromJSON=function(e,t){return new c(e,t[0],t[1],t[2])},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},c.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),u=i.redMul(a),f=o.redMul(s),c=i.redMul(s),h=a.redMul(o);return this.curve.point(u,f,h,c)},c.prototype._projDbl=function(){var e,t,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(f=this.curve._mulA(i)).redAdd(o);if(this.zOne)e=n.redSub(i).redSub(o).redMul(a.redSub(this.curve.two)),t=a.redMul(f.redSub(o)),r=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),u=a.redSub(s).redISub(s);e=n.redSub(i).redISub(o).redMul(u),t=a.redMul(f.redSub(o)),r=a.redMul(u)}}else{var f=i.redAdd(o);s=this.curve._mulC(this.c.redMul(this.z)).redSqr(),u=f.redSub(s).redSub(s);e=this.curve._mulC(n.redISub(f)).redMul(u),t=this.curve._mulC(f).redMul(i.redISub(o)),r=f.redMul(u)}return this.curve.point(e,t,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),u=r.redAdd(t),f=o.redMul(a),c=s.redMul(u),h=o.redMul(u),d=a.redMul(s);return this.curve.point(f,c,d,h)},c.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),f=i.redAdd(s),c=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),h=n.redMul(u).redMul(c);return this.curve.twisted?(t=n.redMul(f).redMul(a.redSub(this.curve._mulA(o))),r=u.redMul(f)):(t=n.redMul(f).redMul(a.redSub(o)),r=this.curve._mulC(u).redMul(f)),this.curve.point(h,t,r)},c.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},c.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},c.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},c.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}return!1},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},function(e,t,r){"use strict";var n,i=t,o=r(40),a=r(17),s=a.utils.assert;function u(e){"short"===e.type?this.curve=new a.curve.short(e):"edwards"===e.type?this.curve=new a.curve.edwards(e):this.curve=new a.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function f(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new u(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,f("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"]}),f("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"]}),f("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"]}),f("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"]}),f("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"]}),f("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"]}),f("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(426)}catch(e){n=void 0}f("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(e,t){e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},function(e,t,r){"use strict";var n=r(3),i=r(151),o=r(17),a=o.utils.assert,s=r(428),u=r(429);function f(e){if(!(this instanceof f))return new f(e);"string"==typeof e&&(a(o.curves.hasOwnProperty(e),"Unknown curve "+e),e=o.curves[e]),e instanceof o.curves.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=f,f.prototype.keyPair=function(e){return new s(this,e)},f.prototype.keyFromPrivate=function(e,t){return s.fromPrivate(this,e,t)},f.prototype.keyFromPublic=function(e,t){return s.fromPublic(this,e,t)},f.prototype.genKeyPair=function(e){e||(e={});for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||o.rand(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),a=this.n.sub(new n(2));;){var s=new n(t.generate(r));if(!(s.cmp(a)>0))return s.iaddn(1),this.keyFromPrivate(s)}},f.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},f.prototype.sign=function(e,t,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var a=this.n.byteLength(),s=t.getPrivate().toArray("be",a),f=e.toArray("be",a),c=new i({hash:this.hash,entropy:s,nonce:f,pers:o.pers,persEnc:o.persEnc||"utf8"}),h=this.n.sub(new n(1)),d=0;;d++){var l=o.k?o.k(d):new n(c.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(h)>=0)){var p=this.g.mul(l);if(!p.isInfinity()){var b=p.getX(),m=b.umod(this.n);if(0!==m.cmpn(0)){var g=l.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e));if(0!==(g=g.umod(this.n)).cmpn(0)){var v=(p.getY().isOdd()?1:0)|(0!==b.cmp(m)?2:0);return o.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),v^=1),new u({r:m,s:g,recoveryParam:v})}}}}}},f.prototype.verify=function(e,t,r,i){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,i);var o=(t=new u(t,"hex")).r,a=t.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,f=a.invm(this.n),c=f.mul(e).umod(this.n),h=f.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),h)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(c,r.getPublic(),h)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},f.prototype.recoverPubKey=function(e,t,r,i){a((3&r)===r,"The recovery param is more than two bits"),t=new u(t,i);var o=this.n,s=new n(e),f=t.r,c=t.s,h=1&r,d=r>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");f=d?this.curve.pointFromX(f.add(this.curve.n),h):this.curve.pointFromX(f,h);var l=t.r.invm(o),p=o.sub(s).mul(l).umod(o),b=c.mul(l).umod(o);return this.g.mulAdd(p,f,b)},f.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new u(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t,r){"use strict";var n=r(3),i=r(17).utils.assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=o,o.fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return""}},function(e,t,r){"use strict";var n=r(3),i=r(17).utils,o=i.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(e,t){var r=e[t.place++];if(!(128&r))return r;for(var n=15&r,i=0,o=0,a=t.place;o>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=a,a.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new function(){this.place=0};if(48!==e[r.place++])return!1;if(s(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var o=s(e,r),a=e.slice(r.place,o+r.place);if(r.place+=o,2!==e[r.place++])return!1;var u=s(e,r);if(e.length!==u+r.place)return!1;var f=e.slice(r.place,u+r.place);return 0===a[0]&&128&a[1]&&(a=a.slice(1)),0===f[0]&&128&f[1]&&(f=f.slice(1)),this.r=new n(a),this.s=new n(f),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=u(t),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];f(n,t.length),(n=n.concat(t)).push(2),f(n,r.length);var o=n.concat(r),a=[48];return f(a,o.length),a=a.concat(o),i.encode(a,e)}},function(e,t,r){"use strict";var n=r(40),i=r(17),o=i.utils,a=o.assert,s=o.parseBytes,u=r(431),f=r(432);function c(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof c))return new c(e);e=i.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=c,c.prototype.sign=function(e,t){e=s(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),u=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},c.prototype.verify=function(e,t,r){e=s(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},c.prototype.hashInt=function(){for(var e=this.hash(),t=0;t>=8;for(;f>0;)o.push(255&f),f>>=8}for(var c=0;e[c]===i&&c0;)n.push(s%r),s=s/r|0}for(var u="",f=0;0===t[f]&&f=0;--c)u+=e[n[c]];return u},decodeUnsafe:s,decode:function(e){var t=s(e);if(t)return t;throw new Error("Non-base"+r+" character")}}}},function(e,t,r){"use strict";(function(t){var n=r(5),i=r(177),o=r(103),a=r(12),s=r(13),u=r(22),f=r(27),c=function e(t){if(!(this instanceof e))return new e(t);t?(this.initialize(),this.set(t)):this.initialize()};c.prototype.verify=function(e,t,o,a,s){var u,f=r(80);if(n.isUndefined(o)&&(o=new f),n.isUndefined(a)&&(a=0),n.isUndefined(s)&&(s=0),this.set({script:e,tx:o,nin:a,flags:s}),0!=(s&c.SCRIPT_VERIFY_SIGPUSHONLY)&&!e.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(!this.evaluate())return!1;s&c.SCRIPT_VERIFY_P2SH&&(u=this.stack.slice());var h=this.stack;if(this.initialize(),this.set({script:t,stack:h,tx:o,nin:a,flags:s}),!this.evaluate())return!1;if(0===this.stack.length)return this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_RESULT",!1;var d=this.stack[this.stack.length-1];if(!c.castToBool(d))return this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK",!1;if(s&c.SCRIPT_VERIFY_P2SH&&t.isScriptHashOut()){if(!e.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(0===u.length)throw new Error("internal error - stack copy empty");var l=u[u.length-1],p=i.fromBuffer(l);return u.pop(),this.initialize(),this.set({script:p,stack:u,tx:o,nin:a,flags:s}),!!this.evaluate()&&(0===u.length?(this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK",!1):!!c.castToBool(u[u.length-1])||(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK",!1))}return!0},e.exports=c,c.prototype.initialize=function(e){this.stack=[],this.altstack=[],this.pc=0,this.pbegincodehash=0,this.nOpCount=0,this.vfExec=[],this.errstr="",this.flags=0},c.prototype.set=function(e){this.script=e.script||this.script,this.tx=e.tx||this.tx,this.nin=void 0!==e.nin?e.nin:this.nin,this.stack=e.stack||this.stack,this.altstack=e.altack||this.altstack,this.pc=void 0!==e.pc?e.pc:this.pc,this.pbegincodehash=void 0!==e.pbegincodehash?e.pbegincodehash:this.pbegincodehash,this.nOpCount=void 0!==e.nOpCount?e.nOpCount:this.nOpCount,this.vfExec=e.vfExec||this.vfExec,this.errstr=e.errstr||this.errstr,this.flags=void 0!==e.flags?e.flags:this.flags},c.true=new t([1]),c.false=new t([]),c.MAX_SCRIPT_ELEMENT_SIZE=520,c.LOCKTIME_THRESHOLD_BN=new a(c.LOCKTIME_THRESHOLD=5e8),c.SCRIPT_VERIFY_NONE=0,c.SCRIPT_VERIFY_P2SH=1,c.SCRIPT_VERIFY_STRICTENC=2,c.SCRIPT_VERIFY_DERSIG=4,c.SCRIPT_VERIFY_LOW_S=8,c.SCRIPT_VERIFY_NULLDUMMY=16,c.SCRIPT_VERIFY_SIGPUSHONLY=32,c.SCRIPT_VERIFY_MINIMALDATA=64,c.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128,c.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512,c.castToBool=function(e){for(var t=0;t1e4)return this.errstr="SCRIPT_ERR_SCRIPT_SIZE",!1;try{for(;this.pc1e3)return this.errstr="SCRIPT_ERR_STACK_SIZE",!1}catch(e){return this.errstr="SCRIPT_ERR_UNKNOWN_ERROR: "+e,!1}return!(this.vfExec.length>0)||(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1)},c.prototype.checkLockTime=function(e){return!!(this.tx.nLockTime=c.LOCKTIME_THRESHOLD&&e.gte(c.LOCKTIME_THRESHOLD_BN))&&(!e.gt(new a(this.tx.nLockTime))&&!!this.tx.inputs[this.nin].isFinal())},c.prototype.step=function(){var e,t,r,h,d,l,p,b,m,g,v,y,w,_,S,M,A,x=0!=(this.flags&c.SCRIPT_VERIFY_MINIMALDATA),E=-1===this.vfExec.indexOf(!1),k=this.script.chunks[this.pc];this.pc++;var I=k.opcodenum;if(n.isUndefined(I))return this.errstr="SCRIPT_ERR_UNDEFINED_OPCODE",!1;if(k.buf&&k.buf.length>c.MAX_SCRIPT_ELEMENT_SIZE)return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;if(I>o.OP_16&&++this.nOpCount>201)return this.errstr="SCRIPT_ERR_OP_COUNT",!1;if(I===o.OP_CAT||I===o.OP_SUBSTR||I===o.OP_LEFT||I===o.OP_RIGHT||I===o.OP_INVERT||I===o.OP_AND||I===o.OP_OR||I===o.OP_XOR||I===o.OP_2MUL||I===o.OP_2DIV||I===o.OP_MUL||I===o.OP_DIV||I===o.OP_MOD||I===o.OP_LSHIFT||I===o.OP_RSHIFT)return this.errstr="SCRIPT_ERR_DISABLED_OPCODE",!1;if(E&&0<=I&&I<=o.OP_PUSHDATA4){if(x&&!this.script.checkMinimalPush(this.pc-1))return this.errstr="SCRIPT_ERR_MINIMALDATA",!1;if(k.buf){if(k.len!==k.buf.length)throw new Error("Length of push value not equal to length of data");this.stack.push(k.buf)}else this.stack.push(c.false)}else if(E||o.OP_IF<=I&&I<=o.OP_ENDIF)switch(I){case o.OP_1NEGATE:case o.OP_1:case o.OP_2:case o.OP_3:case o.OP_4:case o.OP_5:case o.OP_6:case o.OP_7:case o.OP_8:case o.OP_9:case o.OP_10:case o.OP_11:case o.OP_12:case o.OP_13:case o.OP_14:case o.OP_15:case o.OP_16:d=I-(o.OP_1-1),e=new a(d).toScriptNumBuffer(),this.stack.push(e);break;case o.OP_NOP:break;case o.OP_NOP2:case o.OP_CHECKLOCKTIMEVERIFY:if(!(this.flags&c.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)){if(this.flags&c.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var P=a.fromScriptNumBuffer(this.stack[this.stack.length-1],x,5);if(P.lt(new a(0)))return this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if(!this.checkLockTime(P))return this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1;break;case o.OP_NOP1:case o.OP_NOP3:case o.OP_NOP4:case o.OP_NOP5:case o.OP_NOP6:case o.OP_NOP7:case o.OP_NOP8:case o.OP_NOP9:case o.OP_NOP10:if(this.flags&c.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break;case o.OP_IF:case o.OP_NOTIF:if(M=!1,E){if(this.stack.length<1)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;e=this.stack.pop(),M=c.castToBool(e),I===o.OP_NOTIF&&(M=!M)}this.vfExec.push(M);break;case o.OP_ELSE:if(0===this.vfExec.length)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.vfExec[this.vfExec.length-1]=!this.vfExec[this.vfExec.length-1];break;case o.OP_ENDIF:if(0===this.vfExec.length)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.vfExec.pop();break;case o.OP_VERIFY:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(e=this.stack[this.stack.length-1],!(M=c.castToBool(e)))return this.errstr="SCRIPT_ERR_VERIFY",!1;this.stack.pop();break;case o.OP_RETURN:return this.errstr="SCRIPT_ERR_OP_RETURN",!1;case o.OP_TOALTSTACK:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.altstack.push(this.stack.pop());break;case o.OP_FROMALTSTACK:if(this.altstack.length<1)return this.errstr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION",!1;this.stack.push(this.altstack.pop());break;case o.OP_2DROP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop(),this.stack.pop();break;case o.OP_2DUP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;t=this.stack[this.stack.length-2],r=this.stack[this.stack.length-1],this.stack.push(t),this.stack.push(r);break;case o.OP_3DUP:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;t=this.stack[this.stack.length-3],r=this.stack[this.stack.length-2];var B=this.stack[this.stack.length-1];this.stack.push(t),this.stack.push(r),this.stack.push(B);break;case o.OP_2OVER:if(this.stack.length<4)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;t=this.stack[this.stack.length-4],r=this.stack[this.stack.length-3],this.stack.push(t),this.stack.push(r);break;case o.OP_2ROT:if(this.stack.length<6)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;h=this.stack.splice(this.stack.length-6,2),this.stack.push(h[0]),this.stack.push(h[1]);break;case o.OP_2SWAP:if(this.stack.length<4)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;h=this.stack.splice(this.stack.length-4,2),this.stack.push(h[0]),this.stack.push(h[1]);break;case o.OP_IFDUP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;e=this.stack[this.stack.length-1],(M=c.castToBool(e))&&this.stack.push(e);break;case o.OP_DEPTH:e=new a(this.stack.length).toScriptNumBuffer(),this.stack.push(e);break;case o.OP_DROP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop();break;case o.OP_DUP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(this.stack[this.stack.length-1]);break;case o.OP_NIP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,1);break;case o.OP_OVER:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(this.stack[this.stack.length-2]);break;case o.OP_PICK:case o.OP_ROLL:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(e=this.stack[this.stack.length-1],d=(b=a.fromScriptNumBuffer(e,x)).toNumber(),this.stack.pop(),d<0||d>=this.stack.length)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;e=this.stack[this.stack.length-d-1],I===o.OP_ROLL&&this.stack.splice(this.stack.length-d-1,1),this.stack.push(e);break;case o.OP_ROT:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;l=this.stack[this.stack.length-3],p=this.stack[this.stack.length-2];var T=this.stack[this.stack.length-1];this.stack[this.stack.length-3]=p,this.stack[this.stack.length-2]=T,this.stack[this.stack.length-1]=l;break;case o.OP_SWAP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;l=this.stack[this.stack.length-2],p=this.stack[this.stack.length-1],this.stack[this.stack.length-2]=p,this.stack[this.stack.length-1]=l;break;case o.OP_TUCK:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,0,this.stack[this.stack.length-1]);break;case o.OP_SIZE:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;b=new a(this.stack[this.stack.length-1].length),this.stack.push(b.toScriptNumBuffer());break;case o.OP_EQUAL:case o.OP_EQUALVERIFY:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;t=this.stack[this.stack.length-2],r=this.stack[this.stack.length-1];var O=t.toString("hex")===r.toString("hex");if(this.stack.pop(),this.stack.pop(),this.stack.push(O?c.true:c.false),I===o.OP_EQUALVERIFY){if(!O)return this.errstr="SCRIPT_ERR_EQUALVERIFY",!1;this.stack.pop()}break;case o.OP_1ADD:case o.OP_1SUB:case o.OP_NEGATE:case o.OP_ABS:case o.OP_NOT:case o.OP_0NOTEQUAL:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;switch(e=this.stack[this.stack.length-1],b=a.fromScriptNumBuffer(e,x),I){case o.OP_1ADD:b=b.add(a.One);break;case o.OP_1SUB:b=b.sub(a.One);break;case o.OP_NEGATE:b=b.neg();break;case o.OP_ABS:b.cmp(a.Zero)<0&&(b=b.neg());break;case o.OP_NOT:b=new a((0===b.cmp(a.Zero))+0);break;case o.OP_0NOTEQUAL:b=new a((0!==b.cmp(a.Zero))+0)}this.stack.pop(),this.stack.push(b.toScriptNumBuffer());break;case o.OP_ADD:case o.OP_SUB:case o.OP_BOOLAND:case o.OP_BOOLOR:case o.OP_NUMEQUAL:case o.OP_NUMEQUALVERIFY:case o.OP_NUMNOTEQUAL:case o.OP_LESSTHAN:case o.OP_GREATERTHAN:case o.OP_LESSTHANOREQUAL:case o.OP_GREATERTHANOREQUAL:case o.OP_MIN:case o.OP_MAX:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;switch(m=a.fromScriptNumBuffer(this.stack[this.stack.length-2],x),g=a.fromScriptNumBuffer(this.stack[this.stack.length-1],x),b=new a(0),I){case o.OP_ADD:b=m.add(g);break;case o.OP_SUB:b=m.sub(g);break;case o.OP_BOOLAND:b=new a((0!==m.cmp(a.Zero)&&0!==g.cmp(a.Zero))+0);break;case o.OP_BOOLOR:b=new a((0!==m.cmp(a.Zero)||0!==g.cmp(a.Zero))+0);break;case o.OP_NUMEQUAL:case o.OP_NUMEQUALVERIFY:b=new a((0===m.cmp(g))+0);break;case o.OP_NUMNOTEQUAL:b=new a((0!==m.cmp(g))+0);break;case o.OP_LESSTHAN:b=new a((m.cmp(g)<0)+0);break;case o.OP_GREATERTHAN:b=new a((m.cmp(g)>0)+0);break;case o.OP_LESSTHANOREQUAL:b=new a((m.cmp(g)<=0)+0);break;case o.OP_GREATERTHANOREQUAL:b=new a((m.cmp(g)>=0)+0);break;case o.OP_MIN:b=m.cmp(g)<0?m:g;break;case o.OP_MAX:b=m.cmp(g)>0?m:g}if(this.stack.pop(),this.stack.pop(),this.stack.push(b.toScriptNumBuffer()),I===o.OP_NUMEQUALVERIFY){if(!c.castToBool(this.stack[this.stack.length-1]))return this.errstr="SCRIPT_ERR_NUMEQUALVERIFY",!1;this.stack.pop()}break;case o.OP_WITHIN:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;m=a.fromScriptNumBuffer(this.stack[this.stack.length-3],x),g=a.fromScriptNumBuffer(this.stack[this.stack.length-2],x);var R=a.fromScriptNumBuffer(this.stack[this.stack.length-1],x);M=g.cmp(m)<=0&&m.cmp(R)<0,this.stack.pop(),this.stack.pop(),this.stack.pop(),this.stack.push(M?c.true:c.false);break;case o.OP_RIPEMD160:case o.OP_SHA1:case o.OP_SHA256:case o.OP_HASH160:case o.OP_HASH256:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var N;e=this.stack[this.stack.length-1],I===o.OP_RIPEMD160?N=s.ripemd160(e):I===o.OP_SHA1?N=s.sha1(e):I===o.OP_SHA256?N=s.sha256(e):I===o.OP_HASH160?N=s.sha256ripemd160(e):I===o.OP_HASH256&&(N=s.sha256sha256(e)),this.stack.pop(),this.stack.push(N);break;case o.OP_CODESEPARATOR:this.pbegincodehash=this.pc;break;case o.OP_CHECKSIG:case o.OP_CHECKSIGVERIFY:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;v=this.stack[this.stack.length-2],y=this.stack[this.stack.length-1],w=(new i).set({chunks:this.script.chunks.slice(this.pbegincodehash)});var C=(new i).add(v);if(w.findAndDelete(C),!this.checkSignatureEncoding(v)||!this.checkPubkeyEncoding(y))return!1;try{_=u.fromTxFormat(v),S=f.fromBuffer(y,!1),A=this.tx.verifySignature(_,S,this.nin,w)}catch(e){A=!1}if(this.stack.pop(),this.stack.pop(),this.stack.push(A?c.true:c.false),I===o.OP_CHECKSIGVERIFY){if(!A)return this.errstr="SCRIPT_ERR_CHECKSIGVERIFY",!1;this.stack.pop()}break;case o.OP_CHECKMULTISIG:case o.OP_CHECKMULTISIGVERIFY:var L=1;if(this.stack.length20)return this.errstr="SCRIPT_ERR_PUBKEY_COUNT",!1;if(this.nOpCount+=j,this.nOpCount>201)return this.errstr="SCRIPT_ERR_OP_COUNT",!1;var z=++L;if(L+=j,this.stack.lengthj)return this.errstr="SCRIPT_ERR_SIG_COUNT",!1;var U=++L;if(L+=D,this.stack.length0;){if(v=this.stack[this.stack.length-U],y=this.stack[this.stack.length-z],!this.checkSignatureEncoding(v)||!this.checkPubkeyEncoding(y))return!1;var q;try{_=u.fromTxFormat(v),S=f.fromBuffer(y,!1),q=this.tx.verifySignature(_,S,this.nin,w)}catch(e){q=!1}q&&(U++,D--),z++,D>--j&&(A=!1)}for(;L-- >1;)this.stack.pop();if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(this.flags&c.SCRIPT_VERIFY_NULLDUMMY&&this.stack[this.stack.length-1].length)return this.errstr="SCRIPT_ERR_SIG_NULLDUMMY",!1;if(this.stack.pop(),this.stack.push(A?c.true:c.false),I===o.OP_CHECKMULTISIGVERIFY){if(!A)return this.errstr="SCRIPT_ERR_CHECKMULTISIGVERIFY",!1;this.stack.pop()}break;default:return this.errstr="SCRIPT_ERR_BAD_OPCODE",!1}return!0}}).call(this,r(0).Buffer)},function(e,t){e.exports=function(e,t){if("function"==typeof e.compare)return e.compare(t);if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i1;n=Math.floor((n+1)/2)){for(var i=0;i"},d.Values={START_OF_BLOCK:8,NULL_HASH:new t("0000000000000000000000000000000000000000000000000000000000000000","hex")},e.exports=d}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=r(5),i=r(44),o=r(43),a=r(106),s=function(e,t){if(!(this instanceof s))return new s(e,t);if(this.extras={},this.knownParams=t||[],this.address=this.network=this.amount=this.message=null,"string"==typeof e){var r=s.parse(e);r.amount&&(r.amount=this._parseAmount(r.amount)),this._fromObject(r)}else{if("object"!=typeof e)throw new TypeError("Unrecognized data format.");this._fromObject(e)}};s.fromString=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return new s(e)},s.fromObject=function(e){return new s(e)},s.isValid=function(e,t){try{new s(e,t)}catch(e){return!1}return!0},s.parse=function(e){var t=i.parse(e,!0);if("bitcoin:"!==t.protocol)throw new TypeError("Invalid bitcoin URI");var r=/[^:]*:\/?\/?([^?]*)/.exec(e);return t.query.address=r&&r[1]||void 0,t.query},s.Members=["address","amount","message","label","r"],s.prototype._fromObject=function(e){if(!o.isValid(e.address))throw new TypeError("Invalid bitcoin address");for(var t in this.address=new o(e.address),this.network=this.address.network,this.amount=e.amount,e)if("address"!==t&&"amount"!==t){if(/^req-/.exec(t)&&-1===this.knownParams.indexOf(t))throw Error("Unknown required argument "+t);(s.Members.indexOf(t)>-1?this:this.extras)[t]=e[t]}},s.prototype._parseAmount=function(e){if(e=Number(e),isNaN(e))throw new TypeError("Invalid amount");return a.fromBTC(e).toSatoshis()},s.prototype.toObject=s.prototype.toJSON=function(){for(var e={},t=0;t"},e.exports=s},function(e,t,r){"use strict";(function(t){var n=r(76),i=n.crypto.BN,o=r(445),a=n.deps._,s=r(446),u=r(447),f=n.crypto.Hash,c=n.crypto.Random,h=n.util.preconditions,d=function(e,r){if(!(this instanceof d))return new d(e,r);var i,s,f;if(a.isArray(e)&&(r=e,e=null),t.isBuffer(e))f=e;else if(a.isString(e))s=o.nfkd(e);else if(a.isNumber(e))i=e;else if(e)throw new n.errors.InvalidArgument("data","Must be a Buffer, a string or an integer");if(i=i||128,r=r||d._getDictionary(s),s&&!r)throw new u.UnknownWordlist(s);if(r=r||d.Words.ENGLISH,f&&(s=d._entropy2mnemonic(f,r)),s&&!d.isValid(s,r))throw new u.InvalidMnemonic(s);if(i%32!=0||i<128)throw new n.errors.InvalidArgument("ENT","Values must be ENT > 128 and ENT % 32 == 0");s=s||d._mnemonic(i,r),Object.defineProperty(this,"wordlist",{configurable:!1,value:r}),Object.defineProperty(this,"phrase",{configurable:!1,value:s})};d.Words=r(448),d.isValid=function(e,r){if(e=o.nfkd(e),!(r=r||d._getDictionary(e)))return!1;for(var n=e.split(" "),i="",a=0;a"},d._mnemonic=function(e,t){var r=c.getRandomBuffer(e/8);return d._entropy2mnemonic(r,t)},d._entropy2mnemonic=function(e,t){for(var r="",n=0;n>8&255]>n&&(p[t]=i),i},function(e,t,r){return r?e(t,r):new l(t,null)},function(e,t,r){var n;if(t=55296&&e<=56319},l.isLowSurrogate=function(e){return e>=56320&&e<=57343},l.prototype.prepFeature=function(){this.feature||(this.feature=l.fromCharCode(this.codepoint,!0).feature)},l.prototype.toString=function(){if(this.codepoint<65536)return String.fromCharCode(this.codepoint);var e=this.codepoint-65536;return String.fromCharCode(Math.floor(e/1024)+55296,e%1024+56320)},l.prototype.getDecomp=function(){return this.prepFeature(),this.feature[0]||null},l.prototype.isCompatibility=function(){return this.prepFeature(),!!this.feature[1]&&256&this.feature[1]},l.prototype.isExclude=function(){return this.prepFeature(),!!this.feature[1]&&512&this.feature[1]},l.prototype.getCanonicalClass=function(){return this.prepFeature(),this.feature[1]?255&this.feature[1]:0},l.prototype.getComposite=function(e){if(this.prepFeature(),!this.feature[2])return null;var t=this.feature[2][e.codepoint];return t?l.fromCharCode(t):null};var v=function(e){this.str=e,this.cursor=0};v.prototype.next=function(){if(this.str&&this.cursor0;--r){if(this.resBuf[r-1].getCanonicalClass()<=e)break}this.resBuf.splice(r,0,t)}while(0!==e);return this.resBuf.shift()};var _=function(e){this.it=e,this.procBuf=[],this.resBuf=[],this.lastClass=null};_.prototype.next=function(){for(;0===this.resBuf.length;){var e=this.it.next();if(!e){this.resBuf=this.procBuf,this.procBuf=[];break}if(0===this.procBuf.length)this.lastClass=e.getCanonicalClass(),this.procBuf.push(e);else{var t=this.procBuf[0].getComposite(e),r=e.getCanonicalClass();t&&(this.lastClass64*(Math.pow(2,32)-1))throw Error("Requested key length too long");if("string"!=typeof e&&!t.isBuffer(e))throw new TypeError("key must a string or Buffer");if("string"!=typeof r&&!t.isBuffer(r))throw new TypeError("salt must a string or Buffer");"string"==typeof e&&(e=new t(e)),"string"==typeof r&&(r=new t(r));var a=new t(o),s=new t(64),u=new t(64),f=new t(r.length+4),c=Math.ceil(o/64),h=o-64*(c-1);r.copy(f,0,0,r.length);for(var d=1;d<=c;d++){f[r.length+0]=d>>24&255,f[r.length+1]=d>>16&255,f[r.length+2]=d>>8&255,f[r.length+3]=d>>0&255,(s=n.createHmac("sha512",e).update(f).digest()).copy(u,0,0,64);for(var l=1;l