"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[1745],{48670:function(e,r,t){var n=t(48764).Buffer,i=this&&this.__read||function(e,r){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var n,i,o=t.call(e),f=[];try{for(;(void 0===r||r-- >0)&&!(n=o.next()).done;)f.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(t=o.return)&&t.call(o)}finally{if(i)throw i.error}}return f},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.isZeroAddress=r.zeroAddress=r.importPublic=r.privateToAddress=r.privateToPublic=r.publicToAddress=r.pubToAddress=r.isValidPublic=r.isValidPrivate=r.generateAddress2=r.generateAddress=r.isValidChecksumAddress=r.toChecksumAddress=r.isValidAddress=r.Account=void 0;var f=o(t(69282)),a=t(14538),u=t(95053),s=t(54846),c=t(56861),d=t(14651),l=t(45641),p=t(63746),h=t(2971),y=function(){function e(e,r,t,n){void 0===e&&(e=new a.BN(0)),void 0===r&&(r=new a.BN(0)),void 0===t&&(t=c.KECCAK256_RLP),void 0===n&&(n=c.KECCAK256_NULL),this.nonce=e,this.balance=r,this.stateRoot=t,this.codeHash=n,this._validate()}return e.fromAccountData=function(r){var t=r.nonce,n=r.balance,i=r.stateRoot,o=r.codeHash;return new e(t?new a.BN((0,d.toBuffer)(t)):void 0,n?new a.BN((0,d.toBuffer)(n)):void 0,i?(0,d.toBuffer)(i):void 0,o?(0,d.toBuffer)(o):void 0)},e.fromRlpSerializedAccount=function(e){var r=a.rlp.decode(e);if(!Array.isArray(r))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(r)},e.fromValuesArray=function(r){var t=i(r,4),n=t[0],o=t[1],f=t[2],u=t[3];return new e(new a.BN(n),new a.BN(o),f,u)},e.prototype._validate=function(){if(this.nonce.lt(new a.BN(0)))throw new Error("nonce must be greater than zero");if(this.balance.lt(new a.BN(0)))throw new Error("balance must be greater than zero");if(32!==this.stateRoot.length)throw new Error("stateRoot must have a length of 32");if(32!==this.codeHash.length)throw new Error("codeHash must have a length of 32")},e.prototype.raw=function(){return[(0,h.bnToUnpaddedBuffer)(this.nonce),(0,h.bnToUnpaddedBuffer)(this.balance),this.stateRoot,this.codeHash]},e.prototype.serialize=function(){return a.rlp.encode(this.raw())},e.prototype.isContract=function(){return!this.codeHash.equals(c.KECCAK256_NULL)},e.prototype.isEmpty=function(){return this.balance.isZero()&&this.nonce.isZero()&&this.codeHash.equals(c.KECCAK256_NULL)},e}();r.Account=y;r.isValidAddress=function(e){try{(0,p.assertIsString)(e)}catch(e){return!1}return/^0x[0-9a-fA-F]{40}$/.test(e)};r.toChecksumAddress=function(e,r){(0,p.assertIsHexString)(e);var t=(0,s.stripHexPrefix)(e).toLowerCase(),n="";r&&(n=(0,h.toType)(r,h.TypeOutput.BN).toString()+"0x");for(var i=(0,l.keccakFromString)(n+t).toString("hex"),o="0x",f=0;f<t.length;f++)parseInt(i[f],16)>=8?o+=t[f].toUpperCase():o+=t[f];return o};r.isValidChecksumAddress=function(e,t){return(0,r.isValidAddress)(e)&&(0,r.toChecksumAddress)(e,t)===e};r.generateAddress=function(e,r){(0,p.assertIsBuffer)(e),(0,p.assertIsBuffer)(r);var t=new a.BN(r);return t.isZero()?(0,l.rlphash)([e,null]).slice(-20):(0,l.rlphash)([e,n.from(t.toArray())]).slice(-20)};r.generateAddress2=function(e,r,t){return(0,p.assertIsBuffer)(e),(0,p.assertIsBuffer)(r),(0,p.assertIsBuffer)(t),(0,f.default)(20===e.length),(0,f.default)(32===r.length),(0,l.keccak256)(n.concat([n.from("ff","hex"),e,r,(0,l.keccak256)(t)])).slice(-20)};r.isValidPrivate=function(e){return(0,u.privateKeyVerify)(e)};r.isValidPublic=function(e,r){return void 0===r&&(r=!1),(0,p.assertIsBuffer)(e),64===e.length?(0,u.publicKeyVerify)(n.concat([n.from([4]),e])):!!r&&(0,u.publicKeyVerify)(e)};r.pubToAddress=function(e,r){return void 0===r&&(r=!1),(0,p.assertIsBuffer)(e),r&&64!==e.length&&(e=n.from((0,u.publicKeyConvert)(e,!1).slice(1))),(0,f.default)(64===e.length),(0,l.keccak)(e).slice(-20)},r.publicToAddress=r.pubToAddress;r.privateToPublic=function(e){return(0,p.assertIsBuffer)(e),n.from((0,u.publicKeyCreate)(e,!1)).slice(1)};r.privateToAddress=function(e){return(0,r.publicToAddress)((0,r.privateToPublic)(e))};r.importPublic=function(e){return(0,p.assertIsBuffer)(e),64!==e.length&&(e=n.from((0,u.publicKeyConvert)(e,!1).slice(1))),e};r.zeroAddress=function(){var e=(0,d.zeros)(20);return(0,d.bufferToHex)(e)};r.isZeroAddress=function(e){try{(0,p.assertIsString)(e)}catch(e){return!1}return(0,r.zeroAddress)()===e}},6871:function(e,r,t){var n=t(48764).Buffer,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.Address=void 0;var o=i(t(69282)),f=t(14538),a=t(14651),u=t(48670),s=function(){function e(e){(0,o.default)(20===e.length,"Invalid address length"),this.buf=e}return e.zero=function(){return new e((0,a.zeros)(20))},e.fromString=function(r){return(0,o.default)((0,u.isValidAddress)(r),"Invalid address"),new e((0,a.toBuffer)(r))},e.fromPublicKey=function(r){return(0,o.default)(n.isBuffer(r),"Public key should be Buffer"),new e((0,u.pubToAddress)(r))},e.fromPrivateKey=function(r){return(0,o.default)(n.isBuffer(r),"Private key should be Buffer"),new e((0,u.privateToAddress)(r))},e.generate=function(r,t){return(0,o.default)(f.BN.isBN(t)),new e((0,u.generateAddress)(r.buf,t.toArrayLike(n)))},e.generate2=function(r,t,i){return(0,o.default)(n.isBuffer(t)),(0,o.default)(n.isBuffer(i)),new e((0,u.generateAddress2)(r.buf,t,i))},e.prototype.equals=function(e){return this.buf.equals(e.buf)},e.prototype.isZero=function(){return this.equals(e.zero())},e.prototype.isPrecompileOrSystemAddress=function(){var e=new f.BN(this.buf),r=new f.BN(0),t=new f.BN("ffff","hex");return e.gte(r)&&e.lte(t)},e.prototype.toString=function(){return"0x"+this.buf.toString("hex")},e.prototype.toBuffer=function(){return n.from(this.buf)},e}();r.Address=s},14651:function(e,r,t){var n=t(48764).Buffer,i=this&&this.__values||function(e){var r="function"==typeof Symbol&&Symbol.iterator,t=r&&e[r],n=0;if(t)return t.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(e,r){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var n,i,o=t.call(e),f=[];try{for(;(void 0===r||r-- >0)&&!(n=o.next()).done;)f.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(t=o.return)&&t.call(o)}finally{if(i)throw i.error}}return f};Object.defineProperty(r,"__esModule",{value:!0}),r.bufArrToArr=r.arrToBufArr=r.validateNoLeadingZeroes=r.baToJSON=r.toUtf8=r.addHexPrefix=r.toUnsigned=r.fromSigned=r.bufferToHex=r.bufferToInt=r.toBuffer=r.unpadHexString=r.unpadArray=r.unpadBuffer=r.setLengthRight=r.setLengthLeft=r.zeros=r.intToBuffer=r.intToHex=void 0;var f=t(14538),a=t(54846),u=t(63746);r.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};r.intToBuffer=function(e){var t=(0,r.intToHex)(e);return n.from((0,a.padToEven)(t.slice(2)),"hex")};r.zeros=function(e){return n.allocUnsafe(e).fill(0)};var s=function(e,t,n){var i=(0,r.zeros)(t);return n?e.length<t?(e.copy(i),i):e.slice(0,t):e.length<t?(e.copy(i,t-e.length),i):e.slice(-t)};r.setLengthLeft=function(e,r){return(0,u.assertIsBuffer)(e),s(e,r,!1)};r.setLengthRight=function(e,r){return(0,u.assertIsBuffer)(e),s(e,r,!0)};var c=function(e){for(var r=e[0];e.length>0&&"0"===r.toString();)r=(e=e.slice(1))[0];return e};r.unpadBuffer=function(e){return(0,u.assertIsBuffer)(e),c(e)};r.unpadArray=function(e){return(0,u.assertIsArray)(e),c(e)};r.unpadHexString=function(e){return(0,u.assertIsHexString)(e),e=(0,a.stripHexPrefix)(e),c(e)};r.toBuffer=function(e){if(null==e)return n.allocUnsafe(0);if(n.isBuffer(e))return n.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return n.from(e);if("string"==typeof e){if(!(0,a.isHexString)(e))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(e));return n.from((0,a.padToEven)((0,a.stripHexPrefix)(e)),"hex")}if("number"==typeof e)return(0,r.intToBuffer)(e);if(f.BN.isBN(e)){if(e.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(e));return e.toArrayLike(n)}if(e.toArray)return n.from(e.toArray());if(e.toBuffer)return n.from(e.toBuffer());throw new Error("invalid type")};r.bufferToInt=function(e){return new f.BN((0,r.toBuffer)(e)).toNumber()};r.bufferToHex=function(e){return"0x"+(e=(0,r.toBuffer)(e)).toString("hex")};r.fromSigned=function(e){return new f.BN(e).fromTwos(256)};r.toUnsigned=function(e){return n.from(e.toTwos(256).toArray())};r.addHexPrefix=function(e){return"string"!=typeof e||(0,a.isHexPrefixed)(e)?e:"0x"+e};r.toUtf8=function(e){if((e=(0,a.stripHexPrefix)(e)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return n.from(e.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};r.baToJSON=function(e){if(n.isBuffer(e))return"0x".concat(e.toString("hex"));if(e instanceof Array){for(var t=[],i=0;i<e.length;i++)t.push((0,r.baToJSON)(e[i]));return t}};r.validateNoLeadingZeroes=function(e){var r,t;try{for(var n=i(Object.entries(e)),f=n.next();!f.done;f=n.next()){var a=o(f.value,2),u=a[0],s=a[1];if(void 0!==s&&s.length>0&&0===s[0])throw new Error("".concat(u," cannot have leading zeroes, received: ").concat(s.toString("hex")))}}catch(e){r={error:e}}finally{try{f&&!f.done&&(t=n.return)&&t.call(n)}finally{if(r)throw r.error}}},r.arrToBufArr=function e(r){return Array.isArray(r)?r.map((function(r){return e(r)})):n.from(r)},r.bufArrToArr=function e(r){return Array.isArray(r)?r.map((function(r){return e(r)})):Uint8Array.from(null!=r?r:[])}},56861:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.KECCAK256_RLP=r.KECCAK256_RLP_S=r.KECCAK256_RLP_ARRAY=r.KECCAK256_RLP_ARRAY_S=r.KECCAK256_NULL=r.KECCAK256_NULL_S=r.TWO_POW256=r.MAX_INTEGER=r.MAX_UINT64=void 0;var n=t(48764),i=t(14538);r.MAX_UINT64=new i.BN("ffffffffffffffff",16),r.MAX_INTEGER=new i.BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),r.TWO_POW256=new i.BN("10000000000000000000000000000000000000000000000000000000000000000",16),r.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",r.KECCAK256_NULL=n.Buffer.from(r.KECCAK256_NULL_S,"hex"),r.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",r.KECCAK256_RLP_ARRAY=n.Buffer.from(r.KECCAK256_RLP_ARRAY_S,"hex"),r.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",r.KECCAK256_RLP=n.Buffer.from(r.KECCAK256_RLP_S,"hex")},14538:function(e,r,t){var n=this&&this.__createBinding||(Object.create?function(e,r,t,n){void 0===n&&(n=t),Object.defineProperty(e,n,{enumerable:!0,get:function(){return r[t]}})}:function(e,r,t,n){void 0===n&&(n=t),e[n]=r[t]}),i=this&&this.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)"default"!==t&&Object.prototype.hasOwnProperty.call(e,t)&&n(r,e,t);return i(r,e),r},f=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.rlp=r.BN=void 0;var a=f(t(13550));r.BN=a.default;var u=o(t(51675));r.rlp=u},45641:(e,r,t)=>{var n=t(48764).Buffer;Object.defineProperty(r,"__esModule",{value:!0}),r.rlphash=r.ripemd160FromArray=r.ripemd160FromString=r.ripemd160=r.sha256FromArray=r.sha256FromString=r.sha256=r.keccakFromArray=r.keccakFromHexString=r.keccakFromString=r.keccak256=r.keccak=void 0;var i=t(82192),o=t(23482),f=t(14538),a=t(14651),u=t(63746);r.keccak=function(e,r){switch(void 0===r&&(r=256),(0,u.assertIsBuffer)(e),r){case 224:return(0,i.keccak224)(e);case 256:return(0,i.keccak256)(e);case 384:return(0,i.keccak384)(e);case 512:return(0,i.keccak512)(e);default:throw new Error("Invald algorithm: keccak".concat(r))}};r.keccak256=function(e){return(0,r.keccak)(e)};r.keccakFromString=function(e,t){void 0===t&&(t=256),(0,u.assertIsString)(e);var i=n.from(e,"utf8");return(0,r.keccak)(i,t)};r.keccakFromHexString=function(e,t){return void 0===t&&(t=256),(0,u.assertIsHexString)(e),(0,r.keccak)((0,a.toBuffer)(e),t)};r.keccakFromArray=function(e,t){return void 0===t&&(t=256),(0,u.assertIsArray)(e),(0,r.keccak)((0,a.toBuffer)(e),t)};var s=function(e){return e=(0,a.toBuffer)(e),o("sha256").update(e).digest()};r.sha256=function(e){return(0,u.assertIsBuffer)(e),s(e)};r.sha256FromString=function(e){return(0,u.assertIsString)(e),s(e)};r.sha256FromArray=function(e){return(0,u.assertIsArray)(e),s(e)};var c=function(e,r){e=(0,a.toBuffer)(e);var t=o("rmd160").update(e).digest();return!0===r?(0,a.setLengthLeft)(t,32):t};r.ripemd160=function(e,r){return(0,u.assertIsBuffer)(e),c(e,r)};r.ripemd160FromString=function(e,r){return(0,u.assertIsString)(e),c(e,r)};r.ripemd160FromArray=function(e,r){return(0,u.assertIsArray)(e),c(e,r)};r.rlphash=function(e){return(0,r.keccak)(f.rlp.encode(e))}},63746:(e,r,t)=>{var n=t(48764).Buffer;Object.defineProperty(r,"__esModule",{value:!0}),r.assertIsString=r.assertIsArray=r.assertIsBuffer=r.assertIsHexString=void 0;var i=t(54846);r.assertIsHexString=function(e){if(!(0,i.isHexString)(e)){var r="This method only supports 0x-prefixed hex strings but input was: ".concat(e);throw new Error(r)}};r.assertIsBuffer=function(e){if(!n.isBuffer(e)){var r="This method only supports Buffer but input was: ".concat(e);throw new Error(r)}};r.assertIsArray=function(e){if(!Array.isArray(e)){var r="This method only supports number arrays but input was: ".concat(e);throw new Error(r)}};r.assertIsString=function(e){if("string"!=typeof e){var r="This method only supports strings but input was: ".concat(e);throw new Error(r)}}},22751:function(e,r,t){var n=this&&this.__createBinding||(Object.create?function(e,r,t,n){void 0===n&&(n=t),Object.defineProperty(e,n,{enumerable:!0,get:function(){return r[t]}})}:function(e,r,t,n){void 0===n&&(n=t),e[n]=r[t]}),i=this&&this.__exportStar||function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||n(r,e,t)};Object.defineProperty(r,"__esModule",{value:!0}),r.isHexString=r.getKeys=r.fromAscii=r.fromUtf8=r.toAscii=r.arrayContainsArray=r.getBinarySize=r.padToEven=r.stripHexPrefix=r.isHexPrefixed=void 0,i(t(56861),r),i(t(48670),r),i(t(6871),r),i(t(45641),r),i(t(77112),r),i(t(14651),r),i(t(80867),r),i(t(14538),r),i(t(2971),r);var o=t(54846);Object.defineProperty(r,"isHexPrefixed",{enumerable:!0,get:function(){return o.isHexPrefixed}}),Object.defineProperty(r,"stripHexPrefix",{enumerable:!0,get:function(){return o.stripHexPrefix}}),Object.defineProperty(r,"padToEven",{enumerable:!0,get:function(){return o.padToEven}}),Object.defineProperty(r,"getBinarySize",{enumerable:!0,get:function(){return o.getBinarySize}}),Object.defineProperty(r,"arrayContainsArray",{enumerable:!0,get:function(){return o.arrayContainsArray}}),Object.defineProperty(r,"toAscii",{enumerable:!0,get:function(){return o.toAscii}}),Object.defineProperty(r,"fromUtf8",{enumerable:!0,get:function(){return o.fromUtf8}}),Object.defineProperty(r,"fromAscii",{enumerable:!0,get:function(){return o.fromAscii}}),Object.defineProperty(r,"getKeys",{enumerable:!0,get:function(){return o.getKeys}}),Object.defineProperty(r,"isHexString",{enumerable:!0,get:function(){return o.isHexString}})},54846:(e,r,t)=>{var n=t(48764).Buffer;function i(e){if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type ".concat(typeof e));return"0"===e[0]&&"x"===e[1]}Object.defineProperty(r,"__esModule",{value:!0}),r.isHexString=r.getKeys=r.fromAscii=r.fromUtf8=r.toAscii=r.arrayContainsArray=r.getBinarySize=r.padToEven=r.stripHexPrefix=r.isHexPrefixed=void 0,r.isHexPrefixed=i;function o(e){var r=e;if("string"!=typeof r)throw new Error("[padToEven] value must be type 'string', received ".concat(typeof r));return r.length%2&&(r="0".concat(r)),r}r.stripHexPrefix=function(e){if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received ".concat(typeof e));return i(e)?e.slice(2):e},r.padToEven=o,r.getBinarySize=function(e){if("string"!=typeof e)throw new Error("[getBinarySize] method requires input type 'string', recieved ".concat(typeof e));return n.byteLength(e,"utf8")},r.arrayContainsArray=function(e,r,t){if(!0!==Array.isArray(e))throw new Error("[arrayContainsArray] method requires input 'superset' to be an array, got type '".concat(typeof e,"'"));if(!0!==Array.isArray(r))throw new Error("[arrayContainsArray] method requires input 'subset' to be an array, got type '".concat(typeof r,"'"));return r[t?"some":"every"]((function(r){return e.indexOf(r)>=0}))},r.toAscii=function(e){var r="",t=0,n=e.length;for("0x"===e.substring(0,2)&&(t=2);t<n;t+=2){var i=parseInt(e.substr(t,2),16);r+=String.fromCharCode(i)}return r},r.fromUtf8=function(e){var r=n.from(e,"utf8");return"0x".concat(o(r.toString("hex")).replace(/^0+|0+$/g,""))},r.fromAscii=function(e){for(var r="",t=0;t<e.length;t++){var n=e.charCodeAt(t).toString(16);r+=n.length<2?"0".concat(n):n}return"0x".concat(r)},r.getKeys=function(e,r,t){if(!Array.isArray(e))throw new Error("[getKeys] method expects input 'params' to be an array, got ".concat(typeof e));if("string"!=typeof r)throw new Error("[getKeys] method expects input 'key' to be type 'string', got ".concat(typeof e));for(var n=[],i=0;i<e.length;i++){var o=e[i][r];if(t&&!o)o="";else if("string"!=typeof o)throw new Error("invalid abi - expected type 'string', received ".concat(typeof o));n.push(o)}return n},r.isHexString=function(e,r){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!r||e.length===2+2*r)}},80867:function(e,r,t){var n=t(48764).Buffer,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.defineProperties=void 0;var o=i(t(69282)),f=t(54846),a=t(14538),u=t(14651);r.defineProperties=function(e,r,t){if(e.raw=[],e._fields=[],e.toJSON=function(r){if(void 0===r&&(r=!1),r){var t={};return e._fields.forEach((function(r){t[r]="0x".concat(e[r].toString("hex"))})),t}return(0,u.baToJSON)(e.raw)},e.serialize=function(){return a.rlp.encode(e.raw)},r.forEach((function(r,t){function i(){return e.raw[t]}function f(i){"00"!==(i=(0,u.toBuffer)(i)).toString("hex")||r.allowZero||(i=n.allocUnsafe(0)),r.allowLess&&r.length?(i=(0,u.unpadBuffer)(i),(0,o.default)(r.length>=i.length,"The field ".concat(r.name," must not have more ").concat(r.length," bytes"))):r.allowZero&&0===i.length||!r.length||(0,o.default)(r.length===i.length,"The field ".concat(r.name," must have byte length of ").concat(r.length)),e.raw[t]=i}e._fields.push(r.name),Object.defineProperty(e,r.name,{enumerable:!0,configurable:!0,get:i,set:f}),r.default&&(e[r.name]=r.default),r.alias&&Object.defineProperty(e,r.alias,{enumerable:!1,configurable:!0,set:f,get:i})})),t)if("string"==typeof t&&(t=n.from((0,f.stripHexPrefix)(t),"hex")),n.isBuffer(t)&&(t=a.rlp.decode(t)),Array.isArray(t)){if(t.length>e._fields.length)throw new Error("wrong number of fields in data");t.forEach((function(r,t){e[e._fields[t]]=(0,u.toBuffer)(r)}))}else{if("object"!=typeof t)throw new Error("invalid data");var i=Object.keys(t);r.forEach((function(r){-1!==i.indexOf(r.name)&&(e[r.name]=t[r.name]),-1!==i.indexOf(r.alias)&&(e[r.alias]=t[r.alias])}))}}},77112:(e,r,t)=>{var n=t(48764).Buffer;Object.defineProperty(r,"__esModule",{value:!0}),r.hashPersonalMessage=r.isValidSignature=r.fromRpcSig=r.toCompactSig=r.toRpcSig=r.ecrecover=r.ecsign=void 0;var i=t(95053),o=t(14538),f=t(14651),a=t(45641),u=t(63746),s=t(2971);function c(e,r){var t=(0,s.toType)(e,s.TypeOutput.BN);if(!r)return t.subn(27);var n=(0,s.toType)(r,s.TypeOutput.BN);return t.sub(n.muln(2).addn(35))}function d(e){var r=new o.BN(e);return r.eqn(0)||r.eqn(1)}r.ecsign=function(e,r,t){var o=(0,i.ecdsaSign)(e,r),f=o.signature,a=o.recid,u=n.from(f.slice(0,32)),c=n.from(f.slice(32,64));if(!t||"number"==typeof t){if(t&&!Number.isSafeInteger(t))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");return{r:u,s:c,v:t?a+(2*t+35):a+27}}return{r:u,s:c,v:(0,s.toType)(t,s.TypeOutput.BN).muln(2).addn(35).addn(a).toArrayLike(n)}};r.ecrecover=function(e,r,t,o,a){var u=n.concat([(0,f.setLengthLeft)(t,32),(0,f.setLengthLeft)(o,32)],64),s=c(r,a);if(!d(s))throw new Error("Invalid signature v value");var l=(0,i.ecdsaRecover)(u,s.toNumber(),e);return n.from((0,i.publicKeyConvert)(l,!1).slice(1))};r.toRpcSig=function(e,r,t,i){if(!d(c(e,i)))throw new Error("Invalid signature v value");return(0,f.bufferToHex)(n.concat([(0,f.setLengthLeft)(r,32),(0,f.setLengthLeft)(t,32),(0,f.toBuffer)(e)]))};r.toCompactSig=function(e,r,t,i){if(!d(c(e,i)))throw new Error("Invalid signature v value");var o=(0,s.toType)(e,s.TypeOutput.Number),a=t;return(o>28&&o%2==1||1===o||28===o)&&((a=n.from(t))[0]|=128),(0,f.bufferToHex)(n.concat([(0,f.setLengthLeft)(r,32),(0,f.setLengthLeft)(a,32)]))};r.fromRpcSig=function(e){var r,t,n,i=(0,f.toBuffer)(e);if(i.length>=65)r=i.slice(0,32),t=i.slice(32,64),n=(0,f.bufferToInt)(i.slice(64));else{if(64!==i.length)throw new Error("Invalid signature length");r=i.slice(0,32),t=i.slice(32,64),n=(0,f.bufferToInt)(i.slice(32,33))>>7,t[0]&=127}return n<27&&(n+=27),{v:n,r,s:t}};r.isValidSignature=function(e,r,t,n,i){void 0===n&&(n=!0);var f=new o.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),a=new o.BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==r.length||32!==t.length)return!1;if(!d(c(e,i)))return!1;var u=new o.BN(r),s=new o.BN(t);return!(u.isZero()||u.gt(a)||s.isZero()||s.gt(a))&&(!n||1!==s.cmp(f))};r.hashPersonalMessage=function(e){(0,u.assertIsBuffer)(e);var r=n.from("Ethereum Signed Message:\n".concat(e.length),"utf-8");return(0,a.keccak)(n.concat([r,e]))}},2971:(e,r,t)=>{var n=t(48764).Buffer;Object.defineProperty(r,"__esModule",{value:!0}),r.toType=r.TypeOutput=r.bnToRlp=r.bnToUnpaddedBuffer=r.bnToHex=void 0;var i,o=t(14538),f=t(54846),a=t(14651);function u(e){return(0,a.unpadBuffer)(e.toArrayLike(n))}r.bnToHex=function(e){return"0x".concat(e.toString(16))},r.bnToUnpaddedBuffer=u,r.bnToRlp=function(e){return u(e)},function(e){e[e.Number=0]="Number",e[e.BN=1]="BN",e[e.Buffer=2]="Buffer",e[e.PrefixedHexString=3]="PrefixedHexString"}(i=r.TypeOutput||(r.TypeOutput={})),r.toType=function(e,r){if(null===e)return null;if(void 0!==e){if("string"==typeof e&&!(0,f.isHexString)(e))throw new Error("A string must be provided with a 0x-prefix, given: ".concat(e));if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");var t=(0,a.toBuffer)(e);if(r===i.Buffer)return t;if(r===i.BN)return new o.BN(t);if(r===i.Number){var n=new o.BN(t),u=new o.BN(Number.MAX_SAFE_INTEGER.toString());if(n.gt(u))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return n.toNumber()}return"0x".concat(t.toString("hex"))}}},49386:function(e,r,t){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});var i=n(t(1372)),o=t(50949),f=function(){function e(e){this._hdkey=e}return e.fromMasterSeed=function(r){return new e(o.HDKey.fromMasterSeed(r))},e.fromExtendedKey=function(r){return new e(o.HDKey.fromExtendedKey(r))},e.prototype.privateExtendedKey=function(){if(!this._hdkey.privateExtendedKey)throw new Error("This is a public key only wallet");return this._hdkey.privateExtendedKey},e.prototype.publicExtendedKey=function(){return this._hdkey.publicExtendedKey},e.prototype.derivePath=function(r){return new e(this._hdkey.derive(r))},e.prototype.deriveChild=function(r){return new e(this._hdkey.deriveChild(r))},e.prototype.getWallet=function(){return this._hdkey._privateKey?i.default.fromPrivateKey(this._hdkey._privateKey):i.default.fromPublicKey(this._hdkey._publicKey,!0)},e}();r.default=f},1372:function(e,r,t){var n=t(48764).Buffer,i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i]);return e},i.apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,r,t,n){void 0===n&&(n=t),Object.defineProperty(e,n,{enumerable:!0,get:function(){return r[t]}})}:function(e,r,t,n){void 0===n&&(n=t),e[n]=r[t]}),f=this&&this.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)"default"!==t&&Object.prototype.hasOwnProperty.call(e,t)&&o(r,e,t);return f(r,e),r},u=this&&this.__awaiter||function(e,r,t,n){return new(t||(t=Promise))((function(i,o){function f(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var r;e.done?i(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(f,a)}u((n=n.apply(e,r||[])).next())}))},s=this&&this.__generator||function(e,r){var t,n,i,o,f={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(t)throw new TypeError("Generator is already executing.");for(;f;)try{if(t=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return f.label++,{value:o[1],done:!1};case 5:f.label++,n=o[1],o=[0];continue;case 7:o=f.ops.pop(),f.trys.pop();continue;default:if(!(i=f.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){f=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){f.label=o[1];break}if(6===o[0]&&f.label<i[1]){f.label=i[1],i=o;break}if(i&&f.label<i[2]){f.label=i[2],f.ops.push(o);break}i[2]&&f.ops.pop(),f.trys.pop();continue}o=r.call(e,f)}catch(e){o=[6,e],n=0}finally{t=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.thirdparty=r.hdkey=void 0;var d=a(t(55835)),l=t(22751),p=t(17635),h=t(49386);Object.defineProperty(r,"hdkey",{enumerable:!0,get:function(){return c(h).default}});var y=t(60524);Object.defineProperty(r,"thirdparty",{enumerable:!0,get:function(){return c(y).default}});var v=t(58334),g=t(61798),b=t(54039).v4;function m(e,r,t){if(r.toLowerCase().startsWith("0x")&&(r=r.slice(2)),!r&&!t)return r;if(t%2)throw new Error("Invalid length argument, must be an even number");if("number"==typeof t&&r.length!==t)throw new Error("Invalid "+e+", string must be "+t+" hex characters");if(!/^([0-9a-f]{2})+$/i.test(r))throw new Error("Invalid "+e+", string must be "+("number"==typeof t?t:"empty or a non-zero even number of")+" hex characters");return r}function w(e,r,t){if(!n.isBuffer(r))throw new Error("Invalid "+e+", must be a string ("+("number"==typeof t?""+2*t:"empty or a non-zero even number of")+" hex characters) or buffer"+("number"==typeof t?" ("+t+" bytes)":""));if("number"==typeof t&&r.length!==t)throw new Error("Invalid "+e+", buffer must be "+t+" bytes");return r}var x=function(){function e(e,r){if(void 0===r&&(r=void 0),this.privateKey=e,this.publicKey=r,e&&r)throw new Error("Cannot supply both a private and a public key to the constructor");if(e&&!(0,l.isValidPrivate)(e))throw new Error("Private key does not satisfy the curve requirements (ie. it is invalid)");if(r&&!(0,l.isValidPublic)(r))throw new Error("Invalid public key")}return e.generate=function(r){if(void 0===r&&(r=!1),!r)return new e(g(32));for(var t=new l.BN("088f924eeceeda7fe92e1f5b0fffffffffffffff",16);;){var n=g(32);if(new l.BN((0,l.privateToAddress)(n)).lte(t))return new e(n)}},e.generateVanityAddress=function(r){for(r instanceof RegExp||(r=new RegExp(r));;){var t=g(32),n=(0,l.privateToAddress)(t);if(r.test(n.toString("hex")))return new e(t)}},e.fromPublicKey=function(r,t){return void 0===t&&(t=!1),t&&(r=(0,l.importPublic)(r)),new e(void 0,r)},e.fromExtendedPublicKey=function(r){if("xpub"!==r.slice(0,4))throw new Error("Not an extended public key");var t=v.decode(r).slice(45);return e.fromPublicKey(t,!0)},e.fromPrivateKey=function(r){return new e(r)},e.fromExtendedPrivateKey=function(r){if("xprv"!==r.slice(0,4))throw new Error("Not an extended private key");var t=v.decode(r);if(0!==t[45])throw new Error("Invalid extended private key");return e.fromPrivateKey(t.slice(46))},e.fromV1=function(r,t){return u(this,void 0,void 0,(function(){var i,o,f,a,u;return s(this,(function(s){switch(s.label){case 0:if("1"!==(i="object"==typeof r?r:JSON.parse(r)).Version)throw new Error("Not a V1 Wallet");if("scrypt"!==i.Crypto.KeyHeader.Kdf)throw new Error("Unsupported key derivation scheme");return o=i.Crypto.KeyHeader.KdfParams,[4,(0,p.scrypt)(n.from(t),n.from(i.Crypto.Salt,"hex"),o.N,o.R,o.P,o.DkLen)];case 1:if(f=s.sent(),a=n.from(i.Crypto.CipherText,"hex"),(0,l.keccak256)(n.concat([f.slice(16,32),a])).toString("hex")!==i.Crypto.MAC)throw new Error("Key derivation failed - possibly wrong passphrase");return u=d.createDecipheriv("aes-128-cbc",(0,l.keccak256)(f.slice(0,16)).slice(0,16),n.from(i.Crypto.IV,"hex")),[2,new e(_(u,a))]}}))}))},e.fromV3=function(r,t,i){return void 0===i&&(i=!1),u(this,void 0,void 0,(function(){var o,f,a,u,c;return s(this,(function(s){switch(s.label){case 0:if(3!==(o="object"==typeof r?r:JSON.parse(i?r.toLowerCase():r)).version)throw new Error("Not a V3 wallet");return"scrypt"!==o.crypto.kdf?[3,2]:(a=o.crypto.kdfparams,[4,(0,p.scrypt)(n.from(t),n.from(a.salt,"hex"),a.n,a.r,a.p,a.dklen)]);case 1:return f=s.sent(),[3,3];case 2:if("pbkdf2"!==o.crypto.kdf)throw new Error("Unsupported key derivation scheme");if("hmac-sha256"!==(a=o.crypto.kdfparams).prf)throw new Error("Unsupported parameters to PBKDF2");f=d.pbkdf2Sync(n.from(t),n.from(a.salt,"hex"),a.c,a.dklen,"sha256"),s.label=3;case 3:if(u=n.from(o.crypto.ciphertext,"hex"),(0,l.keccak256)(n.concat([n.from(f.slice(16,32)),u])).toString("hex")!==o.crypto.mac)throw new Error("Key derivation failed - possibly wrong passphrase");return c=d.createDecipheriv(o.crypto.cipher,f.slice(0,16),n.from(o.crypto.cipherparams.iv,"hex")),[2,new e(_(c,u))]}}))}))},e.fromEthSale=function(r,t){var i="object"==typeof r?r:JSON.parse(r),o=n.from(i.encseed,"hex"),f=d.pbkdf2Sync(t,t,2e3,32,"sha256").slice(0,16),a=_(d.createDecipheriv("aes-128-cbc",f,o.slice(0,16)),o.slice(16)),u=new e((0,l.keccak256)(a));if(u.getAddress().toString("hex")!==i.ethaddr)throw new Error("Decoded key mismatch - possibly wrong passphrase");return u},Object.defineProperty(e.prototype,"pubKey",{get:function(){return A(this.publicKey)||(this.publicKey=(0,l.privateToPublic)(this.privateKey)),this.publicKey},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"privKey",{get:function(){if(!A(this.privateKey))throw new Error("This is a public key only wallet");return this.privateKey},enumerable:!1,configurable:!0}),e.prototype.getPrivateKey=function(){return this.privKey},e.prototype.getPrivateKeyString=function(){return(0,l.bufferToHex)(this.privKey)},e.prototype.getPublicKey=function(){return this.pubKey},e.prototype.getPublicKeyString=function(){return(0,l.bufferToHex)(this.getPublicKey())},e.prototype.getAddress=function(){return(0,l.publicToAddress)(this.pubKey)},e.prototype.getAddressString=function(){return(0,l.bufferToHex)(this.getAddress())},e.prototype.getChecksumAddressString=function(){return(0,l.toChecksumAddress)(this.getAddressString())},e.prototype.toV3=function(e,r){return u(this,void 0,void 0,(function(){var t,o,f,a,u,c;return s(this,(function(s){switch(s.label){case 0:if(!A(this.privateKey))throw new Error("This is a public key only wallet");switch(h=r,y={cipher:"aes-128-ctr",kdf:"scrypt",salt:g(32),iv:g(16),uuid:g(16),dklen:32,c:262144,n:262144,r:8,p:1},t=h?("string"==typeof h.salt&&(h.salt=n.from(m("salt",h.salt),"hex")),"string"==typeof h.iv&&(h.iv=n.from(m("iv",h.iv,32),"hex")),"string"==typeof h.uuid&&(h.uuid=n.from(m("uuid",h.uuid,32),"hex")),h.salt&&w("salt",h.salt),h.iv&&w("iv",h.iv,16),h.uuid&&w("uuid",h.uuid,16),i(i({},y),h)):y,t.kdf){case"pbkdf2":return[3,1];case"scrypt":return[3,2]}return[3,4];case 1:return o=function(e){return{dklen:e.dklen,salt:e.salt,c:e.c,prf:"hmac-sha256"}}(t),f=d.pbkdf2Sync(n.from(e),o.salt,o.c,o.dklen,"sha256"),[3,5];case 2:return o=function(e){return{dklen:e.dklen,salt:e.salt,n:e.n,r:e.r,p:e.p}}(t),[4,(0,p.scrypt)(n.from(e),o.salt,o.n,o.r,o.p,o.dklen)];case 3:return f=s.sent(),[3,5];case 4:throw new Error("Unsupported kdf");case 5:if(!(a=d.createCipheriv(t.cipher,f.slice(0,16),t.iv)))throw new Error("Unsupported cipher");return u=_(a,this.privKey),c=(0,l.keccak256)(n.concat([n.from(f.slice(16,32)),n.from(u)])),[2,{version:3,id:b({random:t.uuid}),address:this.getAddress().toString("hex"),crypto:{ciphertext:u.toString("hex"),cipherparams:{iv:t.iv.toString("hex")},cipher:t.cipher,kdf:t.kdf,kdfparams:i(i({},o),{salt:o.salt.toString("hex")}),mac:c.toString("hex")}}]}var h,y}))}))},e.prototype.getV3Filename=function(e){return["UTC--",(e?new Date(e):new Date).toJSON().replace(/:/g,"-"),"--",this.getAddress().toString("hex")].join("")},e.prototype.toV3String=function(e,r){return u(this,void 0,void 0,(function(){var t,n;return s(this,(function(i){switch(i.label){case 0:return n=(t=JSON).stringify,[4,this.toV3(e,r)];case 1:return[2,n.apply(t,[i.sent()])]}}))}))},e}();function _(e,r){return n.concat([e.update(r),e.final()])}function A(e){return null!=e}r.default=x},60524:function(e,r,t){var n=t(48764).Buffer,i=this&&this.__createBinding||(Object.create?function(e,r,t,n){void 0===n&&(n=t),Object.defineProperty(e,n,{enumerable:!0,get:function(){return r[t]}})}:function(e,r,t,n){void 0===n&&(n=t),e[n]=r[t]}),o=this&&this.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),f=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)"default"!==t&&Object.prototype.hasOwnProperty.call(e,t)&&i(r,e,t);return o(r,e),r},a=this&&this.__awaiter||function(e,r,t,n){return new(t||(t=Promise))((function(i,o){function f(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var r;e.done?i(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(f,a)}u((n=n.apply(e,r||[])).next())}))},u=this&&this.__generator||function(e,r){var t,n,i,o,f={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(t)throw new TypeError("Generator is already executing.");for(;f;)try{if(t=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return f.label++,{value:o[1],done:!1};case 5:f.label++,n=o[1],o=[0];continue;case 7:o=f.ops.pop(),f.trys.pop();continue;default:if(!(i=f.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){f=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){f.label=o[1];break}if(6===o[0]&&f.label<i[1]){f.label=i[1],i=o;break}if(i&&f.label<i[2]){f.label=i[2],f.ops.push(o);break}i[2]&&f.ops.pop(),f.trys.pop();continue}o=r.call(e,f)}catch(e){o=[6,e],n=0}finally{t=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.fromQuorumWallet=r.fromKryptoKit=r.fromEtherCamp=r.fromEtherWallet=void 0;var c=f(t(55835)),d=t(22751),l=t(17635),p=s(t(1372)),h=t(57458),y=t(78826);var v={count:1,keysize:16,ivsize:16,digest:"md5"};function g(e,r,t){var i=function(e){return e?{count:e.count||v.count,keysize:e.keysize||v.keysize,ivsize:e.ivsize||v.ivsize,digest:e.digest||v.digest}:v}(t);function o(t){var n=c.createHash(i.digest);n.update(t),n.update(e),n.update(r),t=n.digest();for(var o=1,f=i.count;o<f;o++)(n=c.createHash(i.digest)).update(t),t=n.digest();return t}for(var f=[],a=0;n.concat(f).length<i.keysize+i.ivsize;)f[a]=o(0===a?n.alloc(0):f[a-1]),a++;var u=n.concat(f);return{key:u.slice(0,i.keysize),iv:u.slice(i.keysize,i.keysize+i.ivsize)}}function b(e,r){var t,i="object"==typeof e?e:JSON.parse(e);if(i.locked){if("string"!=typeof r)throw new Error("Password required");if(r.length<7)throw new Error("Password must be at least 7 characters");var o=function(e){var r=n.from(e,"base64");return"Salted__"===r.slice(0,8).toString()?{salt:r.slice(8,16),ciphertext:r.slice(16)}:{ciphertext:r}}(i.encrypted?i.private.slice(0,128):i.private);if(!o.salt)throw new Error("Unsupported EtherWallet key format");var f=g(n.from(r),o.salt,{keysize:32,ivsize:16});t=function(e,r){return n.concat([e.update(r),e.final()])}(c.createDecipheriv("aes-256-cbc",f.key,f.iv),n.from(o.ciphertext)),t=n.from(h.decode(t.toString()),"hex")}else{if(64!==i.private.length)throw new Error("Invalid private key length");t=n.from(i.private,"hex")}var a=new p.default(t);if(a.getAddressString()!==i.address)throw new Error("Invalid private key or address");return a}function m(e){return new p.default((0,d.keccak256)(n.from(e)))}function w(e,r){return a(this,void 0,void 0,(function(){var t,i,o,f,a,s,c;return u(this,(function(u){switch(u.label){case 0:return"#"===e[0]&&(e=e.slice(1)),t=e[0],e=e.slice(1),"d"!==t?[3,1]:(i=(0,d.sha256)((0,d.toBuffer)(e)),[3,4]);case 1:if("q"!==t)return[3,3];if("string"!=typeof r)throw new Error("Password required");return o=(0,d.sha256)(n.from(e.slice(0,30))),f=e.slice(30,46),a=function(e){function r(e){try{return decodeURIComponent(e)}catch(e){return String.fromCharCode(65533)}}for(var t="",i="",o=0;o<e.length;o++)e[o]<=127?(t+=r(i)+String.fromCharCode(e[o]),i=""):i+="%"+e[o].toString(16);return n.from(t+r(i))}(o),[4,(0,l.scrypt)(n.from(r,"utf8"),a,16384,8,1,32)];case 2:if(s=u.sent(),c=new y.ModeOfOperation.ecb(s),i=n.concat([n.from(c.decrypt(o.slice(0,16))),n.from(c.decrypt(o.slice(16,32)))]),f.length>0&&f!==(0,d.sha256)((0,d.sha256)(i)).slice(0,8).toString("hex"))throw new Error("Failed to decrypt input - possibly invalid passphrase");return[3,4];case 3:throw new Error("Unsupported or invalid entropy type");case 4:return[2,new p.default(i)]}}))}))}function x(e,r){if(e.length<10)throw new Error("Passphrase must be at least 10 characters");if(r.length<10)throw new Error("User id must be at least 10 characters");var t=e+r,n=c.pbkdf2Sync(t,t,2e3,32,"sha256");return new p.default(n)}r.fromEtherWallet=b,r.fromEtherCamp=m,r.fromKryptoKit=w,r.fromQuorumWallet=x;var _={fromEtherWallet:b,fromEtherCamp:m,fromKryptoKit:w,fromQuorumWallet:x};r.default=_},54039:(e,r,t)=>{var n;t.d(r,{v4:()=>d});var i=new Uint8Array(16);function o(){if(!n&&!(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(i)}const f=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const a=function(e){return"string"==typeof e&&f.test(e)};for(var u=[],s=0;s<256;++s)u.push((s+256).toString(16).substr(1));const c=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=(u[e[r+0]]+u[e[r+1]]+u[e[r+2]]+u[e[r+3]]+"-"+u[e[r+4]]+u[e[r+5]]+"-"+u[e[r+6]]+u[e[r+7]]+"-"+u[e[r+8]]+u[e[r+9]]+"-"+u[e[r+10]]+u[e[r+11]]+u[e[r+12]]+u[e[r+13]]+u[e[r+14]]+u[e[r+15]]).toLowerCase();if(!a(t))throw TypeError("Stringified UUID is invalid");return t};const d=function(e,r,t){var n=(e=e||{}).random||(e.rng||o)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,r){t=t||0;for(var i=0;i<16;++i)r[t+i]=n[i];return r}return c(n)}}}]);