diff --git a/circuits-files/deposit-proving_key.bin b/circuits-files/deposit-proving_key.bin index 4d5a128..556f10b 100644 Binary files a/circuits-files/deposit-proving_key.bin and b/circuits-files/deposit-proving_key.bin differ diff --git a/circuits-files/deposit.wasm b/circuits-files/deposit.wasm index fcbb11b..ef7a680 100644 Binary files a/circuits-files/deposit.wasm and b/circuits-files/deposit.wasm differ diff --git a/circuits-files/withdraw-proving_key.bin b/circuits-files/withdraw-proving_key.bin index b07105f..fa3c193 100644 Binary files a/circuits-files/withdraw-proving_key.bin and b/circuits-files/withdraw-proving_key.bin differ diff --git a/index.html b/index.html index 6590f7c..411e5c1 100644 --- a/index.html +++ b/index.html @@ -88,8 +88,10 @@

Stats

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum +
@@ -174,10 +176,11 @@ - - - - + + + + + diff --git a/index.js b/index.js index 036ee42..4c16872 100644 --- a/index.js +++ b/index.js @@ -2,8 +2,7 @@ var circuit = {}; var provingKey = {}; var witnessCalc = {}; const abi = JSON.parse(`[{"inputs":[{"internalType":"address","name":"_depositVerifierContractAddr","type":"address"},{"internalType":"address","name":"_withdrawVerifierContractAddr","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"_commitment","type":"uint256"},{"internalType":"uint256","name":"_root","type":"uint256"},{"internalType":"uint256[2]","name":"a","type":"uint256[2]"},{"internalType":"uint256[2][2]","name":"b","type":"uint256[2][2]"},{"internalType":"uint256[2]","name":"c","type":"uint256[2]"}],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"getCommitments","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"_address","type":"address"},{"internalType":"uint256","name":"nullifier","type":"uint256"},{"internalType":"uint256[2]","name":"a","type":"uint256[2]"},{"internalType":"uint256[2][2]","name":"b","type":"uint256[2][2]"},{"internalType":"uint256[2]","name":"c","type":"uint256[2]"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]`); -// const miksiAddress = "0x6E77f4bB1356426baD1Bd014d04388eFAc197Fe1"; -const miksiAddress = "0xc9009d9Df413883B6064503FDA93A7A8ab9B7afb"; +const miksiAddress = "0x29DB549Ea98d41e0F28A5aA50ED1D37d62BA8C4B"; function loadCircuit(circuitname) { fetch("circuits-files/"+circuitname+"-proving_key.bin").then( (response) => { @@ -33,7 +32,10 @@ async function deposit(circuitname) { const nullifier = miksi.randBigInt().toString(); // const secret = "1234567890"; // const nullifier = "5678901234"; - const commitments = []; + let res = await miksiContract.methods.getCommitments().call(); + console.log("res", res); + const commitments = res[0]; + console.log("commitments", commitments); // getCommitments from the tree // calculate witness diff --git a/lib/miksi-browser.js b/libs/miksi-browser.js similarity index 99% rename from lib/miksi-browser.js rename to libs/miksi-browser.js index de621ea..cdcaeac 100644 --- a/lib/miksi-browser.js +++ b/libs/miksi-browser.js @@ -58,30 +58,35 @@ module.exports = require('../package.json').version; },{"../package.json":4}],4:[function(require,module,exports){ module.exports={ - "_from": "@web3-js/websocket@^1.0.29", + "_args": [ + [ + "@web3-js/websocket@1.0.30", + "/home/user/git/miksi/miksi-core" + ] + ], + "_from": "@web3-js/websocket@1.0.30", "_id": "@web3-js/websocket@1.0.30", "_inBundle": false, "_integrity": "sha512-fDwrD47MiDrzcJdSeTLF75aCcxVVt8B1N74rA+vh2XCAvFy4tEWJjtnUtj2QG7/zlQ6g9cQ88bZFBxwd9/FmtA==", "_location": "/@web3-js/websocket", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "@web3-js/websocket@^1.0.29", + "raw": "@web3-js/websocket@1.0.30", "name": "@web3-js/websocket", "escapedName": "@web3-js%2fwebsocket", "scope": "@web3-js", - "rawSpec": "^1.0.29", + "rawSpec": "1.0.30", "saveSpec": null, - "fetchSpec": "^1.0.29" + "fetchSpec": "1.0.30" }, "_requiredBy": [ "/web3-providers-ws" ], "_resolved": "https://registry.npmjs.org/@web3-js/websocket/-/websocket-1.0.30.tgz", - "_shasum": "9ea15b7b582cf3bf3e8bc1f4d3d54c0731a87f87", - "_spec": "@web3-js/websocket@^1.0.29", - "_where": "/home/user/git/miksi/miksi-core/node_modules/web3-providers-ws", + "_spec": "1.0.30", + "_where": "/home/user/git/miksi/miksi-core", "author": { "name": "Brian McKelvey", "email": "theturtle32@gmail.com", @@ -91,7 +96,6 @@ module.exports={ "bugs": { "url": "https://github.com/web3-js/WebSocket-Node/issues" }, - "bundleDependencies": false, "config": { "verbose": false }, @@ -109,7 +113,6 @@ module.exports={ "typedarray-to-buffer": "^3.1.5", "yaeti": "^0.0.6" }, - "deprecated": false, "description": "Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.", "devDependencies": { "buffer-equal": "^1.0.0", @@ -27399,21 +27402,27 @@ utils.intFromLE = intFromLE; },{"bn.js":38,"minimalistic-assert":261,"minimalistic-crypto-utils":262}],155:[function(require,module,exports){ module.exports={ - "_from": "elliptic@^6.4.0", + "_args": [ + [ + "elliptic@6.5.2", + "/home/user/git/miksi/miksi-core" + ] + ], + "_from": "elliptic@6.5.2", "_id": "elliptic@6.5.2", "_inBundle": false, "_integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==", "_location": "/elliptic", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "elliptic@^6.4.0", + "raw": "elliptic@6.5.2", "name": "elliptic", "escapedName": "elliptic", - "rawSpec": "^6.4.0", + "rawSpec": "6.5.2", "saveSpec": null, - "fetchSpec": "^6.4.0" + "fetchSpec": "6.5.2" }, "_requiredBy": [ "/browserify-sign", @@ -27424,9 +27433,8 @@ module.exports={ "/web3-utils/eth-lib" ], "_resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", - "_shasum": "05c5678d7173c049d8ca433552224a495d0e3762", - "_spec": "elliptic@^6.4.0", - "_where": "/home/user/git/miksi/miksi-core/node_modules/eth-lib", + "_spec": "6.5.2", + "_where": "/home/user/git/miksi/miksi-core", "author": { "name": "Fedor Indutny", "email": "fedor@indutny.com" @@ -27434,7 +27442,6 @@ module.exports={ "bugs": { "url": "https://github.com/indutny/elliptic/issues" }, - "bundleDependencies": false, "dependencies": { "bn.js": "^4.4.0", "brorand": "^1.0.1", @@ -27444,7 +27451,6 @@ module.exports={ "minimalistic-assert": "^1.0.0", "minimalistic-crypto-utils": "^1.0.0" }, - "deprecated": false, "description": "EC cryptography", "devDependencies": { "brfs": "^1.4.3", @@ -75050,29 +75056,35 @@ module.exports = { }).call(this,{"isBuffer":require("../../is-buffer/index.js")}) },{"../../is-buffer/index.js":247,"bn.js":38,"eth-lib/lib/hash":443,"ethereum-bloom-filters":162,"number-to-bn":265,"underscore":390,"utf8":394}],447:[function(require,module,exports){ module.exports={ - "_from": "web3@^1.2.6", + "_args": [ + [ + "web3@1.2.7", + "/home/user/git/miksi/miksi-core" + ] + ], + "_from": "web3@1.2.7", "_id": "web3@1.2.7", "_inBundle": false, "_integrity": "sha512-jAAJHMfUlTps+jH2li1ckDFEpPrEEriU/ubegSTGRl3KRdNhEqT93+3kd7FHJTn3NgjcyURo2+f7Da1YcZL8Mw==", "_location": "/web3", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "web3@^1.2.6", + "raw": "web3@1.2.7", "name": "web3", "escapedName": "web3", - "rawSpec": "^1.2.6", + "rawSpec": "1.2.7", "saveSpec": null, - "fetchSpec": "^1.2.6" + "fetchSpec": "1.2.7" }, "_requiredBy": [ + "#DEV:/", "/circomlib" ], "_resolved": "https://registry.npmjs.org/web3/-/web3-1.2.7.tgz", - "_shasum": "fcb83571036c1c6f475bc984785982a444e8d78e", - "_spec": "web3@^1.2.6", - "_where": "/home/user/git/miksi/miksi-core/node_modules/circomlib", + "_spec": "1.2.7", + "_where": "/home/user/git/miksi/miksi-core", "author": { "name": "ethereum.org" }, @@ -75105,7 +75117,6 @@ module.exports={ "bugs": { "url": "https://github.com/ethereum/web3.js/issues" }, - "bundleDependencies": false, "dependencies": { "web3-bzz": "1.2.7", "web3-core": "1.2.7", @@ -75115,7 +75126,6 @@ module.exports={ "web3-shh": "1.2.7", "web3-utils": "1.2.7" }, - "deprecated": false, "description": "Ethereum JavaScript API", "devDependencies": { "@types/node": "^12.12.34", @@ -76282,6 +76292,7 @@ const WitnessCalculatorBuilder = require("circom_runtime").WitnessCalculatorBuil const circomlib = require("circomlib"); const smt = require("circomlib").smt; const Web3 = require("web3"); +// const buildBn128 = require("wasmsnark").buildBn128; const nLevels = 5; @@ -76313,9 +76324,14 @@ exports.calcDepositWitness = async (wasm, secret, nullifier, commitments) => { // old root const rootOld = tree.root; const resOld = await tree.find(commitment); - if (resOld.found) { - console.error("leaf expect to not exist but exists"); + let oldKey = "0"; + if (!resOld.found) { + oldKey = resOld.notFoundKey.toString(); } + console.log("oldKey", oldKey); + // if (resOld.found) { + // console.error("leaf expect to not exist but exists"); + // } let siblingsOld = resOld.siblings; while (siblingsOld.length < nLevels) { siblingsOld.push("0"); @@ -76340,6 +76356,7 @@ exports.calcDepositWitness = async (wasm, secret, nullifier, commitments) => { "amount": amount, "secret": secret, "nullifier": nullifier, + "oldKey": oldKey, "siblingsOld": siblingsOld, "siblingsNew": siblingsNew, "rootOld": rootOld, @@ -76360,12 +76377,14 @@ exports.calcDepositWitness = async (wasm, secret, nullifier, commitments) => { for (let j=0; j<8; j++) { const bi = witness[i]; const v = bigInt(bi).shiftRight(j*32).and(0xFFFFFFFF).toJSNumber(); - wBuff.writeUInt32LE(v, i*32 + j*4, 4) + // wBuff.writeUInt32LE(v, i*32 + j*4, 4) + wBuff.writeUInt32LE(v, i*32 + j*4) } } // const witness = unstringifyBigInts(stringifyBigInts(w)); + // return wBuff; return { witness: wBuff, publicInputs: { @@ -76438,6 +76457,8 @@ exports.calcWithdrawWitness = async (wasm, secret, nullifier, commitments, addr) } + + }).call(this,require("buffer").Buffer) },{"big-integer":24,"buffer":70,"circom_runtime":76,"circomlib":95,"ffjavascript":209,"fs":69,"snarkjs":329,"web3":448}]},{},[461])(461) }); diff --git a/lib/snarkjs.js b/libs/snarkjs.js similarity index 100% rename from lib/snarkjs.js rename to libs/snarkjs.js diff --git a/lib/wasmsnark_bn128.js b/libs/wasmsnark_bn128.js similarity index 100% rename from lib/wasmsnark_bn128.js rename to libs/wasmsnark_bn128.js diff --git a/libs/web3.min.js b/libs/web3.min.js new file mode 100644 index 0000000..7b10ac9 --- /dev/null +++ b/libs/web3.min.js @@ -0,0 +1 @@ +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Web3=t()}}(function(){var define,module,exports;return function o(a,s,u){function f(e,t){if(!s[e]){if(!a[e]){var r="function"==typeof require&&require;if(!t&&r)return r(e,!0);if(c)return c(e,!0);var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}var i=s[e]={exports:{}};a[e][0].call(i.exports,function(t){return f(a[e][1][t]||t)},i,i.exports,o,a,s,u)}return s[e].exports}for(var c="function"==typeof require&&require,t=0;t>6],i=0==(32&r);if(31==(31&r)){var o=r;for(r=0;128==(128&o);){if(o=t.readUInt8(e),t.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:s.tag[r]}}function l(t,e,r){var n=t.readUInt8(r);if(t.isError(n))return n;if(!e&&128===n)return null;if(0==(128&n))return n;var i=127&n;if(4>=8)a++;(i=new f(2+a))[0]=o,i[1]=128|a;s=1+a;for(var u=n.length;0>=8)i[s]=255&u;return this._createEncoderBuffer([i,n])},s.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"!==e)return"numstr"===e?this._isNumstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===e?this._isPrintstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(e)?this._createEncoderBuffer(t):"objDesc"===e?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: "+e+" unsupported");for(var r=new f(2*t.length),n=0;n>=7)i++}var a=new f(i),s=a.length-1;for(n=t.length-1;0<=n;n--){o=t[n];for(a[s--]=127&o;0<(o>>=7);)a[s--]=128|127&o}return this._createEncoderBuffer(a)},s.prototype._encodeTime=function(t,e){var r,n=new Date(t);return"gentime"===e?r=[u(n.getFullYear()),u(n.getUTCMonth()+1),u(n.getUTCDate()),u(n.getUTCHours()),u(n.getUTCMinutes()),u(n.getUTCSeconds()),"Z"].join(""):"utctime"===e?r=[u(n.getFullYear()%100),u(n.getUTCMonth()+1),u(n.getUTCDate()),u(n.getUTCHours()),u(n.getUTCMinutes()),u(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(r,"octstr")},s.prototype._encodeNull=function(){return this._createEncoderBuffer("")},s.prototype._encodeInt=function(t,e){if("string"==typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!=typeof t&&!f.isBuffer(t)){var r=t.toArray();!t.sign&&128&r[0]&&r.unshift(0),t=new f(r)}if(f.isBuffer(t)){var n=t.length;0===t.length&&n++;var i=new f(n);return t.copy(i),0===t.length&&(i[0]=0),this._createEncoderBuffer(i)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);n=1;for(var o=t;256<=o;o>>=8)n++;for(o=(i=new Array(n)).length-1;0<=o;o--)i[o]=255&t,t>>=8;return 128&i[0]&&i.unshift(0),this._createEncoderBuffer(new f(i))},s.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},s.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getEncoder("der").tree},s.prototype._skipDefault=function(t,e,r){var n,i=this._baseState;if(null===i.default)return!1;var o=t.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,e,r).join()),o.length!==i.defaultBuffer.length)return!1;for(n=0;n>16&255,o[a++]=e>>8&255,o[a++]=255&e;var f,c;2===i&&(e=l[t.charCodeAt(u)]<<2|l[t.charCodeAt(u+1)]>>4,o[a++]=255&e);1===i&&(e=l[t.charCodeAt(u)]<<10|l[t.charCodeAt(u+1)]<<4|l[t.charCodeAt(u+2)]>>2,o[a++]=e>>8&255,o[a++]=255&e);return o},r.fromByteArray=function(t){for(var e,r=t.length,n=r%3,i=[],o=0,a=r-n;o>2]+s[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],i.push(s[e>>10]+s[e>>4&63]+s[e<<2&63]+"="));return i.join("")};for(var s=[],l=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=n.length;i>18&63]+s[i>>12&63]+s[i>>6&63]+s[63&i]);return o.join("")}l["-".charCodeAt(0)]=62,l["_".charCodeAt(0)]=63},{}],20:[function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i;function o(t){this.rand=t}if(e.exports=function(t){return i||(i=new o(null)),i.generate(t)},(e.exports.Rand=o).prototype.generate=function(t){return this._rand(t)},o.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r>>24]^c[p>>>16&255]^l[y>>>8&255]^h[255&b]^e[m++],a=f[p>>>24]^c[y>>>16&255]^l[b>>>8&255]^h[255&d]^e[m++],s=f[y>>>24]^c[b>>>16&255]^l[d>>>8&255]^h[255&p]^e[m++],u=f[b>>>24]^c[d>>>16&255]^l[p>>>8&255]^h[255&y]^e[m++],d=o,p=a,y=s,b=u;return o=(n[d>>>24]<<24|n[p>>>16&255]<<16|n[y>>>8&255]<<8|n[255&b])^e[m++],a=(n[p>>>24]<<24|n[y>>>16&255]<<16|n[b>>>8&255]<<8|n[255&d])^e[m++],s=(n[y>>>24]<<24|n[b>>>16&255]<<16|n[d>>>8&255]<<8|n[255&p])^e[m++],u=(n[b>>>24]<<24|n[d>>>16&255]<<16|n[p>>>8&255]<<8|n[255&y])^e[m++],[o>>>=0,a>>>=0,s>>>=0,u>>>=0]}var l=[0,1,2,4,8,16,32,64,128,27,54],h=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,u=0;u<256;++u){var f=s^s<<1^s<<2^s<<3^s<<4;f=f>>>8^255&f^99;var c=t[n[r[a]=f]=a],l=t[c],h=t[l],d=257*t[f]^16843008*f;i[0][a]=d<<24|d>>>8,i[1][a]=d<<16|d>>>16,i[2][a]=d<<8|d>>>24,i[3][a]=d,d=16843009*h^65537*l^257*c^16843008*a,o[0][f]=d<<24|d>>>8,o[1][f]=d<<16|d>>>16,o[2][f]=d<<8|d>>>24,o[3][f]=d,0===a?a=s=1:(a=c^t[t[t[h^c]]],s^=t[t[s]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function s(t){this._key=o(t),this._reset()}s.blockSize=16,s.keySize=32,s.prototype.blockSize=s.blockSize,s.prototype.keySize=s.keySize,s.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,n=4*(r+1),i=[],o=0;o>>24,a=h.SBOX[a>>>24]<<24|h.SBOX[a>>>16&255]<<16|h.SBOX[a>>>8&255]<<8|h.SBOX[255&a],a^=l[o/e|0]<<24):6>>24]<<24|h.SBOX[a>>>16&255]<<16|h.SBOX[a>>>8&255]<<8|h.SBOX[255&a]),i[o]=i[o-e]^a}for(var s=[],u=0;u>>24]]^h.INV_SUB_MIX[1][h.SBOX[c>>>16&255]]^h.INV_SUB_MIX[2][h.SBOX[c>>>8&255]]^h.INV_SUB_MIX[3][h.SBOX[255&c]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=s},s.prototype.encryptBlockRaw=function(t){return a(t=o(t),this._keySchedule,h.SUB_MIX,h.SBOX,this._nRounds)},s.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=i.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r},s.prototype.decryptBlock=function(t){var e=(t=o(t))[1];t[1]=t[3],t[3]=e;var r=a(t,this._invKeySchedule,h.INV_SUB_MIX,h.INV_SBOX,this._nRounds),n=i.allocUnsafe(16);return n.writeUInt32BE(r[0],0),n.writeUInt32BE(r[3],4),n.writeUInt32BE(r[2],8),n.writeUInt32BE(r[1],12),n},s.prototype.scrub=function(){n(this._keySchedule),n(this._invKeySchedule),n(this._key)},e.exports.AES=s},{"safe-buffer":153}],23:[function(t,e,r){"use strict";var a=t("./aes"),f=t("safe-buffer").Buffer,s=t("cipher-base"),n=t("inherits"),c=t("./ghash"),i=t("buffer-xor"),l=t("./incr32");function o(t,e,r,n){s.call(this);var i=f.alloc(4,0);this._cipher=new a.AES(e);var o=this._cipher.encryptBlock(i);this._ghash=new c(o),r=function(t,e,r){if(12===e.length)return t._finID=f.concat([e,f.from([0,0,0,1])]),f.concat([e,f.from([0,0,0,2])]);var n=new c(r),i=e.length,o=i%16;n.update(e),o&&(o=16-o,n.update(f.alloc(o,0))),n.update(f.alloc(8,0));var a=8*i,s=f.alloc(8);s.writeUIntBE(a,0,8),n.update(s),t._finID=n.state;var u=f.from(t._finID);return l(u),u}(this,r,o),this._prev=f.from(r),this._cache=f.allocUnsafe(0),this._secCache=f.allocUnsafe(0),this._decrypt=n,this._alen=0,this._len=0,this._mode=t,this._authTag=null,this._called=!1}n(o,s),o.prototype._update=function(t){if(!this._called&&this._alen){var e=16-this._alen%16;e<16&&(e=f.alloc(e,0),this._ghash.update(e))}this._called=!0;var r=this._mode.encrypt(this,t);return this._decrypt?this._ghash.update(t):this._ghash.update(r),this._len+=t.length,r},o.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var t=i(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(t,e){var r=0;t.length!==e.length&&r++;for(var n=Math.min(t.length,e.length),i=0;i>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function o(t){this.h=t,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}o.prototype.ghash=function(t){for(var e=-1;++e>>1|(1&n[e-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=a(i)},o.prototype.update=function(t){var e;for(this.cache=n.concat([this.cache,t]);16<=this.cache.length;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},o.prototype.final=function(t,e){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(a([0,t,0,e])),this.state},e.exports=o},{"safe-buffer":153}],28:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length;r--;){if(255!==(e=t.readUInt8(r))){e++,t.writeUInt8(e,r);break}t.writeUInt8(0,r)}}},{}],29:[function(t,e,r){"use strict";var i=t("buffer-xor");r.encrypt=function(t,e){var r=i(e,t._prev);return t._prev=t._cipher.encryptBlock(r),t._prev},r.decrypt=function(t,e){var r=t._prev;t._prev=e;var n=t._cipher.decryptBlock(e);return i(n,r)}},{"buffer-xor":49}],30:[function(t,e,r){"use strict";var o=t("safe-buffer").Buffer,a=t("buffer-xor");function s(t,e,r){var n=e.length,i=a(e,t._cache);return t._cache=t._cache.slice(n),t._prev=o.concat([t._prev,r?e:i]),i}r.encrypt=function(t,e,r){for(var n,i=o.allocUnsafe(0);e.length;){if(0===t._cache.length&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=o.allocUnsafe(0)),!(t._cache.length<=e.length)){i=o.concat([i,s(t,e,r)]);break}n=t._cache.length,i=o.concat([i,s(t,e.slice(0,n),r)]),e=e.slice(n)}return i}},{"buffer-xor":49,"safe-buffer":153}],31:[function(t,e,r){"use strict";var a=t("safe-buffer").Buffer;function s(t,e,r){for(var n,i,o=-1,a=0;++o<8;)n=e&1<<7-o?128:0,a+=(128&(i=t._cipher.encryptBlock(t._prev)[0]^n))>>o%8,t._prev=u(t._prev,r?n:i);return a}function u(t,e){var r=t.length,n=-1,i=a.allocUnsafe(t.length);for(t=a.concat([t,a.from([e])]);++n>7;return i}r.encrypt=function(t,e,r){for(var n=e.length,i=a.allocUnsafe(n),o=-1;++o=e)throw new Error("invalid sig")}e.exports=function(t,e,r,n,i){var o=y(r);if("ec"===o.type){if("ecdsa"!==n&&"ecdsa/rsa"!==n)throw new Error("wrong public key type");return function(t,e,r){var n=b[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var i=new p(n),o=r.data.subjectPrivateKey.data;return i.verify(e,t,o)}(t,e,o)}if("dsa"===o.type){if("dsa"!==n)throw new Error("wrong public key type");return function(t,e,r){var n=r.data.p,i=r.data.q,o=r.data.g,a=r.data.pub_key,s=y.signature.decode(t,"der"),u=s.s,f=s.r;m(u,i),m(f,i);var c=d.mont(n),l=u.invm(i);return 0===o.toRed(c).redPow(new d(e).mul(l).mod(i)).fromRed().mul(a.toRed(c).redPow(f.mul(l).mod(i)).fromRed()).mod(n).mod(i).cmp(f)}(t,e,o)}if("rsa"!==n&&"ecdsa/rsa"!==n)throw new Error("wrong public key type");e=h.concat([i,e]);for(var a=o.modulus.byteLength(),s=[1],u=0;e.length+s.length+2>>1;case"base64":return B(t).length;default:if(i)return n?-1:O(t).length;e=(""+e).toLowerCase(),i=!0}}function p(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function y(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=l.from(e,n)),l.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){var o,a=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s/=a=2,u/=2,r/=2}function f(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var c=-1;for(o=r;o>>10&1023|55296),c=56320|1023&c),n.push(c),i+=l}return function(t){var e=t.length;if(e<=_)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,e,r);case"utf8":case"utf-8":return w(this,e,r);case"ascii":return A(this,e,r);case"latin1":case"binary":return S(this,e,r);case"base64":return g(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},l.prototype.equals=function(t){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===l.compare(this,t)},l.prototype.inspect=function(){var t="",e=P.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),""},l.prototype.compare=function(t,e,r,n,i){if(C(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+h(t));if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(i<=n&&r<=e)return 0;if(i<=n)return-1;if(r<=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),s=Math.min(o,a),u=this.slice(n,i),f=t.slice(e,r),c=0;c>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||ithis.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o,a,s,u,f,c,l,h,d,p=!1;;)switch(n){case"hex":return m(this,t,e,r);case"utf8":case"utf-8":return h=e,d=r,U(O(t,(l=this).length-h),l,h,d);case"ascii":return v(this,t,e,r);case"latin1":case"binary":return v(this,t,e,r);case"base64":return u=this,f=e,c=r,U(B(t),u,f,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a=e,s=r,U(function(t,e){for(var r,n,i,o=[],a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(t,(o=this).length-a),o,a,s);default:if(p)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var _=4096;function A(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;it.length)throw new RangeError("Index out of range")}function j(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function I(t,e,r,n,i){return e=+e,r>>>=0,i||j(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function T(t,e,r,n,i){return e=+e,r>>>=0,i||j(t,0,r,8),o.write(t,e,r,n,52,8),r+8}l.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):r>>=0,e>>>=0,r||k(t,e,this.length);for(var n=this[t],i=1,o=0;++o>>=0,e>>>=0,r||k(t,e,this.length);for(var n=this[t+--e],i=1;0>>=0,e||k(t,1,this.length),this[t]},l.prototype.readUInt16LE=function(t,e){return t>>>=0,e||k(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUInt16BE=function(t,e){return t>>>=0,e||k(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUInt32LE=function(t,e){return t>>>=0,e||k(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUInt32BE=function(t,e){return t>>>=0,e||k(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||k(t,e,this.length);for(var n=this[t],i=1,o=0;++o>>=0,e>>>=0,r||k(t,e,this.length);for(var n=e,i=1,o=this[t+--n];0>>=0,e||k(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){t>>>=0,e||k(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(t,e){t>>>=0,e||k(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(t,e){return t>>>=0,e||k(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return t>>>=0,e||k(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return t>>>=0,e||k(t,4,this.length),o.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return t>>>=0,e||k(t,4,this.length),o.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return t>>>=0,e||k(t,8,this.length),o.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return t>>>=0,e||k(t,8,this.length),o.read(this,t,!1,52,8)},l.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||M(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n)||M(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;0<=--i&&(o*=256);)this[e+i]=t/o&255;return e+r},l.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,1,255,0),this[e]=255&t,e+1},l.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},l.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);M(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+r},l.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);M(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;0<=--o&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},l.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},l.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeFloatLE=function(t,e,r){return I(this,t,e,!0,r)},l.prototype.writeFloatBE=function(t,e,r){return I(this,t,e,!1,r)},l.prototype.writeDoubleLE=function(t,e,r){return T(this,t,e,!0,r)},l.prototype.writeDoubleBE=function(t,e,r){return T(this,t,e,!1,r)},l.prototype.copy=function(t,e,r,n){if(!l.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),0=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function B(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(e,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function U(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function C(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function N(t){return t!=t}}).call(this,t("buffer").Buffer)},{"base64-js":19,buffer:50,ieee754:103}],51:[function(t,e,r){"use strict";e.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],52:[function(t,e,r){"use strict";var i=t("safe-buffer").Buffer,n=t("stream").Transform,o=t("string_decoder").StringDecoder;function a(t){n.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}t("inherits")(a,n),a.prototype.update=function(t,e,r){"string"==typeof t&&(t=i.from(t,e));var n=this._update(t);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){n=t}finally{r(n)}},a.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},a.prototype._finalOrDigest=function(t){var e=this.__final()||i.alloc(0);return t&&(e=this._toString(e,t,!0)),e},a.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n},e.exports=a},{inherits:104,"safe-buffer":153,stream:162,string_decoder:182}],53:[function(t,e,n){(function(t){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t){return Object.prototype.toString.call(t)}n.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===r(t)},n.isBoolean=function(t){return"boolean"==typeof t},n.isNull=function(t){return null===t},n.isNullOrUndefined=function(t){return null==t},n.isNumber=function(t){return"number"==typeof t},n.isString=function(t){return"string"==typeof t},n.isSymbol=function(t){return"symbol"===e(t)},n.isUndefined=function(t){return void 0===t},n.isRegExp=function(t){return"[object RegExp]"===r(t)},n.isObject=function(t){return"object"===e(t)&&null!==t},n.isDate=function(t){return"[object Date]"===r(t)},n.isError=function(t){return"[object Error]"===r(t)||t instanceof Error},n.isFunction=function(t){return"function"==typeof t},n.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"===e(t)||void 0===t},n.isBuffer=t.isBuffer}).call(this,{isBuffer:t("../../is-buffer/index.js")})},{"../../is-buffer/index.js":105}],54:[function(t,s,e){(function(o){"use strict";var e=t("elliptic"),n=t("bn.js");s.exports=function(t){return new i(t)};var r={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function i(t){this.curveType=r[t],this.curveType||(this.curveType={name:t}),this.curve=new e.ec(this.curveType.name),this.keys=void 0}function a(t,e,r){Array.isArray(t)||(t=t.toArray());var n=new o(t);if(r&&n.lengthr)?e=("rmd160"===t?new u:f(t)).update(e).digest():e.length>>1];r=h.r28shl(r,o),n=h.r28shl(n,o),h.pc2(r,n,t.keys,i)}},u.prototype._update=function(t,e,r,n){var i=this._desState,o=h.readUInt32BE(t,e),a=h.readUInt32BE(t,e+4);h.ip(o,a,i.tmp,0),o=i.tmp[0],a=i.tmp[1],"encrypt"===this.type?this._encrypt(i,o,a,i.tmp,0):this._decrypt(i,o,a,i.tmp,0),o=i.tmp[0],a=i.tmp[1],h.writeUInt32BE(r,o,n),h.writeUInt32BE(r,a,n+4)},u.prototype._pad=function(t,e){for(var r=t.length-e,n=e;n>>0,o=l}h.rip(a,o,n,i)},u.prototype._decrypt=function(t,e,r,n,i){for(var o=r,a=e,s=t.keys.length-2;0<=s;s-=2){var u=t.keys[s],f=t.keys[s+1];h.expand(o,t.tmp,0),u^=t.tmp[0],f^=t.tmp[1];var c=h.substitute(u,f),l=o;o=(a^h.permute(c))>>>0,a=l}h.rip(o,a,n,i)}},{"../des":60,inherits:104,"minimalistic-assert":109}],64:[function(t,e,r){"use strict";var o=t("minimalistic-assert"),n=t("inherits"),i=t("../des"),a=i.Cipher,s=i.DES;function u(t,e){o.equal(e.length,24,"Invalid key length");var r=e.slice(0,8),n=e.slice(8,16),i=e.slice(16,24);this.ciphers="encrypt"===t?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:n}),s.create({type:"encrypt",key:i})]:[s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:n}),s.create({type:"decrypt",key:r})]}function f(t){a.call(this,t);var e=new u(this.type,this.options.key);this._edeState=e}n(f,a),(e.exports=f).create=function(t){return new f(t)},f.prototype._update=function(t,e,r,n){var i=this._edeState;i.ciphers[0]._update(t,e,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},f.prototype._pad=s.prototype._pad,f.prototype._unpad=s.prototype._unpad},{"../des":60,inherits:104,"minimalistic-assert":109}],65:[function(t,e,r){"use strict";r.readUInt32BE=function(t,e){return(t[0+e]<<24|t[1+e]<<16|t[2+e]<<8|t[3+e])>>>0},r.writeUInt32BE=function(t,e,r){t[0+r]=e>>>24,t[1+r]=e>>>16&255,t[2+r]=e>>>8&255,t[3+r]=255&e},r.ip=function(t,e,r,n){for(var i=0,o=0,a=6;0<=a;a-=2){for(var s=0;s<=24;s+=8)i<<=1,i|=e>>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=t>>>s+a&1}for(a=6;0<=a;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1}r[n+0]=i>>>0,r[n+1]=o>>>0},r.rip=function(t,e,r,n){for(var i=0,o=0,a=0;a<4;a++)for(var s=24;0<=s;s-=8)i<<=1,i|=e>>>s+a&1,i<<=1,i|=t>>>s+a&1;for(a=4;a<8;a++)for(s=24;0<=s;s-=8)o<<=1,o|=e>>>s+a&1,o<<=1,o|=t>>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},r.pc1=function(t,e,r,n){for(var i=0,o=0,a=7;5<=a;a--){for(var s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1}for(s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},r.r28shl=function(t,e){return t<>>28-e};var u=[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];r.pc2=function(t,e,r,n){for(var i=0,o=0,a=u.length>>>1,s=0;s>>u[s]&1;for(s=a;s>>u[s]&1;r[n+0]=i>>>0,r[n+1]=o>>>0},r.expand=function(t,e,r){var n=0,i=0;n=(1&t)<<5|t>>>27;for(var o=23;15<=o;o-=4)n<<=6,n|=t>>>o&63;for(o=11;3<=o;o-=4)i|=t>>>o&63,i<<=6;i|=(31&t)<<1|t>>>31,e[r+0]=n>>>0,e[r+1]=i>>>0};var i=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];r.substitute=function(t,e){for(var r=0,n=0;n<4;n++){r<<=4,r|=i[64*n+(t>>>18-6*n&63)]}for(n=0;n<4;n++){r<<=4,r|=i[256+64*n+(e>>>18-6*n&63)]}return r>>>0};var n=[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];r.permute=function(t){for(var e=0,r=0;r>>n[r]&1;return e>>>0},r.padSplit=function(t,e,r){for(var n=t.toString(2);n.lengtht;)r.ishrn(1);if(r.isEven()&&r.iadd(u),r.testn(1)||r.iadd(f),e.cmp(f)){if(!e.cmp(c))for(;r.mod(l).cmp(h);)r.iadd(p)}else for(;r.mod(a).cmp(d);)r.iadd(p);if(b(n=r.shrn(1))&&b(r)&&m(n)&&m(r)&&s.test(n)&&s.test(r))return r}}},{"bn.js":"BN","miller-rabin":108,randombytes:135}],69:[function(t,e,r){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"}}},{}],70:[function(t,e,r){"use strict";var n=r;n.version=t("../package.json").version,n.utils=t("./elliptic/utils"),n.rand=t("brorand"),n.curve=t("./elliptic/curve"),n.curves=t("./elliptic/curves"),n.ec=t("./elliptic/ec"),n.eddsa=t("./elliptic/eddsa")},{"../package.json":85,"./elliptic/curve":73,"./elliptic/curves":76,"./elliptic/ec":77,"./elliptic/eddsa":80,"./elliptic/utils":84,brorand:20}],71:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("../../elliptic").utils,E=i.getNAF,k=i.getJSF,l=i.assert;function o(t,e){this.type=t,this.p=new n(e.p,16),this.red=e.prime?n.red(e.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=e.n&&new n(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||0>1]):a.mixedAdd(i[-u-1>>1].neg()):0>1]):a.add(i[-u-1>>1].neg())}return"affine"===t.type?a.toP():a},o.prototype._wnafMulAdd=function(t,e,r,n,i){for(var o=this._wnafT1,a=this._wnafT2,s=this._wnafT3,u=0,f=0;f>1]:x<0&&(S=a[b][-x-1>>1].neg()),g="affine"===S.type?g.mixedAdd(S):g.add(S))}}for(f=0;f=Math.ceil((t.bitLength()+1)/e.step)},a.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i":""},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 t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=n.redAdd(e),a=o.redSub(r),s=n.redSub(e),u=i.redMul(a),f=o.redMul(s),c=i.redMul(s),l=a.redMul(o);return this.curve.point(u,f,l,c)},c.prototype._projDbl=function(){var t,e,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)t=n.redSub(i).redSub(o).redMul(a.redSub(this.curve.two)),e=a.redMul(f.redSub(o)),r=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),u=a.redSub(s).redISub(s);t=n.redSub(i).redISub(o).redMul(u),e=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);t=this.curve._mulC(n.redISub(f)).redMul(u),e=this.curve._mulC(f).redMul(i.redISub(o)),r=f.redMul(u)}return this.curve.point(t,e,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),a=i.redSub(n),s=i.redAdd(n),u=r.redAdd(e),f=o.redMul(a),c=s.redMul(u),l=o.redMul(u),h=a.redMul(s);return this.curve.point(f,c,h,l)},c.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),o=this.x.redMul(t.x),a=this.y.redMul(t.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),f=i.redAdd(s),c=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(a),l=n.redMul(u).redMul(c);return r=this.curve.twisted?(e=n.redMul(f).redMul(a.redSub(this.curve._mulA(o))),u.redMul(f)):(e=n.redMul(f).redMul(a.redSub(o)),this.curve._mulC(u).redMul(f)),this.curve.point(l,e,r)},c.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},c.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},c.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},c.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),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(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},c.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),0<=r.cmp(this.curve.p))return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},{"../../elliptic":70,"../curve":73,"bn.js":"BN",inherits:104}],73:[function(t,e,r){"use strict";var n=r;n.base=t("./base"),n.short=t("./short"),n.mont=t("./mont"),n.edwards=t("./edwards")},{"./base":71,"./edwards":72,"./mont":74,"./short":75}],74:[function(t,e,r){"use strict";var n=t("../curve"),i=t("bn.js"),o=t("inherits"),a=n.base,s=t("../../elliptic").utils;function u(t){a.call(this,"mont",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.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(t,e,r){a.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(e,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).prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},o(f,a.BasePoint),u.prototype.decodePoint=function(t,e){return this.point(s.toArray(t,e),1)},u.prototype.point=function(t,e){return new f(this,t,e)},u.prototype.pointFromJSON=function(t){return f.fromJSON(this,t)},f.prototype.precompute=function(){},f.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},f.fromJSON=function(t,e){return new f(t,e[0],e[1]||t.one)},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},f.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.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(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),a=i.redMul(n),s=e.z.redMul(o.redAdd(a).redSqr()),u=e.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},f.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var o=i.length-1;0<=o;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(t){return 0===this.getX().cmp(t.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()}},{"../../elliptic":70,"../curve":73,"bn.js":"BN",inherits:104}],75:[function(t,e,r){"use strict";var n=t("../curve"),i=t("../../elliptic"),_=t("bn.js"),o=t("inherits"),a=n.base,s=i.utils.assert;function u(t){a.call(this,"short",t),this.a=new _(t.a,16).toRed(this.red),this.b=new _(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function f(t,e,r,n){a.BasePoint.call(this,t,"affine"),this.inf=null===e&&null===r?(this.x=null,!(this.y=null)):(this.x=new _(e,16),this.y=new _(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),!1)}function c(t,e,r,n){a.BasePoint.call(this,t,"jacobian"),this.z=null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,new _(0)):(this.x=new _(e,16),this.y=new _(r,16),new _(n,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.zOne=this.z===this.curve.one}o(u,a),(e.exports=u).prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new _(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new _(t.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(e))?r=i[0]:(r=i[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map(function(t){return{a:new _(t.a,16),b:new _(t.b,16)}}):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:_.mont(t),r=new _(2).toRed(e).redInvm(),n=r.redNeg(),i=new _(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},u.prototype._getEndoBasis=function(t){for(var e,r,n,i,o,a,s,u,f,c=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=t,h=this.n.clone(),d=new _(1),p=new _(0),y=new _(0),b=new _(1),m=0;0!==l.cmpn(0);){var v=h.div(l);u=h.sub(v.mul(l)),f=y.sub(v.mul(d));var g=b.sub(v.mul(p));if(!n&&u.cmp(c)<0)e=s.neg(),r=d,n=u.neg(),i=f;else if(n&&2==++m)break;h=l,l=s=u,y=d,d=f,b=p,p=g}o=u.neg(),a=f;var w=n.sqr().add(i.sqr());return 0<=o.sqr().add(a.sqr()).cmp(w)&&(o=e,a=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:i},{a:o,b:a}]},u.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),f=o.mul(n.b);return{k1:t.sub(a).sub(s),k2:u.add(f).neg()}},u.prototype.pointFromX=function(t,e){(t=new _(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(e&&!i||!e&&i)&&(n=n.redNeg()),this.point(t,n)},u.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},f.prototype.isInfinity=function(){return this.inf},f.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},f.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},f.prototype.getX=function(){return this.x.fromRed()},f.prototype.getY=function(){return this.y.fromRed()},f.prototype.mul=function(t){return t=new _(t,16),this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},f.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},f.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},f.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},f.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},f.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(c,a.BasePoint),u.prototype.jpoint=function(t,e,r){return new c(this,t,e,r)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),a=t.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=s.redSqr(),c=f.redMul(s),l=n.redMul(f),h=u.redSqr().redIAdd(c).redISub(l).redISub(l),d=u.redMul(l.redISub(h)).redISub(o.redMul(c)),p=this.z.redMul(t.z).redMul(s);return this.curve.jpoint(h,d,p)},c.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),f=u.redMul(a),c=r.redMul(u),l=s.redSqr().redIAdd(f).redISub(c).redISub(c),h=s.redMul(c.redISub(l)).redISub(i.redMul(f)),d=this.z.redMul(a);return this.curve.jpoint(l,h,d)},c.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;r":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":70,"../curve":73,"bn.js":"BN",inherits:104}],76:[function(t,e,r){"use strict";var n,i=r,o=t("hash.js"),a=t("../elliptic"),s=a.utils.assert;function u(t){"short"===t.type?this.curve=new a.curve.short(t):"edwards"===t.type?this.curve=new a.curve.edwards(t):this.curve=new a.curve.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function f(e,r){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var t=new u(r);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:t}),t}})}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=t("./precomputed/secp256k1")}catch(t){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]})},{"../elliptic":70,"./precomputed/secp256k1":83,"hash.js":89}],77:[function(t,e,r){"use strict";function b(t){return(b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var m=t("bn.js"),v=t("hmac-drbg"),o=t("../../elliptic"),d=o.utils.assert,n=t("./key"),g=t("./signature");function i(t){if(!(this instanceof i))return new i(t);"string"==typeof t&&(d(o.curves.hasOwnProperty(t),"Unknown curve "+t),t=o.curves[t]),t instanceof o.curves.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}(e.exports=i).prototype.keyPair=function(t){return new n(this,t)},i.prototype.keyFromPrivate=function(t,e){return n.fromPrivate(this,t,e)},i.prototype.keyFromPublic=function(t,e){return n.fromPublic(this,t,e)},i.prototype.genKeyPair=function(t){t||(t={});for(var e=new v({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||o.rand(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new m(2));;){var i=new m(e.generate(r));if(!(0>1;if(0<=a.cmp(this.curve.p.umod(this.curve.n))&&f)throw new Error("Unable to find sencond key candinate");a=f?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var c=e.r.invm(i),l=i.sub(o).mul(c).umod(i),h=s.mul(c).umod(i);return this.g.mulAdd(l,a,h)},i.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new g(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":70,"./key":78,"./signature":79,"bn.js":"BN","hmac-drbg":101}],78:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("../../elliptic").utils.assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}(e.exports=o).fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new n(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return""}},{"../../elliptic":70,"bn.js":"BN"}],79:[function(t,e,r){"use strict";var s=t("bn.js"),u=t("../../elliptic").utils,n=u.assert;function i(t,e){if(t instanceof i)return t;this._importDER(t,e)||(n(t.r&&t.s,"Signature without r or s"),this.r=new s(t.r,16),this.s=new s(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function f(){this.place=0}function c(t,e){var r=t[e.place++];if(!(128&r))return r;for(var n=15&r,i=0,o=0,a=e.place;o>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}(e.exports=i).prototype._importDER=function(t,e){t=u.toArray(t,e);var r=new f;if(48!==t[r.place++])return!1;if(c(t,r)+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var n=c(t,r),i=t.slice(r.place,n+r.place);if(r.place+=n,2!==t[r.place++])return!1;var o=c(t,r);if(t.length!==o+r.place)return!1;var a=t.slice(r.place,o+r.place);return 0===i[0]&&128&i[1]&&(i=i.slice(1)),0===a[0]&&128&a[1]&&(a=a.slice(1)),this.r=new s(i),this.s=new s(a),!(this.recoveryParam=null)},i.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=a(e),r=a(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];l(n,e.length),(n=n.concat(e)).push(2),l(n,r.length);var i=n.concat(r),o=[48];return l(o,i.length),o=o.concat(i),u.encode(o,t)}},{"../../elliptic":70,"bn.js":"BN"}],80:[function(t,e,r){"use strict";var n=t("hash.js"),i=t("../../elliptic"),o=i.utils,a=o.assert,u=o.parseBytes,s=t("./key"),f=t("./signature");function c(t){if(a("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof c))return new c(t);t=i.curves[t].curve;this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=n.sha512}(e.exports=c).prototype.sign=function(t,e){t=u(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),s=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:s,Rencoded:o})},c.prototype.verify=function(t,e,r){t=u(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(o)},c.prototype.hashInt=function(){for(var t=this.hash(),e=0;e>1)-1>1)-a:a,i.isubn(o)}else o=0;r.push(o);for(var s=0!==i.cmpn(0)&&0===i.andln(n-1)?e+1:1,u=1;ui){a.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+a.length+' "'+String(e)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');s.name="MaxListenersExceededWarning",s.emitter=t,s.type=e,s.count=a.length,"object"===("undefined"==typeof console?"undefined":u(console))&&console.warn&&console.warn("%s: %s",s.name,s.message)}}else a=o[e]=r,++t._eventsCount;return t}function d(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var t=new Array(arguments.length),e=0;e=this._blockSize;){for(var i=this._blockOffset;i=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=i.join32(t,0,t.length-r,this.endian);for(var n=0;n>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;othis.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e>>3},r.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},{"../utils":100}],100:[function(t,e,r){"use strict";var f=t("minimalistic-assert"),n=t("inherits");function o(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function i(t){return 1===t.length?"0"+t:t}function a(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}r.inherits=n,r.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r,n,i=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),a=0;a>6|192:(n=a,55296!=(64512&(r=t).charCodeAt(n))||n<0||n+1>=r.length||56320!=(64512&r.charCodeAt(n+1))?i[o++]=s>>12|224:(s=65536+((1023&s)<<10)+(1023&t.charCodeAt(++a)),i[o++]=s>>18|240,i[o++]=s>>12&63|128),s>>6&63|128),63&s|128)}else for(a=0;a>>0}return o},r.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},r.rotr32=function(t,e){return t>>>e|t<<32-e},r.rotl32=function(t,e){return t<>>32-e},r.sum32=function(t,e){return t+e>>>0},r.sum32_3=function(t,e,r){return t+e+r>>>0},r.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},r.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},r.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,a=(o>>0,t[e+1]=o},r.sum64_hi=function(t,e,r,n){return(e+n>>>0>>0},r.sum64_lo=function(t,e,r,n){return e+n>>>0},r.sum64_4_hi=function(t,e,r,n,i,o,a,s){var u=0,f=e;return u+=(f=f+n>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(t,e,r,n,i,o,a,s){return e+n+o+s>>>0},r.sum64_5_hi=function(t,e,r,n,i,o,a,s,u,f){var c=0,l=e;return c+=(l=l+n>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(t,e,r,n,i,o,a,s,u,f){return e+n+o+s+f>>>0},r.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},r.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},r.shr64_hi=function(t,e,r){return t>>>r},r.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},{inherits:104,"minimalistic-assert":109}],101:[function(t,e,r){"use strict";var n=t("hash.js"),a=t("minimalistic-crypto-utils"),i=t("minimalistic-assert");function o(t){if(!(this instanceof o))return new o(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=a.toArray(t.entropy,t.entropyEnc||"hex"),r=a.toArray(t.nonce,t.nonceEnc||"hex"),n=a.toArray(t.pers,t.persEnc||"hex");i(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}(e.exports=o).prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},o.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=a.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length>1,c=-7,l=r?i-1:0,h=r?-1:1,d=t[e+l];for(l+=h,o=d&(1<<-c)-1,d>>=-c,c+=s;0>=-c,c+=n;0>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),2<=(e+=1<=a+l?h/u:h*Math.pow(2,1-l))*u&&(a++,u/=2),c<=a+l?(s=0,a=c):1<=a+l?(s=(e*u-1)*Math.pow(2,i),a+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));8<=i;t[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<>>32-e}function f(t,e,r,n,i,o,a){return u(t+(e&r|~e&n)+i+o|0,a)+e|0}function c(t,e,r,n,i,o,a){return u(t+(e&n|r&~n)+i+o|0,a)+e|0}function l(t,e,r,n,i,o,a){return u(t+(e^r^n)+i+o|0,a)+e|0}function h(t,e,r,n,i,o,a){return u(t+(r^(e|~n))+i+o|0,a)+e|0}n(s,i),s.prototype._update=function(){for(var t=a,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,o=this._d;n=h(n=h(n=h(n=h(n=l(n=l(n=l(n=l(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,t[0],3614090360,7),n,i,t[1],3905402710,12),r,n,t[2],606105819,17),o,r,t[3],3250441966,22),i=f(i,o=f(o,r=f(r,n,i,o,t[4],4118548399,7),n,i,t[5],1200080426,12),r,n,t[6],2821735955,17),o,r,t[7],4249261313,22),i=f(i,o=f(o,r=f(r,n,i,o,t[8],1770035416,7),n,i,t[9],2336552879,12),r,n,t[10],4294925233,17),o,r,t[11],2304563134,22),i=f(i,o=f(o,r=f(r,n,i,o,t[12],1804603682,7),n,i,t[13],4254626195,12),r,n,t[14],2792965006,17),o,r,t[15],1236535329,22),i=c(i,o=c(o,r=c(r,n,i,o,t[1],4129170786,5),n,i,t[6],3225465664,9),r,n,t[11],643717713,14),o,r,t[0],3921069994,20),i=c(i,o=c(o,r=c(r,n,i,o,t[5],3593408605,5),n,i,t[10],38016083,9),r,n,t[15],3634488961,14),o,r,t[4],3889429448,20),i=c(i,o=c(o,r=c(r,n,i,o,t[9],568446438,5),n,i,t[14],3275163606,9),r,n,t[3],4107603335,14),o,r,t[8],1163531501,20),i=c(i,o=c(o,r=c(r,n,i,o,t[13],2850285829,5),n,i,t[2],4243563512,9),r,n,t[7],1735328473,14),o,r,t[12],2368359562,20),i=l(i,o=l(o,r=l(r,n,i,o,t[5],4294588738,4),n,i,t[8],2272392833,11),r,n,t[11],1839030562,16),o,r,t[14],4259657740,23),i=l(i,o=l(o,r=l(r,n,i,o,t[1],2763975236,4),n,i,t[4],1272893353,11),r,n,t[7],4139469664,16),o,r,t[10],3200236656,23),i=l(i,o=l(o,r=l(r,n,i,o,t[13],681279174,4),n,i,t[0],3936430074,11),r,n,t[3],3572445317,16),o,r,t[6],76029189,23),i=l(i,o=l(o,r=l(r,n,i,o,t[9],3654602809,4),n,i,t[12],3873151461,11),r,n,t[15],530742520,16),o,r,t[2],3299628645,23),i=h(i,o=h(o,r=h(r,n,i,o,t[0],4096336452,6),n,i,t[7],1126891415,10),r,n,t[14],2878612391,15),o,r,t[5],4237533241,21),i=h(i,o=h(o,r=h(r,n,i,o,t[12],1700485571,6),n,i,t[3],2399980690,10),r,n,t[10],4293915773,15),o,r,t[1],2240044497,21),i=h(i,o=h(o,r=h(r,n,i,o,t[8],1873313359,6),n,i,t[15],4264355552,10),r,n,t[6],2734768916,15),o,r,t[13],1309151649,21),i=h(i,o=h(o,r=h(r,n,i,o,t[4],4149444226,6),n,i,t[11],3174756917,10),r,n,t[2],718787259,15),o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,56>8,a=255&i;o?r.push(o,a):r.push(a)}return r},n.zero2=i,n.toHex=o,n.encode=function(t,e){return"hex"===e?o(t):t}},{}],111:[function(t,e,r){"use strict";var u=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,n,i=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),o=1;oo?e=i(e):e.lengtha||0<=new f(e).cmp(o.modulus))throw new Error("decryption error");i=r?p(new f(e),o):h(e,o);var s=y.alloc(a-i.length);if(i=y.concat([s,i],a),4===n)return function(t,e){var r=t.modulus.byteLength(),n=d("sha1").update(y.alloc(0)).digest(),i=n.length;if(0!==e[0])throw new Error("decryption error");var o=e.slice(1,i+1),a=e.slice(i+1),s=l(o,c(a,i)),u=l(a,c(s,r-i-1));if(function(t,e){t=y.from(t),e=y.from(e);var r=0,n=t.length;t.length!==e.length&&(r++,n=Math.min(t.length,e.length));var i=-1;for(;++i=e.length){o++;break}var a=e.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 e.slice(i)}(0,i,r);if(3===n)return i;throw new Error("unknown padding")}},{"./mgf":126,"./withPublic":129,"./xor":130,"bn.js":"BN","browserify-rsa":42,"create-hash":55,"parse-asn1":117,"safe-buffer":153}],128:[function(t,e,r){"use strict";var a=t("parse-asn1"),h=t("randombytes"),d=t("create-hash"),p=t("./mgf"),y=t("./xor"),b=t("bn.js"),s=t("./withPublic"),u=t("browserify-rsa"),m=t("safe-buffer").Buffer;e.exports=function(t,e,r){var n;n=t.padding?t.padding:r?1:4;var i,o=a(t);if(4===n)i=function(t,e){var r=t.modulus.byteLength(),n=e.length,i=d("sha1").update(m.alloc(0)).digest(),o=i.length,a=2*o;if(r-a-2= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=v-g,x=Math.floor,E=String.fromCharCode;function k(t){throw new RangeError(l[t])}function d(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function p(t,e){var r=t.split("@"),n="";return 1>>10&1023|55296),t=56320|1023&t),e+=E(t)}).join("")}function I(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function T(t,e,r){var n=0;for(t=r?x(t/s):t>>1,t+=x(t/e);h*w>>1x((m-p)/a))&&k("overflow"),p+=u*a,!(u<(f=s<=b?g:b+w<=s?w:s-b));s+=v)a>x(m/(c=v-f))&&k("overflow"),a*=c;b=T(p-o,e=h.length+1,0==o),x(p/e)>m-y&&k("overflow"),y+=x(p/e),p%=e,h.splice(p++,0,y)}return j(h)}function b(t){var e,r,n,i,o,a,s,u,f,c,l,h,d,p,y,b=[];for(h=(t=M(t)).length,e=A,o=_,a=r=0;ax((m-r)/(d=n+1))&&k("overflow"),r+=(s-e)*d,e=s,a=0;am&&k("overflow"),l==e){for(u=r,f=v;!(u<(c=f<=o?g:o+w<=f?w:f-o));f+=v)y=u-c,p=v-c,b.push(E(I(c+y%p,0))),u=x(y/p);b.push(E(I(u,0))),o=T(r,d,n==i),r=0,++n}++r,++e}return b.join("")}if(i={version:"1.4.1",ucs2:{decode:M,encode:j},decode:y,encode:b,toASCII:function(t){return p(t,function(t){return f.test(t)?"xn--"+b(t):t})},toUnicode:function(t){return p(t,function(t){return u.test(t)?y(t.slice(4).toLowerCase()):t})}},"function"==typeof define&&"object"==O(define.amd)&&define.amd)define("punycode",function(){return i});else if(e&&r)if(B.exports==e)r.exports=i;else for(o in i)i.hasOwnProperty(o)&&(e[o]=i[o]);else t.punycode=i}(void 0)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],132:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){e=e||"&",r=r||"=";var i={};if("string"!=typeof t||0===t.length)return i;var o=/\+/g;t=t.split(e);var a=1e3;n&&"number"==typeof n.maxKeys&&(a=n.maxKeys);var s,u,f=t.length;0e.highWaterMark&&(e.highWaterMark=(y<=(r=t)?r=y:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0));var r}function A(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(w("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?m.nextTick(S,t):S(t))}function S(t){w("emit readable"),t.emit("readable"),j(t)}function x(t,e){e.readingMore||(e.readingMore=!0,m.nextTick(E,t,e))}function E(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var n;to.length?o.length:t;if(a===o.length?i+=o:i+=o.slice(0,t),0===(t-=a)){a===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r).data=o.slice(a);break}++n}return e.length-=n,i}(t,e):function(t,e){var r=f.allocUnsafe(t),n=e.head,i=1;n.data.copy(r),t-=n.data.length;for(;n=n.next;){var o=n.data,a=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,a),0===(t-=a)){a===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n).data=o.slice(a);break}++i}return e.length-=i,r}(t,e);return n}(t,e.buffer,e.decoder),r);var r}function T(t){var e=t._readableState;if(0=e.highWaterMark||e.ended))return w("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?T(this):A(this),null;if(0===(t=_(t,e))&&e.ended)return 0===e.length&&T(this),null;var n,i=e.needReadable;return w("need readable",i),(0===e.length||e.length-t>>0),o=this.head,a=0;o;)e=o.data,r=i,n=a,e.copy(r,n),a+=o.data.length,o=o.next;return i},t}(),n&&n.inspect&&n.inspect.custom&&(e.exports.prototype[n.inspect.custom]=function(){var t=n.inspect({length:this.length});return this.constructor.name+" "+t})},{"safe-buffer":153,util:21}],144:[function(t,e,r){"use strict";var o=t("process-nextick-args");function a(t,e){t.emit("error",e)}e.exports={destroy:function(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?e?e(t):!t||this._writableState&&this._writableState.errorEmitted||o.nextTick(a,this,t):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(o.nextTick(a,r,t),r._writableState&&(r._writableState.errorEmitted=!0)):e&&e(t)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":123}],145:[function(t,e,r){"use strict";e.exports=t("events").EventEmitter},{events:86}],146:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=f,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=c,this.end=l,e=3;break;default:return this.write=h,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function a(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(1>>32-e}function x(t,e,r,n,i,o,a,s){return S(t+(e^r^n)+o+a|0,s)+i|0}function E(t,e,r,n,i,o,a,s){return S(t+(e&r|~e&n)+o+a|0,s)+i|0}function k(t,e,r,n,i,o,a,s){return S(t+((e|~r)^n)+o+a|0,s)+i|0}function M(t,e,r,n,i,o,a,s){return S(t+(e&n|r&~n)+o+a|0,s)+i|0}function j(t,e,r,n,i,o,a,s){return S(t+(e^(r|~n))+o+a|0,s)+i|0}i(a,o),a.prototype._update=function(){for(var t=b,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,a=0|this._e,s=0|this._a,u=0|this._b,f=0|this._c,c=0|this._d,l=0|this._e,h=0;h<80;h+=1){var d,p;p=h<16?(d=x(r,n,i,o,a,t[m[h]],_[0],g[h]),j(s,u,f,c,l,t[v[h]],A[0],w[h])):h<32?(d=E(r,n,i,o,a,t[m[h]],_[1],g[h]),M(s,u,f,c,l,t[v[h]],A[1],w[h])):h<48?(d=k(r,n,i,o,a,t[m[h]],_[2],g[h]),k(s,u,f,c,l,t[v[h]],A[2],w[h])):h<64?(d=M(r,n,i,o,a,t[m[h]],_[3],g[h]),E(s,u,f,c,l,t[v[h]],A[3],w[h])):(d=j(r,n,i,o,a,t[m[h]],_[4],g[h]),x(s,u,f,c,l,t[v[h]],A[4],w[h])),r=a,a=o,o=S(i,10),i=n,n=d,s=l,l=c,c=S(f,10),f=u,u=p}var y=this._b+i+c|0;this._b=this._c+o+l|0,this._c=this._d+a+s|0,this._d=this._e+r+u|0,this._e=this._a+n+f|0,this._a=y},a.prototype._digest=function(){this._block[this._blockOffset++]=128,56=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=n},{"safe-buffer":153}],155:[function(t,e,r){"use strict";var n=e.exports=function(t){t=t.toLowerCase();var e=n[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e};n.sha=t("./sha"),n.sha1=t("./sha1"),n.sha224=t("./sha224"),n.sha256=t("./sha256"),n.sha384=t("./sha384"),n.sha512=t("./sha512")},{"./sha":156,"./sha1":157,"./sha224":158,"./sha256":159,"./sha384":160,"./sha512":161}],156:[function(t,e,r){"use strict";var n=t("inherits"),i=t("./hash"),o=t("safe-buffer").Buffer,m=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function s(){this.init(),this._w=a,i.call(this,64,56)}n(s,i),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(t){for(var e,r,n,i,o,a,s=this._w,u=0|this._a,f=0|this._b,c=0|this._c,l=0|this._d,h=0|this._e,d=0;d<16;++d)s[d]=t.readInt32BE(4*d);for(;d<80;++d)s[d]=s[d-3]^s[d-8]^s[d-14]^s[d-16];for(var p=0;p<80;++p){var y=~~(p/20),b=0|((a=u)<<5|a>>>27)+(n=f,i=c,o=l,0===(r=y)?n&i|~n&o:2===r?n&i|n&o|i&o:n^i^o)+h+s[p]+m[y];h=l,l=c,c=(e=f)<<30|e>>>2,f=u,u=b}this._a=u+this._a|0,this._b=f+this._b|0,this._c=c+this._c|0,this._d=l+this._d|0,this._e=h+this._e|0},s.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},e.exports=s},{"./hash":154,inherits:104,"safe-buffer":153}],157:[function(t,e,r){"use strict";var n=t("inherits"),i=t("./hash"),o=t("safe-buffer").Buffer,v=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function s(){this.init(),this._w=a,i.call(this,64,56)}n(s,i),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(t){for(var e,r,n,i,o,a,s,u=this._w,f=0|this._a,c=0|this._b,l=0|this._c,h=0|this._d,d=0|this._e,p=0;p<16;++p)u[p]=t.readInt32BE(4*p);for(;p<80;++p)u[p]=(e=u[p-3]^u[p-8]^u[p-14]^u[p-16])<<1|e>>>31;for(var y=0;y<80;++y){var b=~~(y/20),m=0|((s=f)<<5|s>>>27)+(i=c,o=l,a=h,0===(n=b)?i&o|~i&a:2===n?i&o|i&a|o&a:i^o^a)+d+u[y]+v[b];d=h,h=l,l=(r=c)<<30|r>>>2,c=f,f=m}this._a=f+this._a|0,this._b=c+this._b|0,this._c=l+this._c|0,this._d=h+this._d|0,this._e=d+this._e|0},s.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},e.exports=s},{"./hash":154,inherits:104,"safe-buffer":153}],158:[function(t,e,r){"use strict";var n=t("inherits"),i=t("./sha256"),o=t("./hash"),a=t("safe-buffer").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 t=a.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},e.exports=u},{"./hash":154,"./sha256":159,inherits:104,"safe-buffer":153}],159:[function(t,e,r){"use strict";var n=t("inherits"),i=t("./hash"),o=t("safe-buffer").Buffer,_=[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],a=new Array(64);function s(){this.init(),this._w=a,i.call(this,64,56)}n(s,i),s.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},s.prototype._update=function(t){for(var e,r,n,i,o,a,s,u=this._w,f=0|this._a,c=0|this._b,l=0|this._c,h=0|this._d,d=0|this._e,p=0|this._f,y=0|this._g,b=0|this._h,m=0;m<16;++m)u[m]=t.readInt32BE(4*m);for(;m<64;++m)u[m]=0|(((r=u[m-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)+u[m-7]+(((e=u[m-15])>>>7|e<<25)^(e>>>18|e<<14)^e>>>3)+u[m-16];for(var v=0;v<64;++v){var g=b+(((s=d)>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+((a=y)^d&(p^a))+_[v]+u[v]|0,w=0|(((o=f)>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10))+((n=f)&(i=c)|l&(n|i));b=y,y=p,p=d,d=h+g|0,h=l,l=c,c=f,f=g+w|0}this._a=f+this._a|0,this._b=c+this._b|0,this._c=l+this._c|0,this._d=h+this._d|0,this._e=d+this._e|0,this._f=p+this._f|0,this._g=y+this._g|0,this._h=b+this._h|0},s.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},e.exports=s},{"./hash":154,inherits:104,"safe-buffer":153}],160:[function(t,e,r){"use strict";var n=t("inherits"),i=t("./sha512"),o=t("./hash"),a=t("safe-buffer").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 n=a.allocUnsafe(48);function t(t,e,r){n.writeInt32BE(t,r),n.writeInt32BE(e,r+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),n},e.exports=u},{"./hash":154,"./sha512":161,inherits:104,"safe-buffer":153}],161:[function(t,e,r){"use strict";var n=t("inherits"),i=t("./hash"),o=t("safe-buffer").Buffer,tt=[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],a=new Array(160);function s(){this.init(),this._w=a,i.call(this,128,112)}function et(t,e,r){return r^t&(e^r)}function rt(t,e,r){return t&e|r&(t|e)}function nt(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function it(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function ot(t,e){return t>>>0>>0?1:0}n(s,i),s.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},s.prototype._update=function(t){for(var e,r,n,i,o,a,s,u,f=this._w,c=0|this._ah,l=0|this._bh,h=0|this._ch,d=0|this._dh,p=0|this._eh,y=0|this._fh,b=0|this._gh,m=0|this._hh,v=0|this._al,g=0|this._bl,w=0|this._cl,_=0|this._dl,A=0|this._el,S=0|this._fl,x=0|this._gl,E=0|this._hl,k=0;k<32;k+=2)f[k]=t.readInt32BE(4*k),f[k+1]=t.readInt32BE(4*k+4);for(;k<160;k+=2){var M=f[k-30],j=f[k-30+1],I=((s=M)>>>1|(u=j)<<31)^(s>>>8|u<<24)^s>>>7,T=((o=j)>>>1|(a=M)<<31)^(o>>>8|a<<24)^(o>>>7|a<<25);M=f[k-4],j=f[k-4+1];var R=((n=M)>>>19|(i=j)<<13)^(i>>>29|n<<3)^n>>>6,O=((e=j)>>>19|(r=M)<<13)^(r>>>29|e<<3)^(e>>>6|r<<26),B=f[k-14],U=f[k-14+1],C=f[k-32],N=f[k-32+1],P=T+U|0,L=I+B+ot(P,T)|0;L=(L=L+R+ot(P=P+O|0,O)|0)+C+ot(P=P+N|0,N)|0,f[k]=L,f[k+1]=P}for(var F=0;F<160;F+=2){L=f[F],P=f[F+1];var D=rt(c,l,h),q=rt(v,g,w),z=nt(c,v),H=nt(v,c),K=it(p,A),V=it(A,p),G=tt[F],W=tt[F+1],Y=et(p,y,b),X=et(A,S,x),J=E+V|0,Z=m+K+ot(J,E)|0;Z=(Z=(Z=Z+Y+ot(J=J+X|0,X)|0)+G+ot(J=J+W|0,W)|0)+L+ot(J=J+P|0,P)|0;var $=H+q|0,Q=z+D+ot($,H)|0;m=b,E=x,b=y,x=S,y=p,S=A,p=d+Z+ot(A=_+J|0,_)|0,d=h,_=w,h=l,w=g,l=c,g=v,c=Z+Q+ot(v=J+$|0,J)|0}this._al=this._al+v|0,this._bl=this._bl+g|0,this._cl=this._cl+w|0,this._dl=this._dl+_|0,this._el=this._el+A|0,this._fl=this._fl+S|0,this._gl=this._gl+x|0,this._hl=this._hl+E|0,this._ah=this._ah+c+ot(this._al,v)|0,this._bh=this._bh+l+ot(this._bl,g)|0,this._ch=this._ch+h+ot(this._cl,w)|0,this._dh=this._dh+d+ot(this._dl,_)|0,this._eh=this._eh+p+ot(this._el,A)|0,this._fh=this._fh+y+ot(this._fl,S)|0,this._gh=this._gh+b+ot(this._gl,x)|0,this._hh=this._hh+m+ot(this._hl,E)|0},s.prototype._hash=function(){var n=o.allocUnsafe(64);function t(t,e,r){n.writeInt32BE(t,r),n.writeInt32BE(e,r+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),n},e.exports=s},{"./hash":154,inherits:104,"safe-buffer":153}],162:[function(t,e,r){"use strict";e.exports=n;var c=t("events").EventEmitter;function n(){c.call(this)}t("inherits")(n,c),n.Readable=t("readable-stream/readable.js"),n.Writable=t("readable-stream/writable.js"),n.Duplex=t("readable-stream/duplex.js"),n.Transform=t("readable-stream/transform.js"),n.PassThrough=t("readable-stream/passthrough.js"),(n.Stream=n).prototype.pipe=function(e,t){var r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",a),r.on("close",s));var o=!1;function a(){o||(o=!0,e.end())}function s(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function u(t){if(f(),0===c.listenerCount(this,"error"))throw t}function f(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",a),r.removeListener("close",s),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",f),r.removeListener("close",f),e.removeListener("close",f)}return r.on("error",u),e.on("error",u),r.on("end",f),r.on("close",f),e.on("close",f),e.emit("pipe",r),e}},{events:86,inherits:104,"readable-stream/duplex.js":137,"readable-stream/passthrough.js":147,"readable-stream/readable.js":148,"readable-stream/transform.js":149,"readable-stream/writable.js":150}],163:[function(r,t,i){(function(u){"use strict";var f=r("./lib/request"),t=r("./lib/response"),c=r("xtend"),e=r("builtin-status-codes"),l=r("url"),n=i;n.request=function(t,e){t="string"==typeof t?l.parse(t):c(t);var r=-1===u.location.protocol.search(/^https?:$/)?"http:":"",n=t.protocol||r,i=t.hostname||t.host,o=t.port,a=t.path||"/";i&&-1!==i.indexOf(":")&&(i="["+i+"]"),t.url=(i?n+"//"+i:"")+(o?":"+o:"")+a,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var s=new f(t);return e&&s.on("response",e),s},n.get=function(t,e){var r=n.request(t,e);return r.end(),r},n.ClientRequest=f,n.IncomingMessage=t.IncomingMessage,n.Agent=function(){},n.Agent.defaultMaxSockets=4,n.globalAgent=new n.Agent,n.STATUS_CODES=e,n.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,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lib/request":165,"./lib/response":166,"builtin-status-codes":51,url:185,xtend:189}],164:[function(t,e,o){(function(t){"use strict";var e;function r(){if(void 0!==e)return e;if(t.XMLHttpRequest){e=new t.XMLHttpRequest;try{e.open("GET",t.XDomainRequest?"/":"https://example.com")}catch(t){e=null}}else e=null;return e}function n(t){var e=r();if(!e)return!1;try{return e.responseType=t,e.responseType===t}catch(t){}return!1}function i(t){return"function"==typeof t}o.fetch=i(t.fetch)&&i(t.ReadableStream),o.writableStream=i(t.WritableStream),o.abortController=i(t.AbortController),o.arraybuffer=o.fetch||n("arraybuffer"),o.msstream=!o.fetch&&n("ms-stream"),o.mozchunkedarraybuffer=!o.fetch&&n("moz-chunked-arraybuffer"),o.overrideMimeType=o.fetch||!!r()&&i(r().overrideMimeType),e=null}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],165:[function(o,h,t){(function(u,f,a){"use strict";var c=o("./capability"),t=o("inherits"),e=o("./response"),s=o("readable-stream"),r=e.IncomingMessage,l=e.readyStates;var n=h.exports=function(e){var t,r=this;s.Writable.call(r),r._opts=e,r._body=[],r._headers={},e.auth&&r.setHeader("Authorization","Basic "+a.from(e.auth).toString("base64")),Object.keys(e.headers).forEach(function(t){r.setHeader(t,e.headers[t])});var n,i,o=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!c.abortController)t=!(o=!1);else if("prefer-streaming"===e.mode)t=!1;else if("allow-wrong-content-type"===e.mode)t=!c.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");t=!0}r._mode=(n=t,i=o,c.fetch&&i?"fetch":c.mozchunkedarraybuffer?"moz-chunked-arraybuffer":c.msstream?"ms-stream":c.arraybuffer&&n?"arraybuffer":"text"),r._fetchTimer=null,r.on("finish",function(){r._onFinish()})};t(n,s.Writable),n.prototype.setHeader=function(t,e){var r=t.toLowerCase();-1===i.indexOf(r)&&(this._headers[r]={name:t,value:e})},n.prototype.getHeader=function(t){var e=this._headers[t.toLowerCase()];return e?e.value:null},n.prototype.removeHeader=function(t){delete this._headers[t.toLowerCase()]},n.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t=e._opts,n=e._headers,r=null;"GET"!==t.method&&"HEAD"!==t.method&&(r=new Blob(e._body,{type:(n["content-type"]||{}).value||""}));var i=[];if(Object.keys(n).forEach(function(t){var e=n[t].name,r=n[t].value;Array.isArray(r)?r.forEach(function(t){i.push([e,t])}):i.push([e,r])}),"fetch"===e._mode){var o=null;if(c.abortController){var a=new AbortController;o=a.signal,e._fetchAbortController=a,"requestTimeout"in t&&0!==t.requestTimeout&&(e._fetchTimer=f.setTimeout(function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()},t.requestTimeout))}f.fetch(e._opts.url,{method:e._opts.method,headers:i,body:r||void 0,mode:"cors",credentials:t.withCredentials?"include":"same-origin",signal:o}).then(function(t){e._fetchResponse=t,e._connect()},function(t){f.clearTimeout(e._fetchTimer),e._destroyed||e.emit("error",t)})}else{var s=e._xhr=new f.XMLHttpRequest;try{s.open(e._opts.method,e._opts.url,!0)}catch(t){return void u.nextTick(function(){e.emit("error",t)})}"responseType"in s&&(s.responseType=e._mode),"withCredentials"in s&&(s.withCredentials=!!t.withCredentials),"text"===e._mode&&"overrideMimeType"in s&&s.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in t&&(s.timeout=t.requestTimeout,s.ontimeout=function(){e.emit("requestTimeout")}),i.forEach(function(t){s.setRequestHeader(t[0],t[1])}),e._response=null,s.onreadystatechange=function(){switch(s.readyState){case l.LOADING:case l.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(s.onprogress=function(){e._onXHRProgress()}),s.onerror=function(){e._destroyed||e.emit("error",new Error("XHR error"))};try{s.send(r)}catch(t){return void u.nextTick(function(){e.emit("error",t)})}}}},n.prototype._onXHRProgress=function(){(function(t){try{var e=t.status;return null!==e&&0!==e}catch(t){return!1}})(this._xhr)&&!this._destroyed&&(this._response||this._connect(),this._response._onXHRProgress())},n.prototype._connect=function(){var e=this;e._destroyed||(e._response=new r(e._xhr,e._fetchResponse,e._mode,e._fetchTimer),e._response.on("error",function(t){e.emit("error",t)}),e.emit("response",e._response))},n.prototype._write=function(t,e,r){this._body.push(t),r()},n.prototype.abort=n.prototype.destroy=function(){this._destroyed=!0,f.clearTimeout(this._fetchTimer),this._response&&(this._response._destroyed=!0),this._xhr?this._xhr.abort():this._fetchAbortController&&this._fetchAbortController.abort()},n.prototype.end=function(t,e,r){"function"==typeof t&&(r=t,t=void 0),s.Writable.prototype.end.call(this,t,e,r)},n.prototype.flushHeaders=function(){},n.prototype.setTimeout=function(){},n.prototype.setNoDelay=function(){},n.prototype.setSocketKeepAlive=function(){};var i=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}).call(this,o("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},o("buffer").Buffer)},{"./capability":164,"./response":166,_process:124,buffer:50,inherits:104,"readable-stream":181}],166:[function(r,t,n){(function(f,c,l){"use strict";var h=r("./capability"),t=r("inherits"),d=r("readable-stream"),s=n.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},e=n.IncomingMessage=function(t,e,r,n){var i=this;if(d.Readable.call(i),i._mode=r,i.headers={},i.rawHeaders=[],i.trailers={},i.rawTrailers=[],i.on("end",function(){f.nextTick(function(){i.emit("close")})}),"fetch"===r){if(i._fetchResponse=e,i.url=e.url,i.statusCode=e.status,i.statusMessage=e.statusText,e.headers.forEach(function(t,e){i.headers[e.toLowerCase()]=t,i.rawHeaders.push(e,t)}),h.writableStream){var o=new WritableStream({write:function(r){return new Promise(function(t,e){i._destroyed?e():i.push(l.from(r))?t():i._resumeFetch=t})},close:function(){c.clearTimeout(n),i._destroyed||i.push(null)},abort:function(t){i._destroyed||i.emit("error",t)}});try{return void e.body.pipeTo(o).catch(function(t){c.clearTimeout(n),i._destroyed||i.emit("error",t)})}catch(t){}}var a=e.body.getReader();!function e(){a.read().then(function(t){if(!i._destroyed){if(t.done)return c.clearTimeout(n),void i.push(null);i.push(l.from(t.value)),e()}}).catch(function(t){c.clearTimeout(n),i._destroyed||i.emit("error",t)})}()}else{if(i._xhr=t,i._pos=0,i.url=t.responseURL,i.statusCode=t.status,i.statusMessage=t.statusText,t.getAllResponseHeaders().split(/\r?\n/).forEach(function(t){var e=t.match(/^([^:]+):\s*(.*)/);if(e){var r=e[1].toLowerCase();"set-cookie"===r?(void 0===i.headers[r]&&(i.headers[r]=[]),i.headers[r].push(e[2])):void 0!==i.headers[r]?i.headers[r]+=", "+e[2]:i.headers[r]=e[2],i.rawHeaders.push(e[1],e[2])}}),i._charset="x-user-defined",!h.overrideMimeType){var s=i.rawHeaders["mime-type"];if(s){var u=s.match(/;\s*charset=([^;])(;|$)/);u&&(i._charset=u[1].toLowerCase())}i._charset||(i._charset="utf-8")}}};t(e,d.Readable),e.prototype._read=function(){var t=this._resumeFetch;t&&(this._resumeFetch=null,t())},e.prototype._onXHRProgress=function(){var t=this,e=t._xhr,r=null;switch(t._mode){case"text":if((r=e.responseText).length>t._pos){var n=r.substr(t._pos);if("x-user-defined"===t._charset){for(var i=l.alloc(n.length),o=0;ot._pos&&(t.push(l.from(new Uint8Array(a.result.slice(t._pos)))),t._pos=a.result.byteLength)},a.onload=function(){t.push(null)},a.readAsArrayBuffer(r)}t._xhr.readyState===s.DONE&&"ms-stream"!==t._mode&&t.push(null)}}).call(this,r("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r("buffer").Buffer)},{"./capability":164,_process:124,buffer:50,inherits:104,"readable-stream":181}],167:[function(t,e,r){"use strict";function p(t){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var n={};function i(t,s,e){e||(e=Error);var r=function(a){var t,e;function r(t,e,r){return a.call(this,(n=t,i=e,o=r,"string"==typeof s?s:s(n,i,o)))||this;var n,i,o}return e=a,(t=r).prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e,r}(e);r.prototype.name=e.name,r.prototype.code=t,n[t]=r}function y(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(t){return String(t)}),2c.length)&&(h=c.length),c.substring(h-l.length,h)===l)a="The ".concat(t," ").concat(n," ").concat(y(e,"type"));else{var d=("number"!=typeof f&&(f=0),f+(u=".").length>(s=t).length||-1===s.indexOf(u,f)?"argument":"property");a='The "'.concat(t,'" ').concat(d," ").concat(n," ").concat(y(e,"type"))}return a+=". Received type ".concat(p(r))},TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"}),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"}),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=n},{}],168:[function(t,e,r){(function(r){"use strict";var n=new Set;e.exports.emitExperimentalWarning=r.emitWarning?function(t){if(!n.has(t)){var e=t+" is an experimental feature. This feature could change at any time";n.add(t),r.emitWarning(e,"ExperimentalWarning")}}:function(){}}).call(this,t("_process"))},{_process:124}],169:[function(c,l,t){(function(t){"use strict";var e=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};l.exports=s;var r=c("./_stream_readable"),n=c("./_stream_writable");c("inherits")(s,r);for(var i=e(n.prototype),o=0;oe.highWaterMark&&(e.highWaterMark=(E<=(r=t)?r=E:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0));var r}function M(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(m("emitReadable",e.flowing),e.emittedReadable=!0,y.nextTick(j,t))}function j(t){var e=t._readableState;m("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||t.emit("readable"),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,U(t)}function I(t,e){e.readingMore||(e.readingMore=!0,y.nextTick(T,t,e))}function T(t,e){for(;!e.reading&&!e.ended&&(e.length=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function N(t){var e=t._readableState;m("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,y.nextTick(P,e,t))}function P(t,e){m("endReadableNT",t.endEmitted,t.length),t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function L(t,e){for(var r=0,n=t.length;r=e.highWaterMark:0>>0),o=this.head,a=0;o;)e=o.data,r=i,n=a,s.prototype.copy.call(e,r,n),a+=o.data.length,o=o.next;return i},e.consume=function(t,e){var r;return ti.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0===(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e).data=i.slice(o);break}++r}return this.length-=r,n},e._getBuffer=function(t){var e=s.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0===(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r).data=i.slice(o);break}++n}return this.length-=n,e},e[i]=function(t,e){return n(this,function(i){for(var t=1;t",'"',"`"," ","\r","\n","\t"]),L=["'"].concat(i),F=["%","/","?",";","#"].concat(L),D=["/","?","#"],q=/^[+a-z0-9A-Z_-]{0,63}$/,z=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,H={javascript:!0,"javascript:":!0},K={javascript:!0,"javascript:":!0},V={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},G=t("querystring");function o(t,e,r){if(t&&C.isObject(t)&&t instanceof M)return t;var n=new M;return n.parse(t,e,r),n}M.prototype.parse=function(t,e,r){if(!C.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+B(t));var n=t.indexOf("?"),i=-1!==n&&n>6|192);else{if(55295>18|240),r+=e(i>>12&63|128)}else r+=e(i>>12|224);r+=e(i>>6&63|128)}r+=e(63&i|128)}}return r},toString:function(t){for(var e="",r=0,n=a(t);r>10|55296),e+=String.fromCharCode(1023&i|56320)}}return e},fromNumber:function(t){var e=t.toString(16);return e.length%2==0?"0x"+e:"0x0"+e},toNumber:function(t){return parseInt(t.slice(2),16)},fromNat:function(t){return"0x0"===t?"0x":t.length%2==0?t:"0x0"+t.slice(2)},toNat:function(t){return"0"===t[2]?"0x"+t.slice(3):t},fromArray:n,toArray:r,fromUint8Array:function(t){return n([].slice.call(t,0))},toUint8Array:function(t){return new Uint8Array(r(t))}}},{"./array.js":191}],193:[function(t,e,r){"use strict";var p="0123456789abcdef".split(""),y=[1,256,65536,16777216],b=[0,8,16,24],ct=[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],m=function(t){var e,r,n,i,o,a,s,u,f,c,l,h,d,p,y,b,m,v,g,w,_,A,S,x,E,k,M,j,I,T,R,O,B,U,C,N,P,L,F,D,q,z,H,K,V,G,W,Y,X,J,Z,$,Q,tt,et,rt,nt,it,ot,at,st,ut,ft;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],f=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],e=(h=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|s>>>31),r=(d=t[9]^t[19]^t[29]^t[39]^t[49])^(s<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(u<<1|f>>>31),r=o^(f<<1|u>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(c<<1|l>>>31),r=s^(l<<1|c>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=u^(h<<1|d>>>31),r=f^(d<<1|h>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=c^(i<<1|o>>>31),r=l^(o<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,p=t[0],y=t[1],G=t[11]<<4|t[10]>>>28,W=t[10]<<4|t[11]>>>28,j=t[20]<<3|t[21]>>>29,I=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,st=t[30]<<9|t[31]>>>23,z=t[40]<<18|t[41]>>>14,H=t[41]<<18|t[40]>>>14,U=t[2]<<1|t[3]>>>31,C=t[3]<<1|t[2]>>>31,b=t[13]<<12|t[12]>>>20,m=t[12]<<12|t[13]>>>20,Y=t[22]<<10|t[23]>>>22,X=t[23]<<10|t[22]>>>22,T=t[33]<<13|t[32]>>>19,R=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,ft=t[43]<<2|t[42]>>>30,tt=t[5]<<30|t[4]>>>2,et=t[4]<<30|t[5]>>>2,N=t[14]<<6|t[15]>>>26,P=t[15]<<6|t[14]>>>26,v=t[25]<<11|t[24]>>>21,g=t[24]<<11|t[25]>>>21,J=t[34]<<15|t[35]>>>17,Z=t[35]<<15|t[34]>>>17,O=t[45]<<29|t[44]>>>3,B=t[44]<<29|t[45]>>>3,x=t[6]<<28|t[7]>>>4,E=t[7]<<28|t[6]>>>4,rt=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,L=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,w=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,Q=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,V=t[9]<<27|t[8]>>>5,k=t[18]<<20|t[19]>>>12,M=t[19]<<20|t[18]>>>12,it=t[29]<<7|t[28]>>>25,ot=t[28]<<7|t[29]>>>25,D=t[38]<<8|t[39]>>>24,q=t[39]<<8|t[38]>>>24,A=t[48]<<14|t[49]>>>18,S=t[49]<<14|t[48]>>>18,t[0]=p^~b&v,t[1]=y^~m&g,t[10]=x^~k&j,t[11]=E^~M&I,t[20]=U^~N&L,t[21]=C^~P&F,t[30]=K^~G&Y,t[31]=V^~W&X,t[40]=tt^~rt&it,t[41]=et^~nt&ot,t[2]=b^~v&w,t[3]=m^~g&_,t[12]=k^~j&T,t[13]=M^~I&R,t[22]=N^~L&D,t[23]=P^~F&q,t[32]=G^~Y&J,t[33]=W^~X&Z,t[42]=rt^~it&at,t[43]=nt^~ot&st,t[4]=v^~w&A,t[5]=g^~_&S,t[14]=j^~T&O,t[15]=I^~R&B,t[24]=L^~D&z,t[25]=F^~q&H,t[34]=Y^~J&$,t[35]=X^~Z&Q,t[44]=it^~at&ut,t[45]=ot^~st&ft,t[6]=w^~A&p,t[7]=_^~S&y,t[16]=T^~O&x,t[17]=R^~B&E,t[26]=D^~z&U,t[27]=q^~H&C,t[36]=J^~$&K,t[37]=Z^~Q&V,t[46]=at^~ut&tt,t[47]=st^~ft&et,t[8]=A^~p&b,t[9]=S^~y&m,t[18]=O^~x&k,t[19]=B^~E&M,t[28]=z^~U&N,t[29]=H^~C&P,t[38]=$^~K&G,t[39]=Q^~V&W,t[48]=ut^~tt&rt,t[49]=ft^~et&nt,t[0]^=ct[n],t[1]^=ct[n+1]},n=function(a){return function(t){var e,r,n;if("0x"===t.slice(0,2)){e=[];for(var i=2,o=t.length;i>2]|=e[f]<>2]|=r<>2]|=(192|r>>6)<>2]|=(224|r>>12)<>2]|=(240|r>>18)<>2]|=(128|r>>12&63)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<>2]|=y[3&h],t.lastByteIndex===o)for(i[0]=i[a],h=1;h>4&15]+p[15&c]+p[c>>12&15]+p[c>>8&15]+p[c>>20&15]+p[c>>16&15]+p[c>>28&15]+p[c>>24&15];d%a==0&&(m(u),h=0)}return"0x"+l}({blocks:[],reset:!0,block:0,start:0,blockCount:1600-((r=a)<<1)>>5,outputBlocks:r>>5,s:(n=[0,0,0,0,0,0,0,0,0,0],[].concat(n,n,n,n,n))},e)}};e.exports={keccak256:n(256),keccak512:n(512),keccak256s:n(256),keccak512s:n(512)}},{}],194:[function(t,r,e){(function(t){"use strict";var e;e="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},r.exports=e}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],195:[function(t,e,r){"use strict";e.exports=function(t){var e=n.call(t);return"[object Function]"===e||"function"==typeof t&&"[object RegExp]"!==e||"undefined"!=typeof window&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)};var n=Object.prototype.toString},{}],196:[function(t,e,r){arguments[4][111][0].apply(r,arguments)},{dup:111}],197:[function(t,e,r){"use strict";var f=function(t){return t.replace(/^\s+|\s+$/g,"")};e.exports=function(t){if(!t)return{};for(var e,r={},n=f(t).split("\n"),i=0;i":">",'"':""","'":"'","`":"`"},q=d.invert(D),z=function(e){var r=function(t){return e[t]},t="(?:"+d.keys(e).join("|")+")",n=RegExp(t),i=RegExp(t,"g");return function(t){return t=null==t?"":""+t,n.test(t)?t.replace(i,r):t}};d.escape=z(D),d.unescape=z(q),d.result=function(t,e,r){d.isArray(e)||(e=[e]);var n=e.length;if(!n)return d.isFunction(r)?r.call(t):r;for(var i=0;i/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,V={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},G=/\\|'|\r|\n|\u2028|\u2029/g,W=function(t){return"\\"+V[t]};d.template=function(o,t,e){!t&&e&&(t=e),t=d.defaults({},t,d.templateSettings);var r,n=RegExp([(t.escape||K).source,(t.interpolate||K).source,(t.evaluate||K).source].join("|")+"|$","g"),a=0,s="__p+='";o.replace(n,function(t,e,r,n,i){return s+=o.slice(a,i).replace(G,W),a=i+t.length,e?s+="'+\n((__t=("+e+"))==null?'':_.escape(__t))+\n'":r?s+="'+\n((__t=("+r+"))==null?'':__t)+\n'":n&&(s+="';\n"+n+"\n__p+='"),t}),s+="';\n",t.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{r=new Function(t.variable||"obj","_",s)}catch(t){throw t.source=s,t}var i=function(t){return r.call(this,t,d)},u=t.variable||"obj";return i.source="function("+u+"){\n"+s+"}",i},d.chain=function(t){var e=d(t);return e._chain=!0,e};var Y=function(t,e){return t._chain?d(e).chain():e};d.mixin=function(r){return d.each(d.functions(r),function(t){var e=d[t]=r[t];d.prototype[t]=function(){var t=[this._wrapped];return i.apply(t,arguments),Y(this,e.apply(d,t))}}),d},d.mixin(d),d.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var r=n[e];d.prototype[e]=function(){var t=this._wrapped;return r.apply(t,arguments),"shift"!==e&&"splice"!==e||0!==t.length||delete t[0],Y(this,t)}}),d.each(["concat","join","slice"],function(t){var e=n[t];d.prototype[t]=function(){return Y(this,e.apply(this._wrapped,arguments))}}),d.prototype.valueOf=d.prototype.toJSON=d.prototype.value=function(){return this._wrapped},d.prototype.toString=function(){return String(this._wrapped)},"function"==typeof define&&define.amd&&define("underscore",[],function(){return d})}()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],205:[function(t,e,r){"use strict";e.exports=function(t,e){if(e){e=(e=e.trim().replace(/^(\?|#|&)/,""))?"?"+e:e;var r=t.split(/[\?\#]/),n=r[0];e&&/\:\/\/[^\/]*$/.test(n)&&(n+="/");var i=t.match(/(\#.*)$/);t=n+e,i&&(t+=i[0])}return t}},{}],206:[function(t,e,r){"use strict";var s=t("query-string"),u=t("url-set-query"),f=t("object-assign"),c=t("./lib/ensure-header.js"),l=t("./lib/request.js"),h="application/json",d=function(){};e.exports=function(t,e,r){if(!t||"string"!=typeof t)throw new TypeError("must specify a URL");"function"==typeof e&&(r=e,e={});if(r&&"function"!=typeof r)throw new TypeError("expected cb to be undefined or a function");r=r||d;var n=(e=e||{}).json?"json":"text",i=(e=f({responseType:n},e)).headers||{},o=(e.method||"GET").toUpperCase(),a=e.query;a&&("string"!=typeof a&&(a=s.stringify(a)),t=u(t,a));"json"===e.responseType&&c(i,"Accept",h);e.json&&"GET"!==o&&"HEAD"!==o&&(c(i,"Content-Type",h),e.body=JSON.stringify(e.body));return e.method=o,e.url=t,e.headers=i,delete e.query,delete e.json,l(e,r)}},{"./lib/ensure-header.js":207,"./lib/request.js":209,"object-assign":196,"query-string":198,"url-set-query":205}],207:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=e.toLowerCase();t[e]||t[n]||(t[e]=r)}},{}],208:[function(t,e,r){"use strict";e.exports=function(t,e){return e?{statusCode:e.statusCode,headers:e.headers,method:t.method,url:t.url,rawRequest:e.rawRequest?e.rawRequest:e}:null}},{}],209:[function(t,e,r){"use strict";var n=t("xhr"),s=t("./normalize-response"),u=function(){};e.exports=function(i,o){delete i.uri;var a=!1;"json"===i.responseType&&(i.responseType="text",a=!0);var e=n(i,function(e,t,r){if(a&&!e)try{var n=t.rawRequest.responseText;r=JSON.parse(n)}catch(t){e=t}t=s(i,t),o(e,e?null:r,t),o=u}),r=e.onabort;return e.onabort=function(){var t=r.apply(e,Array.prototype.slice.call(arguments));return o(new Error("XHR Aborted")),o=u,t},e}},{"./normalize-response":208,xhr:210}],210:[function(t,e,r){"use strict";var n=t("global/window"),i=t("is-function"),b=t("parse-headers"),o=t("xtend");function a(t,e,r){var n=t;return i(e)?(r=e,"string"==typeof t&&(n={uri:t})):n=o(e,{uri:t}),n.callback=r,n}function m(t,e,r){return s(e=a(t,e,r))}function s(n){if(void 0===n.callback)throw new Error("callback argument missing");var i=!1,o=function(t,e,r){i||(i=!0,n.callback(t,e,r))};function e(t){return clearTimeout(u),t instanceof Error||(t=new Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,o(t,y)}function t(){if(!a){var t;clearTimeout(u),t=n.useXDR&&void 0===s.status?200:1223===s.status?204:s.status;var e=y,r=null;return 0!==t?(e={body:function(){var t=void 0;if(t=s.response?s.response:s.responseText||function(t){try{if("document"===t.responseType)return t.responseXML;var e=t.responseXML&&"parsererror"===t.responseXML.documentElement.nodeName;if(""===t.responseType&&!e)return t.responseXML}catch(t){}return null}(s),p)try{t=JSON.parse(t)}catch(t){}return t}(),statusCode:t,method:c,headers:{},url:f,rawRequest:s},s.getAllResponseHeaders&&(e.headers=b(s.getAllResponseHeaders()))):r=new Error("Internal XMLHttpRequest Error"),o(r,e,e.body)}}var r,a,s=n.xhr||null;s||(s=n.cors||n.useXDR?new m.XDomainRequest:new m.XMLHttpRequest);var u,f=s.url=n.uri||n.url,c=s.method=n.method||"GET",l=n.body||n.data,h=s.headers=n.headers||{},d=!!n.sync,p=!1,y={body:void 0,headers:{},statusCode:0,method:c,url:f,rawRequest:s};if("json"in n&&!1!==n.json&&(p=!0,h.accept||h.Accept||(h.Accept="application/json"),"GET"!==c&&"HEAD"!==c&&(h["content-type"]||h["Content-Type"]||(h["Content-Type"]="application/json"),l=JSON.stringify(!0===n.json?l:n.json))),s.onreadystatechange=function(){4===s.readyState&&setTimeout(t,0)},s.onload=t,s.onerror=e,s.onprogress=function(){},s.onabort=function(){a=!0},s.ontimeout=e,s.open(c,f,!d,n.username,n.password),d||(s.withCredentials=!!n.withCredentials),!d&&0":">",'"':""","'":"'","`":"`"},q=d.invert(D),z=function(e){var r=function(t){return e[t]},t="(?:"+d.keys(e).join("|")+")",n=RegExp(t),i=RegExp(t,"g");return function(t){return t=null==t?"":""+t,n.test(t)?t.replace(i,r):t}};d.escape=z(D),d.unescape=z(q),d.result=function(t,e,r){d.isArray(e)||(e=[e]);var n=e.length;if(!n)return d.isFunction(r)?r.call(t):r;for(var i=0;i/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,V={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},G=/\\|'|\r|\n|\u2028|\u2029/g,W=function(t){return"\\"+V[t]};d.template=function(o,t,e){!t&&e&&(t=e),t=d.defaults({},t,d.templateSettings);var r,n=RegExp([(t.escape||K).source,(t.interpolate||K).source,(t.evaluate||K).source].join("|")+"|$","g"),a=0,s="__p+='";o.replace(n,function(t,e,r,n,i){return s+=o.slice(a,i).replace(G,W),a=i+t.length,e?s+="'+\n((__t=("+e+"))==null?'':_.escape(__t))+\n'":r?s+="'+\n((__t=("+r+"))==null?'':__t)+\n'":n&&(s+="';\n"+n+"\n__p+='"),t}),s+="';\n",t.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{r=new Function(t.variable||"obj","_",s)}catch(t){throw t.source=s,t}var i=function(t){return r.call(this,t,d)},u=t.variable||"obj";return i.source="function("+u+"){\n"+s+"}",i},d.chain=function(t){var e=d(t);return e._chain=!0,e};var Y=function(t,e){return t._chain?d(e).chain():e};d.mixin=function(r){return d.each(d.functions(r),function(t){var e=d[t]=r[t];d.prototype[t]=function(){var t=[this._wrapped];return i.apply(t,arguments),Y(this,e.apply(d,t))}}),d},d.mixin(d),d.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var r=n[e];d.prototype[e]=function(){var t=this._wrapped;return r.apply(t,arguments),"shift"!==e&&"splice"!==e||0!==t.length||delete t[0],Y(this,t)}}),d.each(["concat","join","slice"],function(t){var e=n[t];d.prototype[t]=function(){return Y(this,e.apply(this._wrapped,arguments))}}),d.prototype.valueOf=d.prototype.toJSON=d.prototype.value=function(){return this._wrapped},d.prototype.toString=function(){return String(this._wrapped)},"function"==typeof define&&define.amd&&define("underscore",[],function(){return d})}()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],214:[function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}e.exports={ErrorResponse:function(t){var e=t&&t.error&&t.error.message?t.error.message:JSON.stringify(t);return new Error("Returned error: "+e)},InvalidNumberOfParams:function(t,e,r){return new Error('Invalid number of parameters for "'+r+'". Got '+t+" expected "+e+"!")},InvalidConnection:function(t,e){return this.ConnectionError("CONNECTION ERROR: Couldn't connect to node "+t+".",e)},InvalidProvider:function(){return new Error("Provider not set or invalid")},InvalidResponse:function(t){var e=t&&t.error&&t.error.message?t.error.message:"Invalid JSON RPC response: "+JSON.stringify(t);return new Error(e)},ConnectionTimeout:function(t){return new Error("CONNECTION TIMEOUT: timeout of "+t+" ms achived")},ConnectionNotOpenError:function(t){return this.ConnectionError("connection not open on send()",t)},ConnectionCloseError:function(t){return"object"===n(t)&&t.code&&t.reason?this.ConnectionError("CONNECTION ERROR: The connection got closed with the close code `"+t.code+"` and the following reason string `"+t.reason+"`",t):new Error("CONNECTION ERROR: The connection closed unexpectedly")},MaxAttemptsReachedOnReconnectingError:function(){return new Error("Maximum number of reconnect attempts reached!")},PendingRequestsOnReconnectingError:function(){return new Error("CONNECTION ERROR: Provider started to reconnect before the response got received!")},ConnectionError:function(t,e){var r=new Error(t);return e&&(r.code=e.code,r.reason=e.reason),r},RevertInstructionError:function(t,e){var r=new Error("Your request got reverted with the following reason string: "+t);return r.reason=t,r.signature=e,r},TransactionRevertInstructionError:function(t,e,r){var n=new Error("Transaction has been reverted by the EVM:\n"+JSON.stringify(r,null,2));return n.reason=t,n.signature=e,n.receipt=r,n},TransactionError:function(t,e){var r=new Error(t);return r.receipt=e,r},NoContractAddressFoundError:function(t){return this.TransactionError("The transaction receipt didn't contain a contract address.",t)},ContractCodeNotStoredError:function(t){return this.TransactionError("The contract code couldn't be stored, please check your gas limit.",t)},TransactionRevertedWithoutReasonError:function(t){return this.TransactionError("Transaction has been reverted by the EVM:\n"+JSON.stringify(t,null,2),t)},TransactionOutOfGasError:function(t){return this.TransactionError("Transaction ran out of gas. Please provide more gas:\n"+JSON.stringify(t,null,2),t)}}},{}],215:[function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=t("underscore"),o=t("web3-utils"),a=t("web3-eth-iban"),s=function(t){return o.toBN(t).toString(10)},u=function(t){var e;if(void 0!==t)return"latest"===(e=t)||"pending"===e||"earliest"===e?t:"genesis"===t?"0x0":o.isHexStrict(t)?i.isString(t)?t.toLowerCase():t:o.numberToHex(t)},f=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&&!o.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]=o.numberToHex(e[t])}),e},c=function(t){return null!==t.blockNumber&&(t.blockNumber=o.hexToNumber(t.blockNumber)),null!==t.transactionIndex&&(t.transactionIndex=o.hexToNumber(t.transactionIndex)),t.nonce=o.hexToNumber(t.nonce),t.gas=o.hexToNumber(t.gas),t.gasPrice=s(t.gasPrice),t.value=s(t.value),t.to&&o.isAddress(t.to)?t.to=o.toChecksumAddress(t.to):t.to=null,t.from&&(t.from=o.toChecksumAddress(t.from)),t},l=function(t){if("string"==typeof t.blockHash&&"string"==typeof t.transactionHash&&"string"==typeof t.logIndex){var e=o.sha3(t.blockHash.replace("0x","")+t.transactionHash.replace("0x","")+t.logIndex.replace("0x",""));t.id="log_"+e.replace("0x","").substr(0,8)}else t.id||(t.id=null);return null!==t.blockNumber&&(t.blockNumber=o.hexToNumber(t.blockNumber)),null!==t.transactionIndex&&(t.transactionIndex=o.hexToNumber(t.transactionIndex)),null!==t.logIndex&&(t.logIndex=o.hexToNumber(t.logIndex)),t.address&&(t.address=o.toChecksumAddress(t.address)),t},h=function(t){var e=new a(t);if(e.isValid()&&e.isDirect())return e.toAddress().toLowerCase();if(o.isAddress(t))return"0x"+t.toLowerCase().replace("0x","");throw new Error('Provided address "'+t+"\" is invalid, the capitalization checksum test failed, or its an indrect IBAN address which can't be converted.")};e.exports={inputDefaultBlockNumberFormatter:function(t){return u(this&&null==t?this.defaultBlock:t)},inputBlockNumberFormatter:u,inputCallFormatter:function(t){var e=(t=f(t)).from||(this?this.defaultAccount:null);return e&&(t.from=h(e)),t},inputTransactionFormatter:function(t){if(t=f(t),!i.isNumber(t.from)&&!i.isObject(t.from)){if(t.from=t.from||(this?this.defaultAccount:null),!t.from&&!i.isNumber(t.from))throw new Error('The send transactions "from" field must be defined!');t.from=h(t.from)}return t},inputAddressFormatter:h,inputPostFormatter:function(t){return t.ttl&&(t.ttl=o.numberToHex(t.ttl)),t.workToProve&&(t.workToProve=o.numberToHex(t.workToProve)),t.priority&&(t.priority=o.numberToHex(t.priority)),i.isArray(t.topics)||(t.topics=t.topics?[t.topics]:[]),t.topics=t.topics.map(function(t){return 0===t.indexOf("0x")?t:o.fromUtf8(t)}),t},inputLogFormatter:function(t){var e=function(t){return null==t?null:0===(t=String(t)).indexOf("0x")?t:o.fromUtf8(t)};return(t.fromBlock||0===t.fromBlock)&&(t.fromBlock=u(t.fromBlock)),(t.toBlock||0===t.toBlock)&&(t.toBlock=u(t.toBlock)),t.topics=t.topics||[],t.topics=t.topics.map(function(t){return i.isArray(t)?t.map(e):e(t)}),e=null,t.address&&(t.address=i.isArray(t.address)?t.address.map(function(t){return h(t)}):h(t.address)),t},inputSignFormatter:function(t){return o.isHexStrict(t)?t:o.utf8ToHex(t)},inputStorageKeysFormatter:function(t){return t.map(o.numberToHex)},outputProofFormatter:function(t){return t.address=o.toChecksumAddress(t.address),t.nonce=o.hexToNumberString(t.nonce),t.balance=o.hexToNumberString(t.balance),t},outputBigNumberFormatter:s,outputTransactionFormatter:c,outputTransactionReceiptFormatter:function(t){if("object"!==n(t))throw new Error("Received receipt is invalid: "+t);return null!==t.blockNumber&&(t.blockNumber=o.hexToNumber(t.blockNumber)),null!==t.transactionIndex&&(t.transactionIndex=o.hexToNumber(t.transactionIndex)),t.cumulativeGasUsed=o.hexToNumber(t.cumulativeGasUsed),t.gasUsed=o.hexToNumber(t.gasUsed),i.isArray(t.logs)&&(t.logs=t.logs.map(l)),t.contractAddress&&(t.contractAddress=o.toChecksumAddress(t.contractAddress)),void 0!==t.status&&null!==t.status&&(t.status=Boolean(parseInt(t.status))),t},outputBlockFormatter:function(t){return t.gasLimit=o.hexToNumber(t.gasLimit),t.gasUsed=o.hexToNumber(t.gasUsed),t.size=o.hexToNumber(t.size),t.timestamp=o.hexToNumber(t.timestamp),null!==t.number&&(t.number=o.hexToNumber(t.number)),t.difficulty&&(t.difficulty=s(t.difficulty)),t.totalDifficulty&&(t.totalDifficulty=s(t.totalDifficulty)),i.isArray(t.transactions)&&t.transactions.forEach(function(t){if(!i.isString(t))return c(t)}),t.miner&&(t.miner=o.toChecksumAddress(t.miner)),t},outputLogFormatter:l,outputPostFormatter:function(t){return t.expiry=o.hexToNumber(t.expiry),t.sent=o.hexToNumber(t.sent),t.ttl=o.hexToNumber(t.ttl),t.workProved=o.hexToNumber(t.workProved),t.topics||(t.topics=[]),t.topics=t.topics.map(function(t){return o.toUtf8(t)}),t},outputSyncingFormatter:function(t){return t.startingBlock=o.hexToNumber(t.startingBlock),t.currentBlock=o.hexToNumber(t.currentBlock),t.highestBlock=o.hexToNumber(t.highestBlock),t.knownStates&&(t.knownStates=o.hexToNumber(t.knownStates),t.pulledStates=o.hexToNumber(t.pulledStates)),t}}},{underscore:213,"web3-eth-iban":449,"web3-utils":489}],216:[function(t,e,r){"use strict";var n=t("./errors"),i=t("./formatters");e.exports={errors:n,formatters:i}},{"./errors":214,"./formatters":215}],217:[function(t,Z,$){(function(X){"use strict";function J(t){return(J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(){var t="object"==("undefined"==typeof self?"undefined":J(self))&&self.self===self&&self||"object"==(void 0===X?"undefined":J(X))&&X.global===X&&X||this||{},e=t._,n=Array.prototype,a=Object.prototype,l="undefined"!=typeof Symbol?Symbol.prototype:null,i=n.push,u=n.slice,h=a.toString,o=a.hasOwnProperty,r=Array.isArray,s=Object.keys,f=Object.create,c=function(){},d=function t(e){return e instanceof t?e:this instanceof t?void(this._wrapped=e):new t(e)};void 0===$||$.nodeType?t._=d:(void 0!==Z&&!Z.nodeType&&Z.exports&&($=Z.exports=d),$._=d),d.VERSION="1.9.1";var p,y=function(i,o,t){if(void 0===o)return i;switch(null==t?3:t){case 1:return function(t){return i.call(o,t)};case 3:return function(t,e,r){return i.call(o,t,e,r)};case 4:return function(t,e,r,n){return i.call(o,t,e,r,n)}}return function(){return i.apply(o,arguments)}},b=function(t,e,r){return d.iteratee!==p?d.iteratee(t,e):null==t?d.identity:d.isFunction(t)?y(t,e,r):d.isObject(t)&&!d.isArray(t)?d.matcher(t):d.property(t)};d.iteratee=p=function(t,e){return b(t,e,1/0)};var m=function(i,o){return o=null==o?i.length-1:+o,function(){for(var t=Math.max(arguments.length-o,0),e=Array(t),r=0;r":">",'"':""","'":"'","`":"`"},q=d.invert(D),z=function(e){var r=function(t){return e[t]},t="(?:"+d.keys(e).join("|")+")",n=RegExp(t),i=RegExp(t,"g");return function(t){return t=null==t?"":""+t,n.test(t)?t.replace(i,r):t}};d.escape=z(D),d.unescape=z(q),d.result=function(t,e,r){d.isArray(e)||(e=[e]);var n=e.length;if(!n)return d.isFunction(r)?r.call(t):r;for(var i=0;i/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,V={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},G=/\\|'|\r|\n|\u2028|\u2029/g,W=function(t){return"\\"+V[t]};d.template=function(o,t,e){!t&&e&&(t=e),t=d.defaults({},t,d.templateSettings);var r,n=RegExp([(t.escape||K).source,(t.interpolate||K).source,(t.evaluate||K).source].join("|")+"|$","g"),a=0,s="__p+='";o.replace(n,function(t,e,r,n,i){return s+=o.slice(a,i).replace(G,W),a=i+t.length,e?s+="'+\n((__t=("+e+"))==null?'':_.escape(__t))+\n'":r?s+="'+\n((__t=("+r+"))==null?'':__t)+\n'":n&&(s+="';\n"+n+"\n__p+='"),t}),s+="';\n",t.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{r=new Function(t.variable||"obj","_",s)}catch(t){throw t.source=s,t}var i=function(t){return r.call(this,t,d)},u=t.variable||"obj";return i.source="function("+u+"){\n"+s+"}",i},d.chain=function(t){var e=d(t);return e._chain=!0,e};var Y=function(t,e){return t._chain?d(e).chain():e};d.mixin=function(r){return d.each(d.functions(r),function(t){var e=d[t]=r[t];d.prototype[t]=function(){var t=[this._wrapped];return i.apply(t,arguments),Y(this,e.apply(d,t))}}),d},d.mixin(d),d.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var r=n[e];d.prototype[e]=function(){var t=this._wrapped;return r.apply(t,arguments),"shift"!==e&&"splice"!==e||0!==t.length||delete t[0],Y(this,t)}}),d.each(["concat","join","slice"],function(t){var e=n[t];d.prototype[t]=function(){return Y(this,e.apply(this._wrapped,arguments))}}),d.prototype.valueOf=d.prototype.toJSON=d.prototype.value=function(){return this._wrapped},d.prototype.toString=function(){return String(this._wrapped)},"function"==typeof define&&define.amd&&define("underscore",[],function(){return d})}()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],218:[function(t,e,r){"use strict";function u(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function g(s){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=s.apply(t,a);function i(t){u(n,e,r,i,o,"next",t)}function o(t){u(n,e,r,i,o,"throw",t)}i(void 0)})}}var w=t("underscore"),_=t("web3-core-helpers").errors,A=t("web3-core-helpers").formatters,S=t("web3-utils"),x=t("web3-core-promievent"),i=t("web3-core-subscriptions").subscriptions,E=function(t){if(!t.call||!t.name)throw new Error('When creating a method you need to provide at least the "name" and "call" property.');this.name=t.name,this.call=t.call,this.params=t.params||0,this.inputFormatter=t.inputFormatter,this.outputFormatter=t.outputFormatter,this.transformPayload=t.transformPayload,this.extraFormatters=t.extraFormatters,this.abiCoder=t.abiCoder,this.requestManager=t.requestManager,this.accounts=t.accounts,this.defaultBlock=t.defaultBlock||"latest",this.defaultAccount=t.defaultAccount||null,this.transactionBlockTimeout=t.transactionBlockTimeout||50,this.transactionConfirmationBlocks=t.transactionConfirmationBlocks||24,this.transactionPollingTimeout=t.transactionPollingTimeout||750,this.defaultCommon=t.defaultCommon,this.defaultChain=t.defaultChain,this.defaultHardfork=t.defaultHardfork,this.handleRevert=t.handleRevert};E.prototype.setRequestManager=function(t,e){this.requestManager=t,e&&(this.accounts=e)},E.prototype.createFunction=function(t,e){var r=this.buildCall();return r.call=this.call,this.setRequestManager(t||this.requestManager,e||this.accounts),r},E.prototype.attachToObject=function(t){var e=this.buildCall();e.call=this.call;var r=this.name.split(".");1=u.transactionPollingTimeout&&(o.unsubscribe(),f=!0,S._fireError(_.TransactionError("Transaction was not mined within "+u.transactionPollingTimeout+" seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!"),a.eventEmitter,a.reject)):l-1>=u.transactionBlockTimeout&&(o.unsubscribe(),f=!0,S._fireError(_.TransactionError("Transaction was not mined within "+u.transactionBlockTimeout+" blocks, please make sure your transaction was properly sent. Be aware that it might still be mined!"),a.eventEmitter,a.reject))});o.unsubscribe(),f=!0,S._fireError({message:"Failed to subscribe to new newBlockHeaders to confirm the transaction receipts.",data:t},a.eventEmitter,a.reject)},n=function(t){w.isFunction(this.requestManager.provider.on)?v.subscribe("newBlockHeaders",e.bind(null,t,!1)):d=setInterval(e.bind(null,t,!0),1e3)}.bind(this);v.getTransactionReceipt(r).then(function(t){t&&t.blockHash?(0":">",'"':""","'":"'","`":"`"},q=d.invert(D),z=function(e){var r=function(t){return e[t]},t="(?:"+d.keys(e).join("|")+")",n=RegExp(t),i=RegExp(t,"g");return function(t){return t=null==t?"":""+t,n.test(t)?t.replace(i,r):t}};d.escape=z(D),d.unescape=z(q),d.result=function(t,e,r){d.isArray(e)||(e=[e]);var n=e.length;if(!n)return d.isFunction(r)?r.call(t):r;for(var i=0;i/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,V={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},G=/\\|'|\r|\n|\u2028|\u2029/g,W=function(t){return"\\"+V[t]};d.template=function(o,t,e){!t&&e&&(t=e),t=d.defaults({},t,d.templateSettings);var r,n=RegExp([(t.escape||K).source,(t.interpolate||K).source,(t.evaluate||K).source].join("|")+"|$","g"),a=0,s="__p+='";o.replace(n,function(t,e,r,n,i){return s+=o.slice(a,i).replace(G,W),a=i+t.length,e?s+="'+\n((__t=("+e+"))==null?'':_.escape(__t))+\n'":r?s+="'+\n((__t=("+r+"))==null?'':__t)+\n'":n&&(s+="';\n"+n+"\n__p+='"),t}),s+="';\n",t.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{r=new Function(t.variable||"obj","_",s)}catch(t){throw t.source=s,t}var i=function(t){return r.call(this,t,d)},u=t.variable||"obj";return i.source="function("+u+"){\n"+s+"}",i},d.chain=function(t){var e=d(t);return e._chain=!0,e};var Y=function(t,e){return t._chain?d(e).chain():e};d.mixin=function(r){return d.each(d.functions(r),function(t){var e=d[t]=r[t];d.prototype[t]=function(){var t=[this._wrapped];return i.apply(t,arguments),Y(this,e.apply(d,t))}}),d},d.mixin(d),d.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var r=n[e];d.prototype[e]=function(){var t=this._wrapped;return r.apply(t,arguments),"shift"!==e&&"splice"!==e||0!==t.length||delete t[0],Y(this,t)}}),d.each(["concat","join","slice"],function(t){var e=n[t];d.prototype[t]=function(){return Y(this,e.apply(this._wrapped,arguments))}}),d.prototype.valueOf=d.prototype.toJSON=d.prototype.value=function(){return this._wrapped},d.prototype.toString=function(){return String(this._wrapped)},"function"==typeof define&&define.amd&&define("underscore",[],function(){return d})}()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],222:[function(t,e,r){"use strict";var i=t("./jsonrpc"),o=t("web3-core-helpers").errors,n=function(t){this.requestManager=t,this.requests=[]};n.prototype.add=function(t){this.requests.push(t)},n.prototype.execute=function(){var n=this.requests;this.requestManager.sendBatch(n,function(t,r){r=r||[],n.map(function(t,e){return r[e]||{}}).forEach(function(t,e){if(n[e].callback){if(t&&t.error)return n[e].callback(o.ErrorResponse(t));if(!i.isValidResponse(t))return n[e].callback(o.InvalidResponse(t));try{n[e].callback(null,n[e].format?n[e].format(t.result):t.result)}catch(t){n[e].callback(t)}}})})},e.exports=n},{"./jsonrpc":225,"web3-core-helpers":216}],223:[function(t,e,r){"use strict";var n,i=null;try{n=Function("return this")()}catch(t){n=window}void 0!==n.ethereumProvider?i=n.ethereumProvider:void 0!==n.web3&&n.web3.currentProvider&&(n.web3.currentProvider.sendAsync&&(n.web3.currentProvider.send=n.web3.currentProvider.sendAsync,delete n.web3.currentProvider.sendAsync),!n.web3.currentProvider.on&&n.web3.currentProvider.connection&&"ipcProviderWrapper"===n.web3.currentProvider.connection.constructor.name&&(n.web3.currentProvider.on=function(t,r){if("function"!=typeof r)throw new Error("The second parameter callback must be a function.");switch(t){case"data":this.connection.on("data",function(e){var t="";e=e.toString();try{t=JSON.parse(e)}catch(t){return r(new Error("Couldn't parse response data"+e))}t.id||-1===t.method.indexOf("_subscription")||r(null,t)});break;default:this.connection.on(t,r)}}),i=n.web3.currentProvider),e.exports=i},{}],224:[function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=t("underscore"),o=t("web3-core-helpers").errors,a=t("./jsonrpc.js"),s=t("./batch.js"),u=t("./givenProvider.js"),f=function t(e,r){this.provider=null,this.providers=t.providers,this.setProvider(e,r),this.subscriptions=new Map};f.givenProvider=u,f.providers={WebsocketProvider:t("web3-providers-ws"),HttpProvider:t("web3-providers-http"),IpcProvider:t("web3-providers-ipc")},f.prototype.setProvider=function(t,e){var r=this;if(t&&"string"==typeof t&&this.providers)if(/^http(s)?:\/\//i.test(t))t=new this.providers.HttpProvider(t);else if(/^ws(s)?:\/\//i.test(t))t=new this.providers.WebsocketProvider(t);else if(t&&"object"===n(e)&&"function"==typeof e.connect)t=new this.providers.IpcProvider(t,e);else if(t)throw new Error("Can't autodetect provider for \""+t+'"');this.provider&&this.provider.connected&&this.clearSubscriptions(),this.provider=t||null,this.provider&&this.provider.on&&(this.provider.on("data",function(t,e){(t=t||e).method&&r.subscriptions.has(t.params.subscription)&&r.subscriptions.get(t.params.subscription).callback(null,t.params.result)}),this.provider.on("connect",function(){r.subscriptions.forEach(function(t){t.subscription.resubscribe()})}),this.provider.on("error",function(e){r.subscriptions.forEach(function(t){t.callback(e)})}),this.provider.on("close",function(e){r._isCleanCloseEvent(e)&&!r._isIpcCloseError(e)||r.subscriptions.forEach(function(t){t.callback(o.ConnectionCloseError(e)),r.subscriptions.delete(t.subscription.id)})}))},f.prototype.send=function(t,r){if(r=r||function(){},!this.provider)return r(o.InvalidProvider());var n=a.toPayload(t.method,t.params);this.provider[this.provider.sendAsync?"sendAsync":"send"](n,function(t,e){return e&&e.id&&n.id!==e.id?r(new Error('Wrong response id "'+e.id+'" (expected: "'+n.id+'") in '+JSON.stringify(n))):t?r(t):e&&e.error?r(o.ErrorResponse(e)):a.isValidResponse(e)?void r(null,e.result):r(o.InvalidResponse(e))})},f.prototype.sendBatch=function(t,r){if(!this.provider)return r(o.InvalidProvider());var e=a.toBatchPayload(t);this.provider[this.provider.sendAsync?"sendAsync":"send"](e,function(t,e){return t?r(t):i.isArray(e)?void r(null,e):r(o.InvalidResponse(e))})},f.prototype.addSubscription=function(t,e){if(!this.provider.on)throw new Error("The provider doesn't support subscriptions: "+this.provider.constructor.name);this.subscriptions.set(t.id,{callback:e,subscription:t})},f.prototype.removeSubscription=function(t,e){if(this.subscriptions.has(t)){var r=this.subscriptions.get(t).subscription.options.type;return this.subscriptions.delete(t),void this.send({method:r+"_unsubscribe",params:[t]},e)}"function"==typeof e&&e(null)},f.prototype.clearSubscriptions=function(r){var n=this;0":">",'"':""","'":"'","`":"`"},q=d.invert(D),z=function(e){var r=function(t){return e[t]},t="(?:"+d.keys(e).join("|")+")",n=RegExp(t),i=RegExp(t,"g");return function(t){return t=null==t?"":""+t,n.test(t)?t.replace(i,r):t}};d.escape=z(D),d.unescape=z(q),d.result=function(t,e,r){d.isArray(e)||(e=[e]);var n=e.length;if(!n)return d.isFunction(r)?r.call(t):r;for(var i=0;i/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,V={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},G=/\\|'|\r|\n|\u2028|\u2029/g,W=function(t){return"\\"+V[t]};d.template=function(o,t,e){!t&&e&&(t=e),t=d.defaults({},t,d.templateSettings);var r,n=RegExp([(t.escape||K).source,(t.interpolate||K).source,(t.evaluate||K).source].join("|")+"|$","g"),a=0,s="__p+='";o.replace(n,function(t,e,r,n,i){return s+=o.slice(a,i).replace(G,W),a=i+t.length,e?s+="'+\n((__t=("+e+"))==null?'':_.escape(__t))+\n'":r?s+="'+\n((__t=("+r+"))==null?'':__t)+\n'":n&&(s+="';\n"+n+"\n__p+='"),t}),s+="';\n",t.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{r=new Function(t.variable||"obj","_",s)}catch(t){throw t.source=s,t}var i=function(t){return r.call(this,t,d)},u=t.variable||"obj";return i.source="function("+u+"){\n"+s+"}",i},d.chain=function(t){var e=d(t);return e._chain=!0,e};var Y=function(t,e){return t._chain?d(e).chain():e};d.mixin=function(r){return d.each(d.functions(r),function(t){var e=d[t]=r[t];d.prototype[t]=function(){var t=[this._wrapped];return i.apply(t,arguments),Y(this,e.apply(d,t))}}),d},d.mixin(d),d.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var r=n[e];d.prototype[e]=function(){var t=this._wrapped;return r.apply(t,arguments),"shift"!==e&&"splice"!==e||0!==t.length||delete t[0],Y(this,t)}}),d.each(["concat","join","slice"],function(t){var e=n[t];d.prototype[t]=function(){return Y(this,e.apply(this._wrapped,arguments))}}),d.prototype.valueOf=d.prototype.toJSON=d.prototype.value=function(){return this._wrapped},d.prototype.toString=function(){return String(this._wrapped)},"function"==typeof define&&define.amd&&define("underscore",[],function(){return d})}()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],228:[function(t,e,r){"use strict";var n=t("./subscription.js"),i=function(t){this.name=t.name,this.type=t.type,this.subscriptions=t.subscriptions||{},this.requestManager=null};i.prototype.setRequestManager=function(t){this.requestManager=t},i.prototype.attachToObject=function(t){var e=this.buildCall(),r=this.name.split(".");1>>26-a&67108863,26<=(a+=24)&&(a-=26,i++);else if("le"===r)for(i=n=0;n>>26-a&67108863,26<=(a+=24)&&(a-=26,i++);return this.strip()},m.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r>>26-o&4194303,26<=(o+=24)&&(o-=26,n++);r+6!==e&&(i=a(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},m.prototype._parseBase=function(t,e,r){this.words=[0];for(var n=0,i=this.length=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f"};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function i(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;n=(r.length=n)-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var f=1;f>>26,l=67108863&u,h=Math.min(f,e.length-1),d=Math.max(0,f-t.length+1);d<=h;d++){var p=f-d|0;c+=(a=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&a}r.words[f]=0|l,u=0|c}return 0!==u?r.words[f]=0|u:r.length--,r.strip()}m.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,i=0,o=0;o>>24-n&16777215)||o!==this.length-1?h[6-s.length]+s+r:s+r,26<=(n+=2)&&(n-=26,o--)}for(0!==i&&(r=i.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&2<=t&&t<=36){var u=d[t],f=p[t];r="";var c=this.clone();for(c.negative=0;!c.isZero();){var l=c.modn(f).toString(t);r=(c=c.idivn(f)).isZero()?l+r:h[u-l.length]+l+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}b(!1,"Base should be between 2 and 36")},m.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:2>>=13),64<=e&&(r+=7,e>>>=7),8<=e&&(r+=4,e>>>=4),2<=e&&(r+=2,e>>>=2),r+e},m.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},m.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},m.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},m.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},m.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},m.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},m.prototype.iuxor=function(t){var e,r;r=this.length>t.length?(e=this,t):(e=t,this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},m.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},m.prototype.inotn=function(t){b("number"==typeof t&&0<=t);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),0>26-r),this.strip()},m.prototype.notn=function(t){return this.clone().inotn(t)},m.prototype.setn=function(t,e){b("number"==typeof t&&0<=t);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,t):(r=t,this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},m.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;n=0>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,y=d>>>13,b=0|a[2],m=8191&b,v=b>>>13,g=0|a[3],w=8191&g,_=g>>>13,A=0|a[4],S=8191&A,x=A>>>13,E=0|a[5],k=8191&E,M=E>>>13,j=0|a[6],I=8191&j,T=j>>>13,R=0|a[7],O=8191&R,B=R>>>13,U=0|a[8],C=8191&U,N=U>>>13,P=0|a[9],L=8191&P,F=P>>>13,D=0|s[0],q=8191&D,z=D>>>13,H=0|s[1],K=8191&H,V=H>>>13,G=0|s[2],W=8191&G,Y=G>>>13,X=0|s[3],J=8191&X,Z=X>>>13,$=0|s[4],Q=8191&$,tt=$>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ft=st>>>13,ct=0|s[8],lt=8191&ct,ht=ct>>>13,dt=0|s[9],pt=8191&dt,yt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var bt=(f+(n=Math.imul(l,q))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(h,q)|0))<<13)|0;f=((o=Math.imul(h,z))+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,z))+Math.imul(y,q)|0,o=Math.imul(y,z);var mt=(f+(n=n+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,V)|0)+Math.imul(h,K)|0))<<13)|0;f=((o=o+Math.imul(h,V)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,q),i=(i=Math.imul(m,z))+Math.imul(v,q)|0,o=Math.imul(v,z),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,V)|0;var vt=(f+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,Y)|0)+Math.imul(h,W)|0))<<13)|0;f=((o=o+Math.imul(h,Y)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,z))+Math.imul(_,q)|0,o=Math.imul(_,z),n=n+Math.imul(m,K)|0,i=(i=i+Math.imul(m,V)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,V)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Y)|0;var gt=(f+(n=n+Math.imul(l,J)|0)|0)+((8191&(i=(i=i+Math.imul(l,Z)|0)+Math.imul(h,J)|0))<<13)|0;f=((o=o+Math.imul(h,Z)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(S,q),i=(i=Math.imul(S,z))+Math.imul(x,q)|0,o=Math.imul(x,z),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(m,W)|0,i=(i=i+Math.imul(m,Y)|0)+Math.imul(v,W)|0,o=o+Math.imul(v,Y)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,Z)|0;var wt=(f+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(h,Q)|0))<<13)|0;f=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,q),i=(i=Math.imul(k,z))+Math.imul(M,q)|0,o=Math.imul(M,z),n=n+Math.imul(S,K)|0,i=(i=i+Math.imul(S,V)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,V)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(m,J)|0,i=(i=i+Math.imul(m,Z)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,Z)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0;var _t=(f+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(h,rt)|0))<<13)|0;f=((o=o+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(I,q),i=(i=Math.imul(I,z))+Math.imul(T,q)|0,o=Math.imul(T,z),n=n+Math.imul(k,K)|0,i=(i=i+Math.imul(k,V)|0)+Math.imul(M,K)|0,o=o+Math.imul(M,V)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,Y)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(m,Q)|0,i=(i=i+Math.imul(m,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0;var At=(f+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,at)|0)+Math.imul(h,ot)|0))<<13)|0;f=((o=o+Math.imul(h,at)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(O,q),i=(i=Math.imul(O,z))+Math.imul(B,q)|0,o=Math.imul(B,z),n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(T,K)|0,o=o+Math.imul(T,V)|0,n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,Y)|0,n=n+Math.imul(S,J)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,Z)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(m,rt)|0,i=(i=i+Math.imul(m,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0;var St=(f+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ft)|0)+Math.imul(h,ut)|0))<<13)|0;f=((o=o+Math.imul(h,ft)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(C,q),i=(i=Math.imul(C,z))+Math.imul(N,q)|0,o=Math.imul(N,z),n=n+Math.imul(O,K)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,V)|0,n=n+Math.imul(I,W)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,Y)|0,n=n+Math.imul(k,J)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,Z)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(m,ot)|0,i=(i=i+Math.imul(m,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ft)|0;var xt=(f+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(h,lt)|0))<<13)|0;f=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(L,q),i=(i=Math.imul(L,z))+Math.imul(F,q)|0,o=Math.imul(F,z),n=n+Math.imul(C,K)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(N,K)|0,o=o+Math.imul(N,V)|0,n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(B,W)|0,o=o+Math.imul(B,Y)|0,n=n+Math.imul(I,J)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,Z)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,n=n+Math.imul(m,ut)|0,i=(i=i+Math.imul(m,ft)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ft)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ht)|0;var Et=(f+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,yt)|0)+Math.imul(h,pt)|0))<<13)|0;f=((o=o+Math.imul(h,yt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(L,K),i=(i=Math.imul(L,V))+Math.imul(F,K)|0,o=Math.imul(F,V),n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,Y)|0)+Math.imul(N,W)|0,o=o+Math.imul(N,Y)|0,n=n+Math.imul(O,J)|0,i=(i=i+Math.imul(O,Z)|0)+Math.imul(B,J)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,at)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,at)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ft)|0,n=n+Math.imul(m,lt)|0,i=(i=i+Math.imul(m,ht)|0)+Math.imul(v,lt)|0,o=o+Math.imul(v,ht)|0;var kt=(f+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,yt)|0)+Math.imul(y,pt)|0))<<13)|0;f=((o=o+Math.imul(y,yt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(L,W),i=(i=Math.imul(L,Y))+Math.imul(F,W)|0,o=Math.imul(F,Y),n=n+Math.imul(C,J)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,Z)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,at)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,at)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ft)|0,n=n+Math.imul(w,lt)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,ht)|0;var Mt=(f+(n=n+Math.imul(m,pt)|0)|0)+((8191&(i=(i=i+Math.imul(m,yt)|0)+Math.imul(v,pt)|0))<<13)|0;f=((o=o+Math.imul(v,yt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(L,J),i=(i=Math.imul(L,Z))+Math.imul(F,J)|0,o=Math.imul(F,Z),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,at)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,at)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ft)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ft)|0,n=n+Math.imul(S,lt)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ht)|0;var jt=(f+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,yt)|0)+Math.imul(_,pt)|0))<<13)|0;f=((o=o+Math.imul(_,yt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,n=Math.imul(L,Q),i=(i=Math.imul(L,tt))+Math.imul(F,Q)|0,o=Math.imul(F,tt),n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,at)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,at)|0,n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ft)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ft)|0,n=n+Math.imul(k,lt)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ht)|0;var It=(f+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,yt)|0)+Math.imul(x,pt)|0))<<13)|0;f=((o=o+Math.imul(x,yt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(L,rt),i=(i=Math.imul(L,nt))+Math.imul(F,rt)|0,o=Math.imul(F,nt),n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,n=n+Math.imul(O,ut)|0,i=(i=i+Math.imul(O,ft)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ft)|0,n=n+Math.imul(I,lt)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(T,lt)|0,o=o+Math.imul(T,ht)|0;var Tt=(f+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,yt)|0)+Math.imul(M,pt)|0))<<13)|0;f=((o=o+Math.imul(M,yt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(L,ot),i=(i=Math.imul(L,at))+Math.imul(F,ot)|0,o=Math.imul(F,at),n=n+Math.imul(C,ut)|0,i=(i=i+Math.imul(C,ft)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ft)|0,n=n+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(B,lt)|0,o=o+Math.imul(B,ht)|0;var Rt=(f+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,yt)|0)+Math.imul(T,pt)|0))<<13)|0;f=((o=o+Math.imul(T,yt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(L,ut),i=(i=Math.imul(L,ft))+Math.imul(F,ut)|0,o=Math.imul(F,ft),n=n+Math.imul(C,lt)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,ht)|0;var Ot=(f+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,yt)|0)+Math.imul(B,pt)|0))<<13)|0;f=((o=o+Math.imul(B,yt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(L,lt),i=(i=Math.imul(L,ht))+Math.imul(F,lt)|0,o=Math.imul(F,ht);var Bt=(f+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,yt)|0)+Math.imul(N,pt)|0))<<13)|0;f=((o=o+Math.imul(N,yt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var Ut=(f+(n=Math.imul(L,pt))|0)+((8191&(i=(i=Math.imul(L,yt))+Math.imul(F,pt)|0))<<13)|0;return f=((o=Math.imul(F,yt))+(i>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,u[0]=bt,u[1]=mt,u[2]=vt,u[3]=gt,u[4]=wt,u[5]=_t,u[6]=At,u[7]=St,u[8]=xt,u[9]=Et,u[10]=kt,u[11]=Mt,u[12]=jt,u[13]=It,u[14]=Tt,u[15]=Rt,u[16]=Ot,u[17]=Bt,u[18]=Ut,0!==f&&(u[19]=f,r.length++),r};function s(t,e,r){return(new u).mulp(t,e,r)}function u(t,e){this.x=t,this.y=e}Math.imul||(o=i),m.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?o(this,t,e):r<63?i(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):s(this,t,e)},u.prototype.makeRBT=function(t){for(var e=new Array(t),r=m.prototype._countBits(t)-1,n=0;n>=1;return n},u.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*o+1]=8191&i,i>>>=13;for(o=2*e;o>=26,e+=n/67108864|0,e+=i>>>26,this.words[r]=67108863&i}return 0!==e&&(this.words[r]=e,this.length++),this},m.prototype.muln=function(t){return this.clone().imuln(t)},m.prototype.sqr=function(){return this.mul(this)},m.prototype.isqr=function(){return this.imul(this.clone())},m.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new m(1);for(var r=this,n=0;n>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==n){for(e=this.length-1;0<=e;e--)this.words[e+n]=this.words[e];for(e=0;e>>i<o)for(this.length-=o,u=0;u>>i,f=c&a}return s&&0!==f&&(s.words[s.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},m.prototype.ishrn=function(t,e,r){return b(0===this.negative),this.iushrn(t,e,r)},m.prototype.shln=function(t){return this.clone().ishln(t)},m.prototype.ushln=function(t){return this.clone().iushln(t)},m.prototype.shrn=function(t){return this.clone().ishrn(t)},m.prototype.ushrn=function(t){return this.clone().iushrn(t)},m.prototype.testn=function(t){b("number"==typeof t&&0<=t);var e=t%26,r=(t-e)/26,n=1<>>e<>26)-(s/67108864|0),this.words[n+r]=67108863&i}for(;n>26,this.words[n+r]=67108863&i;if(0===a)return this.strip();for(b(-1===a),n=a=0;n>26,this.words[n]=67108863&i;return this.negative=1,this.strip()},m.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var a,s=n.length-i.length;if("mod"!==e){(a=new m(null)).length=s+1,a.words=new Array(a.length);for(var u=0;uthis.length||this.cmp(t)<0?{div:new m(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new m(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new m(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,i,o},m.prototype.div=function(t){return this.divmod(t,"div",!1).div},m.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},m.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},m.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},m.prototype.modn=function(t){b(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;0<=n;n--)r=(e*r+(0|this.words[n]))%t;return r},m.prototype.idivn=function(t){b(t<=67108863);for(var e=0,r=this.length-1;0<=r;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},m.prototype.divn=function(t){return this.clone().idivn(t)},m.prototype.egcd=function(t){b(0===t.negative),b(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new m(1),i=new m(0),o=new m(0),a=new m(1),s=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++s;for(var u=r.clone(),f=e.clone();!e.isZero();){for(var c=0,l=1;0==(e.words[0]&l)&&c<26;++c,l<<=1);if(0>>26,a&=67108863,this.words[o]=a}return 0!==i&&(this.words[o]=i,this.length++),this},m.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},m.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),1t.length)return 1;if(this.lengththis.n;);var n=e>>22,i=o}i>>>=22,0===(t.words[n-10]=i)&&10>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},m._prime=function(t){if(f[t])return f[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new v;else if("p192"===t)e=new g;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new w}return f[t]=e},_.prototype._verify1=function(t){b(0===t.negative,"red works only with positives"),b(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){b(0==(t.negative|e.negative),"red works only with positives"),b(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return 0<=r.cmp(this.m)&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(b(e%2==1),3===e){var r=this.m.add(new m(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),i=0;!n.isZero()&&0===n.andln(1);)i++,n.iushrn(1);b(!n.isZero());var o=new m(1).toRed(this),a=o.redNeg(),s=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new m(2*u*u).toRed(this);0!==this.pow(u,s).cmp(a);)u.redIAdd(a);for(var f=this.pow(u,n),c=this.pow(t,n.addn(1).iushrn(1)),l=this.pow(t,n),h=i;0!==l.cmp(o);){for(var d=l,p=0;0!==d.cmp(o);p++)d=d.redSqr();b(p>f&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==o?(o<<=1,o|=c,(4===++a||0===n&&0===f)&&(i=this.mul(i,r[o]),o=a=0)):a=0}s=26}return i},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},m.mont=function(t){return new A(t)},r(A,_),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return 0<=i.cmp(this.m)?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new m(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return 0<=i.cmp(this.m)?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t)},{buffer:21}],233:[function(t,e,r){"use strict";function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var n,i=(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var a=t("./address"),s=t("./bignumber"),u=t("./bytes"),c=t("./utf8"),l=t("./properties"),h=o(t("./errors")),d=new RegExp(/^bytes([0-9]*)$/),p=new RegExp(/^(u?int)([0-9]*)$/),y=new RegExp(/^(.*)\[([0-9]*)\]$/);r.defaultCoerceFunc=function(t,e){var r=t.match(p);return r&&parseInt(r[2])<=48?e.toNumber():e};var b=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),m=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function v(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}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;ot.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},t}(_),x=function(a){function t(t,e,r,n){var i=this,o=(r?"int":"uint")+8*e;return(i=a.call(this,t,o,o,n,!1)||this).size=e,i.signed=r,i}return i(t,a),t.prototype.encode=function(e){try{var t=s.bigNumberify(e);return t=t.toTwos(8*this.size).maskn(8*this.size),this.signed&&(t=t.fromTwos(8*this.size).toTwos(256)),u.padZeros(u.arrayify(t),32)}catch(t){h.throwError("invalid number value",h.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e})}return null},t.prototype.decode=function(t,e){t.length>1]>>4&&(e[i]=e[i].toUpperCase()),8<=(15&r[i>>1])&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}for(var c={},l=0;l<10;l++)c[String(l)]=String(l);for(l=0;l<26;l++)c[String.fromCharCode(65+l)]=String(10+l);var h,d=Math.floor((h=9007199254740991,Math.log10?Math.log10(h):Math.log(h)/Math.LN10));function p(t){t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00";var e="";for(t.split("").forEach(function(t){e+=c[t]});e.length>=d;){var r=e.substring(0,d);e=parseInt(r,10)%97+e.substring(r.length)}for(var n=String(98-parseInt(e,10)%97);n.length<2;)n="0"+n;return n}function y(t){var e=null;if("string"!=typeof t&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t}),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=f(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:t});else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==p(t)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:t}),e=new i.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=f("0x"+e)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});return e}r.getAddress=y,r.getIcapAddress=function(t){for(var e=new i.default.BN(y(t).substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+p("XE00"+e)+e},r.getContractAddress=function(t){if(!t.from)throw new Error("missing from address");var e=t.nonce;return y("0x"+a.keccak256(s.encode([y(t.from),o.stripZeros(o.hexlify(e))])).substring(26))}},{"./bytes":236,"./errors":237,"./keccak256":238,"./rlp":240,"bn.js":232}],235:[function(t,e,r){"use strict";var n,i=(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=function(t){return t&&t.__esModule?t:{default:t}},a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var s=o(t("bn.js")),u=t("./bytes"),f=t("./properties"),c=t("./types"),l=a(t("./errors")),h=new s.default.BN(-1);function d(t){var e=t.toString(16);return"-"===e[0]?e.length%2==0?"-0x0"+e.substring(1):"-0x"+e.substring(1):e.length%2==1?"0x0"+e:"0x"+e}function p(t){return m(t)._bn}function y(t){return new b(d(t))}var b=function(r){function n(t){var e=r.call(this)||this;if(l.checkNew(e,n),"string"==typeof t)u.isHexString(t)?("0x"==t&&(t="0x0"),f.defineReadOnly(e,"_hex",t)):"-"===t[0]&&u.isHexString(t.substring(1))?f.defineReadOnly(e,"_hex",t):t.match(/^-?[0-9]*$/)?(""==t&&(t="0"),f.defineReadOnly(e,"_hex",d(new s.default.BN(t)))):l.throwError("invalid BigNumber string value",l.INVALID_ARGUMENT,{arg:"value",value:t});else if("number"==typeof t){parseInt(String(t))!==t&&l.throwError("underflow",l.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:t,outputValue:parseInt(String(t))});try{f.defineReadOnly(e,"_hex",d(new s.default.BN(t)))}catch(t){l.throwError("overflow",l.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else t instanceof n?f.defineReadOnly(e,"_hex",t._hex):t.toHexString?f.defineReadOnly(e,"_hex",d(p(t.toHexString()))):u.isArrayish(t)?f.defineReadOnly(e,"_hex",d(new s.default.BN(u.hexlify(t).substring(2),16))):l.throwError("invalid BigNumber value",l.INVALID_ARGUMENT,{arg:"value",value:t});return e}return i(n,r),Object.defineProperty(n.prototype,"_bn",{get:function(){return"-"===this._hex[0]?new s.default.BN(this._hex.substring(3),16).mul(h):new s.default.BN(this._hex.substring(2),16)},enumerable:!0,configurable:!0}),n.prototype.fromTwos=function(t){return y(this._bn.fromTwos(t))},n.prototype.toTwos=function(t){return y(this._bn.toTwos(t))},n.prototype.add=function(t){return y(this._bn.add(p(t)))},n.prototype.sub=function(t){return y(this._bn.sub(p(t)))},n.prototype.div=function(t){return m(t).isZero()&&l.throwError("division by zero",l.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),y(this._bn.div(p(t)))},n.prototype.mul=function(t){return y(this._bn.mul(p(t)))},n.prototype.mod=function(t){return y(this._bn.mod(p(t)))},n.prototype.pow=function(t){return y(this._bn.pow(p(t)))},n.prototype.maskn=function(t){return y(this._bn.maskn(t))},n.prototype.eq=function(t){return this._bn.eq(p(t))},n.prototype.lt=function(t){return this._bn.lt(p(t))},n.prototype.lte=function(t){return this._bn.lte(p(t))},n.prototype.gt=function(t){return this._bn.gt(p(t))},n.prototype.gte=function(t){return this._bn.gte(p(t))},n.prototype.isZero=function(){return this._bn.isZero()},n.prototype.toNumber=function(){try{return this._bn.toNumber()}catch(t){l.throwError("overflow",l.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},n.prototype.toString=function(){return this._bn.toString(10)},n.prototype.toHexString=function(){return this._hex},n}(c.BigNumber);function m(t){return t instanceof b?t:new b(t)}r.bigNumberify=m,r.ConstantNegativeOne=m(-1),r.ConstantZero=m(0),r.ConstantOne=m(1),r.ConstantTwo=m(2),r.ConstantWeiPerEther=m("1000000000000000000")},{"./bytes":236,"./errors":237,"./properties":239,"./types":241,"bn.js":232}],236:[function(t,e,r){"use strict";function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(r,"__esModule",{value:!0});var n=t("./types"),s=t("./errors");function a(t){return t instanceof n.BigNumber}function u(e){return e.slice||(e.slice=function(){var t=Array.prototype.slice.call(arguments);return new Uint8Array(Array.prototype.slice.apply(e,t))}),e}function f(t){if(!t||parseInt(String(t.length))!=t.length||"string"==typeof t)return!1;for(var e=0;e>4]+h[15&o])}return"0x"+n.join("")}return s.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function p(t,e){for(l(t)||s.throwError("invalid hex string",s.INVALID_ARGUMENT,{arg:"value",value:t});t.length<2*e+2;)t="0x0"+t.substring(2);return t}function y(t){var e,r=0,n="0x",i="0x";if((e=t)&&null!=e.r&&null!=e.s){null==t.v&&null==t.recoveryParam&&s.throwError("at least on of recoveryParam or v must be specified",s.INVALID_ARGUMENT,{argument:"signature",value:t}),n=p(t.r,32),i=p(t.s,32),"string"==typeof(r=t.v)&&(r=parseInt(r,16));var o=t.recoveryParam;null==o&&null!=t.v&&(o=1-r%2),r=27+o}else{var a=c(t);if(65!==a.length)throw new Error("invalid signature");n=d(a.slice(0,32)),i=d(a.slice(32,64)),27!==(r=a[64])&&28!==r&&(r=27+r%2)}return{r:n,s:i,recoveryParam:r-27,v:r}}r.hexlify=d,r.hexDataLength=function(t){return l(t)&&t.length%2==0?(t.length-2)/2:null},r.hexDataSlice=function(t,e,r){return l(t)||s.throwError("invalid hex data",s.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2!=0&&s.throwError("hex data length must be even",s.INVALID_ARGUMENT,{arg:"value",value:t}),e=2+2*e,null!=r?"0x"+t.substring(e,e+2*r):"0x"+t.substring(e)},r.hexStripZeros=function(t){for(l(t)||s.throwError("invalid hex string",s.INVALID_ARGUMENT,{arg:"value",value:t});3>=8;return e}function i(t,e,r){for(var n=0,i=0;it.length)throw new Error("too short");if(e+1+r+(n=i(t,e+1,r))>t.length)throw new Error("to short");return s(t,e,e+1+r,r+n)}if(192<=t[e]){if(e+1+(n=t[e]-192)>t.length)throw new Error("invalid rlp data");return s(t,e,e+1,n)}if(184<=t[e]){var r;if(e+1+(r=t[e]-183)>t.length)throw new Error("invalid rlp data");if(e+1+r+(n=i(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+n,result:o.hexlify(t.slice(e+1+r,e+1+r+n))}}if(128<=t[e]){var n;if(e+1+(n=t[e]-128)>t.length)throw new Error("invlaid rlp data");return{consumed:1+n,result:o.hexlify(t.slice(e+1,e+1+n))}}return{consumed:1,result:o.hexlify(t[e])}}r.encode=function(t){return o.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):((n=a(r.length)).unshift(247+n.length),n.concat(r))}var n,i=Array.prototype.slice.call(o.arrayify(t));return 1===i.length&&i[0]<=127?i:i.length<=55?(i.unshift(128+i.length),i):((n=a(i.length)).unshift(183+n.length),n.concat(i))}(t))},r.decode=function(t){var e=o.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},{"./bytes":236}],241:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){};r.BigNumber=n;var i=function(){};r.Indexed=i;var o=function(){};r.MinimalProvider=o;var a=function(){};r.Signer=a;var s=function(){};r.HDNode=s},{}],242:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a,n,u=t("./bytes");(n=a=r.UnicodeNormalizationForm||(r.UnicodeNormalizationForm={})).current="",n.NFC="NFC",n.NFD="NFD",n.NFKC="NFKC",n.NFKD="NFKD",r.toUtf8Bytes=function(t,e){void 0===e&&(e=a.current),e!=a.current&&(t=t.normalize(e));for(var r=[],n=0,i=0;i>6|192:(55296==(64512&o)&&i+1>18|240,r[n++]=o>>12&63|128):r[n++]=o>>12|224,o>>6&63|128),63&o|128)}return u.arrayify(r)},r.toUtf8String=function(t){t=u.arrayify(t);for(var e="",r=0;r>7!=0){if(n>>6!=2){var i=null;if(n>>5==6)i=1;else if(n>>4==14)i=2;else if(n>>3==30)i=3;else if(n>>2==62)i=4;else{if(n>>1!=126)continue;i=5}if(r+i>t.length){for(;r>6==2;r++);if(r!=t.length)continue;return e}var o,a=n&(1<<8-i-1)-1;for(o=0;o>6!=2)break;a=a<<6|63&s}o==i?a<=65535?e+=String.fromCharCode(a):(a-=65536,e+=String.fromCharCode(55296+(a>>10&1023),56320+(1023&a))):r--}}else e+=String.fromCharCode(n)}return e}},{"./bytes":236}],243:[function(t,A,e){(function(g,w){"use strict";function _(t){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(){var t="object"===("undefined"==typeof window?"undefined":_(window))?window:{};!t.JS_SHA3_NO_NODE_JS&&"object"===(void 0===g?"undefined":_(g))&&g.versions&&g.versions.node&&(t=w);for(var e=!t.JS_SHA3_NO_COMMON_JS&&"object"===(void 0===A?"undefined":_(A))&&A.exports,u="0123456789abcdef".split(""),c=[0,8,16,24],ct=[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],r=[224,256,384,512],o=["hex","buffer","arrayBuffer","array"],a=function(e,r,n){return function(t){return new m(e,r,e).update(t)[n]()}},s=function(r,n,i){return function(t,e){return new m(r,n,e).update(t)[i]()}},n=function(t,e){var r=a(t,e,"hex");r.create=function(){return new m(t,e,t)},r.update=function(t){return r.create().update(t)};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}m.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,n,i=t.length,o=this.blocks,a=this.byteCount,s=this.blockCount,u=0,f=this.s;u>2]|=t[u]<>2]|=n<>2]|=(192|n>>6)<>2]|=(224|n>>12)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+u[15&t]+u[t>>12&15]+u[t>>8&15]+u[t>>20&15]+u[t>>16&15]+u[t>>28&15]+u[t>>24&15];a%e==0&&(v(r),o=0)}return i&&(t=r[o],0>4&15]+u[15&t]),1>12&15]+u[t>>8&15]),2>20&15]+u[t>>16&15])),s},m.prototype.buffer=m.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(t);a>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;s%r==0&&v(n)}return o&&(t=s<<2,e=n[a],0>8&255),2>16&255)),u};var v=function(t){var e,r,n,i,o,a,s,u,f,c,l,h,d,p,y,b,m,v,g,w,_,A,S,x,E,k,M,j,I,T,R,O,B,U,C,N,P,L,F,D,q,z,H,K,V,G,W,Y,X,J,Z,$,Q,tt,et,rt,nt,it,ot,at,st,ut,ft;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],f=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],e=(h=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|s>>>31),r=(d=t[9]^t[19]^t[29]^t[39]^t[49])^(s<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(u<<1|f>>>31),r=o^(f<<1|u>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(c<<1|l>>>31),r=s^(l<<1|c>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=u^(h<<1|d>>>31),r=f^(d<<1|h>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=c^(i<<1|o>>>31),r=l^(o<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,p=t[0],y=t[1],G=t[11]<<4|t[10]>>>28,W=t[10]<<4|t[11]>>>28,j=t[20]<<3|t[21]>>>29,I=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,st=t[30]<<9|t[31]>>>23,z=t[40]<<18|t[41]>>>14,H=t[41]<<18|t[40]>>>14,U=t[2]<<1|t[3]>>>31,C=t[3]<<1|t[2]>>>31,b=t[13]<<12|t[12]>>>20,m=t[12]<<12|t[13]>>>20,Y=t[22]<<10|t[23]>>>22,X=t[23]<<10|t[22]>>>22,T=t[33]<<13|t[32]>>>19,R=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,ft=t[43]<<2|t[42]>>>30,tt=t[5]<<30|t[4]>>>2,et=t[4]<<30|t[5]>>>2,N=t[14]<<6|t[15]>>>26,P=t[15]<<6|t[14]>>>26,v=t[25]<<11|t[24]>>>21,g=t[24]<<11|t[25]>>>21,J=t[34]<<15|t[35]>>>17,Z=t[35]<<15|t[34]>>>17,O=t[45]<<29|t[44]>>>3,B=t[44]<<29|t[45]>>>3,x=t[6]<<28|t[7]>>>4,E=t[7]<<28|t[6]>>>4,rt=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,L=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,w=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,Q=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,V=t[9]<<27|t[8]>>>5,k=t[18]<<20|t[19]>>>12,M=t[19]<<20|t[18]>>>12,it=t[29]<<7|t[28]>>>25,ot=t[28]<<7|t[29]>>>25,D=t[38]<<8|t[39]>>>24,q=t[39]<<8|t[38]>>>24,A=t[48]<<14|t[49]>>>18,S=t[49]<<14|t[48]>>>18,t[0]=p^~b&v,t[1]=y^~m&g,t[10]=x^~k&j,t[11]=E^~M&I,t[20]=U^~N&L,t[21]=C^~P&F,t[30]=K^~G&Y,t[31]=V^~W&X,t[40]=tt^~rt&it,t[41]=et^~nt&ot,t[2]=b^~v&w,t[3]=m^~g&_,t[12]=k^~j&T,t[13]=M^~I&R,t[22]=N^~L&D,t[23]=P^~F&q,t[32]=G^~Y&J,t[33]=W^~X&Z,t[42]=rt^~it&at,t[43]=nt^~ot&st,t[4]=v^~w&A,t[5]=g^~_&S,t[14]=j^~T&O,t[15]=I^~R&B,t[24]=L^~D&z,t[25]=F^~q&H,t[34]=Y^~J&$,t[35]=X^~Z&Q,t[44]=it^~at&ut,t[45]=ot^~st&ft,t[6]=w^~A&p,t[7]=_^~S&y,t[16]=T^~O&x,t[17]=R^~B&E,t[26]=D^~z&U,t[27]=q^~H&C,t[36]=J^~$&K,t[37]=Z^~Q&V,t[46]=at^~ut&tt,t[47]=st^~ft&et,t[8]=A^~p&b,t[9]=S^~y&m,t[18]=O^~x&k,t[19]=B^~E&M,t[28]=z^~U&N,t[29]=H^~C&P,t[38]=$^~K&G,t[39]=Q^~V&W,t[48]=ut^~tt&rt,t[49]=ft^~et&nt,t[0]^=ct[n],t[1]^=ct[n+1]};if(e)A.exports=f;else for(h=0;h":">",'"':""","'":"'","`":"`"},q=d.invert(D),z=function(e){var r=function(t){return e[t]},t="(?:"+d.keys(e).join("|")+")",n=RegExp(t),i=RegExp(t,"g");return function(t){return t=null==t?"":""+t,n.test(t)?t.replace(i,r):t}};d.escape=z(D),d.unescape=z(q),d.result=function(t,e,r){d.isArray(e)||(e=[e]);var n=e.length;if(!n)return d.isFunction(r)?r.call(t):r;for(var i=0;i/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,V={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},G=/\\|'|\r|\n|\u2028|\u2029/g,W=function(t){return"\\"+V[t]};d.template=function(o,t,e){!t&&e&&(t=e),t=d.defaults({},t,d.templateSettings);var r,n=RegExp([(t.escape||K).source,(t.interpolate||K).source,(t.evaluate||K).source].join("|")+"|$","g"),a=0,s="__p+='";o.replace(n,function(t,e,r,n,i){return s+=o.slice(a,i).replace(G,W),a=i+t.length,e?s+="'+\n((__t=("+e+"))==null?'':_.escape(__t))+\n'":r?s+="'+\n((__t=("+r+"))==null?'':__t)+\n'":n&&(s+="';\n"+n+"\n__p+='"),t}),s+="';\n",t.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{r=new Function(t.variable||"obj","_",s)}catch(t){throw t.source=s,t}var i=function(t){return r.call(this,t,d)},u=t.variable||"obj";return i.source="function("+u+"){\n"+s+"}",i},d.chain=function(t){var e=d(t);return e._chain=!0,e};var Y=function(t,e){return t._chain?d(e).chain():e};d.mixin=function(r){return d.each(d.functions(r),function(t){var e=d[t]=r[t];d.prototype[t]=function(){var t=[this._wrapped];return i.apply(t,arguments),Y(this,e.apply(d,t))}}),d},d.mixin(d),d.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var r=n[e];d.prototype[e]=function(){var t=this._wrapped;return r.apply(t,arguments),"shift"!==e&&"splice"!==e||0!==t.length||delete t[0],Y(this,t)}}),d.each(["concat","join","slice"],function(t){var e=n[t];d.prototype[t]=function(){return Y(this,e.apply(this._wrapped,arguments))}}),d.prototype.valueOf=d.prototype.toJSON=d.prototype.value=function(){return this._wrapped},d.prototype.toString=function(){return String(this._wrapped)},"function"==typeof define&&define.amd&&define("underscore",[],function(){return d})}()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],245:[function(t,e,r){"use strict";function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var c=t("underscore"),n=t("web3-utils"),o=new(t("ethers/utils/abi-coder").AbiCoder)(function(t,e){return!t.match(/^u?int/)||c.isArray(e)||c.isObject(e)&&"BN"===e.constructor.name?e:e.toString()});function l(){}var a=function(){};a.prototype.encodeFunctionSignature=function(t){return c.isObject(t)&&(t=n._jsonInterfaceMethodToString(t)),n.sha3(t).slice(0,10)},a.prototype.encodeEventSignature=function(t){return c.isObject(t)&&(t=n._jsonInterfaceMethodToString(t)),n.sha3(t)},a.prototype.encodeParameter=function(t,e){return this.encodeParameters([t],[e])},a.prototype.encodeParameters=function(t,e){return o.encode(this.mapTypes(t),e.map(function(t){return n.isBN(t)||n.isBigNumber(t)?t.toString(10):t}))},a.prototype.mapTypes=function(t){var r=this,n=[];return t.forEach(function(t){if(r.isSimplifiedStructFormat(t)){var e=Object.keys(t)[0];n.push(Object.assign(r.mapStructNameAndType(e),{components:r.mapStructToCoderFormat(t[e])}))}else n.push(t)}),n},a.prototype.isSimplifiedStructFormat=function(t){return"object"===i(t)&&void 0===t.components&&void 0===t.name},a.prototype.mapStructNameAndType=function(t){var e="tuple";return-1=t.length)return!1;if(2!==t[4+e])return!1;var r=t[5+e];return!(0===r||6+e+r!==t.length||128&t[4]||1=t.length)throw new Error("R length is too long");if(2!==t[4+e])throw new Error("Expected DER integer (2)");var r=t[5+e];if(0===r)throw new Error("S length is zero");if(6+e+r!==t.length)throw new Error("S length is invalid");if(128&t[4])throw new Error("R value is negative");if(1=e)throw new Error("invalid sig")}e.exports=function(t,e,r,n,i){var o=y(r);if("ec"===o.type){if("ecdsa"!==n&&"ecdsa/rsa"!==n)throw new Error("wrong public key type");return function(t,e,r){var n=b[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var i=new p(n),o=r.data.subjectPrivateKey.data;return i.verify(e,t,o)}(t,e,o)}if("dsa"===o.type){if("dsa"!==n)throw new Error("wrong public key type");return function(t,e,r){var n=r.data.p,i=r.data.q,o=r.data.g,a=r.data.pub_key,s=y.signature.decode(t,"der"),u=s.s,f=s.r;m(u,i),m(f,i);var c=d.mont(n),l=u.invm(i);return 0===o.toRed(c).redPow(new d(e).mul(l).mod(i)).fromRed().mul(a.toRed(c).redPow(f.mul(l).mod(i)).fromRed()).mod(n).mod(i).cmp(f)}(t,e,o)}if("rsa"!==n&&"ecdsa/rsa"!==n)throw new Error("wrong public key type");e=h.concat([i,e]);for(var a=o.modulus.byteLength(),s=[1],u=0;e.length+s.length+2>>1];r=h.r28shl(r,o),n=h.r28shl(n,o),h.pc2(r,n,t.keys,i)}},s.prototype._update=function(t,e,r,n){var i=this._desState,o=h.readUInt32BE(t,e),a=h.readUInt32BE(t,e+4);h.ip(o,a,i.tmp,0),o=i.tmp[0],a=i.tmp[1],"encrypt"===this.type?this._encrypt(i,o,a,i.tmp,0):this._decrypt(i,o,a,i.tmp,0),o=i.tmp[0],a=i.tmp[1],h.writeUInt32BE(r,o,n),h.writeUInt32BE(r,a,n+4)},s.prototype._pad=function(t,e){for(var r=t.length-e,n=e;n>>0,o=l}h.rip(a,o,n,i)},s.prototype._decrypt=function(t,e,r,n,i){for(var o=r,a=e,s=t.keys.length-2;0<=s;s-=2){var u=t.keys[s],f=t.keys[s+1];h.expand(o,t.tmp,0),u^=t.tmp[0],f^=t.tmp[1];var c=h.substitute(u,f),l=o;o=(a^h.permute(c))>>>0,a=l}h.rip(o,a,n,i)}},{"./cipher":301,"./utils":304,inherits:375,"minimalistic-assert":385}],303:[function(t,e,r){"use strict";var o=t("minimalistic-assert"),n=t("inherits"),i=t("./cipher"),a=t("./des");function s(t,e){o.equal(e.length,24,"Invalid key length");var r=e.slice(0,8),n=e.slice(8,16),i=e.slice(16,24);this.ciphers="encrypt"===t?[a.create({type:"encrypt",key:r}),a.create({type:"decrypt",key:n}),a.create({type:"encrypt",key:i})]:[a.create({type:"decrypt",key:i}),a.create({type:"encrypt",key:n}),a.create({type:"decrypt",key:r})]}function u(t){i.call(this,t);var e=new s(this.type,this.options.key);this._edeState=e}n(u,i),(e.exports=u).create=function(t){return new u(t)},u.prototype._update=function(t,e,r,n){var i=this._edeState;i.ciphers[0]._update(t,e,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},u.prototype._pad=a.prototype._pad,u.prototype._unpad=a.prototype._unpad},{"./cipher":301,"./des":302,inherits:375,"minimalistic-assert":385}],304:[function(t,e,r){arguments[4][65][0].apply(r,arguments)},{dup:65}],305:[function(t,e,r){(function(o){"use strict";var a=t("./lib/generatePrime"),n=t("./lib/primes.json"),s=t("./lib/dh");var u={binary:!0,hex:!0,base64:!0};r.DiffieHellmanGroup=r.createDiffieHellmanGroup=r.getDiffieHellman=function(t){var e=new o(n[t].prime,"hex"),r=new o(n[t].gen,"hex");return new s(e,r)},r.createDiffieHellman=r.DiffieHellman=function t(e,r,n,i){return o.isBuffer(r)||void 0===u[r]?t(e,"binary",r,n):(r=r||"binary",i=i||"binary",n=n||new o([2]),o.isBuffer(n)||(n=new o(n,i)),"number"==typeof e?new s(a(e,n),n,!0):(o.isBuffer(e)||(e=new o(e,r)),new s(e,n,!0)))}}).call(this,t("buffer").Buffer)},{"./lib/dh":306,"./lib/generatePrime":307,"./lib/primes.json":308,buffer:50}],306:[function(y,b,t){(function(o){"use strict";var a=y("bn.js"),s=new(y("miller-rabin")),u=new a(24),f=new a(11),c=new a(10),l=new a(3),h=new a(7),d=y("./generatePrime"),t=y("randombytes");function n(t,e){return e=e||"utf8",o.isBuffer(t)||(t=new o(t,e)),this._pub=new a(t),this}function i(t,e){return e=e||"utf8",o.isBuffer(t)||(t=new o(t,e)),this._priv=new a(t),this}b.exports=e;var p={};function e(t,e,r){this.setGenerator(e),this.__prime=new a(t),this._prime=a.mont(this.__prime),this._primeLen=t.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=n,this.setPrivateKey=i):this._primeCode=8}function r(t,e){var r=new o(t.toArray());return e?r.toString(e):r}Object.defineProperty(e.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(t,e){var r=e.toString("hex"),n=[r,t.toString(16)].join("_");if(n in p)return p[n];var i,o=0;if(t.isEven()||!d.simpleSieve||!d.fermatTest(t)||!s.test(t))return o+=1,o+="02"===r||"05"===r?8:4,p[n]=o;switch(s.test(t.shrn(1))||(o+=2),r){case"02":t.mod(u).cmp(f)&&(o+=8);break;case"05":(i=t.mod(c)).cmp(l)&&i.cmp(h)&&(o+=8);break;default:o+=4}return p[n]=o}(this.__prime,this.__gen)),this._primeCode}}),e.prototype.generateKeys=function(){return this._priv||(this._priv=new a(t(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},e.prototype.computeSecret=function(t){var e=(t=(t=new a(t)).toRed(this._prime)).redPow(this._priv).fromRed(),r=new o(e.toArray()),n=this.getPrime();if(r.length>1]):a.mixedAdd(i[-u-1>>1].neg()):0>1]):a.add(i[-u-1>>1].neg())}return"affine"===t.type?a.toP():a},o.prototype._wnafMulAdd=function(t,e,r,n,i){for(var o=this._wnafT1,a=this._wnafT2,s=this._wnafT3,u=0,f=0;f>1]:x<0&&(S=a[b][-x-1>>1].neg()),g="affine"===S.type?g.mixedAdd(S):g.add(S))}}for(f=0;f=Math.ceil((t.bitLength()+1)/e.step)},a.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},f.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=n.redAdd(e),a=o.redSub(r),s=n.redSub(e),u=i.redMul(a),f=o.redMul(s),c=i.redMul(s),l=a.redMul(o);return this.curve.point(u,f,l,c)},f.prototype._projDbl=function(){var t,e,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)t=n.redSub(i).redSub(o).redMul(a.redSub(this.curve.two)),e=a.redMul(f.redSub(o)),r=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),u=a.redSub(s).redISub(s);t=n.redSub(i).redISub(o).redMul(u),e=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);t=this.curve._mulC(n.redISub(f)).redMul(u),e=this.curve._mulC(f).redMul(i.redISub(o)),r=f.redMul(u)}return this.curve.point(t,e,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),a=i.redSub(n),s=i.redAdd(n),u=r.redAdd(e),f=o.redMul(a),c=s.redMul(u),l=o.redMul(u),h=a.redMul(s);return this.curve.point(f,c,h,l)},f.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),o=this.x.redMul(t.x),a=this.y.redMul(t.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),f=i.redAdd(s),c=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(a),l=n.redMul(u).redMul(c);return r=this.curve.twisted?(e=n.redMul(f).redMul(a.redSub(this.curve._mulA(o))),u.redMul(f)):(e=n.redMul(f).redMul(a.redSub(o)),this.curve._mulC(u).redMul(f)),this.curve.point(l,e,r)},f.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},f.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},f.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},f.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},f.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},f.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),0<=r.cmp(this.curve.p))return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},{"../utils":323,"./base":310,"bn.js":262,inherits:375}],312:[function(t,e,r){arguments[4][73][0].apply(r,arguments)},{"./base":310,"./edwards":311,"./mont":313,"./short":314,dup:73}],313:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("inherits"),o=t("./base"),a=t("../utils");function s(t){o.call(this,"mont",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(t,e,r){o.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(e,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(s,o),(e.exports=s).prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},i(u,o.BasePoint),s.prototype.decodePoint=function(t,e){return this.point(a.toArray(t,e),1)},s.prototype.point=function(t,e){return new u(this,t,e)},s.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(t,e){return new u(t,e[0],e[1]||t.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.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(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),a=i.redMul(n),s=e.z.redMul(o.redAdd(a).redSqr()),u=e.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},u.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var o=i.length-1;0<=o;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.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},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()}},{"../utils":323,"./base":310,"bn.js":262,inherits:375}],314:[function(t,e,r){"use strict";var n=t("../utils"),_=t("bn.js"),i=t("inherits"),o=t("./base"),a=n.assert;function s(t){o.call(this,"short",t),this.a=new _(t.a,16).toRed(this.red),this.b=new _(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(t,e,r,n){o.BasePoint.call(this,t,"affine"),this.inf=null===e&&null===r?(this.x=null,!(this.y=null)):(this.x=new _(e,16),this.y=new _(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),!1)}function f(t,e,r,n){o.BasePoint.call(this,t,"jacobian"),this.z=null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,new _(0)):(this.x=new _(e,16),this.y=new _(r,16),new _(n,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.zOne=this.z===this.curve.one}i(s,o),(e.exports=s).prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new _(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new _(t.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(e))?r=i[0]:(r=i[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map(function(t){return{a:new _(t.a,16),b:new _(t.b,16)}}):this._getEndoBasis(r)}}},s.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:_.mont(t),r=new _(2).toRed(e).redInvm(),n=r.redNeg(),i=new _(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},s.prototype._getEndoBasis=function(t){for(var e,r,n,i,o,a,s,u,f,c=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=t,h=this.n.clone(),d=new _(1),p=new _(0),y=new _(0),b=new _(1),m=0;0!==l.cmpn(0);){var v=h.div(l);u=h.sub(v.mul(l)),f=y.sub(v.mul(d));var g=b.sub(v.mul(p));if(!n&&u.cmp(c)<0)e=s.neg(),r=d,n=u.neg(),i=f;else if(n&&2==++m)break;h=l,l=s=u,y=d,d=f,b=p,p=g}o=u.neg(),a=f;var w=n.sqr().add(i.sqr());return 0<=o.sqr().add(a.sqr()).cmp(w)&&(o=e,a=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:i},{a:o,b:a}]},s.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),f=o.mul(n.b);return{k1:t.sub(a).sub(s),k2:u.add(f).neg()}},s.prototype.pointFromX=function(t,e){(t=new _(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(e&&!i||!e&&i)&&(n=n.redNeg()),this.point(t,n)},s.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},s.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},u.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(t){return t=new _(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},u.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},u.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},u.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},i(f,o.BasePoint),s.prototype.jpoint=function(t,e,r){return new f(this,t,e,r)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),a=t.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=s.redSqr(),c=f.redMul(s),l=n.redMul(f),h=u.redSqr().redIAdd(c).redISub(l).redISub(l),d=u.redMul(l.redISub(h)).redISub(o.redMul(c)),p=this.z.redMul(t.z).redMul(s);return this.curve.jpoint(h,d,p)},f.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),f=u.redMul(a),c=r.redMul(u),l=s.redSqr().redIAdd(f).redISub(c).redISub(c),h=s.redMul(c.redISub(l)).redISub(i.redMul(f)),d=this.z.redMul(a);return this.curve.jpoint(l,h,d)},f.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;r":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../utils":323,"./base":310,"bn.js":262,inherits:375}],315:[function(t,e,r){"use strict";var n,i=r,o=t("hash.js"),a=t("./curve"),s=t("./utils").assert;function u(t){"short"===t.type?this.curve=new a.short(t):"edwards"===t.type?this.curve=new a.edwards(t):this.curve=new a.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function f(e,r){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var t=new u(r);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:t}),t}})}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=t("./precomputed/secp256k1")}catch(t){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]})},{"./curve":312,"./precomputed/secp256k1":322,"./utils":323,"hash.js":362}],316:[function(t,e,r){"use strict";function b(t){return(b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var m=t("bn.js"),v=t("hmac-drbg"),n=t("../utils"),i=t("../curves"),o=t("brorand"),d=n.assert,a=t("./key"),g=t("./signature");function s(t){if(!(this instanceof s))return new s(t);"string"==typeof t&&(d(i.hasOwnProperty(t),"Unknown curve "+t),t=i[t]),t instanceof i.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}(e.exports=s).prototype.keyPair=function(t){return new a(this,t)},s.prototype.keyFromPrivate=function(t,e){return a.fromPrivate(this,t,e)},s.prototype.keyFromPublic=function(t,e){return a.fromPublic(this,t,e)},s.prototype.genKeyPair=function(t){t||(t={});for(var e=new v({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||o(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new m(2));;){var i=new m(e.generate(r));if(!(0>1;if(0<=a.cmp(this.curve.p.umod(this.curve.n))&&f)throw new Error("Unable to find sencond key candinate");a=f?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var c=e.r.invm(i),l=i.sub(o).mul(c).umod(i),h=s.mul(c).umod(i);return this.g.mulAdd(l,a,h)},s.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new g(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},{"../curves":315,"../utils":323,"./key":317,"./signature":318,"bn.js":262,brorand:263,"hmac-drbg":374}],317:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("../utils").assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}(e.exports=o).fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new n(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return""}},{"../utils":323,"bn.js":262}],318:[function(t,e,r){"use strict";var s=t("bn.js"),u=t("../utils"),n=u.assert;function i(t,e){if(t instanceof i)return t;this._importDER(t,e)||(n(t.r&&t.s,"Signature without r or s"),this.r=new s(t.r,16),this.s=new s(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function f(){this.place=0}function c(t,e){var r=t[e.place++];if(!(128&r))return r;for(var n=15&r,i=0,o=0,a=e.place;o>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}(e.exports=i).prototype._importDER=function(t,e){t=u.toArray(t,e);var r=new f;if(48!==t[r.place++])return!1;if(c(t,r)+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var n=c(t,r),i=t.slice(r.place,n+r.place);if(r.place+=n,2!==t[r.place++])return!1;var o=c(t,r);if(t.length!==o+r.place)return!1;var a=t.slice(r.place,o+r.place);return 0===i[0]&&128&i[1]&&(i=i.slice(1)),0===a[0]&&128&a[1]&&(a=a.slice(1)),this.r=new s(i),this.s=new s(a),!(this.recoveryParam=null)},i.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=a(e),r=a(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];l(n,e.length),(n=n.concat(e)).push(2),l(n,r.length);var i=n.concat(r),o=[48];return l(o,i.length),o=o.concat(i),u.encode(o,t)}},{"../utils":323,"bn.js":262}],319:[function(t,e,r){"use strict";var n=t("hash.js"),i=t("../curves"),o=t("../utils"),a=o.assert,u=o.parseBytes,s=t("./key"),f=t("./signature");function c(t){if(a("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof c))return new c(t);t=i[t].curve;this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=n.sha512}(e.exports=c).prototype.sign=function(t,e){t=u(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),s=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:s,Rencoded:o})},c.prototype.verify=function(t,e,r){t=u(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(o)},c.prototype.hashInt=function(){for(var t=this.hash(),e=0;e>1)-1>1)-u:u,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n=0,i=0;0>6|192);else{if(55295>18|240),r+=e(i>>12&63|128)}else r+=e(i>>12|224);r+=e(i>>6&63|128)}r+=e(63&i|128)}}return r},toString:function(t){for(var e="",r=0,n=a(t);r>10|55296),e+=String.fromCharCode(1023&i|56320)}}return e},fromNumber:function(t){var e=t.toString(16);return e.length%2==0?"0x"+e:"0x0"+e},toNumber:function(t){return parseInt(t.slice(2),16)},fromNat:function(t){return"0x0"===t?"0x":t.length%2==0?t:"0x0"+t.slice(2)},toNat:function(t){return"0"===t[2]?"0x"+t.slice(3):t},fromArray:n,toArray:r,fromUint8Array:function(t){return n([].slice.call(t,0))},toUint8Array:function(t){return new Uint8Array(r(t))}}},{"./array.js":326}],328:[function(t,e,r){"use strict";var p="0123456789abcdef".split(""),y=[1,256,65536,16777216],b=[0,8,16,24],ct=[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],m=function(t){var e,r,n,i,o,a,s,u,f,c,l,h,d,p,y,b,m,v,g,w,_,A,S,x,E,k,M,j,I,T,R,O,B,U,C,N,P,L,F,D,q,z,H,K,V,G,W,Y,X,J,Z,$,Q,tt,et,rt,nt,it,ot,at,st,ut,ft;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],f=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],e=(h=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|s>>>31),r=(d=t[9]^t[19]^t[29]^t[39]^t[49])^(s<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(u<<1|f>>>31),r=o^(f<<1|u>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(c<<1|l>>>31),r=s^(l<<1|c>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=u^(h<<1|d>>>31),r=f^(d<<1|h>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=c^(i<<1|o>>>31),r=l^(o<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,p=t[0],y=t[1],G=t[11]<<4|t[10]>>>28,W=t[10]<<4|t[11]>>>28,j=t[20]<<3|t[21]>>>29,I=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,st=t[30]<<9|t[31]>>>23,z=t[40]<<18|t[41]>>>14,H=t[41]<<18|t[40]>>>14,U=t[2]<<1|t[3]>>>31,C=t[3]<<1|t[2]>>>31,b=t[13]<<12|t[12]>>>20,m=t[12]<<12|t[13]>>>20,Y=t[22]<<10|t[23]>>>22,X=t[23]<<10|t[22]>>>22,T=t[33]<<13|t[32]>>>19,R=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,ft=t[43]<<2|t[42]>>>30,tt=t[5]<<30|t[4]>>>2,et=t[4]<<30|t[5]>>>2,N=t[14]<<6|t[15]>>>26,P=t[15]<<6|t[14]>>>26,v=t[25]<<11|t[24]>>>21,g=t[24]<<11|t[25]>>>21,J=t[34]<<15|t[35]>>>17,Z=t[35]<<15|t[34]>>>17,O=t[45]<<29|t[44]>>>3,B=t[44]<<29|t[45]>>>3,x=t[6]<<28|t[7]>>>4,E=t[7]<<28|t[6]>>>4,rt=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,L=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,w=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,Q=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,V=t[9]<<27|t[8]>>>5,k=t[18]<<20|t[19]>>>12,M=t[19]<<20|t[18]>>>12,it=t[29]<<7|t[28]>>>25,ot=t[28]<<7|t[29]>>>25,D=t[38]<<8|t[39]>>>24,q=t[39]<<8|t[38]>>>24,A=t[48]<<14|t[49]>>>18,S=t[49]<<14|t[48]>>>18,t[0]=p^~b&v,t[1]=y^~m&g,t[10]=x^~k&j,t[11]=E^~M&I,t[20]=U^~N&L,t[21]=C^~P&F,t[30]=K^~G&Y,t[31]=V^~W&X,t[40]=tt^~rt&it,t[41]=et^~nt&ot,t[2]=b^~v&w,t[3]=m^~g&_,t[12]=k^~j&T,t[13]=M^~I&R,t[22]=N^~L&D,t[23]=P^~F&q,t[32]=G^~Y&J,t[33]=W^~X&Z,t[42]=rt^~it&at,t[43]=nt^~ot&st,t[4]=v^~w&A,t[5]=g^~_&S,t[14]=j^~T&O,t[15]=I^~R&B,t[24]=L^~D&z,t[25]=F^~q&H,t[34]=Y^~J&$,t[35]=X^~Z&Q,t[44]=it^~at&ut,t[45]=ot^~st&ft,t[6]=w^~A&p,t[7]=_^~S&y,t[16]=T^~O&x,t[17]=R^~B&E,t[26]=D^~z&U,t[27]=q^~H&C,t[36]=J^~$&K,t[37]=Z^~Q&V,t[46]=at^~ut&tt,t[47]=st^~ft&et,t[8]=A^~p&b,t[9]=S^~y&m,t[18]=O^~x&k,t[19]=B^~E&M,t[28]=z^~U&N,t[29]=H^~C&P,t[38]=$^~K&G,t[39]=Q^~V&W,t[48]=ut^~tt&rt,t[49]=ft^~et&nt,t[0]^=ct[n],t[1]^=ct[n+1]},n=function(a){return function(t){var e,r,n;if("0x"===t.slice(0,2)){e=[];for(var i=2,o=t.length;i>2]|=e[f]<>2]|=r<>2]|=(192|r>>6)<>2]|=(224|r>>12)<>2]|=(240|r>>18)<>2]|=(128|r>>12&63)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<>2]|=y[3&h],t.lastByteIndex===o)for(i[0]=i[a],h=1;h>4&15]+p[15&c]+p[c>>12&15]+p[c>>8&15]+p[c>>20&15]+p[c>>16&15]+p[c>>28&15]+p[c>>24&15];d%a==0&&(m(u),h=0)}return"0x"+l}({blocks:[],reset:!0,block:0,start:0,blockCount:1600-((r=a)<<1)>>5,outputBlocks:r>>5,s:(n=[0,0,0,0,0,0,0,0,0,0],[].concat(n,n,n,n,n))},e)}};e.exports={keccak256:n(256),keccak512:n(512),keccak256s:n(256),keccak512s:n(512)}},{}],329:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("./bytes"),o=function(t){return new n(t.slice(2),16)},a=function(t){var e="0x"+("0x"===t.slice(0,2)?new n(t.slice(2),16):new n(t,10)).toString("hex");return"0x0"===e?"0x":e},s=function(t){return"string"==typeof t?/^0x/.test(t)?t:"0x"+t:"0x"+new n(t).toString("hex")},u=function(t){return o(t).toNumber()},f=function(r){return function(t,e){return"0x"+o(t)[r](o(e)).toString("hex")}},c=f("add"),l=f("mul"),h=f("div"),d=f("sub");e.exports={toString:function(t){return o(t).toString(10)},fromString:a,toNumber:u,fromNumber:s,toEther:function(t){return u(h(t,a("10000000000")))/1e8},fromEther:function(t){return l(s(Math.floor(1e8*t)),a("10000000000"))},toUint256:function(t){return i.pad(32,t)},add:c,mul:l,div:h,sub:d}},{"./bytes":327,"bn.js":262}],330:[function(t,e,r){"use strict";e.exports={encode:function(t){var r=function(t){return(e=t.toString(16)).length%2==0?e:"0"+e;var e},i=function(t,e){return t<56?r(e+t):r(e+r(t).length/2+55)+r(t)};return"0x"+function t(e){if("string"==typeof e){var r=e.slice(2);return(2!=r.length||"80"<=r?i(r.length/2,128):"")+r}var n=e.map(t).join("");return i(n.length/2,192)+n}(t)},decode:function(e){var r=2,n=function(){if(r>=e.length)throw"";var t=e.slice(r,r+2);return t<"80"?(r+=2,"0x"+t):t<"c0"?o():a()},i=function(){var t=parseInt(e.slice(r,r+=2),16)%64;return t<56?t:parseInt(e.slice(r,r+=2*(t-55)),16)},o=function(){var t=i();return"0x"+e.slice(r,r+=2*t)},a=function(){for(var t=2*i()+r,e=[];r=2*this.getChainId()+35&&this._common.gteHardfork("spuriousDragon");this._senderPubKey=o.ecrecover(t,e,this.r,this.s,r?this.getChainId():void 0)}catch(t){return!1}return!!this._senderPubKey},t.prototype.sign=function(t){this.v=new s.Buffer([]),this.s=new s.Buffer([]),this.r=new s.Buffer([]);var e=this.hash(!1),r=o.ecsign(e,t);this._implementsEIP155()&&(r.v+=2*this.getChainId()+8),Object.assign(this,r)},t.prototype.getDataFee=function(){for(var t=this.raw[5],e=new o.BN(0),r=0;r=t.length,"The field "+e.name+" must not have more "+e.length+" bytes")):e.allowZero&&0===t.length||!e.length||a(e.length===t.length,"The field "+e.name+" must have byte length of "+e.length),i.raw[r]=t}i._fields.push(e.name),Object.defineProperty(i,e.name,{enumerable:!0,configurable:!0,get:t,set:n}),e.default&&(i[e.name]=e.default),e.alias&&Object.defineProperty(i,e.alias,{enumerable:!1,configurable:!0,set:n,get:t})}),e)if("string"==typeof e&&(e=o.from(s.stripHexPrefix(e),"hex")),o.isBuffer(e)&&(e=u.decode(e)),Array.isArray(e)){if(e.length>i._fields.length)throw new Error("wrong number of fields in data");e.forEach(function(t,e){i[i._fields[e]]=f.toBuffer(t)})}else{if("object"!==n(e))throw new Error("invalid data");var r=Object.keys(e);t.forEach(function(t){-1!==r.indexOf(t.name)&&(i[t.name]=e[t.name]),-1!==r.indexOf(t.alias)&&(i[t.alias]=e[t.alias])})}}}).call(this,t("buffer").Buffer)},{"./bytes":353,assert:15,buffer:50,"ethjs-util":359,rlp:406}],358:[function(t,e,n){(function(u){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var f=t("secp256k1"),c=t("bn.js"),l=t("./bytes"),r=t("./hash");function h(t,e){return e?t-(2*e+35):t-27}function d(t){return 0===t||1===t}n.ecsign=function(t,e,r){var n=f.sign(t,e),i=n.recovery;return{r:n.signature.slice(0,32),s:n.signature.slice(32,64),v:r?i+(2*r+35):i+27}},n.ecrecover=function(t,e,r,n,i){var o=u.concat([l.setLength(r,32),l.setLength(n,32)],64),a=h(e,i);if(!d(a))throw new Error("Invalid signature v value");var s=f.recover(t,o,a);return f.publicKeyConvert(s,!1).slice(1)},n.toRpcSig=function(t,e,r,n){if(!d(h(t,n)))throw new Error("Invalid signature v value");return l.bufferToHex(u.concat([l.setLengthLeft(e,32),l.setLengthLeft(r,32),l.toBuffer(t)]))},n.fromRpcSig=function(t){var e=l.toBuffer(t);if(65!==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)}},n.isValidSignature=function(t,e,r,n,i){void 0===n&&(n=!0);var o=new c("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),a=new c("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==e.length||32!==r.length)return!1;if(!d(h(t,i)))return!1;var s=new c(e),u=new c(r);return!(s.isZero()||s.gt(a)||u.isZero()||u.gt(a))&&(!n||1!==u.cmp(o))},n.hashPersonalMessage=function(t){var e=u.from("Ethereum Signed Message:\n"+t.length.toString(),"utf-8");return r.keccak(u.concat([e,t]))}}).call(this,t("buffer").Buffer)},{"./bytes":353,"./hash":355,"bn.js":262,buffer:50,secp256k1:412}],359:[function(o,s,t){(function(r){"use strict";function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var t=o("is-hex-prefixed"),e=o("strip-hex-prefix");function n(t){var e=t;if("string"!=typeof e)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+a(e)+", while padToEven.");return e.length%2&&(e="0"+e),e}function i(t){return"0x"+t.toString(16)}s.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 '"+a(e)+"'");if(!0!==Array.isArray(t))throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+a(t)+"'");return t[Boolean(r)?"some":"every"](function(t){return 0<=e.indexOf(t)})},intToBuffer:function(t){var e=i(t);return new r(n(e.slice(2)),"hex")},getBinarySize:function(t){if("string"!=typeof t)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+a(t)+"'.");return r.byteLength(t,"utf8")},isHexPrefixed:t,stripHexPrefix:e,padToEven:n,intToHex:i,fromAscii:function(t){for(var e="",r=0;r>>31),d=l^(o<<1|i>>>31),p=t[0]^h,y=t[1]^d,b=t[10]^h,m=t[11]^d,v=t[20]^h,g=t[21]^d,w=t[30]^h,_=t[31]^d,A=t[40]^h,S=t[41]^d;h=r^(a<<1|s>>>31),d=n^(s<<1|a>>>31);var x=t[2]^h,E=t[3]^d,k=t[12]^h,M=t[13]^d,j=t[22]^h,I=t[23]^d,T=t[32]^h,R=t[33]^d,O=t[42]^h,B=t[43]^d;h=i^(u<<1|f>>>31),d=o^(f<<1|u>>>31);var U=t[4]^h,C=t[5]^d,N=t[14]^h,P=t[15]^d,L=t[24]^h,F=t[25]^d,D=t[34]^h,q=t[35]^d,z=t[44]^h,H=t[45]^d;h=a^(c<<1|l>>>31),d=s^(l<<1|c>>>31);var K=t[6]^h,V=t[7]^d,G=t[16]^h,W=t[17]^d,Y=t[26]^h,X=t[27]^d,J=t[36]^h,Z=t[37]^d,$=t[46]^h,Q=t[47]^d;h=u^(r<<1|n>>>31),d=f^(n<<1|r>>>31);var tt=t[8]^h,et=t[9]^d,rt=t[18]^h,nt=t[19]^d,it=t[28]^h,ot=t[29]^d,at=t[38]^h,st=t[39]^d,ut=t[48]^h,ft=t[49]^d,ct=p,lt=y,ht=m<<4|b>>>28,dt=b<<4|m>>>28,pt=v<<3|g>>>29,yt=g<<3|v>>>29,bt=_<<9|w>>>23,mt=w<<9|_>>>23,vt=A<<18|S>>>14,gt=S<<18|A>>>14,wt=x<<1|E>>>31,_t=E<<1|x>>>31,At=M<<12|k>>>20,St=k<<12|M>>>20,xt=j<<10|I>>>22,Et=I<<10|j>>>22,kt=R<<13|T>>>19,Mt=T<<13|R>>>19,jt=O<<2|B>>>30,It=B<<2|O>>>30,Tt=C<<30|U>>>2,Rt=U<<30|C>>>2,Ot=N<<6|P>>>26,Bt=P<<6|N>>>26,Ut=F<<11|L>>>21,Ct=L<<11|F>>>21,Nt=D<<15|q>>>17,Pt=q<<15|D>>>17,Lt=H<<29|z>>>3,Ft=z<<29|H>>>3,Dt=K<<28|V>>>4,qt=V<<28|K>>>4,zt=W<<23|G>>>9,Ht=G<<23|W>>>9,Kt=Y<<25|X>>>7,Vt=X<<25|Y>>>7,Gt=J<<21|Z>>>11,Wt=Z<<21|J>>>11,Yt=Q<<24|$>>>8,Xt=$<<24|Q>>>8,Jt=tt<<27|et>>>5,Zt=et<<27|tt>>>5,$t=rt<<20|nt>>>12,Qt=nt<<20|rt>>>12,te=ot<<7|it>>>25,ee=it<<7|ot>>>25,re=at<<8|st>>>24,ne=st<<8|at>>>24,ie=ut<<14|ft>>>18,oe=ft<<14|ut>>>18;t[0]=ct^~At&Ut,t[1]=lt^~St&Ct,t[10]=Dt^~$t&pt,t[11]=qt^~Qt&yt,t[20]=wt^~Ot&Kt,t[21]=_t^~Bt&Vt,t[30]=Jt^~ht&xt,t[31]=Zt^~dt&Et,t[40]=Tt^~zt&te,t[41]=Rt^~Ht&ee,t[2]=At^~Ut&Gt,t[3]=St^~Ct&Wt,t[12]=$t^~pt&kt,t[13]=Qt^~yt&Mt,t[22]=Ot^~Kt&re,t[23]=Bt^~Vt&ne,t[32]=ht^~xt&Nt,t[33]=dt^~Et&Pt,t[42]=zt^~te&bt,t[43]=Ht^~ee&mt,t[4]=Ut^~Gt&ie,t[5]=Ct^~Wt&oe,t[14]=pt^~kt&Lt,t[15]=yt^~Mt&Ft,t[24]=Kt^~re&vt,t[25]=Vt^~ne>,t[34]=xt^~Nt&Yt,t[35]=Et^~Pt&Xt,t[44]=te^~bt&jt,t[45]=ee^~mt&It,t[6]=Gt^~ie&ct,t[7]=Wt^~oe<,t[16]=kt^~Lt&Dt,t[17]=Mt^~Ft&qt,t[26]=re^~vt&wt,t[27]=ne^~gt&_t,t[36]=Nt^~Yt&Jt,t[37]=Pt^~Xt&Zt,t[46]=bt^~jt&Tt,t[47]=mt^~It&Rt,t[8]=ie^~ct&At,t[9]=oe^~lt&St,t[18]=Lt^~Dt&$t,t[19]=Ft^~qt&Qt,t[28]=vt^~wt&Ot,t[29]=gt^~_t&Bt,t[38]=Yt^~Jt&ht,t[39]=Xt^~Zt&dt,t[48]=jt^~Tt&zt,t[49]=It^~Rt&Ht,t[0]^=ae[2*e],t[1]^=ae[2*e+1]}}},{}],382:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=t("./keccak-state-unroll");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(t,e){for(var r=0;r<50;++r)this.state[r]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1},o.prototype.absorb=function(t){for(var e=0;e>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(i.p1600(this.state),this.count=0);return e},o.prototype.copy=function(t){for(var e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing},e.exports=o},{"./keccak-state-unroll":381,"safe-buffer":407}],383:[function(t,e,r){arguments[4][107][0].apply(r,arguments)},{dup:107,"hash-base":361,inherits:375,"safe-buffer":407}],384:[function(t,e,r){arguments[4][108][0].apply(r,arguments)},{"bn.js":262,brorand:263,dup:108}],385:[function(t,e,r){arguments[4][109][0].apply(r,arguments)},{dup:109}],386:[function(t,e,r){arguments[4][110][0].apply(r,arguments)},{dup:110}],387:[function(t,e,r){arguments[4][113][0].apply(r,arguments)},{dup:113}],388:[function(t,e,r){arguments[4][114][0].apply(r,arguments)},{"./certificate":389,"asn1.js":247,dup:114}],389:[function(t,e,r){arguments[4][115][0].apply(r,arguments)},{"asn1.js":247,dup:115}],390:[function(t,e,r){arguments[4][116][0].apply(r,arguments)},{"browserify-aes":266,dup:116,evp_bytestokey:360,"safe-buffer":407}],391:[function(t,e,r){arguments[4][117][0].apply(r,arguments)},{"./aesid.json":387,"./asn1":388,"./fixProc":390,"browserify-aes":266,dup:117,pbkdf2:392,"safe-buffer":407}],392:[function(t,e,r){arguments[4][118][0].apply(r,arguments)},{"./lib/async":393,"./lib/sync":396,dup:118}],393:[function(t,e,r){(function(f,c){"use strict";var l,h=t("./precondition"),d=t("./default-encoding"),p=t("./sync"),y=t("safe-buffer").Buffer,b=c.crypto&&c.crypto.subtle,m={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},v=[];function g(t,e,r,n,i){return b.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then(function(t){return b.deriveBits({name:"PBKDF2",salt:e,iterations:r,hash:{name:i}},t,n<<3)}).then(function(t){return y.from(t)})}e.exports=function(e,r,n,i,o,a){"function"==typeof o&&(a=o,o=void 0);var t,s,u=m[(o=o||"sha1").toLowerCase()];if(!u||"function"!=typeof c.Promise)return f.nextTick(function(){var t;try{t=p(e,r,n,i,o)}catch(t){return a(t)}a(null,t)});if(h(e,r,n,i),"function"!=typeof a)throw new Error("No callback provided to pbkdf2");y.isBuffer(e)||(e=y.from(e,d)),y.isBuffer(r)||(r=y.from(r,d)),t=function(t){if(c.process&&!c.process.browser)return Promise.resolve(!1);if(!b||!b.importKey||!b.deriveBits)return Promise.resolve(!1);if(void 0!==v[t])return v[t];var e=g(l=l||y.alloc(8),l,10,128,t).then(function(){return!0}).catch(function(){return!1});return v[t]=e}(u).then(function(t){return t?g(e,r,n,i,u):p(e,r,n,i,o)}),s=a,t.then(function(t){f.nextTick(function(){s(null,t)})},function(t){f.nextTick(function(){s(t)})})}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./default-encoding":394,"./precondition":395,"./sync":396,_process:124,"safe-buffer":407}],394:[function(t,r,e){(function(t){"use strict";var e;t.browser?e="utf-8":e=6<=parseInt(t.version.split(".")[0].slice(1),10)?"utf-8":"binary";r.exports=e}).call(this,t("_process"))},{_process:124}],395:[function(t,e,r){(function(r){"use strict";var i=Math.pow(2,30)-1;function o(t,e){if("string"!=typeof t&&!r.isBuffer(t))throw new TypeError(e+" must be a buffer or string")}e.exports=function(t,e,r,n){if(o(t,"Password"),o(e,"Salt"),"number"!=typeof r)throw new TypeError("Iterations not a number");if(r<0)throw new TypeError("Bad iterations");if("number"!=typeof n)throw new TypeError("Key length not a number");if(n<0||ie.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(o=e.slice(n,f)).length)throw new Error("invalid rlp, List has a invalid length");for(;o.length;)a=t(o),s.push(a.data),o=a.remainder;return{data:s,remainder:e.slice(f)}}(u(t));if(e)return r;if(0!==r.remainder.length)throw new Error("invalid remainder");return r.data},r.getLength=function(t){if(!t||0===t.length)return c.from([]);var e=u(t),r=e[0];if(r<=127)return e.length;if(r<=183)return r-127;if(r<=191)return r-182;if(r<=247)return r-191;var n=r-246;return n+l(e.slice(1,n).toString("hex"),16)}}).call(this,t("buffer").Buffer)},{"bn.js":262,buffer:50}],407:[function(t,e,r){arguments[4][183][0].apply(r,arguments)},{buffer:50,dup:183}],408:[function(t,e,r){"use strict";var n=t("./scryptSync");n.async=t("./scrypt"),e.exports=n},{"./scrypt":409,"./scryptSync":410}],409:[function(t,e,r){"use strict";function u(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}var v=t("crypto"),n=t("./utils"),g=n.checkAndInit,w=n.smix;function f(){var s;return s=regeneratorRuntime.mark(function t(e,r,n,i,o,a,s,u){var f,c,l,h,d,p,y,b,m;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:f=g(e,r,n,i,o,a,s),c=f.XY,l=f.V,h=f.B32,d=f.x,p=f._X,y=f.B,b=f.tickCallback,m=0;case 2:if(m>>32-e}function f(t,e,r){var n;for(n=0;n<16;n++)e[n]=(255&t[4*n+0])<<0,e[n]|=(255&t[4*n+1])<<8,e[n]|=(255&t[4*n+2])<<16,e[n]|=(255&t[4*n+3])<<24;for(c(e,0,r,0,16),n=8;0>0&255,t[i+1]=e[n]>>8&255,t[i+2]=e[n]>>16&255,t[i+3]=e[n]>>24&255}}function _(t,e,r,n,i){for(var o=0;o 0 and a power of 2");if(2147483647/128/n":">",'"':""","'":"'","`":"`"},q=d.invert(D),z=function(e){var r=function(t){return e[t]},t="(?:"+d.keys(e).join("|")+")",n=RegExp(t),i=RegExp(t,"g");return function(t){return t=null==t?"":""+t,n.test(t)?t.replace(i,r):t}};d.escape=z(D),d.unescape=z(q),d.result=function(t,e,r){d.isArray(e)||(e=[e]);var n=e.length;if(!n)return d.isFunction(r)?r.call(t):r;for(var i=0;i/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,V={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},G=/\\|'|\r|\n|\u2028|\u2029/g,W=function(t){return"\\"+V[t]};d.template=function(o,t,e){!t&&e&&(t=e),t=d.defaults({},t,d.templateSettings);var r,n=RegExp([(t.escape||K).source,(t.interpolate||K).source,(t.evaluate||K).source].join("|")+"|$","g"),a=0,s="__p+='";o.replace(n,function(t,e,r,n,i){return s+=o.slice(a,i).replace(G,W),a=i+t.length,e?s+="'+\n((__t=("+e+"))==null?'':_.escape(__t))+\n'":r?s+="'+\n((__t=("+r+"))==null?'':__t)+\n'":n&&(s+="';\n"+n+"\n__p+='"),t}),s+="';\n",t.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{r=new Function(t.variable||"obj","_",s)}catch(t){throw t.source=s,t}var i=function(t){return r.call(this,t,d)},u=t.variable||"obj";return i.source="function("+u+"){\n"+s+"}",i},d.chain=function(t){var e=d(t);return e._chain=!0,e};var Y=function(t,e){return t._chain?d(e).chain():e};d.mixin=function(r){return d.each(d.functions(r),function(t){var e=d[t]=r[t];d.prototype[t]=function(){var t=[this._wrapped];return i.apply(t,arguments),Y(this,e.apply(d,t))}}),d},d.mixin(d),d.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var r=n[e];d.prototype[e]=function(){var t=this._wrapped;return r.apply(t,arguments),"shift"!==e&&"splice"!==e||0!==t.length||delete t[0],Y(this,t)}}),d.each(["concat","join","slice"],function(t){var e=n[t];d.prototype[t]=function(){return Y(this,e.apply(this._wrapped,arguments))}}),d.prototype.valueOf=d.prototype.toJSON=d.prototype.value=function(){return this._wrapped},d.prototype.toString=function(){return String(this._wrapped)},"function"==typeof define&&define.amd&&define("underscore",[],function(){return d})}()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],428:[function(t,e,r){"use strict";var n=t("./v1"),i=t("./v4"),o=i;o.v1=n,o.v4=i,e.exports=o},{"./v1":431,"./v4":432}],429:[function(t,e,r){"use strict";for(var i=[],n=0;n<256;++n)i[n]=(n+256).toString(16).substr(1);e.exports=function(t,e){var r=e||0,n=i;return[n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]]].join("")}},{}],430:[function(t,e,r){"use strict";var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var i=new Uint8Array(16);e.exports=function(){return n(i),i}}else{var o=new Array(16);e.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),o[e]=t>>>((3&e)<<3)&255;return o}}},{}],431:[function(t,e,r){"use strict";var p,y,b=t("./lib/rng"),m=t("./lib/bytesToUuid"),v=0,g=0;e.exports=function(t,e,r){var n=e&&r||0,i=e||[],o=(t=t||{}).node||p,a=void 0!==t.clockseq?t.clockseq:y;if(null==o||null==a){var s=b();null==o&&(o=p=[1|s[0],s[1],s[2],s[3],s[4],s[5]]),null==a&&(a=y=16383&(s[6]<<8|s[7]))}var u=void 0!==t.msecs?t.msecs:(new Date).getTime(),f=void 0!==t.nsecs?t.nsecs:g+1,c=u-v+(f-g)/1e4;if(c<0&&void 0===t.clockseq&&(a=a+1&16383),(c<0||v>>24&255,i[n++]=l>>>16&255,i[n++]=l>>>8&255,i[n++]=255&l;var h=u/4294967296*1e4&268435455;i[n++]=h>>>8&255,i[n++]=255&h,i[n++]=h>>>24&15|16,i[n++]=h>>>16&255,i[n++]=a>>>8|128,i[n++]=255&a;for(var d=0;d<6;++d)i[n+d]=o[d];return e||m(i)}},{"./lib/bytesToUuid":429,"./lib/rng":430}],432:[function(t,e,r){"use strict";var a=t("./lib/rng"),s=t("./lib/bytesToUuid");e.exports=function(t,e,r){var n=e&&r||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var i=(t=t||{}).random||(t.rng||a)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e)for(var o=0;o<16;++o)e[n+o]=i[o];return e||s(i)}},{"./lib/bytesToUuid":429,"./lib/rng":430}],433:[function(a,l,t){(function(t,h){"use strict";var d=a("underscore"),r=a("web3-core"),n=a("web3-core-method"),s=a("eth-lib/lib/account"),u=a("eth-lib/lib/hash"),f=a("eth-lib/lib/rlp"),c=a("eth-lib/lib/bytes"),p=a(void 0===t?"crypto-browserify":"crypto"),y=a("@web3-js/scrypt-shim"),b=a("uuid"),m=a("web3-utils"),v=a("web3-core-helpers"),g=a("ethereumjs-tx").Transaction,w=a("ethereumjs-common").default,i=function(t){return d.isUndefined(t)||d.isNull(t)},e=function(){var e=this;r.packageInit(this,arguments),delete this.BatchRequest,delete this.extend;var t=[new n({name:"getNetworkId",call:"net_version",params:0,outputFormatter:parseInt}),new n({name:"getChainId",call:"eth_chainId",params:0,outputFormatter:m.hexToNumber}),new n({name:"getGasPrice",call:"eth_gasPrice",params:0}),new n({name:"getTransactionCount",call:"eth_getTransactionCount",params:2,inputFormatter:[function(t){if(m.isAddress(t))return t;throw new Error("Address "+t+' is not a valid address to get the "transactionCount".')},function(){return"latest"}]})];this._ethereumCall={},d.each(t,function(t){t.attachToObject(e._ethereumCall),t.setRequestManager(e._requestManager)}),this.wallet=new o(this)};function o(t){this._accounts=t,this.length=0,this.defaultKeyName="web3js_wallet"}e.prototype._addAccountFunctions=function(r){var n=this;return r.signTransaction=function(t,e){return n.signTransaction(t,r.privateKey,e)},r.sign=function(t){return n.sign(t,r.privateKey)},r.encrypt=function(t,e){return n.encrypt(r.privateKey,t,e)},r},e.prototype.create=function(t){return this._addAccountFunctions(s.create(t||m.randomHex(32)))},e.prototype.privateKeyToAccount=function(t,e){if(t.startsWith("0x")||(t="0x"+t),!e&&66!==t.length)throw new Error("Private key must be 32 bytes long");return this._addAccountFunctions(s.fromPrivate(t))},e.prototype.signTransaction=function(e,s,u){var f=!1,c={},l=!(!e||!(e.chain&&e.hardfork||e.common));if(u=u||function(){},!e)return f=new Error("No transaction object given!"),u(f),Promise.reject(f);function r(t){if(t.common&&t.chain&&t.hardfork&&(f=new Error("Please provide the ethereumjs-common object or the chain and hardfork property but not all together.")),(t.chain&&!t.hardfork||t.hardfork&&!t.chain)&&(f=new Error('When specifying chain and hardfork, both values must be defined. Received "chain": '+t.chain+', "hardfork": '+t.hardfork)),t.gas||t.gasLimit||(f=new Error('"gas" is missing')),(t.nonce<0||t.gas<0||t.gasPrice<0||t.chainId<0)&&(f=new Error("Gas, gasPrice, nonce or chainId is lower than 0")),f)return u(f),Promise.reject(f);try{var e=v.formatters.inputCallFormatter(d.clone(t));e.to=e.to||"0x",e.data=e.data||"0x",e.value=e.value||"0x",e.chainId=m.numberToHex(e.chainId),l?(e.common&&(c.common=w.forCustomChain(e.common.baseChain||"mainnet",{name:e.common.customChain.name||"custom-network",networkId:e.common.customChain.networkId,chainId:e.common.customChain.chainId},e.common.hardfork||"petersburg"),delete e.common),e.chain&&(c.chain=e.chain,delete e.chain),e.hardfork&&(c.hardfork=e.hardfork,delete e.hardfork)):(c.common=w.forCustomChain("mainnet",{name:"custom-network",networkId:e.networkId,chainId:e.chainId},"petersburg"),delete e.networkId),s.startsWith("0x")&&(s=s.substring(2));var r=new g(e,c);r.sign(h.from(s,"hex"));var n=r.validate(!0);if(""!==n)throw new Error("Signer Error: "+n);var i="0x"+r.serialize().toString("hex"),o=m.keccak256(i),a={messageHash:"0x"+h.from(r.hash(!1)).toString("hex"),v:"0x"+h.from(r.v).toString("hex"),r:"0x"+h.from(r.r).toString("hex"),s:"0x"+h.from(r.s).toString("hex"),rawTransaction:i,transactionHash:o};return u(null,a),a}catch(t){return u(t),Promise.reject(t)}}return void 0!==e.nonce&&void 0!==e.chainId&&void 0!==e.gasPrice&&l?Promise.resolve(r(e)):Promise.all([i(e.chainId)?this._ethereumCall.getChainId():e.chainId,i(e.gasPrice)?this._ethereumCall.getGasPrice():e.gasPrice,i(e.nonce)?this._ethereumCall.getTransactionCount(this.privateKeyToAccount(s).address):e.nonce,i(l)?this._ethereumCall.getNetworkId():1]).then(function(t){if(i(t[0])||i(t[1])||i(t[2])||i(t[3]))throw new Error('One of the values "chainId", "networkId", "gasPrice", or "nonce" couldn\'t be fetched: '+JSON.stringify(t));return r(d.extend(e,{chainId:t[0],gasPrice:t[1],nonce:t[2],networkId:t[3]}))})},e.prototype.recoverTransaction=function(t){var e=f.decode(t),r=s.encodeSignature(e.slice(6,9)),n=c.toNumber(e[6]),i=n<35?[]:[c.fromNumber(n-35>>1),"0x","0x"],o=e.slice(0,6).concat(i),a=f.encode(o);return s.recover(u.keccak256(a),r)},e.prototype.hashMessage=function(t){var e=m.isHexStrict(t)?m.hexToBytes(t):t,r=h.from(e),n="Ethereum Signed Message:\n"+e.length,i=h.from(n),o=h.concat([i,r]);return u.keccak256s(o)},e.prototype.sign=function(t,e){if(e.startsWith("0x")||(e="0x"+e),66!==e.length)throw new Error("Private key must be 32 bytes long");var r=this.hashMessage(t),n=s.sign(r,e),i=s.decodeSignature(n);return{message:t,messageHash:r,v:i[0],r:i[1],s:i[2],signature:n}},e.prototype.recover=function(t,e,r){var n=[].slice.apply(arguments);return d.isObject(t)?this.recover(t.messageHash,s.encodeSignature([t.v,t.r,t.s]),!0):(r||(t=this.hashMessage(t)),4<=n.length?(r=n.slice(-1)[0],r=!!d.isBoolean(r)&&!!r,this.recover(t,s.encodeSignature(n.slice(1,4)),r)):s.recover(t,e))},e.prototype.decrypt=function(t,e,r){if(!d.isString(e))throw new Error("No password given.");var n,i,o=d.isObject(t)?t:JSON.parse(r?t.toLowerCase():t);if(3!==o.version)throw new Error("Not a valid V3 wallet");if("scrypt"===o.crypto.kdf)i=o.crypto.kdfparams,n=y(h.from(e),h.from(i.salt,"hex"),i.n,i.r,i.p,i.dklen);else{if("pbkdf2"!==o.crypto.kdf)throw new Error("Unsupported key derivation scheme");if("hmac-sha256"!==(i=o.crypto.kdfparams).prf)throw new Error("Unsupported parameters to PBKDF2");n=p.pbkdf2Sync(h.from(e),h.from(i.salt,"hex"),i.c,i.dklen,"sha256")}var a=h.from(o.crypto.ciphertext,"hex");if(m.sha3(h.concat([n.slice(16,32),a])).replace("0x","")!==o.crypto.mac)throw new Error("Key derivation failed - possibly wrong password");var s=p.createDecipheriv(o.crypto.cipher,n.slice(0,16),h.from(o.crypto.cipherparams.iv,"hex")),u="0x"+h.concat([s.update(a),s.final()]).toString("hex");return this.privateKeyToAccount(u,!0)},e.prototype.encrypt=function(t,e,r){var n,i=this.privateKeyToAccount(t,!0),o=(r=r||{}).salt||p.randomBytes(32),a=r.iv||p.randomBytes(16),s=r.kdf||"scrypt",u={dklen:r.dklen||32,salt:o.toString("hex")};if("pbkdf2"===s)u.c=r.c||262144,u.prf="hmac-sha256",n=p.pbkdf2Sync(h.from(e),h.from(u.salt,"hex"),u.c,u.dklen,"sha256");else{if("scrypt"!==s)throw new Error("Unsupported kdf");u.n=r.n||8192,u.r=r.r||8,u.p=r.p||1,n=y(h.from(e),h.from(u.salt,"hex"),u.n,u.r,u.p,u.dklen)}var f=p.createCipheriv(r.cipher||"aes-128-ctr",n.slice(0,16),a);if(!f)throw new Error("Unsupported cipher");var c=h.concat([f.update(h.from(i.privateKey.replace("0x",""),"hex")),f.final()]),l=m.sha3(h.concat([n.slice(16,32),h.from(c,"hex")])).replace("0x","");return{version:3,id:b.v4({random:r.uuid||p.randomBytes(16)}),address:i.address.toLowerCase().replace("0x",""),crypto:{ciphertext:c.toString("hex"),cipherparams:{iv:a.toString("hex")},cipher:r.cipher||"aes-128-ctr",kdf:s,kdfparams:u,mac:l.toString("hex")}}},o.prototype._findSafeIndex=function(t){return t=t||0,d.has(this,t)?this._findSafeIndex(t+1):t},o.prototype._currentIndexes=function(){return Object.keys(this).map(function(t){return parseInt(t)}).filter(function(t){return t<9e20})},o.prototype.create=function(t,e){for(var r=0;r":">",'"':""","'":"'","`":"`"},q=d.invert(D),z=function(e){var r=function(t){return e[t]},t="(?:"+d.keys(e).join("|")+")",n=RegExp(t),i=RegExp(t,"g");return function(t){return t=null==t?"":""+t,n.test(t)?t.replace(i,r):t}};d.escape=z(D),d.unescape=z(q),d.result=function(t,e,r){d.isArray(e)||(e=[e]);var n=e.length;if(!n)return d.isFunction(r)?r.call(t):r;for(var i=0;i/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,V={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},G=/\\|'|\r|\n|\u2028|\u2029/g,W=function(t){return"\\"+V[t]};d.template=function(o,t,e){!t&&e&&(t=e),t=d.defaults({},t,d.templateSettings);var r,n=RegExp([(t.escape||K).source,(t.interpolate||K).source,(t.evaluate||K).source].join("|")+"|$","g"),a=0,s="__p+='";o.replace(n,function(t,e,r,n,i){return s+=o.slice(a,i).replace(G,W),a=i+t.length,e?s+="'+\n((__t=("+e+"))==null?'':_.escape(__t))+\n'":r?s+="'+\n((__t=("+r+"))==null?'':__t)+\n'":n&&(s+="';\n"+n+"\n__p+='"),t}),s+="';\n",t.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{r=new Function(t.variable||"obj","_",s)}catch(t){throw t.source=s,t}var i=function(t){return r.call(this,t,d)},u=t.variable||"obj";return i.source="function("+u+"){\n"+s+"}",i},d.chain=function(t){var e=d(t);return e._chain=!0,e};var Y=function(t,e){return t._chain?d(e).chain():e};d.mixin=function(r){return d.each(d.functions(r),function(t){var e=d[t]=r[t];d.prototype[t]=function(){var t=[this._wrapped];return i.apply(t,arguments),Y(this,e.apply(d,t))}}),d},d.mixin(d),d.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var r=n[e];d.prototype[e]=function(){var t=this._wrapped;return r.apply(t,arguments),"shift"!==e&&"splice"!==e||0!==t.length||delete t[0],Y(this,t)}}),d.each(["concat","join","slice"],function(t){var e=n[t];d.prototype[t]=function(){return Y(this,e.apply(this._wrapped,arguments))}}),d.prototype.valueOf=d.prototype.toJSON=d.prototype.value=function(){return this._wrapped},d.prototype.toString=function(){return String(this._wrapped)},"function"==typeof define&&define.amd&&define("underscore",[],function(){return d})}()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],435:[function(t,e,r){"use strict";var f=t("underscore"),c=t("web3-core"),a=t("web3-core-method"),l=t("web3-utils"),n=t("web3-core-subscriptions").subscription,h=t("web3-core-helpers").formatters,i=t("web3-core-helpers").errors,s=t("web3-core-promievent"),d=t("web3-eth-abi"),o=function t(e,r,n){var o=this,i=Array.prototype.slice.call(arguments);if(!(this instanceof t))throw new Error('Please use the "new" keyword to instantiate a web3.eth.Contract() object!');if(this.setProvider=function(){c.packageInit(o,arguments),o.clearSubscriptions=o._requestManager.clearSubscriptions},c.packageInit(this,[this.constructor]),this.clearSubscriptions=this._requestManager.clearSubscriptions,!e||!Array.isArray(e))throw new Error("You must provide the json interface of the contract when instantiating a contract object.");this.options={};var a=i[i.length-1];f.isObject(a)&&!f.isArray(a)&&(n=a,this.options=f.extend(this.options,this._getOrSetDefaultOptions(n)),f.isObject(r)&&(r=null)),Object.defineProperty(this.options,"address",{set:function(t){t&&(o._address=l.toChecksumAddress(h.inputAddressFormatter(t)))},get:function(){return o._address},enumerable:!0}),Object.defineProperty(this.options,"jsonInterface",{set:function(t){return o.methods={},o.events={},o._jsonInterface=t.map(function(t){var e,r;if(t.constant="view"===t.stateMutability||"pure"===t.stateMutability||t.constant,t.payable="payable"===t.stateMutability||t.payable,t.name&&(r=l._jsonInterfaceMethodToString(t)),"function"===t.type){if(t.signature=d.encodeFunctionSignature(r),e=o._createTxObject.bind({method:t,parent:o}),o.methods[t.name]){var n=o._createTxObject.bind({method:t,parent:o,nextMethod:o.methods[t.name]});o.methods[t.name]=n}else o.methods[t.name]=e;o.methods[t.signature]=e,o.methods[r]=e}else if("event"===t.type){t.signature=d.encodeEventSignature(r);var i=o._on.bind(o,t.signature);o.events[t.name]&&"bound "!==o.events[t.name].name||(o.events[t.name]=i),o.events[t.signature]=i,o.events[r]=i}return t}),o.events.allEvents=o._on.bind(o,"allevents"),o._jsonInterface},get:function(){return o._jsonInterface},enumerable:!0});var s=this.constructor.defaultAccount,u=this.constructor.defaultBlock||"latest";Object.defineProperty(this,"handleRevert",{get:function(){return!1===o.options.handleRevert||!0===o.options.handleRevert?o.options.handleRevert:this.constructor.handleRevert},set:function(t){o.options.handleRevert=t},enumerable:!0}),Object.defineProperty(this,"defaultCommon",{get:function(){return o.options.common||this.constructor.defaultCommon},set:function(t){o.options.common=t},enumerable:!0}),Object.defineProperty(this,"defaultHardfork",{get:function(){return o.options.hardfork||this.constructor.defaultHardfork},set:function(t){o.options.hardfork=t},enumerable:!0}),Object.defineProperty(this,"defaultChain",{get:function(){return o.options.chain||this.constructor.defaultChain},set:function(t){o.options.chain=t},enumerable:!0}),Object.defineProperty(this,"transactionPollingTimeout",{get:function(){return 0===o.options.transactionPollingTimeout?o.options.transactionPollingTimeout:o.options.transactionPollingTimeout||this.constructor.transactionPollingTimeout},set:function(t){o.options.transactionPollingTimeout=t},enumerable:!0}),Object.defineProperty(this,"transactionConfirmationBlocks",{get:function(){return 0===o.options.transactionConfirmationBlocks?o.options.transactionConfirmationBlocks:o.options.transactionConfirmationBlocks||this.constructor.transactionConfirmationBlocks},set:function(t){o.options.transactionConfirmationBlocks=t},enumerable:!0}),Object.defineProperty(this,"transactionBlockTimeout",{get:function(){return 0===o.options.transactionBlockTimeout?o.options.transactionBlockTimeout:o.options.transactionBlockTimeout||this.constructor.transactionBlockTimeout},set:function(t){o.options.transactionBlockTimeout=t},enumerable:!0}),Object.defineProperty(this,"defaultAccount",{get:function(){return s},set:function(t){return t&&(s=l.toChecksumAddress(h.inputAddressFormatter(t))),t},enumerable:!0}),Object.defineProperty(this,"defaultBlock",{get:function(){return u},set:function(t){return u=t},enumerable:!0}),this.methods={},this.events={},this._address=null,this._jsonInterface=[],this.options.address=r,this.options.jsonInterface=e};o.setProvider=function(t,e){c.packageInit(this,[t]),this._ethAccounts=e},o.prototype._getCallback=function(t){if(t&&f.isFunction(t[t.length-1]))return t.pop()},o.prototype._checkListener=function(t,e){if(e===t)throw new Error('The event "'+t+"\" is a reserved event name, you can't use it.")},o.prototype._getOrSetDefaultOptions=function(t){var e=t.gasPrice?String(t.gasPrice):null,r=t.from?l.toChecksumAddress(h.inputAddressFormatter(t.from)):null;return t.data=t.data||this.options.data,t.from=r||this.options.from,t.gasPrice=e||this.options.gasPrice,t.gas=t.gas||t.gasLimit||this.options.gas,delete t.gasLimit,t},o.prototype._encodeEventABI=function(t,e){var r=(e=e||{}).filter||{},n={};if(["fromBlock","toBlock"].filter(function(t){return void 0!==e[t]}).forEach(function(t){n[t]=h.inputBlockNumberFormatter(e[t])}),f.isArray(e.topics))n.topics=e.topics;else{if(n.topics=[],t&&!t.anonymous&&"ALLEVENTS"!==t.name&&n.topics.push(t.signature),"ALLEVENTS"!==t.name){var i=t.inputs.filter(function(t){return!0===t.indexed}).map(function(e){var t=r[e.name];return t?f.isArray(t)?t.map(function(t){return d.encodeParameter(e.type,t)}):d.encodeParameter(e.type,t):null});n.topics=n.topics.concat(i)}n.topics.length||delete n.topics}return this.options.address&&(n.address=this.options.address.toLowerCase()),n},o.prototype._decodeEventABI=function(e){var t=this;e.data=e.data||"",e.topics=e.topics||[];var r=h.outputLogFormatter(e);if("ALLEVENTS"===t.name&&(t=t.jsonInterface.find(function(t){return t.signature===e.topics[0]})||{anonymous:!0}),t.inputs=t.inputs||[],!t.anonymous){var n=0;t.inputs.forEach(function(t){return t.indexed?n++:null}),0\\$%@ءؤة\"'^|~⦅⦆・ゥャ¢£¬¦¥₩│←↑→↓■○𐐨𐐩𐐪𐐫𐐬𐐭𐐮𐐯𐐰𐐱𐐲𐐳𐐴𐐵𐐶𐐷𐐸𐐹𐐺𐐻𐐼𐐽𐐾𐐿𐑀𐑁𐑂𐑃𐑄𐑅𐑆𐑇𐑈𐑉𐑊𐑋𐑌𐑍𐑎𐑏𐓘𐓙𐓚𐓛𐓜𐓝𐓞𐓟𐓠𐓡𐓢𐓣𐓤𐓥𐓦𐓧𐓨𐓩𐓪𐓫𐓬𐓭𐓮𐓯𐓰𐓱𐓲𐓳𐓴𐓵𐓶𐓷𐓸𐓹𐓺𐓻𐳀𐳁𐳂𐳃𐳄𐳅𐳆𐳇𐳈𐳉𐳊𐳋𐳌𐳍𐳎𐳏𐳐𐳑𐳒𐳓𐳔𐳕𐳖𐳗𐳘𐳙𐳚𐳛𐳜𐳝𐳞𐳟𐳠𐳡𐳢𐳣𐳤𐳥𐳦𐳧𐳨𐳩𐳪𐳫𐳬𐳭𐳮𐳯𐳰𐳱𐳲𑣀𑣁𑣂𑣃𑣄𑣅𑣆𑣇𑣈𑣉𑣊𑣋𑣌𑣍𑣎𑣏𑣐𑣑𑣒𑣓𑣔𑣕𑣖𑣗𑣘𑣙𑣚𑣛𑣜𑣝𑣞𑣟ıȷ∇∂𞤢𞤣𞤤𞤥𞤦𞤧𞤨𞤩𞤪𞤫𞤬𞤭𞤮𞤯𞤰𞤱𞤲𞤳𞤴𞤵𞤶𞤷𞤸𞤹𞤺𞤻𞤼𞤽𞤾𞤿𞥀𞥁𞥂𞥃ٮڡٯ字双多解交映無前後再新初終販声吹演投捕遊指禁空合満申割営配得可丽丸乁𠄢你侻倂偺備像㒞𠘺兔兤具𠔜㒹內𠕋冗冤仌冬𩇟刃㓟刻剆剷㔕包匆卉博即卽卿𠨬灰及叟𠭣叫叱吆咞吸呈周咢哶唐啓啣善喫喳嗂圖圗噑噴壮城埴堍型堲報墬𡓤売壷夆夢奢𡚨𡛪姬娛娧姘婦㛮嬈嬾𡧈寃寘寳𡬘寿将㞁屠峀岍𡷤嵃𡷦嵮嵫嵼巡巢㠯巽帨帽幩㡢𢆃㡼庰庳庶𪎒𢌱舁弢㣇𣊸𦇚形彫㣣徚忍志忹悁㤺㤜𢛔惇慈慌慺憲憤憯懞戛扝抱拔捐𢬌挽拼捨掃揤𢯱搢揅掩㨮摩摾撝摷㩬敬𣀊旣書晉㬙㬈㫤冒冕最暜肭䏙朡杞杓𣏃㭉柺枅桒𣑭梎栟椔楂榣槪檨𣚣櫛㰘次𣢧歔㱎歲殟殻𣪍𡴋𣫺汎𣲼沿泍汧洖派浩浸涅𣴞洴港湮㴳滇𣻑淹潮𣽞𣾎濆瀹瀛㶖灊災灷炭𠔥煅𤉣熜爨牐𤘈犀犕𤜵𤠔獺王㺬玥㺸瑇瑜璅瓊㼛甤𤰶甾𤲒𢆟瘐𤾡𤾸𥁄㿼䀈𥃳𥃲𥄙𥄳眞真瞋䁆䂖𥐝硎䃣𥘦𥚚𥛅秫䄯穊穏𥥼𥪧䈂𥮫篆築䈧𥲀糒䊠糨糣紀𥾆絣䌁緇縂繅䌴𦈨𦉇䍙𦋙罺𦌾羕翺𦓚𦔣聠𦖨聰𣍟䏕育脃䐋脾媵𦞧𦞵𣎓𣎜舄辞䑫芑芋芝劳花芳芽苦𦬼茝荣莭茣莽菧荓菊菌菜𦰶𦵫𦳕䔫蓱蓳蔖𧏊蕤𦼬䕝䕡𦾱𧃒䕫虐虧虩蚩蚈蜎蛢蜨蝫螆蟡蠁䗹衠𧙧裗裞䘵裺㒻𧢮𧥦䚾䛇誠𧲨貫賁贛起𧼯𠠄跋趼跰𠣞軔𨗒𨗭邔郱鄑𨜮鄛鈸鋗鋘鉼鏹鐕𨯺開䦕閷𨵷䧦雃嶲霣𩅅𩈚䩮䩶韠𩐊䪲𩒖頩𩖶飢䬳餩馧駂駾䯎𩬰鱀鳽䳎䳭鵧𪃎䳸𪄅𪈎𪊑䵖黾鼅鼏鼖𪘀",mapChar:function(t){return 196608<=t?917760<=t&&t<=917999?18874368:0:e[r[t>>4]][15&t]}}},"function"==typeof define&&define.amd?define([],function(){return i()}):"object"===(void 0===r?"undefined":n(r))?e.exports=i():(void 0).uts46_map=i()},{}],438:[function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i;i=function(p,y){function i(t,e,r){for(var n=[],i=p.ucs2.decode(t),o=0;o>23,c=u>>21&3,l=u>>5&65535,h=31&u,d=y.mapStr.substr(l,h);if(0===c||e&&1&f)throw new Error("Illegal char "+s);1===c?n.push(d):2===c?n.push(r?d:s):3===c&&n.push(s)}return n.join("").normalize("NFC")}function f(t,e,r){void 0===r&&(r=!1);var n=i(t,r,e).split(".");return(n=n.map(function(t){return t.startsWith("xn--")?o(t=p.decode(t.substring(4)),r,!1):o(t,r,e),t})).join(".")}function o(t,e,r){if("-"===t[2]&&"-"===t[3])throw new Error("Failed to validate "+t);if(t.startsWith("-")||t.endsWith("-"))throw new Error("Failed to validate "+t);if(t.includes("."))throw new Error("Failed to validate "+t);if(i(t,e,r)!==t)throw new Error("Failed to validate "+t);var n=t.codePointAt(0);if(y.mapChar(n)&2<<23)throw new Error("Label contains illegal character: "+n)}return{toUnicode:function(t,e){return void 0===e&&(e={}),f(t,!1,"useStd3ASCII"in e&&e.useStd3ASCII)},toAscii:function(t,e){void 0===e&&(e={});var r,n=!("transitional"in e)||e.transitional,i="useStd3ASCII"in e&&e.useStd3ASCII,o="verifyDnsLength"in e&&e.verifyDnsLength,a=f(t,n,i).split(".").map(p.toASCII),s=a.join(".");if(o){if(s.length<1||253>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}m.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,n,i=t.length,o=this.blocks,a=this.byteCount,s=this.blockCount,u=0,f=this.s;u>2]|=t[u]<>2]|=n<>2]|=(192|n>>6)<>2]|=(224|n>>12)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+u[15&t]+u[t>>12&15]+u[t>>8&15]+u[t>>20&15]+u[t>>16&15]+u[t>>28&15]+u[t>>24&15];a%e==0&&(v(r),o=0)}return i&&(t=r[o],0>4&15]+u[15&t]),1>12&15]+u[t>>8&15]),2>20&15]+u[t>>16&15])),s},m.prototype.buffer=m.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(t);a>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;s%r==0&&v(n)}return o&&(t=s<<2,e=n[a],0>8&255),2>16&255)),u};var v=function(t){var e,r,n,i,o,a,s,u,f,c,l,h,d,p,y,b,m,v,g,w,_,A,S,x,E,k,M,j,I,T,R,O,B,U,C,N,P,L,F,D,q,z,H,K,V,G,W,Y,X,J,Z,$,Q,tt,et,rt,nt,it,ot,at,st,ut,ft;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],f=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],e=(h=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|s>>>31),r=(d=t[9]^t[19]^t[29]^t[39]^t[49])^(s<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(u<<1|f>>>31),r=o^(f<<1|u>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(c<<1|l>>>31),r=s^(l<<1|c>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=u^(h<<1|d>>>31),r=f^(d<<1|h>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=c^(i<<1|o>>>31),r=l^(o<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,p=t[0],y=t[1],G=t[11]<<4|t[10]>>>28,W=t[10]<<4|t[11]>>>28,j=t[20]<<3|t[21]>>>29,I=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,st=t[30]<<9|t[31]>>>23,z=t[40]<<18|t[41]>>>14,H=t[41]<<18|t[40]>>>14,U=t[2]<<1|t[3]>>>31,C=t[3]<<1|t[2]>>>31,b=t[13]<<12|t[12]>>>20,m=t[12]<<12|t[13]>>>20,Y=t[22]<<10|t[23]>>>22,X=t[23]<<10|t[22]>>>22,T=t[33]<<13|t[32]>>>19,R=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,ft=t[43]<<2|t[42]>>>30,tt=t[5]<<30|t[4]>>>2,et=t[4]<<30|t[5]>>>2,N=t[14]<<6|t[15]>>>26,P=t[15]<<6|t[14]>>>26,v=t[25]<<11|t[24]>>>21,g=t[24]<<11|t[25]>>>21,J=t[34]<<15|t[35]>>>17,Z=t[35]<<15|t[34]>>>17,O=t[45]<<29|t[44]>>>3,B=t[44]<<29|t[45]>>>3,x=t[6]<<28|t[7]>>>4,E=t[7]<<28|t[6]>>>4,rt=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,L=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,w=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,Q=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,V=t[9]<<27|t[8]>>>5,k=t[18]<<20|t[19]>>>12,M=t[19]<<20|t[18]>>>12,it=t[29]<<7|t[28]>>>25,ot=t[28]<<7|t[29]>>>25,D=t[38]<<8|t[39]>>>24,q=t[39]<<8|t[38]>>>24,A=t[48]<<14|t[49]>>>18,S=t[49]<<14|t[48]>>>18,t[0]=p^~b&v,t[1]=y^~m&g,t[10]=x^~k&j,t[11]=E^~M&I,t[20]=U^~N&L,t[21]=C^~P&F,t[30]=K^~G&Y,t[31]=V^~W&X,t[40]=tt^~rt&it,t[41]=et^~nt&ot,t[2]=b^~v&w,t[3]=m^~g&_,t[12]=k^~j&T,t[13]=M^~I&R,t[22]=N^~L&D,t[23]=P^~F&q,t[32]=G^~Y&J,t[33]=W^~X&Z,t[42]=rt^~it&at,t[43]=nt^~ot&st,t[4]=v^~w&A,t[5]=g^~_&S,t[14]=j^~T&O,t[15]=I^~R&B,t[24]=L^~D&z,t[25]=F^~q&H,t[34]=Y^~J&$,t[35]=X^~Z&Q,t[44]=it^~at&ut,t[45]=ot^~st&ft,t[6]=w^~A&p,t[7]=_^~S&y,t[16]=T^~O&x,t[17]=R^~B&E,t[26]=D^~z&U,t[27]=q^~H&C,t[36]=J^~$&K,t[37]=Z^~Q&V,t[46]=at^~ut&tt,t[47]=st^~ft&et,t[8]=A^~p&b,t[9]=S^~y&m,t[18]=O^~x&k,t[19]=B^~E&M,t[28]=z^~U&N,t[29]=H^~C&P,t[38]=$^~K&G,t[39]=Q^~V&W,t[48]=ut^~tt&rt,t[49]=ft^~et&nt,t[0]^=ct[n],t[1]^=ct[n+1]};if(e)A.exports=f;else for(h=0;h":">",'"':""","'":"'","`":"`"},q=d.invert(D),z=function(e){var r=function(t){return e[t]},t="(?:"+d.keys(e).join("|")+")",n=RegExp(t),i=RegExp(t,"g");return function(t){return t=null==t?"":""+t,n.test(t)?t.replace(i,r):t}};d.escape=z(D),d.unescape=z(q),d.result=function(t,e,r){d.isArray(e)||(e=[e]);var n=e.length;if(!n)return d.isFunction(r)?r.call(t):r;for(var i=0;i/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,V={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},G=/\\|'|\r|\n|\u2028|\u2029/g,W=function(t){return"\\"+V[t]};d.template=function(o,t,e){!t&&e&&(t=e),t=d.defaults({},t,d.templateSettings);var r,n=RegExp([(t.escape||K).source,(t.interpolate||K).source,(t.evaluate||K).source].join("|")+"|$","g"),a=0,s="__p+='";o.replace(n,function(t,e,r,n,i){return s+=o.slice(a,i).replace(G,W),a=i+t.length,e?s+="'+\n((__t=("+e+"))==null?'':_.escape(__t))+\n'":r?s+="'+\n((__t=("+r+"))==null?'':__t)+\n'":n&&(s+="';\n"+n+"\n__p+='"),t}),s+="';\n",t.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{r=new Function(t.variable||"obj","_",s)}catch(t){throw t.source=s,t}var i=function(t){return r.call(this,t,d)},u=t.variable||"obj";return i.source="function("+u+"){\n"+s+"}",i},d.chain=function(t){var e=d(t);return e._chain=!0,e};var Y=function(t,e){return t._chain?d(e).chain():e};d.mixin=function(r){return d.each(d.functions(r),function(t){var e=d[t]=r[t];d.prototype[t]=function(){var t=[this._wrapped];return i.apply(t,arguments),Y(this,e.apply(d,t))}}),d},d.mixin(d),d.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var r=n[e];d.prototype[e]=function(){var t=this._wrapped;return r.apply(t,arguments),"shift"!==e&&"splice"!==e||0!==t.length||delete t[0],Y(this,t)}}),d.each(["concat","join","slice"],function(t){var e=n[t];d.prototype[t]=function(){return Y(this,e.apply(this._wrapped,arguments))}}),d.prototype.valueOf=d.prototype.toJSON=d.prototype.value=function(){return this._wrapped},d.prototype.toString=function(){return String(this._wrapped)},"function"==typeof define&&define.amd&&define("underscore",[],function(){return d})}()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],441:[function(t,e,r){"use strict";function u(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function n(s){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=s.apply(t,a);function i(t){u(n,e,r,i,o,"next",t)}function o(t){u(n,e,r,i,o,"throw",t)}i(void 0)})}}var i=t("underscore"),a=t("./config"),o=t("web3-core-helpers").formatters,s=t("web3-utils"),f=t("./contracts/Registry"),c=t("./lib/ResolverMethodHandler");function l(t){this.eth=t;var e=null;this._detectedAddress=null,this._lastSyncCheck=null,Object.defineProperty(this,"registry",{get:function(){return new f(this)},enumerable:!0}),Object.defineProperty(this,"resolverMethodHandler",{get:function(){return new c(this.registry)},enumerable:!0}),Object.defineProperty(this,"registryAddress",{get:function(){return e},set:function(t){e=null!==t?o.inputAddressFormatter(t):t},enumerable:!0})}l.prototype.supportsInterface=function(t,e,r){return this.getResolver(t).then(function(t){return s.isHexStrict(e)||(e=s.sha3(e).slice(0,10)),t.methods.supportsInterface(e).call(r)}).catch(function(t){if(!i.isFunction(r))throw t;r(t,null)})},l.prototype.resolver=function(t,e){return this.registry.resolver(t,e)},l.prototype.getResolver=function(t,e){return this.registry.getResolver(t,e)},l.prototype.setResolver=function(t,e,r,n){return this.registry.setResolver(t,e,r,n)},l.prototype.setRecord=function(t,e,r,n,i,o){return this.registry.setRecord(t,e,r,n,i,o)},l.prototype.setSubnodeRecord=function(t,e,r,n,i,o,a){return this.registry.setSubnodeRecord(t,e,r,n,i,o,a)},l.prototype.setApprovalForAll=function(t,e,r,n){return this.registry.setApprovalForAll(t,e,r,n)},l.prototype.isApprovedForAll=function(t,e,r){return this.registry.isApprovedForAll(t,e,r)},l.prototype.recordExists=function(t,e){return this.registry.recordExists(t,e)},l.prototype.setSubnodeOwner=function(t,e,r,n,i){return this.registry.setSubnodeOwner(t,e,r,n,i)},l.prototype.getTTL=function(t,e){return this.registry.getTTL(t,e)},l.prototype.setTTL=function(t,e,r,n){return this.registry.setTTL(t,e,r,n)},l.prototype.getOwner=function(t,e){return this.registry.getOwner(t,e)},l.prototype.setOwner=function(t,e,r,n){return this.registry.setOwner(t,e,r,n)},l.prototype.getAddress=function(t,e){return this.resolverMethodHandler.method(t,"addr",[]).call(e)},l.prototype.setAddress=function(t,e,r,n){return this.resolverMethodHandler.method(t,"setAddr",[e]).send(r,n)},l.prototype.getPubkey=function(t,e){return this.resolverMethodHandler.method(t,"pubkey",[],e).call(e)},l.prototype.setPubkey=function(t,e,r,n,i){return this.resolverMethodHandler.method(t,"setPubkey",[e,r]).send(n,i)},l.prototype.getContent=function(t,e){return this.resolverMethodHandler.method(t,"content",[]).call(e)},l.prototype.setContent=function(t,e,r,n){return this.resolverMethodHandler.method(t,"setContent",[e]).send(r,n)},l.prototype.getMultihash=function(t,e){return this.resolverMethodHandler.method(t,"multihash",[]).call(e)},l.prototype.setMultihash=function(t,e,r,n){return this.resolverMethodHandler.method(t,"multihash",[e]).send(r,n)},l.prototype.checkNetwork=n(regeneratorRuntime.mark(function t(){var e,r,n,i,o;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e=new Date/1e3,!this._lastSyncCheck||3600":">",'"':""","'":"'","`":"`"},q=d.invert(D),z=function(e){var r=function(t){return e[t]},t="(?:"+d.keys(e).join("|")+")",n=RegExp(t),i=RegExp(t,"g");return function(t){return t=null==t?"":""+t,n.test(t)?t.replace(i,r):t}};d.escape=z(D),d.unescape=z(q),d.result=function(t,e,r){d.isArray(e)||(e=[e]);var n=e.length;if(!n)return d.isFunction(r)?r.call(t):r;for(var i=0;i/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,V={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},G=/\\|'|\r|\n|\u2028|\u2029/g,W=function(t){return"\\"+V[t]};d.template=function(o,t,e){!t&&e&&(t=e),t=d.defaults({},t,d.templateSettings);var r,n=RegExp([(t.escape||K).source,(t.interpolate||K).source,(t.evaluate||K).source].join("|")+"|$","g"),a=0,s="__p+='";o.replace(n,function(t,e,r,n,i){return s+=o.slice(a,i).replace(G,W),a=i+t.length,e?s+="'+\n((__t=("+e+"))==null?'':_.escape(__t))+\n'":r?s+="'+\n((__t=("+r+"))==null?'':__t)+\n'":n&&(s+="';\n"+n+"\n__p+='"),t}),s+="';\n",t.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{r=new Function(t.variable||"obj","_",s)}catch(t){throw t.source=s,t}var i=function(t){return r.call(this,t,d)},u=t.variable||"obj";return i.source="function("+u+"){\n"+s+"}",i},d.chain=function(t){var e=d(t);return e._chain=!0,e};var Y=function(t,e){return t._chain?d(e).chain():e};d.mixin=function(r){return d.each(d.functions(r),function(t){var e=d[t]=r[t];d.prototype[t]=function(){var t=[this._wrapped];return i.apply(t,arguments),Y(this,e.apply(d,t))}}),d},d.mixin(d),d.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var r=n[e];d.prototype[e]=function(){var t=this._wrapped;return r.apply(t,arguments),"shift"!==e&&"splice"!==e||0!==t.length||delete t[0],Y(this,t)}}),d.each(["concat","join","slice"],function(t){var e=n[t];d.prototype[t]=function(){return Y(this,e.apply(this._wrapped,arguments))}}),d.prototype.valueOf=d.prototype.toJSON=d.prototype.value=function(){return this._wrapped},d.prototype.toString=function(){return String(this._wrapped)},"function"==typeof define&&define.amd&&define("underscore",[],function(){return d})}()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],452:[function(t,e,r){"use strict";var i=t("underscore");e.exports=function(r){var n,e=this;return this.net.getId().then(function(t){return n=t,e.getBlock(0)}).then(function(t){var e="private";return"0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3"===t.hash&&1===n&&(e="main"),"0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303"===t.hash&&2===n&&(e="morden"),"0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d"===t.hash&&3===n&&(e="ropsten"),"0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177"===t.hash&&4===n&&(e="rinkeby"),"0xbf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a"===t.hash&&5===n&&(e="goerli"),"0xa3c565fc15c7478862d50ccd6561e3c06b24cc509bf388941c25ea985ce32cb9"===t.hash&&42===n&&(e="kovan"),i.isFunction(r)&&r(null,e),e}).catch(function(t){if(!i.isFunction(r))throw t;r(t)})}},{underscore:451}],453:[function(t,e,r){"use strict";var y=t("underscore"),b=t("web3-core"),n=t("web3-core-helpers"),m=t("web3-core-subscriptions").subscriptions,v=t("web3-core-method"),g=t("web3-utils"),w=t("web3-net"),_=t("web3-eth-ens"),A=t("web3-eth-personal"),S=t("web3-eth-contract"),x=t("web3-eth-iban"),E=t("web3-eth-accounts"),k=t("web3-eth-abi"),M=t("./getNetworkType.js"),j=n.formatters,I=function(t){return y.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getBlockByHash":"eth_getBlockByNumber"},T=function(t){return y.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getTransactionByBlockHashAndIndex":"eth_getTransactionByBlockNumberAndIndex"},R=function(t){return y.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getUncleByBlockHashAndIndex":"eth_getUncleByBlockNumberAndIndex"},O=function(t){return y.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getBlockTransactionCountByHash":"eth_getBlockTransactionCountByNumber"},B=function(t){return y.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getUncleCountByBlockHash":"eth_getUncleCountByBlockNumber"},i=function(){var e=this;b.packageInit(this,arguments);var r=this.setRequestManager;this.setRequestManager=function(t){return r(t),e.net.setRequestManager(t),e.personal.setRequestManager(t),e.accounts.setRequestManager(t),e.Contract._requestManager=e._requestManager,e.Contract.currentProvider=e._provider,!0};var n,i,o,t=this.setProvider,a=!(this.setProvider=function(){t.apply(e,arguments),e.setRequestManager(e._requestManager),e.ens._detectedAddress=null,e.ens._lastSyncCheck=null}),s=null,u="latest",f=50,c=24,l=750;Object.defineProperty(this,"handleRevert",{get:function(){return a},set:function(t){a=t,e.Contract.handleRevert=a,p.forEach(function(t){t.handleRevert=a})},enumerable:!0}),Object.defineProperty(this,"defaultCommon",{get:function(){return o},set:function(t){o=t,e.Contract.defaultCommon=o,p.forEach(function(t){t.defaultCommon=o})},enumerable:!0}),Object.defineProperty(this,"defaultHardfork",{get:function(){return i},set:function(t){i=t,e.Contract.defaultHardfork=i,p.forEach(function(t){t.defaultHardfork=i})},enumerable:!0}),Object.defineProperty(this,"defaultChain",{get:function(){return n},set:function(t){n=t,e.Contract.defaultChain=n,p.forEach(function(t){t.defaultChain=n})},enumerable:!0}),Object.defineProperty(this,"transactionPollingTimeout",{get:function(){return l},set:function(t){l=t,e.Contract.transactionPollingTimeout=l,p.forEach(function(t){t.transactionPollingTimeout=l})},enumerable:!0}),Object.defineProperty(this,"transactionConfirmationBlocks",{get:function(){return c},set:function(t){c=t,e.Contract.transactionConfirmationBlocks=c,p.forEach(function(t){t.transactionConfirmationBlocks=c})},enumerable:!0}),Object.defineProperty(this,"transactionBlockTimeout",{get:function(){return f},set:function(t){f=t,e.Contract.transactionBlockTimeout=f,p.forEach(function(t){t.transactionBlockTimeout=f})},enumerable:!0}),Object.defineProperty(this,"defaultAccount",{get:function(){return s},set:function(t){return t&&(s=g.toChecksumAddress(j.inputAddressFormatter(t))),e.Contract.defaultAccount=s,e.personal.defaultAccount=s,p.forEach(function(t){t.defaultAccount=s}),t},enumerable:!0}),Object.defineProperty(this,"defaultBlock",{get:function(){return u},set:function(t){return u=t,e.Contract.defaultBlock=u,e.personal.defaultBlock=u,p.forEach(function(t){t.defaultBlock=u}),t},enumerable:!0}),this.clearSubscriptions=e._requestManager.clearSubscriptions,this.net=new w(this),this.net.getNetworkType=M.bind(this),this.accounts=new E(this),this.personal=new A(this),this.personal.defaultAccount=this.defaultAccount;var h=this,d=function(){S.apply(this,arguments);var t=this,e=h.setProvider;h.setProvider=function(){e.apply(h,arguments),b.packageInit(t,[h])}};d.setProvider=function(){S.setProvider.apply(this,arguments)},(d.prototype=Object.create(S.prototype)).constructor=d,this.Contract=d,this.Contract.defaultAccount=this.defaultAccount,this.Contract.defaultBlock=this.defaultBlock,this.Contract.transactionBlockTimeout=this.transactionBlockTimeout,this.Contract.transactionConfirmationBlocks=this.transactionConfirmationBlocks,this.Contract.transactionPollingTimeout=this.transactionPollingTimeout,this.Contract.handleRevert=this.handleRevert,this.Contract._requestManager=this._requestManager,this.Contract._ethAccounts=this.accounts,this.Contract.currentProvider=this._requestManager.provider,this.Iban=x,this.abi=k,this.ens=new _(this);var p=[new v({name:"getNodeInfo",call:"web3_clientVersion"}),new v({name:"getProtocolVersion",call:"eth_protocolVersion",params:0}),new v({name:"getCoinbase",call:"eth_coinbase",params:0}),new v({name:"isMining",call:"eth_mining",params:0}),new v({name:"getHashrate",call:"eth_hashrate",params:0,outputFormatter:g.hexToNumber}),new v({name:"isSyncing",call:"eth_syncing",params:0,outputFormatter:j.outputSyncingFormatter}),new v({name:"getGasPrice",call:"eth_gasPrice",params:0,outputFormatter:j.outputBigNumberFormatter}),new v({name:"getAccounts",call:"eth_accounts",params:0,outputFormatter:g.toChecksumAddress}),new v({name:"getBlockNumber",call:"eth_blockNumber",params:0,outputFormatter:g.hexToNumber}),new v({name:"getBalance",call:"eth_getBalance",params:2,inputFormatter:[j.inputAddressFormatter,j.inputDefaultBlockNumberFormatter],outputFormatter:j.outputBigNumberFormatter}),new v({name:"getStorageAt",call:"eth_getStorageAt",params:3,inputFormatter:[j.inputAddressFormatter,g.numberToHex,j.inputDefaultBlockNumberFormatter]}),new v({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[j.inputAddressFormatter,j.inputDefaultBlockNumberFormatter]}),new v({name:"getBlock",call:I,params:2,inputFormatter:[j.inputBlockNumberFormatter,function(t){return!!t}],outputFormatter:j.outputBlockFormatter}),new v({name:"getUncle",call:R,params:2,inputFormatter:[j.inputBlockNumberFormatter,g.numberToHex],outputFormatter:j.outputBlockFormatter}),new v({name:"getBlockTransactionCount",call:O,params:1,inputFormatter:[j.inputBlockNumberFormatter],outputFormatter:g.hexToNumber}),new v({name:"getBlockUncleCount",call:B,params:1,inputFormatter:[j.inputBlockNumberFormatter],outputFormatter:g.hexToNumber}),new v({name:"getTransaction",call:"eth_getTransactionByHash",params:1,inputFormatter:[null],outputFormatter:j.outputTransactionFormatter}),new v({name:"getTransactionFromBlock",call:T,params:2,inputFormatter:[j.inputBlockNumberFormatter,g.numberToHex],outputFormatter:j.outputTransactionFormatter}),new v({name:"getTransactionReceipt",call:"eth_getTransactionReceipt",params:1,inputFormatter:[null],outputFormatter:j.outputTransactionReceiptFormatter}),new v({name:"getTransactionCount",call:"eth_getTransactionCount",params:2,inputFormatter:[j.inputAddressFormatter,j.inputDefaultBlockNumberFormatter],outputFormatter:g.hexToNumber}),new v({name:"sendSignedTransaction",call:"eth_sendRawTransaction",params:1,inputFormatter:[null],abiCoder:k}),new v({name:"signTransaction",call:"eth_signTransaction",params:1,inputFormatter:[j.inputTransactionFormatter]}),new v({name:"sendTransaction",call:"eth_sendTransaction",params:1,inputFormatter:[j.inputTransactionFormatter],abiCoder:k}),new v({name:"sign",call:"eth_sign",params:2,inputFormatter:[j.inputSignFormatter,j.inputAddressFormatter],transformPayload:function(t){return t.params.reverse(),t}}),new v({name:"call",call:"eth_call",params:2,inputFormatter:[j.inputCallFormatter,j.inputDefaultBlockNumberFormatter],abiCoder:k}),new v({name:"estimateGas",call:"eth_estimateGas",params:1,inputFormatter:[j.inputCallFormatter],outputFormatter:g.hexToNumber}),new v({name:"submitWork",call:"eth_submitWork",params:3}),new v({name:"getWork",call:"eth_getWork",params:0}),new v({name:"getPastLogs",call:"eth_getLogs",params:1,inputFormatter:[j.inputLogFormatter],outputFormatter:j.outputLogFormatter}),new v({name:"getChainId",call:"eth_chainId",params:0,outputFormatter:g.hexToNumber}),new v({name:"requestAccounts",call:"eth_requestAccounts",params:0,outputFormatter:g.toChecksumAddress}),new v({name:"getProof",call:"eth_getProof",params:3,inputFormatter:[j.inputAddressFormatter,j.inputStorageKeysFormatter,j.inputDefaultBlockNumberFormatter],outputFormatter:j.outputProofFormatter}),new v({name:"getPendingTransactions",call:"eth_pendingTransactions",params:0,outputFormatter:j.outputTransactionFormatter}),new m({name:"subscribe",type:"eth",subscriptions:{newBlockHeaders:{subscriptionName:"newHeads",params:0,outputFormatter:j.outputBlockFormatter},pendingTransactions:{subscriptionName:"newPendingTransactions",params:0},logs:{params:1,inputFormatter:[j.inputLogFormatter],outputFormatter:j.outputLogFormatter,subscriptionHandler:function(t){t.removed?this.emit("changed",t):this.emit("data",t),y.isFunction(this.callback)&&this.callback(null,t,this)}},syncing:{params:0,outputFormatter:j.outputSyncingFormatter,subscriptionHandler:function(t){var e=this;!0!==this._isSyncing?(this._isSyncing=!0,this.emit("changed",e._isSyncing),y.isFunction(this.callback)&&this.callback(null,e._isSyncing,this),setTimeout(function(){e.emit("data",t),y.isFunction(e.callback)&&e.callback(null,t,e)},0)):(this.emit("data",t),y.isFunction(e.callback)&&this.callback(null,t,this),clearTimeout(this._isSyncingTimeout),this._isSyncingTimeout=setTimeout(function(){t.currentBlock>t.highestBlock-200&&(e._isSyncing=!1,e.emit("changed",e._isSyncing),y.isFunction(e.callback)&&e.callback(null,e._isSyncing,e))},500))}}}})];p.forEach(function(t){t.attachToObject(e),t.setRequestManager(e._requestManager,e.accounts),t.defaultBlock=e.defaultBlock,t.defaultAccount=e.defaultAccount,t.transactionBlockTimeout=e.transactionBlockTimeout,t.transactionConfirmationBlocks=e.transactionConfirmationBlocks,t.transactionPollingTimeout=e.transactionPollingTimeout,t.handleRevert=e.handleRevert})};b.addProviders(i),e.exports=i},{"./getNetworkType.js":452,underscore:451,"web3-core":231,"web3-core-helpers":216,"web3-core-method":218,"web3-core-subscriptions":228,"web3-eth-abi":245,"web3-eth-accounts":433,"web3-eth-contract":435,"web3-eth-ens":444,"web3-eth-iban":449,"web3-eth-personal":450,"web3-net":454,"web3-utils":489}],454:[function(t,e,r){"use strict";var n=t("web3-core"),i=t("web3-core-method"),o=t("web3-utils"),a=function(){var e=this;n.packageInit(this,arguments),[new i({name:"getId",call:"net_version",params:0,outputFormatter:parseInt}),new i({name:"isListening",call:"net_listening",params:0}),new i({name:"getPeerCount",call:"net_peerCount",params:0,outputFormatter:o.hexToNumber})].forEach(function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)})};n.addProviders(a),e.exports=a},{"web3-core":231,"web3-core-method":218,"web3-utils":489}],455:[function(t,e,r){"use strict";!function(){function i(t,e,r,n){return this instanceof i?(this.domain=t||void 0,this.path=e||"/",this.secure=!!r,this.script=!!n,this):new i(t,e,r,n)}function u(t,e,r){return t instanceof u?t:this instanceof u?(this.name=null,this.value=null,this.expiration_date=1/0,this.path=String(r||"/"),this.explicit_path=!1,this.domain=e||null,this.explicit_domain=!1,this.secure=!1,this.noscript=!1,t&&this.parse(t,e,r),this):new u(t,e,r)}i.All=Object.freeze(Object.create(null)),r.CookieAccessInfo=i,(r.Cookie=u).prototype.toString=function(){var t=[this.name+"="+this.value];return this.expiration_date!==1/0&&t.push("expires="+new Date(this.expiration_date).toGMTString()),this.domain&&t.push("domain="+this.domain),this.path&&t.push("path="+this.path),this.secure&&t.push("secure"),this.noscript&&t.push("httponly"),t.join("; ")},u.prototype.toValueString=function(){return this.name+"="+this.value};var a=/[:](?=\s*[a-zA-Z0-9_\-]+\s*[=])/g;function t(){var o,a;return this instanceof t?(o=Object.create(null),this.setCookie=function(t,e,r){var n,i;if(n=(t=new u(t,e,r)).expiration_date<=Date.now(),void 0===o[t.name])return!n&&(o[t.name]=[t],o[t.name]);for(a=o[t.name],i=0;il&&(G("Max buffer length exceeded: textNode"),i=Math.max(i,U.length)),C.length>l&&(G("Max buffer length exceeded: numberNode"),i=Math.max(i,C.length)),B=l-i+H);var i}),t(st).on(function(){if(L==d)return f({}),c(),void(P=!0);L===p&&0===z||G("Unexpected end");U!==X&&(f(U),c(),U=X);P=!0})}var t,e,o,B,U,C,N,P,L,F,D,q=(t=d(function(t){return t.unshift(/^/),(e=RegExp(t.map(n("source")).join(""))).exec.bind(e);var e}),B=t(e=/(\$?)/,/([\w-_]+|\*)/,o=/(?:{([\w ]*?)})?/),U=t(e,/\["([^"]+)"\]/,o),C=t(e,/\[(\d+|\*)\]/,o),N=t(e,/()/,/{([\w ]*?)}/),P=t(/\.\./),L=t(/\./),F=t(e,/!/),D=t(/$/),function(t){return t(m(B,U,C,N),P,L,F,D)});function z(t,e){return{key:t,node:e}}var H=n("key"),K=n("node"),V={};function G(t){var i=t($).emit,e=t(Q).emit,u=t(it).emit,r=t(nt).emit;function f(t,e,r){K(M(t))[e]=r}function c(t,e,r){t&&f(t,e,r);var n=k(z(e,r),t);return i(n),n}var n={};return n[ct]=function(t,e){if(!t)return u(e),c(t,V,e);var r,n,i,o=(n=e,i=K(M(r=t)),_(l,i)?c(r,A(i),n):r),a=j(o),s=H(M(o));return f(a,s,e),k(z(s,e),a)},n[lt]=function(t){return e(t),j(t)||r(K(M(t)))},n[ft]=c,n}var W=q(function(t,e,r,n,i){var o=b(H,M),a=b(K,M);function s(t,e){return!!e[1]?v(t,M):t}function u(t){if(t==w)return w;return v(function(t){return o(t)!=V},b(t,j))}function f(){return function(t){return o(t)==V}}function c(t,e,r,n,i){var o,a=t(r);if(a){var s=(o=a,R(function(t,e){return e(t,o)},n,e));return i(r.substr(A(a[0])),s)}}function l(t,e){return y(c,t,e)}var h=m(l(t,T(s,function(t,e){var r=e[3];return r?v(b(y(E,I(r.split(/\W+/))),a),t):t},function(t,e){var r=e[2];return v(r&&"*"!=r?function(t){return o(t)==r}:w,t)},u)),l(e,T(function(t){if(t==w)return w;var e=f(),r=t,n=u(function(t){return i(t)}),i=m(e,r,n);return i})),l(r,T()),l(n,T(s,f)),l(i,T(function(r){return function(t){var e=r(t);return!0===e?M(t):e}})),function(t){throw Y('"'+t+'" could not be tokenised')});function d(t,e){return e}function p(t,e){return h(t,e,t?p:d)}return function(e){try{return p(e,w)}catch(t){throw Y('Could not compile "'+e+'" because '+t.message)}}});function J(n,i,r){var o,a;function s(e){return function(t){return t.id==e}}return{on:function(t,e){var r={listener:t,id:e||t};return i&&i.emit(n,t,r.id),o=k(r,o),a=k(t,a),this},emit:function(){!function t(e,r){e&&(M(e).apply(null,r),t(j(e),r))}(a,arguments)},un:function(t){var e;o=c(o,s(t),function(t){e=t}),e&&(a=c(a,function(t){return t==e.listener}),r&&r.emit(n,e.listener,e.id))},listeners:function(){return a},hasListener:function(t){return x(function t(e,r){return r&&(e(M(r))?M(r):t(e,j(r)))}(t?s(t):w,o))}}}var Z=1,$=Z++,Q=Z++,tt=Z++,et=Z++,rt="fail",nt=Z++,it=Z++,ot="start",at="data",st="end",ut=Z++,ft=Z++,ct=Z++,lt=Z++;function ht(t,e,r){try{var n=u.parse(e)}catch(t){}return{statusCode:t,body:e,jsonBody:n,thrown:r}}function dt(n,i){var o={node:n(Q),path:n($)};function a(e,r,o){var a=n(e).emit;r.on(function(t){var e,r,n,i=o(t);!1!==i&&(e=a,r=K(i),n=O(t),e(r,s(j(f(H,n))),s(f(K,n))))},e),n("removeListener").on(function(t){t==e&&(n(t).listeners()||r.un(e))})}n("newListener").on(function(t){var e=/(node|path):(.*)/.exec(t);if(e){var r=o[e[1]];r.hasListener(t)||a(t,r,i(e[2]))}})}function pt(o,t){var i,a=/^(node|path):./,s=o(nt),u=o(et).emit,f=o(tt).emit,e=d(function(t,e){if(i[t])h(e,i[t]);else{var r=o(t),n=e[0];a.test(t)?c(r,n):r.on(n)}return i});function c(e,t,r){r=r||t;var n=l(t);return e.on(function(){var t=!1;i.forget=function(){t=!0},h(arguments,n),delete i.forget,t&&e.un(r)},r),i}function l(t){return function(){try{return t.apply(i,arguments)}catch(t){setTimeout(function(){throw new Y(t.message)})}}}function n(t,e,r){var n,i;n="node"==t?(i=r,function(){var t=i.apply(this,arguments);x(t)&&(t==mt.drop?u():f(t))}):r,c(o(t+":"+e),n,r)}function r(t,e,r){return S(e)?n(t,e,r):function(t,e){for(var r in e)n(t,r,e[r])}(t,e),i}return o(it).on(function(t){var e;i.root=(e=t,function(){return e})}),o(ot).on(function(t,e){i.header=function(t){return t?e[t]:e}}),i={on:e,addListener:e,removeListener:function(t,e,r){if("done"==t)s.un(e);else if("node"==t||"path"==t)o.un(t+":"+e,r);else{var n=e;o(t).un(n)}return i},emit:o.emit,node:y(r,"node"),path:y(r,"path"),done:y(c,s),start:y(function(t,e){return o(t).on(l(e),e),i},ot),fail:o(rt).on,abort:o(ut).emit,header:g,root:g,source:t}}function yt(t,e,r,n,i){var o=function(){var e={},r=i("newListener"),n=i("removeListener");function i(t){return e[t]=J(t,r,n)}function o(t){return e[t]||i(t)}return["emit","on","un"].forEach(function(r){o[r]=d(function(t,e){h(e,o(t)[r])})}),o}();return e&&function(e,n,t,r,i,o,a){var s,u=e(at).emit,f=e(rt).emit,c=0,l=!0;function h(){var t=n.responseText,e=t.substr(c);e&&u(e),c=A(t)}e(ut).on(function(){n.onreadystatechange=null,n.abort()}),"onprogress"in n&&(n.onprogress=h),n.onreadystatechange=function(){function t(){try{l&&e(ot).emit(n.status,(t=n.getAllResponseHeaders(),r={},t&&t.split("\r\n").forEach(function(t){var e=t.indexOf(": ");r[t.substring(0,e)]=t.substring(e+2)}),r)),l=!1}catch(t){}var t,r}switch(n.readyState){case 2:case 3:return t();case 4:t(),2==String(n.status)[0]?(h(),e(st).emit()):f(ht(n.status,n.responseText))}};try{for(var d in n.open(t,r,!0),o)n.setRequestHeader(d,o[d]);(function(e,t){function r(t){return t.port||{"http:":80,"https:":443}[t.protocol||e.protocol]}return!!(t.protocol&&t.protocol!=e.protocol||t.host&&t.host!=e.host||t.host&&r(t)!=r(e))})(p.location,{protocol:(s=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(r)||[])[1]||"",host:s[2]||"",port:s[3]||""})||n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.withCredentials=a,n.send(i)}catch(t){p.setTimeout(y(f,ht(X,X,t)),0)}}(o,new XMLHttpRequest,t,e,r,n,i),a(o),function(e,r){var i,n={};function t(e){return function(t){i=e(i,t)}}for(var o in r)e(o).on(t(r[o]),n);e(tt).on(function(t){var e=M(i),r=H(e),n=j(i);n&&(K(M(n))[r]=t)}),e(et).on(function(){var t=M(i),e=H(t),r=j(i);r&&delete K(M(r))[e]}),e(ut).on(function(){for(var t in r)e(t).un(n)})}(o,G(o)),dt(o,W),pt(o,e)}function bt(t,e,r,n,i,o,a){return i=i?u.parse(u.stringify(i)):{},n?(S(n)||(n=u.stringify(n),i["Content-Type"]=i["Content-Type"]||"application/json"),i["Content-Length"]=i["Content-Length"]||n.length):n=null,t(r||"GET",(s=e,!1===a&&(-1==s.indexOf("?")?s+="?":s+="&",s+="_="+(new Date).getTime()),s),n,i,o||!1);var s}function mt(t){var e=T("resume","pause","pipe"),r=y(E,e);return t?r(t)||S(t)?bt(yt,t):bt(yt,t.url,t.method,t.body,t.headers,t.withCredentials,t.cached):yt()}mt.drop=function(){return mt.drop},"function"==typeof define&&define.amd?define("oboe",[],function(){return mt}):"object"===(void 0===gt?"undefined":wt(gt))?vt.exports=mt:p.oboe=mt}(function(){try{return window}catch(t){return self}}(),Object,Array,Error,JSON)},{}],464:[function(t,Z,$){(function(X){"use strict";function J(t){return(J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(){var t="object"==("undefined"==typeof self?"undefined":J(self))&&self.self===self&&self||"object"==(void 0===X?"undefined":J(X))&&X.global===X&&X||this||{},e=t._,n=Array.prototype,a=Object.prototype,l="undefined"!=typeof Symbol?Symbol.prototype:null,i=n.push,u=n.slice,h=a.toString,o=a.hasOwnProperty,r=Array.isArray,s=Object.keys,f=Object.create,c=function(){},d=function t(e){return e instanceof t?e:this instanceof t?void(this._wrapped=e):new t(e)};void 0===$||$.nodeType?t._=d:(void 0!==Z&&!Z.nodeType&&Z.exports&&($=Z.exports=d),$._=d),d.VERSION="1.9.1";var p,y=function(i,o,t){if(void 0===o)return i;switch(null==t?3:t){case 1:return function(t){return i.call(o,t)};case 3:return function(t,e,r){return i.call(o,t,e,r)};case 4:return function(t,e,r,n){return i.call(o,t,e,r,n)}}return function(){return i.apply(o,arguments)}},b=function(t,e,r){return d.iteratee!==p?d.iteratee(t,e):null==t?d.identity:d.isFunction(t)?y(t,e,r):d.isObject(t)&&!d.isArray(t)?d.matcher(t):d.property(t)};d.iteratee=p=function(t,e){return b(t,e,1/0)};var m=function(i,o){return o=null==o?i.length-1:+o,function(){for(var t=Math.max(arguments.length-o,0),e=Array(t),r=0;r":">",'"':""","'":"'","`":"`"},q=d.invert(D),z=function(e){var r=function(t){return e[t]},t="(?:"+d.keys(e).join("|")+")",n=RegExp(t),i=RegExp(t,"g");return function(t){return t=null==t?"":""+t,n.test(t)?t.replace(i,r):t}};d.escape=z(D),d.unescape=z(q),d.result=function(t,e,r){d.isArray(e)||(e=[e]);var n=e.length;if(!n)return d.isFunction(r)?r.call(t):r;for(var i=0;i/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,V={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},G=/\\|'|\r|\n|\u2028|\u2029/g,W=function(t){return"\\"+V[t]};d.template=function(o,t,e){!t&&e&&(t=e),t=d.defaults({},t,d.templateSettings);var r,n=RegExp([(t.escape||K).source,(t.interpolate||K).source,(t.evaluate||K).source].join("|")+"|$","g"),a=0,s="__p+='";o.replace(n,function(t,e,r,n,i){return s+=o.slice(a,i).replace(G,W),a=i+t.length,e?s+="'+\n((__t=("+e+"))==null?'':_.escape(__t))+\n'":r?s+="'+\n((__t=("+r+"))==null?'':__t)+\n'":n&&(s+="';\n"+n+"\n__p+='"),t}),s+="';\n",t.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{r=new Function(t.variable||"obj","_",s)}catch(t){throw t.source=s,t}var i=function(t){return r.call(this,t,d)},u=t.variable||"obj";return i.source="function("+u+"){\n"+s+"}",i},d.chain=function(t){var e=d(t);return e._chain=!0,e};var Y=function(t,e){return t._chain?d(e).chain():e};d.mixin=function(r){return d.each(d.functions(r),function(t){var e=d[t]=r[t];d.prototype[t]=function(){var t=[this._wrapped];return i.apply(t,arguments),Y(this,e.apply(d,t))}}),d},d.mixin(d),d.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var r=n[e];d.prototype[e]=function(){var t=this._wrapped;return r.apply(t,arguments),"shift"!==e&&"splice"!==e||0!==t.length||delete t[0],Y(this,t)}}),d.each(["concat","join","slice"],function(t){var e=n[t];d.prototype[t]=function(){return Y(this,e.apply(this._wrapped,arguments))}}),d.prototype.valueOf=d.prototype.toJSON=d.prototype.value=function(){return this._wrapped},d.prototype.toString=function(){return String(this._wrapped)},"function"==typeof define&&define.amd&&define("underscore",[],function(){return d})}()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],465:[function(t,e,r){"use strict";var i=t("underscore"),o=t("web3-core-helpers").errors,a=t("oboe"),n=function(t,e){var n=this;this.responseCallbacks={},this.notificationCallbacks=[],this.path=t,this.connected=!1,this.connection=e.connect({path:this.path}),this.addDefaultEvents();var r=function(e){var r=null;i.isArray(e)?e.forEach(function(t){n.responseCallbacks[t.id]&&(r=t.id)}):r=e.id,r||-1===e.method.indexOf("_subscription")?n.responseCallbacks[r]&&(n.responseCallbacks[r](null,e),delete n.responseCallbacks[r]):n.notificationCallbacks.forEach(function(t){i.isFunction(t)&&t(e)})};"Socket"===e.constructor.name?a(this.connection).done(r):this.connection.on("data",function(t){n._parseResponse(t.toString()).forEach(r)})};n.prototype.addDefaultEvents=function(){var t=this;this.connection.on("connect",function(){t.connected=!0}),this.connection.on("close",function(){t.connected=!1}),this.connection.on("error",function(){t._timeout()}),this.connection.on("end",function(){t._timeout()}),this.connection.on("timeout",function(){t._timeout()})},n.prototype._parseResponse=function(t){var r=this,n=[];return t.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|").forEach(function(e){r.lastChunk&&(e=r.lastChunk+e);var t=null;try{t=JSON.parse(e)}catch(t){return r.lastChunk=e,clearTimeout(r.lastChunkTimeout),void(r.lastChunkTimeout=setTimeout(function(){throw r._timeout(),o.InvalidResponse(e)},15e3))}clearTimeout(r.lastChunkTimeout),r.lastChunk=null,t&&n.push(t)}),n},n.prototype._addResponseCallback=function(t,e){var r=t.id||t[0].id,n=t.method||t[0].method;this.responseCallbacks[r]=e,this.responseCallbacks[r].method=n},n.prototype._timeout=function(){for(var t in this.responseCallbacks)this.responseCallbacks.hasOwnProperty(t)&&(this.responseCallbacks[t](o.InvalidConnection("on IPC")),delete this.responseCallbacks[t])},n.prototype.reconnect=function(){this.connection.connect({path:this.path})},n.prototype.send=function(t,e){this.connection.writable||this.connection.connect({path:this.path}),this.connection.write(JSON.stringify(t)),this._addResponseCallback(t,e)},n.prototype.on=function(t,e){if("function"!=typeof e)throw new Error("The second parameter callback must be a function.");switch(t){case"data":this.notificationCallbacks.push(e);break;default:this.connection.on(t,e)}},n.prototype.once=function(t,e){if("function"!=typeof e)throw new Error("The second parameter callback must be a function.");this.connection.once(t,e)},n.prototype.removeListener=function(t,r){var n=this;switch(t){case"data":this.notificationCallbacks.forEach(function(t,e){t===r&&n.notificationCallbacks.splice(e,1)});break;default:this.connection.removeListener(t,r)}},n.prototype.removeAllListeners=function(t){switch(t){case"data":this.notificationCallbacks=[];break;default:this.connection.removeAllListeners(t)}},n.prototype.reset=function(){this._timeout(),this.notificationCallbacks=[],this.connection.removeAllListeners("error"),this.connection.removeAllListeners("end"),this.connection.removeAllListeners("timeout"),this.addDefaultEvents()},n.prototype.supportsSubscriptions=function(){return!0},e.exports=n},{oboe:463,underscore:464,"web3-core-helpers":216}],466:[function(t,e,r){"use strict";var n;try{n=t("es5-ext/global")}catch(t){}finally{if(n||"undefined"==typeof window||(n=window),!n)throw new Error("Could not determine global this")}var i=n.WebSocket||n.MozWebSocket,o=t("./version");function a(t,e){return e?new i(t,e):new i(t)}i&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach(function(t){Object.defineProperty(a,t,{get:function(){return i[t]}})}),e.exports={w3cwebsocket:i?a:null,version:o}},{"./version":467,"es5-ext/global":469}],467:[function(t,e,r){"use strict";e.exports=t("../package.json").version},{"../package.json":468}],468:[function(t,e,r){e.exports={_args:[["@web3-js/websocket@1.0.30","/Users/ryanghods/dev/web3.js/packages/web3-providers-ws"]],_from:"@web3-js/websocket@1.0.30",_id:"@web3-js/websocket@1.0.30",_inBundle:!1,_integrity:"sha512-fDwrD47MiDrzcJdSeTLF75aCcxVVt8B1N74rA+vh2XCAvFy4tEWJjtnUtj2QG7/zlQ6g9cQ88bZFBxwd9/FmtA==",_location:"/@web3-js/websocket",_phantomChildren:{},_requested:{type:"version",registry:!0,raw:"@web3-js/websocket@1.0.30",name:"@web3-js/websocket",escapedName:"@web3-js%2fwebsocket",scope:"@web3-js",rawSpec:"1.0.30",saveSpec:null,fetchSpec:"1.0.30"},_requiredBy:["/"],_resolved:"https://registry.npmjs.org/@web3-js/websocket/-/websocket-1.0.30.tgz",_spec:"1.0.30",_where:"/Users/ryanghods/dev/web3.js/packages/web3-providers-ws",author:{name:"Brian McKelvey",email:"theturtle32@gmail.com",url:"https://github.com/theturtle32"},browser:"lib/browser.js",bugs:{url:"https://github.com/web3-js/WebSocket-Node/issues"},config:{verbose:!1},contributors:[{name:"Iñaki Baz Castillo",email:"ibc@aliax.net",url:"http://dev.sipdoc.net"}],dependencies:{debug:"^2.2.0","es5-ext":"^0.10.50",nan:"^2.14.0","typedarray-to-buffer":"^3.1.5",yaeti:"^0.0.6"},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:"^4.0.2","gulp-jshint":"^2.0.4",jshint:"^2.0.0","jshint-stylish":"^2.2.1",tape:"^4.9.1"},directories:{lib:"./lib"},engines:{node:">=0.10.0"},homepage:"https://github.com/web3-js/WebSocket-Node",keywords:["websocket","websockets","socket","networking","comet","push","RFC-6455","realtime","server","client"],license:"Apache-2.0",main:"index",name:"@web3-js/websocket",repository:{type:"git",url:"git+https://github.com/web3-js/WebSocket-Node.git"},scripts:{gulp:"gulp",install:"(node-gyp rebuild 2> builderror.log) || (exit 0)",test:"faucet test/unit"},version:"1.0.30"}},{}],469:[function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=function(){if("object"===("undefined"==typeof self?"undefined":n(self))&&self)return self;if("object"===("undefined"==typeof window?"undefined":n(window))&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;if("object"===("undefined"==typeof globalThis?"undefined":n(globalThis))&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return i()}try{return __global__||i()}finally{delete Object.prototype.__global__}}()},{}],470:[function(t,e,r){arguments[4][219][0].apply(r,arguments)},{dup:219}],471:[function(a,s,t){(function(t,e){"use strict";var r=null,n=null;if("[object process]"===Object.prototype.toString.call(void 0!==t?t:0)){r=function(t){return e.from(t).toString("base64")};var i=a("url");if(i.URL){var o=i.URL;n=function(t){return new o(t)}}else n=a("url").parse}else r=btoa,n=function(t){return new URL(t)};s.exports={parseURL:n,btoa:r}}).call(this,a("_process"),a("buffer").Buffer)},{_process:124,buffer:50,url:185}],472:[function(t,e,r){"use strict";var n=t("eventemitter3"),i=t("./helpers.js"),o=t("web3-core-helpers").errors,a=t("@web3-js/websocket").w3cwebsocket,s=function(t,e){n.call(this),e=e||{},this.url=t,this._customTimeout=e.timeout||15e3,this.headers=e.headers||{},this.protocol=e.protocol||void 0,this.reconnectOptions=Object.assign({auto:!1,delay:5e3,maxAttempts:!1,onTimeout:!1},e.reconnect),this.clientConfig=e.clientConfig||void 0,this.requestOptions=e.requestOptions||void 0,this.DATA="data",this.CLOSE="close",this.ERROR="error",this.CONNECT="connect",this.RECONNECT="reconnect",this.connection=null,this.requestQueue=new Map,this.responseQueue=new Map,this.reconnectAttempts=0,this.reconnecting=!1;var r=i.parseURL(t);r.username&&r.password&&(this.headers.authorization="Basic "+i.btoa(r.username+":"+r.password)),r.auth&&(this.headers.authorization="Basic "+i.btoa(r.auth)),Object.defineProperty(this,"connected",{get:function(){return this.connection&&this.connection.readyState===this.connection.OPEN},enumerable:!0}),this.connect()};((s.prototype=Object.create(n.prototype)).constructor=s).prototype.connect=function(){this.connection=new a(this.url,this.protocol,void 0,this.headers,this.requestOptions,this.clientConfig),this._addSocketListeners()},s.prototype._onMessage=function(t){var r=this;this._parseResponse("string"==typeof t.data?t.data:"").forEach(function(t){if(t.method&&-1!==t.method.indexOf("_subscription"))r.emit(r.DATA,t);else{var e=t.id;Array.isArray(t)&&(e=t[0].id),r.responseQueue.has(e)&&(r.responseQueue.get(e).callback(!1,t),r.responseQueue.delete(e))}})},s.prototype._onConnect=function(){if(this.emit(this.CONNECT),this.reconnectAttempts=0,this.reconnecting=!1,0>>4).toString(16)),e.push((15&t[r]).toString(16));return"0x".concat(e.join("").replace(/^0+/,""))},r.toByteArray=i},{"js-sha3":481}],478:[function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var c=t("bn.js"),l=t("number-to-bn"),h=new c(0),d=new c(-1),p={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 y(t){var e=t?t.toLowerCase():"ether",r=p[e];if("string"!=typeof r)throw new Error("[ethjs-unit] the unit provided "+t+" doesn't exists, please use the one of the following units "+JSON.stringify(p,null,2));return new c(r,10)}function b(t){if("string"==typeof t){if(!t.match(/^-?[0-9.]+$/))throw new Error("while converting number to string, invalid number value '"+t+"', should be a number matching (^-?[0-9.]+).");return t}if("number"==typeof t)return String(t);if("object"===n(t)&&t.toString&&(t.toTwos||t.dividedToIntegerBy))return t.toPrecision?String(t.toPrecision()):t.toString(10);throw new Error("while converting number to string, invalid number value '"+t+"' type "+n(t)+".")}e.exports={unitMap:p,numberToString:b,getValueOfUnit:y,fromWei:function(t,e,r){var n=l(t),i=n.lt(h),o=y(e),a=p[e].length-1||1,s=r||{};i&&(n=n.mul(d));for(var u=n.mod(o).toString(10);u.lengthi)throw new Error("[ethjs-unit] while converting number "+t+" to wei, too many decimal places");for(;u.length>>26-a&67108863,26<=(a+=24)&&(a-=26,i++);else if("le"===r)for(i=n=0;n>>26-a&67108863,26<=(a+=24)&&(a-=26,i++);return this.strip()},m.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r>>26-o&4194303,26<=(o+=24)&&(o-=26,n++);r+6!==e&&(i=a(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},m.prototype._parseBase=function(t,e,r){this.words=[0];for(var n=0,i=this.length=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f"};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function i(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;n=(r.length=n)-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var f=1;f>>26,l=67108863&u,h=Math.min(f,e.length-1),d=Math.max(0,f-t.length+1);d<=h;d++){var p=f-d|0;c+=(a=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&a}r.words[f]=0|l,u=0|c}return 0!==u?r.words[f]=0|u:r.length--,r.strip()}m.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,i=0,o=0;o>>24-n&16777215)||o!==this.length-1?h[6-s.length]+s+r:s+r,26<=(n+=2)&&(n-=26,o--)}for(0!==i&&(r=i.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&2<=t&&t<=36){var u=d[t],f=p[t];r="";var c=this.clone();for(c.negative=0;!c.isZero();){var l=c.modn(f).toString(t);r=(c=c.idivn(f)).isZero()?l+r:h[u-l.length]+l+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}b(!1,"Base should be between 2 and 36")},m.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:2>>=13),64<=e&&(r+=7,e>>>=7),8<=e&&(r+=4,e>>>=4),2<=e&&(r+=2,e>>>=2),r+e},m.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},m.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},m.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},m.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},m.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},m.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},m.prototype.iuxor=function(t){var e,r;r=this.length>t.length?(e=this,t):(e=t,this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},m.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},m.prototype.inotn=function(t){b("number"==typeof t&&0<=t);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),0>26-r),this.strip()},m.prototype.notn=function(t){return this.clone().inotn(t)},m.prototype.setn=function(t,e){b("number"==typeof t&&0<=t);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,t):(r=t,this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},m.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;n=0>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,y=d>>>13,b=0|a[2],m=8191&b,v=b>>>13,g=0|a[3],w=8191&g,_=g>>>13,A=0|a[4],S=8191&A,x=A>>>13,E=0|a[5],k=8191&E,M=E>>>13,j=0|a[6],I=8191&j,T=j>>>13,R=0|a[7],O=8191&R,B=R>>>13,U=0|a[8],C=8191&U,N=U>>>13,P=0|a[9],L=8191&P,F=P>>>13,D=0|s[0],q=8191&D,z=D>>>13,H=0|s[1],K=8191&H,V=H>>>13,G=0|s[2],W=8191&G,Y=G>>>13,X=0|s[3],J=8191&X,Z=X>>>13,$=0|s[4],Q=8191&$,tt=$>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ft=st>>>13,ct=0|s[8],lt=8191&ct,ht=ct>>>13,dt=0|s[9],pt=8191&dt,yt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var bt=(f+(n=Math.imul(l,q))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(h,q)|0))<<13)|0;f=((o=Math.imul(h,z))+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,z))+Math.imul(y,q)|0,o=Math.imul(y,z);var mt=(f+(n=n+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,V)|0)+Math.imul(h,K)|0))<<13)|0;f=((o=o+Math.imul(h,V)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,q),i=(i=Math.imul(m,z))+Math.imul(v,q)|0,o=Math.imul(v,z),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,V)|0;var vt=(f+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,Y)|0)+Math.imul(h,W)|0))<<13)|0;f=((o=o+Math.imul(h,Y)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,z))+Math.imul(_,q)|0,o=Math.imul(_,z),n=n+Math.imul(m,K)|0,i=(i=i+Math.imul(m,V)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,V)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Y)|0;var gt=(f+(n=n+Math.imul(l,J)|0)|0)+((8191&(i=(i=i+Math.imul(l,Z)|0)+Math.imul(h,J)|0))<<13)|0;f=((o=o+Math.imul(h,Z)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(S,q),i=(i=Math.imul(S,z))+Math.imul(x,q)|0,o=Math.imul(x,z),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(m,W)|0,i=(i=i+Math.imul(m,Y)|0)+Math.imul(v,W)|0,o=o+Math.imul(v,Y)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,Z)|0;var wt=(f+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(h,Q)|0))<<13)|0;f=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,q),i=(i=Math.imul(k,z))+Math.imul(M,q)|0,o=Math.imul(M,z),n=n+Math.imul(S,K)|0,i=(i=i+Math.imul(S,V)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,V)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(m,J)|0,i=(i=i+Math.imul(m,Z)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,Z)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0;var _t=(f+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(h,rt)|0))<<13)|0;f=((o=o+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(I,q),i=(i=Math.imul(I,z))+Math.imul(T,q)|0,o=Math.imul(T,z),n=n+Math.imul(k,K)|0,i=(i=i+Math.imul(k,V)|0)+Math.imul(M,K)|0,o=o+Math.imul(M,V)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,Y)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(m,Q)|0,i=(i=i+Math.imul(m,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0;var At=(f+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,at)|0)+Math.imul(h,ot)|0))<<13)|0;f=((o=o+Math.imul(h,at)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(O,q),i=(i=Math.imul(O,z))+Math.imul(B,q)|0,o=Math.imul(B,z),n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(T,K)|0,o=o+Math.imul(T,V)|0,n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,Y)|0,n=n+Math.imul(S,J)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,Z)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(m,rt)|0,i=(i=i+Math.imul(m,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0;var St=(f+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ft)|0)+Math.imul(h,ut)|0))<<13)|0;f=((o=o+Math.imul(h,ft)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(C,q),i=(i=Math.imul(C,z))+Math.imul(N,q)|0,o=Math.imul(N,z),n=n+Math.imul(O,K)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,V)|0,n=n+Math.imul(I,W)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,Y)|0,n=n+Math.imul(k,J)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,Z)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(m,ot)|0,i=(i=i+Math.imul(m,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ft)|0;var xt=(f+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(h,lt)|0))<<13)|0;f=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(L,q),i=(i=Math.imul(L,z))+Math.imul(F,q)|0,o=Math.imul(F,z),n=n+Math.imul(C,K)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(N,K)|0,o=o+Math.imul(N,V)|0,n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(B,W)|0,o=o+Math.imul(B,Y)|0,n=n+Math.imul(I,J)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,Z)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,n=n+Math.imul(m,ut)|0,i=(i=i+Math.imul(m,ft)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ft)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ht)|0;var Et=(f+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,yt)|0)+Math.imul(h,pt)|0))<<13)|0;f=((o=o+Math.imul(h,yt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(L,K),i=(i=Math.imul(L,V))+Math.imul(F,K)|0,o=Math.imul(F,V),n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,Y)|0)+Math.imul(N,W)|0,o=o+Math.imul(N,Y)|0,n=n+Math.imul(O,J)|0,i=(i=i+Math.imul(O,Z)|0)+Math.imul(B,J)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,at)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,at)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ft)|0,n=n+Math.imul(m,lt)|0,i=(i=i+Math.imul(m,ht)|0)+Math.imul(v,lt)|0,o=o+Math.imul(v,ht)|0;var kt=(f+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,yt)|0)+Math.imul(y,pt)|0))<<13)|0;f=((o=o+Math.imul(y,yt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(L,W),i=(i=Math.imul(L,Y))+Math.imul(F,W)|0,o=Math.imul(F,Y),n=n+Math.imul(C,J)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,Z)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,at)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,at)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ft)|0,n=n+Math.imul(w,lt)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,ht)|0;var Mt=(f+(n=n+Math.imul(m,pt)|0)|0)+((8191&(i=(i=i+Math.imul(m,yt)|0)+Math.imul(v,pt)|0))<<13)|0;f=((o=o+Math.imul(v,yt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(L,J),i=(i=Math.imul(L,Z))+Math.imul(F,J)|0,o=Math.imul(F,Z),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,at)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,at)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ft)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ft)|0,n=n+Math.imul(S,lt)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ht)|0;var jt=(f+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,yt)|0)+Math.imul(_,pt)|0))<<13)|0;f=((o=o+Math.imul(_,yt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,n=Math.imul(L,Q),i=(i=Math.imul(L,tt))+Math.imul(F,Q)|0,o=Math.imul(F,tt),n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,at)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,at)|0,n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ft)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ft)|0,n=n+Math.imul(k,lt)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ht)|0;var It=(f+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,yt)|0)+Math.imul(x,pt)|0))<<13)|0;f=((o=o+Math.imul(x,yt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(L,rt),i=(i=Math.imul(L,nt))+Math.imul(F,rt)|0,o=Math.imul(F,nt),n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,n=n+Math.imul(O,ut)|0,i=(i=i+Math.imul(O,ft)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ft)|0,n=n+Math.imul(I,lt)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(T,lt)|0,o=o+Math.imul(T,ht)|0;var Tt=(f+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,yt)|0)+Math.imul(M,pt)|0))<<13)|0;f=((o=o+Math.imul(M,yt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(L,ot),i=(i=Math.imul(L,at))+Math.imul(F,ot)|0,o=Math.imul(F,at),n=n+Math.imul(C,ut)|0,i=(i=i+Math.imul(C,ft)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ft)|0,n=n+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(B,lt)|0,o=o+Math.imul(B,ht)|0;var Rt=(f+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,yt)|0)+Math.imul(T,pt)|0))<<13)|0;f=((o=o+Math.imul(T,yt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(L,ut),i=(i=Math.imul(L,ft))+Math.imul(F,ut)|0,o=Math.imul(F,ft),n=n+Math.imul(C,lt)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,ht)|0;var Ot=(f+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,yt)|0)+Math.imul(B,pt)|0))<<13)|0;f=((o=o+Math.imul(B,yt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(L,lt),i=(i=Math.imul(L,ht))+Math.imul(F,lt)|0,o=Math.imul(F,ht);var Bt=(f+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,yt)|0)+Math.imul(N,pt)|0))<<13)|0;f=((o=o+Math.imul(N,yt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var Ut=(f+(n=Math.imul(L,pt))|0)+((8191&(i=(i=Math.imul(L,yt))+Math.imul(F,pt)|0))<<13)|0;return f=((o=Math.imul(F,yt))+(i>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,u[0]=bt,u[1]=mt,u[2]=vt,u[3]=gt,u[4]=wt,u[5]=_t,u[6]=At,u[7]=St,u[8]=xt,u[9]=Et,u[10]=kt,u[11]=Mt,u[12]=jt,u[13]=It,u[14]=Tt,u[15]=Rt,u[16]=Ot,u[17]=Bt,u[18]=Ut,0!==f&&(u[19]=f,r.length++),r};function s(t,e,r){return(new u).mulp(t,e,r)}function u(t,e){this.x=t,this.y=e}Math.imul||(o=i),m.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?o(this,t,e):r<63?i(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):s(this,t,e)},u.prototype.makeRBT=function(t){for(var e=new Array(t),r=m.prototype._countBits(t)-1,n=0;n>=1;return n},u.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*o+1]=8191&i,i>>>=13;for(o=2*e;o>=26,e+=n/67108864|0,e+=i>>>26,this.words[r]=67108863&i}return 0!==e&&(this.words[r]=e,this.length++),this},m.prototype.muln=function(t){return this.clone().imuln(t)},m.prototype.sqr=function(){return this.mul(this)},m.prototype.isqr=function(){return this.imul(this.clone())},m.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new m(1);for(var r=this,n=0;n>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==n){for(e=this.length-1;0<=e;e--)this.words[e+n]=this.words[e];for(e=0;e>>i<o)for(this.length-=o,u=0;u>>i,f=c&a}return s&&0!==f&&(s.words[s.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},m.prototype.ishrn=function(t,e,r){return b(0===this.negative),this.iushrn(t,e,r)},m.prototype.shln=function(t){return this.clone().ishln(t)},m.prototype.ushln=function(t){return this.clone().iushln(t)},m.prototype.shrn=function(t){return this.clone().ishrn(t)},m.prototype.ushrn=function(t){return this.clone().iushrn(t)},m.prototype.testn=function(t){b("number"==typeof t&&0<=t);var e=t%26,r=(t-e)/26,n=1<>>e<>26)-(s/67108864|0),this.words[n+r]=67108863&i}for(;n>26,this.words[n+r]=67108863&i;if(0===a)return this.strip();for(b(-1===a),n=a=0;n>26,this.words[n]=67108863&i;return this.negative=1,this.strip()},m.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var a,s=n.length-i.length;if("mod"!==e){(a=new m(null)).length=s+1,a.words=new Array(a.length);for(var u=0;uthis.length||this.cmp(t)<0?{div:new m(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new m(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new m(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,i,o},m.prototype.div=function(t){return this.divmod(t,"div",!1).div},m.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},m.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},m.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},m.prototype.modn=function(t){b(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;0<=n;n--)r=(e*r+(0|this.words[n]))%t;return r},m.prototype.idivn=function(t){b(t<=67108863);for(var e=0,r=this.length-1;0<=r;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},m.prototype.divn=function(t){return this.clone().idivn(t)},m.prototype.egcd=function(t){b(0===t.negative),b(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new m(1),i=new m(0),o=new m(0),a=new m(1),s=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++s;for(var u=r.clone(),f=e.clone();!e.isZero();){for(var c=0,l=1;0==(e.words[0]&l)&&c<26;++c,l<<=1);if(0>>26,a&=67108863,this.words[o]=a}return 0!==i&&(this.words[o]=i,this.length++),this},m.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},m.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),1t.length)return 1;if(this.lengththis.n;);var n=e>>22,i=o}i>>>=22,0===(t.words[n-10]=i)&&10>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},m._prime=function(t){if(f[t])return f[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new v;else if("p192"===t)e=new g;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new w}return f[t]=e},_.prototype._verify1=function(t){b(0===t.negative,"red works only with positives"),b(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){b(0==(t.negative|e.negative),"red works only with positives"),b(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return 0<=r.cmp(this.m)&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(b(e%2==1),3===e){var r=this.m.add(new m(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),i=0;!n.isZero()&&0===n.andln(1);)i++,n.iushrn(1);b(!n.isZero());var o=new m(1).toRed(this),a=o.redNeg(),s=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new m(2*u*u).toRed(this);0!==this.pow(u,s).cmp(a);)u.redIAdd(a);for(var f=this.pow(u,n),c=this.pow(t,n.addn(1).iushrn(1)),l=this.pow(t,n),h=i;0!==l.cmp(o);){for(var d=l,p=0;0!==d.cmp(o);p++)d=d.redSqr();b(p>f&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==o?(o<<=1,o|=c,(4===++a||0===n&&0===f)&&(i=this.mul(i,r[o]),o=a=0)):a=0}s=26}return i},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},m.mont=function(t){return new A(t)},r(A,_),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return 0<=i.cmp(this.m)?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new m(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return 0<=i.cmp(this.m)?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t)},{}],480:[function(t,e,r){arguments[4][376][0].apply(r,arguments)},{dup:376}],481:[function(t,C,e){(function(O,B){"use strict";function U(t){return(U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(){var l="input is invalid type",t="object"===("undefined"==typeof window?"undefined":U(window)),e=t?window:{};e.JS_SHA3_NO_WINDOW&&(t=!1);var r=!t&&"object"===("undefined"==typeof self?"undefined":U(self));!e.JS_SHA3_NO_NODE_JS&&"object"===(void 0===O?"undefined":U(O))&&O.versions&&O.versions.node?e=B:r&&(e=self);var n=!e.JS_SHA3_NO_COMMON_JS&&"object"===(void 0===C?"undefined":U(C))&&C.exports,i="function"==typeof define&&define.amd,h=!e.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,u="0123456789abcdef".split(""),o=[4,1024,262144,67108864],d=[0,8,16,24],ct=[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=[224,256,384,512],s=[128,256],f=["hex","buffer","arrayBuffer","array","digest"],c={128:168,256:136};!e.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!h||!e.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"===U(t)&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var p=function(e,r,n){return function(t){return new I(e,r,e).update(t)[n]()}},y=function(r,n,i){return function(t,e){return new I(r,n,e).update(t)[i]()}},b=function(i,t,o){return function(t,e,r,n){return _["cshake"+i].update(t,e,r,n)[o]()}},m=function(i,t,o){return function(t,e,r,n){return _["kmac"+i].update(t,e,r,n)[o]()}},v=function(t,e,r,n){for(var i=0;i>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}function T(t,e,r){I.call(this,t,e,r)}I.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var e,r=U(t);if("string"!==r){if("object"!==r)throw new Error(l);if(null===t)throw new Error(l);if(h&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||h&&ArrayBuffer.isView(t)))throw new Error(l);e=!0}for(var n,i,o=this.blocks,a=this.byteCount,s=t.length,u=this.blockCount,f=0,c=this.s;f>2]|=t[f]<>2]|=i<>2]|=(192|i>>6)<>2]|=(224|i>>12)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>=8);0>=8),++n;return e?i.push(n):i.unshift(n),this.update(i),i.length},I.prototype.encodeString=function(t){var e,r=U(t);if("string"!==r){if("object"!==r)throw new Error(l);if(null===t)throw new Error(l);if(h&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||h&&ArrayBuffer.isView(t)))throw new Error(l);e=!0}var n=0,i=t.length;if(e)n=i;else for(var o=0;o>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+u[15&t]+u[t>>12&15]+u[t>>8&15]+u[t>>20&15]+u[t>>16&15]+u[t>>28&15]+u[t>>24&15];a%e==0&&(R(r),o=0)}return i&&(t=r[o],s+=u[t>>4&15]+u[15&t],1>12&15]+u[t>>8&15]),2>20&15]+u[t>>16&15])),s},I.prototype.buffer=I.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(t);a>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;s%r==0&&R(n)}return o&&(t=s<<2,e=n[a],u[t]=255&e,1>8&255),2>16&255)),u},(T.prototype=new I).finalize=function(){return this.encode(this.outputBits,!0),I.prototype.finalize.call(this)};var R=function(t){var e,r,n,i,o,a,s,u,f,c,l,h,d,p,y,b,m,v,g,w,_,A,S,x,E,k,M,j,I,T,R,O,B,U,C,N,P,L,F,D,q,z,H,K,V,G,W,Y,X,J,Z,$,Q,tt,et,rt,nt,it,ot,at,st,ut,ft;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],f=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],e=(h=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|s>>>31),r=(d=t[9]^t[19]^t[29]^t[39]^t[49])^(s<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(u<<1|f>>>31),r=o^(f<<1|u>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(c<<1|l>>>31),r=s^(l<<1|c>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=u^(h<<1|d>>>31),r=f^(d<<1|h>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=c^(i<<1|o>>>31),r=l^(o<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,p=t[0],y=t[1],G=t[11]<<4|t[10]>>>28,W=t[10]<<4|t[11]>>>28,j=t[20]<<3|t[21]>>>29,I=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,st=t[30]<<9|t[31]>>>23,z=t[40]<<18|t[41]>>>14,H=t[41]<<18|t[40]>>>14,U=t[2]<<1|t[3]>>>31,C=t[3]<<1|t[2]>>>31,b=t[13]<<12|t[12]>>>20,m=t[12]<<12|t[13]>>>20,Y=t[22]<<10|t[23]>>>22,X=t[23]<<10|t[22]>>>22,T=t[33]<<13|t[32]>>>19,R=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,ft=t[43]<<2|t[42]>>>30,tt=t[5]<<30|t[4]>>>2,et=t[4]<<30|t[5]>>>2,N=t[14]<<6|t[15]>>>26,P=t[15]<<6|t[14]>>>26,v=t[25]<<11|t[24]>>>21,g=t[24]<<11|t[25]>>>21,J=t[34]<<15|t[35]>>>17,Z=t[35]<<15|t[34]>>>17,O=t[45]<<29|t[44]>>>3,B=t[44]<<29|t[45]>>>3,x=t[6]<<28|t[7]>>>4,E=t[7]<<28|t[6]>>>4,rt=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,L=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,w=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,Q=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,V=t[9]<<27|t[8]>>>5,k=t[18]<<20|t[19]>>>12,M=t[19]<<20|t[18]>>>12,it=t[29]<<7|t[28]>>>25,ot=t[28]<<7|t[29]>>>25,D=t[38]<<8|t[39]>>>24,q=t[39]<<8|t[38]>>>24,A=t[48]<<14|t[49]>>>18,S=t[49]<<14|t[48]>>>18,t[0]=p^~b&v,t[1]=y^~m&g,t[10]=x^~k&j,t[11]=E^~M&I,t[20]=U^~N&L,t[21]=C^~P&F,t[30]=K^~G&Y,t[31]=V^~W&X,t[40]=tt^~rt&it,t[41]=et^~nt&ot,t[2]=b^~v&w,t[3]=m^~g&_,t[12]=k^~j&T,t[13]=M^~I&R,t[22]=N^~L&D,t[23]=P^~F&q,t[32]=G^~Y&J,t[33]=W^~X&Z,t[42]=rt^~it&at,t[43]=nt^~ot&st,t[4]=v^~w&A,t[5]=g^~_&S,t[14]=j^~T&O,t[15]=I^~R&B,t[24]=L^~D&z,t[25]=F^~q&H,t[34]=Y^~J&$,t[35]=X^~Z&Q,t[44]=it^~at&ut,t[45]=ot^~st&ft,t[6]=w^~A&p,t[7]=_^~S&y,t[16]=T^~O&x,t[17]=R^~B&E,t[26]=D^~z&U,t[27]=q^~H&C,t[36]=J^~$&K,t[37]=Z^~Q&V,t[46]=at^~ut&tt,t[47]=st^~ft&et,t[8]=A^~p&b,t[9]=S^~y&m,t[18]=O^~x&k,t[19]=B^~E&M,t[28]=z^~U&N,t[29]=H^~C&P,t[38]=$^~K&G,t[39]=Q^~V&W,t[48]=ut^~tt&rt,t[49]=ft^~et&nt,t[0]^=ct[n],t[1]^=ct[n+1]};if(n)C.exports=_;else{for(S=0;S":">",'"':""","'":"'","`":"`"},q=d.invert(D),z=function(e){var r=function(t){return e[t]},t="(?:"+d.keys(e).join("|")+")",n=RegExp(t),i=RegExp(t,"g");return function(t){return t=null==t?"":""+t,n.test(t)?t.replace(i,r):t}};d.escape=z(D),d.unescape=z(q),d.result=function(t,e,r){d.isArray(e)||(e=[e]);var n=e.length;if(!n)return d.isFunction(r)?r.call(t):r;for(var i=0;i/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,V={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},G=/\\|'|\r|\n|\u2028|\u2029/g,W=function(t){return"\\"+V[t]};d.template=function(o,t,e){!t&&e&&(t=e),t=d.defaults({},t,d.templateSettings);var r,n=RegExp([(t.escape||K).source,(t.interpolate||K).source,(t.evaluate||K).source].join("|")+"|$","g"),a=0,s="__p+='";o.replace(n,function(t,e,r,n,i){return s+=o.slice(a,i).replace(G,W),a=i+t.length,e?s+="'+\n((__t=("+e+"))==null?'':_.escape(__t))+\n'":r?s+="'+\n((__t=("+r+"))==null?'':__t)+\n'":n&&(s+="';\n"+n+"\n__p+='"),t}),s+="';\n",t.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{r=new Function(t.variable||"obj","_",s)}catch(t){throw t.source=s,t}var i=function(t){return r.call(this,t,d)},u=t.variable||"obj";return i.source="function("+u+"){\n"+s+"}",i},d.chain=function(t){var e=d(t);return e._chain=!0,e};var Y=function(t,e){return t._chain?d(e).chain():e};d.mixin=function(r){return d.each(d.functions(r),function(t){var e=d[t]=r[t];d.prototype[t]=function(){var t=[this._wrapped];return i.apply(t,arguments),Y(this,e.apply(d,t))}}),d},d.mixin(d),d.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var r=n[e];d.prototype[e]=function(){var t=this._wrapped;return r.apply(t,arguments),"shift"!==e&&"splice"!==e||0!==t.length||delete t[0],Y(this,t)}}),d.each(["concat","join","slice"],function(t){var e=n[t];d.prototype[t]=function(){return Y(this,e.apply(this._wrapped,arguments))}}),d.prototype.valueOf=d.prototype.toJSON=d.prototype.value=function(){return this._wrapped},d.prototype.toString=function(){return String(this._wrapped)},"function"==typeof define&&define.amd&&define("underscore",[],function(){return d})}()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],488:[function(t,e,r){"use strict";!function(t){var n,i,o,a=String.fromCharCode;function s(t){for(var e,r,n=[],i=0,o=t.length;i>e&63|128)}function f(t){if(0==(4294967168&t))return a(t);var e="";return 0==(4294965248&t)?e=a(t>>6&31|192):0==(4294901760&t)?(r(t),e=a(t>>12&15|224),e+=u(t,6)):0==(4292870144&t)&&(e=a(t>>18&7|240),e+=u(t,12),e+=u(t,6)),e+=a(63&t|128)}function c(){if(i<=o)throw Error("Invalid byte index");var t=255&n[o];if(o++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function l(){var t,e;if(i>>10&1023|55296),e=56320|1023&e),i+=a(e);return i}(r)}}(void 0===r?(void 0).utf8={}:r)},{}],489:[function(t,e,r){"use strict";function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var u=t("underscore"),n=t("ethjs-unit"),o=t("./utils.js"),i=t("./soliditySha3.js"),a=t("randombytes"),f=function i(o,t){var a=[];return t.forEach(function(t){if("object"===s(t.components)){if("tuple"!==t.type.substring(0,5))throw new Error("components found but type is not tuple; report on GitHub");var e="",r=t.type.indexOf("[");0<=r&&(e=t.type.substring(r));var n=i(o,t.components);u.isArray(n)&&o?a.push("tuple("+n.join(",")+")"+e):o?a.push("("+n+")"):a.push("("+n.join(",")+")"+e)}else a.push(t.type)}),a},c=function(t){if(!o.isHexStrict(t))throw new Error("The parameter must be a valid HEX string.");var e="",r=0,n=t.length;for("0x"===t.substring(0,2)&&(r=2);rn)throw new Error("Supplied uint exceeds width: "+n+" vs "+i.bitLength());if(i.lt(new s(0)))throw new Error("Supplied uint "+i.toString()+" is negative");return n?u.leftPad(i.toString("hex"),n/8*2):i}if(t.startsWith("int")){if(n%8||n<8||256n)throw new Error("Supplied int exceeds width: "+n+" vs "+i.bitLength());return i.lt(new s(0))?i.toTwos(n).toString("hex"):n?u.leftPad(i.toString("hex"),n/8*2):i}throw new Error("Unsupported or invalid type: "+t)},i=function(t){if(o.isArray(t))throw new Error("Autodetection of array types is not supported.");var e,r,n,i="";if(o.isObject(t)&&(t.hasOwnProperty("v")||t.hasOwnProperty("t")||t.hasOwnProperty("value")||t.hasOwnProperty("type"))?(e=t.hasOwnProperty("t")?t.t:t.type,i=t.hasOwnProperty("v")?t.v:t.value):(e=u.toHex(t,!0),i=u.toHex(t),e.startsWith("int")||e.startsWith("uint")||(e="bytes")),!e.startsWith("int")&&!e.startsWith("uint")||"string"!=typeof i||/^(-)?0x/i.test(i)||(i=new s(i)),o.isArray(i)){if(n=/^\D+\d*\[(\d+)\]$/.exec(e),(r=n?parseInt(n[1],10):null)&&i.length!==r)throw new Error(e+" is not matching the given array "+JSON.stringify(i));r=i.length}return o.isArray(i)?i.map(function(t){return a(e,t,r).toString("hex").replace("0x","")}).join(""):a(e,i,r).toString("hex").replace("0x","")};e.exports={soliditySha3:function(){var t=Array.prototype.slice.call(arguments),e=o.map(t,i);return u.sha3("0x"+e.join(""))},soliditySha3Raw:function(){return u.sha3Raw("0x"+o.map(Array.prototype.slice.call(arguments),i).join(""))}}},{"./utils.js":491,"bn.js":474,underscore:487}],491:[function(v,g,t){(function(r){"use strict";var n=v("underscore"),i=v("bn.js"),t=v("number-to-bn"),o=v("utf8"),a=v("eth-lib/lib/hash"),s=v("ethereum-bloom-filters"),u=function(t){return i.isBN(t)},f=function(t){return t&&t.constructor&&"BigNumber"===t.constructor.name},c=function(e){try{return t.apply(null,arguments)}catch(t){throw new Error(t+' Given value: "'+e+'"')}},l=function(t){return!!/^(0x)?[0-9a-f]{40}$/i.test(t)&&(!(!/^(0x|0X)?[0-9a-f]{40}$/.test(t)&&!/^(0x|0X)?[0-9A-F]{40}$/.test(t))||e(t))},e=function(t){t=t.replace(/^0x/i,"");for(var e=m(t.toLowerCase()).replace(/^0x/i,""),r=0;r<40;r++)if(7>>4).toString(16)),e.push((15&t[r]).toString(16));return"0x"+e.join("")},isHex:function(t){return(n.isString(t)||n.isNumber(t))&&/^(-0x|0x)?[0-9a-f]*$/i.test(t)},isHexStrict:y,leftPad:function(t,e,r){var n=/^0x/i.test(t)||"number"==typeof t,i=0<=e-(t=t.toString(16).replace(/^0x/i,"")).length+1?e-t.length+1:0;return(n?"0x":"")+new Array(i).join(r||"0")+t},rightPad:function(t,e,r){var n=/^0x/i.test(t)||"number"==typeof t,i=0<=e-(t=t.toString(16).replace(/^0x/i,"")).length+1?e-t.length+1:0;return(n?"0x":"")+t+new Array(i).join(r||"0")},toTwosComplement:function(t){return"0x"+c(t).toTwos(256).toString(16,64)},sha3:m,sha3Raw:function(t){return null===(t=m(t))?b:t}}}).call(this,{isBuffer:v("../../../node_modules/is-buffer/index.js")})},{"../../../node_modules/is-buffer/index.js":105,"bn.js":474,"eth-lib/lib/hash":475,"ethereum-bloom-filters":476,"number-to-bn":483,underscore:487,utf8:488}],492:[function(t,e,r){e.exports={name:"web3",version:"1.2.7",description:"Ethereum JavaScript API",repository:"https://github.com/ethereum/web3.js",license:"LGPL-3.0",engines:{node:">=8.0.0"},main:"src/index.js",bugs:{url:"https://github.com/ethereum/web3.js/issues"},keywords:["Ethereum","JavaScript","API"],author:"ethereum.org",types:"types/index.d.ts",scripts:{dtslint:"dtslint types",postinstall:"node angular-patch.js"},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"}],dependencies:{"web3-bzz":"1.2.7","web3-core":"1.2.7","web3-eth":"1.2.7","web3-eth-personal":"1.2.7","web3-net":"1.2.7","web3-shh":"1.2.7","web3-utils":"1.2.7"},devDependencies:{"@types/node":"^12.12.34","definitelytyped-header-parser":"^3.9.0",dtslint:"^3.4.1"}}},{}],BN:[function(t,e,r){arguments[4][232][0].apply(r,arguments)},{buffer:21,dup:232}],Web3:[function(t,e,r){"use strict";var i=t("../package.json").version,o=t("web3-core"),a=t("web3-eth"),n=t("web3-net"),s=t("web3-eth-personal"),u=t("web3-shh"),f=t("web3-bzz"),c=t("web3-utils"),l=function(){var r=this;o.packageInit(this,arguments),this.version=i,this.utils=c,this.eth=new a(this),this.shh=new u(this),this.bzz=new f(this);var n=this.setProvider;this.setProvider=function(t,e){return n.apply(r,arguments),r.eth.setRequestManager(r._requestManager),r.shh.setRequestManager(r._requestManager),r.bzz.setProvider(t),!0}};l.version=i,l.utils=c,l.modules={Eth:a,Net:n,Personal:s,Shh:u,Bzz:f},o.addProviders(l),e.exports=l},{"../package.json":492,"web3-bzz":212,"web3-core":231,"web3-eth":453,"web3-eth-personal":450,"web3-net":454,"web3-shh":473,"web3-utils":489}]},{},[151,"Web3"])("Web3")}); \ No newline at end of file diff --git a/miksi-logo00-square-pink.png b/miksi-logo00-square-pink.png new file mode 100644 index 0000000..e74e001 Binary files /dev/null and b/miksi-logo00-square-pink.png differ