diff --git a/ui/app/AppLayouts/Wallet/services/dapps/sdk/generated/bundle.js b/ui/app/AppLayouts/Wallet/services/dapps/sdk/generated/bundle.js index 06621c094f..5aba67f501 100644 --- a/ui/app/AppLayouts/Wallet/services/dapps/sdk/generated/bundle.js +++ b/ui/app/AppLayouts/Wallet/services/dapps/sdk/generated/bundle.js @@ -1,1823 +1,2 @@ -/* - * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). - * This devtool is neither made for production nor for readable output files. - * It uses "eval()" calls to create a separate source file in the browser devtools. - * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) - * or disable the default devtool with "devtool: false". - * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). - */ -/******/ var __webpack_modules__ = ({ - -/***/ "./node_modules/@ethersproject/address/lib.esm/_version.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@ethersproject/address/lib.esm/_version.js ***! - \*****************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ version: () => (/* binding */ version)\n/* harmony export */ });\nconst version = \"address/5.7.0\";\n//# sourceMappingURL=_version.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@ethersproject/address/lib.esm/_version.js?"); - -/***/ }), - -/***/ "./node_modules/@ethersproject/address/lib.esm/index.js": -/*!**************************************************************!*\ - !*** ./node_modules/@ethersproject/address/lib.esm/index.js ***! - \**************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getAddress: () => (/* binding */ getAddress),\n/* harmony export */ getContractAddress: () => (/* binding */ getContractAddress),\n/* harmony export */ getCreate2Address: () => (/* binding */ getCreate2Address),\n/* harmony export */ getIcapAddress: () => (/* binding */ getIcapAddress),\n/* harmony export */ isAddress: () => (/* binding */ isAddress)\n/* harmony export */ });\n/* harmony import */ var _ethersproject_bytes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ethersproject/bytes */ \"./node_modules/@ethersproject/bytes/lib.esm/index.js\");\n/* harmony import */ var _ethersproject_bignumber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ethersproject/bignumber */ \"./node_modules/@ethersproject/bignumber/lib.esm/bignumber.js\");\n/* harmony import */ var _ethersproject_keccak256__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ethersproject/keccak256 */ \"./node_modules/@ethersproject/keccak256/lib.esm/index.js\");\n/* harmony import */ var _ethersproject_rlp__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ethersproject/rlp */ \"./node_modules/@ethersproject/rlp/lib.esm/index.js\");\n/* harmony import */ var _ethersproject_logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ethersproject/logger */ \"./node_modules/@ethersproject/logger/lib.esm/index.js\");\n/* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_version */ \"./node_modules/@ethersproject/address/lib.esm/_version.js\");\n\n\n\n\n\n\n\nconst logger = new _ethersproject_logger__WEBPACK_IMPORTED_MODULE_0__.Logger(_version__WEBPACK_IMPORTED_MODULE_1__.version);\nfunction getChecksumAddress(address) {\n if (!(0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_2__.isHexString)(address, 20)) {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n address = address.toLowerCase();\n const chars = address.substring(2).split(\"\");\n const expanded = new Uint8Array(40);\n for (let i = 0; i < 40; i++) {\n expanded[i] = chars[i].charCodeAt(0);\n }\n const hashed = (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_2__.arrayify)((0,_ethersproject_keccak256__WEBPACK_IMPORTED_MODULE_3__.keccak256)(expanded));\n for (let i = 0; i < 40; i += 2) {\n if ((hashed[i >> 1] >> 4) >= 8) {\n chars[i] = chars[i].toUpperCase();\n }\n if ((hashed[i >> 1] & 0x0f) >= 8) {\n chars[i + 1] = chars[i + 1].toUpperCase();\n }\n }\n return \"0x\" + chars.join(\"\");\n}\n// Shims for environments that are missing some required constants and functions\nconst MAX_SAFE_INTEGER = 0x1fffffffffffff;\nfunction log10(x) {\n if (Math.log10) {\n return Math.log10(x);\n }\n return Math.log(x) / Math.LN10;\n}\n// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number\n// Create lookup table\nconst ibanLookup = {};\nfor (let i = 0; i < 10; i++) {\n ibanLookup[String(i)] = String(i);\n}\nfor (let i = 0; i < 26; i++) {\n ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);\n}\n// How many decimal digits can we process? (for 64-bit float, this is 15)\nconst safeDigits = Math.floor(log10(MAX_SAFE_INTEGER));\nfunction ibanChecksum(address) {\n address = address.toUpperCase();\n address = address.substring(4) + address.substring(0, 2) + \"00\";\n let expanded = address.split(\"\").map((c) => { return ibanLookup[c]; }).join(\"\");\n // Javascript can handle integers safely up to 15 (decimal) digits\n while (expanded.length >= safeDigits) {\n let block = expanded.substring(0, safeDigits);\n expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);\n }\n let checksum = String(98 - (parseInt(expanded, 10) % 97));\n while (checksum.length < 2) {\n checksum = \"0\" + checksum;\n }\n return checksum;\n}\n;\nfunction getAddress(address) {\n let result = null;\n if (typeof (address) !== \"string\") {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) {\n // Missing the 0x prefix\n if (address.substring(0, 2) !== \"0x\") {\n address = \"0x\" + address;\n }\n result = getChecksumAddress(address);\n // It is a checksummed address with a bad checksum\n if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) {\n logger.throwArgumentError(\"bad address checksum\", \"address\", address);\n }\n // Maybe ICAP? (we only support direct mode)\n }\n else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {\n // It is an ICAP address with a bad checksum\n if (address.substring(2, 4) !== ibanChecksum(address)) {\n logger.throwArgumentError(\"bad icap checksum\", \"address\", address);\n }\n result = (0,_ethersproject_bignumber__WEBPACK_IMPORTED_MODULE_4__._base36To16)(address.substring(4));\n while (result.length < 40) {\n result = \"0\" + result;\n }\n result = getChecksumAddress(\"0x\" + result);\n }\n else {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n return result;\n}\nfunction isAddress(address) {\n try {\n getAddress(address);\n return true;\n }\n catch (error) { }\n return false;\n}\nfunction getIcapAddress(address) {\n let base36 = (0,_ethersproject_bignumber__WEBPACK_IMPORTED_MODULE_4__._base16To36)(getAddress(address).substring(2)).toUpperCase();\n while (base36.length < 30) {\n base36 = \"0\" + base36;\n }\n return \"XE\" + ibanChecksum(\"XE00\" + base36) + base36;\n}\n// http://ethereum.stackexchange.com/questions/760/how-is-the-address-of-an-ethereum-contract-computed\nfunction getContractAddress(transaction) {\n let from = null;\n try {\n from = getAddress(transaction.from);\n }\n catch (error) {\n logger.throwArgumentError(\"missing from address\", \"transaction\", transaction);\n }\n const nonce = (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_2__.stripZeros)((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_2__.arrayify)(_ethersproject_bignumber__WEBPACK_IMPORTED_MODULE_4__.BigNumber.from(transaction.nonce).toHexString()));\n return getAddress((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_2__.hexDataSlice)((0,_ethersproject_keccak256__WEBPACK_IMPORTED_MODULE_3__.keccak256)((0,_ethersproject_rlp__WEBPACK_IMPORTED_MODULE_5__.encode)([from, nonce])), 12));\n}\nfunction getCreate2Address(from, salt, initCodeHash) {\n if ((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_2__.hexDataLength)(salt) !== 32) {\n logger.throwArgumentError(\"salt must be 32 bytes\", \"salt\", salt);\n }\n if ((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_2__.hexDataLength)(initCodeHash) !== 32) {\n logger.throwArgumentError(\"initCodeHash must be 32 bytes\", \"initCodeHash\", initCodeHash);\n }\n return getAddress((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_2__.hexDataSlice)((0,_ethersproject_keccak256__WEBPACK_IMPORTED_MODULE_3__.keccak256)((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_2__.concat)([\"0xff\", getAddress(from), salt, initCodeHash])), 12));\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@ethersproject/address/lib.esm/index.js?"); - -/***/ }), - -/***/ "./node_modules/@ethersproject/bignumber/lib.esm/_version.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@ethersproject/bignumber/lib.esm/_version.js ***! - \*******************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ version: () => (/* binding */ version)\n/* harmony export */ });\nconst version = \"bignumber/5.7.0\";\n//# sourceMappingURL=_version.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@ethersproject/bignumber/lib.esm/_version.js?"); - -/***/ }), - -/***/ "./node_modules/@ethersproject/bignumber/lib.esm/bignumber.js": -/*!********************************************************************!*\ - !*** ./node_modules/@ethersproject/bignumber/lib.esm/bignumber.js ***! - \********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BigNumber: () => (/* binding */ BigNumber),\n/* harmony export */ _base16To36: () => (/* binding */ _base16To36),\n/* harmony export */ _base36To16: () => (/* binding */ _base36To16),\n/* harmony export */ isBigNumberish: () => (/* binding */ isBigNumberish)\n/* harmony export */ });\n/* harmony import */ var bn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\");\n/* harmony import */ var bn_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(bn_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _ethersproject_bytes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ethersproject/bytes */ \"./node_modules/@ethersproject/bytes/lib.esm/index.js\");\n/* harmony import */ var _ethersproject_logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ethersproject/logger */ \"./node_modules/@ethersproject/logger/lib.esm/index.js\");\n/* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_version */ \"./node_modules/@ethersproject/bignumber/lib.esm/_version.js\");\n\n/**\n * BigNumber\n *\n * A wrapper around the BN.js object. We use the BN.js library\n * because it is used by elliptic, so it is required regardless.\n *\n */\n\nvar BN = (bn_js__WEBPACK_IMPORTED_MODULE_0___default().BN);\n\n\n\nconst logger = new _ethersproject_logger__WEBPACK_IMPORTED_MODULE_1__.Logger(_version__WEBPACK_IMPORTED_MODULE_2__.version);\nconst _constructorGuard = {};\nconst MAX_SAFE = 0x1fffffffffffff;\nfunction isBigNumberish(value) {\n return (value != null) && (BigNumber.isBigNumber(value) ||\n (typeof (value) === \"number\" && (value % 1) === 0) ||\n (typeof (value) === \"string\" && !!value.match(/^-?[0-9]+$/)) ||\n (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_3__.isHexString)(value) ||\n (typeof (value) === \"bigint\") ||\n (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_3__.isBytes)(value));\n}\n// Only warn about passing 10 into radix once\nlet _warnedToStringRadix = false;\nclass BigNumber {\n constructor(constructorGuard, hex) {\n if (constructorGuard !== _constructorGuard) {\n logger.throwError(\"cannot call constructor directly; use BigNumber.from\", _ethersproject_logger__WEBPACK_IMPORTED_MODULE_1__.Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"new (BigNumber)\"\n });\n }\n this._hex = hex;\n this._isBigNumber = true;\n Object.freeze(this);\n }\n fromTwos(value) {\n return toBigNumber(toBN(this).fromTwos(value));\n }\n toTwos(value) {\n return toBigNumber(toBN(this).toTwos(value));\n }\n abs() {\n if (this._hex[0] === \"-\") {\n return BigNumber.from(this._hex.substring(1));\n }\n return this;\n }\n add(other) {\n return toBigNumber(toBN(this).add(toBN(other)));\n }\n sub(other) {\n return toBigNumber(toBN(this).sub(toBN(other)));\n }\n div(other) {\n const o = BigNumber.from(other);\n if (o.isZero()) {\n throwFault(\"division-by-zero\", \"div\");\n }\n return toBigNumber(toBN(this).div(toBN(other)));\n }\n mul(other) {\n return toBigNumber(toBN(this).mul(toBN(other)));\n }\n mod(other) {\n const value = toBN(other);\n if (value.isNeg()) {\n throwFault(\"division-by-zero\", \"mod\");\n }\n return toBigNumber(toBN(this).umod(value));\n }\n pow(other) {\n const value = toBN(other);\n if (value.isNeg()) {\n throwFault(\"negative-power\", \"pow\");\n }\n return toBigNumber(toBN(this).pow(value));\n }\n and(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"unbound-bitwise-result\", \"and\");\n }\n return toBigNumber(toBN(this).and(value));\n }\n or(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"unbound-bitwise-result\", \"or\");\n }\n return toBigNumber(toBN(this).or(value));\n }\n xor(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"unbound-bitwise-result\", \"xor\");\n }\n return toBigNumber(toBN(this).xor(value));\n }\n mask(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"negative-width\", \"mask\");\n }\n return toBigNumber(toBN(this).maskn(value));\n }\n shl(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"negative-width\", \"shl\");\n }\n return toBigNumber(toBN(this).shln(value));\n }\n shr(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"negative-width\", \"shr\");\n }\n return toBigNumber(toBN(this).shrn(value));\n }\n eq(other) {\n return toBN(this).eq(toBN(other));\n }\n lt(other) {\n return toBN(this).lt(toBN(other));\n }\n lte(other) {\n return toBN(this).lte(toBN(other));\n }\n gt(other) {\n return toBN(this).gt(toBN(other));\n }\n gte(other) {\n return toBN(this).gte(toBN(other));\n }\n isNegative() {\n return (this._hex[0] === \"-\");\n }\n isZero() {\n return toBN(this).isZero();\n }\n toNumber() {\n try {\n return toBN(this).toNumber();\n }\n catch (error) {\n throwFault(\"overflow\", \"toNumber\", this.toString());\n }\n return null;\n }\n toBigInt() {\n try {\n return BigInt(this.toString());\n }\n catch (e) { }\n return logger.throwError(\"this platform does not support BigInt\", _ethersproject_logger__WEBPACK_IMPORTED_MODULE_1__.Logger.errors.UNSUPPORTED_OPERATION, {\n value: this.toString()\n });\n }\n toString() {\n // Lots of people expect this, which we do not support, so check (See: #889)\n if (arguments.length > 0) {\n if (arguments[0] === 10) {\n if (!_warnedToStringRadix) {\n _warnedToStringRadix = true;\n logger.warn(\"BigNumber.toString does not accept any parameters; base-10 is assumed\");\n }\n }\n else if (arguments[0] === 16) {\n logger.throwError(\"BigNumber.toString does not accept any parameters; use bigNumber.toHexString()\", _ethersproject_logger__WEBPACK_IMPORTED_MODULE_1__.Logger.errors.UNEXPECTED_ARGUMENT, {});\n }\n else {\n logger.throwError(\"BigNumber.toString does not accept parameters\", _ethersproject_logger__WEBPACK_IMPORTED_MODULE_1__.Logger.errors.UNEXPECTED_ARGUMENT, {});\n }\n }\n return toBN(this).toString(10);\n }\n toHexString() {\n return this._hex;\n }\n toJSON(key) {\n return { type: \"BigNumber\", hex: this.toHexString() };\n }\n static from(value) {\n if (value instanceof BigNumber) {\n return value;\n }\n if (typeof (value) === \"string\") {\n if (value.match(/^-?0x[0-9a-f]+$/i)) {\n return new BigNumber(_constructorGuard, toHex(value));\n }\n if (value.match(/^-?[0-9]+$/)) {\n return new BigNumber(_constructorGuard, toHex(new BN(value)));\n }\n return logger.throwArgumentError(\"invalid BigNumber string\", \"value\", value);\n }\n if (typeof (value) === \"number\") {\n if (value % 1) {\n throwFault(\"underflow\", \"BigNumber.from\", value);\n }\n if (value >= MAX_SAFE || value <= -MAX_SAFE) {\n throwFault(\"overflow\", \"BigNumber.from\", value);\n }\n return BigNumber.from(String(value));\n }\n const anyValue = value;\n if (typeof (anyValue) === \"bigint\") {\n return BigNumber.from(anyValue.toString());\n }\n if ((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_3__.isBytes)(anyValue)) {\n return BigNumber.from((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_3__.hexlify)(anyValue));\n }\n if (anyValue) {\n // Hexable interface (takes priority)\n if (anyValue.toHexString) {\n const hex = anyValue.toHexString();\n if (typeof (hex) === \"string\") {\n return BigNumber.from(hex);\n }\n }\n else {\n // For now, handle legacy JSON-ified values (goes away in v6)\n let hex = anyValue._hex;\n // New-form JSON\n if (hex == null && anyValue.type === \"BigNumber\") {\n hex = anyValue.hex;\n }\n if (typeof (hex) === \"string\") {\n if ((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_3__.isHexString)(hex) || (hex[0] === \"-\" && (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_3__.isHexString)(hex.substring(1)))) {\n return BigNumber.from(hex);\n }\n }\n }\n }\n return logger.throwArgumentError(\"invalid BigNumber value\", \"value\", value);\n }\n static isBigNumber(value) {\n return !!(value && value._isBigNumber);\n }\n}\n// Normalize the hex string\nfunction toHex(value) {\n // For BN, call on the hex string\n if (typeof (value) !== \"string\") {\n return toHex(value.toString(16));\n }\n // If negative, prepend the negative sign to the normalized positive value\n if (value[0] === \"-\") {\n // Strip off the negative sign\n value = value.substring(1);\n // Cannot have multiple negative signs (e.g. \"--0x04\")\n if (value[0] === \"-\") {\n logger.throwArgumentError(\"invalid hex\", \"value\", value);\n }\n // Call toHex on the positive component\n value = toHex(value);\n // Do not allow \"-0x00\"\n if (value === \"0x00\") {\n return value;\n }\n // Negate the value\n return \"-\" + value;\n }\n // Add a \"0x\" prefix if missing\n if (value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n // Normalize zero\n if (value === \"0x\") {\n return \"0x00\";\n }\n // Make the string even length\n if (value.length % 2) {\n value = \"0x0\" + value.substring(2);\n }\n // Trim to smallest even-length string\n while (value.length > 4 && value.substring(0, 4) === \"0x00\") {\n value = \"0x\" + value.substring(4);\n }\n return value;\n}\nfunction toBigNumber(value) {\n return BigNumber.from(toHex(value));\n}\nfunction toBN(value) {\n const hex = BigNumber.from(value).toHexString();\n if (hex[0] === \"-\") {\n return (new BN(\"-\" + hex.substring(3), 16));\n }\n return new BN(hex.substring(2), 16);\n}\nfunction throwFault(fault, operation, value) {\n const params = { fault: fault, operation: operation };\n if (value != null) {\n params.value = value;\n }\n return logger.throwError(fault, _ethersproject_logger__WEBPACK_IMPORTED_MODULE_1__.Logger.errors.NUMERIC_FAULT, params);\n}\n// value should have no prefix\nfunction _base36To16(value) {\n return (new BN(value, 36)).toString(16);\n}\n// value should have no prefix\nfunction _base16To36(value) {\n return (new BN(value, 16)).toString(36);\n}\n//# sourceMappingURL=bignumber.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@ethersproject/bignumber/lib.esm/bignumber.js?"); - -/***/ }), - -/***/ "./node_modules/@ethersproject/bytes/lib.esm/_version.js": -/*!***************************************************************!*\ - !*** ./node_modules/@ethersproject/bytes/lib.esm/_version.js ***! - \***************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ version: () => (/* binding */ version)\n/* harmony export */ });\nconst version = \"bytes/5.7.0\";\n//# sourceMappingURL=_version.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@ethersproject/bytes/lib.esm/_version.js?"); - -/***/ }), - -/***/ "./node_modules/@ethersproject/bytes/lib.esm/index.js": -/*!************************************************************!*\ - !*** ./node_modules/@ethersproject/bytes/lib.esm/index.js ***! - \************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ arrayify: () => (/* binding */ arrayify),\n/* harmony export */ concat: () => (/* binding */ concat),\n/* harmony export */ hexConcat: () => (/* binding */ hexConcat),\n/* harmony export */ hexDataLength: () => (/* binding */ hexDataLength),\n/* harmony export */ hexDataSlice: () => (/* binding */ hexDataSlice),\n/* harmony export */ hexStripZeros: () => (/* binding */ hexStripZeros),\n/* harmony export */ hexValue: () => (/* binding */ hexValue),\n/* harmony export */ hexZeroPad: () => (/* binding */ hexZeroPad),\n/* harmony export */ hexlify: () => (/* binding */ hexlify),\n/* harmony export */ isBytes: () => (/* binding */ isBytes),\n/* harmony export */ isBytesLike: () => (/* binding */ isBytesLike),\n/* harmony export */ isHexString: () => (/* binding */ isHexString),\n/* harmony export */ joinSignature: () => (/* binding */ joinSignature),\n/* harmony export */ splitSignature: () => (/* binding */ splitSignature),\n/* harmony export */ stripZeros: () => (/* binding */ stripZeros),\n/* harmony export */ zeroPad: () => (/* binding */ zeroPad)\n/* harmony export */ });\n/* harmony import */ var _ethersproject_logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ethersproject/logger */ \"./node_modules/@ethersproject/logger/lib.esm/index.js\");\n/* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_version */ \"./node_modules/@ethersproject/bytes/lib.esm/_version.js\");\n\n\n\nconst logger = new _ethersproject_logger__WEBPACK_IMPORTED_MODULE_0__.Logger(_version__WEBPACK_IMPORTED_MODULE_1__.version);\n///////////////////////////////\nfunction isHexable(value) {\n return !!(value.toHexString);\n}\nfunction addSlice(array) {\n if (array.slice) {\n return array;\n }\n array.slice = function () {\n const args = Array.prototype.slice.call(arguments);\n return addSlice(new Uint8Array(Array.prototype.slice.apply(array, args)));\n };\n return array;\n}\nfunction isBytesLike(value) {\n return ((isHexString(value) && !(value.length % 2)) || isBytes(value));\n}\nfunction isInteger(value) {\n return (typeof (value) === \"number\" && value == value && (value % 1) === 0);\n}\nfunction isBytes(value) {\n if (value == null) {\n return false;\n }\n if (value.constructor === Uint8Array) {\n return true;\n }\n if (typeof (value) === \"string\") {\n return false;\n }\n if (!isInteger(value.length) || value.length < 0) {\n return false;\n }\n for (let i = 0; i < value.length; i++) {\n const v = value[i];\n if (!isInteger(v) || v < 0 || v >= 256) {\n return false;\n }\n }\n return true;\n}\nfunction arrayify(value, options) {\n if (!options) {\n options = {};\n }\n if (typeof (value) === \"number\") {\n logger.checkSafeUint53(value, \"invalid arrayify value\");\n const result = [];\n while (value) {\n result.unshift(value & 0xff);\n value = parseInt(String(value / 256));\n }\n if (result.length === 0) {\n result.push(0);\n }\n return addSlice(new Uint8Array(result));\n }\n if (options.allowMissingPrefix && typeof (value) === \"string\" && value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexable(value)) {\n value = value.toHexString();\n }\n if (isHexString(value)) {\n let hex = value.substring(2);\n if (hex.length % 2) {\n if (options.hexPad === \"left\") {\n hex = \"0\" + hex;\n }\n else if (options.hexPad === \"right\") {\n hex += \"0\";\n }\n else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n const result = [];\n for (let i = 0; i < hex.length; i += 2) {\n result.push(parseInt(hex.substring(i, i + 2), 16));\n }\n return addSlice(new Uint8Array(result));\n }\n if (isBytes(value)) {\n return addSlice(new Uint8Array(value));\n }\n return logger.throwArgumentError(\"invalid arrayify value\", \"value\", value);\n}\nfunction concat(items) {\n const objects = items.map(item => arrayify(item));\n const length = objects.reduce((accum, item) => (accum + item.length), 0);\n const result = new Uint8Array(length);\n objects.reduce((offset, object) => {\n result.set(object, offset);\n return offset + object.length;\n }, 0);\n return addSlice(result);\n}\nfunction stripZeros(value) {\n let result = arrayify(value);\n if (result.length === 0) {\n return result;\n }\n // Find the first non-zero entry\n let start = 0;\n while (start < result.length && result[start] === 0) {\n start++;\n }\n // If we started with zeros, strip them\n if (start) {\n result = result.slice(start);\n }\n return result;\n}\nfunction zeroPad(value, length) {\n value = arrayify(value);\n if (value.length > length) {\n logger.throwArgumentError(\"value out of range\", \"value\", arguments[0]);\n }\n const result = new Uint8Array(length);\n result.set(value, length - value.length);\n return addSlice(result);\n}\nfunction isHexString(value, length) {\n if (typeof (value) !== \"string\" || !value.match(/^0x[0-9A-Fa-f]*$/)) {\n return false;\n }\n if (length && value.length !== 2 + 2 * length) {\n return false;\n }\n return true;\n}\nconst HexCharacters = \"0123456789abcdef\";\nfunction hexlify(value, options) {\n if (!options) {\n options = {};\n }\n if (typeof (value) === \"number\") {\n logger.checkSafeUint53(value, \"invalid hexlify value\");\n let hex = \"\";\n while (value) {\n hex = HexCharacters[value & 0xf] + hex;\n value = Math.floor(value / 16);\n }\n if (hex.length) {\n if (hex.length % 2) {\n hex = \"0\" + hex;\n }\n return \"0x\" + hex;\n }\n return \"0x00\";\n }\n if (typeof (value) === \"bigint\") {\n value = value.toString(16);\n if (value.length % 2) {\n return (\"0x0\" + value);\n }\n return \"0x\" + value;\n }\n if (options.allowMissingPrefix && typeof (value) === \"string\" && value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexable(value)) {\n return value.toHexString();\n }\n if (isHexString(value)) {\n if (value.length % 2) {\n if (options.hexPad === \"left\") {\n value = \"0x0\" + value.substring(2);\n }\n else if (options.hexPad === \"right\") {\n value += \"0\";\n }\n else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n return value.toLowerCase();\n }\n if (isBytes(value)) {\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n let v = value[i];\n result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f];\n }\n return result;\n }\n return logger.throwArgumentError(\"invalid hexlify value\", \"value\", value);\n}\n/*\nfunction unoddify(value: BytesLike | Hexable | number): BytesLike | Hexable | number {\n if (typeof(value) === \"string\" && value.length % 2 && value.substring(0, 2) === \"0x\") {\n return \"0x0\" + value.substring(2);\n }\n return value;\n}\n*/\nfunction hexDataLength(data) {\n if (typeof (data) !== \"string\") {\n data = hexlify(data);\n }\n else if (!isHexString(data) || (data.length % 2)) {\n return null;\n }\n return (data.length - 2) / 2;\n}\nfunction hexDataSlice(data, offset, endOffset) {\n if (typeof (data) !== \"string\") {\n data = hexlify(data);\n }\n else if (!isHexString(data) || (data.length % 2)) {\n logger.throwArgumentError(\"invalid hexData\", \"value\", data);\n }\n offset = 2 + 2 * offset;\n if (endOffset != null) {\n return \"0x\" + data.substring(offset, 2 + 2 * endOffset);\n }\n return \"0x\" + data.substring(offset);\n}\nfunction hexConcat(items) {\n let result = \"0x\";\n items.forEach((item) => {\n result += hexlify(item).substring(2);\n });\n return result;\n}\nfunction hexValue(value) {\n const trimmed = hexStripZeros(hexlify(value, { hexPad: \"left\" }));\n if (trimmed === \"0x\") {\n return \"0x0\";\n }\n return trimmed;\n}\nfunction hexStripZeros(value) {\n if (typeof (value) !== \"string\") {\n value = hexlify(value);\n }\n if (!isHexString(value)) {\n logger.throwArgumentError(\"invalid hex string\", \"value\", value);\n }\n value = value.substring(2);\n let offset = 0;\n while (offset < value.length && value[offset] === \"0\") {\n offset++;\n }\n return \"0x\" + value.substring(offset);\n}\nfunction hexZeroPad(value, length) {\n if (typeof (value) !== \"string\") {\n value = hexlify(value);\n }\n else if (!isHexString(value)) {\n logger.throwArgumentError(\"invalid hex string\", \"value\", value);\n }\n if (value.length > 2 * length + 2) {\n logger.throwArgumentError(\"value out of range\", \"value\", arguments[1]);\n }\n while (value.length < 2 * length + 2) {\n value = \"0x0\" + value.substring(2);\n }\n return value;\n}\nfunction splitSignature(signature) {\n const result = {\n r: \"0x\",\n s: \"0x\",\n _vs: \"0x\",\n recoveryParam: 0,\n v: 0,\n yParityAndS: \"0x\",\n compact: \"0x\"\n };\n if (isBytesLike(signature)) {\n let bytes = arrayify(signature);\n // Get the r, s and v\n if (bytes.length === 64) {\n // EIP-2098; pull the v from the top bit of s and clear it\n result.v = 27 + (bytes[32] >> 7);\n bytes[32] &= 0x7f;\n result.r = hexlify(bytes.slice(0, 32));\n result.s = hexlify(bytes.slice(32, 64));\n }\n else if (bytes.length === 65) {\n result.r = hexlify(bytes.slice(0, 32));\n result.s = hexlify(bytes.slice(32, 64));\n result.v = bytes[64];\n }\n else {\n logger.throwArgumentError(\"invalid signature string\", \"signature\", signature);\n }\n // Allow a recid to be used as the v\n if (result.v < 27) {\n if (result.v === 0 || result.v === 1) {\n result.v += 27;\n }\n else {\n logger.throwArgumentError(\"signature invalid v byte\", \"signature\", signature);\n }\n }\n // Compute recoveryParam from v\n result.recoveryParam = 1 - (result.v % 2);\n // Compute _vs from recoveryParam and s\n if (result.recoveryParam) {\n bytes[32] |= 0x80;\n }\n result._vs = hexlify(bytes.slice(32, 64));\n }\n else {\n result.r = signature.r;\n result.s = signature.s;\n result.v = signature.v;\n result.recoveryParam = signature.recoveryParam;\n result._vs = signature._vs;\n // If the _vs is available, use it to populate missing s, v and recoveryParam\n // and verify non-missing s, v and recoveryParam\n if (result._vs != null) {\n const vs = zeroPad(arrayify(result._vs), 32);\n result._vs = hexlify(vs);\n // Set or check the recid\n const recoveryParam = ((vs[0] >= 128) ? 1 : 0);\n if (result.recoveryParam == null) {\n result.recoveryParam = recoveryParam;\n }\n else if (result.recoveryParam !== recoveryParam) {\n logger.throwArgumentError(\"signature recoveryParam mismatch _vs\", \"signature\", signature);\n }\n // Set or check the s\n vs[0] &= 0x7f;\n const s = hexlify(vs);\n if (result.s == null) {\n result.s = s;\n }\n else if (result.s !== s) {\n logger.throwArgumentError(\"signature v mismatch _vs\", \"signature\", signature);\n }\n }\n // Use recid and v to populate each other\n if (result.recoveryParam == null) {\n if (result.v == null) {\n logger.throwArgumentError(\"signature missing v and recoveryParam\", \"signature\", signature);\n }\n else if (result.v === 0 || result.v === 1) {\n result.recoveryParam = result.v;\n }\n else {\n result.recoveryParam = 1 - (result.v % 2);\n }\n }\n else {\n if (result.v == null) {\n result.v = 27 + result.recoveryParam;\n }\n else {\n const recId = (result.v === 0 || result.v === 1) ? result.v : (1 - (result.v % 2));\n if (result.recoveryParam !== recId) {\n logger.throwArgumentError(\"signature recoveryParam mismatch v\", \"signature\", signature);\n }\n }\n }\n if (result.r == null || !isHexString(result.r)) {\n logger.throwArgumentError(\"signature missing or invalid r\", \"signature\", signature);\n }\n else {\n result.r = hexZeroPad(result.r, 32);\n }\n if (result.s == null || !isHexString(result.s)) {\n logger.throwArgumentError(\"signature missing or invalid s\", \"signature\", signature);\n }\n else {\n result.s = hexZeroPad(result.s, 32);\n }\n const vs = arrayify(result.s);\n if (vs[0] >= 128) {\n logger.throwArgumentError(\"signature s out of range\", \"signature\", signature);\n }\n if (result.recoveryParam) {\n vs[0] |= 0x80;\n }\n const _vs = hexlify(vs);\n if (result._vs) {\n if (!isHexString(result._vs)) {\n logger.throwArgumentError(\"signature invalid _vs\", \"signature\", signature);\n }\n result._vs = hexZeroPad(result._vs, 32);\n }\n // Set or check the _vs\n if (result._vs == null) {\n result._vs = _vs;\n }\n else if (result._vs !== _vs) {\n logger.throwArgumentError(\"signature _vs mismatch v and s\", \"signature\", signature);\n }\n }\n result.yParityAndS = result._vs;\n result.compact = result.r + result.yParityAndS.substring(2);\n return result;\n}\nfunction joinSignature(signature) {\n signature = splitSignature(signature);\n return hexlify(concat([\n signature.r,\n signature.s,\n (signature.recoveryParam ? \"0x1c\" : \"0x1b\")\n ]));\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@ethersproject/bytes/lib.esm/index.js?"); - -/***/ }), - -/***/ "./node_modules/@ethersproject/constants/lib.esm/bignumbers.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@ethersproject/constants/lib.esm/bignumbers.js ***! - \*********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ MaxInt256: () => (/* binding */ MaxInt256),\n/* harmony export */ MaxUint256: () => (/* binding */ MaxUint256),\n/* harmony export */ MinInt256: () => (/* binding */ MinInt256),\n/* harmony export */ NegativeOne: () => (/* binding */ NegativeOne),\n/* harmony export */ One: () => (/* binding */ One),\n/* harmony export */ Two: () => (/* binding */ Two),\n/* harmony export */ WeiPerEther: () => (/* binding */ WeiPerEther),\n/* harmony export */ Zero: () => (/* binding */ Zero)\n/* harmony export */ });\n/* harmony import */ var _ethersproject_bignumber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ethersproject/bignumber */ \"./node_modules/@ethersproject/bignumber/lib.esm/bignumber.js\");\n\nconst NegativeOne = ( /*#__PURE__*/_ethersproject_bignumber__WEBPACK_IMPORTED_MODULE_0__.BigNumber.from(-1));\nconst Zero = ( /*#__PURE__*/_ethersproject_bignumber__WEBPACK_IMPORTED_MODULE_0__.BigNumber.from(0));\nconst One = ( /*#__PURE__*/_ethersproject_bignumber__WEBPACK_IMPORTED_MODULE_0__.BigNumber.from(1));\nconst Two = ( /*#__PURE__*/_ethersproject_bignumber__WEBPACK_IMPORTED_MODULE_0__.BigNumber.from(2));\nconst WeiPerEther = ( /*#__PURE__*/_ethersproject_bignumber__WEBPACK_IMPORTED_MODULE_0__.BigNumber.from(\"1000000000000000000\"));\nconst MaxUint256 = ( /*#__PURE__*/_ethersproject_bignumber__WEBPACK_IMPORTED_MODULE_0__.BigNumber.from(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\"));\nconst MinInt256 = ( /*#__PURE__*/_ethersproject_bignumber__WEBPACK_IMPORTED_MODULE_0__.BigNumber.from(\"-0x8000000000000000000000000000000000000000000000000000000000000000\"));\nconst MaxInt256 = ( /*#__PURE__*/_ethersproject_bignumber__WEBPACK_IMPORTED_MODULE_0__.BigNumber.from(\"0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\"));\n\n//# sourceMappingURL=bignumbers.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@ethersproject/constants/lib.esm/bignumbers.js?"); - -/***/ }), - -/***/ "./node_modules/@ethersproject/hash/lib.esm/message.js": -/*!*************************************************************!*\ - !*** ./node_modules/@ethersproject/hash/lib.esm/message.js ***! - \*************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ hashMessage: () => (/* binding */ hashMessage),\n/* harmony export */ messagePrefix: () => (/* binding */ messagePrefix)\n/* harmony export */ });\n/* harmony import */ var _ethersproject_bytes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ethersproject/bytes */ \"./node_modules/@ethersproject/bytes/lib.esm/index.js\");\n/* harmony import */ var _ethersproject_keccak256__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ethersproject/keccak256 */ \"./node_modules/@ethersproject/keccak256/lib.esm/index.js\");\n/* harmony import */ var _ethersproject_strings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ethersproject/strings */ \"./node_modules/@ethersproject/strings/lib.esm/utf8.js\");\n\n\n\nconst messagePrefix = \"\\x19Ethereum Signed Message:\\n\";\nfunction hashMessage(message) {\n if (typeof (message) === \"string\") {\n message = (0,_ethersproject_strings__WEBPACK_IMPORTED_MODULE_0__.toUtf8Bytes)(message);\n }\n return (0,_ethersproject_keccak256__WEBPACK_IMPORTED_MODULE_1__.keccak256)((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_2__.concat)([\n (0,_ethersproject_strings__WEBPACK_IMPORTED_MODULE_0__.toUtf8Bytes)(messagePrefix),\n (0,_ethersproject_strings__WEBPACK_IMPORTED_MODULE_0__.toUtf8Bytes)(String(message.length)),\n message\n ]));\n}\n//# sourceMappingURL=message.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@ethersproject/hash/lib.esm/message.js?"); - -/***/ }), - -/***/ "./node_modules/@ethersproject/keccak256/lib.esm/index.js": -/*!****************************************************************!*\ - !*** ./node_modules/@ethersproject/keccak256/lib.esm/index.js ***! - \****************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ keccak256: () => (/* binding */ keccak256)\n/* harmony export */ });\n/* harmony import */ var js_sha3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! js-sha3 */ \"./node_modules/js-sha3/src/sha3.js\");\n/* harmony import */ var js_sha3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(js_sha3__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _ethersproject_bytes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ethersproject/bytes */ \"./node_modules/@ethersproject/bytes/lib.esm/index.js\");\n\n\n\nfunction keccak256(data) {\n return '0x' + js_sha3__WEBPACK_IMPORTED_MODULE_0___default().keccak_256((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_1__.arrayify)(data));\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@ethersproject/keccak256/lib.esm/index.js?"); - -/***/ }), - -/***/ "./node_modules/@ethersproject/logger/lib.esm/_version.js": -/*!****************************************************************!*\ - !*** ./node_modules/@ethersproject/logger/lib.esm/_version.js ***! - \****************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ version: () => (/* binding */ version)\n/* harmony export */ });\nconst version = \"logger/5.7.0\";\n//# sourceMappingURL=_version.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@ethersproject/logger/lib.esm/_version.js?"); - -/***/ }), - -/***/ "./node_modules/@ethersproject/logger/lib.esm/index.js": -/*!*************************************************************!*\ - !*** ./node_modules/@ethersproject/logger/lib.esm/index.js ***! - \*************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ErrorCode: () => (/* binding */ ErrorCode),\n/* harmony export */ LogLevel: () => (/* binding */ LogLevel),\n/* harmony export */ Logger: () => (/* binding */ Logger)\n/* harmony export */ });\n/* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_version */ \"./node_modules/@ethersproject/logger/lib.esm/_version.js\");\n\nlet _permanentCensorErrors = false;\nlet _censorErrors = false;\nconst LogLevels = { debug: 1, \"default\": 2, info: 2, warning: 3, error: 4, off: 5 };\nlet _logLevel = LogLevels[\"default\"];\n\nlet _globalLogger = null;\nfunction _checkNormalize() {\n try {\n const missing = [];\n // Make sure all forms of normalization are supported\n [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].forEach((form) => {\n try {\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad normalize\");\n }\n ;\n }\n catch (error) {\n missing.push(form);\n }\n });\n if (missing.length) {\n throw new Error(\"missing \" + missing.join(\", \"));\n }\n if (String.fromCharCode(0xe9).normalize(\"NFD\") !== String.fromCharCode(0x65, 0x0301)) {\n throw new Error(\"broken implementation\");\n }\n }\n catch (error) {\n return error.message;\n }\n return null;\n}\nconst _normalizeError = _checkNormalize();\nvar LogLevel;\n(function (LogLevel) {\n LogLevel[\"DEBUG\"] = \"DEBUG\";\n LogLevel[\"INFO\"] = \"INFO\";\n LogLevel[\"WARNING\"] = \"WARNING\";\n LogLevel[\"ERROR\"] = \"ERROR\";\n LogLevel[\"OFF\"] = \"OFF\";\n})(LogLevel || (LogLevel = {}));\nvar ErrorCode;\n(function (ErrorCode) {\n ///////////////////\n // Generic Errors\n // Unknown Error\n ErrorCode[\"UNKNOWN_ERROR\"] = \"UNKNOWN_ERROR\";\n // Not Implemented\n ErrorCode[\"NOT_IMPLEMENTED\"] = \"NOT_IMPLEMENTED\";\n // Unsupported Operation\n // - operation\n ErrorCode[\"UNSUPPORTED_OPERATION\"] = \"UNSUPPORTED_OPERATION\";\n // Network Error (i.e. Ethereum Network, such as an invalid chain ID)\n // - event (\"noNetwork\" is not re-thrown in provider.ready; otherwise thrown)\n ErrorCode[\"NETWORK_ERROR\"] = \"NETWORK_ERROR\";\n // Some sort of bad response from the server\n ErrorCode[\"SERVER_ERROR\"] = \"SERVER_ERROR\";\n // Timeout\n ErrorCode[\"TIMEOUT\"] = \"TIMEOUT\";\n ///////////////////\n // Operational Errors\n // Buffer Overrun\n ErrorCode[\"BUFFER_OVERRUN\"] = \"BUFFER_OVERRUN\";\n // Numeric Fault\n // - operation: the operation being executed\n // - fault: the reason this faulted\n ErrorCode[\"NUMERIC_FAULT\"] = \"NUMERIC_FAULT\";\n ///////////////////\n // Argument Errors\n // Missing new operator to an object\n // - name: The name of the class\n ErrorCode[\"MISSING_NEW\"] = \"MISSING_NEW\";\n // Invalid argument (e.g. value is incompatible with type) to a function:\n // - argument: The argument name that was invalid\n // - value: The value of the argument\n ErrorCode[\"INVALID_ARGUMENT\"] = \"INVALID_ARGUMENT\";\n // Missing argument to a function:\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n ErrorCode[\"MISSING_ARGUMENT\"] = \"MISSING_ARGUMENT\";\n // Too many arguments\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n ErrorCode[\"UNEXPECTED_ARGUMENT\"] = \"UNEXPECTED_ARGUMENT\";\n ///////////////////\n // Blockchain Errors\n // Call exception\n // - transaction: the transaction\n // - address?: the contract address\n // - args?: The arguments passed into the function\n // - method?: The Solidity method signature\n // - errorSignature?: The EIP848 error signature\n // - errorArgs?: The EIP848 error parameters\n // - reason: The reason (only for EIP848 \"Error(string)\")\n ErrorCode[\"CALL_EXCEPTION\"] = \"CALL_EXCEPTION\";\n // Insufficient funds (< value + gasLimit * gasPrice)\n // - transaction: the transaction attempted\n ErrorCode[\"INSUFFICIENT_FUNDS\"] = \"INSUFFICIENT_FUNDS\";\n // Nonce has already been used\n // - transaction: the transaction attempted\n ErrorCode[\"NONCE_EXPIRED\"] = \"NONCE_EXPIRED\";\n // The replacement fee for the transaction is too low\n // - transaction: the transaction attempted\n ErrorCode[\"REPLACEMENT_UNDERPRICED\"] = \"REPLACEMENT_UNDERPRICED\";\n // The gas limit could not be estimated\n // - transaction: the transaction passed to estimateGas\n ErrorCode[\"UNPREDICTABLE_GAS_LIMIT\"] = \"UNPREDICTABLE_GAS_LIMIT\";\n // The transaction was replaced by one with a higher gas price\n // - reason: \"cancelled\", \"replaced\" or \"repriced\"\n // - cancelled: true if reason == \"cancelled\" or reason == \"replaced\")\n // - hash: original transaction hash\n // - replacement: the full TransactionsResponse for the replacement\n // - receipt: the receipt of the replacement\n ErrorCode[\"TRANSACTION_REPLACED\"] = \"TRANSACTION_REPLACED\";\n ///////////////////\n // Interaction Errors\n // The user rejected the action, such as signing a message or sending\n // a transaction\n ErrorCode[\"ACTION_REJECTED\"] = \"ACTION_REJECTED\";\n})(ErrorCode || (ErrorCode = {}));\n;\nconst HEX = \"0123456789abcdef\";\nclass Logger {\n constructor(version) {\n Object.defineProperty(this, \"version\", {\n enumerable: true,\n value: version,\n writable: false\n });\n }\n _log(logLevel, args) {\n const level = logLevel.toLowerCase();\n if (LogLevels[level] == null) {\n this.throwArgumentError(\"invalid log level name\", \"logLevel\", logLevel);\n }\n if (_logLevel > LogLevels[level]) {\n return;\n }\n console.log.apply(console, args);\n }\n debug(...args) {\n this._log(Logger.levels.DEBUG, args);\n }\n info(...args) {\n this._log(Logger.levels.INFO, args);\n }\n warn(...args) {\n this._log(Logger.levels.WARNING, args);\n }\n makeError(message, code, params) {\n // Errors are being censored\n if (_censorErrors) {\n return this.makeError(\"censored error\", code, {});\n }\n if (!code) {\n code = Logger.errors.UNKNOWN_ERROR;\n }\n if (!params) {\n params = {};\n }\n const messageDetails = [];\n Object.keys(params).forEach((key) => {\n const value = params[key];\n try {\n if (value instanceof Uint8Array) {\n let hex = \"\";\n for (let i = 0; i < value.length; i++) {\n hex += HEX[value[i] >> 4];\n hex += HEX[value[i] & 0x0f];\n }\n messageDetails.push(key + \"=Uint8Array(0x\" + hex + \")\");\n }\n else {\n messageDetails.push(key + \"=\" + JSON.stringify(value));\n }\n }\n catch (error) {\n messageDetails.push(key + \"=\" + JSON.stringify(params[key].toString()));\n }\n });\n messageDetails.push(`code=${code}`);\n messageDetails.push(`version=${this.version}`);\n const reason = message;\n let url = \"\";\n switch (code) {\n case ErrorCode.NUMERIC_FAULT: {\n url = \"NUMERIC_FAULT\";\n const fault = message;\n switch (fault) {\n case \"overflow\":\n case \"underflow\":\n case \"division-by-zero\":\n url += \"-\" + fault;\n break;\n case \"negative-power\":\n case \"negative-width\":\n url += \"-unsupported\";\n break;\n case \"unbound-bitwise-result\":\n url += \"-unbound-result\";\n break;\n }\n break;\n }\n case ErrorCode.CALL_EXCEPTION:\n case ErrorCode.INSUFFICIENT_FUNDS:\n case ErrorCode.MISSING_NEW:\n case ErrorCode.NONCE_EXPIRED:\n case ErrorCode.REPLACEMENT_UNDERPRICED:\n case ErrorCode.TRANSACTION_REPLACED:\n case ErrorCode.UNPREDICTABLE_GAS_LIMIT:\n url = code;\n break;\n }\n if (url) {\n message += \" [ See: https:/\\/links.ethers.org/v5-errors-\" + url + \" ]\";\n }\n if (messageDetails.length) {\n message += \" (\" + messageDetails.join(\", \") + \")\";\n }\n // @TODO: Any??\n const error = new Error(message);\n error.reason = reason;\n error.code = code;\n Object.keys(params).forEach(function (key) {\n error[key] = params[key];\n });\n return error;\n }\n throwError(message, code, params) {\n throw this.makeError(message, code, params);\n }\n throwArgumentError(message, name, value) {\n return this.throwError(message, Logger.errors.INVALID_ARGUMENT, {\n argument: name,\n value: value\n });\n }\n assert(condition, message, code, params) {\n if (!!condition) {\n return;\n }\n this.throwError(message, code, params);\n }\n assertArgument(condition, message, name, value) {\n if (!!condition) {\n return;\n }\n this.throwArgumentError(message, name, value);\n }\n checkNormalize(message) {\n if (message == null) {\n message = \"platform missing String.prototype.normalize\";\n }\n if (_normalizeError) {\n this.throwError(\"platform missing String.prototype.normalize\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"String.prototype.normalize\", form: _normalizeError\n });\n }\n }\n checkSafeUint53(value, message) {\n if (typeof (value) !== \"number\") {\n return;\n }\n if (message == null) {\n message = \"value not safe\";\n }\n if (value < 0 || value >= 0x1fffffffffffff) {\n this.throwError(message, Logger.errors.NUMERIC_FAULT, {\n operation: \"checkSafeInteger\",\n fault: \"out-of-safe-range\",\n value: value\n });\n }\n if (value % 1) {\n this.throwError(message, Logger.errors.NUMERIC_FAULT, {\n operation: \"checkSafeInteger\",\n fault: \"non-integer\",\n value: value\n });\n }\n }\n checkArgumentCount(count, expectedCount, message) {\n if (message) {\n message = \": \" + message;\n }\n else {\n message = \"\";\n }\n if (count < expectedCount) {\n this.throwError(\"missing argument\" + message, Logger.errors.MISSING_ARGUMENT, {\n count: count,\n expectedCount: expectedCount\n });\n }\n if (count > expectedCount) {\n this.throwError(\"too many arguments\" + message, Logger.errors.UNEXPECTED_ARGUMENT, {\n count: count,\n expectedCount: expectedCount\n });\n }\n }\n checkNew(target, kind) {\n if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, { name: kind.name });\n }\n }\n checkAbstract(target, kind) {\n if (target === kind) {\n this.throwError(\"cannot instantiate abstract class \" + JSON.stringify(kind.name) + \" directly; use a sub-class\", Logger.errors.UNSUPPORTED_OPERATION, { name: target.name, operation: \"new\" });\n }\n else if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, { name: kind.name });\n }\n }\n static globalLogger() {\n if (!_globalLogger) {\n _globalLogger = new Logger(_version__WEBPACK_IMPORTED_MODULE_0__.version);\n }\n return _globalLogger;\n }\n static setCensorship(censorship, permanent) {\n if (!censorship && permanent) {\n this.globalLogger().throwError(\"cannot permanently disable censorship\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\"\n });\n }\n if (_permanentCensorErrors) {\n if (!censorship) {\n return;\n }\n this.globalLogger().throwError(\"error censorship permanent\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\"\n });\n }\n _censorErrors = !!censorship;\n _permanentCensorErrors = !!permanent;\n }\n static setLogLevel(logLevel) {\n const level = LogLevels[logLevel.toLowerCase()];\n if (level == null) {\n Logger.globalLogger().warn(\"invalid log level - \" + logLevel);\n return;\n }\n _logLevel = level;\n }\n static from(version) {\n return new Logger(version);\n }\n}\nLogger.errors = ErrorCode;\nLogger.levels = LogLevel;\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@ethersproject/logger/lib.esm/index.js?"); - -/***/ }), - -/***/ "./node_modules/@ethersproject/properties/lib.esm/_version.js": -/*!********************************************************************!*\ - !*** ./node_modules/@ethersproject/properties/lib.esm/_version.js ***! - \********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ version: () => (/* binding */ version)\n/* harmony export */ });\nconst version = \"properties/5.7.0\";\n//# sourceMappingURL=_version.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@ethersproject/properties/lib.esm/_version.js?"); - -/***/ }), - -/***/ "./node_modules/@ethersproject/properties/lib.esm/index.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@ethersproject/properties/lib.esm/index.js ***! - \*****************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Description: () => (/* binding */ Description),\n/* harmony export */ checkProperties: () => (/* binding */ checkProperties),\n/* harmony export */ deepCopy: () => (/* binding */ deepCopy),\n/* harmony export */ defineReadOnly: () => (/* binding */ defineReadOnly),\n/* harmony export */ getStatic: () => (/* binding */ getStatic),\n/* harmony export */ resolveProperties: () => (/* binding */ resolveProperties),\n/* harmony export */ shallowCopy: () => (/* binding */ shallowCopy)\n/* harmony export */ });\n/* harmony import */ var _ethersproject_logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ethersproject/logger */ \"./node_modules/@ethersproject/logger/lib.esm/index.js\");\n/* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_version */ \"./node_modules/@ethersproject/properties/lib.esm/_version.js\");\n\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\nconst logger = new _ethersproject_logger__WEBPACK_IMPORTED_MODULE_0__.Logger(_version__WEBPACK_IMPORTED_MODULE_1__.version);\nfunction defineReadOnly(object, name, value) {\n Object.defineProperty(object, name, {\n enumerable: true,\n value: value,\n writable: false,\n });\n}\n// Crawl up the constructor chain to find a static method\nfunction getStatic(ctor, key) {\n for (let i = 0; i < 32; i++) {\n if (ctor[key]) {\n return ctor[key];\n }\n if (!ctor.prototype || typeof (ctor.prototype) !== \"object\") {\n break;\n }\n ctor = Object.getPrototypeOf(ctor.prototype).constructor;\n }\n return null;\n}\nfunction resolveProperties(object) {\n return __awaiter(this, void 0, void 0, function* () {\n const promises = Object.keys(object).map((key) => {\n const value = object[key];\n return Promise.resolve(value).then((v) => ({ key: key, value: v }));\n });\n const results = yield Promise.all(promises);\n return results.reduce((accum, result) => {\n accum[(result.key)] = result.value;\n return accum;\n }, {});\n });\n}\nfunction checkProperties(object, properties) {\n if (!object || typeof (object) !== \"object\") {\n logger.throwArgumentError(\"invalid object\", \"object\", object);\n }\n Object.keys(object).forEach((key) => {\n if (!properties[key]) {\n logger.throwArgumentError(\"invalid object key - \" + key, \"transaction:\" + key, object);\n }\n });\n}\nfunction shallowCopy(object) {\n const result = {};\n for (const key in object) {\n result[key] = object[key];\n }\n return result;\n}\nconst opaque = { bigint: true, boolean: true, \"function\": true, number: true, string: true };\nfunction _isFrozen(object) {\n // Opaque objects are not mutable, so safe to copy by assignment\n if (object === undefined || object === null || opaque[typeof (object)]) {\n return true;\n }\n if (Array.isArray(object) || typeof (object) === \"object\") {\n if (!Object.isFrozen(object)) {\n return false;\n }\n const keys = Object.keys(object);\n for (let i = 0; i < keys.length; i++) {\n let value = null;\n try {\n value = object[keys[i]];\n }\n catch (error) {\n // If accessing a value triggers an error, it is a getter\n // designed to do so (e.g. Result) and is therefore \"frozen\"\n continue;\n }\n if (!_isFrozen(value)) {\n return false;\n }\n }\n return true;\n }\n return logger.throwArgumentError(`Cannot deepCopy ${typeof (object)}`, \"object\", object);\n}\n// Returns a new copy of object, such that no properties may be replaced.\n// New properties may be added only to objects.\nfunction _deepCopy(object) {\n if (_isFrozen(object)) {\n return object;\n }\n // Arrays are mutable, so we need to create a copy\n if (Array.isArray(object)) {\n return Object.freeze(object.map((item) => deepCopy(item)));\n }\n if (typeof (object) === \"object\") {\n const result = {};\n for (const key in object) {\n const value = object[key];\n if (value === undefined) {\n continue;\n }\n defineReadOnly(result, key, deepCopy(value));\n }\n return result;\n }\n return logger.throwArgumentError(`Cannot deepCopy ${typeof (object)}`, \"object\", object);\n}\nfunction deepCopy(object) {\n return _deepCopy(object);\n}\nclass Description {\n constructor(info) {\n for (const key in info) {\n this[key] = deepCopy(info[key]);\n }\n }\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@ethersproject/properties/lib.esm/index.js?"); - -/***/ }), - -/***/ "./node_modules/@ethersproject/rlp/lib.esm/_version.js": -/*!*************************************************************!*\ - !*** ./node_modules/@ethersproject/rlp/lib.esm/_version.js ***! - \*************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ version: () => (/* binding */ version)\n/* harmony export */ });\nconst version = \"rlp/5.7.0\";\n//# sourceMappingURL=_version.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@ethersproject/rlp/lib.esm/_version.js?"); - -/***/ }), - -/***/ "./node_modules/@ethersproject/rlp/lib.esm/index.js": -/*!**********************************************************!*\ - !*** ./node_modules/@ethersproject/rlp/lib.esm/index.js ***! - \**********************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ decode: () => (/* binding */ decode),\n/* harmony export */ encode: () => (/* binding */ encode)\n/* harmony export */ });\n/* harmony import */ var _ethersproject_bytes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ethersproject/bytes */ \"./node_modules/@ethersproject/bytes/lib.esm/index.js\");\n/* harmony import */ var _ethersproject_logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ethersproject/logger */ \"./node_modules/@ethersproject/logger/lib.esm/index.js\");\n/* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_version */ \"./node_modules/@ethersproject/rlp/lib.esm/_version.js\");\n\n//See: https://github.com/ethereum/wiki/wiki/RLP\n\n\n\nconst logger = new _ethersproject_logger__WEBPACK_IMPORTED_MODULE_0__.Logger(_version__WEBPACK_IMPORTED_MODULE_1__.version);\nfunction arrayifyInteger(value) {\n const result = [];\n while (value) {\n result.unshift(value & 0xff);\n value >>= 8;\n }\n return result;\n}\nfunction unarrayifyInteger(data, offset, length) {\n let result = 0;\n for (let i = 0; i < length; i++) {\n result = (result * 256) + data[offset + i];\n }\n return result;\n}\nfunction _encode(object) {\n if (Array.isArray(object)) {\n let payload = [];\n object.forEach(function (child) {\n payload = payload.concat(_encode(child));\n });\n if (payload.length <= 55) {\n payload.unshift(0xc0 + payload.length);\n return payload;\n }\n const length = arrayifyInteger(payload.length);\n length.unshift(0xf7 + length.length);\n return length.concat(payload);\n }\n if (!(0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_2__.isBytesLike)(object)) {\n logger.throwArgumentError(\"RLP object must be BytesLike\", \"object\", object);\n }\n const data = Array.prototype.slice.call((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_2__.arrayify)(object));\n if (data.length === 1 && data[0] <= 0x7f) {\n return data;\n }\n else if (data.length <= 55) {\n data.unshift(0x80 + data.length);\n return data;\n }\n const length = arrayifyInteger(data.length);\n length.unshift(0xb7 + length.length);\n return length.concat(data);\n}\nfunction encode(object) {\n return (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_2__.hexlify)(_encode(object));\n}\nfunction _decodeChildren(data, offset, childOffset, length) {\n const result = [];\n while (childOffset < offset + 1 + length) {\n const decoded = _decode(data, childOffset);\n result.push(decoded.result);\n childOffset += decoded.consumed;\n if (childOffset > offset + 1 + length) {\n logger.throwError(\"child data too short\", _ethersproject_logger__WEBPACK_IMPORTED_MODULE_0__.Logger.errors.BUFFER_OVERRUN, {});\n }\n }\n return { consumed: (1 + length), result: result };\n}\n// returns { consumed: number, result: Object }\nfunction _decode(data, offset) {\n if (data.length === 0) {\n logger.throwError(\"data too short\", _ethersproject_logger__WEBPACK_IMPORTED_MODULE_0__.Logger.errors.BUFFER_OVERRUN, {});\n }\n // Array with extra length prefix\n if (data[offset] >= 0xf8) {\n const lengthLength = data[offset] - 0xf7;\n if (offset + 1 + lengthLength > data.length) {\n logger.throwError(\"data short segment too short\", _ethersproject_logger__WEBPACK_IMPORTED_MODULE_0__.Logger.errors.BUFFER_OVERRUN, {});\n }\n const length = unarrayifyInteger(data, offset + 1, lengthLength);\n if (offset + 1 + lengthLength + length > data.length) {\n logger.throwError(\"data long segment too short\", _ethersproject_logger__WEBPACK_IMPORTED_MODULE_0__.Logger.errors.BUFFER_OVERRUN, {});\n }\n return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length);\n }\n else if (data[offset] >= 0xc0) {\n const length = data[offset] - 0xc0;\n if (offset + 1 + length > data.length) {\n logger.throwError(\"data array too short\", _ethersproject_logger__WEBPACK_IMPORTED_MODULE_0__.Logger.errors.BUFFER_OVERRUN, {});\n }\n return _decodeChildren(data, offset, offset + 1, length);\n }\n else if (data[offset] >= 0xb8) {\n const lengthLength = data[offset] - 0xb7;\n if (offset + 1 + lengthLength > data.length) {\n logger.throwError(\"data array too short\", _ethersproject_logger__WEBPACK_IMPORTED_MODULE_0__.Logger.errors.BUFFER_OVERRUN, {});\n }\n const length = unarrayifyInteger(data, offset + 1, lengthLength);\n if (offset + 1 + lengthLength + length > data.length) {\n logger.throwError(\"data array too short\", _ethersproject_logger__WEBPACK_IMPORTED_MODULE_0__.Logger.errors.BUFFER_OVERRUN, {});\n }\n const result = (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_2__.hexlify)(data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length));\n return { consumed: (1 + lengthLength + length), result: result };\n }\n else if (data[offset] >= 0x80) {\n const length = data[offset] - 0x80;\n if (offset + 1 + length > data.length) {\n logger.throwError(\"data too short\", _ethersproject_logger__WEBPACK_IMPORTED_MODULE_0__.Logger.errors.BUFFER_OVERRUN, {});\n }\n const result = (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_2__.hexlify)(data.slice(offset + 1, offset + 1 + length));\n return { consumed: (1 + length), result: result };\n }\n return { consumed: 1, result: (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_2__.hexlify)(data[offset]) };\n}\nfunction decode(data) {\n const bytes = (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_2__.arrayify)(data);\n const decoded = _decode(bytes, 0);\n if (decoded.consumed !== bytes.length) {\n logger.throwArgumentError(\"invalid rlp data\", \"data\", data);\n }\n return decoded.result;\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@ethersproject/rlp/lib.esm/index.js?"); - -/***/ }), - -/***/ "./node_modules/@ethersproject/signing-key/lib.esm/_version.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@ethersproject/signing-key/lib.esm/_version.js ***! - \*********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ version: () => (/* binding */ version)\n/* harmony export */ });\nconst version = \"signing-key/5.7.0\";\n//# sourceMappingURL=_version.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@ethersproject/signing-key/lib.esm/_version.js?"); - -/***/ }), - -/***/ "./node_modules/@ethersproject/signing-key/lib.esm/elliptic.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@ethersproject/signing-key/lib.esm/elliptic.js ***! - \*********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EC: () => (/* binding */ EC$1)\n/* harmony export */ });\n/* harmony import */ var bn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\");\n/* harmony import */ var bn_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(bn_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var hash_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! hash.js */ \"./node_modules/hash.js/lib/hash.js\");\n/* harmony import */ var hash_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(hash_js__WEBPACK_IMPORTED_MODULE_1__);\n\n\n\nvar commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};\n\nfunction getDefaultExportFromCjs (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nfunction createCommonjsModule(fn, basedir, module) {\n\treturn module = {\n\t\tpath: basedir,\n\t\texports: {},\n\t\trequire: function (path, base) {\n\t\t\treturn commonjsRequire(path, (base === undefined || base === null) ? module.path : base);\n\t\t}\n\t}, fn(module, module.exports), module.exports;\n}\n\nfunction getDefaultExportFromNamespaceIfPresent (n) {\n\treturn n && Object.prototype.hasOwnProperty.call(n, 'default') ? n['default'] : n;\n}\n\nfunction getDefaultExportFromNamespaceIfNotNamed (n) {\n\treturn n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n;\n}\n\nfunction getAugmentedNamespace(n) {\n\tif (n.__esModule) return n;\n\tvar a = Object.defineProperty({}, '__esModule', {value: true});\n\tObject.keys(n).forEach(function (k) {\n\t\tvar d = Object.getOwnPropertyDescriptor(n, k);\n\t\tObject.defineProperty(a, k, d.get ? d : {\n\t\t\tenumerable: true,\n\t\t\tget: function () {\n\t\t\t\treturn n[k];\n\t\t\t}\n\t\t});\n\t});\n\treturn a;\n}\n\nfunction commonjsRequire () {\n\tthrow new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');\n}\n\nvar minimalisticAssert = assert;\n\nfunction assert(val, msg) {\n if (!val)\n throw new Error(msg || 'Assertion failed');\n}\n\nassert.equal = function assertEqual(l, r, msg) {\n if (l != r)\n throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));\n};\n\nvar utils_1 = createCommonjsModule(function (module, exports) {\n'use strict';\n\nvar utils = exports;\n\nfunction toArray(msg, enc) {\n if (Array.isArray(msg))\n return msg.slice();\n if (!msg)\n return [];\n var res = [];\n if (typeof msg !== 'string') {\n for (var i = 0; i < msg.length; i++)\n res[i] = msg[i] | 0;\n return res;\n }\n if (enc === 'hex') {\n msg = msg.replace(/[^a-z0-9]+/ig, '');\n if (msg.length % 2 !== 0)\n msg = '0' + msg;\n for (var i = 0; i < msg.length; i += 2)\n res.push(parseInt(msg[i] + msg[i + 1], 16));\n } else {\n for (var i = 0; i < msg.length; i++) {\n var c = msg.charCodeAt(i);\n var hi = c >> 8;\n var lo = c & 0xff;\n if (hi)\n res.push(hi, lo);\n else\n res.push(lo);\n }\n }\n return res;\n}\nutils.toArray = toArray;\n\nfunction zero2(word) {\n if (word.length === 1)\n return '0' + word;\n else\n return word;\n}\nutils.zero2 = zero2;\n\nfunction toHex(msg) {\n var res = '';\n for (var i = 0; i < msg.length; i++)\n res += zero2(msg[i].toString(16));\n return res;\n}\nutils.toHex = toHex;\n\nutils.encode = function encode(arr, enc) {\n if (enc === 'hex')\n return toHex(arr);\n else\n return arr;\n};\n});\n\nvar utils_1$1 = createCommonjsModule(function (module, exports) {\n'use strict';\n\nvar utils = exports;\n\n\n\n\nutils.assert = minimalisticAssert;\nutils.toArray = utils_1.toArray;\nutils.zero2 = utils_1.zero2;\nutils.toHex = utils_1.toHex;\nutils.encode = utils_1.encode;\n\n// Represent num in a w-NAF form\nfunction getNAF(num, w, bits) {\n var naf = new Array(Math.max(num.bitLength(), bits) + 1);\n naf.fill(0);\n\n var ws = 1 << (w + 1);\n var k = num.clone();\n\n for (var i = 0; i < naf.length; i++) {\n var z;\n var mod = k.andln(ws - 1);\n if (k.isOdd()) {\n if (mod > (ws >> 1) - 1)\n z = (ws >> 1) - mod;\n else\n z = mod;\n k.isubn(z);\n } else {\n z = 0;\n }\n\n naf[i] = z;\n k.iushrn(1);\n }\n\n return naf;\n}\nutils.getNAF = getNAF;\n\n// Represent k1, k2 in a Joint Sparse Form\nfunction getJSF(k1, k2) {\n var jsf = [\n [],\n [],\n ];\n\n k1 = k1.clone();\n k2 = k2.clone();\n var d1 = 0;\n var d2 = 0;\n var m8;\n while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) {\n // First phase\n var m14 = (k1.andln(3) + d1) & 3;\n var m24 = (k2.andln(3) + d2) & 3;\n if (m14 === 3)\n m14 = -1;\n if (m24 === 3)\n m24 = -1;\n var u1;\n if ((m14 & 1) === 0) {\n u1 = 0;\n } else {\n m8 = (k1.andln(7) + d1) & 7;\n if ((m8 === 3 || m8 === 5) && m24 === 2)\n u1 = -m14;\n else\n u1 = m14;\n }\n jsf[0].push(u1);\n\n var u2;\n if ((m24 & 1) === 0) {\n u2 = 0;\n } else {\n m8 = (k2.andln(7) + d2) & 7;\n if ((m8 === 3 || m8 === 5) && m14 === 2)\n u2 = -m24;\n else\n u2 = m24;\n }\n jsf[1].push(u2);\n\n // Second phase\n if (2 * d1 === u1 + 1)\n d1 = 1 - d1;\n if (2 * d2 === u2 + 1)\n d2 = 1 - d2;\n k1.iushrn(1);\n k2.iushrn(1);\n }\n\n return jsf;\n}\nutils.getJSF = getJSF;\n\nfunction cachedProperty(obj, name, computer) {\n var key = '_' + name;\n obj.prototype[name] = function cachedProperty() {\n return this[key] !== undefined ? this[key] :\n this[key] = computer.call(this);\n };\n}\nutils.cachedProperty = cachedProperty;\n\nfunction parseBytes(bytes) {\n return typeof bytes === 'string' ? utils.toArray(bytes, 'hex') :\n bytes;\n}\nutils.parseBytes = parseBytes;\n\nfunction intFromLE(bytes) {\n return new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(bytes, 'hex', 'le');\n}\nutils.intFromLE = intFromLE;\n});\n\n'use strict';\n\n\n\nvar getNAF = utils_1$1.getNAF;\nvar getJSF = utils_1$1.getJSF;\nvar assert$1 = utils_1$1.assert;\n\nfunction BaseCurve(type, conf) {\n this.type = type;\n this.p = new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(conf.p, 16);\n\n // Use Montgomery, when there is no fast reduction for the prime\n this.red = conf.prime ? bn_js__WEBPACK_IMPORTED_MODULE_0___default().red(conf.prime) : bn_js__WEBPACK_IMPORTED_MODULE_0___default().mont(this.p);\n\n // Useful for many curves\n this.zero = new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(0).toRed(this.red);\n this.one = new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(1).toRed(this.red);\n this.two = new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(2).toRed(this.red);\n\n // Curve configuration, optional\n this.n = conf.n && new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(conf.n, 16);\n this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed);\n\n // Temporary arrays\n this._wnafT1 = new Array(4);\n this._wnafT2 = new Array(4);\n this._wnafT3 = new Array(4);\n this._wnafT4 = new Array(4);\n\n this._bitLength = this.n ? this.n.bitLength() : 0;\n\n // Generalized Greg Maxwell's trick\n var adjustCount = this.n && this.p.div(this.n);\n if (!adjustCount || adjustCount.cmpn(100) > 0) {\n this.redN = null;\n } else {\n this._maxwellTrick = true;\n this.redN = this.n.toRed(this.red);\n }\n}\nvar base = BaseCurve;\n\nBaseCurve.prototype.point = function point() {\n throw new Error('Not implemented');\n};\n\nBaseCurve.prototype.validate = function validate() {\n throw new Error('Not implemented');\n};\n\nBaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) {\n assert$1(p.precomputed);\n var doubles = p._getDoubles();\n\n var naf = getNAF(k, 1, this._bitLength);\n var I = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1);\n I /= 3;\n\n // Translate into more windowed form\n var repr = [];\n var j;\n var nafW;\n for (j = 0; j < naf.length; j += doubles.step) {\n nafW = 0;\n for (var l = j + doubles.step - 1; l >= j; l--)\n nafW = (nafW << 1) + naf[l];\n repr.push(nafW);\n }\n\n var a = this.jpoint(null, null, null);\n var b = this.jpoint(null, null, null);\n for (var i = I; i > 0; i--) {\n for (j = 0; j < repr.length; j++) {\n nafW = repr[j];\n if (nafW === i)\n b = b.mixedAdd(doubles.points[j]);\n else if (nafW === -i)\n b = b.mixedAdd(doubles.points[j].neg());\n }\n a = a.add(b);\n }\n return a.toP();\n};\n\nBaseCurve.prototype._wnafMul = function _wnafMul(p, k) {\n var w = 4;\n\n // Precompute window\n var nafPoints = p._getNAFPoints(w);\n w = nafPoints.wnd;\n var wnd = nafPoints.points;\n\n // Get NAF form\n var naf = getNAF(k, w, this._bitLength);\n\n // Add `this`*(N+1) for every w-NAF index\n var acc = this.jpoint(null, null, null);\n for (var i = naf.length - 1; i >= 0; i--) {\n // Count zeroes\n for (var l = 0; i >= 0 && naf[i] === 0; i--)\n l++;\n if (i >= 0)\n l++;\n acc = acc.dblp(l);\n\n if (i < 0)\n break;\n var z = naf[i];\n assert$1(z !== 0);\n if (p.type === 'affine') {\n // J +- P\n if (z > 0)\n acc = acc.mixedAdd(wnd[(z - 1) >> 1]);\n else\n acc = acc.mixedAdd(wnd[(-z - 1) >> 1].neg());\n } else {\n // J +- J\n if (z > 0)\n acc = acc.add(wnd[(z - 1) >> 1]);\n else\n acc = acc.add(wnd[(-z - 1) >> 1].neg());\n }\n }\n return p.type === 'affine' ? acc.toP() : acc;\n};\n\nBaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW,\n points,\n coeffs,\n len,\n jacobianResult) {\n var wndWidth = this._wnafT1;\n var wnd = this._wnafT2;\n var naf = this._wnafT3;\n\n // Fill all arrays\n var max = 0;\n var i;\n var j;\n var p;\n for (i = 0; i < len; i++) {\n p = points[i];\n var nafPoints = p._getNAFPoints(defW);\n wndWidth[i] = nafPoints.wnd;\n wnd[i] = nafPoints.points;\n }\n\n // Comb small window NAFs\n for (i = len - 1; i >= 1; i -= 2) {\n var a = i - 1;\n var b = i;\n if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {\n naf[a] = getNAF(coeffs[a], wndWidth[a], this._bitLength);\n naf[b] = getNAF(coeffs[b], wndWidth[b], this._bitLength);\n max = Math.max(naf[a].length, max);\n max = Math.max(naf[b].length, max);\n continue;\n }\n\n var comb = [\n points[a], /* 1 */\n null, /* 3 */\n null, /* 5 */\n points[b], /* 7 */\n ];\n\n // Try to avoid Projective points, if possible\n if (points[a].y.cmp(points[b].y) === 0) {\n comb[1] = points[a].add(points[b]);\n comb[2] = points[a].toJ().mixedAdd(points[b].neg());\n } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) {\n comb[1] = points[a].toJ().mixedAdd(points[b]);\n comb[2] = points[a].add(points[b].neg());\n } else {\n comb[1] = points[a].toJ().mixedAdd(points[b]);\n comb[2] = points[a].toJ().mixedAdd(points[b].neg());\n }\n\n var index = [\n -3, /* -1 -1 */\n -1, /* -1 0 */\n -5, /* -1 1 */\n -7, /* 0 -1 */\n 0, /* 0 0 */\n 7, /* 0 1 */\n 5, /* 1 -1 */\n 1, /* 1 0 */\n 3, /* 1 1 */\n ];\n\n var jsf = getJSF(coeffs[a], coeffs[b]);\n max = Math.max(jsf[0].length, max);\n naf[a] = new Array(max);\n naf[b] = new Array(max);\n for (j = 0; j < max; j++) {\n var ja = jsf[0][j] | 0;\n var jb = jsf[1][j] | 0;\n\n naf[a][j] = index[(ja + 1) * 3 + (jb + 1)];\n naf[b][j] = 0;\n wnd[a] = comb;\n }\n }\n\n var acc = this.jpoint(null, null, null);\n var tmp = this._wnafT4;\n for (i = max; i >= 0; i--) {\n var k = 0;\n\n while (i >= 0) {\n var zero = true;\n for (j = 0; j < len; j++) {\n tmp[j] = naf[j][i] | 0;\n if (tmp[j] !== 0)\n zero = false;\n }\n if (!zero)\n break;\n k++;\n i--;\n }\n if (i >= 0)\n k++;\n acc = acc.dblp(k);\n if (i < 0)\n break;\n\n for (j = 0; j < len; j++) {\n var z = tmp[j];\n p;\n if (z === 0)\n continue;\n else if (z > 0)\n p = wnd[j][(z - 1) >> 1];\n else if (z < 0)\n p = wnd[j][(-z - 1) >> 1].neg();\n\n if (p.type === 'affine')\n acc = acc.mixedAdd(p);\n else\n acc = acc.add(p);\n }\n }\n // Zeroify references\n for (i = 0; i < len; i++)\n wnd[i] = null;\n\n if (jacobianResult)\n return acc;\n else\n return acc.toP();\n};\n\nfunction BasePoint(curve, type) {\n this.curve = curve;\n this.type = type;\n this.precomputed = null;\n}\nBaseCurve.BasePoint = BasePoint;\n\nBasePoint.prototype.eq = function eq(/*other*/) {\n throw new Error('Not implemented');\n};\n\nBasePoint.prototype.validate = function validate() {\n return this.curve.validate(this);\n};\n\nBaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) {\n bytes = utils_1$1.toArray(bytes, enc);\n\n var len = this.p.byteLength();\n\n // uncompressed, hybrid-odd, hybrid-even\n if ((bytes[0] === 0x04 || bytes[0] === 0x06 || bytes[0] === 0x07) &&\n bytes.length - 1 === 2 * len) {\n if (bytes[0] === 0x06)\n assert$1(bytes[bytes.length - 1] % 2 === 0);\n else if (bytes[0] === 0x07)\n assert$1(bytes[bytes.length - 1] % 2 === 1);\n\n var res = this.point(bytes.slice(1, 1 + len),\n bytes.slice(1 + len, 1 + 2 * len));\n\n return res;\n } else if ((bytes[0] === 0x02 || bytes[0] === 0x03) &&\n bytes.length - 1 === len) {\n return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03);\n }\n throw new Error('Unknown point format');\n};\n\nBasePoint.prototype.encodeCompressed = function encodeCompressed(enc) {\n return this.encode(enc, true);\n};\n\nBasePoint.prototype._encode = function _encode(compact) {\n var len = this.curve.p.byteLength();\n var x = this.getX().toArray('be', len);\n\n if (compact)\n return [ this.getY().isEven() ? 0x02 : 0x03 ].concat(x);\n\n return [ 0x04 ].concat(x, this.getY().toArray('be', len));\n};\n\nBasePoint.prototype.encode = function encode(enc, compact) {\n return utils_1$1.encode(this._encode(compact), enc);\n};\n\nBasePoint.prototype.precompute = function precompute(power) {\n if (this.precomputed)\n return this;\n\n var precomputed = {\n doubles: null,\n naf: null,\n beta: null,\n };\n precomputed.naf = this._getNAFPoints(8);\n precomputed.doubles = this._getDoubles(4, power);\n precomputed.beta = this._getBeta();\n this.precomputed = precomputed;\n\n return this;\n};\n\nBasePoint.prototype._hasDoubles = function _hasDoubles(k) {\n if (!this.precomputed)\n return false;\n\n var doubles = this.precomputed.doubles;\n if (!doubles)\n return false;\n\n return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step);\n};\n\nBasePoint.prototype._getDoubles = function _getDoubles(step, power) {\n if (this.precomputed && this.precomputed.doubles)\n return this.precomputed.doubles;\n\n var doubles = [ this ];\n var acc = this;\n for (var i = 0; i < power; i += step) {\n for (var j = 0; j < step; j++)\n acc = acc.dbl();\n doubles.push(acc);\n }\n return {\n step: step,\n points: doubles,\n };\n};\n\nBasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) {\n if (this.precomputed && this.precomputed.naf)\n return this.precomputed.naf;\n\n var res = [ this ];\n var max = (1 << wnd) - 1;\n var dbl = max === 1 ? null : this.dbl();\n for (var i = 1; i < max; i++)\n res[i] = res[i - 1].add(dbl);\n return {\n wnd: wnd,\n points: res,\n };\n};\n\nBasePoint.prototype._getBeta = function _getBeta() {\n return null;\n};\n\nBasePoint.prototype.dblp = function dblp(k) {\n var r = this;\n for (var i = 0; i < k; i++)\n r = r.dbl();\n return r;\n};\n\nvar inherits_browser = createCommonjsModule(function (module) {\nif (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor;\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function () {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n };\n}\n});\n\n'use strict';\n\n\n\n\n\n\nvar assert$2 = utils_1$1.assert;\n\nfunction ShortCurve(conf) {\n base.call(this, 'short', conf);\n\n this.a = new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(conf.a, 16).toRed(this.red);\n this.b = new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(conf.b, 16).toRed(this.red);\n this.tinv = this.two.redInvm();\n\n this.zeroA = this.a.fromRed().cmpn(0) === 0;\n this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0;\n\n // If the curve is endomorphic, precalculate beta and lambda\n this.endo = this._getEndomorphism(conf);\n this._endoWnafT1 = new Array(4);\n this._endoWnafT2 = new Array(4);\n}\ninherits_browser(ShortCurve, base);\nvar short_1 = ShortCurve;\n\nShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) {\n // No efficient endomorphism\n if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1)\n return;\n\n // Compute beta and lambda, that lambda * P = (beta * Px; Py)\n var beta;\n var lambda;\n if (conf.beta) {\n beta = new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(conf.beta, 16).toRed(this.red);\n } else {\n var betas = this._getEndoRoots(this.p);\n // Choose the smallest beta\n beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1];\n beta = beta.toRed(this.red);\n }\n if (conf.lambda) {\n lambda = new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(conf.lambda, 16);\n } else {\n // Choose the lambda that is matching selected beta\n var lambdas = this._getEndoRoots(this.n);\n if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) {\n lambda = lambdas[0];\n } else {\n lambda = lambdas[1];\n assert$2(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0);\n }\n }\n\n // Get basis vectors, used for balanced length-two representation\n var basis;\n if (conf.basis) {\n basis = conf.basis.map(function(vec) {\n return {\n a: new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(vec.a, 16),\n b: new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(vec.b, 16),\n };\n });\n } else {\n basis = this._getEndoBasis(lambda);\n }\n\n return {\n beta: beta,\n lambda: lambda,\n basis: basis,\n };\n};\n\nShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) {\n // Find roots of for x^2 + x + 1 in F\n // Root = (-1 +- Sqrt(-3)) / 2\n //\n var red = num === this.p ? this.red : bn_js__WEBPACK_IMPORTED_MODULE_0___default().mont(num);\n var tinv = new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(2).toRed(red).redInvm();\n var ntinv = tinv.redNeg();\n\n var s = new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(3).toRed(red).redNeg().redSqrt().redMul(tinv);\n\n var l1 = ntinv.redAdd(s).fromRed();\n var l2 = ntinv.redSub(s).fromRed();\n return [ l1, l2 ];\n};\n\nShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) {\n // aprxSqrt >= sqrt(this.n)\n var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2));\n\n // 3.74\n // Run EGCD, until r(L + 1) < aprxSqrt\n var u = lambda;\n var v = this.n.clone();\n var x1 = new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(1);\n var y1 = new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(0);\n var x2 = new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(0);\n var y2 = new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(1);\n\n // NOTE: all vectors are roots of: a + b * lambda = 0 (mod n)\n var a0;\n var b0;\n // First vector\n var a1;\n var b1;\n // Second vector\n var a2;\n var b2;\n\n var prevR;\n var i = 0;\n var r;\n var x;\n while (u.cmpn(0) !== 0) {\n var q = v.div(u);\n r = v.sub(q.mul(u));\n x = x2.sub(q.mul(x1));\n var y = y2.sub(q.mul(y1));\n\n if (!a1 && r.cmp(aprxSqrt) < 0) {\n a0 = prevR.neg();\n b0 = x1;\n a1 = r.neg();\n b1 = x;\n } else if (a1 && ++i === 2) {\n break;\n }\n prevR = r;\n\n v = u;\n u = r;\n x2 = x1;\n x1 = x;\n y2 = y1;\n y1 = y;\n }\n a2 = r.neg();\n b2 = x;\n\n var len1 = a1.sqr().add(b1.sqr());\n var len2 = a2.sqr().add(b2.sqr());\n if (len2.cmp(len1) >= 0) {\n a2 = a0;\n b2 = b0;\n }\n\n // Normalize signs\n if (a1.negative) {\n a1 = a1.neg();\n b1 = b1.neg();\n }\n if (a2.negative) {\n a2 = a2.neg();\n b2 = b2.neg();\n }\n\n return [\n { a: a1, b: b1 },\n { a: a2, b: b2 },\n ];\n};\n\nShortCurve.prototype._endoSplit = function _endoSplit(k) {\n var basis = this.endo.basis;\n var v1 = basis[0];\n var v2 = basis[1];\n\n var c1 = v2.b.mul(k).divRound(this.n);\n var c2 = v1.b.neg().mul(k).divRound(this.n);\n\n var p1 = c1.mul(v1.a);\n var p2 = c2.mul(v2.a);\n var q1 = c1.mul(v1.b);\n var q2 = c2.mul(v2.b);\n\n // Calculate answer\n var k1 = k.sub(p1).sub(p2);\n var k2 = q1.add(q2).neg();\n return { k1: k1, k2: k2 };\n};\n\nShortCurve.prototype.pointFromX = function pointFromX(x, odd) {\n x = new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(x, 16);\n if (!x.red)\n x = x.toRed(this.red);\n\n var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b);\n var y = y2.redSqrt();\n if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)\n throw new Error('invalid point');\n\n // XXX Is there any way to tell if the number is odd without converting it\n // to non-red form?\n var isOdd = y.fromRed().isOdd();\n if (odd && !isOdd || !odd && isOdd)\n y = y.redNeg();\n\n return this.point(x, y);\n};\n\nShortCurve.prototype.validate = function validate(point) {\n if (point.inf)\n return true;\n\n var x = point.x;\n var y = point.y;\n\n var ax = this.a.redMul(x);\n var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);\n return y.redSqr().redISub(rhs).cmpn(0) === 0;\n};\n\nShortCurve.prototype._endoWnafMulAdd =\n function _endoWnafMulAdd(points, coeffs, jacobianResult) {\n var npoints = this._endoWnafT1;\n var ncoeffs = this._endoWnafT2;\n for (var i = 0; i < points.length; i++) {\n var split = this._endoSplit(coeffs[i]);\n var p = points[i];\n var beta = p._getBeta();\n\n if (split.k1.negative) {\n split.k1.ineg();\n p = p.neg(true);\n }\n if (split.k2.negative) {\n split.k2.ineg();\n beta = beta.neg(true);\n }\n\n npoints[i * 2] = p;\n npoints[i * 2 + 1] = beta;\n ncoeffs[i * 2] = split.k1;\n ncoeffs[i * 2 + 1] = split.k2;\n }\n var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult);\n\n // Clean-up references to points and coefficients\n for (var j = 0; j < i * 2; j++) {\n npoints[j] = null;\n ncoeffs[j] = null;\n }\n return res;\n };\n\nfunction Point(curve, x, y, isRed) {\n base.BasePoint.call(this, curve, 'affine');\n if (x === null && y === null) {\n this.x = null;\n this.y = null;\n this.inf = true;\n } else {\n this.x = new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(x, 16);\n this.y = new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(y, 16);\n // Force redgomery representation when loading from JSON\n if (isRed) {\n this.x.forceRed(this.curve.red);\n this.y.forceRed(this.curve.red);\n }\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n this.inf = false;\n }\n}\ninherits_browser(Point, base.BasePoint);\n\nShortCurve.prototype.point = function point(x, y, isRed) {\n return new Point(this, x, y, isRed);\n};\n\nShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) {\n return Point.fromJSON(this, obj, red);\n};\n\nPoint.prototype._getBeta = function _getBeta() {\n if (!this.curve.endo)\n return;\n\n var pre = this.precomputed;\n if (pre && pre.beta)\n return pre.beta;\n\n var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);\n if (pre) {\n var curve = this.curve;\n var endoMul = function(p) {\n return curve.point(p.x.redMul(curve.endo.beta), p.y);\n };\n pre.beta = beta;\n beta.precomputed = {\n beta: null,\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: pre.naf.points.map(endoMul),\n },\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: pre.doubles.points.map(endoMul),\n },\n };\n }\n return beta;\n};\n\nPoint.prototype.toJSON = function toJSON() {\n if (!this.precomputed)\n return [ this.x, this.y ];\n\n return [ this.x, this.y, this.precomputed && {\n doubles: this.precomputed.doubles && {\n step: this.precomputed.doubles.step,\n points: this.precomputed.doubles.points.slice(1),\n },\n naf: this.precomputed.naf && {\n wnd: this.precomputed.naf.wnd,\n points: this.precomputed.naf.points.slice(1),\n },\n } ];\n};\n\nPoint.fromJSON = function fromJSON(curve, obj, red) {\n if (typeof obj === 'string')\n obj = JSON.parse(obj);\n var res = curve.point(obj[0], obj[1], red);\n if (!obj[2])\n return res;\n\n function obj2point(obj) {\n return curve.point(obj[0], obj[1], red);\n }\n\n var pre = obj[2];\n res.precomputed = {\n beta: null,\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: [ res ].concat(pre.doubles.points.map(obj2point)),\n },\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: [ res ].concat(pre.naf.points.map(obj2point)),\n },\n };\n return res;\n};\n\nPoint.prototype.inspect = function inspect() {\n if (this.isInfinity())\n return '';\n return '';\n};\n\nPoint.prototype.isInfinity = function isInfinity() {\n return this.inf;\n};\n\nPoint.prototype.add = function add(p) {\n // O + P = P\n if (this.inf)\n return p;\n\n // P + O = P\n if (p.inf)\n return this;\n\n // P + P = 2P\n if (this.eq(p))\n return this.dbl();\n\n // P + (-P) = O\n if (this.neg().eq(p))\n return this.curve.point(null, null);\n\n // P + Q = O\n if (this.x.cmp(p.x) === 0)\n return this.curve.point(null, null);\n\n var c = this.y.redSub(p.y);\n if (c.cmpn(0) !== 0)\n c = c.redMul(this.x.redSub(p.x).redInvm());\n var nx = c.redSqr().redISub(this.x).redISub(p.x);\n var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n return this.curve.point(nx, ny);\n};\n\nPoint.prototype.dbl = function dbl() {\n if (this.inf)\n return this;\n\n // 2P = O\n var ys1 = this.y.redAdd(this.y);\n if (ys1.cmpn(0) === 0)\n return this.curve.point(null, null);\n\n var a = this.curve.a;\n\n var x2 = this.x.redSqr();\n var dyinv = ys1.redInvm();\n var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv);\n\n var nx = c.redSqr().redISub(this.x.redAdd(this.x));\n var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n return this.curve.point(nx, ny);\n};\n\nPoint.prototype.getX = function getX() {\n return this.x.fromRed();\n};\n\nPoint.prototype.getY = function getY() {\n return this.y.fromRed();\n};\n\nPoint.prototype.mul = function mul(k) {\n k = new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(k, 16);\n if (this.isInfinity())\n return this;\n else if (this._hasDoubles(k))\n return this.curve._fixedNafMul(this, k);\n else if (this.curve.endo)\n return this.curve._endoWnafMulAdd([ this ], [ k ]);\n else\n return this.curve._wnafMul(this, k);\n};\n\nPoint.prototype.mulAdd = function mulAdd(k1, p2, k2) {\n var points = [ this, p2 ];\n var coeffs = [ k1, k2 ];\n if (this.curve.endo)\n return this.curve._endoWnafMulAdd(points, coeffs);\n else\n return this.curve._wnafMulAdd(1, points, coeffs, 2);\n};\n\nPoint.prototype.jmulAdd = function jmulAdd(k1, p2, k2) {\n var points = [ this, p2 ];\n var coeffs = [ k1, k2 ];\n if (this.curve.endo)\n return this.curve._endoWnafMulAdd(points, coeffs, true);\n else\n return this.curve._wnafMulAdd(1, points, coeffs, 2, true);\n};\n\nPoint.prototype.eq = function eq(p) {\n return this === p ||\n this.inf === p.inf &&\n (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0);\n};\n\nPoint.prototype.neg = function neg(_precompute) {\n if (this.inf)\n return this;\n\n var res = this.curve.point(this.x, this.y.redNeg());\n if (_precompute && this.precomputed) {\n var pre = this.precomputed;\n var negate = function(p) {\n return p.neg();\n };\n res.precomputed = {\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: pre.naf.points.map(negate),\n },\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: pre.doubles.points.map(negate),\n },\n };\n }\n return res;\n};\n\nPoint.prototype.toJ = function toJ() {\n if (this.inf)\n return this.curve.jpoint(null, null, null);\n\n var res = this.curve.jpoint(this.x, this.y, this.curve.one);\n return res;\n};\n\nfunction JPoint(curve, x, y, z) {\n base.BasePoint.call(this, curve, 'jacobian');\n if (x === null && y === null && z === null) {\n this.x = this.curve.one;\n this.y = this.curve.one;\n this.z = new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(0);\n } else {\n this.x = new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(x, 16);\n this.y = new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(y, 16);\n this.z = new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(z, 16);\n }\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n if (!this.z.red)\n this.z = this.z.toRed(this.curve.red);\n\n this.zOne = this.z === this.curve.one;\n}\ninherits_browser(JPoint, base.BasePoint);\n\nShortCurve.prototype.jpoint = function jpoint(x, y, z) {\n return new JPoint(this, x, y, z);\n};\n\nJPoint.prototype.toP = function toP() {\n if (this.isInfinity())\n return this.curve.point(null, null);\n\n var zinv = this.z.redInvm();\n var zinv2 = zinv.redSqr();\n var ax = this.x.redMul(zinv2);\n var ay = this.y.redMul(zinv2).redMul(zinv);\n\n return this.curve.point(ax, ay);\n};\n\nJPoint.prototype.neg = function neg() {\n return this.curve.jpoint(this.x, this.y.redNeg(), this.z);\n};\n\nJPoint.prototype.add = function add(p) {\n // O + P = P\n if (this.isInfinity())\n return p;\n\n // P + O = P\n if (p.isInfinity())\n return this;\n\n // 12M + 4S + 7A\n var pz2 = p.z.redSqr();\n var z2 = this.z.redSqr();\n var u1 = this.x.redMul(pz2);\n var u2 = p.x.redMul(z2);\n var s1 = this.y.redMul(pz2.redMul(p.z));\n var s2 = p.y.redMul(z2.redMul(this.z));\n\n var h = u1.redSub(u2);\n var r = s1.redSub(s2);\n if (h.cmpn(0) === 0) {\n if (r.cmpn(0) !== 0)\n return this.curve.jpoint(null, null, null);\n else\n return this.dbl();\n }\n\n var h2 = h.redSqr();\n var h3 = h2.redMul(h);\n var v = u1.redMul(h2);\n\n var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);\n var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));\n var nz = this.z.redMul(p.z).redMul(h);\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.mixedAdd = function mixedAdd(p) {\n // O + P = P\n if (this.isInfinity())\n return p.toJ();\n\n // P + O = P\n if (p.isInfinity())\n return this;\n\n // 8M + 3S + 7A\n var z2 = this.z.redSqr();\n var u1 = this.x;\n var u2 = p.x.redMul(z2);\n var s1 = this.y;\n var s2 = p.y.redMul(z2).redMul(this.z);\n\n var h = u1.redSub(u2);\n var r = s1.redSub(s2);\n if (h.cmpn(0) === 0) {\n if (r.cmpn(0) !== 0)\n return this.curve.jpoint(null, null, null);\n else\n return this.dbl();\n }\n\n var h2 = h.redSqr();\n var h3 = h2.redMul(h);\n var v = u1.redMul(h2);\n\n var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);\n var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));\n var nz = this.z.redMul(h);\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.dblp = function dblp(pow) {\n if (pow === 0)\n return this;\n if (this.isInfinity())\n return this;\n if (!pow)\n return this.dbl();\n\n var i;\n if (this.curve.zeroA || this.curve.threeA) {\n var r = this;\n for (i = 0; i < pow; i++)\n r = r.dbl();\n return r;\n }\n\n // 1M + 2S + 1A + N * (4S + 5M + 8A)\n // N = 1 => 6M + 6S + 9A\n var a = this.curve.a;\n var tinv = this.curve.tinv;\n\n var jx = this.x;\n var jy = this.y;\n var jz = this.z;\n var jz4 = jz.redSqr().redSqr();\n\n // Reuse results\n var jyd = jy.redAdd(jy);\n for (i = 0; i < pow; i++) {\n var jx2 = jx.redSqr();\n var jyd2 = jyd.redSqr();\n var jyd4 = jyd2.redSqr();\n var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));\n\n var t1 = jx.redMul(jyd2);\n var nx = c.redSqr().redISub(t1.redAdd(t1));\n var t2 = t1.redISub(nx);\n var dny = c.redMul(t2);\n dny = dny.redIAdd(dny).redISub(jyd4);\n var nz = jyd.redMul(jz);\n if (i + 1 < pow)\n jz4 = jz4.redMul(jyd4);\n\n jx = nx;\n jz = nz;\n jyd = dny;\n }\n\n return this.curve.jpoint(jx, jyd.redMul(tinv), jz);\n};\n\nJPoint.prototype.dbl = function dbl() {\n if (this.isInfinity())\n return this;\n\n if (this.curve.zeroA)\n return this._zeroDbl();\n else if (this.curve.threeA)\n return this._threeDbl();\n else\n return this._dbl();\n};\n\nJPoint.prototype._zeroDbl = function _zeroDbl() {\n var nx;\n var ny;\n var nz;\n // Z = 1\n if (this.zOne) {\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html\n // #doubling-mdbl-2007-bl\n // 1M + 5S + 14A\n\n // XX = X1^2\n var xx = this.x.redSqr();\n // YY = Y1^2\n var yy = this.y.redSqr();\n // YYYY = YY^2\n var yyyy = yy.redSqr();\n // S = 2 * ((X1 + YY)^2 - XX - YYYY)\n var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n s = s.redIAdd(s);\n // M = 3 * XX + a; a = 0\n var m = xx.redAdd(xx).redIAdd(xx);\n // T = M ^ 2 - 2*S\n var t = m.redSqr().redISub(s).redISub(s);\n\n // 8 * YYYY\n var yyyy8 = yyyy.redIAdd(yyyy);\n yyyy8 = yyyy8.redIAdd(yyyy8);\n yyyy8 = yyyy8.redIAdd(yyyy8);\n\n // X3 = T\n nx = t;\n // Y3 = M * (S - T) - 8 * YYYY\n ny = m.redMul(s.redISub(t)).redISub(yyyy8);\n // Z3 = 2*Y1\n nz = this.y.redAdd(this.y);\n } else {\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html\n // #doubling-dbl-2009-l\n // 2M + 5S + 13A\n\n // A = X1^2\n var a = this.x.redSqr();\n // B = Y1^2\n var b = this.y.redSqr();\n // C = B^2\n var c = b.redSqr();\n // D = 2 * ((X1 + B)^2 - A - C)\n var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c);\n d = d.redIAdd(d);\n // E = 3 * A\n var e = a.redAdd(a).redIAdd(a);\n // F = E^2\n var f = e.redSqr();\n\n // 8 * C\n var c8 = c.redIAdd(c);\n c8 = c8.redIAdd(c8);\n c8 = c8.redIAdd(c8);\n\n // X3 = F - 2 * D\n nx = f.redISub(d).redISub(d);\n // Y3 = E * (D - X3) - 8 * C\n ny = e.redMul(d.redISub(nx)).redISub(c8);\n // Z3 = 2 * Y1 * Z1\n nz = this.y.redMul(this.z);\n nz = nz.redIAdd(nz);\n }\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype._threeDbl = function _threeDbl() {\n var nx;\n var ny;\n var nz;\n // Z = 1\n if (this.zOne) {\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html\n // #doubling-mdbl-2007-bl\n // 1M + 5S + 15A\n\n // XX = X1^2\n var xx = this.x.redSqr();\n // YY = Y1^2\n var yy = this.y.redSqr();\n // YYYY = YY^2\n var yyyy = yy.redSqr();\n // S = 2 * ((X1 + YY)^2 - XX - YYYY)\n var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n s = s.redIAdd(s);\n // M = 3 * XX + a\n var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a);\n // T = M^2 - 2 * S\n var t = m.redSqr().redISub(s).redISub(s);\n // X3 = T\n nx = t;\n // Y3 = M * (S - T) - 8 * YYYY\n var yyyy8 = yyyy.redIAdd(yyyy);\n yyyy8 = yyyy8.redIAdd(yyyy8);\n yyyy8 = yyyy8.redIAdd(yyyy8);\n ny = m.redMul(s.redISub(t)).redISub(yyyy8);\n // Z3 = 2 * Y1\n nz = this.y.redAdd(this.y);\n } else {\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b\n // 3M + 5S\n\n // delta = Z1^2\n var delta = this.z.redSqr();\n // gamma = Y1^2\n var gamma = this.y.redSqr();\n // beta = X1 * gamma\n var beta = this.x.redMul(gamma);\n // alpha = 3 * (X1 - delta) * (X1 + delta)\n var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta));\n alpha = alpha.redAdd(alpha).redIAdd(alpha);\n // X3 = alpha^2 - 8 * beta\n var beta4 = beta.redIAdd(beta);\n beta4 = beta4.redIAdd(beta4);\n var beta8 = beta4.redAdd(beta4);\n nx = alpha.redSqr().redISub(beta8);\n // Z3 = (Y1 + Z1)^2 - gamma - delta\n nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);\n // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2\n var ggamma8 = gamma.redSqr();\n ggamma8 = ggamma8.redIAdd(ggamma8);\n ggamma8 = ggamma8.redIAdd(ggamma8);\n ggamma8 = ggamma8.redIAdd(ggamma8);\n ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8);\n }\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype._dbl = function _dbl() {\n var a = this.curve.a;\n\n // 4M + 6S + 10A\n var jx = this.x;\n var jy = this.y;\n var jz = this.z;\n var jz4 = jz.redSqr().redSqr();\n\n var jx2 = jx.redSqr();\n var jy2 = jy.redSqr();\n\n var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));\n\n var jxd4 = jx.redAdd(jx);\n jxd4 = jxd4.redIAdd(jxd4);\n var t1 = jxd4.redMul(jy2);\n var nx = c.redSqr().redISub(t1.redAdd(t1));\n var t2 = t1.redISub(nx);\n\n var jyd8 = jy2.redSqr();\n jyd8 = jyd8.redIAdd(jyd8);\n jyd8 = jyd8.redIAdd(jyd8);\n jyd8 = jyd8.redIAdd(jyd8);\n var ny = c.redMul(t2).redISub(jyd8);\n var nz = jy.redAdd(jy).redMul(jz);\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.trpl = function trpl() {\n if (!this.curve.zeroA)\n return this.dbl().add(this);\n\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#tripling-tpl-2007-bl\n // 5M + 10S + ...\n\n // XX = X1^2\n var xx = this.x.redSqr();\n // YY = Y1^2\n var yy = this.y.redSqr();\n // ZZ = Z1^2\n var zz = this.z.redSqr();\n // YYYY = YY^2\n var yyyy = yy.redSqr();\n // M = 3 * XX + a * ZZ2; a = 0\n var m = xx.redAdd(xx).redIAdd(xx);\n // MM = M^2\n var mm = m.redSqr();\n // E = 6 * ((X1 + YY)^2 - XX - YYYY) - MM\n var e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n e = e.redIAdd(e);\n e = e.redAdd(e).redIAdd(e);\n e = e.redISub(mm);\n // EE = E^2\n var ee = e.redSqr();\n // T = 16*YYYY\n var t = yyyy.redIAdd(yyyy);\n t = t.redIAdd(t);\n t = t.redIAdd(t);\n t = t.redIAdd(t);\n // U = (M + E)^2 - MM - EE - T\n var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t);\n // X3 = 4 * (X1 * EE - 4 * YY * U)\n var yyu4 = yy.redMul(u);\n yyu4 = yyu4.redIAdd(yyu4);\n yyu4 = yyu4.redIAdd(yyu4);\n var nx = this.x.redMul(ee).redISub(yyu4);\n nx = nx.redIAdd(nx);\n nx = nx.redIAdd(nx);\n // Y3 = 8 * Y1 * (U * (T - U) - E * EE)\n var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee)));\n ny = ny.redIAdd(ny);\n ny = ny.redIAdd(ny);\n ny = ny.redIAdd(ny);\n // Z3 = (Z1 + E)^2 - ZZ - EE\n var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee);\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.mul = function mul(k, kbase) {\n k = new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(k, kbase);\n\n return this.curve._wnafMul(this, k);\n};\n\nJPoint.prototype.eq = function eq(p) {\n if (p.type === 'affine')\n return this.eq(p.toJ());\n\n if (this === p)\n return true;\n\n // x1 * z2^2 == x2 * z1^2\n var z2 = this.z.redSqr();\n var pz2 = p.z.redSqr();\n if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0)\n return false;\n\n // y1 * z2^3 == y2 * z1^3\n var z3 = z2.redMul(this.z);\n var pz3 = pz2.redMul(p.z);\n return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0;\n};\n\nJPoint.prototype.eqXToP = function eqXToP(x) {\n var zs = this.z.redSqr();\n var rx = x.toRed(this.curve.red).redMul(zs);\n if (this.x.cmp(rx) === 0)\n return true;\n\n var xc = x.clone();\n var t = this.curve.redN.redMul(zs);\n for (;;) {\n xc.iadd(this.curve.n);\n if (xc.cmp(this.curve.p) >= 0)\n return false;\n\n rx.redIAdd(t);\n if (this.x.cmp(rx) === 0)\n return true;\n }\n};\n\nJPoint.prototype.inspect = function inspect() {\n if (this.isInfinity())\n return '';\n return '';\n};\n\nJPoint.prototype.isInfinity = function isInfinity() {\n // XXX This code assumes that zero is always zero in red\n return this.z.cmpn(0) === 0;\n};\n\nvar curve_1 = createCommonjsModule(function (module, exports) {\n'use strict';\n\nvar curve = exports;\n\ncurve.base = base;\ncurve.short = short_1;\ncurve.mont = /*RicMoo:ethers:require(./mont)*/(null);\ncurve.edwards = /*RicMoo:ethers:require(./edwards)*/(null);\n});\n\nvar curves_1 = createCommonjsModule(function (module, exports) {\n'use strict';\n\nvar curves = exports;\n\n\n\n\n\nvar assert = utils_1$1.assert;\n\nfunction PresetCurve(options) {\n if (options.type === 'short')\n this.curve = new curve_1.short(options);\n else if (options.type === 'edwards')\n this.curve = new curve_1.edwards(options);\n else\n this.curve = new curve_1.mont(options);\n this.g = this.curve.g;\n this.n = this.curve.n;\n this.hash = options.hash;\n\n assert(this.g.validate(), 'Invalid curve');\n assert(this.g.mul(this.n).isInfinity(), 'Invalid curve, G*N != O');\n}\ncurves.PresetCurve = PresetCurve;\n\nfunction defineCurve(name, options) {\n Object.defineProperty(curves, name, {\n configurable: true,\n enumerable: true,\n get: function() {\n var curve = new PresetCurve(options);\n Object.defineProperty(curves, name, {\n configurable: true,\n enumerable: true,\n value: curve,\n });\n return curve;\n },\n });\n}\n\ndefineCurve('p192', {\n type: 'short',\n prime: 'p192',\n p: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff',\n a: 'ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc',\n b: '64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1',\n n: 'ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831',\n hash: (hash_js__WEBPACK_IMPORTED_MODULE_1___default().sha256),\n gRed: false,\n g: [\n '188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012',\n '07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811',\n ],\n});\n\ndefineCurve('p224', {\n type: 'short',\n prime: 'p224',\n p: 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001',\n a: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe',\n b: 'b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4',\n n: 'ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d',\n hash: (hash_js__WEBPACK_IMPORTED_MODULE_1___default().sha256),\n gRed: false,\n g: [\n 'b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21',\n 'bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34',\n ],\n});\n\ndefineCurve('p256', {\n type: 'short',\n prime: null,\n p: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff',\n a: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc',\n b: '5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b',\n n: 'ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551',\n hash: (hash_js__WEBPACK_IMPORTED_MODULE_1___default().sha256),\n gRed: false,\n g: [\n '6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296',\n '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5',\n ],\n});\n\ndefineCurve('p384', {\n type: 'short',\n prime: null,\n p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'fffffffe ffffffff 00000000 00000000 ffffffff',\n a: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'fffffffe ffffffff 00000000 00000000 fffffffc',\n b: 'b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f ' +\n '5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef',\n n: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 ' +\n 'f4372ddf 581a0db2 48b0a77a ecec196a ccc52973',\n hash: (hash_js__WEBPACK_IMPORTED_MODULE_1___default().sha384),\n gRed: false,\n g: [\n 'aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 ' +\n '5502f25d bf55296c 3a545e38 72760ab7',\n '3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 ' +\n '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f',\n ],\n});\n\ndefineCurve('p521', {\n type: 'short',\n prime: null,\n p: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff ffffffff ffffffff ffffffff',\n a: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff ffffffff ffffffff fffffffc',\n b: '00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b ' +\n '99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd ' +\n '3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00',\n n: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 ' +\n 'f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409',\n hash: (hash_js__WEBPACK_IMPORTED_MODULE_1___default().sha512),\n gRed: false,\n g: [\n '000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 ' +\n '053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 ' +\n 'a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66',\n '00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 ' +\n '579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 ' +\n '3fad0761 353c7086 a272c240 88be9476 9fd16650',\n ],\n});\n\ndefineCurve('curve25519', {\n type: 'mont',\n prime: 'p25519',\n p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',\n a: '76d06',\n b: '1',\n n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',\n hash: (hash_js__WEBPACK_IMPORTED_MODULE_1___default().sha256),\n gRed: false,\n g: [\n '9',\n ],\n});\n\ndefineCurve('ed25519', {\n type: 'edwards',\n prime: 'p25519',\n p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',\n a: '-1',\n c: '1',\n // -121665 * (121666^(-1)) (mod P)\n d: '52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3',\n n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',\n hash: (hash_js__WEBPACK_IMPORTED_MODULE_1___default().sha256),\n gRed: false,\n g: [\n '216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a',\n\n // 4/5\n '6666666666666666666666666666666666666666666666666666666666666658',\n ],\n});\n\nvar pre;\ntry {\n pre = /*RicMoo:ethers:require(./precomputed/secp256k1)*/(null).crash();\n} catch (e) {\n pre = undefined;\n}\n\ndefineCurve('secp256k1', {\n type: 'short',\n prime: 'k256',\n p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f',\n a: '0',\n b: '7',\n n: 'ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141',\n h: '1',\n hash: (hash_js__WEBPACK_IMPORTED_MODULE_1___default().sha256),\n\n // Precomputed endomorphism\n beta: '7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee',\n lambda: '5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72',\n basis: [\n {\n a: '3086d221a7d46bcde86c90e49284eb15',\n b: '-e4437ed6010e88286f547fa90abfe4c3',\n },\n {\n a: '114ca50f7a8e2f3f657c1108d9d44cfd8',\n b: '3086d221a7d46bcde86c90e49284eb15',\n },\n ],\n\n gRed: false,\n g: [\n '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798',\n '483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8',\n pre,\n ],\n});\n});\n\n'use strict';\n\n\n\n\n\nfunction HmacDRBG(options) {\n if (!(this instanceof HmacDRBG))\n return new HmacDRBG(options);\n this.hash = options.hash;\n this.predResist = !!options.predResist;\n\n this.outLen = this.hash.outSize;\n this.minEntropy = options.minEntropy || this.hash.hmacStrength;\n\n this._reseed = null;\n this.reseedInterval = null;\n this.K = null;\n this.V = null;\n\n var entropy = utils_1.toArray(options.entropy, options.entropyEnc || 'hex');\n var nonce = utils_1.toArray(options.nonce, options.nonceEnc || 'hex');\n var pers = utils_1.toArray(options.pers, options.persEnc || 'hex');\n minimalisticAssert(entropy.length >= (this.minEntropy / 8),\n 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');\n this._init(entropy, nonce, pers);\n}\nvar hmacDrbg = HmacDRBG;\n\nHmacDRBG.prototype._init = function init(entropy, nonce, pers) {\n var seed = entropy.concat(nonce).concat(pers);\n\n this.K = new Array(this.outLen / 8);\n this.V = new Array(this.outLen / 8);\n for (var i = 0; i < this.V.length; i++) {\n this.K[i] = 0x00;\n this.V[i] = 0x01;\n }\n\n this._update(seed);\n this._reseed = 1;\n this.reseedInterval = 0x1000000000000; // 2^48\n};\n\nHmacDRBG.prototype._hmac = function hmac() {\n return new (hash_js__WEBPACK_IMPORTED_MODULE_1___default().hmac)(this.hash, this.K);\n};\n\nHmacDRBG.prototype._update = function update(seed) {\n var kmac = this._hmac()\n .update(this.V)\n .update([ 0x00 ]);\n if (seed)\n kmac = kmac.update(seed);\n this.K = kmac.digest();\n this.V = this._hmac().update(this.V).digest();\n if (!seed)\n return;\n\n this.K = this._hmac()\n .update(this.V)\n .update([ 0x01 ])\n .update(seed)\n .digest();\n this.V = this._hmac().update(this.V).digest();\n};\n\nHmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) {\n // Optional entropy enc\n if (typeof entropyEnc !== 'string') {\n addEnc = add;\n add = entropyEnc;\n entropyEnc = null;\n }\n\n entropy = utils_1.toArray(entropy, entropyEnc);\n add = utils_1.toArray(add, addEnc);\n\n minimalisticAssert(entropy.length >= (this.minEntropy / 8),\n 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');\n\n this._update(entropy.concat(add || []));\n this._reseed = 1;\n};\n\nHmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) {\n if (this._reseed > this.reseedInterval)\n throw new Error('Reseed is required');\n\n // Optional encoding\n if (typeof enc !== 'string') {\n addEnc = add;\n add = enc;\n enc = null;\n }\n\n // Optional additional data\n if (add) {\n add = utils_1.toArray(add, addEnc || 'hex');\n this._update(add);\n }\n\n var temp = [];\n while (temp.length < len) {\n this.V = this._hmac().update(this.V).digest();\n temp = temp.concat(this.V);\n }\n\n var res = temp.slice(0, len);\n this._update(add);\n this._reseed++;\n return utils_1.encode(res, enc);\n};\n\n'use strict';\n\n\n\nvar assert$3 = utils_1$1.assert;\n\nfunction KeyPair(ec, options) {\n this.ec = ec;\n this.priv = null;\n this.pub = null;\n\n // KeyPair(ec, { priv: ..., pub: ... })\n if (options.priv)\n this._importPrivate(options.priv, options.privEnc);\n if (options.pub)\n this._importPublic(options.pub, options.pubEnc);\n}\nvar key = KeyPair;\n\nKeyPair.fromPublic = function fromPublic(ec, pub, enc) {\n if (pub instanceof KeyPair)\n return pub;\n\n return new KeyPair(ec, {\n pub: pub,\n pubEnc: enc,\n });\n};\n\nKeyPair.fromPrivate = function fromPrivate(ec, priv, enc) {\n if (priv instanceof KeyPair)\n return priv;\n\n return new KeyPair(ec, {\n priv: priv,\n privEnc: enc,\n });\n};\n\nKeyPair.prototype.validate = function validate() {\n var pub = this.getPublic();\n\n if (pub.isInfinity())\n return { result: false, reason: 'Invalid public key' };\n if (!pub.validate())\n return { result: false, reason: 'Public key is not a point' };\n if (!pub.mul(this.ec.curve.n).isInfinity())\n return { result: false, reason: 'Public key * N != O' };\n\n return { result: true, reason: null };\n};\n\nKeyPair.prototype.getPublic = function getPublic(compact, enc) {\n // compact is optional argument\n if (typeof compact === 'string') {\n enc = compact;\n compact = null;\n }\n\n if (!this.pub)\n this.pub = this.ec.g.mul(this.priv);\n\n if (!enc)\n return this.pub;\n\n return this.pub.encode(enc, compact);\n};\n\nKeyPair.prototype.getPrivate = function getPrivate(enc) {\n if (enc === 'hex')\n return this.priv.toString(16, 2);\n else\n return this.priv;\n};\n\nKeyPair.prototype._importPrivate = function _importPrivate(key, enc) {\n this.priv = new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(key, enc || 16);\n\n // Ensure that the priv won't be bigger than n, otherwise we may fail\n // in fixed multiplication method\n this.priv = this.priv.umod(this.ec.curve.n);\n};\n\nKeyPair.prototype._importPublic = function _importPublic(key, enc) {\n if (key.x || key.y) {\n // Montgomery points only have an `x` coordinate.\n // Weierstrass/Edwards points on the other hand have both `x` and\n // `y` coordinates.\n if (this.ec.curve.type === 'mont') {\n assert$3(key.x, 'Need x coordinate');\n } else if (this.ec.curve.type === 'short' ||\n this.ec.curve.type === 'edwards') {\n assert$3(key.x && key.y, 'Need both x and y coordinate');\n }\n this.pub = this.ec.curve.point(key.x, key.y);\n return;\n }\n this.pub = this.ec.curve.decodePoint(key, enc);\n};\n\n// ECDH\nKeyPair.prototype.derive = function derive(pub) {\n if(!pub.validate()) {\n assert$3(pub.validate(), 'public point not validated');\n }\n return pub.mul(this.priv).getX();\n};\n\n// ECDSA\nKeyPair.prototype.sign = function sign(msg, enc, options) {\n return this.ec.sign(msg, this, enc, options);\n};\n\nKeyPair.prototype.verify = function verify(msg, signature) {\n return this.ec.verify(msg, signature, this);\n};\n\nKeyPair.prototype.inspect = function inspect() {\n return '';\n};\n\n'use strict';\n\n\n\n\nvar assert$4 = utils_1$1.assert;\n\nfunction Signature(options, enc) {\n if (options instanceof Signature)\n return options;\n\n if (this._importDER(options, enc))\n return;\n\n assert$4(options.r && options.s, 'Signature without r or s');\n this.r = new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(options.r, 16);\n this.s = new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(options.s, 16);\n if (options.recoveryParam === undefined)\n this.recoveryParam = null;\n else\n this.recoveryParam = options.recoveryParam;\n}\nvar signature = Signature;\n\nfunction Position() {\n this.place = 0;\n}\n\nfunction getLength(buf, p) {\n var initial = buf[p.place++];\n if (!(initial & 0x80)) {\n return initial;\n }\n var octetLen = initial & 0xf;\n\n // Indefinite length or overflow\n if (octetLen === 0 || octetLen > 4) {\n return false;\n }\n\n var val = 0;\n for (var i = 0, off = p.place; i < octetLen; i++, off++) {\n val <<= 8;\n val |= buf[off];\n val >>>= 0;\n }\n\n // Leading zeroes\n if (val <= 0x7f) {\n return false;\n }\n\n p.place = off;\n return val;\n}\n\nfunction rmPadding(buf) {\n var i = 0;\n var len = buf.length - 1;\n while (!buf[i] && !(buf[i + 1] & 0x80) && i < len) {\n i++;\n }\n if (i === 0) {\n return buf;\n }\n return buf.slice(i);\n}\n\nSignature.prototype._importDER = function _importDER(data, enc) {\n data = utils_1$1.toArray(data, enc);\n var p = new Position();\n if (data[p.place++] !== 0x30) {\n return false;\n }\n var len = getLength(data, p);\n if (len === false) {\n return false;\n }\n if ((len + p.place) !== data.length) {\n return false;\n }\n if (data[p.place++] !== 0x02) {\n return false;\n }\n var rlen = getLength(data, p);\n if (rlen === false) {\n return false;\n }\n var r = data.slice(p.place, rlen + p.place);\n p.place += rlen;\n if (data[p.place++] !== 0x02) {\n return false;\n }\n var slen = getLength(data, p);\n if (slen === false) {\n return false;\n }\n if (data.length !== slen + p.place) {\n return false;\n }\n var s = data.slice(p.place, slen + p.place);\n if (r[0] === 0) {\n if (r[1] & 0x80) {\n r = r.slice(1);\n } else {\n // Leading zeroes\n return false;\n }\n }\n if (s[0] === 0) {\n if (s[1] & 0x80) {\n s = s.slice(1);\n } else {\n // Leading zeroes\n return false;\n }\n }\n\n this.r = new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(r);\n this.s = new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(s);\n this.recoveryParam = null;\n\n return true;\n};\n\nfunction constructLength(arr, len) {\n if (len < 0x80) {\n arr.push(len);\n return;\n }\n var octets = 1 + (Math.log(len) / Math.LN2 >>> 3);\n arr.push(octets | 0x80);\n while (--octets) {\n arr.push((len >>> (octets << 3)) & 0xff);\n }\n arr.push(len);\n}\n\nSignature.prototype.toDER = function toDER(enc) {\n var r = this.r.toArray();\n var s = this.s.toArray();\n\n // Pad values\n if (r[0] & 0x80)\n r = [ 0 ].concat(r);\n // Pad values\n if (s[0] & 0x80)\n s = [ 0 ].concat(s);\n\n r = rmPadding(r);\n s = rmPadding(s);\n\n while (!s[0] && !(s[1] & 0x80)) {\n s = s.slice(1);\n }\n var arr = [ 0x02 ];\n constructLength(arr, r.length);\n arr = arr.concat(r);\n arr.push(0x02);\n constructLength(arr, s.length);\n var backHalf = arr.concat(s);\n var res = [ 0x30 ];\n constructLength(res, backHalf.length);\n res = res.concat(backHalf);\n return utils_1$1.encode(res, enc);\n};\n\n'use strict';\n\n\n\n\n\nvar rand = /*RicMoo:ethers:require(brorand)*/(function() { throw new Error('unsupported'); });\nvar assert$5 = utils_1$1.assert;\n\n\n\n\nfunction EC(options) {\n if (!(this instanceof EC))\n return new EC(options);\n\n // Shortcut `elliptic.ec(curve-name)`\n if (typeof options === 'string') {\n assert$5(Object.prototype.hasOwnProperty.call(curves_1, options),\n 'Unknown curve ' + options);\n\n options = curves_1[options];\n }\n\n // Shortcut for `elliptic.ec(elliptic.curves.curveName)`\n if (options instanceof curves_1.PresetCurve)\n options = { curve: options };\n\n this.curve = options.curve.curve;\n this.n = this.curve.n;\n this.nh = this.n.ushrn(1);\n this.g = this.curve.g;\n\n // Point on curve\n this.g = options.curve.g;\n this.g.precompute(options.curve.n.bitLength() + 1);\n\n // Hash for function for DRBG\n this.hash = options.hash || options.curve.hash;\n}\nvar ec = EC;\n\nEC.prototype.keyPair = function keyPair(options) {\n return new key(this, options);\n};\n\nEC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) {\n return key.fromPrivate(this, priv, enc);\n};\n\nEC.prototype.keyFromPublic = function keyFromPublic(pub, enc) {\n return key.fromPublic(this, pub, enc);\n};\n\nEC.prototype.genKeyPair = function genKeyPair(options) {\n if (!options)\n options = {};\n\n // Instantiate Hmac_DRBG\n var drbg = new hmacDrbg({\n hash: this.hash,\n pers: options.pers,\n persEnc: options.persEnc || 'utf8',\n entropy: options.entropy || rand(this.hash.hmacStrength),\n entropyEnc: options.entropy && options.entropyEnc || 'utf8',\n nonce: this.n.toArray(),\n });\n\n var bytes = this.n.byteLength();\n var ns2 = this.n.sub(new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(2));\n for (;;) {\n var priv = new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(drbg.generate(bytes));\n if (priv.cmp(ns2) > 0)\n continue;\n\n priv.iaddn(1);\n return this.keyFromPrivate(priv);\n }\n};\n\nEC.prototype._truncateToN = function _truncateToN(msg, truncOnly) {\n var delta = msg.byteLength() * 8 - this.n.bitLength();\n if (delta > 0)\n msg = msg.ushrn(delta);\n if (!truncOnly && msg.cmp(this.n) >= 0)\n return msg.sub(this.n);\n else\n return msg;\n};\n\nEC.prototype.sign = function sign(msg, key, enc, options) {\n if (typeof enc === 'object') {\n options = enc;\n enc = null;\n }\n if (!options)\n options = {};\n\n key = this.keyFromPrivate(key, enc);\n msg = this._truncateToN(new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(msg, 16));\n\n // Zero-extend key to provide enough entropy\n var bytes = this.n.byteLength();\n var bkey = key.getPrivate().toArray('be', bytes);\n\n // Zero-extend nonce to have the same byte size as N\n var nonce = msg.toArray('be', bytes);\n\n // Instantiate Hmac_DRBG\n var drbg = new hmacDrbg({\n hash: this.hash,\n entropy: bkey,\n nonce: nonce,\n pers: options.pers,\n persEnc: options.persEnc || 'utf8',\n });\n\n // Number of bytes to generate\n var ns1 = this.n.sub(new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(1));\n\n for (var iter = 0; ; iter++) {\n var k = options.k ?\n options.k(iter) :\n new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(drbg.generate(this.n.byteLength()));\n k = this._truncateToN(k, true);\n if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0)\n continue;\n\n var kp = this.g.mul(k);\n if (kp.isInfinity())\n continue;\n\n var kpX = kp.getX();\n var r = kpX.umod(this.n);\n if (r.cmpn(0) === 0)\n continue;\n\n var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));\n s = s.umod(this.n);\n if (s.cmpn(0) === 0)\n continue;\n\n var recoveryParam = (kp.getY().isOdd() ? 1 : 0) |\n (kpX.cmp(r) !== 0 ? 2 : 0);\n\n // Use complement of `s`, if it is > `n / 2`\n if (options.canonical && s.cmp(this.nh) > 0) {\n s = this.n.sub(s);\n recoveryParam ^= 1;\n }\n\n return new signature({ r: r, s: s, recoveryParam: recoveryParam });\n }\n};\n\nEC.prototype.verify = function verify(msg, signature$1, key, enc) {\n msg = this._truncateToN(new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(msg, 16));\n key = this.keyFromPublic(key, enc);\n signature$1 = new signature(signature$1, 'hex');\n\n // Perform primitive values validation\n var r = signature$1.r;\n var s = signature$1.s;\n if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0)\n return false;\n if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0)\n return false;\n\n // Validate signature\n var sinv = s.invm(this.n);\n var u1 = sinv.mul(msg).umod(this.n);\n var u2 = sinv.mul(r).umod(this.n);\n var p;\n\n if (!this.curve._maxwellTrick) {\n p = this.g.mulAdd(u1, key.getPublic(), u2);\n if (p.isInfinity())\n return false;\n\n return p.getX().umod(this.n).cmp(r) === 0;\n }\n\n // NOTE: Greg Maxwell's trick, inspired by:\n // https://git.io/vad3K\n\n p = this.g.jmulAdd(u1, key.getPublic(), u2);\n if (p.isInfinity())\n return false;\n\n // Compare `p.x` of Jacobian point with `r`,\n // this will do `p.x == r * p.z^2` instead of multiplying `p.x` by the\n // inverse of `p.z^2`\n return p.eqXToP(r);\n};\n\nEC.prototype.recoverPubKey = function(msg, signature$1, j, enc) {\n assert$5((3 & j) === j, 'The recovery param is more than two bits');\n signature$1 = new signature(signature$1, enc);\n\n var n = this.n;\n var e = new (bn_js__WEBPACK_IMPORTED_MODULE_0___default())(msg);\n var r = signature$1.r;\n var s = signature$1.s;\n\n // A set LSB signifies that the y-coordinate is odd\n var isYOdd = j & 1;\n var isSecondKey = j >> 1;\n if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey)\n throw new Error('Unable to find sencond key candinate');\n\n // 1.1. Let x = r + jn.\n if (isSecondKey)\n r = this.curve.pointFromX(r.add(this.curve.n), isYOdd);\n else\n r = this.curve.pointFromX(r, isYOdd);\n\n var rInv = signature$1.r.invm(n);\n var s1 = n.sub(e).mul(rInv).umod(n);\n var s2 = s.mul(rInv).umod(n);\n\n // 1.6.1 Compute Q = r^-1 (sR - eG)\n // Q = r^-1 (sR + -eG)\n return this.g.mulAdd(s1, r, s2);\n};\n\nEC.prototype.getKeyRecoveryParam = function(e, signature$1, Q, enc) {\n signature$1 = new signature(signature$1, enc);\n if (signature$1.recoveryParam !== null)\n return signature$1.recoveryParam;\n\n for (var i = 0; i < 4; i++) {\n var Qprime;\n try {\n Qprime = this.recoverPubKey(e, signature$1, i);\n } catch (e) {\n continue;\n }\n\n if (Qprime.eq(Q))\n return i;\n }\n throw new Error('Unable to find valid recovery factor');\n};\n\nvar elliptic_1 = createCommonjsModule(function (module, exports) {\n'use strict';\n\nvar elliptic = exports;\n\nelliptic.version = /*RicMoo:ethers*/{ version: \"6.5.4\" }.version;\nelliptic.utils = utils_1$1;\nelliptic.rand = /*RicMoo:ethers:require(brorand)*/(function() { throw new Error('unsupported'); });\nelliptic.curve = curve_1;\nelliptic.curves = curves_1;\n\n// Protocols\nelliptic.ec = ec;\nelliptic.eddsa = /*RicMoo:ethers:require(./elliptic/eddsa)*/(null);\n});\n\nvar EC$1 = elliptic_1.ec;\n\n\n//# sourceMappingURL=elliptic.js.map\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@ethersproject/signing-key/lib.esm/elliptic.js?"); - -/***/ }), - -/***/ "./node_modules/@ethersproject/signing-key/lib.esm/index.js": -/*!******************************************************************!*\ - !*** ./node_modules/@ethersproject/signing-key/lib.esm/index.js ***! - \******************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SigningKey: () => (/* binding */ SigningKey),\n/* harmony export */ computePublicKey: () => (/* binding */ computePublicKey),\n/* harmony export */ recoverPublicKey: () => (/* binding */ recoverPublicKey)\n/* harmony export */ });\n/* harmony import */ var _elliptic__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./elliptic */ \"./node_modules/@ethersproject/signing-key/lib.esm/elliptic.js\");\n/* harmony import */ var _ethersproject_bytes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ethersproject/bytes */ \"./node_modules/@ethersproject/bytes/lib.esm/index.js\");\n/* harmony import */ var _ethersproject_properties__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ethersproject/properties */ \"./node_modules/@ethersproject/properties/lib.esm/index.js\");\n/* harmony import */ var _ethersproject_logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ethersproject/logger */ \"./node_modules/@ethersproject/logger/lib.esm/index.js\");\n/* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_version */ \"./node_modules/@ethersproject/signing-key/lib.esm/_version.js\");\n\n\n\n\n\n\nconst logger = new _ethersproject_logger__WEBPACK_IMPORTED_MODULE_0__.Logger(_version__WEBPACK_IMPORTED_MODULE_1__.version);\nlet _curve = null;\nfunction getCurve() {\n if (!_curve) {\n _curve = new _elliptic__WEBPACK_IMPORTED_MODULE_2__.EC(\"secp256k1\");\n }\n return _curve;\n}\nclass SigningKey {\n constructor(privateKey) {\n (0,_ethersproject_properties__WEBPACK_IMPORTED_MODULE_3__.defineReadOnly)(this, \"curve\", \"secp256k1\");\n (0,_ethersproject_properties__WEBPACK_IMPORTED_MODULE_3__.defineReadOnly)(this, \"privateKey\", (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_4__.hexlify)(privateKey));\n if ((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_4__.hexDataLength)(this.privateKey) !== 32) {\n logger.throwArgumentError(\"invalid private key\", \"privateKey\", \"[[ REDACTED ]]\");\n }\n const keyPair = getCurve().keyFromPrivate((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_4__.arrayify)(this.privateKey));\n (0,_ethersproject_properties__WEBPACK_IMPORTED_MODULE_3__.defineReadOnly)(this, \"publicKey\", \"0x\" + keyPair.getPublic(false, \"hex\"));\n (0,_ethersproject_properties__WEBPACK_IMPORTED_MODULE_3__.defineReadOnly)(this, \"compressedPublicKey\", \"0x\" + keyPair.getPublic(true, \"hex\"));\n (0,_ethersproject_properties__WEBPACK_IMPORTED_MODULE_3__.defineReadOnly)(this, \"_isSigningKey\", true);\n }\n _addPoint(other) {\n const p0 = getCurve().keyFromPublic((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_4__.arrayify)(this.publicKey));\n const p1 = getCurve().keyFromPublic((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_4__.arrayify)(other));\n return \"0x\" + p0.pub.add(p1.pub).encodeCompressed(\"hex\");\n }\n signDigest(digest) {\n const keyPair = getCurve().keyFromPrivate((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_4__.arrayify)(this.privateKey));\n const digestBytes = (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_4__.arrayify)(digest);\n if (digestBytes.length !== 32) {\n logger.throwArgumentError(\"bad digest length\", \"digest\", digest);\n }\n const signature = keyPair.sign(digestBytes, { canonical: true });\n return (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_4__.splitSignature)({\n recoveryParam: signature.recoveryParam,\n r: (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_4__.hexZeroPad)(\"0x\" + signature.r.toString(16), 32),\n s: (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_4__.hexZeroPad)(\"0x\" + signature.s.toString(16), 32),\n });\n }\n computeSharedSecret(otherKey) {\n const keyPair = getCurve().keyFromPrivate((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_4__.arrayify)(this.privateKey));\n const otherKeyPair = getCurve().keyFromPublic((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_4__.arrayify)(computePublicKey(otherKey)));\n return (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_4__.hexZeroPad)(\"0x\" + keyPair.derive(otherKeyPair.getPublic()).toString(16), 32);\n }\n static isSigningKey(value) {\n return !!(value && value._isSigningKey);\n }\n}\nfunction recoverPublicKey(digest, signature) {\n const sig = (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_4__.splitSignature)(signature);\n const rs = { r: (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_4__.arrayify)(sig.r), s: (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_4__.arrayify)(sig.s) };\n return \"0x\" + getCurve().recoverPubKey((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_4__.arrayify)(digest), rs, sig.recoveryParam).encode(\"hex\", false);\n}\nfunction computePublicKey(key, compressed) {\n const bytes = (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_4__.arrayify)(key);\n if (bytes.length === 32) {\n const signingKey = new SigningKey(bytes);\n if (compressed) {\n return \"0x\" + getCurve().keyFromPrivate(bytes).getPublic(true, \"hex\");\n }\n return signingKey.publicKey;\n }\n else if (bytes.length === 33) {\n if (compressed) {\n return (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_4__.hexlify)(bytes);\n }\n return \"0x\" + getCurve().keyFromPublic(bytes).getPublic(false, \"hex\");\n }\n else if (bytes.length === 65) {\n if (!compressed) {\n return (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_4__.hexlify)(bytes);\n }\n return \"0x\" + getCurve().keyFromPublic(bytes).getPublic(true, \"hex\");\n }\n return logger.throwArgumentError(\"invalid public or private key\", \"key\", \"[REDACTED]\");\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@ethersproject/signing-key/lib.esm/index.js?"); - -/***/ }), - -/***/ "./node_modules/@ethersproject/strings/lib.esm/_version.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@ethersproject/strings/lib.esm/_version.js ***! - \*****************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ version: () => (/* binding */ version)\n/* harmony export */ });\nconst version = \"strings/5.7.0\";\n//# sourceMappingURL=_version.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@ethersproject/strings/lib.esm/_version.js?"); - -/***/ }), - -/***/ "./node_modules/@ethersproject/strings/lib.esm/utf8.js": -/*!*************************************************************!*\ - !*** ./node_modules/@ethersproject/strings/lib.esm/utf8.js ***! - \*************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ UnicodeNormalizationForm: () => (/* binding */ UnicodeNormalizationForm),\n/* harmony export */ Utf8ErrorFuncs: () => (/* binding */ Utf8ErrorFuncs),\n/* harmony export */ Utf8ErrorReason: () => (/* binding */ Utf8ErrorReason),\n/* harmony export */ _toEscapedUtf8String: () => (/* binding */ _toEscapedUtf8String),\n/* harmony export */ _toUtf8String: () => (/* binding */ _toUtf8String),\n/* harmony export */ toUtf8Bytes: () => (/* binding */ toUtf8Bytes),\n/* harmony export */ toUtf8CodePoints: () => (/* binding */ toUtf8CodePoints),\n/* harmony export */ toUtf8String: () => (/* binding */ toUtf8String)\n/* harmony export */ });\n/* harmony import */ var _ethersproject_bytes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ethersproject/bytes */ \"./node_modules/@ethersproject/bytes/lib.esm/index.js\");\n/* harmony import */ var _ethersproject_logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ethersproject/logger */ \"./node_modules/@ethersproject/logger/lib.esm/index.js\");\n/* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_version */ \"./node_modules/@ethersproject/strings/lib.esm/_version.js\");\n\n\n\n\nconst logger = new _ethersproject_logger__WEBPACK_IMPORTED_MODULE_0__.Logger(_version__WEBPACK_IMPORTED_MODULE_1__.version);\n///////////////////////////////\nvar UnicodeNormalizationForm;\n(function (UnicodeNormalizationForm) {\n UnicodeNormalizationForm[\"current\"] = \"\";\n UnicodeNormalizationForm[\"NFC\"] = \"NFC\";\n UnicodeNormalizationForm[\"NFD\"] = \"NFD\";\n UnicodeNormalizationForm[\"NFKC\"] = \"NFKC\";\n UnicodeNormalizationForm[\"NFKD\"] = \"NFKD\";\n})(UnicodeNormalizationForm || (UnicodeNormalizationForm = {}));\n;\nvar Utf8ErrorReason;\n(function (Utf8ErrorReason) {\n // A continuation byte was present where there was nothing to continue\n // - offset = the index the codepoint began in\n Utf8ErrorReason[\"UNEXPECTED_CONTINUE\"] = \"unexpected continuation byte\";\n // An invalid (non-continuation) byte to start a UTF-8 codepoint was found\n // - offset = the index the codepoint began in\n Utf8ErrorReason[\"BAD_PREFIX\"] = \"bad codepoint prefix\";\n // The string is too short to process the expected codepoint\n // - offset = the index the codepoint began in\n Utf8ErrorReason[\"OVERRUN\"] = \"string overrun\";\n // A missing continuation byte was expected but not found\n // - offset = the index the continuation byte was expected at\n Utf8ErrorReason[\"MISSING_CONTINUE\"] = \"missing continuation byte\";\n // The computed code point is outside the range for UTF-8\n // - offset = start of this codepoint\n // - badCodepoint = the computed codepoint; outside the UTF-8 range\n Utf8ErrorReason[\"OUT_OF_RANGE\"] = \"out of UTF-8 range\";\n // UTF-8 strings may not contain UTF-16 surrogate pairs\n // - offset = start of this codepoint\n // - badCodepoint = the computed codepoint; inside the UTF-16 surrogate range\n Utf8ErrorReason[\"UTF16_SURROGATE\"] = \"UTF-16 surrogate\";\n // The string is an overlong representation\n // - offset = start of this codepoint\n // - badCodepoint = the computed codepoint; already bounds checked\n Utf8ErrorReason[\"OVERLONG\"] = \"overlong representation\";\n})(Utf8ErrorReason || (Utf8ErrorReason = {}));\n;\nfunction errorFunc(reason, offset, bytes, output, badCodepoint) {\n return logger.throwArgumentError(`invalid codepoint at offset ${offset}; ${reason}`, \"bytes\", bytes);\n}\nfunction ignoreFunc(reason, offset, bytes, output, badCodepoint) {\n // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes\n if (reason === Utf8ErrorReason.BAD_PREFIX || reason === Utf8ErrorReason.UNEXPECTED_CONTINUE) {\n let i = 0;\n for (let o = offset + 1; o < bytes.length; o++) {\n if (bytes[o] >> 6 !== 0x02) {\n break;\n }\n i++;\n }\n return i;\n }\n // This byte runs us past the end of the string, so just jump to the end\n // (but the first byte was read already read and therefore skipped)\n if (reason === Utf8ErrorReason.OVERRUN) {\n return bytes.length - offset - 1;\n }\n // Nothing to skip\n return 0;\n}\nfunction replaceFunc(reason, offset, bytes, output, badCodepoint) {\n // Overlong representations are otherwise \"valid\" code points; just non-deistingtished\n if (reason === Utf8ErrorReason.OVERLONG) {\n output.push(badCodepoint);\n return 0;\n }\n // Put the replacement character into the output\n output.push(0xfffd);\n // Otherwise, process as if ignoring errors\n return ignoreFunc(reason, offset, bytes, output, badCodepoint);\n}\n// Common error handing strategies\nconst Utf8ErrorFuncs = Object.freeze({\n error: errorFunc,\n ignore: ignoreFunc,\n replace: replaceFunc\n});\n// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499\nfunction getUtf8CodePoints(bytes, onError) {\n if (onError == null) {\n onError = Utf8ErrorFuncs.error;\n }\n bytes = (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_2__.arrayify)(bytes);\n const result = [];\n let i = 0;\n // Invalid bytes are ignored\n while (i < bytes.length) {\n const c = bytes[i++];\n // 0xxx xxxx\n if (c >> 7 === 0) {\n result.push(c);\n continue;\n }\n // Multibyte; how many bytes left for this character?\n let extraLength = null;\n let overlongMask = null;\n // 110x xxxx 10xx xxxx\n if ((c & 0xe0) === 0xc0) {\n extraLength = 1;\n overlongMask = 0x7f;\n // 1110 xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf0) === 0xe0) {\n extraLength = 2;\n overlongMask = 0x7ff;\n // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf8) === 0xf0) {\n extraLength = 3;\n overlongMask = 0xffff;\n }\n else {\n if ((c & 0xc0) === 0x80) {\n i += onError(Utf8ErrorReason.UNEXPECTED_CONTINUE, i - 1, bytes, result);\n }\n else {\n i += onError(Utf8ErrorReason.BAD_PREFIX, i - 1, bytes, result);\n }\n continue;\n }\n // Do we have enough bytes in our data?\n if (i - 1 + extraLength >= bytes.length) {\n i += onError(Utf8ErrorReason.OVERRUN, i - 1, bytes, result);\n continue;\n }\n // Remove the length prefix from the char\n let res = c & ((1 << (8 - extraLength - 1)) - 1);\n for (let j = 0; j < extraLength; j++) {\n let nextChar = bytes[i];\n // Invalid continuation byte\n if ((nextChar & 0xc0) != 0x80) {\n i += onError(Utf8ErrorReason.MISSING_CONTINUE, i, bytes, result);\n res = null;\n break;\n }\n ;\n res = (res << 6) | (nextChar & 0x3f);\n i++;\n }\n // See above loop for invalid continuation byte\n if (res === null) {\n continue;\n }\n // Maximum code point\n if (res > 0x10ffff) {\n i += onError(Utf8ErrorReason.OUT_OF_RANGE, i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Reserved for UTF-16 surrogate halves\n if (res >= 0xd800 && res <= 0xdfff) {\n i += onError(Utf8ErrorReason.UTF16_SURROGATE, i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Check for overlong sequences (more bytes than needed)\n if (res <= overlongMask) {\n i += onError(Utf8ErrorReason.OVERLONG, i - 1 - extraLength, bytes, result, res);\n continue;\n }\n result.push(res);\n }\n return result;\n}\n// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array\nfunction toUtf8Bytes(str, form = UnicodeNormalizationForm.current) {\n if (form != UnicodeNormalizationForm.current) {\n logger.checkNormalize();\n str = str.normalize(form);\n }\n let result = [];\n for (let i = 0; i < str.length; i++) {\n const c = str.charCodeAt(i);\n if (c < 0x80) {\n result.push(c);\n }\n else if (c < 0x800) {\n result.push((c >> 6) | 0xc0);\n result.push((c & 0x3f) | 0x80);\n }\n else if ((c & 0xfc00) == 0xd800) {\n i++;\n const c2 = str.charCodeAt(i);\n if (i >= str.length || (c2 & 0xfc00) !== 0xdc00) {\n throw new Error(\"invalid utf-8 string\");\n }\n // Surrogate Pair\n const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff);\n result.push((pair >> 18) | 0xf0);\n result.push(((pair >> 12) & 0x3f) | 0x80);\n result.push(((pair >> 6) & 0x3f) | 0x80);\n result.push((pair & 0x3f) | 0x80);\n }\n else {\n result.push((c >> 12) | 0xe0);\n result.push(((c >> 6) & 0x3f) | 0x80);\n result.push((c & 0x3f) | 0x80);\n }\n }\n return (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_2__.arrayify)(result);\n}\n;\nfunction escapeChar(value) {\n const hex = (\"0000\" + value.toString(16));\n return \"\\\\u\" + hex.substring(hex.length - 4);\n}\nfunction _toEscapedUtf8String(bytes, onError) {\n return '\"' + getUtf8CodePoints(bytes, onError).map((codePoint) => {\n if (codePoint < 256) {\n switch (codePoint) {\n case 8: return \"\\\\b\";\n case 9: return \"\\\\t\";\n case 10: return \"\\\\n\";\n case 13: return \"\\\\r\";\n case 34: return \"\\\\\\\"\";\n case 92: return \"\\\\\\\\\";\n }\n if (codePoint >= 32 && codePoint < 127) {\n return String.fromCharCode(codePoint);\n }\n }\n if (codePoint <= 0xffff) {\n return escapeChar(codePoint);\n }\n codePoint -= 0x10000;\n return escapeChar(((codePoint >> 10) & 0x3ff) + 0xd800) + escapeChar((codePoint & 0x3ff) + 0xdc00);\n }).join(\"\") + '\"';\n}\nfunction _toUtf8String(codePoints) {\n return codePoints.map((codePoint) => {\n if (codePoint <= 0xffff) {\n return String.fromCharCode(codePoint);\n }\n codePoint -= 0x10000;\n return String.fromCharCode((((codePoint >> 10) & 0x3ff) + 0xd800), ((codePoint & 0x3ff) + 0xdc00));\n }).join(\"\");\n}\nfunction toUtf8String(bytes, onError) {\n return _toUtf8String(getUtf8CodePoints(bytes, onError));\n}\nfunction toUtf8CodePoints(str, form = UnicodeNormalizationForm.current) {\n return getUtf8CodePoints(toUtf8Bytes(str, form));\n}\n//# sourceMappingURL=utf8.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@ethersproject/strings/lib.esm/utf8.js?"); - -/***/ }), - -/***/ "./node_modules/@ethersproject/transactions/lib.esm/_version.js": -/*!**********************************************************************!*\ - !*** ./node_modules/@ethersproject/transactions/lib.esm/_version.js ***! - \**********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ version: () => (/* binding */ version)\n/* harmony export */ });\nconst version = \"transactions/5.7.0\";\n//# sourceMappingURL=_version.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@ethersproject/transactions/lib.esm/_version.js?"); - -/***/ }), - -/***/ "./node_modules/@ethersproject/transactions/lib.esm/index.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@ethersproject/transactions/lib.esm/index.js ***! - \*******************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TransactionTypes: () => (/* binding */ TransactionTypes),\n/* harmony export */ accessListify: () => (/* binding */ accessListify),\n/* harmony export */ computeAddress: () => (/* binding */ computeAddress),\n/* harmony export */ parse: () => (/* binding */ parse),\n/* harmony export */ recoverAddress: () => (/* binding */ recoverAddress),\n/* harmony export */ serialize: () => (/* binding */ serialize)\n/* harmony export */ });\n/* harmony import */ var _ethersproject_address__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ethersproject/address */ \"./node_modules/@ethersproject/address/lib.esm/index.js\");\n/* harmony import */ var _ethersproject_bignumber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ethersproject/bignumber */ \"./node_modules/@ethersproject/bignumber/lib.esm/bignumber.js\");\n/* harmony import */ var _ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ethersproject/bytes */ \"./node_modules/@ethersproject/bytes/lib.esm/index.js\");\n/* harmony import */ var _ethersproject_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ethersproject/constants */ \"./node_modules/@ethersproject/constants/lib.esm/bignumbers.js\");\n/* harmony import */ var _ethersproject_keccak256__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ethersproject/keccak256 */ \"./node_modules/@ethersproject/keccak256/lib.esm/index.js\");\n/* harmony import */ var _ethersproject_properties__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ethersproject/properties */ \"./node_modules/@ethersproject/properties/lib.esm/index.js\");\n/* harmony import */ var _ethersproject_rlp__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ethersproject/rlp */ \"./node_modules/@ethersproject/rlp/lib.esm/index.js\");\n/* harmony import */ var _ethersproject_signing_key__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ethersproject/signing-key */ \"./node_modules/@ethersproject/signing-key/lib.esm/index.js\");\n/* harmony import */ var _ethersproject_logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ethersproject/logger */ \"./node_modules/@ethersproject/logger/lib.esm/index.js\");\n/* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_version */ \"./node_modules/@ethersproject/transactions/lib.esm/_version.js\");\n\n\n\n\n\n\n\n\n\n\n\nconst logger = new _ethersproject_logger__WEBPACK_IMPORTED_MODULE_0__.Logger(_version__WEBPACK_IMPORTED_MODULE_1__.version);\nvar TransactionTypes;\n(function (TransactionTypes) {\n TransactionTypes[TransactionTypes[\"legacy\"] = 0] = \"legacy\";\n TransactionTypes[TransactionTypes[\"eip2930\"] = 1] = \"eip2930\";\n TransactionTypes[TransactionTypes[\"eip1559\"] = 2] = \"eip1559\";\n})(TransactionTypes || (TransactionTypes = {}));\n;\n///////////////////////////////\nfunction handleAddress(value) {\n if (value === \"0x\") {\n return null;\n }\n return (0,_ethersproject_address__WEBPACK_IMPORTED_MODULE_2__.getAddress)(value);\n}\nfunction handleNumber(value) {\n if (value === \"0x\") {\n return _ethersproject_constants__WEBPACK_IMPORTED_MODULE_3__.Zero;\n }\n return _ethersproject_bignumber__WEBPACK_IMPORTED_MODULE_4__.BigNumber.from(value);\n}\n// Legacy Transaction Fields\nconst transactionFields = [\n { name: \"nonce\", maxLength: 32, numeric: true },\n { name: \"gasPrice\", maxLength: 32, numeric: true },\n { name: \"gasLimit\", maxLength: 32, numeric: true },\n { name: \"to\", length: 20 },\n { name: \"value\", maxLength: 32, numeric: true },\n { name: \"data\" },\n];\nconst allowedTransactionKeys = {\n chainId: true, data: true, gasLimit: true, gasPrice: true, nonce: true, to: true, type: true, value: true\n};\nfunction computeAddress(key) {\n const publicKey = (0,_ethersproject_signing_key__WEBPACK_IMPORTED_MODULE_5__.computePublicKey)(key);\n return (0,_ethersproject_address__WEBPACK_IMPORTED_MODULE_2__.getAddress)((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.hexDataSlice)((0,_ethersproject_keccak256__WEBPACK_IMPORTED_MODULE_7__.keccak256)((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.hexDataSlice)(publicKey, 1)), 12));\n}\nfunction recoverAddress(digest, signature) {\n return computeAddress((0,_ethersproject_signing_key__WEBPACK_IMPORTED_MODULE_5__.recoverPublicKey)((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.arrayify)(digest), signature));\n}\nfunction formatNumber(value, name) {\n const result = (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.stripZeros)(_ethersproject_bignumber__WEBPACK_IMPORTED_MODULE_4__.BigNumber.from(value).toHexString());\n if (result.length > 32) {\n logger.throwArgumentError(\"invalid length for \" + name, (\"transaction:\" + name), value);\n }\n return result;\n}\nfunction accessSetify(addr, storageKeys) {\n return {\n address: (0,_ethersproject_address__WEBPACK_IMPORTED_MODULE_2__.getAddress)(addr),\n storageKeys: (storageKeys || []).map((storageKey, index) => {\n if ((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.hexDataLength)(storageKey) !== 32) {\n logger.throwArgumentError(\"invalid access list storageKey\", `accessList[${addr}:${index}]`, storageKey);\n }\n return storageKey.toLowerCase();\n })\n };\n}\nfunction accessListify(value) {\n if (Array.isArray(value)) {\n return value.map((set, index) => {\n if (Array.isArray(set)) {\n if (set.length > 2) {\n logger.throwArgumentError(\"access list expected to be [ address, storageKeys[] ]\", `value[${index}]`, set);\n }\n return accessSetify(set[0], set[1]);\n }\n return accessSetify(set.address, set.storageKeys);\n });\n }\n const result = Object.keys(value).map((addr) => {\n const storageKeys = value[addr].reduce((accum, storageKey) => {\n accum[storageKey] = true;\n return accum;\n }, {});\n return accessSetify(addr, Object.keys(storageKeys).sort());\n });\n result.sort((a, b) => (a.address.localeCompare(b.address)));\n return result;\n}\nfunction formatAccessList(value) {\n return accessListify(value).map((set) => [set.address, set.storageKeys]);\n}\nfunction _serializeEip1559(transaction, signature) {\n // If there is an explicit gasPrice, make sure it matches the\n // EIP-1559 fees; otherwise they may not understand what they\n // think they are setting in terms of fee.\n if (transaction.gasPrice != null) {\n const gasPrice = _ethersproject_bignumber__WEBPACK_IMPORTED_MODULE_4__.BigNumber.from(transaction.gasPrice);\n const maxFeePerGas = _ethersproject_bignumber__WEBPACK_IMPORTED_MODULE_4__.BigNumber.from(transaction.maxFeePerGas || 0);\n if (!gasPrice.eq(maxFeePerGas)) {\n logger.throwArgumentError(\"mismatch EIP-1559 gasPrice != maxFeePerGas\", \"tx\", {\n gasPrice, maxFeePerGas\n });\n }\n }\n const fields = [\n formatNumber(transaction.chainId || 0, \"chainId\"),\n formatNumber(transaction.nonce || 0, \"nonce\"),\n formatNumber(transaction.maxPriorityFeePerGas || 0, \"maxPriorityFeePerGas\"),\n formatNumber(transaction.maxFeePerGas || 0, \"maxFeePerGas\"),\n formatNumber(transaction.gasLimit || 0, \"gasLimit\"),\n ((transaction.to != null) ? (0,_ethersproject_address__WEBPACK_IMPORTED_MODULE_2__.getAddress)(transaction.to) : \"0x\"),\n formatNumber(transaction.value || 0, \"value\"),\n (transaction.data || \"0x\"),\n (formatAccessList(transaction.accessList || []))\n ];\n if (signature) {\n const sig = (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.splitSignature)(signature);\n fields.push(formatNumber(sig.recoveryParam, \"recoveryParam\"));\n fields.push((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.stripZeros)(sig.r));\n fields.push((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.stripZeros)(sig.s));\n }\n return (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.hexConcat)([\"0x02\", _ethersproject_rlp__WEBPACK_IMPORTED_MODULE_8__.encode(fields)]);\n}\nfunction _serializeEip2930(transaction, signature) {\n const fields = [\n formatNumber(transaction.chainId || 0, \"chainId\"),\n formatNumber(transaction.nonce || 0, \"nonce\"),\n formatNumber(transaction.gasPrice || 0, \"gasPrice\"),\n formatNumber(transaction.gasLimit || 0, \"gasLimit\"),\n ((transaction.to != null) ? (0,_ethersproject_address__WEBPACK_IMPORTED_MODULE_2__.getAddress)(transaction.to) : \"0x\"),\n formatNumber(transaction.value || 0, \"value\"),\n (transaction.data || \"0x\"),\n (formatAccessList(transaction.accessList || []))\n ];\n if (signature) {\n const sig = (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.splitSignature)(signature);\n fields.push(formatNumber(sig.recoveryParam, \"recoveryParam\"));\n fields.push((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.stripZeros)(sig.r));\n fields.push((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.stripZeros)(sig.s));\n }\n return (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.hexConcat)([\"0x01\", _ethersproject_rlp__WEBPACK_IMPORTED_MODULE_8__.encode(fields)]);\n}\n// Legacy Transactions and EIP-155\nfunction _serialize(transaction, signature) {\n (0,_ethersproject_properties__WEBPACK_IMPORTED_MODULE_9__.checkProperties)(transaction, allowedTransactionKeys);\n const raw = [];\n transactionFields.forEach(function (fieldInfo) {\n let value = transaction[fieldInfo.name] || ([]);\n const options = {};\n if (fieldInfo.numeric) {\n options.hexPad = \"left\";\n }\n value = (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.arrayify)((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.hexlify)(value, options));\n // Fixed-width field\n if (fieldInfo.length && value.length !== fieldInfo.length && value.length > 0) {\n logger.throwArgumentError(\"invalid length for \" + fieldInfo.name, (\"transaction:\" + fieldInfo.name), value);\n }\n // Variable-width (with a maximum)\n if (fieldInfo.maxLength) {\n value = (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.stripZeros)(value);\n if (value.length > fieldInfo.maxLength) {\n logger.throwArgumentError(\"invalid length for \" + fieldInfo.name, (\"transaction:\" + fieldInfo.name), value);\n }\n }\n raw.push((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.hexlify)(value));\n });\n let chainId = 0;\n if (transaction.chainId != null) {\n // A chainId was provided; if non-zero we'll use EIP-155\n chainId = transaction.chainId;\n if (typeof (chainId) !== \"number\") {\n logger.throwArgumentError(\"invalid transaction.chainId\", \"transaction\", transaction);\n }\n }\n else if (signature && !(0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.isBytesLike)(signature) && signature.v > 28) {\n // No chainId provided, but the signature is signing with EIP-155; derive chainId\n chainId = Math.floor((signature.v - 35) / 2);\n }\n // We have an EIP-155 transaction (chainId was specified and non-zero)\n if (chainId !== 0) {\n raw.push((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.hexlify)(chainId)); // @TODO: hexValue?\n raw.push(\"0x\");\n raw.push(\"0x\");\n }\n // Requesting an unsigned transaction\n if (!signature) {\n return _ethersproject_rlp__WEBPACK_IMPORTED_MODULE_8__.encode(raw);\n }\n // The splitSignature will ensure the transaction has a recoveryParam in the\n // case that the signTransaction function only adds a v.\n const sig = (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.splitSignature)(signature);\n // We pushed a chainId and null r, s on for hashing only; remove those\n let v = 27 + sig.recoveryParam;\n if (chainId !== 0) {\n raw.pop();\n raw.pop();\n raw.pop();\n v += chainId * 2 + 8;\n // If an EIP-155 v (directly or indirectly; maybe _vs) was provided, check it!\n if (sig.v > 28 && sig.v !== v) {\n logger.throwArgumentError(\"transaction.chainId/signature.v mismatch\", \"signature\", signature);\n }\n }\n else if (sig.v !== v) {\n logger.throwArgumentError(\"transaction.chainId/signature.v mismatch\", \"signature\", signature);\n }\n raw.push((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.hexlify)(v));\n raw.push((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.stripZeros)((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.arrayify)(sig.r)));\n raw.push((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.stripZeros)((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.arrayify)(sig.s)));\n return _ethersproject_rlp__WEBPACK_IMPORTED_MODULE_8__.encode(raw);\n}\nfunction serialize(transaction, signature) {\n // Legacy and EIP-155 Transactions\n if (transaction.type == null || transaction.type === 0) {\n if (transaction.accessList != null) {\n logger.throwArgumentError(\"untyped transactions do not support accessList; include type: 1\", \"transaction\", transaction);\n }\n return _serialize(transaction, signature);\n }\n // Typed Transactions (EIP-2718)\n switch (transaction.type) {\n case 1:\n return _serializeEip2930(transaction, signature);\n case 2:\n return _serializeEip1559(transaction, signature);\n default:\n break;\n }\n return logger.throwError(`unsupported transaction type: ${transaction.type}`, _ethersproject_logger__WEBPACK_IMPORTED_MODULE_0__.Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"serializeTransaction\",\n transactionType: transaction.type\n });\n}\nfunction _parseEipSignature(tx, fields, serialize) {\n try {\n const recid = handleNumber(fields[0]).toNumber();\n if (recid !== 0 && recid !== 1) {\n throw new Error(\"bad recid\");\n }\n tx.v = recid;\n }\n catch (error) {\n logger.throwArgumentError(\"invalid v for transaction type: 1\", \"v\", fields[0]);\n }\n tx.r = (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.hexZeroPad)(fields[1], 32);\n tx.s = (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.hexZeroPad)(fields[2], 32);\n try {\n const digest = (0,_ethersproject_keccak256__WEBPACK_IMPORTED_MODULE_7__.keccak256)(serialize(tx));\n tx.from = recoverAddress(digest, { r: tx.r, s: tx.s, recoveryParam: tx.v });\n }\n catch (error) { }\n}\nfunction _parseEip1559(payload) {\n const transaction = _ethersproject_rlp__WEBPACK_IMPORTED_MODULE_8__.decode(payload.slice(1));\n if (transaction.length !== 9 && transaction.length !== 12) {\n logger.throwArgumentError(\"invalid component count for transaction type: 2\", \"payload\", (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.hexlify)(payload));\n }\n const maxPriorityFeePerGas = handleNumber(transaction[2]);\n const maxFeePerGas = handleNumber(transaction[3]);\n const tx = {\n type: 2,\n chainId: handleNumber(transaction[0]).toNumber(),\n nonce: handleNumber(transaction[1]).toNumber(),\n maxPriorityFeePerGas: maxPriorityFeePerGas,\n maxFeePerGas: maxFeePerGas,\n gasPrice: null,\n gasLimit: handleNumber(transaction[4]),\n to: handleAddress(transaction[5]),\n value: handleNumber(transaction[6]),\n data: transaction[7],\n accessList: accessListify(transaction[8]),\n };\n // Unsigned EIP-1559 Transaction\n if (transaction.length === 9) {\n return tx;\n }\n tx.hash = (0,_ethersproject_keccak256__WEBPACK_IMPORTED_MODULE_7__.keccak256)(payload);\n _parseEipSignature(tx, transaction.slice(9), _serializeEip1559);\n return tx;\n}\nfunction _parseEip2930(payload) {\n const transaction = _ethersproject_rlp__WEBPACK_IMPORTED_MODULE_8__.decode(payload.slice(1));\n if (transaction.length !== 8 && transaction.length !== 11) {\n logger.throwArgumentError(\"invalid component count for transaction type: 1\", \"payload\", (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.hexlify)(payload));\n }\n const tx = {\n type: 1,\n chainId: handleNumber(transaction[0]).toNumber(),\n nonce: handleNumber(transaction[1]).toNumber(),\n gasPrice: handleNumber(transaction[2]),\n gasLimit: handleNumber(transaction[3]),\n to: handleAddress(transaction[4]),\n value: handleNumber(transaction[5]),\n data: transaction[6],\n accessList: accessListify(transaction[7])\n };\n // Unsigned EIP-2930 Transaction\n if (transaction.length === 8) {\n return tx;\n }\n tx.hash = (0,_ethersproject_keccak256__WEBPACK_IMPORTED_MODULE_7__.keccak256)(payload);\n _parseEipSignature(tx, transaction.slice(8), _serializeEip2930);\n return tx;\n}\n// Legacy Transactions and EIP-155\nfunction _parse(rawTransaction) {\n const transaction = _ethersproject_rlp__WEBPACK_IMPORTED_MODULE_8__.decode(rawTransaction);\n if (transaction.length !== 9 && transaction.length !== 6) {\n logger.throwArgumentError(\"invalid raw transaction\", \"rawTransaction\", rawTransaction);\n }\n const tx = {\n nonce: handleNumber(transaction[0]).toNumber(),\n gasPrice: handleNumber(transaction[1]),\n gasLimit: handleNumber(transaction[2]),\n to: handleAddress(transaction[3]),\n value: handleNumber(transaction[4]),\n data: transaction[5],\n chainId: 0\n };\n // Legacy unsigned transaction\n if (transaction.length === 6) {\n return tx;\n }\n try {\n tx.v = _ethersproject_bignumber__WEBPACK_IMPORTED_MODULE_4__.BigNumber.from(transaction[6]).toNumber();\n }\n catch (error) {\n // @TODO: What makes snese to do? The v is too big\n return tx;\n }\n tx.r = (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.hexZeroPad)(transaction[7], 32);\n tx.s = (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.hexZeroPad)(transaction[8], 32);\n if (_ethersproject_bignumber__WEBPACK_IMPORTED_MODULE_4__.BigNumber.from(tx.r).isZero() && _ethersproject_bignumber__WEBPACK_IMPORTED_MODULE_4__.BigNumber.from(tx.s).isZero()) {\n // EIP-155 unsigned transaction\n tx.chainId = tx.v;\n tx.v = 0;\n }\n else {\n // Signed Transaction\n tx.chainId = Math.floor((tx.v - 35) / 2);\n if (tx.chainId < 0) {\n tx.chainId = 0;\n }\n let recoveryParam = tx.v - 27;\n const raw = transaction.slice(0, 6);\n if (tx.chainId !== 0) {\n raw.push((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.hexlify)(tx.chainId));\n raw.push(\"0x\");\n raw.push(\"0x\");\n recoveryParam -= tx.chainId * 2 + 8;\n }\n const digest = (0,_ethersproject_keccak256__WEBPACK_IMPORTED_MODULE_7__.keccak256)(_ethersproject_rlp__WEBPACK_IMPORTED_MODULE_8__.encode(raw));\n try {\n tx.from = recoverAddress(digest, { r: (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.hexlify)(tx.r), s: (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.hexlify)(tx.s), recoveryParam: recoveryParam });\n }\n catch (error) { }\n tx.hash = (0,_ethersproject_keccak256__WEBPACK_IMPORTED_MODULE_7__.keccak256)(rawTransaction);\n }\n tx.type = null;\n return tx;\n}\nfunction parse(rawTransaction) {\n const payload = (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_6__.arrayify)(rawTransaction);\n // Legacy and EIP-155 Transactions\n if (payload[0] > 0x7f) {\n return _parse(payload);\n }\n // Typed Transaction (EIP-2718)\n switch (payload[0]) {\n case 1:\n return _parseEip2930(payload);\n case 2:\n return _parseEip1559(payload);\n default:\n break;\n }\n return logger.throwError(`unsupported transaction type: ${payload[0]}`, _ethersproject_logger__WEBPACK_IMPORTED_MODULE_0__.Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"parseTransaction\",\n transactionType: payload[0]\n });\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@ethersproject/transactions/lib.esm/index.js?"); - -/***/ }), - -/***/ "./node_modules/@stablelib/binary/lib/binary.js": -/*!******************************************************!*\ - !*** ./node_modules/@stablelib/binary/lib/binary.js ***! - \******************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\n// Copyright (C) 2016 Dmitry Chestnykh\n// MIT License. See LICENSE file for details.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n/**\n * Package binary provides functions for encoding and decoding numbers in byte arrays.\n */\nvar int_1 = __webpack_require__(/*! @stablelib/int */ \"./node_modules/@stablelib/int/lib/int.js\");\n// TODO(dchest): add asserts for correct value ranges and array offsets.\n/**\n * Reads 2 bytes from array starting at offset as big-endian\n * signed 16-bit integer and returns it.\n */\nfunction readInt16BE(array, offset) {\n if (offset === void 0) { offset = 0; }\n return (((array[offset + 0] << 8) | array[offset + 1]) << 16) >> 16;\n}\nexports.readInt16BE = readInt16BE;\n/**\n * Reads 2 bytes from array starting at offset as big-endian\n * unsigned 16-bit integer and returns it.\n */\nfunction readUint16BE(array, offset) {\n if (offset === void 0) { offset = 0; }\n return ((array[offset + 0] << 8) | array[offset + 1]) >>> 0;\n}\nexports.readUint16BE = readUint16BE;\n/**\n * Reads 2 bytes from array starting at offset as little-endian\n * signed 16-bit integer and returns it.\n */\nfunction readInt16LE(array, offset) {\n if (offset === void 0) { offset = 0; }\n return (((array[offset + 1] << 8) | array[offset]) << 16) >> 16;\n}\nexports.readInt16LE = readInt16LE;\n/**\n * Reads 2 bytes from array starting at offset as little-endian\n * unsigned 16-bit integer and returns it.\n */\nfunction readUint16LE(array, offset) {\n if (offset === void 0) { offset = 0; }\n return ((array[offset + 1] << 8) | array[offset]) >>> 0;\n}\nexports.readUint16LE = readUint16LE;\n/**\n * Writes 2-byte big-endian representation of 16-bit unsigned\n * value to byte array starting at offset.\n *\n * If byte array is not given, creates a new 2-byte one.\n *\n * Returns the output byte array.\n */\nfunction writeUint16BE(value, out, offset) {\n if (out === void 0) { out = new Uint8Array(2); }\n if (offset === void 0) { offset = 0; }\n out[offset + 0] = value >>> 8;\n out[offset + 1] = value >>> 0;\n return out;\n}\nexports.writeUint16BE = writeUint16BE;\nexports.writeInt16BE = writeUint16BE;\n/**\n * Writes 2-byte little-endian representation of 16-bit unsigned\n * value to array starting at offset.\n *\n * If byte array is not given, creates a new 2-byte one.\n *\n * Returns the output byte array.\n */\nfunction writeUint16LE(value, out, offset) {\n if (out === void 0) { out = new Uint8Array(2); }\n if (offset === void 0) { offset = 0; }\n out[offset + 0] = value >>> 0;\n out[offset + 1] = value >>> 8;\n return out;\n}\nexports.writeUint16LE = writeUint16LE;\nexports.writeInt16LE = writeUint16LE;\n/**\n * Reads 4 bytes from array starting at offset as big-endian\n * signed 32-bit integer and returns it.\n */\nfunction readInt32BE(array, offset) {\n if (offset === void 0) { offset = 0; }\n return (array[offset] << 24) |\n (array[offset + 1] << 16) |\n (array[offset + 2] << 8) |\n array[offset + 3];\n}\nexports.readInt32BE = readInt32BE;\n/**\n * Reads 4 bytes from array starting at offset as big-endian\n * unsigned 32-bit integer and returns it.\n */\nfunction readUint32BE(array, offset) {\n if (offset === void 0) { offset = 0; }\n return ((array[offset] << 24) |\n (array[offset + 1] << 16) |\n (array[offset + 2] << 8) |\n array[offset + 3]) >>> 0;\n}\nexports.readUint32BE = readUint32BE;\n/**\n * Reads 4 bytes from array starting at offset as little-endian\n * signed 32-bit integer and returns it.\n */\nfunction readInt32LE(array, offset) {\n if (offset === void 0) { offset = 0; }\n return (array[offset + 3] << 24) |\n (array[offset + 2] << 16) |\n (array[offset + 1] << 8) |\n array[offset];\n}\nexports.readInt32LE = readInt32LE;\n/**\n * Reads 4 bytes from array starting at offset as little-endian\n * unsigned 32-bit integer and returns it.\n */\nfunction readUint32LE(array, offset) {\n if (offset === void 0) { offset = 0; }\n return ((array[offset + 3] << 24) |\n (array[offset + 2] << 16) |\n (array[offset + 1] << 8) |\n array[offset]) >>> 0;\n}\nexports.readUint32LE = readUint32LE;\n/**\n * Writes 4-byte big-endian representation of 32-bit unsigned\n * value to byte array starting at offset.\n *\n * If byte array is not given, creates a new 4-byte one.\n *\n * Returns the output byte array.\n */\nfunction writeUint32BE(value, out, offset) {\n if (out === void 0) { out = new Uint8Array(4); }\n if (offset === void 0) { offset = 0; }\n out[offset + 0] = value >>> 24;\n out[offset + 1] = value >>> 16;\n out[offset + 2] = value >>> 8;\n out[offset + 3] = value >>> 0;\n return out;\n}\nexports.writeUint32BE = writeUint32BE;\nexports.writeInt32BE = writeUint32BE;\n/**\n * Writes 4-byte little-endian representation of 32-bit unsigned\n * value to array starting at offset.\n *\n * If byte array is not given, creates a new 4-byte one.\n *\n * Returns the output byte array.\n */\nfunction writeUint32LE(value, out, offset) {\n if (out === void 0) { out = new Uint8Array(4); }\n if (offset === void 0) { offset = 0; }\n out[offset + 0] = value >>> 0;\n out[offset + 1] = value >>> 8;\n out[offset + 2] = value >>> 16;\n out[offset + 3] = value >>> 24;\n return out;\n}\nexports.writeUint32LE = writeUint32LE;\nexports.writeInt32LE = writeUint32LE;\n/**\n * Reads 8 bytes from array starting at offset as big-endian\n * signed 64-bit integer and returns it.\n *\n * IMPORTANT: due to JavaScript limitation, supports exact\n * numbers in range -9007199254740991 to 9007199254740991.\n * If the number stored in the byte array is outside this range,\n * the result is not exact.\n */\nfunction readInt64BE(array, offset) {\n if (offset === void 0) { offset = 0; }\n var hi = readInt32BE(array, offset);\n var lo = readInt32BE(array, offset + 4);\n return hi * 0x100000000 + lo - ((lo >> 31) * 0x100000000);\n}\nexports.readInt64BE = readInt64BE;\n/**\n * Reads 8 bytes from array starting at offset as big-endian\n * unsigned 64-bit integer and returns it.\n *\n * IMPORTANT: due to JavaScript limitation, supports values up to 2^53-1.\n */\nfunction readUint64BE(array, offset) {\n if (offset === void 0) { offset = 0; }\n var hi = readUint32BE(array, offset);\n var lo = readUint32BE(array, offset + 4);\n return hi * 0x100000000 + lo;\n}\nexports.readUint64BE = readUint64BE;\n/**\n * Reads 8 bytes from array starting at offset as little-endian\n * signed 64-bit integer and returns it.\n *\n * IMPORTANT: due to JavaScript limitation, supports exact\n * numbers in range -9007199254740991 to 9007199254740991.\n * If the number stored in the byte array is outside this range,\n * the result is not exact.\n */\nfunction readInt64LE(array, offset) {\n if (offset === void 0) { offset = 0; }\n var lo = readInt32LE(array, offset);\n var hi = readInt32LE(array, offset + 4);\n return hi * 0x100000000 + lo - ((lo >> 31) * 0x100000000);\n}\nexports.readInt64LE = readInt64LE;\n/**\n * Reads 8 bytes from array starting at offset as little-endian\n * unsigned 64-bit integer and returns it.\n *\n * IMPORTANT: due to JavaScript limitation, supports values up to 2^53-1.\n */\nfunction readUint64LE(array, offset) {\n if (offset === void 0) { offset = 0; }\n var lo = readUint32LE(array, offset);\n var hi = readUint32LE(array, offset + 4);\n return hi * 0x100000000 + lo;\n}\nexports.readUint64LE = readUint64LE;\n/**\n * Writes 8-byte big-endian representation of 64-bit unsigned\n * value to byte array starting at offset.\n *\n * Due to JavaScript limitation, supports values up to 2^53-1.\n *\n * If byte array is not given, creates a new 8-byte one.\n *\n * Returns the output byte array.\n */\nfunction writeUint64BE(value, out, offset) {\n if (out === void 0) { out = new Uint8Array(8); }\n if (offset === void 0) { offset = 0; }\n writeUint32BE(value / 0x100000000 >>> 0, out, offset);\n writeUint32BE(value >>> 0, out, offset + 4);\n return out;\n}\nexports.writeUint64BE = writeUint64BE;\nexports.writeInt64BE = writeUint64BE;\n/**\n * Writes 8-byte little-endian representation of 64-bit unsigned\n * value to byte array starting at offset.\n *\n * Due to JavaScript limitation, supports values up to 2^53-1.\n *\n * If byte array is not given, creates a new 8-byte one.\n *\n * Returns the output byte array.\n */\nfunction writeUint64LE(value, out, offset) {\n if (out === void 0) { out = new Uint8Array(8); }\n if (offset === void 0) { offset = 0; }\n writeUint32LE(value >>> 0, out, offset);\n writeUint32LE(value / 0x100000000 >>> 0, out, offset + 4);\n return out;\n}\nexports.writeUint64LE = writeUint64LE;\nexports.writeInt64LE = writeUint64LE;\n/**\n * Reads bytes from array starting at offset as big-endian\n * unsigned bitLen-bit integer and returns it.\n *\n * Supports bit lengths divisible by 8, up to 48.\n */\nfunction readUintBE(bitLength, array, offset) {\n if (offset === void 0) { offset = 0; }\n // TODO(dchest): implement support for bitLengths non-divisible by 8\n if (bitLength % 8 !== 0) {\n throw new Error(\"readUintBE supports only bitLengths divisible by 8\");\n }\n if (bitLength / 8 > array.length - offset) {\n throw new Error(\"readUintBE: array is too short for the given bitLength\");\n }\n var result = 0;\n var mul = 1;\n for (var i = bitLength / 8 + offset - 1; i >= offset; i--) {\n result += array[i] * mul;\n mul *= 256;\n }\n return result;\n}\nexports.readUintBE = readUintBE;\n/**\n * Reads bytes from array starting at offset as little-endian\n * unsigned bitLen-bit integer and returns it.\n *\n * Supports bit lengths divisible by 8, up to 48.\n */\nfunction readUintLE(bitLength, array, offset) {\n if (offset === void 0) { offset = 0; }\n // TODO(dchest): implement support for bitLengths non-divisible by 8\n if (bitLength % 8 !== 0) {\n throw new Error(\"readUintLE supports only bitLengths divisible by 8\");\n }\n if (bitLength / 8 > array.length - offset) {\n throw new Error(\"readUintLE: array is too short for the given bitLength\");\n }\n var result = 0;\n var mul = 1;\n for (var i = offset; i < offset + bitLength / 8; i++) {\n result += array[i] * mul;\n mul *= 256;\n }\n return result;\n}\nexports.readUintLE = readUintLE;\n/**\n * Writes a big-endian representation of bitLen-bit unsigned\n * value to array starting at offset.\n *\n * Supports bit lengths divisible by 8, up to 48.\n *\n * If byte array is not given, creates a new one.\n *\n * Returns the output byte array.\n */\nfunction writeUintBE(bitLength, value, out, offset) {\n if (out === void 0) { out = new Uint8Array(bitLength / 8); }\n if (offset === void 0) { offset = 0; }\n // TODO(dchest): implement support for bitLengths non-divisible by 8\n if (bitLength % 8 !== 0) {\n throw new Error(\"writeUintBE supports only bitLengths divisible by 8\");\n }\n if (!int_1.isSafeInteger(value)) {\n throw new Error(\"writeUintBE value must be an integer\");\n }\n var div = 1;\n for (var i = bitLength / 8 + offset - 1; i >= offset; i--) {\n out[i] = (value / div) & 0xff;\n div *= 256;\n }\n return out;\n}\nexports.writeUintBE = writeUintBE;\n/**\n * Writes a little-endian representation of bitLen-bit unsigned\n * value to array starting at offset.\n *\n * Supports bit lengths divisible by 8, up to 48.\n *\n * If byte array is not given, creates a new one.\n *\n * Returns the output byte array.\n */\nfunction writeUintLE(bitLength, value, out, offset) {\n if (out === void 0) { out = new Uint8Array(bitLength / 8); }\n if (offset === void 0) { offset = 0; }\n // TODO(dchest): implement support for bitLengths non-divisible by 8\n if (bitLength % 8 !== 0) {\n throw new Error(\"writeUintLE supports only bitLengths divisible by 8\");\n }\n if (!int_1.isSafeInteger(value)) {\n throw new Error(\"writeUintLE value must be an integer\");\n }\n var div = 1;\n for (var i = offset; i < offset + bitLength / 8; i++) {\n out[i] = (value / div) & 0xff;\n div *= 256;\n }\n return out;\n}\nexports.writeUintLE = writeUintLE;\n/**\n * Reads 4 bytes from array starting at offset as big-endian\n * 32-bit floating-point number and returns it.\n */\nfunction readFloat32BE(array, offset) {\n if (offset === void 0) { offset = 0; }\n var view = new DataView(array.buffer, array.byteOffset, array.byteLength);\n return view.getFloat32(offset);\n}\nexports.readFloat32BE = readFloat32BE;\n/**\n * Reads 4 bytes from array starting at offset as little-endian\n * 32-bit floating-point number and returns it.\n */\nfunction readFloat32LE(array, offset) {\n if (offset === void 0) { offset = 0; }\n var view = new DataView(array.buffer, array.byteOffset, array.byteLength);\n return view.getFloat32(offset, true);\n}\nexports.readFloat32LE = readFloat32LE;\n/**\n * Reads 8 bytes from array starting at offset as big-endian\n * 64-bit floating-point number (\"double\") and returns it.\n */\nfunction readFloat64BE(array, offset) {\n if (offset === void 0) { offset = 0; }\n var view = new DataView(array.buffer, array.byteOffset, array.byteLength);\n return view.getFloat64(offset);\n}\nexports.readFloat64BE = readFloat64BE;\n/**\n * Reads 8 bytes from array starting at offset as little-endian\n * 64-bit floating-point number (\"double\") and returns it.\n */\nfunction readFloat64LE(array, offset) {\n if (offset === void 0) { offset = 0; }\n var view = new DataView(array.buffer, array.byteOffset, array.byteLength);\n return view.getFloat64(offset, true);\n}\nexports.readFloat64LE = readFloat64LE;\n/**\n * Writes 4-byte big-endian floating-point representation of value\n * to byte array starting at offset.\n *\n * If byte array is not given, creates a new 4-byte one.\n *\n * Returns the output byte array.\n */\nfunction writeFloat32BE(value, out, offset) {\n if (out === void 0) { out = new Uint8Array(4); }\n if (offset === void 0) { offset = 0; }\n var view = new DataView(out.buffer, out.byteOffset, out.byteLength);\n view.setFloat32(offset, value);\n return out;\n}\nexports.writeFloat32BE = writeFloat32BE;\n/**\n * Writes 4-byte little-endian floating-point representation of value\n * to byte array starting at offset.\n *\n * If byte array is not given, creates a new 4-byte one.\n *\n * Returns the output byte array.\n */\nfunction writeFloat32LE(value, out, offset) {\n if (out === void 0) { out = new Uint8Array(4); }\n if (offset === void 0) { offset = 0; }\n var view = new DataView(out.buffer, out.byteOffset, out.byteLength);\n view.setFloat32(offset, value, true);\n return out;\n}\nexports.writeFloat32LE = writeFloat32LE;\n/**\n * Writes 8-byte big-endian floating-point representation of value\n * to byte array starting at offset.\n *\n * If byte array is not given, creates a new 8-byte one.\n *\n * Returns the output byte array.\n */\nfunction writeFloat64BE(value, out, offset) {\n if (out === void 0) { out = new Uint8Array(8); }\n if (offset === void 0) { offset = 0; }\n var view = new DataView(out.buffer, out.byteOffset, out.byteLength);\n view.setFloat64(offset, value);\n return out;\n}\nexports.writeFloat64BE = writeFloat64BE;\n/**\n * Writes 8-byte little-endian floating-point representation of value\n * to byte array starting at offset.\n *\n * If byte array is not given, creates a new 8-byte one.\n *\n * Returns the output byte array.\n */\nfunction writeFloat64LE(value, out, offset) {\n if (out === void 0) { out = new Uint8Array(8); }\n if (offset === void 0) { offset = 0; }\n var view = new DataView(out.buffer, out.byteOffset, out.byteLength);\n view.setFloat64(offset, value, true);\n return out;\n}\nexports.writeFloat64LE = writeFloat64LE;\n//# sourceMappingURL=binary.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@stablelib/binary/lib/binary.js?"); - -/***/ }), - -/***/ "./node_modules/@stablelib/chacha/lib/chacha.js": -/*!******************************************************!*\ - !*** ./node_modules/@stablelib/chacha/lib/chacha.js ***! - \******************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\n// Copyright (C) 2016 Dmitry Chestnykh\n// MIT License. See LICENSE file for details.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n/**\n * Package chacha implements ChaCha stream cipher.\n */\nvar binary_1 = __webpack_require__(/*! @stablelib/binary */ \"./node_modules/@stablelib/binary/lib/binary.js\");\nvar wipe_1 = __webpack_require__(/*! @stablelib/wipe */ \"./node_modules/@stablelib/wipe/lib/wipe.js\");\n// Number of ChaCha rounds (ChaCha20).\nvar ROUNDS = 20;\n// Applies the ChaCha core function to 16-byte input,\n// 32-byte key key, and puts the result into 64-byte array out.\nfunction core(out, input, key) {\n var j0 = 0x61707865; // \"expa\" -- ChaCha's \"sigma\" constant\n var j1 = 0x3320646E; // \"nd 3\" for 32-byte keys\n var j2 = 0x79622D32; // \"2-by\"\n var j3 = 0x6B206574; // \"te k\"\n var j4 = (key[3] << 24) | (key[2] << 16) | (key[1] << 8) | key[0];\n var j5 = (key[7] << 24) | (key[6] << 16) | (key[5] << 8) | key[4];\n var j6 = (key[11] << 24) | (key[10] << 16) | (key[9] << 8) | key[8];\n var j7 = (key[15] << 24) | (key[14] << 16) | (key[13] << 8) | key[12];\n var j8 = (key[19] << 24) | (key[18] << 16) | (key[17] << 8) | key[16];\n var j9 = (key[23] << 24) | (key[22] << 16) | (key[21] << 8) | key[20];\n var j10 = (key[27] << 24) | (key[26] << 16) | (key[25] << 8) | key[24];\n var j11 = (key[31] << 24) | (key[30] << 16) | (key[29] << 8) | key[28];\n var j12 = (input[3] << 24) | (input[2] << 16) | (input[1] << 8) | input[0];\n var j13 = (input[7] << 24) | (input[6] << 16) | (input[5] << 8) | input[4];\n var j14 = (input[11] << 24) | (input[10] << 16) | (input[9] << 8) | input[8];\n var j15 = (input[15] << 24) | (input[14] << 16) | (input[13] << 8) | input[12];\n var x0 = j0;\n var x1 = j1;\n var x2 = j2;\n var x3 = j3;\n var x4 = j4;\n var x5 = j5;\n var x6 = j6;\n var x7 = j7;\n var x8 = j8;\n var x9 = j9;\n var x10 = j10;\n var x11 = j11;\n var x12 = j12;\n var x13 = j13;\n var x14 = j14;\n var x15 = j15;\n for (var i = 0; i < ROUNDS; i += 2) {\n x0 = x0 + x4 | 0;\n x12 ^= x0;\n x12 = x12 >>> (32 - 16) | x12 << 16;\n x8 = x8 + x12 | 0;\n x4 ^= x8;\n x4 = x4 >>> (32 - 12) | x4 << 12;\n x1 = x1 + x5 | 0;\n x13 ^= x1;\n x13 = x13 >>> (32 - 16) | x13 << 16;\n x9 = x9 + x13 | 0;\n x5 ^= x9;\n x5 = x5 >>> (32 - 12) | x5 << 12;\n x2 = x2 + x6 | 0;\n x14 ^= x2;\n x14 = x14 >>> (32 - 16) | x14 << 16;\n x10 = x10 + x14 | 0;\n x6 ^= x10;\n x6 = x6 >>> (32 - 12) | x6 << 12;\n x3 = x3 + x7 | 0;\n x15 ^= x3;\n x15 = x15 >>> (32 - 16) | x15 << 16;\n x11 = x11 + x15 | 0;\n x7 ^= x11;\n x7 = x7 >>> (32 - 12) | x7 << 12;\n x2 = x2 + x6 | 0;\n x14 ^= x2;\n x14 = x14 >>> (32 - 8) | x14 << 8;\n x10 = x10 + x14 | 0;\n x6 ^= x10;\n x6 = x6 >>> (32 - 7) | x6 << 7;\n x3 = x3 + x7 | 0;\n x15 ^= x3;\n x15 = x15 >>> (32 - 8) | x15 << 8;\n x11 = x11 + x15 | 0;\n x7 ^= x11;\n x7 = x7 >>> (32 - 7) | x7 << 7;\n x1 = x1 + x5 | 0;\n x13 ^= x1;\n x13 = x13 >>> (32 - 8) | x13 << 8;\n x9 = x9 + x13 | 0;\n x5 ^= x9;\n x5 = x5 >>> (32 - 7) | x5 << 7;\n x0 = x0 + x4 | 0;\n x12 ^= x0;\n x12 = x12 >>> (32 - 8) | x12 << 8;\n x8 = x8 + x12 | 0;\n x4 ^= x8;\n x4 = x4 >>> (32 - 7) | x4 << 7;\n x0 = x0 + x5 | 0;\n x15 ^= x0;\n x15 = x15 >>> (32 - 16) | x15 << 16;\n x10 = x10 + x15 | 0;\n x5 ^= x10;\n x5 = x5 >>> (32 - 12) | x5 << 12;\n x1 = x1 + x6 | 0;\n x12 ^= x1;\n x12 = x12 >>> (32 - 16) | x12 << 16;\n x11 = x11 + x12 | 0;\n x6 ^= x11;\n x6 = x6 >>> (32 - 12) | x6 << 12;\n x2 = x2 + x7 | 0;\n x13 ^= x2;\n x13 = x13 >>> (32 - 16) | x13 << 16;\n x8 = x8 + x13 | 0;\n x7 ^= x8;\n x7 = x7 >>> (32 - 12) | x7 << 12;\n x3 = x3 + x4 | 0;\n x14 ^= x3;\n x14 = x14 >>> (32 - 16) | x14 << 16;\n x9 = x9 + x14 | 0;\n x4 ^= x9;\n x4 = x4 >>> (32 - 12) | x4 << 12;\n x2 = x2 + x7 | 0;\n x13 ^= x2;\n x13 = x13 >>> (32 - 8) | x13 << 8;\n x8 = x8 + x13 | 0;\n x7 ^= x8;\n x7 = x7 >>> (32 - 7) | x7 << 7;\n x3 = x3 + x4 | 0;\n x14 ^= x3;\n x14 = x14 >>> (32 - 8) | x14 << 8;\n x9 = x9 + x14 | 0;\n x4 ^= x9;\n x4 = x4 >>> (32 - 7) | x4 << 7;\n x1 = x1 + x6 | 0;\n x12 ^= x1;\n x12 = x12 >>> (32 - 8) | x12 << 8;\n x11 = x11 + x12 | 0;\n x6 ^= x11;\n x6 = x6 >>> (32 - 7) | x6 << 7;\n x0 = x0 + x5 | 0;\n x15 ^= x0;\n x15 = x15 >>> (32 - 8) | x15 << 8;\n x10 = x10 + x15 | 0;\n x5 ^= x10;\n x5 = x5 >>> (32 - 7) | x5 << 7;\n }\n binary_1.writeUint32LE(x0 + j0 | 0, out, 0);\n binary_1.writeUint32LE(x1 + j1 | 0, out, 4);\n binary_1.writeUint32LE(x2 + j2 | 0, out, 8);\n binary_1.writeUint32LE(x3 + j3 | 0, out, 12);\n binary_1.writeUint32LE(x4 + j4 | 0, out, 16);\n binary_1.writeUint32LE(x5 + j5 | 0, out, 20);\n binary_1.writeUint32LE(x6 + j6 | 0, out, 24);\n binary_1.writeUint32LE(x7 + j7 | 0, out, 28);\n binary_1.writeUint32LE(x8 + j8 | 0, out, 32);\n binary_1.writeUint32LE(x9 + j9 | 0, out, 36);\n binary_1.writeUint32LE(x10 + j10 | 0, out, 40);\n binary_1.writeUint32LE(x11 + j11 | 0, out, 44);\n binary_1.writeUint32LE(x12 + j12 | 0, out, 48);\n binary_1.writeUint32LE(x13 + j13 | 0, out, 52);\n binary_1.writeUint32LE(x14 + j14 | 0, out, 56);\n binary_1.writeUint32LE(x15 + j15 | 0, out, 60);\n}\n/**\n * Encrypt src with ChaCha20 stream generated for the given 32-byte key and\n * 8-byte (as in original implementation) or 12-byte (as in RFC7539) nonce and\n * write the result into dst and return it.\n *\n * dst and src may be the same, but otherwise must not overlap.\n *\n * If nonce is 12 bytes, users should not encrypt more than 256 GiB with the\n * same key and nonce, otherwise the stream will repeat. The function will\n * throw error if counter overflows to prevent this.\n *\n * If nonce is 8 bytes, the output is practically unlimited (2^70 bytes, which\n * is more than a million petabytes). However, it is not recommended to\n * generate 8-byte nonces randomly, as the chance of collision is high.\n *\n * Never use the same key and nonce to encrypt more than one message.\n *\n * If nonceInplaceCounterLength is not 0, the nonce is assumed to be a 16-byte\n * array with stream counter in first nonceInplaceCounterLength bytes and nonce\n * in the last remaining bytes. The counter will be incremented inplace for\n * each ChaCha block. This is useful if you need to encrypt one stream of data\n * in chunks.\n */\nfunction streamXOR(key, nonce, src, dst, nonceInplaceCounterLength) {\n if (nonceInplaceCounterLength === void 0) { nonceInplaceCounterLength = 0; }\n // We only support 256-bit keys.\n if (key.length !== 32) {\n throw new Error(\"ChaCha: key size must be 32 bytes\");\n }\n if (dst.length < src.length) {\n throw new Error(\"ChaCha: destination is shorter than source\");\n }\n var nc;\n var counterLength;\n if (nonceInplaceCounterLength === 0) {\n if (nonce.length !== 8 && nonce.length !== 12) {\n throw new Error(\"ChaCha nonce must be 8 or 12 bytes\");\n }\n nc = new Uint8Array(16);\n // First counterLength bytes of nc are counter, starting with zero.\n counterLength = nc.length - nonce.length;\n // Last bytes of nc after counterLength are nonce, set them.\n nc.set(nonce, counterLength);\n }\n else {\n if (nonce.length !== 16) {\n throw new Error(\"ChaCha nonce with counter must be 16 bytes\");\n }\n // This will update passed nonce with counter inplace.\n nc = nonce;\n counterLength = nonceInplaceCounterLength;\n }\n // Allocate temporary space for ChaCha block.\n var block = new Uint8Array(64);\n for (var i = 0; i < src.length; i += 64) {\n // Generate a block.\n core(block, nc, key);\n // XOR block bytes with src into dst.\n for (var j = i; j < i + 64 && j < src.length; j++) {\n dst[j] = src[j] ^ block[j - i];\n }\n // Increment counter.\n incrementCounter(nc, 0, counterLength);\n }\n // Cleanup temporary space.\n wipe_1.wipe(block);\n if (nonceInplaceCounterLength === 0) {\n // Cleanup counter.\n wipe_1.wipe(nc);\n }\n return dst;\n}\nexports.streamXOR = streamXOR;\n/**\n * Generate ChaCha20 stream for the given 32-byte key and 8-byte or 12-byte\n * nonce and write it into dst and return it.\n *\n * Never use the same key and nonce to generate more than one stream.\n *\n * If nonceInplaceCounterLength is not 0, it behaves the same with respect to\n * the nonce as described in the streamXOR documentation.\n *\n * stream is like streamXOR with all-zero src.\n */\nfunction stream(key, nonce, dst, nonceInplaceCounterLength) {\n if (nonceInplaceCounterLength === void 0) { nonceInplaceCounterLength = 0; }\n wipe_1.wipe(dst);\n return streamXOR(key, nonce, dst, dst, nonceInplaceCounterLength);\n}\nexports.stream = stream;\nfunction incrementCounter(counter, pos, len) {\n var carry = 1;\n while (len--) {\n carry = carry + (counter[pos] & 0xff) | 0;\n counter[pos] = carry & 0xff;\n carry >>>= 8;\n pos++;\n }\n if (carry > 0) {\n throw new Error(\"ChaCha: counter overflow\");\n }\n}\n//# sourceMappingURL=chacha.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@stablelib/chacha/lib/chacha.js?"); - -/***/ }), - -/***/ "./node_modules/@stablelib/chacha20poly1305/lib/chacha20poly1305.js": -/*!**************************************************************************!*\ - !*** ./node_modules/@stablelib/chacha20poly1305/lib/chacha20poly1305.js ***! - \**************************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\n// Copyright (C) 2016 Dmitry Chestnykh\n// MIT License. See LICENSE file for details.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar chacha_1 = __webpack_require__(/*! @stablelib/chacha */ \"./node_modules/@stablelib/chacha/lib/chacha.js\");\nvar poly1305_1 = __webpack_require__(/*! @stablelib/poly1305 */ \"./node_modules/@stablelib/poly1305/lib/poly1305.js\");\nvar wipe_1 = __webpack_require__(/*! @stablelib/wipe */ \"./node_modules/@stablelib/wipe/lib/wipe.js\");\nvar binary_1 = __webpack_require__(/*! @stablelib/binary */ \"./node_modules/@stablelib/binary/lib/binary.js\");\nvar constant_time_1 = __webpack_require__(/*! @stablelib/constant-time */ \"./node_modules/@stablelib/constant-time/lib/constant-time.js\");\nexports.KEY_LENGTH = 32;\nexports.NONCE_LENGTH = 12;\nexports.TAG_LENGTH = 16;\nvar ZEROS = new Uint8Array(16);\n/**\n * ChaCha20-Poly1305 Authenticated Encryption with Associated Data.\n *\n * Defined in RFC7539.\n */\nvar ChaCha20Poly1305 = /** @class */ (function () {\n /**\n * Creates a new instance with the given 32-byte key.\n */\n function ChaCha20Poly1305(key) {\n this.nonceLength = exports.NONCE_LENGTH;\n this.tagLength = exports.TAG_LENGTH;\n if (key.length !== exports.KEY_LENGTH) {\n throw new Error(\"ChaCha20Poly1305 needs 32-byte key\");\n }\n // Copy key.\n this._key = new Uint8Array(key);\n }\n /**\n * Encrypts and authenticates plaintext, authenticates associated data,\n * and returns sealed ciphertext, which includes authentication tag.\n *\n * RFC7539 specifies 12 bytes for nonce. It may be this 12-byte nonce\n * (\"IV\"), or full 16-byte counter (called \"32-bit fixed-common part\")\n * and nonce.\n *\n * If dst is given (it must be the size of plaintext + the size of tag\n * length) the result will be put into it. Dst and plaintext must not\n * overlap.\n */\n ChaCha20Poly1305.prototype.seal = function (nonce, plaintext, associatedData, dst) {\n if (nonce.length > 16) {\n throw new Error(\"ChaCha20Poly1305: incorrect nonce length\");\n }\n // Allocate space for counter, and set nonce as last bytes of it.\n var counter = new Uint8Array(16);\n counter.set(nonce, counter.length - nonce.length);\n // Generate authentication key by taking first 32-bytes of stream.\n // We pass full counter, which has 12-byte nonce and 4-byte block counter,\n // and it will get incremented after generating the block, which is\n // exactly what we need: we only use the first 32 bytes of 64-byte\n // ChaCha block and discard the next 32 bytes.\n var authKey = new Uint8Array(32);\n chacha_1.stream(this._key, counter, authKey, 4);\n // Allocate space for sealed ciphertext.\n var resultLength = plaintext.length + this.tagLength;\n var result;\n if (dst) {\n if (dst.length !== resultLength) {\n throw new Error(\"ChaCha20Poly1305: incorrect destination length\");\n }\n result = dst;\n }\n else {\n result = new Uint8Array(resultLength);\n }\n // Encrypt plaintext.\n chacha_1.streamXOR(this._key, counter, plaintext, result, 4);\n // Authenticate.\n // XXX: can \"simplify\" here: pass full result (which is already padded\n // due to zeroes prepared for tag), and ciphertext length instead of\n // subarray of result.\n this._authenticate(result.subarray(result.length - this.tagLength, result.length), authKey, result.subarray(0, result.length - this.tagLength), associatedData);\n // Cleanup.\n wipe_1.wipe(counter);\n return result;\n };\n /**\n * Authenticates sealed ciphertext (which includes authentication tag) and\n * associated data, decrypts ciphertext and returns decrypted plaintext.\n *\n * RFC7539 specifies 12 bytes for nonce. It may be this 12-byte nonce\n * (\"IV\"), or full 16-byte counter (called \"32-bit fixed-common part\")\n * and nonce.\n *\n * If authentication fails, it returns null.\n *\n * If dst is given (it must be of ciphertext length minus tag length),\n * the result will be put into it. Dst and plaintext must not overlap.\n */\n ChaCha20Poly1305.prototype.open = function (nonce, sealed, associatedData, dst) {\n if (nonce.length > 16) {\n throw new Error(\"ChaCha20Poly1305: incorrect nonce length\");\n }\n // Sealed ciphertext should at least contain tag.\n if (sealed.length < this.tagLength) {\n // TODO(dchest): should we throw here instead?\n return null;\n }\n // Allocate space for counter, and set nonce as last bytes of it.\n var counter = new Uint8Array(16);\n counter.set(nonce, counter.length - nonce.length);\n // Generate authentication key by taking first 32-bytes of stream.\n var authKey = new Uint8Array(32);\n chacha_1.stream(this._key, counter, authKey, 4);\n // Authenticate.\n // XXX: can simplify and avoid allocation: since authenticate()\n // already allocates tag (from Poly1305.digest(), it can return)\n // it instead of copying to calculatedTag. But then in seal()\n // we'll need to copy it.\n var calculatedTag = new Uint8Array(this.tagLength);\n this._authenticate(calculatedTag, authKey, sealed.subarray(0, sealed.length - this.tagLength), associatedData);\n // Constant-time compare tags and return null if they differ.\n if (!constant_time_1.equal(calculatedTag, sealed.subarray(sealed.length - this.tagLength, sealed.length))) {\n return null;\n }\n // Allocate space for decrypted plaintext.\n var resultLength = sealed.length - this.tagLength;\n var result;\n if (dst) {\n if (dst.length !== resultLength) {\n throw new Error(\"ChaCha20Poly1305: incorrect destination length\");\n }\n result = dst;\n }\n else {\n result = new Uint8Array(resultLength);\n }\n // Decrypt.\n chacha_1.streamXOR(this._key, counter, sealed.subarray(0, sealed.length - this.tagLength), result, 4);\n // Cleanup.\n wipe_1.wipe(counter);\n return result;\n };\n ChaCha20Poly1305.prototype.clean = function () {\n wipe_1.wipe(this._key);\n return this;\n };\n ChaCha20Poly1305.prototype._authenticate = function (tagOut, authKey, ciphertext, associatedData) {\n // Initialize Poly1305 with authKey.\n var h = new poly1305_1.Poly1305(authKey);\n // Authenticate padded associated data.\n if (associatedData) {\n h.update(associatedData);\n if (associatedData.length % 16 > 0) {\n h.update(ZEROS.subarray(associatedData.length % 16));\n }\n }\n // Authenticate padded ciphertext.\n h.update(ciphertext);\n if (ciphertext.length % 16 > 0) {\n h.update(ZEROS.subarray(ciphertext.length % 16));\n }\n // Authenticate length of associated data.\n // XXX: can avoid allocation here?\n var length = new Uint8Array(8);\n if (associatedData) {\n binary_1.writeUint64LE(associatedData.length, length);\n }\n h.update(length);\n // Authenticate length of ciphertext.\n binary_1.writeUint64LE(ciphertext.length, length);\n h.update(length);\n // Get tag and copy it into tagOut.\n var tag = h.digest();\n for (var i = 0; i < tag.length; i++) {\n tagOut[i] = tag[i];\n }\n // Cleanup.\n h.clean();\n wipe_1.wipe(tag);\n wipe_1.wipe(length);\n };\n return ChaCha20Poly1305;\n}());\nexports.ChaCha20Poly1305 = ChaCha20Poly1305;\n//# sourceMappingURL=chacha20poly1305.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@stablelib/chacha20poly1305/lib/chacha20poly1305.js?"); - -/***/ }), - -/***/ "./node_modules/@stablelib/constant-time/lib/constant-time.js": -/*!********************************************************************!*\ - !*** ./node_modules/@stablelib/constant-time/lib/constant-time.js ***! - \********************************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -eval("\n// Copyright (C) 2016 Dmitry Chestnykh\n// MIT License. See LICENSE file for details.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n/**\n * Package constant-time provides functions for performing algorithmically constant-time operations.\n */\n/**\n * NOTE! Due to the inability to guarantee real constant time evaluation of\n * anything in JavaScript VM, this is module is the best effort.\n */\n/**\n * Returns resultIfOne if subject is 1, or resultIfZero if subject is 0.\n *\n * Supports only 32-bit integers, so resultIfOne or resultIfZero are not\n * integers, they'll be converted to them with bitwise operations.\n */\nfunction select(subject, resultIfOne, resultIfZero) {\n return (~(subject - 1) & resultIfOne) | ((subject - 1) & resultIfZero);\n}\nexports.select = select;\n/**\n * Returns 1 if a <= b, or 0 if not.\n * Arguments must be positive 32-bit integers less than or equal to 2^31 - 1.\n */\nfunction lessOrEqual(a, b) {\n return (((a | 0) - (b | 0) - 1) >>> 31) & 1;\n}\nexports.lessOrEqual = lessOrEqual;\n/**\n * Returns 1 if a and b are of equal length and their contents\n * are equal, or 0 otherwise.\n *\n * Note that unlike in equal(), zero-length inputs are considered\n * the same, so this function will return 1.\n */\nfunction compare(a, b) {\n if (a.length !== b.length) {\n return 0;\n }\n var result = 0;\n for (var i = 0; i < a.length; i++) {\n result |= a[i] ^ b[i];\n }\n return (1 & ((result - 1) >>> 8));\n}\nexports.compare = compare;\n/**\n * Returns true if a and b are of equal non-zero length,\n * and their contents are equal, or false otherwise.\n *\n * Note that unlike in compare() zero-length inputs are considered\n * _not_ equal, so this function will return false.\n */\nfunction equal(a, b) {\n if (a.length === 0 || b.length === 0) {\n return false;\n }\n return compare(a, b) !== 0;\n}\nexports.equal = equal;\n//# sourceMappingURL=constant-time.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@stablelib/constant-time/lib/constant-time.js?"); - -/***/ }), - -/***/ "./node_modules/@stablelib/ed25519/lib/ed25519.js": -/*!********************************************************!*\ - !*** ./node_modules/@stablelib/ed25519/lib/ed25519.js ***! - \********************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\n// Copyright (C) 2016 Dmitry Chestnykh\n// MIT License. See LICENSE file for details.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.convertSecretKeyToX25519 = exports.convertPublicKeyToX25519 = exports.verify = exports.sign = exports.extractPublicKeyFromSecretKey = exports.generateKeyPair = exports.generateKeyPairFromSeed = exports.SEED_LENGTH = exports.SECRET_KEY_LENGTH = exports.PUBLIC_KEY_LENGTH = exports.SIGNATURE_LENGTH = void 0;\n/**\n * Package ed25519 implements Ed25519 public-key signature algorithm.\n */\nconst random_1 = __webpack_require__(/*! @stablelib/random */ \"./node_modules/@stablelib/random/lib/random.js\");\nconst sha512_1 = __webpack_require__(/*! @stablelib/sha512 */ \"./node_modules/@stablelib/sha512/lib/sha512.js\");\nconst wipe_1 = __webpack_require__(/*! @stablelib/wipe */ \"./node_modules/@stablelib/wipe/lib/wipe.js\");\nexports.SIGNATURE_LENGTH = 64;\nexports.PUBLIC_KEY_LENGTH = 32;\nexports.SECRET_KEY_LENGTH = 64;\nexports.SEED_LENGTH = 32;\n// Returns new zero-filled 16-element GF (Float64Array).\n// If passed an array of numbers, prefills the returned\n// array with them.\n//\n// We use Float64Array, because we need 48-bit numbers\n// for this implementation.\nfunction gf(init) {\n const r = new Float64Array(16);\n if (init) {\n for (let i = 0; i < init.length; i++) {\n r[i] = init[i];\n }\n }\n return r;\n}\n// Base point.\nconst _9 = new Uint8Array(32);\n_9[0] = 9;\nconst gf0 = gf();\nconst gf1 = gf([1]);\nconst D = gf([\n 0x78a3, 0x1359, 0x4dca, 0x75eb, 0xd8ab, 0x4141, 0x0a4d, 0x0070,\n 0xe898, 0x7779, 0x4079, 0x8cc7, 0xfe73, 0x2b6f, 0x6cee, 0x5203\n]);\nconst D2 = gf([\n 0xf159, 0x26b2, 0x9b94, 0xebd6, 0xb156, 0x8283, 0x149a, 0x00e0,\n 0xd130, 0xeef3, 0x80f2, 0x198e, 0xfce7, 0x56df, 0xd9dc, 0x2406\n]);\nconst X = gf([\n 0xd51a, 0x8f25, 0x2d60, 0xc956, 0xa7b2, 0x9525, 0xc760, 0x692c,\n 0xdc5c, 0xfdd6, 0xe231, 0xc0a4, 0x53fe, 0xcd6e, 0x36d3, 0x2169\n]);\nconst Y = gf([\n 0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666,\n 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666\n]);\nconst I = gf([\n 0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43,\n 0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83\n]);\nfunction set25519(r, a) {\n for (let i = 0; i < 16; i++) {\n r[i] = a[i] | 0;\n }\n}\nfunction car25519(o) {\n let c = 1;\n for (let i = 0; i < 16; i++) {\n let v = o[i] + c + 65535;\n c = Math.floor(v / 65536);\n o[i] = v - c * 65536;\n }\n o[0] += c - 1 + 37 * (c - 1);\n}\nfunction sel25519(p, q, b) {\n const c = ~(b - 1);\n for (let i = 0; i < 16; i++) {\n const t = c & (p[i] ^ q[i]);\n p[i] ^= t;\n q[i] ^= t;\n }\n}\nfunction pack25519(o, n) {\n const m = gf();\n const t = gf();\n for (let i = 0; i < 16; i++) {\n t[i] = n[i];\n }\n car25519(t);\n car25519(t);\n car25519(t);\n for (let j = 0; j < 2; j++) {\n m[0] = t[0] - 0xffed;\n for (let i = 1; i < 15; i++) {\n m[i] = t[i] - 0xffff - ((m[i - 1] >> 16) & 1);\n m[i - 1] &= 0xffff;\n }\n m[15] = t[15] - 0x7fff - ((m[14] >> 16) & 1);\n const b = (m[15] >> 16) & 1;\n m[14] &= 0xffff;\n sel25519(t, m, 1 - b);\n }\n for (let i = 0; i < 16; i++) {\n o[2 * i] = t[i] & 0xff;\n o[2 * i + 1] = t[i] >> 8;\n }\n}\nfunction verify32(x, y) {\n let d = 0;\n for (let i = 0; i < 32; i++) {\n d |= x[i] ^ y[i];\n }\n return (1 & ((d - 1) >>> 8)) - 1;\n}\nfunction neq25519(a, b) {\n const c = new Uint8Array(32);\n const d = new Uint8Array(32);\n pack25519(c, a);\n pack25519(d, b);\n return verify32(c, d);\n}\nfunction par25519(a) {\n const d = new Uint8Array(32);\n pack25519(d, a);\n return d[0] & 1;\n}\nfunction unpack25519(o, n) {\n for (let i = 0; i < 16; i++) {\n o[i] = n[2 * i] + (n[2 * i + 1] << 8);\n }\n o[15] &= 0x7fff;\n}\nfunction add(o, a, b) {\n for (let i = 0; i < 16; i++) {\n o[i] = a[i] + b[i];\n }\n}\nfunction sub(o, a, b) {\n for (let i = 0; i < 16; i++) {\n o[i] = a[i] - b[i];\n }\n}\nfunction mul(o, a, b) {\n let v, c, t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0, t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0, t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0, b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3], b4 = b[4], b5 = b[5], b6 = b[6], b7 = b[7], b8 = b[8], b9 = b[9], b10 = b[10], b11 = b[11], b12 = b[12], b13 = b[13], b14 = b[14], b15 = b[15];\n v = a[0];\n t0 += v * b0;\n t1 += v * b1;\n t2 += v * b2;\n t3 += v * b3;\n t4 += v * b4;\n t5 += v * b5;\n t6 += v * b6;\n t7 += v * b7;\n t8 += v * b8;\n t9 += v * b9;\n t10 += v * b10;\n t11 += v * b11;\n t12 += v * b12;\n t13 += v * b13;\n t14 += v * b14;\n t15 += v * b15;\n v = a[1];\n t1 += v * b0;\n t2 += v * b1;\n t3 += v * b2;\n t4 += v * b3;\n t5 += v * b4;\n t6 += v * b5;\n t7 += v * b6;\n t8 += v * b7;\n t9 += v * b8;\n t10 += v * b9;\n t11 += v * b10;\n t12 += v * b11;\n t13 += v * b12;\n t14 += v * b13;\n t15 += v * b14;\n t16 += v * b15;\n v = a[2];\n t2 += v * b0;\n t3 += v * b1;\n t4 += v * b2;\n t5 += v * b3;\n t6 += v * b4;\n t7 += v * b5;\n t8 += v * b6;\n t9 += v * b7;\n t10 += v * b8;\n t11 += v * b9;\n t12 += v * b10;\n t13 += v * b11;\n t14 += v * b12;\n t15 += v * b13;\n t16 += v * b14;\n t17 += v * b15;\n v = a[3];\n t3 += v * b0;\n t4 += v * b1;\n t5 += v * b2;\n t6 += v * b3;\n t7 += v * b4;\n t8 += v * b5;\n t9 += v * b6;\n t10 += v * b7;\n t11 += v * b8;\n t12 += v * b9;\n t13 += v * b10;\n t14 += v * b11;\n t15 += v * b12;\n t16 += v * b13;\n t17 += v * b14;\n t18 += v * b15;\n v = a[4];\n t4 += v * b0;\n t5 += v * b1;\n t6 += v * b2;\n t7 += v * b3;\n t8 += v * b4;\n t9 += v * b5;\n t10 += v * b6;\n t11 += v * b7;\n t12 += v * b8;\n t13 += v * b9;\n t14 += v * b10;\n t15 += v * b11;\n t16 += v * b12;\n t17 += v * b13;\n t18 += v * b14;\n t19 += v * b15;\n v = a[5];\n t5 += v * b0;\n t6 += v * b1;\n t7 += v * b2;\n t8 += v * b3;\n t9 += v * b4;\n t10 += v * b5;\n t11 += v * b6;\n t12 += v * b7;\n t13 += v * b8;\n t14 += v * b9;\n t15 += v * b10;\n t16 += v * b11;\n t17 += v * b12;\n t18 += v * b13;\n t19 += v * b14;\n t20 += v * b15;\n v = a[6];\n t6 += v * b0;\n t7 += v * b1;\n t8 += v * b2;\n t9 += v * b3;\n t10 += v * b4;\n t11 += v * b5;\n t12 += v * b6;\n t13 += v * b7;\n t14 += v * b8;\n t15 += v * b9;\n t16 += v * b10;\n t17 += v * b11;\n t18 += v * b12;\n t19 += v * b13;\n t20 += v * b14;\n t21 += v * b15;\n v = a[7];\n t7 += v * b0;\n t8 += v * b1;\n t9 += v * b2;\n t10 += v * b3;\n t11 += v * b4;\n t12 += v * b5;\n t13 += v * b6;\n t14 += v * b7;\n t15 += v * b8;\n t16 += v * b9;\n t17 += v * b10;\n t18 += v * b11;\n t19 += v * b12;\n t20 += v * b13;\n t21 += v * b14;\n t22 += v * b15;\n v = a[8];\n t8 += v * b0;\n t9 += v * b1;\n t10 += v * b2;\n t11 += v * b3;\n t12 += v * b4;\n t13 += v * b5;\n t14 += v * b6;\n t15 += v * b7;\n t16 += v * b8;\n t17 += v * b9;\n t18 += v * b10;\n t19 += v * b11;\n t20 += v * b12;\n t21 += v * b13;\n t22 += v * b14;\n t23 += v * b15;\n v = a[9];\n t9 += v * b0;\n t10 += v * b1;\n t11 += v * b2;\n t12 += v * b3;\n t13 += v * b4;\n t14 += v * b5;\n t15 += v * b6;\n t16 += v * b7;\n t17 += v * b8;\n t18 += v * b9;\n t19 += v * b10;\n t20 += v * b11;\n t21 += v * b12;\n t22 += v * b13;\n t23 += v * b14;\n t24 += v * b15;\n v = a[10];\n t10 += v * b0;\n t11 += v * b1;\n t12 += v * b2;\n t13 += v * b3;\n t14 += v * b4;\n t15 += v * b5;\n t16 += v * b6;\n t17 += v * b7;\n t18 += v * b8;\n t19 += v * b9;\n t20 += v * b10;\n t21 += v * b11;\n t22 += v * b12;\n t23 += v * b13;\n t24 += v * b14;\n t25 += v * b15;\n v = a[11];\n t11 += v * b0;\n t12 += v * b1;\n t13 += v * b2;\n t14 += v * b3;\n t15 += v * b4;\n t16 += v * b5;\n t17 += v * b6;\n t18 += v * b7;\n t19 += v * b8;\n t20 += v * b9;\n t21 += v * b10;\n t22 += v * b11;\n t23 += v * b12;\n t24 += v * b13;\n t25 += v * b14;\n t26 += v * b15;\n v = a[12];\n t12 += v * b0;\n t13 += v * b1;\n t14 += v * b2;\n t15 += v * b3;\n t16 += v * b4;\n t17 += v * b5;\n t18 += v * b6;\n t19 += v * b7;\n t20 += v * b8;\n t21 += v * b9;\n t22 += v * b10;\n t23 += v * b11;\n t24 += v * b12;\n t25 += v * b13;\n t26 += v * b14;\n t27 += v * b15;\n v = a[13];\n t13 += v * b0;\n t14 += v * b1;\n t15 += v * b2;\n t16 += v * b3;\n t17 += v * b4;\n t18 += v * b5;\n t19 += v * b6;\n t20 += v * b7;\n t21 += v * b8;\n t22 += v * b9;\n t23 += v * b10;\n t24 += v * b11;\n t25 += v * b12;\n t26 += v * b13;\n t27 += v * b14;\n t28 += v * b15;\n v = a[14];\n t14 += v * b0;\n t15 += v * b1;\n t16 += v * b2;\n t17 += v * b3;\n t18 += v * b4;\n t19 += v * b5;\n t20 += v * b6;\n t21 += v * b7;\n t22 += v * b8;\n t23 += v * b9;\n t24 += v * b10;\n t25 += v * b11;\n t26 += v * b12;\n t27 += v * b13;\n t28 += v * b14;\n t29 += v * b15;\n v = a[15];\n t15 += v * b0;\n t16 += v * b1;\n t17 += v * b2;\n t18 += v * b3;\n t19 += v * b4;\n t20 += v * b5;\n t21 += v * b6;\n t22 += v * b7;\n t23 += v * b8;\n t24 += v * b9;\n t25 += v * b10;\n t26 += v * b11;\n t27 += v * b12;\n t28 += v * b13;\n t29 += v * b14;\n t30 += v * b15;\n t0 += 38 * t16;\n t1 += 38 * t17;\n t2 += 38 * t18;\n t3 += 38 * t19;\n t4 += 38 * t20;\n t5 += 38 * t21;\n t6 += 38 * t22;\n t7 += 38 * t23;\n t8 += 38 * t24;\n t9 += 38 * t25;\n t10 += 38 * t26;\n t11 += 38 * t27;\n t12 += 38 * t28;\n t13 += 38 * t29;\n t14 += 38 * t30;\n // t15 left as is\n // first car\n c = 1;\n v = t0 + c + 65535;\n c = Math.floor(v / 65536);\n t0 = v - c * 65536;\n v = t1 + c + 65535;\n c = Math.floor(v / 65536);\n t1 = v - c * 65536;\n v = t2 + c + 65535;\n c = Math.floor(v / 65536);\n t2 = v - c * 65536;\n v = t3 + c + 65535;\n c = Math.floor(v / 65536);\n t3 = v - c * 65536;\n v = t4 + c + 65535;\n c = Math.floor(v / 65536);\n t4 = v - c * 65536;\n v = t5 + c + 65535;\n c = Math.floor(v / 65536);\n t5 = v - c * 65536;\n v = t6 + c + 65535;\n c = Math.floor(v / 65536);\n t6 = v - c * 65536;\n v = t7 + c + 65535;\n c = Math.floor(v / 65536);\n t7 = v - c * 65536;\n v = t8 + c + 65535;\n c = Math.floor(v / 65536);\n t8 = v - c * 65536;\n v = t9 + c + 65535;\n c = Math.floor(v / 65536);\n t9 = v - c * 65536;\n v = t10 + c + 65535;\n c = Math.floor(v / 65536);\n t10 = v - c * 65536;\n v = t11 + c + 65535;\n c = Math.floor(v / 65536);\n t11 = v - c * 65536;\n v = t12 + c + 65535;\n c = Math.floor(v / 65536);\n t12 = v - c * 65536;\n v = t13 + c + 65535;\n c = Math.floor(v / 65536);\n t13 = v - c * 65536;\n v = t14 + c + 65535;\n c = Math.floor(v / 65536);\n t14 = v - c * 65536;\n v = t15 + c + 65535;\n c = Math.floor(v / 65536);\n t15 = v - c * 65536;\n t0 += c - 1 + 37 * (c - 1);\n // second car\n c = 1;\n v = t0 + c + 65535;\n c = Math.floor(v / 65536);\n t0 = v - c * 65536;\n v = t1 + c + 65535;\n c = Math.floor(v / 65536);\n t1 = v - c * 65536;\n v = t2 + c + 65535;\n c = Math.floor(v / 65536);\n t2 = v - c * 65536;\n v = t3 + c + 65535;\n c = Math.floor(v / 65536);\n t3 = v - c * 65536;\n v = t4 + c + 65535;\n c = Math.floor(v / 65536);\n t4 = v - c * 65536;\n v = t5 + c + 65535;\n c = Math.floor(v / 65536);\n t5 = v - c * 65536;\n v = t6 + c + 65535;\n c = Math.floor(v / 65536);\n t6 = v - c * 65536;\n v = t7 + c + 65535;\n c = Math.floor(v / 65536);\n t7 = v - c * 65536;\n v = t8 + c + 65535;\n c = Math.floor(v / 65536);\n t8 = v - c * 65536;\n v = t9 + c + 65535;\n c = Math.floor(v / 65536);\n t9 = v - c * 65536;\n v = t10 + c + 65535;\n c = Math.floor(v / 65536);\n t10 = v - c * 65536;\n v = t11 + c + 65535;\n c = Math.floor(v / 65536);\n t11 = v - c * 65536;\n v = t12 + c + 65535;\n c = Math.floor(v / 65536);\n t12 = v - c * 65536;\n v = t13 + c + 65535;\n c = Math.floor(v / 65536);\n t13 = v - c * 65536;\n v = t14 + c + 65535;\n c = Math.floor(v / 65536);\n t14 = v - c * 65536;\n v = t15 + c + 65535;\n c = Math.floor(v / 65536);\n t15 = v - c * 65536;\n t0 += c - 1 + 37 * (c - 1);\n o[0] = t0;\n o[1] = t1;\n o[2] = t2;\n o[3] = t3;\n o[4] = t4;\n o[5] = t5;\n o[6] = t6;\n o[7] = t7;\n o[8] = t8;\n o[9] = t9;\n o[10] = t10;\n o[11] = t11;\n o[12] = t12;\n o[13] = t13;\n o[14] = t14;\n o[15] = t15;\n}\nfunction square(o, a) {\n mul(o, a, a);\n}\nfunction inv25519(o, i) {\n const c = gf();\n let a;\n for (a = 0; a < 16; a++) {\n c[a] = i[a];\n }\n for (a = 253; a >= 0; a--) {\n square(c, c);\n if (a !== 2 && a !== 4) {\n mul(c, c, i);\n }\n }\n for (a = 0; a < 16; a++) {\n o[a] = c[a];\n }\n}\nfunction pow2523(o, i) {\n const c = gf();\n let a;\n for (a = 0; a < 16; a++) {\n c[a] = i[a];\n }\n for (a = 250; a >= 0; a--) {\n square(c, c);\n if (a !== 1) {\n mul(c, c, i);\n }\n }\n for (a = 0; a < 16; a++) {\n o[a] = c[a];\n }\n}\nfunction edadd(p, q) {\n const a = gf(), b = gf(), c = gf(), d = gf(), e = gf(), f = gf(), g = gf(), h = gf(), t = gf();\n sub(a, p[1], p[0]);\n sub(t, q[1], q[0]);\n mul(a, a, t);\n add(b, p[0], p[1]);\n add(t, q[0], q[1]);\n mul(b, b, t);\n mul(c, p[3], q[3]);\n mul(c, c, D2);\n mul(d, p[2], q[2]);\n add(d, d, d);\n sub(e, b, a);\n sub(f, d, c);\n add(g, d, c);\n add(h, b, a);\n mul(p[0], e, f);\n mul(p[1], h, g);\n mul(p[2], g, f);\n mul(p[3], e, h);\n}\nfunction cswap(p, q, b) {\n for (let i = 0; i < 4; i++) {\n sel25519(p[i], q[i], b);\n }\n}\nfunction pack(r, p) {\n const tx = gf(), ty = gf(), zi = gf();\n inv25519(zi, p[2]);\n mul(tx, p[0], zi);\n mul(ty, p[1], zi);\n pack25519(r, ty);\n r[31] ^= par25519(tx) << 7;\n}\nfunction scalarmult(p, q, s) {\n set25519(p[0], gf0);\n set25519(p[1], gf1);\n set25519(p[2], gf1);\n set25519(p[3], gf0);\n for (let i = 255; i >= 0; --i) {\n const b = (s[(i / 8) | 0] >> (i & 7)) & 1;\n cswap(p, q, b);\n edadd(q, p);\n edadd(p, p);\n cswap(p, q, b);\n }\n}\nfunction scalarbase(p, s) {\n const q = [gf(), gf(), gf(), gf()];\n set25519(q[0], X);\n set25519(q[1], Y);\n set25519(q[2], gf1);\n mul(q[3], X, Y);\n scalarmult(p, q, s);\n}\n// Generates key pair from secret 32-byte seed.\nfunction generateKeyPairFromSeed(seed) {\n if (seed.length !== exports.SEED_LENGTH) {\n throw new Error(`ed25519: seed must be ${exports.SEED_LENGTH} bytes`);\n }\n const d = (0, sha512_1.hash)(seed);\n d[0] &= 248;\n d[31] &= 127;\n d[31] |= 64;\n const publicKey = new Uint8Array(32);\n const p = [gf(), gf(), gf(), gf()];\n scalarbase(p, d);\n pack(publicKey, p);\n const secretKey = new Uint8Array(64);\n secretKey.set(seed);\n secretKey.set(publicKey, 32);\n return {\n publicKey,\n secretKey\n };\n}\nexports.generateKeyPairFromSeed = generateKeyPairFromSeed;\nfunction generateKeyPair(prng) {\n const seed = (0, random_1.randomBytes)(32, prng);\n const result = generateKeyPairFromSeed(seed);\n (0, wipe_1.wipe)(seed);\n return result;\n}\nexports.generateKeyPair = generateKeyPair;\nfunction extractPublicKeyFromSecretKey(secretKey) {\n if (secretKey.length !== exports.SECRET_KEY_LENGTH) {\n throw new Error(`ed25519: secret key must be ${exports.SECRET_KEY_LENGTH} bytes`);\n }\n return new Uint8Array(secretKey.subarray(32));\n}\nexports.extractPublicKeyFromSecretKey = extractPublicKeyFromSecretKey;\nconst L = new Float64Array([\n 0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2,\n 0xde, 0xf9, 0xde, 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10\n]);\nfunction modL(r, x) {\n let carry;\n let i;\n let j;\n let k;\n for (i = 63; i >= 32; --i) {\n carry = 0;\n for (j = i - 32, k = i - 12; j < k; ++j) {\n x[j] += carry - 16 * x[i] * L[j - (i - 32)];\n carry = Math.floor((x[j] + 128) / 256);\n x[j] -= carry * 256;\n }\n x[j] += carry;\n x[i] = 0;\n }\n carry = 0;\n for (j = 0; j < 32; j++) {\n x[j] += carry - (x[31] >> 4) * L[j];\n carry = x[j] >> 8;\n x[j] &= 255;\n }\n for (j = 0; j < 32; j++) {\n x[j] -= carry * L[j];\n }\n for (i = 0; i < 32; i++) {\n x[i + 1] += x[i] >> 8;\n r[i] = x[i] & 255;\n }\n}\nfunction reduce(r) {\n const x = new Float64Array(64);\n for (let i = 0; i < 64; i++) {\n x[i] = r[i];\n }\n for (let i = 0; i < 64; i++) {\n r[i] = 0;\n }\n modL(r, x);\n}\n// Returns 64-byte signature of the message under the 64-byte secret key.\nfunction sign(secretKey, message) {\n const x = new Float64Array(64);\n const p = [gf(), gf(), gf(), gf()];\n const d = (0, sha512_1.hash)(secretKey.subarray(0, 32));\n d[0] &= 248;\n d[31] &= 127;\n d[31] |= 64;\n const signature = new Uint8Array(64);\n signature.set(d.subarray(32), 32);\n const hs = new sha512_1.SHA512();\n hs.update(signature.subarray(32));\n hs.update(message);\n const r = hs.digest();\n hs.clean();\n reduce(r);\n scalarbase(p, r);\n pack(signature, p);\n hs.reset();\n hs.update(signature.subarray(0, 32));\n hs.update(secretKey.subarray(32));\n hs.update(message);\n const h = hs.digest();\n reduce(h);\n for (let i = 0; i < 32; i++) {\n x[i] = r[i];\n }\n for (let i = 0; i < 32; i++) {\n for (let j = 0; j < 32; j++) {\n x[i + j] += h[i] * d[j];\n }\n }\n modL(signature.subarray(32), x);\n return signature;\n}\nexports.sign = sign;\nfunction unpackneg(r, p) {\n const t = gf(), chk = gf(), num = gf(), den = gf(), den2 = gf(), den4 = gf(), den6 = gf();\n set25519(r[2], gf1);\n unpack25519(r[1], p);\n square(num, r[1]);\n mul(den, num, D);\n sub(num, num, r[2]);\n add(den, r[2], den);\n square(den2, den);\n square(den4, den2);\n mul(den6, den4, den2);\n mul(t, den6, num);\n mul(t, t, den);\n pow2523(t, t);\n mul(t, t, num);\n mul(t, t, den);\n mul(t, t, den);\n mul(r[0], t, den);\n square(chk, r[0]);\n mul(chk, chk, den);\n if (neq25519(chk, num)) {\n mul(r[0], r[0], I);\n }\n square(chk, r[0]);\n mul(chk, chk, den);\n if (neq25519(chk, num)) {\n return -1;\n }\n if (par25519(r[0]) === (p[31] >> 7)) {\n sub(r[0], gf0, r[0]);\n }\n mul(r[3], r[0], r[1]);\n return 0;\n}\nfunction verify(publicKey, message, signature) {\n const t = new Uint8Array(32);\n const p = [gf(), gf(), gf(), gf()];\n const q = [gf(), gf(), gf(), gf()];\n if (signature.length !== exports.SIGNATURE_LENGTH) {\n throw new Error(`ed25519: signature must be ${exports.SIGNATURE_LENGTH} bytes`);\n }\n if (unpackneg(q, publicKey)) {\n return false;\n }\n const hs = new sha512_1.SHA512();\n hs.update(signature.subarray(0, 32));\n hs.update(publicKey);\n hs.update(message);\n const h = hs.digest();\n reduce(h);\n scalarmult(p, q, h);\n scalarbase(q, signature.subarray(32));\n edadd(p, q);\n pack(t, p);\n if (verify32(signature, t)) {\n return false;\n }\n return true;\n}\nexports.verify = verify;\n/**\n * Convert Ed25519 public key to X25519 public key.\n *\n * Throws if given an invalid public key.\n */\nfunction convertPublicKeyToX25519(publicKey) {\n let q = [gf(), gf(), gf(), gf()];\n if (unpackneg(q, publicKey)) {\n throw new Error(\"Ed25519: invalid public key\");\n }\n // Formula: montgomeryX = (edwardsY + 1)*inverse(1 - edwardsY) mod p\n let a = gf();\n let b = gf();\n let y = q[1];\n add(a, gf1, y);\n sub(b, gf1, y);\n inv25519(b, b);\n mul(a, a, b);\n let z = new Uint8Array(32);\n pack25519(z, a);\n return z;\n}\nexports.convertPublicKeyToX25519 = convertPublicKeyToX25519;\n/**\n * Convert Ed25519 secret (private) key to X25519 secret key.\n */\nfunction convertSecretKeyToX25519(secretKey) {\n const d = (0, sha512_1.hash)(secretKey.subarray(0, 32));\n d[0] &= 248;\n d[31] &= 127;\n d[31] |= 64;\n const o = new Uint8Array(d.subarray(0, 32));\n (0, wipe_1.wipe)(d);\n return o;\n}\nexports.convertSecretKeyToX25519 = convertSecretKeyToX25519;\n//# sourceMappingURL=ed25519.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@stablelib/ed25519/lib/ed25519.js?"); - -/***/ }), - -/***/ "./node_modules/@stablelib/hash/lib/hash.js": -/*!**************************************************!*\ - !*** ./node_modules/@stablelib/hash/lib/hash.js ***! - \**************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -eval("\n// Copyright (C) 2016 Dmitry Chestnykh\n// MIT License. See LICENSE file for details.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nfunction isSerializableHash(h) {\n return (typeof h.saveState !== \"undefined\" &&\n typeof h.restoreState !== \"undefined\" &&\n typeof h.cleanSavedState !== \"undefined\");\n}\nexports.isSerializableHash = isSerializableHash;\n// TODO(dchest): figure out the standardized interface for XOF such as\n// SHAKE and BLAKE2X.\n//# sourceMappingURL=hash.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@stablelib/hash/lib/hash.js?"); - -/***/ }), - -/***/ "./node_modules/@stablelib/hkdf/lib/hkdf.js": -/*!**************************************************!*\ - !*** ./node_modules/@stablelib/hkdf/lib/hkdf.js ***! - \**************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\n// Copyright (C) 2016 Dmitry Chestnykh\n// MIT License. See LICENSE file for details.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar hmac_1 = __webpack_require__(/*! @stablelib/hmac */ \"./node_modules/@stablelib/hmac/lib/hmac.js\");\nvar wipe_1 = __webpack_require__(/*! @stablelib/wipe */ \"./node_modules/@stablelib/wipe/lib/wipe.js\");\n/**\n * HMAC-based Extract-and-Expand Key Derivation Function.\n *\n * Implements HKDF from RFC5869.\n *\n * Expands the given master key with salt and info into\n * a limited stream of key material.\n */\nvar HKDF = /** @class */ (function () {\n /**\n * Create a new HKDF instance for the given hash function\n * with the master key, optional salt, and info.\n *\n * - Master key is a high-entropy secret key (not a password).\n * - Salt is a non-secret random value.\n * - Info is application- and/or context-specific information.\n */\n function HKDF(hash, key, salt, info) {\n if (salt === void 0) { salt = new Uint8Array(0); }\n this._counter = new Uint8Array(1); // starts with zero\n this._hash = hash;\n this._info = info;\n // HKDF-Extract uses salt as HMAC key, and key as data.\n var okm = hmac_1.hmac(this._hash, salt, key);\n // Initialize HMAC for expanding with extracted key.\n this._hmac = new hmac_1.HMAC(hash, okm);\n // Allocate buffer.\n this._buffer = new Uint8Array(this._hmac.digestLength);\n this._bufpos = this._buffer.length;\n }\n // Fill buffer with new block of HKDF-Extract output.\n HKDF.prototype._fillBuffer = function () {\n // Increment counter.\n this._counter[0]++;\n var ctr = this._counter[0];\n // Check if counter overflowed.\n if (ctr === 0) {\n throw new Error(\"hkdf: cannot expand more\");\n }\n // Prepare HMAC instance for new data with old key.\n this._hmac.reset();\n // Hash in previous output if it was generated\n // (i.e. counter is greater than 1).\n if (ctr > 1) {\n this._hmac.update(this._buffer);\n }\n // Hash in info if it exists.\n if (this._info) {\n this._hmac.update(this._info);\n }\n // Hash in the counter.\n this._hmac.update(this._counter);\n // Output result to buffer and clean HMAC instance.\n this._hmac.finish(this._buffer);\n // Reset buffer position.\n this._bufpos = 0;\n };\n /**\n * Expand returns next key material of the given length.\n *\n * It throws if expansion limit is reached (which is\n * 254 digests of the underlying HMAC function).\n */\n HKDF.prototype.expand = function (length) {\n var out = new Uint8Array(length);\n for (var i = 0; i < out.length; i++) {\n if (this._bufpos === this._buffer.length) {\n this._fillBuffer();\n }\n out[i] = this._buffer[this._bufpos++];\n }\n return out;\n };\n HKDF.prototype.clean = function () {\n this._hmac.clean();\n wipe_1.wipe(this._buffer);\n wipe_1.wipe(this._counter);\n this._bufpos = 0;\n };\n return HKDF;\n}());\nexports.HKDF = HKDF;\n// TODO(dchest): maybe implement deriveKey?\n//# sourceMappingURL=hkdf.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@stablelib/hkdf/lib/hkdf.js?"); - -/***/ }), - -/***/ "./node_modules/@stablelib/hmac/lib/hmac.js": -/*!**************************************************!*\ - !*** ./node_modules/@stablelib/hmac/lib/hmac.js ***! - \**************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\n// Copyright (C) 2016 Dmitry Chestnykh\n// MIT License. See LICENSE file for details.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n/**\n * Package hmac implements HMAC algorithm.\n */\nvar hash_1 = __webpack_require__(/*! @stablelib/hash */ \"./node_modules/@stablelib/hash/lib/hash.js\");\nvar constant_time_1 = __webpack_require__(/*! @stablelib/constant-time */ \"./node_modules/@stablelib/constant-time/lib/constant-time.js\");\nvar wipe_1 = __webpack_require__(/*! @stablelib/wipe */ \"./node_modules/@stablelib/wipe/lib/wipe.js\");\n/**\n * HMAC implements hash-based message authentication algorithm.\n */\nvar HMAC = /** @class */ (function () {\n /**\n * Constructs a new HMAC with the given Hash and secret key.\n */\n function HMAC(hash, key) {\n this._finished = false; // true if HMAC was finalized\n // Initialize inner and outer hashes.\n this._inner = new hash();\n this._outer = new hash();\n // Set block and digest sizes for this HMAC\n // instance to values from the hash.\n this.blockSize = this._outer.blockSize;\n this.digestLength = this._outer.digestLength;\n // Pad temporary stores a key (or its hash) padded with zeroes.\n var pad = new Uint8Array(this.blockSize);\n if (key.length > this.blockSize) {\n // If key is bigger than hash block size, it must be\n // hashed and this hash is used as a key instead.\n this._inner.update(key).finish(pad).clean();\n }\n else {\n // Otherwise, copy the key into pad.\n pad.set(key);\n }\n // Now two different keys are derived from padded key\n // by xoring a different byte value to each.\n // To make inner hash key, xor byte 0x36 into pad.\n for (var i = 0; i < pad.length; i++) {\n pad[i] ^= 0x36;\n }\n // Update inner hash with the result.\n this._inner.update(pad);\n // To make outer hash key, xor byte 0x5c into pad.\n // But since we already xored 0x36 there, we must\n // first undo this by xoring it again.\n for (var i = 0; i < pad.length; i++) {\n pad[i] ^= 0x36 ^ 0x5c;\n }\n // Update outer hash with the result.\n this._outer.update(pad);\n // Save states of both hashes, so that we can quickly restore\n // them later in reset() without the need to remember the actual\n // key and perform this initialization again.\n if (hash_1.isSerializableHash(this._inner) && hash_1.isSerializableHash(this._outer)) {\n this._innerKeyedState = this._inner.saveState();\n this._outerKeyedState = this._outer.saveState();\n }\n // Clean pad.\n wipe_1.wipe(pad);\n }\n /**\n * Returns HMAC state to the state initialized with key\n * to make it possible to run HMAC over the other data with the same\n * key without creating a new instance.\n */\n HMAC.prototype.reset = function () {\n if (!hash_1.isSerializableHash(this._inner) || !hash_1.isSerializableHash(this._outer)) {\n throw new Error(\"hmac: can't reset() because hash doesn't implement restoreState()\");\n }\n // Restore keyed states of inner and outer hashes.\n this._inner.restoreState(this._innerKeyedState);\n this._outer.restoreState(this._outerKeyedState);\n this._finished = false;\n return this;\n };\n /**\n * Cleans HMAC state.\n */\n HMAC.prototype.clean = function () {\n if (hash_1.isSerializableHash(this._inner)) {\n this._inner.cleanSavedState(this._innerKeyedState);\n }\n if (hash_1.isSerializableHash(this._outer)) {\n this._outer.cleanSavedState(this._outerKeyedState);\n }\n this._inner.clean();\n this._outer.clean();\n };\n /**\n * Updates state with provided data.\n */\n HMAC.prototype.update = function (data) {\n this._inner.update(data);\n return this;\n };\n /**\n * Finalizes HMAC and puts the result in out.\n */\n HMAC.prototype.finish = function (out) {\n if (this._finished) {\n // If HMAC was finalized, outer hash is also finalized,\n // so it produces the same digest it produced when it\n // was finalized.\n this._outer.finish(out);\n return this;\n }\n // Finalize inner hash and store the result temporarily.\n this._inner.finish(out);\n // Update outer hash with digest of inner hash and and finalize it.\n this._outer.update(out.subarray(0, this.digestLength)).finish(out);\n this._finished = true;\n return this;\n };\n /**\n * Returns the computed message authentication code.\n */\n HMAC.prototype.digest = function () {\n var out = new Uint8Array(this.digestLength);\n this.finish(out);\n return out;\n };\n /**\n * Saves HMAC state.\n * This function is needed for PBKDF2 optimization.\n */\n HMAC.prototype.saveState = function () {\n if (!hash_1.isSerializableHash(this._inner)) {\n throw new Error(\"hmac: can't saveState() because hash doesn't implement it\");\n }\n return this._inner.saveState();\n };\n HMAC.prototype.restoreState = function (savedState) {\n if (!hash_1.isSerializableHash(this._inner) || !hash_1.isSerializableHash(this._outer)) {\n throw new Error(\"hmac: can't restoreState() because hash doesn't implement it\");\n }\n this._inner.restoreState(savedState);\n this._outer.restoreState(this._outerKeyedState);\n this._finished = false;\n return this;\n };\n HMAC.prototype.cleanSavedState = function (savedState) {\n if (!hash_1.isSerializableHash(this._inner)) {\n throw new Error(\"hmac: can't cleanSavedState() because hash doesn't implement it\");\n }\n this._inner.cleanSavedState(savedState);\n };\n return HMAC;\n}());\nexports.HMAC = HMAC;\n/**\n * Returns HMAC using the given hash constructor for the key over data.\n */\nfunction hmac(hash, key, data) {\n var h = new HMAC(hash, key);\n h.update(data);\n var digest = h.digest();\n h.clean();\n return digest;\n}\nexports.hmac = hmac;\n/**\n * Returns true if two HMAC digests are equal.\n * Uses constant-time comparison to avoid leaking timing information.\n *\n * Example:\n *\n * const receivedDigest = ...\n * const realDigest = hmac(SHA256, key, data);\n * if (!equal(receivedDigest, realDigest)) {\n * throw new Error(\"Authentication error\");\n * }\n */\nexports.equal = constant_time_1.equal;\n//# sourceMappingURL=hmac.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@stablelib/hmac/lib/hmac.js?"); - -/***/ }), - -/***/ "./node_modules/@stablelib/int/lib/int.js": -/*!************************************************!*\ - !*** ./node_modules/@stablelib/int/lib/int.js ***! - \************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -eval("\n// Copyright (C) 2016 Dmitry Chestnykh\n// MIT License. See LICENSE file for details.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n/**\n * Package int provides helper functions for integerss.\n */\n// Shim using 16-bit pieces.\nfunction imulShim(a, b) {\n var ah = (a >>> 16) & 0xffff, al = a & 0xffff;\n var bh = (b >>> 16) & 0xffff, bl = b & 0xffff;\n return ((al * bl) + (((ah * bl + al * bh) << 16) >>> 0) | 0);\n}\n/** 32-bit integer multiplication. */\n// Use system Math.imul if available, otherwise use our shim.\nexports.mul = Math.imul || imulShim;\n/** 32-bit integer addition. */\nfunction add(a, b) {\n return (a + b) | 0;\n}\nexports.add = add;\n/** 32-bit integer subtraction. */\nfunction sub(a, b) {\n return (a - b) | 0;\n}\nexports.sub = sub;\n/** 32-bit integer left rotation */\nfunction rotl(x, n) {\n return x << n | x >>> (32 - n);\n}\nexports.rotl = rotl;\n/** 32-bit integer left rotation */\nfunction rotr(x, n) {\n return x << (32 - n) | x >>> n;\n}\nexports.rotr = rotr;\nfunction isIntegerShim(n) {\n return typeof n === \"number\" && isFinite(n) && Math.floor(n) === n;\n}\n/**\n * Returns true if the argument is an integer number.\n *\n * In ES2015, Number.isInteger.\n */\nexports.isInteger = Number.isInteger || isIntegerShim;\n/**\n * Math.pow(2, 53) - 1\n *\n * In ES2015 Number.MAX_SAFE_INTEGER.\n */\nexports.MAX_SAFE_INTEGER = 9007199254740991;\n/**\n * Returns true if the argument is a safe integer number\n * (-MIN_SAFE_INTEGER < number <= MAX_SAFE_INTEGER)\n *\n * In ES2015, Number.isSafeInteger.\n */\nexports.isSafeInteger = function (n) {\n return exports.isInteger(n) && (n >= -exports.MAX_SAFE_INTEGER && n <= exports.MAX_SAFE_INTEGER);\n};\n//# sourceMappingURL=int.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@stablelib/int/lib/int.js?"); - -/***/ }), - -/***/ "./node_modules/@stablelib/poly1305/lib/poly1305.js": -/*!**********************************************************!*\ - !*** ./node_modules/@stablelib/poly1305/lib/poly1305.js ***! - \**********************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\n// Copyright (C) 2016 Dmitry Chestnykh\n// MIT License. See LICENSE file for details.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n/**\n * Package poly1305 implements Poly1305 one-time message authentication algorithm.\n */\nvar constant_time_1 = __webpack_require__(/*! @stablelib/constant-time */ \"./node_modules/@stablelib/constant-time/lib/constant-time.js\");\nvar wipe_1 = __webpack_require__(/*! @stablelib/wipe */ \"./node_modules/@stablelib/wipe/lib/wipe.js\");\nexports.DIGEST_LENGTH = 16;\n// Port of Andrew Moon's Poly1305-donna-16. Public domain.\n// https://github.com/floodyberry/poly1305-donna\n/**\n * Poly1305 computes 16-byte authenticator of message using\n * a one-time 32-byte key.\n *\n * Important: key should be used for only one message,\n * it should never repeat.\n */\nvar Poly1305 = /** @class */ (function () {\n function Poly1305(key) {\n this.digestLength = exports.DIGEST_LENGTH;\n this._buffer = new Uint8Array(16);\n this._r = new Uint16Array(10);\n this._h = new Uint16Array(10);\n this._pad = new Uint16Array(8);\n this._leftover = 0;\n this._fin = 0;\n this._finished = false;\n var t0 = key[0] | key[1] << 8;\n this._r[0] = (t0) & 0x1fff;\n var t1 = key[2] | key[3] << 8;\n this._r[1] = ((t0 >>> 13) | (t1 << 3)) & 0x1fff;\n var t2 = key[4] | key[5] << 8;\n this._r[2] = ((t1 >>> 10) | (t2 << 6)) & 0x1f03;\n var t3 = key[6] | key[7] << 8;\n this._r[3] = ((t2 >>> 7) | (t3 << 9)) & 0x1fff;\n var t4 = key[8] | key[9] << 8;\n this._r[4] = ((t3 >>> 4) | (t4 << 12)) & 0x00ff;\n this._r[5] = ((t4 >>> 1)) & 0x1ffe;\n var t5 = key[10] | key[11] << 8;\n this._r[6] = ((t4 >>> 14) | (t5 << 2)) & 0x1fff;\n var t6 = key[12] | key[13] << 8;\n this._r[7] = ((t5 >>> 11) | (t6 << 5)) & 0x1f81;\n var t7 = key[14] | key[15] << 8;\n this._r[8] = ((t6 >>> 8) | (t7 << 8)) & 0x1fff;\n this._r[9] = ((t7 >>> 5)) & 0x007f;\n this._pad[0] = key[16] | key[17] << 8;\n this._pad[1] = key[18] | key[19] << 8;\n this._pad[2] = key[20] | key[21] << 8;\n this._pad[3] = key[22] | key[23] << 8;\n this._pad[4] = key[24] | key[25] << 8;\n this._pad[5] = key[26] | key[27] << 8;\n this._pad[6] = key[28] | key[29] << 8;\n this._pad[7] = key[30] | key[31] << 8;\n }\n Poly1305.prototype._blocks = function (m, mpos, bytes) {\n var hibit = this._fin ? 0 : 1 << 11;\n var h0 = this._h[0], h1 = this._h[1], h2 = this._h[2], h3 = this._h[3], h4 = this._h[4], h5 = this._h[5], h6 = this._h[6], h7 = this._h[7], h8 = this._h[8], h9 = this._h[9];\n var r0 = this._r[0], r1 = this._r[1], r2 = this._r[2], r3 = this._r[3], r4 = this._r[4], r5 = this._r[5], r6 = this._r[6], r7 = this._r[7], r8 = this._r[8], r9 = this._r[9];\n while (bytes >= 16) {\n var t0 = m[mpos + 0] | m[mpos + 1] << 8;\n h0 += (t0) & 0x1fff;\n var t1 = m[mpos + 2] | m[mpos + 3] << 8;\n h1 += ((t0 >>> 13) | (t1 << 3)) & 0x1fff;\n var t2 = m[mpos + 4] | m[mpos + 5] << 8;\n h2 += ((t1 >>> 10) | (t2 << 6)) & 0x1fff;\n var t3 = m[mpos + 6] | m[mpos + 7] << 8;\n h3 += ((t2 >>> 7) | (t3 << 9)) & 0x1fff;\n var t4 = m[mpos + 8] | m[mpos + 9] << 8;\n h4 += ((t3 >>> 4) | (t4 << 12)) & 0x1fff;\n h5 += ((t4 >>> 1)) & 0x1fff;\n var t5 = m[mpos + 10] | m[mpos + 11] << 8;\n h6 += ((t4 >>> 14) | (t5 << 2)) & 0x1fff;\n var t6 = m[mpos + 12] | m[mpos + 13] << 8;\n h7 += ((t5 >>> 11) | (t6 << 5)) & 0x1fff;\n var t7 = m[mpos + 14] | m[mpos + 15] << 8;\n h8 += ((t6 >>> 8) | (t7 << 8)) & 0x1fff;\n h9 += ((t7 >>> 5)) | hibit;\n var c = 0;\n var d0 = c;\n d0 += h0 * r0;\n d0 += h1 * (5 * r9);\n d0 += h2 * (5 * r8);\n d0 += h3 * (5 * r7);\n d0 += h4 * (5 * r6);\n c = (d0 >>> 13);\n d0 &= 0x1fff;\n d0 += h5 * (5 * r5);\n d0 += h6 * (5 * r4);\n d0 += h7 * (5 * r3);\n d0 += h8 * (5 * r2);\n d0 += h9 * (5 * r1);\n c += (d0 >>> 13);\n d0 &= 0x1fff;\n var d1 = c;\n d1 += h0 * r1;\n d1 += h1 * r0;\n d1 += h2 * (5 * r9);\n d1 += h3 * (5 * r8);\n d1 += h4 * (5 * r7);\n c = (d1 >>> 13);\n d1 &= 0x1fff;\n d1 += h5 * (5 * r6);\n d1 += h6 * (5 * r5);\n d1 += h7 * (5 * r4);\n d1 += h8 * (5 * r3);\n d1 += h9 * (5 * r2);\n c += (d1 >>> 13);\n d1 &= 0x1fff;\n var d2 = c;\n d2 += h0 * r2;\n d2 += h1 * r1;\n d2 += h2 * r0;\n d2 += h3 * (5 * r9);\n d2 += h4 * (5 * r8);\n c = (d2 >>> 13);\n d2 &= 0x1fff;\n d2 += h5 * (5 * r7);\n d2 += h6 * (5 * r6);\n d2 += h7 * (5 * r5);\n d2 += h8 * (5 * r4);\n d2 += h9 * (5 * r3);\n c += (d2 >>> 13);\n d2 &= 0x1fff;\n var d3 = c;\n d3 += h0 * r3;\n d3 += h1 * r2;\n d3 += h2 * r1;\n d3 += h3 * r0;\n d3 += h4 * (5 * r9);\n c = (d3 >>> 13);\n d3 &= 0x1fff;\n d3 += h5 * (5 * r8);\n d3 += h6 * (5 * r7);\n d3 += h7 * (5 * r6);\n d3 += h8 * (5 * r5);\n d3 += h9 * (5 * r4);\n c += (d3 >>> 13);\n d3 &= 0x1fff;\n var d4 = c;\n d4 += h0 * r4;\n d4 += h1 * r3;\n d4 += h2 * r2;\n d4 += h3 * r1;\n d4 += h4 * r0;\n c = (d4 >>> 13);\n d4 &= 0x1fff;\n d4 += h5 * (5 * r9);\n d4 += h6 * (5 * r8);\n d4 += h7 * (5 * r7);\n d4 += h8 * (5 * r6);\n d4 += h9 * (5 * r5);\n c += (d4 >>> 13);\n d4 &= 0x1fff;\n var d5 = c;\n d5 += h0 * r5;\n d5 += h1 * r4;\n d5 += h2 * r3;\n d5 += h3 * r2;\n d5 += h4 * r1;\n c = (d5 >>> 13);\n d5 &= 0x1fff;\n d5 += h5 * r0;\n d5 += h6 * (5 * r9);\n d5 += h7 * (5 * r8);\n d5 += h8 * (5 * r7);\n d5 += h9 * (5 * r6);\n c += (d5 >>> 13);\n d5 &= 0x1fff;\n var d6 = c;\n d6 += h0 * r6;\n d6 += h1 * r5;\n d6 += h2 * r4;\n d6 += h3 * r3;\n d6 += h4 * r2;\n c = (d6 >>> 13);\n d6 &= 0x1fff;\n d6 += h5 * r1;\n d6 += h6 * r0;\n d6 += h7 * (5 * r9);\n d6 += h8 * (5 * r8);\n d6 += h9 * (5 * r7);\n c += (d6 >>> 13);\n d6 &= 0x1fff;\n var d7 = c;\n d7 += h0 * r7;\n d7 += h1 * r6;\n d7 += h2 * r5;\n d7 += h3 * r4;\n d7 += h4 * r3;\n c = (d7 >>> 13);\n d7 &= 0x1fff;\n d7 += h5 * r2;\n d7 += h6 * r1;\n d7 += h7 * r0;\n d7 += h8 * (5 * r9);\n d7 += h9 * (5 * r8);\n c += (d7 >>> 13);\n d7 &= 0x1fff;\n var d8 = c;\n d8 += h0 * r8;\n d8 += h1 * r7;\n d8 += h2 * r6;\n d8 += h3 * r5;\n d8 += h4 * r4;\n c = (d8 >>> 13);\n d8 &= 0x1fff;\n d8 += h5 * r3;\n d8 += h6 * r2;\n d8 += h7 * r1;\n d8 += h8 * r0;\n d8 += h9 * (5 * r9);\n c += (d8 >>> 13);\n d8 &= 0x1fff;\n var d9 = c;\n d9 += h0 * r9;\n d9 += h1 * r8;\n d9 += h2 * r7;\n d9 += h3 * r6;\n d9 += h4 * r5;\n c = (d9 >>> 13);\n d9 &= 0x1fff;\n d9 += h5 * r4;\n d9 += h6 * r3;\n d9 += h7 * r2;\n d9 += h8 * r1;\n d9 += h9 * r0;\n c += (d9 >>> 13);\n d9 &= 0x1fff;\n c = (((c << 2) + c)) | 0;\n c = (c + d0) | 0;\n d0 = c & 0x1fff;\n c = (c >>> 13);\n d1 += c;\n h0 = d0;\n h1 = d1;\n h2 = d2;\n h3 = d3;\n h4 = d4;\n h5 = d5;\n h6 = d6;\n h7 = d7;\n h8 = d8;\n h9 = d9;\n mpos += 16;\n bytes -= 16;\n }\n this._h[0] = h0;\n this._h[1] = h1;\n this._h[2] = h2;\n this._h[3] = h3;\n this._h[4] = h4;\n this._h[5] = h5;\n this._h[6] = h6;\n this._h[7] = h7;\n this._h[8] = h8;\n this._h[9] = h9;\n };\n Poly1305.prototype.finish = function (mac, macpos) {\n if (macpos === void 0) { macpos = 0; }\n var g = new Uint16Array(10);\n var c;\n var mask;\n var f;\n var i;\n if (this._leftover) {\n i = this._leftover;\n this._buffer[i++] = 1;\n for (; i < 16; i++) {\n this._buffer[i] = 0;\n }\n this._fin = 1;\n this._blocks(this._buffer, 0, 16);\n }\n c = this._h[1] >>> 13;\n this._h[1] &= 0x1fff;\n for (i = 2; i < 10; i++) {\n this._h[i] += c;\n c = this._h[i] >>> 13;\n this._h[i] &= 0x1fff;\n }\n this._h[0] += (c * 5);\n c = this._h[0] >>> 13;\n this._h[0] &= 0x1fff;\n this._h[1] += c;\n c = this._h[1] >>> 13;\n this._h[1] &= 0x1fff;\n this._h[2] += c;\n g[0] = this._h[0] + 5;\n c = g[0] >>> 13;\n g[0] &= 0x1fff;\n for (i = 1; i < 10; i++) {\n g[i] = this._h[i] + c;\n c = g[i] >>> 13;\n g[i] &= 0x1fff;\n }\n g[9] -= (1 << 13);\n mask = (c ^ 1) - 1;\n for (i = 0; i < 10; i++) {\n g[i] &= mask;\n }\n mask = ~mask;\n for (i = 0; i < 10; i++) {\n this._h[i] = (this._h[i] & mask) | g[i];\n }\n this._h[0] = ((this._h[0]) | (this._h[1] << 13)) & 0xffff;\n this._h[1] = ((this._h[1] >>> 3) | (this._h[2] << 10)) & 0xffff;\n this._h[2] = ((this._h[2] >>> 6) | (this._h[3] << 7)) & 0xffff;\n this._h[3] = ((this._h[3] >>> 9) | (this._h[4] << 4)) & 0xffff;\n this._h[4] = ((this._h[4] >>> 12) | (this._h[5] << 1) | (this._h[6] << 14)) & 0xffff;\n this._h[5] = ((this._h[6] >>> 2) | (this._h[7] << 11)) & 0xffff;\n this._h[6] = ((this._h[7] >>> 5) | (this._h[8] << 8)) & 0xffff;\n this._h[7] = ((this._h[8] >>> 8) | (this._h[9] << 5)) & 0xffff;\n f = this._h[0] + this._pad[0];\n this._h[0] = f & 0xffff;\n for (i = 1; i < 8; i++) {\n f = (((this._h[i] + this._pad[i]) | 0) + (f >>> 16)) | 0;\n this._h[i] = f & 0xffff;\n }\n mac[macpos + 0] = this._h[0] >>> 0;\n mac[macpos + 1] = this._h[0] >>> 8;\n mac[macpos + 2] = this._h[1] >>> 0;\n mac[macpos + 3] = this._h[1] >>> 8;\n mac[macpos + 4] = this._h[2] >>> 0;\n mac[macpos + 5] = this._h[2] >>> 8;\n mac[macpos + 6] = this._h[3] >>> 0;\n mac[macpos + 7] = this._h[3] >>> 8;\n mac[macpos + 8] = this._h[4] >>> 0;\n mac[macpos + 9] = this._h[4] >>> 8;\n mac[macpos + 10] = this._h[5] >>> 0;\n mac[macpos + 11] = this._h[5] >>> 8;\n mac[macpos + 12] = this._h[6] >>> 0;\n mac[macpos + 13] = this._h[6] >>> 8;\n mac[macpos + 14] = this._h[7] >>> 0;\n mac[macpos + 15] = this._h[7] >>> 8;\n this._finished = true;\n return this;\n };\n Poly1305.prototype.update = function (m) {\n var mpos = 0;\n var bytes = m.length;\n var want;\n if (this._leftover) {\n want = (16 - this._leftover);\n if (want > bytes) {\n want = bytes;\n }\n for (var i = 0; i < want; i++) {\n this._buffer[this._leftover + i] = m[mpos + i];\n }\n bytes -= want;\n mpos += want;\n this._leftover += want;\n if (this._leftover < 16) {\n return this;\n }\n this._blocks(this._buffer, 0, 16);\n this._leftover = 0;\n }\n if (bytes >= 16) {\n want = bytes - (bytes % 16);\n this._blocks(m, mpos, want);\n mpos += want;\n bytes -= want;\n }\n if (bytes) {\n for (var i = 0; i < bytes; i++) {\n this._buffer[this._leftover + i] = m[mpos + i];\n }\n this._leftover += bytes;\n }\n return this;\n };\n Poly1305.prototype.digest = function () {\n // TODO(dchest): it behaves differently than other hashes/HMAC,\n // because it throws when finished — others just return saved result.\n if (this._finished) {\n throw new Error(\"Poly1305 was finished\");\n }\n var mac = new Uint8Array(16);\n this.finish(mac);\n return mac;\n };\n Poly1305.prototype.clean = function () {\n wipe_1.wipe(this._buffer);\n wipe_1.wipe(this._r);\n wipe_1.wipe(this._h);\n wipe_1.wipe(this._pad);\n this._leftover = 0;\n this._fin = 0;\n this._finished = true; // mark as finished even if not\n return this;\n };\n return Poly1305;\n}());\nexports.Poly1305 = Poly1305;\n/**\n * Returns 16-byte authenticator of data using a one-time 32-byte key.\n *\n * Important: key should be used for only one message, it should never repeat.\n */\nfunction oneTimeAuth(key, data) {\n var h = new Poly1305(key);\n h.update(data);\n var digest = h.digest();\n h.clean();\n return digest;\n}\nexports.oneTimeAuth = oneTimeAuth;\n/**\n * Returns true if two authenticators are 16-byte long and equal.\n * Uses contant-time comparison to avoid leaking timing information.\n */\nfunction equal(a, b) {\n if (a.length !== exports.DIGEST_LENGTH || b.length !== exports.DIGEST_LENGTH) {\n return false;\n }\n return constant_time_1.equal(a, b);\n}\nexports.equal = equal;\n//# sourceMappingURL=poly1305.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@stablelib/poly1305/lib/poly1305.js?"); - -/***/ }), - -/***/ "./node_modules/@stablelib/random/lib/random.js": -/*!******************************************************!*\ - !*** ./node_modules/@stablelib/random/lib/random.js ***! - \******************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\n// Copyright (C) 2016 Dmitry Chestnykh\n// MIT License. See LICENSE file for details.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.randomStringForEntropy = exports.randomString = exports.randomUint32 = exports.randomBytes = exports.defaultRandomSource = void 0;\nconst system_1 = __webpack_require__(/*! ./source/system */ \"./node_modules/@stablelib/random/lib/source/system.js\");\nconst binary_1 = __webpack_require__(/*! @stablelib/binary */ \"./node_modules/@stablelib/binary/lib/binary.js\");\nconst wipe_1 = __webpack_require__(/*! @stablelib/wipe */ \"./node_modules/@stablelib/wipe/lib/wipe.js\");\nexports.defaultRandomSource = new system_1.SystemRandomSource();\nfunction randomBytes(length, prng = exports.defaultRandomSource) {\n return prng.randomBytes(length);\n}\nexports.randomBytes = randomBytes;\n/**\n * Returns a uniformly random unsigned 32-bit integer.\n */\nfunction randomUint32(prng = exports.defaultRandomSource) {\n // Generate 4-byte random buffer.\n const buf = randomBytes(4, prng);\n // Convert bytes from buffer into a 32-bit integer.\n // It's not important which byte order to use, since\n // the result is random.\n const result = (0, binary_1.readUint32LE)(buf);\n // Clean the buffer.\n (0, wipe_1.wipe)(buf);\n return result;\n}\nexports.randomUint32 = randomUint32;\n/** 62 alphanumeric characters for default charset of randomString() */\nconst ALPHANUMERIC = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\n/**\n * Returns a uniform random string of the given length\n * with characters from the given charset.\n *\n * Charset must not have more than 256 characters.\n *\n * Default charset generates case-sensitive alphanumeric\n * strings (0-9, A-Z, a-z).\n */\nfunction randomString(length, charset = ALPHANUMERIC, prng = exports.defaultRandomSource) {\n if (charset.length < 2) {\n throw new Error(\"randomString charset is too short\");\n }\n if (charset.length > 256) {\n throw new Error(\"randomString charset is too long\");\n }\n let out = '';\n const charsLen = charset.length;\n const maxByte = 256 - (256 % charsLen);\n while (length > 0) {\n const buf = randomBytes(Math.ceil(length * 256 / maxByte), prng);\n for (let i = 0; i < buf.length && length > 0; i++) {\n const randomByte = buf[i];\n if (randomByte < maxByte) {\n out += charset.charAt(randomByte % charsLen);\n length--;\n }\n }\n (0, wipe_1.wipe)(buf);\n }\n return out;\n}\nexports.randomString = randomString;\n/**\n * Returns uniform random string containing at least the given\n * number of bits of entropy.\n *\n * For example, randomStringForEntropy(128) will return a 22-character\n * alphanumeric string, while randomStringForEntropy(128, \"0123456789\")\n * will return a 39-character numeric string, both will contain at\n * least 128 bits of entropy.\n *\n * Default charset generates case-sensitive alphanumeric\n * strings (0-9, A-Z, a-z).\n */\nfunction randomStringForEntropy(bits, charset = ALPHANUMERIC, prng = exports.defaultRandomSource) {\n const length = Math.ceil(bits / (Math.log(charset.length) / Math.LN2));\n return randomString(length, charset, prng);\n}\nexports.randomStringForEntropy = randomStringForEntropy;\n//# sourceMappingURL=random.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@stablelib/random/lib/random.js?"); - -/***/ }), - -/***/ "./node_modules/@stablelib/random/lib/source/browser.js": -/*!**************************************************************!*\ - !*** ./node_modules/@stablelib/random/lib/source/browser.js ***! - \**************************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -eval("\n// Copyright (C) 2016 Dmitry Chestnykh\n// MIT License. See LICENSE file for details.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.BrowserRandomSource = void 0;\nconst QUOTA = 65536;\nclass BrowserRandomSource {\n constructor() {\n this.isAvailable = false;\n this.isInstantiated = false;\n const browserCrypto = typeof self !== 'undefined'\n ? (self.crypto || self.msCrypto) // IE11 has msCrypto\n : null;\n if (browserCrypto && browserCrypto.getRandomValues !== undefined) {\n this._crypto = browserCrypto;\n this.isAvailable = true;\n this.isInstantiated = true;\n }\n }\n randomBytes(length) {\n if (!this.isAvailable || !this._crypto) {\n throw new Error(\"Browser random byte generator is not available.\");\n }\n const out = new Uint8Array(length);\n for (let i = 0; i < out.length; i += QUOTA) {\n this._crypto.getRandomValues(out.subarray(i, i + Math.min(out.length - i, QUOTA)));\n }\n return out;\n }\n}\nexports.BrowserRandomSource = BrowserRandomSource;\n//# sourceMappingURL=browser.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@stablelib/random/lib/source/browser.js?"); - -/***/ }), - -/***/ "./node_modules/@stablelib/random/lib/source/node.js": -/*!***********************************************************!*\ - !*** ./node_modules/@stablelib/random/lib/source/node.js ***! - \***********************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\n// Copyright (C) 2016 Dmitry Chestnykh\n// MIT License. See LICENSE file for details.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.NodeRandomSource = void 0;\nconst wipe_1 = __webpack_require__(/*! @stablelib/wipe */ \"./node_modules/@stablelib/wipe/lib/wipe.js\");\nclass NodeRandomSource {\n constructor() {\n this.isAvailable = false;\n this.isInstantiated = false;\n if (true) {\n const nodeCrypto = __webpack_require__(/*! crypto */ \"?25ed\");\n if (nodeCrypto && nodeCrypto.randomBytes) {\n this._crypto = nodeCrypto;\n this.isAvailable = true;\n this.isInstantiated = true;\n }\n }\n }\n randomBytes(length) {\n if (!this.isAvailable || !this._crypto) {\n throw new Error(\"Node.js random byte generator is not available.\");\n }\n // Get random bytes (result is Buffer).\n let buffer = this._crypto.randomBytes(length);\n // Make sure we got the length that we requested.\n if (buffer.length !== length) {\n throw new Error(\"NodeRandomSource: got fewer bytes than requested\");\n }\n // Allocate output array.\n const out = new Uint8Array(length);\n // Copy bytes from buffer to output.\n for (let i = 0; i < out.length; i++) {\n out[i] = buffer[i];\n }\n // Cleanup.\n (0, wipe_1.wipe)(buffer);\n return out;\n }\n}\nexports.NodeRandomSource = NodeRandomSource;\n//# sourceMappingURL=node.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@stablelib/random/lib/source/node.js?"); - -/***/ }), - -/***/ "./node_modules/@stablelib/random/lib/source/system.js": -/*!*************************************************************!*\ - !*** ./node_modules/@stablelib/random/lib/source/system.js ***! - \*************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\n// Copyright (C) 2016 Dmitry Chestnykh\n// MIT License. See LICENSE file for details.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.SystemRandomSource = void 0;\nconst browser_1 = __webpack_require__(/*! ./browser */ \"./node_modules/@stablelib/random/lib/source/browser.js\");\nconst node_1 = __webpack_require__(/*! ./node */ \"./node_modules/@stablelib/random/lib/source/node.js\");\nclass SystemRandomSource {\n constructor() {\n this.isAvailable = false;\n this.name = \"\";\n // Try browser.\n this._source = new browser_1.BrowserRandomSource();\n if (this._source.isAvailable) {\n this.isAvailable = true;\n this.name = \"Browser\";\n return;\n }\n // If no browser source, try Node.\n this._source = new node_1.NodeRandomSource();\n if (this._source.isAvailable) {\n this.isAvailable = true;\n this.name = \"Node\";\n return;\n }\n // No sources, we're out of options.\n }\n randomBytes(length) {\n if (!this.isAvailable) {\n throw new Error(\"System random byte generator is not available.\");\n }\n return this._source.randomBytes(length);\n }\n}\nexports.SystemRandomSource = SystemRandomSource;\n//# sourceMappingURL=system.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@stablelib/random/lib/source/system.js?"); - -/***/ }), - -/***/ "./node_modules/@stablelib/sha256/lib/sha256.js": -/*!******************************************************!*\ - !*** ./node_modules/@stablelib/sha256/lib/sha256.js ***! - \******************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\n// Copyright (C) 2016 Dmitry Chestnykh\n// MIT License. See LICENSE file for details.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar binary_1 = __webpack_require__(/*! @stablelib/binary */ \"./node_modules/@stablelib/binary/lib/binary.js\");\nvar wipe_1 = __webpack_require__(/*! @stablelib/wipe */ \"./node_modules/@stablelib/wipe/lib/wipe.js\");\nexports.DIGEST_LENGTH = 32;\nexports.BLOCK_SIZE = 64;\n/**\n * SHA2-256 cryptographic hash algorithm.\n */\nvar SHA256 = /** @class */ (function () {\n function SHA256() {\n /** Length of hash output */\n this.digestLength = exports.DIGEST_LENGTH;\n /** Block size */\n this.blockSize = exports.BLOCK_SIZE;\n // Note: Int32Array is used instead of Uint32Array for performance reasons.\n this._state = new Int32Array(8); // hash state\n this._temp = new Int32Array(64); // temporary state\n this._buffer = new Uint8Array(128); // buffer for data to hash\n this._bufferLength = 0; // number of bytes in buffer\n this._bytesHashed = 0; // number of total bytes hashed\n this._finished = false; // indicates whether the hash was finalized\n this.reset();\n }\n SHA256.prototype._initState = function () {\n this._state[0] = 0x6a09e667;\n this._state[1] = 0xbb67ae85;\n this._state[2] = 0x3c6ef372;\n this._state[3] = 0xa54ff53a;\n this._state[4] = 0x510e527f;\n this._state[5] = 0x9b05688c;\n this._state[6] = 0x1f83d9ab;\n this._state[7] = 0x5be0cd19;\n };\n /**\n * Resets hash state making it possible\n * to re-use this instance to hash other data.\n */\n SHA256.prototype.reset = function () {\n this._initState();\n this._bufferLength = 0;\n this._bytesHashed = 0;\n this._finished = false;\n return this;\n };\n /**\n * Cleans internal buffers and resets hash state.\n */\n SHA256.prototype.clean = function () {\n wipe_1.wipe(this._buffer);\n wipe_1.wipe(this._temp);\n this.reset();\n };\n /**\n * Updates hash state with the given data.\n *\n * Throws error when trying to update already finalized hash:\n * instance must be reset to update it again.\n */\n SHA256.prototype.update = function (data, dataLength) {\n if (dataLength === void 0) { dataLength = data.length; }\n if (this._finished) {\n throw new Error(\"SHA256: can't update because hash was finished.\");\n }\n var dataPos = 0;\n this._bytesHashed += dataLength;\n if (this._bufferLength > 0) {\n while (this._bufferLength < this.blockSize && dataLength > 0) {\n this._buffer[this._bufferLength++] = data[dataPos++];\n dataLength--;\n }\n if (this._bufferLength === this.blockSize) {\n hashBlocks(this._temp, this._state, this._buffer, 0, this.blockSize);\n this._bufferLength = 0;\n }\n }\n if (dataLength >= this.blockSize) {\n dataPos = hashBlocks(this._temp, this._state, data, dataPos, dataLength);\n dataLength %= this.blockSize;\n }\n while (dataLength > 0) {\n this._buffer[this._bufferLength++] = data[dataPos++];\n dataLength--;\n }\n return this;\n };\n /**\n * Finalizes hash state and puts hash into out.\n * If hash was already finalized, puts the same value.\n */\n SHA256.prototype.finish = function (out) {\n if (!this._finished) {\n var bytesHashed = this._bytesHashed;\n var left = this._bufferLength;\n var bitLenHi = (bytesHashed / 0x20000000) | 0;\n var bitLenLo = bytesHashed << 3;\n var padLength = (bytesHashed % 64 < 56) ? 64 : 128;\n this._buffer[left] = 0x80;\n for (var i = left + 1; i < padLength - 8; i++) {\n this._buffer[i] = 0;\n }\n binary_1.writeUint32BE(bitLenHi, this._buffer, padLength - 8);\n binary_1.writeUint32BE(bitLenLo, this._buffer, padLength - 4);\n hashBlocks(this._temp, this._state, this._buffer, 0, padLength);\n this._finished = true;\n }\n for (var i = 0; i < this.digestLength / 4; i++) {\n binary_1.writeUint32BE(this._state[i], out, i * 4);\n }\n return this;\n };\n /**\n * Returns the final hash digest.\n */\n SHA256.prototype.digest = function () {\n var out = new Uint8Array(this.digestLength);\n this.finish(out);\n return out;\n };\n /**\n * Function useful for HMAC/PBKDF2 optimization.\n * Returns hash state to be used with restoreState().\n * Only chain value is saved, not buffers or other\n * state variables.\n */\n SHA256.prototype.saveState = function () {\n if (this._finished) {\n throw new Error(\"SHA256: cannot save finished state\");\n }\n return {\n state: new Int32Array(this._state),\n buffer: this._bufferLength > 0 ? new Uint8Array(this._buffer) : undefined,\n bufferLength: this._bufferLength,\n bytesHashed: this._bytesHashed\n };\n };\n /**\n * Function useful for HMAC/PBKDF2 optimization.\n * Restores state saved by saveState() and sets bytesHashed\n * to the given value.\n */\n SHA256.prototype.restoreState = function (savedState) {\n this._state.set(savedState.state);\n this._bufferLength = savedState.bufferLength;\n if (savedState.buffer) {\n this._buffer.set(savedState.buffer);\n }\n this._bytesHashed = savedState.bytesHashed;\n this._finished = false;\n return this;\n };\n /**\n * Cleans state returned by saveState().\n */\n SHA256.prototype.cleanSavedState = function (savedState) {\n wipe_1.wipe(savedState.state);\n if (savedState.buffer) {\n wipe_1.wipe(savedState.buffer);\n }\n savedState.bufferLength = 0;\n savedState.bytesHashed = 0;\n };\n return SHA256;\n}());\nexports.SHA256 = SHA256;\n// Constants\nvar K = new Int32Array([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b,\n 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01,\n 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7,\n 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152,\n 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147,\n 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc,\n 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819,\n 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08,\n 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f,\n 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n]);\nfunction hashBlocks(w, v, p, pos, len) {\n while (len >= 64) {\n var a = v[0];\n var b = v[1];\n var c = v[2];\n var d = v[3];\n var e = v[4];\n var f = v[5];\n var g = v[6];\n var h = v[7];\n for (var i = 0; i < 16; i++) {\n var j = pos + i * 4;\n w[i] = binary_1.readUint32BE(p, j);\n }\n for (var i = 16; i < 64; i++) {\n var u = w[i - 2];\n var t1 = (u >>> 17 | u << (32 - 17)) ^ (u >>> 19 | u << (32 - 19)) ^ (u >>> 10);\n u = w[i - 15];\n var t2 = (u >>> 7 | u << (32 - 7)) ^ (u >>> 18 | u << (32 - 18)) ^ (u >>> 3);\n w[i] = (t1 + w[i - 7] | 0) + (t2 + w[i - 16] | 0);\n }\n for (var i = 0; i < 64; i++) {\n var t1 = (((((e >>> 6 | e << (32 - 6)) ^ (e >>> 11 | e << (32 - 11)) ^\n (e >>> 25 | e << (32 - 25))) + ((e & f) ^ (~e & g))) | 0) +\n ((h + ((K[i] + w[i]) | 0)) | 0)) | 0;\n var t2 = (((a >>> 2 | a << (32 - 2)) ^ (a >>> 13 | a << (32 - 13)) ^\n (a >>> 22 | a << (32 - 22))) + ((a & b) ^ (a & c) ^ (b & c))) | 0;\n h = g;\n g = f;\n f = e;\n e = (d + t1) | 0;\n d = c;\n c = b;\n b = a;\n a = (t1 + t2) | 0;\n }\n v[0] += a;\n v[1] += b;\n v[2] += c;\n v[3] += d;\n v[4] += e;\n v[5] += f;\n v[6] += g;\n v[7] += h;\n pos += 64;\n len -= 64;\n }\n return pos;\n}\nfunction hash(data) {\n var h = new SHA256();\n h.update(data);\n var digest = h.digest();\n h.clean();\n return digest;\n}\nexports.hash = hash;\n//# sourceMappingURL=sha256.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@stablelib/sha256/lib/sha256.js?"); - -/***/ }), - -/***/ "./node_modules/@stablelib/sha512/lib/sha512.js": -/*!******************************************************!*\ - !*** ./node_modules/@stablelib/sha512/lib/sha512.js ***! - \******************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\n// Copyright (C) 2016 Dmitry Chestnykh\n// MIT License. See LICENSE file for details.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar binary_1 = __webpack_require__(/*! @stablelib/binary */ \"./node_modules/@stablelib/binary/lib/binary.js\");\nvar wipe_1 = __webpack_require__(/*! @stablelib/wipe */ \"./node_modules/@stablelib/wipe/lib/wipe.js\");\nexports.DIGEST_LENGTH = 64;\nexports.BLOCK_SIZE = 128;\n/**\n * SHA-2-512 cryptographic hash algorithm.\n */\nvar SHA512 = /** @class */ (function () {\n function SHA512() {\n /** Length of hash output */\n this.digestLength = exports.DIGEST_LENGTH;\n /** Block size */\n this.blockSize = exports.BLOCK_SIZE;\n // Note: Int32Array is used instead of Uint32Array for performance reasons.\n this._stateHi = new Int32Array(8); // hash state, high bytes\n this._stateLo = new Int32Array(8); // hash state, low bytes\n this._tempHi = new Int32Array(16); // temporary state, high bytes\n this._tempLo = new Int32Array(16); // temporary state, low bytes\n this._buffer = new Uint8Array(256); // buffer for data to hash\n this._bufferLength = 0; // number of bytes in buffer\n this._bytesHashed = 0; // number of total bytes hashed\n this._finished = false; // indicates whether the hash was finalized\n this.reset();\n }\n SHA512.prototype._initState = function () {\n this._stateHi[0] = 0x6a09e667;\n this._stateHi[1] = 0xbb67ae85;\n this._stateHi[2] = 0x3c6ef372;\n this._stateHi[3] = 0xa54ff53a;\n this._stateHi[4] = 0x510e527f;\n this._stateHi[5] = 0x9b05688c;\n this._stateHi[6] = 0x1f83d9ab;\n this._stateHi[7] = 0x5be0cd19;\n this._stateLo[0] = 0xf3bcc908;\n this._stateLo[1] = 0x84caa73b;\n this._stateLo[2] = 0xfe94f82b;\n this._stateLo[3] = 0x5f1d36f1;\n this._stateLo[4] = 0xade682d1;\n this._stateLo[5] = 0x2b3e6c1f;\n this._stateLo[6] = 0xfb41bd6b;\n this._stateLo[7] = 0x137e2179;\n };\n /**\n * Resets hash state making it possible\n * to re-use this instance to hash other data.\n */\n SHA512.prototype.reset = function () {\n this._initState();\n this._bufferLength = 0;\n this._bytesHashed = 0;\n this._finished = false;\n return this;\n };\n /**\n * Cleans internal buffers and resets hash state.\n */\n SHA512.prototype.clean = function () {\n wipe_1.wipe(this._buffer);\n wipe_1.wipe(this._tempHi);\n wipe_1.wipe(this._tempLo);\n this.reset();\n };\n /**\n * Updates hash state with the given data.\n *\n * Throws error when trying to update already finalized hash:\n * instance must be reset to update it again.\n */\n SHA512.prototype.update = function (data, dataLength) {\n if (dataLength === void 0) { dataLength = data.length; }\n if (this._finished) {\n throw new Error(\"SHA512: can't update because hash was finished.\");\n }\n var dataPos = 0;\n this._bytesHashed += dataLength;\n if (this._bufferLength > 0) {\n while (this._bufferLength < exports.BLOCK_SIZE && dataLength > 0) {\n this._buffer[this._bufferLength++] = data[dataPos++];\n dataLength--;\n }\n if (this._bufferLength === this.blockSize) {\n hashBlocks(this._tempHi, this._tempLo, this._stateHi, this._stateLo, this._buffer, 0, this.blockSize);\n this._bufferLength = 0;\n }\n }\n if (dataLength >= this.blockSize) {\n dataPos = hashBlocks(this._tempHi, this._tempLo, this._stateHi, this._stateLo, data, dataPos, dataLength);\n dataLength %= this.blockSize;\n }\n while (dataLength > 0) {\n this._buffer[this._bufferLength++] = data[dataPos++];\n dataLength--;\n }\n return this;\n };\n /**\n * Finalizes hash state and puts hash into out.\n * If hash was already finalized, puts the same value.\n */\n SHA512.prototype.finish = function (out) {\n if (!this._finished) {\n var bytesHashed = this._bytesHashed;\n var left = this._bufferLength;\n var bitLenHi = (bytesHashed / 0x20000000) | 0;\n var bitLenLo = bytesHashed << 3;\n var padLength = (bytesHashed % 128 < 112) ? 128 : 256;\n this._buffer[left] = 0x80;\n for (var i = left + 1; i < padLength - 8; i++) {\n this._buffer[i] = 0;\n }\n binary_1.writeUint32BE(bitLenHi, this._buffer, padLength - 8);\n binary_1.writeUint32BE(bitLenLo, this._buffer, padLength - 4);\n hashBlocks(this._tempHi, this._tempLo, this._stateHi, this._stateLo, this._buffer, 0, padLength);\n this._finished = true;\n }\n for (var i = 0; i < this.digestLength / 8; i++) {\n binary_1.writeUint32BE(this._stateHi[i], out, i * 8);\n binary_1.writeUint32BE(this._stateLo[i], out, i * 8 + 4);\n }\n return this;\n };\n /**\n * Returns the final hash digest.\n */\n SHA512.prototype.digest = function () {\n var out = new Uint8Array(this.digestLength);\n this.finish(out);\n return out;\n };\n /**\n * Function useful for HMAC/PBKDF2 optimization. Returns hash state to be\n * used with restoreState(). Only chain value is saved, not buffers or\n * other state variables.\n */\n SHA512.prototype.saveState = function () {\n if (this._finished) {\n throw new Error(\"SHA256: cannot save finished state\");\n }\n return {\n stateHi: new Int32Array(this._stateHi),\n stateLo: new Int32Array(this._stateLo),\n buffer: this._bufferLength > 0 ? new Uint8Array(this._buffer) : undefined,\n bufferLength: this._bufferLength,\n bytesHashed: this._bytesHashed\n };\n };\n /**\n * Function useful for HMAC/PBKDF2 optimization. Restores state saved by\n * saveState() and sets bytesHashed to the given value.\n */\n SHA512.prototype.restoreState = function (savedState) {\n this._stateHi.set(savedState.stateHi);\n this._stateLo.set(savedState.stateLo);\n this._bufferLength = savedState.bufferLength;\n if (savedState.buffer) {\n this._buffer.set(savedState.buffer);\n }\n this._bytesHashed = savedState.bytesHashed;\n this._finished = false;\n return this;\n };\n /**\n * Cleans state returned by saveState().\n */\n SHA512.prototype.cleanSavedState = function (savedState) {\n wipe_1.wipe(savedState.stateHi);\n wipe_1.wipe(savedState.stateLo);\n if (savedState.buffer) {\n wipe_1.wipe(savedState.buffer);\n }\n savedState.bufferLength = 0;\n savedState.bytesHashed = 0;\n };\n return SHA512;\n}());\nexports.SHA512 = SHA512;\n// Constants\nvar K = new Int32Array([\n 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\n 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\n 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\n 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\n 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\n 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\n 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\n 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\n 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\n 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\n 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\n 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\n 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\n 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\n 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\n 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\n 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\n 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\n 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\n 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\n 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\n 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\n 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\n 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\n 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\n 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\n 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\n 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\n 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\n 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\n 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\n 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\n 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\n 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\n 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\n 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\n 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\n 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\n 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\n 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\n]);\nfunction hashBlocks(wh, wl, hh, hl, m, pos, len) {\n var ah0 = hh[0], ah1 = hh[1], ah2 = hh[2], ah3 = hh[3], ah4 = hh[4], ah5 = hh[5], ah6 = hh[6], ah7 = hh[7], al0 = hl[0], al1 = hl[1], al2 = hl[2], al3 = hl[3], al4 = hl[4], al5 = hl[5], al6 = hl[6], al7 = hl[7];\n var h, l;\n var th, tl;\n var a, b, c, d;\n while (len >= 128) {\n for (var i = 0; i < 16; i++) {\n var j = 8 * i + pos;\n wh[i] = binary_1.readUint32BE(m, j);\n wl[i] = binary_1.readUint32BE(m, j + 4);\n }\n for (var i = 0; i < 80; i++) {\n var bh0 = ah0;\n var bh1 = ah1;\n var bh2 = ah2;\n var bh3 = ah3;\n var bh4 = ah4;\n var bh5 = ah5;\n var bh6 = ah6;\n var bh7 = ah7;\n var bl0 = al0;\n var bl1 = al1;\n var bl2 = al2;\n var bl3 = al3;\n var bl4 = al4;\n var bl5 = al5;\n var bl6 = al6;\n var bl7 = al7;\n // add\n h = ah7;\n l = al7;\n a = l & 0xffff;\n b = l >>> 16;\n c = h & 0xffff;\n d = h >>> 16;\n // Sigma1\n h = ((ah4 >>> 14) | (al4 << (32 - 14))) ^ ((ah4 >>> 18) |\n (al4 << (32 - 18))) ^ ((al4 >>> (41 - 32)) | (ah4 << (32 - (41 - 32))));\n l = ((al4 >>> 14) | (ah4 << (32 - 14))) ^ ((al4 >>> 18) |\n (ah4 << (32 - 18))) ^ ((ah4 >>> (41 - 32)) | (al4 << (32 - (41 - 32))));\n a += l & 0xffff;\n b += l >>> 16;\n c += h & 0xffff;\n d += h >>> 16;\n // Ch\n h = (ah4 & ah5) ^ (~ah4 & ah6);\n l = (al4 & al5) ^ (~al4 & al6);\n a += l & 0xffff;\n b += l >>> 16;\n c += h & 0xffff;\n d += h >>> 16;\n // K\n h = K[i * 2];\n l = K[i * 2 + 1];\n a += l & 0xffff;\n b += l >>> 16;\n c += h & 0xffff;\n d += h >>> 16;\n // w\n h = wh[i % 16];\n l = wl[i % 16];\n a += l & 0xffff;\n b += l >>> 16;\n c += h & 0xffff;\n d += h >>> 16;\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n th = c & 0xffff | d << 16;\n tl = a & 0xffff | b << 16;\n // add\n h = th;\n l = tl;\n a = l & 0xffff;\n b = l >>> 16;\n c = h & 0xffff;\n d = h >>> 16;\n // Sigma0\n h = ((ah0 >>> 28) | (al0 << (32 - 28))) ^ ((al0 >>> (34 - 32)) |\n (ah0 << (32 - (34 - 32)))) ^ ((al0 >>> (39 - 32)) | (ah0 << (32 - (39 - 32))));\n l = ((al0 >>> 28) | (ah0 << (32 - 28))) ^ ((ah0 >>> (34 - 32)) |\n (al0 << (32 - (34 - 32)))) ^ ((ah0 >>> (39 - 32)) | (al0 << (32 - (39 - 32))));\n a += l & 0xffff;\n b += l >>> 16;\n c += h & 0xffff;\n d += h >>> 16;\n // Maj\n h = (ah0 & ah1) ^ (ah0 & ah2) ^ (ah1 & ah2);\n l = (al0 & al1) ^ (al0 & al2) ^ (al1 & al2);\n a += l & 0xffff;\n b += l >>> 16;\n c += h & 0xffff;\n d += h >>> 16;\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n bh7 = (c & 0xffff) | (d << 16);\n bl7 = (a & 0xffff) | (b << 16);\n // add\n h = bh3;\n l = bl3;\n a = l & 0xffff;\n b = l >>> 16;\n c = h & 0xffff;\n d = h >>> 16;\n h = th;\n l = tl;\n a += l & 0xffff;\n b += l >>> 16;\n c += h & 0xffff;\n d += h >>> 16;\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n bh3 = (c & 0xffff) | (d << 16);\n bl3 = (a & 0xffff) | (b << 16);\n ah1 = bh0;\n ah2 = bh1;\n ah3 = bh2;\n ah4 = bh3;\n ah5 = bh4;\n ah6 = bh5;\n ah7 = bh6;\n ah0 = bh7;\n al1 = bl0;\n al2 = bl1;\n al3 = bl2;\n al4 = bl3;\n al5 = bl4;\n al6 = bl5;\n al7 = bl6;\n al0 = bl7;\n if (i % 16 === 15) {\n for (var j = 0; j < 16; j++) {\n // add\n h = wh[j];\n l = wl[j];\n a = l & 0xffff;\n b = l >>> 16;\n c = h & 0xffff;\n d = h >>> 16;\n h = wh[(j + 9) % 16];\n l = wl[(j + 9) % 16];\n a += l & 0xffff;\n b += l >>> 16;\n c += h & 0xffff;\n d += h >>> 16;\n // sigma0\n th = wh[(j + 1) % 16];\n tl = wl[(j + 1) % 16];\n h = ((th >>> 1) | (tl << (32 - 1))) ^ ((th >>> 8) |\n (tl << (32 - 8))) ^ (th >>> 7);\n l = ((tl >>> 1) | (th << (32 - 1))) ^ ((tl >>> 8) |\n (th << (32 - 8))) ^ ((tl >>> 7) | (th << (32 - 7)));\n a += l & 0xffff;\n b += l >>> 16;\n c += h & 0xffff;\n d += h >>> 16;\n // sigma1\n th = wh[(j + 14) % 16];\n tl = wl[(j + 14) % 16];\n h = ((th >>> 19) | (tl << (32 - 19))) ^ ((tl >>> (61 - 32)) |\n (th << (32 - (61 - 32)))) ^ (th >>> 6);\n l = ((tl >>> 19) | (th << (32 - 19))) ^ ((th >>> (61 - 32)) |\n (tl << (32 - (61 - 32)))) ^ ((tl >>> 6) | (th << (32 - 6)));\n a += l & 0xffff;\n b += l >>> 16;\n c += h & 0xffff;\n d += h >>> 16;\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n wh[j] = (c & 0xffff) | (d << 16);\n wl[j] = (a & 0xffff) | (b << 16);\n }\n }\n }\n // add\n h = ah0;\n l = al0;\n a = l & 0xffff;\n b = l >>> 16;\n c = h & 0xffff;\n d = h >>> 16;\n h = hh[0];\n l = hl[0];\n a += l & 0xffff;\n b += l >>> 16;\n c += h & 0xffff;\n d += h >>> 16;\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n hh[0] = ah0 = (c & 0xffff) | (d << 16);\n hl[0] = al0 = (a & 0xffff) | (b << 16);\n h = ah1;\n l = al1;\n a = l & 0xffff;\n b = l >>> 16;\n c = h & 0xffff;\n d = h >>> 16;\n h = hh[1];\n l = hl[1];\n a += l & 0xffff;\n b += l >>> 16;\n c += h & 0xffff;\n d += h >>> 16;\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n hh[1] = ah1 = (c & 0xffff) | (d << 16);\n hl[1] = al1 = (a & 0xffff) | (b << 16);\n h = ah2;\n l = al2;\n a = l & 0xffff;\n b = l >>> 16;\n c = h & 0xffff;\n d = h >>> 16;\n h = hh[2];\n l = hl[2];\n a += l & 0xffff;\n b += l >>> 16;\n c += h & 0xffff;\n d += h >>> 16;\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n hh[2] = ah2 = (c & 0xffff) | (d << 16);\n hl[2] = al2 = (a & 0xffff) | (b << 16);\n h = ah3;\n l = al3;\n a = l & 0xffff;\n b = l >>> 16;\n c = h & 0xffff;\n d = h >>> 16;\n h = hh[3];\n l = hl[3];\n a += l & 0xffff;\n b += l >>> 16;\n c += h & 0xffff;\n d += h >>> 16;\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n hh[3] = ah3 = (c & 0xffff) | (d << 16);\n hl[3] = al3 = (a & 0xffff) | (b << 16);\n h = ah4;\n l = al4;\n a = l & 0xffff;\n b = l >>> 16;\n c = h & 0xffff;\n d = h >>> 16;\n h = hh[4];\n l = hl[4];\n a += l & 0xffff;\n b += l >>> 16;\n c += h & 0xffff;\n d += h >>> 16;\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n hh[4] = ah4 = (c & 0xffff) | (d << 16);\n hl[4] = al4 = (a & 0xffff) | (b << 16);\n h = ah5;\n l = al5;\n a = l & 0xffff;\n b = l >>> 16;\n c = h & 0xffff;\n d = h >>> 16;\n h = hh[5];\n l = hl[5];\n a += l & 0xffff;\n b += l >>> 16;\n c += h & 0xffff;\n d += h >>> 16;\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n hh[5] = ah5 = (c & 0xffff) | (d << 16);\n hl[5] = al5 = (a & 0xffff) | (b << 16);\n h = ah6;\n l = al6;\n a = l & 0xffff;\n b = l >>> 16;\n c = h & 0xffff;\n d = h >>> 16;\n h = hh[6];\n l = hl[6];\n a += l & 0xffff;\n b += l >>> 16;\n c += h & 0xffff;\n d += h >>> 16;\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n hh[6] = ah6 = (c & 0xffff) | (d << 16);\n hl[6] = al6 = (a & 0xffff) | (b << 16);\n h = ah7;\n l = al7;\n a = l & 0xffff;\n b = l >>> 16;\n c = h & 0xffff;\n d = h >>> 16;\n h = hh[7];\n l = hl[7];\n a += l & 0xffff;\n b += l >>> 16;\n c += h & 0xffff;\n d += h >>> 16;\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n hh[7] = ah7 = (c & 0xffff) | (d << 16);\n hl[7] = al7 = (a & 0xffff) | (b << 16);\n pos += 128;\n len -= 128;\n }\n return pos;\n}\nfunction hash(data) {\n var h = new SHA512();\n h.update(data);\n var digest = h.digest();\n h.clean();\n return digest;\n}\nexports.hash = hash;\n//# sourceMappingURL=sha512.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@stablelib/sha512/lib/sha512.js?"); - -/***/ }), - -/***/ "./node_modules/@stablelib/wipe/lib/wipe.js": -/*!**************************************************!*\ - !*** ./node_modules/@stablelib/wipe/lib/wipe.js ***! - \**************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -eval("\n// Copyright (C) 2016 Dmitry Chestnykh\n// MIT License. See LICENSE file for details.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n/**\n * Sets all values in the given array to zero and returns it.\n *\n * The fact that it sets bytes to zero can be relied on.\n *\n * There is no guarantee that this function makes data disappear from memory,\n * as runtime implementation can, for example, have copying garbage collector\n * that will make copies of sensitive data before we wipe it. Or that an\n * operating system will write our data to swap or sleep image. Another thing\n * is that an optimizing compiler can remove calls to this function or make it\n * no-op. There's nothing we can do with it, so we just do our best and hope\n * that everything will be okay and good will triumph over evil.\n */\nfunction wipe(array) {\n // Right now it's similar to array.fill(0). If it turns\n // out that runtimes optimize this call away, maybe\n // we can try something else.\n for (var i = 0; i < array.length; i++) {\n array[i] = 0;\n }\n return array;\n}\nexports.wipe = wipe;\n//# sourceMappingURL=wipe.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@stablelib/wipe/lib/wipe.js?"); - -/***/ }), - -/***/ "./node_modules/@stablelib/x25519/lib/x25519.js": -/*!******************************************************!*\ - !*** ./node_modules/@stablelib/x25519/lib/x25519.js ***! - \******************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\n// Copyright (C) 2016 Dmitry Chestnykh\n// MIT License. See LICENSE file for details.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.sharedKey = exports.generateKeyPair = exports.generateKeyPairFromSeed = exports.scalarMultBase = exports.scalarMult = exports.SHARED_KEY_LENGTH = exports.SECRET_KEY_LENGTH = exports.PUBLIC_KEY_LENGTH = void 0;\n/**\n * Package x25519 implements X25519 key agreement.\n */\nconst random_1 = __webpack_require__(/*! @stablelib/random */ \"./node_modules/@stablelib/random/lib/random.js\");\nconst wipe_1 = __webpack_require__(/*! @stablelib/wipe */ \"./node_modules/@stablelib/wipe/lib/wipe.js\");\nexports.PUBLIC_KEY_LENGTH = 32;\nexports.SECRET_KEY_LENGTH = 32;\nexports.SHARED_KEY_LENGTH = 32;\n// Returns new zero-filled 16-element GF (Float64Array).\n// If passed an array of numbers, prefills the returned\n// array with them.\n//\n// We use Float64Array, because we need 48-bit numbers\n// for this implementation.\nfunction gf(init) {\n const r = new Float64Array(16);\n if (init) {\n for (let i = 0; i < init.length; i++) {\n r[i] = init[i];\n }\n }\n return r;\n}\n// Base point.\nconst _9 = new Uint8Array(32);\n_9[0] = 9;\nconst _121665 = gf([0xdb41, 1]);\nfunction car25519(o) {\n let c = 1;\n for (let i = 0; i < 16; i++) {\n let v = o[i] + c + 65535;\n c = Math.floor(v / 65536);\n o[i] = v - c * 65536;\n }\n o[0] += c - 1 + 37 * (c - 1);\n}\nfunction sel25519(p, q, b) {\n const c = ~(b - 1);\n for (let i = 0; i < 16; i++) {\n const t = c & (p[i] ^ q[i]);\n p[i] ^= t;\n q[i] ^= t;\n }\n}\nfunction pack25519(o, n) {\n const m = gf();\n const t = gf();\n for (let i = 0; i < 16; i++) {\n t[i] = n[i];\n }\n car25519(t);\n car25519(t);\n car25519(t);\n for (let j = 0; j < 2; j++) {\n m[0] = t[0] - 0xffed;\n for (let i = 1; i < 15; i++) {\n m[i] = t[i] - 0xffff - ((m[i - 1] >> 16) & 1);\n m[i - 1] &= 0xffff;\n }\n m[15] = t[15] - 0x7fff - ((m[14] >> 16) & 1);\n const b = (m[15] >> 16) & 1;\n m[14] &= 0xffff;\n sel25519(t, m, 1 - b);\n }\n for (let i = 0; i < 16; i++) {\n o[2 * i] = t[i] & 0xff;\n o[2 * i + 1] = t[i] >> 8;\n }\n}\nfunction unpack25519(o, n) {\n for (let i = 0; i < 16; i++) {\n o[i] = n[2 * i] + (n[2 * i + 1] << 8);\n }\n o[15] &= 0x7fff;\n}\nfunction add(o, a, b) {\n for (let i = 0; i < 16; i++) {\n o[i] = a[i] + b[i];\n }\n}\nfunction sub(o, a, b) {\n for (let i = 0; i < 16; i++) {\n o[i] = a[i] - b[i];\n }\n}\nfunction mul(o, a, b) {\n let v, c, t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0, t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0, t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0, b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3], b4 = b[4], b5 = b[5], b6 = b[6], b7 = b[7], b8 = b[8], b9 = b[9], b10 = b[10], b11 = b[11], b12 = b[12], b13 = b[13], b14 = b[14], b15 = b[15];\n v = a[0];\n t0 += v * b0;\n t1 += v * b1;\n t2 += v * b2;\n t3 += v * b3;\n t4 += v * b4;\n t5 += v * b5;\n t6 += v * b6;\n t7 += v * b7;\n t8 += v * b8;\n t9 += v * b9;\n t10 += v * b10;\n t11 += v * b11;\n t12 += v * b12;\n t13 += v * b13;\n t14 += v * b14;\n t15 += v * b15;\n v = a[1];\n t1 += v * b0;\n t2 += v * b1;\n t3 += v * b2;\n t4 += v * b3;\n t5 += v * b4;\n t6 += v * b5;\n t7 += v * b6;\n t8 += v * b7;\n t9 += v * b8;\n t10 += v * b9;\n t11 += v * b10;\n t12 += v * b11;\n t13 += v * b12;\n t14 += v * b13;\n t15 += v * b14;\n t16 += v * b15;\n v = a[2];\n t2 += v * b0;\n t3 += v * b1;\n t4 += v * b2;\n t5 += v * b3;\n t6 += v * b4;\n t7 += v * b5;\n t8 += v * b6;\n t9 += v * b7;\n t10 += v * b8;\n t11 += v * b9;\n t12 += v * b10;\n t13 += v * b11;\n t14 += v * b12;\n t15 += v * b13;\n t16 += v * b14;\n t17 += v * b15;\n v = a[3];\n t3 += v * b0;\n t4 += v * b1;\n t5 += v * b2;\n t6 += v * b3;\n t7 += v * b4;\n t8 += v * b5;\n t9 += v * b6;\n t10 += v * b7;\n t11 += v * b8;\n t12 += v * b9;\n t13 += v * b10;\n t14 += v * b11;\n t15 += v * b12;\n t16 += v * b13;\n t17 += v * b14;\n t18 += v * b15;\n v = a[4];\n t4 += v * b0;\n t5 += v * b1;\n t6 += v * b2;\n t7 += v * b3;\n t8 += v * b4;\n t9 += v * b5;\n t10 += v * b6;\n t11 += v * b7;\n t12 += v * b8;\n t13 += v * b9;\n t14 += v * b10;\n t15 += v * b11;\n t16 += v * b12;\n t17 += v * b13;\n t18 += v * b14;\n t19 += v * b15;\n v = a[5];\n t5 += v * b0;\n t6 += v * b1;\n t7 += v * b2;\n t8 += v * b3;\n t9 += v * b4;\n t10 += v * b5;\n t11 += v * b6;\n t12 += v * b7;\n t13 += v * b8;\n t14 += v * b9;\n t15 += v * b10;\n t16 += v * b11;\n t17 += v * b12;\n t18 += v * b13;\n t19 += v * b14;\n t20 += v * b15;\n v = a[6];\n t6 += v * b0;\n t7 += v * b1;\n t8 += v * b2;\n t9 += v * b3;\n t10 += v * b4;\n t11 += v * b5;\n t12 += v * b6;\n t13 += v * b7;\n t14 += v * b8;\n t15 += v * b9;\n t16 += v * b10;\n t17 += v * b11;\n t18 += v * b12;\n t19 += v * b13;\n t20 += v * b14;\n t21 += v * b15;\n v = a[7];\n t7 += v * b0;\n t8 += v * b1;\n t9 += v * b2;\n t10 += v * b3;\n t11 += v * b4;\n t12 += v * b5;\n t13 += v * b6;\n t14 += v * b7;\n t15 += v * b8;\n t16 += v * b9;\n t17 += v * b10;\n t18 += v * b11;\n t19 += v * b12;\n t20 += v * b13;\n t21 += v * b14;\n t22 += v * b15;\n v = a[8];\n t8 += v * b0;\n t9 += v * b1;\n t10 += v * b2;\n t11 += v * b3;\n t12 += v * b4;\n t13 += v * b5;\n t14 += v * b6;\n t15 += v * b7;\n t16 += v * b8;\n t17 += v * b9;\n t18 += v * b10;\n t19 += v * b11;\n t20 += v * b12;\n t21 += v * b13;\n t22 += v * b14;\n t23 += v * b15;\n v = a[9];\n t9 += v * b0;\n t10 += v * b1;\n t11 += v * b2;\n t12 += v * b3;\n t13 += v * b4;\n t14 += v * b5;\n t15 += v * b6;\n t16 += v * b7;\n t17 += v * b8;\n t18 += v * b9;\n t19 += v * b10;\n t20 += v * b11;\n t21 += v * b12;\n t22 += v * b13;\n t23 += v * b14;\n t24 += v * b15;\n v = a[10];\n t10 += v * b0;\n t11 += v * b1;\n t12 += v * b2;\n t13 += v * b3;\n t14 += v * b4;\n t15 += v * b5;\n t16 += v * b6;\n t17 += v * b7;\n t18 += v * b8;\n t19 += v * b9;\n t20 += v * b10;\n t21 += v * b11;\n t22 += v * b12;\n t23 += v * b13;\n t24 += v * b14;\n t25 += v * b15;\n v = a[11];\n t11 += v * b0;\n t12 += v * b1;\n t13 += v * b2;\n t14 += v * b3;\n t15 += v * b4;\n t16 += v * b5;\n t17 += v * b6;\n t18 += v * b7;\n t19 += v * b8;\n t20 += v * b9;\n t21 += v * b10;\n t22 += v * b11;\n t23 += v * b12;\n t24 += v * b13;\n t25 += v * b14;\n t26 += v * b15;\n v = a[12];\n t12 += v * b0;\n t13 += v * b1;\n t14 += v * b2;\n t15 += v * b3;\n t16 += v * b4;\n t17 += v * b5;\n t18 += v * b6;\n t19 += v * b7;\n t20 += v * b8;\n t21 += v * b9;\n t22 += v * b10;\n t23 += v * b11;\n t24 += v * b12;\n t25 += v * b13;\n t26 += v * b14;\n t27 += v * b15;\n v = a[13];\n t13 += v * b0;\n t14 += v * b1;\n t15 += v * b2;\n t16 += v * b3;\n t17 += v * b4;\n t18 += v * b5;\n t19 += v * b6;\n t20 += v * b7;\n t21 += v * b8;\n t22 += v * b9;\n t23 += v * b10;\n t24 += v * b11;\n t25 += v * b12;\n t26 += v * b13;\n t27 += v * b14;\n t28 += v * b15;\n v = a[14];\n t14 += v * b0;\n t15 += v * b1;\n t16 += v * b2;\n t17 += v * b3;\n t18 += v * b4;\n t19 += v * b5;\n t20 += v * b6;\n t21 += v * b7;\n t22 += v * b8;\n t23 += v * b9;\n t24 += v * b10;\n t25 += v * b11;\n t26 += v * b12;\n t27 += v * b13;\n t28 += v * b14;\n t29 += v * b15;\n v = a[15];\n t15 += v * b0;\n t16 += v * b1;\n t17 += v * b2;\n t18 += v * b3;\n t19 += v * b4;\n t20 += v * b5;\n t21 += v * b6;\n t22 += v * b7;\n t23 += v * b8;\n t24 += v * b9;\n t25 += v * b10;\n t26 += v * b11;\n t27 += v * b12;\n t28 += v * b13;\n t29 += v * b14;\n t30 += v * b15;\n t0 += 38 * t16;\n t1 += 38 * t17;\n t2 += 38 * t18;\n t3 += 38 * t19;\n t4 += 38 * t20;\n t5 += 38 * t21;\n t6 += 38 * t22;\n t7 += 38 * t23;\n t8 += 38 * t24;\n t9 += 38 * t25;\n t10 += 38 * t26;\n t11 += 38 * t27;\n t12 += 38 * t28;\n t13 += 38 * t29;\n t14 += 38 * t30;\n // t15 left as is\n // first car\n c = 1;\n v = t0 + c + 65535;\n c = Math.floor(v / 65536);\n t0 = v - c * 65536;\n v = t1 + c + 65535;\n c = Math.floor(v / 65536);\n t1 = v - c * 65536;\n v = t2 + c + 65535;\n c = Math.floor(v / 65536);\n t2 = v - c * 65536;\n v = t3 + c + 65535;\n c = Math.floor(v / 65536);\n t3 = v - c * 65536;\n v = t4 + c + 65535;\n c = Math.floor(v / 65536);\n t4 = v - c * 65536;\n v = t5 + c + 65535;\n c = Math.floor(v / 65536);\n t5 = v - c * 65536;\n v = t6 + c + 65535;\n c = Math.floor(v / 65536);\n t6 = v - c * 65536;\n v = t7 + c + 65535;\n c = Math.floor(v / 65536);\n t7 = v - c * 65536;\n v = t8 + c + 65535;\n c = Math.floor(v / 65536);\n t8 = v - c * 65536;\n v = t9 + c + 65535;\n c = Math.floor(v / 65536);\n t9 = v - c * 65536;\n v = t10 + c + 65535;\n c = Math.floor(v / 65536);\n t10 = v - c * 65536;\n v = t11 + c + 65535;\n c = Math.floor(v / 65536);\n t11 = v - c * 65536;\n v = t12 + c + 65535;\n c = Math.floor(v / 65536);\n t12 = v - c * 65536;\n v = t13 + c + 65535;\n c = Math.floor(v / 65536);\n t13 = v - c * 65536;\n v = t14 + c + 65535;\n c = Math.floor(v / 65536);\n t14 = v - c * 65536;\n v = t15 + c + 65535;\n c = Math.floor(v / 65536);\n t15 = v - c * 65536;\n t0 += c - 1 + 37 * (c - 1);\n // second car\n c = 1;\n v = t0 + c + 65535;\n c = Math.floor(v / 65536);\n t0 = v - c * 65536;\n v = t1 + c + 65535;\n c = Math.floor(v / 65536);\n t1 = v - c * 65536;\n v = t2 + c + 65535;\n c = Math.floor(v / 65536);\n t2 = v - c * 65536;\n v = t3 + c + 65535;\n c = Math.floor(v / 65536);\n t3 = v - c * 65536;\n v = t4 + c + 65535;\n c = Math.floor(v / 65536);\n t4 = v - c * 65536;\n v = t5 + c + 65535;\n c = Math.floor(v / 65536);\n t5 = v - c * 65536;\n v = t6 + c + 65535;\n c = Math.floor(v / 65536);\n t6 = v - c * 65536;\n v = t7 + c + 65535;\n c = Math.floor(v / 65536);\n t7 = v - c * 65536;\n v = t8 + c + 65535;\n c = Math.floor(v / 65536);\n t8 = v - c * 65536;\n v = t9 + c + 65535;\n c = Math.floor(v / 65536);\n t9 = v - c * 65536;\n v = t10 + c + 65535;\n c = Math.floor(v / 65536);\n t10 = v - c * 65536;\n v = t11 + c + 65535;\n c = Math.floor(v / 65536);\n t11 = v - c * 65536;\n v = t12 + c + 65535;\n c = Math.floor(v / 65536);\n t12 = v - c * 65536;\n v = t13 + c + 65535;\n c = Math.floor(v / 65536);\n t13 = v - c * 65536;\n v = t14 + c + 65535;\n c = Math.floor(v / 65536);\n t14 = v - c * 65536;\n v = t15 + c + 65535;\n c = Math.floor(v / 65536);\n t15 = v - c * 65536;\n t0 += c - 1 + 37 * (c - 1);\n o[0] = t0;\n o[1] = t1;\n o[2] = t2;\n o[3] = t3;\n o[4] = t4;\n o[5] = t5;\n o[6] = t6;\n o[7] = t7;\n o[8] = t8;\n o[9] = t9;\n o[10] = t10;\n o[11] = t11;\n o[12] = t12;\n o[13] = t13;\n o[14] = t14;\n o[15] = t15;\n}\nfunction square(o, a) {\n mul(o, a, a);\n}\nfunction inv25519(o, inp) {\n const c = gf();\n for (let i = 0; i < 16; i++) {\n c[i] = inp[i];\n }\n for (let i = 253; i >= 0; i--) {\n square(c, c);\n if (i !== 2 && i !== 4) {\n mul(c, c, inp);\n }\n }\n for (let i = 0; i < 16; i++) {\n o[i] = c[i];\n }\n}\nfunction scalarMult(n, p) {\n const z = new Uint8Array(32);\n const x = new Float64Array(80);\n const a = gf(), b = gf(), c = gf(), d = gf(), e = gf(), f = gf();\n for (let i = 0; i < 31; i++) {\n z[i] = n[i];\n }\n z[31] = (n[31] & 127) | 64;\n z[0] &= 248;\n unpack25519(x, p);\n for (let i = 0; i < 16; i++) {\n b[i] = x[i];\n }\n a[0] = d[0] = 1;\n for (let i = 254; i >= 0; --i) {\n const r = (z[i >>> 3] >>> (i & 7)) & 1;\n sel25519(a, b, r);\n sel25519(c, d, r);\n add(e, a, c);\n sub(a, a, c);\n add(c, b, d);\n sub(b, b, d);\n square(d, e);\n square(f, a);\n mul(a, c, a);\n mul(c, b, e);\n add(e, a, c);\n sub(a, a, c);\n square(b, a);\n sub(c, d, f);\n mul(a, c, _121665);\n add(a, a, d);\n mul(c, c, a);\n mul(a, d, f);\n mul(d, b, x);\n square(b, e);\n sel25519(a, b, r);\n sel25519(c, d, r);\n }\n for (let i = 0; i < 16; i++) {\n x[i + 16] = a[i];\n x[i + 32] = c[i];\n x[i + 48] = b[i];\n x[i + 64] = d[i];\n }\n const x32 = x.subarray(32);\n const x16 = x.subarray(16);\n inv25519(x32, x32);\n mul(x16, x16, x32);\n const q = new Uint8Array(32);\n pack25519(q, x16);\n return q;\n}\nexports.scalarMult = scalarMult;\nfunction scalarMultBase(n) {\n return scalarMult(n, _9);\n}\nexports.scalarMultBase = scalarMultBase;\nfunction generateKeyPairFromSeed(seed) {\n if (seed.length !== exports.SECRET_KEY_LENGTH) {\n throw new Error(`x25519: seed must be ${exports.SECRET_KEY_LENGTH} bytes`);\n }\n const secretKey = new Uint8Array(seed);\n const publicKey = scalarMultBase(secretKey);\n return {\n publicKey,\n secretKey\n };\n}\nexports.generateKeyPairFromSeed = generateKeyPairFromSeed;\nfunction generateKeyPair(prng) {\n const seed = (0, random_1.randomBytes)(32, prng);\n const result = generateKeyPairFromSeed(seed);\n (0, wipe_1.wipe)(seed);\n return result;\n}\nexports.generateKeyPair = generateKeyPair;\n/**\n * Returns a shared key between our secret key and a peer's public key.\n *\n * Throws an error if the given keys are of wrong length.\n *\n * If rejectZero is true throws if the calculated shared key is all-zero.\n * From RFC 7748:\n *\n * > Protocol designers using Diffie-Hellman over the curves defined in\n * > this document must not assume \"contributory behavior\". Specially,\n * > contributory behavior means that both parties' private keys\n * > contribute to the resulting shared key. Since curve25519 and\n * > curve448 have cofactors of 8 and 4 (respectively), an input point of\n * > small order will eliminate any contribution from the other party's\n * > private key. This situation can be detected by checking for the all-\n * > zero output, which implementations MAY do, as specified in Section 6.\n * > However, a large number of existing implementations do not do this.\n *\n * IMPORTANT: the returned key is a raw result of scalar multiplication.\n * To use it as a key material, hash it with a cryptographic hash function.\n */\nfunction sharedKey(mySecretKey, theirPublicKey, rejectZero = false) {\n if (mySecretKey.length !== exports.PUBLIC_KEY_LENGTH) {\n throw new Error(\"X25519: incorrect secret key length\");\n }\n if (theirPublicKey.length !== exports.PUBLIC_KEY_LENGTH) {\n throw new Error(\"X25519: incorrect public key length\");\n }\n const result = scalarMult(mySecretKey, theirPublicKey);\n if (rejectZero) {\n let zeros = 0;\n for (let i = 0; i < result.length; i++) {\n zeros |= result[i];\n }\n if (zeros === 0) {\n throw new Error(\"X25519: invalid shared key\");\n }\n }\n return result;\n}\nexports.sharedKey = sharedKey;\n//# sourceMappingURL=x25519.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@stablelib/x25519/lib/x25519.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/auth-client/dist/index.es.js": -/*!******************************************************************!*\ - !*** ./node_modules/@walletconnect/auth-client/dist/index.es.js ***! - \******************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AUTH_CLIENT_CONTEXT: () => (/* binding */ Z),\n/* harmony export */ AUTH_CLIENT_DEFAULT_NAME: () => (/* binding */ B),\n/* harmony export */ AUTH_CLIENT_PROTOCOL: () => (/* binding */ $),\n/* harmony export */ AUTH_CLIENT_PUBLIC_KEY_NAME: () => (/* binding */ x),\n/* harmony export */ AUTH_CLIENT_STORAGE_PREFIX: () => (/* binding */ F),\n/* harmony export */ AUTH_CLIENT_VERSION: () => (/* binding */ Q),\n/* harmony export */ AUTH_REQUEST_EXPIRY_BOUNDARIES: () => (/* binding */ U),\n/* harmony export */ AuthClient: () => (/* binding */ zr),\n/* harmony export */ BASE10: () => (/* binding */ Ir),\n/* harmony export */ BASE16: () => (/* binding */ ye),\n/* harmony export */ BASE64: () => (/* binding */ qr),\n/* harmony export */ DEFAULT_RPC_URL: () => (/* binding */ Y),\n/* harmony export */ ENGINE_RPC_OPTS: () => (/* binding */ R),\n/* harmony export */ EXPIRER_CONTEXT: () => (/* binding */ Ge),\n/* harmony export */ EXPIRER_DEFAULT_TTL: () => (/* binding */ Qe),\n/* harmony export */ EXPIRER_EVENTS: () => (/* binding */ He),\n/* harmony export */ EXPIRER_STORAGE_VERSION: () => (/* binding */ Ye),\n/* harmony export */ IAuthClient: () => (/* binding */ H),\n/* harmony export */ IAuthEngine: () => (/* binding */ G),\n/* harmony export */ UTF8: () => (/* binding */ we),\n/* harmony export */ \"default\": () => (/* binding */ S),\n/* harmony export */ generateNonce: () => (/* binding */ Ur),\n/* harmony export */ hashMessage: () => (/* binding */ K)\n/* harmony export */ });\n/* harmony import */ var _walletconnect_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @walletconnect/core */ \"./node_modules/@walletconnect/core/dist/index.es.js\");\n/* harmony import */ var _walletconnect_logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @walletconnect/logger */ \"./node_modules/@walletconnect/logger/dist/index.es.js\");\n/* harmony import */ var events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! events */ \"./node_modules/events/events.js\");\n/* harmony import */ var events__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(events__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @walletconnect/jsonrpc-utils */ \"./node_modules/@walletconnect/jsonrpc-utils/dist/esm/index.js\");\n/* harmony import */ var _walletconnect_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @walletconnect/utils */ \"./node_modules/@walletconnect/utils/dist/index.es.js\");\n/* harmony import */ var _walletconnect_time__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @walletconnect/time */ \"./node_modules/@walletconnect/time/dist/cjs/index.js\");\n/* harmony import */ var _walletconnect_time__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_walletconnect_time__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _ethersproject_hash__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ethersproject/hash */ \"./node_modules/@ethersproject/hash/lib.esm/message.js\");\n/* harmony import */ var _ethersproject_transactions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ethersproject/transactions */ \"./node_modules/@ethersproject/transactions/lib.esm/index.js\");\n/* harmony import */ var isomorphic_unfetch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! isomorphic-unfetch */ \"./node_modules/isomorphic-unfetch/browser.js\");\n/* harmony import */ var isomorphic_unfetch__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(isomorphic_unfetch__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _stablelib_random__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @stablelib/random */ \"./node_modules/@stablelib/random/lib/random.js\");\n/* harmony import */ var _stablelib_sha256__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @stablelib/sha256 */ \"./node_modules/@stablelib/sha256/lib/sha256.js\");\nclass G{constructor(t){this.client=t}}class H{constructor(t){this.opts=t}}const Y=\"https://rpc.walletconnect.com/v1\",R={wc_authRequest:{req:{ttl:_walletconnect_time__WEBPACK_IMPORTED_MODULE_3__.ONE_DAY,prompt:!0,tag:3e3},res:{ttl:_walletconnect_time__WEBPACK_IMPORTED_MODULE_3__.ONE_DAY,prompt:!1,tag:3001}}},U={min:_walletconnect_time__WEBPACK_IMPORTED_MODULE_3__.FIVE_MINUTES,max:_walletconnect_time__WEBPACK_IMPORTED_MODULE_3__.SEVEN_DAYS},$=\"wc\",Q=1,Z=\"auth\",B=\"authClient\",F=`${$}@${1}:${Z}:`,x=`${F}:PUB_KEY`,Ge=\"expirer\",He={created:\"expirer_created\",deleted:\"expirer_deleted\",expired:\"expirer_expired\",sync:\"expirer_sync\"},Ye=\"0.3\",Qe=_walletconnect_time__WEBPACK_IMPORTED_MODULE_3__.ONE_DAY;function z(r){return r?.split(\":\")}function Ze(r){const t=r&&z(r);if(t)return t[3]}function We(r){const t=r&&z(r);if(t)return t[2]+\":\"+t[3]}function W(r){const t=r&&z(r);if(t)return t.pop()}async function et(r,t,e,i,n){switch(e.t){case\"eip191\":return tt(r,t,e.s);case\"eip1271\":return await rt(r,t,e.s,i,n);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${e.t}`)}}function tt(r,t,e){return (0,_ethersproject_transactions__WEBPACK_IMPORTED_MODULE_7__.recoverAddress)((0,_ethersproject_hash__WEBPACK_IMPORTED_MODULE_8__.hashMessage)(t),e).toLowerCase()===r.toLowerCase()}async function rt(r,t,e,i,n){try{const s=\"0x1626ba7e\",o=\"0000000000000000000000000000000000000000000000000000000000000040\",u=\"0000000000000000000000000000000000000000000000000000000000000041\",a=e.substring(2),c=(0,_ethersproject_hash__WEBPACK_IMPORTED_MODULE_8__.hashMessage)(t).substring(2),h=s+c+o+u+a,f=await isomorphic_unfetch__WEBPACK_IMPORTED_MODULE_4___default()(`${Y}/?chainId=${i}&projectId=${n}`,{method:\"POST\",body:JSON.stringify({id:it(),jsonrpc:\"2.0\",method:\"eth_call\",params:[{to:r,data:h},\"latest\"]})}),{result:p}=await f.json();return p?p.slice(0,s.length).toLowerCase()===s.toLowerCase():!1}catch(s){return console.error(\"isValidEip1271Signature: \",s),!1}}function it(){return Date.now()+Math.floor(Math.random()*1e3)}function ee(r){return r.getAll().filter(t=>\"requester\"in t)}function te(r,t){return ee(r).find(e=>e.id===t)}function nt(r){const t=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_9__.isValidUrl)(r.aud),e=new RegExp(`${r.domain}`).test(r.aud),i=!!r.nonce,n=r.type?r.type===\"eip4361\":!0,s=r.expiry;if(s&&!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_9__.isValidRequestExpiry)(s,U)){const{message:o}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_9__.getInternalError)(\"MISSING_OR_INVALID\",`request() expiry: ${s}. Expiry must be a number (in seconds) between ${U.min} and ${U.max}`);throw new Error(o)}return!!(t&&e&&i&&n)}function st(r,t){return!!te(t,r.id)}function ot(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(r):new Uint8Array(r)}function ut(r,t){if(r.length>=255)throw new TypeError(\"Alphabet too long\");for(var e=new Uint8Array(256),i=0;i>>0,g=new Uint8Array(w);E!==y;){for(var C=D[E],_=0,b=w-1;(C!==0||_>>0,g[b]=C%u>>>0,C=C/u>>>0;if(C!==0)throw new Error(\"Non-zero carry\");m=_,E++}for(var v=w-m;v!==w&&g[v]===0;)v++;for(var q=a.repeat(l);v>>0,w=new Uint8Array(y);D[l];){var g=e[D.charCodeAt(l)];if(g===255)return;for(var C=0,_=y-1;(g!==0||C>>0,w[_]=g%256>>>0,g=g/256>>>0;if(g!==0)throw new Error(\"Non-zero carry\");E=C,l++}if(D[l]!==\" \"){for(var b=y-E;b!==y&&w[b]===0;)b++;for(var v=new Uint8Array(m+(y-b)),q=m;b!==y;)v[q++]=w[b++];return v}}}function A(D){var l=p(D);if(l)return l;throw new Error(`Non-${t} character`)}return{encode:f,decodeUnsafe:p,decode:A}}var at=ut,Dt=at;const re=r=>{if(r instanceof Uint8Array&&r.constructor.name===\"Uint8Array\")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error(\"Unknown type, must be binary type\")},ct=r=>new TextEncoder().encode(r),ht=r=>new TextDecoder().decode(r);class lt{constructor(t,e,i){this.name=t,this.prefix=e,this.baseEncode=i}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error(\"Unknown type, must be binary type\")}}class dt{constructor(t,e,i){if(this.name=t,this.prefix=e,e.codePointAt(0)===void 0)throw new Error(\"Invalid prefix character\");this.prefixCodePoint=e.codePointAt(0),this.baseDecode=i}decode(t){if(typeof t==\"string\"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error(\"Can only multibase decode strings\")}or(t){return ie(this,t)}}class pt{constructor(t){this.decoders=t}or(t){return ie(this,t)}decode(t){const e=t[0],i=this.decoders[e];if(i)return i.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const ie=(r,t)=>new pt({...r.decoders||{[r.prefix]:r},...t.decoders||{[t.prefix]:t}});class ft{constructor(t,e,i,n){this.name=t,this.prefix=e,this.baseEncode=i,this.baseDecode=n,this.encoder=new lt(t,e,i),this.decoder=new dt(t,e,n)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const O=({name:r,prefix:t,encode:e,decode:i})=>new ft(r,t,e,i),T=({prefix:r,name:t,alphabet:e})=>{const{encode:i,decode:n}=Dt(e,t);return O({prefix:r,name:t,encode:i,decode:s=>re(n(s))})},gt=(r,t,e,i)=>{const n={};for(let h=0;h=8&&(u-=8,o[c++]=255&a>>u)}if(u>=e||255&a<<8-u)throw new SyntaxError(\"Unexpected end of data\");return o},Et=(r,t,e)=>{const i=t[t.length-1]===\"=\",n=(1<e;)o-=e,s+=t[n&u>>o];if(o&&(s+=t[n&u<O({prefix:t,name:r,encode(n){return Et(n,i,e)},decode(n){return gt(n,i,e,r)}}),bt=O({prefix:\"\\0\",name:\"identity\",encode:r=>ht(r),decode:r=>ct(r)});var yt=Object.freeze({__proto__:null,identity:bt});const wt=d({prefix:\"0\",name:\"base2\",alphabet:\"01\",bitsPerChar:1});var Ct=Object.freeze({__proto__:null,base2:wt});const mt=d({prefix:\"7\",name:\"base8\",alphabet:\"01234567\",bitsPerChar:3});var vt=Object.freeze({__proto__:null,base8:mt});const At=T({prefix:\"9\",name:\"base10\",alphabet:\"0123456789\"});var _t=Object.freeze({__proto__:null,base10:At});const xt=d({prefix:\"f\",name:\"base16\",alphabet:\"0123456789abcdef\",bitsPerChar:4}),Rt=d({prefix:\"F\",name:\"base16upper\",alphabet:\"0123456789ABCDEF\",bitsPerChar:4});var Ft=Object.freeze({__proto__:null,base16:xt,base16upper:Rt});const Tt=d({prefix:\"b\",name:\"base32\",alphabet:\"abcdefghijklmnopqrstuvwxyz234567\",bitsPerChar:5}),It=d({prefix:\"B\",name:\"base32upper\",alphabet:\"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\",bitsPerChar:5}),qt=d({prefix:\"c\",name:\"base32pad\",alphabet:\"abcdefghijklmnopqrstuvwxyz234567=\",bitsPerChar:5}),Ut=d({prefix:\"C\",name:\"base32padupper\",alphabet:\"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=\",bitsPerChar:5}),Ot=d({prefix:\"v\",name:\"base32hex\",alphabet:\"0123456789abcdefghijklmnopqrstuv\",bitsPerChar:5}),St=d({prefix:\"V\",name:\"base32hexupper\",alphabet:\"0123456789ABCDEFGHIJKLMNOPQRSTUV\",bitsPerChar:5}),Pt=d({prefix:\"t\",name:\"base32hexpad\",alphabet:\"0123456789abcdefghijklmnopqrstuv=\",bitsPerChar:5}),Nt=d({prefix:\"T\",name:\"base32hexpadupper\",alphabet:\"0123456789ABCDEFGHIJKLMNOPQRSTUV=\",bitsPerChar:5}),$t=d({prefix:\"h\",name:\"base32z\",alphabet:\"ybndrfg8ejkmcpqxot1uwisza345h769\",bitsPerChar:5});var Bt=Object.freeze({__proto__:null,base32:Tt,base32upper:It,base32pad:qt,base32padupper:Ut,base32hex:Ot,base32hexupper:St,base32hexpad:Pt,base32hexpadupper:Nt,base32z:$t});const zt=T({prefix:\"k\",name:\"base36\",alphabet:\"0123456789abcdefghijklmnopqrstuvwxyz\"}),jt=T({prefix:\"K\",name:\"base36upper\",alphabet:\"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\"});var Mt=Object.freeze({__proto__:null,base36:zt,base36upper:jt});const Lt=T({name:\"base58btc\",prefix:\"z\",alphabet:\"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\"}),Kt=T({name:\"base58flickr\",prefix:\"Z\",alphabet:\"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ\"});var Vt=Object.freeze({__proto__:null,base58btc:Lt,base58flickr:Kt});const kt=d({prefix:\"m\",name:\"base64\",alphabet:\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",bitsPerChar:6}),Jt=d({prefix:\"M\",name:\"base64pad\",alphabet:\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\",bitsPerChar:6}),Xt=d({prefix:\"u\",name:\"base64url\",alphabet:\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_\",bitsPerChar:6}),Gt=d({prefix:\"U\",name:\"base64urlpad\",alphabet:\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=\",bitsPerChar:6});var Ht=Object.freeze({__proto__:null,base64:kt,base64pad:Jt,base64url:Xt,base64urlpad:Gt});const ne=Array.from(\"\\u{1F680}\\u{1FA90}\\u2604\\u{1F6F0}\\u{1F30C}\\u{1F311}\\u{1F312}\\u{1F313}\\u{1F314}\\u{1F315}\\u{1F316}\\u{1F317}\\u{1F318}\\u{1F30D}\\u{1F30F}\\u{1F30E}\\u{1F409}\\u2600\\u{1F4BB}\\u{1F5A5}\\u{1F4BE}\\u{1F4BF}\\u{1F602}\\u2764\\u{1F60D}\\u{1F923}\\u{1F60A}\\u{1F64F}\\u{1F495}\\u{1F62D}\\u{1F618}\\u{1F44D}\\u{1F605}\\u{1F44F}\\u{1F601}\\u{1F525}\\u{1F970}\\u{1F494}\\u{1F496}\\u{1F499}\\u{1F622}\\u{1F914}\\u{1F606}\\u{1F644}\\u{1F4AA}\\u{1F609}\\u263A\\u{1F44C}\\u{1F917}\\u{1F49C}\\u{1F614}\\u{1F60E}\\u{1F607}\\u{1F339}\\u{1F926}\\u{1F389}\\u{1F49E}\\u270C\\u2728\\u{1F937}\\u{1F631}\\u{1F60C}\\u{1F338}\\u{1F64C}\\u{1F60B}\\u{1F497}\\u{1F49A}\\u{1F60F}\\u{1F49B}\\u{1F642}\\u{1F493}\\u{1F929}\\u{1F604}\\u{1F600}\\u{1F5A4}\\u{1F603}\\u{1F4AF}\\u{1F648}\\u{1F447}\\u{1F3B6}\\u{1F612}\\u{1F92D}\\u2763\\u{1F61C}\\u{1F48B}\\u{1F440}\\u{1F62A}\\u{1F611}\\u{1F4A5}\\u{1F64B}\\u{1F61E}\\u{1F629}\\u{1F621}\\u{1F92A}\\u{1F44A}\\u{1F973}\\u{1F625}\\u{1F924}\\u{1F449}\\u{1F483}\\u{1F633}\\u270B\\u{1F61A}\\u{1F61D}\\u{1F634}\\u{1F31F}\\u{1F62C}\\u{1F643}\\u{1F340}\\u{1F337}\\u{1F63B}\\u{1F613}\\u2B50\\u2705\\u{1F97A}\\u{1F308}\\u{1F608}\\u{1F918}\\u{1F4A6}\\u2714\\u{1F623}\\u{1F3C3}\\u{1F490}\\u2639\\u{1F38A}\\u{1F498}\\u{1F620}\\u261D\\u{1F615}\\u{1F33A}\\u{1F382}\\u{1F33B}\\u{1F610}\\u{1F595}\\u{1F49D}\\u{1F64A}\\u{1F639}\\u{1F5E3}\\u{1F4AB}\\u{1F480}\\u{1F451}\\u{1F3B5}\\u{1F91E}\\u{1F61B}\\u{1F534}\\u{1F624}\\u{1F33C}\\u{1F62B}\\u26BD\\u{1F919}\\u2615\\u{1F3C6}\\u{1F92B}\\u{1F448}\\u{1F62E}\\u{1F646}\\u{1F37B}\\u{1F343}\\u{1F436}\\u{1F481}\\u{1F632}\\u{1F33F}\\u{1F9E1}\\u{1F381}\\u26A1\\u{1F31E}\\u{1F388}\\u274C\\u270A\\u{1F44B}\\u{1F630}\\u{1F928}\\u{1F636}\\u{1F91D}\\u{1F6B6}\\u{1F4B0}\\u{1F353}\\u{1F4A2}\\u{1F91F}\\u{1F641}\\u{1F6A8}\\u{1F4A8}\\u{1F92C}\\u2708\\u{1F380}\\u{1F37A}\\u{1F913}\\u{1F619}\\u{1F49F}\\u{1F331}\\u{1F616}\\u{1F476}\\u{1F974}\\u25B6\\u27A1\\u2753\\u{1F48E}\\u{1F4B8}\\u2B07\\u{1F628}\\u{1F31A}\\u{1F98B}\\u{1F637}\\u{1F57A}\\u26A0\\u{1F645}\\u{1F61F}\\u{1F635}\\u{1F44E}\\u{1F932}\\u{1F920}\\u{1F927}\\u{1F4CC}\\u{1F535}\\u{1F485}\\u{1F9D0}\\u{1F43E}\\u{1F352}\\u{1F617}\\u{1F911}\\u{1F30A}\\u{1F92F}\\u{1F437}\\u260E\\u{1F4A7}\\u{1F62F}\\u{1F486}\\u{1F446}\\u{1F3A4}\\u{1F647}\\u{1F351}\\u2744\\u{1F334}\\u{1F4A3}\\u{1F438}\\u{1F48C}\\u{1F4CD}\\u{1F940}\\u{1F922}\\u{1F445}\\u{1F4A1}\\u{1F4A9}\\u{1F450}\\u{1F4F8}\\u{1F47B}\\u{1F910}\\u{1F92E}\\u{1F3BC}\\u{1F975}\\u{1F6A9}\\u{1F34E}\\u{1F34A}\\u{1F47C}\\u{1F48D}\\u{1F4E3}\\u{1F942}\"),Yt=ne.reduce((r,t,e)=>(r[e]=t,r),[]),Qt=ne.reduce((r,t,e)=>(r[t.codePointAt(0)]=e,r),[]);function Zt(r){return r.reduce((t,e)=>(t+=Yt[e],t),\"\")}function Wt(r){const t=[];for(const e of r){const i=Qt[e.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${e}`);t.push(i)}return new Uint8Array(t)}const er=O({prefix:\"\\u{1F680}\",name:\"base256emoji\",encode:Zt,decode:Wt});var tr=Object.freeze({__proto__:null,base256emoji:er}),rr=oe,se=128,ir=127,nr=~ir,sr=Math.pow(2,31);function oe(r,t,e){t=t||[],e=e||0;for(var i=e;r>=sr;)t[e++]=r&255|se,r/=128;for(;r&nr;)t[e++]=r&255|se,r>>>=7;return t[e]=r|0,oe.bytes=e-i+1,t}var or=j,ur=128,ue=127;function j(r,i){var e=0,i=i||0,n=0,s=i,o,u=r.length;do{if(s>=u)throw j.bytes=0,new RangeError(\"Could not decode varint\");o=r[s++],e+=n<28?(o&ue)<=ur);return j.bytes=s-i,e}var ar=Math.pow(2,7),Dr=Math.pow(2,14),cr=Math.pow(2,21),hr=Math.pow(2,28),lr=Math.pow(2,35),dr=Math.pow(2,42),pr=Math.pow(2,49),fr=Math.pow(2,56),gr=Math.pow(2,63),Er=function(r){return r(ae.encode(r,t,e),t),ce=r=>ae.encodingLength(r),M=(r,t)=>{const e=t.byteLength,i=ce(r),n=i+ce(e),s=new Uint8Array(n+e);return De(r,s,0),De(e,s,i),s.set(t,n),new yr(r,e,t,s)};class yr{constructor(t,e,i,n){this.code=t,this.size=e,this.digest=i,this.bytes=n}}const he=({name:r,code:t,encode:e})=>new wr(r,t,e);class wr{constructor(t,e,i){this.name=t,this.code=e,this.encode=i}digest(t){if(t instanceof Uint8Array){const e=this.encode(t);return e instanceof Uint8Array?M(this.code,e):e.then(i=>M(this.code,i))}else throw Error(\"Unknown type, must be binary type\")}}const le=r=>async t=>new Uint8Array(await crypto.subtle.digest(r,t)),Cr=he({name:\"sha2-256\",code:18,encode:le(\"SHA-256\")}),mr=he({name:\"sha2-512\",code:19,encode:le(\"SHA-512\")});var vr=Object.freeze({__proto__:null,sha256:Cr,sha512:mr});const de=0,Ar=\"identity\",pe=re,_r=r=>M(de,pe(r)),xr={code:de,name:Ar,encode:pe,digest:_r};var Rr=Object.freeze({__proto__:null,identity:xr});new TextEncoder,new TextDecoder;const fe={...yt,...Ct,...vt,..._t,...Ft,...Bt,...Mt,...Vt,...Ht,...tr};({...vr,...Rr});function ge(r,t,e,i){return{name:r,prefix:t,encoder:{name:r,prefix:t,encode:e},decoder:{decode:i}}}const Ee=ge(\"utf8\",\"u\",r=>\"u\"+new TextDecoder(\"utf8\").decode(r),r=>new TextEncoder().encode(r.substring(1))),L=ge(\"ascii\",\"a\",r=>{let t=\"a\";for(let e=0;e{r=r.substring(1);const t=ot(r.length);for(let e=0;et in r?Or(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,I=(r,t)=>{for(var e in t||(t={}))Nr.call(t,e)&&me(r,e,t[e]);if(Ce)for(var e of Ce(t))$r.call(t,e)&&me(r,e,t[e]);return r},V=(r,t)=>Sr(r,Pr(t));class Br extends G{constructor(t){super(t),this.initialized=!1,this.name=\"authEngine\",this.init=()=>{this.initialized||(this.registerRelayerEvents(),this.registerPairingEvents(),this.client.core.pairing.register({methods:Object.keys(R)}),this.initialized=!0)},this.request=async(e,i)=>{if(this.isInitialized(),!nt(e))throw new Error(\"Invalid request\");if(i!=null&&i.topic)return await this.requestOnKnownPairing(i.topic,e);const{chainId:n,statement:s,aud:o,domain:u,nonce:a,type:c,exp:h,nbf:f}=e,{topic:p,uri:A}=await this.client.core.pairing.create();this.client.logger.info({message:\"Generated new pairing\",pairing:{topic:p,uri:A}});const D=await this.client.core.crypto.generateKeyPair(),l=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_9__.hashKey)(D);await this.client.authKeys.set(x,{responseTopic:l,publicKey:D}),await this.client.pairingTopics.set(l,{topic:l,pairingTopic:p}),await this.client.core.relayer.subscribe(l),this.client.logger.info(`sending request to new pairing topic: ${p}`);const m=await this.sendRequest(p,\"wc_authRequest\",{payloadParams:{type:c??\"eip4361\",chainId:n,statement:s,aud:o,domain:u,version:\"1\",nonce:a,iat:new Date().toISOString(),exp:h,nbf:f},requester:{publicKey:D,metadata:this.client.metadata}},{},e.expiry);return this.client.logger.info(`sent request to new pairing topic: ${p}`),{uri:A,id:m}},this.respond=async(e,i)=>{if(this.isInitialized(),!st(e,this.client.requests))throw new Error(\"Invalid response\");const n=te(this.client.requests,e.id);if(!n)throw new Error(`Could not find pending auth request with id ${e.id}`);const s=n.requester.publicKey,o=await this.client.core.crypto.generateKeyPair(),u=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_9__.hashKey)(s),a={type:_walletconnect_utils__WEBPACK_IMPORTED_MODULE_9__.TYPE_1,receiverPublicKey:s,senderPublicKey:o};if(\"error\"in e){await this.sendError(n.id,u,e,a);return}const c={h:{t:\"eip4361\"},p:V(I({},n.cacaoPayload),{iss:i}),s:e.signature};await this.sendResult(n.id,u,c,a),await this.client.core.pairing.activate({topic:n.pairingTopic}),await this.client.requests.update(n.id,I({},c))},this.getPendingRequests=()=>ee(this.client.requests),this.formatMessage=(e,i)=>{this.client.logger.debug(`formatMessage, cacao is: ${JSON.stringify(e)}`);const n=`${e.domain} wants you to sign in with your Ethereum account:`,s=W(i),o=e.statement,u=`URI: ${e.aud}`,a=`Version: ${e.version}`,c=`Chain ID: ${Ze(i)}`,h=`Nonce: ${e.nonce}`,f=`Issued At: ${e.iat}`,p=e.exp?`Expiry: ${e.exp}`:void 0,A=e.resources&&e.resources.length>0?`Resources:\n${e.resources.map(D=>`- ${D}`).join(`\n`)}`:void 0;return[n,s,\"\",o,\"\",u,a,c,h,f,p,A].filter(D=>D!=null).join(`\n`)},this.setExpiry=async(e,i)=>{this.client.core.pairing.pairings.keys.includes(e)&&await this.client.core.pairing.updateExpiry({topic:e,expiry:i}),this.client.core.expirer.set(e,i)},this.sendRequest=async(e,i,n,s,o)=>{const u=(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_2__.formatJsonRpcRequest)(i,n),a=await this.client.core.crypto.encode(e,u,s),c=R[i].req;if(o&&(c.ttl=o),this.client.core.history.set(e,u),(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_9__.isBrowser)()){const h=K(JSON.stringify(u));this.client.core.verify.register({attestationId:h})}return await this.client.core.relayer.publish(e,a,V(I({},c),{internal:{throwOnFailedPublish:!0}})),u.id},this.sendResult=async(e,i,n,s)=>{const o=(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_2__.formatJsonRpcResult)(e,n),u=await this.client.core.crypto.encode(i,o,s),a=await this.client.core.history.get(i,e),c=R[a.request.method].res;return await this.client.core.relayer.publish(i,u,V(I({},c),{internal:{throwOnFailedPublish:!0}})),await this.client.core.history.resolve(o),o.id},this.sendError=async(e,i,n,s)=>{const o=(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_2__.formatJsonRpcError)(e,n.error),u=await this.client.core.crypto.encode(i,o,s),a=await this.client.core.history.get(i,e),c=R[a.request.method].res;return await this.client.core.relayer.publish(i,u,c),await this.client.core.history.resolve(o),o.id},this.requestOnKnownPairing=async(e,i)=>{const n=this.client.core.pairing.pairings.getAll({active:!0}).find(A=>A.topic===e);if(!n)throw new Error(`Could not find pairing for provided topic ${e}`);const{publicKey:s}=this.client.authKeys.get(x),{chainId:o,statement:u,aud:a,domain:c,nonce:h,type:f}=i,p=await this.sendRequest(n.topic,\"wc_authRequest\",{payloadParams:{type:f??\"eip4361\",chainId:o,statement:u,aud:a,domain:c,version:\"1\",nonce:h,iat:new Date().toISOString()},requester:{publicKey:s,metadata:this.client.metadata}},{},i.expiry);return this.client.logger.info(`sent request to known pairing topic: ${n.topic}`),{id:p}},this.onPairingCreated=e=>{const i=this.getPendingRequests();if(i){const n=Object.values(i).find(s=>s.pairingTopic===e.topic);n&&this.handleAuthRequest(n)}},this.onRelayEventRequest=e=>{const{topic:i,payload:n}=e,s=n.method;switch(s){case\"wc_authRequest\":return this.onAuthRequest(i,n);default:return this.client.logger.info(`Unsupported request method ${s}`)}},this.onRelayEventResponse=async e=>{const{topic:i,payload:n}=e,s=(await this.client.core.history.get(i,n.id)).request.method;switch(s){case\"wc_authRequest\":return this.onAuthResponse(i,n);default:return this.client.logger.info(`Unsupported response method ${s}`)}},this.onAuthRequest=async(e,i)=>{const{requester:n,payloadParams:s}=i.params;this.client.logger.info({type:\"onAuthRequest\",topic:e,payload:i});const o=K(JSON.stringify(i)),u=await this.getVerifyContext(o,this.client.metadata),a={requester:n,pairingTopic:e,id:i.id,cacaoPayload:s,verifyContext:u};await this.client.requests.set(i.id,a),this.handleAuthRequest(a)},this.handleAuthRequest=async e=>{const{id:i,pairingTopic:n,requester:s,cacaoPayload:o,verifyContext:u}=e;try{this.client.emit(\"auth_request\",{id:i,topic:n,params:{requester:s,cacaoPayload:o},verifyContext:u})}catch(a){await this.sendError(e.id,e.pairingTopic,a),this.client.logger.error(a)}},this.onAuthResponse=async(e,i)=>{const{id:n}=i;if(this.client.logger.info({type:\"onAuthResponse\",topic:e,response:i}),(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_2__.isJsonRpcResult)(i)){const{pairingTopic:s}=this.client.pairingTopics.get(e);await this.client.core.pairing.activate({topic:s});const{s:o,p:u}=i.result;await this.client.requests.set(n,I({id:n,pairingTopic:s},i.result));const a=this.formatMessage(u,u.iss);this.client.logger.debug(`reconstructed message:\n`,JSON.stringify(a)),this.client.logger.debug(\"payload.iss:\",u.iss),this.client.logger.debug(\"signature:\",o);const c=W(u.iss),h=We(u.iss);if(!c)throw new Error(\"Could not derive address from `payload.iss`\");if(!h)throw new Error(\"Could not derive chainId from `payload.iss`\");this.client.logger.debug(\"walletAddress extracted from `payload.iss`:\",c),await et(c,a,o,h,this.client.projectId)?this.client.emit(\"auth_response\",{id:n,topic:e,params:i}):this.client.emit(\"auth_response\",{id:n,topic:e,params:{message:\"Invalid signature\",code:-1}})}else (0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_2__.isJsonRpcError)(i)&&this.client.emit(\"auth_response\",{id:n,topic:e,params:i})},this.getVerifyContext=async(e,i)=>{const n={verified:{verifyUrl:i.verifyUrl||\"\",validation:\"UNKNOWN\",origin:i.url||\"\"}};try{const s=await this.client.core.verify.resolve({attestationId:e,verifyUrl:i.verifyUrl});s&&(n.verified.origin=s.origin,n.verified.isScam=s.isScam,n.verified.validation=origin===new URL(i.url).origin?\"VALID\":\"INVALID\")}catch(s){this.client.logger.error(s)}return this.client.logger.info(`Verify context: ${JSON.stringify(n)}`),n}}isInitialized(){if(!this.initialized){const{message:t}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_9__.getInternalError)(\"NOT_INITIALIZED\",this.name);throw new Error(t)}}registerRelayerEvents(){this.client.core.relayer.on(_walletconnect_core__WEBPACK_IMPORTED_MODULE_10__.RELAYER_EVENTS.message,async t=>{const{topic:e,message:i}=t,{responseTopic:n,publicKey:s}=this.client.authKeys.keys.includes(x)?this.client.authKeys.get(x):{responseTopic:void 0,publicKey:void 0};if(n&&e!==n){this.client.logger.debug(\"[Auth] Ignoring message from unknown topic\",e);return}const o=await this.client.core.crypto.decode(e,i,{receiverPublicKey:s});(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_2__.isJsonRpcRequest)(o)?(this.client.core.history.set(e,o),this.onRelayEventRequest({topic:e,payload:o})):(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_2__.isJsonRpcResponse)(o)&&(await this.client.core.history.resolve(o),this.onRelayEventResponse({topic:e,payload:o}))})}registerPairingEvents(){this.client.core.pairing.events.on(_walletconnect_core__WEBPACK_IMPORTED_MODULE_10__.PAIRING_EVENTS.create,t=>this.onPairingCreated(t))}}class S extends H{constructor(t){super(t),this.protocol=$,this.version=Q,this.name=B,this.events=new events__WEBPACK_IMPORTED_MODULE_1__.EventEmitter,this.emit=(i,n)=>this.events.emit(i,n),this.on=(i,n)=>this.events.on(i,n),this.once=(i,n)=>this.events.once(i,n),this.off=(i,n)=>this.events.off(i,n),this.removeListener=(i,n)=>this.events.removeListener(i,n),this.request=async(i,n)=>{try{return await this.engine.request(i,n)}catch(s){throw this.logger.error(s.message),s}},this.respond=async(i,n)=>{try{return await this.engine.respond(i,n)}catch(s){throw this.logger.error(s.message),s}},this.getPendingRequests=()=>{try{return this.engine.getPendingRequests()}catch(i){throw this.logger.error(i.message),i}},this.formatMessage=(i,n)=>{try{return this.engine.formatMessage(i,n)}catch(s){throw this.logger.error(s.message),s}};const e=typeof t.logger<\"u\"&&typeof t.logger!=\"string\"?t.logger:(0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_0__.pino)((0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_0__.getDefaultLoggerOptions)({level:t.logger||\"error\"}));this.name=t?.name||B,this.metadata=t.metadata,this.projectId=t.projectId,this.core=t.core||new _walletconnect_core__WEBPACK_IMPORTED_MODULE_10__.Core(t),this.logger=(0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_0__.generateChildLogger)(e,this.name),this.authKeys=new _walletconnect_core__WEBPACK_IMPORTED_MODULE_10__.Store(this.core,this.logger,\"authKeys\",F,()=>x),this.pairingTopics=new _walletconnect_core__WEBPACK_IMPORTED_MODULE_10__.Store(this.core,this.logger,\"pairingTopics\",F),this.requests=new _walletconnect_core__WEBPACK_IMPORTED_MODULE_10__.Store(this.core,this.logger,\"requests\",F,i=>i.id),this.engine=new Br(this)}static async init(t){const e=new S(t);return await e.initialize(),e}get context(){return (0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_0__.getLoggerContext)(this.logger)}async initialize(){this.logger.trace(\"Initialized\");try{await this.core.start(),await this.authKeys.init(),await this.requests.init(),await this.pairingTopics.init(),await this.engine.init(),this.logger.info(\"AuthClient Initialization Success\"),this.logger.info({authClient:this})}catch(t){throw this.logger.info(\"AuthClient Initialization Failure\"),this.logger.error(t.message),t}}}const zr=S;\n//# sourceMappingURL=index.es.js.map\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/auth-client/dist/index.es.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/core/dist/index.es.js": -/*!***********************************************************!*\ - !*** ./node_modules/@walletconnect/core/dist/index.es.js ***! - \***********************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CORE_CONTEXT: () => (/* binding */ Z),\n/* harmony export */ CORE_DEFAULT: () => (/* binding */ et),\n/* harmony export */ CORE_PROTOCOL: () => (/* binding */ De),\n/* harmony export */ CORE_STORAGE_OPTIONS: () => (/* binding */ tt),\n/* harmony export */ CORE_STORAGE_PREFIX: () => (/* binding */ z),\n/* harmony export */ CORE_VERSION: () => (/* binding */ Ze),\n/* harmony export */ CRYPTO_CLIENT_SEED: () => (/* binding */ ye),\n/* harmony export */ CRYPTO_CONTEXT: () => (/* binding */ it),\n/* harmony export */ CRYPTO_JWT_TTL: () => (/* binding */ st),\n/* harmony export */ Core: () => (/* binding */ Br),\n/* harmony export */ Crypto: () => (/* binding */ At),\n/* harmony export */ ECHO_CONTEXT: () => (/* binding */ Pt),\n/* harmony export */ ECHO_URL: () => (/* binding */ xt),\n/* harmony export */ EXPIRER_CONTEXT: () => (/* binding */ Rt),\n/* harmony export */ EXPIRER_DEFAULT_TTL: () => (/* binding */ vr),\n/* harmony export */ EXPIRER_EVENTS: () => (/* binding */ C),\n/* harmony export */ EXPIRER_STORAGE_VERSION: () => (/* binding */ Tt),\n/* harmony export */ EchoClient: () => (/* binding */ Ht),\n/* harmony export */ Expirer: () => (/* binding */ Gt),\n/* harmony export */ HISTORY_CONTEXT: () => (/* binding */ Ct),\n/* harmony export */ HISTORY_EVENTS: () => (/* binding */ I),\n/* harmony export */ HISTORY_STORAGE_VERSION: () => (/* binding */ _t),\n/* harmony export */ JsonRpcHistory: () => (/* binding */ jt),\n/* harmony export */ KEYCHAIN_CONTEXT: () => (/* binding */ rt),\n/* harmony export */ KEYCHAIN_STORAGE_VERSION: () => (/* binding */ nt),\n/* harmony export */ KeyChain: () => (/* binding */ Ot),\n/* harmony export */ MESSAGES_CONTEXT: () => (/* binding */ ot),\n/* harmony export */ MESSAGES_STORAGE_VERSION: () => (/* binding */ at),\n/* harmony export */ MessageTracker: () => (/* binding */ zt),\n/* harmony export */ PAIRING_CONTEXT: () => (/* binding */ vt),\n/* harmony export */ PAIRING_DEFAULT_TTL: () => (/* binding */ wr),\n/* harmony export */ PAIRING_EVENTS: () => (/* binding */ V),\n/* harmony export */ PAIRING_RPC_OPTS: () => (/* binding */ F),\n/* harmony export */ PAIRING_STORAGE_VERSION: () => (/* binding */ It),\n/* harmony export */ PENDING_SUB_RESOLUTION_TIMEOUT: () => (/* binding */ wt),\n/* harmony export */ PUBLISHER_CONTEXT: () => (/* binding */ ct),\n/* harmony export */ PUBLISHER_DEFAULT_TTL: () => (/* binding */ ht),\n/* harmony export */ Pairing: () => (/* binding */ qt),\n/* harmony export */ RELAYER_CONTEXT: () => (/* binding */ dt),\n/* harmony export */ RELAYER_DEFAULT_LOGGER: () => (/* binding */ ut),\n/* harmony export */ RELAYER_DEFAULT_PROTOCOL: () => (/* binding */ lt),\n/* harmony export */ RELAYER_DEFAULT_RELAY_URL: () => (/* binding */ me),\n/* harmony export */ RELAYER_EVENTS: () => (/* binding */ v),\n/* harmony export */ RELAYER_FAILOVER_RELAY_URL: () => (/* binding */ be),\n/* harmony export */ RELAYER_PROVIDER_EVENTS: () => (/* binding */ f),\n/* harmony export */ RELAYER_RECONNECT_TIMEOUT: () => (/* binding */ pt),\n/* harmony export */ RELAYER_SDK_VERSION: () => (/* binding */ Dt),\n/* harmony export */ RELAYER_STORAGE_OPTIONS: () => (/* binding */ fr),\n/* harmony export */ RELAYER_SUBSCRIBER_SUFFIX: () => (/* binding */ gt),\n/* harmony export */ RELAYER_TRANSPORT_CUTOFF: () => (/* binding */ yt),\n/* harmony export */ Relayer: () => (/* binding */ kt),\n/* harmony export */ STORE_STORAGE_VERSION: () => (/* binding */ mt),\n/* harmony export */ SUBSCRIBER_CONTEXT: () => (/* binding */ ft),\n/* harmony export */ SUBSCRIBER_DEFAULT_TTL: () => (/* binding */ Er),\n/* harmony export */ SUBSCRIBER_EVENTS: () => (/* binding */ S),\n/* harmony export */ SUBSCRIBER_STORAGE_VERSION: () => (/* binding */ Et),\n/* harmony export */ Store: () => (/* binding */ Vt),\n/* harmony export */ Subscriber: () => (/* binding */ Ut),\n/* harmony export */ TRUSTED_VERIFY_URLS: () => (/* binding */ St),\n/* harmony export */ VERIFY_CONTEXT: () => (/* binding */ ee),\n/* harmony export */ VERIFY_FALLBACK_SERVER: () => (/* binding */ te),\n/* harmony export */ VERIFY_SERVER: () => (/* binding */ k),\n/* harmony export */ Verify: () => (/* binding */ Yt),\n/* harmony export */ WALLETCONNECT_CLIENT_ID: () => (/* binding */ bt),\n/* harmony export */ \"default\": () => (/* binding */ ie)\n/* harmony export */ });\n/* harmony import */ var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! events */ \"./node_modules/events/events.js\");\n/* harmony import */ var events__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(events__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _walletconnect_keyvaluestorage__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @walletconnect/keyvaluestorage */ \"./node_modules/@walletconnect/keyvaluestorage/dist/index.es.js\");\n/* harmony import */ var _walletconnect_heartbeat__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @walletconnect/heartbeat */ \"./node_modules/@walletconnect/heartbeat/dist/cjs/index.js\");\n/* harmony import */ var _walletconnect_heartbeat__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_walletconnect_heartbeat__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _walletconnect_logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @walletconnect/logger */ \"./node_modules/@walletconnect/logger/dist/index.es.js\");\n/* harmony import */ var _walletconnect_types__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @walletconnect/types */ \"./node_modules/@walletconnect/types/dist/index.es.js\");\n/* harmony import */ var _walletconnect_safe_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @walletconnect/safe-json */ \"./node_modules/@walletconnect/safe-json/dist/esm/index.js\");\n/* harmony import */ var _walletconnect_relay_auth__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @walletconnect/relay-auth */ \"./node_modules/@walletconnect/relay-auth/dist/esm/index.js\");\n/* harmony import */ var _walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @walletconnect/utils */ \"./node_modules/@walletconnect/utils/dist/index.es.js\");\n/* harmony import */ var uint8arrays__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! uint8arrays */ \"./node_modules/uint8arrays/esm/src/index.js\");\n/* harmony import */ var _walletconnect_time__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @walletconnect/time */ \"./node_modules/@walletconnect/time/dist/cjs/index.js\");\n/* harmony import */ var _walletconnect_time__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_walletconnect_time__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _walletconnect_jsonrpc_provider__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @walletconnect/jsonrpc-provider */ \"./node_modules/@walletconnect/jsonrpc-provider/dist/esm/index.js\");\n/* harmony import */ var _walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @walletconnect/jsonrpc-utils */ \"./node_modules/@walletconnect/jsonrpc-utils/dist/esm/index.js\");\n/* harmony import */ var _walletconnect_jsonrpc_ws_connection__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @walletconnect/jsonrpc-ws-connection */ \"./node_modules/@walletconnect/jsonrpc-ws-connection/dist/index.es.js\");\n/* harmony import */ var lodash_isequal__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! lodash.isequal */ \"./node_modules/lodash.isequal/index.js\");\n/* harmony import */ var lodash_isequal__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(lodash_isequal__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony import */ var isomorphic_unfetch__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! isomorphic-unfetch */ \"./node_modules/isomorphic-unfetch/browser.js\");\n/* harmony import */ var isomorphic_unfetch__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(isomorphic_unfetch__WEBPACK_IMPORTED_MODULE_12__);\nfunction Ji(n,e){if(n.length>=255)throw new TypeError(\"Alphabet too long\");for(var t=new Uint8Array(256),i=0;i>>0,E=new Uint8Array(x);D!==P;){for(var O=u[D],N=0,R=x-1;(O!==0||N<_)&&R!==-1;R--,N++)O+=256*E[R]>>>0,E[R]=O%a>>>0,O=O/a>>>0;if(O!==0)throw new Error(\"Non-zero carry\");_=N,D++}for(var A=x-_;A!==x&&E[A]===0;)A++;for(var j=h.repeat(p);A>>0,x=new Uint8Array(P);u[p];){var E=t[u.charCodeAt(p)];if(E===255)return;for(var O=0,N=P-1;(E!==0||O>>0,x[N]=E%256>>>0,E=E/256>>>0;if(E!==0)throw new Error(\"Non-zero carry\");D=O,p++}if(u[p]!==\" \"){for(var R=P-D;R!==P&&x[R]===0;)R++;for(var A=new Uint8Array(_+(P-R)),j=_;R!==P;)A[j++]=x[R++];return A}}}function L(u){var p=m(u);if(p)return p;throw new Error(`Non-${e} character`)}return{encode:g,decodeUnsafe:m,decode:L}}var Xi=Ji,Wi=Xi;const Ue=n=>{if(n instanceof Uint8Array&&n.constructor.name===\"Uint8Array\")return n;if(n instanceof ArrayBuffer)return new Uint8Array(n);if(ArrayBuffer.isView(n))return new Uint8Array(n.buffer,n.byteOffset,n.byteLength);throw new Error(\"Unknown type, must be binary type\")},Qi=n=>new TextEncoder().encode(n),Zi=n=>new TextDecoder().decode(n);class es{constructor(e,t,i){this.name=e,this.prefix=t,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error(\"Unknown type, must be binary type\")}}class ts{constructor(e,t,i){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error(\"Invalid prefix character\");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=i}decode(e){if(typeof e==\"string\"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error(\"Can only multibase decode strings\")}or(e){return $e(this,e)}}class is{constructor(e){this.decoders=e}or(e){return $e(this,e)}decode(e){const t=e[0],i=this.decoders[t];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const $e=(n,e)=>new is({...n.decoders||{[n.prefix]:n},...e.decoders||{[e.prefix]:e}});class ss{constructor(e,t,i,s){this.name=e,this.prefix=t,this.baseEncode=i,this.baseDecode=s,this.encoder=new es(e,t,i),this.decoder=new ts(e,t,s)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Q=({name:n,prefix:e,encode:t,decode:i})=>new ss(n,e,t,i),K=({prefix:n,name:e,alphabet:t})=>{const{encode:i,decode:s}=Wi(t,e);return Q({prefix:n,name:e,encode:i,decode:r=>Ue(s(r))})},rs=(n,e,t,i)=>{const s={};for(let d=0;d=8&&(a-=8,o[l++]=255&h>>a)}if(a>=t||255&h<<8-a)throw new SyntaxError(\"Unexpected end of data\");return o},ns=(n,e,t)=>{const i=e[e.length-1]===\"=\",s=(1<t;)o-=t,r+=e[s&a>>o];if(o&&(r+=e[s&a<Q({prefix:e,name:n,encode(s){return ns(s,i,t)},decode(s){return rs(s,i,t,n)}}),os=Q({prefix:\"\\0\",name:\"identity\",encode:n=>Zi(n),decode:n=>Qi(n)});var as=Object.freeze({__proto__:null,identity:os});const hs=y({prefix:\"0\",name:\"base2\",alphabet:\"01\",bitsPerChar:1});var cs=Object.freeze({__proto__:null,base2:hs});const ls=y({prefix:\"7\",name:\"base8\",alphabet:\"01234567\",bitsPerChar:3});var us=Object.freeze({__proto__:null,base8:ls});const ds=K({prefix:\"9\",name:\"base10\",alphabet:\"0123456789\"});var gs=Object.freeze({__proto__:null,base10:ds});const ps=y({prefix:\"f\",name:\"base16\",alphabet:\"0123456789abcdef\",bitsPerChar:4}),Ds=y({prefix:\"F\",name:\"base16upper\",alphabet:\"0123456789ABCDEF\",bitsPerChar:4});var ys=Object.freeze({__proto__:null,base16:ps,base16upper:Ds});const ms=y({prefix:\"b\",name:\"base32\",alphabet:\"abcdefghijklmnopqrstuvwxyz234567\",bitsPerChar:5}),bs=y({prefix:\"B\",name:\"base32upper\",alphabet:\"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\",bitsPerChar:5}),fs=y({prefix:\"c\",name:\"base32pad\",alphabet:\"abcdefghijklmnopqrstuvwxyz234567=\",bitsPerChar:5}),Es=y({prefix:\"C\",name:\"base32padupper\",alphabet:\"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=\",bitsPerChar:5}),ws=y({prefix:\"v\",name:\"base32hex\",alphabet:\"0123456789abcdefghijklmnopqrstuv\",bitsPerChar:5}),vs=y({prefix:\"V\",name:\"base32hexupper\",alphabet:\"0123456789ABCDEFGHIJKLMNOPQRSTUV\",bitsPerChar:5}),Is=y({prefix:\"t\",name:\"base32hexpad\",alphabet:\"0123456789abcdefghijklmnopqrstuv=\",bitsPerChar:5}),Cs=y({prefix:\"T\",name:\"base32hexpadupper\",alphabet:\"0123456789ABCDEFGHIJKLMNOPQRSTUV=\",bitsPerChar:5}),_s=y({prefix:\"h\",name:\"base32z\",alphabet:\"ybndrfg8ejkmcpqxot1uwisza345h769\",bitsPerChar:5});var Rs=Object.freeze({__proto__:null,base32:ms,base32upper:bs,base32pad:fs,base32padupper:Es,base32hex:ws,base32hexupper:vs,base32hexpad:Is,base32hexpadupper:Cs,base32z:_s});const Ts=K({prefix:\"k\",name:\"base36\",alphabet:\"0123456789abcdefghijklmnopqrstuvwxyz\"}),Ss=K({prefix:\"K\",name:\"base36upper\",alphabet:\"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\"});var Ps=Object.freeze({__proto__:null,base36:Ts,base36upper:Ss});const xs=K({name:\"base58btc\",prefix:\"z\",alphabet:\"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\"}),Os=K({name:\"base58flickr\",prefix:\"Z\",alphabet:\"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ\"});var As=Object.freeze({__proto__:null,base58btc:xs,base58flickr:Os});const zs=y({prefix:\"m\",name:\"base64\",alphabet:\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",bitsPerChar:6}),Ns=y({prefix:\"M\",name:\"base64pad\",alphabet:\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\",bitsPerChar:6}),Ls=y({prefix:\"u\",name:\"base64url\",alphabet:\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_\",bitsPerChar:6}),Us=y({prefix:\"U\",name:\"base64urlpad\",alphabet:\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=\",bitsPerChar:6});var $s=Object.freeze({__proto__:null,base64:zs,base64pad:Ns,base64url:Ls,base64urlpad:Us});const Fe=Array.from(\"\\u{1F680}\\u{1FA90}\\u2604\\u{1F6F0}\\u{1F30C}\\u{1F311}\\u{1F312}\\u{1F313}\\u{1F314}\\u{1F315}\\u{1F316}\\u{1F317}\\u{1F318}\\u{1F30D}\\u{1F30F}\\u{1F30E}\\u{1F409}\\u2600\\u{1F4BB}\\u{1F5A5}\\u{1F4BE}\\u{1F4BF}\\u{1F602}\\u2764\\u{1F60D}\\u{1F923}\\u{1F60A}\\u{1F64F}\\u{1F495}\\u{1F62D}\\u{1F618}\\u{1F44D}\\u{1F605}\\u{1F44F}\\u{1F601}\\u{1F525}\\u{1F970}\\u{1F494}\\u{1F496}\\u{1F499}\\u{1F622}\\u{1F914}\\u{1F606}\\u{1F644}\\u{1F4AA}\\u{1F609}\\u263A\\u{1F44C}\\u{1F917}\\u{1F49C}\\u{1F614}\\u{1F60E}\\u{1F607}\\u{1F339}\\u{1F926}\\u{1F389}\\u{1F49E}\\u270C\\u2728\\u{1F937}\\u{1F631}\\u{1F60C}\\u{1F338}\\u{1F64C}\\u{1F60B}\\u{1F497}\\u{1F49A}\\u{1F60F}\\u{1F49B}\\u{1F642}\\u{1F493}\\u{1F929}\\u{1F604}\\u{1F600}\\u{1F5A4}\\u{1F603}\\u{1F4AF}\\u{1F648}\\u{1F447}\\u{1F3B6}\\u{1F612}\\u{1F92D}\\u2763\\u{1F61C}\\u{1F48B}\\u{1F440}\\u{1F62A}\\u{1F611}\\u{1F4A5}\\u{1F64B}\\u{1F61E}\\u{1F629}\\u{1F621}\\u{1F92A}\\u{1F44A}\\u{1F973}\\u{1F625}\\u{1F924}\\u{1F449}\\u{1F483}\\u{1F633}\\u270B\\u{1F61A}\\u{1F61D}\\u{1F634}\\u{1F31F}\\u{1F62C}\\u{1F643}\\u{1F340}\\u{1F337}\\u{1F63B}\\u{1F613}\\u2B50\\u2705\\u{1F97A}\\u{1F308}\\u{1F608}\\u{1F918}\\u{1F4A6}\\u2714\\u{1F623}\\u{1F3C3}\\u{1F490}\\u2639\\u{1F38A}\\u{1F498}\\u{1F620}\\u261D\\u{1F615}\\u{1F33A}\\u{1F382}\\u{1F33B}\\u{1F610}\\u{1F595}\\u{1F49D}\\u{1F64A}\\u{1F639}\\u{1F5E3}\\u{1F4AB}\\u{1F480}\\u{1F451}\\u{1F3B5}\\u{1F91E}\\u{1F61B}\\u{1F534}\\u{1F624}\\u{1F33C}\\u{1F62B}\\u26BD\\u{1F919}\\u2615\\u{1F3C6}\\u{1F92B}\\u{1F448}\\u{1F62E}\\u{1F646}\\u{1F37B}\\u{1F343}\\u{1F436}\\u{1F481}\\u{1F632}\\u{1F33F}\\u{1F9E1}\\u{1F381}\\u26A1\\u{1F31E}\\u{1F388}\\u274C\\u270A\\u{1F44B}\\u{1F630}\\u{1F928}\\u{1F636}\\u{1F91D}\\u{1F6B6}\\u{1F4B0}\\u{1F353}\\u{1F4A2}\\u{1F91F}\\u{1F641}\\u{1F6A8}\\u{1F4A8}\\u{1F92C}\\u2708\\u{1F380}\\u{1F37A}\\u{1F913}\\u{1F619}\\u{1F49F}\\u{1F331}\\u{1F616}\\u{1F476}\\u{1F974}\\u25B6\\u27A1\\u2753\\u{1F48E}\\u{1F4B8}\\u2B07\\u{1F628}\\u{1F31A}\\u{1F98B}\\u{1F637}\\u{1F57A}\\u26A0\\u{1F645}\\u{1F61F}\\u{1F635}\\u{1F44E}\\u{1F932}\\u{1F920}\\u{1F927}\\u{1F4CC}\\u{1F535}\\u{1F485}\\u{1F9D0}\\u{1F43E}\\u{1F352}\\u{1F617}\\u{1F911}\\u{1F30A}\\u{1F92F}\\u{1F437}\\u260E\\u{1F4A7}\\u{1F62F}\\u{1F486}\\u{1F446}\\u{1F3A4}\\u{1F647}\\u{1F351}\\u2744\\u{1F334}\\u{1F4A3}\\u{1F438}\\u{1F48C}\\u{1F4CD}\\u{1F940}\\u{1F922}\\u{1F445}\\u{1F4A1}\\u{1F4A9}\\u{1F450}\\u{1F4F8}\\u{1F47B}\\u{1F910}\\u{1F92E}\\u{1F3BC}\\u{1F975}\\u{1F6A9}\\u{1F34E}\\u{1F34A}\\u{1F47C}\\u{1F48D}\\u{1F4E3}\\u{1F942}\"),Fs=Fe.reduce((n,e,t)=>(n[t]=e,n),[]),ks=Fe.reduce((n,e,t)=>(n[e.codePointAt(0)]=t,n),[]);function Bs(n){return n.reduce((e,t)=>(e+=Fs[t],e),\"\")}function Ms(n){const e=[];for(const t of n){const i=ks[t.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(i)}return new Uint8Array(e)}const Ks=Q({prefix:\"\\u{1F680}\",name:\"base256emoji\",encode:Bs,decode:Ms});var Vs=Object.freeze({__proto__:null,base256emoji:Ks}),qs=Be,ke=128,js=127,Gs=~js,Ys=Math.pow(2,31);function Be(n,e,t){e=e||[],t=t||0;for(var i=t;n>=Ys;)e[t++]=n&255|ke,n/=128;for(;n&Gs;)e[t++]=n&255|ke,n>>>=7;return e[t]=n|0,Be.bytes=t-i+1,e}var Hs=de,Js=128,Me=127;function de(n,i){var t=0,i=i||0,s=0,r=i,o,a=n.length;do{if(r>=a)throw de.bytes=0,new RangeError(\"Could not decode varint\");o=n[r++],t+=s<28?(o&Me)<=Js);return de.bytes=r-i,t}var Xs=Math.pow(2,7),Ws=Math.pow(2,14),Qs=Math.pow(2,21),Zs=Math.pow(2,28),er=Math.pow(2,35),tr=Math.pow(2,42),ir=Math.pow(2,49),sr=Math.pow(2,56),rr=Math.pow(2,63),nr=function(n){return n(Ke.encode(n,e,t),e),qe=n=>Ke.encodingLength(n),ge=(n,e)=>{const t=e.byteLength,i=qe(n),s=i+qe(t),r=new Uint8Array(s+t);return Ve(n,r,0),Ve(t,r,i),r.set(e,s),new ar(n,t,e,r)};class ar{constructor(e,t,i,s){this.code=e,this.size=t,this.digest=i,this.bytes=s}}const je=({name:n,code:e,encode:t})=>new hr(n,e,t);class hr{constructor(e,t,i){this.name=e,this.code=t,this.encode=i}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?ge(this.code,t):t.then(i=>ge(this.code,i))}else throw Error(\"Unknown type, must be binary type\")}}const Ge=n=>async e=>new Uint8Array(await crypto.subtle.digest(n,e)),cr=je({name:\"sha2-256\",code:18,encode:Ge(\"SHA-256\")}),lr=je({name:\"sha2-512\",code:19,encode:Ge(\"SHA-512\")});var ur=Object.freeze({__proto__:null,sha256:cr,sha512:lr});const Ye=0,dr=\"identity\",He=Ue,gr=n=>ge(Ye,He(n)),pr={code:Ye,name:dr,encode:He,digest:gr};var Dr=Object.freeze({__proto__:null,identity:pr});new TextEncoder,new TextDecoder;const Je={...as,...cs,...us,...gs,...ys,...Rs,...Ps,...As,...$s,...Vs};({...ur,...Dr});function Xe(n){return globalThis.Buffer!=null?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):n}function yr(n=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Xe(globalThis.Buffer.allocUnsafe(n)):new Uint8Array(n)}function We(n,e,t,i){return{name:n,prefix:e,encoder:{name:n,prefix:e,encode:t},decoder:{decode:i}}}const Qe=We(\"utf8\",\"u\",n=>\"u\"+new TextDecoder(\"utf8\").decode(n),n=>new TextEncoder().encode(n.substring(1))),pe=We(\"ascii\",\"a\",n=>{let e=\"a\";for(let t=0;t{n=n.substring(1);const e=yr(n.length);for(let t=0;t{if(!this.initialized){const i=await this.getKeyChain();typeof i<\"u\"&&(this.keychain=i),this.initialized=!0}},this.has=i=>(this.isInitialized(),this.keychain.has(i)),this.set=async(i,s)=>{this.isInitialized(),this.keychain.set(i,s),await this.persist()},this.get=i=>{this.isInitialized();const s=this.keychain.get(i);if(typeof s>\"u\"){const{message:r}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getInternalError)(\"NO_MATCHING_KEY\",`${this.name}: ${i}`);throw new Error(r)}return s},this.del=async i=>{this.isInitialized(),this.keychain.delete(i),await this.persist()},this.core=e,this.logger=(0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_3__.generateChildLogger)(t,this.name)}get context(){return (0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_3__.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+\"//\"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.mapToObj)(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<\"u\"?(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.objToMap)(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getInternalError)(\"NOT_INITIALIZED\",this.name);throw new Error(e)}}}class At{constructor(e,t,i){this.core=e,this.logger=t,this.name=it,this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=s=>(this.isInitialized(),this.keychain.has(s)),this.getClientId=async()=>{this.isInitialized();const s=await this.getClientSeed(),r=_walletconnect_relay_auth__WEBPACK_IMPORTED_MODULE_5__.generateKeyPair(s);return _walletconnect_relay_auth__WEBPACK_IMPORTED_MODULE_5__.encodeIss(r.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const s=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.generateKeyPair)();return this.setPrivateKey(s.publicKey,s.privateKey)},this.signJWT=async s=>{this.isInitialized();const r=await this.getClientSeed(),o=_walletconnect_relay_auth__WEBPACK_IMPORTED_MODULE_5__.generateKeyPair(r),a=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.generateRandomBytes32)(),h=st;return await _walletconnect_relay_auth__WEBPACK_IMPORTED_MODULE_5__.signJWT(a,s,h,o)},this.generateSharedKey=(s,r,o)=>{this.isInitialized();const a=this.getPrivateKey(s),h=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.deriveSymKey)(a,r);return this.setSymKey(h,o)},this.setSymKey=async(s,r)=>{this.isInitialized();const o=r||(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.hashKey)(s);return await this.keychain.set(o,s),o},this.deleteKeyPair=async s=>{this.isInitialized(),await this.keychain.del(s)},this.deleteSymKey=async s=>{this.isInitialized(),await this.keychain.del(s)},this.encode=async(s,r,o)=>{this.isInitialized();const a=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.validateEncoding)(o),h=(0,_walletconnect_safe_json__WEBPACK_IMPORTED_MODULE_4__.safeJsonStringify)(r);if((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.isTypeOneEnvelope)(a)){const m=a.senderPublicKey,L=a.receiverPublicKey;s=await this.generateSharedKey(m,L)}const l=this.getSymKey(s),{type:d,senderPublicKey:g}=a;return (0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.encrypt)({type:d,symKey:l,message:h,senderPublicKey:g})},this.decode=async(s,r,o)=>{this.isInitialized();const a=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.validateDecoding)(r,o);if((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.isTypeOneEnvelope)(a)){const h=a.receiverPublicKey,l=a.senderPublicKey;s=await this.generateSharedKey(h,l)}try{const h=this.getSymKey(s),l=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.decrypt)({symKey:h,encoded:r});return (0,_walletconnect_safe_json__WEBPACK_IMPORTED_MODULE_4__.safeJsonParse)(l)}catch(h){this.logger.error(`Failed to decode message from topic: '${s}', clientId: '${await this.getClientId()}'`),this.logger.error(h)}},this.getPayloadType=s=>{const r=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.deserialize)(s);return (0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.decodeTypeByte)(r.type)},this.getPayloadSenderPublicKey=s=>{const r=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.deserialize)(s);return r.senderPublicKey?(0,uint8arrays__WEBPACK_IMPORTED_MODULE_6__.toString)(r.senderPublicKey,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.BASE16):void 0},this.core=e,this.logger=(0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_3__.generateChildLogger)(t,this.name),this.keychain=i||new Ot(this.core,this.logger)}get context(){return (0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_3__.getLoggerContext)(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e=\"\";try{e=this.keychain.get(ye)}catch{e=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.generateRandomBytes32)(),await this.keychain.set(ye,e)}return br(e,\"base16\")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getInternalError)(\"NOT_INITIALIZED\",this.name);throw new Error(e)}}}class zt extends _walletconnect_types__WEBPACK_IMPORTED_MODULE_14__.IMessageTracker{constructor(e,t){super(e,t),this.logger=e,this.core=t,this.messages=new Map,this.name=ot,this.version=at,this.initialized=!1,this.storagePrefix=z,this.init=async()=>{if(!this.initialized){this.logger.trace(\"Initialized\");try{const i=await this.getRelayerMessages();typeof i<\"u\"&&(this.messages=i),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:\"method\",method:\"restore\",size:this.messages.size})}catch(i){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(i)}finally{this.initialized=!0}}},this.set=async(i,s)=>{this.isInitialized();const r=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.hashMessage)(s);let o=this.messages.get(i);return typeof o>\"u\"&&(o={}),typeof o[r]<\"u\"||(o[r]=s,this.messages.set(i,o),await this.persist()),r},this.get=i=>{this.isInitialized();let s=this.messages.get(i);return typeof s>\"u\"&&(s={}),s},this.has=(i,s)=>{this.isInitialized();const r=this.get(i),o=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.hashMessage)(s);return typeof r[o]<\"u\"},this.del=async i=>{this.isInitialized(),this.messages.delete(i),await this.persist()},this.logger=(0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_3__.generateChildLogger)(e,this.name),this.core=t}get context(){return (0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_3__.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+\"//\"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.mapToObj)(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<\"u\"?(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.objToMap)(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getInternalError)(\"NOT_INITIALIZED\",this.name);throw new Error(e)}}}class Ir extends _walletconnect_types__WEBPACK_IMPORTED_MODULE_14__.IPublisher{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.events=new events__WEBPACK_IMPORTED_MODULE_0__.EventEmitter,this.name=ct,this.queue=new Map,this.publishTimeout=(0,_walletconnect_time__WEBPACK_IMPORTED_MODULE_7__.toMiliseconds)(_walletconnect_time__WEBPACK_IMPORTED_MODULE_7__.ONE_MINUTE),this.failedPublishTimeout=(0,_walletconnect_time__WEBPACK_IMPORTED_MODULE_7__.toMiliseconds)(_walletconnect_time__WEBPACK_IMPORTED_MODULE_7__.ONE_SECOND),this.needsTransportRestart=!1,this.publish=async(i,s,r)=>{var o;this.logger.debug(\"Publishing Payload\"),this.logger.trace({type:\"method\",method:\"publish\",params:{topic:i,message:s,opts:r}});const a=r?.ttl||ht,h=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getRelayProtocolName)(r),l=r?.prompt||!1,d=r?.tag||0,g=r?.id||(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_9__.getBigIntRpcId)().toString(),m={topic:i,message:s,opts:{ttl:a,relay:h,prompt:l,tag:d,id:g}},L=`Failed to publish payload, please try again. id:${g} tag:${d}`,u=Date.now();let p,_=1;try{for(;p===void 0;){if(Date.now()-u>this.publishTimeout)throw new Error(L);this.logger.trace({id:g,attempts:_},`publisher.publish - attempt ${_}`),p=await await (0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.createExpiringPromise)(this.rpcPublish(i,s,a,h,l,d,g).catch(D=>this.logger.warn(D)),this.publishTimeout,L),_++,p||await new Promise(D=>setTimeout(D,this.failedPublishTimeout))}this.relayer.events.emit(v.publish,m),this.logger.debug(\"Successfully Published Payload\"),this.logger.trace({type:\"method\",method:\"publish\",params:{id:g,topic:i,message:s,opts:r}})}catch(D){if(this.logger.debug(\"Failed to Publish Payload\"),this.logger.error(D),(o=r?.internal)!=null&&o.throwOnFailedPublish)throw D;this.queue.set(g,m)}},this.on=(i,s)=>{this.events.on(i,s)},this.once=(i,s)=>{this.events.once(i,s)},this.off=(i,s)=>{this.events.off(i,s)},this.removeListener=(i,s)=>{this.events.removeListener(i,s)},this.relayer=e,this.logger=(0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_3__.generateChildLogger)(t,this.name),this.registerEventListeners()}get context(){return (0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_3__.getLoggerContext)(this.logger)}rpcPublish(e,t,i,s,r,o,a){var h,l,d,g;const m={method:(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getRelayProtocolApi)(s.protocol).publish,params:{topic:e,message:t,ttl:i,prompt:r,tag:o},id:a};return (0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.isUndefined)((h=m.params)==null?void 0:h.prompt)&&((l=m.params)==null||delete l.prompt),(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.isUndefined)((d=m.params)==null?void 0:d.tag)&&((g=m.params)==null||delete g.tag),this.logger.debug(\"Outgoing Relay Payload\"),this.logger.trace({type:\"message\",direction:\"outgoing\",request:m}),this.relayer.request(m)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:t,message:i,opts:s}=e;await this.publish(t,i,s)})}registerEventListeners(){this.relayer.core.heartbeat.on(_walletconnect_heartbeat__WEBPACK_IMPORTED_MODULE_2__.HEARTBEAT_EVENTS.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(v.connection_stalled);return}this.checkQueue()}),this.relayer.on(v.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class Cr{constructor(){this.map=new Map,this.set=(e,t)=>{const i=this.get(e);this.exists(e,t)||this.map.set(e,[...i,t])},this.get=e=>this.map.get(e)||[],this.exists=(e,t)=>this.get(e).includes(t),this.delete=(e,t)=>{if(typeof t>\"u\"){this.map.delete(e);return}if(!this.map.has(e))return;const i=this.get(e);if(!this.exists(e,t))return;const s=i.filter(r=>r!==t);if(!s.length){this.map.delete(e);return}this.map.set(e,s)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var _r=Object.defineProperty,Rr=Object.defineProperties,Tr=Object.getOwnPropertyDescriptors,Nt=Object.getOwnPropertySymbols,Sr=Object.prototype.hasOwnProperty,Pr=Object.prototype.propertyIsEnumerable,Lt=(n,e,t)=>e in n?_r(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,q=(n,e)=>{for(var t in e||(e={}))Sr.call(e,t)&&Lt(n,t,e[t]);if(Nt)for(var t of Nt(e))Pr.call(e,t)&&Lt(n,t,e[t]);return n},fe=(n,e)=>Rr(n,Tr(e));class Ut extends _walletconnect_types__WEBPACK_IMPORTED_MODULE_14__.ISubscriber{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.subscriptions=new Map,this.topicMap=new Cr,this.events=new events__WEBPACK_IMPORTED_MODULE_0__.EventEmitter,this.name=ft,this.version=Et,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel=\"pending_sub_watch_label\",this.pollingInterval=20,this.storagePrefix=z,this.subscribeTimeout=(0,_walletconnect_time__WEBPACK_IMPORTED_MODULE_7__.toMiliseconds)(_walletconnect_time__WEBPACK_IMPORTED_MODULE_7__.ONE_MINUTE),this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace(\"Initialized\"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(i,s)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug(\"Subscribing Topic\"),this.logger.trace({type:\"method\",method:\"subscribe\",params:{topic:i,opts:s}});try{const r=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getRelayProtocolName)(s),o={topic:i,relay:r};this.pending.set(i,o);const a=await this.rpcSubscribe(i,r);return typeof a==\"string\"&&(this.onSubscribe(a,o),this.logger.debug(\"Successfully Subscribed Topic\"),this.logger.trace({type:\"method\",method:\"subscribe\",params:{topic:i,opts:s}})),a}catch(r){throw this.logger.debug(\"Failed to Subscribe Topic\"),this.logger.error(r),r}},this.unsubscribe=async(i,s)=>{await this.restartToComplete(),this.isInitialized(),typeof s?.id<\"u\"?await this.unsubscribeById(i,s.id,s):await this.unsubscribeByTopic(i,s)},this.isSubscribed=async i=>{if(this.topics.includes(i))return!0;const s=`${this.pendingSubscriptionWatchLabel}_${i}`;return await new Promise((r,o)=>{const a=new _walletconnect_time__WEBPACK_IMPORTED_MODULE_7__.Watch;a.start(s);const h=setInterval(()=>{!this.pending.has(i)&&this.topics.includes(i)&&(clearInterval(h),a.stop(s),r(!0)),a.elapsed(s)>=wt&&(clearInterval(h),a.stop(s),o(new Error(\"Subscription resolution timeout\")))},this.pollingInterval)}).catch(()=>!1)},this.on=(i,s)=>{this.events.on(i,s)},this.once=(i,s)=>{this.events.once(i,s)},this.off=(i,s)=>{this.events.off(i,s)},this.removeListener=(i,s)=>{this.events.removeListener(i,s)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=(0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_3__.generateChildLogger)(t,this.name),this.clientId=\"\"}get context(){return (0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_3__.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+\"//\"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,t){let i=!1;try{i=this.getSubscription(e).topic===t}catch{}return i}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){const i=this.topicMap.get(e);await Promise.all(i.map(async s=>await this.unsubscribeById(e,s,t)))}async unsubscribeById(e,t,i){this.logger.debug(\"Unsubscribing Topic\"),this.logger.trace({type:\"method\",method:\"unsubscribe\",params:{topic:e,id:t,opts:i}});try{const s=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getRelayProtocolName)(i);await this.rpcUnsubscribe(e,t,s);const r=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getSdkError)(\"USER_DISCONNECTED\",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,r),this.logger.debug(\"Successfully Unsubscribed Topic\"),this.logger.trace({type:\"method\",method:\"unsubscribe\",params:{topic:e,id:t,opts:i}})}catch(s){throw this.logger.debug(\"Failed to Unsubscribe Topic\"),this.logger.error(s),s}}async rpcSubscribe(e,t){const i={method:(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getRelayProtocolApi)(t.protocol).subscribe,params:{topic:e}};this.logger.debug(\"Outgoing Relay Payload\"),this.logger.trace({type:\"payload\",direction:\"outgoing\",request:i});try{return await await (0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.createExpiringPromise)(this.relayer.request(i).catch(s=>this.logger.warn(s)),this.subscribeTimeout)?(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.hashMessage)(e+this.clientId):null}catch{this.logger.debug(\"Outgoing Relay Subscribe Payload stalled\"),this.relayer.events.emit(v.connection_stalled)}return null}async rpcBatchSubscribe(e){if(!e.length)return;const t=e[0].relay,i={method:(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getRelayProtocolApi)(t.protocol).batchSubscribe,params:{topics:e.map(s=>s.topic)}};this.logger.debug(\"Outgoing Relay Payload\"),this.logger.trace({type:\"payload\",direction:\"outgoing\",request:i});try{return await await (0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.createExpiringPromise)(this.relayer.request(i).catch(s=>this.logger.warn(s)),this.subscribeTimeout)}catch{this.relayer.events.emit(v.connection_stalled)}}rpcUnsubscribe(e,t,i){const s={method:(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getRelayProtocolApi)(i.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug(\"Outgoing Relay Payload\"),this.logger.trace({type:\"payload\",direction:\"outgoing\",request:s}),this.relayer.request(s)}onSubscribe(e,t){this.setSubscription(e,fe(q({},t),{id:e})),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach(t=>{this.setSubscription(t.id,q({},t)),this.pending.delete(t.topic)})}async onUnsubscribe(e,t,i){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,i),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,t){this.logger.debug(\"Setting subscription\"),this.logger.trace({type:\"method\",method:\"setSubscription\",id:e,subscription:t}),this.addSubscription(e,t)}addSubscription(e,t){this.subscriptions.set(e,q({},t)),this.topicMap.set(t.topic,e),this.events.emit(S.created,t)}getSubscription(e){this.logger.debug(\"Getting subscription\"),this.logger.trace({type:\"method\",method:\"getSubscription\",id:e});const t=this.subscriptions.get(e);if(!t){const{message:i}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getInternalError)(\"NO_MATCHING_KEY\",`${this.name}: ${e}`);throw new Error(i)}return t}deleteSubscription(e,t){this.logger.debug(\"Deleting subscription\"),this.logger.trace({type:\"method\",method:\"deleteSubscription\",id:e,reason:t});const i=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(i.topic,e),this.events.emit(S.deleted,fe(q({},i),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(S.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let t=0;t\"u\"||!e.length)return;if(this.subscriptions.size){const{message:t}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getInternalError)(\"RESTORE_WILL_OVERRIDE\",this.name);throw this.logger.error(t),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:\"method\",method:\"restore\",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const t=await this.rpcBatchSubscribe(e);(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.isValidArray)(t)&&this.onBatchSubscribe(t.map((i,s)=>fe(q({},e[s]),{id:i})))}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||!this.relayer.connected)return;const e=[];this.pending.forEach(t=>{e.push(t)}),await this.batchSubscribe(e)}registerEventListeners(){this.relayer.core.heartbeat.on(_walletconnect_heartbeat__WEBPACK_IMPORTED_MODULE_2__.HEARTBEAT_EVENTS.pulse,async()=>{await this.checkPending()}),this.events.on(S.created,async e=>{const t=S.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:\"event\",event:t,data:e}),await this.persist()}),this.events.on(S.deleted,async e=>{const t=S.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:\"event\",event:t,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getInternalError)(\"NOT_INITIALIZED\",this.name);throw new Error(e)}}async restartToComplete(){this.restartInProgress&&await new Promise(e=>{const t=setInterval(()=>{this.restartInProgress||(clearInterval(t),e())},this.pollingInterval)})}}var xr=Object.defineProperty,$t=Object.getOwnPropertySymbols,Or=Object.prototype.hasOwnProperty,Ar=Object.prototype.propertyIsEnumerable,Ft=(n,e,t)=>e in n?xr(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,zr=(n,e)=>{for(var t in e||(e={}))Or.call(e,t)&&Ft(n,t,e[t]);if($t)for(var t of $t(e))Ar.call(e,t)&&Ft(n,t,e[t]);return n};class kt extends _walletconnect_types__WEBPACK_IMPORTED_MODULE_14__.IRelayer{constructor(e){super(e),this.protocol=\"wc\",this.version=2,this.events=new events__WEBPACK_IMPORTED_MODULE_0__.EventEmitter,this.name=dt,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=[\"socket hang up\",\"socket stalled\",\"interrupted\"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.heartBeatTimeout=(0,_walletconnect_time__WEBPACK_IMPORTED_MODULE_7__.toMiliseconds)(_walletconnect_time__WEBPACK_IMPORTED_MODULE_7__.THIRTY_SECONDS+_walletconnect_time__WEBPACK_IMPORTED_MODULE_7__.ONE_SECOND),this.request=async t=>{var i,s;this.logger.debug(\"Publishing Request Payload\");const r=t.id||(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_9__.getBigIntRpcId)().toString();await this.toEstablishConnection();try{const o=this.provider.request(t);this.requestsInFlight.set(r,{promise:o,request:t}),this.logger.trace({id:r,method:t.method,topic:(i=t.params)==null?void 0:i.topic},\"relayer.request - attempt to publish...\");const a=await new Promise(async(h,l)=>{const d=()=>{l(new Error(`relayer.request - publish interrupted, id: ${r}`))};this.provider.on(f.disconnect,d);const g=await o;this.provider.off(f.disconnect,d),h(g)});return this.logger.trace({id:r,method:t.method,topic:(s=t.params)==null?void 0:s.topic},\"relayer.request - published\"),a}catch(o){throw this.logger.debug(`Failed to Publish Request: ${r}`),o}finally{this.requestsInFlight.delete(r)}},this.resetPingTimeout=()=>{if((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.isNode)())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var t,i,s;(s=(i=(t=this.provider)==null?void 0:t.connection)==null?void 0:i.socket)==null||s.terminate()},this.heartBeatTimeout)}catch(t){this.logger.warn(t)}},this.onPayloadHandler=t=>{this.onProviderPayload(t),this.resetPingTimeout()},this.onConnectHandler=()=>{this.startPingTimeout(),this.events.emit(v.connect)},this.onDisconnectHandler=()=>{this.onProviderDisconnect()},this.onProviderErrorHandler=t=>{this.logger.error(t),this.events.emit(v.error,t),this.logger.info(\"Fatal socket error received, closing transport\"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(f.payload,this.onPayloadHandler),this.provider.on(f.connect,this.onConnectHandler),this.provider.on(f.disconnect,this.onDisconnectHandler),this.provider.on(f.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<\"u\"&&typeof e.logger!=\"string\"?(0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_3__.generateChildLogger)(e.logger,this.name):(0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_3__.pino)((0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_3__.getDefaultLoggerOptions)({level:e.logger||ut})),this.messages=new zt(this.logger,e.core),this.subscriber=new Ut(this,this.logger),this.publisher=new Ir(this,this.logger),this.relayUrl=e?.relayUrl||me,this.projectId=e.projectId,this.bundleId=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getBundleId)(),this.provider={}}async init(){this.logger.trace(\"Initialized\"),this.registerEventListeners(),await this.createProvider(),await Promise.all([this.messages.init(),this.subscriber.init()]);try{await this.transportOpen()}catch{this.logger.warn(`Connection via ${this.relayUrl} failed, attempting to connect via failover domain ${be}...`),await this.restartTransport(be)}this.initialized=!0,setTimeout(async()=>{this.subscriber.topics.length===0&&this.subscriber.pending.size===0&&(this.logger.info(\"No topics subscribed to after init, closing transport\"),await this.transportClose(),this.transportExplicitlyClosed=!1)},yt)}get context(){return (0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_3__.getLoggerContext)(this.logger)}get connected(){var e,t,i;return((i=(t=(e=this.provider)==null?void 0:e.connection)==null?void 0:t.socket)==null?void 0:i.readyState)===1}get connecting(){var e,t,i;return((i=(t=(e=this.provider)==null?void 0:e.connection)==null?void 0:t.socket)==null?void 0:i.readyState)===0}async publish(e,t,i){this.isInitialized(),await this.publisher.publish(e,t,i),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now()})}async subscribe(e,t){var i;this.isInitialized();let s=((i=this.subscriber.topicMap.get(e))==null?void 0:i[0])||\"\",r;const o=a=>{a.topic===e&&(this.subscriber.off(S.created,o),r())};return await Promise.all([new Promise(a=>{r=a,this.subscriber.on(S.created,o)}),new Promise(async a=>{s=await this.subscriber.subscribe(e,t)||s,a()})]),s}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportDisconnect(){if(!this.hasExperiencedNetworkDisruption&&this.connected&&this.requestsInFlight.size>0)try{await Promise.all(Array.from(this.requestsInFlight.values()).map(e=>e.promise))}catch(e){this.logger.warn(e)}this.hasExperiencedNetworkDisruption||this.connected?await (0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.createExpiringPromise)(this.provider.disconnect(),2e3,\"provider.disconnect()\").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect(),await this.createProvider()),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;try{await new Promise(async(t,i)=>{const s=()=>{this.provider.off(f.disconnect,s),i(new Error(\"Connection interrupted while trying to subscribe\"))};this.provider.on(f.disconnect,s),await (0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.createExpiringPromise)(this.provider.connect(),(0,_walletconnect_time__WEBPACK_IMPORTED_MODULE_7__.toMiliseconds)(_walletconnect_time__WEBPACK_IMPORTED_MODULE_7__.ONE_MINUTE),`Socket stalled when trying to connect to ${this.relayUrl}`).catch(r=>{i(r)}),await this.subscriber.start(),this.hasExperiencedNetworkDisruption=!1,t()})}catch(t){this.logger.error(t);const i=t;if(!this.isConnectionStalled(i.message))throw t}finally{this.connectionAttemptInProgress=!1}}async restartTransport(e){this.connectionAttemptInProgress||(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.createProvider(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await (0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.isOnline)())throw new Error(\"No internet connection detected. Please restart your network and try again.\")}startPingTimeout(){var e,t,i,s,r;if((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.isNode)())try{(t=(e=this.provider)==null?void 0:e.connection)!=null&&t.socket&&((r=(s=(i=this.provider)==null?void 0:i.connection)==null?void 0:s.socket)==null||r.once(\"ping\",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(o){this.logger.warn(o)}}isConnectionStalled(e){return this.staleConnectionErrors.some(t=>e.includes(t))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new _walletconnect_jsonrpc_provider__WEBPACK_IMPORTED_MODULE_8__.JsonRpcProvider(new _walletconnect_jsonrpc_ws_connection__WEBPACK_IMPORTED_MODULE_10__[\"default\"]((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.formatRelayRpcUrl)({sdkVersion:Dt,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:t,message:i}=e;await this.messages.set(t,i)}async shouldIgnoreMessageEvent(e){const{topic:t,message:i}=e;if(!i||i.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${i}`),!0;if(!await this.subscriber.isSubscribed(t))return this.logger.debug(`Ignoring message for non-subscribed topic ${t}`),!0;const s=this.messages.has(t,i);return s&&this.logger.debug(`Ignoring duplicate message: ${i}`),s}async onProviderPayload(e){if(this.logger.debug(\"Incoming Relay Payload\"),this.logger.trace({type:\"payload\",direction:\"incoming\",payload:e}),(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_9__.isJsonRpcRequest)(e)){if(!e.method.endsWith(gt))return;const t=e.params,{topic:i,message:s,publishedAt:r}=t.data,o={topic:i,message:s,publishedAt:r};this.logger.debug(\"Emitting Relayer Payload\"),this.logger.trace(zr({type:\"event\",event:t.id},o)),this.events.emit(t.id,o),await this.acknowledgePayload(e),await this.onMessageEvent(o)}else (0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_9__.isJsonRpcResponse)(e)&&this.events.emit(v.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(v.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const t=(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_9__.formatJsonRpcResult)(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off(f.payload,this.onPayloadHandler),this.provider.off(f.connect,this.onConnectHandler),this.provider.off(f.disconnect,this.onDisconnectHandler),this.provider.off(f.error,this.onProviderErrorHandler)}async registerEventListeners(){let e=await (0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.isOnline)();(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.subscribeToNetworkChange)(async t=>{e!==t&&(e=t,t?await this.restartTransport().catch(i=>this.logger.error(i)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))})}async onProviderDisconnect(){await this.subscriber.stop(),this.events.emit(v.disconnect),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e))},(0,_walletconnect_time__WEBPACK_IMPORTED_MODULE_7__.toMiliseconds)(pt))}isInitialized(){if(!this.initialized){const{message:e}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getInternalError)(\"NOT_INITIALIZED\",this.name);throw new Error(e)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),!this.connected&&(this.connectionAttemptInProgress&&await new Promise(e=>{const t=setInterval(()=>{this.connected&&(clearInterval(t),e())},this.connectionStatusPollingInterval)}),await this.transportOpen())}}var Nr=Object.defineProperty,Bt=Object.getOwnPropertySymbols,Lr=Object.prototype.hasOwnProperty,Ur=Object.prototype.propertyIsEnumerable,Mt=(n,e,t)=>e in n?Nr(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Kt=(n,e)=>{for(var t in e||(e={}))Lr.call(e,t)&&Mt(n,t,e[t]);if(Bt)for(var t of Bt(e))Ur.call(e,t)&&Mt(n,t,e[t]);return n};class Vt extends _walletconnect_types__WEBPACK_IMPORTED_MODULE_14__.IStore{constructor(e,t,i,s=z,r=void 0){super(e,t,i,s),this.core=e,this.logger=t,this.name=i,this.map=new Map,this.version=mt,this.cached=[],this.initialized=!1,this.storagePrefix=z,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace(\"Initialized\"),await this.restore(),this.cached.forEach(o=>{this.getKey&&o!==null&&!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.isUndefined)(o)?this.map.set(this.getKey(o),o):(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.isProposalStruct)(o)?this.map.set(o.id,o):(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.isSessionStruct)(o)&&this.map.set(o.topic,o)}),this.cached=[],this.initialized=!0)},this.set=async(o,a)=>{this.isInitialized(),this.map.has(o)?await this.update(o,a):(this.logger.debug(\"Setting value\"),this.logger.trace({type:\"method\",method:\"set\",key:o,value:a}),this.map.set(o,a),await this.persist())},this.get=o=>(this.isInitialized(),this.logger.debug(\"Getting value\"),this.logger.trace({type:\"method\",method:\"get\",key:o}),this.getData(o)),this.getAll=o=>(this.isInitialized(),o?this.values.filter(a=>Object.keys(o).every(h=>lodash_isequal__WEBPACK_IMPORTED_MODULE_11___default()(a[h],o[h]))):this.values),this.update=async(o,a)=>{this.isInitialized(),this.logger.debug(\"Updating value\"),this.logger.trace({type:\"method\",method:\"update\",key:o,update:a});const h=Kt(Kt({},this.getData(o)),a);this.map.set(o,h),await this.persist()},this.delete=async(o,a)=>{this.isInitialized(),this.map.has(o)&&(this.logger.debug(\"Deleting value\"),this.logger.trace({type:\"method\",method:\"delete\",key:o,reason:a}),this.map.delete(o),this.addToRecentlyDeleted(o),await this.persist())},this.logger=(0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_3__.generateChildLogger)(t,this.name),this.storagePrefix=s,this.getKey=r}get context(){return (0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_3__.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+\"//\"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const t=this.map.get(e);if(!t){if(this.recentlyDeleted.includes(e)){const{message:s}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getInternalError)(\"MISSING_OR_INVALID\",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(s),new Error(s)}const{message:i}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getInternalError)(\"NO_MATCHING_KEY\",`${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}return t}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>\"u\"||!e.length)return;if(this.map.size){const{message:t}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getInternalError)(\"RESTORE_WILL_OVERRIDE\",this.name);throw this.logger.error(t),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:\"method\",method:\"restore\",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getInternalError)(\"NOT_INITIALIZED\",this.name);throw new Error(e)}}}class qt{constructor(e,t){this.core=e,this.logger=t,this.name=vt,this.version=It,this.events=new (events__WEBPACK_IMPORTED_MODULE_0___default()),this.initialized=!1,this.storagePrefix=z,this.ignoredPayloadTypes=[_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.TYPE_1],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace(\"Initialized\"))},this.register=({methods:i})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...i])]},this.create=async i=>{this.isInitialized();const s=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.generateRandomBytes32)(),r=await this.core.crypto.setSymKey(s),o=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.calcExpiry)(_walletconnect_time__WEBPACK_IMPORTED_MODULE_7__.FIVE_MINUTES),a={protocol:lt},h={topic:r,expiry:o,relay:a,active:!1},l=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.formatUri)({protocol:this.core.protocol,version:this.core.version,topic:r,symKey:s,relay:a,expiryTimestamp:o,methods:i?.methods});return await this.pairings.set(r,h),await this.core.relayer.subscribe(r),this.core.expirer.set(r,o),{topic:r,uri:l}},this.pair=async i=>{this.isInitialized(),this.isValidPair(i);const{topic:s,symKey:r,relay:o,expiryTimestamp:a,methods:h}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.parseUri)(i.uri);let l;if(this.pairings.keys.includes(s)&&(l=this.pairings.get(s),l.active))throw new Error(`Pairing already exists: ${s}. Please try again with a new connection URI.`);const d=a||(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.calcExpiry)(_walletconnect_time__WEBPACK_IMPORTED_MODULE_7__.FIVE_MINUTES),g={topic:s,relay:o,expiry:d,active:!1,methods:h};return await this.pairings.set(s,g),this.core.expirer.set(s,d),i.activatePairing&&await this.activate({topic:s}),this.events.emit(V.create,g),this.core.crypto.keychain.has(s)||await this.core.crypto.setSymKey(r,s),await this.core.relayer.subscribe(s,{relay:o}),g},this.activate=async({topic:i})=>{this.isInitialized();const s=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.calcExpiry)(_walletconnect_time__WEBPACK_IMPORTED_MODULE_7__.THIRTY_DAYS);await this.pairings.update(i,{active:!0,expiry:s}),this.core.expirer.set(i,s)},this.ping=async i=>{this.isInitialized(),await this.isValidPing(i);const{topic:s}=i;if(this.pairings.keys.includes(s)){const r=await this.sendRequest(s,\"wc_pairingPing\",{}),{done:o,resolve:a,reject:h}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.createDelayedPromise)();this.events.once((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.engineEvent)(\"pairing_ping\",r),({error:l})=>{l?h(l):a()}),await o()}},this.updateExpiry=async({topic:i,expiry:s})=>{this.isInitialized(),await this.pairings.update(i,{expiry:s})},this.updateMetadata=async({topic:i,metadata:s})=>{this.isInitialized(),await this.pairings.update(i,{peerMetadata:s})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async i=>{this.isInitialized(),await this.isValidDisconnect(i);const{topic:s}=i;this.pairings.keys.includes(s)&&(await this.sendRequest(s,\"wc_pairingDelete\",(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getSdkError)(\"USER_DISCONNECTED\")),await this.deletePairing(s))},this.sendRequest=async(i,s,r)=>{const o=(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_9__.formatJsonRpcRequest)(s,r),a=await this.core.crypto.encode(i,o),h=F[s].req;return this.core.history.set(i,o),this.core.relayer.publish(i,a,h),o.id},this.sendResult=async(i,s,r)=>{const o=(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_9__.formatJsonRpcResult)(i,r),a=await this.core.crypto.encode(s,o),h=await this.core.history.get(s,i),l=F[h.request.method].res;await this.core.relayer.publish(s,a,l),await this.core.history.resolve(o)},this.sendError=async(i,s,r)=>{const o=(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_9__.formatJsonRpcError)(i,r),a=await this.core.crypto.encode(s,o),h=await this.core.history.get(s,i),l=F[h.request.method]?F[h.request.method].res:F.unregistered_method.res;await this.core.relayer.publish(s,a,l),await this.core.history.resolve(o)},this.deletePairing=async(i,s)=>{await this.core.relayer.unsubscribe(i),await Promise.all([this.pairings.delete(i,(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getSdkError)(\"USER_DISCONNECTED\")),this.core.crypto.deleteSymKey(i),s?Promise.resolve():this.core.expirer.del(i)])},this.cleanup=async()=>{const i=this.pairings.getAll().filter(s=>(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.isExpired)(s.expiry));await Promise.all(i.map(s=>this.deletePairing(s.topic)))},this.onRelayEventRequest=i=>{const{topic:s,payload:r}=i;switch(r.method){case\"wc_pairingPing\":return this.onPairingPingRequest(s,r);case\"wc_pairingDelete\":return this.onPairingDeleteRequest(s,r);default:return this.onUnknownRpcMethodRequest(s,r)}},this.onRelayEventResponse=async i=>{const{topic:s,payload:r}=i,o=(await this.core.history.get(s,r.id)).request.method;switch(o){case\"wc_pairingPing\":return this.onPairingPingResponse(s,r);default:return this.onUnknownRpcMethodResponse(o)}},this.onPairingPingRequest=async(i,s)=>{const{id:r}=s;try{this.isValidPing({topic:i}),await this.sendResult(r,i,!0),this.events.emit(V.ping,{id:r,topic:i})}catch(o){await this.sendError(r,i,o),this.logger.error(o)}},this.onPairingPingResponse=(i,s)=>{const{id:r}=s;setTimeout(()=>{(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_9__.isJsonRpcResult)(s)?this.events.emit((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.engineEvent)(\"pairing_ping\",r),{}):(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_9__.isJsonRpcError)(s)&&this.events.emit((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.engineEvent)(\"pairing_ping\",r),{error:s.error})},500)},this.onPairingDeleteRequest=async(i,s)=>{const{id:r}=s;try{this.isValidDisconnect({topic:i}),await this.deletePairing(i),this.events.emit(V.delete,{id:r,topic:i})}catch(o){await this.sendError(r,i,o),this.logger.error(o)}},this.onUnknownRpcMethodRequest=async(i,s)=>{const{id:r,method:o}=s;try{if(this.registeredMethods.includes(o))return;const a=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getSdkError)(\"WC_METHOD_UNSUPPORTED\",o);await this.sendError(r,i,a),this.logger.error(a)}catch(a){await this.sendError(r,i,a),this.logger.error(a)}},this.onUnknownRpcMethodResponse=i=>{this.registeredMethods.includes(i)||this.logger.error((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getSdkError)(\"WC_METHOD_UNSUPPORTED\",i))},this.isValidPair=i=>{var s;if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.isValidParams)(i)){const{message:o}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getInternalError)(\"MISSING_OR_INVALID\",`pair() params: ${i}`);throw new Error(o)}if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.isValidUrl)(i.uri)){const{message:o}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getInternalError)(\"MISSING_OR_INVALID\",`pair() uri: ${i.uri}`);throw new Error(o)}const r=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.parseUri)(i.uri);if(!((s=r?.relay)!=null&&s.protocol)){const{message:o}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getInternalError)(\"MISSING_OR_INVALID\",\"pair() uri#relay-protocol\");throw new Error(o)}if(!(r!=null&&r.symKey)){const{message:o}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getInternalError)(\"MISSING_OR_INVALID\",\"pair() uri#symKey\");throw new Error(o)}if(r!=null&&r.expiryTimestamp&&(0,_walletconnect_time__WEBPACK_IMPORTED_MODULE_7__.toMiliseconds)(r?.expiryTimestamp){if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.isValidParams)(i)){const{message:r}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getInternalError)(\"MISSING_OR_INVALID\",`ping() params: ${i}`);throw new Error(r)}const{topic:s}=i;await this.isValidPairingTopic(s)},this.isValidDisconnect=async i=>{if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.isValidParams)(i)){const{message:r}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getInternalError)(\"MISSING_OR_INVALID\",`disconnect() params: ${i}`);throw new Error(r)}const{topic:s}=i;await this.isValidPairingTopic(s)},this.isValidPairingTopic=async i=>{if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.isValidString)(i,!1)){const{message:s}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getInternalError)(\"MISSING_OR_INVALID\",`pairing topic should be a string: ${i}`);throw new Error(s)}if(!this.pairings.keys.includes(i)){const{message:s}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getInternalError)(\"NO_MATCHING_KEY\",`pairing topic doesn't exist: ${i}`);throw new Error(s)}if((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.isExpired)(this.pairings.get(i).expiry)){await this.deletePairing(i);const{message:s}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getInternalError)(\"EXPIRED\",`pairing topic: ${i}`);throw new Error(s)}},this.core=e,this.logger=(0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_3__.generateChildLogger)(t,this.name),this.pairings=new Vt(this.core,this.logger,this.name,this.storagePrefix)}get context(){return (0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_3__.getLoggerContext)(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getInternalError)(\"NOT_INITIALIZED\",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(v.message,async e=>{const{topic:t,message:i}=e;if(!this.pairings.keys.includes(t)||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(i)))return;const s=await this.core.crypto.decode(t,i);try{(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_9__.isJsonRpcRequest)(s)?(this.core.history.set(t,s),this.onRelayEventRequest({topic:t,payload:s})):(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_9__.isJsonRpcResponse)(s)&&(await this.core.history.resolve(s),await this.onRelayEventResponse({topic:t,payload:s}),this.core.history.delete(t,s.id))}catch(r){this.logger.error(r)}})}registerExpirerEvents(){this.core.expirer.on(C.expired,async e=>{const{topic:t}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.parseExpirerTarget)(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit(V.expire,{topic:t}))})}}class jt extends _walletconnect_types__WEBPACK_IMPORTED_MODULE_14__.IJsonRpcHistory{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.records=new Map,this.events=new events__WEBPACK_IMPORTED_MODULE_0__.EventEmitter,this.name=Ct,this.version=_t,this.cached=[],this.initialized=!1,this.storagePrefix=z,this.init=async()=>{this.initialized||(this.logger.trace(\"Initialized\"),await this.restore(),this.cached.forEach(i=>this.records.set(i.id,i)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(i,s,r)=>{if(this.isInitialized(),this.logger.debug(\"Setting JSON-RPC request history record\"),this.logger.trace({type:\"method\",method:\"set\",topic:i,request:s,chainId:r}),this.records.has(s.id))return;const o={id:s.id,topic:i,request:{method:s.method,params:s.params||null},chainId:r,expiry:(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.calcExpiry)(_walletconnect_time__WEBPACK_IMPORTED_MODULE_7__.THIRTY_DAYS)};this.records.set(o.id,o),this.persist(),this.events.emit(I.created,o)},this.resolve=async i=>{if(this.isInitialized(),this.logger.debug(\"Updating JSON-RPC response history record\"),this.logger.trace({type:\"method\",method:\"update\",response:i}),!this.records.has(i.id))return;const s=await this.getRecord(i.id);typeof s.response>\"u\"&&(s.response=(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_9__.isJsonRpcError)(i)?{error:i.error}:{result:i.result},this.records.set(s.id,s),this.persist(),this.events.emit(I.updated,s))},this.get=async(i,s)=>(this.isInitialized(),this.logger.debug(\"Getting record\"),this.logger.trace({type:\"method\",method:\"get\",topic:i,id:s}),await this.getRecord(s)),this.delete=(i,s)=>{this.isInitialized(),this.logger.debug(\"Deleting record\"),this.logger.trace({type:\"method\",method:\"delete\",id:s}),this.values.forEach(r=>{if(r.topic===i){if(typeof s<\"u\"&&r.id!==s)return;this.records.delete(r.id),this.events.emit(I.deleted,r)}}),this.persist()},this.exists=async(i,s)=>(this.isInitialized(),this.records.has(s)?(await this.getRecord(s)).topic===i:!1),this.on=(i,s)=>{this.events.on(i,s)},this.once=(i,s)=>{this.events.once(i,s)},this.off=(i,s)=>{this.events.off(i,s)},this.removeListener=(i,s)=>{this.events.removeListener(i,s)},this.logger=(0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_3__.generateChildLogger)(t,this.name)}get context(){return (0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_3__.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+\"//\"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(t=>{if(typeof t.response<\"u\")return;const i={topic:t.topic,request:(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_9__.formatJsonRpcRequest)(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(i)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const t=this.records.get(e);if(!t){const{message:i}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getInternalError)(\"NO_MATCHING_KEY\",`${this.name}: ${e}`);throw new Error(i)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(I.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>\"u\"||!e.length)return;if(this.records.size){const{message:t}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getInternalError)(\"RESTORE_WILL_OVERRIDE\",this.name);throw this.logger.error(t),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:\"method\",method:\"restore\",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(I.created,e=>{const t=I.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:\"event\",event:t,record:e})}),this.events.on(I.updated,e=>{const t=I.updated;this.logger.info(`Emitting ${t}`),this.logger.debug({type:\"event\",event:t,record:e})}),this.events.on(I.deleted,e=>{const t=I.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:\"event\",event:t,record:e})}),this.core.heartbeat.on(_walletconnect_heartbeat__WEBPACK_IMPORTED_MODULE_2__.HEARTBEAT_EVENTS.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(t=>{(0,_walletconnect_time__WEBPACK_IMPORTED_MODULE_7__.toMiliseconds)(t.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${t.id}`),this.records.delete(t.id),this.events.emit(I.deleted,t,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getInternalError)(\"NOT_INITIALIZED\",this.name);throw new Error(e)}}}class Gt extends _walletconnect_types__WEBPACK_IMPORTED_MODULE_14__.IExpirer{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.expirations=new Map,this.events=new events__WEBPACK_IMPORTED_MODULE_0__.EventEmitter,this.name=Rt,this.version=Tt,this.cached=[],this.initialized=!1,this.storagePrefix=z,this.init=async()=>{this.initialized||(this.logger.trace(\"Initialized\"),await this.restore(),this.cached.forEach(i=>this.expirations.set(i.target,i)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=i=>{try{const s=this.formatTarget(i);return typeof this.getExpiration(s)<\"u\"}catch{return!1}},this.set=(i,s)=>{this.isInitialized();const r=this.formatTarget(i),o={target:r,expiry:s};this.expirations.set(r,o),this.checkExpiry(r,o),this.events.emit(C.created,{target:r,expiration:o})},this.get=i=>{this.isInitialized();const s=this.formatTarget(i);return this.getExpiration(s)},this.del=i=>{if(this.isInitialized(),this.has(i)){const s=this.formatTarget(i),r=this.getExpiration(s);this.expirations.delete(s),this.events.emit(C.deleted,{target:s,expiration:r})}},this.on=(i,s)=>{this.events.on(i,s)},this.once=(i,s)=>{this.events.once(i,s)},this.off=(i,s)=>{this.events.off(i,s)},this.removeListener=(i,s)=>{this.events.removeListener(i,s)},this.logger=(0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_3__.generateChildLogger)(t,this.name)}get context(){return (0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_3__.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+\"//\"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e==\"string\")return (0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.formatTopicTarget)(e);if(typeof e==\"number\")return (0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.formatIdTarget)(e);const{message:t}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getInternalError)(\"UNKNOWN_TYPE\",`Target type: ${typeof e}`);throw new Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(C.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>\"u\"||!e.length)return;if(this.expirations.size){const{message:t}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getInternalError)(\"RESTORE_WILL_OVERRIDE\",this.name);throw this.logger.error(t),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:\"method\",method:\"restore\",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const t=this.expirations.get(e);if(!t){const{message:i}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getInternalError)(\"NO_MATCHING_KEY\",`${this.name}: ${e}`);throw this.logger.warn(i),new Error(i)}return t}checkExpiry(e,t){const{expiry:i}=t;(0,_walletconnect_time__WEBPACK_IMPORTED_MODULE_7__.toMiliseconds)(i)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(C.expired,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,t)=>this.checkExpiry(t,e))}registerEventListeners(){this.core.heartbeat.on(_walletconnect_heartbeat__WEBPACK_IMPORTED_MODULE_2__.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(C.created,e=>{const t=C.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:\"event\",event:t,data:e}),this.persist()}),this.events.on(C.expired,e=>{const t=C.expired;this.logger.info(`Emitting ${t}`),this.logger.debug({type:\"event\",event:t,data:e}),this.persist()}),this.events.on(C.deleted,e=>{const t=C.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:\"event\",event:t,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.getInternalError)(\"NOT_INITIALIZED\",this.name);throw new Error(e)}}}class Yt extends _walletconnect_types__WEBPACK_IMPORTED_MODULE_14__.IVerify{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.name=ee,this.initialized=!1,this.queue=[],this.verifyDisabled=!1,this.init=async i=>{if(this.verifyDisabled||(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.isReactNative)()||!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.isBrowser)())return;const s=this.getVerifyUrl(i?.verifyUrl);this.verifyUrl!==s&&this.removeIframe(),this.verifyUrl=s;try{await this.createIframe()}catch(r){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(r)}if(!this.initialized){this.removeIframe(),this.verifyUrl=te;try{await this.createIframe()}catch(r){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(r),this.verifyDisabled=!0}}},this.register=async i=>{this.initialized?this.sendPost(i.attestationId):(this.addToQueue(i.attestationId),await this.init())},this.resolve=async i=>{if(this.isDevEnv)return\"\";const s=this.getVerifyUrl(i?.verifyUrl);let r;try{r=await this.fetchAttestation(i.attestationId,s)}catch(o){this.logger.info(`failed to resolve attestation: ${i.attestationId} from url: ${s}`),this.logger.info(o),r=await this.fetchAttestation(i.attestationId,te)}return r},this.fetchAttestation=async(i,s)=>{this.logger.info(`resolving attestation: ${i} from url: ${s}`);const r=this.startAbortTimer(_walletconnect_time__WEBPACK_IMPORTED_MODULE_7__.ONE_SECOND*2),o=await fetch(`${s}/attestation/${i}`,{signal:this.abortController.signal});return clearTimeout(r),o.status===200?await o.json():void 0},this.addToQueue=i=>{this.queue.push(i)},this.processQueue=()=>{this.queue.length!==0&&(this.queue.forEach(i=>this.sendPost(i)),this.queue=[])},this.sendPost=i=>{var s;try{if(!this.iframe)return;(s=this.iframe.contentWindow)==null||s.postMessage(i,\"*\"),this.logger.info(`postMessage sent: ${i} ${this.verifyUrl}`)}catch{}},this.createIframe=async()=>{let i;const s=r=>{r.data===\"verify_ready\"&&(this.onInit(),window.removeEventListener(\"message\",s),i())};await Promise.race([new Promise(r=>{const o=document.getElementById(ee);if(o)return this.iframe=o,this.onInit(),r();window.addEventListener(\"message\",s);const a=document.createElement(\"iframe\");a.id=ee,a.src=`${this.verifyUrl}/${this.projectId}`,a.style.display=\"none\",document.body.append(a),this.iframe=a,i=r}),new Promise((r,o)=>setTimeout(()=>{window.removeEventListener(\"message\",s),o(\"verify iframe load timeout\")},(0,_walletconnect_time__WEBPACK_IMPORTED_MODULE_7__.toMiliseconds)(_walletconnect_time__WEBPACK_IMPORTED_MODULE_7__.FIVE_SECONDS)))])},this.onInit=()=>{this.initialized=!0,this.processQueue()},this.removeIframe=()=>{this.iframe&&(this.iframe.remove(),this.iframe=void 0,this.initialized=!1)},this.getVerifyUrl=i=>{let s=i||k;return St.includes(s)||(this.logger.info(`verify url: ${s}, not included in trusted list, assigning default: ${k}`),s=k),s},this.logger=(0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_3__.generateChildLogger)(t,this.name),this.verifyUrl=k,this.abortController=new AbortController,this.isDevEnv=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_13__.isNode)()&&process.env.IS_VITEST}get context(){return (0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_3__.getLoggerContext)(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),(0,_walletconnect_time__WEBPACK_IMPORTED_MODULE_7__.toMiliseconds)(e))}}class Ht extends _walletconnect_types__WEBPACK_IMPORTED_MODULE_14__.IEchoClient{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.context=Pt,this.registerDeviceToken=async i=>{const{clientId:s,token:r,notificationType:o,enableEncrypted:a=!1}=i,h=`${xt}/${this.projectId}/clients`;await isomorphic_unfetch__WEBPACK_IMPORTED_MODULE_12___default()(h,{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({client_id:s,type:o,token:r,always_raw:a})})},this.logger=(0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_3__.generateChildLogger)(t,this.context)}}var $r=Object.defineProperty,Jt=Object.getOwnPropertySymbols,Fr=Object.prototype.hasOwnProperty,kr=Object.prototype.propertyIsEnumerable,Xt=(n,e,t)=>e in n?$r(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Wt=(n,e)=>{for(var t in e||(e={}))Fr.call(e,t)&&Xt(n,t,e[t]);if(Jt)for(var t of Jt(e))kr.call(e,t)&&Xt(n,t,e[t]);return n};class ie extends _walletconnect_types__WEBPACK_IMPORTED_MODULE_14__.ICore{constructor(e){var t;super(e),this.protocol=De,this.version=Ze,this.name=Z,this.events=new events__WEBPACK_IMPORTED_MODULE_0__.EventEmitter,this.initialized=!1,this.on=(o,a)=>this.events.on(o,a),this.once=(o,a)=>this.events.once(o,a),this.off=(o,a)=>this.events.off(o,a),this.removeListener=(o,a)=>this.events.removeListener(o,a),this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||me,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:\"\";const i=(0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_3__.getDefaultLoggerOptions)({level:typeof e?.logger==\"string\"&&e.logger?e.logger:et.logger}),{logger:s,chunkLoggerController:r}=(0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_3__.generatePlatformLogger)({opts:i,maxSizeInBytes:e?.maxLogBlobSizeInBytes,loggerOverride:e?.logger});this.logChunkController=r,(t=this.logChunkController)!=null&&t.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var o,a;(o=this.logChunkController)!=null&&o.downloadLogsBlobInBrowser&&((a=this.logChunkController)==null||a.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=(0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_3__.generateChildLogger)(s,this.name),this.heartbeat=new _walletconnect_heartbeat__WEBPACK_IMPORTED_MODULE_2__.HeartBeat,this.crypto=new At(this,this.logger,e?.keychain),this.history=new jt(this,this.logger),this.expirer=new Gt(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new _walletconnect_keyvaluestorage__WEBPACK_IMPORTED_MODULE_1__[\"default\"](Wt(Wt({},tt),e?.storageOptions)),this.relayer=new kt({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new qt(this,this.logger),this.verify=new Yt(this.projectId||\"\",this.logger),this.echoClient=new Ht(this.projectId||\"\",this.logger)}static async init(e){const t=new ie(e);await t.initialize();const i=await t.crypto.getClientId();return await t.storage.setItem(bt,i),t}get context(){return (0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_3__.getLoggerContext)(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return(e=this.logChunkController)==null?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async initialize(){this.logger.trace(\"Initialized\");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.initialized=!0,this.logger.info(\"Core Initialization Success\")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}}const Br=ie;\n//# sourceMappingURL=index.es.js.map\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/core/dist/index.es.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/environment/dist/cjs/crypto.js": -/*!********************************************************************!*\ - !*** ./node_modules/@walletconnect/environment/dist/cjs/crypto.js ***! - \********************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.isBrowserCryptoAvailable = exports.getSubtleCrypto = exports.getBrowerCrypto = void 0;\nfunction getBrowerCrypto() {\n return (__webpack_require__.g === null || __webpack_require__.g === void 0 ? void 0 : __webpack_require__.g.crypto) || (__webpack_require__.g === null || __webpack_require__.g === void 0 ? void 0 : __webpack_require__.g.msCrypto) || {};\n}\nexports.getBrowerCrypto = getBrowerCrypto;\nfunction getSubtleCrypto() {\n const browserCrypto = getBrowerCrypto();\n return browserCrypto.subtle || browserCrypto.webkitSubtle;\n}\nexports.getSubtleCrypto = getSubtleCrypto;\nfunction isBrowserCryptoAvailable() {\n return !!getBrowerCrypto() && !!getSubtleCrypto();\n}\nexports.isBrowserCryptoAvailable = isBrowserCryptoAvailable;\n//# sourceMappingURL=crypto.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/environment/dist/cjs/crypto.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/environment/dist/cjs/env.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@walletconnect/environment/dist/cjs/env.js ***! - \*****************************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.isBrowser = exports.isNode = exports.isReactNative = void 0;\nfunction isReactNative() {\n return (typeof document === \"undefined\" &&\n typeof navigator !== \"undefined\" &&\n navigator.product === \"ReactNative\");\n}\nexports.isReactNative = isReactNative;\nfunction isNode() {\n return (typeof process !== \"undefined\" &&\n typeof process.versions !== \"undefined\" &&\n typeof process.versions.node !== \"undefined\");\n}\nexports.isNode = isNode;\nfunction isBrowser() {\n return !isReactNative() && !isNode();\n}\nexports.isBrowser = isBrowser;\n//# sourceMappingURL=env.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/environment/dist/cjs/env.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/environment/dist/cjs/index.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@walletconnect/environment/dist/cjs/index.js ***! - \*******************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst tslib_1 = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\ntslib_1.__exportStar(__webpack_require__(/*! ./crypto */ \"./node_modules/@walletconnect/environment/dist/cjs/crypto.js\"), exports);\ntslib_1.__exportStar(__webpack_require__(/*! ./env */ \"./node_modules/@walletconnect/environment/dist/cjs/env.js\"), exports);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/environment/dist/cjs/index.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/events/dist/esm/events.js": -/*!***************************************************************!*\ - !*** ./node_modules/@walletconnect/events/dist/esm/events.js ***! - \***************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ IEvents: () => (/* binding */ IEvents)\n/* harmony export */ });\nclass IEvents {\n}\n//# sourceMappingURL=events.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/events/dist/esm/events.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/events/dist/esm/index.js": -/*!**************************************************************!*\ - !*** ./node_modules/@walletconnect/events/dist/esm/index.js ***! - \**************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ IEvents: () => (/* reexport safe */ _events__WEBPACK_IMPORTED_MODULE_0__.IEvents)\n/* harmony export */ });\n/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./events */ \"./node_modules/@walletconnect/events/dist/esm/events.js\");\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/events/dist/esm/index.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/heartbeat/dist/cjs/constants/heartbeat.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/@walletconnect/heartbeat/dist/cjs/constants/heartbeat.js ***! - \*******************************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.HEARTBEAT_EVENTS = exports.HEARTBEAT_INTERVAL = void 0;\nconst time_1 = __webpack_require__(/*! @walletconnect/time */ \"./node_modules/@walletconnect/time/dist/cjs/index.js\");\nexports.HEARTBEAT_INTERVAL = time_1.FIVE_SECONDS;\nexports.HEARTBEAT_EVENTS = {\n pulse: \"heartbeat_pulse\",\n};\n//# sourceMappingURL=heartbeat.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/heartbeat/dist/cjs/constants/heartbeat.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/heartbeat/dist/cjs/constants/index.js": -/*!***************************************************************************!*\ - !*** ./node_modules/@walletconnect/heartbeat/dist/cjs/constants/index.js ***! - \***************************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst tslib_1 = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\ntslib_1.__exportStar(__webpack_require__(/*! ./heartbeat */ \"./node_modules/@walletconnect/heartbeat/dist/cjs/constants/heartbeat.js\"), exports);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/heartbeat/dist/cjs/constants/index.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/heartbeat/dist/cjs/heartbeat.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@walletconnect/heartbeat/dist/cjs/heartbeat.js ***! - \*********************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.HeartBeat = void 0;\nconst tslib_1 = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\nconst events_1 = __webpack_require__(/*! events */ \"./node_modules/events/events.js\");\nconst time_1 = __webpack_require__(/*! @walletconnect/time */ \"./node_modules/@walletconnect/time/dist/cjs/index.js\");\nconst types_1 = __webpack_require__(/*! ./types */ \"./node_modules/@walletconnect/heartbeat/dist/cjs/types/index.js\");\nconst constants_1 = __webpack_require__(/*! ./constants */ \"./node_modules/@walletconnect/heartbeat/dist/cjs/constants/index.js\");\nclass HeartBeat extends types_1.IHeartBeat {\n constructor(opts) {\n super(opts);\n this.events = new events_1.EventEmitter();\n this.interval = constants_1.HEARTBEAT_INTERVAL;\n this.interval = (opts === null || opts === void 0 ? void 0 : opts.interval) || constants_1.HEARTBEAT_INTERVAL;\n }\n static init(opts) {\n return tslib_1.__awaiter(this, void 0, void 0, function* () {\n const heartbeat = new HeartBeat(opts);\n yield heartbeat.init();\n return heartbeat;\n });\n }\n init() {\n return tslib_1.__awaiter(this, void 0, void 0, function* () {\n yield this.initialize();\n });\n }\n stop() {\n clearInterval(this.intervalRef);\n }\n on(event, listener) {\n this.events.on(event, listener);\n }\n once(event, listener) {\n this.events.once(event, listener);\n }\n off(event, listener) {\n this.events.off(event, listener);\n }\n removeListener(event, listener) {\n this.events.removeListener(event, listener);\n }\n initialize() {\n return tslib_1.__awaiter(this, void 0, void 0, function* () {\n this.intervalRef = setInterval(() => this.pulse(), time_1.toMiliseconds(this.interval));\n });\n }\n pulse() {\n this.events.emit(constants_1.HEARTBEAT_EVENTS.pulse);\n }\n}\nexports.HeartBeat = HeartBeat;\n//# sourceMappingURL=heartbeat.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/heartbeat/dist/cjs/heartbeat.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/heartbeat/dist/cjs/index.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@walletconnect/heartbeat/dist/cjs/index.js ***! - \*****************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst tslib_1 = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\ntslib_1.__exportStar(__webpack_require__(/*! ./heartbeat */ \"./node_modules/@walletconnect/heartbeat/dist/cjs/heartbeat.js\"), exports);\ntslib_1.__exportStar(__webpack_require__(/*! ./types */ \"./node_modules/@walletconnect/heartbeat/dist/cjs/types/index.js\"), exports);\ntslib_1.__exportStar(__webpack_require__(/*! ./constants */ \"./node_modules/@walletconnect/heartbeat/dist/cjs/constants/index.js\"), exports);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/heartbeat/dist/cjs/index.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/heartbeat/dist/cjs/types/heartbeat.js": -/*!***************************************************************************!*\ - !*** ./node_modules/@walletconnect/heartbeat/dist/cjs/types/heartbeat.js ***! - \***************************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.IHeartBeat = void 0;\nconst events_1 = __webpack_require__(/*! @walletconnect/events */ \"./node_modules/@walletconnect/events/dist/esm/index.js\");\nclass IHeartBeat extends events_1.IEvents {\n constructor(opts) {\n super();\n }\n}\nexports.IHeartBeat = IHeartBeat;\n//# sourceMappingURL=heartbeat.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/heartbeat/dist/cjs/types/heartbeat.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/heartbeat/dist/cjs/types/index.js": -/*!***********************************************************************!*\ - !*** ./node_modules/@walletconnect/heartbeat/dist/cjs/types/index.js ***! - \***********************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst tslib_1 = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\ntslib_1.__exportStar(__webpack_require__(/*! ./heartbeat */ \"./node_modules/@walletconnect/heartbeat/dist/cjs/types/heartbeat.js\"), exports);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/heartbeat/dist/cjs/types/index.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/jsonrpc-provider/dist/esm/index.js": -/*!************************************************************************!*\ - !*** ./node_modules/@walletconnect/jsonrpc-provider/dist/esm/index.js ***! - \************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ JsonRpcProvider: () => (/* reexport safe */ _provider__WEBPACK_IMPORTED_MODULE_0__.JsonRpcProvider),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _provider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./provider */ \"./node_modules/@walletconnect/jsonrpc-provider/dist/esm/provider.js\");\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_provider__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/jsonrpc-provider/dist/esm/index.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/jsonrpc-provider/dist/esm/provider.js": -/*!***************************************************************************!*\ - !*** ./node_modules/@walletconnect/jsonrpc-provider/dist/esm/provider.js ***! - \***************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ JsonRpcProvider: () => (/* binding */ JsonRpcProvider),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! events */ \"./node_modules/events/events.js\");\n/* harmony import */ var events__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(events__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @walletconnect/jsonrpc-utils */ \"./node_modules/@walletconnect/jsonrpc-utils/dist/esm/index.js\");\n\n\nclass JsonRpcProvider extends _walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_1__.IJsonRpcProvider {\n constructor(connection) {\n super(connection);\n this.events = new events__WEBPACK_IMPORTED_MODULE_0__.EventEmitter();\n this.hasRegisteredEventListeners = false;\n this.connection = this.setConnection(connection);\n if (this.connection.connected) {\n this.registerEventListeners();\n }\n }\n async connect(connection = this.connection) {\n await this.open(connection);\n }\n async disconnect() {\n await this.close();\n }\n on(event, listener) {\n this.events.on(event, listener);\n }\n once(event, listener) {\n this.events.once(event, listener);\n }\n off(event, listener) {\n this.events.off(event, listener);\n }\n removeListener(event, listener) {\n this.events.removeListener(event, listener);\n }\n async request(request, context) {\n return this.requestStrict((0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_1__.formatJsonRpcRequest)(request.method, request.params || [], request.id || (0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_1__.getBigIntRpcId)().toString()), context);\n }\n async requestStrict(request, context) {\n return new Promise(async (resolve, reject) => {\n if (!this.connection.connected) {\n try {\n await this.open();\n }\n catch (e) {\n reject(e);\n }\n }\n this.events.on(`${request.id}`, response => {\n if ((0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_1__.isJsonRpcError)(response)) {\n reject(response.error);\n }\n else {\n resolve(response.result);\n }\n });\n try {\n await this.connection.send(request, context);\n }\n catch (e) {\n reject(e);\n }\n });\n }\n setConnection(connection = this.connection) {\n return connection;\n }\n onPayload(payload) {\n this.events.emit(\"payload\", payload);\n if ((0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_1__.isJsonRpcResponse)(payload)) {\n this.events.emit(`${payload.id}`, payload);\n }\n else {\n this.events.emit(\"message\", {\n type: payload.method,\n data: payload.params,\n });\n }\n }\n onClose(event) {\n if (event && event.code === 3000) {\n this.events.emit(\"error\", new Error(`WebSocket connection closed abnormally with code: ${event.code} ${event.reason ? `(${event.reason})` : \"\"}`));\n }\n this.events.emit(\"disconnect\");\n }\n async open(connection = this.connection) {\n if (this.connection === connection && this.connection.connected)\n return;\n if (this.connection.connected)\n this.close();\n if (typeof connection === \"string\") {\n await this.connection.open(connection);\n connection = this.connection;\n }\n this.connection = this.setConnection(connection);\n await this.connection.open();\n this.registerEventListeners();\n this.events.emit(\"connect\");\n }\n async close() {\n await this.connection.close();\n }\n registerEventListeners() {\n if (this.hasRegisteredEventListeners)\n return;\n this.connection.on(\"payload\", (payload) => this.onPayload(payload));\n this.connection.on(\"close\", (event) => this.onClose(event));\n this.connection.on(\"error\", (error) => this.events.emit(\"error\", error));\n this.connection.on(\"register_error\", (error) => this.onClose());\n this.hasRegisteredEventListeners = true;\n }\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (JsonRpcProvider);\n//# sourceMappingURL=provider.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/jsonrpc-provider/dist/esm/provider.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/jsonrpc-types/dist/esm/index.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@walletconnect/jsonrpc-types/dist/esm/index.js ***! - \*********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ IBaseJsonRpcProvider: () => (/* reexport safe */ _provider__WEBPACK_IMPORTED_MODULE_2__.IBaseJsonRpcProvider),\n/* harmony export */ IEvents: () => (/* reexport safe */ _misc__WEBPACK_IMPORTED_MODULE_1__.IEvents),\n/* harmony export */ IJsonRpcConnection: () => (/* reexport safe */ _provider__WEBPACK_IMPORTED_MODULE_2__.IJsonRpcConnection),\n/* harmony export */ IJsonRpcProvider: () => (/* reexport safe */ _provider__WEBPACK_IMPORTED_MODULE_2__.IJsonRpcProvider)\n/* harmony export */ });\n/* harmony import */ var _jsonrpc__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./jsonrpc */ \"./node_modules/@walletconnect/jsonrpc-types/dist/esm/jsonrpc.js\");\n/* harmony import */ var _misc__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./misc */ \"./node_modules/@walletconnect/jsonrpc-types/dist/esm/misc.js\");\n/* harmony import */ var _provider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./provider */ \"./node_modules/@walletconnect/jsonrpc-types/dist/esm/provider.js\");\n/* harmony import */ var _validator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./validator */ \"./node_modules/@walletconnect/jsonrpc-types/dist/esm/validator.js\");\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/jsonrpc-types/dist/esm/index.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/jsonrpc-types/dist/esm/jsonrpc.js": -/*!***********************************************************************!*\ - !*** ./node_modules/@walletconnect/jsonrpc-types/dist/esm/jsonrpc.js ***! - \***********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n\n//# sourceMappingURL=jsonrpc.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/jsonrpc-types/dist/esm/jsonrpc.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/jsonrpc-types/dist/esm/misc.js": -/*!********************************************************************!*\ - !*** ./node_modules/@walletconnect/jsonrpc-types/dist/esm/misc.js ***! - \********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ IEvents: () => (/* binding */ IEvents)\n/* harmony export */ });\nclass IEvents {\n}\n//# sourceMappingURL=misc.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/jsonrpc-types/dist/esm/misc.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/jsonrpc-types/dist/esm/provider.js": -/*!************************************************************************!*\ - !*** ./node_modules/@walletconnect/jsonrpc-types/dist/esm/provider.js ***! - \************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ IBaseJsonRpcProvider: () => (/* binding */ IBaseJsonRpcProvider),\n/* harmony export */ IJsonRpcConnection: () => (/* binding */ IJsonRpcConnection),\n/* harmony export */ IJsonRpcProvider: () => (/* binding */ IJsonRpcProvider)\n/* harmony export */ });\n/* harmony import */ var _misc__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./misc */ \"./node_modules/@walletconnect/jsonrpc-types/dist/esm/misc.js\");\n\nclass IJsonRpcConnection extends _misc__WEBPACK_IMPORTED_MODULE_0__.IEvents {\n constructor(opts) {\n super();\n }\n}\nclass IBaseJsonRpcProvider extends _misc__WEBPACK_IMPORTED_MODULE_0__.IEvents {\n constructor() {\n super();\n }\n}\nclass IJsonRpcProvider extends IBaseJsonRpcProvider {\n constructor(connection) {\n super();\n }\n}\n//# sourceMappingURL=provider.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/jsonrpc-types/dist/esm/provider.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/jsonrpc-types/dist/esm/validator.js": -/*!*************************************************************************!*\ - !*** ./node_modules/@walletconnect/jsonrpc-types/dist/esm/validator.js ***! - \*************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n\n//# sourceMappingURL=validator.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/jsonrpc-types/dist/esm/validator.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/jsonrpc-utils/dist/esm/constants.js": -/*!*************************************************************************!*\ - !*** ./node_modules/@walletconnect/jsonrpc-utils/dist/esm/constants.js ***! - \*************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DEFAULT_ERROR: () => (/* binding */ DEFAULT_ERROR),\n/* harmony export */ INTERNAL_ERROR: () => (/* binding */ INTERNAL_ERROR),\n/* harmony export */ INVALID_PARAMS: () => (/* binding */ INVALID_PARAMS),\n/* harmony export */ INVALID_REQUEST: () => (/* binding */ INVALID_REQUEST),\n/* harmony export */ METHOD_NOT_FOUND: () => (/* binding */ METHOD_NOT_FOUND),\n/* harmony export */ PARSE_ERROR: () => (/* binding */ PARSE_ERROR),\n/* harmony export */ RESERVED_ERROR_CODES: () => (/* binding */ RESERVED_ERROR_CODES),\n/* harmony export */ SERVER_ERROR: () => (/* binding */ SERVER_ERROR),\n/* harmony export */ SERVER_ERROR_CODE_RANGE: () => (/* binding */ SERVER_ERROR_CODE_RANGE),\n/* harmony export */ STANDARD_ERROR_MAP: () => (/* binding */ STANDARD_ERROR_MAP)\n/* harmony export */ });\nconst PARSE_ERROR = \"PARSE_ERROR\";\nconst INVALID_REQUEST = \"INVALID_REQUEST\";\nconst METHOD_NOT_FOUND = \"METHOD_NOT_FOUND\";\nconst INVALID_PARAMS = \"INVALID_PARAMS\";\nconst INTERNAL_ERROR = \"INTERNAL_ERROR\";\nconst SERVER_ERROR = \"SERVER_ERROR\";\nconst RESERVED_ERROR_CODES = [-32700, -32600, -32601, -32602, -32603];\nconst SERVER_ERROR_CODE_RANGE = [-32000, -32099];\nconst STANDARD_ERROR_MAP = {\n [PARSE_ERROR]: { code: -32700, message: \"Parse error\" },\n [INVALID_REQUEST]: { code: -32600, message: \"Invalid Request\" },\n [METHOD_NOT_FOUND]: { code: -32601, message: \"Method not found\" },\n [INVALID_PARAMS]: { code: -32602, message: \"Invalid params\" },\n [INTERNAL_ERROR]: { code: -32603, message: \"Internal error\" },\n [SERVER_ERROR]: { code: -32000, message: \"Server error\" },\n};\nconst DEFAULT_ERROR = SERVER_ERROR;\n//# sourceMappingURL=constants.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/jsonrpc-utils/dist/esm/constants.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/jsonrpc-utils/dist/esm/env.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@walletconnect/jsonrpc-utils/dist/esm/env.js ***! - \*******************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ isNodeJs: () => (/* binding */ isNodeJs)\n/* harmony export */ });\n/* harmony import */ var _walletconnect_environment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @walletconnect/environment */ \"./node_modules/@walletconnect/environment/dist/cjs/index.js\");\n/* harmony import */ var _walletconnect_environment__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_walletconnect_environment__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _walletconnect_environment__WEBPACK_IMPORTED_MODULE_0__) if([\"default\",\"isNodeJs\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _walletconnect_environment__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\n\nconst isNodeJs = _walletconnect_environment__WEBPACK_IMPORTED_MODULE_0__.isNode;\n\n//# sourceMappingURL=env.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/jsonrpc-utils/dist/esm/env.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/jsonrpc-utils/dist/esm/error.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@walletconnect/jsonrpc-utils/dist/esm/error.js ***! - \*********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getError: () => (/* binding */ getError),\n/* harmony export */ getErrorByCode: () => (/* binding */ getErrorByCode),\n/* harmony export */ isReservedErrorCode: () => (/* binding */ isReservedErrorCode),\n/* harmony export */ isServerErrorCode: () => (/* binding */ isServerErrorCode),\n/* harmony export */ isValidErrorCode: () => (/* binding */ isValidErrorCode),\n/* harmony export */ parseConnectionError: () => (/* binding */ parseConnectionError),\n/* harmony export */ validateJsonRpcError: () => (/* binding */ validateJsonRpcError)\n/* harmony export */ });\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ \"./node_modules/@walletconnect/jsonrpc-utils/dist/esm/constants.js\");\n\nfunction isServerErrorCode(code) {\n return code <= _constants__WEBPACK_IMPORTED_MODULE_0__.SERVER_ERROR_CODE_RANGE[0] && code >= _constants__WEBPACK_IMPORTED_MODULE_0__.SERVER_ERROR_CODE_RANGE[1];\n}\nfunction isReservedErrorCode(code) {\n return _constants__WEBPACK_IMPORTED_MODULE_0__.RESERVED_ERROR_CODES.includes(code);\n}\nfunction isValidErrorCode(code) {\n return typeof code === \"number\";\n}\nfunction getError(type) {\n if (!Object.keys(_constants__WEBPACK_IMPORTED_MODULE_0__.STANDARD_ERROR_MAP).includes(type)) {\n return _constants__WEBPACK_IMPORTED_MODULE_0__.STANDARD_ERROR_MAP[_constants__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_ERROR];\n }\n return _constants__WEBPACK_IMPORTED_MODULE_0__.STANDARD_ERROR_MAP[type];\n}\nfunction getErrorByCode(code) {\n const match = Object.values(_constants__WEBPACK_IMPORTED_MODULE_0__.STANDARD_ERROR_MAP).find(e => e.code === code);\n if (!match) {\n return _constants__WEBPACK_IMPORTED_MODULE_0__.STANDARD_ERROR_MAP[_constants__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_ERROR];\n }\n return match;\n}\nfunction validateJsonRpcError(response) {\n if (typeof response.error.code === \"undefined\") {\n return { valid: false, error: \"Missing code for JSON-RPC error\" };\n }\n if (typeof response.error.message === \"undefined\") {\n return { valid: false, error: \"Missing message for JSON-RPC error\" };\n }\n if (!isValidErrorCode(response.error.code)) {\n return {\n valid: false,\n error: `Invalid error code type for JSON-RPC: ${response.error.code}`,\n };\n }\n if (isReservedErrorCode(response.error.code)) {\n const error = getErrorByCode(response.error.code);\n if (error.message !== _constants__WEBPACK_IMPORTED_MODULE_0__.STANDARD_ERROR_MAP[_constants__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_ERROR].message &&\n response.error.message === error.message) {\n return {\n valid: false,\n error: `Invalid error code message for JSON-RPC: ${response.error.code}`,\n };\n }\n }\n return { valid: true };\n}\nfunction parseConnectionError(e, url, type) {\n return e.message.includes(\"getaddrinfo ENOTFOUND\") || e.message.includes(\"connect ECONNREFUSED\")\n ? new Error(`Unavailable ${type} RPC url at ${url}`)\n : e;\n}\n//# sourceMappingURL=error.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/jsonrpc-utils/dist/esm/error.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/jsonrpc-utils/dist/esm/format.js": -/*!**********************************************************************!*\ - !*** ./node_modules/@walletconnect/jsonrpc-utils/dist/esm/format.js ***! - \**********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ formatErrorMessage: () => (/* binding */ formatErrorMessage),\n/* harmony export */ formatJsonRpcError: () => (/* binding */ formatJsonRpcError),\n/* harmony export */ formatJsonRpcRequest: () => (/* binding */ formatJsonRpcRequest),\n/* harmony export */ formatJsonRpcResult: () => (/* binding */ formatJsonRpcResult),\n/* harmony export */ getBigIntRpcId: () => (/* binding */ getBigIntRpcId),\n/* harmony export */ payloadId: () => (/* binding */ payloadId)\n/* harmony export */ });\n/* harmony import */ var _error__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./error */ \"./node_modules/@walletconnect/jsonrpc-utils/dist/esm/error.js\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants */ \"./node_modules/@walletconnect/jsonrpc-utils/dist/esm/constants.js\");\n\n\nfunction payloadId(entropy = 3) {\n const date = Date.now() * Math.pow(10, entropy);\n const extra = Math.floor(Math.random() * Math.pow(10, entropy));\n return date + extra;\n}\nfunction getBigIntRpcId(entropy = 6) {\n return BigInt(payloadId(entropy));\n}\nfunction formatJsonRpcRequest(method, params, id) {\n return {\n id: id || payloadId(),\n jsonrpc: \"2.0\",\n method,\n params,\n };\n}\nfunction formatJsonRpcResult(id, result) {\n return {\n id,\n jsonrpc: \"2.0\",\n result,\n };\n}\nfunction formatJsonRpcError(id, error, data) {\n return {\n id,\n jsonrpc: \"2.0\",\n error: formatErrorMessage(error, data),\n };\n}\nfunction formatErrorMessage(error, data) {\n if (typeof error === \"undefined\") {\n return (0,_error__WEBPACK_IMPORTED_MODULE_0__.getError)(_constants__WEBPACK_IMPORTED_MODULE_1__.INTERNAL_ERROR);\n }\n if (typeof error === \"string\") {\n error = Object.assign(Object.assign({}, (0,_error__WEBPACK_IMPORTED_MODULE_0__.getError)(_constants__WEBPACK_IMPORTED_MODULE_1__.SERVER_ERROR)), { message: error });\n }\n if (typeof data !== \"undefined\") {\n error.data = data;\n }\n if ((0,_error__WEBPACK_IMPORTED_MODULE_0__.isReservedErrorCode)(error.code)) {\n error = (0,_error__WEBPACK_IMPORTED_MODULE_0__.getErrorByCode)(error.code);\n }\n return error;\n}\n//# sourceMappingURL=format.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/jsonrpc-utils/dist/esm/format.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/jsonrpc-utils/dist/esm/index.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@walletconnect/jsonrpc-utils/dist/esm/index.js ***! - \*********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DEFAULT_ERROR: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_ERROR),\n/* harmony export */ IBaseJsonRpcProvider: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_5__.IBaseJsonRpcProvider),\n/* harmony export */ IEvents: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_5__.IEvents),\n/* harmony export */ IJsonRpcConnection: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_5__.IJsonRpcConnection),\n/* harmony export */ IJsonRpcProvider: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_5__.IJsonRpcProvider),\n/* harmony export */ INTERNAL_ERROR: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.INTERNAL_ERROR),\n/* harmony export */ INVALID_PARAMS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.INVALID_PARAMS),\n/* harmony export */ INVALID_REQUEST: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.INVALID_REQUEST),\n/* harmony export */ METHOD_NOT_FOUND: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.METHOD_NOT_FOUND),\n/* harmony export */ PARSE_ERROR: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.PARSE_ERROR),\n/* harmony export */ RESERVED_ERROR_CODES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.RESERVED_ERROR_CODES),\n/* harmony export */ SERVER_ERROR: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.SERVER_ERROR),\n/* harmony export */ SERVER_ERROR_CODE_RANGE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.SERVER_ERROR_CODE_RANGE),\n/* harmony export */ STANDARD_ERROR_MAP: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.STANDARD_ERROR_MAP),\n/* harmony export */ formatErrorMessage: () => (/* reexport safe */ _format__WEBPACK_IMPORTED_MODULE_3__.formatErrorMessage),\n/* harmony export */ formatJsonRpcError: () => (/* reexport safe */ _format__WEBPACK_IMPORTED_MODULE_3__.formatJsonRpcError),\n/* harmony export */ formatJsonRpcRequest: () => (/* reexport safe */ _format__WEBPACK_IMPORTED_MODULE_3__.formatJsonRpcRequest),\n/* harmony export */ formatJsonRpcResult: () => (/* reexport safe */ _format__WEBPACK_IMPORTED_MODULE_3__.formatJsonRpcResult),\n/* harmony export */ getBigIntRpcId: () => (/* reexport safe */ _format__WEBPACK_IMPORTED_MODULE_3__.getBigIntRpcId),\n/* harmony export */ getError: () => (/* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_1__.getError),\n/* harmony export */ getErrorByCode: () => (/* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_1__.getErrorByCode),\n/* harmony export */ isHttpUrl: () => (/* reexport safe */ _url__WEBPACK_IMPORTED_MODULE_6__.isHttpUrl),\n/* harmony export */ isJsonRpcError: () => (/* reexport safe */ _validators__WEBPACK_IMPORTED_MODULE_7__.isJsonRpcError),\n/* harmony export */ isJsonRpcPayload: () => (/* reexport safe */ _validators__WEBPACK_IMPORTED_MODULE_7__.isJsonRpcPayload),\n/* harmony export */ isJsonRpcRequest: () => (/* reexport safe */ _validators__WEBPACK_IMPORTED_MODULE_7__.isJsonRpcRequest),\n/* harmony export */ isJsonRpcResponse: () => (/* reexport safe */ _validators__WEBPACK_IMPORTED_MODULE_7__.isJsonRpcResponse),\n/* harmony export */ isJsonRpcResult: () => (/* reexport safe */ _validators__WEBPACK_IMPORTED_MODULE_7__.isJsonRpcResult),\n/* harmony export */ isJsonRpcValidationInvalid: () => (/* reexport safe */ _validators__WEBPACK_IMPORTED_MODULE_7__.isJsonRpcValidationInvalid),\n/* harmony export */ isLocalhostUrl: () => (/* reexport safe */ _url__WEBPACK_IMPORTED_MODULE_6__.isLocalhostUrl),\n/* harmony export */ isReservedErrorCode: () => (/* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_1__.isReservedErrorCode),\n/* harmony export */ isServerErrorCode: () => (/* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_1__.isServerErrorCode),\n/* harmony export */ isValidDefaultRoute: () => (/* reexport safe */ _routing__WEBPACK_IMPORTED_MODULE_4__.isValidDefaultRoute),\n/* harmony export */ isValidErrorCode: () => (/* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_1__.isValidErrorCode),\n/* harmony export */ isValidLeadingWildcardRoute: () => (/* reexport safe */ _routing__WEBPACK_IMPORTED_MODULE_4__.isValidLeadingWildcardRoute),\n/* harmony export */ isValidRoute: () => (/* reexport safe */ _routing__WEBPACK_IMPORTED_MODULE_4__.isValidRoute),\n/* harmony export */ isValidTrailingWildcardRoute: () => (/* reexport safe */ _routing__WEBPACK_IMPORTED_MODULE_4__.isValidTrailingWildcardRoute),\n/* harmony export */ isValidWildcardRoute: () => (/* reexport safe */ _routing__WEBPACK_IMPORTED_MODULE_4__.isValidWildcardRoute),\n/* harmony export */ isWsUrl: () => (/* reexport safe */ _url__WEBPACK_IMPORTED_MODULE_6__.isWsUrl),\n/* harmony export */ parseConnectionError: () => (/* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_1__.parseConnectionError),\n/* harmony export */ payloadId: () => (/* reexport safe */ _format__WEBPACK_IMPORTED_MODULE_3__.payloadId),\n/* harmony export */ validateJsonRpcError: () => (/* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_1__.validateJsonRpcError)\n/* harmony export */ });\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ \"./node_modules/@walletconnect/jsonrpc-utils/dist/esm/constants.js\");\n/* harmony import */ var _error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./error */ \"./node_modules/@walletconnect/jsonrpc-utils/dist/esm/error.js\");\n/* harmony import */ var _env__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./env */ \"./node_modules/@walletconnect/jsonrpc-utils/dist/esm/env.js\");\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _env__WEBPACK_IMPORTED_MODULE_2__) if([\"default\",\"DEFAULT_ERROR\",\"INTERNAL_ERROR\",\"INVALID_PARAMS\",\"INVALID_REQUEST\",\"METHOD_NOT_FOUND\",\"PARSE_ERROR\",\"RESERVED_ERROR_CODES\",\"SERVER_ERROR\",\"SERVER_ERROR_CODE_RANGE\",\"STANDARD_ERROR_MAP\",\"getError\",\"getErrorByCode\",\"isReservedErrorCode\",\"isServerErrorCode\",\"isValidErrorCode\",\"parseConnectionError\",\"validateJsonRpcError\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _env__WEBPACK_IMPORTED_MODULE_2__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\n/* harmony import */ var _format__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./format */ \"./node_modules/@walletconnect/jsonrpc-utils/dist/esm/format.js\");\n/* harmony import */ var _routing__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./routing */ \"./node_modules/@walletconnect/jsonrpc-utils/dist/esm/routing.js\");\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./types */ \"./node_modules/@walletconnect/jsonrpc-utils/dist/esm/types.js\");\n/* harmony import */ var _url__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./url */ \"./node_modules/@walletconnect/jsonrpc-utils/dist/esm/url.js\");\n/* harmony import */ var _validators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./validators */ \"./node_modules/@walletconnect/jsonrpc-utils/dist/esm/validators.js\");\n\n\n\n\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/jsonrpc-utils/dist/esm/index.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/jsonrpc-utils/dist/esm/routing.js": -/*!***********************************************************************!*\ - !*** ./node_modules/@walletconnect/jsonrpc-utils/dist/esm/routing.js ***! - \***********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ isValidDefaultRoute: () => (/* binding */ isValidDefaultRoute),\n/* harmony export */ isValidLeadingWildcardRoute: () => (/* binding */ isValidLeadingWildcardRoute),\n/* harmony export */ isValidRoute: () => (/* binding */ isValidRoute),\n/* harmony export */ isValidTrailingWildcardRoute: () => (/* binding */ isValidTrailingWildcardRoute),\n/* harmony export */ isValidWildcardRoute: () => (/* binding */ isValidWildcardRoute)\n/* harmony export */ });\nfunction isValidRoute(route) {\n if (route.includes(\"*\")) {\n return isValidWildcardRoute(route);\n }\n if (/\\W/g.test(route)) {\n return false;\n }\n return true;\n}\nfunction isValidDefaultRoute(route) {\n return route === \"*\";\n}\nfunction isValidWildcardRoute(route) {\n if (isValidDefaultRoute(route)) {\n return true;\n }\n if (!route.includes(\"*\")) {\n return false;\n }\n if (route.split(\"*\").length !== 2) {\n return false;\n }\n if (route.split(\"*\").filter(x => x.trim() === \"\").length !== 1) {\n return false;\n }\n return true;\n}\nfunction isValidLeadingWildcardRoute(route) {\n return !isValidDefaultRoute(route) && isValidWildcardRoute(route) && !route.split(\"*\")[0].trim();\n}\nfunction isValidTrailingWildcardRoute(route) {\n return !isValidDefaultRoute(route) && isValidWildcardRoute(route) && !route.split(\"*\")[1].trim();\n}\n//# sourceMappingURL=routing.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/jsonrpc-utils/dist/esm/routing.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/jsonrpc-utils/dist/esm/types.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@walletconnect/jsonrpc-utils/dist/esm/types.js ***! - \*********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ IBaseJsonRpcProvider: () => (/* reexport safe */ _walletconnect_jsonrpc_types__WEBPACK_IMPORTED_MODULE_0__.IBaseJsonRpcProvider),\n/* harmony export */ IEvents: () => (/* reexport safe */ _walletconnect_jsonrpc_types__WEBPACK_IMPORTED_MODULE_0__.IEvents),\n/* harmony export */ IJsonRpcConnection: () => (/* reexport safe */ _walletconnect_jsonrpc_types__WEBPACK_IMPORTED_MODULE_0__.IJsonRpcConnection),\n/* harmony export */ IJsonRpcProvider: () => (/* reexport safe */ _walletconnect_jsonrpc_types__WEBPACK_IMPORTED_MODULE_0__.IJsonRpcProvider)\n/* harmony export */ });\n/* harmony import */ var _walletconnect_jsonrpc_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @walletconnect/jsonrpc-types */ \"./node_modules/@walletconnect/jsonrpc-types/dist/esm/index.js\");\n\n//# sourceMappingURL=types.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/jsonrpc-utils/dist/esm/types.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/jsonrpc-utils/dist/esm/url.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@walletconnect/jsonrpc-utils/dist/esm/url.js ***! - \*******************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ isHttpUrl: () => (/* binding */ isHttpUrl),\n/* harmony export */ isLocalhostUrl: () => (/* binding */ isLocalhostUrl),\n/* harmony export */ isWsUrl: () => (/* binding */ isWsUrl)\n/* harmony export */ });\nconst HTTP_REGEX = \"^https?:\";\nconst WS_REGEX = \"^wss?:\";\nfunction getUrlProtocol(url) {\n const matches = url.match(new RegExp(/^\\w+:/, \"gi\"));\n if (!matches || !matches.length)\n return;\n return matches[0];\n}\nfunction matchRegexProtocol(url, regex) {\n const protocol = getUrlProtocol(url);\n if (typeof protocol === \"undefined\")\n return false;\n return new RegExp(regex).test(protocol);\n}\nfunction isHttpUrl(url) {\n return matchRegexProtocol(url, HTTP_REGEX);\n}\nfunction isWsUrl(url) {\n return matchRegexProtocol(url, WS_REGEX);\n}\nfunction isLocalhostUrl(url) {\n return new RegExp(\"wss?://localhost(:d{2,5})?\").test(url);\n}\n//# sourceMappingURL=url.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/jsonrpc-utils/dist/esm/url.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/jsonrpc-utils/dist/esm/validators.js": -/*!**************************************************************************!*\ - !*** ./node_modules/@walletconnect/jsonrpc-utils/dist/esm/validators.js ***! - \**************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ isJsonRpcError: () => (/* binding */ isJsonRpcError),\n/* harmony export */ isJsonRpcPayload: () => (/* binding */ isJsonRpcPayload),\n/* harmony export */ isJsonRpcRequest: () => (/* binding */ isJsonRpcRequest),\n/* harmony export */ isJsonRpcResponse: () => (/* binding */ isJsonRpcResponse),\n/* harmony export */ isJsonRpcResult: () => (/* binding */ isJsonRpcResult),\n/* harmony export */ isJsonRpcValidationInvalid: () => (/* binding */ isJsonRpcValidationInvalid)\n/* harmony export */ });\nfunction isJsonRpcPayload(payload) {\n return (typeof payload === \"object\" &&\n \"id\" in payload &&\n \"jsonrpc\" in payload &&\n payload.jsonrpc === \"2.0\");\n}\nfunction isJsonRpcRequest(payload) {\n return isJsonRpcPayload(payload) && \"method\" in payload;\n}\nfunction isJsonRpcResponse(payload) {\n return isJsonRpcPayload(payload) && (isJsonRpcResult(payload) || isJsonRpcError(payload));\n}\nfunction isJsonRpcResult(payload) {\n return \"result\" in payload;\n}\nfunction isJsonRpcError(payload) {\n return \"error\" in payload;\n}\nfunction isJsonRpcValidationInvalid(validation) {\n return \"error\" in validation && validation.valid === false;\n}\n//# sourceMappingURL=validators.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/jsonrpc-utils/dist/esm/validators.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/jsonrpc-ws-connection/dist/index.es.js": -/*!****************************************************************************!*\ - !*** ./node_modules/@walletconnect/jsonrpc-ws-connection/dist/index.es.js ***! - \****************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ WsConnection: () => (/* binding */ f),\n/* harmony export */ \"default\": () => (/* binding */ f)\n/* harmony export */ });\n/* harmony import */ var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! events */ \"./node_modules/events/events.js\");\n/* harmony import */ var events__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(events__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _walletconnect_safe_json__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @walletconnect/safe-json */ \"./node_modules/@walletconnect/safe-json/dist/esm/index.js\");\n/* harmony import */ var _walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @walletconnect/jsonrpc-utils */ \"./node_modules/@walletconnect/jsonrpc-utils/dist/esm/index.js\");\nconst w=()=>typeof WebSocket<\"u\"?WebSocket:typeof __webpack_require__.g<\"u\"&&typeof __webpack_require__.g.WebSocket<\"u\"?__webpack_require__.g.WebSocket:typeof window<\"u\"&&typeof window.WebSocket<\"u\"?window.WebSocket:typeof self<\"u\"&&typeof self.WebSocket<\"u\"?self.WebSocket:__webpack_require__(/*! ws */ \"./node_modules/ws/browser.js\"),b=()=>typeof WebSocket<\"u\"||typeof __webpack_require__.g<\"u\"&&typeof __webpack_require__.g.WebSocket<\"u\"||typeof window<\"u\"&&typeof window.WebSocket<\"u\"||typeof self<\"u\"&&typeof self.WebSocket<\"u\",a=c=>c.split(\"?\")[0],h=10,S=w();class f{constructor(e){if(this.url=e,this.events=new events__WEBPACK_IMPORTED_MODULE_0__.EventEmitter,this.registering=!1,!(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_2__.isWsUrl)(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<\"u\"}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,t)=>{if(typeof this.socket>\"u\"){t(new Error(\"Connection already closed\"));return}this.socket.onclose=n=>{this.onClose(n),e()},this.socket.close()})}async send(e){typeof this.socket>\"u\"&&(this.socket=await this.register());try{this.socket.send((0,_walletconnect_safe_json__WEBPACK_IMPORTED_MODULE_1__.safeJsonStringify)(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_2__.isWsUrl)(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount(\"register_error\")>=t||this.events.listenerCount(\"open\")>=t)&&this.events.setMaxListeners(t+1),new Promise((n,o)=>{this.events.once(\"register_error\",s=>{this.resetMaxListeners(),o(s)}),this.events.once(\"open\",()=>{if(this.resetMaxListeners(),typeof this.socket>\"u\")return o(new Error(\"WebSocket connection is missing or invalid\"));n(this.socket)})})}return this.url=e,this.registering=!0,new Promise((t,n)=>{const o=new URLSearchParams(e).get(\"origin\"),s=(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_2__.isReactNative)()?{headers:{origin:o}}:{rejectUnauthorized:!(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_2__.isLocalhostUrl)(e)},i=new S(e,[],s);b()?i.onerror=r=>{const l=r;n(this.emitError(l.error))}:i.on(\"error\",r=>{n(this.emitError(r))}),i.onopen=()=>{this.onOpen(i),t(i)}})}onOpen(e){e.onmessage=t=>this.onPayload(t),e.onclose=t=>this.onClose(t),this.socket=e,this.registering=!1,this.events.emit(\"open\")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit(\"close\",e)}onPayload(e){if(typeof e.data>\"u\")return;const t=typeof e.data==\"string\"?(0,_walletconnect_safe_json__WEBPACK_IMPORTED_MODULE_1__.safeJsonParse)(e.data):e.data;this.events.emit(\"payload\",t)}onError(e,t){const n=this.parseError(t),o=n.message||n.toString(),s=(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_2__.formatJsonRpcError)(e,o);this.events.emit(\"payload\",s)}parseError(e,t=this.url){return (0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_2__.parseConnectionError)(e,a(t),\"WS\")}resetMaxListeners(){this.events.getMaxListeners()>h&&this.events.setMaxListeners(h)}emitError(e){const t=this.parseError(new Error(e?.message||`WebSocket connection failed for host: ${a(this.url)}`));return this.events.emit(\"register_error\",t),t}}\n//# sourceMappingURL=index.es.js.map\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/jsonrpc-ws-connection/dist/index.es.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/keyvaluestorage/dist/index.es.js": -/*!**********************************************************************!*\ - !*** ./node_modules/@walletconnect/keyvaluestorage/dist/index.es.js ***! - \**********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ KeyValueStorage: () => (/* binding */ h),\n/* harmony export */ \"default\": () => (/* binding */ h)\n/* harmony export */ });\n/* harmony import */ var unstorage__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! unstorage */ \"./node_modules/unstorage/dist/index.mjs\");\n/* harmony import */ var idb_keyval__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! idb-keyval */ \"./node_modules/idb-keyval/dist/index.js\");\n/* harmony import */ var _walletconnect_safe_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @walletconnect/safe-json */ \"./node_modules/@walletconnect/safe-json/dist/esm/index.js\");\nfunction C(i){return i}const x=\"idb-keyval\";var z=(i={})=>{const t=i.base&&i.base.length>0?`${i.base}:`:\"\",e=s=>t+s;let n;return i.dbName&&i.storeName&&(n=(0,idb_keyval__WEBPACK_IMPORTED_MODULE_1__.createStore)(i.dbName,i.storeName)),{name:x,options:i,async hasItem(s){return!(typeof await (0,idb_keyval__WEBPACK_IMPORTED_MODULE_1__.get)(e(s),n)>\"u\")},async getItem(s){return await (0,idb_keyval__WEBPACK_IMPORTED_MODULE_1__.get)(e(s),n)??null},setItem(s,a){return (0,idb_keyval__WEBPACK_IMPORTED_MODULE_1__.set)(e(s),a,n)},removeItem(s){return (0,idb_keyval__WEBPACK_IMPORTED_MODULE_1__.del)(e(s),n)},getKeys(){return (0,idb_keyval__WEBPACK_IMPORTED_MODULE_1__.keys)(n)},clear(){return (0,idb_keyval__WEBPACK_IMPORTED_MODULE_1__.clear)(n)}}};const D=\"WALLET_CONNECT_V2_INDEXED_DB\",E=\"keyvaluestorage\";class _{constructor(){this.indexedDb=(0,unstorage__WEBPACK_IMPORTED_MODULE_2__.createStorage)({driver:z({dbName:D,storeName:E})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(t=>[t.key,t.value])}async getItem(t){const e=await this.indexedDb.getItem(t);if(e!==null)return e}async setItem(t,e){await this.indexedDb.setItem(t,(0,_walletconnect_safe_json__WEBPACK_IMPORTED_MODULE_0__.safeJsonStringify)(e))}async removeItem(t){await this.indexedDb.removeItem(t)}}var l=typeof globalThis<\"u\"?globalThis:typeof window<\"u\"?window:typeof __webpack_require__.g<\"u\"?__webpack_require__.g:typeof self<\"u\"?self:{},c={exports:{}};(function(){let i;function t(){}i=t,i.prototype.getItem=function(e){return this.hasOwnProperty(e)?String(this[e]):null},i.prototype.setItem=function(e,n){this[e]=String(n)},i.prototype.removeItem=function(e){delete this[e]},i.prototype.clear=function(){const e=this;Object.keys(e).forEach(function(n){e[n]=void 0,delete e[n]})},i.prototype.key=function(e){return e=e||0,Object.keys(this)[e]},i.prototype.__defineGetter__(\"length\",function(){return Object.keys(this).length}),typeof l<\"u\"&&l.localStorage?c.exports=l.localStorage:typeof window<\"u\"&&window.localStorage?c.exports=window.localStorage:c.exports=new t})();function k(i){var t;return[i[0],(0,_walletconnect_safe_json__WEBPACK_IMPORTED_MODULE_0__.safeJsonParse)((t=i[1])!=null?t:\"\")]}class K{constructor(){this.localStorage=c.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(k)}async getItem(t){const e=this.localStorage.getItem(t);if(e!==null)return (0,_walletconnect_safe_json__WEBPACK_IMPORTED_MODULE_0__.safeJsonParse)(e)}async setItem(t,e){this.localStorage.setItem(t,(0,_walletconnect_safe_json__WEBPACK_IMPORTED_MODULE_0__.safeJsonStringify)(e))}async removeItem(t){this.localStorage.removeItem(t)}}const N=\"wc_storage_version\",y=1,O=async(i,t,e)=>{const n=N,s=await t.getItem(n);if(s&&s>=y){e(t);return}const a=await i.getKeys();if(!a.length){e(t);return}const m=[];for(;a.length;){const r=a.shift();if(!r)continue;const o=r.toLowerCase();if(o.includes(\"wc@\")||o.includes(\"walletconnect\")||o.includes(\"wc_\")||o.includes(\"wallet_connect\")){const f=await i.getItem(r);await t.setItem(r,f),m.push(r)}}await t.setItem(n,y),e(t),j(i,m)},j=async(i,t)=>{t.length&&t.forEach(async e=>{await i.removeItem(e)})};class h{constructor(){this.initialized=!1,this.setInitialized=e=>{this.storage=e,this.initialized=!0};const t=new K;this.storage=t;try{const e=new _;O(t,e,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(t){return await this.initialize(),this.storage.getItem(t)}async setItem(t,e){return await this.initialize(),this.storage.setItem(t,e)}async removeItem(t){return await this.initialize(),this.storage.removeItem(t)}async initialize(){this.initialized||await new Promise(t=>{const e=setInterval(()=>{this.initialized&&(clearInterval(e),t())},20)})}}\n//# sourceMappingURL=index.es.js.map\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/keyvaluestorage/dist/index.es.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/logger/dist/index.es.js": -/*!*************************************************************!*\ - !*** ./node_modules/@walletconnect/logger/dist/index.es.js ***! - \*************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ MAX_LOG_SIZE_IN_BYTES_DEFAULT: () => (/* binding */ l),\n/* harmony export */ PINO_CUSTOM_CONTEXT_KEY: () => (/* binding */ n),\n/* harmony export */ PINO_LOGGER_DEFAULTS: () => (/* binding */ c),\n/* harmony export */ formatChildLoggerContext: () => (/* binding */ w),\n/* harmony export */ generateChildLogger: () => (/* binding */ E),\n/* harmony export */ generateClientLogger: () => (/* binding */ C),\n/* harmony export */ generatePlatformLogger: () => (/* binding */ A),\n/* harmony export */ generateServerLogger: () => (/* binding */ I),\n/* harmony export */ getBrowserLoggerContext: () => (/* binding */ v),\n/* harmony export */ getDefaultLoggerOptions: () => (/* binding */ k),\n/* harmony export */ getLoggerContext: () => (/* binding */ y),\n/* harmony export */ pino: () => (/* reexport default from dynamic */ pino__WEBPACK_IMPORTED_MODULE_0___default.a),\n/* harmony export */ setBrowserLoggerContext: () => (/* binding */ b)\n/* harmony export */ });\n/* harmony import */ var pino__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! pino */ \"./node_modules/pino/browser.js\");\n/* harmony import */ var pino__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(pino__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _walletconnect_safe_json__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @walletconnect/safe-json */ \"./node_modules/@walletconnect/safe-json/dist/esm/index.js\");\nconst c={level:\"info\"},n=\"custom_context\",l=1e3*1024;class O{constructor(e){this.nodeValue=e,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class d{constructor(e){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){const t=new O(e);if(t.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${t.size}`);for(;this.size+t.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=t),this.tail=t):(this.head=t,this.tail=t),this.lengthInNodes++,this.sizeInBytes+=t.size}shift(){if(!this.head)return;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let t=this.head;for(;t!==null;)e.push(t.value),t=t.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};const t=e.value;return e=e.next,{done:!1,value:t}}}}}class L{constructor(e,t=l){this.level=e??\"error\",this.levelValue=pino__WEBPACK_IMPORTED_MODULE_0__.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=t,this.logs=new d(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,t){t===pino__WEBPACK_IMPORTED_MODULE_0__.levels.values.error?console.error(e):t===pino__WEBPACK_IMPORTED_MODULE_0__.levels.values.warn?console.warn(e):t===pino__WEBPACK_IMPORTED_MODULE_0__.levels.values.debug?console.debug(e):t===pino__WEBPACK_IMPORTED_MODULE_0__.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append((0,_walletconnect_safe_json__WEBPACK_IMPORTED_MODULE_1__.safeJsonStringify)({timestamp:new Date().toISOString(),log:e}));const t=typeof e==\"string\"?JSON.parse(e).level:e.level;t>=this.levelValue&&this.forwardToConsole(e,t)}getLogs(){return this.logs}clearLogs(){this.logs=new d(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const t=this.getLogArray();return t.push((0,_walletconnect_safe_json__WEBPACK_IMPORTED_MODULE_1__.safeJsonStringify)({extraMetadata:e})),new Blob(t,{type:\"application/json\"})}}class m{constructor(e,t=l){this.baseChunkLogger=new L(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){const t=URL.createObjectURL(this.logsToBlob(e)),o=document.createElement(\"a\");o.href=t,o.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(t)}}class B{constructor(e,t=l){this.baseChunkLogger=new L(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}}var x=Object.defineProperty,S=Object.defineProperties,_=Object.getOwnPropertyDescriptors,p=Object.getOwnPropertySymbols,T=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable,f=(r,e,t)=>e in r?x(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,i=(r,e)=>{for(var t in e||(e={}))T.call(e,t)&&f(r,t,e[t]);if(p)for(var t of p(e))z.call(e,t)&&f(r,t,e[t]);return r},g=(r,e)=>S(r,_(e));function k(r){return g(i({},r),{level:r?.level||c.level})}function v(r,e=n){return r[e]||\"\"}function b(r,e,t=n){return r[t]=e,r}function y(r,e=n){let t=\"\";return typeof r.bindings>\"u\"?t=v(r,e):t=r.bindings().context||\"\",t}function w(r,e,t=n){const o=y(r,t);return o.trim()?`${o}/${e}`:e}function E(r,e,t=n){const o=w(r,e,t),a=r.child({context:o});return b(a,o,t)}function C(r){var e,t;const o=new m((e=r.opts)==null?void 0:e.level,r.maxSizeInBytes);return{logger:pino__WEBPACK_IMPORTED_MODULE_0___default()(g(i({},r.opts),{level:\"trace\",browser:g(i({},(t=r.opts)==null?void 0:t.browser),{write:a=>o.write(a)})})),chunkLoggerController:o}}function I(r){var e;const t=new B((e=r.opts)==null?void 0:e.level,r.maxSizeInBytes);return{logger:pino__WEBPACK_IMPORTED_MODULE_0___default()(g(i({},r.opts),{level:\"trace\"}),t),chunkLoggerController:t}}function A(r){return typeof r.loggerOverride<\"u\"&&typeof r.loggerOverride!=\"string\"?{logger:r.loggerOverride,chunkLoggerController:null}:typeof window<\"u\"?C(r):I(r)}\n//# sourceMappingURL=index.es.js.map\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/logger/dist/index.es.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/relay-api/dist/esm/index.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@walletconnect/relay-api/dist/esm/index.js ***! - \*****************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ RELAY_JSONRPC: () => (/* reexport safe */ _jsonrpc__WEBPACK_IMPORTED_MODULE_2__.RELAY_JSONRPC),\n/* harmony export */ isPublishMethod: () => (/* reexport safe */ _validators__WEBPACK_IMPORTED_MODULE_3__.isPublishMethod),\n/* harmony export */ isPublishParams: () => (/* reexport safe */ _validators__WEBPACK_IMPORTED_MODULE_3__.isPublishParams),\n/* harmony export */ isPublishRequest: () => (/* reexport safe */ _validators__WEBPACK_IMPORTED_MODULE_3__.isPublishRequest),\n/* harmony export */ isSubscribeMethod: () => (/* reexport safe */ _validators__WEBPACK_IMPORTED_MODULE_3__.isSubscribeMethod),\n/* harmony export */ isSubscribeParams: () => (/* reexport safe */ _validators__WEBPACK_IMPORTED_MODULE_3__.isSubscribeParams),\n/* harmony export */ isSubscribeRequest: () => (/* reexport safe */ _validators__WEBPACK_IMPORTED_MODULE_3__.isSubscribeRequest),\n/* harmony export */ isSubscriptionMethod: () => (/* reexport safe */ _validators__WEBPACK_IMPORTED_MODULE_3__.isSubscriptionMethod),\n/* harmony export */ isSubscriptionParams: () => (/* reexport safe */ _validators__WEBPACK_IMPORTED_MODULE_3__.isSubscriptionParams),\n/* harmony export */ isSubscriptionRequest: () => (/* reexport safe */ _validators__WEBPACK_IMPORTED_MODULE_3__.isSubscriptionRequest),\n/* harmony export */ isUnsubscribeMethod: () => (/* reexport safe */ _validators__WEBPACK_IMPORTED_MODULE_3__.isUnsubscribeMethod),\n/* harmony export */ isUnsubscribeParams: () => (/* reexport safe */ _validators__WEBPACK_IMPORTED_MODULE_3__.isUnsubscribeParams),\n/* harmony export */ isUnsubscribeRequest: () => (/* reexport safe */ _validators__WEBPACK_IMPORTED_MODULE_3__.isUnsubscribeRequest),\n/* harmony export */ parsePublishRequest: () => (/* reexport safe */ _parsers__WEBPACK_IMPORTED_MODULE_1__.parsePublishRequest),\n/* harmony export */ parseSubscribeRequest: () => (/* reexport safe */ _parsers__WEBPACK_IMPORTED_MODULE_1__.parseSubscribeRequest),\n/* harmony export */ parseSubscriptionRequest: () => (/* reexport safe */ _parsers__WEBPACK_IMPORTED_MODULE_1__.parseSubscriptionRequest),\n/* harmony export */ parseUnsubscribeRequest: () => (/* reexport safe */ _parsers__WEBPACK_IMPORTED_MODULE_1__.parseUnsubscribeRequest)\n/* harmony export */ });\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ \"./node_modules/@walletconnect/relay-api/dist/esm/types.js\");\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_types__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _types__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== \"default\") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _types__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\n/* harmony import */ var _parsers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./parsers */ \"./node_modules/@walletconnect/relay-api/dist/esm/parsers.js\");\n/* harmony import */ var _jsonrpc__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./jsonrpc */ \"./node_modules/@walletconnect/relay-api/dist/esm/jsonrpc.js\");\n/* harmony import */ var _validators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./validators */ \"./node_modules/@walletconnect/relay-api/dist/esm/validators.js\");\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/relay-api/dist/esm/index.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/relay-api/dist/esm/jsonrpc.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@walletconnect/relay-api/dist/esm/jsonrpc.js ***! - \*******************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ RELAY_JSONRPC: () => (/* binding */ RELAY_JSONRPC)\n/* harmony export */ });\nconst RELAY_JSONRPC = {\n waku: {\n publish: \"waku_publish\",\n batchPublish: \"waku_batchPublish\",\n subscribe: \"waku_subscribe\",\n batchSubscribe: \"waku_batchSubscribe\",\n subscription: \"waku_subscription\",\n unsubscribe: \"waku_unsubscribe\",\n batchUnsubscribe: \"waku_batchUnsubscribe\",\n },\n irn: {\n publish: \"irn_publish\",\n batchPublish: \"irn_batchPublish\",\n subscribe: \"irn_subscribe\",\n batchSubscribe: \"irn_batchSubscribe\",\n subscription: \"irn_subscription\",\n unsubscribe: \"irn_unsubscribe\",\n batchUnsubscribe: \"irn_batchUnsubscribe\",\n },\n iridium: {\n publish: \"iridium_publish\",\n batchPublish: \"iridium_batchPublish\",\n subscribe: \"iridium_subscribe\",\n batchSubscribe: \"iridium_batchSubscribe\",\n subscription: \"iridium_subscription\",\n unsubscribe: \"iridium_unsubscribe\",\n batchUnsubscribe: \"iridium_batchUnsubscribe\",\n },\n};\n//# sourceMappingURL=jsonrpc.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/relay-api/dist/esm/jsonrpc.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/relay-api/dist/esm/misc.js": -/*!****************************************************************!*\ - !*** ./node_modules/@walletconnect/relay-api/dist/esm/misc.js ***! - \****************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ assertType: () => (/* binding */ assertType),\n/* harmony export */ checkParams: () => (/* binding */ checkParams),\n/* harmony export */ hasExactParamsLength: () => (/* binding */ hasExactParamsLength),\n/* harmony export */ hasRequiredParams: () => (/* binding */ hasRequiredParams),\n/* harmony export */ hasRequiredParamsLength: () => (/* binding */ hasRequiredParamsLength),\n/* harmony export */ methodEndsWith: () => (/* binding */ methodEndsWith)\n/* harmony export */ });\nfunction assertType(obj, key, type = \"string\") {\n if (!obj[key] || typeof obj[key] !== type) {\n throw new Error(`Missing or invalid \"${key}\" param`);\n }\n}\nfunction hasRequiredParams(params, required) {\n let matches = true;\n required.forEach(key => {\n const exists = key in params;\n if (!exists) {\n matches = false;\n }\n });\n return matches;\n}\nfunction hasExactParamsLength(params, length) {\n return Array.isArray(params)\n ? params.length === length\n : Object.keys(params).length === length;\n}\nfunction hasRequiredParamsLength(params, minLength) {\n return Array.isArray(params)\n ? params.length >= minLength\n : Object.keys(params).length >= minLength;\n}\nfunction checkParams(params, required, optional) {\n const exact = !optional.length;\n const matchesLength = exact\n ? hasExactParamsLength(params, required.length)\n : hasRequiredParamsLength(params, required.length);\n if (!matchesLength)\n return false;\n return hasRequiredParams(params, required);\n}\nfunction methodEndsWith(method, expected, separator = \"_\") {\n const split = method.split(separator);\n return (split[split.length - 1].trim().toLowerCase() ===\n expected.trim().toLowerCase());\n}\n//# sourceMappingURL=misc.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/relay-api/dist/esm/misc.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/relay-api/dist/esm/parsers.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@walletconnect/relay-api/dist/esm/parsers.js ***! - \*******************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ parsePublishRequest: () => (/* binding */ parsePublishRequest),\n/* harmony export */ parseSubscribeRequest: () => (/* binding */ parseSubscribeRequest),\n/* harmony export */ parseSubscriptionRequest: () => (/* binding */ parseSubscriptionRequest),\n/* harmony export */ parseUnsubscribeRequest: () => (/* binding */ parseUnsubscribeRequest)\n/* harmony export */ });\n/* harmony import */ var _misc__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./misc */ \"./node_modules/@walletconnect/relay-api/dist/esm/misc.js\");\n/* harmony import */ var _validators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./validators */ \"./node_modules/@walletconnect/relay-api/dist/esm/validators.js\");\n\n\nfunction parseSubscribeRequest(request) {\n if (!(0,_validators__WEBPACK_IMPORTED_MODULE_1__.isSubscribeMethod)(request.method)) {\n throw new Error(\"JSON-RPC Request has invalid subscribe method\");\n }\n if (!(0,_validators__WEBPACK_IMPORTED_MODULE_1__.isSubscribeParams)(request.params)) {\n throw new Error(\"JSON-RPC Request has invalid subscribe params\");\n }\n const params = request.params;\n (0,_misc__WEBPACK_IMPORTED_MODULE_0__.assertType)(params, \"topic\");\n return params;\n}\nfunction parsePublishRequest(request) {\n if (!(0,_validators__WEBPACK_IMPORTED_MODULE_1__.isPublishMethod)(request.method)) {\n throw new Error(\"JSON-RPC Request has invalid publish method\");\n }\n if (!(0,_validators__WEBPACK_IMPORTED_MODULE_1__.isPublishParams)(request.params)) {\n throw new Error(\"JSON-RPC Request has invalid publish params\");\n }\n const params = request.params;\n (0,_misc__WEBPACK_IMPORTED_MODULE_0__.assertType)(params, \"topic\");\n (0,_misc__WEBPACK_IMPORTED_MODULE_0__.assertType)(params, \"message\");\n (0,_misc__WEBPACK_IMPORTED_MODULE_0__.assertType)(params, \"ttl\", \"number\");\n return params;\n}\nfunction parseUnsubscribeRequest(request) {\n if (!(0,_validators__WEBPACK_IMPORTED_MODULE_1__.isUnsubscribeMethod)(request.method)) {\n throw new Error(\"JSON-RPC Request has invalid unsubscribe method\");\n }\n if (!(0,_validators__WEBPACK_IMPORTED_MODULE_1__.isUnsubscribeParams)(request.params)) {\n throw new Error(\"JSON-RPC Request has invalid unsubscribe params\");\n }\n const params = request.params;\n (0,_misc__WEBPACK_IMPORTED_MODULE_0__.assertType)(params, \"id\");\n return params;\n}\nfunction parseSubscriptionRequest(request) {\n if (!(0,_validators__WEBPACK_IMPORTED_MODULE_1__.isSubscriptionMethod)(request.method)) {\n throw new Error(\"JSON-RPC Request has invalid subscription method\");\n }\n if (!(0,_validators__WEBPACK_IMPORTED_MODULE_1__.isSubscriptionParams)(request.params)) {\n throw new Error(\"JSON-RPC Request has invalid subscription params\");\n }\n const params = request.params;\n (0,_misc__WEBPACK_IMPORTED_MODULE_0__.assertType)(params, \"id\");\n (0,_misc__WEBPACK_IMPORTED_MODULE_0__.assertType)(params, \"data\");\n return params;\n}\n//# sourceMappingURL=parsers.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/relay-api/dist/esm/parsers.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/relay-api/dist/esm/types.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@walletconnect/relay-api/dist/esm/types.js ***! - \*****************************************************************/ -/***/ (() => { - -eval("//# sourceMappingURL=types.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/relay-api/dist/esm/types.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/relay-api/dist/esm/validators.js": -/*!**********************************************************************!*\ - !*** ./node_modules/@walletconnect/relay-api/dist/esm/validators.js ***! - \**********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ isPublishMethod: () => (/* binding */ isPublishMethod),\n/* harmony export */ isPublishParams: () => (/* binding */ isPublishParams),\n/* harmony export */ isPublishRequest: () => (/* binding */ isPublishRequest),\n/* harmony export */ isSubscribeMethod: () => (/* binding */ isSubscribeMethod),\n/* harmony export */ isSubscribeParams: () => (/* binding */ isSubscribeParams),\n/* harmony export */ isSubscribeRequest: () => (/* binding */ isSubscribeRequest),\n/* harmony export */ isSubscriptionMethod: () => (/* binding */ isSubscriptionMethod),\n/* harmony export */ isSubscriptionParams: () => (/* binding */ isSubscriptionParams),\n/* harmony export */ isSubscriptionRequest: () => (/* binding */ isSubscriptionRequest),\n/* harmony export */ isUnsubscribeMethod: () => (/* binding */ isUnsubscribeMethod),\n/* harmony export */ isUnsubscribeParams: () => (/* binding */ isUnsubscribeParams),\n/* harmony export */ isUnsubscribeRequest: () => (/* binding */ isUnsubscribeRequest)\n/* harmony export */ });\n/* harmony import */ var _misc__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./misc */ \"./node_modules/@walletconnect/relay-api/dist/esm/misc.js\");\n\nfunction isSubscribeRequest(request) {\n return isSubscribeMethod(request.method) && isSubscribeParams(request.params);\n}\nfunction isSubscribeMethod(method) {\n return (0,_misc__WEBPACK_IMPORTED_MODULE_0__.methodEndsWith)(method, \"subscribe\");\n}\nfunction isSubscribeParams(params) {\n const required = [\"topic\"];\n const optional = [];\n return (0,_misc__WEBPACK_IMPORTED_MODULE_0__.checkParams)(params, required, optional);\n}\nfunction isPublishRequest(request) {\n return isPublishMethod(request.method) && isPublishParams(request.params);\n}\nfunction isPublishMethod(method) {\n return (0,_misc__WEBPACK_IMPORTED_MODULE_0__.methodEndsWith)(method, \"publish\");\n}\nfunction isPublishParams(params) {\n const required = [\"message\", \"topic\", \"ttl\"];\n const optional = [\"prompt\", \"tag\"];\n return (0,_misc__WEBPACK_IMPORTED_MODULE_0__.checkParams)(params, required, optional);\n}\nfunction isUnsubscribeRequest(request) {\n return (isUnsubscribeMethod(request.method) && isUnsubscribeParams(request.params));\n}\nfunction isUnsubscribeMethod(method) {\n return (0,_misc__WEBPACK_IMPORTED_MODULE_0__.methodEndsWith)(method, \"unsubscribe\");\n}\nfunction isUnsubscribeParams(params) {\n const required = [\"id\", \"topic\"];\n const optional = [];\n return (0,_misc__WEBPACK_IMPORTED_MODULE_0__.checkParams)(params, required, optional);\n}\nfunction isSubscriptionRequest(request) {\n return (isSubscriptionMethod(request.method) && isSubscriptionParams(request.params));\n}\nfunction isSubscriptionMethod(method) {\n return (0,_misc__WEBPACK_IMPORTED_MODULE_0__.methodEndsWith)(method, \"subscription\");\n}\nfunction isSubscriptionParams(params) {\n const required = [\"id\", \"data\"];\n const optional = [];\n return (0,_misc__WEBPACK_IMPORTED_MODULE_0__.checkParams)(params, required, optional);\n}\n//# sourceMappingURL=validators.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/relay-api/dist/esm/validators.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/relay-auth/dist/esm/api.js": -/*!****************************************************************!*\ - !*** ./node_modules/@walletconnect/relay-auth/dist/esm/api.js ***! - \****************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ generateKeyPair: () => (/* binding */ generateKeyPair),\n/* harmony export */ signJWT: () => (/* binding */ signJWT),\n/* harmony export */ verifyJWT: () => (/* binding */ verifyJWT)\n/* harmony export */ });\n/* harmony import */ var _stablelib_ed25519__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @stablelib/ed25519 */ \"./node_modules/@stablelib/ed25519/lib/ed25519.js\");\n/* harmony import */ var _stablelib_random__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @stablelib/random */ \"./node_modules/@stablelib/random/lib/random.js\");\n/* harmony import */ var _walletconnect_time__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @walletconnect/time */ \"./node_modules/@walletconnect/time/dist/cjs/index.js\");\n/* harmony import */ var _walletconnect_time__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_walletconnect_time__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ \"./node_modules/@walletconnect/relay-auth/dist/esm/constants.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ \"./node_modules/@walletconnect/relay-auth/dist/esm/utils.js\");\n\n\n\n\n\nfunction generateKeyPair(seed = (0,_stablelib_random__WEBPACK_IMPORTED_MODULE_1__.randomBytes)(_constants__WEBPACK_IMPORTED_MODULE_3__.KEY_PAIR_SEED_LENGTH)) {\n return _stablelib_ed25519__WEBPACK_IMPORTED_MODULE_0__.generateKeyPairFromSeed(seed);\n}\nasync function signJWT(sub, aud, ttl, keyPair, iat = (0,_walletconnect_time__WEBPACK_IMPORTED_MODULE_2__.fromMiliseconds)(Date.now())) {\n const header = { alg: _constants__WEBPACK_IMPORTED_MODULE_3__.JWT_IRIDIUM_ALG, typ: _constants__WEBPACK_IMPORTED_MODULE_3__.JWT_IRIDIUM_TYP };\n const iss = (0,_utils__WEBPACK_IMPORTED_MODULE_4__.encodeIss)(keyPair.publicKey);\n const exp = iat + ttl;\n const payload = { iss, sub, aud, iat, exp };\n const data = (0,_utils__WEBPACK_IMPORTED_MODULE_4__.encodeData)({ header, payload });\n const signature = _stablelib_ed25519__WEBPACK_IMPORTED_MODULE_0__.sign(keyPair.secretKey, data);\n return (0,_utils__WEBPACK_IMPORTED_MODULE_4__.encodeJWT)({ header, payload, signature });\n}\nasync function verifyJWT(jwt) {\n const { header, payload, data, signature } = (0,_utils__WEBPACK_IMPORTED_MODULE_4__.decodeJWT)(jwt);\n if (header.alg !== _constants__WEBPACK_IMPORTED_MODULE_3__.JWT_IRIDIUM_ALG || header.typ !== _constants__WEBPACK_IMPORTED_MODULE_3__.JWT_IRIDIUM_TYP) {\n throw new Error(\"JWT must use EdDSA algorithm\");\n }\n const publicKey = (0,_utils__WEBPACK_IMPORTED_MODULE_4__.decodeIss)(payload.iss);\n return _stablelib_ed25519__WEBPACK_IMPORTED_MODULE_0__.verify(publicKey, data, signature);\n}\n//# sourceMappingURL=api.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/relay-auth/dist/esm/api.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/relay-auth/dist/esm/constants.js": -/*!**********************************************************************!*\ - !*** ./node_modules/@walletconnect/relay-auth/dist/esm/constants.js ***! - \**********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DATA_ENCODING: () => (/* binding */ DATA_ENCODING),\n/* harmony export */ DID_DELIMITER: () => (/* binding */ DID_DELIMITER),\n/* harmony export */ DID_METHOD: () => (/* binding */ DID_METHOD),\n/* harmony export */ DID_PREFIX: () => (/* binding */ DID_PREFIX),\n/* harmony export */ JSON_ENCODING: () => (/* binding */ JSON_ENCODING),\n/* harmony export */ JWT_DELIMITER: () => (/* binding */ JWT_DELIMITER),\n/* harmony export */ JWT_ENCODING: () => (/* binding */ JWT_ENCODING),\n/* harmony export */ JWT_IRIDIUM_ALG: () => (/* binding */ JWT_IRIDIUM_ALG),\n/* harmony export */ JWT_IRIDIUM_TYP: () => (/* binding */ JWT_IRIDIUM_TYP),\n/* harmony export */ KEY_PAIR_SEED_LENGTH: () => (/* binding */ KEY_PAIR_SEED_LENGTH),\n/* harmony export */ MULTICODEC_ED25519_BASE: () => (/* binding */ MULTICODEC_ED25519_BASE),\n/* harmony export */ MULTICODEC_ED25519_ENCODING: () => (/* binding */ MULTICODEC_ED25519_ENCODING),\n/* harmony export */ MULTICODEC_ED25519_HEADER: () => (/* binding */ MULTICODEC_ED25519_HEADER),\n/* harmony export */ MULTICODEC_ED25519_LENGTH: () => (/* binding */ MULTICODEC_ED25519_LENGTH)\n/* harmony export */ });\nconst JWT_IRIDIUM_ALG = \"EdDSA\";\nconst JWT_IRIDIUM_TYP = \"JWT\";\nconst JWT_DELIMITER = \".\";\nconst JWT_ENCODING = \"base64url\";\nconst JSON_ENCODING = \"utf8\";\nconst DATA_ENCODING = \"utf8\";\nconst DID_DELIMITER = \":\";\nconst DID_PREFIX = \"did\";\nconst DID_METHOD = \"key\";\nconst MULTICODEC_ED25519_ENCODING = \"base58btc\";\nconst MULTICODEC_ED25519_BASE = \"z\";\nconst MULTICODEC_ED25519_HEADER = \"K36\";\nconst MULTICODEC_ED25519_LENGTH = 32;\nconst KEY_PAIR_SEED_LENGTH = 32;\n//# sourceMappingURL=constants.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/relay-auth/dist/esm/constants.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/relay-auth/dist/esm/index.js": -/*!******************************************************************!*\ - !*** ./node_modules/@walletconnect/relay-auth/dist/esm/index.js ***! - \******************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DATA_ENCODING: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_1__.DATA_ENCODING),\n/* harmony export */ DID_DELIMITER: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_1__.DID_DELIMITER),\n/* harmony export */ DID_METHOD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_1__.DID_METHOD),\n/* harmony export */ DID_PREFIX: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_1__.DID_PREFIX),\n/* harmony export */ JSON_ENCODING: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_1__.JSON_ENCODING),\n/* harmony export */ JWT_DELIMITER: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_1__.JWT_DELIMITER),\n/* harmony export */ JWT_ENCODING: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_1__.JWT_ENCODING),\n/* harmony export */ JWT_IRIDIUM_ALG: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_1__.JWT_IRIDIUM_ALG),\n/* harmony export */ JWT_IRIDIUM_TYP: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_1__.JWT_IRIDIUM_TYP),\n/* harmony export */ KEY_PAIR_SEED_LENGTH: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_1__.KEY_PAIR_SEED_LENGTH),\n/* harmony export */ MULTICODEC_ED25519_BASE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_1__.MULTICODEC_ED25519_BASE),\n/* harmony export */ MULTICODEC_ED25519_ENCODING: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_1__.MULTICODEC_ED25519_ENCODING),\n/* harmony export */ MULTICODEC_ED25519_HEADER: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_1__.MULTICODEC_ED25519_HEADER),\n/* harmony export */ MULTICODEC_ED25519_LENGTH: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_1__.MULTICODEC_ED25519_LENGTH),\n/* harmony export */ decodeData: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_3__.decodeData),\n/* harmony export */ decodeIss: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_3__.decodeIss),\n/* harmony export */ decodeJSON: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_3__.decodeJSON),\n/* harmony export */ decodeJWT: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_3__.decodeJWT),\n/* harmony export */ decodeSig: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_3__.decodeSig),\n/* harmony export */ encodeData: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_3__.encodeData),\n/* harmony export */ encodeIss: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_3__.encodeIss),\n/* harmony export */ encodeJSON: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_3__.encodeJSON),\n/* harmony export */ encodeJWT: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_3__.encodeJWT),\n/* harmony export */ encodeSig: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_3__.encodeSig),\n/* harmony export */ generateKeyPair: () => (/* reexport safe */ _api__WEBPACK_IMPORTED_MODULE_0__.generateKeyPair),\n/* harmony export */ signJWT: () => (/* reexport safe */ _api__WEBPACK_IMPORTED_MODULE_0__.signJWT),\n/* harmony export */ verifyJWT: () => (/* reexport safe */ _api__WEBPACK_IMPORTED_MODULE_0__.verifyJWT)\n/* harmony export */ });\n/* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./api */ \"./node_modules/@walletconnect/relay-auth/dist/esm/api.js\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants */ \"./node_modules/@walletconnect/relay-auth/dist/esm/constants.js\");\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./types */ \"./node_modules/@walletconnect/relay-auth/dist/esm/types.js\");\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_types__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _types__WEBPACK_IMPORTED_MODULE_2__) if([\"default\",\"generateKeyPair\",\"signJWT\",\"verifyJWT\",\"DATA_ENCODING\",\"DID_DELIMITER\",\"DID_METHOD\",\"DID_PREFIX\",\"JSON_ENCODING\",\"JWT_DELIMITER\",\"JWT_ENCODING\",\"JWT_IRIDIUM_ALG\",\"JWT_IRIDIUM_TYP\",\"KEY_PAIR_SEED_LENGTH\",\"MULTICODEC_ED25519_BASE\",\"MULTICODEC_ED25519_ENCODING\",\"MULTICODEC_ED25519_HEADER\",\"MULTICODEC_ED25519_LENGTH\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _types__WEBPACK_IMPORTED_MODULE_2__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ \"./node_modules/@walletconnect/relay-auth/dist/esm/utils.js\");\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/relay-auth/dist/esm/index.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/relay-auth/dist/esm/types.js": -/*!******************************************************************!*\ - !*** ./node_modules/@walletconnect/relay-auth/dist/esm/types.js ***! - \******************************************************************/ -/***/ (() => { - -eval("//# sourceMappingURL=types.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/relay-auth/dist/esm/types.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/relay-auth/dist/esm/utils.js": -/*!******************************************************************!*\ - !*** ./node_modules/@walletconnect/relay-auth/dist/esm/utils.js ***! - \******************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ decodeData: () => (/* binding */ decodeData),\n/* harmony export */ decodeIss: () => (/* binding */ decodeIss),\n/* harmony export */ decodeJSON: () => (/* binding */ decodeJSON),\n/* harmony export */ decodeJWT: () => (/* binding */ decodeJWT),\n/* harmony export */ decodeSig: () => (/* binding */ decodeSig),\n/* harmony export */ encodeData: () => (/* binding */ encodeData),\n/* harmony export */ encodeIss: () => (/* binding */ encodeIss),\n/* harmony export */ encodeJSON: () => (/* binding */ encodeJSON),\n/* harmony export */ encodeJWT: () => (/* binding */ encodeJWT),\n/* harmony export */ encodeSig: () => (/* binding */ encodeSig)\n/* harmony export */ });\n/* harmony import */ var uint8arrays_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uint8arrays/concat */ \"./node_modules/uint8arrays/esm/src/concat.js\");\n/* harmony import */ var uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! uint8arrays/to-string */ \"./node_modules/uint8arrays/esm/src/to-string.js\");\n/* harmony import */ var uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! uint8arrays/from-string */ \"./node_modules/uint8arrays/esm/src/from-string.js\");\n/* harmony import */ var _walletconnect_safe_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @walletconnect/safe-json */ \"./node_modules/@walletconnect/safe-json/dist/esm/index.js\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constants */ \"./node_modules/@walletconnect/relay-auth/dist/esm/constants.js\");\n\n\n\n\n\nfunction decodeJSON(str) {\n return (0,_walletconnect_safe_json__WEBPACK_IMPORTED_MODULE_3__.safeJsonParse)((0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_1__.toString)((0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_2__.fromString)(str, _constants__WEBPACK_IMPORTED_MODULE_4__.JWT_ENCODING), _constants__WEBPACK_IMPORTED_MODULE_4__.JSON_ENCODING));\n}\nfunction encodeJSON(val) {\n return (0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_1__.toString)((0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_2__.fromString)((0,_walletconnect_safe_json__WEBPACK_IMPORTED_MODULE_3__.safeJsonStringify)(val), _constants__WEBPACK_IMPORTED_MODULE_4__.JSON_ENCODING), _constants__WEBPACK_IMPORTED_MODULE_4__.JWT_ENCODING);\n}\nfunction encodeIss(publicKey) {\n const header = (0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_2__.fromString)(_constants__WEBPACK_IMPORTED_MODULE_4__.MULTICODEC_ED25519_HEADER, _constants__WEBPACK_IMPORTED_MODULE_4__.MULTICODEC_ED25519_ENCODING);\n const multicodec = _constants__WEBPACK_IMPORTED_MODULE_4__.MULTICODEC_ED25519_BASE +\n (0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_1__.toString)((0,uint8arrays_concat__WEBPACK_IMPORTED_MODULE_0__.concat)([header, publicKey]), _constants__WEBPACK_IMPORTED_MODULE_4__.MULTICODEC_ED25519_ENCODING);\n return [_constants__WEBPACK_IMPORTED_MODULE_4__.DID_PREFIX, _constants__WEBPACK_IMPORTED_MODULE_4__.DID_METHOD, multicodec].join(_constants__WEBPACK_IMPORTED_MODULE_4__.DID_DELIMITER);\n}\nfunction decodeIss(issuer) {\n const [prefix, method, multicodec] = issuer.split(_constants__WEBPACK_IMPORTED_MODULE_4__.DID_DELIMITER);\n if (prefix !== _constants__WEBPACK_IMPORTED_MODULE_4__.DID_PREFIX || method !== _constants__WEBPACK_IMPORTED_MODULE_4__.DID_METHOD) {\n throw new Error(`Issuer must be a DID with method \"key\"`);\n }\n const base = multicodec.slice(0, 1);\n if (base !== _constants__WEBPACK_IMPORTED_MODULE_4__.MULTICODEC_ED25519_BASE) {\n throw new Error(`Issuer must be a key in mulicodec format`);\n }\n const bytes = (0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_2__.fromString)(multicodec.slice(1), _constants__WEBPACK_IMPORTED_MODULE_4__.MULTICODEC_ED25519_ENCODING);\n const type = (0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_1__.toString)(bytes.slice(0, 2), _constants__WEBPACK_IMPORTED_MODULE_4__.MULTICODEC_ED25519_ENCODING);\n if (type !== _constants__WEBPACK_IMPORTED_MODULE_4__.MULTICODEC_ED25519_HEADER) {\n throw new Error(`Issuer must be a public key with type \"Ed25519\"`);\n }\n const publicKey = bytes.slice(2);\n if (publicKey.length !== _constants__WEBPACK_IMPORTED_MODULE_4__.MULTICODEC_ED25519_LENGTH) {\n throw new Error(`Issuer must be a public key with length 32 bytes`);\n }\n return publicKey;\n}\nfunction encodeSig(bytes) {\n return (0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_1__.toString)(bytes, _constants__WEBPACK_IMPORTED_MODULE_4__.JWT_ENCODING);\n}\nfunction decodeSig(encoded) {\n return (0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_2__.fromString)(encoded, _constants__WEBPACK_IMPORTED_MODULE_4__.JWT_ENCODING);\n}\nfunction encodeData(params) {\n return (0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_2__.fromString)([encodeJSON(params.header), encodeJSON(params.payload)].join(_constants__WEBPACK_IMPORTED_MODULE_4__.JWT_DELIMITER), _constants__WEBPACK_IMPORTED_MODULE_4__.DATA_ENCODING);\n}\nfunction decodeData(data) {\n const params = (0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_1__.toString)(data, _constants__WEBPACK_IMPORTED_MODULE_4__.DATA_ENCODING).split(_constants__WEBPACK_IMPORTED_MODULE_4__.JWT_DELIMITER);\n const header = decodeJSON(params[0]);\n const payload = decodeJSON(params[1]);\n return { header, payload };\n}\nfunction encodeJWT(params) {\n return [\n encodeJSON(params.header),\n encodeJSON(params.payload),\n encodeSig(params.signature),\n ].join(_constants__WEBPACK_IMPORTED_MODULE_4__.JWT_DELIMITER);\n}\nfunction decodeJWT(jwt) {\n const params = jwt.split(_constants__WEBPACK_IMPORTED_MODULE_4__.JWT_DELIMITER);\n const header = decodeJSON(params[0]);\n const payload = decodeJSON(params[1]);\n const signature = decodeSig(params[2]);\n const data = (0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_2__.fromString)(params.slice(0, 2).join(_constants__WEBPACK_IMPORTED_MODULE_4__.JWT_DELIMITER), _constants__WEBPACK_IMPORTED_MODULE_4__.DATA_ENCODING);\n return { header, payload, signature, data };\n}\n//# sourceMappingURL=utils.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/relay-auth/dist/esm/utils.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/safe-json/dist/esm/index.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@walletconnect/safe-json/dist/esm/index.js ***! - \*****************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ safeJsonParse: () => (/* binding */ safeJsonParse),\n/* harmony export */ safeJsonStringify: () => (/* binding */ safeJsonStringify)\n/* harmony export */ });\nconst JSONStringify = data => JSON.stringify(data, (_, value) => typeof value === \"bigint\" ? value.toString() + \"n\" : value);\nconst JSONParse = json => {\n const numbersBiggerThanMaxInt = /([\\[:])?(\\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\\}\\]])/g;\n const serializedData = json.replace(numbersBiggerThanMaxInt, \"$1\\\"$2n\\\"$3\");\n return JSON.parse(serializedData, (_, value) => {\n const isCustomFormatBigInt = typeof value === \"string\" && value.match(/^\\d+n$/);\n if (isCustomFormatBigInt)\n return BigInt(value.substring(0, value.length - 1));\n return value;\n });\n};\nfunction safeJsonParse(value) {\n if (typeof value !== \"string\") {\n throw new Error(`Cannot safe json parse value of type ${typeof value}`);\n }\n try {\n return JSONParse(value);\n }\n catch (_a) {\n return value;\n }\n}\nfunction safeJsonStringify(value) {\n return typeof value === \"string\" ? value : JSONStringify(value) || \"\";\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/safe-json/dist/esm/index.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/sign-client/dist/index.es.js": -/*!******************************************************************!*\ - !*** ./node_modules/@walletconnect/sign-client/dist/index.es.js ***! - \******************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AUTH_CONTEXT: () => (/* binding */ ze),\n/* harmony export */ AUTH_KEYS_CONTEXT: () => (/* binding */ He),\n/* harmony export */ AUTH_PAIRING_TOPIC_CONTEXT: () => (/* binding */ Ye),\n/* harmony export */ AUTH_PROTOCOL: () => (/* binding */ Qe),\n/* harmony export */ AUTH_PUBLIC_KEY_NAME: () => (/* binding */ J),\n/* harmony export */ AUTH_REQUEST_CONTEXT: () => (/* binding */ Xe),\n/* harmony export */ AUTH_STORAGE_PREFIX: () => (/* binding */ X),\n/* harmony export */ AUTH_VERSION: () => (/* binding */ zt),\n/* harmony export */ ENGINE_CONTEXT: () => (/* binding */ ke),\n/* harmony export */ ENGINE_QUEUE_STATES: () => (/* binding */ A),\n/* harmony export */ ENGINE_RPC_OPTS: () => (/* binding */ q),\n/* harmony export */ HISTORY_CONTEXT: () => (/* binding */ Ft),\n/* harmony export */ HISTORY_EVENTS: () => (/* binding */ kt),\n/* harmony export */ HISTORY_STORAGE_VERSION: () => (/* binding */ jt),\n/* harmony export */ METHODS_TO_VERIFY: () => (/* binding */ je),\n/* harmony export */ PROPOSAL_CONTEXT: () => (/* binding */ Ke),\n/* harmony export */ PROPOSAL_EXPIRY: () => (/* binding */ Qt),\n/* harmony export */ PROPOSAL_EXPIRY_MESSAGE: () => (/* binding */ Ue),\n/* harmony export */ REQUEST_CONTEXT: () => (/* binding */ Fe),\n/* harmony export */ SESSION_CONTEXT: () => (/* binding */ Ge),\n/* harmony export */ SESSION_EXPIRY: () => (/* binding */ L),\n/* harmony export */ SESSION_REQUEST_EXPIRY_BOUNDARIES: () => (/* binding */ re),\n/* harmony export */ SIGN_CLIENT_CONTEXT: () => (/* binding */ _e),\n/* harmony export */ SIGN_CLIENT_DEFAULT: () => (/* binding */ ie),\n/* harmony export */ SIGN_CLIENT_EVENTS: () => (/* binding */ Ut),\n/* harmony export */ SIGN_CLIENT_PROTOCOL: () => (/* binding */ Se),\n/* harmony export */ SIGN_CLIENT_STORAGE_OPTIONS: () => (/* binding */ Gt),\n/* harmony export */ SIGN_CLIENT_STORAGE_PREFIX: () => (/* binding */ se),\n/* harmony export */ SIGN_CLIENT_VERSION: () => (/* binding */ Ee),\n/* harmony export */ SessionStore: () => (/* binding */ ns),\n/* harmony export */ SignClient: () => (/* binding */ os),\n/* harmony export */ WALLETCONNECT_DEEPLINK_CHOICE: () => (/* binding */ Re),\n/* harmony export */ \"default\": () => (/* binding */ ne)\n/* harmony export */ });\n/* harmony import */ var _walletconnect_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @walletconnect/core */ \"./node_modules/@walletconnect/core/dist/index.es.js\");\n/* harmony import */ var _walletconnect_logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @walletconnect/logger */ \"./node_modules/@walletconnect/logger/dist/index.es.js\");\n/* harmony import */ var _walletconnect_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @walletconnect/types */ \"./node_modules/@walletconnect/types/dist/index.es.js\");\n/* harmony import */ var _walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @walletconnect/utils */ \"./node_modules/@walletconnect/utils/dist/index.es.js\");\n/* harmony import */ var events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! events */ \"./node_modules/events/events.js\");\n/* harmony import */ var events__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(events__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _walletconnect_time__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @walletconnect/time */ \"./node_modules/@walletconnect/time/dist/cjs/index.js\");\n/* harmony import */ var _walletconnect_time__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_walletconnect_time__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @walletconnect/jsonrpc-utils */ \"./node_modules/@walletconnect/jsonrpc-utils/dist/esm/index.js\");\nconst Se=\"wc\",Ee=2,_e=\"client\",se=`${Se}@${Ee}:${_e}:`,ie={name:_e,logger:\"error\",controller:!1,relayUrl:\"wss://relay.walletconnect.com\"},Ut={session_proposal:\"session_proposal\",session_update:\"session_update\",session_extend:\"session_extend\",session_ping:\"session_ping\",session_delete:\"session_delete\",session_expire:\"session_expire\",session_request:\"session_request\",session_request_sent:\"session_request_sent\",session_event:\"session_event\",proposal_expire:\"proposal_expire\",session_authenticate:\"session_authenticate\",session_request_expire:\"session_request_expire\"},Gt={database:\":memory:\"},Re=\"WALLETCONNECT_DEEPLINK_CHOICE\",kt={created:\"history_created\",updated:\"history_updated\",deleted:\"history_deleted\",sync:\"history_sync\"},Ft=\"history\",jt=\"0.3\",Ke=\"proposal\",Qt=_walletconnect_time__WEBPACK_IMPORTED_MODULE_2__.THIRTY_DAYS,Ue=\"Proposal expired\",Ge=\"session\",L=_walletconnect_time__WEBPACK_IMPORTED_MODULE_2__.SEVEN_DAYS,ke=\"engine\",q={wc_sessionPropose:{req:{ttl:_walletconnect_time__WEBPACK_IMPORTED_MODULE_2__.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:_walletconnect_time__WEBPACK_IMPORTED_MODULE_2__.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:_walletconnect_time__WEBPACK_IMPORTED_MODULE_2__.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:_walletconnect_time__WEBPACK_IMPORTED_MODULE_2__.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:_walletconnect_time__WEBPACK_IMPORTED_MODULE_2__.ONE_DAY,prompt:!1,tag:1104},res:{ttl:_walletconnect_time__WEBPACK_IMPORTED_MODULE_2__.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:_walletconnect_time__WEBPACK_IMPORTED_MODULE_2__.ONE_DAY,prompt:!1,tag:1106},res:{ttl:_walletconnect_time__WEBPACK_IMPORTED_MODULE_2__.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:_walletconnect_time__WEBPACK_IMPORTED_MODULE_2__.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:_walletconnect_time__WEBPACK_IMPORTED_MODULE_2__.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:_walletconnect_time__WEBPACK_IMPORTED_MODULE_2__.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:_walletconnect_time__WEBPACK_IMPORTED_MODULE_2__.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:_walletconnect_time__WEBPACK_IMPORTED_MODULE_2__.ONE_DAY,prompt:!1,tag:1112},res:{ttl:_walletconnect_time__WEBPACK_IMPORTED_MODULE_2__.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:_walletconnect_time__WEBPACK_IMPORTED_MODULE_2__.ONE_DAY,prompt:!1,tag:1114},res:{ttl:_walletconnect_time__WEBPACK_IMPORTED_MODULE_2__.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:_walletconnect_time__WEBPACK_IMPORTED_MODULE_2__.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:_walletconnect_time__WEBPACK_IMPORTED_MODULE_2__.ONE_HOUR,prompt:!1,tag:1117}}},re={min:_walletconnect_time__WEBPACK_IMPORTED_MODULE_2__.FIVE_MINUTES,max:_walletconnect_time__WEBPACK_IMPORTED_MODULE_2__.SEVEN_DAYS},A={idle:\"IDLE\",active:\"ACTIVE\"},Fe=\"request\",je=[\"wc_sessionPropose\",\"wc_sessionRequest\",\"wc_authRequest\"],Qe=\"wc\",zt=1.5,ze=\"auth\",He=\"authKeys\",Ye=\"pairingTopics\",Xe=\"requests\",X=`${Qe}@${1.5}:${ze}:`,J=`${X}:PUB_KEY`;var Ht=Object.defineProperty,Yt=Object.defineProperties,Xt=Object.getOwnPropertyDescriptors,Je=Object.getOwnPropertySymbols,Jt=Object.prototype.hasOwnProperty,Bt=Object.prototype.propertyIsEnumerable,Be=(S,n,t)=>n in S?Ht(S,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):S[n]=t,m=(S,n)=>{for(var t in n||(n={}))Jt.call(n,t)&&Be(S,t,n[t]);if(Je)for(var t of Je(n))Bt.call(n,t)&&Be(S,t,n[t]);return S},F=(S,n)=>Yt(S,Xt(n));class Wt extends _walletconnect_types__WEBPACK_IMPORTED_MODULE_4__.IEngine{constructor(n){super(n),this.name=ke,this.events=new (events__WEBPACK_IMPORTED_MODULE_1___default()),this.initialized=!1,this.requestQueue={state:A.idle,queue:[]},this.sessionRequestQueue={state:A.idle,queue:[]},this.requestQueueDelay=_walletconnect_time__WEBPACK_IMPORTED_MODULE_2__.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),this.client.core.pairing.register({methods:Object.keys(q)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},(0,_walletconnect_time__WEBPACK_IMPORTED_MODULE_2__.toMiliseconds)(this.requestQueueDelay)))},this.connect=async t=>{await this.isInitialized();const e=F(m({},t),{requiredNamespaces:t.requiredNamespaces||{},optionalNamespaces:t.optionalNamespaces||{}});await this.isValidConnect(e);const{pairingTopic:s,requiredNamespaces:i,optionalNamespaces:r,sessionProperties:o,relays:a}=e;let c=s,d,p=!1;try{c&&(p=this.client.core.pairing.pairings.get(c).active)}catch(f){throw this.client.logger.error(`connect() -> pairing.get(${c}) failed`),f}if(!c||!p){const{topic:f,uri:v}=await this.client.core.pairing.create();c=f,d=v}if(!c){const{message:f}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"NO_MATCHING_KEY\",`connect() pairing topic: ${c}`);throw new Error(f)}const g=await this.client.core.crypto.generateKeyPair(),h=q.wc_sessionPropose.req.ttl||_walletconnect_time__WEBPACK_IMPORTED_MODULE_2__.FIVE_MINUTES,y=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.calcExpiry)(h),w=m({requiredNamespaces:i,optionalNamespaces:r,relays:a??[{protocol:_walletconnect_core__WEBPACK_IMPORTED_MODULE_6__.RELAYER_DEFAULT_PROTOCOL}],proposer:{publicKey:g,metadata:this.client.metadata},expiryTimestamp:y},o&&{sessionProperties:o}),{reject:I,resolve:D,done:E}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.createDelayedPromise)(h,Ue);this.events.once((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_connect\"),async({error:f,session:v})=>{if(f)I(f);else if(v){v.self.publicKey=g;const j=F(m({},v),{requiredNamespaces:w.requiredNamespaces,optionalNamespaces:w.optionalNamespaces});await this.client.session.set(v.topic,j),await this.setExpiry(v.topic,v.expiry),c&&await this.client.core.pairing.updateMetadata({topic:c,metadata:v.peer.metadata}),D(j)}});const P=await this.sendRequest({topic:c,method:\"wc_sessionPropose\",params:w,throwOnFailedPublish:!0});return await this.setProposal(P,m({id:P},w)),{uri:d,approval:E}},this.pair=async t=>{await this.isInitialized();try{return await this.client.core.pairing.pair(t)}catch(e){throw this.client.logger.error(\"pair() failed\"),e}},this.approve=async t=>{await this.isInitialized();try{await this.isValidApprove(t)}catch(E){throw this.client.logger.error(\"approve() -> isValidApprove() failed\"),E}const{id:e,relayProtocol:s,namespaces:i,sessionProperties:r,sessionConfig:o}=t;let a;try{a=this.client.proposal.get(e)}catch(E){throw this.client.logger.error(`approve() -> proposal.get(${e}) failed`),E}let{pairingTopic:c,proposer:d,requiredNamespaces:p,optionalNamespaces:g}=a;c=c||\"\";const h=await this.client.core.crypto.generateKeyPair(),y=d.publicKey,w=await this.client.core.crypto.generateSharedKey(h,y),I=m(m({relay:{protocol:s??\"irn\"},namespaces:i,pairingTopic:c,controller:{publicKey:h,metadata:this.client.metadata},expiry:(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.calcExpiry)(L)},r&&{sessionProperties:r}),o&&{sessionConfig:o});await this.client.core.relayer.subscribe(w);const D=F(m({},I),{topic:w,requiredNamespaces:p,optionalNamespaces:g,pairingTopic:c,acknowledged:!1,self:I.controller,peer:{publicKey:d.publicKey,metadata:d.metadata},controller:h});await this.client.session.set(w,D);try{await this.sendResult({id:e,topic:c,result:{relay:{protocol:s??\"irn\"},responderPublicKey:h},throwOnFailedPublish:!0}),await this.sendRequest({topic:w,method:\"wc_sessionSettle\",params:I,throwOnFailedPublish:!0})}catch(E){throw this.client.logger.error(E),this.client.session.delete(w,(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getSdkError)(\"USER_DISCONNECTED\")),await this.client.core.relayer.unsubscribe(w),E}return await this.client.core.pairing.updateMetadata({topic:c,metadata:d.metadata}),await this.client.proposal.delete(e,(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getSdkError)(\"USER_DISCONNECTED\")),await this.client.core.pairing.activate({topic:c}),await this.setExpiry(w,(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.calcExpiry)(L)),{topic:w,acknowledged:()=>new Promise(E=>setTimeout(()=>E(this.client.session.get(w)),500))}},this.reject=async t=>{await this.isInitialized();try{await this.isValidReject(t)}catch(r){throw this.client.logger.error(\"reject() -> isValidReject() failed\"),r}const{id:e,reason:s}=t;let i;try{i=this.client.proposal.get(e).pairingTopic}catch(r){throw this.client.logger.error(`reject() -> proposal.get(${e}) failed`),r}i&&(await this.sendError({id:e,topic:i,error:s}),await this.client.proposal.delete(e,(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getSdkError)(\"USER_DISCONNECTED\")))},this.update=async t=>{await this.isInitialized();try{await this.isValidUpdate(t)}catch(p){throw this.client.logger.error(\"update() -> isValidUpdate() failed\"),p}const{topic:e,namespaces:s}=t,{done:i,resolve:r,reject:o}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.createDelayedPromise)(),a=(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.payloadId)(),c=(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.getBigIntRpcId)().toString(),d=this.client.session.get(e).namespaces;return this.events.once((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_update\",a),({error:p})=>{p?o(p):r()}),await this.client.session.update(e,{namespaces:s}),this.sendRequest({topic:e,method:\"wc_sessionUpdate\",params:{namespaces:s},throwOnFailedPublish:!0,clientRpcId:a,relayRpcId:c}).catch(p=>{this.client.logger.error(p),this.client.session.update(e,{namespaces:d}),o(p)}),{acknowledged:i}},this.extend=async t=>{await this.isInitialized();try{await this.isValidExtend(t)}catch(a){throw this.client.logger.error(\"extend() -> isValidExtend() failed\"),a}const{topic:e}=t,s=(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.payloadId)(),{done:i,resolve:r,reject:o}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.createDelayedPromise)();return this.events.once((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_extend\",s),({error:a})=>{a?o(a):r()}),await this.setExpiry(e,(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.calcExpiry)(L)),this.sendRequest({topic:e,method:\"wc_sessionExtend\",params:{},clientRpcId:s,throwOnFailedPublish:!0}).catch(a=>{o(a)}),{acknowledged:i}},this.request=async t=>{await this.isInitialized();try{await this.isValidRequest(t)}catch(h){throw this.client.logger.error(\"request() -> isValidRequest() failed\"),h}const{chainId:e,request:s,topic:i,expiry:r=q.wc_sessionRequest.req.ttl}=t,o=this.client.session.get(i),a=(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.payloadId)(),c=(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.getBigIntRpcId)().toString(),{done:d,resolve:p,reject:g}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.createDelayedPromise)(r,\"Request expired. Please try again.\");return this.events.once((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_request\",a),({error:h,result:y})=>{h?g(h):p(y)}),await Promise.all([new Promise(async h=>{await this.sendRequest({clientRpcId:a,relayRpcId:c,topic:i,method:\"wc_sessionRequest\",params:{request:F(m({},s),{expiryTimestamp:(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.calcExpiry)(r)}),chainId:e},expiry:r,throwOnFailedPublish:!0}).catch(y=>g(y)),this.client.events.emit(\"session_request_sent\",{topic:i,request:s,chainId:e,id:a}),h()}),new Promise(async h=>{var y;if(!((y=o.sessionConfig)!=null&&y.disableDeepLink)){const w=await (0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getDeepLink)(this.client.core.storage,Re);(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.handleDeeplinkRedirect)({id:a,topic:i,wcDeepLink:w})}h()}),d()]).then(h=>h[2])},this.respond=async t=>{await this.isInitialized(),await this.isValidRespond(t);const{topic:e,response:s}=t,{id:i}=s;(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.isJsonRpcResult)(s)?await this.sendResult({id:i,topic:e,result:s.result,throwOnFailedPublish:!0}):(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.isJsonRpcError)(s)&&await this.sendError({id:i,topic:e,error:s.error}),this.cleanupAfterResponse(t)},this.ping=async t=>{await this.isInitialized();try{await this.isValidPing(t)}catch(s){throw this.client.logger.error(\"ping() -> isValidPing() failed\"),s}const{topic:e}=t;if(this.client.session.keys.includes(e)){const s=(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.payloadId)(),i=(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.getBigIntRpcId)().toString(),{done:r,resolve:o,reject:a}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.createDelayedPromise)();this.events.once((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_ping\",s),({error:c})=>{c?a(c):o()}),await Promise.all([this.sendRequest({topic:e,method:\"wc_sessionPing\",params:{},throwOnFailedPublish:!0,clientRpcId:s,relayRpcId:i}),r()])}else this.client.core.pairing.pairings.keys.includes(e)&&await this.client.core.pairing.ping({topic:e})},this.emit=async t=>{await this.isInitialized(),await this.isValidEmit(t);const{topic:e,event:s,chainId:i}=t,r=(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.getBigIntRpcId)().toString();await this.sendRequest({topic:e,method:\"wc_sessionEvent\",params:{event:s,chainId:i},throwOnFailedPublish:!0,relayRpcId:r})},this.disconnect=async t=>{await this.isInitialized(),await this.isValidDisconnect(t);const{topic:e}=t;if(this.client.session.keys.includes(e))await this.sendRequest({topic:e,method:\"wc_sessionDelete\",params:(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getSdkError)(\"USER_DISCONNECTED\"),throwOnFailedPublish:!0}),await this.deleteSession({topic:e,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(e))await this.client.core.pairing.disconnect({topic:e});else{const{message:s}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISMATCHED_TOPIC\",`Session or pairing topic not found: ${e}`);throw new Error(s)}},this.find=t=>(this.isInitialized(),this.client.session.getAll().filter(e=>(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isSessionCompatible)(e,t))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async t=>{this.isInitialized(),this.isValidAuthenticate(t);const{chains:e,statement:s=\"\",uri:i,domain:r,nonce:o,type:a,exp:c,nbf:d,methods:p=[]}=t,g=[...t.resources||[]],{topic:h,uri:y}=await this.client.core.pairing.create({methods:[\"wc_sessionAuthenticate\"]});this.client.logger.info({message:\"Generated new pairing\",pairing:{topic:h,uri:y}});const w=await this.client.core.crypto.generateKeyPair(),I=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.hashKey)(w);if(await Promise.all([this.client.auth.authKeys.set(J,{responseTopic:I,publicKey:w}),this.client.auth.pairingTopics.set(I,{topic:I,pairingTopic:h})]),await this.client.core.relayer.subscribe(I),this.client.logger.info(`sending request to new pairing topic: ${h}`),p.length>0){const{namespace:O}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.parseChainId)(e[0]);let _=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.createEncodedRecap)(O,\"request\",p);(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getRecapFromResources)(g)&&(_=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.mergeEncodedRecaps)(_,g.pop())),g.push(_)}const D=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.calcExpiry)(q.wc_sessionPropose.req.ttl),E={authPayload:{type:a??\"caip122\",chains:e,statement:s,aud:i,domain:r,version:\"1\",nonce:o,iat:new Date().toISOString(),exp:c,nbf:d,resources:g},requester:{publicKey:w,metadata:this.client.metadata},expiryTimestamp:D},P={eip155:{chains:e,methods:[...new Set([\"personal_sign\",...p])],events:[\"chainChanged\",\"accountsChanged\"]}},f={requiredNamespaces:{},optionalNamespaces:P,relays:[{protocol:\"irn\"}],proposer:{publicKey:w,metadata:this.client.metadata},expiryTimestamp:D},{done:v,resolve:j,reject:oe}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.createDelayedPromise)(q.wc_sessionAuthenticate.req.ttl,\"Request expired\"),B=async({error:O,session:_})=>{if(this.events.off((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_request\",M),ae),O)oe(O);else if(_){_.self.publicKey=w,await this.client.session.set(_.topic,_),await this.setExpiry(_.topic,_.expiry),h&&await this.client.core.pairing.updateMetadata({topic:h,metadata:_.peer.metadata});const Q=this.client.session.get(_.topic);j({session:Q})}},ae=async O=>{if(O.error){const z=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getSdkError)(\"WC_METHOD_UNSUPPORTED\",\"wc_sessionAuthenticate\");return O.error.code===z.code?void 0:(this.events.off((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_connect\"),B),oe(O.error.message))}this.events.off((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_connect\"),B);const{cacaos:_,responder:Q}=O.result,le=[],Ie=[];for(const z of _){await (0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.validateSignedCacao)({cacao:z,projectId:this.client.core.projectId})||(this.client.logger.error(z,\"Signature verification failed\"),oe((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getSdkError)(\"SESSION_SETTLEMENT_FAILED\",\"Signature verification failed\")));const{p:he}=z,pe=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getRecapFromResources)(he.resources),fe=[(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getNamespacedDidChainId)(he.iss)],Ze=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getDidAddress)(he.iss);if(pe){const de=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getMethodsFromRecap)(pe),et=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getChainsFromRecap)(pe);le.push(...de),fe.push(...et)}for(const de of fe)Ie.push(`${de}:${Ze}`)}const W=await this.client.core.crypto.generateSharedKey(w,Q.publicKey);let Z;le.length>0&&(Z={topic:W,acknowledged:!0,self:{publicKey:w,metadata:this.client.metadata},peer:Q,controller:Q.publicKey,expiry:(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.calcExpiry)(L),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:\"irn\"},pairingTopic:h,namespaces:(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.buildNamespacesFromAuth)([...new Set(le)],[...new Set(Ie)])},await this.client.core.relayer.subscribe(W),await this.client.session.set(W,Z),Z=this.client.session.get(W)),j({auths:_,session:Z})},M=(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.payloadId)(),ce=(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.payloadId)();this.events.once((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_connect\"),B),this.events.once((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_request\",M),ae);try{await Promise.all([this.sendRequest({topic:h,method:\"wc_sessionAuthenticate\",params:E,expiry:t.expiry,throwOnFailedPublish:!0,clientRpcId:M}),this.sendRequest({topic:h,method:\"wc_sessionPropose\",params:f,expiry:q.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:ce})])}catch(O){throw this.events.off((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_connect\"),B),this.events.off((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_request\",M),ae),O}return await this.setProposal(ce,m({id:ce},f)),await this.client.auth.requests.set(M,{authPayload:E.authPayload,requester:E.requester,expiryTimestamp:D,id:M,pairingTopic:h,verifyContext:{}}),{uri:y,response:v}},this.approveSessionAuthenticate=async t=>{this.isInitialized();const{id:e,auths:s}=t,i=this.getPendingAuthRequest(e);if(!i)throw new Error(`Could not find pending auth request with id ${e}`);const r=i.requester.publicKey,o=await this.client.core.crypto.generateKeyPair(),a=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.hashKey)(r),c={type:_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.TYPE_1,receiverPublicKey:r,senderPublicKey:o},d=[],p=[];for(const y of s){if(!await (0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.validateSignedCacao)({cacao:y,projectId:this.client.core.projectId})){const P=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getSdkError)(\"SESSION_SETTLEMENT_FAILED\",\"Signature verification failed\");throw await this.sendError({id:e,topic:a,error:P,encodeOpts:c}),new Error(P.message)}const{p:w}=y,I=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getRecapFromResources)(w.resources),D=[(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getNamespacedDidChainId)(w.iss)],E=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getDidAddress)(w.iss);if(I){const P=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getMethodsFromRecap)(I),f=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getChainsFromRecap)(I);d.push(...P),D.push(...f)}for(const P of D)p.push(`${P}:${E}`)}const g=await this.client.core.crypto.generateSharedKey(o,r);let h;return d?.length>0&&(h={topic:g,acknowledged:!0,self:{publicKey:o,metadata:this.client.metadata},peer:{publicKey:r,metadata:i.requester.metadata},controller:r,expiry:(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.calcExpiry)(L),authentication:s,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:\"irn\"},pairingTopic:\"\",namespaces:(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.buildNamespacesFromAuth)([...new Set(d)],[...new Set(p)])},await this.client.core.relayer.subscribe(g),await this.client.session.set(g,h)),await this.sendResult({topic:a,id:e,result:{cacaos:s,responder:{publicKey:o,metadata:this.client.metadata}},encodeOpts:c,throwOnFailedPublish:!0}),await this.client.auth.requests.delete(e,{message:\"fullfilled\",code:0}),await this.client.core.pairing.activate({topic:i.pairingTopic}),{session:h}},this.rejectSessionAuthenticate=async t=>{await this.isInitialized();const{id:e,reason:s}=t,i=this.getPendingAuthRequest(e);if(!i)throw new Error(`Could not find pending auth request with id ${e}`);const r=i.requester.publicKey,o=await this.client.core.crypto.generateKeyPair(),a=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.hashKey)(r),c={type:_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.TYPE_1,receiverPublicKey:r,senderPublicKey:o};await this.sendError({id:e,topic:a,error:s,encodeOpts:c}),await this.client.auth.requests.delete(e,{message:\"rejected\",code:0}),await this.client.proposal.delete(e,(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getSdkError)(\"USER_DISCONNECTED\"))},this.formatAuthMessage=t=>{this.isInitialized();const{request:e,iss:s}=t;return (0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.formatMessage)(e,s)},this.cleanupDuplicatePairings=async t=>{if(t.pairingTopic)try{const e=this.client.core.pairing.pairings.get(t.pairingTopic),s=this.client.core.pairing.pairings.getAll().filter(i=>{var r,o;return((r=i.peerMetadata)==null?void 0:r.url)&&((o=i.peerMetadata)==null?void 0:o.url)===t.peer.metadata.url&&i.topic&&i.topic!==e.topic});if(s.length===0)return;this.client.logger.info(`Cleaning up ${s.length} duplicate pairing(s)`),await Promise.all(s.map(i=>this.client.core.pairing.disconnect({topic:i.topic}))),this.client.logger.info(\"Duplicate pairings clean up finished\")}catch(e){this.client.logger.error(e)}},this.deleteSession=async t=>{const{topic:e,expirerHasDeleted:s=!1,emitEvent:i=!0,id:r=0}=t,{self:o}=this.client.session.get(e);await this.client.core.relayer.unsubscribe(e),await this.client.session.delete(e,(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getSdkError)(\"USER_DISCONNECTED\")),this.addToRecentlyDeleted(e,\"session\"),this.client.core.crypto.keychain.has(o.publicKey)&&await this.client.core.crypto.deleteKeyPair(o.publicKey),this.client.core.crypto.keychain.has(e)&&await this.client.core.crypto.deleteSymKey(e),s||this.client.core.expirer.del(e),this.client.core.storage.removeItem(Re).catch(a=>this.client.logger.warn(a)),this.getPendingSessionRequests().forEach(a=>{a.topic===e&&this.deletePendingSessionRequest(a.id,(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getSdkError)(\"USER_DISCONNECTED\"))}),i&&this.client.events.emit(\"session_delete\",{id:r,topic:e})},this.deleteProposal=async(t,e)=>{await Promise.all([this.client.proposal.delete(t,(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getSdkError)(\"USER_DISCONNECTED\")),e?Promise.resolve():this.client.core.expirer.del(t)]),this.addToRecentlyDeleted(t,\"proposal\")},this.deletePendingSessionRequest=async(t,e,s=!1)=>{await Promise.all([this.client.pendingRequest.delete(t,e),s?Promise.resolve():this.client.core.expirer.del(t)]),this.addToRecentlyDeleted(t,\"request\"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(i=>i.id!==t),s&&(this.sessionRequestQueue.state=A.idle,this.client.events.emit(\"session_request_expire\",{id:t}))},this.setExpiry=async(t,e)=>{this.client.session.keys.includes(t)&&await this.client.session.update(t,{expiry:e}),this.client.core.expirer.set(t,e)},this.setProposal=async(t,e)=>{await this.client.proposal.set(t,e),this.client.core.expirer.set(t,(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.calcExpiry)(q.wc_sessionPropose.req.ttl))},this.setPendingSessionRequest=async t=>{const{id:e,topic:s,params:i,verifyContext:r}=t,o=i.request.expiryTimestamp||(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.calcExpiry)(q.wc_sessionRequest.req.ttl);await this.client.pendingRequest.set(e,{id:e,topic:s,params:i,verifyContext:r}),o&&this.client.core.expirer.set(e,o)},this.sendRequest=async t=>{const{topic:e,method:s,params:i,expiry:r,relayRpcId:o,clientRpcId:a,throwOnFailedPublish:c}=t,d=(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.formatJsonRpcRequest)(s,i,a);if((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isBrowser)()&&je.includes(s)){const h=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.hashMessage)(JSON.stringify(d));this.client.core.verify.register({attestationId:h})}let p;try{p=await this.client.core.crypto.encode(e,d)}catch(h){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${e} failed`),h}const g=q[s].req;return r&&(g.ttl=r),o&&(g.id=o),this.client.core.history.set(e,d),c?(g.internal=F(m({},g.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(e,p,g)):this.client.core.relayer.publish(e,p,g).catch(h=>this.client.logger.error(h)),d.id},this.sendResult=async t=>{const{id:e,topic:s,result:i,throwOnFailedPublish:r,encodeOpts:o}=t,a=(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.formatJsonRpcResult)(e,i);let c;try{c=await this.client.core.crypto.encode(s,a,o)}catch(g){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${s} failed`),g}let d;try{d=await this.client.core.history.get(s,e)}catch(g){throw this.client.logger.error(`sendResult() -> history.get(${s}, ${e}) failed`),g}const p=q[d.request.method].res;r?(p.internal=F(m({},p.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(s,c,p)):this.client.core.relayer.publish(s,c,p).catch(g=>this.client.logger.error(g)),await this.client.core.history.resolve(a)},this.sendError=async t=>{const{id:e,topic:s,error:i,encodeOpts:r}=t,o=(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.formatJsonRpcError)(e,i);let a;try{a=await this.client.core.crypto.encode(s,o,r)}catch(p){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${s} failed`),p}let c;try{c=await this.client.core.history.get(s,e)}catch(p){throw this.client.logger.error(`sendError() -> history.get(${s}, ${e}) failed`),p}const d=q[c.request.method].res;this.client.core.relayer.publish(s,a,d),await this.client.core.history.resolve(o)},this.cleanup=async()=>{const t=[],e=[];this.client.session.getAll().forEach(s=>{let i=!1;(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isExpired)(s.expiry)&&(i=!0),this.client.core.crypto.keychain.has(s.topic)||(i=!0),i&&t.push(s.topic)}),this.client.proposal.getAll().forEach(s=>{(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isExpired)(s.expiryTimestamp)&&e.push(s.id)}),await Promise.all([...t.map(s=>this.deleteSession({topic:s})),...e.map(s=>this.deleteProposal(s))])},this.onRelayEventRequest=async t=>{this.requestQueue.queue.push(t),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===A.active){this.client.logger.info(\"Request queue already active, skipping...\");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=A.active;const t=this.requestQueue.queue.shift();if(t)try{this.processRequest(t),await new Promise(e=>setTimeout(e,300))}catch(e){this.client.logger.warn(e)}}this.requestQueue.state=A.idle},this.processRequest=t=>{const{topic:e,payload:s}=t,i=s.method;if(!this.shouldIgnorePairingRequest({topic:e,requestMethod:i}))switch(i){case\"wc_sessionPropose\":return this.onSessionProposeRequest(e,s);case\"wc_sessionSettle\":return this.onSessionSettleRequest(e,s);case\"wc_sessionUpdate\":return this.onSessionUpdateRequest(e,s);case\"wc_sessionExtend\":return this.onSessionExtendRequest(e,s);case\"wc_sessionPing\":return this.onSessionPingRequest(e,s);case\"wc_sessionDelete\":return this.onSessionDeleteRequest(e,s);case\"wc_sessionRequest\":return this.onSessionRequest(e,s);case\"wc_sessionEvent\":return this.onSessionEventRequest(e,s);case\"wc_sessionAuthenticate\":return this.onSessionAuthenticateRequest(e,s);default:return this.client.logger.info(`Unsupported request method ${i}`)}},this.onRelayEventResponse=async t=>{const{topic:e,payload:s}=t,i=(await this.client.core.history.get(e,s.id)).request.method;switch(i){case\"wc_sessionPropose\":return this.onSessionProposeResponse(e,s);case\"wc_sessionSettle\":return this.onSessionSettleResponse(e,s);case\"wc_sessionUpdate\":return this.onSessionUpdateResponse(e,s);case\"wc_sessionExtend\":return this.onSessionExtendResponse(e,s);case\"wc_sessionPing\":return this.onSessionPingResponse(e,s);case\"wc_sessionRequest\":return this.onSessionRequestResponse(e,s);case\"wc_sessionAuthenticate\":return this.onSessionAuthenticateResponse(e,s);default:return this.client.logger.info(`Unsupported response method ${i}`)}},this.onRelayEventUnknownPayload=t=>{const{topic:e}=t,{message:s}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",`Decoded payload on topic ${e} is not identifiable as a JSON-RPC request or a response.`);throw new Error(s)},this.shouldIgnorePairingRequest=t=>{const{topic:e,requestMethod:s}=t,i=this.expectedPairingMethodMap.get(e);return!i||i.includes(s)?!1:!!(i.includes(\"wc_sessionAuthenticate\")&&this.client.events.listenerCount(\"session_authenticate\")>0)},this.onSessionProposeRequest=async(t,e)=>{const{params:s,id:i}=e;try{this.isValidConnect(m({},e.params));const r=s.expiryTimestamp||(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.calcExpiry)(q.wc_sessionPropose.req.ttl),o=m({id:i,pairingTopic:t,expiryTimestamp:r},s);await this.setProposal(i,o);const a=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.hashMessage)(JSON.stringify(e)),c=await this.getVerifyContext(a,o.proposer.metadata);this.client.events.emit(\"session_proposal\",{id:i,params:o,verifyContext:c})}catch(r){await this.sendError({id:i,topic:t,error:r}),this.client.logger.error(r)}},this.onSessionProposeResponse=async(t,e)=>{const{id:s}=e;if((0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.isJsonRpcResult)(e)){const{result:i}=e;this.client.logger.trace({type:\"method\",method:\"onSessionProposeResponse\",result:i});const r=this.client.proposal.get(s);this.client.logger.trace({type:\"method\",method:\"onSessionProposeResponse\",proposal:r});const o=r.proposer.publicKey;this.client.logger.trace({type:\"method\",method:\"onSessionProposeResponse\",selfPublicKey:o});const a=i.responderPublicKey;this.client.logger.trace({type:\"method\",method:\"onSessionProposeResponse\",peerPublicKey:a});const c=await this.client.core.crypto.generateSharedKey(o,a);this.client.logger.trace({type:\"method\",method:\"onSessionProposeResponse\",sessionTopic:c});const d=await this.client.core.relayer.subscribe(c);this.client.logger.trace({type:\"method\",method:\"onSessionProposeResponse\",subscriptionId:d}),await this.client.core.pairing.activate({topic:t})}else if((0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.isJsonRpcError)(e)){await this.client.proposal.delete(s,(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getSdkError)(\"USER_DISCONNECTED\"));const i=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_connect\");if(this.events.listenerCount(i)===0)throw new Error(`emitting ${i} without any listeners, 954`);this.events.emit((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_connect\"),{error:e.error})}},this.onSessionSettleRequest=async(t,e)=>{const{id:s,params:i}=e;try{this.isValidSessionSettleRequest(i);const{relay:r,controller:o,expiry:a,namespaces:c,sessionProperties:d,pairingTopic:p,sessionConfig:g}=e.params,h=m(m({topic:t,relay:r,expiry:a,namespaces:c,acknowledged:!0,pairingTopic:p,requiredNamespaces:{},optionalNamespaces:{},controller:o.publicKey,self:{publicKey:\"\",metadata:this.client.metadata},peer:{publicKey:o.publicKey,metadata:o.metadata}},d&&{sessionProperties:d}),g&&{sessionConfig:g});await this.sendResult({id:e.id,topic:t,result:!0,throwOnFailedPublish:!0});const y=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_connect\");if(this.events.listenerCount(y)===0)throw new Error(`emitting ${y} without any listeners 997`);this.events.emit((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_connect\"),{session:h}),this.cleanupDuplicatePairings(h)}catch(r){await this.sendError({id:s,topic:t,error:r}),this.client.logger.error(r)}},this.onSessionSettleResponse=async(t,e)=>{const{id:s}=e;(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.isJsonRpcResult)(e)?(await this.client.session.update(t,{acknowledged:!0}),this.events.emit((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_approve\",s),{})):(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.isJsonRpcError)(e)&&(await this.client.session.delete(t,(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getSdkError)(\"USER_DISCONNECTED\")),this.events.emit((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_approve\",s),{error:e.error}))},this.onSessionUpdateRequest=async(t,e)=>{const{params:s,id:i}=e;try{const r=`${t}_session_update`,o=_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.MemoryStore.get(r);if(o&&this.isRequestOutOfSync(o,i)){this.client.logger.info(`Discarding out of sync request - ${i}`),this.sendError({id:i,topic:t,error:(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getSdkError)(\"INVALID_UPDATE_REQUEST\")});return}this.isValidUpdate(m({topic:t},s));try{_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.MemoryStore.set(r,i),await this.client.session.update(t,{namespaces:s.namespaces}),await this.sendResult({id:i,topic:t,result:!0,throwOnFailedPublish:!0})}catch(a){throw _walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.MemoryStore.delete(r),a}this.client.events.emit(\"session_update\",{id:i,topic:t,params:s})}catch(r){await this.sendError({id:i,topic:t,error:r}),this.client.logger.error(r)}},this.isRequestOutOfSync=(t,e)=>parseInt(e.toString().slice(0,-3))<=parseInt(t.toString().slice(0,-3)),this.onSessionUpdateResponse=(t,e)=>{const{id:s}=e,i=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_update\",s);if(this.events.listenerCount(i)===0)throw new Error(`emitting ${i} without any listeners`);(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.isJsonRpcResult)(e)?this.events.emit((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_update\",s),{}):(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.isJsonRpcError)(e)&&this.events.emit((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_update\",s),{error:e.error})},this.onSessionExtendRequest=async(t,e)=>{const{id:s}=e;try{this.isValidExtend({topic:t}),await this.setExpiry(t,(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.calcExpiry)(L)),await this.sendResult({id:s,topic:t,result:!0,throwOnFailedPublish:!0}),this.client.events.emit(\"session_extend\",{id:s,topic:t})}catch(i){await this.sendError({id:s,topic:t,error:i}),this.client.logger.error(i)}},this.onSessionExtendResponse=(t,e)=>{const{id:s}=e,i=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_extend\",s);if(this.events.listenerCount(i)===0)throw new Error(`emitting ${i} without any listeners`);(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.isJsonRpcResult)(e)?this.events.emit((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_extend\",s),{}):(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.isJsonRpcError)(e)&&this.events.emit((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_extend\",s),{error:e.error})},this.onSessionPingRequest=async(t,e)=>{const{id:s}=e;try{this.isValidPing({topic:t}),await this.sendResult({id:s,topic:t,result:!0,throwOnFailedPublish:!0}),this.client.events.emit(\"session_ping\",{id:s,topic:t})}catch(i){await this.sendError({id:s,topic:t,error:i}),this.client.logger.error(i)}},this.onSessionPingResponse=(t,e)=>{const{id:s}=e,i=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_ping\",s);if(this.events.listenerCount(i)===0)throw new Error(`emitting ${i} without any listeners`);setTimeout(()=>{(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.isJsonRpcResult)(e)?this.events.emit((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_ping\",s),{}):(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.isJsonRpcError)(e)&&this.events.emit((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_ping\",s),{error:e.error})},500)},this.onSessionDeleteRequest=async(t,e)=>{const{id:s}=e;try{this.isValidDisconnect({topic:t,reason:e.params}),await Promise.all([new Promise(i=>{this.client.core.relayer.once(_walletconnect_core__WEBPACK_IMPORTED_MODULE_6__.RELAYER_EVENTS.publish,async()=>{i(await this.deleteSession({topic:t,id:s}))})}),this.sendResult({id:s,topic:t,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:t,error:(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getSdkError)(\"USER_DISCONNECTED\")})])}catch(i){this.client.logger.error(i)}},this.onSessionRequest=async(t,e)=>{const{id:s,params:i}=e;try{await this.isValidRequest(m({topic:t},i));const r=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.hashMessage)(JSON.stringify((0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.formatJsonRpcRequest)(\"wc_sessionRequest\",i,s))),o=this.client.session.get(t),a=await this.getVerifyContext(r,o.peer.metadata),c={id:s,topic:t,params:i,verifyContext:a};await this.setPendingSessionRequest(c),this.addSessionRequestToSessionRequestQueue(c),this.processSessionRequestQueue()}catch(r){await this.sendError({id:s,topic:t,error:r}),this.client.logger.error(r)}},this.onSessionRequestResponse=(t,e)=>{const{id:s}=e,i=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_request\",s);if(this.events.listenerCount(i)===0)throw new Error(`emitting ${i} without any listeners`);(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.isJsonRpcResult)(e)?this.events.emit((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_request\",s),{result:e.result}):(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.isJsonRpcError)(e)&&this.events.emit((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_request\",s),{error:e.error})},this.onSessionEventRequest=async(t,e)=>{const{id:s,params:i}=e;try{const r=`${t}_session_event_${i.event.name}`,o=_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.MemoryStore.get(r);if(o&&this.isRequestOutOfSync(o,s)){this.client.logger.info(`Discarding out of sync request - ${s}`);return}this.isValidEmit(m({topic:t},i)),this.client.events.emit(\"session_event\",{id:s,topic:t,params:i}),_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.MemoryStore.set(r,s)}catch(r){await this.sendError({id:s,topic:t,error:r}),this.client.logger.error(r)}},this.onSessionAuthenticateResponse=(t,e)=>{const{id:s}=e;this.client.logger.trace({type:\"method\",method:\"onSessionAuthenticateResponse\",topic:t,payload:e}),(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.isJsonRpcResult)(e)?this.events.emit((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_request\",s),{result:e.result}):(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.isJsonRpcError)(e)&&this.events.emit((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_request\",s),{error:e.error})},this.onSessionAuthenticateRequest=async(t,e)=>{const{requester:s,authPayload:i,expiryTimestamp:r}=e.params,o=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.hashMessage)(JSON.stringify(e)),a=await this.getVerifyContext(o,this.client.metadata),c={requester:s,pairingTopic:t,id:e.id,authPayload:i,verifyContext:a,expiryTimestamp:r};await this.client.auth.requests.set(e.id,c),this.client.events.emit(\"session_authenticate\",{topic:t,params:e.params,id:e.id})},this.addSessionRequestToSessionRequestQueue=t=>{this.sessionRequestQueue.queue.push(t)},this.cleanupAfterResponse=t=>{this.deletePendingSessionRequest(t.response.id,{message:\"fulfilled\",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=A.idle,this.processSessionRequestQueue()},(0,_walletconnect_time__WEBPACK_IMPORTED_MODULE_2__.toMiliseconds)(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:t,error:e})=>{const s=this.client.core.history.pending;s.length>0&&s.filter(i=>i.topic===t&&i.request.method===\"wc_sessionRequest\").forEach(i=>{const r=i.request.id,o=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_request\",r);if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners`);this.events.emit((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.engineEvent)(\"session_request\",i.request.id),{error:e})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===A.active){this.client.logger.info(\"session request queue is already active.\");return}const t=this.sessionRequestQueue.queue[0];if(!t){this.client.logger.info(\"session request queue is empty.\");return}try{this.sessionRequestQueue.state=A.active,this.client.events.emit(\"session_request\",t)}catch(e){this.client.logger.error(e)}},this.onPairingCreated=t=>{if(t.methods&&this.expectedPairingMethodMap.set(t.topic,t.methods),t.active)return;const e=this.client.proposal.getAll().find(s=>s.pairingTopic===t.topic);e&&this.onSessionProposeRequest(t.topic,(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.formatJsonRpcRequest)(\"wc_sessionPropose\",{requiredNamespaces:e.requiredNamespaces,optionalNamespaces:e.optionalNamespaces,relays:e.relays,proposer:e.proposer,sessionProperties:e.sessionProperties},e.id))},this.isValidConnect=async t=>{if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidParams)(t)){const{message:a}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",`connect() params: ${JSON.stringify(t)}`);throw new Error(a)}const{pairingTopic:e,requiredNamespaces:s,optionalNamespaces:i,sessionProperties:r,relays:o}=t;if((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isUndefined)(e)||await this.isValidPairingTopic(e),!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidRelays)(o,!0)){const{message:a}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",`connect() relays: ${o}`);throw new Error(a)}!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isUndefined)(s)&&(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidObject)(s)!==0&&this.validateNamespaces(s,\"requiredNamespaces\"),!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isUndefined)(i)&&(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidObject)(i)!==0&&this.validateNamespaces(i,\"optionalNamespaces\"),(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isUndefined)(r)||this.validateSessionProps(r,\"sessionProperties\")},this.validateNamespaces=(t,e)=>{const s=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidRequiredNamespaces)(t,\"connect()\",e);if(s)throw new Error(s.message)},this.isValidApprove=async t=>{if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidParams)(t))throw new Error((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",`approve() params: ${t}`).message);const{id:e,namespaces:s,relayProtocol:i,sessionProperties:r}=t;this.checkRecentlyDeleted(e),await this.isValidProposalId(e);const o=this.client.proposal.get(e),a=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidNamespaces)(s,\"approve()\");if(a)throw new Error(a.message);const c=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isConformingNamespaces)(o.requiredNamespaces,s,\"approve()\");if(c)throw new Error(c.message);if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidString)(i,!0)){const{message:d}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",`approve() relayProtocol: ${i}`);throw new Error(d)}(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isUndefined)(r)||this.validateSessionProps(r,\"sessionProperties\")},this.isValidReject=async t=>{if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidParams)(t)){const{message:i}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",`reject() params: ${t}`);throw new Error(i)}const{id:e,reason:s}=t;if(this.checkRecentlyDeleted(e),await this.isValidProposalId(e),!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidErrorReason)(s)){const{message:i}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",`reject() reason: ${JSON.stringify(s)}`);throw new Error(i)}},this.isValidSessionSettleRequest=t=>{if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidParams)(t)){const{message:c}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",`onSessionSettleRequest() params: ${t}`);throw new Error(c)}const{relay:e,controller:s,namespaces:i,expiry:r}=t;if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidRelay)(e)){const{message:c}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",\"onSessionSettleRequest() relay protocol should be a string\");throw new Error(c)}const o=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidController)(s,\"onSessionSettleRequest()\");if(o)throw new Error(o.message);const a=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidNamespaces)(i,\"onSessionSettleRequest()\");if(a)throw new Error(a.message);if((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isExpired)(r)){const{message:c}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"EXPIRED\",\"onSessionSettleRequest()\");throw new Error(c)}},this.isValidUpdate=async t=>{if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidParams)(t)){const{message:a}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",`update() params: ${t}`);throw new Error(a)}const{topic:e,namespaces:s}=t;this.checkRecentlyDeleted(e),await this.isValidSessionTopic(e);const i=this.client.session.get(e),r=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidNamespaces)(s,\"update()\");if(r)throw new Error(r.message);const o=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isConformingNamespaces)(i.requiredNamespaces,s,\"update()\");if(o)throw new Error(o.message)},this.isValidExtend=async t=>{if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidParams)(t)){const{message:s}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",`extend() params: ${t}`);throw new Error(s)}const{topic:e}=t;this.checkRecentlyDeleted(e),await this.isValidSessionTopic(e)},this.isValidRequest=async t=>{if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidParams)(t)){const{message:a}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",`request() params: ${t}`);throw new Error(a)}const{topic:e,request:s,chainId:i,expiry:r}=t;this.checkRecentlyDeleted(e),await this.isValidSessionTopic(e);const{namespaces:o}=this.client.session.get(e);if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidNamespacesChainId)(o,i)){const{message:a}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",`request() chainId: ${i}`);throw new Error(a)}if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidRequest)(s)){const{message:a}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",`request() ${JSON.stringify(s)}`);throw new Error(a)}if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidNamespacesRequest)(o,i,s.method)){const{message:a}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",`request() method: ${s.method}`);throw new Error(a)}if(r&&!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidRequestExpiry)(r,re)){const{message:a}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",`request() expiry: ${r}. Expiry must be a number (in seconds) between ${re.min} and ${re.max}`);throw new Error(a)}},this.isValidRespond=async t=>{var e;if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidParams)(t)){const{message:r}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",`respond() params: ${t}`);throw new Error(r)}const{topic:s,response:i}=t;try{await this.isValidSessionTopic(s)}catch(r){throw(e=t?.response)!=null&&e.id&&this.cleanupAfterResponse(t),r}if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidResponse)(i)){const{message:r}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",`respond() response: ${JSON.stringify(i)}`);throw new Error(r)}},this.isValidPing=async t=>{if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidParams)(t)){const{message:s}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",`ping() params: ${t}`);throw new Error(s)}const{topic:e}=t;await this.isValidSessionOrPairingTopic(e)},this.isValidEmit=async t=>{if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidParams)(t)){const{message:o}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",`emit() params: ${t}`);throw new Error(o)}const{topic:e,event:s,chainId:i}=t;await this.isValidSessionTopic(e);const{namespaces:r}=this.client.session.get(e);if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidNamespacesChainId)(r,i)){const{message:o}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",`emit() chainId: ${i}`);throw new Error(o)}if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidEvent)(s)){const{message:o}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",`emit() event: ${JSON.stringify(s)}`);throw new Error(o)}if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidNamespacesEvent)(r,i,s.name)){const{message:o}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",`emit() event: ${JSON.stringify(s)}`);throw new Error(o)}},this.isValidDisconnect=async t=>{if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidParams)(t)){const{message:s}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",`disconnect() params: ${t}`);throw new Error(s)}const{topic:e}=t;await this.isValidSessionOrPairingTopic(e)},this.isValidAuthenticate=t=>{const{chains:e,uri:s,domain:i,nonce:r}=t;if(!Array.isArray(e)||e.length===0)throw new Error(\"chains is required and must be a non-empty array\");if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidString)(s,!1))throw new Error(\"uri is required parameter\");if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidString)(i,!1))throw new Error(\"domain is required parameter\");if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidString)(r,!1))throw new Error(\"nonce is required parameter\");if([...new Set(e.map(a=>(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.parseChainId)(a).namespace))].length>1)throw new Error(\"Multi-namespace requests are not supported. Please request single namespace only.\");const{namespace:o}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.parseChainId)(e[0]);if(o!==\"eip155\")throw new Error(\"Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.\")},this.getVerifyContext=async(t,e)=>{const s={verified:{verifyUrl:e.verifyUrl||_walletconnect_core__WEBPACK_IMPORTED_MODULE_6__.VERIFY_SERVER,validation:\"UNKNOWN\",origin:e.url||\"\"}};try{const i=await this.client.core.verify.resolve({attestationId:t,verifyUrl:e.verifyUrl});i&&(s.verified.origin=i.origin,s.verified.isScam=i.isScam,s.verified.validation=i.origin===new URL(e.url).origin?\"VALID\":\"INVALID\")}catch(i){this.client.logger.info(i)}return this.client.logger.info(`Verify context: ${JSON.stringify(s)}`),s},this.validateSessionProps=(t,e)=>{Object.values(t).forEach(s=>{if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidString)(s,!1)){const{message:i}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",`${e} must be in Record format. Received: ${JSON.stringify(s)}`);throw new Error(i)}})},this.getPendingAuthRequest=t=>{const e=this.client.auth.requests.get(t);return typeof e==\"object\"?e:void 0},this.addToRecentlyDeleted=(t,e)=>{if(this.recentlyDeletedMap.set(t,e),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let s=0;const i=this.recentlyDeletedLimit/2;for(const r of this.recentlyDeletedMap.keys()){if(s++>=i)break;this.recentlyDeletedMap.delete(r)}}},this.checkRecentlyDeleted=t=>{const e=this.recentlyDeletedMap.get(t);if(e){const{message:s}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",`Record was recently deleted - ${e}: ${t}`);throw new Error(s)}}}async isInitialized(){if(!this.initialized){const{message:n}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"NOT_INITIALIZED\",this.name);throw new Error(n)}await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(_walletconnect_core__WEBPACK_IMPORTED_MODULE_6__.RELAYER_EVENTS.message,async n=>{const{topic:t,message:e}=n,{publicKey:s}=this.client.auth.authKeys.keys.includes(J)?this.client.auth.authKeys.get(J):{responseTopic:void 0,publicKey:void 0},i=await this.client.core.crypto.decode(t,e,{receiverPublicKey:s});try{(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.isJsonRpcRequest)(i)?(this.client.core.history.set(t,i),this.onRelayEventRequest({topic:t,payload:i})):(0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_3__.isJsonRpcResponse)(i)?(await this.client.core.history.resolve(i),await this.onRelayEventResponse({topic:t,payload:i}),this.client.core.history.delete(t,i.id)):this.onRelayEventUnknownPayload({topic:t,payload:i})}catch(r){this.client.logger.error(r)}})}registerExpirerEvents(){this.client.core.expirer.on(_walletconnect_core__WEBPACK_IMPORTED_MODULE_6__.EXPIRER_EVENTS.expired,async n=>{const{topic:t,id:e}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.parseExpirerTarget)(n.target);if(e&&this.client.pendingRequest.keys.includes(e))return await this.deletePendingSessionRequest(e,(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"EXPIRED\"),!0);t?this.client.session.keys.includes(t)&&(await this.deleteSession({topic:t,expirerHasDeleted:!0}),this.client.events.emit(\"session_expire\",{topic:t})):e&&(await this.deleteProposal(e,!0),this.client.events.emit(\"proposal_expire\",{id:e}))})}registerPairingEvents(){this.client.core.pairing.events.on(_walletconnect_core__WEBPACK_IMPORTED_MODULE_6__.PAIRING_EVENTS.create,n=>this.onPairingCreated(n)),this.client.core.pairing.events.on(_walletconnect_core__WEBPACK_IMPORTED_MODULE_6__.PAIRING_EVENTS.delete,n=>{this.addToRecentlyDeleted(n.topic,\"pairing\")})}isValidPairingTopic(n){if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidString)(n,!1)){const{message:t}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",`pairing topic should be a string: ${n}`);throw new Error(t)}if(!this.client.core.pairing.pairings.keys.includes(n)){const{message:t}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"NO_MATCHING_KEY\",`pairing topic doesn't exist: ${n}`);throw new Error(t)}if((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isExpired)(this.client.core.pairing.pairings.get(n).expiry)){const{message:t}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"EXPIRED\",`pairing topic: ${n}`);throw new Error(t)}}async isValidSessionTopic(n){if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidString)(n,!1)){const{message:t}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",`session topic should be a string: ${n}`);throw new Error(t)}if(this.checkRecentlyDeleted(n),!this.client.session.keys.includes(n)){const{message:t}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"NO_MATCHING_KEY\",`session topic doesn't exist: ${n}`);throw new Error(t)}if((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isExpired)(this.client.session.get(n).expiry)){await this.deleteSession({topic:n});const{message:t}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"EXPIRED\",`session topic: ${n}`);throw new Error(t)}if(!this.client.core.crypto.keychain.has(n)){const{message:t}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",`session topic does not exist in keychain: ${n}`);throw await this.deleteSession({topic:n}),new Error(t)}}async isValidSessionOrPairingTopic(n){if(this.checkRecentlyDeleted(n),this.client.session.keys.includes(n))await this.isValidSessionTopic(n);else if(this.client.core.pairing.pairings.keys.includes(n))this.isValidPairingTopic(n);else if((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidString)(n,!1)){const{message:t}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"NO_MATCHING_KEY\",`session or pairing topic doesn't exist: ${n}`);throw new Error(t)}else{const{message:t}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",`session or pairing topic should be a string: ${n}`);throw new Error(t)}}async isValidProposalId(n){if(!(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isValidId)(n)){const{message:t}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"MISSING_OR_INVALID\",`proposal id should be a number: ${n}`);throw new Error(t)}if(!this.client.proposal.keys.includes(n)){const{message:t}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"NO_MATCHING_KEY\",`proposal id doesn't exist: ${n}`);throw new Error(t)}if((0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.isExpired)(this.client.proposal.get(n).expiryTimestamp)){await this.deleteProposal(n);const{message:t}=(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getInternalError)(\"EXPIRED\",`proposal id: ${n}`);throw new Error(t)}}}class Zt extends _walletconnect_core__WEBPACK_IMPORTED_MODULE_6__.Store{constructor(n,t){super(n,t,Ke,se),this.core=n,this.logger=t}}class We extends _walletconnect_core__WEBPACK_IMPORTED_MODULE_6__.Store{constructor(n,t){super(n,t,Ge,se),this.core=n,this.logger=t}}class es extends _walletconnect_core__WEBPACK_IMPORTED_MODULE_6__.Store{constructor(n,t){super(n,t,Fe,se,e=>e.id),this.core=n,this.logger=t}}class ts extends _walletconnect_core__WEBPACK_IMPORTED_MODULE_6__.Store{constructor(n,t){super(n,t,He,X,()=>J),this.core=n,this.logger=t}}class ss extends _walletconnect_core__WEBPACK_IMPORTED_MODULE_6__.Store{constructor(n,t){super(n,t,Ye,X),this.core=n,this.logger=t}}class is extends _walletconnect_core__WEBPACK_IMPORTED_MODULE_6__.Store{constructor(n,t){super(n,t,Xe,X,e=>e.id),this.core=n,this.logger=t}}class rs{constructor(n,t){this.core=n,this.logger=t,this.authKeys=new ts(this.core,this.logger),this.pairingTopics=new ss(this.core,this.logger),this.requests=new is(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}class ne extends _walletconnect_types__WEBPACK_IMPORTED_MODULE_4__.ISignClient{constructor(n){super(n),this.protocol=Se,this.version=Ee,this.name=ie.name,this.events=new events__WEBPACK_IMPORTED_MODULE_1__.EventEmitter,this.on=(e,s)=>this.events.on(e,s),this.once=(e,s)=>this.events.once(e,s),this.off=(e,s)=>this.events.off(e,s),this.removeListener=(e,s)=>this.events.removeListener(e,s),this.removeAllListeners=e=>this.events.removeAllListeners(e),this.connect=async e=>{try{return await this.engine.connect(e)}catch(s){throw this.logger.error(s.message),s}},this.pair=async e=>{try{return await this.engine.pair(e)}catch(s){throw this.logger.error(s.message),s}},this.approve=async e=>{try{return await this.engine.approve(e)}catch(s){throw this.logger.error(s.message),s}},this.reject=async e=>{try{return await this.engine.reject(e)}catch(s){throw this.logger.error(s.message),s}},this.update=async e=>{try{return await this.engine.update(e)}catch(s){throw this.logger.error(s.message),s}},this.extend=async e=>{try{return await this.engine.extend(e)}catch(s){throw this.logger.error(s.message),s}},this.request=async e=>{try{return await this.engine.request(e)}catch(s){throw this.logger.error(s.message),s}},this.respond=async e=>{try{return await this.engine.respond(e)}catch(s){throw this.logger.error(s.message),s}},this.ping=async e=>{try{return await this.engine.ping(e)}catch(s){throw this.logger.error(s.message),s}},this.emit=async e=>{try{return await this.engine.emit(e)}catch(s){throw this.logger.error(s.message),s}},this.disconnect=async e=>{try{return await this.engine.disconnect(e)}catch(s){throw this.logger.error(s.message),s}},this.find=e=>{try{return this.engine.find(e)}catch(s){throw this.logger.error(s.message),s}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(e){throw this.logger.error(e.message),e}},this.authenticate=async e=>{try{return await this.engine.authenticate(e)}catch(s){throw this.logger.error(s.message),s}},this.formatAuthMessage=e=>{try{return this.engine.formatAuthMessage(e)}catch(s){throw this.logger.error(s.message),s}},this.approveSessionAuthenticate=async e=>{try{return await this.engine.approveSessionAuthenticate(e)}catch(s){throw this.logger.error(s.message),s}},this.rejectSessionAuthenticate=async e=>{try{return await this.engine.rejectSessionAuthenticate(e)}catch(s){throw this.logger.error(s.message),s}},this.name=n?.name||ie.name,this.metadata=n?.metadata||(0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_5__.getAppMetadata)();const t=typeof n?.logger<\"u\"&&typeof n?.logger!=\"string\"?n.logger:(0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_0__.pino)((0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_0__.getDefaultLoggerOptions)({level:n?.logger||ie.logger}));this.core=n?.core||new _walletconnect_core__WEBPACK_IMPORTED_MODULE_6__.Core(n),this.logger=(0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_0__.generateChildLogger)(t,this.name),this.session=new We(this.core,this.logger),this.proposal=new Zt(this.core,this.logger),this.pendingRequest=new es(this.core,this.logger),this.engine=new Wt(this),this.auth=new rs(this.core,this.logger)}static async init(n){const t=new ne(n);return await t.initialize(),t}get context(){return (0,_walletconnect_logger__WEBPACK_IMPORTED_MODULE_0__.getLoggerContext)(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace(\"Initialized\");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.engine.init(),await this.auth.init(),this.core.verify.init({verifyUrl:this.metadata.verifyUrl}),this.logger.info(\"SignClient Initialization Success\")}catch(n){throw this.logger.info(\"SignClient Initialization Failure\"),this.logger.error(n.message),n}}}const ns=We,os=ne;\n//# sourceMappingURL=index.es.js.map\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/sign-client/dist/index.es.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/time/dist/cjs/constants/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/@walletconnect/time/dist/cjs/constants/index.js ***! - \**********************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst tslib_1 = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\ntslib_1.__exportStar(__webpack_require__(/*! ./misc */ \"./node_modules/@walletconnect/time/dist/cjs/constants/misc.js\"), exports);\ntslib_1.__exportStar(__webpack_require__(/*! ./time */ \"./node_modules/@walletconnect/time/dist/cjs/constants/time.js\"), exports);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/time/dist/cjs/constants/index.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/time/dist/cjs/constants/misc.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@walletconnect/time/dist/cjs/constants/misc.js ***! - \*********************************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.ONE_THOUSAND = exports.ONE_HUNDRED = void 0;\nexports.ONE_HUNDRED = 100;\nexports.ONE_THOUSAND = 1000;\n//# sourceMappingURL=misc.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/time/dist/cjs/constants/misc.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/time/dist/cjs/constants/time.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@walletconnect/time/dist/cjs/constants/time.js ***! - \*********************************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.ONE_YEAR = exports.FOUR_WEEKS = exports.THREE_WEEKS = exports.TWO_WEEKS = exports.ONE_WEEK = exports.THIRTY_DAYS = exports.SEVEN_DAYS = exports.FIVE_DAYS = exports.THREE_DAYS = exports.ONE_DAY = exports.TWENTY_FOUR_HOURS = exports.TWELVE_HOURS = exports.SIX_HOURS = exports.THREE_HOURS = exports.ONE_HOUR = exports.SIXTY_MINUTES = exports.THIRTY_MINUTES = exports.TEN_MINUTES = exports.FIVE_MINUTES = exports.ONE_MINUTE = exports.SIXTY_SECONDS = exports.THIRTY_SECONDS = exports.TEN_SECONDS = exports.FIVE_SECONDS = exports.ONE_SECOND = void 0;\nexports.ONE_SECOND = 1;\nexports.FIVE_SECONDS = 5;\nexports.TEN_SECONDS = 10;\nexports.THIRTY_SECONDS = 30;\nexports.SIXTY_SECONDS = 60;\nexports.ONE_MINUTE = exports.SIXTY_SECONDS;\nexports.FIVE_MINUTES = exports.ONE_MINUTE * 5;\nexports.TEN_MINUTES = exports.ONE_MINUTE * 10;\nexports.THIRTY_MINUTES = exports.ONE_MINUTE * 30;\nexports.SIXTY_MINUTES = exports.ONE_MINUTE * 60;\nexports.ONE_HOUR = exports.SIXTY_MINUTES;\nexports.THREE_HOURS = exports.ONE_HOUR * 3;\nexports.SIX_HOURS = exports.ONE_HOUR * 6;\nexports.TWELVE_HOURS = exports.ONE_HOUR * 12;\nexports.TWENTY_FOUR_HOURS = exports.ONE_HOUR * 24;\nexports.ONE_DAY = exports.TWENTY_FOUR_HOURS;\nexports.THREE_DAYS = exports.ONE_DAY * 3;\nexports.FIVE_DAYS = exports.ONE_DAY * 5;\nexports.SEVEN_DAYS = exports.ONE_DAY * 7;\nexports.THIRTY_DAYS = exports.ONE_DAY * 30;\nexports.ONE_WEEK = exports.SEVEN_DAYS;\nexports.TWO_WEEKS = exports.ONE_WEEK * 2;\nexports.THREE_WEEKS = exports.ONE_WEEK * 3;\nexports.FOUR_WEEKS = exports.ONE_WEEK * 4;\nexports.ONE_YEAR = exports.ONE_DAY * 365;\n//# sourceMappingURL=time.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/time/dist/cjs/constants/time.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/time/dist/cjs/index.js": -/*!************************************************************!*\ - !*** ./node_modules/@walletconnect/time/dist/cjs/index.js ***! - \************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst tslib_1 = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\ntslib_1.__exportStar(__webpack_require__(/*! ./utils */ \"./node_modules/@walletconnect/time/dist/cjs/utils/index.js\"), exports);\ntslib_1.__exportStar(__webpack_require__(/*! ./watch */ \"./node_modules/@walletconnect/time/dist/cjs/watch.js\"), exports);\ntslib_1.__exportStar(__webpack_require__(/*! ./types */ \"./node_modules/@walletconnect/time/dist/cjs/types/index.js\"), exports);\ntslib_1.__exportStar(__webpack_require__(/*! ./constants */ \"./node_modules/@walletconnect/time/dist/cjs/constants/index.js\"), exports);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/time/dist/cjs/index.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/time/dist/cjs/types/index.js": -/*!******************************************************************!*\ - !*** ./node_modules/@walletconnect/time/dist/cjs/types/index.js ***! - \******************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst tslib_1 = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\ntslib_1.__exportStar(__webpack_require__(/*! ./watch */ \"./node_modules/@walletconnect/time/dist/cjs/types/watch.js\"), exports);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/time/dist/cjs/types/index.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/time/dist/cjs/types/watch.js": -/*!******************************************************************!*\ - !*** ./node_modules/@walletconnect/time/dist/cjs/types/watch.js ***! - \******************************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.IWatch = void 0;\nclass IWatch {\n}\nexports.IWatch = IWatch;\n//# sourceMappingURL=watch.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/time/dist/cjs/types/watch.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/time/dist/cjs/utils/convert.js": -/*!********************************************************************!*\ - !*** ./node_modules/@walletconnect/time/dist/cjs/utils/convert.js ***! - \********************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.fromMiliseconds = exports.toMiliseconds = void 0;\nconst constants_1 = __webpack_require__(/*! ../constants */ \"./node_modules/@walletconnect/time/dist/cjs/constants/index.js\");\nfunction toMiliseconds(seconds) {\n return seconds * constants_1.ONE_THOUSAND;\n}\nexports.toMiliseconds = toMiliseconds;\nfunction fromMiliseconds(miliseconds) {\n return Math.floor(miliseconds / constants_1.ONE_THOUSAND);\n}\nexports.fromMiliseconds = fromMiliseconds;\n//# sourceMappingURL=convert.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/time/dist/cjs/utils/convert.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/time/dist/cjs/utils/delay.js": -/*!******************************************************************!*\ - !*** ./node_modules/@walletconnect/time/dist/cjs/utils/delay.js ***! - \******************************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.delay = void 0;\nfunction delay(timeout) {\n return new Promise(resolve => {\n setTimeout(() => {\n resolve(true);\n }, timeout);\n });\n}\nexports.delay = delay;\n//# sourceMappingURL=delay.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/time/dist/cjs/utils/delay.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/time/dist/cjs/utils/index.js": -/*!******************************************************************!*\ - !*** ./node_modules/@walletconnect/time/dist/cjs/utils/index.js ***! - \******************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst tslib_1 = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\ntslib_1.__exportStar(__webpack_require__(/*! ./delay */ \"./node_modules/@walletconnect/time/dist/cjs/utils/delay.js\"), exports);\ntslib_1.__exportStar(__webpack_require__(/*! ./convert */ \"./node_modules/@walletconnect/time/dist/cjs/utils/convert.js\"), exports);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/time/dist/cjs/utils/index.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/time/dist/cjs/watch.js": -/*!************************************************************!*\ - !*** ./node_modules/@walletconnect/time/dist/cjs/watch.js ***! - \************************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Watch = void 0;\nclass Watch {\n constructor() {\n this.timestamps = new Map();\n }\n start(label) {\n if (this.timestamps.has(label)) {\n throw new Error(`Watch already started for label: ${label}`);\n }\n this.timestamps.set(label, { started: Date.now() });\n }\n stop(label) {\n const timestamp = this.get(label);\n if (typeof timestamp.elapsed !== \"undefined\") {\n throw new Error(`Watch already stopped for label: ${label}`);\n }\n const elapsed = Date.now() - timestamp.started;\n this.timestamps.set(label, { started: timestamp.started, elapsed });\n }\n get(label) {\n const timestamp = this.timestamps.get(label);\n if (typeof timestamp === \"undefined\") {\n throw new Error(`No timestamp found for label: ${label}`);\n }\n return timestamp;\n }\n elapsed(label) {\n const timestamp = this.get(label);\n const elapsed = timestamp.elapsed || Date.now() - timestamp.started;\n return elapsed;\n }\n}\nexports.Watch = Watch;\nexports[\"default\"] = Watch;\n//# sourceMappingURL=watch.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/time/dist/cjs/watch.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/types/dist/index.es.js": -/*!************************************************************!*\ - !*** ./node_modules/@walletconnect/types/dist/index.es.js ***! - \************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ICore: () => (/* binding */ n),\n/* harmony export */ ICrypto: () => (/* binding */ l),\n/* harmony export */ IEchoClient: () => (/* binding */ v),\n/* harmony export */ IEngine: () => (/* binding */ w),\n/* harmony export */ IEngineEvents: () => (/* binding */ S),\n/* harmony export */ IExpirer: () => (/* binding */ E),\n/* harmony export */ IJsonRpcHistory: () => (/* binding */ h),\n/* harmony export */ IKeyChain: () => (/* binding */ x),\n/* harmony export */ IMessageTracker: () => (/* binding */ a),\n/* harmony export */ IPairing: () => (/* binding */ m),\n/* harmony export */ IPublisher: () => (/* binding */ u),\n/* harmony export */ IRelayer: () => (/* binding */ g),\n/* harmony export */ ISignClient: () => (/* binding */ b),\n/* harmony export */ ISignClientEvents: () => (/* binding */ C),\n/* harmony export */ IStore: () => (/* binding */ p),\n/* harmony export */ ISubscriber: () => (/* binding */ d),\n/* harmony export */ ISubscriberTopicMap: () => (/* binding */ I),\n/* harmony export */ IVerify: () => (/* binding */ y)\n/* harmony export */ });\n/* harmony import */ var _walletconnect_events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @walletconnect/events */ \"./node_modules/@walletconnect/events/dist/esm/index.js\");\n/* harmony import */ var events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! events */ \"./node_modules/events/events.js\");\n/* harmony import */ var events__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(events__WEBPACK_IMPORTED_MODULE_1__);\nclass n extends _walletconnect_events__WEBPACK_IMPORTED_MODULE_0__.IEvents{constructor(s){super(),this.opts=s,this.protocol=\"wc\",this.version=2}}class l{constructor(s,t,o){this.core=s,this.logger=t}}class h extends _walletconnect_events__WEBPACK_IMPORTED_MODULE_0__.IEvents{constructor(s,t){super(),this.core=s,this.logger=t,this.records=new Map}}class a{constructor(s,t){this.logger=s,this.core=t}}class u extends _walletconnect_events__WEBPACK_IMPORTED_MODULE_0__.IEvents{constructor(s,t){super(),this.relayer=s,this.logger=t}}class g extends _walletconnect_events__WEBPACK_IMPORTED_MODULE_0__.IEvents{constructor(s){super()}}class p{constructor(s,t,o,M){this.core=s,this.logger=t,this.name=o}}class I{constructor(){this.map=new Map}}class d extends _walletconnect_events__WEBPACK_IMPORTED_MODULE_0__.IEvents{constructor(s,t){super(),this.relayer=s,this.logger=t}}class x{constructor(s,t){this.core=s,this.logger=t}}class E extends _walletconnect_events__WEBPACK_IMPORTED_MODULE_0__.IEvents{constructor(s,t){super(),this.core=s,this.logger=t}}class m{constructor(s,t){this.logger=s,this.core=t}}class y{constructor(s,t){this.projectId=s,this.logger=t}}class v{constructor(s,t){this.projectId=s,this.logger=t}}class C extends (events__WEBPACK_IMPORTED_MODULE_1___default()){constructor(){super()}}class b{constructor(s){this.opts=s,this.protocol=\"wc\",this.version=2}}class S extends events__WEBPACK_IMPORTED_MODULE_1__.EventEmitter{constructor(){super()}}class w{constructor(s){this.client=s}}\n//# sourceMappingURL=index.es.js.map\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/types/dist/index.es.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/utils/dist/index.es.js": -/*!************************************************************!*\ - !*** ./node_modules/@walletconnect/utils/dist/index.es.js ***! - \************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BASE10: () => (/* binding */ Gi),\n/* harmony export */ BASE16: () => (/* binding */ zt),\n/* harmony export */ BASE64: () => (/* binding */ Jr),\n/* harmony export */ COLON: () => (/* binding */ Yo),\n/* harmony export */ DEFAULT_DEPTH: () => (/* binding */ di),\n/* harmony export */ EMPTY_SPACE: () => (/* binding */ Br),\n/* harmony export */ ENV_MAP: () => (/* binding */ qt),\n/* harmony export */ INTERNAL_ERRORS: () => (/* binding */ Ao),\n/* harmony export */ MemoryStore: () => (/* binding */ lh),\n/* harmony export */ ONE_THOUSAND: () => (/* binding */ Vo),\n/* harmony export */ REACT_NATIVE_PRODUCT: () => (/* binding */ xn),\n/* harmony export */ RELAYER_DEFAULT_PROTOCOL: () => (/* binding */ ro),\n/* harmony export */ SDK_ERRORS: () => (/* binding */ go),\n/* harmony export */ SDK_TYPE: () => (/* binding */ En),\n/* harmony export */ SLASH: () => (/* binding */ Mn),\n/* harmony export */ TYPE_0: () => (/* binding */ Yi),\n/* harmony export */ TYPE_1: () => (/* binding */ lr),\n/* harmony export */ UTF8: () => (/* binding */ Gr),\n/* harmony export */ addResourceToRecap: () => (/* binding */ Vf),\n/* harmony export */ appendToQueryString: () => (/* binding */ Sn),\n/* harmony export */ assertType: () => (/* binding */ e0),\n/* harmony export */ assignAbilityToActions: () => (/* binding */ ji),\n/* harmony export */ base64Decode: () => (/* binding */ Gf),\n/* harmony export */ base64Encode: () => (/* binding */ Jf),\n/* harmony export */ buildApprovedNamespaces: () => (/* binding */ Lu),\n/* harmony export */ buildAuthObject: () => (/* binding */ su),\n/* harmony export */ buildNamespacesFromAuth: () => (/* binding */ ju),\n/* harmony export */ buildRecapStatement: () => (/* binding */ Xf),\n/* harmony export */ calcExpiry: () => (/* binding */ d0),\n/* harmony export */ capitalize: () => (/* binding */ s0),\n/* harmony export */ capitalizeWord: () => (/* binding */ Rn),\n/* harmony export */ createDelayedPromise: () => (/* binding */ a0),\n/* harmony export */ createEncodedRecap: () => (/* binding */ cu),\n/* harmony export */ createExpiringPromise: () => (/* binding */ u0),\n/* harmony export */ createRecap: () => (/* binding */ Yf),\n/* harmony export */ decodeRecap: () => (/* binding */ Oe),\n/* harmony export */ decodeTypeByte: () => (/* binding */ Mr),\n/* harmony export */ decrypt: () => (/* binding */ xu),\n/* harmony export */ deriveSymKey: () => (/* binding */ Au),\n/* harmony export */ deserialize: () => (/* binding */ Xi),\n/* harmony export */ encodeRecap: () => (/* binding */ jr),\n/* harmony export */ encodeTypeByte: () => (/* binding */ $f),\n/* harmony export */ encrypt: () => (/* binding */ wu),\n/* harmony export */ engineEvent: () => (/* binding */ v0),\n/* harmony export */ enumify: () => (/* binding */ o0),\n/* harmony export */ formatAccountId: () => (/* binding */ vn),\n/* harmony export */ formatAccountWithChain: () => (/* binding */ Ko),\n/* harmony export */ formatChainId: () => (/* binding */ pn),\n/* harmony export */ formatExpirerTarget: () => (/* binding */ vi),\n/* harmony export */ formatIdTarget: () => (/* binding */ c0),\n/* harmony export */ formatMessage: () => (/* binding */ zf),\n/* harmony export */ formatMessageContext: () => (/* binding */ r0),\n/* harmony export */ formatRelayParams: () => (/* binding */ ao),\n/* harmony export */ formatRelayRpcUrl: () => (/* binding */ $o),\n/* harmony export */ formatStatementFromRecap: () => (/* binding */ Ji),\n/* harmony export */ formatTopicTarget: () => (/* binding */ h0),\n/* harmony export */ formatUA: () => (/* binding */ _n),\n/* harmony export */ formatUri: () => (/* binding */ Du),\n/* harmony export */ generateKeyPair: () => (/* binding */ mu),\n/* harmony export */ generateRandomBytes32: () => (/* binding */ gu),\n/* harmony export */ getAccountsChains: () => (/* binding */ $e),\n/* harmony export */ getAccountsFromNamespaces: () => (/* binding */ zo),\n/* harmony export */ getAddressFromAccount: () => (/* binding */ mn),\n/* harmony export */ getAddressesFromAccounts: () => (/* binding */ Ho),\n/* harmony export */ getAppMetadata: () => (/* binding */ Xo),\n/* harmony export */ getBrowserOnlineStatus: () => (/* binding */ Bo),\n/* harmony export */ getBundleId: () => (/* binding */ Wo),\n/* harmony export */ getChainFromAccount: () => (/* binding */ gn),\n/* harmony export */ getChainsFromAccounts: () => (/* binding */ An),\n/* harmony export */ getChainsFromNamespace: () => (/* binding */ _r),\n/* harmony export */ getChainsFromNamespaces: () => (/* binding */ Lo),\n/* harmony export */ getChainsFromRecap: () => (/* binding */ pu),\n/* harmony export */ getChainsFromRequiredNamespaces: () => (/* binding */ jo),\n/* harmony export */ getCommonValuesInArrays: () => (/* binding */ mi),\n/* harmony export */ getDecodedRecapFromResources: () => (/* binding */ Lf),\n/* harmony export */ getDeepLink: () => (/* binding */ g0),\n/* harmony export */ getDidAddress: () => (/* binding */ Li),\n/* harmony export */ getDidAddressSegments: () => (/* binding */ Lr),\n/* harmony export */ getDidChainId: () => (/* binding */ zi),\n/* harmony export */ getEnvironment: () => (/* binding */ We),\n/* harmony export */ getHttpUrl: () => (/* binding */ t0),\n/* harmony export */ getInternalError: () => (/* binding */ xe),\n/* harmony export */ getJavascriptID: () => (/* binding */ In),\n/* harmony export */ getJavascriptOS: () => (/* binding */ Nn),\n/* harmony export */ getLastItems: () => (/* binding */ Cn),\n/* harmony export */ getMethodsFromRecap: () => (/* binding */ du),\n/* harmony export */ getNamespacedDidChainId: () => (/* binding */ fu),\n/* harmony export */ getNamespacesChains: () => (/* binding */ co),\n/* harmony export */ getNamespacesEventsForChainId: () => (/* binding */ po),\n/* harmony export */ getNamespacesFromAccounts: () => (/* binding */ mo),\n/* harmony export */ getNamespacesMethodsForChainId: () => (/* binding */ lo),\n/* harmony export */ getNodeOnlineStatus: () => (/* binding */ Ro),\n/* harmony export */ getReCapActions: () => (/* binding */ Qf),\n/* harmony export */ getReactNativeOnlineStatus: () => (/* binding */ Co),\n/* harmony export */ getRecapAbilitiesFromResource: () => (/* binding */ hu),\n/* harmony export */ getRecapFromResources: () => (/* binding */ Qr),\n/* harmony export */ getRecapResource: () => (/* binding */ jf),\n/* harmony export */ getRelayClientMetadata: () => (/* binding */ Zo),\n/* harmony export */ getRelayProtocolApi: () => (/* binding */ Nu),\n/* harmony export */ getRelayProtocolName: () => (/* binding */ Su),\n/* harmony export */ getRequiredNamespacesFromNamespaces: () => (/* binding */ zu),\n/* harmony export */ getSdkError: () => (/* binding */ tr),\n/* harmony export */ getUniqueValues: () => (/* binding */ li),\n/* harmony export */ handleDeeplinkRedirect: () => (/* binding */ m0),\n/* harmony export */ hasOverlap: () => (/* binding */ _e),\n/* harmony export */ hashKey: () => (/* binding */ bu),\n/* harmony export */ hashMessage: () => (/* binding */ yu),\n/* harmony export */ isBrowser: () => (/* binding */ pr),\n/* harmony export */ isCaipNamespace: () => (/* binding */ Zi),\n/* harmony export */ isConformingNamespaces: () => (/* binding */ Io),\n/* harmony export */ isExpired: () => (/* binding */ p0),\n/* harmony export */ isNode: () => (/* binding */ pi),\n/* harmony export */ isOnline: () => (/* binding */ hh),\n/* harmony export */ isProposalStruct: () => (/* binding */ Gu),\n/* harmony export */ isReactNative: () => (/* binding */ er),\n/* harmony export */ isRecap: () => (/* binding */ Qi),\n/* harmony export */ isSessionCompatible: () => (/* binding */ Qu),\n/* harmony export */ isSessionStruct: () => (/* binding */ Yu),\n/* harmony export */ isTypeOneEnvelope: () => (/* binding */ Eu),\n/* harmony export */ isUndefined: () => (/* binding */ Pe),\n/* harmony export */ isValidAccountId: () => (/* binding */ bo),\n/* harmony export */ isValidAccounts: () => (/* binding */ xo),\n/* harmony export */ isValidActions: () => (/* binding */ Eo),\n/* harmony export */ isValidArray: () => (/* binding */ Er),\n/* harmony export */ isValidChainId: () => (/* binding */ Sr),\n/* harmony export */ isValidChains: () => (/* binding */ yo),\n/* harmony export */ isValidController: () => (/* binding */ Vu),\n/* harmony export */ isValidEip1271Signature: () => (/* binding */ kf),\n/* harmony export */ isValidEip191Signature: () => (/* binding */ Uf),\n/* harmony export */ isValidErrorReason: () => (/* binding */ th),\n/* harmony export */ isValidEvent: () => (/* binding */ ih),\n/* harmony export */ isValidId: () => (/* binding */ Zu),\n/* harmony export */ isValidNamespaceAccounts: () => (/* binding */ Mo),\n/* harmony export */ isValidNamespaceActions: () => (/* binding */ en),\n/* harmony export */ isValidNamespaceChains: () => (/* binding */ wo),\n/* harmony export */ isValidNamespaceMethodsOrEvents: () => (/* binding */ tn),\n/* harmony export */ isValidNamespaces: () => (/* binding */ So),\n/* harmony export */ isValidNamespacesChainId: () => (/* binding */ nh),\n/* harmony export */ isValidNamespacesEvent: () => (/* binding */ oh),\n/* harmony export */ isValidNamespacesRequest: () => (/* binding */ fh),\n/* harmony export */ isValidNumber: () => (/* binding */ Vr),\n/* harmony export */ isValidObject: () => (/* binding */ Yr),\n/* harmony export */ isValidParams: () => (/* binding */ $u),\n/* harmony export */ isValidRecap: () => (/* binding */ me),\n/* harmony export */ isValidRelay: () => (/* binding */ No),\n/* harmony export */ isValidRelays: () => (/* binding */ Xu),\n/* harmony export */ isValidRequest: () => (/* binding */ eh),\n/* harmony export */ isValidRequestExpiry: () => (/* binding */ uh),\n/* harmony export */ isValidRequiredNamespaces: () => (/* binding */ Wu),\n/* harmony export */ isValidResponse: () => (/* binding */ rh),\n/* harmony export */ isValidString: () => (/* binding */ Gt),\n/* harmony export */ isValidUrl: () => (/* binding */ Ju),\n/* harmony export */ mapEntries: () => (/* binding */ f0),\n/* harmony export */ mapToObj: () => (/* binding */ i0),\n/* harmony export */ mergeArrays: () => (/* binding */ ge),\n/* harmony export */ mergeEncodedRecaps: () => (/* binding */ lu),\n/* harmony export */ mergeRecaps: () => (/* binding */ Wf),\n/* harmony export */ normalizeNamespaces: () => (/* binding */ $i),\n/* harmony export */ objToMap: () => (/* binding */ n0),\n/* harmony export */ parseAccountId: () => (/* binding */ ci),\n/* harmony export */ parseChainId: () => (/* binding */ dn),\n/* harmony export */ parseContextNames: () => (/* binding */ Bn),\n/* harmony export */ parseExpirerTarget: () => (/* binding */ l0),\n/* harmony export */ parseNamespaceKey: () => (/* binding */ vo),\n/* harmony export */ parseRelayParams: () => (/* binding */ oo),\n/* harmony export */ parseTopic: () => (/* binding */ so),\n/* harmony export */ parseUri: () => (/* binding */ Pu),\n/* harmony export */ populateAuthPayload: () => (/* binding */ au),\n/* harmony export */ recapHasResource: () => (/* binding */ uu),\n/* harmony export */ serialize: () => (/* binding */ to),\n/* harmony export */ subscribeToBrowserNetworkChange: () => (/* binding */ Oo),\n/* harmony export */ subscribeToNetworkChange: () => (/* binding */ ch),\n/* harmony export */ subscribeToReactNativeNetworkChange: () => (/* binding */ Po),\n/* harmony export */ validateDecoding: () => (/* binding */ Mu),\n/* harmony export */ validateEncoding: () => (/* binding */ eo),\n/* harmony export */ validateSignedCacao: () => (/* binding */ ou),\n/* harmony export */ verifySignature: () => (/* binding */ Tf)\n/* harmony export */ });\n/* harmony import */ var detect_browser__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! detect-browser */ \"./node_modules/detect-browser/es/index.js\");\n/* harmony import */ var _walletconnect_time__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @walletconnect/time */ \"./node_modules/@walletconnect/time/dist/cjs/index.js\");\n/* harmony import */ var _walletconnect_time__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_walletconnect_time__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _walletconnect_window_getters__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @walletconnect/window-getters */ \"./node_modules/@walletconnect/window-getters/dist/cjs/index.js\");\n/* harmony import */ var _walletconnect_window_metadata__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @walletconnect/window-metadata */ \"./node_modules/@walletconnect/window-metadata/dist/cjs/index.js\");\n/* harmony import */ var query_string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! query-string */ \"./node_modules/query-string/index.js\");\n/* harmony import */ var _stablelib_chacha20poly1305__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @stablelib/chacha20poly1305 */ \"./node_modules/@stablelib/chacha20poly1305/lib/chacha20poly1305.js\");\n/* harmony import */ var _stablelib_hkdf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @stablelib/hkdf */ \"./node_modules/@stablelib/hkdf/lib/hkdf.js\");\n/* harmony import */ var _stablelib_random__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @stablelib/random */ \"./node_modules/@stablelib/random/lib/random.js\");\n/* harmony import */ var _stablelib_sha256__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @stablelib/sha256 */ \"./node_modules/@stablelib/sha256/lib/sha256.js\");\n/* harmony import */ var _stablelib_x25519__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @stablelib/x25519 */ \"./node_modules/@stablelib/x25519/lib/x25519.js\");\n/* harmony import */ var uint8arrays__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! uint8arrays */ \"./node_modules/uint8arrays/esm/src/index.js\");\n/* harmony import */ var _walletconnect_relay_api__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @walletconnect/relay-api */ \"./node_modules/@walletconnect/relay-api/dist/esm/index.js\");\nconst Ir=\":\";function dn(e){const[t,r]=e.split(Ir);return{namespace:t,reference:r}}function pn(e){const{namespace:t,reference:r}=e;return[t,r].join(Ir)}function ci(e){const[t,r,i]=e.split(Ir);return{namespace:t,reference:r,address:i}}function vn(e){const{namespace:t,reference:r,address:i}=e;return[t,r,i].join(Ir)}function li(e,t){const r=[];return e.forEach(i=>{const n=t(i);r.includes(n)||r.push(n)}),r}function mn(e){const{address:t}=ci(e);return t}function gn(e){const{namespace:t,reference:r}=ci(e);return pn({namespace:t,reference:r})}function Ko(e,t){const{namespace:r,reference:i}=dn(t);return vn({namespace:r,reference:i,address:e})}function Ho(e){return li(e,mn)}function An(e){return li(e,gn)}function zo(e,t=[]){const r=[];return Object.keys(e).forEach(i=>{if(t.length&&!t.includes(i))return;const n=e[i];r.push(...n.accounts)}),r}function Lo(e,t=[]){const r=[];return Object.keys(e).forEach(i=>{if(t.length&&!t.includes(i))return;const n=e[i];r.push(...An(n.accounts))}),r}function jo(e,t=[]){const r=[];return Object.keys(e).forEach(i=>{if(t.length&&!t.includes(i))return;const n=e[i];r.push(..._r(i,n))}),r}function _r(e,t){return e.includes(\":\")?[e]:t.chains||[]}var Qo=Object.defineProperty,bn=Object.getOwnPropertySymbols,Jo=Object.prototype.hasOwnProperty,Go=Object.prototype.propertyIsEnumerable,yn=(e,t,r)=>t in e?Qo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wn=(e,t)=>{for(var r in t||(t={}))Jo.call(t,r)&&yn(e,r,t[r]);if(bn)for(var r of bn(t))Go.call(t,r)&&yn(e,r,t[r]);return e};const xn=\"ReactNative\",qt={reactNative:\"react-native\",node:\"node\",browser:\"browser\",unknown:\"unknown\"},Br=\" \",Yo=\":\",Mn=\"/\",di=2,Vo=1e3,En=\"js\";function pi(){return typeof process<\"u\"&&typeof process.versions<\"u\"&&typeof process.versions.node<\"u\"}function er(){return!(0,_walletconnect_window_getters__WEBPACK_IMPORTED_MODULE_1__.getDocument)()&&!!(0,_walletconnect_window_getters__WEBPACK_IMPORTED_MODULE_1__.getNavigator)()&&navigator.product===xn}function pr(){return!pi()&&!!(0,_walletconnect_window_getters__WEBPACK_IMPORTED_MODULE_1__.getNavigator)()&&!!(0,_walletconnect_window_getters__WEBPACK_IMPORTED_MODULE_1__.getDocument)()}function We(){return er()?qt.reactNative:pi()?qt.node:pr()?qt.browser:qt.unknown}function Wo(){var e;try{return er()&&typeof __webpack_require__.g<\"u\"&&typeof(__webpack_require__.g==null?void 0:__webpack_require__.g.Application)<\"u\"?(e=__webpack_require__.g.Application)==null?void 0:e.applicationId:void 0}catch{return}}function Sn(e,t){let r=query_string__WEBPACK_IMPORTED_MODULE_3__.parse(e);return r=wn(wn({},r),t),e=query_string__WEBPACK_IMPORTED_MODULE_3__.stringify(r),e}function Xo(){return (0,_walletconnect_window_metadata__WEBPACK_IMPORTED_MODULE_2__.getWindowMetadata)()||{name:\"\",description:\"\",url:\"\",icons:[\"\"]}}function Zo(e,t){var r;const i=We(),n={protocol:e,version:t,env:i};return i===\"browser\"&&(n.host=((r=(0,_walletconnect_window_getters__WEBPACK_IMPORTED_MODULE_1__.getLocation)())==null?void 0:r.host)||\"unknown\"),n}function Nn(){if(We()===qt.reactNative&&typeof __webpack_require__.g<\"u\"&&typeof(__webpack_require__.g==null?void 0:__webpack_require__.g.Platform)<\"u\"){const{OS:r,Version:i}=__webpack_require__.g.Platform;return[r,i].join(\"-\")}const e=(0,detect_browser__WEBPACK_IMPORTED_MODULE_11__.detect)();if(e===null)return\"unknown\";const t=e.os?e.os.replace(\" \",\"\").toLowerCase():\"unknown\";return e.type===\"browser\"?[t,e.name,e.version].join(\"-\"):[t,e.version].join(\"-\")}function In(){var e;const t=We();return t===qt.browser?[t,((e=(0,_walletconnect_window_getters__WEBPACK_IMPORTED_MODULE_1__.getLocation)())==null?void 0:e.host)||\"unknown\"].join(\":\"):t}function _n(e,t,r){const i=Nn(),n=In();return[[e,t].join(\"-\"),[En,r].join(\"-\"),i,n].join(\"/\")}function $o({protocol:e,version:t,relayUrl:r,sdkVersion:i,auth:n,projectId:o,useOnCloseEvent:h,bundleId:p}){const b=r.split(\"?\"),m=_n(e,t,i),w={auth:n,ua:m,projectId:o,useOnCloseEvent:h||void 0,origin:p||void 0},y=Sn(b[1]||\"\",w);return b[0]+\"?\"+y}function t0(e){let t=(e.match(/^[^:]+(?=:\\/\\/)/gi)||[])[0];const r=typeof t<\"u\"?e.split(\"://\")[1]:e;return t=t===\"wss\"?\"https\":\"http\",[t,r].join(\"://\")}function e0(e,t,r){if(!e[t]||typeof e[t]!==r)throw new Error(`Missing or invalid \"${t}\" param`)}function Bn(e,t=di){return Cn(e.split(Mn),t)}function r0(e){return Bn(e).join(Br)}function _e(e,t){return e.filter(r=>t.includes(r)).length===e.length}function Cn(e,t=di){return e.slice(Math.max(e.length-t,0))}function i0(e){return Object.fromEntries(e.entries())}function n0(e){return new Map(Object.entries(e))}function f0(e,t){const r={};return Object.keys(e).forEach(i=>{r[i]=t(e[i])}),r}const o0=e=>e;function Rn(e){return e.trim().replace(/^\\w/,t=>t.toUpperCase())}function s0(e){return e.split(Br).map(t=>Rn(t)).join(Br)}function a0(e=_walletconnect_time__WEBPACK_IMPORTED_MODULE_0__.FIVE_MINUTES,t){const r=(0,_walletconnect_time__WEBPACK_IMPORTED_MODULE_0__.toMiliseconds)(e||_walletconnect_time__WEBPACK_IMPORTED_MODULE_0__.FIVE_MINUTES);let i,n,o;return{resolve:h=>{o&&i&&(clearTimeout(o),i(h))},reject:h=>{o&&n&&(clearTimeout(o),n(h))},done:()=>new Promise((h,p)=>{o=setTimeout(()=>{p(new Error(t))},r),i=h,n=p})}}function u0(e,t,r){return new Promise(async(i,n)=>{const o=setTimeout(()=>n(new Error(r)),t);try{const h=await e;i(h)}catch(h){n(h)}clearTimeout(o)})}function vi(e,t){if(typeof t==\"string\"&&t.startsWith(`${e}:`))return t;if(e.toLowerCase()===\"topic\"){if(typeof t!=\"string\")throw new Error('Value must be \"string\" for expirer target type: topic');return`topic:${t}`}else if(e.toLowerCase()===\"id\"){if(typeof t!=\"number\")throw new Error('Value must be \"number\" for expirer target type: id');return`id:${t}`}throw new Error(`Unknown expirer target type: ${e}`)}function h0(e){return vi(\"topic\",e)}function c0(e){return vi(\"id\",e)}function l0(e){const[t,r]=e.split(\":\"),i={id:void 0,topic:void 0};if(t===\"topic\"&&typeof r==\"string\")i.topic=r;else if(t===\"id\"&&Number.isInteger(Number(r)))i.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${t}:${r}`);return i}function d0(e,t){return (0,_walletconnect_time__WEBPACK_IMPORTED_MODULE_0__.fromMiliseconds)((t||Date.now())+(0,_walletconnect_time__WEBPACK_IMPORTED_MODULE_0__.toMiliseconds)(e))}function p0(e){return Date.now()>=(0,_walletconnect_time__WEBPACK_IMPORTED_MODULE_0__.toMiliseconds)(e)}function v0(e,t){return`${e}${t?`:${t}`:\"\"}`}function ge(e=[],t=[]){return[...new Set([...e,...t])]}async function m0({id:e,topic:t,wcDeepLink:r}){try{if(!r)return;const i=typeof r==\"string\"?JSON.parse(r):r;let n=i?.href;if(typeof n!=\"string\")return;n.endsWith(\"/\")&&(n=n.slice(0,-1));const o=`${n}/wc?requestId=${e}&sessionTopic=${t}`,h=We();h===qt.browser?o.startsWith(\"https://\")||o.startsWith(\"http://\")?window.open(o,\"_blank\",\"noreferrer noopener\"):window.open(o,\"_self\",\"noreferrer noopener\"):h===qt.reactNative&&typeof(__webpack_require__.g==null?void 0:__webpack_require__.g.Linking)<\"u\"&&await __webpack_require__.g.Linking.openURL(o)}catch(i){console.error(i)}}async function g0(e,t){try{return await e.getItem(t)||(pr()?localStorage.getItem(t):void 0)}catch(r){console.error(r)}}function mi(e,t){return e.filter(r=>t.includes(r))}var On=typeof globalThis<\"u\"?globalThis:typeof window<\"u\"?window:typeof __webpack_require__.g<\"u\"?__webpack_require__.g:typeof self<\"u\"?self:{};function A0(e){var t=e.default;if(typeof t==\"function\"){var r=function(){return t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,\"__esModule\",{value:!0}),Object.keys(e).forEach(function(i){var n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(r,i,n.get?n:{enumerable:!0,get:function(){return e[i]}})}),r}var Pn={exports:{}};/**\n * [js-sha3]{@link https://github.com/emn178/js-sha3}\n *\n * @version 0.8.0\n * @author Chen, Yi-Cyuan [emn178@gmail.com]\n * @copyright Chen, Yi-Cyuan 2015-2018\n * @license MIT\n */(function(e){(function(){var t=\"input is invalid type\",r=\"finalize already called\",i=typeof window==\"object\",n=i?window:{};n.JS_SHA3_NO_WINDOW&&(i=!1);var o=!i&&typeof self==\"object\",h=!n.JS_SHA3_NO_NODE_JS&&typeof process==\"object\"&&process.versions&&process.versions.node;h?n=On:o&&(n=self);var p=!n.JS_SHA3_NO_COMMON_JS&&!0&&e.exports,b=!n.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<\"u\",m=\"0123456789abcdef\".split(\"\"),w=[31,7936,2031616,520093696],y=[4,1024,262144,67108864],S=[1,256,65536,16777216],I=[6,1536,393216,100663296],N=[0,8,16,24],C=[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],F=[224,256,384,512],U=[128,256],J=[\"hex\",\"buffer\",\"arrayBuffer\",\"array\",\"digest\"],Bt={128:168,256:136};(n.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(u){return Object.prototype.toString.call(u)===\"[object Array]\"}),b&&(n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(u){return typeof u==\"object\"&&u.buffer&&u.buffer.constructor===ArrayBuffer});for(var G=function(u,E,_){return function(B){return new s(u,E,u).update(B)[_]()}},H=function(u,E,_){return function(B,R){return new s(u,E,R).update(B)[_]()}},z=function(u,E,_){return function(B,R,T,P){return f[\"cshake\"+u].update(B,R,T,P)[_]()}},Pt=function(u,E,_){return function(B,R,T,P){return f[\"kmac\"+u].update(B,R,T,P)[_]()}},W=function(u,E,_,B){for(var R=0;R>5,this.byteCount=this.blockCount<<2,this.outputBlocks=_>>5,this.extraBytes=(_&31)>>3;for(var B=0;B<50;++B)this.s[B]=0}s.prototype.update=function(u){if(this.finalized)throw new Error(r);var E,_=typeof u;if(_!==\"string\"){if(_===\"object\"){if(u===null)throw new Error(t);if(b&&u.constructor===ArrayBuffer)u=new Uint8Array(u);else if(!Array.isArray(u)&&(!b||!ArrayBuffer.isView(u)))throw new Error(t)}else throw new Error(t);E=!0}for(var B=this.blocks,R=this.byteCount,T=u.length,P=this.blockCount,O=0,Ct=this.s,D,q;O>2]|=u[O]<>2]|=q<>2]|=(192|q>>6)<>2]|=(128|q&63)<=57344?(B[D>>2]|=(224|q>>12)<>2]|=(128|q>>6&63)<>2]|=(128|q&63)<>2]|=(240|q>>18)<>2]|=(128|q>>12&63)<>2]|=(128|q>>6&63)<>2]|=(128|q&63)<=R){for(this.start=D-R,this.block=B[P],D=0;D>8,_=u&255;_>0;)R.unshift(_),u=u>>8,_=u&255,++B;return E?R.push(B):R.unshift(B),this.update(R),R.length},s.prototype.encodeString=function(u){var E,_=typeof u;if(_!==\"string\"){if(_===\"object\"){if(u===null)throw new Error(t);if(b&&u.constructor===ArrayBuffer)u=new Uint8Array(u);else if(!Array.isArray(u)&&(!b||!ArrayBuffer.isView(u)))throw new Error(t)}else throw new Error(t);E=!0}var B=0,R=u.length;if(E)B=R;else for(var T=0;T=57344?B+=3:(P=65536+((P&1023)<<10|u.charCodeAt(++T)&1023),B+=4)}return B+=this.encode(B*8),this.update(u),B},s.prototype.bytepad=function(u,E){for(var _=this.encode(E),B=0;B>2]|=this.padding[E&3],this.lastByteIndex===this.byteCount)for(u[0]=u[_],E=1;E<_+1;++E)u[E]=0;for(u[_-1]|=2147483648,E=0;E<_;++E)B[E]^=u[E];k(B)}},s.prototype.toString=s.prototype.hex=function(){this.finalize();for(var u=this.blockCount,E=this.s,_=this.outputBlocks,B=this.extraBytes,R=0,T=0,P=\"\",O;T<_;){for(R=0;R>4&15]+m[O&15]+m[O>>12&15]+m[O>>8&15]+m[O>>20&15]+m[O>>16&15]+m[O>>28&15]+m[O>>24&15];T%u===0&&(k(E),R=0)}return B&&(O=E[R],P+=m[O>>4&15]+m[O&15],B>1&&(P+=m[O>>12&15]+m[O>>8&15]),B>2&&(P+=m[O>>20&15]+m[O>>16&15])),P},s.prototype.arrayBuffer=function(){this.finalize();var u=this.blockCount,E=this.s,_=this.outputBlocks,B=this.extraBytes,R=0,T=0,P=this.outputBits>>3,O;B?O=new ArrayBuffer(_+1<<2):O=new ArrayBuffer(P);for(var Ct=new Uint32Array(O);T<_;){for(R=0;R>8&255,P[O+2]=Ct>>16&255,P[O+3]=Ct>>24&255;T%u===0&&k(E)}return B&&(O=T<<2,Ct=E[R],P[O]=Ct&255,B>1&&(P[O+1]=Ct>>8&255),B>2&&(P[O+2]=Ct>>16&255)),P};function v(u,E,_){s.call(this,u,E,_)}v.prototype=new s,v.prototype.finalize=function(){return this.encode(this.outputBits,!0),s.prototype.finalize.call(this)};var k=function(u){var E,_,B,R,T,P,O,Ct,D,q,De,X,Z,Fe,$,tt,Te,et,rt,Ue,it,nt,ke,ft,ot,qe,st,at,Ke,ut,ht,He,ct,lt,ze,dt,pt,Le,vt,mt,je,gt,At,Qe,bt,yt,Je,wt,xt,Ge,Mt,Et,Ye,St,Nt,Ve,It,_t,Me,Ee,Se,Ne,Ie;for(B=0;B<48;B+=2)R=u[0]^u[10]^u[20]^u[30]^u[40],T=u[1]^u[11]^u[21]^u[31]^u[41],P=u[2]^u[12]^u[22]^u[32]^u[42],O=u[3]^u[13]^u[23]^u[33]^u[43],Ct=u[4]^u[14]^u[24]^u[34]^u[44],D=u[5]^u[15]^u[25]^u[35]^u[45],q=u[6]^u[16]^u[26]^u[36]^u[46],De=u[7]^u[17]^u[27]^u[37]^u[47],X=u[8]^u[18]^u[28]^u[38]^u[48],Z=u[9]^u[19]^u[29]^u[39]^u[49],E=X^(P<<1|O>>>31),_=Z^(O<<1|P>>>31),u[0]^=E,u[1]^=_,u[10]^=E,u[11]^=_,u[20]^=E,u[21]^=_,u[30]^=E,u[31]^=_,u[40]^=E,u[41]^=_,E=R^(Ct<<1|D>>>31),_=T^(D<<1|Ct>>>31),u[2]^=E,u[3]^=_,u[12]^=E,u[13]^=_,u[22]^=E,u[23]^=_,u[32]^=E,u[33]^=_,u[42]^=E,u[43]^=_,E=P^(q<<1|De>>>31),_=O^(De<<1|q>>>31),u[4]^=E,u[5]^=_,u[14]^=E,u[15]^=_,u[24]^=E,u[25]^=_,u[34]^=E,u[35]^=_,u[44]^=E,u[45]^=_,E=Ct^(X<<1|Z>>>31),_=D^(Z<<1|X>>>31),u[6]^=E,u[7]^=_,u[16]^=E,u[17]^=_,u[26]^=E,u[27]^=_,u[36]^=E,u[37]^=_,u[46]^=E,u[47]^=_,E=q^(R<<1|T>>>31),_=De^(T<<1|R>>>31),u[8]^=E,u[9]^=_,u[18]^=E,u[19]^=_,u[28]^=E,u[29]^=_,u[38]^=E,u[39]^=_,u[48]^=E,u[49]^=_,Fe=u[0],$=u[1],yt=u[11]<<4|u[10]>>>28,Je=u[10]<<4|u[11]>>>28,at=u[20]<<3|u[21]>>>29,Ke=u[21]<<3|u[20]>>>29,Ee=u[31]<<9|u[30]>>>23,Se=u[30]<<9|u[31]>>>23,gt=u[40]<<18|u[41]>>>14,At=u[41]<<18|u[40]>>>14,lt=u[2]<<1|u[3]>>>31,ze=u[3]<<1|u[2]>>>31,tt=u[13]<<12|u[12]>>>20,Te=u[12]<<12|u[13]>>>20,wt=u[22]<<10|u[23]>>>22,xt=u[23]<<10|u[22]>>>22,ut=u[33]<<13|u[32]>>>19,ht=u[32]<<13|u[33]>>>19,Ne=u[42]<<2|u[43]>>>30,Ie=u[43]<<2|u[42]>>>30,St=u[5]<<30|u[4]>>>2,Nt=u[4]<<30|u[5]>>>2,dt=u[14]<<6|u[15]>>>26,pt=u[15]<<6|u[14]>>>26,et=u[25]<<11|u[24]>>>21,rt=u[24]<<11|u[25]>>>21,Ge=u[34]<<15|u[35]>>>17,Mt=u[35]<<15|u[34]>>>17,He=u[45]<<29|u[44]>>>3,ct=u[44]<<29|u[45]>>>3,ft=u[6]<<28|u[7]>>>4,ot=u[7]<<28|u[6]>>>4,Ve=u[17]<<23|u[16]>>>9,It=u[16]<<23|u[17]>>>9,Le=u[26]<<25|u[27]>>>7,vt=u[27]<<25|u[26]>>>7,Ue=u[36]<<21|u[37]>>>11,it=u[37]<<21|u[36]>>>11,Et=u[47]<<24|u[46]>>>8,Ye=u[46]<<24|u[47]>>>8,Qe=u[8]<<27|u[9]>>>5,bt=u[9]<<27|u[8]>>>5,qe=u[18]<<20|u[19]>>>12,st=u[19]<<20|u[18]>>>12,_t=u[29]<<7|u[28]>>>25,Me=u[28]<<7|u[29]>>>25,mt=u[38]<<8|u[39]>>>24,je=u[39]<<8|u[38]>>>24,nt=u[48]<<14|u[49]>>>18,ke=u[49]<<14|u[48]>>>18,u[0]=Fe^~tt&et,u[1]=$^~Te&rt,u[10]=ft^~qe&at,u[11]=ot^~st&Ke,u[20]=lt^~dt&Le,u[21]=ze^~pt&vt,u[30]=Qe^~yt&wt,u[31]=bt^~Je&xt,u[40]=St^~Ve&_t,u[41]=Nt^~It&Me,u[2]=tt^~et&Ue,u[3]=Te^~rt&it,u[12]=qe^~at&ut,u[13]=st^~Ke&ht,u[22]=dt^~Le&mt,u[23]=pt^~vt&je,u[32]=yt^~wt&Ge,u[33]=Je^~xt&Mt,u[42]=Ve^~_t&Ee,u[43]=It^~Me&Se,u[4]=et^~Ue&nt,u[5]=rt^~it&ke,u[14]=at^~ut&He,u[15]=Ke^~ht&ct,u[24]=Le^~mt>,u[25]=vt^~je&At,u[34]=wt^~Ge&Et,u[35]=xt^~Mt&Ye,u[44]=_t^~Ee&Ne,u[45]=Me^~Se&Ie,u[6]=Ue^~nt&Fe,u[7]=it^~ke&$,u[16]=ut^~He&ft,u[17]=ht^~ct&ot,u[26]=mt^~gt<,u[27]=je^~At&ze,u[36]=Ge^~Et&Qe,u[37]=Mt^~Ye&bt,u[46]=Ee^~Ne&St,u[47]=Se^~Ie&Nt,u[8]=nt^~Fe&tt,u[9]=ke^~$&Te,u[18]=He^~ft&qe,u[19]=ct^~ot&st,u[28]=gt^~lt&dt,u[29]=At^~ze&pt,u[38]=Et^~Qe&yt,u[39]=Ye^~bt&Je,u[48]=Ne^~St&Ve,u[49]=Ie^~Nt&It,u[0]^=C[B],u[1]^=C[B+1]};if(p)e.exports=f;else for(c=0;c{try{if(\"test\".normalize(t)!==\"test\")throw new Error(\"bad normalize\")}catch{e.push(t)}}),e.length)throw new Error(\"missing \"+e.join(\", \"));if(String.fromCharCode(233).normalize(\"NFD\")!==String.fromCharCode(101,769))throw new Error(\"broken implementation\")}catch(e){return e.message}return null}const Un=w0();var Ai;(function(e){e.DEBUG=\"DEBUG\",e.INFO=\"INFO\",e.WARNING=\"WARNING\",e.ERROR=\"ERROR\",e.OFF=\"OFF\"})(Ai||(Ai={}));var re;(function(e){e.UNKNOWN_ERROR=\"UNKNOWN_ERROR\",e.NOT_IMPLEMENTED=\"NOT_IMPLEMENTED\",e.UNSUPPORTED_OPERATION=\"UNSUPPORTED_OPERATION\",e.NETWORK_ERROR=\"NETWORK_ERROR\",e.SERVER_ERROR=\"SERVER_ERROR\",e.TIMEOUT=\"TIMEOUT\",e.BUFFER_OVERRUN=\"BUFFER_OVERRUN\",e.NUMERIC_FAULT=\"NUMERIC_FAULT\",e.MISSING_NEW=\"MISSING_NEW\",e.INVALID_ARGUMENT=\"INVALID_ARGUMENT\",e.MISSING_ARGUMENT=\"MISSING_ARGUMENT\",e.UNEXPECTED_ARGUMENT=\"UNEXPECTED_ARGUMENT\",e.CALL_EXCEPTION=\"CALL_EXCEPTION\",e.INSUFFICIENT_FUNDS=\"INSUFFICIENT_FUNDS\",e.NONCE_EXPIRED=\"NONCE_EXPIRED\",e.REPLACEMENT_UNDERPRICED=\"REPLACEMENT_UNDERPRICED\",e.UNPREDICTABLE_GAS_LIMIT=\"UNPREDICTABLE_GAS_LIMIT\",e.TRANSACTION_REPLACED=\"TRANSACTION_REPLACED\",e.ACTION_REJECTED=\"ACTION_REJECTED\"})(re||(re={}));const kn=\"0123456789abcdef\";class L{constructor(t){Object.defineProperty(this,\"version\",{enumerable:!0,value:t,writable:!1})}_log(t,r){const i=t.toLowerCase();Cr[i]==null&&this.throwArgumentError(\"invalid log level name\",\"logLevel\",t),!(Tn>Cr[i])&&console.log.apply(console,r)}debug(...t){this._log(L.levels.DEBUG,t)}info(...t){this._log(L.levels.INFO,t)}warn(...t){this._log(L.levels.WARNING,t)}makeError(t,r,i){if(Fn)return this.makeError(\"censored error\",r,{});r||(r=L.errors.UNKNOWN_ERROR),i||(i={});const n=[];Object.keys(i).forEach(b=>{const m=i[b];try{if(m instanceof Uint8Array){let w=\"\";for(let y=0;y>4],w+=kn[m[y]&15];n.push(b+\"=Uint8Array(0x\"+w+\")\")}else n.push(b+\"=\"+JSON.stringify(m))}catch{n.push(b+\"=\"+JSON.stringify(i[b].toString()))}}),n.push(`code=${r}`),n.push(`version=${this.version}`);const o=t;let h=\"\";switch(r){case re.NUMERIC_FAULT:{h=\"NUMERIC_FAULT\";const b=t;switch(b){case\"overflow\":case\"underflow\":case\"division-by-zero\":h+=\"-\"+b;break;case\"negative-power\":case\"negative-width\":h+=\"-unsupported\";break;case\"unbound-bitwise-result\":h+=\"-unbound-result\";break}break}case re.CALL_EXCEPTION:case re.INSUFFICIENT_FUNDS:case re.MISSING_NEW:case re.NONCE_EXPIRED:case re.REPLACEMENT_UNDERPRICED:case re.TRANSACTION_REPLACED:case re.UNPREDICTABLE_GAS_LIMIT:h=r;break}h&&(t+=\" [ See: https://links.ethers.org/v5-errors-\"+h+\" ]\"),n.length&&(t+=\" (\"+n.join(\", \")+\")\");const p=new Error(t);return p.reason=o,p.code=r,Object.keys(i).forEach(function(b){p[b]=i[b]}),p}throwError(t,r,i){throw this.makeError(t,r,i)}throwArgumentError(t,r,i){return this.throwError(t,L.errors.INVALID_ARGUMENT,{argument:r,value:i})}assert(t,r,i,n){t||this.throwError(r,i,n)}assertArgument(t,r,i,n){t||this.throwArgumentError(r,i,n)}checkNormalize(t){Un&&this.throwError(\"platform missing String.prototype.normalize\",L.errors.UNSUPPORTED_OPERATION,{operation:\"String.prototype.normalize\",form:Un})}checkSafeUint53(t,r){typeof t==\"number\"&&(r==null&&(r=\"value not safe\"),(t<0||t>=9007199254740991)&&this.throwError(r,L.errors.NUMERIC_FAULT,{operation:\"checkSafeInteger\",fault:\"out-of-safe-range\",value:t}),t%1&&this.throwError(r,L.errors.NUMERIC_FAULT,{operation:\"checkSafeInteger\",fault:\"non-integer\",value:t}))}checkArgumentCount(t,r,i){i?i=\": \"+i:i=\"\",tr&&this.throwError(\"too many arguments\"+i,L.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})}checkNew(t,r){(t===Object||t==null)&&this.throwError(\"missing new\",L.errors.MISSING_NEW,{name:r.name})}checkAbstract(t,r){t===r?this.throwError(\"cannot instantiate abstract class \"+JSON.stringify(r.name)+\" directly; use a sub-class\",L.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:\"new\"}):(t===Object||t==null)&&this.throwError(\"missing new\",L.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return gi||(gi=new L(y0)),gi}static setCensorship(t,r){if(!t&&r&&this.globalLogger().throwError(\"cannot permanently disable censorship\",L.errors.UNSUPPORTED_OPERATION,{operation:\"setCensorship\"}),Dn){if(!t)return;this.globalLogger().throwError(\"error censorship permanent\",L.errors.UNSUPPORTED_OPERATION,{operation:\"setCensorship\"})}Fn=!!t,Dn=!!r}static setLogLevel(t){const r=Cr[t.toLowerCase()];if(r==null){L.globalLogger().warn(\"invalid log level - \"+t);return}Tn=r}static from(t){return new L(t)}}L.errors=re,L.levels=Ai;const x0=\"bytes/5.7.0\",Dt=new L(x0);function qn(e){return!!e.toHexString}function rr(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return rr(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function M0(e){return Qt(e)&&!(e.length%2)||ir(e)}function Kn(e){return typeof e==\"number\"&&e==e&&e%1===0}function ir(e){if(e==null)return!1;if(e.constructor===Uint8Array)return!0;if(typeof e==\"string\"||!Kn(e.length)||e.length<0)return!1;for(let t=0;t=256)return!1}return!0}function Ot(e,t){if(t||(t={}),typeof e==\"number\"){Dt.checkSafeUint53(e,\"invalid arrayify value\");const r=[];for(;e;)r.unshift(e&255),e=parseInt(String(e/256));return r.length===0&&r.push(0),rr(new Uint8Array(r))}if(t.allowMissingPrefix&&typeof e==\"string\"&&e.substring(0,2)!==\"0x\"&&(e=\"0x\"+e),qn(e)&&(e=e.toHexString()),Qt(e)){let r=e.substring(2);r.length%2&&(t.hexPad===\"left\"?r=\"0\"+r:t.hexPad===\"right\"?r+=\"0\":Dt.throwArgumentError(\"hex data is odd-length\",\"value\",e));const i=[];for(let n=0;nOt(n)),r=t.reduce((n,o)=>n+o.length,0),i=new Uint8Array(r);return t.reduce((n,o)=>(i.set(o,n),n+o.length),0),rr(i)}function S0(e,t){e=Ot(e),e.length>t&&Dt.throwArgumentError(\"value out of range\",\"value\",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),rr(r)}function Qt(e,t){return!(typeof e!=\"string\"||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}const bi=\"0123456789abcdef\";function Kt(e,t){if(t||(t={}),typeof e==\"number\"){Dt.checkSafeUint53(e,\"invalid hexlify value\");let r=\"\";for(;e;)r=bi[e&15]+r,e=Math.floor(e/16);return r.length?(r.length%2&&(r=\"0\"+r),\"0x\"+r):\"0x00\"}if(typeof e==\"bigint\")return e=e.toString(16),e.length%2?\"0x0\"+e:\"0x\"+e;if(t.allowMissingPrefix&&typeof e==\"string\"&&e.substring(0,2)!==\"0x\"&&(e=\"0x\"+e),qn(e))return e.toHexString();if(Qt(e))return e.length%2&&(t.hexPad===\"left\"?e=\"0x0\"+e.substring(2):t.hexPad===\"right\"?e+=\"0\":Dt.throwArgumentError(\"hex data is odd-length\",\"value\",e)),e.toLowerCase();if(ir(e)){let r=\"0x\";for(let i=0;i>4]+bi[n&15]}return r}return Dt.throwArgumentError(\"invalid hexlify value\",\"value\",e)}function N0(e){if(typeof e!=\"string\")e=Kt(e);else if(!Qt(e)||e.length%2)return null;return(e.length-2)/2}function Hn(e,t,r){return typeof e!=\"string\"?e=Kt(e):(!Qt(e)||e.length%2)&&Dt.throwArgumentError(\"invalid hexData\",\"value\",e),t=2+2*t,r!=null?\"0x\"+e.substring(t,2+2*r):\"0x\"+e.substring(t)}function oe(e,t){for(typeof e!=\"string\"?e=Kt(e):Qt(e)||Dt.throwArgumentError(\"invalid hex string\",\"value\",e),e.length>2*t+2&&Dt.throwArgumentError(\"value out of range\",\"value\",arguments[1]);e.length<2*t+2;)e=\"0x0\"+e.substring(2);return e}function zn(e){const t={r:\"0x\",s:\"0x\",_vs:\"0x\",recoveryParam:0,v:0,yParityAndS:\"0x\",compact:\"0x\"};if(M0(e)){let r=Ot(e);r.length===64?(t.v=27+(r[32]>>7),r[32]&=127,t.r=Kt(r.slice(0,32)),t.s=Kt(r.slice(32,64))):r.length===65?(t.r=Kt(r.slice(0,32)),t.s=Kt(r.slice(32,64)),t.v=r[64]):Dt.throwArgumentError(\"invalid signature string\",\"signature\",e),t.v<27&&(t.v===0||t.v===1?t.v+=27:Dt.throwArgumentError(\"signature invalid v byte\",\"signature\",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=Kt(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,t._vs!=null){const n=S0(Ot(t._vs),32);t._vs=Kt(n);const o=n[0]>=128?1:0;t.recoveryParam==null?t.recoveryParam=o:t.recoveryParam!==o&&Dt.throwArgumentError(\"signature recoveryParam mismatch _vs\",\"signature\",e),n[0]&=127;const h=Kt(n);t.s==null?t.s=h:t.s!==h&&Dt.throwArgumentError(\"signature v mismatch _vs\",\"signature\",e)}if(t.recoveryParam==null)t.v==null?Dt.throwArgumentError(\"signature missing v and recoveryParam\",\"signature\",e):t.v===0||t.v===1?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(t.v==null)t.v=27+t.recoveryParam;else{const n=t.v===0||t.v===1?t.v:1-t.v%2;t.recoveryParam!==n&&Dt.throwArgumentError(\"signature recoveryParam mismatch v\",\"signature\",e)}t.r==null||!Qt(t.r)?Dt.throwArgumentError(\"signature missing or invalid r\",\"signature\",e):t.r=oe(t.r,32),t.s==null||!Qt(t.s)?Dt.throwArgumentError(\"signature missing or invalid s\",\"signature\",e):t.s=oe(t.s,32);const r=Ot(t.s);r[0]>=128&&Dt.throwArgumentError(\"signature s out of range\",\"signature\",e),t.recoveryParam&&(r[0]|=128);const i=Kt(r);t._vs&&(Qt(t._vs)||Dt.throwArgumentError(\"signature invalid _vs\",\"signature\",e),t._vs=oe(t._vs,32)),t._vs==null?t._vs=i:t._vs!==i&&Dt.throwArgumentError(\"signature _vs mismatch v and s\",\"signature\",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function yi(e){return\"0x\"+b0.keccak_256(Ot(e))}var Ln={exports:{}},I0={},_0=Object.freeze({__proto__:null,default:I0}),B0=A0(_0);(function(e){(function(t,r){function i(A,f){if(!A)throw new Error(f||\"Assertion failed\")}function n(A,f){A.super_=f;var a=function(){};a.prototype=f.prototype,A.prototype=new a,A.prototype.constructor=A}function o(A,f,a){if(o.isBN(A))return A;this.negative=0,this.words=null,this.length=0,this.red=null,A!==null&&((f===\"le\"||f===\"be\")&&(a=f,f=10),this._init(A||0,f||10,a||\"be\"))}typeof t==\"object\"?t.exports=o:r.BN=o,o.BN=o,o.wordSize=26;var h;try{typeof window<\"u\"&&typeof window.Buffer<\"u\"?h=window.Buffer:h=B0.Buffer}catch{}o.isBN=function(f){return f instanceof o?!0:f!==null&&typeof f==\"object\"&&f.constructor.wordSize===o.wordSize&&Array.isArray(f.words)},o.max=function(f,a){return f.cmp(a)>0?f:a},o.min=function(f,a){return f.cmp(a)<0?f:a},o.prototype._init=function(f,a,c){if(typeof f==\"number\")return this._initNumber(f,a,c);if(typeof f==\"object\")return this._initArray(f,a,c);a===\"hex\"&&(a=16),i(a===(a|0)&&a>=2&&a<=36),f=f.toString().replace(/\\s+/g,\"\");var d=0;f[0]===\"-\"&&(d++,this.negative=1),d=0;d-=3)x=f[d]|f[d-1]<<8|f[d-2]<<16,this.words[g]|=x<>>26-M&67108863,M+=24,M>=26&&(M-=26,g++);else if(c===\"le\")for(d=0,g=0;d>>26-M&67108863,M+=24,M>=26&&(M-=26,g++);return this._strip()};function p(A,f){var a=A.charCodeAt(f);if(a>=48&&a<=57)return a-48;if(a>=65&&a<=70)return a-55;if(a>=97&&a<=102)return a-87;i(!1,\"Invalid character in \"+A)}function b(A,f,a){var c=p(A,a);return a-1>=f&&(c|=p(A,a-1)<<4),c}o.prototype._parseHex=function(f,a,c){this.length=Math.ceil((f.length-a)/6),this.words=new Array(this.length);for(var d=0;d=a;d-=2)M=b(f,a,d)<=18?(g-=18,x+=1,this.words[x]|=M>>>26):g+=8;else{var l=f.length-a;for(d=l%2===0?a+1:a;d=18?(g-=18,x+=1,this.words[x]|=M>>>26):g+=8}this._strip()};function m(A,f,a,c){for(var d=0,g=0,x=Math.min(A.length,a),M=f;M=49?g=l-49+10:l>=17?g=l-17+10:g=l,i(l>=0&&g1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<\"u\"&&typeof Symbol.for==\"function\")try{o.prototype[Symbol.for(\"nodejs.util.inspect.custom\")]=y}catch{o.prototype.inspect=y}else o.prototype.inspect=y;function y(){return(this.red?\"\"}var S=[\"\",\"0\",\"00\",\"000\",\"0000\",\"00000\",\"000000\",\"0000000\",\"00000000\",\"000000000\",\"0000000000\",\"00000000000\",\"000000000000\",\"0000000000000\",\"00000000000000\",\"000000000000000\",\"0000000000000000\",\"00000000000000000\",\"000000000000000000\",\"0000000000000000000\",\"00000000000000000000\",\"000000000000000000000\",\"0000000000000000000000\",\"00000000000000000000000\",\"000000000000000000000000\",\"0000000000000000000000000\"],I=[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],N=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(f,a){f=f||10,a=a|0||1;var c;if(f===16||f===\"hex\"){c=\"\";for(var d=0,g=0,x=0;x>>24-d&16777215,d+=2,d>=26&&(d-=26,x--),g!==0||x!==this.length-1?c=S[6-l.length]+l+c:c=l+c}for(g!==0&&(c=g.toString(16)+c);c.length%a!==0;)c=\"0\"+c;return this.negative!==0&&(c=\"-\"+c),c}if(f===(f|0)&&f>=2&&f<=36){var s=I[f],v=N[f];c=\"\";var k=this.clone();for(k.negative=0;!k.isZero();){var u=k.modrn(v).toString(f);k=k.idivn(v),k.isZero()?c=u+c:c=S[s-u.length]+u+c}for(this.isZero()&&(c=\"0\"+c);c.length%a!==0;)c=\"0\"+c;return this.negative!==0&&(c=\"-\"+c),c}i(!1,\"Base should be between 2 and 36\")},o.prototype.toNumber=function(){var f=this.words[0];return this.length===2?f+=this.words[1]*67108864:this.length===3&&this.words[2]===1?f+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,\"Number can only safely store up to 53 bits\"),this.negative!==0?-f:f},o.prototype.toJSON=function(){return this.toString(16,2)},h&&(o.prototype.toBuffer=function(f,a){return this.toArrayLike(h,f,a)}),o.prototype.toArray=function(f,a){return this.toArrayLike(Array,f,a)};var C=function(f,a){return f.allocUnsafe?f.allocUnsafe(a):new f(a)};o.prototype.toArrayLike=function(f,a,c){this._strip();var d=this.byteLength(),g=c||Math.max(1,d);i(d<=g,\"byte array longer than desired length\"),i(g>0,\"Requested array length <= 0\");var x=C(f,g),M=a===\"le\"?\"LE\":\"BE\";return this[\"_toArrayLike\"+M](x,d),x},o.prototype._toArrayLikeLE=function(f,a){for(var c=0,d=0,g=0,x=0;g>8&255),c>16&255),x===6?(c>24&255),d=0,x=0):(d=M>>>24,x+=2)}if(c=0&&(f[c--]=M>>8&255),c>=0&&(f[c--]=M>>16&255),x===6?(c>=0&&(f[c--]=M>>24&255),d=0,x=0):(d=M>>>24,x+=2)}if(c>=0)for(f[c--]=d;c>=0;)f[c--]=0},Math.clz32?o.prototype._countBits=function(f){return 32-Math.clz32(f)}:o.prototype._countBits=function(f){var a=f,c=0;return a>=4096&&(c+=13,a>>>=13),a>=64&&(c+=7,a>>>=7),a>=8&&(c+=4,a>>>=4),a>=2&&(c+=2,a>>>=2),c+a},o.prototype._zeroBits=function(f){if(f===0)return 26;var a=f,c=0;return a&8191||(c+=13,a>>>=13),a&127||(c+=7,a>>>=7),a&15||(c+=4,a>>>=4),a&3||(c+=2,a>>>=2),a&1||c++,c},o.prototype.bitLength=function(){var f=this.words[this.length-1],a=this._countBits(f);return(this.length-1)*26+a};function F(A){for(var f=new Array(A.bitLength()),a=0;a>>d&1}return f}o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var f=0,a=0;af.length?this.clone().ior(f):f.clone().ior(this)},o.prototype.uor=function(f){return this.length>f.length?this.clone().iuor(f):f.clone().iuor(this)},o.prototype.iuand=function(f){var a;this.length>f.length?a=f:a=this;for(var c=0;cf.length?this.clone().iand(f):f.clone().iand(this)},o.prototype.uand=function(f){return this.length>f.length?this.clone().iuand(f):f.clone().iuand(this)},o.prototype.iuxor=function(f){var a,c;this.length>f.length?(a=this,c=f):(a=f,c=this);for(var d=0;df.length?this.clone().ixor(f):f.clone().ixor(this)},o.prototype.uxor=function(f){return this.length>f.length?this.clone().iuxor(f):f.clone().iuxor(this)},o.prototype.inotn=function(f){i(typeof f==\"number\"&&f>=0);var a=Math.ceil(f/26)|0,c=f%26;this._expand(a),c>0&&a--;for(var d=0;d0&&(this.words[d]=~this.words[d]&67108863>>26-c),this._strip()},o.prototype.notn=function(f){return this.clone().inotn(f)},o.prototype.setn=function(f,a){i(typeof f==\"number\"&&f>=0);var c=f/26|0,d=f%26;return this._expand(c+1),a?this.words[c]=this.words[c]|1<f.length?(c=this,d=f):(c=f,d=this);for(var g=0,x=0;x>>26;for(;g!==0&&x>>26;if(this.length=c.length,g!==0)this.words[this.length]=g,this.length++;else if(c!==this)for(;xf.length?this.clone().iadd(f):f.clone().iadd(this)},o.prototype.isub=function(f){if(f.negative!==0){f.negative=0;var a=this.iadd(f);return f.negative=1,a._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(f),this.negative=1,this._normSign();var c=this.cmp(f);if(c===0)return this.negative=0,this.length=1,this.words[0]=0,this;var d,g;c>0?(d=this,g=f):(d=f,g=this);for(var x=0,M=0;M>26,this.words[M]=a&67108863;for(;x!==0&&M>26,this.words[M]=a&67108863;if(x===0&&M>>26,k=l&67108863,u=Math.min(s,f.length-1),E=Math.max(0,s-A.length+1);E<=u;E++){var _=s-E|0;d=A.words[_]|0,g=f.words[E]|0,x=d*g+k,v+=x/67108864|0,k=x&67108863}a.words[s]=k|0,l=v|0}return l!==0?a.words[s]=l|0:a.length--,a._strip()}var J=function(f,a,c){var d=f.words,g=a.words,x=c.words,M=0,l,s,v,k=d[0]|0,u=k&8191,E=k>>>13,_=d[1]|0,B=_&8191,R=_>>>13,T=d[2]|0,P=T&8191,O=T>>>13,Ct=d[3]|0,D=Ct&8191,q=Ct>>>13,De=d[4]|0,X=De&8191,Z=De>>>13,Fe=d[5]|0,$=Fe&8191,tt=Fe>>>13,Te=d[6]|0,et=Te&8191,rt=Te>>>13,Ue=d[7]|0,it=Ue&8191,nt=Ue>>>13,ke=d[8]|0,ft=ke&8191,ot=ke>>>13,qe=d[9]|0,st=qe&8191,at=qe>>>13,Ke=g[0]|0,ut=Ke&8191,ht=Ke>>>13,He=g[1]|0,ct=He&8191,lt=He>>>13,ze=g[2]|0,dt=ze&8191,pt=ze>>>13,Le=g[3]|0,vt=Le&8191,mt=Le>>>13,je=g[4]|0,gt=je&8191,At=je>>>13,Qe=g[5]|0,bt=Qe&8191,yt=Qe>>>13,Je=g[6]|0,wt=Je&8191,xt=Je>>>13,Ge=g[7]|0,Mt=Ge&8191,Et=Ge>>>13,Ye=g[8]|0,St=Ye&8191,Nt=Ye>>>13,Ve=g[9]|0,It=Ve&8191,_t=Ve>>>13;c.negative=f.negative^a.negative,c.length=19,l=Math.imul(u,ut),s=Math.imul(u,ht),s=s+Math.imul(E,ut)|0,v=Math.imul(E,ht);var Me=(M+l|0)+((s&8191)<<13)|0;M=(v+(s>>>13)|0)+(Me>>>26)|0,Me&=67108863,l=Math.imul(B,ut),s=Math.imul(B,ht),s=s+Math.imul(R,ut)|0,v=Math.imul(R,ht),l=l+Math.imul(u,ct)|0,s=s+Math.imul(u,lt)|0,s=s+Math.imul(E,ct)|0,v=v+Math.imul(E,lt)|0;var Ee=(M+l|0)+((s&8191)<<13)|0;M=(v+(s>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,l=Math.imul(P,ut),s=Math.imul(P,ht),s=s+Math.imul(O,ut)|0,v=Math.imul(O,ht),l=l+Math.imul(B,ct)|0,s=s+Math.imul(B,lt)|0,s=s+Math.imul(R,ct)|0,v=v+Math.imul(R,lt)|0,l=l+Math.imul(u,dt)|0,s=s+Math.imul(u,pt)|0,s=s+Math.imul(E,dt)|0,v=v+Math.imul(E,pt)|0;var Se=(M+l|0)+((s&8191)<<13)|0;M=(v+(s>>>13)|0)+(Se>>>26)|0,Se&=67108863,l=Math.imul(D,ut),s=Math.imul(D,ht),s=s+Math.imul(q,ut)|0,v=Math.imul(q,ht),l=l+Math.imul(P,ct)|0,s=s+Math.imul(P,lt)|0,s=s+Math.imul(O,ct)|0,v=v+Math.imul(O,lt)|0,l=l+Math.imul(B,dt)|0,s=s+Math.imul(B,pt)|0,s=s+Math.imul(R,dt)|0,v=v+Math.imul(R,pt)|0,l=l+Math.imul(u,vt)|0,s=s+Math.imul(u,mt)|0,s=s+Math.imul(E,vt)|0,v=v+Math.imul(E,mt)|0;var Ne=(M+l|0)+((s&8191)<<13)|0;M=(v+(s>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,l=Math.imul(X,ut),s=Math.imul(X,ht),s=s+Math.imul(Z,ut)|0,v=Math.imul(Z,ht),l=l+Math.imul(D,ct)|0,s=s+Math.imul(D,lt)|0,s=s+Math.imul(q,ct)|0,v=v+Math.imul(q,lt)|0,l=l+Math.imul(P,dt)|0,s=s+Math.imul(P,pt)|0,s=s+Math.imul(O,dt)|0,v=v+Math.imul(O,pt)|0,l=l+Math.imul(B,vt)|0,s=s+Math.imul(B,mt)|0,s=s+Math.imul(R,vt)|0,v=v+Math.imul(R,mt)|0,l=l+Math.imul(u,gt)|0,s=s+Math.imul(u,At)|0,s=s+Math.imul(E,gt)|0,v=v+Math.imul(E,At)|0;var Ie=(M+l|0)+((s&8191)<<13)|0;M=(v+(s>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,l=Math.imul($,ut),s=Math.imul($,ht),s=s+Math.imul(tt,ut)|0,v=Math.imul(tt,ht),l=l+Math.imul(X,ct)|0,s=s+Math.imul(X,lt)|0,s=s+Math.imul(Z,ct)|0,v=v+Math.imul(Z,lt)|0,l=l+Math.imul(D,dt)|0,s=s+Math.imul(D,pt)|0,s=s+Math.imul(q,dt)|0,v=v+Math.imul(q,pt)|0,l=l+Math.imul(P,vt)|0,s=s+Math.imul(P,mt)|0,s=s+Math.imul(O,vt)|0,v=v+Math.imul(O,mt)|0,l=l+Math.imul(B,gt)|0,s=s+Math.imul(B,At)|0,s=s+Math.imul(R,gt)|0,v=v+Math.imul(R,At)|0,l=l+Math.imul(u,bt)|0,s=s+Math.imul(u,yt)|0,s=s+Math.imul(E,bt)|0,v=v+Math.imul(E,yt)|0;var Wr=(M+l|0)+((s&8191)<<13)|0;M=(v+(s>>>13)|0)+(Wr>>>26)|0,Wr&=67108863,l=Math.imul(et,ut),s=Math.imul(et,ht),s=s+Math.imul(rt,ut)|0,v=Math.imul(rt,ht),l=l+Math.imul($,ct)|0,s=s+Math.imul($,lt)|0,s=s+Math.imul(tt,ct)|0,v=v+Math.imul(tt,lt)|0,l=l+Math.imul(X,dt)|0,s=s+Math.imul(X,pt)|0,s=s+Math.imul(Z,dt)|0,v=v+Math.imul(Z,pt)|0,l=l+Math.imul(D,vt)|0,s=s+Math.imul(D,mt)|0,s=s+Math.imul(q,vt)|0,v=v+Math.imul(q,mt)|0,l=l+Math.imul(P,gt)|0,s=s+Math.imul(P,At)|0,s=s+Math.imul(O,gt)|0,v=v+Math.imul(O,At)|0,l=l+Math.imul(B,bt)|0,s=s+Math.imul(B,yt)|0,s=s+Math.imul(R,bt)|0,v=v+Math.imul(R,yt)|0,l=l+Math.imul(u,wt)|0,s=s+Math.imul(u,xt)|0,s=s+Math.imul(E,wt)|0,v=v+Math.imul(E,xt)|0;var Xr=(M+l|0)+((s&8191)<<13)|0;M=(v+(s>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,l=Math.imul(it,ut),s=Math.imul(it,ht),s=s+Math.imul(nt,ut)|0,v=Math.imul(nt,ht),l=l+Math.imul(et,ct)|0,s=s+Math.imul(et,lt)|0,s=s+Math.imul(rt,ct)|0,v=v+Math.imul(rt,lt)|0,l=l+Math.imul($,dt)|0,s=s+Math.imul($,pt)|0,s=s+Math.imul(tt,dt)|0,v=v+Math.imul(tt,pt)|0,l=l+Math.imul(X,vt)|0,s=s+Math.imul(X,mt)|0,s=s+Math.imul(Z,vt)|0,v=v+Math.imul(Z,mt)|0,l=l+Math.imul(D,gt)|0,s=s+Math.imul(D,At)|0,s=s+Math.imul(q,gt)|0,v=v+Math.imul(q,At)|0,l=l+Math.imul(P,bt)|0,s=s+Math.imul(P,yt)|0,s=s+Math.imul(O,bt)|0,v=v+Math.imul(O,yt)|0,l=l+Math.imul(B,wt)|0,s=s+Math.imul(B,xt)|0,s=s+Math.imul(R,wt)|0,v=v+Math.imul(R,xt)|0,l=l+Math.imul(u,Mt)|0,s=s+Math.imul(u,Et)|0,s=s+Math.imul(E,Mt)|0,v=v+Math.imul(E,Et)|0;var Zr=(M+l|0)+((s&8191)<<13)|0;M=(v+(s>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,l=Math.imul(ft,ut),s=Math.imul(ft,ht),s=s+Math.imul(ot,ut)|0,v=Math.imul(ot,ht),l=l+Math.imul(it,ct)|0,s=s+Math.imul(it,lt)|0,s=s+Math.imul(nt,ct)|0,v=v+Math.imul(nt,lt)|0,l=l+Math.imul(et,dt)|0,s=s+Math.imul(et,pt)|0,s=s+Math.imul(rt,dt)|0,v=v+Math.imul(rt,pt)|0,l=l+Math.imul($,vt)|0,s=s+Math.imul($,mt)|0,s=s+Math.imul(tt,vt)|0,v=v+Math.imul(tt,mt)|0,l=l+Math.imul(X,gt)|0,s=s+Math.imul(X,At)|0,s=s+Math.imul(Z,gt)|0,v=v+Math.imul(Z,At)|0,l=l+Math.imul(D,bt)|0,s=s+Math.imul(D,yt)|0,s=s+Math.imul(q,bt)|0,v=v+Math.imul(q,yt)|0,l=l+Math.imul(P,wt)|0,s=s+Math.imul(P,xt)|0,s=s+Math.imul(O,wt)|0,v=v+Math.imul(O,xt)|0,l=l+Math.imul(B,Mt)|0,s=s+Math.imul(B,Et)|0,s=s+Math.imul(R,Mt)|0,v=v+Math.imul(R,Et)|0,l=l+Math.imul(u,St)|0,s=s+Math.imul(u,Nt)|0,s=s+Math.imul(E,St)|0,v=v+Math.imul(E,Nt)|0;var $r=(M+l|0)+((s&8191)<<13)|0;M=(v+(s>>>13)|0)+($r>>>26)|0,$r&=67108863,l=Math.imul(st,ut),s=Math.imul(st,ht),s=s+Math.imul(at,ut)|0,v=Math.imul(at,ht),l=l+Math.imul(ft,ct)|0,s=s+Math.imul(ft,lt)|0,s=s+Math.imul(ot,ct)|0,v=v+Math.imul(ot,lt)|0,l=l+Math.imul(it,dt)|0,s=s+Math.imul(it,pt)|0,s=s+Math.imul(nt,dt)|0,v=v+Math.imul(nt,pt)|0,l=l+Math.imul(et,vt)|0,s=s+Math.imul(et,mt)|0,s=s+Math.imul(rt,vt)|0,v=v+Math.imul(rt,mt)|0,l=l+Math.imul($,gt)|0,s=s+Math.imul($,At)|0,s=s+Math.imul(tt,gt)|0,v=v+Math.imul(tt,At)|0,l=l+Math.imul(X,bt)|0,s=s+Math.imul(X,yt)|0,s=s+Math.imul(Z,bt)|0,v=v+Math.imul(Z,yt)|0,l=l+Math.imul(D,wt)|0,s=s+Math.imul(D,xt)|0,s=s+Math.imul(q,wt)|0,v=v+Math.imul(q,xt)|0,l=l+Math.imul(P,Mt)|0,s=s+Math.imul(P,Et)|0,s=s+Math.imul(O,Mt)|0,v=v+Math.imul(O,Et)|0,l=l+Math.imul(B,St)|0,s=s+Math.imul(B,Nt)|0,s=s+Math.imul(R,St)|0,v=v+Math.imul(R,Nt)|0,l=l+Math.imul(u,It)|0,s=s+Math.imul(u,_t)|0,s=s+Math.imul(E,It)|0,v=v+Math.imul(E,_t)|0;var ti=(M+l|0)+((s&8191)<<13)|0;M=(v+(s>>>13)|0)+(ti>>>26)|0,ti&=67108863,l=Math.imul(st,ct),s=Math.imul(st,lt),s=s+Math.imul(at,ct)|0,v=Math.imul(at,lt),l=l+Math.imul(ft,dt)|0,s=s+Math.imul(ft,pt)|0,s=s+Math.imul(ot,dt)|0,v=v+Math.imul(ot,pt)|0,l=l+Math.imul(it,vt)|0,s=s+Math.imul(it,mt)|0,s=s+Math.imul(nt,vt)|0,v=v+Math.imul(nt,mt)|0,l=l+Math.imul(et,gt)|0,s=s+Math.imul(et,At)|0,s=s+Math.imul(rt,gt)|0,v=v+Math.imul(rt,At)|0,l=l+Math.imul($,bt)|0,s=s+Math.imul($,yt)|0,s=s+Math.imul(tt,bt)|0,v=v+Math.imul(tt,yt)|0,l=l+Math.imul(X,wt)|0,s=s+Math.imul(X,xt)|0,s=s+Math.imul(Z,wt)|0,v=v+Math.imul(Z,xt)|0,l=l+Math.imul(D,Mt)|0,s=s+Math.imul(D,Et)|0,s=s+Math.imul(q,Mt)|0,v=v+Math.imul(q,Et)|0,l=l+Math.imul(P,St)|0,s=s+Math.imul(P,Nt)|0,s=s+Math.imul(O,St)|0,v=v+Math.imul(O,Nt)|0,l=l+Math.imul(B,It)|0,s=s+Math.imul(B,_t)|0,s=s+Math.imul(R,It)|0,v=v+Math.imul(R,_t)|0;var ei=(M+l|0)+((s&8191)<<13)|0;M=(v+(s>>>13)|0)+(ei>>>26)|0,ei&=67108863,l=Math.imul(st,dt),s=Math.imul(st,pt),s=s+Math.imul(at,dt)|0,v=Math.imul(at,pt),l=l+Math.imul(ft,vt)|0,s=s+Math.imul(ft,mt)|0,s=s+Math.imul(ot,vt)|0,v=v+Math.imul(ot,mt)|0,l=l+Math.imul(it,gt)|0,s=s+Math.imul(it,At)|0,s=s+Math.imul(nt,gt)|0,v=v+Math.imul(nt,At)|0,l=l+Math.imul(et,bt)|0,s=s+Math.imul(et,yt)|0,s=s+Math.imul(rt,bt)|0,v=v+Math.imul(rt,yt)|0,l=l+Math.imul($,wt)|0,s=s+Math.imul($,xt)|0,s=s+Math.imul(tt,wt)|0,v=v+Math.imul(tt,xt)|0,l=l+Math.imul(X,Mt)|0,s=s+Math.imul(X,Et)|0,s=s+Math.imul(Z,Mt)|0,v=v+Math.imul(Z,Et)|0,l=l+Math.imul(D,St)|0,s=s+Math.imul(D,Nt)|0,s=s+Math.imul(q,St)|0,v=v+Math.imul(q,Nt)|0,l=l+Math.imul(P,It)|0,s=s+Math.imul(P,_t)|0,s=s+Math.imul(O,It)|0,v=v+Math.imul(O,_t)|0;var ri=(M+l|0)+((s&8191)<<13)|0;M=(v+(s>>>13)|0)+(ri>>>26)|0,ri&=67108863,l=Math.imul(st,vt),s=Math.imul(st,mt),s=s+Math.imul(at,vt)|0,v=Math.imul(at,mt),l=l+Math.imul(ft,gt)|0,s=s+Math.imul(ft,At)|0,s=s+Math.imul(ot,gt)|0,v=v+Math.imul(ot,At)|0,l=l+Math.imul(it,bt)|0,s=s+Math.imul(it,yt)|0,s=s+Math.imul(nt,bt)|0,v=v+Math.imul(nt,yt)|0,l=l+Math.imul(et,wt)|0,s=s+Math.imul(et,xt)|0,s=s+Math.imul(rt,wt)|0,v=v+Math.imul(rt,xt)|0,l=l+Math.imul($,Mt)|0,s=s+Math.imul($,Et)|0,s=s+Math.imul(tt,Mt)|0,v=v+Math.imul(tt,Et)|0,l=l+Math.imul(X,St)|0,s=s+Math.imul(X,Nt)|0,s=s+Math.imul(Z,St)|0,v=v+Math.imul(Z,Nt)|0,l=l+Math.imul(D,It)|0,s=s+Math.imul(D,_t)|0,s=s+Math.imul(q,It)|0,v=v+Math.imul(q,_t)|0;var ii=(M+l|0)+((s&8191)<<13)|0;M=(v+(s>>>13)|0)+(ii>>>26)|0,ii&=67108863,l=Math.imul(st,gt),s=Math.imul(st,At),s=s+Math.imul(at,gt)|0,v=Math.imul(at,At),l=l+Math.imul(ft,bt)|0,s=s+Math.imul(ft,yt)|0,s=s+Math.imul(ot,bt)|0,v=v+Math.imul(ot,yt)|0,l=l+Math.imul(it,wt)|0,s=s+Math.imul(it,xt)|0,s=s+Math.imul(nt,wt)|0,v=v+Math.imul(nt,xt)|0,l=l+Math.imul(et,Mt)|0,s=s+Math.imul(et,Et)|0,s=s+Math.imul(rt,Mt)|0,v=v+Math.imul(rt,Et)|0,l=l+Math.imul($,St)|0,s=s+Math.imul($,Nt)|0,s=s+Math.imul(tt,St)|0,v=v+Math.imul(tt,Nt)|0,l=l+Math.imul(X,It)|0,s=s+Math.imul(X,_t)|0,s=s+Math.imul(Z,It)|0,v=v+Math.imul(Z,_t)|0;var ni=(M+l|0)+((s&8191)<<13)|0;M=(v+(s>>>13)|0)+(ni>>>26)|0,ni&=67108863,l=Math.imul(st,bt),s=Math.imul(st,yt),s=s+Math.imul(at,bt)|0,v=Math.imul(at,yt),l=l+Math.imul(ft,wt)|0,s=s+Math.imul(ft,xt)|0,s=s+Math.imul(ot,wt)|0,v=v+Math.imul(ot,xt)|0,l=l+Math.imul(it,Mt)|0,s=s+Math.imul(it,Et)|0,s=s+Math.imul(nt,Mt)|0,v=v+Math.imul(nt,Et)|0,l=l+Math.imul(et,St)|0,s=s+Math.imul(et,Nt)|0,s=s+Math.imul(rt,St)|0,v=v+Math.imul(rt,Nt)|0,l=l+Math.imul($,It)|0,s=s+Math.imul($,_t)|0,s=s+Math.imul(tt,It)|0,v=v+Math.imul(tt,_t)|0;var fi=(M+l|0)+((s&8191)<<13)|0;M=(v+(s>>>13)|0)+(fi>>>26)|0,fi&=67108863,l=Math.imul(st,wt),s=Math.imul(st,xt),s=s+Math.imul(at,wt)|0,v=Math.imul(at,xt),l=l+Math.imul(ft,Mt)|0,s=s+Math.imul(ft,Et)|0,s=s+Math.imul(ot,Mt)|0,v=v+Math.imul(ot,Et)|0,l=l+Math.imul(it,St)|0,s=s+Math.imul(it,Nt)|0,s=s+Math.imul(nt,St)|0,v=v+Math.imul(nt,Nt)|0,l=l+Math.imul(et,It)|0,s=s+Math.imul(et,_t)|0,s=s+Math.imul(rt,It)|0,v=v+Math.imul(rt,_t)|0;var oi=(M+l|0)+((s&8191)<<13)|0;M=(v+(s>>>13)|0)+(oi>>>26)|0,oi&=67108863,l=Math.imul(st,Mt),s=Math.imul(st,Et),s=s+Math.imul(at,Mt)|0,v=Math.imul(at,Et),l=l+Math.imul(ft,St)|0,s=s+Math.imul(ft,Nt)|0,s=s+Math.imul(ot,St)|0,v=v+Math.imul(ot,Nt)|0,l=l+Math.imul(it,It)|0,s=s+Math.imul(it,_t)|0,s=s+Math.imul(nt,It)|0,v=v+Math.imul(nt,_t)|0;var si=(M+l|0)+((s&8191)<<13)|0;M=(v+(s>>>13)|0)+(si>>>26)|0,si&=67108863,l=Math.imul(st,St),s=Math.imul(st,Nt),s=s+Math.imul(at,St)|0,v=Math.imul(at,Nt),l=l+Math.imul(ft,It)|0,s=s+Math.imul(ft,_t)|0,s=s+Math.imul(ot,It)|0,v=v+Math.imul(ot,_t)|0;var ai=(M+l|0)+((s&8191)<<13)|0;M=(v+(s>>>13)|0)+(ai>>>26)|0,ai&=67108863,l=Math.imul(st,It),s=Math.imul(st,_t),s=s+Math.imul(at,It)|0,v=Math.imul(at,_t);var ui=(M+l|0)+((s&8191)<<13)|0;return M=(v+(s>>>13)|0)+(ui>>>26)|0,ui&=67108863,x[0]=Me,x[1]=Ee,x[2]=Se,x[3]=Ne,x[4]=Ie,x[5]=Wr,x[6]=Xr,x[7]=Zr,x[8]=$r,x[9]=ti,x[10]=ei,x[11]=ri,x[12]=ii,x[13]=ni,x[14]=fi,x[15]=oi,x[16]=si,x[17]=ai,x[18]=ui,M!==0&&(x[19]=M,c.length++),c};Math.imul||(J=U);function Bt(A,f,a){a.negative=f.negative^A.negative,a.length=A.length+f.length;for(var c=0,d=0,g=0;g>>26)|0,d+=x>>>26,x&=67108863}a.words[g]=M,c=x,x=d}return c!==0?a.words[g]=c:a.length--,a._strip()}function G(A,f,a){return Bt(A,f,a)}o.prototype.mulTo=function(f,a){var c,d=this.length+f.length;return this.length===10&&f.length===10?c=J(this,f,a):d<63?c=U(this,f,a):d<1024?c=Bt(this,f,a):c=G(this,f,a),c},o.prototype.mul=function(f){var a=new o(null);return a.words=new Array(this.length+f.length),this.mulTo(f,a)},o.prototype.mulf=function(f){var a=new o(null);return a.words=new Array(this.length+f.length),G(this,f,a)},o.prototype.imul=function(f){return this.clone().mulTo(f,this)},o.prototype.imuln=function(f){var a=f<0;a&&(f=-f),i(typeof f==\"number\"),i(f<67108864);for(var c=0,d=0;d>=26,c+=g/67108864|0,c+=x>>>26,this.words[d]=x&67108863}return c!==0&&(this.words[d]=c,this.length++),a?this.ineg():this},o.prototype.muln=function(f){return this.clone().imuln(f)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(f){var a=F(f);if(a.length===0)return new o(1);for(var c=this,d=0;d=0);var a=f%26,c=(f-a)/26,d=67108863>>>26-a<<26-a,g;if(a!==0){var x=0;for(g=0;g>>26-a}x&&(this.words[g]=x,this.length++)}if(c!==0){for(g=this.length-1;g>=0;g--)this.words[g+c]=this.words[g];for(g=0;g=0);var d;a?d=(a-a%26)/26:d=0;var g=f%26,x=Math.min((f-g)/26,this.length),M=67108863^67108863>>>g<x)for(this.length-=x,s=0;s=0&&(v!==0||s>=d);s--){var k=this.words[s]|0;this.words[s]=v<<26-g|k>>>g,v=k&M}return l&&v!==0&&(l.words[l.length++]=v),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(f,a,c){return i(this.negative===0),this.iushrn(f,a,c)},o.prototype.shln=function(f){return this.clone().ishln(f)},o.prototype.ushln=function(f){return this.clone().iushln(f)},o.prototype.shrn=function(f){return this.clone().ishrn(f)},o.prototype.ushrn=function(f){return this.clone().iushrn(f)},o.prototype.testn=function(f){i(typeof f==\"number\"&&f>=0);var a=f%26,c=(f-a)/26,d=1<=0);var a=f%26,c=(f-a)/26;if(i(this.negative===0,\"imaskn works only with positive numbers\"),this.length<=c)return this;if(a!==0&&c++,this.length=Math.min(c,this.length),a!==0){var d=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},o.prototype.isubn=function(f){if(i(typeof f==\"number\"),i(f<67108864),f<0)return this.iaddn(-f);if(this.negative!==0)return this.negative=0,this.iaddn(f),this.negative=1,this;if(this.words[0]-=f,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(l/67108864|0),this.words[g+c]=x&67108863}for(;g>26,this.words[g+c]=x&67108863;if(M===0)return this._strip();for(i(M===-1),M=0,g=0;g>26,this.words[g]=x&67108863;return this.negative=1,this._strip()},o.prototype._wordDiv=function(f,a){var c=this.length-f.length,d=this.clone(),g=f,x=g.words[g.length-1]|0,M=this._countBits(x);c=26-M,c!==0&&(g=g.ushln(c),d.iushln(c),x=g.words[g.length-1]|0);var l=d.length-g.length,s;if(a!==\"mod\"){s=new o(null),s.length=l+1,s.words=new Array(s.length);for(var v=0;v=0;u--){var E=(d.words[g.length+u]|0)*67108864+(d.words[g.length+u-1]|0);for(E=Math.min(E/x|0,67108863),d._ishlnsubmul(g,E,u);d.negative!==0;)E--,d.negative=0,d._ishlnsubmul(g,1,u),d.isZero()||(d.negative^=1);s&&(s.words[u]=E)}return s&&s._strip(),d._strip(),a!==\"div\"&&c!==0&&d.iushrn(c),{div:s||null,mod:d}},o.prototype.divmod=function(f,a,c){if(i(!f.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var d,g,x;return this.negative!==0&&f.negative===0?(x=this.neg().divmod(f,a),a!==\"mod\"&&(d=x.div.neg()),a!==\"div\"&&(g=x.mod.neg(),c&&g.negative!==0&&g.iadd(f)),{div:d,mod:g}):this.negative===0&&f.negative!==0?(x=this.divmod(f.neg(),a),a!==\"mod\"&&(d=x.div.neg()),{div:d,mod:x.mod}):this.negative&f.negative?(x=this.neg().divmod(f.neg(),a),a!==\"div\"&&(g=x.mod.neg(),c&&g.negative!==0&&g.isub(f)),{div:x.div,mod:g}):f.length>this.length||this.cmp(f)<0?{div:new o(0),mod:this}:f.length===1?a===\"div\"?{div:this.divn(f.words[0]),mod:null}:a===\"mod\"?{div:null,mod:new o(this.modrn(f.words[0]))}:{div:this.divn(f.words[0]),mod:new o(this.modrn(f.words[0]))}:this._wordDiv(f,a)},o.prototype.div=function(f){return this.divmod(f,\"div\",!1).div},o.prototype.mod=function(f){return this.divmod(f,\"mod\",!1).mod},o.prototype.umod=function(f){return this.divmod(f,\"mod\",!0).mod},o.prototype.divRound=function(f){var a=this.divmod(f);if(a.mod.isZero())return a.div;var c=a.div.negative!==0?a.mod.isub(f):a.mod,d=f.ushrn(1),g=f.andln(1),x=c.cmp(d);return x<0||g===1&&x===0?a.div:a.div.negative!==0?a.div.isubn(1):a.div.iaddn(1)},o.prototype.modrn=function(f){var a=f<0;a&&(f=-f),i(f<=67108863);for(var c=(1<<26)%f,d=0,g=this.length-1;g>=0;g--)d=(c*d+(this.words[g]|0))%f;return a?-d:d},o.prototype.modn=function(f){return this.modrn(f)},o.prototype.idivn=function(f){var a=f<0;a&&(f=-f),i(f<=67108863);for(var c=0,d=this.length-1;d>=0;d--){var g=(this.words[d]|0)+c*67108864;this.words[d]=g/f|0,c=g%f}return this._strip(),a?this.ineg():this},o.prototype.divn=function(f){return this.clone().idivn(f)},o.prototype.egcd=function(f){i(f.negative===0),i(!f.isZero());var a=this,c=f.clone();a.negative!==0?a=a.umod(f):a=a.clone();for(var d=new o(1),g=new o(0),x=new o(0),M=new o(1),l=0;a.isEven()&&c.isEven();)a.iushrn(1),c.iushrn(1),++l;for(var s=c.clone(),v=a.clone();!a.isZero();){for(var k=0,u=1;!(a.words[0]&u)&&k<26;++k,u<<=1);if(k>0)for(a.iushrn(k);k-- >0;)(d.isOdd()||g.isOdd())&&(d.iadd(s),g.isub(v)),d.iushrn(1),g.iushrn(1);for(var E=0,_=1;!(c.words[0]&_)&&E<26;++E,_<<=1);if(E>0)for(c.iushrn(E);E-- >0;)(x.isOdd()||M.isOdd())&&(x.iadd(s),M.isub(v)),x.iushrn(1),M.iushrn(1);a.cmp(c)>=0?(a.isub(c),d.isub(x),g.isub(M)):(c.isub(a),x.isub(d),M.isub(g))}return{a:x,b:M,gcd:c.iushln(l)}},o.prototype._invmp=function(f){i(f.negative===0),i(!f.isZero());var a=this,c=f.clone();a.negative!==0?a=a.umod(f):a=a.clone();for(var d=new o(1),g=new o(0),x=c.clone();a.cmpn(1)>0&&c.cmpn(1)>0;){for(var M=0,l=1;!(a.words[0]&l)&&M<26;++M,l<<=1);if(M>0)for(a.iushrn(M);M-- >0;)d.isOdd()&&d.iadd(x),d.iushrn(1);for(var s=0,v=1;!(c.words[0]&v)&&s<26;++s,v<<=1);if(s>0)for(c.iushrn(s);s-- >0;)g.isOdd()&&g.iadd(x),g.iushrn(1);a.cmp(c)>=0?(a.isub(c),d.isub(g)):(c.isub(a),g.isub(d))}var k;return a.cmpn(1)===0?k=d:k=g,k.cmpn(0)<0&&k.iadd(f),k},o.prototype.gcd=function(f){if(this.isZero())return f.abs();if(f.isZero())return this.abs();var a=this.clone(),c=f.clone();a.negative=0,c.negative=0;for(var d=0;a.isEven()&&c.isEven();d++)a.iushrn(1),c.iushrn(1);do{for(;a.isEven();)a.iushrn(1);for(;c.isEven();)c.iushrn(1);var g=a.cmp(c);if(g<0){var x=a;a=c,c=x}else if(g===0||c.cmpn(1)===0)break;a.isub(c)}while(!0);return c.iushln(d)},o.prototype.invm=function(f){return this.egcd(f).a.umod(f)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(f){return this.words[0]&f},o.prototype.bincn=function(f){i(typeof f==\"number\");var a=f%26,c=(f-a)/26,d=1<>>26,M&=67108863,this.words[x]=M}return g!==0&&(this.words[x]=g,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(f){var a=f<0;if(this.negative!==0&&!a)return-1;if(this.negative===0&&a)return 1;this._strip();var c;if(this.length>1)c=1;else{a&&(f=-f),i(f<=67108863,\"Number is too big\");var d=this.words[0]|0;c=d===f?0:df.length)return 1;if(this.length=0;c--){var d=this.words[c]|0,g=f.words[c]|0;if(d!==g){dg&&(a=1);break}}return a},o.prototype.gtn=function(f){return this.cmpn(f)===1},o.prototype.gt=function(f){return this.cmp(f)===1},o.prototype.gten=function(f){return this.cmpn(f)>=0},o.prototype.gte=function(f){return this.cmp(f)>=0},o.prototype.ltn=function(f){return this.cmpn(f)===-1},o.prototype.lt=function(f){return this.cmp(f)===-1},o.prototype.lten=function(f){return this.cmpn(f)<=0},o.prototype.lte=function(f){return this.cmp(f)<=0},o.prototype.eqn=function(f){return this.cmpn(f)===0},o.prototype.eq=function(f){return this.cmp(f)===0},o.red=function(f){return new Y(f)},o.prototype.toRed=function(f){return i(!this.red,\"Already a number in reduction context\"),i(this.negative===0,\"red works only with positives\"),f.convertTo(this)._forceRed(f)},o.prototype.fromRed=function(){return i(this.red,\"fromRed works only with numbers in reduction context\"),this.red.convertFrom(this)},o.prototype._forceRed=function(f){return this.red=f,this},o.prototype.forceRed=function(f){return i(!this.red,\"Already a number in reduction context\"),this._forceRed(f)},o.prototype.redAdd=function(f){return i(this.red,\"redAdd works only with red numbers\"),this.red.add(this,f)},o.prototype.redIAdd=function(f){return i(this.red,\"redIAdd works only with red numbers\"),this.red.iadd(this,f)},o.prototype.redSub=function(f){return i(this.red,\"redSub works only with red numbers\"),this.red.sub(this,f)},o.prototype.redISub=function(f){return i(this.red,\"redISub works only with red numbers\"),this.red.isub(this,f)},o.prototype.redShl=function(f){return i(this.red,\"redShl works only with red numbers\"),this.red.shl(this,f)},o.prototype.redMul=function(f){return i(this.red,\"redMul works only with red numbers\"),this.red._verify2(this,f),this.red.mul(this,f)},o.prototype.redIMul=function(f){return i(this.red,\"redMul works only with red numbers\"),this.red._verify2(this,f),this.red.imul(this,f)},o.prototype.redSqr=function(){return i(this.red,\"redSqr works only with red numbers\"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,\"redISqr works only with red numbers\"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,\"redSqrt works only with red numbers\"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,\"redInvm works only with red numbers\"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,\"redNeg works only with red numbers\"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(f){return i(this.red&&!f.red,\"redPow(normalNum)\"),this.red._verify1(this),this.red.pow(this,f)};var H={k256:null,p224:null,p192:null,p25519:null};function z(A,f){this.name=A,this.p=new o(f,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}z.prototype._tmp=function(){var f=new o(null);return f.words=new Array(Math.ceil(this.n/13)),f},z.prototype.ireduce=function(f){var a=f,c;do this.split(a,this.tmp),a=this.imulK(a),a=a.iadd(this.tmp),c=a.bitLength();while(c>this.n);var d=c0?a.isub(this.p):a.strip!==void 0?a.strip():a._strip(),a},z.prototype.split=function(f,a){f.iushrn(this.n,0,a)},z.prototype.imulK=function(f){return f.imul(this.k)};function Pt(){z.call(this,\"k256\",\"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f\")}n(Pt,z),Pt.prototype.split=function(f,a){for(var c=4194303,d=Math.min(f.length,9),g=0;g>>22,x=M}x>>>=22,f.words[g-10]=x,x===0&&f.length>10?f.length-=10:f.length-=9},Pt.prototype.imulK=function(f){f.words[f.length]=0,f.words[f.length+1]=0,f.length+=2;for(var a=0,c=0;c>>=26,f.words[c]=g,a=d}return a!==0&&(f.words[f.length++]=a),f},o._prime=function(f){if(H[f])return H[f];var a;if(f===\"k256\")a=new Pt;else if(f===\"p224\")a=new W;else if(f===\"p192\")a=new Rt;else if(f===\"p25519\")a=new Yt;else throw new Error(\"Unknown prime \"+f);return H[f]=a,a};function Y(A){if(typeof A==\"string\"){var f=o._prime(A);this.m=f.p,this.prime=f}else i(A.gtn(1),\"modulus must be greater than 1\"),this.m=A,this.prime=null}Y.prototype._verify1=function(f){i(f.negative===0,\"red works only with positives\"),i(f.red,\"red works only with red numbers\")},Y.prototype._verify2=function(f,a){i((f.negative|a.negative)===0,\"red works only with positives\"),i(f.red&&f.red===a.red,\"red works only with red numbers\")},Y.prototype.imod=function(f){return this.prime?this.prime.ireduce(f)._forceRed(this):(w(f,f.umod(this.m)._forceRed(this)),f)},Y.prototype.neg=function(f){return f.isZero()?f.clone():this.m.sub(f)._forceRed(this)},Y.prototype.add=function(f,a){this._verify2(f,a);var c=f.add(a);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},Y.prototype.iadd=function(f,a){this._verify2(f,a);var c=f.iadd(a);return c.cmp(this.m)>=0&&c.isub(this.m),c},Y.prototype.sub=function(f,a){this._verify2(f,a);var c=f.sub(a);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},Y.prototype.isub=function(f,a){this._verify2(f,a);var c=f.isub(a);return c.cmpn(0)<0&&c.iadd(this.m),c},Y.prototype.shl=function(f,a){return this._verify1(f),this.imod(f.ushln(a))},Y.prototype.imul=function(f,a){return this._verify2(f,a),this.imod(f.imul(a))},Y.prototype.mul=function(f,a){return this._verify2(f,a),this.imod(f.mul(a))},Y.prototype.isqr=function(f){return this.imul(f,f.clone())},Y.prototype.sqr=function(f){return this.mul(f,f)},Y.prototype.sqrt=function(f){if(f.isZero())return f.clone();var a=this.m.andln(3);if(i(a%2===1),a===3){var c=this.m.add(new o(1)).iushrn(2);return this.pow(f,c)}for(var d=this.m.subn(1),g=0;!d.isZero()&&d.andln(1)===0;)g++,d.iushrn(1);i(!d.isZero());var x=new o(1).toRed(this),M=x.redNeg(),l=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new o(2*s*s).toRed(this);this.pow(s,l).cmp(M)!==0;)s.redIAdd(M);for(var v=this.pow(s,d),k=this.pow(f,d.addn(1).iushrn(1)),u=this.pow(f,d),E=g;u.cmp(x)!==0;){for(var _=u,B=0;_.cmp(x)!==0;B++)_=_.redSqr();i(B=0;g--){for(var v=a.words[g],k=s-1;k>=0;k--){var u=v>>k&1;if(x!==d[0]&&(x=this.sqr(x)),u===0&&M===0){l=0;continue}M<<=1,M|=u,l++,!(l!==c&&(g!==0||k!==0))&&(x=this.mul(x,d[M]),l=0,M=0)}s=26}return x},Y.prototype.convertTo=function(f){var a=f.umod(this.m);return a===f?a.clone():a},Y.prototype.convertFrom=function(f){var a=f.clone();return a.red=null,a},o.mont=function(f){return new Vt(f)};function Vt(A){Y.call(this,A),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(Vt,Y),Vt.prototype.convertTo=function(f){return this.imod(f.ushln(this.shift))},Vt.prototype.convertFrom=function(f){var a=this.imod(f.mul(this.rinv));return a.red=null,a},Vt.prototype.imul=function(f,a){if(f.isZero()||a.isZero())return f.words[0]=0,f.length=1,f;var c=f.imul(a),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),g=c.isub(d).iushrn(this.shift),x=g;return g.cmp(this.m)>=0?x=g.isub(this.m):g.cmpn(0)<0&&(x=g.iadd(this.m)),x._forceRed(this)},Vt.prototype.mul=function(f,a){if(f.isZero()||a.isZero())return new o(0)._forceRed(this);var c=f.mul(a),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),g=c.isub(d).iushrn(this.shift),x=g;return g.cmp(this.m)>=0?x=g.isub(this.m):g.cmpn(0)<0&&(x=g.iadd(this.m)),x._forceRed(this)},Vt.prototype.invm=function(f){var a=this.imod(f._invmp(this.m).mul(this.r2));return a._forceRed(this)}})(e,On)})(Ln);var K=Ln.exports;const jn=\"bignumber/5.7.0\";var Rr=K.BN;const Ae=new L(jn),wi={},Qn=9007199254740991;function C0(e){return e!=null&&(V.isBigNumber(e)||typeof e==\"number\"&&e%1===0||typeof e==\"string\"&&!!e.match(/^-?[0-9]+$/)||Qt(e)||typeof e==\"bigint\"||ir(e))}let Jn=!1;class V{constructor(t,r){t!==wi&&Ae.throwError(\"cannot call constructor directly; use BigNumber.from\",L.errors.UNSUPPORTED_OPERATION,{operation:\"new (BigNumber)\"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return Lt(j(this).fromTwos(t))}toTwos(t){return Lt(j(this).toTwos(t))}abs(){return this._hex[0]===\"-\"?V.from(this._hex.substring(1)):this}add(t){return Lt(j(this).add(j(t)))}sub(t){return Lt(j(this).sub(j(t)))}div(t){return V.from(t).isZero()&&Wt(\"division-by-zero\",\"div\"),Lt(j(this).div(j(t)))}mul(t){return Lt(j(this).mul(j(t)))}mod(t){const r=j(t);return r.isNeg()&&Wt(\"division-by-zero\",\"mod\"),Lt(j(this).umod(r))}pow(t){const r=j(t);return r.isNeg()&&Wt(\"negative-power\",\"pow\"),Lt(j(this).pow(r))}and(t){const r=j(t);return(this.isNegative()||r.isNeg())&&Wt(\"unbound-bitwise-result\",\"and\"),Lt(j(this).and(r))}or(t){const r=j(t);return(this.isNegative()||r.isNeg())&&Wt(\"unbound-bitwise-result\",\"or\"),Lt(j(this).or(r))}xor(t){const r=j(t);return(this.isNegative()||r.isNeg())&&Wt(\"unbound-bitwise-result\",\"xor\"),Lt(j(this).xor(r))}mask(t){return(this.isNegative()||t<0)&&Wt(\"negative-width\",\"mask\"),Lt(j(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&Wt(\"negative-width\",\"shl\"),Lt(j(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&Wt(\"negative-width\",\"shr\"),Lt(j(this).shrn(t))}eq(t){return j(this).eq(j(t))}lt(t){return j(this).lt(j(t))}lte(t){return j(this).lte(j(t))}gt(t){return j(this).gt(j(t))}gte(t){return j(this).gte(j(t))}isNegative(){return this._hex[0]===\"-\"}isZero(){return j(this).isZero()}toNumber(){try{return j(this).toNumber()}catch{Wt(\"overflow\",\"toNumber\",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Ae.throwError(\"this platform does not support BigInt\",L.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?Jn||(Jn=!0,Ae.warn(\"BigNumber.toString does not accept any parameters; base-10 is assumed\")):arguments[0]===16?Ae.throwError(\"BigNumber.toString does not accept any parameters; use bigNumber.toHexString()\",L.errors.UNEXPECTED_ARGUMENT,{}):Ae.throwError(\"BigNumber.toString does not accept parameters\",L.errors.UNEXPECTED_ARGUMENT,{})),j(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:\"BigNumber\",hex:this.toHexString()}}static from(t){if(t instanceof V)return t;if(typeof t==\"string\")return t.match(/^-?0x[0-9a-f]+$/i)?new V(wi,vr(t)):t.match(/^-?[0-9]+$/)?new V(wi,vr(new Rr(t))):Ae.throwArgumentError(\"invalid BigNumber string\",\"value\",t);if(typeof t==\"number\")return t%1&&Wt(\"underflow\",\"BigNumber.from\",t),(t>=Qn||t<=-Qn)&&Wt(\"overflow\",\"BigNumber.from\",t),V.from(String(t));const r=t;if(typeof r==\"bigint\")return V.from(r.toString());if(ir(r))return V.from(Kt(r));if(r)if(r.toHexString){const i=r.toHexString();if(typeof i==\"string\")return V.from(i)}else{let i=r._hex;if(i==null&&r.type===\"BigNumber\"&&(i=r.hex),typeof i==\"string\"&&(Qt(i)||i[0]===\"-\"&&Qt(i.substring(1))))return V.from(i)}return Ae.throwArgumentError(\"invalid BigNumber value\",\"value\",t)}static isBigNumber(t){return!!(t&&t._isBigNumber)}}function vr(e){if(typeof e!=\"string\")return vr(e.toString(16));if(e[0]===\"-\")return e=e.substring(1),e[0]===\"-\"&&Ae.throwArgumentError(\"invalid hex\",\"value\",e),e=vr(e),e===\"0x00\"?e:\"-\"+e;if(e.substring(0,2)!==\"0x\"&&(e=\"0x\"+e),e===\"0x\")return\"0x00\";for(e.length%2&&(e=\"0x0\"+e.substring(2));e.length>4&&e.substring(0,4)===\"0x00\";)e=\"0x\"+e.substring(4);return e}function Lt(e){return V.from(vr(e))}function j(e){const t=V.from(e).toHexString();return t[0]===\"-\"?new Rr(\"-\"+t.substring(3),16):new Rr(t.substring(2),16)}function Wt(e,t,r){const i={fault:e,operation:t};return r!=null&&(i.value=r),Ae.throwError(e,L.errors.NUMERIC_FAULT,i)}function R0(e){return new Rr(e,36).toString(16)}const Ht=new L(jn),mr={},Gn=V.from(0),Yn=V.from(-1);function Vn(e,t,r,i){const n={fault:t,operation:r};return i!==void 0&&(n.value=i),Ht.throwError(e,L.errors.NUMERIC_FAULT,n)}let gr=\"0\";for(;gr.length<256;)gr+=gr;function xi(e){if(typeof e!=\"number\")try{e=V.from(e).toNumber()}catch{}return typeof e==\"number\"&&e>=0&&e<=256&&!(e%1)?\"1\"+gr.substring(0,e):Ht.throwArgumentError(\"invalid decimal size\",\"decimals\",e)}function Mi(e,t){t==null&&(t=0);const r=xi(t);e=V.from(e);const i=e.lt(Gn);i&&(e=e.mul(Yn));let n=e.mod(r).toString();for(;n.length2&&Ht.throwArgumentError(\"too many decimal points\",\"value\",e);let o=n[0],h=n[1];for(o||(o=\"0\"),h||(h=\"0\");h[h.length-1]===\"0\";)h=h.substring(0,h.length-1);for(h.length>r.length-1&&Vn(\"fractional component exceeds decimals\",\"underflow\",\"parseFixed\"),h===\"\"&&(h=\"0\");h.lengtht[h]==null?b:(typeof t[h]!==p&&Ht.throwArgumentError(\"invalid fixed format (\"+h+\" not \"+p+\")\",\"format.\"+h,t[h]),t[h]);r=o(\"signed\",\"boolean\",r),i=o(\"width\",\"number\",i),n=o(\"decimals\",\"number\",n)}return i%8&&Ht.throwArgumentError(\"invalid fixed format width (not byte aligned)\",\"format.width\",i),n>80&&Ht.throwArgumentError(\"invalid fixed format (decimals too large)\",\"format.decimals\",n),new dr(mr,r,i,n)}}class Ut{constructor(t,r,i,n){t!==mr&&Ht.throwError(\"cannot use FixedNumber constructor; use FixedNumber.from\",L.errors.UNSUPPORTED_OPERATION,{operation:\"new FixedFormat\"}),this.format=n,this._hex=r,this._value=i,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(t){this.format.name!==t.format.name&&Ht.throwArgumentError(\"incompatible format; use fixedNumber.toFormat\",\"other\",t)}addUnsafe(t){this._checkFormat(t);const r=be(this._value,this.format.decimals),i=be(t._value,t.format.decimals);return Ut.fromValue(r.add(i),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);const r=be(this._value,this.format.decimals),i=be(t._value,t.format.decimals);return Ut.fromValue(r.sub(i),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);const r=be(this._value,this.format.decimals),i=be(t._value,t.format.decimals);return Ut.fromValue(r.mul(i).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);const r=be(this._value,this.format.decimals),i=be(t._value,t.format.decimals);return Ut.fromValue(r.mul(this.format._multiplier).div(i),this.format.decimals,this.format)}floor(){const t=this.toString().split(\".\");t.length===1&&t.push(\"0\");let r=Ut.from(t[0],this.format);const i=!t[1].match(/^(0*)$/);return this.isNegative()&&i&&(r=r.subUnsafe(Wn.toFormat(r.format))),r}ceiling(){const t=this.toString().split(\".\");t.length===1&&t.push(\"0\");let r=Ut.from(t[0],this.format);const i=!t[1].match(/^(0*)$/);return!this.isNegative()&&i&&(r=r.addUnsafe(Wn.toFormat(r.format))),r}round(t){t==null&&(t=0);const r=this.toString().split(\".\");if(r.length===1&&r.push(\"0\"),(t<0||t>80||t%1)&&Ht.throwArgumentError(\"invalid decimal count\",\"decimals\",t),r[1].length<=t)return this;const i=Ut.from(\"1\"+gr.substring(0,t),this.format),n=O0.toFormat(this.format);return this.mulUnsafe(i).addUnsafe(n).floor().divUnsafe(i)}isZero(){return this._value===\"0.0\"||this._value===\"0\"}isNegative(){return this._value[0]===\"-\"}toString(){return this._value}toHexString(t){if(t==null)return this._hex;t%8&&Ht.throwArgumentError(\"invalid byte width\",\"width\",t);const r=V.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString();return oe(r,t/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return Ut.fromString(this._value,t)}static fromValue(t,r,i){return i==null&&r!=null&&!C0(r)&&(i=r,r=null),r==null&&(r=0),i==null&&(i=\"fixed\"),Ut.fromString(Mi(t,r),dr.from(i))}static fromString(t,r){r==null&&(r=\"fixed\");const i=dr.from(r),n=be(t,i.decimals);!i.signed&&n.lt(Gn)&&Vn(\"unsigned value cannot be negative\",\"overflow\",\"value\",t);let o=null;i.signed?o=n.toTwos(i.width).toHexString():(o=n.toHexString(),o=oe(o,i.width/8));const h=Mi(n,i.decimals);return new Ut(mr,o,h,i)}static fromBytes(t,r){r==null&&(r=\"fixed\");const i=dr.from(r);if(Ot(t).length>i.width/8)throw new Error(\"overflow\");let n=V.from(t);i.signed&&(n=n.fromTwos(i.width));const o=n.toTwos((i.signed?0:1)+i.width).toHexString(),h=Mi(n,i.decimals);return new Ut(mr,o,h,i)}static from(t,r){if(typeof t==\"string\")return Ut.fromString(t,r);if(ir(t))return Ut.fromBytes(t,r);try{return Ut.fromValue(t,0,r)}catch(i){if(i.code!==L.errors.INVALID_ARGUMENT)throw i}return Ht.throwArgumentError(\"invalid FixedNumber value\",\"value\",t)}static isFixedNumber(t){return!!(t&&t._isFixedNumber)}}const Wn=Ut.from(1),O0=Ut.from(\"0.5\"),P0=\"strings/5.7.0\",Xn=new L(P0);var Or;(function(e){e.current=\"\",e.NFC=\"NFC\",e.NFD=\"NFD\",e.NFKC=\"NFKC\",e.NFKD=\"NFKD\"})(Or||(Or={}));var nr;(function(e){e.UNEXPECTED_CONTINUE=\"unexpected continuation byte\",e.BAD_PREFIX=\"bad codepoint prefix\",e.OVERRUN=\"string overrun\",e.MISSING_CONTINUE=\"missing continuation byte\",e.OUT_OF_RANGE=\"out of UTF-8 range\",e.UTF16_SURROGATE=\"UTF-16 surrogate\",e.OVERLONG=\"overlong representation\"})(nr||(nr={}));function D0(e,t,r,i,n){return Xn.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,\"bytes\",r)}function Zn(e,t,r,i,n){if(e===nr.BAD_PREFIX||e===nr.UNEXPECTED_CONTINUE){let o=0;for(let h=t+1;h>6===2;h++)o++;return o}return e===nr.OVERRUN?r.length-t-1:0}function F0(e,t,r,i,n){return e===nr.OVERLONG?(i.push(n),0):(i.push(65533),Zn(e,t,r))}Object.freeze({error:D0,ignore:Zn,replace:F0});function Ei(e,t=Or.current){t!=Or.current&&(Xn.checkNormalize(),e=e.normalize(t));let r=[];for(let i=0;i>6|192),r.push(n&63|128);else if((n&64512)==55296){i++;const o=e.charCodeAt(i);if(i>=e.length||(o&64512)!==56320)throw new Error(\"invalid utf-8 string\");const h=65536+((n&1023)<<10)+(o&1023);r.push(h>>18|240),r.push(h>>12&63|128),r.push(h>>6&63|128),r.push(h&63|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(n&63|128)}return Ot(r)}function T0(e){if(e.length%4!==0)throw new Error(\"bad data\");let t=[];for(let r=0;r{let o=n.split(\":\");r+=parseInt(o[0],16),i[r]=t(o[1])}),i}function $n(e){let t=0;return e.split(\",\").map(r=>{let i=r.split(\"-\");i.length===1?i[1]=\"0\":i[1]===\"\"&&(i[1]=\"1\");let n=t+parseInt(i[0],16);return t=parseInt(i[1],16),{l:n,h:t}})}$n(\"221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d\"),\"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff\".split(\",\").map(e=>parseInt(e,16)),Si(\"b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3\"),Si(\"179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7\"),Si(\"df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D\",T0),$n(\"80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001\");const tf=\"hash/5.7.0\";function U0(e){e=atob(e);const t=[];for(let r=0;r0&&Array.isArray(p)?n(p,h-1):r.push(p)})};return n(e,t),r}function k0(e){const t={};for(let r=0;r>--b&1}const y=31,S=Math.pow(2,y),I=S>>>1,N=I>>1,C=S-1;let F=0;for(let H=0;H1;){let Yt=z+Pt>>>1;H>>1|w(),W=W<<1^I,Rt=(Rt^I)<<1|I|1;J=W,Bt=1+Rt-W}let G=i-4;return U.map(H=>{switch(H-G){case 3:return G+65792+(e[p++]<<16|e[p++]<<8|e[p++]);case 2:return G+256+(e[p++]<<8|e[p++]);case 1:return G+e[p++];default:return H-1}})}function K0(e){let t=0;return()=>e[t++]}function H0(e){return K0(q0(e))}function z0(e){return e&1?~e>>1:e>>1}function L0(e,t){let r=Array(e);for(let i=0;it[h]):r}function Q0(e){let t=[];for(;;){let r=e();if(r==0)break;t.push(G0(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(Y0(r,e))}return k0(ef(t))}function J0(e){let t=[];for(;;){let r=e();if(r==0)break;t.push(r)}return t}function nf(e,t,r){let i=Array(e).fill(void 0).map(()=>[]);for(let n=0;ni[h].push(o));return i}function G0(e,t){let r=1+t(),i=t(),n=J0(t),o=nf(n.length,1+e,t);return ef(o.map((h,p)=>{const b=h[0],m=h.slice(1);return Array(n[p]).fill(void 0).map((w,y)=>{let S=y*i;return[b+y*r,m.map(I=>I+S)]})}))}function Y0(e,t){let r=1+t();return nf(r,1+e,t).map(n=>[n[0],n.slice(1)])}function V0(e){let t=Pr(e).sort((i,n)=>i-n);return r();function r(){let i=[];for(;;){let m=Pr(e,t);if(m.length==0)break;i.push({set:new Set(m),node:r()})}i.sort((m,w)=>w.set.size-m.set.size);let n=e(),o=n%3;n=n/3|0;let h=!!(n&1);n>>=1;let p=n==1,b=n==2;return{branches:i,valid:o,fe0f:h,save:p,check:b}}}function W0(){return H0(U0(\"AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==\"))}const Dr=W0();new Set(Pr(Dr)),new Set(Pr(Dr)),Q0(Dr),V0(Dr),new L(tf);const X0=new Uint8Array(32);X0.fill(0);const Z0=`\u0019Ethereum Signed Message:\n`;function ff(e){return typeof e==\"string\"&&(e=Ei(e)),yi(E0([Ei(Z0),Ei(String(e.length)),e]))}const $0=\"rlp/5.7.0\";new L($0);const ts=\"address/5.7.0\",Ar=new L(ts);function of(e){Qt(e,20)||Ar.throwArgumentError(\"invalid address\",\"address\",e),e=e.toLowerCase();const t=e.substring(2).split(\"\"),r=new Uint8Array(40);for(let n=0;n<40;n++)r[n]=t[n].charCodeAt(0);const i=Ot(yi(r));for(let n=0;n<40;n+=2)i[n>>1]>>4>=8&&(t[n]=t[n].toUpperCase()),(i[n>>1]&15)>=8&&(t[n+1]=t[n+1].toUpperCase());return\"0x\"+t.join(\"\")}const es=9007199254740991;function rs(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}const Ni={};for(let e=0;e<10;e++)Ni[String(e)]=String(e);for(let e=0;e<26;e++)Ni[String.fromCharCode(65+e)]=String(10+e);const sf=Math.floor(rs(es));function is(e){e=e.toUpperCase(),e=e.substring(4)+e.substring(0,2)+\"00\";let t=e.split(\"\").map(i=>Ni[i]).join(\"\");for(;t.length>=sf;){let i=t.substring(0,sf);t=parseInt(i,10)%97+t.substring(i.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r=\"0\"+r;return r}function ns(e){let t=null;if(typeof e!=\"string\"&&Ar.throwArgumentError(\"invalid address\",\"address\",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))e.substring(0,2)!==\"0x\"&&(e=\"0x\"+e),t=of(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&Ar.throwArgumentError(\"bad address checksum\",\"address\",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==is(e)&&Ar.throwArgumentError(\"bad icap checksum\",\"address\",e),t=R0(e.substring(4));t.length<40;)t=\"0\"+t;t=of(\"0x\"+t)}else Ar.throwArgumentError(\"invalid address\",\"address\",e);return t}const fs=\"properties/5.7.0\";new L(fs);function br(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}new L(tf);const os=new Uint8Array(32);os.fill(0),V.from(-1);const ss=V.from(0),as=V.from(1);V.from(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\"),oe(as.toHexString(),32),oe(ss.toHexString(),32);var se={},Q={},yr=af;function af(e,t){if(!e)throw new Error(t||\"Assertion failed\")}af.equal=function(t,r,i){if(t!=r)throw new Error(i||\"Assertion failed: \"+t+\" != \"+r)};var Ii={exports:{}};typeof Object.create==\"function\"?Ii.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Ii.exports=function(t,r){if(r){t.super_=r;var i=function(){};i.prototype=r.prototype,t.prototype=new i,t.prototype.constructor=t}};var us=yr,hs=Ii.exports;Q.inherits=hs;function cs(e,t){return(e.charCodeAt(t)&64512)!==55296||t<0||t+1>=e.length?!1:(e.charCodeAt(t+1)&64512)===56320}function ls(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if(typeof e==\"string\")if(t){if(t===\"hex\")for(e=e.replace(/[^a-z0-9]+/ig,\"\"),e.length%2!==0&&(e=\"0\"+e),n=0;n>6|192,r[i++]=o&63|128):cs(e,n)?(o=65536+((o&1023)<<10)+(e.charCodeAt(++n)&1023),r[i++]=o>>18|240,r[i++]=o>>12&63|128,r[i++]=o>>6&63|128,r[i++]=o&63|128):(r[i++]=o>>12|224,r[i++]=o>>6&63|128,r[i++]=o&63|128)}else for(n=0;n>>24|e>>>8&65280|e<<8&16711680|(e&255)<<24;return t>>>0}Q.htonl=uf;function ps(e,t){for(var r=\"\",i=0;i>>0}return o}Q.join32=vs;function ms(e,t){for(var r=new Array(e.length*4),i=0,n=0;i>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=o&255):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=o&255)}return r}Q.split32=ms;function gs(e,t){return e>>>t|e<<32-t}Q.rotr32=gs;function As(e,t){return e<>>32-t}Q.rotl32=As;function bs(e,t){return e+t>>>0}Q.sum32=bs;function ys(e,t,r){return e+t+r>>>0}Q.sum32_3=ys;function ws(e,t,r,i){return e+t+r+i>>>0}Q.sum32_4=ws;function xs(e,t,r,i,n){return e+t+r+i+n>>>0}Q.sum32_5=xs;function Ms(e,t,r,i){var n=e[t],o=e[t+1],h=i+o>>>0,p=(h>>0,e[t+1]=h}Q.sum64=Ms;function Es(e,t,r,i){var n=t+i>>>0,o=(n>>0}Q.sum64_hi=Es;function Ss(e,t,r,i){var n=t+i;return n>>>0}Q.sum64_lo=Ss;function Ns(e,t,r,i,n,o,h,p){var b=0,m=t;m=m+i>>>0,b+=m>>0,b+=m>>0,b+=m>>0}Q.sum64_4_hi=Ns;function Is(e,t,r,i,n,o,h,p){var b=t+i+o+p;return b>>>0}Q.sum64_4_lo=Is;function _s(e,t,r,i,n,o,h,p,b,m){var w=0,y=t;y=y+i>>>0,w+=y>>0,w+=y>>0,w+=y>>0,w+=y>>0}Q.sum64_5_hi=_s;function Bs(e,t,r,i,n,o,h,p,b,m){var w=t+i+o+p+m;return w>>>0}Q.sum64_5_lo=Bs;function Cs(e,t,r){var i=t<<32-r|e>>>r;return i>>>0}Q.rotr64_hi=Cs;function Rs(e,t,r){var i=e<<32-r|t>>>r;return i>>>0}Q.rotr64_lo=Rs;function Os(e,t,r){return e>>>r}Q.shr64_hi=Os;function Ps(e,t,r){var i=e<<32-r|t>>>r;return i>>>0}Q.shr64_lo=Ps;var fr={},lf=Q,Ds=yr;function Fr(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian=\"big\",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}fr.BlockHash=Fr,Fr.prototype.update=function(t,r){if(t=lf.toArray(t,r),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){t=this.pending;var i=t.length%this._delta8;this.pending=t.slice(t.length-i,t.length),this.pending.length===0&&(this.pending=null),t=lf.join32(t,0,t.length-i,this.endian);for(var n=0;n>>24&255,n[o++]=t>>>16&255,n[o++]=t>>>8&255,n[o++]=t&255}else for(n[o++]=t&255,n[o++]=t>>>8&255,n[o++]=t>>>16&255,n[o++]=t>>>24&255,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,h=8;h>>3}ae.g0_256=qs;function Ks(e){return ue(e,17)^ue(e,19)^e>>>10}ae.g1_256=Ks;var sr=Q,Hs=fr,zs=ae,_i=sr.rotl32,wr=sr.sum32,Ls=sr.sum32_5,js=zs.ft_1,mf=Hs.BlockHash,Qs=[1518500249,1859775393,2400959708,3395469782];function he(){if(!(this instanceof he))return new he;mf.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}sr.inherits(he,mf);var Js=he;he.blockSize=512,he.outSize=160,he.hmacStrength=80,he.padLength=64,he.prototype._update=function(t,r){for(var i=this.W,n=0;n<16;n++)i[n]=t[r+n];for(;nthis.blockSize&&(t=new this.Hash().update(t).digest()),Pa(t.length<=this.blockSize);for(var r=t.length;r>8,S=w&255;y?b.push(y,S):b.push(S)}return b}r.toArray=i;function n(h){return h.length===1?\"0\"+h:h}r.zero2=n;function o(h){for(var p=\"\",b=0;b(S>>1)-1?C=(S>>1)-F:C=F,I.isubn(C)):C=0,y[N]=C,I.iushrn(1)}return y}r.getNAF=i;function n(b,m){var w=[[],[]];b=b.clone(),m=m.clone();for(var y=0,S=0,I;b.cmpn(-y)>0||m.cmpn(-S)>0;){var N=b.andln(3)+y&3,C=m.andln(3)+S&3;N===3&&(N=-1),C===3&&(C=-1);var F;N&1?(I=b.andln(7)+y&7,(I===3||I===5)&&C===2?F=-N:F=N):F=0,w[0].push(F);var U;C&1?(I=m.andln(7)+S&7,(I===3||I===5)&&N===2?U=-C:U=C):U=0,w[1].push(U),2*y===F+1&&(y=1-y),2*S===U+1&&(S=1-S),b.iushrn(1),m.iushrn(1)}return w}r.getJSF=n;function o(b,m,w){var y=\"_\"+m;b.prototype[m]=function(){return this[y]!==void 0?this[y]:this[y]=w.call(this)}}r.cachedProperty=o;function h(b){return typeof b==\"string\"?r.toArray(b,\"hex\"):b}r.parseBytes=h;function p(b){return new K(b,\"hex\",\"le\")}r.intFromLE=p}),Ur=Jt.getNAF,Ta=Jt.getJSF,kr=Jt.assert;function Ce(e,t){this.type=e,this.p=new K(t.p,16),this.red=t.prime?K.red(t.prime):K.mont(this.p),this.zero=new K(0).toRed(this.red),this.one=new K(1).toRed(this.red),this.two=new K(2).toRed(this.red),this.n=t.n&&new K(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Ze=Ce;Ce.prototype.point=function(){throw new Error(\"Not implemented\")},Ce.prototype.validate=function(){throw new Error(\"Not implemented\")},Ce.prototype._fixedNafMul=function(t,r){kr(t.precomputed);var i=t._getDoubles(),n=Ur(r,1,this._bitLength),o=(1<=p;m--)b=(b<<1)+n[m];h.push(b)}for(var w=this.jpoint(null,null,null),y=this.jpoint(null,null,null),S=o;S>0;S--){for(p=0;p=0;b--){for(var m=0;b>=0&&h[b]===0;b--)m++;if(b>=0&&m++,p=p.dblp(m),b<0)break;var w=h[b];kr(w!==0),t.type===\"affine\"?w>0?p=p.mixedAdd(o[w-1>>1]):p=p.mixedAdd(o[-w-1>>1].neg()):w>0?p=p.add(o[w-1>>1]):p=p.add(o[-w-1>>1].neg())}return t.type===\"affine\"?p.toP():p},Ce.prototype._wnafMulAdd=function(t,r,i,n,o){var h=this._wnafT1,p=this._wnafT2,b=this._wnafT3,m=0,w,y,S;for(w=0;w=1;w-=2){var N=w-1,C=w;if(h[N]!==1||h[C]!==1){b[N]=Ur(i[N],h[N],this._bitLength),b[C]=Ur(i[C],h[C],this._bitLength),m=Math.max(b[N].length,m),m=Math.max(b[C].length,m);continue}var F=[r[N],null,null,r[C]];r[N].y.cmp(r[C].y)===0?(F[1]=r[N].add(r[C]),F[2]=r[N].toJ().mixedAdd(r[C].neg())):r[N].y.cmp(r[C].y.redNeg())===0?(F[1]=r[N].toJ().mixedAdd(r[C]),F[2]=r[N].add(r[C].neg())):(F[1]=r[N].toJ().mixedAdd(r[C]),F[2]=r[N].toJ().mixedAdd(r[C].neg()));var U=[-3,-1,-5,-7,0,7,5,1,3],J=Ta(i[N],i[C]);for(m=Math.max(J[0].length,m),b[N]=new Array(m),b[C]=new Array(m),y=0;y=0;w--){for(var Pt=0;w>=0;){var W=!0;for(y=0;y=0&&Pt++,H=H.dblp(Pt),w<0)break;for(y=0;y0?S=p[y][Rt-1>>1]:Rt<0&&(S=p[y][-Rt-1>>1].neg()),S.type===\"affine\"?H=H.mixedAdd(S):H=H.add(S))}}for(w=0;w=Math.ceil((t.bitLength()+1)/r.step):!1},Xt.prototype._getDoubles=function(t,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],n=this,o=0;o=0&&(I=m,N=w),y.negative&&(y=y.neg(),S=S.neg()),I.negative&&(I=I.neg(),N=N.neg()),[{a:y,b:S},{a:I,b:N}]},Zt.prototype._endoSplit=function(t){var r=this.endo.basis,i=r[0],n=r[1],o=n.b.mul(t).divRound(this.n),h=i.b.neg().mul(t).divRound(this.n),p=o.mul(i.a),b=h.mul(n.a),m=o.mul(i.b),w=h.mul(n.b),y=t.sub(p).sub(b),S=m.add(w).neg();return{k1:y,k2:S}},Zt.prototype.pointFromX=function(t,r){t=new K(t,16),t.red||(t=t.toRed(this.red));var i=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=i.redSqrt();if(n.redSqr().redSub(i).cmp(this.zero)!==0)throw new Error(\"invalid point\");var o=n.fromRed().isOdd();return(r&&!o||!r&&o)&&(n=n.redNeg()),this.point(t,n)},Zt.prototype.validate=function(t){if(t.inf)return!0;var r=t.x,i=t.y,n=this.a.redMul(r),o=r.redSqr().redMul(r).redIAdd(n).redIAdd(this.b);return i.redSqr().redISub(o).cmpn(0)===0},Zt.prototype._endoWnafMulAdd=function(t,r,i){for(var n=this._endoWnafT1,o=this._endoWnafT2,h=0;h\":\"\"},Ft.prototype.isInfinity=function(){return this.inf},Ft.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(this.x.cmp(t.x)===0)return this.curve.point(null,null);var r=this.y.redSub(t.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(t.x).redInvm()));var i=r.redSqr().redISub(this.x).redISub(t.x),n=r.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,n)},Ft.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(t.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,i=this.x.redSqr(),n=t.redInvm(),o=i.redAdd(i).redIAdd(i).redIAdd(r).redMul(n),h=o.redSqr().redISub(this.x.redAdd(this.x)),p=o.redMul(this.x.redSub(h)).redISub(this.y);return this.curve.point(h,p)},Ft.prototype.getX=function(){return this.x.fromRed()},Ft.prototype.getY=function(){return this.y.fromRed()},Ft.prototype.mul=function(t){return t=new K(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)},Ft.prototype.mulAdd=function(t,r,i){var n=[this,r],o=[t,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,o):this.curve._wnafMulAdd(1,n,o,2)},Ft.prototype.jmulAdd=function(t,r,i){var n=[this,r],o=[t,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,o,!0):this.curve._wnafMulAdd(1,n,o,2,!0)},Ft.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||this.x.cmp(t.x)===0&&this.y.cmp(t.y)===0)},Ft.prototype.neg=function(t){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var i=this.precomputed,n=function(o){return o.neg()};r.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(n)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(n)}}}return r},Ft.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t};function Tt(e,t,r,i){Ze.BasePoint.call(this,e,\"jacobian\"),t===null&&r===null&&i===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new K(0)):(this.x=new K(t,16),this.y=new K(r,16),this.z=new K(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}Di(Tt,Ze.BasePoint),Zt.prototype.jpoint=function(t,r,i){return new Tt(this,t,r,i)},Tt.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),r=t.redSqr(),i=this.x.redMul(r),n=this.y.redMul(r).redMul(t);return this.curve.point(i,n)},Tt.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Tt.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var r=t.z.redSqr(),i=this.z.redSqr(),n=this.x.redMul(r),o=t.x.redMul(i),h=this.y.redMul(r.redMul(t.z)),p=t.y.redMul(i.redMul(this.z)),b=n.redSub(o),m=h.redSub(p);if(b.cmpn(0)===0)return m.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var w=b.redSqr(),y=w.redMul(b),S=n.redMul(w),I=m.redSqr().redIAdd(y).redISub(S).redISub(S),N=m.redMul(S.redISub(I)).redISub(h.redMul(y)),C=this.z.redMul(t.z).redMul(b);return this.curve.jpoint(I,N,C)},Tt.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var r=this.z.redSqr(),i=this.x,n=t.x.redMul(r),o=this.y,h=t.y.redMul(r).redMul(this.z),p=i.redSub(n),b=o.redSub(h);if(p.cmpn(0)===0)return b.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var m=p.redSqr(),w=m.redMul(p),y=i.redMul(m),S=b.redSqr().redIAdd(w).redISub(y).redISub(y),I=b.redMul(y.redISub(S)).redISub(o.redMul(w)),N=this.z.redMul(p);return this.curve.jpoint(S,I,N)},Tt.prototype.dblp=function(t){if(t===0)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var i=this;for(r=0;r=0)return!1;if(i.redIAdd(o),this.x.cmp(i)===0)return!0}},Tt.prototype.inspect=function(){return this.isInfinity()?\"\":\"\"},Tt.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var qr=cr(function(e,t){var r=t;r.base=Ze,r.short=ka,r.mont=null,r.edwards=null}),Kr=cr(function(e,t){var r=t,i=Jt.assert;function n(p){p.type===\"short\"?this.curve=new qr.short(p):p.type===\"edwards\"?this.curve=new qr.edwards(p):this.curve=new qr.mont(p),this.g=this.curve.g,this.n=this.curve.n,this.hash=p.hash,i(this.g.validate(),\"Invalid curve\"),i(this.g.mul(this.n).isInfinity(),\"Invalid curve, G*N != O\")}r.PresetCurve=n;function o(p,b){Object.defineProperty(r,p,{configurable:!0,enumerable:!0,get:function(){var m=new n(b);return Object.defineProperty(r,p,{configurable:!0,enumerable:!0,value:m}),m}})}o(\"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:se.sha256,gRed:!1,g:[\"188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012\",\"07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811\"]}),o(\"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:se.sha256,gRed:!1,g:[\"b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21\",\"bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34\"]}),o(\"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:se.sha256,gRed:!1,g:[\"6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296\",\"4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5\"]}),o(\"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:se.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\"]}),o(\"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:se.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\"]}),o(\"curve25519\",{type:\"mont\",prime:\"p25519\",p:\"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\",a:\"76d06\",b:\"1\",n:\"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed\",hash:se.sha256,gRed:!1,g:[\"9\"]}),o(\"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:se.sha256,gRed:!1,g:[\"216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a\",\"6666666666666666666666666666666666666666666666666666666666666658\"]});var h;try{h=null.crash()}catch{h=void 0}o(\"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:se.sha256,beta:\"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee\",lambda:\"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72\",basis:[{a:\"3086d221a7d46bcde86c90e49284eb15\",b:\"-e4437ed6010e88286f547fa90abfe4c3\"},{a:\"114ca50f7a8e2f3f657c1108d9d44cfd8\",b:\"3086d221a7d46bcde86c90e49284eb15\"}],gRed:!1,g:[\"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798\",\"483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8\",h]})});function Re(e){if(!(this instanceof Re))return new Re(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=fe.toArray(e.entropy,e.entropyEnc||\"hex\"),r=fe.toArray(e.nonce,e.nonceEnc||\"hex\"),i=fe.toArray(e.pers,e.persEnc||\"hex\");Pi(t.length>=this.minEntropy/8,\"Not enough entropy. Minimum is: \"+this.minEntropy+\" bits\"),this._init(t,r,i)}var Rf=Re;Re.prototype._init=function(t,r,i){var n=t.concat(r).concat(i);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o=this.minEntropy/8,\"Not enough entropy. Minimum is: \"+this.minEntropy+\" bits\"),this._update(t.concat(i||[])),this._reseed=1},Re.prototype.generate=function(t,r,i,n){if(this._reseed>this.reseedInterval)throw new Error(\"Reseed is required\");typeof r!=\"string\"&&(n=i,i=r,r=null),i&&(i=fe.toArray(i,n||\"hex\"),this._update(i));for(var o=[];o.length\"};var qa=Jt.assert;function Hr(e,t){if(e instanceof Hr)return e;this._importDER(e,t)||(qa(e.r&&e.s,\"Signature without r or s\"),this.r=new K(e.r,16),this.s=new K(e.s,16),e.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var zr=Hr;function Ka(){this.place=0}function Ui(e,t){var r=e[t.place++];if(!(r&128))return r;var i=r&15;if(i===0||i>4)return!1;for(var n=0,o=0,h=t.place;o>>=0;return n<=127?!1:(t.place=h,n)}function Of(e){for(var t=0,r=e.length-1;!e[t]&&!(e[t+1]&128)&&t>>3);for(e.push(r|128);--r;)e.push(t>>>(r<<3)&255);e.push(t)}Hr.prototype.toDER=function(t){var r=this.r.toArray(),i=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),i[0]&128&&(i=[0].concat(i)),r=Of(r),i=Of(i);!i[0]&&!(i[1]&128);)i=i.slice(1);var n=[2];ki(n,r.length),n=n.concat(r),n.push(2),ki(n,i.length);var o=n.concat(i),h=[48];return ki(h,o.length),h=h.concat(o),Jt.encode(h,t)};var Ha=function(){throw new Error(\"unsupported\")},Pf=Jt.assert;function $t(e){if(!(this instanceof $t))return new $t(e);typeof e==\"string\"&&(Pf(Object.prototype.hasOwnProperty.call(Kr,e),\"Unknown curve \"+e),e=Kr[e]),e instanceof Kr.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var za=$t;$t.prototype.keyPair=function(t){return new Ti(this,t)},$t.prototype.keyFromPrivate=function(t,r){return Ti.fromPrivate(this,t,r)},$t.prototype.keyFromPublic=function(t,r){return Ti.fromPublic(this,t,r)},$t.prototype.genKeyPair=function(t){t||(t={});for(var r=new Rf({hash:this.hash,pers:t.pers,persEnc:t.persEnc||\"utf8\",entropy:t.entropy||Ha(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||\"utf8\",nonce:this.n.toArray()}),i=this.n.byteLength(),n=this.n.sub(new K(2));;){var o=new K(r.generate(i));if(!(o.cmp(n)>0))return o.iaddn(1),this.keyFromPrivate(o)}},$t.prototype._truncateToN=function(t,r){var i=t.byteLength()*8-this.n.bitLength();return i>0&&(t=t.ushrn(i)),!r&&t.cmp(this.n)>=0?t.sub(this.n):t},$t.prototype.sign=function(t,r,i,n){typeof i==\"object\"&&(n=i,i=null),n||(n={}),r=this.keyFromPrivate(r,i),t=this._truncateToN(new K(t,16));for(var o=this.n.byteLength(),h=r.getPrivate().toArray(\"be\",o),p=t.toArray(\"be\",o),b=new Rf({hash:this.hash,entropy:h,nonce:p,pers:n.pers,persEnc:n.persEnc||\"utf8\"}),m=this.n.sub(new K(1)),w=0;;w++){var y=n.k?n.k(w):new K(b.generate(this.n.byteLength()));if(y=this._truncateToN(y,!0),!(y.cmpn(1)<=0||y.cmp(m)>=0)){var S=this.g.mul(y);if(!S.isInfinity()){var I=S.getX(),N=I.umod(this.n);if(N.cmpn(0)!==0){var C=y.invm(this.n).mul(N.mul(r.getPrivate()).iadd(t));if(C=C.umod(this.n),C.cmpn(0)!==0){var F=(S.getY().isOdd()?1:0)|(I.cmp(N)!==0?2:0);return n.canonical&&C.cmp(this.nh)>0&&(C=this.n.sub(C),F^=1),new zr({r:N,s:C,recoveryParam:F})}}}}}},$t.prototype.verify=function(t,r,i,n){t=this._truncateToN(new K(t,16)),i=this.keyFromPublic(i,n),r=new zr(r,\"hex\");var o=r.r,h=r.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0||h.cmpn(1)<0||h.cmp(this.n)>=0)return!1;var p=h.invm(this.n),b=p.mul(t).umod(this.n),m=p.mul(o).umod(this.n),w;return this.curve._maxwellTrick?(w=this.g.jmulAdd(b,i.getPublic(),m),w.isInfinity()?!1:w.eqXToP(o)):(w=this.g.mulAdd(b,i.getPublic(),m),w.isInfinity()?!1:w.getX().umod(this.n).cmp(o)===0)},$t.prototype.recoverPubKey=function(e,t,r,i){Pf((3&r)===r,\"The recovery param is more than two bits\"),t=new zr(t,i);var n=this.n,o=new K(e),h=t.r,p=t.s,b=r&1,m=r>>1;if(h.cmp(this.curve.p.umod(this.curve.n))>=0&&m)throw new Error(\"Unable to find sencond key candinate\");m?h=this.curve.pointFromX(h.add(this.curve.n),b):h=this.curve.pointFromX(h,b);var w=t.r.invm(n),y=n.sub(o).mul(w).umod(n),S=p.mul(w).umod(n);return this.g.mulAdd(y,h,S)},$t.prototype.getKeyRecoveryParam=function(e,t,r,i){if(t=new zr(t,i),t.recoveryParam!==null)return t.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(e,t,n)}catch{continue}if(o.eq(r))return n}throw new Error(\"Unable to find valid recovery factor\")};var La=cr(function(e,t){var r=t;r.version=\"6.5.4\",r.utils=Jt,r.rand=function(){throw new Error(\"unsupported\")},r.curve=qr,r.curves=Kr,r.ec=za,r.eddsa=null}),ja=La.ec;const Qa=\"signing-key/5.7.0\",qi=new L(Qa);let Ki=null;function ve(){return Ki||(Ki=new ja(\"secp256k1\")),Ki}class Ja{constructor(t){br(this,\"curve\",\"secp256k1\"),br(this,\"privateKey\",Kt(t)),N0(this.privateKey)!==32&&qi.throwArgumentError(\"invalid private key\",\"privateKey\",\"[[ REDACTED ]]\");const r=ve().keyFromPrivate(Ot(this.privateKey));br(this,\"publicKey\",\"0x\"+r.getPublic(!1,\"hex\")),br(this,\"compressedPublicKey\",\"0x\"+r.getPublic(!0,\"hex\")),br(this,\"_isSigningKey\",!0)}_addPoint(t){const r=ve().keyFromPublic(Ot(this.publicKey)),i=ve().keyFromPublic(Ot(t));return\"0x\"+r.pub.add(i.pub).encodeCompressed(\"hex\")}signDigest(t){const r=ve().keyFromPrivate(Ot(this.privateKey)),i=Ot(t);i.length!==32&&qi.throwArgumentError(\"bad digest length\",\"digest\",t);const n=r.sign(i,{canonical:!0});return zn({recoveryParam:n.recoveryParam,r:oe(\"0x\"+n.r.toString(16),32),s:oe(\"0x\"+n.s.toString(16),32)})}computeSharedSecret(t){const r=ve().keyFromPrivate(Ot(this.privateKey)),i=ve().keyFromPublic(Ot(Df(t)));return oe(\"0x\"+r.derive(i.getPublic()).toString(16),32)}static isSigningKey(t){return!!(t&&t._isSigningKey)}}function Ga(e,t){const r=zn(t),i={r:Ot(r.r),s:Ot(r.s)};return\"0x\"+ve().recoverPubKey(Ot(e),i,r.recoveryParam).encode(\"hex\",!1)}function Df(e,t){const r=Ot(e);if(r.length===32){const i=new Ja(r);return t?\"0x\"+ve().keyFromPrivate(r).getPublic(!0,\"hex\"):i.publicKey}else{if(r.length===33)return t?Kt(r):\"0x\"+ve().keyFromPublic(r).getPublic(!1,\"hex\");if(r.length===65)return t?\"0x\"+ve().keyFromPublic(r).getPublic(!0,\"hex\"):Kt(r)}return qi.throwArgumentError(\"invalid public or private key\",\"key\",\"[REDACTED]\")}const Ya=\"transactions/5.7.0\";new L(Ya);var Ff;(function(e){e[e.legacy=0]=\"legacy\",e[e.eip2930=1]=\"eip2930\",e[e.eip1559=2]=\"eip1559\"})(Ff||(Ff={}));function Va(e){const t=Df(e);return ns(Hn(yi(Hn(t,1)),12))}function Wa(e,t){return Va(Ga(Ot(e),t))}const Xa=\"https://rpc.walletconnect.com/v1\";async function Tf(e,t,r,i,n,o){switch(r.t){case\"eip191\":return Uf(e,t,r.s);case\"eip1271\":return await kf(e,t,r.s,i,n,o);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}function Uf(e,t,r){return Wa(ff(t),r).toLowerCase()===e.toLowerCase()}async function kf(e,t,r,i,n,o){try{const h=\"0x1626ba7e\",p=\"0000000000000000000000000000000000000000000000000000000000000040\",b=\"0000000000000000000000000000000000000000000000000000000000000041\",m=r.substring(2),w=ff(t).substring(2),y=h+w+p+b+m,S=await fetch(`${o||Xa}/?chainId=${i}&projectId=${n}`,{method:\"POST\",body:JSON.stringify({id:Za(),jsonrpc:\"2.0\",method:\"eth_call\",params:[{to:e,data:y},\"latest\"]})}),{result:I}=await S.json();return I?I.slice(0,h.length).toLowerCase()===h.toLowerCase():!1}catch(h){return console.error(\"isValidEip1271Signature: \",h),!1}}function Za(){return Date.now()+Math.floor(Math.random()*1e3)}var $a=Object.defineProperty,tu=Object.defineProperties,eu=Object.getOwnPropertyDescriptors,qf=Object.getOwnPropertySymbols,ru=Object.prototype.hasOwnProperty,iu=Object.prototype.propertyIsEnumerable,Kf=(e,t,r)=>t in e?$a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Hi=(e,t)=>{for(var r in t||(t={}))ru.call(t,r)&&Kf(e,r,t[r]);if(qf)for(var r of qf(t))iu.call(t,r)&&Kf(e,r,t[r]);return e},Hf=(e,t)=>tu(e,eu(t));const nu=\"did:pkh:\",Lr=e=>e?.split(\":\"),zi=e=>{const t=e&&Lr(e);if(t)return e.includes(nu)?t[3]:t[1]},fu=e=>{const t=e&&Lr(e);if(t)return t[2]+\":\"+t[3]},Li=e=>{const t=e&&Lr(e);if(t)return t.pop()};async function ou(e){const{cacao:t,projectId:r}=e,{s:i,p:n}=t,o=zf(n,n.iss),h=Li(n.iss);return await Tf(h,o,i,zi(n.iss),r)}const zf=(e,t)=>{const r=`${e.domain} wants you to sign in with your Ethereum account:`,i=Li(t);if(!e.aud&&!e.uri)throw new Error(\"Either `aud` or `uri` is required to construct the message\");let n=e.statement||void 0;const o=`URI: ${e.aud||e.uri}`,h=`Version: ${e.version}`,p=`Chain ID: ${zi(t)}`,b=`Nonce: ${e.nonce}`,m=`Issued At: ${e.iat}`,w=e.resources?`Resources:${e.resources.map(S=>`\n- ${S}`).join(\"\")}`:void 0,y=Qr(e.resources);if(y){const S=Oe(y);n=Ji(n,S)}return[r,i,\"\",n,\"\",o,h,p,b,m,w].filter(S=>S!=null).join(`\n`)};function su(e,t,r){return r.includes(\"did:pkh:\")||(r=`did:pkh:${r}`),{h:{t:\"caip122\"},p:{iss:r,domain:e.domain,aud:e.aud,version:e.version,nonce:e.nonce,iat:e.iat,statement:e.statement,requestId:e.requestId,resources:e.resources,nbf:e.nbf,exp:e.exp},s:t}}function au(e){var t;const{authPayload:r,chains:i,methods:n}=e,o=r.statement||\"\";if(!(i!=null&&i.length))return r;const h=r.chains,p=mi(h,i);if(!(p!=null&&p.length))throw new Error(\"No supported chains\");const b=Lf(r.resources);if(!b)return r;me(b);const m=jf(b,\"eip155\");let w=r?.resources||[];if(m!=null&&m.length){const y=Qf(m),S=mi(y,n);if(!(S!=null&&S.length))throw new Error(`Supported methods don't satisfy the requested: ${JSON.stringify(y)}, supported: ${JSON.stringify(n)}`);const I=ji(\"request\",S,{chains:p}),N=Vf(b,\"eip155\",I);w=((t=r?.resources)==null?void 0:t.slice(0,-1))||[],w.push(jr(N))}return Hf(Hi({},r),{statement:Xf(o,Qr(w)),chains:p,resources:r!=null&&r.resources||w.length>0?w:void 0})}function Lf(e){const t=Qr(e);if(t&&Qi(t))return Oe(t)}function uu(e,t){var r;return(r=e?.att)==null?void 0:r.hasOwnProperty(t)}function jf(e,t){var r,i;return(r=e?.att)!=null&&r[t]?Object.keys((i=e?.att)==null?void 0:i[t]):[]}function hu(e){return e?.map(t=>Object.keys(t))||[]}function Qf(e){return e?.map(t=>{var r;return(r=t.split(\"/\"))==null?void 0:r[1]})||[]}function Jf(e){return Buffer.from(JSON.stringify(e)).toString(\"base64\")}function Gf(e){return JSON.parse(Buffer.from(e,\"base64\").toString(\"utf-8\"))}function me(e){if(!e)throw new Error(\"No recap provided, value is undefined\");if(!e.att)throw new Error(\"No `att` property found\");const t=Object.keys(e.att);if(!(t!=null&&t.length))throw new Error(\"No resources found in `att` property\");t.forEach(r=>{const i=e.att[r];if(Array.isArray(i))throw new Error(`Resource must be an object: ${r}`);if(typeof i!=\"object\")throw new Error(`Resource must be an object: ${r}`);if(!Object.keys(i).length)throw new Error(`Resource object is empty: ${r}`);Object.keys(i).forEach(n=>{const o=i[n];if(!Array.isArray(o))throw new Error(`Ability limits ${n} must be an array of objects, found: ${o}`);if(!o.length)throw new Error(`Value of ${n} is empty array, must be an array with objects`);o.forEach(h=>{if(typeof h!=\"object\")throw new Error(`Ability limits (${n}) must be an array of objects, found: ${h}`)})})})}function Yf(e,t,r,i={}){return r?.sort((n,o)=>n.localeCompare(o)),{att:{[e]:ji(t,r,i)}}}function Vf(e,t,r){var i;return e.att[t]=Hi({},r),((i=Object.keys(e.att))==null?void 0:i.sort((n,o)=>n.localeCompare(o))).reduce((n,o)=>(n.att[o]=e.att[o],n),{att:{}})}function ji(e,t,r={}){t=t?.sort((n,o)=>n.localeCompare(o));const i=t.map(n=>({[`${e}/${n}`]:[r]}));return Object.assign({},...i)}function jr(e){return me(e),`urn:recap:${Jf(e).replace(/=/g,\"\")}`}function Oe(e){const t=Gf(e.replace(\"urn:recap:\",\"\"));return me(t),t}function cu(e,t,r){const i=Yf(e,t,r);return jr(i)}function Qi(e){return e&&e.includes(\"urn:recap:\")}function lu(e,t){const r=Oe(e),i=Oe(t),n=Wf(r,i);return jr(n)}function Wf(e,t){me(e),me(t);const r=Object.keys(e.att).concat(Object.keys(t.att)).sort((n,o)=>n.localeCompare(o)),i={att:{}};return r.forEach(n=>{var o,h;Object.keys(((o=e.att)==null?void 0:o[n])||{}).concat(Object.keys(((h=t.att)==null?void 0:h[n])||{})).sort((p,b)=>p.localeCompare(b)).forEach(p=>{var b,m;i.att[n]=Hf(Hi({},i.att[n]),{[p]:((b=e.att[n])==null?void 0:b[p])||((m=t.att[n])==null?void 0:m[p])})})}),i}function Ji(e=\"\",t){me(t);const r=\"I further authorize the stated URI to perform the following actions on my behalf: \";if(e.includes(r))return e;const i=[];let n=0;Object.keys(t.att).forEach(p=>{const b=Object.keys(t.att[p]).map(y=>({ability:y.split(\"/\")[0],action:y.split(\"/\")[1]}));b.sort((y,S)=>y.action.localeCompare(S.action));const m={};b.forEach(y=>{m[y.ability]||(m[y.ability]=[]),m[y.ability].push(y.action)});const w=Object.keys(m).map(y=>(n++,`(${n}) '${y}': '${m[y].join(\"', '\")}' for '${p}'.`));i.push(w.join(\", \").replace(\".,\",\".\"))});const o=i.join(\" \"),h=`${r}${o}`;return`${e?e+\" \":\"\"}${h}`}function du(e){var t;const r=Oe(e);me(r);const i=(t=r.att)==null?void 0:t.eip155;return i?Object.keys(i).map(n=>n.split(\"/\")[1]):[]}function pu(e){const t=Oe(e);me(t);const r=[];return Object.values(t.att).forEach(i=>{Object.values(i).forEach(n=>{var o;(o=n?.[0])!=null&&o.chains&&r.push(n[0].chains)})}),[...new Set(r.flat())]}function Xf(e,t){if(!t)return e;const r=Oe(t);return me(r),Ji(e,r)}function Qr(e){if(!e)return;const t=e?.[e.length-1];return Qi(t)?t:void 0}const Gi=\"base10\",zt=\"base16\",Jr=\"base64pad\",Gr=\"utf8\",Yi=0,lr=1,vu=0,Zf=1,Vi=12,Wi=32;function mu(){const e=_stablelib_x25519__WEBPACK_IMPORTED_MODULE_8__.generateKeyPair();return{privateKey:(0,uint8arrays__WEBPACK_IMPORTED_MODULE_9__.toString)(e.secretKey,zt),publicKey:(0,uint8arrays__WEBPACK_IMPORTED_MODULE_9__.toString)(e.publicKey,zt)}}function gu(){const e=(0,_stablelib_random__WEBPACK_IMPORTED_MODULE_6__.randomBytes)(Wi);return (0,uint8arrays__WEBPACK_IMPORTED_MODULE_9__.toString)(e,zt)}function Au(e,t){const r=_stablelib_x25519__WEBPACK_IMPORTED_MODULE_8__.sharedKey((0,uint8arrays__WEBPACK_IMPORTED_MODULE_9__.fromString)(e,zt),(0,uint8arrays__WEBPACK_IMPORTED_MODULE_9__.fromString)(t,zt),!0),i=new _stablelib_hkdf__WEBPACK_IMPORTED_MODULE_5__.HKDF(_stablelib_sha256__WEBPACK_IMPORTED_MODULE_7__.SHA256,r).expand(Wi);return (0,uint8arrays__WEBPACK_IMPORTED_MODULE_9__.toString)(i,zt)}function bu(e){const t=(0,_stablelib_sha256__WEBPACK_IMPORTED_MODULE_7__.hash)((0,uint8arrays__WEBPACK_IMPORTED_MODULE_9__.fromString)(e,zt));return (0,uint8arrays__WEBPACK_IMPORTED_MODULE_9__.toString)(t,zt)}function yu(e){const t=(0,_stablelib_sha256__WEBPACK_IMPORTED_MODULE_7__.hash)((0,uint8arrays__WEBPACK_IMPORTED_MODULE_9__.fromString)(e,Gr));return (0,uint8arrays__WEBPACK_IMPORTED_MODULE_9__.toString)(t,zt)}function $f(e){return (0,uint8arrays__WEBPACK_IMPORTED_MODULE_9__.fromString)(`${e}`,Gi)}function Mr(e){return Number((0,uint8arrays__WEBPACK_IMPORTED_MODULE_9__.toString)(e,Gi))}function wu(e){const t=$f(typeof e.type<\"u\"?e.type:Yi);if(Mr(t)===lr&&typeof e.senderPublicKey>\"u\")throw new Error(\"Missing sender public key for type 1 envelope\");const r=typeof e.senderPublicKey<\"u\"?(0,uint8arrays__WEBPACK_IMPORTED_MODULE_9__.fromString)(e.senderPublicKey,zt):void 0,i=typeof e.iv<\"u\"?(0,uint8arrays__WEBPACK_IMPORTED_MODULE_9__.fromString)(e.iv,zt):(0,_stablelib_random__WEBPACK_IMPORTED_MODULE_6__.randomBytes)(Vi),n=new _stablelib_chacha20poly1305__WEBPACK_IMPORTED_MODULE_4__.ChaCha20Poly1305((0,uint8arrays__WEBPACK_IMPORTED_MODULE_9__.fromString)(e.symKey,zt)).seal(i,(0,uint8arrays__WEBPACK_IMPORTED_MODULE_9__.fromString)(e.message,Gr));return to({type:t,sealed:n,iv:i,senderPublicKey:r})}function xu(e){const t=new _stablelib_chacha20poly1305__WEBPACK_IMPORTED_MODULE_4__.ChaCha20Poly1305((0,uint8arrays__WEBPACK_IMPORTED_MODULE_9__.fromString)(e.symKey,zt)),{sealed:r,iv:i}=Xi(e.encoded),n=t.open(i,r);if(n===null)throw new Error(\"Failed to decrypt\");return (0,uint8arrays__WEBPACK_IMPORTED_MODULE_9__.toString)(n,Gr)}function to(e){if(Mr(e.type)===lr){if(typeof e.senderPublicKey>\"u\")throw new Error(\"Missing sender public key for type 1 envelope\");return (0,uint8arrays__WEBPACK_IMPORTED_MODULE_9__.toString)((0,uint8arrays__WEBPACK_IMPORTED_MODULE_9__.concat)([e.type,e.senderPublicKey,e.iv,e.sealed]),Jr)}return (0,uint8arrays__WEBPACK_IMPORTED_MODULE_9__.toString)((0,uint8arrays__WEBPACK_IMPORTED_MODULE_9__.concat)([e.type,e.iv,e.sealed]),Jr)}function Xi(e){const t=(0,uint8arrays__WEBPACK_IMPORTED_MODULE_9__.fromString)(e,Jr),r=t.slice(vu,Zf),i=Zf;if(Mr(r)===lr){const p=i+Wi,b=p+Vi,m=t.slice(i,p),w=t.slice(p,b),y=t.slice(b);return{type:r,sealed:y,iv:w,senderPublicKey:m}}const n=i+Vi,o=t.slice(i,n),h=t.slice(n);return{type:r,sealed:h,iv:o}}function Mu(e,t){const r=Xi(e);return eo({type:Mr(r.type),senderPublicKey:typeof r.senderPublicKey<\"u\"?(0,uint8arrays__WEBPACK_IMPORTED_MODULE_9__.toString)(r.senderPublicKey,zt):void 0,receiverPublicKey:t?.receiverPublicKey})}function eo(e){const t=e?.type||Yi;if(t===lr){if(typeof e?.senderPublicKey>\"u\")throw new Error(\"missing sender public key\");if(typeof e?.receiverPublicKey>\"u\")throw new Error(\"missing receiver public key\")}return{type:t,senderPublicKey:e?.senderPublicKey,receiverPublicKey:e?.receiverPublicKey}}function Eu(e){return e.type===lr&&typeof e.senderPublicKey==\"string\"&&typeof e.receiverPublicKey==\"string\"}const ro=\"irn\";function Su(e){return e?.relay||{protocol:ro}}function Nu(e){const t=_walletconnect_relay_api__WEBPACK_IMPORTED_MODULE_10__.RELAY_JSONRPC[e];if(typeof t>\"u\")throw new Error(`Relay Protocol not supported: ${e}`);return t}var Iu=Object.defineProperty,_u=Object.defineProperties,Bu=Object.getOwnPropertyDescriptors,io=Object.getOwnPropertySymbols,Cu=Object.prototype.hasOwnProperty,Ru=Object.prototype.propertyIsEnumerable,no=(e,t,r)=>t in e?Iu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fo=(e,t)=>{for(var r in t||(t={}))Cu.call(t,r)&&no(e,r,t[r]);if(io)for(var r of io(t))Ru.call(t,r)&&no(e,r,t[r]);return e},Ou=(e,t)=>_u(e,Bu(t));function oo(e,t=\"-\"){const r={},i=\"relay\"+t;return Object.keys(e).forEach(n=>{if(n.startsWith(i)){const o=n.replace(i,\"\"),h=e[n];r[o]=h}}),r}function Pu(e){e=e.includes(\"wc://\")?e.replace(\"wc://\",\"\"):e,e=e.includes(\"wc:\")?e.replace(\"wc:\",\"\"):e;const t=e.indexOf(\":\"),r=e.indexOf(\"?\")!==-1?e.indexOf(\"?\"):void 0,i=e.substring(0,t),n=e.substring(t+1,r).split(\"@\"),o=typeof r<\"u\"?e.substring(r):\"\",h=query_string__WEBPACK_IMPORTED_MODULE_3__.parse(o),p=typeof h.methods==\"string\"?h.methods.split(\",\"):void 0;return{protocol:i,topic:so(n[0]),version:parseInt(n[1],10),symKey:h.symKey,relay:oo(h),methods:p,expiryTimestamp:h.expiryTimestamp?parseInt(h.expiryTimestamp,10):void 0}}function so(e){return e.startsWith(\"//\")?e.substring(2):e}function ao(e,t=\"-\"){const r=\"relay\",i={};return Object.keys(e).forEach(n=>{const o=r+t+n;e[n]&&(i[o]=e[n])}),i}function Du(e){return`${e.protocol}:${e.topic}@${e.version}?`+query_string__WEBPACK_IMPORTED_MODULE_3__.stringify(fo(Ou(fo({symKey:e.symKey},ao(e.relay)),{expiryTimestamp:e.expiryTimestamp}),e.methods?{methods:e.methods.join(\",\")}:{}))}var Fu=Object.defineProperty,Tu=Object.defineProperties,Uu=Object.getOwnPropertyDescriptors,uo=Object.getOwnPropertySymbols,ku=Object.prototype.hasOwnProperty,qu=Object.prototype.propertyIsEnumerable,ho=(e,t,r)=>t in e?Fu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ku=(e,t)=>{for(var r in t||(t={}))ku.call(t,r)&&ho(e,r,t[r]);if(uo)for(var r of uo(t))qu.call(t,r)&&ho(e,r,t[r]);return e},Hu=(e,t)=>Tu(e,Uu(t));function $e(e){const t=[];return e.forEach(r=>{const[i,n]=r.split(\":\");t.push(`${i}:${n}`)}),t}function co(e){const t=[];return Object.values(e).forEach(r=>{t.push(...$e(r.accounts))}),t}function lo(e,t){const r=[];return Object.values(e).forEach(i=>{$e(i.accounts).includes(t)&&r.push(...i.methods)}),r}function po(e,t){const r=[];return Object.values(e).forEach(i=>{$e(i.accounts).includes(t)&&r.push(...i.events)}),r}function zu(e,t){const r=So(e,t);if(r)throw new Error(r.message);const i={};for(const[n,o]of Object.entries(e))i[n]={methods:o.methods,events:o.events,chains:o.accounts.map(h=>`${h.split(\":\")[0]}:${h.split(\":\")[1]}`)};return i}function Lu(e){const{proposal:{requiredNamespaces:t,optionalNamespaces:r={}},supportedNamespaces:i}=e,n=$i(t),o=$i(r),h={};Object.keys(i).forEach(m=>{const w=i[m].chains,y=i[m].methods,S=i[m].events,I=i[m].accounts;w.forEach(N=>{if(!I.some(C=>C.includes(N)))throw new Error(`No accounts provided for chain ${N} in namespace ${m}`)}),h[m]={chains:w,methods:y,events:S,accounts:I}});const p=Io(t,h,\"approve()\");if(p)throw new Error(p.message);const b={};return!Object.keys(t).length&&!Object.keys(r).length?h:(Object.keys(n).forEach(m=>{const w=i[m].chains.filter(N=>{var C,F;return(F=(C=n[m])==null?void 0:C.chains)==null?void 0:F.includes(N)}),y=i[m].methods.filter(N=>{var C,F;return(F=(C=n[m])==null?void 0:C.methods)==null?void 0:F.includes(N)}),S=i[m].events.filter(N=>{var C,F;return(F=(C=n[m])==null?void 0:C.events)==null?void 0:F.includes(N)}),I=w.map(N=>i[m].accounts.filter(C=>C.includes(`${N}:`))).flat();b[m]={chains:w,methods:y,events:S,accounts:I}}),Object.keys(o).forEach(m=>{var w,y,S,I,N,C;if(!i[m])return;const F=(y=(w=o[m])==null?void 0:w.chains)==null?void 0:y.filter(G=>i[m].chains.includes(G)),U=i[m].methods.filter(G=>{var H,z;return(z=(H=o[m])==null?void 0:H.methods)==null?void 0:z.includes(G)}),J=i[m].events.filter(G=>{var H,z;return(z=(H=o[m])==null?void 0:H.events)==null?void 0:z.includes(G)}),Bt=F?.map(G=>i[m].accounts.filter(H=>H.includes(`${G}:`))).flat();b[m]={chains:ge((S=b[m])==null?void 0:S.chains,F),methods:ge((I=b[m])==null?void 0:I.methods,U),events:ge((N=b[m])==null?void 0:N.events,J),accounts:ge((C=b[m])==null?void 0:C.accounts,Bt)}}),b)}function Zi(e){return e.includes(\":\")}function vo(e){return Zi(e)?e.split(\":\")[0]:e}function $i(e){var t,r,i;const n={};if(!Yr(e))return n;for(const[o,h]of Object.entries(e)){const p=Zi(o)?[o]:h.chains,b=h.methods||[],m=h.events||[],w=vo(o);n[w]=Hu(Ku({},n[w]),{chains:ge(p,(t=n[w])==null?void 0:t.chains),methods:ge(b,(r=n[w])==null?void 0:r.methods),events:ge(m,(i=n[w])==null?void 0:i.events)})}return n}function mo(e){const t={};return e?.forEach(r=>{const[i,n]=r.split(\":\");t[i]||(t[i]={accounts:[],chains:[],events:[]}),t[i].accounts.push(r),t[i].chains.push(`${i}:${n}`)}),t}function ju(e,t){t=t.map(i=>i.replace(\"did:pkh:\",\"\"));const r=mo(t);for(const[i,n]of Object.entries(r))n.methods?n.methods=ge(n.methods,e):n.methods=e,n.events=[\"chainChanged\",\"accountsChanged\"];return r}const go={INVALID_METHOD:{message:\"Invalid method.\",code:1001},INVALID_EVENT:{message:\"Invalid event.\",code:1002},INVALID_UPDATE_REQUEST:{message:\"Invalid update request.\",code:1003},INVALID_EXTEND_REQUEST:{message:\"Invalid extend request.\",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:\"Invalid session settle request.\",code:1005},UNAUTHORIZED_METHOD:{message:\"Unauthorized method.\",code:3001},UNAUTHORIZED_EVENT:{message:\"Unauthorized event.\",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:\"Unauthorized update request.\",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:\"Unauthorized extend request.\",code:3004},USER_REJECTED:{message:\"User rejected.\",code:5e3},USER_REJECTED_CHAINS:{message:\"User rejected chains.\",code:5001},USER_REJECTED_METHODS:{message:\"User rejected methods.\",code:5002},USER_REJECTED_EVENTS:{message:\"User rejected events.\",code:5003},UNSUPPORTED_CHAINS:{message:\"Unsupported chains.\",code:5100},UNSUPPORTED_METHODS:{message:\"Unsupported methods.\",code:5101},UNSUPPORTED_EVENTS:{message:\"Unsupported events.\",code:5102},UNSUPPORTED_ACCOUNTS:{message:\"Unsupported accounts.\",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:\"Unsupported namespace key.\",code:5104},USER_DISCONNECTED:{message:\"User disconnected.\",code:6e3},SESSION_SETTLEMENT_FAILED:{message:\"Session settlement failed.\",code:7e3},WC_METHOD_UNSUPPORTED:{message:\"Unsupported wc_ method.\",code:10001}},Ao={NOT_INITIALIZED:{message:\"Not initialized.\",code:1},NO_MATCHING_KEY:{message:\"No matching key.\",code:2},RESTORE_WILL_OVERRIDE:{message:\"Restore will override.\",code:3},RESUBSCRIBED:{message:\"Resubscribed.\",code:4},MISSING_OR_INVALID:{message:\"Missing or invalid.\",code:5},EXPIRED:{message:\"Expired.\",code:6},UNKNOWN_TYPE:{message:\"Unknown type.\",code:7},MISMATCHED_TOPIC:{message:\"Mismatched topic.\",code:8},NON_CONFORMING_NAMESPACES:{message:\"Non conforming namespaces.\",code:9}};function xe(e,t){const{message:r,code:i}=Ao[e];return{message:t?`${r} ${t}`:r,code:i}}function tr(e,t){const{message:r,code:i}=go[e];return{message:t?`${r} ${t}`:r,code:i}}function Er(e,t){return Array.isArray(e)?typeof t<\"u\"&&e.length?e.every(t):!0:!1}function Yr(e){return Object.getPrototypeOf(e)===Object.prototype&&Object.keys(e).length}function Pe(e){return typeof e>\"u\"}function Gt(e,t){return t&&Pe(e)?!0:typeof e==\"string\"&&!!e.trim().length}function Vr(e,t){return t&&Pe(e)?!0:typeof e==\"number\"&&!isNaN(e)}function Qu(e,t){const{requiredNamespaces:r}=t,i=Object.keys(e.namespaces),n=Object.keys(r);let o=!0;return _e(n,i)?(i.forEach(h=>{const{accounts:p,methods:b,events:m}=e.namespaces[h],w=$e(p),y=r[h];(!_e(_r(h,y),w)||!_e(y.methods,b)||!_e(y.events,m))&&(o=!1)}),o):!1}function Sr(e){return Gt(e,!1)&&e.includes(\":\")?e.split(\":\").length===2:!1}function bo(e){if(Gt(e,!1)&&e.includes(\":\")){const t=e.split(\":\");if(t.length===3){const r=t[0]+\":\"+t[1];return!!t[2]&&Sr(r)}}return!1}function Ju(e){if(Gt(e,!1))try{return typeof new URL(e)<\"u\"}catch{return!1}return!1}function Gu(e){var t;return(t=e?.proposer)==null?void 0:t.publicKey}function Yu(e){return e?.topic}function Vu(e,t){let r=null;return Gt(e?.publicKey,!1)||(r=xe(\"MISSING_OR_INVALID\",`${t} controller public key should be a string`)),r}function tn(e){let t=!0;return Er(e)?e.length&&(t=e.every(r=>Gt(r,!1))):t=!1,t}function yo(e,t,r){let i=null;return Er(t)&&t.length?t.forEach(n=>{i||Sr(n)||(i=tr(\"UNSUPPORTED_CHAINS\",`${r}, chain ${n} should be a string and conform to \"namespace:chainId\" format`))}):Sr(e)||(i=tr(\"UNSUPPORTED_CHAINS\",`${r}, chains must be defined as \"namespace:chainId\" e.g. \"eip155:1\": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: [\"eip155:1\", \"eip155:5\"] }`)),i}function wo(e,t,r){let i=null;return Object.entries(e).forEach(([n,o])=>{if(i)return;const h=yo(n,_r(n,o),`${t} ${r}`);h&&(i=h)}),i}function xo(e,t){let r=null;return Er(e)?e.forEach(i=>{r||bo(i)||(r=tr(\"UNSUPPORTED_ACCOUNTS\",`${t}, account ${i} should be a string and conform to \"namespace:chainId:address\" format`))}):r=tr(\"UNSUPPORTED_ACCOUNTS\",`${t}, accounts should be an array of strings conforming to \"namespace:chainId:address\" format`),r}function Mo(e,t){let r=null;return Object.values(e).forEach(i=>{if(r)return;const n=xo(i?.accounts,`${t} namespace`);n&&(r=n)}),r}function Eo(e,t){let r=null;return tn(e?.methods)?tn(e?.events)||(r=tr(\"UNSUPPORTED_EVENTS\",`${t}, events should be an array of strings or empty array for no events`)):r=tr(\"UNSUPPORTED_METHODS\",`${t}, methods should be an array of strings or empty array for no methods`),r}function en(e,t){let r=null;return Object.values(e).forEach(i=>{if(r)return;const n=Eo(i,`${t}, namespace`);n&&(r=n)}),r}function Wu(e,t,r){let i=null;if(e&&Yr(e)){const n=en(e,t);n&&(i=n);const o=wo(e,t,r);o&&(i=o)}else i=xe(\"MISSING_OR_INVALID\",`${t}, ${r} should be an object with data`);return i}function So(e,t){let r=null;if(e&&Yr(e)){const i=en(e,t);i&&(r=i);const n=Mo(e,t);n&&(r=n)}else r=xe(\"MISSING_OR_INVALID\",`${t}, namespaces should be an object with data`);return r}function No(e){return Gt(e.protocol,!0)}function Xu(e,t){let r=!1;return t&&!e?r=!0:e&&Er(e)&&e.length&&e.forEach(i=>{r=No(i)}),r}function Zu(e){return typeof e==\"number\"}function $u(e){return typeof e<\"u\"&&typeof e!==null}function th(e){return!(!e||typeof e!=\"object\"||!e.code||!Vr(e.code,!1)||!e.message||!Gt(e.message,!1))}function eh(e){return!(Pe(e)||!Gt(e.method,!1))}function rh(e){return!(Pe(e)||Pe(e.result)&&Pe(e.error)||!Vr(e.id,!1)||!Gt(e.jsonrpc,!1))}function ih(e){return!(Pe(e)||!Gt(e.name,!1))}function nh(e,t){return!(!Sr(t)||!co(e).includes(t))}function fh(e,t,r){return Gt(r,!1)?lo(e,t).includes(r):!1}function oh(e,t,r){return Gt(r,!1)?po(e,t).includes(r):!1}function Io(e,t,r){let i=null;const n=sh(e),o=ah(t),h=Object.keys(n),p=Object.keys(o),b=_o(Object.keys(e)),m=_o(Object.keys(t)),w=b.filter(y=>!m.includes(y));return w.length&&(i=xe(\"NON_CONFORMING_NAMESPACES\",`${r} namespaces keys don't satisfy requiredNamespaces.\n Required: ${w.toString()}\n Received: ${Object.keys(t).toString()}`)),_e(h,p)||(i=xe(\"NON_CONFORMING_NAMESPACES\",`${r} namespaces chains don't satisfy required namespaces.\n Required: ${h.toString()}\n Approved: ${p.toString()}`)),Object.keys(t).forEach(y=>{if(!y.includes(\":\")||i)return;const S=$e(t[y].accounts);S.includes(y)||(i=xe(\"NON_CONFORMING_NAMESPACES\",`${r} namespaces accounts don't satisfy namespace accounts for ${y}\n Required: ${y}\n Approved: ${S.toString()}`))}),h.forEach(y=>{i||(_e(n[y].methods,o[y].methods)?_e(n[y].events,o[y].events)||(i=xe(\"NON_CONFORMING_NAMESPACES\",`${r} namespaces events don't satisfy namespace events for ${y}`)):i=xe(\"NON_CONFORMING_NAMESPACES\",`${r} namespaces methods don't satisfy namespace methods for ${y}`))}),i}function sh(e){const t={};return Object.keys(e).forEach(r=>{var i;r.includes(\":\")?t[r]=e[r]:(i=e[r].chains)==null||i.forEach(n=>{t[n]={methods:e[r].methods,events:e[r].events}})}),t}function _o(e){return[...new Set(e.map(t=>t.includes(\":\")?t.split(\":\")[0]:t))]}function ah(e){const t={};return Object.keys(e).forEach(r=>{if(r.includes(\":\"))t[r]=e[r];else{const i=$e(e[r].accounts);i?.forEach(n=>{t[n]={accounts:e[r].accounts.filter(o=>o.includes(`${n}:`)),methods:e[r].methods,events:e[r].events}})}}),t}function uh(e,t){return Vr(e,!1)&&e<=t.max&&e>=t.min}function hh(){const e=We();return new Promise(t=>{switch(e){case qt.browser:t(Bo());break;case qt.reactNative:t(Co());break;case qt.node:t(Ro());break;default:t(!0)}})}function Bo(){return pr()&&navigator?.onLine}async function Co(){if(er()&&typeof __webpack_require__.g<\"u\"&&__webpack_require__.g!=null&&__webpack_require__.g.NetInfo){const e=await(__webpack_require__.g==null?void 0:__webpack_require__.g.NetInfo.fetch());return e?.isConnected}return!0}function Ro(){return!0}function ch(e){switch(We()){case qt.browser:Oo(e);break;case qt.reactNative:Po(e);break;case qt.node:break}}function Oo(e){!er()&&pr()&&(window.addEventListener(\"online\",()=>e(!0)),window.addEventListener(\"offline\",()=>e(!1)))}function Po(e){er()&&typeof __webpack_require__.g<\"u\"&&__webpack_require__.g!=null&&__webpack_require__.g.NetInfo&&__webpack_require__.g?.NetInfo.addEventListener(t=>e(t?.isConnected))}const rn={};class lh{static get(t){return rn[t]}static set(t,r){rn[t]=r}static delete(t){delete rn[t]}}\n//# sourceMappingURL=index.es.js.map\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/utils/dist/index.es.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/web3wallet/dist/index.es.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@walletconnect/web3wallet/dist/index.es.js ***! - \*****************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CLIENT_CONTEXT: () => (/* binding */ p),\n/* harmony export */ CLIENT_STORAGE_OPTIONS: () => (/* binding */ G),\n/* harmony export */ CLIENT_STORAGE_PREFIX: () => (/* binding */ $),\n/* harmony export */ IWeb3Wallet: () => (/* binding */ x),\n/* harmony export */ IWeb3WalletEngine: () => (/* binding */ P),\n/* harmony export */ IWeb3WalletEvents: () => (/* binding */ Q),\n/* harmony export */ PROTOCOL: () => (/* binding */ A),\n/* harmony export */ PROTOCOL_VERSION: () => (/* binding */ X),\n/* harmony export */ REQUEST_CONTEXT: () => (/* binding */ H),\n/* harmony export */ Web3Wallet: () => (/* binding */ ie),\n/* harmony export */ \"default\": () => (/* binding */ v)\n/* harmony export */ });\n/* harmony import */ var _walletconnect_auth_client__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @walletconnect/auth-client */ \"./node_modules/@walletconnect/auth-client/dist/index.es.js\");\n/* harmony import */ var _walletconnect_sign_client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @walletconnect/sign-client */ \"./node_modules/@walletconnect/sign-client/dist/index.es.js\");\n/* harmony import */ var _walletconnect_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @walletconnect/core */ \"./node_modules/@walletconnect/core/dist/index.es.js\");\nvar l={exports:{}},c=typeof Reflect==\"object\"?Reflect:null,y=c&&typeof c.apply==\"function\"?c.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)},f;c&&typeof c.ownKeys==\"function\"?f=c.ownKeys:Object.getOwnPropertySymbols?f=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:f=function(t){return Object.getOwnPropertyNames(t)};function k(s){console&&console.warn&&console.warn(s)}var w=Number.isNaN||function(t){return t!==t};function o(){o.init.call(this)}l.exports=o,l.exports.once=K,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var L=10;function g(s){if(typeof s!=\"function\")throw new TypeError('The \"listener\" argument must be of type Function. Received type '+typeof s)}Object.defineProperty(o,\"defaultMaxListeners\",{enumerable:!0,get:function(){return L},set:function(s){if(typeof s!=\"number\"||s<0||w(s))throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received '+s+\".\");L=s}}),o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(t){if(typeof t!=\"number\"||t<0||w(t))throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received '+t+\".\");return this._maxListeners=t,this};function _(s){return s._maxListeners===void 0?o.defaultMaxListeners:s._maxListeners}o.prototype.getMaxListeners=function(){return _(this)},o.prototype.emit=function(t){for(var e=[],n=1;n0&&(r=e[0]),r instanceof Error)throw r;var h=new Error(\"Unhandled error.\"+(r?\" (\"+r.message+\")\":\"\"));throw h.context=r,h}var u=a[t];if(u===void 0)return!1;if(typeof u==\"function\")y(u,this,e);else for(var d=u.length,M=O(u,d),n=0;n0&&r.length>i&&!r.warned){r.warned=!0;var h=new Error(\"Possible EventEmitter memory leak detected. \"+r.length+\" \"+String(t)+\" listeners added. Use emitter.setMaxListeners() to increase limit\");h.name=\"MaxListenersExceededWarning\",h.emitter=s,h.type=t,h.count=r.length,k(h)}return s}o.prototype.addListener=function(t,e){return S(this,t,e,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(t,e){return S(this,t,e,!0)};function D(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function b(s,t,e){var n={fired:!1,wrapFn:void 0,target:s,type:t,listener:e},i=D.bind(n);return i.listener=e,n.wrapFn=i,i}o.prototype.once=function(t,e){return g(e),this.on(t,b(this,t,e)),this},o.prototype.prependOnceListener=function(t,e){return g(e),this.prependListener(t,b(this,t,e)),this},o.prototype.removeListener=function(t,e){var n,i,a,r,h;if(g(e),i=this._events,i===void 0)return this;if(n=i[t],n===void 0)return this;if(n===e||n.listener===e)--this._eventsCount===0?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit(\"removeListener\",t,n.listener||e));else if(typeof n!=\"function\"){for(a=-1,r=n.length-1;r>=0;r--)if(n[r]===e||n[r].listener===e){h=n[r].listener,a=r;break}if(a<0)return this;a===0?n.shift():F(n,a),n.length===1&&(i[t]=n[0]),i.removeListener!==void 0&&this.emit(\"removeListener\",t,h||e)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(t){var e,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[t]),this;if(arguments.length===0){var a=Object.keys(n),r;for(i=0;i=0;i--)this.removeListener(t,e[i]);return this};function C(s,t,e){var n=s._events;if(n===void 0)return[];var i=n[t];return i===void 0?[]:typeof i==\"function\"?e?[i.listener||i]:[i]:e?z(i):O(i,i.length)}o.prototype.listeners=function(t){return C(this,t,!0)},o.prototype.rawListeners=function(t){return C(this,t,!1)},o.listenerCount=function(s,t){return typeof s.listenerCount==\"function\"?s.listenerCount(t):E.call(s,t)},o.prototype.listenerCount=E;function E(s){var t=this._events;if(t!==void 0){var e=t[s];if(typeof e==\"function\")return 1;if(e!==void 0)return e.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?f(this._events):[]};function O(s,t){for(var e=new Array(t),n=0;nt in s?V(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,ee=(s,t)=>{for(var e in t||(t={}))Y.call(t,e)&&j(s,e,t[e]);if(q)for(var e of q(t))Z.call(t,e)&&j(s,e,t[e]);return s},te=(s,t)=>B(s,J(t));class se extends P{constructor(t){super(t),this.init=async()=>{this.signClient=await _walletconnect_sign_client__WEBPACK_IMPORTED_MODULE_1__.SignClient.init({core:this.client.core,metadata:this.client.metadata}),this.authClient=await _walletconnect_auth_client__WEBPACK_IMPORTED_MODULE_0__.AuthClient.init({core:this.client.core,projectId:\"\",metadata:this.client.metadata})},this.pair=async e=>{await this.client.core.pairing.pair(e)},this.approveSession=async e=>{const{topic:n,acknowledged:i}=await this.signClient.approve(te(ee({},e),{id:e.id,namespaces:e.namespaces,sessionProperties:e.sessionProperties,sessionConfig:e.sessionConfig}));return await i(),this.signClient.session.get(n)},this.rejectSession=async e=>await this.signClient.reject(e),this.updateSession=async e=>await this.signClient.update(e),this.extendSession=async e=>await this.signClient.extend(e),this.respondSessionRequest=async e=>await this.signClient.respond(e),this.disconnectSession=async e=>await this.signClient.disconnect(e),this.emitSessionEvent=async e=>await this.signClient.emit(e),this.getActiveSessions=()=>this.signClient.session.getAll().reduce((e,n)=>(e[n.topic]=n,e),{}),this.getPendingSessionProposals=()=>this.signClient.proposal.getAll(),this.getPendingSessionRequests=()=>this.signClient.getPendingSessionRequests(),this.respondAuthRequest=async(e,n)=>await this.authClient.respond(e,n),this.getPendingAuthRequests=()=>this.authClient.requests.getAll().filter(e=>\"requester\"in e),this.formatMessage=(e,n)=>this.authClient.formatMessage(e,n),this.approveSessionAuthenticate=async e=>await this.signClient.approveSessionAuthenticate(e),this.rejectSessionAuthenticate=async e=>await this.signClient.rejectSessionAuthenticate(e),this.formatAuthMessage=e=>this.signClient.formatAuthMessage(e),this.registerDeviceToken=e=>this.client.core.echoClient.registerDeviceToken(e),this.on=(e,n)=>(this.setEvent(e,\"on\"),this.client.events.on(e,n)),this.once=(e,n)=>(this.setEvent(e,\"once\"),this.client.events.once(e,n)),this.off=(e,n)=>(this.setEvent(e,\"off\"),this.client.events.off(e,n)),this.removeListener=(e,n)=>(this.setEvent(e,\"removeListener\"),this.client.events.removeListener(e,n)),this.onSessionRequest=e=>{this.client.events.emit(\"session_request\",e)},this.onSessionProposal=e=>{this.client.events.emit(\"session_proposal\",e)},this.onSessionDelete=e=>{this.client.events.emit(\"session_delete\",e)},this.onAuthRequest=e=>{this.client.events.emit(\"auth_request\",e)},this.onProposalExpire=e=>{this.client.events.emit(\"proposal_expire\",e)},this.onSessionRequestExpire=e=>{this.client.events.emit(\"session_request_expire\",e)},this.onSessionRequestAuthenticate=e=>{this.client.events.emit(\"session_authenticate\",e)},this.setEvent=(e,n)=>{switch(e){case\"session_request\":this.signClient.events[n](\"session_request\",this.onSessionRequest);break;case\"session_proposal\":this.signClient.events[n](\"session_proposal\",this.onSessionProposal);break;case\"session_delete\":this.signClient.events[n](\"session_delete\",this.onSessionDelete);break;case\"auth_request\":this.authClient[n](\"auth_request\",this.onAuthRequest);break;case\"proposal_expire\":this.signClient.events[n](\"proposal_expire\",this.onProposalExpire);break;case\"session_request_expire\":this.signClient.events[n](\"session_request_expire\",this.onSessionRequestExpire);break;case\"session_authenticate\":this.signClient.events[n](\"session_authenticate\",this.onSessionRequestAuthenticate);break}},this.signClient={},this.authClient={}}}const ne={decryptMessage:async s=>{const t={core:new _walletconnect_core__WEBPACK_IMPORTED_MODULE_2__.Core({storageOptions:s.storageOptions,storage:s.storage})};await t.core.crypto.init();const e=t.core.crypto.decode(s.topic,s.encryptedMessage);return t.core=null,e},getMetadata:async s=>{const t={core:new _walletconnect_core__WEBPACK_IMPORTED_MODULE_2__.Core({storageOptions:s.storageOptions,storage:s.storage}),sessionStore:null};t.sessionStore=new _walletconnect_sign_client__WEBPACK_IMPORTED_MODULE_1__.SessionStore(t.core,t.core.logger),await t.sessionStore.init();const e=t.sessionStore.get(s.topic),n=e?.peer.metadata;return t.core=null,t.sessionStore=null,n}},T=class extends x{constructor(s){super(s),this.events=new l.exports,this.on=(t,e)=>this.engine.on(t,e),this.once=(t,e)=>this.engine.once(t,e),this.off=(t,e)=>this.engine.off(t,e),this.removeListener=(t,e)=>this.engine.removeListener(t,e),this.pair=async t=>{try{return await this.engine.pair(t)}catch(e){throw this.logger.error(e.message),e}},this.approveSession=async t=>{try{return await this.engine.approveSession(t)}catch(e){throw this.logger.error(e.message),e}},this.rejectSession=async t=>{try{return await this.engine.rejectSession(t)}catch(e){throw this.logger.error(e.message),e}},this.updateSession=async t=>{try{return await this.engine.updateSession(t)}catch(e){throw this.logger.error(e.message),e}},this.extendSession=async t=>{try{return await this.engine.extendSession(t)}catch(e){throw this.logger.error(e.message),e}},this.respondSessionRequest=async t=>{try{return await this.engine.respondSessionRequest(t)}catch(e){throw this.logger.error(e.message),e}},this.disconnectSession=async t=>{try{return await this.engine.disconnectSession(t)}catch(e){throw this.logger.error(e.message),e}},this.emitSessionEvent=async t=>{try{return await this.engine.emitSessionEvent(t)}catch(e){throw this.logger.error(e.message),e}},this.getActiveSessions=()=>{try{return this.engine.getActiveSessions()}catch(t){throw this.logger.error(t.message),t}},this.getPendingSessionProposals=()=>{try{return this.engine.getPendingSessionProposals()}catch(t){throw this.logger.error(t.message),t}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(t){throw this.logger.error(t.message),t}},this.respondAuthRequest=async(t,e)=>{try{return await this.engine.respondAuthRequest(t,e)}catch(n){throw this.logger.error(n.message),n}},this.getPendingAuthRequests=()=>{try{return this.engine.getPendingAuthRequests()}catch(t){throw this.logger.error(t.message),t}},this.formatMessage=(t,e)=>{try{return this.engine.formatMessage(t,e)}catch(n){throw this.logger.error(n.message),n}},this.registerDeviceToken=t=>{try{return this.engine.registerDeviceToken(t)}catch(e){throw this.logger.error(e.message),e}},this.approveSessionAuthenticate=t=>{try{return this.engine.approveSessionAuthenticate(t)}catch(e){throw this.logger.error(e.message),e}},this.rejectSessionAuthenticate=t=>{try{return this.engine.rejectSessionAuthenticate(t)}catch(e){throw this.logger.error(e.message),e}},this.formatAuthMessage=t=>{try{return this.engine.formatAuthMessage(t)}catch(e){throw this.logger.error(e.message),e}},this.metadata=s.metadata,this.name=s.name||p,this.core=s.core,this.logger=this.core.logger,this.engine=new se(this)}static async init(s){const t=new T(s);return await t.initialize(),t}async initialize(){this.logger.trace(\"Initialized\");try{await this.engine.init(),this.logger.info(\"Web3Wallet Initialization Success\")}catch(s){throw this.logger.info(\"Web3Wallet Initialization Failure\"),this.logger.error(s.message),s}}};let v=T;v.notifications=ne;const ie=v;\n//# sourceMappingURL=index.es.js.map\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/web3wallet/dist/index.es.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/window-getters/dist/cjs/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/@walletconnect/window-getters/dist/cjs/index.js ***! - \**********************************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.getLocalStorage = exports.getLocalStorageOrThrow = exports.getCrypto = exports.getCryptoOrThrow = exports.getLocation = exports.getLocationOrThrow = exports.getNavigator = exports.getNavigatorOrThrow = exports.getDocument = exports.getDocumentOrThrow = exports.getFromWindowOrThrow = exports.getFromWindow = void 0;\nfunction getFromWindow(name) {\n let res = undefined;\n if (typeof window !== \"undefined\" && typeof window[name] !== \"undefined\") {\n res = window[name];\n }\n return res;\n}\nexports.getFromWindow = getFromWindow;\nfunction getFromWindowOrThrow(name) {\n const res = getFromWindow(name);\n if (!res) {\n throw new Error(`${name} is not defined in Window`);\n }\n return res;\n}\nexports.getFromWindowOrThrow = getFromWindowOrThrow;\nfunction getDocumentOrThrow() {\n return getFromWindowOrThrow(\"document\");\n}\nexports.getDocumentOrThrow = getDocumentOrThrow;\nfunction getDocument() {\n return getFromWindow(\"document\");\n}\nexports.getDocument = getDocument;\nfunction getNavigatorOrThrow() {\n return getFromWindowOrThrow(\"navigator\");\n}\nexports.getNavigatorOrThrow = getNavigatorOrThrow;\nfunction getNavigator() {\n return getFromWindow(\"navigator\");\n}\nexports.getNavigator = getNavigator;\nfunction getLocationOrThrow() {\n return getFromWindowOrThrow(\"location\");\n}\nexports.getLocationOrThrow = getLocationOrThrow;\nfunction getLocation() {\n return getFromWindow(\"location\");\n}\nexports.getLocation = getLocation;\nfunction getCryptoOrThrow() {\n return getFromWindowOrThrow(\"crypto\");\n}\nexports.getCryptoOrThrow = getCryptoOrThrow;\nfunction getCrypto() {\n return getFromWindow(\"crypto\");\n}\nexports.getCrypto = getCrypto;\nfunction getLocalStorageOrThrow() {\n return getFromWindowOrThrow(\"localStorage\");\n}\nexports.getLocalStorageOrThrow = getLocalStorageOrThrow;\nfunction getLocalStorage() {\n return getFromWindow(\"localStorage\");\n}\nexports.getLocalStorage = getLocalStorage;\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/window-getters/dist/cjs/index.js?"); - -/***/ }), - -/***/ "./node_modules/@walletconnect/window-metadata/dist/cjs/index.js": -/*!***********************************************************************!*\ - !*** ./node_modules/@walletconnect/window-metadata/dist/cjs/index.js ***! - \***********************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.getWindowMetadata = void 0;\nconst window_getters_1 = __webpack_require__(/*! @walletconnect/window-getters */ \"./node_modules/@walletconnect/window-getters/dist/cjs/index.js\");\nfunction getWindowMetadata() {\n let doc;\n let loc;\n try {\n doc = window_getters_1.getDocumentOrThrow();\n loc = window_getters_1.getLocationOrThrow();\n }\n catch (e) {\n return null;\n }\n function getIcons() {\n const links = doc.getElementsByTagName(\"link\");\n const icons = [];\n for (let i = 0; i < links.length; i++) {\n const link = links[i];\n const rel = link.getAttribute(\"rel\");\n if (rel) {\n if (rel.toLowerCase().indexOf(\"icon\") > -1) {\n const href = link.getAttribute(\"href\");\n if (href) {\n if (href.toLowerCase().indexOf(\"https:\") === -1 &&\n href.toLowerCase().indexOf(\"http:\") === -1 &&\n href.indexOf(\"//\") !== 0) {\n let absoluteHref = loc.protocol + \"//\" + loc.host;\n if (href.indexOf(\"/\") === 0) {\n absoluteHref += href;\n }\n else {\n const path = loc.pathname.split(\"/\");\n path.pop();\n const finalPath = path.join(\"/\");\n absoluteHref += finalPath + \"/\" + href;\n }\n icons.push(absoluteHref);\n }\n else if (href.indexOf(\"//\") === 0) {\n const absoluteUrl = loc.protocol + href;\n icons.push(absoluteUrl);\n }\n else {\n icons.push(href);\n }\n }\n }\n }\n }\n return icons;\n }\n function getWindowMetadataOfAny(...args) {\n const metaTags = doc.getElementsByTagName(\"meta\");\n for (let i = 0; i < metaTags.length; i++) {\n const tag = metaTags[i];\n const attributes = [\"itemprop\", \"property\", \"name\"]\n .map((target) => tag.getAttribute(target))\n .filter((attr) => {\n if (attr) {\n return args.includes(attr);\n }\n return false;\n });\n if (attributes.length && attributes) {\n const content = tag.getAttribute(\"content\");\n if (content) {\n return content;\n }\n }\n }\n return \"\";\n }\n function getName() {\n let name = getWindowMetadataOfAny(\"name\", \"og:site_name\", \"og:title\", \"twitter:title\");\n if (!name) {\n name = doc.title;\n }\n return name;\n }\n function getDescription() {\n const description = getWindowMetadataOfAny(\"description\", \"og:description\", \"twitter:description\", \"keywords\");\n return description;\n }\n const name = getName();\n const description = getDescription();\n const url = loc.origin;\n const icons = getIcons();\n const meta = {\n description,\n url,\n icons,\n name,\n };\n return meta;\n}\nexports.getWindowMetadata = getWindowMetadata;\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/@walletconnect/window-metadata/dist/cjs/index.js?"); - -/***/ }), - -/***/ "./node_modules/bn.js/lib/bn.js": -/*!**************************************!*\ - !*** ./node_modules/bn.js/lib/bn.js ***! - \**************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -eval("/* module decorator */ module = __webpack_require__.nmd(module);\n(function (module, exports) {\n 'use strict';\n\n // Utils\n function assert (val, msg) {\n if (!val) throw new Error(msg || 'Assertion failed');\n }\n\n // Could use `inherits` module, but don't want to move from single file\n // architecture yet.\n function inherits (ctor, superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function () {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n\n // BN\n\n function BN (number, base, endian) {\n if (BN.isBN(number)) {\n return number;\n }\n\n this.negative = 0;\n this.words = null;\n this.length = 0;\n\n // Reduction context\n this.red = null;\n\n if (number !== null) {\n if (base === 'le' || base === 'be') {\n endian = base;\n base = 10;\n }\n\n this._init(number || 0, base || 10, endian || 'be');\n }\n }\n if (typeof module === 'object') {\n module.exports = BN;\n } else {\n exports.BN = BN;\n }\n\n BN.BN = BN;\n BN.wordSize = 26;\n\n var Buffer;\n try {\n if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') {\n Buffer = window.Buffer;\n } else {\n Buffer = (__webpack_require__(/*! buffer */ \"?8131\").Buffer);\n }\n } catch (e) {\n }\n\n BN.isBN = function isBN (num) {\n if (num instanceof BN) {\n return true;\n }\n\n return num !== null && typeof num === 'object' &&\n num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n };\n\n BN.max = function max (left, right) {\n if (left.cmp(right) > 0) return left;\n return right;\n };\n\n BN.min = function min (left, right) {\n if (left.cmp(right) < 0) return left;\n return right;\n };\n\n BN.prototype._init = function init (number, base, endian) {\n if (typeof number === 'number') {\n return this._initNumber(number, base, endian);\n }\n\n if (typeof number === 'object') {\n return this._initArray(number, base, endian);\n }\n\n if (base === 'hex') {\n base = 16;\n }\n assert(base === (base | 0) && base >= 2 && base <= 36);\n\n number = number.toString().replace(/\\s+/g, '');\n var start = 0;\n if (number[0] === '-') {\n start++;\n this.negative = 1;\n }\n\n if (start < number.length) {\n if (base === 16) {\n this._parseHex(number, start, endian);\n } else {\n this._parseBase(number, base, start);\n if (endian === 'le') {\n this._initArray(this.toArray(), base, endian);\n }\n }\n }\n };\n\n BN.prototype._initNumber = function _initNumber (number, base, endian) {\n if (number < 0) {\n this.negative = 1;\n number = -number;\n }\n if (number < 0x4000000) {\n this.words = [number & 0x3ffffff];\n this.length = 1;\n } else if (number < 0x10000000000000) {\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff\n ];\n this.length = 2;\n } else {\n assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff,\n 1\n ];\n this.length = 3;\n }\n\n if (endian !== 'le') return;\n\n // Reverse the bytes\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initArray = function _initArray (number, base, endian) {\n // Perhaps a Uint8Array\n assert(typeof number.length === 'number');\n if (number.length <= 0) {\n this.words = [0];\n this.length = 1;\n return this;\n }\n\n this.length = Math.ceil(number.length / 3);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n var off = 0;\n if (endian === 'be') {\n for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n } else if (endian === 'le') {\n for (i = 0, j = 0; i < number.length; i += 3) {\n w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n }\n return this._strip();\n };\n\n function parseHex4Bits (string, index) {\n var c = string.charCodeAt(index);\n // '0' - '9'\n if (c >= 48 && c <= 57) {\n return c - 48;\n // 'A' - 'F'\n } else if (c >= 65 && c <= 70) {\n return c - 55;\n // 'a' - 'f'\n } else if (c >= 97 && c <= 102) {\n return c - 87;\n } else {\n assert(false, 'Invalid character in ' + string);\n }\n }\n\n function parseHexByte (string, lowerBound, index) {\n var r = parseHex4Bits(string, index);\n if (index - 1 >= lowerBound) {\n r |= parseHex4Bits(string, index - 1) << 4;\n }\n return r;\n }\n\n BN.prototype._parseHex = function _parseHex (number, start, endian) {\n // Create possibly bigger array to ensure that it fits the number\n this.length = Math.ceil((number.length - start) / 6);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n // 24-bits chunks\n var off = 0;\n var j = 0;\n\n var w;\n if (endian === 'be') {\n for (i = number.length - 1; i >= start; i -= 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n } else {\n var parseLength = number.length - start;\n for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n }\n\n this._strip();\n };\n\n function parseBase (str, start, end, mul) {\n var r = 0;\n var b = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r *= mul;\n\n // 'a'\n if (c >= 49) {\n b = c - 49 + 0xa;\n\n // 'A'\n } else if (c >= 17) {\n b = c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n b = c;\n }\n assert(c >= 0 && b < mul, 'Invalid character');\n r += b;\n }\n return r;\n }\n\n BN.prototype._parseBase = function _parseBase (number, base, start) {\n // Initialize as zero\n this.words = [0];\n this.length = 1;\n\n // Find length of limb in base\n for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n limbLen++;\n }\n limbLen--;\n limbPow = (limbPow / base) | 0;\n\n var total = number.length - start;\n var mod = total % limbLen;\n var end = Math.min(total, total - mod) + start;\n\n var word = 0;\n for (var i = start; i < end; i += limbLen) {\n word = parseBase(number, i, i + limbLen, base);\n\n this.imuln(limbPow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n if (mod !== 0) {\n var pow = 1;\n word = parseBase(number, i, number.length, base);\n\n for (i = 0; i < mod; i++) {\n pow *= base;\n }\n\n this.imuln(pow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n this._strip();\n };\n\n BN.prototype.copy = function copy (dest) {\n dest.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n dest.words[i] = this.words[i];\n }\n dest.length = this.length;\n dest.negative = this.negative;\n dest.red = this.red;\n };\n\n function move (dest, src) {\n dest.words = src.words;\n dest.length = src.length;\n dest.negative = src.negative;\n dest.red = src.red;\n }\n\n BN.prototype._move = function _move (dest) {\n move(dest, this);\n };\n\n BN.prototype.clone = function clone () {\n var r = new BN(null);\n this.copy(r);\n return r;\n };\n\n BN.prototype._expand = function _expand (size) {\n while (this.length < size) {\n this.words[this.length++] = 0;\n }\n return this;\n };\n\n // Remove leading `0` from `this`\n BN.prototype._strip = function strip () {\n while (this.length > 1 && this.words[this.length - 1] === 0) {\n this.length--;\n }\n return this._normSign();\n };\n\n BN.prototype._normSign = function _normSign () {\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0) {\n this.negative = 0;\n }\n return this;\n };\n\n // Check Symbol.for because not everywhere where Symbol defined\n // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#Browser_compatibility\n if (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function') {\n try {\n BN.prototype[Symbol.for('nodejs.util.inspect.custom')] = inspect;\n } catch (e) {\n BN.prototype.inspect = inspect;\n }\n } else {\n BN.prototype.inspect = inspect;\n }\n\n function inspect () {\n return (this.red ? '';\n }\n\n /*\n\n var zeros = [];\n var groupSizes = [];\n var groupBases = [];\n\n var s = '';\n var i = -1;\n while (++i < BN.wordSize) {\n zeros[i] = s;\n s += '0';\n }\n groupSizes[0] = 0;\n groupSizes[1] = 0;\n groupBases[0] = 0;\n groupBases[1] = 0;\n var base = 2 - 1;\n while (++base < 36 + 1) {\n var groupSize = 0;\n var groupBase = 1;\n while (groupBase < (1 << BN.wordSize) / base) {\n groupBase *= base;\n groupSize += 1;\n }\n groupSizes[base] = groupSize;\n groupBases[base] = groupBase;\n }\n\n */\n\n var zeros = [\n '',\n '0',\n '00',\n '000',\n '0000',\n '00000',\n '000000',\n '0000000',\n '00000000',\n '000000000',\n '0000000000',\n '00000000000',\n '000000000000',\n '0000000000000',\n '00000000000000',\n '000000000000000',\n '0000000000000000',\n '00000000000000000',\n '000000000000000000',\n '0000000000000000000',\n '00000000000000000000',\n '000000000000000000000',\n '0000000000000000000000',\n '00000000000000000000000',\n '000000000000000000000000',\n '0000000000000000000000000'\n ];\n\n var groupSizes = [\n 0, 0,\n 25, 16, 12, 11, 10, 9, 8,\n 8, 7, 7, 7, 7, 6, 6,\n 6, 6, 6, 6, 6, 5, 5,\n 5, 5, 5, 5, 5, 5, 5,\n 5, 5, 5, 5, 5, 5, 5\n ];\n\n var groupBases = [\n 0, 0,\n 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n ];\n\n BN.prototype.toString = function toString (base, padding) {\n base = base || 10;\n padding = padding | 0 || 1;\n\n var out;\n if (base === 16 || base === 'hex') {\n out = '';\n var off = 0;\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = this.words[i];\n var word = (((w << off) | carry) & 0xffffff).toString(16);\n carry = (w >>> (24 - off)) & 0xffffff;\n off += 2;\n if (off >= 26) {\n off -= 26;\n i--;\n }\n if (carry !== 0 || i !== this.length - 1) {\n out = zeros[6 - word.length] + word + out;\n } else {\n out = word + out;\n }\n }\n if (carry !== 0) {\n out = carry.toString(16) + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n if (base === (base | 0) && base >= 2 && base <= 36) {\n // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n var groupSize = groupSizes[base];\n // var groupBase = Math.pow(base, groupSize);\n var groupBase = groupBases[base];\n out = '';\n var c = this.clone();\n c.negative = 0;\n while (!c.isZero()) {\n var r = c.modrn(groupBase).toString(base);\n c = c.idivn(groupBase);\n\n if (!c.isZero()) {\n out = zeros[groupSize - r.length] + r + out;\n } else {\n out = r + out;\n }\n }\n if (this.isZero()) {\n out = '0' + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n assert(false, 'Base should be between 2 and 36');\n };\n\n BN.prototype.toNumber = function toNumber () {\n var ret = this.words[0];\n if (this.length === 2) {\n ret += this.words[1] * 0x4000000;\n } else if (this.length === 3 && this.words[2] === 0x01) {\n // NOTE: at this stage it is known that the top bit is set\n ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n } else if (this.length > 2) {\n assert(false, 'Number can only safely store up to 53 bits');\n }\n return (this.negative !== 0) ? -ret : ret;\n };\n\n BN.prototype.toJSON = function toJSON () {\n return this.toString(16, 2);\n };\n\n if (Buffer) {\n BN.prototype.toBuffer = function toBuffer (endian, length) {\n return this.toArrayLike(Buffer, endian, length);\n };\n }\n\n BN.prototype.toArray = function toArray (endian, length) {\n return this.toArrayLike(Array, endian, length);\n };\n\n var allocate = function allocate (ArrayType, size) {\n if (ArrayType.allocUnsafe) {\n return ArrayType.allocUnsafe(size);\n }\n return new ArrayType(size);\n };\n\n BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n this._strip();\n\n var byteLength = this.byteLength();\n var reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, 'byte array longer than desired length');\n assert(reqLength > 0, 'Requested array length <= 0');\n\n var res = allocate(ArrayType, reqLength);\n var postfix = endian === 'le' ? 'LE' : 'BE';\n this['_toArrayLike' + postfix](res, byteLength);\n return res;\n };\n\n BN.prototype._toArrayLikeLE = function _toArrayLikeLE (res, byteLength) {\n var position = 0;\n var carry = 0;\n\n for (var i = 0, shift = 0; i < this.length; i++) {\n var word = (this.words[i] << shift) | carry;\n\n res[position++] = word & 0xff;\n if (position < res.length) {\n res[position++] = (word >> 8) & 0xff;\n }\n if (position < res.length) {\n res[position++] = (word >> 16) & 0xff;\n }\n\n if (shift === 6) {\n if (position < res.length) {\n res[position++] = (word >> 24) & 0xff;\n }\n carry = 0;\n shift = 0;\n } else {\n carry = word >>> 24;\n shift += 2;\n }\n }\n\n if (position < res.length) {\n res[position++] = carry;\n\n while (position < res.length) {\n res[position++] = 0;\n }\n }\n };\n\n BN.prototype._toArrayLikeBE = function _toArrayLikeBE (res, byteLength) {\n var position = res.length - 1;\n var carry = 0;\n\n for (var i = 0, shift = 0; i < this.length; i++) {\n var word = (this.words[i] << shift) | carry;\n\n res[position--] = word & 0xff;\n if (position >= 0) {\n res[position--] = (word >> 8) & 0xff;\n }\n if (position >= 0) {\n res[position--] = (word >> 16) & 0xff;\n }\n\n if (shift === 6) {\n if (position >= 0) {\n res[position--] = (word >> 24) & 0xff;\n }\n carry = 0;\n shift = 0;\n } else {\n carry = word >>> 24;\n shift += 2;\n }\n }\n\n if (position >= 0) {\n res[position--] = carry;\n\n while (position >= 0) {\n res[position--] = 0;\n }\n }\n };\n\n if (Math.clz32) {\n BN.prototype._countBits = function _countBits (w) {\n return 32 - Math.clz32(w);\n };\n } else {\n BN.prototype._countBits = function _countBits (w) {\n var t = w;\n var r = 0;\n if (t >= 0x1000) {\n r += 13;\n t >>>= 13;\n }\n if (t >= 0x40) {\n r += 7;\n t >>>= 7;\n }\n if (t >= 0x8) {\n r += 4;\n t >>>= 4;\n }\n if (t >= 0x02) {\n r += 2;\n t >>>= 2;\n }\n return r + t;\n };\n }\n\n BN.prototype._zeroBits = function _zeroBits (w) {\n // Short-cut\n if (w === 0) return 26;\n\n var t = w;\n var r = 0;\n if ((t & 0x1fff) === 0) {\n r += 13;\n t >>>= 13;\n }\n if ((t & 0x7f) === 0) {\n r += 7;\n t >>>= 7;\n }\n if ((t & 0xf) === 0) {\n r += 4;\n t >>>= 4;\n }\n if ((t & 0x3) === 0) {\n r += 2;\n t >>>= 2;\n }\n if ((t & 0x1) === 0) {\n r++;\n }\n return r;\n };\n\n // Return number of used bits in a BN\n BN.prototype.bitLength = function bitLength () {\n var w = this.words[this.length - 1];\n var hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n\n function toBitArray (num) {\n var w = new Array(num.bitLength());\n\n for (var bit = 0; bit < w.length; bit++) {\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n w[bit] = (num.words[off] >>> wbit) & 0x01;\n }\n\n return w;\n }\n\n // Number of trailing zero bits\n BN.prototype.zeroBits = function zeroBits () {\n if (this.isZero()) return 0;\n\n var r = 0;\n for (var i = 0; i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n r += b;\n if (b !== 26) break;\n }\n return r;\n };\n\n BN.prototype.byteLength = function byteLength () {\n return Math.ceil(this.bitLength() / 8);\n };\n\n BN.prototype.toTwos = function toTwos (width) {\n if (this.negative !== 0) {\n return this.abs().inotn(width).iaddn(1);\n }\n return this.clone();\n };\n\n BN.prototype.fromTwos = function fromTwos (width) {\n if (this.testn(width - 1)) {\n return this.notn(width).iaddn(1).ineg();\n }\n return this.clone();\n };\n\n BN.prototype.isNeg = function isNeg () {\n return this.negative !== 0;\n };\n\n // Return negative clone of `this`\n BN.prototype.neg = function neg () {\n return this.clone().ineg();\n };\n\n BN.prototype.ineg = function ineg () {\n if (!this.isZero()) {\n this.negative ^= 1;\n }\n\n return this;\n };\n\n // Or `num` with `this` in-place\n BN.prototype.iuor = function iuor (num) {\n while (this.length < num.length) {\n this.words[this.length++] = 0;\n }\n\n for (var i = 0; i < num.length; i++) {\n this.words[i] = this.words[i] | num.words[i];\n }\n\n return this._strip();\n };\n\n BN.prototype.ior = function ior (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuor(num);\n };\n\n // Or `num` with `this`\n BN.prototype.or = function or (num) {\n if (this.length > num.length) return this.clone().ior(num);\n return num.clone().ior(this);\n };\n\n BN.prototype.uor = function uor (num) {\n if (this.length > num.length) return this.clone().iuor(num);\n return num.clone().iuor(this);\n };\n\n // And `num` with `this` in-place\n BN.prototype.iuand = function iuand (num) {\n // b = min-length(num, this)\n var b;\n if (this.length > num.length) {\n b = num;\n } else {\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = this.words[i] & num.words[i];\n }\n\n this.length = b.length;\n\n return this._strip();\n };\n\n BN.prototype.iand = function iand (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuand(num);\n };\n\n // And `num` with `this`\n BN.prototype.and = function and (num) {\n if (this.length > num.length) return this.clone().iand(num);\n return num.clone().iand(this);\n };\n\n BN.prototype.uand = function uand (num) {\n if (this.length > num.length) return this.clone().iuand(num);\n return num.clone().iuand(this);\n };\n\n // Xor `num` with `this` in-place\n BN.prototype.iuxor = function iuxor (num) {\n // a.length > b.length\n var a;\n var b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = a.words[i] ^ b.words[i];\n }\n\n if (this !== a) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = a.length;\n\n return this._strip();\n };\n\n BN.prototype.ixor = function ixor (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuxor(num);\n };\n\n // Xor `num` with `this`\n BN.prototype.xor = function xor (num) {\n if (this.length > num.length) return this.clone().ixor(num);\n return num.clone().ixor(this);\n };\n\n BN.prototype.uxor = function uxor (num) {\n if (this.length > num.length) return this.clone().iuxor(num);\n return num.clone().iuxor(this);\n };\n\n // Not ``this`` with ``width`` bitwidth\n BN.prototype.inotn = function inotn (width) {\n assert(typeof width === 'number' && width >= 0);\n\n var bytesNeeded = Math.ceil(width / 26) | 0;\n var bitsLeft = width % 26;\n\n // Extend the buffer with leading zeroes\n this._expand(bytesNeeded);\n\n if (bitsLeft > 0) {\n bytesNeeded--;\n }\n\n // Handle complete words\n for (var i = 0; i < bytesNeeded; i++) {\n this.words[i] = ~this.words[i] & 0x3ffffff;\n }\n\n // Handle the residue\n if (bitsLeft > 0) {\n this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n }\n\n // And remove leading zeroes\n return this._strip();\n };\n\n BN.prototype.notn = function notn (width) {\n return this.clone().inotn(width);\n };\n\n // Set `bit` of `this`\n BN.prototype.setn = function setn (bit, val) {\n assert(typeof bit === 'number' && bit >= 0);\n\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n this._expand(off + 1);\n\n if (val) {\n this.words[off] = this.words[off] | (1 << wbit);\n } else {\n this.words[off] = this.words[off] & ~(1 << wbit);\n }\n\n return this._strip();\n };\n\n // Add `num` to `this` in-place\n BN.prototype.iadd = function iadd (num) {\n var r;\n\n // negative + positive\n if (this.negative !== 0 && num.negative === 0) {\n this.negative = 0;\n r = this.isub(num);\n this.negative ^= 1;\n return this._normSign();\n\n // positive + negative\n } else if (this.negative === 0 && num.negative !== 0) {\n num.negative = 0;\n r = this.isub(num);\n num.negative = 1;\n return r._normSign();\n }\n\n // a.length > b.length\n var a, b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n\n this.length = a.length;\n if (carry !== 0) {\n this.words[this.length] = carry;\n this.length++;\n // Copy the rest of the words\n } else if (a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n return this;\n };\n\n // Add `num` to `this`\n BN.prototype.add = function add (num) {\n var res;\n if (num.negative !== 0 && this.negative === 0) {\n num.negative = 0;\n res = this.sub(num);\n num.negative ^= 1;\n return res;\n } else if (num.negative === 0 && this.negative !== 0) {\n this.negative = 0;\n res = num.sub(this);\n this.negative = 1;\n return res;\n }\n\n if (this.length > num.length) return this.clone().iadd(num);\n\n return num.clone().iadd(this);\n };\n\n // Subtract `num` from `this` in-place\n BN.prototype.isub = function isub (num) {\n // this - (-num) = this + num\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n num.negative = 1;\n return r._normSign();\n\n // -this - num = -(this + num)\n } else if (this.negative !== 0) {\n this.negative = 0;\n this.iadd(num);\n this.negative = 1;\n return this._normSign();\n }\n\n // At this point both numbers are positive\n var cmp = this.cmp(num);\n\n // Optimization - zeroify\n if (cmp === 0) {\n this.negative = 0;\n this.length = 1;\n this.words[0] = 0;\n return this;\n }\n\n // a > b\n var a, b;\n if (cmp > 0) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n\n // Copy rest of the words\n if (carry === 0 && i < a.length && a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = Math.max(this.length, i);\n\n if (a !== this) {\n this.negative = 1;\n }\n\n return this._strip();\n };\n\n // Subtract `num` from `this`\n BN.prototype.sub = function sub (num) {\n return this.clone().isub(num);\n };\n\n function smallMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n var len = (self.length + num.length) | 0;\n out.length = len;\n len = (len - 1) | 0;\n\n // Peel one iteration (compiler can't do it, because of code complexity)\n var a = self.words[0] | 0;\n var b = num.words[0] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n var carry = (r / 0x4000000) | 0;\n out.words[0] = lo;\n\n for (var k = 1; k < len; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = carry >>> 26;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = (k - j) | 0;\n a = self.words[i] | 0;\n b = num.words[j] | 0;\n r = a * b + rword;\n ncarry += (r / 0x4000000) | 0;\n rword = r & 0x3ffffff;\n }\n out.words[k] = rword | 0;\n carry = ncarry | 0;\n }\n if (carry !== 0) {\n out.words[k] = carry | 0;\n } else {\n out.length--;\n }\n\n return out._strip();\n }\n\n // TODO(indutny): it may be reasonable to omit it for users who don't need\n // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n // multiplication (like elliptic secp256k1).\n var comb10MulTo = function comb10MulTo (self, num, out) {\n var a = self.words;\n var b = num.words;\n var o = out.words;\n var c = 0;\n var lo;\n var mid;\n var hi;\n var a0 = a[0] | 0;\n var al0 = a0 & 0x1fff;\n var ah0 = a0 >>> 13;\n var a1 = a[1] | 0;\n var al1 = a1 & 0x1fff;\n var ah1 = a1 >>> 13;\n var a2 = a[2] | 0;\n var al2 = a2 & 0x1fff;\n var ah2 = a2 >>> 13;\n var a3 = a[3] | 0;\n var al3 = a3 & 0x1fff;\n var ah3 = a3 >>> 13;\n var a4 = a[4] | 0;\n var al4 = a4 & 0x1fff;\n var ah4 = a4 >>> 13;\n var a5 = a[5] | 0;\n var al5 = a5 & 0x1fff;\n var ah5 = a5 >>> 13;\n var a6 = a[6] | 0;\n var al6 = a6 & 0x1fff;\n var ah6 = a6 >>> 13;\n var a7 = a[7] | 0;\n var al7 = a7 & 0x1fff;\n var ah7 = a7 >>> 13;\n var a8 = a[8] | 0;\n var al8 = a8 & 0x1fff;\n var ah8 = a8 >>> 13;\n var a9 = a[9] | 0;\n var al9 = a9 & 0x1fff;\n var ah9 = a9 >>> 13;\n var b0 = b[0] | 0;\n var bl0 = b0 & 0x1fff;\n var bh0 = b0 >>> 13;\n var b1 = b[1] | 0;\n var bl1 = b1 & 0x1fff;\n var bh1 = b1 >>> 13;\n var b2 = b[2] | 0;\n var bl2 = b2 & 0x1fff;\n var bh2 = b2 >>> 13;\n var b3 = b[3] | 0;\n var bl3 = b3 & 0x1fff;\n var bh3 = b3 >>> 13;\n var b4 = b[4] | 0;\n var bl4 = b4 & 0x1fff;\n var bh4 = b4 >>> 13;\n var b5 = b[5] | 0;\n var bl5 = b5 & 0x1fff;\n var bh5 = b5 >>> 13;\n var b6 = b[6] | 0;\n var bl6 = b6 & 0x1fff;\n var bh6 = b6 >>> 13;\n var b7 = b[7] | 0;\n var bl7 = b7 & 0x1fff;\n var bh7 = b7 >>> 13;\n var b8 = b[8] | 0;\n var bl8 = b8 & 0x1fff;\n var bh8 = b8 >>> 13;\n var b9 = b[9] | 0;\n var bl9 = b9 & 0x1fff;\n var bh9 = b9 >>> 13;\n\n out.negative = self.negative ^ num.negative;\n out.length = 19;\n /* k = 0 */\n lo = Math.imul(al0, bl0);\n mid = Math.imul(al0, bh0);\n mid = (mid + Math.imul(ah0, bl0)) | 0;\n hi = Math.imul(ah0, bh0);\n var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n w0 &= 0x3ffffff;\n /* k = 1 */\n lo = Math.imul(al1, bl0);\n mid = Math.imul(al1, bh0);\n mid = (mid + Math.imul(ah1, bl0)) | 0;\n hi = Math.imul(ah1, bh0);\n lo = (lo + Math.imul(al0, bl1)) | 0;\n mid = (mid + Math.imul(al0, bh1)) | 0;\n mid = (mid + Math.imul(ah0, bl1)) | 0;\n hi = (hi + Math.imul(ah0, bh1)) | 0;\n var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n w1 &= 0x3ffffff;\n /* k = 2 */\n lo = Math.imul(al2, bl0);\n mid = Math.imul(al2, bh0);\n mid = (mid + Math.imul(ah2, bl0)) | 0;\n hi = Math.imul(ah2, bh0);\n lo = (lo + Math.imul(al1, bl1)) | 0;\n mid = (mid + Math.imul(al1, bh1)) | 0;\n mid = (mid + Math.imul(ah1, bl1)) | 0;\n hi = (hi + Math.imul(ah1, bh1)) | 0;\n lo = (lo + Math.imul(al0, bl2)) | 0;\n mid = (mid + Math.imul(al0, bh2)) | 0;\n mid = (mid + Math.imul(ah0, bl2)) | 0;\n hi = (hi + Math.imul(ah0, bh2)) | 0;\n var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n w2 &= 0x3ffffff;\n /* k = 3 */\n lo = Math.imul(al3, bl0);\n mid = Math.imul(al3, bh0);\n mid = (mid + Math.imul(ah3, bl0)) | 0;\n hi = Math.imul(ah3, bh0);\n lo = (lo + Math.imul(al2, bl1)) | 0;\n mid = (mid + Math.imul(al2, bh1)) | 0;\n mid = (mid + Math.imul(ah2, bl1)) | 0;\n hi = (hi + Math.imul(ah2, bh1)) | 0;\n lo = (lo + Math.imul(al1, bl2)) | 0;\n mid = (mid + Math.imul(al1, bh2)) | 0;\n mid = (mid + Math.imul(ah1, bl2)) | 0;\n hi = (hi + Math.imul(ah1, bh2)) | 0;\n lo = (lo + Math.imul(al0, bl3)) | 0;\n mid = (mid + Math.imul(al0, bh3)) | 0;\n mid = (mid + Math.imul(ah0, bl3)) | 0;\n hi = (hi + Math.imul(ah0, bh3)) | 0;\n var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n w3 &= 0x3ffffff;\n /* k = 4 */\n lo = Math.imul(al4, bl0);\n mid = Math.imul(al4, bh0);\n mid = (mid + Math.imul(ah4, bl0)) | 0;\n hi = Math.imul(ah4, bh0);\n lo = (lo + Math.imul(al3, bl1)) | 0;\n mid = (mid + Math.imul(al3, bh1)) | 0;\n mid = (mid + Math.imul(ah3, bl1)) | 0;\n hi = (hi + Math.imul(ah3, bh1)) | 0;\n lo = (lo + Math.imul(al2, bl2)) | 0;\n mid = (mid + Math.imul(al2, bh2)) | 0;\n mid = (mid + Math.imul(ah2, bl2)) | 0;\n hi = (hi + Math.imul(ah2, bh2)) | 0;\n lo = (lo + Math.imul(al1, bl3)) | 0;\n mid = (mid + Math.imul(al1, bh3)) | 0;\n mid = (mid + Math.imul(ah1, bl3)) | 0;\n hi = (hi + Math.imul(ah1, bh3)) | 0;\n lo = (lo + Math.imul(al0, bl4)) | 0;\n mid = (mid + Math.imul(al0, bh4)) | 0;\n mid = (mid + Math.imul(ah0, bl4)) | 0;\n hi = (hi + Math.imul(ah0, bh4)) | 0;\n var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n w4 &= 0x3ffffff;\n /* k = 5 */\n lo = Math.imul(al5, bl0);\n mid = Math.imul(al5, bh0);\n mid = (mid + Math.imul(ah5, bl0)) | 0;\n hi = Math.imul(ah5, bh0);\n lo = (lo + Math.imul(al4, bl1)) | 0;\n mid = (mid + Math.imul(al4, bh1)) | 0;\n mid = (mid + Math.imul(ah4, bl1)) | 0;\n hi = (hi + Math.imul(ah4, bh1)) | 0;\n lo = (lo + Math.imul(al3, bl2)) | 0;\n mid = (mid + Math.imul(al3, bh2)) | 0;\n mid = (mid + Math.imul(ah3, bl2)) | 0;\n hi = (hi + Math.imul(ah3, bh2)) | 0;\n lo = (lo + Math.imul(al2, bl3)) | 0;\n mid = (mid + Math.imul(al2, bh3)) | 0;\n mid = (mid + Math.imul(ah2, bl3)) | 0;\n hi = (hi + Math.imul(ah2, bh3)) | 0;\n lo = (lo + Math.imul(al1, bl4)) | 0;\n mid = (mid + Math.imul(al1, bh4)) | 0;\n mid = (mid + Math.imul(ah1, bl4)) | 0;\n hi = (hi + Math.imul(ah1, bh4)) | 0;\n lo = (lo + Math.imul(al0, bl5)) | 0;\n mid = (mid + Math.imul(al0, bh5)) | 0;\n mid = (mid + Math.imul(ah0, bl5)) | 0;\n hi = (hi + Math.imul(ah0, bh5)) | 0;\n var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n w5 &= 0x3ffffff;\n /* k = 6 */\n lo = Math.imul(al6, bl0);\n mid = Math.imul(al6, bh0);\n mid = (mid + Math.imul(ah6, bl0)) | 0;\n hi = Math.imul(ah6, bh0);\n lo = (lo + Math.imul(al5, bl1)) | 0;\n mid = (mid + Math.imul(al5, bh1)) | 0;\n mid = (mid + Math.imul(ah5, bl1)) | 0;\n hi = (hi + Math.imul(ah5, bh1)) | 0;\n lo = (lo + Math.imul(al4, bl2)) | 0;\n mid = (mid + Math.imul(al4, bh2)) | 0;\n mid = (mid + Math.imul(ah4, bl2)) | 0;\n hi = (hi + Math.imul(ah4, bh2)) | 0;\n lo = (lo + Math.imul(al3, bl3)) | 0;\n mid = (mid + Math.imul(al3, bh3)) | 0;\n mid = (mid + Math.imul(ah3, bl3)) | 0;\n hi = (hi + Math.imul(ah3, bh3)) | 0;\n lo = (lo + Math.imul(al2, bl4)) | 0;\n mid = (mid + Math.imul(al2, bh4)) | 0;\n mid = (mid + Math.imul(ah2, bl4)) | 0;\n hi = (hi + Math.imul(ah2, bh4)) | 0;\n lo = (lo + Math.imul(al1, bl5)) | 0;\n mid = (mid + Math.imul(al1, bh5)) | 0;\n mid = (mid + Math.imul(ah1, bl5)) | 0;\n hi = (hi + Math.imul(ah1, bh5)) | 0;\n lo = (lo + Math.imul(al0, bl6)) | 0;\n mid = (mid + Math.imul(al0, bh6)) | 0;\n mid = (mid + Math.imul(ah0, bl6)) | 0;\n hi = (hi + Math.imul(ah0, bh6)) | 0;\n var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n w6 &= 0x3ffffff;\n /* k = 7 */\n lo = Math.imul(al7, bl0);\n mid = Math.imul(al7, bh0);\n mid = (mid + Math.imul(ah7, bl0)) | 0;\n hi = Math.imul(ah7, bh0);\n lo = (lo + Math.imul(al6, bl1)) | 0;\n mid = (mid + Math.imul(al6, bh1)) | 0;\n mid = (mid + Math.imul(ah6, bl1)) | 0;\n hi = (hi + Math.imul(ah6, bh1)) | 0;\n lo = (lo + Math.imul(al5, bl2)) | 0;\n mid = (mid + Math.imul(al5, bh2)) | 0;\n mid = (mid + Math.imul(ah5, bl2)) | 0;\n hi = (hi + Math.imul(ah5, bh2)) | 0;\n lo = (lo + Math.imul(al4, bl3)) | 0;\n mid = (mid + Math.imul(al4, bh3)) | 0;\n mid = (mid + Math.imul(ah4, bl3)) | 0;\n hi = (hi + Math.imul(ah4, bh3)) | 0;\n lo = (lo + Math.imul(al3, bl4)) | 0;\n mid = (mid + Math.imul(al3, bh4)) | 0;\n mid = (mid + Math.imul(ah3, bl4)) | 0;\n hi = (hi + Math.imul(ah3, bh4)) | 0;\n lo = (lo + Math.imul(al2, bl5)) | 0;\n mid = (mid + Math.imul(al2, bh5)) | 0;\n mid = (mid + Math.imul(ah2, bl5)) | 0;\n hi = (hi + Math.imul(ah2, bh5)) | 0;\n lo = (lo + Math.imul(al1, bl6)) | 0;\n mid = (mid + Math.imul(al1, bh6)) | 0;\n mid = (mid + Math.imul(ah1, bl6)) | 0;\n hi = (hi + Math.imul(ah1, bh6)) | 0;\n lo = (lo + Math.imul(al0, bl7)) | 0;\n mid = (mid + Math.imul(al0, bh7)) | 0;\n mid = (mid + Math.imul(ah0, bl7)) | 0;\n hi = (hi + Math.imul(ah0, bh7)) | 0;\n var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n w7 &= 0x3ffffff;\n /* k = 8 */\n lo = Math.imul(al8, bl0);\n mid = Math.imul(al8, bh0);\n mid = (mid + Math.imul(ah8, bl0)) | 0;\n hi = Math.imul(ah8, bh0);\n lo = (lo + Math.imul(al7, bl1)) | 0;\n mid = (mid + Math.imul(al7, bh1)) | 0;\n mid = (mid + Math.imul(ah7, bl1)) | 0;\n hi = (hi + Math.imul(ah7, bh1)) | 0;\n lo = (lo + Math.imul(al6, bl2)) | 0;\n mid = (mid + Math.imul(al6, bh2)) | 0;\n mid = (mid + Math.imul(ah6, bl2)) | 0;\n hi = (hi + Math.imul(ah6, bh2)) | 0;\n lo = (lo + Math.imul(al5, bl3)) | 0;\n mid = (mid + Math.imul(al5, bh3)) | 0;\n mid = (mid + Math.imul(ah5, bl3)) | 0;\n hi = (hi + Math.imul(ah5, bh3)) | 0;\n lo = (lo + Math.imul(al4, bl4)) | 0;\n mid = (mid + Math.imul(al4, bh4)) | 0;\n mid = (mid + Math.imul(ah4, bl4)) | 0;\n hi = (hi + Math.imul(ah4, bh4)) | 0;\n lo = (lo + Math.imul(al3, bl5)) | 0;\n mid = (mid + Math.imul(al3, bh5)) | 0;\n mid = (mid + Math.imul(ah3, bl5)) | 0;\n hi = (hi + Math.imul(ah3, bh5)) | 0;\n lo = (lo + Math.imul(al2, bl6)) | 0;\n mid = (mid + Math.imul(al2, bh6)) | 0;\n mid = (mid + Math.imul(ah2, bl6)) | 0;\n hi = (hi + Math.imul(ah2, bh6)) | 0;\n lo = (lo + Math.imul(al1, bl7)) | 0;\n mid = (mid + Math.imul(al1, bh7)) | 0;\n mid = (mid + Math.imul(ah1, bl7)) | 0;\n hi = (hi + Math.imul(ah1, bh7)) | 0;\n lo = (lo + Math.imul(al0, bl8)) | 0;\n mid = (mid + Math.imul(al0, bh8)) | 0;\n mid = (mid + Math.imul(ah0, bl8)) | 0;\n hi = (hi + Math.imul(ah0, bh8)) | 0;\n var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n w8 &= 0x3ffffff;\n /* k = 9 */\n lo = Math.imul(al9, bl0);\n mid = Math.imul(al9, bh0);\n mid = (mid + Math.imul(ah9, bl0)) | 0;\n hi = Math.imul(ah9, bh0);\n lo = (lo + Math.imul(al8, bl1)) | 0;\n mid = (mid + Math.imul(al8, bh1)) | 0;\n mid = (mid + Math.imul(ah8, bl1)) | 0;\n hi = (hi + Math.imul(ah8, bh1)) | 0;\n lo = (lo + Math.imul(al7, bl2)) | 0;\n mid = (mid + Math.imul(al7, bh2)) | 0;\n mid = (mid + Math.imul(ah7, bl2)) | 0;\n hi = (hi + Math.imul(ah7, bh2)) | 0;\n lo = (lo + Math.imul(al6, bl3)) | 0;\n mid = (mid + Math.imul(al6, bh3)) | 0;\n mid = (mid + Math.imul(ah6, bl3)) | 0;\n hi = (hi + Math.imul(ah6, bh3)) | 0;\n lo = (lo + Math.imul(al5, bl4)) | 0;\n mid = (mid + Math.imul(al5, bh4)) | 0;\n mid = (mid + Math.imul(ah5, bl4)) | 0;\n hi = (hi + Math.imul(ah5, bh4)) | 0;\n lo = (lo + Math.imul(al4, bl5)) | 0;\n mid = (mid + Math.imul(al4, bh5)) | 0;\n mid = (mid + Math.imul(ah4, bl5)) | 0;\n hi = (hi + Math.imul(ah4, bh5)) | 0;\n lo = (lo + Math.imul(al3, bl6)) | 0;\n mid = (mid + Math.imul(al3, bh6)) | 0;\n mid = (mid + Math.imul(ah3, bl6)) | 0;\n hi = (hi + Math.imul(ah3, bh6)) | 0;\n lo = (lo + Math.imul(al2, bl7)) | 0;\n mid = (mid + Math.imul(al2, bh7)) | 0;\n mid = (mid + Math.imul(ah2, bl7)) | 0;\n hi = (hi + Math.imul(ah2, bh7)) | 0;\n lo = (lo + Math.imul(al1, bl8)) | 0;\n mid = (mid + Math.imul(al1, bh8)) | 0;\n mid = (mid + Math.imul(ah1, bl8)) | 0;\n hi = (hi + Math.imul(ah1, bh8)) | 0;\n lo = (lo + Math.imul(al0, bl9)) | 0;\n mid = (mid + Math.imul(al0, bh9)) | 0;\n mid = (mid + Math.imul(ah0, bl9)) | 0;\n hi = (hi + Math.imul(ah0, bh9)) | 0;\n var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n w9 &= 0x3ffffff;\n /* k = 10 */\n lo = Math.imul(al9, bl1);\n mid = Math.imul(al9, bh1);\n mid = (mid + Math.imul(ah9, bl1)) | 0;\n hi = Math.imul(ah9, bh1);\n lo = (lo + Math.imul(al8, bl2)) | 0;\n mid = (mid + Math.imul(al8, bh2)) | 0;\n mid = (mid + Math.imul(ah8, bl2)) | 0;\n hi = (hi + Math.imul(ah8, bh2)) | 0;\n lo = (lo + Math.imul(al7, bl3)) | 0;\n mid = (mid + Math.imul(al7, bh3)) | 0;\n mid = (mid + Math.imul(ah7, bl3)) | 0;\n hi = (hi + Math.imul(ah7, bh3)) | 0;\n lo = (lo + Math.imul(al6, bl4)) | 0;\n mid = (mid + Math.imul(al6, bh4)) | 0;\n mid = (mid + Math.imul(ah6, bl4)) | 0;\n hi = (hi + Math.imul(ah6, bh4)) | 0;\n lo = (lo + Math.imul(al5, bl5)) | 0;\n mid = (mid + Math.imul(al5, bh5)) | 0;\n mid = (mid + Math.imul(ah5, bl5)) | 0;\n hi = (hi + Math.imul(ah5, bh5)) | 0;\n lo = (lo + Math.imul(al4, bl6)) | 0;\n mid = (mid + Math.imul(al4, bh6)) | 0;\n mid = (mid + Math.imul(ah4, bl6)) | 0;\n hi = (hi + Math.imul(ah4, bh6)) | 0;\n lo = (lo + Math.imul(al3, bl7)) | 0;\n mid = (mid + Math.imul(al3, bh7)) | 0;\n mid = (mid + Math.imul(ah3, bl7)) | 0;\n hi = (hi + Math.imul(ah3, bh7)) | 0;\n lo = (lo + Math.imul(al2, bl8)) | 0;\n mid = (mid + Math.imul(al2, bh8)) | 0;\n mid = (mid + Math.imul(ah2, bl8)) | 0;\n hi = (hi + Math.imul(ah2, bh8)) | 0;\n lo = (lo + Math.imul(al1, bl9)) | 0;\n mid = (mid + Math.imul(al1, bh9)) | 0;\n mid = (mid + Math.imul(ah1, bl9)) | 0;\n hi = (hi + Math.imul(ah1, bh9)) | 0;\n var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n w10 &= 0x3ffffff;\n /* k = 11 */\n lo = Math.imul(al9, bl2);\n mid = Math.imul(al9, bh2);\n mid = (mid + Math.imul(ah9, bl2)) | 0;\n hi = Math.imul(ah9, bh2);\n lo = (lo + Math.imul(al8, bl3)) | 0;\n mid = (mid + Math.imul(al8, bh3)) | 0;\n mid = (mid + Math.imul(ah8, bl3)) | 0;\n hi = (hi + Math.imul(ah8, bh3)) | 0;\n lo = (lo + Math.imul(al7, bl4)) | 0;\n mid = (mid + Math.imul(al7, bh4)) | 0;\n mid = (mid + Math.imul(ah7, bl4)) | 0;\n hi = (hi + Math.imul(ah7, bh4)) | 0;\n lo = (lo + Math.imul(al6, bl5)) | 0;\n mid = (mid + Math.imul(al6, bh5)) | 0;\n mid = (mid + Math.imul(ah6, bl5)) | 0;\n hi = (hi + Math.imul(ah6, bh5)) | 0;\n lo = (lo + Math.imul(al5, bl6)) | 0;\n mid = (mid + Math.imul(al5, bh6)) | 0;\n mid = (mid + Math.imul(ah5, bl6)) | 0;\n hi = (hi + Math.imul(ah5, bh6)) | 0;\n lo = (lo + Math.imul(al4, bl7)) | 0;\n mid = (mid + Math.imul(al4, bh7)) | 0;\n mid = (mid + Math.imul(ah4, bl7)) | 0;\n hi = (hi + Math.imul(ah4, bh7)) | 0;\n lo = (lo + Math.imul(al3, bl8)) | 0;\n mid = (mid + Math.imul(al3, bh8)) | 0;\n mid = (mid + Math.imul(ah3, bl8)) | 0;\n hi = (hi + Math.imul(ah3, bh8)) | 0;\n lo = (lo + Math.imul(al2, bl9)) | 0;\n mid = (mid + Math.imul(al2, bh9)) | 0;\n mid = (mid + Math.imul(ah2, bl9)) | 0;\n hi = (hi + Math.imul(ah2, bh9)) | 0;\n var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n w11 &= 0x3ffffff;\n /* k = 12 */\n lo = Math.imul(al9, bl3);\n mid = Math.imul(al9, bh3);\n mid = (mid + Math.imul(ah9, bl3)) | 0;\n hi = Math.imul(ah9, bh3);\n lo = (lo + Math.imul(al8, bl4)) | 0;\n mid = (mid + Math.imul(al8, bh4)) | 0;\n mid = (mid + Math.imul(ah8, bl4)) | 0;\n hi = (hi + Math.imul(ah8, bh4)) | 0;\n lo = (lo + Math.imul(al7, bl5)) | 0;\n mid = (mid + Math.imul(al7, bh5)) | 0;\n mid = (mid + Math.imul(ah7, bl5)) | 0;\n hi = (hi + Math.imul(ah7, bh5)) | 0;\n lo = (lo + Math.imul(al6, bl6)) | 0;\n mid = (mid + Math.imul(al6, bh6)) | 0;\n mid = (mid + Math.imul(ah6, bl6)) | 0;\n hi = (hi + Math.imul(ah6, bh6)) | 0;\n lo = (lo + Math.imul(al5, bl7)) | 0;\n mid = (mid + Math.imul(al5, bh7)) | 0;\n mid = (mid + Math.imul(ah5, bl7)) | 0;\n hi = (hi + Math.imul(ah5, bh7)) | 0;\n lo = (lo + Math.imul(al4, bl8)) | 0;\n mid = (mid + Math.imul(al4, bh8)) | 0;\n mid = (mid + Math.imul(ah4, bl8)) | 0;\n hi = (hi + Math.imul(ah4, bh8)) | 0;\n lo = (lo + Math.imul(al3, bl9)) | 0;\n mid = (mid + Math.imul(al3, bh9)) | 0;\n mid = (mid + Math.imul(ah3, bl9)) | 0;\n hi = (hi + Math.imul(ah3, bh9)) | 0;\n var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n w12 &= 0x3ffffff;\n /* k = 13 */\n lo = Math.imul(al9, bl4);\n mid = Math.imul(al9, bh4);\n mid = (mid + Math.imul(ah9, bl4)) | 0;\n hi = Math.imul(ah9, bh4);\n lo = (lo + Math.imul(al8, bl5)) | 0;\n mid = (mid + Math.imul(al8, bh5)) | 0;\n mid = (mid + Math.imul(ah8, bl5)) | 0;\n hi = (hi + Math.imul(ah8, bh5)) | 0;\n lo = (lo + Math.imul(al7, bl6)) | 0;\n mid = (mid + Math.imul(al7, bh6)) | 0;\n mid = (mid + Math.imul(ah7, bl6)) | 0;\n hi = (hi + Math.imul(ah7, bh6)) | 0;\n lo = (lo + Math.imul(al6, bl7)) | 0;\n mid = (mid + Math.imul(al6, bh7)) | 0;\n mid = (mid + Math.imul(ah6, bl7)) | 0;\n hi = (hi + Math.imul(ah6, bh7)) | 0;\n lo = (lo + Math.imul(al5, bl8)) | 0;\n mid = (mid + Math.imul(al5, bh8)) | 0;\n mid = (mid + Math.imul(ah5, bl8)) | 0;\n hi = (hi + Math.imul(ah5, bh8)) | 0;\n lo = (lo + Math.imul(al4, bl9)) | 0;\n mid = (mid + Math.imul(al4, bh9)) | 0;\n mid = (mid + Math.imul(ah4, bl9)) | 0;\n hi = (hi + Math.imul(ah4, bh9)) | 0;\n var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n w13 &= 0x3ffffff;\n /* k = 14 */\n lo = Math.imul(al9, bl5);\n mid = Math.imul(al9, bh5);\n mid = (mid + Math.imul(ah9, bl5)) | 0;\n hi = Math.imul(ah9, bh5);\n lo = (lo + Math.imul(al8, bl6)) | 0;\n mid = (mid + Math.imul(al8, bh6)) | 0;\n mid = (mid + Math.imul(ah8, bl6)) | 0;\n hi = (hi + Math.imul(ah8, bh6)) | 0;\n lo = (lo + Math.imul(al7, bl7)) | 0;\n mid = (mid + Math.imul(al7, bh7)) | 0;\n mid = (mid + Math.imul(ah7, bl7)) | 0;\n hi = (hi + Math.imul(ah7, bh7)) | 0;\n lo = (lo + Math.imul(al6, bl8)) | 0;\n mid = (mid + Math.imul(al6, bh8)) | 0;\n mid = (mid + Math.imul(ah6, bl8)) | 0;\n hi = (hi + Math.imul(ah6, bh8)) | 0;\n lo = (lo + Math.imul(al5, bl9)) | 0;\n mid = (mid + Math.imul(al5, bh9)) | 0;\n mid = (mid + Math.imul(ah5, bl9)) | 0;\n hi = (hi + Math.imul(ah5, bh9)) | 0;\n var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n w14 &= 0x3ffffff;\n /* k = 15 */\n lo = Math.imul(al9, bl6);\n mid = Math.imul(al9, bh6);\n mid = (mid + Math.imul(ah9, bl6)) | 0;\n hi = Math.imul(ah9, bh6);\n lo = (lo + Math.imul(al8, bl7)) | 0;\n mid = (mid + Math.imul(al8, bh7)) | 0;\n mid = (mid + Math.imul(ah8, bl7)) | 0;\n hi = (hi + Math.imul(ah8, bh7)) | 0;\n lo = (lo + Math.imul(al7, bl8)) | 0;\n mid = (mid + Math.imul(al7, bh8)) | 0;\n mid = (mid + Math.imul(ah7, bl8)) | 0;\n hi = (hi + Math.imul(ah7, bh8)) | 0;\n lo = (lo + Math.imul(al6, bl9)) | 0;\n mid = (mid + Math.imul(al6, bh9)) | 0;\n mid = (mid + Math.imul(ah6, bl9)) | 0;\n hi = (hi + Math.imul(ah6, bh9)) | 0;\n var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n w15 &= 0x3ffffff;\n /* k = 16 */\n lo = Math.imul(al9, bl7);\n mid = Math.imul(al9, bh7);\n mid = (mid + Math.imul(ah9, bl7)) | 0;\n hi = Math.imul(ah9, bh7);\n lo = (lo + Math.imul(al8, bl8)) | 0;\n mid = (mid + Math.imul(al8, bh8)) | 0;\n mid = (mid + Math.imul(ah8, bl8)) | 0;\n hi = (hi + Math.imul(ah8, bh8)) | 0;\n lo = (lo + Math.imul(al7, bl9)) | 0;\n mid = (mid + Math.imul(al7, bh9)) | 0;\n mid = (mid + Math.imul(ah7, bl9)) | 0;\n hi = (hi + Math.imul(ah7, bh9)) | 0;\n var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n w16 &= 0x3ffffff;\n /* k = 17 */\n lo = Math.imul(al9, bl8);\n mid = Math.imul(al9, bh8);\n mid = (mid + Math.imul(ah9, bl8)) | 0;\n hi = Math.imul(ah9, bh8);\n lo = (lo + Math.imul(al8, bl9)) | 0;\n mid = (mid + Math.imul(al8, bh9)) | 0;\n mid = (mid + Math.imul(ah8, bl9)) | 0;\n hi = (hi + Math.imul(ah8, bh9)) | 0;\n var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n w17 &= 0x3ffffff;\n /* k = 18 */\n lo = Math.imul(al9, bl9);\n mid = Math.imul(al9, bh9);\n mid = (mid + Math.imul(ah9, bl9)) | 0;\n hi = Math.imul(ah9, bh9);\n var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n w18 &= 0x3ffffff;\n o[0] = w0;\n o[1] = w1;\n o[2] = w2;\n o[3] = w3;\n o[4] = w4;\n o[5] = w5;\n o[6] = w6;\n o[7] = w7;\n o[8] = w8;\n o[9] = w9;\n o[10] = w10;\n o[11] = w11;\n o[12] = w12;\n o[13] = w13;\n o[14] = w14;\n o[15] = w15;\n o[16] = w16;\n o[17] = w17;\n o[18] = w18;\n if (c !== 0) {\n o[19] = c;\n out.length++;\n }\n return out;\n };\n\n // Polyfill comb\n if (!Math.imul) {\n comb10MulTo = smallMulTo;\n }\n\n function bigMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n out.length = self.length + num.length;\n\n var carry = 0;\n var hncarry = 0;\n for (var k = 0; k < out.length - 1; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = hncarry;\n hncarry = 0;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = k - j;\n var a = self.words[i] | 0;\n var b = num.words[j] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n lo = (lo + rword) | 0;\n rword = lo & 0x3ffffff;\n ncarry = (ncarry + (lo >>> 26)) | 0;\n\n hncarry += ncarry >>> 26;\n ncarry &= 0x3ffffff;\n }\n out.words[k] = rword;\n carry = ncarry;\n ncarry = hncarry;\n }\n if (carry !== 0) {\n out.words[k] = carry;\n } else {\n out.length--;\n }\n\n return out._strip();\n }\n\n function jumboMulTo (self, num, out) {\n // Temporary disable, see https://github.com/indutny/bn.js/issues/211\n // var fftm = new FFTM();\n // return fftm.mulp(self, num, out);\n return bigMulTo(self, num, out);\n }\n\n BN.prototype.mulTo = function mulTo (num, out) {\n var res;\n var len = this.length + num.length;\n if (this.length === 10 && num.length === 10) {\n res = comb10MulTo(this, num, out);\n } else if (len < 63) {\n res = smallMulTo(this, num, out);\n } else if (len < 1024) {\n res = bigMulTo(this, num, out);\n } else {\n res = jumboMulTo(this, num, out);\n }\n\n return res;\n };\n\n // Cooley-Tukey algorithm for FFT\n // slightly revisited to rely on looping instead of recursion\n\n function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }\n\n FFTM.prototype.makeRBT = function makeRBT (N) {\n var t = new Array(N);\n var l = BN.prototype._countBits(N) - 1;\n for (var i = 0; i < N; i++) {\n t[i] = this.revBin(i, l, N);\n }\n\n return t;\n };\n\n // Returns binary-reversed representation of `x`\n FFTM.prototype.revBin = function revBin (x, l, N) {\n if (x === 0 || x === N - 1) return x;\n\n var rb = 0;\n for (var i = 0; i < l; i++) {\n rb |= (x & 1) << (l - i - 1);\n x >>= 1;\n }\n\n return rb;\n };\n\n // Performs \"tweedling\" phase, therefore 'emulating'\n // behaviour of the recursive algorithm\n FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n for (var i = 0; i < N; i++) {\n rtws[i] = rws[rbt[i]];\n itws[i] = iws[rbt[i]];\n }\n };\n\n FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n\n for (var s = 1; s < N; s <<= 1) {\n var l = s << 1;\n\n var rtwdf = Math.cos(2 * Math.PI / l);\n var itwdf = Math.sin(2 * Math.PI / l);\n\n for (var p = 0; p < N; p += l) {\n var rtwdf_ = rtwdf;\n var itwdf_ = itwdf;\n\n for (var j = 0; j < s; j++) {\n var re = rtws[p + j];\n var ie = itws[p + j];\n\n var ro = rtws[p + j + s];\n var io = itws[p + j + s];\n\n var rx = rtwdf_ * ro - itwdf_ * io;\n\n io = rtwdf_ * io + itwdf_ * ro;\n ro = rx;\n\n rtws[p + j] = re + ro;\n itws[p + j] = ie + io;\n\n rtws[p + j + s] = re - ro;\n itws[p + j + s] = ie - io;\n\n /* jshint maxdepth : false */\n if (j !== l) {\n rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n rtwdf_ = rx;\n }\n }\n }\n }\n };\n\n FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n var N = Math.max(m, n) | 1;\n var odd = N & 1;\n var i = 0;\n for (N = N / 2 | 0; N; N = N >>> 1) {\n i++;\n }\n\n return 1 << i + 1 + odd;\n };\n\n FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n if (N <= 1) return;\n\n for (var i = 0; i < N / 2; i++) {\n var t = rws[i];\n\n rws[i] = rws[N - i - 1];\n rws[N - i - 1] = t;\n\n t = iws[i];\n\n iws[i] = -iws[N - i - 1];\n iws[N - i - 1] = -t;\n }\n };\n\n FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n var carry = 0;\n for (var i = 0; i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n Math.round(ws[2 * i] / N) +\n carry;\n\n ws[i] = w & 0x3ffffff;\n\n if (w < 0x4000000) {\n carry = 0;\n } else {\n carry = w / 0x4000000 | 0;\n }\n }\n\n return ws;\n };\n\n FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n var carry = 0;\n for (var i = 0; i < len; i++) {\n carry = carry + (ws[i] | 0);\n\n rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n }\n\n // Pad with zeroes\n for (i = 2 * len; i < N; ++i) {\n rws[i] = 0;\n }\n\n assert(carry === 0);\n assert((carry & ~0x1fff) === 0);\n };\n\n FFTM.prototype.stub = function stub (N) {\n var ph = new Array(N);\n for (var i = 0; i < N; i++) {\n ph[i] = 0;\n }\n\n return ph;\n };\n\n FFTM.prototype.mulp = function mulp (x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length);\n\n var rbt = this.makeRBT(N);\n\n var _ = this.stub(N);\n\n var rws = new Array(N);\n var rwst = new Array(N);\n var iwst = new Array(N);\n\n var nrws = new Array(N);\n var nrwst = new Array(N);\n var niwst = new Array(N);\n\n var rmws = out.words;\n rmws.length = N;\n\n this.convert13b(x.words, x.length, rws, N);\n this.convert13b(y.words, y.length, nrws, N);\n\n this.transform(rws, _, rwst, iwst, N, rbt);\n this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n for (var i = 0; i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n rwst[i] = rx;\n }\n\n this.conjugate(rwst, iwst, N);\n this.transform(rwst, iwst, rmws, _, N, rbt);\n this.conjugate(rmws, _, N);\n this.normalize13b(rmws, N);\n\n out.negative = x.negative ^ y.negative;\n out.length = x.length + y.length;\n return out._strip();\n };\n\n // Multiply `this` by `num`\n BN.prototype.mul = function mul (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return this.mulTo(num, out);\n };\n\n // Multiply employing FFT\n BN.prototype.mulf = function mulf (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return jumboMulTo(this, num, out);\n };\n\n // In-place Multiplication\n BN.prototype.imul = function imul (num) {\n return this.clone().mulTo(num, this);\n };\n\n BN.prototype.imuln = function imuln (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n\n // Carry\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = (this.words[i] | 0) * num;\n var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n carry >>= 26;\n carry += (w / 0x4000000) | 0;\n // NOTE: lo is 27bit maximum\n carry += lo >>> 26;\n this.words[i] = lo & 0x3ffffff;\n }\n\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n\n return isNegNum ? this.ineg() : this;\n };\n\n BN.prototype.muln = function muln (num) {\n return this.clone().imuln(num);\n };\n\n // `this` * `this`\n BN.prototype.sqr = function sqr () {\n return this.mul(this);\n };\n\n // `this` * `this` in-place\n BN.prototype.isqr = function isqr () {\n return this.imul(this.clone());\n };\n\n // Math.pow(`this`, `num`)\n BN.prototype.pow = function pow (num) {\n var w = toBitArray(num);\n if (w.length === 0) return new BN(1);\n\n // Skip leading zeroes\n var res = this;\n for (var i = 0; i < w.length; i++, res = res.sqr()) {\n if (w[i] !== 0) break;\n }\n\n if (++i < w.length) {\n for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n if (w[i] === 0) continue;\n\n res = res.mul(q);\n }\n }\n\n return res;\n };\n\n // Shift-left in-place\n BN.prototype.iushln = function iushln (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n var i;\n\n if (r !== 0) {\n var carry = 0;\n\n for (i = 0; i < this.length; i++) {\n var newCarry = this.words[i] & carryMask;\n var c = ((this.words[i] | 0) - newCarry) << r;\n this.words[i] = c | carry;\n carry = newCarry >>> (26 - r);\n }\n\n if (carry) {\n this.words[i] = carry;\n this.length++;\n }\n }\n\n if (s !== 0) {\n for (i = this.length - 1; i >= 0; i--) {\n this.words[i + s] = this.words[i];\n }\n\n for (i = 0; i < s; i++) {\n this.words[i] = 0;\n }\n\n this.length += s;\n }\n\n return this._strip();\n };\n\n BN.prototype.ishln = function ishln (bits) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushln(bits);\n };\n\n // Shift-right in-place\n // NOTE: `hint` is a lowest bit before trailing zeroes\n // NOTE: if `extended` is present - it will be filled with destroyed bits\n BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n assert(typeof bits === 'number' && bits >= 0);\n var h;\n if (hint) {\n h = (hint - (hint % 26)) / 26;\n } else {\n h = 0;\n }\n\n var r = bits % 26;\n var s = Math.min((bits - r) / 26, this.length);\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n var maskedWords = extended;\n\n h -= s;\n h = Math.max(0, h);\n\n // Extended mode, copy masked part\n if (maskedWords) {\n for (var i = 0; i < s; i++) {\n maskedWords.words[i] = this.words[i];\n }\n maskedWords.length = s;\n }\n\n if (s === 0) {\n // No-op, we should not move anything at all\n } else if (this.length > s) {\n this.length -= s;\n for (i = 0; i < this.length; i++) {\n this.words[i] = this.words[i + s];\n }\n } else {\n this.words[0] = 0;\n this.length = 1;\n }\n\n var carry = 0;\n for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = (carry << (26 - r)) | (word >>> r);\n carry = word & mask;\n }\n\n // Push carried bits as a mask\n if (maskedWords && carry !== 0) {\n maskedWords.words[maskedWords.length++] = carry;\n }\n\n if (this.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n }\n\n return this._strip();\n };\n\n BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushrn(bits, hint, extended);\n };\n\n // Shift-left\n BN.prototype.shln = function shln (bits) {\n return this.clone().ishln(bits);\n };\n\n BN.prototype.ushln = function ushln (bits) {\n return this.clone().iushln(bits);\n };\n\n // Shift-right\n BN.prototype.shrn = function shrn (bits) {\n return this.clone().ishrn(bits);\n };\n\n BN.prototype.ushrn = function ushrn (bits) {\n return this.clone().iushrn(bits);\n };\n\n // Test if n bit is set\n BN.prototype.testn = function testn (bit) {\n assert(typeof bit === 'number' && bit >= 0);\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) return false;\n\n // Check bit and return\n var w = this.words[s];\n\n return !!(w & q);\n };\n\n // Return only lowers bits of number (in-place)\n BN.prototype.imaskn = function imaskn (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n\n assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n if (this.length <= s) {\n return this;\n }\n\n if (r !== 0) {\n s++;\n }\n this.length = Math.min(s, this.length);\n\n if (r !== 0) {\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n this.words[this.length - 1] &= mask;\n }\n\n return this._strip();\n };\n\n // Return only lowers bits of number\n BN.prototype.maskn = function maskn (bits) {\n return this.clone().imaskn(bits);\n };\n\n // Add plain number `num` to `this`\n BN.prototype.iaddn = function iaddn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.isubn(-num);\n\n // Possible sign change\n if (this.negative !== 0) {\n if (this.length === 1 && (this.words[0] | 0) <= num) {\n this.words[0] = num - (this.words[0] | 0);\n this.negative = 0;\n return this;\n }\n\n this.negative = 0;\n this.isubn(num);\n this.negative = 1;\n return this;\n }\n\n // Add without checks\n return this._iaddn(num);\n };\n\n BN.prototype._iaddn = function _iaddn (num) {\n this.words[0] += num;\n\n // Carry\n for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n this.words[i] -= 0x4000000;\n if (i === this.length - 1) {\n this.words[i + 1] = 1;\n } else {\n this.words[i + 1]++;\n }\n }\n this.length = Math.max(this.length, i + 1);\n\n return this;\n };\n\n // Subtract plain number `num` from `this`\n BN.prototype.isubn = function isubn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.iaddn(-num);\n\n if (this.negative !== 0) {\n this.negative = 0;\n this.iaddn(num);\n this.negative = 1;\n return this;\n }\n\n this.words[0] -= num;\n\n if (this.length === 1 && this.words[0] < 0) {\n this.words[0] = -this.words[0];\n this.negative = 1;\n } else {\n // Carry\n for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n this.words[i] += 0x4000000;\n this.words[i + 1] -= 1;\n }\n }\n\n return this._strip();\n };\n\n BN.prototype.addn = function addn (num) {\n return this.clone().iaddn(num);\n };\n\n BN.prototype.subn = function subn (num) {\n return this.clone().isubn(num);\n };\n\n BN.prototype.iabs = function iabs () {\n this.negative = 0;\n\n return this;\n };\n\n BN.prototype.abs = function abs () {\n return this.clone().iabs();\n };\n\n BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n var len = num.length + shift;\n var i;\n\n this._expand(len);\n\n var w;\n var carry = 0;\n for (i = 0; i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 0x3ffffff;\n carry = (w >> 26) - ((right / 0x4000000) | 0);\n this.words[i + shift] = w & 0x3ffffff;\n }\n for (; i < this.length - shift; i++) {\n w = (this.words[i + shift] | 0) + carry;\n carry = w >> 26;\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n if (carry === 0) return this._strip();\n\n // Subtraction overflow\n assert(carry === -1);\n carry = 0;\n for (i = 0; i < this.length; i++) {\n w = -(this.words[i] | 0) + carry;\n carry = w >> 26;\n this.words[i] = w & 0x3ffffff;\n }\n this.negative = 1;\n\n return this._strip();\n };\n\n BN.prototype._wordDiv = function _wordDiv (num, mode) {\n var shift = this.length - num.length;\n\n var a = this.clone();\n var b = num;\n\n // Normalize\n var bhi = b.words[b.length - 1] | 0;\n var bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits;\n if (shift !== 0) {\n b = b.ushln(shift);\n a.iushln(shift);\n bhi = b.words[b.length - 1] | 0;\n }\n\n // Initialize quotient\n var m = a.length - b.length;\n var q;\n\n if (mode !== 'mod') {\n q = new BN(null);\n q.length = m + 1;\n q.words = new Array(q.length);\n for (var i = 0; i < q.length; i++) {\n q.words[i] = 0;\n }\n }\n\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n if (diff.negative === 0) {\n a = diff;\n if (q) {\n q.words[m] = 1;\n }\n }\n\n for (var j = m - 1; j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n (a.words[b.length + j - 1] | 0);\n\n // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n // (0x7ffffff)\n qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n a._ishlnsubmul(b, qj, j);\n while (a.negative !== 0) {\n qj--;\n a.negative = 0;\n a._ishlnsubmul(b, 1, j);\n if (!a.isZero()) {\n a.negative ^= 1;\n }\n }\n if (q) {\n q.words[j] = qj;\n }\n }\n if (q) {\n q._strip();\n }\n a._strip();\n\n // Denormalize\n if (mode !== 'div' && shift !== 0) {\n a.iushrn(shift);\n }\n\n return {\n div: q || null,\n mod: a\n };\n };\n\n // NOTE: 1) `mode` can be set to `mod` to request mod only,\n // to `div` to request div only, or be absent to\n // request both div & mod\n // 2) `positive` is true if unsigned mod is requested\n BN.prototype.divmod = function divmod (num, mode, positive) {\n assert(!num.isZero());\n\n if (this.isZero()) {\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n }\n\n var div, mod, res;\n if (this.negative !== 0 && num.negative === 0) {\n res = this.neg().divmod(num, mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.iadd(num);\n }\n }\n\n return {\n div: div,\n mod: mod\n };\n }\n\n if (this.negative === 0 && num.negative !== 0) {\n res = this.divmod(num.neg(), mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n return {\n div: div,\n mod: res.mod\n };\n }\n\n if ((this.negative & num.negative) !== 0) {\n res = this.neg().divmod(num.neg(), mode);\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.isub(num);\n }\n }\n\n return {\n div: res.div,\n mod: mod\n };\n }\n\n // Both numbers are positive at this point\n\n // Strip both numbers to approximate shift value\n if (num.length > this.length || this.cmp(num) < 0) {\n return {\n div: new BN(0),\n mod: this\n };\n }\n\n // Very short reduction\n if (num.length === 1) {\n if (mode === 'div') {\n return {\n div: this.divn(num.words[0]),\n mod: null\n };\n }\n\n if (mode === 'mod') {\n return {\n div: null,\n mod: new BN(this.modrn(num.words[0]))\n };\n }\n\n return {\n div: this.divn(num.words[0]),\n mod: new BN(this.modrn(num.words[0]))\n };\n }\n\n return this._wordDiv(num, mode);\n };\n\n // Find `this` / `num`\n BN.prototype.div = function div (num) {\n return this.divmod(num, 'div', false).div;\n };\n\n // Find `this` % `num`\n BN.prototype.mod = function mod (num) {\n return this.divmod(num, 'mod', false).mod;\n };\n\n BN.prototype.umod = function umod (num) {\n return this.divmod(num, 'mod', true).mod;\n };\n\n // Find Round(`this` / `num`)\n BN.prototype.divRound = function divRound (num) {\n var dm = this.divmod(num);\n\n // Fast case - exact division\n if (dm.mod.isZero()) return dm.div;\n\n var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\n\n var half = num.ushrn(1);\n var r2 = num.andln(1);\n var cmp = mod.cmp(half);\n\n // Round down\n if (cmp < 0 || (r2 === 1 && cmp === 0)) return dm.div;\n\n // Round up\n return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\n };\n\n BN.prototype.modrn = function modrn (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(num <= 0x3ffffff);\n var p = (1 << 26) % num;\n\n var acc = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n acc = (p * acc + (this.words[i] | 0)) % num;\n }\n\n return isNegNum ? -acc : acc;\n };\n\n // WARNING: DEPRECATED\n BN.prototype.modn = function modn (num) {\n return this.modrn(num);\n };\n\n // In-place division by number\n BN.prototype.idivn = function idivn (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(num <= 0x3ffffff);\n\n var carry = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 0x4000000;\n this.words[i] = (w / num) | 0;\n carry = w % num;\n }\n\n this._strip();\n return isNegNum ? this.ineg() : this;\n };\n\n BN.prototype.divn = function divn (num) {\n return this.clone().idivn(num);\n };\n\n BN.prototype.egcd = function egcd (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var x = this;\n var y = p.clone();\n\n if (x.negative !== 0) {\n x = x.umod(p);\n } else {\n x = x.clone();\n }\n\n // A * x + B * y = x\n var A = new BN(1);\n var B = new BN(0);\n\n // C * x + D * y = y\n var C = new BN(0);\n var D = new BN(1);\n\n var g = 0;\n\n while (x.isEven() && y.isEven()) {\n x.iushrn(1);\n y.iushrn(1);\n ++g;\n }\n\n var yp = y.clone();\n var xp = x.clone();\n\n while (!x.isZero()) {\n for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n x.iushrn(i);\n while (i-- > 0) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp);\n B.isub(xp);\n }\n\n A.iushrn(1);\n B.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n y.iushrn(j);\n while (j-- > 0) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp);\n D.isub(xp);\n }\n\n C.iushrn(1);\n D.iushrn(1);\n }\n }\n\n if (x.cmp(y) >= 0) {\n x.isub(y);\n A.isub(C);\n B.isub(D);\n } else {\n y.isub(x);\n C.isub(A);\n D.isub(B);\n }\n }\n\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n };\n\n // This is reduced incarnation of the binary EEA\n // above, designated to invert members of the\n // _prime_ fields F(p) at a maximal speed\n BN.prototype._invmp = function _invmp (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var a = this;\n var b = p.clone();\n\n if (a.negative !== 0) {\n a = a.umod(p);\n } else {\n a = a.clone();\n }\n\n var x1 = new BN(1);\n var x2 = new BN(0);\n\n var delta = b.clone();\n\n while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n a.iushrn(i);\n while (i-- > 0) {\n if (x1.isOdd()) {\n x1.iadd(delta);\n }\n\n x1.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n b.iushrn(j);\n while (j-- > 0) {\n if (x2.isOdd()) {\n x2.iadd(delta);\n }\n\n x2.iushrn(1);\n }\n }\n\n if (a.cmp(b) >= 0) {\n a.isub(b);\n x1.isub(x2);\n } else {\n b.isub(a);\n x2.isub(x1);\n }\n }\n\n var res;\n if (a.cmpn(1) === 0) {\n res = x1;\n } else {\n res = x2;\n }\n\n if (res.cmpn(0) < 0) {\n res.iadd(p);\n }\n\n return res;\n };\n\n BN.prototype.gcd = function gcd (num) {\n if (this.isZero()) return num.abs();\n if (num.isZero()) return this.abs();\n\n var a = this.clone();\n var b = num.clone();\n a.negative = 0;\n b.negative = 0;\n\n // Remove common factor of two\n for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n a.iushrn(1);\n b.iushrn(1);\n }\n\n do {\n while (a.isEven()) {\n a.iushrn(1);\n }\n while (b.isEven()) {\n b.iushrn(1);\n }\n\n var r = a.cmp(b);\n if (r < 0) {\n // Swap `a` and `b` to make `a` always bigger than `b`\n var t = a;\n a = b;\n b = t;\n } else if (r === 0 || b.cmpn(1) === 0) {\n break;\n }\n\n a.isub(b);\n } while (true);\n\n return b.iushln(shift);\n };\n\n // Invert number in the field F(num)\n BN.prototype.invm = function invm (num) {\n return this.egcd(num).a.umod(num);\n };\n\n BN.prototype.isEven = function isEven () {\n return (this.words[0] & 1) === 0;\n };\n\n BN.prototype.isOdd = function isOdd () {\n return (this.words[0] & 1) === 1;\n };\n\n // And first word and num\n BN.prototype.andln = function andln (num) {\n return this.words[0] & num;\n };\n\n // Increment at the bit position in-line\n BN.prototype.bincn = function bincn (bit) {\n assert(typeof bit === 'number');\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) {\n this._expand(s + 1);\n this.words[s] |= q;\n return this;\n }\n\n // Add bit and propagate, if needed\n var carry = q;\n for (var i = s; carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry;\n carry = w >>> 26;\n w &= 0x3ffffff;\n this.words[i] = w;\n }\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n return this;\n };\n\n BN.prototype.isZero = function isZero () {\n return this.length === 1 && this.words[0] === 0;\n };\n\n BN.prototype.cmpn = function cmpn (num) {\n var negative = num < 0;\n\n if (this.negative !== 0 && !negative) return -1;\n if (this.negative === 0 && negative) return 1;\n\n this._strip();\n\n var res;\n if (this.length > 1) {\n res = 1;\n } else {\n if (negative) {\n num = -num;\n }\n\n assert(num <= 0x3ffffff, 'Number is too big');\n\n var w = this.words[0] | 0;\n res = w === num ? 0 : w < num ? -1 : 1;\n }\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Compare two numbers and return:\n // 1 - if `this` > `num`\n // 0 - if `this` == `num`\n // -1 - if `this` < `num`\n BN.prototype.cmp = function cmp (num) {\n if (this.negative !== 0 && num.negative === 0) return -1;\n if (this.negative === 0 && num.negative !== 0) return 1;\n\n var res = this.ucmp(num);\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Unsigned comparison\n BN.prototype.ucmp = function ucmp (num) {\n // At this point both numbers have the same sign\n if (this.length > num.length) return 1;\n if (this.length < num.length) return -1;\n\n var res = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var a = this.words[i] | 0;\n var b = num.words[i] | 0;\n\n if (a === b) continue;\n if (a < b) {\n res = -1;\n } else if (a > b) {\n res = 1;\n }\n break;\n }\n return res;\n };\n\n BN.prototype.gtn = function gtn (num) {\n return this.cmpn(num) === 1;\n };\n\n BN.prototype.gt = function gt (num) {\n return this.cmp(num) === 1;\n };\n\n BN.prototype.gten = function gten (num) {\n return this.cmpn(num) >= 0;\n };\n\n BN.prototype.gte = function gte (num) {\n return this.cmp(num) >= 0;\n };\n\n BN.prototype.ltn = function ltn (num) {\n return this.cmpn(num) === -1;\n };\n\n BN.prototype.lt = function lt (num) {\n return this.cmp(num) === -1;\n };\n\n BN.prototype.lten = function lten (num) {\n return this.cmpn(num) <= 0;\n };\n\n BN.prototype.lte = function lte (num) {\n return this.cmp(num) <= 0;\n };\n\n BN.prototype.eqn = function eqn (num) {\n return this.cmpn(num) === 0;\n };\n\n BN.prototype.eq = function eq (num) {\n return this.cmp(num) === 0;\n };\n\n //\n // A reduce context, could be using montgomery or something better, depending\n // on the `m` itself.\n //\n BN.red = function red (num) {\n return new Red(num);\n };\n\n BN.prototype.toRed = function toRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n assert(this.negative === 0, 'red works only with positives');\n return ctx.convertTo(this)._forceRed(ctx);\n };\n\n BN.prototype.fromRed = function fromRed () {\n assert(this.red, 'fromRed works only with numbers in reduction context');\n return this.red.convertFrom(this);\n };\n\n BN.prototype._forceRed = function _forceRed (ctx) {\n this.red = ctx;\n return this;\n };\n\n BN.prototype.forceRed = function forceRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n return this._forceRed(ctx);\n };\n\n BN.prototype.redAdd = function redAdd (num) {\n assert(this.red, 'redAdd works only with red numbers');\n return this.red.add(this, num);\n };\n\n BN.prototype.redIAdd = function redIAdd (num) {\n assert(this.red, 'redIAdd works only with red numbers');\n return this.red.iadd(this, num);\n };\n\n BN.prototype.redSub = function redSub (num) {\n assert(this.red, 'redSub works only with red numbers');\n return this.red.sub(this, num);\n };\n\n BN.prototype.redISub = function redISub (num) {\n assert(this.red, 'redISub works only with red numbers');\n return this.red.isub(this, num);\n };\n\n BN.prototype.redShl = function redShl (num) {\n assert(this.red, 'redShl works only with red numbers');\n return this.red.shl(this, num);\n };\n\n BN.prototype.redMul = function redMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.mul(this, num);\n };\n\n BN.prototype.redIMul = function redIMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.imul(this, num);\n };\n\n BN.prototype.redSqr = function redSqr () {\n assert(this.red, 'redSqr works only with red numbers');\n this.red._verify1(this);\n return this.red.sqr(this);\n };\n\n BN.prototype.redISqr = function redISqr () {\n assert(this.red, 'redISqr works only with red numbers');\n this.red._verify1(this);\n return this.red.isqr(this);\n };\n\n // Square root over p\n BN.prototype.redSqrt = function redSqrt () {\n assert(this.red, 'redSqrt works only with red numbers');\n this.red._verify1(this);\n return this.red.sqrt(this);\n };\n\n BN.prototype.redInvm = function redInvm () {\n assert(this.red, 'redInvm works only with red numbers');\n this.red._verify1(this);\n return this.red.invm(this);\n };\n\n // Return negative clone of `this` % `red modulo`\n BN.prototype.redNeg = function redNeg () {\n assert(this.red, 'redNeg works only with red numbers');\n this.red._verify1(this);\n return this.red.neg(this);\n };\n\n BN.prototype.redPow = function redPow (num) {\n assert(this.red && !num.red, 'redPow(normalNum)');\n this.red._verify1(this);\n return this.red.pow(this, num);\n };\n\n // Prime numbers with efficient reduction\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n\n // Pseudo-Mersenne prime\n function MPrime (name, p) {\n // P = 2 ^ N - K\n this.name = name;\n this.p = new BN(p, 16);\n this.n = this.p.bitLength();\n this.k = new BN(1).iushln(this.n).isub(this.p);\n\n this.tmp = this._tmp();\n }\n\n MPrime.prototype._tmp = function _tmp () {\n var tmp = new BN(null);\n tmp.words = new Array(Math.ceil(this.n / 13));\n return tmp;\n };\n\n MPrime.prototype.ireduce = function ireduce (num) {\n // Assumes that `num` is less than `P^2`\n // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n var r = num;\n var rlen;\n\n do {\n this.split(r, this.tmp);\n r = this.imulK(r);\n r = r.iadd(this.tmp);\n rlen = r.bitLength();\n } while (rlen > this.n);\n\n var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n if (cmp === 0) {\n r.words[0] = 0;\n r.length = 1;\n } else if (cmp > 0) {\n r.isub(this.p);\n } else {\n if (r.strip !== undefined) {\n // r is a BN v4 instance\n r.strip();\n } else {\n // r is a BN v5 instance\n r._strip();\n }\n }\n\n return r;\n };\n\n MPrime.prototype.split = function split (input, out) {\n input.iushrn(this.n, 0, out);\n };\n\n MPrime.prototype.imulK = function imulK (num) {\n return num.imul(this.k);\n };\n\n function K256 () {\n MPrime.call(\n this,\n 'k256',\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n }\n inherits(K256, MPrime);\n\n K256.prototype.split = function split (input, output) {\n // 256 = 9 * 26 + 22\n var mask = 0x3fffff;\n\n var outLen = Math.min(input.length, 9);\n for (var i = 0; i < outLen; i++) {\n output.words[i] = input.words[i];\n }\n output.length = outLen;\n\n if (input.length <= 9) {\n input.words[0] = 0;\n input.length = 1;\n return;\n }\n\n // Shift by 9 limbs\n var prev = input.words[9];\n output.words[output.length++] = prev & mask;\n\n for (i = 10; i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n prev = next;\n }\n prev >>>= 22;\n input.words[i - 10] = prev;\n if (prev === 0 && input.length > 10) {\n input.length -= 10;\n } else {\n input.length -= 9;\n }\n };\n\n K256.prototype.imulK = function imulK (num) {\n // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n num.words[num.length] = 0;\n num.words[num.length + 1] = 0;\n num.length += 2;\n\n // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n var lo = 0;\n for (var i = 0; i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 0x3d1;\n num.words[i] = lo & 0x3ffffff;\n lo = w * 0x40 + ((lo / 0x4000000) | 0);\n }\n\n // Fast length reduction\n if (num.words[num.length - 1] === 0) {\n num.length--;\n if (num.words[num.length - 1] === 0) {\n num.length--;\n }\n }\n return num;\n };\n\n function P224 () {\n MPrime.call(\n this,\n 'p224',\n 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n }\n inherits(P224, MPrime);\n\n function P192 () {\n MPrime.call(\n this,\n 'p192',\n 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n }\n inherits(P192, MPrime);\n\n function P25519 () {\n // 2 ^ 255 - 19\n MPrime.call(\n this,\n '25519',\n '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n }\n inherits(P25519, MPrime);\n\n P25519.prototype.imulK = function imulK (num) {\n // K = 0x13\n var carry = 0;\n for (var i = 0; i < num.length; i++) {\n var hi = (num.words[i] | 0) * 0x13 + carry;\n var lo = hi & 0x3ffffff;\n hi >>>= 26;\n\n num.words[i] = lo;\n carry = hi;\n }\n if (carry !== 0) {\n num.words[num.length++] = carry;\n }\n return num;\n };\n\n // Exported mostly for testing purposes, use plain name instead\n BN._prime = function prime (name) {\n // Cached version of prime\n if (primes[name]) return primes[name];\n\n var prime;\n if (name === 'k256') {\n prime = new K256();\n } else if (name === 'p224') {\n prime = new P224();\n } else if (name === 'p192') {\n prime = new P192();\n } else if (name === 'p25519') {\n prime = new P25519();\n } else {\n throw new Error('Unknown prime ' + name);\n }\n primes[name] = prime;\n\n return prime;\n };\n\n //\n // Base reduction engine\n //\n function Red (m) {\n if (typeof m === 'string') {\n var prime = BN._prime(m);\n this.m = prime.p;\n this.prime = prime;\n } else {\n assert(m.gtn(1), 'modulus must be greater than 1');\n this.m = m;\n this.prime = null;\n }\n }\n\n Red.prototype._verify1 = function _verify1 (a) {\n assert(a.negative === 0, 'red works only with positives');\n assert(a.red, 'red works only with red numbers');\n };\n\n Red.prototype._verify2 = function _verify2 (a, b) {\n assert((a.negative | b.negative) === 0, 'red works only with positives');\n assert(a.red && a.red === b.red,\n 'red works only with red numbers');\n };\n\n Red.prototype.imod = function imod (a) {\n if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n\n move(a, a.umod(this.m)._forceRed(this));\n return a;\n };\n\n Red.prototype.neg = function neg (a) {\n if (a.isZero()) {\n return a.clone();\n }\n\n return this.m.sub(a)._forceRed(this);\n };\n\n Red.prototype.add = function add (a, b) {\n this._verify2(a, b);\n\n var res = a.add(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.iadd = function iadd (a, b) {\n this._verify2(a, b);\n\n var res = a.iadd(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res;\n };\n\n Red.prototype.sub = function sub (a, b) {\n this._verify2(a, b);\n\n var res = a.sub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.isub = function isub (a, b) {\n this._verify2(a, b);\n\n var res = a.isub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res;\n };\n\n Red.prototype.shl = function shl (a, num) {\n this._verify1(a);\n return this.imod(a.ushln(num));\n };\n\n Red.prototype.imul = function imul (a, b) {\n this._verify2(a, b);\n return this.imod(a.imul(b));\n };\n\n Red.prototype.mul = function mul (a, b) {\n this._verify2(a, b);\n return this.imod(a.mul(b));\n };\n\n Red.prototype.isqr = function isqr (a) {\n return this.imul(a, a.clone());\n };\n\n Red.prototype.sqr = function sqr (a) {\n return this.mul(a, a);\n };\n\n Red.prototype.sqrt = function sqrt (a) {\n if (a.isZero()) return a.clone();\n\n var mod3 = this.m.andln(3);\n assert(mod3 % 2 === 1);\n\n // Fast case\n if (mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n\n // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n //\n // Find Q and S, that Q * 2 ^ S = (P - 1)\n var q = this.m.subn(1);\n var s = 0;\n while (!q.isZero() && q.andln(1) === 0) {\n s++;\n q.iushrn(1);\n }\n assert(!q.isZero());\n\n var one = new BN(1).toRed(this);\n var nOne = one.redNeg();\n\n // Find quadratic non-residue\n // NOTE: Max is such because of generalized Riemann hypothesis.\n var lpow = this.m.subn(1).iushrn(1);\n var z = this.m.bitLength();\n z = new BN(2 * z * z).toRed(this);\n\n while (this.pow(z, lpow).cmp(nOne) !== 0) {\n z.redIAdd(nOne);\n }\n\n var c = this.pow(z, q);\n var r = this.pow(a, q.addn(1).iushrn(1));\n var t = this.pow(a, q);\n var m = s;\n while (t.cmp(one) !== 0) {\n var tmp = t;\n for (var i = 0; tmp.cmp(one) !== 0; i++) {\n tmp = tmp.redSqr();\n }\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n r = r.redMul(b);\n c = b.redSqr();\n t = t.redMul(c);\n m = i;\n }\n\n return r;\n };\n\n Red.prototype.invm = function invm (a) {\n var inv = a._invmp(this.m);\n if (inv.negative !== 0) {\n inv.negative = 0;\n return this.imod(inv).redNeg();\n } else {\n return this.imod(inv);\n }\n };\n\n Red.prototype.pow = function pow (a, num) {\n if (num.isZero()) return new BN(1).toRed(this);\n if (num.cmpn(1) === 0) return a.clone();\n\n var windowSize = 4;\n var wnd = new Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this);\n wnd[1] = a;\n for (var i = 2; i < wnd.length; i++) {\n wnd[i] = this.mul(wnd[i - 1], a);\n }\n\n var res = wnd[0];\n var current = 0;\n var currentLen = 0;\n var start = num.bitLength() % 26;\n if (start === 0) {\n start = 26;\n }\n\n for (i = num.length - 1; i >= 0; i--) {\n var word = num.words[i];\n for (var j = start - 1; j >= 0; j--) {\n var bit = (word >> j) & 1;\n if (res !== wnd[0]) {\n res = this.sqr(res);\n }\n\n if (bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n\n current <<= 1;\n current |= bit;\n currentLen++;\n if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n res = this.mul(res, wnd[current]);\n currentLen = 0;\n current = 0;\n }\n start = 26;\n }\n\n return res;\n };\n\n Red.prototype.convertTo = function convertTo (num) {\n var r = num.umod(this.m);\n\n return r === num ? r.clone() : r;\n };\n\n Red.prototype.convertFrom = function convertFrom (num) {\n var res = num.clone();\n res.red = null;\n return res;\n };\n\n //\n // Montgomery method engine\n //\n\n BN.mont = function mont (num) {\n return new Mont(num);\n };\n\n function Mont (m) {\n Red.call(this, m);\n\n this.shift = this.m.bitLength();\n if (this.shift % 26 !== 0) {\n this.shift += 26 - (this.shift % 26);\n }\n\n this.r = new BN(1).iushln(this.shift);\n this.r2 = this.imod(this.r.sqr());\n this.rinv = this.r._invmp(this.m);\n\n this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n this.minv = this.minv.umod(this.r);\n this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red);\n\n Mont.prototype.convertTo = function convertTo (num) {\n return this.imod(num.ushln(this.shift));\n };\n\n Mont.prototype.convertFrom = function convertFrom (num) {\n var r = this.imod(num.mul(this.rinv));\n r.red = null;\n return r;\n };\n\n Mont.prototype.imul = function imul (a, b) {\n if (a.isZero() || b.isZero()) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n var t = a.imul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.mul = function mul (a, b) {\n if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n var t = a.mul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.invm = function invm (a) {\n // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n})( false || module, this);\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/bn.js/lib/bn.js?"); - -/***/ }), - -/***/ "./node_modules/decode-uri-component/index.js": -/*!****************************************************!*\ - !*** ./node_modules/decode-uri-component/index.js ***! - \****************************************************/ -/***/ ((module) => { - -eval("\nvar token = '%[a-f0-9]{2}';\nvar singleMatcher = new RegExp('(' + token + ')|([^%]+?)', 'gi');\nvar multiMatcher = new RegExp('(' + token + ')+', 'gi');\n\nfunction decodeComponents(components, split) {\n\ttry {\n\t\t// Try to decode the entire string first\n\t\treturn [decodeURIComponent(components.join(''))];\n\t} catch (err) {\n\t\t// Do nothing\n\t}\n\n\tif (components.length === 1) {\n\t\treturn components;\n\t}\n\n\tsplit = split || 1;\n\n\t// Split the array in 2 parts\n\tvar left = components.slice(0, split);\n\tvar right = components.slice(split);\n\n\treturn Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right));\n}\n\nfunction decode(input) {\n\ttry {\n\t\treturn decodeURIComponent(input);\n\t} catch (err) {\n\t\tvar tokens = input.match(singleMatcher) || [];\n\n\t\tfor (var i = 1; i < tokens.length; i++) {\n\t\t\tinput = decodeComponents(tokens, i).join('');\n\n\t\t\ttokens = input.match(singleMatcher) || [];\n\t\t}\n\n\t\treturn input;\n\t}\n}\n\nfunction customDecodeURIComponent(input) {\n\t// Keep track of all the replacements and prefill the map with the `BOM`\n\tvar replaceMap = {\n\t\t'%FE%FF': '\\uFFFD\\uFFFD',\n\t\t'%FF%FE': '\\uFFFD\\uFFFD'\n\t};\n\n\tvar match = multiMatcher.exec(input);\n\twhile (match) {\n\t\ttry {\n\t\t\t// Decode as big chunks as possible\n\t\t\treplaceMap[match[0]] = decodeURIComponent(match[0]);\n\t\t} catch (err) {\n\t\t\tvar result = decode(match[0]);\n\n\t\t\tif (result !== match[0]) {\n\t\t\t\treplaceMap[match[0]] = result;\n\t\t\t}\n\t\t}\n\n\t\tmatch = multiMatcher.exec(input);\n\t}\n\n\t// Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else\n\treplaceMap['%C2'] = '\\uFFFD';\n\n\tvar entries = Object.keys(replaceMap);\n\n\tfor (var i = 0; i < entries.length; i++) {\n\t\t// Replace all decoded components\n\t\tvar key = entries[i];\n\t\tinput = input.replace(new RegExp(key, 'g'), replaceMap[key]);\n\t}\n\n\treturn input;\n}\n\nmodule.exports = function (encodedURI) {\n\tif (typeof encodedURI !== 'string') {\n\t\tthrow new TypeError('Expected `encodedURI` to be of type `string`, got `' + typeof encodedURI + '`');\n\t}\n\n\ttry {\n\t\tencodedURI = encodedURI.replace(/\\+/g, ' ');\n\n\t\t// Try the built in decoder first\n\t\treturn decodeURIComponent(encodedURI);\n\t} catch (err) {\n\t\t// Fallback to a more advanced decoder\n\t\treturn customDecodeURIComponent(encodedURI);\n\t}\n};\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/decode-uri-component/index.js?"); - -/***/ }), - -/***/ "./node_modules/detect-browser/es/index.js": -/*!*************************************************!*\ - !*** ./node_modules/detect-browser/es/index.js ***! - \*************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BotInfo: () => (/* binding */ BotInfo),\n/* harmony export */ BrowserInfo: () => (/* binding */ BrowserInfo),\n/* harmony export */ NodeInfo: () => (/* binding */ NodeInfo),\n/* harmony export */ ReactNativeInfo: () => (/* binding */ ReactNativeInfo),\n/* harmony export */ SearchBotDeviceInfo: () => (/* binding */ SearchBotDeviceInfo),\n/* harmony export */ browserName: () => (/* binding */ browserName),\n/* harmony export */ detect: () => (/* binding */ detect),\n/* harmony export */ detectOS: () => (/* binding */ detectOS),\n/* harmony export */ getNodeVersion: () => (/* binding */ getNodeVersion),\n/* harmony export */ parseUserAgent: () => (/* binding */ parseUserAgent)\n/* harmony export */ });\nvar __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar BrowserInfo = /** @class */ (function () {\n function BrowserInfo(name, version, os) {\n this.name = name;\n this.version = version;\n this.os = os;\n this.type = 'browser';\n }\n return BrowserInfo;\n}());\n\nvar NodeInfo = /** @class */ (function () {\n function NodeInfo(version) {\n this.version = version;\n this.type = 'node';\n this.name = 'node';\n this.os = process.platform;\n }\n return NodeInfo;\n}());\n\nvar SearchBotDeviceInfo = /** @class */ (function () {\n function SearchBotDeviceInfo(name, version, os, bot) {\n this.name = name;\n this.version = version;\n this.os = os;\n this.bot = bot;\n this.type = 'bot-device';\n }\n return SearchBotDeviceInfo;\n}());\n\nvar BotInfo = /** @class */ (function () {\n function BotInfo() {\n this.type = 'bot';\n this.bot = true; // NOTE: deprecated test name instead\n this.name = 'bot';\n this.version = null;\n this.os = null;\n }\n return BotInfo;\n}());\n\nvar ReactNativeInfo = /** @class */ (function () {\n function ReactNativeInfo() {\n this.type = 'react-native';\n this.name = 'react-native';\n this.version = null;\n this.os = null;\n }\n return ReactNativeInfo;\n}());\n\n// tslint:disable-next-line:max-line-length\nvar SEARCHBOX_UA_REGEX = /alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/;\nvar SEARCHBOT_OS_REGEX = /(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\\ Jeeves\\/Teoma|ia_archiver)/;\nvar REQUIRED_VERSION_PARTS = 3;\nvar userAgentRules = [\n ['aol', /AOLShield\\/([0-9\\._]+)/],\n ['edge', /Edge\\/([0-9\\._]+)/],\n ['edge-ios', /EdgiOS\\/([0-9\\._]+)/],\n ['yandexbrowser', /YaBrowser\\/([0-9\\._]+)/],\n ['kakaotalk', /KAKAOTALK\\s([0-9\\.]+)/],\n ['samsung', /SamsungBrowser\\/([0-9\\.]+)/],\n ['silk', /\\bSilk\\/([0-9._-]+)\\b/],\n ['miui', /MiuiBrowser\\/([0-9\\.]+)$/],\n ['beaker', /BeakerBrowser\\/([0-9\\.]+)/],\n ['edge-chromium', /EdgA?\\/([0-9\\.]+)/],\n [\n 'chromium-webview',\n /(?!Chrom.*OPR)wv\\).*Chrom(?:e|ium)\\/([0-9\\.]+)(:?\\s|$)/,\n ],\n ['chrome', /(?!Chrom.*OPR)Chrom(?:e|ium)\\/([0-9\\.]+)(:?\\s|$)/],\n ['phantomjs', /PhantomJS\\/([0-9\\.]+)(:?\\s|$)/],\n ['crios', /CriOS\\/([0-9\\.]+)(:?\\s|$)/],\n ['firefox', /Firefox\\/([0-9\\.]+)(?:\\s|$)/],\n ['fxios', /FxiOS\\/([0-9\\.]+)/],\n ['opera-mini', /Opera Mini.*Version\\/([0-9\\.]+)/],\n ['opera', /Opera\\/([0-9\\.]+)(?:\\s|$)/],\n ['opera', /OPR\\/([0-9\\.]+)(:?\\s|$)/],\n ['pie', /^Microsoft Pocket Internet Explorer\\/(\\d+\\.\\d+)$/],\n ['pie', /^Mozilla\\/\\d\\.\\d+\\s\\(compatible;\\s(?:MSP?IE|MSInternet Explorer) (\\d+\\.\\d+);.*Windows CE.*\\)$/],\n ['netfront', /^Mozilla\\/\\d\\.\\d+.*NetFront\\/(\\d.\\d)/],\n ['ie', /Trident\\/7\\.0.*rv\\:([0-9\\.]+).*\\).*Gecko$/],\n ['ie', /MSIE\\s([0-9\\.]+);.*Trident\\/[4-7].0/],\n ['ie', /MSIE\\s(7\\.0)/],\n ['bb10', /BB10;\\sTouch.*Version\\/([0-9\\.]+)/],\n ['android', /Android\\s([0-9\\.]+)/],\n ['ios', /Version\\/([0-9\\._]+).*Mobile.*Safari.*/],\n ['safari', /Version\\/([0-9\\._]+).*Safari/],\n ['facebook', /FB[AS]V\\/([0-9\\.]+)/],\n ['instagram', /Instagram\\s([0-9\\.]+)/],\n ['ios-webview', /AppleWebKit\\/([0-9\\.]+).*Mobile/],\n ['ios-webview', /AppleWebKit\\/([0-9\\.]+).*Gecko\\)$/],\n ['curl', /^curl\\/([0-9\\.]+)$/],\n ['searchbot', SEARCHBOX_UA_REGEX],\n];\nvar operatingSystemRules = [\n ['iOS', /iP(hone|od|ad)/],\n ['Android OS', /Android/],\n ['BlackBerry OS', /BlackBerry|BB10/],\n ['Windows Mobile', /IEMobile/],\n ['Amazon OS', /Kindle/],\n ['Windows 3.11', /Win16/],\n ['Windows 95', /(Windows 95)|(Win95)|(Windows_95)/],\n ['Windows 98', /(Windows 98)|(Win98)/],\n ['Windows 2000', /(Windows NT 5.0)|(Windows 2000)/],\n ['Windows XP', /(Windows NT 5.1)|(Windows XP)/],\n ['Windows Server 2003', /(Windows NT 5.2)/],\n ['Windows Vista', /(Windows NT 6.0)/],\n ['Windows 7', /(Windows NT 6.1)/],\n ['Windows 8', /(Windows NT 6.2)/],\n ['Windows 8.1', /(Windows NT 6.3)/],\n ['Windows 10', /(Windows NT 10.0)/],\n ['Windows ME', /Windows ME/],\n ['Windows CE', /Windows CE|WinCE|Microsoft Pocket Internet Explorer/],\n ['Open BSD', /OpenBSD/],\n ['Sun OS', /SunOS/],\n ['Chrome OS', /CrOS/],\n ['Linux', /(Linux)|(X11)/],\n ['Mac OS', /(Mac_PowerPC)|(Macintosh)/],\n ['QNX', /QNX/],\n ['BeOS', /BeOS/],\n ['OS/2', /OS\\/2/],\n];\nfunction detect(userAgent) {\n if (!!userAgent) {\n return parseUserAgent(userAgent);\n }\n if (typeof document === 'undefined' &&\n typeof navigator !== 'undefined' &&\n navigator.product === 'ReactNative') {\n return new ReactNativeInfo();\n }\n if (typeof navigator !== 'undefined') {\n return parseUserAgent(navigator.userAgent);\n }\n return getNodeVersion();\n}\nfunction matchUserAgent(ua) {\n // opted for using reduce here rather than Array#first with a regex.test call\n // this is primarily because using the reduce we only perform the regex\n // execution once rather than once for the test and for the exec again below\n // probably something that needs to be benchmarked though\n return (ua !== '' &&\n userAgentRules.reduce(function (matched, _a) {\n var browser = _a[0], regex = _a[1];\n if (matched) {\n return matched;\n }\n var uaMatch = regex.exec(ua);\n return !!uaMatch && [browser, uaMatch];\n }, false));\n}\nfunction browserName(ua) {\n var data = matchUserAgent(ua);\n return data ? data[0] : null;\n}\nfunction parseUserAgent(ua) {\n var matchedRule = matchUserAgent(ua);\n if (!matchedRule) {\n return null;\n }\n var name = matchedRule[0], match = matchedRule[1];\n if (name === 'searchbot') {\n return new BotInfo();\n }\n // Do not use RegExp for split operation as some browser do not support it (See: http://blog.stevenlevithan.com/archives/cross-browser-split)\n var versionParts = match[1] && match[1].split('.').join('_').split('_').slice(0, 3);\n if (versionParts) {\n if (versionParts.length < REQUIRED_VERSION_PARTS) {\n versionParts = __spreadArray(__spreadArray([], versionParts, true), createVersionParts(REQUIRED_VERSION_PARTS - versionParts.length), true);\n }\n }\n else {\n versionParts = [];\n }\n var version = versionParts.join('.');\n var os = detectOS(ua);\n var searchBotMatch = SEARCHBOT_OS_REGEX.exec(ua);\n if (searchBotMatch && searchBotMatch[1]) {\n return new SearchBotDeviceInfo(name, version, os, searchBotMatch[1]);\n }\n return new BrowserInfo(name, version, os);\n}\nfunction detectOS(ua) {\n for (var ii = 0, count = operatingSystemRules.length; ii < count; ii++) {\n var _a = operatingSystemRules[ii], os = _a[0], regex = _a[1];\n var match = regex.exec(ua);\n if (match) {\n return os;\n }\n }\n return null;\n}\nfunction getNodeVersion() {\n var isNode = typeof process !== 'undefined' && process.version;\n return isNode ? new NodeInfo(process.version.slice(1)) : null;\n}\nfunction createVersionParts(count) {\n var output = [];\n for (var ii = 0; ii < count; ii++) {\n output.push('0');\n }\n return output;\n}\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/detect-browser/es/index.js?"); - -/***/ }), - -/***/ "./node_modules/events/events.js": -/*!***************************************!*\ - !*** ./node_modules/events/events.js ***! - \***************************************/ -/***/ ((module) => { - -eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\nvar R = typeof Reflect === 'object' ? Reflect : null\nvar ReflectApply = R && typeof R.apply === 'function'\n ? R.apply\n : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n }\n\nvar ReflectOwnKeys\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target)\n .concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n}\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\nmodule.exports = EventEmitter;\nmodule.exports.once = once;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nvar defaultMaxListeners = 10;\n\nfunction checkListener(listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n}\n\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function() {\n return defaultMaxListeners;\n },\n set: function(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function() {\n\n if (this._events === undefined ||\n this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n};\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n this._maxListeners = n;\n return this;\n};\n\nfunction _getMaxListeners(that) {\n if (that._maxListeners === undefined)\n return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return _getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);\n var doError = (type === 'error');\n\n var events = this._events;\n if (events !== undefined)\n doError = (doError && events.error === undefined);\n else if (!doError)\n return false;\n\n // If there is no 'error' event listener then throw.\n if (doError) {\n var er;\n if (args.length > 0)\n er = args[0];\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n }\n // At least give some kind of context to the user\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n\n if (handler === undefined)\n return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n for (var i = 0; i < len; ++i)\n ReflectApply(listeners[i], this, args);\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n\n checkListener(listener);\n\n events = target._events;\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type,\n listener.listener ? listener.listener : listener);\n\n // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n events = target._events;\n }\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] =\n prepend ? [listener, existing] : [existing, listener];\n // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n }\n\n // Check for listener leak\n m = _getMaxListeners(target);\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true;\n // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n var w = new Error('Possible EventEmitter memory leak detected. ' +\n existing.length + ' ' + String(type) + ' listeners ' +\n 'added. Use emitter.setMaxListeners() to ' +\n 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener =\n function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n };\n\nfunction onceWrapper() {\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n if (arguments.length === 0)\n return this.listener.call(this.target);\n return this.listener.apply(this.target, arguments);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n checkListener(listener);\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener =\n function prependOnceListener(type, listener) {\n checkListener(listener);\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n };\n\n// Emits a 'removeListener' event if and only if the listener was removed.\nEventEmitter.prototype.removeListener =\n function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n\n checkListener(listener);\n\n events = this._events;\n if (events === undefined)\n return this;\n\n list = events[type];\n if (list === undefined)\n return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else {\n delete events[type];\n if (events.removeListener)\n this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (position === 0)\n list.shift();\n else {\n spliceOne(list, position);\n }\n\n if (list.length === 1)\n events[type] = list[0];\n\n if (events.removeListener !== undefined)\n this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n };\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners =\n function removeAllListeners(type) {\n var listeners, events, i;\n\n events = this._events;\n if (events === undefined)\n return this;\n\n // not listening for removeListener, no need to emit\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else\n delete events[type];\n }\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n };\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n\n if (events === undefined)\n return [];\n\n var evlistener = events[type];\n if (evlistener === undefined)\n return [];\n\n if (typeof evlistener === 'function')\n return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n\n return unwrap ?\n unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n for (var i = 0; i < n; ++i)\n copy[i] = arr[i];\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++)\n list[index] = list[index + 1];\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n return ret;\n}\n\nfunction once(emitter, name) {\n return new Promise(function (resolve, reject) {\n function errorListener(err) {\n emitter.removeListener(name, resolver);\n reject(err);\n }\n\n function resolver() {\n if (typeof emitter.removeListener === 'function') {\n emitter.removeListener('error', errorListener);\n }\n resolve([].slice.call(arguments));\n };\n\n eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });\n if (name !== 'error') {\n addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });\n }\n });\n}\n\nfunction addErrorHandlerIfEventEmitter(emitter, handler, flags) {\n if (typeof emitter.on === 'function') {\n eventTargetAgnosticAddListener(emitter, 'error', handler, flags);\n }\n}\n\nfunction eventTargetAgnosticAddListener(emitter, name, listener, flags) {\n if (typeof emitter.on === 'function') {\n if (flags.once) {\n emitter.once(name, listener);\n } else {\n emitter.on(name, listener);\n }\n } else if (typeof emitter.addEventListener === 'function') {\n // EventTarget does not have `error` event semantics like Node\n // EventEmitters, we do not listen for `error` events here.\n emitter.addEventListener(name, function wrapListener(arg) {\n // IE does not have builtin `{ once: true }` support so we\n // have to do it manually.\n if (flags.once) {\n emitter.removeEventListener(name, wrapListener);\n }\n listener(arg);\n });\n } else {\n throw new TypeError('The \"emitter\" argument must be of type EventEmitter. Received type ' + typeof emitter);\n }\n}\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/events/events.js?"); - -/***/ }), - -/***/ "./node_modules/filter-obj/index.js": -/*!******************************************!*\ - !*** ./node_modules/filter-obj/index.js ***! - \******************************************/ -/***/ ((module) => { - -eval("\nmodule.exports = function (obj, predicate) {\n\tvar ret = {};\n\tvar keys = Object.keys(obj);\n\tvar isArr = Array.isArray(predicate);\n\n\tfor (var i = 0; i < keys.length; i++) {\n\t\tvar key = keys[i];\n\t\tvar val = obj[key];\n\n\t\tif (isArr ? predicate.indexOf(key) !== -1 : predicate(key, val, obj)) {\n\t\t\tret[key] = val;\n\t\t}\n\t}\n\n\treturn ret;\n};\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/filter-obj/index.js?"); - -/***/ }), - -/***/ "./node_modules/hash.js/lib/hash.js": -/*!******************************************!*\ - !*** ./node_modules/hash.js/lib/hash.js ***! - \******************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("var hash = exports;\n\nhash.utils = __webpack_require__(/*! ./hash/utils */ \"./node_modules/hash.js/lib/hash/utils.js\");\nhash.common = __webpack_require__(/*! ./hash/common */ \"./node_modules/hash.js/lib/hash/common.js\");\nhash.sha = __webpack_require__(/*! ./hash/sha */ \"./node_modules/hash.js/lib/hash/sha.js\");\nhash.ripemd = __webpack_require__(/*! ./hash/ripemd */ \"./node_modules/hash.js/lib/hash/ripemd.js\");\nhash.hmac = __webpack_require__(/*! ./hash/hmac */ \"./node_modules/hash.js/lib/hash/hmac.js\");\n\n// Proxy hash functions to the main object\nhash.sha1 = hash.sha.sha1;\nhash.sha256 = hash.sha.sha256;\nhash.sha224 = hash.sha.sha224;\nhash.sha384 = hash.sha.sha384;\nhash.sha512 = hash.sha.sha512;\nhash.ripemd160 = hash.ripemd.ripemd160;\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/hash.js/lib/hash.js?"); - -/***/ }), - -/***/ "./node_modules/hash.js/lib/hash/common.js": -/*!*************************************************!*\ - !*** ./node_modules/hash.js/lib/hash/common.js ***! - \*************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\n\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/hash.js/lib/hash/utils.js\");\nvar assert = __webpack_require__(/*! minimalistic-assert */ \"./node_modules/minimalistic-assert/index.js\");\n\nfunction BlockHash() {\n this.pending = null;\n this.pendingTotal = 0;\n this.blockSize = this.constructor.blockSize;\n this.outSize = this.constructor.outSize;\n this.hmacStrength = this.constructor.hmacStrength;\n this.padLength = this.constructor.padLength / 8;\n this.endian = 'big';\n\n this._delta8 = this.blockSize / 8;\n this._delta32 = this.blockSize / 32;\n}\nexports.BlockHash = BlockHash;\n\nBlockHash.prototype.update = function update(msg, enc) {\n // Convert message to array, pad it, and join into 32bit blocks\n msg = utils.toArray(msg, enc);\n if (!this.pending)\n this.pending = msg;\n else\n this.pending = this.pending.concat(msg);\n this.pendingTotal += msg.length;\n\n // Enough data, try updating\n if (this.pending.length >= this._delta8) {\n msg = this.pending;\n\n // Process pending data in blocks\n var r = msg.length % this._delta8;\n this.pending = msg.slice(msg.length - r, msg.length);\n if (this.pending.length === 0)\n this.pending = null;\n\n msg = utils.join32(msg, 0, msg.length - r, this.endian);\n for (var i = 0; i < msg.length; i += this._delta32)\n this._update(msg, i, i + this._delta32);\n }\n\n return this;\n};\n\nBlockHash.prototype.digest = function digest(enc) {\n this.update(this._pad());\n assert(this.pending === null);\n\n return this._digest(enc);\n};\n\nBlockHash.prototype._pad = function pad() {\n var len = this.pendingTotal;\n var bytes = this._delta8;\n var k = bytes - ((len + this.padLength) % bytes);\n var res = new Array(k + this.padLength);\n res[0] = 0x80;\n for (var i = 1; i < k; i++)\n res[i] = 0;\n\n // Append length\n len <<= 3;\n if (this.endian === 'big') {\n for (var t = 8; t < this.padLength; t++)\n res[i++] = 0;\n\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = (len >>> 24) & 0xff;\n res[i++] = (len >>> 16) & 0xff;\n res[i++] = (len >>> 8) & 0xff;\n res[i++] = len & 0xff;\n } else {\n res[i++] = len & 0xff;\n res[i++] = (len >>> 8) & 0xff;\n res[i++] = (len >>> 16) & 0xff;\n res[i++] = (len >>> 24) & 0xff;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n\n for (t = 8; t < this.padLength; t++)\n res[i++] = 0;\n }\n\n return res;\n};\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/hash.js/lib/hash/common.js?"); - -/***/ }), - -/***/ "./node_modules/hash.js/lib/hash/hmac.js": -/*!***********************************************!*\ - !*** ./node_modules/hash.js/lib/hash/hmac.js ***! - \***********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -eval("\n\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/hash.js/lib/hash/utils.js\");\nvar assert = __webpack_require__(/*! minimalistic-assert */ \"./node_modules/minimalistic-assert/index.js\");\n\nfunction Hmac(hash, key, enc) {\n if (!(this instanceof Hmac))\n return new Hmac(hash, key, enc);\n this.Hash = hash;\n this.blockSize = hash.blockSize / 8;\n this.outSize = hash.outSize / 8;\n this.inner = null;\n this.outer = null;\n\n this._init(utils.toArray(key, enc));\n}\nmodule.exports = Hmac;\n\nHmac.prototype._init = function init(key) {\n // Shorten key, if needed\n if (key.length > this.blockSize)\n key = new this.Hash().update(key).digest();\n assert(key.length <= this.blockSize);\n\n // Add padding to key\n for (var i = key.length; i < this.blockSize; i++)\n key.push(0);\n\n for (i = 0; i < key.length; i++)\n key[i] ^= 0x36;\n this.inner = new this.Hash().update(key);\n\n // 0x36 ^ 0x5c = 0x6a\n for (i = 0; i < key.length; i++)\n key[i] ^= 0x6a;\n this.outer = new this.Hash().update(key);\n};\n\nHmac.prototype.update = function update(msg, enc) {\n this.inner.update(msg, enc);\n return this;\n};\n\nHmac.prototype.digest = function digest(enc) {\n this.outer.update(this.inner.digest());\n return this.outer.digest(enc);\n};\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/hash.js/lib/hash/hmac.js?"); - -/***/ }), - -/***/ "./node_modules/hash.js/lib/hash/ripemd.js": -/*!*************************************************!*\ - !*** ./node_modules/hash.js/lib/hash/ripemd.js ***! - \*************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\n\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/hash.js/lib/hash/utils.js\");\nvar common = __webpack_require__(/*! ./common */ \"./node_modules/hash.js/lib/hash/common.js\");\n\nvar rotl32 = utils.rotl32;\nvar sum32 = utils.sum32;\nvar sum32_3 = utils.sum32_3;\nvar sum32_4 = utils.sum32_4;\nvar BlockHash = common.BlockHash;\n\nfunction RIPEMD160() {\n if (!(this instanceof RIPEMD160))\n return new RIPEMD160();\n\n BlockHash.call(this);\n\n this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ];\n this.endian = 'little';\n}\nutils.inherits(RIPEMD160, BlockHash);\nexports.ripemd160 = RIPEMD160;\n\nRIPEMD160.blockSize = 512;\nRIPEMD160.outSize = 160;\nRIPEMD160.hmacStrength = 192;\nRIPEMD160.padLength = 64;\n\nRIPEMD160.prototype._update = function update(msg, start) {\n var A = this.h[0];\n var B = this.h[1];\n var C = this.h[2];\n var D = this.h[3];\n var E = this.h[4];\n var Ah = A;\n var Bh = B;\n var Ch = C;\n var Dh = D;\n var Eh = E;\n for (var j = 0; j < 80; j++) {\n var T = sum32(\n rotl32(\n sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)),\n s[j]),\n E);\n A = E;\n E = D;\n D = rotl32(C, 10);\n C = B;\n B = T;\n T = sum32(\n rotl32(\n sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)),\n sh[j]),\n Eh);\n Ah = Eh;\n Eh = Dh;\n Dh = rotl32(Ch, 10);\n Ch = Bh;\n Bh = T;\n }\n T = sum32_3(this.h[1], C, Dh);\n this.h[1] = sum32_3(this.h[2], D, Eh);\n this.h[2] = sum32_3(this.h[3], E, Ah);\n this.h[3] = sum32_3(this.h[4], A, Bh);\n this.h[4] = sum32_3(this.h[0], B, Ch);\n this.h[0] = T;\n};\n\nRIPEMD160.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h, 'little');\n else\n return utils.split32(this.h, 'little');\n};\n\nfunction f(j, x, y, z) {\n if (j <= 15)\n return x ^ y ^ z;\n else if (j <= 31)\n return (x & y) | ((~x) & z);\n else if (j <= 47)\n return (x | (~y)) ^ z;\n else if (j <= 63)\n return (x & z) | (y & (~z));\n else\n return x ^ (y | (~z));\n}\n\nfunction K(j) {\n if (j <= 15)\n return 0x00000000;\n else if (j <= 31)\n return 0x5a827999;\n else if (j <= 47)\n return 0x6ed9eba1;\n else if (j <= 63)\n return 0x8f1bbcdc;\n else\n return 0xa953fd4e;\n}\n\nfunction Kh(j) {\n if (j <= 15)\n return 0x50a28be6;\n else if (j <= 31)\n return 0x5c4dd124;\n else if (j <= 47)\n return 0x6d703ef3;\n else if (j <= 63)\n return 0x7a6d76e9;\n else\n return 0x00000000;\n}\n\nvar r = [\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,\n 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,\n 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,\n 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13\n];\n\nvar rh = [\n 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,\n 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,\n 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,\n 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,\n 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11\n];\n\nvar s = [\n 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,\n 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,\n 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,\n 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,\n 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6\n];\n\nvar sh = [\n 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,\n 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,\n 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,\n 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,\n 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11\n];\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/hash.js/lib/hash/ripemd.js?"); - -/***/ }), - -/***/ "./node_modules/hash.js/lib/hash/sha.js": -/*!**********************************************!*\ - !*** ./node_modules/hash.js/lib/hash/sha.js ***! - \**********************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\n\nexports.sha1 = __webpack_require__(/*! ./sha/1 */ \"./node_modules/hash.js/lib/hash/sha/1.js\");\nexports.sha224 = __webpack_require__(/*! ./sha/224 */ \"./node_modules/hash.js/lib/hash/sha/224.js\");\nexports.sha256 = __webpack_require__(/*! ./sha/256 */ \"./node_modules/hash.js/lib/hash/sha/256.js\");\nexports.sha384 = __webpack_require__(/*! ./sha/384 */ \"./node_modules/hash.js/lib/hash/sha/384.js\");\nexports.sha512 = __webpack_require__(/*! ./sha/512 */ \"./node_modules/hash.js/lib/hash/sha/512.js\");\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/hash.js/lib/hash/sha.js?"); - -/***/ }), - -/***/ "./node_modules/hash.js/lib/hash/sha/1.js": -/*!************************************************!*\ - !*** ./node_modules/hash.js/lib/hash/sha/1.js ***! - \************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -eval("\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/hash.js/lib/hash/utils.js\");\nvar common = __webpack_require__(/*! ../common */ \"./node_modules/hash.js/lib/hash/common.js\");\nvar shaCommon = __webpack_require__(/*! ./common */ \"./node_modules/hash.js/lib/hash/sha/common.js\");\n\nvar rotl32 = utils.rotl32;\nvar sum32 = utils.sum32;\nvar sum32_5 = utils.sum32_5;\nvar ft_1 = shaCommon.ft_1;\nvar BlockHash = common.BlockHash;\n\nvar sha1_K = [\n 0x5A827999, 0x6ED9EBA1,\n 0x8F1BBCDC, 0xCA62C1D6\n];\n\nfunction SHA1() {\n if (!(this instanceof SHA1))\n return new SHA1();\n\n BlockHash.call(this);\n this.h = [\n 0x67452301, 0xefcdab89, 0x98badcfe,\n 0x10325476, 0xc3d2e1f0 ];\n this.W = new Array(80);\n}\n\nutils.inherits(SHA1, BlockHash);\nmodule.exports = SHA1;\n\nSHA1.blockSize = 512;\nSHA1.outSize = 160;\nSHA1.hmacStrength = 80;\nSHA1.padLength = 64;\n\nSHA1.prototype._update = function _update(msg, start) {\n var W = this.W;\n\n for (var i = 0; i < 16; i++)\n W[i] = msg[start + i];\n\n for(; i < W.length; i++)\n W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);\n\n var a = this.h[0];\n var b = this.h[1];\n var c = this.h[2];\n var d = this.h[3];\n var e = this.h[4];\n\n for (i = 0; i < W.length; i++) {\n var s = ~~(i / 20);\n var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);\n e = d;\n d = c;\n c = rotl32(b, 30);\n b = a;\n a = t;\n }\n\n this.h[0] = sum32(this.h[0], a);\n this.h[1] = sum32(this.h[1], b);\n this.h[2] = sum32(this.h[2], c);\n this.h[3] = sum32(this.h[3], d);\n this.h[4] = sum32(this.h[4], e);\n};\n\nSHA1.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h, 'big');\n else\n return utils.split32(this.h, 'big');\n};\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/hash.js/lib/hash/sha/1.js?"); - -/***/ }), - -/***/ "./node_modules/hash.js/lib/hash/sha/224.js": -/*!**************************************************!*\ - !*** ./node_modules/hash.js/lib/hash/sha/224.js ***! - \**************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -eval("\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/hash.js/lib/hash/utils.js\");\nvar SHA256 = __webpack_require__(/*! ./256 */ \"./node_modules/hash.js/lib/hash/sha/256.js\");\n\nfunction SHA224() {\n if (!(this instanceof SHA224))\n return new SHA224();\n\n SHA256.call(this);\n this.h = [\n 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,\n 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ];\n}\nutils.inherits(SHA224, SHA256);\nmodule.exports = SHA224;\n\nSHA224.blockSize = 512;\nSHA224.outSize = 224;\nSHA224.hmacStrength = 192;\nSHA224.padLength = 64;\n\nSHA224.prototype._digest = function digest(enc) {\n // Just truncate output\n if (enc === 'hex')\n return utils.toHex32(this.h.slice(0, 7), 'big');\n else\n return utils.split32(this.h.slice(0, 7), 'big');\n};\n\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/hash.js/lib/hash/sha/224.js?"); - -/***/ }), - -/***/ "./node_modules/hash.js/lib/hash/sha/256.js": -/*!**************************************************!*\ - !*** ./node_modules/hash.js/lib/hash/sha/256.js ***! - \**************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -eval("\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/hash.js/lib/hash/utils.js\");\nvar common = __webpack_require__(/*! ../common */ \"./node_modules/hash.js/lib/hash/common.js\");\nvar shaCommon = __webpack_require__(/*! ./common */ \"./node_modules/hash.js/lib/hash/sha/common.js\");\nvar assert = __webpack_require__(/*! minimalistic-assert */ \"./node_modules/minimalistic-assert/index.js\");\n\nvar sum32 = utils.sum32;\nvar sum32_4 = utils.sum32_4;\nvar sum32_5 = utils.sum32_5;\nvar ch32 = shaCommon.ch32;\nvar maj32 = shaCommon.maj32;\nvar s0_256 = shaCommon.s0_256;\nvar s1_256 = shaCommon.s1_256;\nvar g0_256 = shaCommon.g0_256;\nvar g1_256 = shaCommon.g1_256;\n\nvar BlockHash = common.BlockHash;\n\nvar sha256_K = [\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,\n 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,\n 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,\n 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,\n 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,\n 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,\n 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n];\n\nfunction SHA256() {\n if (!(this instanceof SHA256))\n return new SHA256();\n\n BlockHash.call(this);\n this.h = [\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,\n 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19\n ];\n this.k = sha256_K;\n this.W = new Array(64);\n}\nutils.inherits(SHA256, BlockHash);\nmodule.exports = SHA256;\n\nSHA256.blockSize = 512;\nSHA256.outSize = 256;\nSHA256.hmacStrength = 192;\nSHA256.padLength = 64;\n\nSHA256.prototype._update = function _update(msg, start) {\n var W = this.W;\n\n for (var i = 0; i < 16; i++)\n W[i] = msg[start + i];\n for (; i < W.length; i++)\n W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);\n\n var a = this.h[0];\n var b = this.h[1];\n var c = this.h[2];\n var d = this.h[3];\n var e = this.h[4];\n var f = this.h[5];\n var g = this.h[6];\n var h = this.h[7];\n\n assert(this.k.length === W.length);\n for (i = 0; i < W.length; i++) {\n var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);\n var T2 = sum32(s0_256(a), maj32(a, b, c));\n h = g;\n g = f;\n f = e;\n e = sum32(d, T1);\n d = c;\n c = b;\n b = a;\n a = sum32(T1, T2);\n }\n\n this.h[0] = sum32(this.h[0], a);\n this.h[1] = sum32(this.h[1], b);\n this.h[2] = sum32(this.h[2], c);\n this.h[3] = sum32(this.h[3], d);\n this.h[4] = sum32(this.h[4], e);\n this.h[5] = sum32(this.h[5], f);\n this.h[6] = sum32(this.h[6], g);\n this.h[7] = sum32(this.h[7], h);\n};\n\nSHA256.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h, 'big');\n else\n return utils.split32(this.h, 'big');\n};\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/hash.js/lib/hash/sha/256.js?"); - -/***/ }), - -/***/ "./node_modules/hash.js/lib/hash/sha/384.js": -/*!**************************************************!*\ - !*** ./node_modules/hash.js/lib/hash/sha/384.js ***! - \**************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -eval("\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/hash.js/lib/hash/utils.js\");\n\nvar SHA512 = __webpack_require__(/*! ./512 */ \"./node_modules/hash.js/lib/hash/sha/512.js\");\n\nfunction SHA384() {\n if (!(this instanceof SHA384))\n return new SHA384();\n\n SHA512.call(this);\n this.h = [\n 0xcbbb9d5d, 0xc1059ed8,\n 0x629a292a, 0x367cd507,\n 0x9159015a, 0x3070dd17,\n 0x152fecd8, 0xf70e5939,\n 0x67332667, 0xffc00b31,\n 0x8eb44a87, 0x68581511,\n 0xdb0c2e0d, 0x64f98fa7,\n 0x47b5481d, 0xbefa4fa4 ];\n}\nutils.inherits(SHA384, SHA512);\nmodule.exports = SHA384;\n\nSHA384.blockSize = 1024;\nSHA384.outSize = 384;\nSHA384.hmacStrength = 192;\nSHA384.padLength = 128;\n\nSHA384.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h.slice(0, 12), 'big');\n else\n return utils.split32(this.h.slice(0, 12), 'big');\n};\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/hash.js/lib/hash/sha/384.js?"); - -/***/ }), - -/***/ "./node_modules/hash.js/lib/hash/sha/512.js": -/*!**************************************************!*\ - !*** ./node_modules/hash.js/lib/hash/sha/512.js ***! - \**************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -eval("\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/hash.js/lib/hash/utils.js\");\nvar common = __webpack_require__(/*! ../common */ \"./node_modules/hash.js/lib/hash/common.js\");\nvar assert = __webpack_require__(/*! minimalistic-assert */ \"./node_modules/minimalistic-assert/index.js\");\n\nvar rotr64_hi = utils.rotr64_hi;\nvar rotr64_lo = utils.rotr64_lo;\nvar shr64_hi = utils.shr64_hi;\nvar shr64_lo = utils.shr64_lo;\nvar sum64 = utils.sum64;\nvar sum64_hi = utils.sum64_hi;\nvar sum64_lo = utils.sum64_lo;\nvar sum64_4_hi = utils.sum64_4_hi;\nvar sum64_4_lo = utils.sum64_4_lo;\nvar sum64_5_hi = utils.sum64_5_hi;\nvar sum64_5_lo = utils.sum64_5_lo;\n\nvar BlockHash = common.BlockHash;\n\nvar sha512_K = [\n 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\n 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\n 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\n 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\n 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\n 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\n 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\n 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\n 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\n 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\n 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\n 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\n 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\n 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\n 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\n 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\n 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\n 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\n 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\n 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\n 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\n 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\n 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\n 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\n 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\n 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\n 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\n 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\n 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\n 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\n 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\n 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\n 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\n 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\n 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\n 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\n 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\n 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\n 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\n 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\n];\n\nfunction SHA512() {\n if (!(this instanceof SHA512))\n return new SHA512();\n\n BlockHash.call(this);\n this.h = [\n 0x6a09e667, 0xf3bcc908,\n 0xbb67ae85, 0x84caa73b,\n 0x3c6ef372, 0xfe94f82b,\n 0xa54ff53a, 0x5f1d36f1,\n 0x510e527f, 0xade682d1,\n 0x9b05688c, 0x2b3e6c1f,\n 0x1f83d9ab, 0xfb41bd6b,\n 0x5be0cd19, 0x137e2179 ];\n this.k = sha512_K;\n this.W = new Array(160);\n}\nutils.inherits(SHA512, BlockHash);\nmodule.exports = SHA512;\n\nSHA512.blockSize = 1024;\nSHA512.outSize = 512;\nSHA512.hmacStrength = 192;\nSHA512.padLength = 128;\n\nSHA512.prototype._prepareBlock = function _prepareBlock(msg, start) {\n var W = this.W;\n\n // 32 x 32bit words\n for (var i = 0; i < 32; i++)\n W[i] = msg[start + i];\n for (; i < W.length; i += 2) {\n var c0_hi = g1_512_hi(W[i - 4], W[i - 3]); // i - 2\n var c0_lo = g1_512_lo(W[i - 4], W[i - 3]);\n var c1_hi = W[i - 14]; // i - 7\n var c1_lo = W[i - 13];\n var c2_hi = g0_512_hi(W[i - 30], W[i - 29]); // i - 15\n var c2_lo = g0_512_lo(W[i - 30], W[i - 29]);\n var c3_hi = W[i - 32]; // i - 16\n var c3_lo = W[i - 31];\n\n W[i] = sum64_4_hi(\n c0_hi, c0_lo,\n c1_hi, c1_lo,\n c2_hi, c2_lo,\n c3_hi, c3_lo);\n W[i + 1] = sum64_4_lo(\n c0_hi, c0_lo,\n c1_hi, c1_lo,\n c2_hi, c2_lo,\n c3_hi, c3_lo);\n }\n};\n\nSHA512.prototype._update = function _update(msg, start) {\n this._prepareBlock(msg, start);\n\n var W = this.W;\n\n var ah = this.h[0];\n var al = this.h[1];\n var bh = this.h[2];\n var bl = this.h[3];\n var ch = this.h[4];\n var cl = this.h[5];\n var dh = this.h[6];\n var dl = this.h[7];\n var eh = this.h[8];\n var el = this.h[9];\n var fh = this.h[10];\n var fl = this.h[11];\n var gh = this.h[12];\n var gl = this.h[13];\n var hh = this.h[14];\n var hl = this.h[15];\n\n assert(this.k.length === W.length);\n for (var i = 0; i < W.length; i += 2) {\n var c0_hi = hh;\n var c0_lo = hl;\n var c1_hi = s1_512_hi(eh, el);\n var c1_lo = s1_512_lo(eh, el);\n var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl);\n var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl);\n var c3_hi = this.k[i];\n var c3_lo = this.k[i + 1];\n var c4_hi = W[i];\n var c4_lo = W[i + 1];\n\n var T1_hi = sum64_5_hi(\n c0_hi, c0_lo,\n c1_hi, c1_lo,\n c2_hi, c2_lo,\n c3_hi, c3_lo,\n c4_hi, c4_lo);\n var T1_lo = sum64_5_lo(\n c0_hi, c0_lo,\n c1_hi, c1_lo,\n c2_hi, c2_lo,\n c3_hi, c3_lo,\n c4_hi, c4_lo);\n\n c0_hi = s0_512_hi(ah, al);\n c0_lo = s0_512_lo(ah, al);\n c1_hi = maj64_hi(ah, al, bh, bl, ch, cl);\n c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);\n\n var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo);\n var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);\n\n hh = gh;\n hl = gl;\n\n gh = fh;\n gl = fl;\n\n fh = eh;\n fl = el;\n\n eh = sum64_hi(dh, dl, T1_hi, T1_lo);\n el = sum64_lo(dl, dl, T1_hi, T1_lo);\n\n dh = ch;\n dl = cl;\n\n ch = bh;\n cl = bl;\n\n bh = ah;\n bl = al;\n\n ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo);\n al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);\n }\n\n sum64(this.h, 0, ah, al);\n sum64(this.h, 2, bh, bl);\n sum64(this.h, 4, ch, cl);\n sum64(this.h, 6, dh, dl);\n sum64(this.h, 8, eh, el);\n sum64(this.h, 10, fh, fl);\n sum64(this.h, 12, gh, gl);\n sum64(this.h, 14, hh, hl);\n};\n\nSHA512.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h, 'big');\n else\n return utils.split32(this.h, 'big');\n};\n\nfunction ch64_hi(xh, xl, yh, yl, zh) {\n var r = (xh & yh) ^ ((~xh) & zh);\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction ch64_lo(xh, xl, yh, yl, zh, zl) {\n var r = (xl & yl) ^ ((~xl) & zl);\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction maj64_hi(xh, xl, yh, yl, zh) {\n var r = (xh & yh) ^ (xh & zh) ^ (yh & zh);\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction maj64_lo(xh, xl, yh, yl, zh, zl) {\n var r = (xl & yl) ^ (xl & zl) ^ (yl & zl);\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction s0_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 28);\n var c1_hi = rotr64_hi(xl, xh, 2); // 34\n var c2_hi = rotr64_hi(xl, xh, 7); // 39\n\n var r = c0_hi ^ c1_hi ^ c2_hi;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction s0_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 28);\n var c1_lo = rotr64_lo(xl, xh, 2); // 34\n var c2_lo = rotr64_lo(xl, xh, 7); // 39\n\n var r = c0_lo ^ c1_lo ^ c2_lo;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction s1_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 14);\n var c1_hi = rotr64_hi(xh, xl, 18);\n var c2_hi = rotr64_hi(xl, xh, 9); // 41\n\n var r = c0_hi ^ c1_hi ^ c2_hi;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction s1_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 14);\n var c1_lo = rotr64_lo(xh, xl, 18);\n var c2_lo = rotr64_lo(xl, xh, 9); // 41\n\n var r = c0_lo ^ c1_lo ^ c2_lo;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction g0_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 1);\n var c1_hi = rotr64_hi(xh, xl, 8);\n var c2_hi = shr64_hi(xh, xl, 7);\n\n var r = c0_hi ^ c1_hi ^ c2_hi;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction g0_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 1);\n var c1_lo = rotr64_lo(xh, xl, 8);\n var c2_lo = shr64_lo(xh, xl, 7);\n\n var r = c0_lo ^ c1_lo ^ c2_lo;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction g1_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 19);\n var c1_hi = rotr64_hi(xl, xh, 29); // 61\n var c2_hi = shr64_hi(xh, xl, 6);\n\n var r = c0_hi ^ c1_hi ^ c2_hi;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction g1_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 19);\n var c1_lo = rotr64_lo(xl, xh, 29); // 61\n var c2_lo = shr64_lo(xh, xl, 6);\n\n var r = c0_lo ^ c1_lo ^ c2_lo;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/hash.js/lib/hash/sha/512.js?"); - -/***/ }), - -/***/ "./node_modules/hash.js/lib/hash/sha/common.js": -/*!*****************************************************!*\ - !*** ./node_modules/hash.js/lib/hash/sha/common.js ***! - \*****************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/hash.js/lib/hash/utils.js\");\nvar rotr32 = utils.rotr32;\n\nfunction ft_1(s, x, y, z) {\n if (s === 0)\n return ch32(x, y, z);\n if (s === 1 || s === 3)\n return p32(x, y, z);\n if (s === 2)\n return maj32(x, y, z);\n}\nexports.ft_1 = ft_1;\n\nfunction ch32(x, y, z) {\n return (x & y) ^ ((~x) & z);\n}\nexports.ch32 = ch32;\n\nfunction maj32(x, y, z) {\n return (x & y) ^ (x & z) ^ (y & z);\n}\nexports.maj32 = maj32;\n\nfunction p32(x, y, z) {\n return x ^ y ^ z;\n}\nexports.p32 = p32;\n\nfunction s0_256(x) {\n return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);\n}\nexports.s0_256 = s0_256;\n\nfunction s1_256(x) {\n return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);\n}\nexports.s1_256 = s1_256;\n\nfunction g0_256(x) {\n return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3);\n}\nexports.g0_256 = g0_256;\n\nfunction g1_256(x) {\n return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10);\n}\nexports.g1_256 = g1_256;\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/hash.js/lib/hash/sha/common.js?"); - -/***/ }), - -/***/ "./node_modules/hash.js/lib/hash/utils.js": -/*!************************************************!*\ - !*** ./node_modules/hash.js/lib/hash/utils.js ***! - \************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\n\nvar assert = __webpack_require__(/*! minimalistic-assert */ \"./node_modules/minimalistic-assert/index.js\");\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nexports.inherits = inherits;\n\nfunction isSurrogatePair(msg, i) {\n if ((msg.charCodeAt(i) & 0xFC00) !== 0xD800) {\n return false;\n }\n if (i < 0 || i + 1 >= msg.length) {\n return false;\n }\n return (msg.charCodeAt(i + 1) & 0xFC00) === 0xDC00;\n}\n\nfunction toArray(msg, enc) {\n if (Array.isArray(msg))\n return msg.slice();\n if (!msg)\n return [];\n var res = [];\n if (typeof msg === 'string') {\n if (!enc) {\n // Inspired by stringToUtf8ByteArray() in closure-library by Google\n // https://github.com/google/closure-library/blob/8598d87242af59aac233270742c8984e2b2bdbe0/closure/goog/crypt/crypt.js#L117-L143\n // Apache License 2.0\n // https://github.com/google/closure-library/blob/master/LICENSE\n var p = 0;\n for (var i = 0; i < msg.length; i++) {\n var c = msg.charCodeAt(i);\n if (c < 128) {\n res[p++] = c;\n } else if (c < 2048) {\n res[p++] = (c >> 6) | 192;\n res[p++] = (c & 63) | 128;\n } else if (isSurrogatePair(msg, i)) {\n c = 0x10000 + ((c & 0x03FF) << 10) + (msg.charCodeAt(++i) & 0x03FF);\n res[p++] = (c >> 18) | 240;\n res[p++] = ((c >> 12) & 63) | 128;\n res[p++] = ((c >> 6) & 63) | 128;\n res[p++] = (c & 63) | 128;\n } else {\n res[p++] = (c >> 12) | 224;\n res[p++] = ((c >> 6) & 63) | 128;\n res[p++] = (c & 63) | 128;\n }\n }\n } else if (enc === 'hex') {\n msg = msg.replace(/[^a-z0-9]+/ig, '');\n if (msg.length % 2 !== 0)\n msg = '0' + msg;\n for (i = 0; i < msg.length; i += 2)\n res.push(parseInt(msg[i] + msg[i + 1], 16));\n }\n } else {\n for (i = 0; i < msg.length; i++)\n res[i] = msg[i] | 0;\n }\n return res;\n}\nexports.toArray = toArray;\n\nfunction toHex(msg) {\n var res = '';\n for (var i = 0; i < msg.length; i++)\n res += zero2(msg[i].toString(16));\n return res;\n}\nexports.toHex = toHex;\n\nfunction htonl(w) {\n var res = (w >>> 24) |\n ((w >>> 8) & 0xff00) |\n ((w << 8) & 0xff0000) |\n ((w & 0xff) << 24);\n return res >>> 0;\n}\nexports.htonl = htonl;\n\nfunction toHex32(msg, endian) {\n var res = '';\n for (var i = 0; i < msg.length; i++) {\n var w = msg[i];\n if (endian === 'little')\n w = htonl(w);\n res += zero8(w.toString(16));\n }\n return res;\n}\nexports.toHex32 = toHex32;\n\nfunction zero2(word) {\n if (word.length === 1)\n return '0' + word;\n else\n return word;\n}\nexports.zero2 = zero2;\n\nfunction zero8(word) {\n if (word.length === 7)\n return '0' + word;\n else if (word.length === 6)\n return '00' + word;\n else if (word.length === 5)\n return '000' + word;\n else if (word.length === 4)\n return '0000' + word;\n else if (word.length === 3)\n return '00000' + word;\n else if (word.length === 2)\n return '000000' + word;\n else if (word.length === 1)\n return '0000000' + word;\n else\n return word;\n}\nexports.zero8 = zero8;\n\nfunction join32(msg, start, end, endian) {\n var len = end - start;\n assert(len % 4 === 0);\n var res = new Array(len / 4);\n for (var i = 0, k = start; i < res.length; i++, k += 4) {\n var w;\n if (endian === 'big')\n w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3];\n else\n w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k];\n res[i] = w >>> 0;\n }\n return res;\n}\nexports.join32 = join32;\n\nfunction split32(msg, endian) {\n var res = new Array(msg.length * 4);\n for (var i = 0, k = 0; i < msg.length; i++, k += 4) {\n var m = msg[i];\n if (endian === 'big') {\n res[k] = m >>> 24;\n res[k + 1] = (m >>> 16) & 0xff;\n res[k + 2] = (m >>> 8) & 0xff;\n res[k + 3] = m & 0xff;\n } else {\n res[k + 3] = m >>> 24;\n res[k + 2] = (m >>> 16) & 0xff;\n res[k + 1] = (m >>> 8) & 0xff;\n res[k] = m & 0xff;\n }\n }\n return res;\n}\nexports.split32 = split32;\n\nfunction rotr32(w, b) {\n return (w >>> b) | (w << (32 - b));\n}\nexports.rotr32 = rotr32;\n\nfunction rotl32(w, b) {\n return (w << b) | (w >>> (32 - b));\n}\nexports.rotl32 = rotl32;\n\nfunction sum32(a, b) {\n return (a + b) >>> 0;\n}\nexports.sum32 = sum32;\n\nfunction sum32_3(a, b, c) {\n return (a + b + c) >>> 0;\n}\nexports.sum32_3 = sum32_3;\n\nfunction sum32_4(a, b, c, d) {\n return (a + b + c + d) >>> 0;\n}\nexports.sum32_4 = sum32_4;\n\nfunction sum32_5(a, b, c, d, e) {\n return (a + b + c + d + e) >>> 0;\n}\nexports.sum32_5 = sum32_5;\n\nfunction sum64(buf, pos, ah, al) {\n var bh = buf[pos];\n var bl = buf[pos + 1];\n\n var lo = (al + bl) >>> 0;\n var hi = (lo < al ? 1 : 0) + ah + bh;\n buf[pos] = hi >>> 0;\n buf[pos + 1] = lo;\n}\nexports.sum64 = sum64;\n\nfunction sum64_hi(ah, al, bh, bl) {\n var lo = (al + bl) >>> 0;\n var hi = (lo < al ? 1 : 0) + ah + bh;\n return hi >>> 0;\n}\nexports.sum64_hi = sum64_hi;\n\nfunction sum64_lo(ah, al, bh, bl) {\n var lo = al + bl;\n return lo >>> 0;\n}\nexports.sum64_lo = sum64_lo;\n\nfunction sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {\n var carry = 0;\n var lo = al;\n lo = (lo + bl) >>> 0;\n carry += lo < al ? 1 : 0;\n lo = (lo + cl) >>> 0;\n carry += lo < cl ? 1 : 0;\n lo = (lo + dl) >>> 0;\n carry += lo < dl ? 1 : 0;\n\n var hi = ah + bh + ch + dh + carry;\n return hi >>> 0;\n}\nexports.sum64_4_hi = sum64_4_hi;\n\nfunction sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {\n var lo = al + bl + cl + dl;\n return lo >>> 0;\n}\nexports.sum64_4_lo = sum64_4_lo;\n\nfunction sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n var carry = 0;\n var lo = al;\n lo = (lo + bl) >>> 0;\n carry += lo < al ? 1 : 0;\n lo = (lo + cl) >>> 0;\n carry += lo < cl ? 1 : 0;\n lo = (lo + dl) >>> 0;\n carry += lo < dl ? 1 : 0;\n lo = (lo + el) >>> 0;\n carry += lo < el ? 1 : 0;\n\n var hi = ah + bh + ch + dh + eh + carry;\n return hi >>> 0;\n}\nexports.sum64_5_hi = sum64_5_hi;\n\nfunction sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n var lo = al + bl + cl + dl + el;\n\n return lo >>> 0;\n}\nexports.sum64_5_lo = sum64_5_lo;\n\nfunction rotr64_hi(ah, al, num) {\n var r = (al << (32 - num)) | (ah >>> num);\n return r >>> 0;\n}\nexports.rotr64_hi = rotr64_hi;\n\nfunction rotr64_lo(ah, al, num) {\n var r = (ah << (32 - num)) | (al >>> num);\n return r >>> 0;\n}\nexports.rotr64_lo = rotr64_lo;\n\nfunction shr64_hi(ah, al, num) {\n return ah >>> num;\n}\nexports.shr64_hi = shr64_hi;\n\nfunction shr64_lo(ah, al, num) {\n var r = (ah << (32 - num)) | (al >>> num);\n return r >>> 0;\n}\nexports.shr64_lo = shr64_lo;\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/hash.js/lib/hash/utils.js?"); - -/***/ }), - -/***/ "./node_modules/inherits/inherits_browser.js": -/*!***************************************************!*\ - !*** ./node_modules/inherits/inherits_browser.js ***! - \***************************************************/ -/***/ ((module) => { - -eval("if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/inherits/inherits_browser.js?"); - -/***/ }), - -/***/ "./node_modules/isomorphic-unfetch/browser.js": -/*!****************************************************!*\ - !*** ./node_modules/isomorphic-unfetch/browser.js ***! - \****************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -eval("module.exports = self.fetch || (self.fetch = (__webpack_require__(/*! unfetch */ \"./node_modules/unfetch/dist/unfetch.module.js\")[\"default\"]) || __webpack_require__(/*! unfetch */ \"./node_modules/unfetch/dist/unfetch.module.js\"));\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/isomorphic-unfetch/browser.js?"); - -/***/ }), - -/***/ "./node_modules/js-sha3/src/sha3.js": -/*!******************************************!*\ - !*** ./node_modules/js-sha3/src/sha3.js ***! - \******************************************/ -/***/ ((module, exports, __webpack_require__) => { - -eval("var __WEBPACK_AMD_DEFINE_RESULT__;/**\n * [js-sha3]{@link https://github.com/emn178/js-sha3}\n *\n * @version 0.8.0\n * @author Chen, Yi-Cyuan [emn178@gmail.com]\n * @copyright Chen, Yi-Cyuan 2015-2018\n * @license MIT\n */\n/*jslint bitwise: true */\n(function () {\n 'use strict';\n\n var INPUT_ERROR = 'input is invalid type';\n var FINALIZE_ERROR = 'finalize already called';\n var WINDOW = typeof window === 'object';\n var root = WINDOW ? window : {};\n if (root.JS_SHA3_NO_WINDOW) {\n WINDOW = false;\n }\n var WEB_WORKER = !WINDOW && typeof self === 'object';\n var NODE_JS = !root.JS_SHA3_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;\n if (NODE_JS) {\n root = __webpack_require__.g;\n } else if (WEB_WORKER) {\n root = self;\n }\n var COMMON_JS = !root.JS_SHA3_NO_COMMON_JS && \"object\" === 'object' && module.exports;\n var AMD = true && __webpack_require__.amdO;\n var ARRAY_BUFFER = !root.JS_SHA3_NO_ARRAY_BUFFER && typeof ArrayBuffer !== 'undefined';\n var HEX_CHARS = '0123456789abcdef'.split('');\n var SHAKE_PADDING = [31, 7936, 2031616, 520093696];\n var CSHAKE_PADDING = [4, 1024, 262144, 67108864];\n var KECCAK_PADDING = [1, 256, 65536, 16777216];\n var PADDING = [6, 1536, 393216, 100663296];\n var SHIFT = [0, 8, 16, 24];\n var RC = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649,\n 0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0,\n 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771,\n 2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648,\n 2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648];\n var BITS = [224, 256, 384, 512];\n var SHAKE_BITS = [128, 256];\n var OUTPUT_TYPES = ['hex', 'buffer', 'arrayBuffer', 'array', 'digest'];\n var CSHAKE_BYTEPAD = {\n '128': 168,\n '256': 136\n };\n\n if (root.JS_SHA3_NO_NODE_JS || !Array.isArray) {\n Array.isArray = function (obj) {\n return Object.prototype.toString.call(obj) === '[object Array]';\n };\n }\n\n if (ARRAY_BUFFER && (root.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView)) {\n ArrayBuffer.isView = function (obj) {\n return typeof obj === 'object' && obj.buffer && obj.buffer.constructor === ArrayBuffer;\n };\n }\n\n var createOutputMethod = function (bits, padding, outputType) {\n return function (message) {\n return new Keccak(bits, padding, bits).update(message)[outputType]();\n };\n };\n\n var createShakeOutputMethod = function (bits, padding, outputType) {\n return function (message, outputBits) {\n return new Keccak(bits, padding, outputBits).update(message)[outputType]();\n };\n };\n\n var createCshakeOutputMethod = function (bits, padding, outputType) {\n return function (message, outputBits, n, s) {\n return methods['cshake' + bits].update(message, outputBits, n, s)[outputType]();\n };\n };\n\n var createKmacOutputMethod = function (bits, padding, outputType) {\n return function (key, message, outputBits, s) {\n return methods['kmac' + bits].update(key, message, outputBits, s)[outputType]();\n };\n };\n\n var createOutputMethods = function (method, createMethod, bits, padding) {\n for (var i = 0; i < OUTPUT_TYPES.length; ++i) {\n var type = OUTPUT_TYPES[i];\n method[type] = createMethod(bits, padding, type);\n }\n return method;\n };\n\n var createMethod = function (bits, padding) {\n var method = createOutputMethod(bits, padding, 'hex');\n method.create = function () {\n return new Keccak(bits, padding, bits);\n };\n method.update = function (message) {\n return method.create().update(message);\n };\n return createOutputMethods(method, createOutputMethod, bits, padding);\n };\n\n var createShakeMethod = function (bits, padding) {\n var method = createShakeOutputMethod(bits, padding, 'hex');\n method.create = function (outputBits) {\n return new Keccak(bits, padding, outputBits);\n };\n method.update = function (message, outputBits) {\n return method.create(outputBits).update(message);\n };\n return createOutputMethods(method, createShakeOutputMethod, bits, padding);\n };\n\n var createCshakeMethod = function (bits, padding) {\n var w = CSHAKE_BYTEPAD[bits];\n var method = createCshakeOutputMethod(bits, padding, 'hex');\n method.create = function (outputBits, n, s) {\n if (!n && !s) {\n return methods['shake' + bits].create(outputBits);\n } else {\n return new Keccak(bits, padding, outputBits).bytepad([n, s], w);\n }\n };\n method.update = function (message, outputBits, n, s) {\n return method.create(outputBits, n, s).update(message);\n };\n return createOutputMethods(method, createCshakeOutputMethod, bits, padding);\n };\n\n var createKmacMethod = function (bits, padding) {\n var w = CSHAKE_BYTEPAD[bits];\n var method = createKmacOutputMethod(bits, padding, 'hex');\n method.create = function (key, outputBits, s) {\n return new Kmac(bits, padding, outputBits).bytepad(['KMAC', s], w).bytepad([key], w);\n };\n method.update = function (key, message, outputBits, s) {\n return method.create(key, outputBits, s).update(message);\n };\n return createOutputMethods(method, createKmacOutputMethod, bits, padding);\n };\n\n var algorithms = [\n { name: 'keccak', padding: KECCAK_PADDING, bits: BITS, createMethod: createMethod },\n { name: 'sha3', padding: PADDING, bits: BITS, createMethod: createMethod },\n { name: 'shake', padding: SHAKE_PADDING, bits: SHAKE_BITS, createMethod: createShakeMethod },\n { name: 'cshake', padding: CSHAKE_PADDING, bits: SHAKE_BITS, createMethod: createCshakeMethod },\n { name: 'kmac', padding: CSHAKE_PADDING, bits: SHAKE_BITS, createMethod: createKmacMethod }\n ];\n\n var methods = {}, methodNames = [];\n\n for (var i = 0; i < algorithms.length; ++i) {\n var algorithm = algorithms[i];\n var bits = algorithm.bits;\n for (var j = 0; j < bits.length; ++j) {\n var methodName = algorithm.name + '_' + bits[j];\n methodNames.push(methodName);\n methods[methodName] = algorithm.createMethod(bits[j], algorithm.padding);\n if (algorithm.name !== 'sha3') {\n var newMethodName = algorithm.name + bits[j];\n methodNames.push(newMethodName);\n methods[newMethodName] = methods[methodName];\n }\n }\n }\n\n function Keccak(bits, padding, outputBits) {\n this.blocks = [];\n this.s = [];\n this.padding = padding;\n this.outputBits = outputBits;\n this.reset = true;\n this.finalized = false;\n this.block = 0;\n this.start = 0;\n this.blockCount = (1600 - (bits << 1)) >> 5;\n this.byteCount = this.blockCount << 2;\n this.outputBlocks = outputBits >> 5;\n this.extraBytes = (outputBits & 31) >> 3;\n\n for (var i = 0; i < 50; ++i) {\n this.s[i] = 0;\n }\n }\n\n Keccak.prototype.update = function (message) {\n if (this.finalized) {\n throw new Error(FINALIZE_ERROR);\n }\n var notString, type = typeof message;\n if (type !== 'string') {\n if (type === 'object') {\n if (message === null) {\n throw new Error(INPUT_ERROR);\n } else if (ARRAY_BUFFER && message.constructor === ArrayBuffer) {\n message = new Uint8Array(message);\n } else if (!Array.isArray(message)) {\n if (!ARRAY_BUFFER || !ArrayBuffer.isView(message)) {\n throw new Error(INPUT_ERROR);\n }\n }\n } else {\n throw new Error(INPUT_ERROR);\n }\n notString = true;\n }\n var blocks = this.blocks, byteCount = this.byteCount, length = message.length,\n blockCount = this.blockCount, index = 0, s = this.s, i, code;\n\n while (index < length) {\n if (this.reset) {\n this.reset = false;\n blocks[0] = this.block;\n for (i = 1; i < blockCount + 1; ++i) {\n blocks[i] = 0;\n }\n }\n if (notString) {\n for (i = this.start; index < length && i < byteCount; ++index) {\n blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];\n }\n } else {\n for (i = this.start; index < length && i < byteCount; ++index) {\n code = message.charCodeAt(index);\n if (code < 0x80) {\n blocks[i >> 2] |= code << SHIFT[i++ & 3];\n } else if (code < 0x800) {\n blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n } else if (code < 0xd800 || code >= 0xe000) {\n blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n } else {\n code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));\n blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n }\n }\n }\n this.lastByteIndex = i;\n if (i >= byteCount) {\n this.start = i - byteCount;\n this.block = blocks[blockCount];\n for (i = 0; i < blockCount; ++i) {\n s[i] ^= blocks[i];\n }\n f(s);\n this.reset = true;\n } else {\n this.start = i;\n }\n }\n return this;\n };\n\n Keccak.prototype.encode = function (x, right) {\n var o = x & 255, n = 1;\n var bytes = [o];\n x = x >> 8;\n o = x & 255;\n while (o > 0) {\n bytes.unshift(o);\n x = x >> 8;\n o = x & 255;\n ++n;\n }\n if (right) {\n bytes.push(n);\n } else {\n bytes.unshift(n);\n }\n this.update(bytes);\n return bytes.length;\n };\n\n Keccak.prototype.encodeString = function (str) {\n var notString, type = typeof str;\n if (type !== 'string') {\n if (type === 'object') {\n if (str === null) {\n throw new Error(INPUT_ERROR);\n } else if (ARRAY_BUFFER && str.constructor === ArrayBuffer) {\n str = new Uint8Array(str);\n } else if (!Array.isArray(str)) {\n if (!ARRAY_BUFFER || !ArrayBuffer.isView(str)) {\n throw new Error(INPUT_ERROR);\n }\n }\n } else {\n throw new Error(INPUT_ERROR);\n }\n notString = true;\n }\n var bytes = 0, length = str.length;\n if (notString) {\n bytes = length;\n } else {\n for (var i = 0; i < str.length; ++i) {\n var code = str.charCodeAt(i);\n if (code < 0x80) {\n bytes += 1;\n } else if (code < 0x800) {\n bytes += 2;\n } else if (code < 0xd800 || code >= 0xe000) {\n bytes += 3;\n } else {\n code = 0x10000 + (((code & 0x3ff) << 10) | (str.charCodeAt(++i) & 0x3ff));\n bytes += 4;\n }\n }\n }\n bytes += this.encode(bytes * 8);\n this.update(str);\n return bytes;\n };\n\n Keccak.prototype.bytepad = function (strs, w) {\n var bytes = this.encode(w);\n for (var i = 0; i < strs.length; ++i) {\n bytes += this.encodeString(strs[i]);\n }\n var paddingBytes = w - bytes % w;\n var zeros = [];\n zeros.length = paddingBytes;\n this.update(zeros);\n return this;\n };\n\n Keccak.prototype.finalize = function () {\n if (this.finalized) {\n return;\n }\n this.finalized = true;\n var blocks = this.blocks, i = this.lastByteIndex, blockCount = this.blockCount, s = this.s;\n blocks[i >> 2] |= this.padding[i & 3];\n if (this.lastByteIndex === this.byteCount) {\n blocks[0] = blocks[blockCount];\n for (i = 1; i < blockCount + 1; ++i) {\n blocks[i] = 0;\n }\n }\n blocks[blockCount - 1] |= 0x80000000;\n for (i = 0; i < blockCount; ++i) {\n s[i] ^= blocks[i];\n }\n f(s);\n };\n\n Keccak.prototype.toString = Keccak.prototype.hex = function () {\n this.finalize();\n\n var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,\n extraBytes = this.extraBytes, i = 0, j = 0;\n var hex = '', block;\n while (j < outputBlocks) {\n for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\n block = s[i];\n hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F] +\n HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F] +\n HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F] +\n HEX_CHARS[(block >> 28) & 0x0F] + HEX_CHARS[(block >> 24) & 0x0F];\n }\n if (j % blockCount === 0) {\n f(s);\n i = 0;\n }\n }\n if (extraBytes) {\n block = s[i];\n hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F];\n if (extraBytes > 1) {\n hex += HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F];\n }\n if (extraBytes > 2) {\n hex += HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F];\n }\n }\n return hex;\n };\n\n Keccak.prototype.arrayBuffer = function () {\n this.finalize();\n\n var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,\n extraBytes = this.extraBytes, i = 0, j = 0;\n var bytes = this.outputBits >> 3;\n var buffer;\n if (extraBytes) {\n buffer = new ArrayBuffer((outputBlocks + 1) << 2);\n } else {\n buffer = new ArrayBuffer(bytes);\n }\n var array = new Uint32Array(buffer);\n while (j < outputBlocks) {\n for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\n array[j] = s[i];\n }\n if (j % blockCount === 0) {\n f(s);\n }\n }\n if (extraBytes) {\n array[i] = s[i];\n buffer = buffer.slice(0, bytes);\n }\n return buffer;\n };\n\n Keccak.prototype.buffer = Keccak.prototype.arrayBuffer;\n\n Keccak.prototype.digest = Keccak.prototype.array = function () {\n this.finalize();\n\n var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,\n extraBytes = this.extraBytes, i = 0, j = 0;\n var array = [], offset, block;\n while (j < outputBlocks) {\n for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\n offset = j << 2;\n block = s[i];\n array[offset] = block & 0xFF;\n array[offset + 1] = (block >> 8) & 0xFF;\n array[offset + 2] = (block >> 16) & 0xFF;\n array[offset + 3] = (block >> 24) & 0xFF;\n }\n if (j % blockCount === 0) {\n f(s);\n }\n }\n if (extraBytes) {\n offset = j << 2;\n block = s[i];\n array[offset] = block & 0xFF;\n if (extraBytes > 1) {\n array[offset + 1] = (block >> 8) & 0xFF;\n }\n if (extraBytes > 2) {\n array[offset + 2] = (block >> 16) & 0xFF;\n }\n }\n return array;\n };\n\n function Kmac(bits, padding, outputBits) {\n Keccak.call(this, bits, padding, outputBits);\n }\n\n Kmac.prototype = new Keccak();\n\n Kmac.prototype.finalize = function () {\n this.encode(this.outputBits, true);\n return Keccak.prototype.finalize.call(this);\n };\n\n var f = function (s) {\n var h, l, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9,\n b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17,\n b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33,\n b34, b35, b36, b37, b38, b39, b40, b41, b42, b43, b44, b45, b46, b47, b48, b49;\n for (n = 0; n < 48; n += 2) {\n c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40];\n c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41];\n c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42];\n c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43];\n c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44];\n c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45];\n c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46];\n c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47];\n c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48];\n c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49];\n\n h = c8 ^ ((c2 << 1) | (c3 >>> 31));\n l = c9 ^ ((c3 << 1) | (c2 >>> 31));\n s[0] ^= h;\n s[1] ^= l;\n s[10] ^= h;\n s[11] ^= l;\n s[20] ^= h;\n s[21] ^= l;\n s[30] ^= h;\n s[31] ^= l;\n s[40] ^= h;\n s[41] ^= l;\n h = c0 ^ ((c4 << 1) | (c5 >>> 31));\n l = c1 ^ ((c5 << 1) | (c4 >>> 31));\n s[2] ^= h;\n s[3] ^= l;\n s[12] ^= h;\n s[13] ^= l;\n s[22] ^= h;\n s[23] ^= l;\n s[32] ^= h;\n s[33] ^= l;\n s[42] ^= h;\n s[43] ^= l;\n h = c2 ^ ((c6 << 1) | (c7 >>> 31));\n l = c3 ^ ((c7 << 1) | (c6 >>> 31));\n s[4] ^= h;\n s[5] ^= l;\n s[14] ^= h;\n s[15] ^= l;\n s[24] ^= h;\n s[25] ^= l;\n s[34] ^= h;\n s[35] ^= l;\n s[44] ^= h;\n s[45] ^= l;\n h = c4 ^ ((c8 << 1) | (c9 >>> 31));\n l = c5 ^ ((c9 << 1) | (c8 >>> 31));\n s[6] ^= h;\n s[7] ^= l;\n s[16] ^= h;\n s[17] ^= l;\n s[26] ^= h;\n s[27] ^= l;\n s[36] ^= h;\n s[37] ^= l;\n s[46] ^= h;\n s[47] ^= l;\n h = c6 ^ ((c0 << 1) | (c1 >>> 31));\n l = c7 ^ ((c1 << 1) | (c0 >>> 31));\n s[8] ^= h;\n s[9] ^= l;\n s[18] ^= h;\n s[19] ^= l;\n s[28] ^= h;\n s[29] ^= l;\n s[38] ^= h;\n s[39] ^= l;\n s[48] ^= h;\n s[49] ^= l;\n\n b0 = s[0];\n b1 = s[1];\n b32 = (s[11] << 4) | (s[10] >>> 28);\n b33 = (s[10] << 4) | (s[11] >>> 28);\n b14 = (s[20] << 3) | (s[21] >>> 29);\n b15 = (s[21] << 3) | (s[20] >>> 29);\n b46 = (s[31] << 9) | (s[30] >>> 23);\n b47 = (s[30] << 9) | (s[31] >>> 23);\n b28 = (s[40] << 18) | (s[41] >>> 14);\n b29 = (s[41] << 18) | (s[40] >>> 14);\n b20 = (s[2] << 1) | (s[3] >>> 31);\n b21 = (s[3] << 1) | (s[2] >>> 31);\n b2 = (s[13] << 12) | (s[12] >>> 20);\n b3 = (s[12] << 12) | (s[13] >>> 20);\n b34 = (s[22] << 10) | (s[23] >>> 22);\n b35 = (s[23] << 10) | (s[22] >>> 22);\n b16 = (s[33] << 13) | (s[32] >>> 19);\n b17 = (s[32] << 13) | (s[33] >>> 19);\n b48 = (s[42] << 2) | (s[43] >>> 30);\n b49 = (s[43] << 2) | (s[42] >>> 30);\n b40 = (s[5] << 30) | (s[4] >>> 2);\n b41 = (s[4] << 30) | (s[5] >>> 2);\n b22 = (s[14] << 6) | (s[15] >>> 26);\n b23 = (s[15] << 6) | (s[14] >>> 26);\n b4 = (s[25] << 11) | (s[24] >>> 21);\n b5 = (s[24] << 11) | (s[25] >>> 21);\n b36 = (s[34] << 15) | (s[35] >>> 17);\n b37 = (s[35] << 15) | (s[34] >>> 17);\n b18 = (s[45] << 29) | (s[44] >>> 3);\n b19 = (s[44] << 29) | (s[45] >>> 3);\n b10 = (s[6] << 28) | (s[7] >>> 4);\n b11 = (s[7] << 28) | (s[6] >>> 4);\n b42 = (s[17] << 23) | (s[16] >>> 9);\n b43 = (s[16] << 23) | (s[17] >>> 9);\n b24 = (s[26] << 25) | (s[27] >>> 7);\n b25 = (s[27] << 25) | (s[26] >>> 7);\n b6 = (s[36] << 21) | (s[37] >>> 11);\n b7 = (s[37] << 21) | (s[36] >>> 11);\n b38 = (s[47] << 24) | (s[46] >>> 8);\n b39 = (s[46] << 24) | (s[47] >>> 8);\n b30 = (s[8] << 27) | (s[9] >>> 5);\n b31 = (s[9] << 27) | (s[8] >>> 5);\n b12 = (s[18] << 20) | (s[19] >>> 12);\n b13 = (s[19] << 20) | (s[18] >>> 12);\n b44 = (s[29] << 7) | (s[28] >>> 25);\n b45 = (s[28] << 7) | (s[29] >>> 25);\n b26 = (s[38] << 8) | (s[39] >>> 24);\n b27 = (s[39] << 8) | (s[38] >>> 24);\n b8 = (s[48] << 14) | (s[49] >>> 18);\n b9 = (s[49] << 14) | (s[48] >>> 18);\n\n s[0] = b0 ^ (~b2 & b4);\n s[1] = b1 ^ (~b3 & b5);\n s[10] = b10 ^ (~b12 & b14);\n s[11] = b11 ^ (~b13 & b15);\n s[20] = b20 ^ (~b22 & b24);\n s[21] = b21 ^ (~b23 & b25);\n s[30] = b30 ^ (~b32 & b34);\n s[31] = b31 ^ (~b33 & b35);\n s[40] = b40 ^ (~b42 & b44);\n s[41] = b41 ^ (~b43 & b45);\n s[2] = b2 ^ (~b4 & b6);\n s[3] = b3 ^ (~b5 & b7);\n s[12] = b12 ^ (~b14 & b16);\n s[13] = b13 ^ (~b15 & b17);\n s[22] = b22 ^ (~b24 & b26);\n s[23] = b23 ^ (~b25 & b27);\n s[32] = b32 ^ (~b34 & b36);\n s[33] = b33 ^ (~b35 & b37);\n s[42] = b42 ^ (~b44 & b46);\n s[43] = b43 ^ (~b45 & b47);\n s[4] = b4 ^ (~b6 & b8);\n s[5] = b5 ^ (~b7 & b9);\n s[14] = b14 ^ (~b16 & b18);\n s[15] = b15 ^ (~b17 & b19);\n s[24] = b24 ^ (~b26 & b28);\n s[25] = b25 ^ (~b27 & b29);\n s[34] = b34 ^ (~b36 & b38);\n s[35] = b35 ^ (~b37 & b39);\n s[44] = b44 ^ (~b46 & b48);\n s[45] = b45 ^ (~b47 & b49);\n s[6] = b6 ^ (~b8 & b0);\n s[7] = b7 ^ (~b9 & b1);\n s[16] = b16 ^ (~b18 & b10);\n s[17] = b17 ^ (~b19 & b11);\n s[26] = b26 ^ (~b28 & b20);\n s[27] = b27 ^ (~b29 & b21);\n s[36] = b36 ^ (~b38 & b30);\n s[37] = b37 ^ (~b39 & b31);\n s[46] = b46 ^ (~b48 & b40);\n s[47] = b47 ^ (~b49 & b41);\n s[8] = b8 ^ (~b0 & b2);\n s[9] = b9 ^ (~b1 & b3);\n s[18] = b18 ^ (~b10 & b12);\n s[19] = b19 ^ (~b11 & b13);\n s[28] = b28 ^ (~b20 & b22);\n s[29] = b29 ^ (~b21 & b23);\n s[38] = b38 ^ (~b30 & b32);\n s[39] = b39 ^ (~b31 & b33);\n s[48] = b48 ^ (~b40 & b42);\n s[49] = b49 ^ (~b41 & b43);\n\n s[0] ^= RC[n];\n s[1] ^= RC[n + 1];\n }\n };\n\n if (COMMON_JS) {\n module.exports = methods;\n } else {\n for (i = 0; i < methodNames.length; ++i) {\n root[methodNames[i]] = methods[methodNames[i]];\n }\n if (AMD) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n return methods;\n }).call(exports, __webpack_require__, exports, module),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n }\n }\n})();\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/js-sha3/src/sha3.js?"); - -/***/ }), - -/***/ "./node_modules/lodash.isequal/index.js": -/*!**********************************************!*\ - !*** ./node_modules/lodash.isequal/index.js ***! - \**********************************************/ -/***/ ((module, exports, __webpack_require__) => { - -eval("/* module decorator */ module = __webpack_require__.nmd(module);\n/**\n * Lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright JS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = true && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && \"object\" == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = isEqual;\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/lodash.isequal/index.js?"); - -/***/ }), - -/***/ "./node_modules/minimalistic-assert/index.js": -/*!***************************************************!*\ - !*** ./node_modules/minimalistic-assert/index.js ***! - \***************************************************/ -/***/ ((module) => { - -eval("module.exports = assert;\n\nfunction assert(val, msg) {\n if (!val)\n throw new Error(msg || 'Assertion failed');\n}\n\nassert.equal = function assertEqual(l, r, msg) {\n if (l != r)\n throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));\n};\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/minimalistic-assert/index.js?"); - -/***/ }), - -/***/ "./node_modules/query-string/index.js": -/*!********************************************!*\ - !*** ./node_modules/query-string/index.js ***! - \********************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -eval("\nconst strictUriEncode = __webpack_require__(/*! strict-uri-encode */ \"./node_modules/strict-uri-encode/index.js\");\nconst decodeComponent = __webpack_require__(/*! decode-uri-component */ \"./node_modules/decode-uri-component/index.js\");\nconst splitOnFirst = __webpack_require__(/*! split-on-first */ \"./node_modules/split-on-first/index.js\");\nconst filterObject = __webpack_require__(/*! filter-obj */ \"./node_modules/filter-obj/index.js\");\n\nconst isNullOrUndefined = value => value === null || value === undefined;\n\nconst encodeFragmentIdentifier = Symbol('encodeFragmentIdentifier');\n\nfunction encoderForArrayFormat(options) {\n\tswitch (options.arrayFormat) {\n\t\tcase 'index':\n\t\t\treturn key => (result, value) => {\n\t\t\t\tconst index = result.length;\n\n\t\t\t\tif (\n\t\t\t\t\tvalue === undefined ||\n\t\t\t\t\t(options.skipNull && value === null) ||\n\t\t\t\t\t(options.skipEmptyString && value === '')\n\t\t\t\t) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\tif (value === null) {\n\t\t\t\t\treturn [...result, [encode(key, options), '[', index, ']'].join('')];\n\t\t\t\t}\n\n\t\t\t\treturn [\n\t\t\t\t\t...result,\n\t\t\t\t\t[encode(key, options), '[', encode(index, options), ']=', encode(value, options)].join('')\n\t\t\t\t];\n\t\t\t};\n\n\t\tcase 'bracket':\n\t\t\treturn key => (result, value) => {\n\t\t\t\tif (\n\t\t\t\t\tvalue === undefined ||\n\t\t\t\t\t(options.skipNull && value === null) ||\n\t\t\t\t\t(options.skipEmptyString && value === '')\n\t\t\t\t) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\tif (value === null) {\n\t\t\t\t\treturn [...result, [encode(key, options), '[]'].join('')];\n\t\t\t\t}\n\n\t\t\t\treturn [...result, [encode(key, options), '[]=', encode(value, options)].join('')];\n\t\t\t};\n\n\t\tcase 'colon-list-separator':\n\t\t\treturn key => (result, value) => {\n\t\t\t\tif (\n\t\t\t\t\tvalue === undefined ||\n\t\t\t\t\t(options.skipNull && value === null) ||\n\t\t\t\t\t(options.skipEmptyString && value === '')\n\t\t\t\t) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\tif (value === null) {\n\t\t\t\t\treturn [...result, [encode(key, options), ':list='].join('')];\n\t\t\t\t}\n\n\t\t\t\treturn [...result, [encode(key, options), ':list=', encode(value, options)].join('')];\n\t\t\t};\n\n\t\tcase 'comma':\n\t\tcase 'separator':\n\t\tcase 'bracket-separator': {\n\t\t\tconst keyValueSep = options.arrayFormat === 'bracket-separator' ?\n\t\t\t\t'[]=' :\n\t\t\t\t'=';\n\n\t\t\treturn key => (result, value) => {\n\t\t\t\tif (\n\t\t\t\t\tvalue === undefined ||\n\t\t\t\t\t(options.skipNull && value === null) ||\n\t\t\t\t\t(options.skipEmptyString && value === '')\n\t\t\t\t) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\t// Translate null to an empty string so that it doesn't serialize as 'null'\n\t\t\t\tvalue = value === null ? '' : value;\n\n\t\t\t\tif (result.length === 0) {\n\t\t\t\t\treturn [[encode(key, options), keyValueSep, encode(value, options)].join('')];\n\t\t\t\t}\n\n\t\t\t\treturn [[result, encode(value, options)].join(options.arrayFormatSeparator)];\n\t\t\t};\n\t\t}\n\n\t\tdefault:\n\t\t\treturn key => (result, value) => {\n\t\t\t\tif (\n\t\t\t\t\tvalue === undefined ||\n\t\t\t\t\t(options.skipNull && value === null) ||\n\t\t\t\t\t(options.skipEmptyString && value === '')\n\t\t\t\t) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\tif (value === null) {\n\t\t\t\t\treturn [...result, encode(key, options)];\n\t\t\t\t}\n\n\t\t\t\treturn [...result, [encode(key, options), '=', encode(value, options)].join('')];\n\t\t\t};\n\t}\n}\n\nfunction parserForArrayFormat(options) {\n\tlet result;\n\n\tswitch (options.arrayFormat) {\n\t\tcase 'index':\n\t\t\treturn (key, value, accumulator) => {\n\t\t\t\tresult = /\\[(\\d*)\\]$/.exec(key);\n\n\t\t\t\tkey = key.replace(/\\[\\d*\\]$/, '');\n\n\t\t\t\tif (!result) {\n\t\t\t\t\taccumulator[key] = value;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (accumulator[key] === undefined) {\n\t\t\t\t\taccumulator[key] = {};\n\t\t\t\t}\n\n\t\t\t\taccumulator[key][result[1]] = value;\n\t\t\t};\n\n\t\tcase 'bracket':\n\t\t\treturn (key, value, accumulator) => {\n\t\t\t\tresult = /(\\[\\])$/.exec(key);\n\t\t\t\tkey = key.replace(/\\[\\]$/, '');\n\n\t\t\t\tif (!result) {\n\t\t\t\t\taccumulator[key] = value;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (accumulator[key] === undefined) {\n\t\t\t\t\taccumulator[key] = [value];\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\taccumulator[key] = [].concat(accumulator[key], value);\n\t\t\t};\n\n\t\tcase 'colon-list-separator':\n\t\t\treturn (key, value, accumulator) => {\n\t\t\t\tresult = /(:list)$/.exec(key);\n\t\t\t\tkey = key.replace(/:list$/, '');\n\n\t\t\t\tif (!result) {\n\t\t\t\t\taccumulator[key] = value;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (accumulator[key] === undefined) {\n\t\t\t\t\taccumulator[key] = [value];\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\taccumulator[key] = [].concat(accumulator[key], value);\n\t\t\t};\n\n\t\tcase 'comma':\n\t\tcase 'separator':\n\t\t\treturn (key, value, accumulator) => {\n\t\t\t\tconst isArray = typeof value === 'string' && value.includes(options.arrayFormatSeparator);\n\t\t\t\tconst isEncodedArray = (typeof value === 'string' && !isArray && decode(value, options).includes(options.arrayFormatSeparator));\n\t\t\t\tvalue = isEncodedArray ? decode(value, options) : value;\n\t\t\t\tconst newValue = isArray || isEncodedArray ? value.split(options.arrayFormatSeparator).map(item => decode(item, options)) : value === null ? value : decode(value, options);\n\t\t\t\taccumulator[key] = newValue;\n\t\t\t};\n\n\t\tcase 'bracket-separator':\n\t\t\treturn (key, value, accumulator) => {\n\t\t\t\tconst isArray = /(\\[\\])$/.test(key);\n\t\t\t\tkey = key.replace(/\\[\\]$/, '');\n\n\t\t\t\tif (!isArray) {\n\t\t\t\t\taccumulator[key] = value ? decode(value, options) : value;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst arrayValue = value === null ?\n\t\t\t\t\t[] :\n\t\t\t\t\tvalue.split(options.arrayFormatSeparator).map(item => decode(item, options));\n\n\t\t\t\tif (accumulator[key] === undefined) {\n\t\t\t\t\taccumulator[key] = arrayValue;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\taccumulator[key] = [].concat(accumulator[key], arrayValue);\n\t\t\t};\n\n\t\tdefault:\n\t\t\treturn (key, value, accumulator) => {\n\t\t\t\tif (accumulator[key] === undefined) {\n\t\t\t\t\taccumulator[key] = value;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\taccumulator[key] = [].concat(accumulator[key], value);\n\t\t\t};\n\t}\n}\n\nfunction validateArrayFormatSeparator(value) {\n\tif (typeof value !== 'string' || value.length !== 1) {\n\t\tthrow new TypeError('arrayFormatSeparator must be single character string');\n\t}\n}\n\nfunction encode(value, options) {\n\tif (options.encode) {\n\t\treturn options.strict ? strictUriEncode(value) : encodeURIComponent(value);\n\t}\n\n\treturn value;\n}\n\nfunction decode(value, options) {\n\tif (options.decode) {\n\t\treturn decodeComponent(value);\n\t}\n\n\treturn value;\n}\n\nfunction keysSorter(input) {\n\tif (Array.isArray(input)) {\n\t\treturn input.sort();\n\t}\n\n\tif (typeof input === 'object') {\n\t\treturn keysSorter(Object.keys(input))\n\t\t\t.sort((a, b) => Number(a) - Number(b))\n\t\t\t.map(key => input[key]);\n\t}\n\n\treturn input;\n}\n\nfunction removeHash(input) {\n\tconst hashStart = input.indexOf('#');\n\tif (hashStart !== -1) {\n\t\tinput = input.slice(0, hashStart);\n\t}\n\n\treturn input;\n}\n\nfunction getHash(url) {\n\tlet hash = '';\n\tconst hashStart = url.indexOf('#');\n\tif (hashStart !== -1) {\n\t\thash = url.slice(hashStart);\n\t}\n\n\treturn hash;\n}\n\nfunction extract(input) {\n\tinput = removeHash(input);\n\tconst queryStart = input.indexOf('?');\n\tif (queryStart === -1) {\n\t\treturn '';\n\t}\n\n\treturn input.slice(queryStart + 1);\n}\n\nfunction parseValue(value, options) {\n\tif (options.parseNumbers && !Number.isNaN(Number(value)) && (typeof value === 'string' && value.trim() !== '')) {\n\t\tvalue = Number(value);\n\t} else if (options.parseBooleans && value !== null && (value.toLowerCase() === 'true' || value.toLowerCase() === 'false')) {\n\t\tvalue = value.toLowerCase() === 'true';\n\t}\n\n\treturn value;\n}\n\nfunction parse(query, options) {\n\toptions = Object.assign({\n\t\tdecode: true,\n\t\tsort: true,\n\t\tarrayFormat: 'none',\n\t\tarrayFormatSeparator: ',',\n\t\tparseNumbers: false,\n\t\tparseBooleans: false\n\t}, options);\n\n\tvalidateArrayFormatSeparator(options.arrayFormatSeparator);\n\n\tconst formatter = parserForArrayFormat(options);\n\n\t// Create an object with no prototype\n\tconst ret = Object.create(null);\n\n\tif (typeof query !== 'string') {\n\t\treturn ret;\n\t}\n\n\tquery = query.trim().replace(/^[?#&]/, '');\n\n\tif (!query) {\n\t\treturn ret;\n\t}\n\n\tfor (const param of query.split('&')) {\n\t\tif (param === '') {\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet [key, value] = splitOnFirst(options.decode ? param.replace(/\\+/g, ' ') : param, '=');\n\n\t\t// Missing `=` should be `null`:\n\t\t// http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters\n\t\tvalue = value === undefined ? null : ['comma', 'separator', 'bracket-separator'].includes(options.arrayFormat) ? value : decode(value, options);\n\t\tformatter(decode(key, options), value, ret);\n\t}\n\n\tfor (const key of Object.keys(ret)) {\n\t\tconst value = ret[key];\n\t\tif (typeof value === 'object' && value !== null) {\n\t\t\tfor (const k of Object.keys(value)) {\n\t\t\t\tvalue[k] = parseValue(value[k], options);\n\t\t\t}\n\t\t} else {\n\t\t\tret[key] = parseValue(value, options);\n\t\t}\n\t}\n\n\tif (options.sort === false) {\n\t\treturn ret;\n\t}\n\n\treturn (options.sort === true ? Object.keys(ret).sort() : Object.keys(ret).sort(options.sort)).reduce((result, key) => {\n\t\tconst value = ret[key];\n\t\tif (Boolean(value) && typeof value === 'object' && !Array.isArray(value)) {\n\t\t\t// Sort object keys, not values\n\t\t\tresult[key] = keysSorter(value);\n\t\t} else {\n\t\t\tresult[key] = value;\n\t\t}\n\n\t\treturn result;\n\t}, Object.create(null));\n}\n\nexports.extract = extract;\nexports.parse = parse;\n\nexports.stringify = (object, options) => {\n\tif (!object) {\n\t\treturn '';\n\t}\n\n\toptions = Object.assign({\n\t\tencode: true,\n\t\tstrict: true,\n\t\tarrayFormat: 'none',\n\t\tarrayFormatSeparator: ','\n\t}, options);\n\n\tvalidateArrayFormatSeparator(options.arrayFormatSeparator);\n\n\tconst shouldFilter = key => (\n\t\t(options.skipNull && isNullOrUndefined(object[key])) ||\n\t\t(options.skipEmptyString && object[key] === '')\n\t);\n\n\tconst formatter = encoderForArrayFormat(options);\n\n\tconst objectCopy = {};\n\n\tfor (const key of Object.keys(object)) {\n\t\tif (!shouldFilter(key)) {\n\t\t\tobjectCopy[key] = object[key];\n\t\t}\n\t}\n\n\tconst keys = Object.keys(objectCopy);\n\n\tif (options.sort !== false) {\n\t\tkeys.sort(options.sort);\n\t}\n\n\treturn keys.map(key => {\n\t\tconst value = object[key];\n\n\t\tif (value === undefined) {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (value === null) {\n\t\t\treturn encode(key, options);\n\t\t}\n\n\t\tif (Array.isArray(value)) {\n\t\t\tif (value.length === 0 && options.arrayFormat === 'bracket-separator') {\n\t\t\t\treturn encode(key, options) + '[]';\n\t\t\t}\n\n\t\t\treturn value\n\t\t\t\t.reduce(formatter(key), [])\n\t\t\t\t.join('&');\n\t\t}\n\n\t\treturn encode(key, options) + '=' + encode(value, options);\n\t}).filter(x => x.length > 0).join('&');\n};\n\nexports.parseUrl = (url, options) => {\n\toptions = Object.assign({\n\t\tdecode: true\n\t}, options);\n\n\tconst [url_, hash] = splitOnFirst(url, '#');\n\n\treturn Object.assign(\n\t\t{\n\t\t\turl: url_.split('?')[0] || '',\n\t\t\tquery: parse(extract(url), options)\n\t\t},\n\t\toptions && options.parseFragmentIdentifier && hash ? {fragmentIdentifier: decode(hash, options)} : {}\n\t);\n};\n\nexports.stringifyUrl = (object, options) => {\n\toptions = Object.assign({\n\t\tencode: true,\n\t\tstrict: true,\n\t\t[encodeFragmentIdentifier]: true\n\t}, options);\n\n\tconst url = removeHash(object.url).split('?')[0] || '';\n\tconst queryFromUrl = exports.extract(object.url);\n\tconst parsedQueryFromUrl = exports.parse(queryFromUrl, {sort: false});\n\n\tconst query = Object.assign(parsedQueryFromUrl, object.query);\n\tlet queryString = exports.stringify(query, options);\n\tif (queryString) {\n\t\tqueryString = `?${queryString}`;\n\t}\n\n\tlet hash = getHash(object.url);\n\tif (object.fragmentIdentifier) {\n\t\thash = `#${options[encodeFragmentIdentifier] ? encode(object.fragmentIdentifier, options) : object.fragmentIdentifier}`;\n\t}\n\n\treturn `${url}${queryString}${hash}`;\n};\n\nexports.pick = (input, filter, options) => {\n\toptions = Object.assign({\n\t\tparseFragmentIdentifier: true,\n\t\t[encodeFragmentIdentifier]: false\n\t}, options);\n\n\tconst {url, query, fragmentIdentifier} = exports.parseUrl(input, options);\n\treturn exports.stringifyUrl({\n\t\turl,\n\t\tquery: filterObject(query, filter),\n\t\tfragmentIdentifier\n\t}, options);\n};\n\nexports.exclude = (input, filter, options) => {\n\tconst exclusionFilter = Array.isArray(filter) ? key => !filter.includes(key) : (key, value) => !filter(key, value);\n\n\treturn exports.pick(input, exclusionFilter, options);\n};\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/query-string/index.js?"); - -/***/ }), - -/***/ "./node_modules/quick-format-unescaped/index.js": -/*!******************************************************!*\ - !*** ./node_modules/quick-format-unescaped/index.js ***! - \******************************************************/ -/***/ ((module) => { - -eval("\nfunction tryStringify (o) {\n try { return JSON.stringify(o) } catch(e) { return '\"[Circular]\"' }\n}\n\nmodule.exports = format\n\nfunction format(f, args, opts) {\n var ss = (opts && opts.stringify) || tryStringify\n var offset = 1\n if (typeof f === 'object' && f !== null) {\n var len = args.length + offset\n if (len === 1) return f\n var objects = new Array(len)\n objects[0] = ss(f)\n for (var index = 1; index < len; index++) {\n objects[index] = ss(args[index])\n }\n return objects.join(' ')\n }\n if (typeof f !== 'string') {\n return f\n }\n var argLen = args.length\n if (argLen === 0) return f\n var str = ''\n var a = 1 - offset\n var lastPos = -1\n var flen = (f && f.length) || 0\n for (var i = 0; i < flen;) {\n if (f.charCodeAt(i) === 37 && i + 1 < flen) {\n lastPos = lastPos > -1 ? lastPos : 0\n switch (f.charCodeAt(i + 1)) {\n case 100: // 'd'\n case 102: // 'f'\n if (a >= argLen)\n break\n if (args[a] == null) break\n if (lastPos < i)\n str += f.slice(lastPos, i)\n str += Number(args[a])\n lastPos = i + 2\n i++\n break\n case 105: // 'i'\n if (a >= argLen)\n break\n if (args[a] == null) break\n if (lastPos < i)\n str += f.slice(lastPos, i)\n str += Math.floor(Number(args[a]))\n lastPos = i + 2\n i++\n break\n case 79: // 'O'\n case 111: // 'o'\n case 106: // 'j'\n if (a >= argLen)\n break\n if (args[a] === undefined) break\n if (lastPos < i)\n str += f.slice(lastPos, i)\n var type = typeof args[a]\n if (type === 'string') {\n str += '\\'' + args[a] + '\\''\n lastPos = i + 2\n i++\n break\n }\n if (type === 'function') {\n str += args[a].name || ''\n lastPos = i + 2\n i++\n break\n }\n str += ss(args[a])\n lastPos = i + 2\n i++\n break\n case 115: // 's'\n if (a >= argLen)\n break\n if (lastPos < i)\n str += f.slice(lastPos, i)\n str += String(args[a])\n lastPos = i + 2\n i++\n break\n case 37: // '%'\n if (lastPos < i)\n str += f.slice(lastPos, i)\n str += '%'\n lastPos = i + 2\n i++\n a--\n break\n }\n ++a\n }\n ++i\n }\n if (lastPos === -1)\n return f\n else if (lastPos < flen) {\n str += f.slice(lastPos)\n }\n\n return str\n}\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/quick-format-unescaped/index.js?"); - -/***/ }), - -/***/ "./node_modules/split-on-first/index.js": -/*!**********************************************!*\ - !*** ./node_modules/split-on-first/index.js ***! - \**********************************************/ -/***/ ((module) => { - -eval("\n\nmodule.exports = (string, separator) => {\n\tif (!(typeof string === 'string' && typeof separator === 'string')) {\n\t\tthrow new TypeError('Expected the arguments to be of type `string`');\n\t}\n\n\tif (separator === '') {\n\t\treturn [string];\n\t}\n\n\tconst separatorIndex = string.indexOf(separator);\n\n\tif (separatorIndex === -1) {\n\t\treturn [string];\n\t}\n\n\treturn [\n\t\tstring.slice(0, separatorIndex),\n\t\tstring.slice(separatorIndex + separator.length)\n\t];\n};\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/split-on-first/index.js?"); - -/***/ }), - -/***/ "./node_modules/strict-uri-encode/index.js": -/*!*************************************************!*\ - !*** ./node_modules/strict-uri-encode/index.js ***! - \*************************************************/ -/***/ ((module) => { - -eval("\nmodule.exports = str => encodeURIComponent(str).replace(/[!'()*]/g, x => `%${x.charCodeAt(0).toString(16).toUpperCase()}`);\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/strict-uri-encode/index.js?"); - -/***/ }), - -/***/ "./node_modules/tslib/tslib.es6.js": -/*!*****************************************!*\ - !*** ./node_modules/tslib/tslib.es6.js ***! - \*****************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ __assign: () => (/* binding */ __assign),\n/* harmony export */ __asyncDelegator: () => (/* binding */ __asyncDelegator),\n/* harmony export */ __asyncGenerator: () => (/* binding */ __asyncGenerator),\n/* harmony export */ __asyncValues: () => (/* binding */ __asyncValues),\n/* harmony export */ __await: () => (/* binding */ __await),\n/* harmony export */ __awaiter: () => (/* binding */ __awaiter),\n/* harmony export */ __classPrivateFieldGet: () => (/* binding */ __classPrivateFieldGet),\n/* harmony export */ __classPrivateFieldSet: () => (/* binding */ __classPrivateFieldSet),\n/* harmony export */ __createBinding: () => (/* binding */ __createBinding),\n/* harmony export */ __decorate: () => (/* binding */ __decorate),\n/* harmony export */ __exportStar: () => (/* binding */ __exportStar),\n/* harmony export */ __extends: () => (/* binding */ __extends),\n/* harmony export */ __generator: () => (/* binding */ __generator),\n/* harmony export */ __importDefault: () => (/* binding */ __importDefault),\n/* harmony export */ __importStar: () => (/* binding */ __importStar),\n/* harmony export */ __makeTemplateObject: () => (/* binding */ __makeTemplateObject),\n/* harmony export */ __metadata: () => (/* binding */ __metadata),\n/* harmony export */ __param: () => (/* binding */ __param),\n/* harmony export */ __read: () => (/* binding */ __read),\n/* harmony export */ __rest: () => (/* binding */ __rest),\n/* harmony export */ __spread: () => (/* binding */ __spread),\n/* harmony export */ __spreadArrays: () => (/* binding */ __spreadArrays),\n/* harmony export */ __values: () => (/* binding */ __values)\n/* harmony export */ });\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nfunction __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nfunction __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nfunction __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nfunction __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nfunction __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nfunction __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nfunction __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nfunction __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nfunction __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nfunction __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nfunction __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nfunction __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nfunction __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nfunction __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nfunction __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nfunction __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nfunction __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nfunction __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nfunction __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nfunction __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/tslib/tslib.es6.js?"); - -/***/ }), - -/***/ "./node_modules/unfetch/dist/unfetch.module.js": -/*!*****************************************************!*\ - !*** ./node_modules/unfetch/dist/unfetch.module.js ***! - \*****************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(e,n){return n=n||{},new Promise(function(t,r){var s=new XMLHttpRequest,o=[],u=[],i={},a=function(){return{ok:2==(s.status/100|0),statusText:s.statusText,status:s.status,url:s.responseURL,text:function(){return Promise.resolve(s.responseText)},json:function(){return Promise.resolve(s.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([s.response]))},clone:a,headers:{keys:function(){return o},entries:function(){return u},get:function(e){return i[e.toLowerCase()]},has:function(e){return e.toLowerCase()in i}}}};for(var l in s.open(n.method||\"get\",e,!0),s.onload=function(){s.getAllResponseHeaders().replace(/^(.*?):[^\\S\\n]*([\\s\\S]*?)$/gm,function(e,n,t){o.push(n=n.toLowerCase()),u.push([n,t]),i[n]=i[n]?i[n]+\",\"+t:t}),t(a())},s.onerror=r,s.withCredentials=\"include\"==n.credentials,n.headers)s.setRequestHeader(l,n.headers[l]);s.send(n.body||null)})}\n//# sourceMappingURL=unfetch.module.js.map\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/unfetch/dist/unfetch.module.js?"); - -/***/ }), - -/***/ "./node_modules/ws/browser.js": -/*!************************************!*\ - !*** ./node_modules/ws/browser.js ***! - \************************************/ -/***/ ((module) => { - -eval("\n\nmodule.exports = function () {\n throw new Error(\n 'ws does not work in the browser. Browser clients must use the native ' +\n 'WebSocket object'\n );\n};\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/ws/browser.js?"); - -/***/ }), - -/***/ "./src/index.js": -/*!**********************!*\ - !*** ./src/index.js ***! - \**********************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _walletconnect_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @walletconnect/core */ \"./node_modules/@walletconnect/core/dist/index.es.js\");\n/* harmony import */ var _walletconnect_web3wallet__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @walletconnect/web3wallet */ \"./node_modules/@walletconnect/web3wallet/dist/index.es.js\");\n/* harmony import */ var _walletconnect_auth_client__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @walletconnect/auth-client */ \"./node_modules/@walletconnect/auth-client/dist/index.es.js\");\n/* harmony import */ var _walletconnect_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @walletconnect/utils */ \"./node_modules/@walletconnect/utils/dist/index.es.js\");\n/* harmony import */ var _walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @walletconnect/jsonrpc-utils */ \"./node_modules/@walletconnect/jsonrpc-utils/dist/esm/index.js\");\n\n\n\n\n\n// import the builder util\n\n\n\nwindow.wc = {\n core: null,\n web3wallet: null,\n authClient: null,\n statusObject: null,\n\n init: function (projectId) {\n return new Promise(async (resolve, reject) => {\n if (!window.statusq) {\n const errMsg = 'missing window.statusq! Forgot to execute \"ui/StatusQ/src/StatusQ/Components/private/qwebchannel/helpers.js\" first?'\n console.error(errMsg);\n reject(errMsg);\n }\n\n if (window.statusq.error) {\n const errMsg = \"Failed initializing WebChannel: \" + window.statusq.error\n console.error(errMsg);\n reject(errMsg);\n }\n\n wc.statusObject = window.statusq.channel.objects.statusObject;\n if (!wc.statusObject) {\n const errMsg = \"Failed initializing WebChannel or initialization not run\"\n console.error(errMsg);\n reject(errMsg);\n }\n\n window.wc.core = new _walletconnect_core__WEBPACK_IMPORTED_MODULE_2__.Core({\n projectId: projectId,\n });\n\n window.wc.web3wallet = await _walletconnect_web3wallet__WEBPACK_IMPORTED_MODULE_3__.Web3Wallet.init({\n core: window.wc.core, // <- pass the shared `core` instance\n metadata: {\n name: \"Status\",\n description: \"Status Wallet\",\n url: \"http://localhost\",\n icons: ['https://status.im/img/status-footer-logo.svg'],\n },\n });\n\n window.wc.authClient = await _walletconnect_auth_client__WEBPACK_IMPORTED_MODULE_0__[\"default\"].init({\n projectId: projectId,\n metadata: window.wc.web3wallet.metadata,\n });\n\n // connect session responses https://specs.walletconnect.com/2.0/specs/clients/sign/session-events#events\n window.wc.web3wallet.on(\"session_proposal\", (details) => {\n wc.statusObject.onSessionProposal(details)\n });\n\n window.wc.web3wallet.on(\"session_update\", (details) => {\n wc.statusObject.onSessionUpdate(details)\n });\n\n window.wc.web3wallet.on(\"session_extend\", (details) => {\n wc.statusObject.onSessionExtend(details)\n });\n\n window.wc.web3wallet.on(\"session_ping\", (details) => {\n wc.statusObject.onSessionPing(details)\n });\n\n window.wc.web3wallet.on(\"session_delete\", (details) => {\n wc.statusObject.onSessionDelete(details)\n });\n\n window.wc.web3wallet.on(\"session_expire\", (details) => {\n wc.statusObject.onSessionExpire(details)\n });\n\n window.wc.web3wallet.on(\"session_request\", (details) => {\n wc.statusObject.onSessionRequest(details)\n });\n\n window.wc.web3wallet.on(\"session_request_sent\", (details) => {\n wc.statusObject.onSessionRequestSent(details)\n });\n\n window.wc.web3wallet.on(\"session_event\", (details) => {\n wc.statusObject.onSessionEvent(details)\n });\n\n window.wc.web3wallet.on(\"proposal_expire\", (details) => {\n wc.statusObject.onProposalExpire(details)\n });\n\n window.wc.authClient.on(\"auth_request\", (details) => {\n wc.statusObject.onAuthRequest(details)\n });\n\n wc.statusObject.sdkInitialized(\"\");\n resolve(\"\");\n });\n },\n\n // TODO: there is a corner case when attempting to pair with a link that is already paired or was rejected won't trigger any event back\n pair: async function (uri) {\n await window.wc.web3wallet.pair({ uri });\n },\n\n getPairings: function () {\n return window.wc.web3wallet.core.pairing.getPairings();\n },\n\n getActiveSessions: function () {\n return window.wc.web3wallet.getActiveSessions();\n },\n\n disconnect: async function (topic) {\n await window.wc.web3wallet.disconnectSession(\n {\n topic,\n reason: (0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_4__.getSdkError)('USER_DISCONNECTED')\n }\n );\n },\n\n ping: async function (topic) {\n await window.wc.web3wallet.engine.signClient.ping({ topic });\n },\n\n buildApprovedNamespaces: async function (params, supportedNamespaces) {\n return (0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_4__.buildApprovedNamespaces)({\n proposal: params,\n supportedNamespaces: supportedNamespaces,\n });\n },\n\n approveSession: async function (sessionProposal, approvedNamespaces) {\n const { id, params } = sessionProposal;\n\n const { relays } = params\n\n return await window.wc.web3wallet.approveSession(\n {\n id,\n relayProtocol: relays[0].protocol,\n namespaces: approvedNamespaces,\n }\n );\n },\n\n rejectSession: async function (id) {\n await window.wc.web3wallet.rejectSession(\n {\n id,\n reason: (0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_4__.getSdkError)(\"USER_REJECTED\"), // TODO USER_REJECTED_METHODS, USER_REJECTED_CHAINS, USER_REJECTED_EVENTS\n }\n );\n },\n\n auth: async function (uri) {\n await window.wc.authClient.core.pairing.pair({ uri });\n },\n\n formatAuthMessage: function (cacaoPayload, address) {\n const iss = `did:pkh:eip155:1:${address}`;\n return window.wc.authClient.formatMessage(cacaoPayload, iss);\n },\n\n approveAuth: async function (authRequest, address, signature) {\n const { id } = authRequest;\n\n const iss = `did:pkh:eip155:1:${address}`;\n\n await window.wc.authClient.respond(\n {\n id: id,\n signature: {\n s: signature,\n t: \"eip191\",\n },\n },\n iss\n );\n },\n\n rejectAuth: async function (id, address) {\n const iss = `did:pkh:eip155:1:${address}`;\n\n await window.wc.authClient.respond(\n {\n id: id,\n error: {\n code: 4001,\n message: 'Auth request has been rejected'\n },\n },\n iss\n );\n },\n\n respondSessionRequest: async function (topic, id, signature) {\n const response = (0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_1__.formatJsonRpcResult)(id, signature)\n\n await window.wc.web3wallet.respondSessionRequest(\n {\n topic: topic,\n response: response\n }\n );\n },\n\n rejectSessionRequest: async function (topic, id, error = false) {\n const errorType = error ? \"SESSION_SETTLEMENT_FAILED\" : \"USER_REJECTED\";\n\n await window.wc.web3wallet.respondSessionRequest(\n {\n topic: topic,\n response: (0,_walletconnect_jsonrpc_utils__WEBPACK_IMPORTED_MODULE_1__.formatJsonRpcError)(id, (0,_walletconnect_utils__WEBPACK_IMPORTED_MODULE_4__.getSdkError)(errorType)),\n }\n );\n },\n};\n\n\n//# sourceURL=webpack://wallet_connect_integration/./src/index.js?"); - -/***/ }), - -/***/ "?25ed": -/*!************************!*\ - !*** crypto (ignored) ***! - \************************/ -/***/ (() => { - -eval("/* (ignored) */\n\n//# sourceURL=webpack://wallet_connect_integration/crypto_(ignored)?"); - -/***/ }), - -/***/ "?8131": -/*!************************!*\ - !*** buffer (ignored) ***! - \************************/ -/***/ (() => { - -eval("/* (ignored) */\n\n//# sourceURL=webpack://wallet_connect_integration/buffer_(ignored)?"); - -/***/ }), - -/***/ "./node_modules/pino/browser.js": -/*!**************************************!*\ - !*** ./node_modules/pino/browser.js ***! - \**************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -eval("\n\nconst format = __webpack_require__(/*! quick-format-unescaped */ \"./node_modules/quick-format-unescaped/index.js\")\n\nmodule.exports = pino\n\nconst _console = pfGlobalThisOrFallback().console || {}\nconst stdSerializers = {\n mapHttpRequest: mock,\n mapHttpResponse: mock,\n wrapRequestSerializer: passthrough,\n wrapResponseSerializer: passthrough,\n wrapErrorSerializer: passthrough,\n req: mock,\n res: mock,\n err: asErrValue\n}\n\nfunction shouldSerialize (serialize, serializers) {\n if (Array.isArray(serialize)) {\n const hasToFilter = serialize.filter(function (k) {\n return k !== '!stdSerializers.err'\n })\n return hasToFilter\n } else if (serialize === true) {\n return Object.keys(serializers)\n }\n\n return false\n}\n\nfunction pino (opts) {\n opts = opts || {}\n opts.browser = opts.browser || {}\n\n const transmit = opts.browser.transmit\n if (transmit && typeof transmit.send !== 'function') { throw Error('pino: transmit option must have a send function') }\n\n const proto = opts.browser.write || _console\n if (opts.browser.write) opts.browser.asObject = true\n const serializers = opts.serializers || {}\n const serialize = shouldSerialize(opts.browser.serialize, serializers)\n let stdErrSerialize = opts.browser.serialize\n\n if (\n Array.isArray(opts.browser.serialize) &&\n opts.browser.serialize.indexOf('!stdSerializers.err') > -1\n ) stdErrSerialize = false\n\n const levels = ['error', 'fatal', 'warn', 'info', 'debug', 'trace']\n\n if (typeof proto === 'function') {\n proto.error = proto.fatal = proto.warn =\n proto.info = proto.debug = proto.trace = proto\n }\n if (opts.enabled === false) opts.level = 'silent'\n const level = opts.level || 'info'\n const logger = Object.create(proto)\n if (!logger.log) logger.log = noop\n\n Object.defineProperty(logger, 'levelVal', {\n get: getLevelVal\n })\n Object.defineProperty(logger, 'level', {\n get: getLevel,\n set: setLevel\n })\n\n const setOpts = {\n transmit,\n serialize,\n asObject: opts.browser.asObject,\n levels,\n timestamp: getTimeFunction(opts)\n }\n logger.levels = pino.levels\n logger.level = level\n\n logger.setMaxListeners = logger.getMaxListeners =\n logger.emit = logger.addListener = logger.on =\n logger.prependListener = logger.once =\n logger.prependOnceListener = logger.removeListener =\n logger.removeAllListeners = logger.listeners =\n logger.listenerCount = logger.eventNames =\n logger.write = logger.flush = noop\n logger.serializers = serializers\n logger._serialize = serialize\n logger._stdErrSerialize = stdErrSerialize\n logger.child = child\n\n if (transmit) logger._logEvent = createLogEventShape()\n\n function getLevelVal () {\n return this.level === 'silent'\n ? Infinity\n : this.levels.values[this.level]\n }\n\n function getLevel () {\n return this._level\n }\n function setLevel (level) {\n if (level !== 'silent' && !this.levels.values[level]) {\n throw Error('unknown level ' + level)\n }\n this._level = level\n\n set(setOpts, logger, 'error', 'log') // <-- must stay first\n set(setOpts, logger, 'fatal', 'error')\n set(setOpts, logger, 'warn', 'error')\n set(setOpts, logger, 'info', 'log')\n set(setOpts, logger, 'debug', 'log')\n set(setOpts, logger, 'trace', 'log')\n }\n\n function child (bindings, childOptions) {\n if (!bindings) {\n throw new Error('missing bindings for child Pino')\n }\n childOptions = childOptions || {}\n if (serialize && bindings.serializers) {\n childOptions.serializers = bindings.serializers\n }\n const childOptionsSerializers = childOptions.serializers\n if (serialize && childOptionsSerializers) {\n var childSerializers = Object.assign({}, serializers, childOptionsSerializers)\n var childSerialize = opts.browser.serialize === true\n ? Object.keys(childSerializers)\n : serialize\n delete bindings.serializers\n applySerializers([bindings], childSerialize, childSerializers, this._stdErrSerialize)\n }\n function Child (parent) {\n this._childLevel = (parent._childLevel | 0) + 1\n this.error = bind(parent, bindings, 'error')\n this.fatal = bind(parent, bindings, 'fatal')\n this.warn = bind(parent, bindings, 'warn')\n this.info = bind(parent, bindings, 'info')\n this.debug = bind(parent, bindings, 'debug')\n this.trace = bind(parent, bindings, 'trace')\n if (childSerializers) {\n this.serializers = childSerializers\n this._serialize = childSerialize\n }\n if (transmit) {\n this._logEvent = createLogEventShape(\n [].concat(parent._logEvent.bindings, bindings)\n )\n }\n }\n Child.prototype = this\n return new Child(this)\n }\n return logger\n}\n\npino.levels = {\n values: {\n fatal: 60,\n error: 50,\n warn: 40,\n info: 30,\n debug: 20,\n trace: 10\n },\n labels: {\n 10: 'trace',\n 20: 'debug',\n 30: 'info',\n 40: 'warn',\n 50: 'error',\n 60: 'fatal'\n }\n}\n\npino.stdSerializers = stdSerializers\npino.stdTimeFunctions = Object.assign({}, { nullTime, epochTime, unixTime, isoTime })\n\nfunction set (opts, logger, level, fallback) {\n const proto = Object.getPrototypeOf(logger)\n logger[level] = logger.levelVal > logger.levels.values[level]\n ? noop\n : (proto[level] ? proto[level] : (_console[level] || _console[fallback] || noop))\n\n wrap(opts, logger, level)\n}\n\nfunction wrap (opts, logger, level) {\n if (!opts.transmit && logger[level] === noop) return\n\n logger[level] = (function (write) {\n return function LOG () {\n const ts = opts.timestamp()\n const args = new Array(arguments.length)\n const proto = (Object.getPrototypeOf && Object.getPrototypeOf(this) === _console) ? _console : this\n for (var i = 0; i < args.length; i++) args[i] = arguments[i]\n\n if (opts.serialize && !opts.asObject) {\n applySerializers(args, this._serialize, this.serializers, this._stdErrSerialize)\n }\n if (opts.asObject) write.call(proto, asObject(this, level, args, ts))\n else write.apply(proto, args)\n\n if (opts.transmit) {\n const transmitLevel = opts.transmit.level || logger.level\n const transmitValue = pino.levels.values[transmitLevel]\n const methodValue = pino.levels.values[level]\n if (methodValue < transmitValue) return\n transmit(this, {\n ts,\n methodLevel: level,\n methodValue,\n transmitLevel,\n transmitValue: pino.levels.values[opts.transmit.level || logger.level],\n send: opts.transmit.send,\n val: logger.levelVal\n }, args)\n }\n }\n })(logger[level])\n}\n\nfunction asObject (logger, level, args, ts) {\n if (logger._serialize) applySerializers(args, logger._serialize, logger.serializers, logger._stdErrSerialize)\n const argsCloned = args.slice()\n let msg = argsCloned[0]\n const o = {}\n if (ts) {\n o.time = ts\n }\n o.level = pino.levels.values[level]\n let lvl = (logger._childLevel | 0) + 1\n if (lvl < 1) lvl = 1\n // deliberate, catching objects, arrays\n if (msg !== null && typeof msg === 'object') {\n while (lvl-- && typeof argsCloned[0] === 'object') {\n Object.assign(o, argsCloned.shift())\n }\n msg = argsCloned.length ? format(argsCloned.shift(), argsCloned) : undefined\n } else if (typeof msg === 'string') msg = format(argsCloned.shift(), argsCloned)\n if (msg !== undefined) o.msg = msg\n return o\n}\n\nfunction applySerializers (args, serialize, serializers, stdErrSerialize) {\n for (const i in args) {\n if (stdErrSerialize && args[i] instanceof Error) {\n args[i] = pino.stdSerializers.err(args[i])\n } else if (typeof args[i] === 'object' && !Array.isArray(args[i])) {\n for (const k in args[i]) {\n if (serialize && serialize.indexOf(k) > -1 && k in serializers) {\n args[i][k] = serializers[k](args[i][k])\n }\n }\n }\n }\n}\n\nfunction bind (parent, bindings, level) {\n return function () {\n const args = new Array(1 + arguments.length)\n args[0] = bindings\n for (var i = 1; i < args.length; i++) {\n args[i] = arguments[i - 1]\n }\n return parent[level].apply(this, args)\n }\n}\n\nfunction transmit (logger, opts, args) {\n const send = opts.send\n const ts = opts.ts\n const methodLevel = opts.methodLevel\n const methodValue = opts.methodValue\n const val = opts.val\n const bindings = logger._logEvent.bindings\n\n applySerializers(\n args,\n logger._serialize || Object.keys(logger.serializers),\n logger.serializers,\n logger._stdErrSerialize === undefined ? true : logger._stdErrSerialize\n )\n logger._logEvent.ts = ts\n logger._logEvent.messages = args.filter(function (arg) {\n // bindings can only be objects, so reference equality check via indexOf is fine\n return bindings.indexOf(arg) === -1\n })\n\n logger._logEvent.level.label = methodLevel\n logger._logEvent.level.value = methodValue\n\n send(methodLevel, logger._logEvent, val)\n\n logger._logEvent = createLogEventShape(bindings)\n}\n\nfunction createLogEventShape (bindings) {\n return {\n ts: 0,\n messages: [],\n bindings: bindings || [],\n level: { label: '', value: 0 }\n }\n}\n\nfunction asErrValue (err) {\n const obj = {\n type: err.constructor.name,\n msg: err.message,\n stack: err.stack\n }\n for (const key in err) {\n if (obj[key] === undefined) {\n obj[key] = err[key]\n }\n }\n return obj\n}\n\nfunction getTimeFunction (opts) {\n if (typeof opts.timestamp === 'function') {\n return opts.timestamp\n }\n if (opts.timestamp === false) {\n return nullTime\n }\n return epochTime\n}\n\nfunction mock () { return {} }\nfunction passthrough (a) { return a }\nfunction noop () {}\n\nfunction nullTime () { return false }\nfunction epochTime () { return Date.now() }\nfunction unixTime () { return Math.round(Date.now() / 1000.0) }\nfunction isoTime () { return new Date(Date.now()).toISOString() } // using Date.now() for testability\n\n/* eslint-disable */\n/* istanbul ignore next */\nfunction pfGlobalThisOrFallback () {\n function defd (o) { return typeof o !== 'undefined' && o }\n try {\n if (typeof globalThis !== 'undefined') return globalThis\n Object.defineProperty(Object.prototype, 'globalThis', {\n get: function () {\n delete Object.prototype.globalThis\n return (this.globalThis = this)\n },\n configurable: true\n })\n return globalThis\n } catch (e) {\n return defd(self) || defd(window) || defd(this) || {}\n }\n}\n/* eslint-enable */\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/pino/browser.js?"); - -/***/ }), - -/***/ "./node_modules/destr/dist/index.mjs": -/*!*******************************************!*\ - !*** ./node_modules/destr/dist/index.mjs ***! - \*******************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ destr),\n/* harmony export */ destr: () => (/* binding */ destr),\n/* harmony export */ safeDestr: () => (/* binding */ safeDestr)\n/* harmony export */ });\nconst suspectProtoRx = /\"(?:_|\\\\u0{2}5[Ff]){2}(?:p|\\\\u0{2}70)(?:r|\\\\u0{2}72)(?:o|\\\\u0{2}6[Ff])(?:t|\\\\u0{2}74)(?:o|\\\\u0{2}6[Ff])(?:_|\\\\u0{2}5[Ff]){2}\"\\s*:/;\nconst suspectConstructorRx = /\"(?:c|\\\\u0063)(?:o|\\\\u006[Ff])(?:n|\\\\u006[Ee])(?:s|\\\\u0073)(?:t|\\\\u0074)(?:r|\\\\u0072)(?:u|\\\\u0075)(?:c|\\\\u0063)(?:t|\\\\u0074)(?:o|\\\\u006[Ff])(?:r|\\\\u0072)\"\\s*:/;\nconst JsonSigRx = /^\\s*[\"[{]|^\\s*-?\\d{1,16}(\\.\\d{1,17})?([Ee][+-]?\\d+)?\\s*$/;\nfunction jsonParseTransform(key, value) {\n if (key === \"__proto__\" || key === \"constructor\" && value && typeof value === \"object\" && \"prototype\" in value) {\n warnKeyDropped(key);\n return;\n }\n return value;\n}\nfunction warnKeyDropped(key) {\n console.warn(`[destr] Dropping \"${key}\" key to prevent prototype pollution.`);\n}\nfunction destr(value, options = {}) {\n if (typeof value !== \"string\") {\n return value;\n }\n const _value = value.trim();\n if (\n // eslint-disable-next-line unicorn/prefer-at\n value[0] === '\"' && value.at(-1) === '\"' && !value.includes(\"\\\\\")\n ) {\n return _value.slice(1, -1);\n }\n if (_value.length <= 9) {\n const _lval = _value.toLowerCase();\n if (_lval === \"true\") {\n return true;\n }\n if (_lval === \"false\") {\n return false;\n }\n if (_lval === \"undefined\") {\n return void 0;\n }\n if (_lval === \"null\") {\n return null;\n }\n if (_lval === \"nan\") {\n return Number.NaN;\n }\n if (_lval === \"infinity\") {\n return Number.POSITIVE_INFINITY;\n }\n if (_lval === \"-infinity\") {\n return Number.NEGATIVE_INFINITY;\n }\n }\n if (!JsonSigRx.test(value)) {\n if (options.strict) {\n throw new SyntaxError(\"[destr] Invalid JSON\");\n }\n return value;\n }\n try {\n if (suspectProtoRx.test(value) || suspectConstructorRx.test(value)) {\n if (options.strict) {\n throw new Error(\"[destr] Possible prototype pollution\");\n }\n return JSON.parse(value, jsonParseTransform);\n }\n return JSON.parse(value);\n } catch (error) {\n if (options.strict) {\n throw error;\n }\n return value;\n }\n}\nfunction safeDestr(value, options = {}) {\n return destr(value, { ...options, strict: true });\n}\n\n\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/destr/dist/index.mjs?"); - -/***/ }), - -/***/ "./node_modules/idb-keyval/dist/index.js": -/*!***********************************************!*\ - !*** ./node_modules/idb-keyval/dist/index.js ***! - \***********************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ clear: () => (/* binding */ clear),\n/* harmony export */ createStore: () => (/* binding */ createStore),\n/* harmony export */ del: () => (/* binding */ del),\n/* harmony export */ delMany: () => (/* binding */ delMany),\n/* harmony export */ entries: () => (/* binding */ entries),\n/* harmony export */ get: () => (/* binding */ get),\n/* harmony export */ getMany: () => (/* binding */ getMany),\n/* harmony export */ keys: () => (/* binding */ keys),\n/* harmony export */ promisifyRequest: () => (/* binding */ promisifyRequest),\n/* harmony export */ set: () => (/* binding */ set),\n/* harmony export */ setMany: () => (/* binding */ setMany),\n/* harmony export */ update: () => (/* binding */ update),\n/* harmony export */ values: () => (/* binding */ values)\n/* harmony export */ });\nfunction promisifyRequest(request) {\n return new Promise((resolve, reject) => {\n // @ts-ignore - file size hacks\n request.oncomplete = request.onsuccess = () => resolve(request.result);\n // @ts-ignore - file size hacks\n request.onabort = request.onerror = () => reject(request.error);\n });\n}\nfunction createStore(dbName, storeName) {\n const request = indexedDB.open(dbName);\n request.onupgradeneeded = () => request.result.createObjectStore(storeName);\n const dbp = promisifyRequest(request);\n return (txMode, callback) => dbp.then((db) => callback(db.transaction(storeName, txMode).objectStore(storeName)));\n}\nlet defaultGetStoreFunc;\nfunction defaultGetStore() {\n if (!defaultGetStoreFunc) {\n defaultGetStoreFunc = createStore('keyval-store', 'keyval');\n }\n return defaultGetStoreFunc;\n}\n/**\n * Get a value by its key.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction get(key, customStore = defaultGetStore()) {\n return customStore('readonly', (store) => promisifyRequest(store.get(key)));\n}\n/**\n * Set a value with a key.\n *\n * @param key\n * @param value\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction set(key, value, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.put(value, key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Set multiple values at once. This is faster than calling set() multiple times.\n * It's also atomic – if one of the pairs can't be added, none will be added.\n *\n * @param entries Array of entries, where each entry is an array of `[key, value]`.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction setMany(entries, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n entries.forEach((entry) => store.put(entry[1], entry[0]));\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Get multiple values by their keys\n *\n * @param keys\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction getMany(keys, customStore = defaultGetStore()) {\n return customStore('readonly', (store) => Promise.all(keys.map((key) => promisifyRequest(store.get(key)))));\n}\n/**\n * Update a value. This lets you see the old value and update it as an atomic operation.\n *\n * @param key\n * @param updater A callback that takes the old value and returns a new value.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction update(key, updater, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => \n // Need to create the promise manually.\n // If I try to chain promises, the transaction closes in browsers\n // that use a promise polyfill (IE10/11).\n new Promise((resolve, reject) => {\n store.get(key).onsuccess = function () {\n try {\n store.put(updater(this.result), key);\n resolve(promisifyRequest(store.transaction));\n }\n catch (err) {\n reject(err);\n }\n };\n }));\n}\n/**\n * Delete a particular key from the store.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction del(key, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.delete(key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Delete multiple keys at once.\n *\n * @param keys List of keys to delete.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction delMany(keys, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n keys.forEach((key) => store.delete(key));\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Clear all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction clear(customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.clear();\n return promisifyRequest(store.transaction);\n });\n}\nfunction eachCursor(store, callback) {\n store.openCursor().onsuccess = function () {\n if (!this.result)\n return;\n callback(this.result);\n this.result.continue();\n };\n return promisifyRequest(store.transaction);\n}\n/**\n * Get all keys in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction keys(customStore = defaultGetStore()) {\n return customStore('readonly', (store) => {\n // Fast path for modern browsers\n if (store.getAllKeys) {\n return promisifyRequest(store.getAllKeys());\n }\n const items = [];\n return eachCursor(store, (cursor) => items.push(cursor.key)).then(() => items);\n });\n}\n/**\n * Get all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction values(customStore = defaultGetStore()) {\n return customStore('readonly', (store) => {\n // Fast path for modern browsers\n if (store.getAll) {\n return promisifyRequest(store.getAll());\n }\n const items = [];\n return eachCursor(store, (cursor) => items.push(cursor.value)).then(() => items);\n });\n}\n/**\n * Get all entries in the store. Each entry is an array of `[key, value]`.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction entries(customStore = defaultGetStore()) {\n return customStore('readonly', (store) => {\n // Fast path for modern browsers\n // (although, hopefully we'll get a simpler path some day)\n if (store.getAll && store.getAllKeys) {\n return Promise.all([\n promisifyRequest(store.getAllKeys()),\n promisifyRequest(store.getAll()),\n ]).then(([keys, values]) => keys.map((key, i) => [key, values[i]]));\n }\n const items = [];\n return customStore('readonly', (store) => eachCursor(store, (cursor) => items.push([cursor.key, cursor.value])).then(() => items));\n });\n}\n\n\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/idb-keyval/dist/index.js?"); - -/***/ }), - -/***/ "./node_modules/multiformats/esm/src/bases/base.js": -/*!*********************************************************!*\ - !*** ./node_modules/multiformats/esm/src/bases/base.js ***! - \*********************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Codec: () => (/* binding */ Codec),\n/* harmony export */ baseX: () => (/* binding */ baseX),\n/* harmony export */ from: () => (/* binding */ from),\n/* harmony export */ or: () => (/* binding */ or),\n/* harmony export */ rfc4648: () => (/* binding */ rfc4648)\n/* harmony export */ });\n/* harmony import */ var _vendor_base_x_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../vendor/base-x.js */ \"./node_modules/multiformats/esm/vendor/base-x.js\");\n/* harmony import */ var _bytes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../bytes.js */ \"./node_modules/multiformats/esm/src/bytes.js\");\n\n\nclass Encoder {\n constructor(name, prefix, baseEncode) {\n this.name = name;\n this.prefix = prefix;\n this.baseEncode = baseEncode;\n }\n encode(bytes) {\n if (bytes instanceof Uint8Array) {\n return `${ this.prefix }${ this.baseEncode(bytes) }`;\n } else {\n throw Error('Unknown type, must be binary type');\n }\n }\n}\nclass Decoder {\n constructor(name, prefix, baseDecode) {\n this.name = name;\n this.prefix = prefix;\n if (prefix.codePointAt(0) === undefined) {\n throw new Error('Invalid prefix character');\n }\n this.prefixCodePoint = prefix.codePointAt(0);\n this.baseDecode = baseDecode;\n }\n decode(text) {\n if (typeof text === 'string') {\n if (text.codePointAt(0) !== this.prefixCodePoint) {\n throw Error(`Unable to decode multibase string ${ JSON.stringify(text) }, ${ this.name } decoder only supports inputs prefixed with ${ this.prefix }`);\n }\n return this.baseDecode(text.slice(this.prefix.length));\n } else {\n throw Error('Can only multibase decode strings');\n }\n }\n or(decoder) {\n return or(this, decoder);\n }\n}\nclass ComposedDecoder {\n constructor(decoders) {\n this.decoders = decoders;\n }\n or(decoder) {\n return or(this, decoder);\n }\n decode(input) {\n const prefix = input[0];\n const decoder = this.decoders[prefix];\n if (decoder) {\n return decoder.decode(input);\n } else {\n throw RangeError(`Unable to decode multibase string ${ JSON.stringify(input) }, only inputs prefixed with ${ Object.keys(this.decoders) } are supported`);\n }\n }\n}\nconst or = (left, right) => new ComposedDecoder({\n ...left.decoders || { [left.prefix]: left },\n ...right.decoders || { [right.prefix]: right }\n});\nclass Codec {\n constructor(name, prefix, baseEncode, baseDecode) {\n this.name = name;\n this.prefix = prefix;\n this.baseEncode = baseEncode;\n this.baseDecode = baseDecode;\n this.encoder = new Encoder(name, prefix, baseEncode);\n this.decoder = new Decoder(name, prefix, baseDecode);\n }\n encode(input) {\n return this.encoder.encode(input);\n }\n decode(input) {\n return this.decoder.decode(input);\n }\n}\nconst from = ({name, prefix, encode, decode}) => new Codec(name, prefix, encode, decode);\nconst baseX = ({prefix, name, alphabet}) => {\n const {encode, decode} = (0,_vendor_base_x_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(alphabet, name);\n return from({\n prefix,\n name,\n encode,\n decode: text => (0,_bytes_js__WEBPACK_IMPORTED_MODULE_1__.coerce)(decode(text))\n });\n};\nconst decode = (string, alphabet, bitsPerChar, name) => {\n const codes = {};\n for (let i = 0; i < alphabet.length; ++i) {\n codes[alphabet[i]] = i;\n }\n let end = string.length;\n while (string[end - 1] === '=') {\n --end;\n }\n const out = new Uint8Array(end * bitsPerChar / 8 | 0);\n let bits = 0;\n let buffer = 0;\n let written = 0;\n for (let i = 0; i < end; ++i) {\n const value = codes[string[i]];\n if (value === undefined) {\n throw new SyntaxError(`Non-${ name } character`);\n }\n buffer = buffer << bitsPerChar | value;\n bits += bitsPerChar;\n if (bits >= 8) {\n bits -= 8;\n out[written++] = 255 & buffer >> bits;\n }\n }\n if (bits >= bitsPerChar || 255 & buffer << 8 - bits) {\n throw new SyntaxError('Unexpected end of data');\n }\n return out;\n};\nconst encode = (data, alphabet, bitsPerChar) => {\n const pad = alphabet[alphabet.length - 1] === '=';\n const mask = (1 << bitsPerChar) - 1;\n let out = '';\n let bits = 0;\n let buffer = 0;\n for (let i = 0; i < data.length; ++i) {\n buffer = buffer << 8 | data[i];\n bits += 8;\n while (bits > bitsPerChar) {\n bits -= bitsPerChar;\n out += alphabet[mask & buffer >> bits];\n }\n }\n if (bits) {\n out += alphabet[mask & buffer << bitsPerChar - bits];\n }\n if (pad) {\n while (out.length * bitsPerChar & 7) {\n out += '=';\n }\n }\n return out;\n};\nconst rfc4648 = ({name, prefix, bitsPerChar, alphabet}) => {\n return from({\n prefix,\n name,\n encode(input) {\n return encode(input, alphabet, bitsPerChar);\n },\n decode(input) {\n return decode(input, alphabet, bitsPerChar, name);\n }\n });\n};\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/multiformats/esm/src/bases/base.js?"); - -/***/ }), - -/***/ "./node_modules/multiformats/esm/src/bases/base10.js": -/*!***********************************************************!*\ - !*** ./node_modules/multiformats/esm/src/bases/base10.js ***! - \***********************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ base10: () => (/* binding */ base10)\n/* harmony export */ });\n/* harmony import */ var _base_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base.js */ \"./node_modules/multiformats/esm/src/bases/base.js\");\n\nconst base10 = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.baseX)({\n prefix: '9',\n name: 'base10',\n alphabet: '0123456789'\n});\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/multiformats/esm/src/bases/base10.js?"); - -/***/ }), - -/***/ "./node_modules/multiformats/esm/src/bases/base16.js": -/*!***********************************************************!*\ - !*** ./node_modules/multiformats/esm/src/bases/base16.js ***! - \***********************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ base16: () => (/* binding */ base16),\n/* harmony export */ base16upper: () => (/* binding */ base16upper)\n/* harmony export */ });\n/* harmony import */ var _base_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base.js */ \"./node_modules/multiformats/esm/src/bases/base.js\");\n\nconst base16 = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 'f',\n name: 'base16',\n alphabet: '0123456789abcdef',\n bitsPerChar: 4\n});\nconst base16upper = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 'F',\n name: 'base16upper',\n alphabet: '0123456789ABCDEF',\n bitsPerChar: 4\n});\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/multiformats/esm/src/bases/base16.js?"); - -/***/ }), - -/***/ "./node_modules/multiformats/esm/src/bases/base2.js": -/*!**********************************************************!*\ - !*** ./node_modules/multiformats/esm/src/bases/base2.js ***! - \**********************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ base2: () => (/* binding */ base2)\n/* harmony export */ });\n/* harmony import */ var _base_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base.js */ \"./node_modules/multiformats/esm/src/bases/base.js\");\n\nconst base2 = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: '0',\n name: 'base2',\n alphabet: '01',\n bitsPerChar: 1\n});\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/multiformats/esm/src/bases/base2.js?"); - -/***/ }), - -/***/ "./node_modules/multiformats/esm/src/bases/base256emoji.js": -/*!*****************************************************************!*\ - !*** ./node_modules/multiformats/esm/src/bases/base256emoji.js ***! - \*****************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ base256emoji: () => (/* binding */ base256emoji)\n/* harmony export */ });\n/* harmony import */ var _base_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base.js */ \"./node_modules/multiformats/esm/src/bases/base.js\");\n\nconst alphabet = Array.from('\\uD83D\\uDE80\\uD83E\\uDE90\\u2604\\uD83D\\uDEF0\\uD83C\\uDF0C\\uD83C\\uDF11\\uD83C\\uDF12\\uD83C\\uDF13\\uD83C\\uDF14\\uD83C\\uDF15\\uD83C\\uDF16\\uD83C\\uDF17\\uD83C\\uDF18\\uD83C\\uDF0D\\uD83C\\uDF0F\\uD83C\\uDF0E\\uD83D\\uDC09\\u2600\\uD83D\\uDCBB\\uD83D\\uDDA5\\uD83D\\uDCBE\\uD83D\\uDCBF\\uD83D\\uDE02\\u2764\\uD83D\\uDE0D\\uD83E\\uDD23\\uD83D\\uDE0A\\uD83D\\uDE4F\\uD83D\\uDC95\\uD83D\\uDE2D\\uD83D\\uDE18\\uD83D\\uDC4D\\uD83D\\uDE05\\uD83D\\uDC4F\\uD83D\\uDE01\\uD83D\\uDD25\\uD83E\\uDD70\\uD83D\\uDC94\\uD83D\\uDC96\\uD83D\\uDC99\\uD83D\\uDE22\\uD83E\\uDD14\\uD83D\\uDE06\\uD83D\\uDE44\\uD83D\\uDCAA\\uD83D\\uDE09\\u263A\\uD83D\\uDC4C\\uD83E\\uDD17\\uD83D\\uDC9C\\uD83D\\uDE14\\uD83D\\uDE0E\\uD83D\\uDE07\\uD83C\\uDF39\\uD83E\\uDD26\\uD83C\\uDF89\\uD83D\\uDC9E\\u270C\\u2728\\uD83E\\uDD37\\uD83D\\uDE31\\uD83D\\uDE0C\\uD83C\\uDF38\\uD83D\\uDE4C\\uD83D\\uDE0B\\uD83D\\uDC97\\uD83D\\uDC9A\\uD83D\\uDE0F\\uD83D\\uDC9B\\uD83D\\uDE42\\uD83D\\uDC93\\uD83E\\uDD29\\uD83D\\uDE04\\uD83D\\uDE00\\uD83D\\uDDA4\\uD83D\\uDE03\\uD83D\\uDCAF\\uD83D\\uDE48\\uD83D\\uDC47\\uD83C\\uDFB6\\uD83D\\uDE12\\uD83E\\uDD2D\\u2763\\uD83D\\uDE1C\\uD83D\\uDC8B\\uD83D\\uDC40\\uD83D\\uDE2A\\uD83D\\uDE11\\uD83D\\uDCA5\\uD83D\\uDE4B\\uD83D\\uDE1E\\uD83D\\uDE29\\uD83D\\uDE21\\uD83E\\uDD2A\\uD83D\\uDC4A\\uD83E\\uDD73\\uD83D\\uDE25\\uD83E\\uDD24\\uD83D\\uDC49\\uD83D\\uDC83\\uD83D\\uDE33\\u270B\\uD83D\\uDE1A\\uD83D\\uDE1D\\uD83D\\uDE34\\uD83C\\uDF1F\\uD83D\\uDE2C\\uD83D\\uDE43\\uD83C\\uDF40\\uD83C\\uDF37\\uD83D\\uDE3B\\uD83D\\uDE13\\u2B50\\u2705\\uD83E\\uDD7A\\uD83C\\uDF08\\uD83D\\uDE08\\uD83E\\uDD18\\uD83D\\uDCA6\\u2714\\uD83D\\uDE23\\uD83C\\uDFC3\\uD83D\\uDC90\\u2639\\uD83C\\uDF8A\\uD83D\\uDC98\\uD83D\\uDE20\\u261D\\uD83D\\uDE15\\uD83C\\uDF3A\\uD83C\\uDF82\\uD83C\\uDF3B\\uD83D\\uDE10\\uD83D\\uDD95\\uD83D\\uDC9D\\uD83D\\uDE4A\\uD83D\\uDE39\\uD83D\\uDDE3\\uD83D\\uDCAB\\uD83D\\uDC80\\uD83D\\uDC51\\uD83C\\uDFB5\\uD83E\\uDD1E\\uD83D\\uDE1B\\uD83D\\uDD34\\uD83D\\uDE24\\uD83C\\uDF3C\\uD83D\\uDE2B\\u26BD\\uD83E\\uDD19\\u2615\\uD83C\\uDFC6\\uD83E\\uDD2B\\uD83D\\uDC48\\uD83D\\uDE2E\\uD83D\\uDE46\\uD83C\\uDF7B\\uD83C\\uDF43\\uD83D\\uDC36\\uD83D\\uDC81\\uD83D\\uDE32\\uD83C\\uDF3F\\uD83E\\uDDE1\\uD83C\\uDF81\\u26A1\\uD83C\\uDF1E\\uD83C\\uDF88\\u274C\\u270A\\uD83D\\uDC4B\\uD83D\\uDE30\\uD83E\\uDD28\\uD83D\\uDE36\\uD83E\\uDD1D\\uD83D\\uDEB6\\uD83D\\uDCB0\\uD83C\\uDF53\\uD83D\\uDCA2\\uD83E\\uDD1F\\uD83D\\uDE41\\uD83D\\uDEA8\\uD83D\\uDCA8\\uD83E\\uDD2C\\u2708\\uD83C\\uDF80\\uD83C\\uDF7A\\uD83E\\uDD13\\uD83D\\uDE19\\uD83D\\uDC9F\\uD83C\\uDF31\\uD83D\\uDE16\\uD83D\\uDC76\\uD83E\\uDD74\\u25B6\\u27A1\\u2753\\uD83D\\uDC8E\\uD83D\\uDCB8\\u2B07\\uD83D\\uDE28\\uD83C\\uDF1A\\uD83E\\uDD8B\\uD83D\\uDE37\\uD83D\\uDD7A\\u26A0\\uD83D\\uDE45\\uD83D\\uDE1F\\uD83D\\uDE35\\uD83D\\uDC4E\\uD83E\\uDD32\\uD83E\\uDD20\\uD83E\\uDD27\\uD83D\\uDCCC\\uD83D\\uDD35\\uD83D\\uDC85\\uD83E\\uDDD0\\uD83D\\uDC3E\\uD83C\\uDF52\\uD83D\\uDE17\\uD83E\\uDD11\\uD83C\\uDF0A\\uD83E\\uDD2F\\uD83D\\uDC37\\u260E\\uD83D\\uDCA7\\uD83D\\uDE2F\\uD83D\\uDC86\\uD83D\\uDC46\\uD83C\\uDFA4\\uD83D\\uDE47\\uD83C\\uDF51\\u2744\\uD83C\\uDF34\\uD83D\\uDCA3\\uD83D\\uDC38\\uD83D\\uDC8C\\uD83D\\uDCCD\\uD83E\\uDD40\\uD83E\\uDD22\\uD83D\\uDC45\\uD83D\\uDCA1\\uD83D\\uDCA9\\uD83D\\uDC50\\uD83D\\uDCF8\\uD83D\\uDC7B\\uD83E\\uDD10\\uD83E\\uDD2E\\uD83C\\uDFBC\\uD83E\\uDD75\\uD83D\\uDEA9\\uD83C\\uDF4E\\uD83C\\uDF4A\\uD83D\\uDC7C\\uD83D\\uDC8D\\uD83D\\uDCE3\\uD83E\\uDD42');\nconst alphabetBytesToChars = alphabet.reduce((p, c, i) => {\n p[i] = c;\n return p;\n}, []);\nconst alphabetCharsToBytes = alphabet.reduce((p, c, i) => {\n p[c.codePointAt(0)] = i;\n return p;\n}, []);\nfunction encode(data) {\n return data.reduce((p, c) => {\n p += alphabetBytesToChars[c];\n return p;\n }, '');\n}\nfunction decode(str) {\n const byts = [];\n for (const char of str) {\n const byt = alphabetCharsToBytes[char.codePointAt(0)];\n if (byt === undefined) {\n throw new Error(`Non-base256emoji character: ${ char }`);\n }\n byts.push(byt);\n }\n return new Uint8Array(byts);\n}\nconst base256emoji = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.from)({\n prefix: '\\uD83D\\uDE80',\n name: 'base256emoji',\n encode,\n decode\n});\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/multiformats/esm/src/bases/base256emoji.js?"); - -/***/ }), - -/***/ "./node_modules/multiformats/esm/src/bases/base32.js": -/*!***********************************************************!*\ - !*** ./node_modules/multiformats/esm/src/bases/base32.js ***! - \***********************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ base32: () => (/* binding */ base32),\n/* harmony export */ base32hex: () => (/* binding */ base32hex),\n/* harmony export */ base32hexpad: () => (/* binding */ base32hexpad),\n/* harmony export */ base32hexpadupper: () => (/* binding */ base32hexpadupper),\n/* harmony export */ base32hexupper: () => (/* binding */ base32hexupper),\n/* harmony export */ base32pad: () => (/* binding */ base32pad),\n/* harmony export */ base32padupper: () => (/* binding */ base32padupper),\n/* harmony export */ base32upper: () => (/* binding */ base32upper),\n/* harmony export */ base32z: () => (/* binding */ base32z)\n/* harmony export */ });\n/* harmony import */ var _base_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base.js */ \"./node_modules/multiformats/esm/src/bases/base.js\");\n\nconst base32 = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 'b',\n name: 'base32',\n alphabet: 'abcdefghijklmnopqrstuvwxyz234567',\n bitsPerChar: 5\n});\nconst base32upper = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 'B',\n name: 'base32upper',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567',\n bitsPerChar: 5\n});\nconst base32pad = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 'c',\n name: 'base32pad',\n alphabet: 'abcdefghijklmnopqrstuvwxyz234567=',\n bitsPerChar: 5\n});\nconst base32padupper = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 'C',\n name: 'base32padupper',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=',\n bitsPerChar: 5\n});\nconst base32hex = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 'v',\n name: 'base32hex',\n alphabet: '0123456789abcdefghijklmnopqrstuv',\n bitsPerChar: 5\n});\nconst base32hexupper = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 'V',\n name: 'base32hexupper',\n alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV',\n bitsPerChar: 5\n});\nconst base32hexpad = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 't',\n name: 'base32hexpad',\n alphabet: '0123456789abcdefghijklmnopqrstuv=',\n bitsPerChar: 5\n});\nconst base32hexpadupper = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 'T',\n name: 'base32hexpadupper',\n alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=',\n bitsPerChar: 5\n});\nconst base32z = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 'h',\n name: 'base32z',\n alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769',\n bitsPerChar: 5\n});\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/multiformats/esm/src/bases/base32.js?"); - -/***/ }), - -/***/ "./node_modules/multiformats/esm/src/bases/base36.js": -/*!***********************************************************!*\ - !*** ./node_modules/multiformats/esm/src/bases/base36.js ***! - \***********************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ base36: () => (/* binding */ base36),\n/* harmony export */ base36upper: () => (/* binding */ base36upper)\n/* harmony export */ });\n/* harmony import */ var _base_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base.js */ \"./node_modules/multiformats/esm/src/bases/base.js\");\n\nconst base36 = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.baseX)({\n prefix: 'k',\n name: 'base36',\n alphabet: '0123456789abcdefghijklmnopqrstuvwxyz'\n});\nconst base36upper = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.baseX)({\n prefix: 'K',\n name: 'base36upper',\n alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'\n});\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/multiformats/esm/src/bases/base36.js?"); - -/***/ }), - -/***/ "./node_modules/multiformats/esm/src/bases/base58.js": -/*!***********************************************************!*\ - !*** ./node_modules/multiformats/esm/src/bases/base58.js ***! - \***********************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ base58btc: () => (/* binding */ base58btc),\n/* harmony export */ base58flickr: () => (/* binding */ base58flickr)\n/* harmony export */ });\n/* harmony import */ var _base_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base.js */ \"./node_modules/multiformats/esm/src/bases/base.js\");\n\nconst base58btc = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.baseX)({\n name: 'base58btc',\n prefix: 'z',\n alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'\n});\nconst base58flickr = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.baseX)({\n name: 'base58flickr',\n prefix: 'Z',\n alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'\n});\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/multiformats/esm/src/bases/base58.js?"); - -/***/ }), - -/***/ "./node_modules/multiformats/esm/src/bases/base64.js": -/*!***********************************************************!*\ - !*** ./node_modules/multiformats/esm/src/bases/base64.js ***! - \***********************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ base64: () => (/* binding */ base64),\n/* harmony export */ base64pad: () => (/* binding */ base64pad),\n/* harmony export */ base64url: () => (/* binding */ base64url),\n/* harmony export */ base64urlpad: () => (/* binding */ base64urlpad)\n/* harmony export */ });\n/* harmony import */ var _base_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base.js */ \"./node_modules/multiformats/esm/src/bases/base.js\");\n\nconst base64 = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 'm',\n name: 'base64',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',\n bitsPerChar: 6\n});\nconst base64pad = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 'M',\n name: 'base64pad',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',\n bitsPerChar: 6\n});\nconst base64url = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 'u',\n name: 'base64url',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_',\n bitsPerChar: 6\n});\nconst base64urlpad = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 'U',\n name: 'base64urlpad',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=',\n bitsPerChar: 6\n});\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/multiformats/esm/src/bases/base64.js?"); - -/***/ }), - -/***/ "./node_modules/multiformats/esm/src/bases/base8.js": -/*!**********************************************************!*\ - !*** ./node_modules/multiformats/esm/src/bases/base8.js ***! - \**********************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ base8: () => (/* binding */ base8)\n/* harmony export */ });\n/* harmony import */ var _base_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base.js */ \"./node_modules/multiformats/esm/src/bases/base.js\");\n\nconst base8 = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: '7',\n name: 'base8',\n alphabet: '01234567',\n bitsPerChar: 3\n});\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/multiformats/esm/src/bases/base8.js?"); - -/***/ }), - -/***/ "./node_modules/multiformats/esm/src/bases/identity.js": -/*!*************************************************************!*\ - !*** ./node_modules/multiformats/esm/src/bases/identity.js ***! - \*************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ identity: () => (/* binding */ identity)\n/* harmony export */ });\n/* harmony import */ var _base_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base.js */ \"./node_modules/multiformats/esm/src/bases/base.js\");\n/* harmony import */ var _bytes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../bytes.js */ \"./node_modules/multiformats/esm/src/bytes.js\");\n\n\nconst identity = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.from)({\n prefix: '\\0',\n name: 'identity',\n encode: buf => (0,_bytes_js__WEBPACK_IMPORTED_MODULE_1__.toString)(buf),\n decode: str => (0,_bytes_js__WEBPACK_IMPORTED_MODULE_1__.fromString)(str)\n});\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/multiformats/esm/src/bases/identity.js?"); - -/***/ }), - -/***/ "./node_modules/multiformats/esm/src/basics.js": -/*!*****************************************************!*\ - !*** ./node_modules/multiformats/esm/src/basics.js ***! - \*****************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CID: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_14__.CID),\n/* harmony export */ bases: () => (/* binding */ bases),\n/* harmony export */ bytes: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_14__.bytes),\n/* harmony export */ codecs: () => (/* binding */ codecs),\n/* harmony export */ digest: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_14__.digest),\n/* harmony export */ hasher: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_14__.hasher),\n/* harmony export */ hashes: () => (/* binding */ hashes),\n/* harmony export */ varint: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_14__.varint)\n/* harmony export */ });\n/* harmony import */ var _bases_identity_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./bases/identity.js */ \"./node_modules/multiformats/esm/src/bases/identity.js\");\n/* harmony import */ var _bases_base2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bases/base2.js */ \"./node_modules/multiformats/esm/src/bases/base2.js\");\n/* harmony import */ var _bases_base8_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./bases/base8.js */ \"./node_modules/multiformats/esm/src/bases/base8.js\");\n/* harmony import */ var _bases_base10_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bases/base10.js */ \"./node_modules/multiformats/esm/src/bases/base10.js\");\n/* harmony import */ var _bases_base16_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./bases/base16.js */ \"./node_modules/multiformats/esm/src/bases/base16.js\");\n/* harmony import */ var _bases_base32_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./bases/base32.js */ \"./node_modules/multiformats/esm/src/bases/base32.js\");\n/* harmony import */ var _bases_base36_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./bases/base36.js */ \"./node_modules/multiformats/esm/src/bases/base36.js\");\n/* harmony import */ var _bases_base58_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./bases/base58.js */ \"./node_modules/multiformats/esm/src/bases/base58.js\");\n/* harmony import */ var _bases_base64_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./bases/base64.js */ \"./node_modules/multiformats/esm/src/bases/base64.js\");\n/* harmony import */ var _bases_base256emoji_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./bases/base256emoji.js */ \"./node_modules/multiformats/esm/src/bases/base256emoji.js\");\n/* harmony import */ var _hashes_sha2_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./hashes/sha2.js */ \"./node_modules/multiformats/esm/src/hashes/sha2-browser.js\");\n/* harmony import */ var _hashes_identity_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./hashes/identity.js */ \"./node_modules/multiformats/esm/src/hashes/identity.js\");\n/* harmony import */ var _codecs_raw_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./codecs/raw.js */ \"./node_modules/multiformats/esm/src/codecs/raw.js\");\n/* harmony import */ var _codecs_json_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./codecs/json.js */ \"./node_modules/multiformats/esm/src/codecs/json.js\");\n/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./index.js */ \"./node_modules/multiformats/esm/src/index.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst bases = {\n ..._bases_identity_js__WEBPACK_IMPORTED_MODULE_0__,\n ..._bases_base2_js__WEBPACK_IMPORTED_MODULE_1__,\n ..._bases_base8_js__WEBPACK_IMPORTED_MODULE_2__,\n ..._bases_base10_js__WEBPACK_IMPORTED_MODULE_3__,\n ..._bases_base16_js__WEBPACK_IMPORTED_MODULE_4__,\n ..._bases_base32_js__WEBPACK_IMPORTED_MODULE_5__,\n ..._bases_base36_js__WEBPACK_IMPORTED_MODULE_6__,\n ..._bases_base58_js__WEBPACK_IMPORTED_MODULE_7__,\n ..._bases_base64_js__WEBPACK_IMPORTED_MODULE_8__,\n ..._bases_base256emoji_js__WEBPACK_IMPORTED_MODULE_9__\n};\nconst hashes = {\n ..._hashes_sha2_js__WEBPACK_IMPORTED_MODULE_10__,\n ..._hashes_identity_js__WEBPACK_IMPORTED_MODULE_11__\n};\nconst codecs = {\n raw: _codecs_raw_js__WEBPACK_IMPORTED_MODULE_12__,\n json: _codecs_json_js__WEBPACK_IMPORTED_MODULE_13__\n};\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/multiformats/esm/src/basics.js?"); - -/***/ }), - -/***/ "./node_modules/multiformats/esm/src/bytes.js": -/*!****************************************************!*\ - !*** ./node_modules/multiformats/esm/src/bytes.js ***! - \****************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ coerce: () => (/* binding */ coerce),\n/* harmony export */ empty: () => (/* binding */ empty),\n/* harmony export */ equals: () => (/* binding */ equals),\n/* harmony export */ fromHex: () => (/* binding */ fromHex),\n/* harmony export */ fromString: () => (/* binding */ fromString),\n/* harmony export */ isBinary: () => (/* binding */ isBinary),\n/* harmony export */ toHex: () => (/* binding */ toHex),\n/* harmony export */ toString: () => (/* binding */ toString)\n/* harmony export */ });\nconst empty = new Uint8Array(0);\nconst toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '');\nconst fromHex = hex => {\n const hexes = hex.match(/../g);\n return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : empty;\n};\nconst equals = (aa, bb) => {\n if (aa === bb)\n return true;\n if (aa.byteLength !== bb.byteLength) {\n return false;\n }\n for (let ii = 0; ii < aa.byteLength; ii++) {\n if (aa[ii] !== bb[ii]) {\n return false;\n }\n }\n return true;\n};\nconst coerce = o => {\n if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array')\n return o;\n if (o instanceof ArrayBuffer)\n return new Uint8Array(o);\n if (ArrayBuffer.isView(o)) {\n return new Uint8Array(o.buffer, o.byteOffset, o.byteLength);\n }\n throw new Error('Unknown type, must be binary type');\n};\nconst isBinary = o => o instanceof ArrayBuffer || ArrayBuffer.isView(o);\nconst fromString = str => new TextEncoder().encode(str);\nconst toString = b => new TextDecoder().decode(b);\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/multiformats/esm/src/bytes.js?"); - -/***/ }), - -/***/ "./node_modules/multiformats/esm/src/cid.js": -/*!**************************************************!*\ - !*** ./node_modules/multiformats/esm/src/cid.js ***! - \**************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CID: () => (/* binding */ CID)\n/* harmony export */ });\n/* harmony import */ var _varint_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./varint.js */ \"./node_modules/multiformats/esm/src/varint.js\");\n/* harmony import */ var _hashes_digest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./hashes/digest.js */ \"./node_modules/multiformats/esm/src/hashes/digest.js\");\n/* harmony import */ var _bases_base58_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./bases/base58.js */ \"./node_modules/multiformats/esm/src/bases/base58.js\");\n/* harmony import */ var _bases_base32_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bases/base32.js */ \"./node_modules/multiformats/esm/src/bases/base32.js\");\n/* harmony import */ var _bytes_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./bytes.js */ \"./node_modules/multiformats/esm/src/bytes.js\");\n\n\n\n\n\nclass CID {\n constructor(version, code, multihash, bytes) {\n this.code = code;\n this.version = version;\n this.multihash = multihash;\n this.bytes = bytes;\n this.byteOffset = bytes.byteOffset;\n this.byteLength = bytes.byteLength;\n this.asCID = this;\n this._baseCache = new Map();\n Object.defineProperties(this, {\n byteOffset: hidden,\n byteLength: hidden,\n code: readonly,\n version: readonly,\n multihash: readonly,\n bytes: readonly,\n _baseCache: hidden,\n asCID: hidden\n });\n }\n toV0() {\n switch (this.version) {\n case 0: {\n return this;\n }\n default: {\n const {code, multihash} = this;\n if (code !== DAG_PB_CODE) {\n throw new Error('Cannot convert a non dag-pb CID to CIDv0');\n }\n if (multihash.code !== SHA_256_CODE) {\n throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0');\n }\n return CID.createV0(multihash);\n }\n }\n }\n toV1() {\n switch (this.version) {\n case 0: {\n const {code, digest} = this.multihash;\n const multihash = _hashes_digest_js__WEBPACK_IMPORTED_MODULE_1__.create(code, digest);\n return CID.createV1(this.code, multihash);\n }\n case 1: {\n return this;\n }\n default: {\n throw Error(`Can not convert CID version ${ this.version } to version 0. This is a bug please report`);\n }\n }\n }\n equals(other) {\n return other && this.code === other.code && this.version === other.version && _hashes_digest_js__WEBPACK_IMPORTED_MODULE_1__.equals(this.multihash, other.multihash);\n }\n toString(base) {\n const {bytes, version, _baseCache} = this;\n switch (version) {\n case 0:\n return toStringV0(bytes, _baseCache, base || _bases_base58_js__WEBPACK_IMPORTED_MODULE_2__.base58btc.encoder);\n default:\n return toStringV1(bytes, _baseCache, base || _bases_base32_js__WEBPACK_IMPORTED_MODULE_3__.base32.encoder);\n }\n }\n toJSON() {\n return {\n code: this.code,\n version: this.version,\n hash: this.multihash.bytes\n };\n }\n get [Symbol.toStringTag]() {\n return 'CID';\n }\n [Symbol.for('nodejs.util.inspect.custom')]() {\n return 'CID(' + this.toString() + ')';\n }\n static isCID(value) {\n deprecate(/^0\\.0/, IS_CID_DEPRECATION);\n return !!(value && (value[cidSymbol] || value.asCID === value));\n }\n get toBaseEncodedString() {\n throw new Error('Deprecated, use .toString()');\n }\n get codec() {\n throw new Error('\"codec\" property is deprecated, use integer \"code\" property instead');\n }\n get buffer() {\n throw new Error('Deprecated .buffer property, use .bytes to get Uint8Array instead');\n }\n get multibaseName() {\n throw new Error('\"multibaseName\" property is deprecated');\n }\n get prefix() {\n throw new Error('\"prefix\" property is deprecated');\n }\n static asCID(value) {\n if (value instanceof CID) {\n return value;\n } else if (value != null && value.asCID === value) {\n const {version, code, multihash, bytes} = value;\n return new CID(version, code, multihash, bytes || encodeCID(version, code, multihash.bytes));\n } else if (value != null && value[cidSymbol] === true) {\n const {version, multihash, code} = value;\n const digest = _hashes_digest_js__WEBPACK_IMPORTED_MODULE_1__.decode(multihash);\n return CID.create(version, code, digest);\n } else {\n return null;\n }\n }\n static create(version, code, digest) {\n if (typeof code !== 'number') {\n throw new Error('String codecs are no longer supported');\n }\n switch (version) {\n case 0: {\n if (code !== DAG_PB_CODE) {\n throw new Error(`Version 0 CID must use dag-pb (code: ${ DAG_PB_CODE }) block encoding`);\n } else {\n return new CID(version, code, digest, digest.bytes);\n }\n }\n case 1: {\n const bytes = encodeCID(version, code, digest.bytes);\n return new CID(version, code, digest, bytes);\n }\n default: {\n throw new Error('Invalid version');\n }\n }\n }\n static createV0(digest) {\n return CID.create(0, DAG_PB_CODE, digest);\n }\n static createV1(code, digest) {\n return CID.create(1, code, digest);\n }\n static decode(bytes) {\n const [cid, remainder] = CID.decodeFirst(bytes);\n if (remainder.length) {\n throw new Error('Incorrect length');\n }\n return cid;\n }\n static decodeFirst(bytes) {\n const specs = CID.inspectBytes(bytes);\n const prefixSize = specs.size - specs.multihashSize;\n const multihashBytes = (0,_bytes_js__WEBPACK_IMPORTED_MODULE_4__.coerce)(bytes.subarray(prefixSize, prefixSize + specs.multihashSize));\n if (multihashBytes.byteLength !== specs.multihashSize) {\n throw new Error('Incorrect length');\n }\n const digestBytes = multihashBytes.subarray(specs.multihashSize - specs.digestSize);\n const digest = new _hashes_digest_js__WEBPACK_IMPORTED_MODULE_1__.Digest(specs.multihashCode, specs.digestSize, digestBytes, multihashBytes);\n const cid = specs.version === 0 ? CID.createV0(digest) : CID.createV1(specs.codec, digest);\n return [\n cid,\n bytes.subarray(specs.size)\n ];\n }\n static inspectBytes(initialBytes) {\n let offset = 0;\n const next = () => {\n const [i, length] = _varint_js__WEBPACK_IMPORTED_MODULE_0__.decode(initialBytes.subarray(offset));\n offset += length;\n return i;\n };\n let version = next();\n let codec = DAG_PB_CODE;\n if (version === 18) {\n version = 0;\n offset = 0;\n } else if (version === 1) {\n codec = next();\n }\n if (version !== 0 && version !== 1) {\n throw new RangeError(`Invalid CID version ${ version }`);\n }\n const prefixSize = offset;\n const multihashCode = next();\n const digestSize = next();\n const size = offset + digestSize;\n const multihashSize = size - prefixSize;\n return {\n version,\n codec,\n multihashCode,\n digestSize,\n multihashSize,\n size\n };\n }\n static parse(source, base) {\n const [prefix, bytes] = parseCIDtoBytes(source, base);\n const cid = CID.decode(bytes);\n cid._baseCache.set(prefix, source);\n return cid;\n }\n}\nconst parseCIDtoBytes = (source, base) => {\n switch (source[0]) {\n case 'Q': {\n const decoder = base || _bases_base58_js__WEBPACK_IMPORTED_MODULE_2__.base58btc;\n return [\n _bases_base58_js__WEBPACK_IMPORTED_MODULE_2__.base58btc.prefix,\n decoder.decode(`${ _bases_base58_js__WEBPACK_IMPORTED_MODULE_2__.base58btc.prefix }${ source }`)\n ];\n }\n case _bases_base58_js__WEBPACK_IMPORTED_MODULE_2__.base58btc.prefix: {\n const decoder = base || _bases_base58_js__WEBPACK_IMPORTED_MODULE_2__.base58btc;\n return [\n _bases_base58_js__WEBPACK_IMPORTED_MODULE_2__.base58btc.prefix,\n decoder.decode(source)\n ];\n }\n case _bases_base32_js__WEBPACK_IMPORTED_MODULE_3__.base32.prefix: {\n const decoder = base || _bases_base32_js__WEBPACK_IMPORTED_MODULE_3__.base32;\n return [\n _bases_base32_js__WEBPACK_IMPORTED_MODULE_3__.base32.prefix,\n decoder.decode(source)\n ];\n }\n default: {\n if (base == null) {\n throw Error('To parse non base32 or base58btc encoded CID multibase decoder must be provided');\n }\n return [\n source[0],\n base.decode(source)\n ];\n }\n }\n};\nconst toStringV0 = (bytes, cache, base) => {\n const {prefix} = base;\n if (prefix !== _bases_base58_js__WEBPACK_IMPORTED_MODULE_2__.base58btc.prefix) {\n throw Error(`Cannot string encode V0 in ${ base.name } encoding`);\n }\n const cid = cache.get(prefix);\n if (cid == null) {\n const cid = base.encode(bytes).slice(1);\n cache.set(prefix, cid);\n return cid;\n } else {\n return cid;\n }\n};\nconst toStringV1 = (bytes, cache, base) => {\n const {prefix} = base;\n const cid = cache.get(prefix);\n if (cid == null) {\n const cid = base.encode(bytes);\n cache.set(prefix, cid);\n return cid;\n } else {\n return cid;\n }\n};\nconst DAG_PB_CODE = 112;\nconst SHA_256_CODE = 18;\nconst encodeCID = (version, code, multihash) => {\n const codeOffset = _varint_js__WEBPACK_IMPORTED_MODULE_0__.encodingLength(version);\n const hashOffset = codeOffset + _varint_js__WEBPACK_IMPORTED_MODULE_0__.encodingLength(code);\n const bytes = new Uint8Array(hashOffset + multihash.byteLength);\n _varint_js__WEBPACK_IMPORTED_MODULE_0__.encodeTo(version, bytes, 0);\n _varint_js__WEBPACK_IMPORTED_MODULE_0__.encodeTo(code, bytes, codeOffset);\n bytes.set(multihash, hashOffset);\n return bytes;\n};\nconst cidSymbol = Symbol.for('@ipld/js-cid/CID');\nconst readonly = {\n writable: false,\n configurable: false,\n enumerable: true\n};\nconst hidden = {\n writable: false,\n enumerable: false,\n configurable: false\n};\nconst version = '0.0.0-dev';\nconst deprecate = (range, message) => {\n if (range.test(version)) {\n console.warn(message);\n } else {\n throw new Error(message);\n }\n};\nconst IS_CID_DEPRECATION = `CID.isCID(v) is deprecated and will be removed in the next major release.\nFollowing code pattern:\n\nif (CID.isCID(value)) {\n doSomethingWithCID(value)\n}\n\nIs replaced with:\n\nconst cid = CID.asCID(value)\nif (cid) {\n // Make sure to use cid instead of value\n doSomethingWithCID(cid)\n}\n`;\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/multiformats/esm/src/cid.js?"); - -/***/ }), - -/***/ "./node_modules/multiformats/esm/src/codecs/json.js": -/*!**********************************************************!*\ - !*** ./node_modules/multiformats/esm/src/codecs/json.js ***! - \**********************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ code: () => (/* binding */ code),\n/* harmony export */ decode: () => (/* binding */ decode),\n/* harmony export */ encode: () => (/* binding */ encode),\n/* harmony export */ name: () => (/* binding */ name)\n/* harmony export */ });\nconst textEncoder = new TextEncoder();\nconst textDecoder = new TextDecoder();\nconst name = 'json';\nconst code = 512;\nconst encode = node => textEncoder.encode(JSON.stringify(node));\nconst decode = data => JSON.parse(textDecoder.decode(data));\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/multiformats/esm/src/codecs/json.js?"); - -/***/ }), - -/***/ "./node_modules/multiformats/esm/src/codecs/raw.js": -/*!*********************************************************!*\ - !*** ./node_modules/multiformats/esm/src/codecs/raw.js ***! - \*********************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ code: () => (/* binding */ code),\n/* harmony export */ decode: () => (/* binding */ decode),\n/* harmony export */ encode: () => (/* binding */ encode),\n/* harmony export */ name: () => (/* binding */ name)\n/* harmony export */ });\n/* harmony import */ var _bytes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../bytes.js */ \"./node_modules/multiformats/esm/src/bytes.js\");\n\nconst name = 'raw';\nconst code = 85;\nconst encode = node => (0,_bytes_js__WEBPACK_IMPORTED_MODULE_0__.coerce)(node);\nconst decode = data => (0,_bytes_js__WEBPACK_IMPORTED_MODULE_0__.coerce)(data);\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/multiformats/esm/src/codecs/raw.js?"); - -/***/ }), - -/***/ "./node_modules/multiformats/esm/src/hashes/digest.js": -/*!************************************************************!*\ - !*** ./node_modules/multiformats/esm/src/hashes/digest.js ***! - \************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Digest: () => (/* binding */ Digest),\n/* harmony export */ create: () => (/* binding */ create),\n/* harmony export */ decode: () => (/* binding */ decode),\n/* harmony export */ equals: () => (/* binding */ equals)\n/* harmony export */ });\n/* harmony import */ var _bytes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../bytes.js */ \"./node_modules/multiformats/esm/src/bytes.js\");\n/* harmony import */ var _varint_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../varint.js */ \"./node_modules/multiformats/esm/src/varint.js\");\n\n\nconst create = (code, digest) => {\n const size = digest.byteLength;\n const sizeOffset = _varint_js__WEBPACK_IMPORTED_MODULE_1__.encodingLength(code);\n const digestOffset = sizeOffset + _varint_js__WEBPACK_IMPORTED_MODULE_1__.encodingLength(size);\n const bytes = new Uint8Array(digestOffset + size);\n _varint_js__WEBPACK_IMPORTED_MODULE_1__.encodeTo(code, bytes, 0);\n _varint_js__WEBPACK_IMPORTED_MODULE_1__.encodeTo(size, bytes, sizeOffset);\n bytes.set(digest, digestOffset);\n return new Digest(code, size, digest, bytes);\n};\nconst decode = multihash => {\n const bytes = (0,_bytes_js__WEBPACK_IMPORTED_MODULE_0__.coerce)(multihash);\n const [code, sizeOffset] = _varint_js__WEBPACK_IMPORTED_MODULE_1__.decode(bytes);\n const [size, digestOffset] = _varint_js__WEBPACK_IMPORTED_MODULE_1__.decode(bytes.subarray(sizeOffset));\n const digest = bytes.subarray(sizeOffset + digestOffset);\n if (digest.byteLength !== size) {\n throw new Error('Incorrect length');\n }\n return new Digest(code, size, digest, bytes);\n};\nconst equals = (a, b) => {\n if (a === b) {\n return true;\n } else {\n return a.code === b.code && a.size === b.size && (0,_bytes_js__WEBPACK_IMPORTED_MODULE_0__.equals)(a.bytes, b.bytes);\n }\n};\nclass Digest {\n constructor(code, size, digest, bytes) {\n this.code = code;\n this.size = size;\n this.digest = digest;\n this.bytes = bytes;\n }\n}\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/multiformats/esm/src/hashes/digest.js?"); - -/***/ }), - -/***/ "./node_modules/multiformats/esm/src/hashes/hasher.js": -/*!************************************************************!*\ - !*** ./node_modules/multiformats/esm/src/hashes/hasher.js ***! - \************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Hasher: () => (/* binding */ Hasher),\n/* harmony export */ from: () => (/* binding */ from)\n/* harmony export */ });\n/* harmony import */ var _digest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./digest.js */ \"./node_modules/multiformats/esm/src/hashes/digest.js\");\n\nconst from = ({name, code, encode}) => new Hasher(name, code, encode);\nclass Hasher {\n constructor(name, code, encode) {\n this.name = name;\n this.code = code;\n this.encode = encode;\n }\n digest(input) {\n if (input instanceof Uint8Array) {\n const result = this.encode(input);\n return result instanceof Uint8Array ? _digest_js__WEBPACK_IMPORTED_MODULE_0__.create(this.code, result) : result.then(digest => _digest_js__WEBPACK_IMPORTED_MODULE_0__.create(this.code, digest));\n } else {\n throw Error('Unknown type, must be binary type');\n }\n }\n}\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/multiformats/esm/src/hashes/hasher.js?"); - -/***/ }), - -/***/ "./node_modules/multiformats/esm/src/hashes/identity.js": -/*!**************************************************************!*\ - !*** ./node_modules/multiformats/esm/src/hashes/identity.js ***! - \**************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ identity: () => (/* binding */ identity)\n/* harmony export */ });\n/* harmony import */ var _bytes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../bytes.js */ \"./node_modules/multiformats/esm/src/bytes.js\");\n/* harmony import */ var _digest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./digest.js */ \"./node_modules/multiformats/esm/src/hashes/digest.js\");\n\n\nconst code = 0;\nconst name = 'identity';\nconst encode = _bytes_js__WEBPACK_IMPORTED_MODULE_0__.coerce;\nconst digest = input => _digest_js__WEBPACK_IMPORTED_MODULE_1__.create(code, encode(input));\nconst identity = {\n code,\n name,\n encode,\n digest\n};\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/multiformats/esm/src/hashes/identity.js?"); - -/***/ }), - -/***/ "./node_modules/multiformats/esm/src/hashes/sha2-browser.js": -/*!******************************************************************!*\ - !*** ./node_modules/multiformats/esm/src/hashes/sha2-browser.js ***! - \******************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ sha256: () => (/* binding */ sha256),\n/* harmony export */ sha512: () => (/* binding */ sha512)\n/* harmony export */ });\n/* harmony import */ var _hasher_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hasher.js */ \"./node_modules/multiformats/esm/src/hashes/hasher.js\");\n\nconst sha = name => async data => new Uint8Array(await crypto.subtle.digest(name, data));\nconst sha256 = (0,_hasher_js__WEBPACK_IMPORTED_MODULE_0__.from)({\n name: 'sha2-256',\n code: 18,\n encode: sha('SHA-256')\n});\nconst sha512 = (0,_hasher_js__WEBPACK_IMPORTED_MODULE_0__.from)({\n name: 'sha2-512',\n code: 19,\n encode: sha('SHA-512')\n});\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/multiformats/esm/src/hashes/sha2-browser.js?"); - -/***/ }), - -/***/ "./node_modules/multiformats/esm/src/index.js": -/*!****************************************************!*\ - !*** ./node_modules/multiformats/esm/src/index.js ***! - \****************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CID: () => (/* reexport safe */ _cid_js__WEBPACK_IMPORTED_MODULE_0__.CID),\n/* harmony export */ bytes: () => (/* reexport module object */ _bytes_js__WEBPACK_IMPORTED_MODULE_2__),\n/* harmony export */ digest: () => (/* reexport module object */ _hashes_digest_js__WEBPACK_IMPORTED_MODULE_4__),\n/* harmony export */ hasher: () => (/* reexport module object */ _hashes_hasher_js__WEBPACK_IMPORTED_MODULE_3__),\n/* harmony export */ varint: () => (/* reexport module object */ _varint_js__WEBPACK_IMPORTED_MODULE_1__)\n/* harmony export */ });\n/* harmony import */ var _cid_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cid.js */ \"./node_modules/multiformats/esm/src/cid.js\");\n/* harmony import */ var _varint_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./varint.js */ \"./node_modules/multiformats/esm/src/varint.js\");\n/* harmony import */ var _bytes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./bytes.js */ \"./node_modules/multiformats/esm/src/bytes.js\");\n/* harmony import */ var _hashes_hasher_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./hashes/hasher.js */ \"./node_modules/multiformats/esm/src/hashes/hasher.js\");\n/* harmony import */ var _hashes_digest_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./hashes/digest.js */ \"./node_modules/multiformats/esm/src/hashes/digest.js\");\n\n\n\n\n\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/multiformats/esm/src/index.js?"); - -/***/ }), - -/***/ "./node_modules/multiformats/esm/src/varint.js": -/*!*****************************************************!*\ - !*** ./node_modules/multiformats/esm/src/varint.js ***! - \*****************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ decode: () => (/* binding */ decode),\n/* harmony export */ encodeTo: () => (/* binding */ encodeTo),\n/* harmony export */ encodingLength: () => (/* binding */ encodingLength)\n/* harmony export */ });\n/* harmony import */ var _vendor_varint_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../vendor/varint.js */ \"./node_modules/multiformats/esm/vendor/varint.js\");\n\nconst decode = (data, offset = 0) => {\n const code = _vendor_varint_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].decode(data, offset);\n return [\n code,\n _vendor_varint_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].decode.bytes\n ];\n};\nconst encodeTo = (int, target, offset = 0) => {\n _vendor_varint_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].encode(int, target, offset);\n return target;\n};\nconst encodingLength = int => {\n return _vendor_varint_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].encodingLength(int);\n};\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/multiformats/esm/src/varint.js?"); - -/***/ }), - -/***/ "./node_modules/multiformats/esm/vendor/base-x.js": -/*!********************************************************!*\ - !*** ./node_modules/multiformats/esm/vendor/base-x.js ***! - \********************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\nfunction base(ALPHABET, name) {\n if (ALPHABET.length >= 255) {\n throw new TypeError('Alphabet too long');\n }\n var BASE_MAP = new Uint8Array(256);\n for (var j = 0; j < BASE_MAP.length; j++) {\n BASE_MAP[j] = 255;\n }\n for (var i = 0; i < ALPHABET.length; i++) {\n var x = ALPHABET.charAt(i);\n var xc = x.charCodeAt(0);\n if (BASE_MAP[xc] !== 255) {\n throw new TypeError(x + ' is ambiguous');\n }\n BASE_MAP[xc] = i;\n }\n var BASE = ALPHABET.length;\n var LEADER = ALPHABET.charAt(0);\n var FACTOR = Math.log(BASE) / Math.log(256);\n var iFACTOR = Math.log(256) / Math.log(BASE);\n function encode(source) {\n if (source instanceof Uint8Array);\n else if (ArrayBuffer.isView(source)) {\n source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength);\n } else if (Array.isArray(source)) {\n source = Uint8Array.from(source);\n }\n if (!(source instanceof Uint8Array)) {\n throw new TypeError('Expected Uint8Array');\n }\n if (source.length === 0) {\n return '';\n }\n var zeroes = 0;\n var length = 0;\n var pbegin = 0;\n var pend = source.length;\n while (pbegin !== pend && source[pbegin] === 0) {\n pbegin++;\n zeroes++;\n }\n var size = (pend - pbegin) * iFACTOR + 1 >>> 0;\n var b58 = new Uint8Array(size);\n while (pbegin !== pend) {\n var carry = source[pbegin];\n var i = 0;\n for (var it1 = size - 1; (carry !== 0 || i < length) && it1 !== -1; it1--, i++) {\n carry += 256 * b58[it1] >>> 0;\n b58[it1] = carry % BASE >>> 0;\n carry = carry / BASE >>> 0;\n }\n if (carry !== 0) {\n throw new Error('Non-zero carry');\n }\n length = i;\n pbegin++;\n }\n var it2 = size - length;\n while (it2 !== size && b58[it2] === 0) {\n it2++;\n }\n var str = LEADER.repeat(zeroes);\n for (; it2 < size; ++it2) {\n str += ALPHABET.charAt(b58[it2]);\n }\n return str;\n }\n function decodeUnsafe(source) {\n if (typeof source !== 'string') {\n throw new TypeError('Expected String');\n }\n if (source.length === 0) {\n return new Uint8Array();\n }\n var psz = 0;\n if (source[psz] === ' ') {\n return;\n }\n var zeroes = 0;\n var length = 0;\n while (source[psz] === LEADER) {\n zeroes++;\n psz++;\n }\n var size = (source.length - psz) * FACTOR + 1 >>> 0;\n var b256 = new Uint8Array(size);\n while (source[psz]) {\n var carry = BASE_MAP[source.charCodeAt(psz)];\n if (carry === 255) {\n return;\n }\n var i = 0;\n for (var it3 = size - 1; (carry !== 0 || i < length) && it3 !== -1; it3--, i++) {\n carry += BASE * b256[it3] >>> 0;\n b256[it3] = carry % 256 >>> 0;\n carry = carry / 256 >>> 0;\n }\n if (carry !== 0) {\n throw new Error('Non-zero carry');\n }\n length = i;\n psz++;\n }\n if (source[psz] === ' ') {\n return;\n }\n var it4 = size - length;\n while (it4 !== size && b256[it4] === 0) {\n it4++;\n }\n var vch = new Uint8Array(zeroes + (size - it4));\n var j = zeroes;\n while (it4 !== size) {\n vch[j++] = b256[it4++];\n }\n return vch;\n }\n function decode(string) {\n var buffer = decodeUnsafe(string);\n if (buffer) {\n return buffer;\n }\n throw new Error(`Non-${ name } character`);\n }\n return {\n encode: encode,\n decodeUnsafe: decodeUnsafe,\n decode: decode\n };\n}\nvar src = base;\nvar _brrp__multiformats_scope_baseX = src;\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_brrp__multiformats_scope_baseX);\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/multiformats/esm/vendor/base-x.js?"); - -/***/ }), - -/***/ "./node_modules/multiformats/esm/vendor/varint.js": -/*!********************************************************!*\ - !*** ./node_modules/multiformats/esm/vendor/varint.js ***! - \********************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\nvar encode_1 = encode;\nvar MSB = 128, REST = 127, MSBALL = ~REST, INT = Math.pow(2, 31);\nfunction encode(num, out, offset) {\n out = out || [];\n offset = offset || 0;\n var oldOffset = offset;\n while (num >= INT) {\n out[offset++] = num & 255 | MSB;\n num /= 128;\n }\n while (num & MSBALL) {\n out[offset++] = num & 255 | MSB;\n num >>>= 7;\n }\n out[offset] = num | 0;\n encode.bytes = offset - oldOffset + 1;\n return out;\n}\nvar decode = read;\nvar MSB$1 = 128, REST$1 = 127;\nfunction read(buf, offset) {\n var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l = buf.length;\n do {\n if (counter >= l) {\n read.bytes = 0;\n throw new RangeError('Could not decode varint');\n }\n b = buf[counter++];\n res += shift < 28 ? (b & REST$1) << shift : (b & REST$1) * Math.pow(2, shift);\n shift += 7;\n } while (b >= MSB$1);\n read.bytes = counter - offset;\n return res;\n}\nvar N1 = Math.pow(2, 7);\nvar N2 = Math.pow(2, 14);\nvar N3 = Math.pow(2, 21);\nvar N4 = Math.pow(2, 28);\nvar N5 = Math.pow(2, 35);\nvar N6 = Math.pow(2, 42);\nvar N7 = Math.pow(2, 49);\nvar N8 = Math.pow(2, 56);\nvar N9 = Math.pow(2, 63);\nvar length = function (value) {\n return value < N1 ? 1 : value < N2 ? 2 : value < N3 ? 3 : value < N4 ? 4 : value < N5 ? 5 : value < N6 ? 6 : value < N7 ? 7 : value < N8 ? 8 : value < N9 ? 9 : 10;\n};\nvar varint = {\n encode: encode_1,\n decode: decode,\n encodingLength: length\n};\nvar _brrp_varint = varint;\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_brrp_varint);\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/multiformats/esm/vendor/varint.js?"); - -/***/ }), - -/***/ "./node_modules/uint8arrays/esm/src/alloc.js": -/*!***************************************************!*\ - !*** ./node_modules/uint8arrays/esm/src/alloc.js ***! - \***************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ alloc: () => (/* binding */ alloc),\n/* harmony export */ allocUnsafe: () => (/* binding */ allocUnsafe)\n/* harmony export */ });\n/* harmony import */ var _util_as_uint8array_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/as-uint8array.js */ \"./node_modules/uint8arrays/esm/src/util/as-uint8array.js\");\n\nfunction alloc(size = 0) {\n if (globalThis.Buffer != null && globalThis.Buffer.alloc != null) {\n return (0,_util_as_uint8array_js__WEBPACK_IMPORTED_MODULE_0__.asUint8Array)(globalThis.Buffer.alloc(size));\n }\n return new Uint8Array(size);\n}\nfunction allocUnsafe(size = 0) {\n if (globalThis.Buffer != null && globalThis.Buffer.allocUnsafe != null) {\n return (0,_util_as_uint8array_js__WEBPACK_IMPORTED_MODULE_0__.asUint8Array)(globalThis.Buffer.allocUnsafe(size));\n }\n return new Uint8Array(size);\n}\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/uint8arrays/esm/src/alloc.js?"); - -/***/ }), - -/***/ "./node_modules/uint8arrays/esm/src/compare.js": -/*!*****************************************************!*\ - !*** ./node_modules/uint8arrays/esm/src/compare.js ***! - \*****************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ compare: () => (/* binding */ compare)\n/* harmony export */ });\nfunction compare(a, b) {\n for (let i = 0; i < a.byteLength; i++) {\n if (a[i] < b[i]) {\n return -1;\n }\n if (a[i] > b[i]) {\n return 1;\n }\n }\n if (a.byteLength > b.byteLength) {\n return 1;\n }\n if (a.byteLength < b.byteLength) {\n return -1;\n }\n return 0;\n}\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/uint8arrays/esm/src/compare.js?"); - -/***/ }), - -/***/ "./node_modules/uint8arrays/esm/src/concat.js": -/*!****************************************************!*\ - !*** ./node_modules/uint8arrays/esm/src/concat.js ***! - \****************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ concat: () => (/* binding */ concat)\n/* harmony export */ });\n/* harmony import */ var _alloc_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./alloc.js */ \"./node_modules/uint8arrays/esm/src/alloc.js\");\n/* harmony import */ var _util_as_uint8array_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/as-uint8array.js */ \"./node_modules/uint8arrays/esm/src/util/as-uint8array.js\");\n\n\nfunction concat(arrays, length) {\n if (!length) {\n length = arrays.reduce((acc, curr) => acc + curr.length, 0);\n }\n const output = (0,_alloc_js__WEBPACK_IMPORTED_MODULE_0__.allocUnsafe)(length);\n let offset = 0;\n for (const arr of arrays) {\n output.set(arr, offset);\n offset += arr.length;\n }\n return (0,_util_as_uint8array_js__WEBPACK_IMPORTED_MODULE_1__.asUint8Array)(output);\n}\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/uint8arrays/esm/src/concat.js?"); - -/***/ }), - -/***/ "./node_modules/uint8arrays/esm/src/equals.js": -/*!****************************************************!*\ - !*** ./node_modules/uint8arrays/esm/src/equals.js ***! - \****************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ equals: () => (/* binding */ equals)\n/* harmony export */ });\nfunction equals(a, b) {\n if (a === b) {\n return true;\n }\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n for (let i = 0; i < a.byteLength; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/uint8arrays/esm/src/equals.js?"); - -/***/ }), - -/***/ "./node_modules/uint8arrays/esm/src/from-string.js": -/*!*********************************************************!*\ - !*** ./node_modules/uint8arrays/esm/src/from-string.js ***! - \*********************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ fromString: () => (/* binding */ fromString)\n/* harmony export */ });\n/* harmony import */ var _util_bases_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/bases.js */ \"./node_modules/uint8arrays/esm/src/util/bases.js\");\n/* harmony import */ var _util_as_uint8array_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/as-uint8array.js */ \"./node_modules/uint8arrays/esm/src/util/as-uint8array.js\");\n\n\nfunction fromString(string, encoding = 'utf8') {\n const base = _util_bases_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"][encoding];\n if (!base) {\n throw new Error(`Unsupported encoding \"${ encoding }\"`);\n }\n if ((encoding === 'utf8' || encoding === 'utf-8') && globalThis.Buffer != null && globalThis.Buffer.from != null) {\n return (0,_util_as_uint8array_js__WEBPACK_IMPORTED_MODULE_1__.asUint8Array)(globalThis.Buffer.from(string, 'utf-8'));\n }\n return base.decoder.decode(`${ base.prefix }${ string }`);\n}\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/uint8arrays/esm/src/from-string.js?"); - -/***/ }), - -/***/ "./node_modules/uint8arrays/esm/src/index.js": -/*!***************************************************!*\ - !*** ./node_modules/uint8arrays/esm/src/index.js ***! - \***************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ compare: () => (/* reexport safe */ _compare_js__WEBPACK_IMPORTED_MODULE_0__.compare),\n/* harmony export */ concat: () => (/* reexport safe */ _concat_js__WEBPACK_IMPORTED_MODULE_1__.concat),\n/* harmony export */ equals: () => (/* reexport safe */ _equals_js__WEBPACK_IMPORTED_MODULE_2__.equals),\n/* harmony export */ fromString: () => (/* reexport safe */ _from_string_js__WEBPACK_IMPORTED_MODULE_3__.fromString),\n/* harmony export */ toString: () => (/* reexport safe */ _to_string_js__WEBPACK_IMPORTED_MODULE_4__.toString),\n/* harmony export */ xor: () => (/* reexport safe */ _xor_js__WEBPACK_IMPORTED_MODULE_5__.xor)\n/* harmony export */ });\n/* harmony import */ var _compare_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./compare.js */ \"./node_modules/uint8arrays/esm/src/compare.js\");\n/* harmony import */ var _concat_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./concat.js */ \"./node_modules/uint8arrays/esm/src/concat.js\");\n/* harmony import */ var _equals_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./equals.js */ \"./node_modules/uint8arrays/esm/src/equals.js\");\n/* harmony import */ var _from_string_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./from-string.js */ \"./node_modules/uint8arrays/esm/src/from-string.js\");\n/* harmony import */ var _to_string_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./to-string.js */ \"./node_modules/uint8arrays/esm/src/to-string.js\");\n/* harmony import */ var _xor_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./xor.js */ \"./node_modules/uint8arrays/esm/src/xor.js\");\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/uint8arrays/esm/src/index.js?"); - -/***/ }), - -/***/ "./node_modules/uint8arrays/esm/src/to-string.js": -/*!*******************************************************!*\ - !*** ./node_modules/uint8arrays/esm/src/to-string.js ***! - \*******************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ toString: () => (/* binding */ toString)\n/* harmony export */ });\n/* harmony import */ var _util_bases_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/bases.js */ \"./node_modules/uint8arrays/esm/src/util/bases.js\");\n\nfunction toString(array, encoding = 'utf8') {\n const base = _util_bases_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"][encoding];\n if (!base) {\n throw new Error(`Unsupported encoding \"${ encoding }\"`);\n }\n if ((encoding === 'utf8' || encoding === 'utf-8') && globalThis.Buffer != null && globalThis.Buffer.from != null) {\n return globalThis.Buffer.from(array.buffer, array.byteOffset, array.byteLength).toString('utf8');\n }\n return base.encoder.encode(array).substring(1);\n}\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/uint8arrays/esm/src/to-string.js?"); - -/***/ }), - -/***/ "./node_modules/uint8arrays/esm/src/util/as-uint8array.js": -/*!****************************************************************!*\ - !*** ./node_modules/uint8arrays/esm/src/util/as-uint8array.js ***! - \****************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ asUint8Array: () => (/* binding */ asUint8Array)\n/* harmony export */ });\nfunction asUint8Array(buf) {\n if (globalThis.Buffer != null) {\n return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);\n }\n return buf;\n}\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/uint8arrays/esm/src/util/as-uint8array.js?"); - -/***/ }), - -/***/ "./node_modules/uint8arrays/esm/src/util/bases.js": -/*!********************************************************!*\ - !*** ./node_modules/uint8arrays/esm/src/util/bases.js ***! - \********************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var multiformats_basics__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! multiformats/basics */ \"./node_modules/multiformats/esm/src/basics.js\");\n/* harmony import */ var _alloc_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../alloc.js */ \"./node_modules/uint8arrays/esm/src/alloc.js\");\n\n\nfunction createCodec(name, prefix, encode, decode) {\n return {\n name,\n prefix,\n encoder: {\n name,\n prefix,\n encode\n },\n decoder: { decode }\n };\n}\nconst string = createCodec('utf8', 'u', buf => {\n const decoder = new TextDecoder('utf8');\n return 'u' + decoder.decode(buf);\n}, str => {\n const encoder = new TextEncoder();\n return encoder.encode(str.substring(1));\n});\nconst ascii = createCodec('ascii', 'a', buf => {\n let string = 'a';\n for (let i = 0; i < buf.length; i++) {\n string += String.fromCharCode(buf[i]);\n }\n return string;\n}, str => {\n str = str.substring(1);\n const buf = (0,_alloc_js__WEBPACK_IMPORTED_MODULE_1__.allocUnsafe)(str.length);\n for (let i = 0; i < str.length; i++) {\n buf[i] = str.charCodeAt(i);\n }\n return buf;\n});\nconst BASES = {\n utf8: string,\n 'utf-8': string,\n hex: multiformats_basics__WEBPACK_IMPORTED_MODULE_0__.bases.base16,\n latin1: ascii,\n ascii: ascii,\n binary: ascii,\n ...multiformats_basics__WEBPACK_IMPORTED_MODULE_0__.bases\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BASES);\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/uint8arrays/esm/src/util/bases.js?"); - -/***/ }), - -/***/ "./node_modules/uint8arrays/esm/src/xor.js": -/*!*************************************************!*\ - !*** ./node_modules/uint8arrays/esm/src/xor.js ***! - \*************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ xor: () => (/* binding */ xor)\n/* harmony export */ });\n/* harmony import */ var _alloc_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./alloc.js */ \"./node_modules/uint8arrays/esm/src/alloc.js\");\n/* harmony import */ var _util_as_uint8array_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/as-uint8array.js */ \"./node_modules/uint8arrays/esm/src/util/as-uint8array.js\");\n\n\nfunction xor(a, b) {\n if (a.length !== b.length) {\n throw new Error('Inputs should have the same length');\n }\n const result = (0,_alloc_js__WEBPACK_IMPORTED_MODULE_0__.allocUnsafe)(a.length);\n for (let i = 0; i < a.length; i++) {\n result[i] = a[i] ^ b[i];\n }\n return (0,_util_as_uint8array_js__WEBPACK_IMPORTED_MODULE_1__.asUint8Array)(result);\n}\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/uint8arrays/esm/src/xor.js?"); - -/***/ }), - -/***/ "./node_modules/unstorage/dist/index.mjs": -/*!***********************************************!*\ - !*** ./node_modules/unstorage/dist/index.mjs ***! - \***********************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ builtinDrivers: () => (/* binding */ builtinDrivers),\n/* harmony export */ createStorage: () => (/* binding */ createStorage),\n/* harmony export */ defineDriver: () => (/* binding */ defineDriver),\n/* harmony export */ joinKeys: () => (/* reexport safe */ _shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.j),\n/* harmony export */ normalizeBaseKey: () => (/* reexport safe */ _shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.n),\n/* harmony export */ normalizeKey: () => (/* reexport safe */ _shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.a),\n/* harmony export */ prefixStorage: () => (/* reexport safe */ _shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.p),\n/* harmony export */ restoreSnapshot: () => (/* binding */ restoreSnapshot),\n/* harmony export */ snapshot: () => (/* binding */ snapshot)\n/* harmony export */ });\n/* harmony import */ var destr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! destr */ \"./node_modules/destr/dist/index.mjs\");\n/* harmony import */ var _shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shared/unstorage.8581f561.mjs */ \"./node_modules/unstorage/dist/shared/unstorage.8581f561.mjs\");\n\n\n\n\nfunction defineDriver(factory) {\n return factory;\n}\n\nconst DRIVER_NAME = \"memory\";\nconst memory = defineDriver(() => {\n const data = /* @__PURE__ */ new Map();\n return {\n name: DRIVER_NAME,\n options: {},\n hasItem(key) {\n return data.has(key);\n },\n getItem(key) {\n return data.get(key) ?? null;\n },\n getItemRaw(key) {\n return data.get(key) ?? null;\n },\n setItem(key, value) {\n data.set(key, value);\n },\n setItemRaw(key, value) {\n data.set(key, value);\n },\n removeItem(key) {\n data.delete(key);\n },\n getKeys() {\n return Array.from(data.keys());\n },\n clear() {\n data.clear();\n },\n dispose() {\n data.clear();\n }\n };\n});\n\nfunction createStorage(options = {}) {\n const context = {\n mounts: { \"\": options.driver || memory() },\n mountpoints: [\"\"],\n watching: false,\n watchListeners: [],\n unwatch: {}\n };\n const getMount = (key) => {\n for (const base of context.mountpoints) {\n if (key.startsWith(base)) {\n return {\n base,\n relativeKey: key.slice(base.length),\n driver: context.mounts[base]\n };\n }\n }\n return {\n base: \"\",\n relativeKey: key,\n driver: context.mounts[\"\"]\n };\n };\n const getMounts = (base, includeParent) => {\n return context.mountpoints.filter(\n (mountpoint) => mountpoint.startsWith(base) || includeParent && base.startsWith(mountpoint)\n ).map((mountpoint) => ({\n relativeBase: base.length > mountpoint.length ? base.slice(mountpoint.length) : void 0,\n mountpoint,\n driver: context.mounts[mountpoint]\n }));\n };\n const onChange = (event, key) => {\n if (!context.watching) {\n return;\n }\n key = (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.a)(key);\n for (const listener of context.watchListeners) {\n listener(event, key);\n }\n };\n const startWatch = async () => {\n if (context.watching) {\n return;\n }\n context.watching = true;\n for (const mountpoint in context.mounts) {\n context.unwatch[mountpoint] = await watch(\n context.mounts[mountpoint],\n onChange,\n mountpoint\n );\n }\n };\n const stopWatch = async () => {\n if (!context.watching) {\n return;\n }\n for (const mountpoint in context.unwatch) {\n await context.unwatch[mountpoint]();\n }\n context.unwatch = {};\n context.watching = false;\n };\n const runBatch = (items, commonOptions, cb) => {\n const batches = /* @__PURE__ */ new Map();\n const getBatch = (mount) => {\n let batch = batches.get(mount.base);\n if (!batch) {\n batch = {\n driver: mount.driver,\n base: mount.base,\n items: []\n };\n batches.set(mount.base, batch);\n }\n return batch;\n };\n for (const item of items) {\n const isStringItem = typeof item === \"string\";\n const key = (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.a)(isStringItem ? item : item.key);\n const value = isStringItem ? void 0 : item.value;\n const options2 = isStringItem || !item.options ? commonOptions : { ...commonOptions, ...item.options };\n const mount = getMount(key);\n getBatch(mount).items.push({\n key,\n value,\n relativeKey: mount.relativeKey,\n options: options2\n });\n }\n return Promise.all([...batches.values()].map((batch) => cb(batch))).then(\n (r) => r.flat()\n );\n };\n const storage = {\n // Item\n hasItem(key, opts = {}) {\n key = (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.a)(key);\n const { relativeKey, driver } = getMount(key);\n return (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.b)(driver.hasItem, relativeKey, opts);\n },\n getItem(key, opts = {}) {\n key = (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.a)(key);\n const { relativeKey, driver } = getMount(key);\n return (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.b)(driver.getItem, relativeKey, opts).then(\n (value) => (0,destr__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value)\n );\n },\n getItems(items, commonOptions) {\n return runBatch(items, commonOptions, (batch) => {\n if (batch.driver.getItems) {\n return (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.b)(\n batch.driver.getItems,\n batch.items.map((item) => ({\n key: item.relativeKey,\n options: item.options\n })),\n commonOptions\n ).then(\n (r) => r.map((item) => ({\n key: (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.j)(batch.base, item.key),\n value: (0,destr__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(item.value)\n }))\n );\n }\n return Promise.all(\n batch.items.map((item) => {\n return (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.b)(\n batch.driver.getItem,\n item.relativeKey,\n item.options\n ).then((value) => ({\n key: item.key,\n value: (0,destr__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value)\n }));\n })\n );\n });\n },\n getItemRaw(key, opts = {}) {\n key = (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.a)(key);\n const { relativeKey, driver } = getMount(key);\n if (driver.getItemRaw) {\n return (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.b)(driver.getItemRaw, relativeKey, opts);\n }\n return (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.b)(driver.getItem, relativeKey, opts).then(\n (value) => (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.d)(value)\n );\n },\n async setItem(key, value, opts = {}) {\n if (value === void 0) {\n return storage.removeItem(key);\n }\n key = (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.a)(key);\n const { relativeKey, driver } = getMount(key);\n if (!driver.setItem) {\n return;\n }\n await (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.b)(driver.setItem, relativeKey, (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.s)(value), opts);\n if (!driver.watch) {\n onChange(\"update\", key);\n }\n },\n async setItems(items, commonOptions) {\n await runBatch(items, commonOptions, async (batch) => {\n if (batch.driver.setItems) {\n await (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.b)(\n batch.driver.setItems,\n batch.items.map((item) => ({\n key: item.relativeKey,\n value: (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.s)(item.value),\n options: item.options\n })),\n commonOptions\n );\n }\n if (!batch.driver.setItem) {\n return;\n }\n await Promise.all(\n batch.items.map((item) => {\n return (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.b)(\n batch.driver.setItem,\n item.relativeKey,\n (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.s)(item.value),\n item.options\n );\n })\n );\n });\n },\n async setItemRaw(key, value, opts = {}) {\n if (value === void 0) {\n return storage.removeItem(key, opts);\n }\n key = (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.a)(key);\n const { relativeKey, driver } = getMount(key);\n if (driver.setItemRaw) {\n await (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.b)(driver.setItemRaw, relativeKey, value, opts);\n } else if (driver.setItem) {\n await (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.b)(driver.setItem, relativeKey, (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.c)(value), opts);\n } else {\n return;\n }\n if (!driver.watch) {\n onChange(\"update\", key);\n }\n },\n async removeItem(key, opts = {}) {\n if (typeof opts === \"boolean\") {\n opts = { removeMeta: opts };\n }\n key = (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.a)(key);\n const { relativeKey, driver } = getMount(key);\n if (!driver.removeItem) {\n return;\n }\n await (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.b)(driver.removeItem, relativeKey, opts);\n if (opts.removeMeta || opts.removeMata) {\n await (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.b)(driver.removeItem, relativeKey + \"$\", opts);\n }\n if (!driver.watch) {\n onChange(\"remove\", key);\n }\n },\n // Meta\n async getMeta(key, opts = {}) {\n if (typeof opts === \"boolean\") {\n opts = { nativeOnly: opts };\n }\n key = (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.a)(key);\n const { relativeKey, driver } = getMount(key);\n const meta = /* @__PURE__ */ Object.create(null);\n if (driver.getMeta) {\n Object.assign(meta, await (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.b)(driver.getMeta, relativeKey, opts));\n }\n if (!opts.nativeOnly) {\n const value = await (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.b)(\n driver.getItem,\n relativeKey + \"$\",\n opts\n ).then((value_) => (0,destr__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value_));\n if (value && typeof value === \"object\") {\n if (typeof value.atime === \"string\") {\n value.atime = new Date(value.atime);\n }\n if (typeof value.mtime === \"string\") {\n value.mtime = new Date(value.mtime);\n }\n Object.assign(meta, value);\n }\n }\n return meta;\n },\n setMeta(key, value, opts = {}) {\n return this.setItem(key + \"$\", value, opts);\n },\n removeMeta(key, opts = {}) {\n return this.removeItem(key + \"$\", opts);\n },\n // Keys\n async getKeys(base, opts = {}) {\n base = (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.n)(base);\n const mounts = getMounts(base, true);\n let maskedMounts = [];\n const allKeys = [];\n for (const mount of mounts) {\n const rawKeys = await (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.b)(\n mount.driver.getKeys,\n mount.relativeBase,\n opts\n );\n const keys = rawKeys.map((key) => mount.mountpoint + (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.a)(key)).filter((key) => !maskedMounts.some((p) => key.startsWith(p)));\n allKeys.push(...keys);\n maskedMounts = [\n mount.mountpoint,\n ...maskedMounts.filter((p) => !p.startsWith(mount.mountpoint))\n ];\n }\n return base ? allKeys.filter((key) => key.startsWith(base) && !key.endsWith(\"$\")) : allKeys.filter((key) => !key.endsWith(\"$\"));\n },\n // Utils\n async clear(base, opts = {}) {\n base = (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.n)(base);\n await Promise.all(\n getMounts(base, false).map(async (m) => {\n if (m.driver.clear) {\n return (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.b)(m.driver.clear, m.relativeBase, opts);\n }\n if (m.driver.removeItem) {\n const keys = await m.driver.getKeys(m.relativeBase || \"\", opts);\n return Promise.all(\n keys.map((key) => m.driver.removeItem(key, opts))\n );\n }\n })\n );\n },\n async dispose() {\n await Promise.all(\n Object.values(context.mounts).map((driver) => dispose(driver))\n );\n },\n async watch(callback) {\n await startWatch();\n context.watchListeners.push(callback);\n return async () => {\n context.watchListeners = context.watchListeners.filter(\n (listener) => listener !== callback\n );\n if (context.watchListeners.length === 0) {\n await stopWatch();\n }\n };\n },\n async unwatch() {\n context.watchListeners = [];\n await stopWatch();\n },\n // Mount\n mount(base, driver) {\n base = (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.n)(base);\n if (base && context.mounts[base]) {\n throw new Error(`already mounted at ${base}`);\n }\n if (base) {\n context.mountpoints.push(base);\n context.mountpoints.sort((a, b) => b.length - a.length);\n }\n context.mounts[base] = driver;\n if (context.watching) {\n Promise.resolve(watch(driver, onChange, base)).then((unwatcher) => {\n context.unwatch[base] = unwatcher;\n }).catch(console.error);\n }\n return storage;\n },\n async unmount(base, _dispose = true) {\n base = (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.n)(base);\n if (!base || !context.mounts[base]) {\n return;\n }\n if (context.watching && base in context.unwatch) {\n context.unwatch[base]();\n delete context.unwatch[base];\n }\n if (_dispose) {\n await dispose(context.mounts[base]);\n }\n context.mountpoints = context.mountpoints.filter((key) => key !== base);\n delete context.mounts[base];\n },\n getMount(key = \"\") {\n key = (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.a)(key) + \":\";\n const m = getMount(key);\n return {\n driver: m.driver,\n base: m.base\n };\n },\n getMounts(base = \"\", opts = {}) {\n base = (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.a)(base);\n const mounts = getMounts(base, opts.parents);\n return mounts.map((m) => ({\n driver: m.driver,\n base: m.mountpoint\n }));\n }\n };\n return storage;\n}\nasync function snapshot(storage, base) {\n base = (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.n)(base);\n const keys = await storage.getKeys(base);\n const snapshot2 = {};\n await Promise.all(\n keys.map(async (key) => {\n snapshot2[key.slice(base.length)] = await storage.getItem(key);\n })\n );\n return snapshot2;\n}\nasync function restoreSnapshot(driver, snapshot2, base = \"\") {\n base = (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.n)(base);\n await Promise.all(\n Object.entries(snapshot2).map((e) => driver.setItem(base + e[0], e[1]))\n );\n}\nfunction watch(driver, onChange, base) {\n return driver.watch ? driver.watch((event, key) => onChange(event, base + key)) : () => {\n };\n}\nasync function dispose(driver) {\n if (typeof driver.dispose === \"function\") {\n await (0,_shared_unstorage_8581f561_mjs__WEBPACK_IMPORTED_MODULE_1__.b)(driver.dispose);\n }\n}\n\nconst builtinDrivers = {\n azureAppConfiguration: \"unstorage/drivers/azure-app-configuration\",\n azureCosmos: \"unstorage/drivers/azure-cosmos\",\n azureKeyVault: \"unstorage/drivers/azure-key-vault\",\n azureStorageBlob: \"unstorage/drivers/azure-storage-blob\",\n azureStorageTable: \"unstorage/drivers/azure-storage-table\",\n cloudflareKVBinding: \"unstorage/drivers/cloudflare-kv-binding\",\n cloudflareKVHTTP: \"unstorage/drivers/cloudflare-kv-http\",\n cloudflareR2Binding: \"unstorage/drivers/cloudflare-r2-binding\",\n fs: \"unstorage/drivers/fs\",\n fsLite: \"unstorage/drivers/fs-lite\",\n github: \"unstorage/drivers/github\",\n http: \"unstorage/drivers/http\",\n indexedb: \"unstorage/drivers/indexedb\",\n localStorage: \"unstorage/drivers/localstorage\",\n lruCache: \"unstorage/drivers/lru-cache\",\n memory: \"unstorage/drivers/memory\",\n mongodb: \"unstorage/drivers/mongodb\",\n netlifyBlobs: \"unstorage/drivers/netlify-blobs\",\n overlay: \"unstorage/drivers/overlay\",\n planetscale: \"unstorage/drivers/planetscale\",\n redis: \"unstorage/drivers/redis\",\n sessionStorage: \"unstorage/drivers/session-storage\",\n vercelKV: \"unstorage/drivers/vercel-kv\",\n /** @deprecated */\n \"cloudflare-kv-binding\": \"unstorage/drivers/cloudflare-kv-binding\",\n /** @deprecated */\n \"cloudflare-kv-http\": \"unstorage/drivers/cloudflare-kv-http\"\n};\n\n\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/unstorage/dist/index.mjs?"); - -/***/ }), - -/***/ "./node_modules/unstorage/dist/shared/unstorage.8581f561.mjs": -/*!*******************************************************************!*\ - !*** ./node_modules/unstorage/dist/shared/unstorage.8581f561.mjs ***! - \*******************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ a: () => (/* binding */ normalizeKey),\n/* harmony export */ b: () => (/* binding */ asyncCall),\n/* harmony export */ c: () => (/* binding */ serializeRaw),\n/* harmony export */ d: () => (/* binding */ deserializeRaw),\n/* harmony export */ j: () => (/* binding */ joinKeys),\n/* harmony export */ n: () => (/* binding */ normalizeBaseKey),\n/* harmony export */ p: () => (/* binding */ prefixStorage),\n/* harmony export */ s: () => (/* binding */ stringify)\n/* harmony export */ });\nfunction wrapToPromise(value) {\n if (!value || typeof value.then !== \"function\") {\n return Promise.resolve(value);\n }\n return value;\n}\nfunction asyncCall(function_, ...arguments_) {\n try {\n return wrapToPromise(function_(...arguments_));\n } catch (error) {\n return Promise.reject(error);\n }\n}\nfunction isPrimitive(value) {\n const type = typeof value;\n return value === null || type !== \"object\" && type !== \"function\";\n}\nfunction isPureObject(value) {\n const proto = Object.getPrototypeOf(value);\n return !proto || proto.isPrototypeOf(Object);\n}\nfunction stringify(value) {\n if (isPrimitive(value)) {\n return String(value);\n }\n if (isPureObject(value) || Array.isArray(value)) {\n return JSON.stringify(value);\n }\n if (typeof value.toJSON === \"function\") {\n return stringify(value.toJSON());\n }\n throw new Error(\"[unstorage] Cannot stringify value!\");\n}\nfunction checkBufferSupport() {\n if (typeof Buffer === void 0) {\n throw new TypeError(\"[unstorage] Buffer is not supported!\");\n }\n}\nconst BASE64_PREFIX = \"base64:\";\nfunction serializeRaw(value) {\n if (typeof value === \"string\") {\n return value;\n }\n checkBufferSupport();\n const base64 = Buffer.from(value).toString(\"base64\");\n return BASE64_PREFIX + base64;\n}\nfunction deserializeRaw(value) {\n if (typeof value !== \"string\") {\n return value;\n }\n if (!value.startsWith(BASE64_PREFIX)) {\n return value;\n }\n checkBufferSupport();\n return Buffer.from(value.slice(BASE64_PREFIX.length), \"base64\");\n}\n\nconst storageKeyProperties = [\n \"hasItem\",\n \"getItem\",\n \"getItemRaw\",\n \"setItem\",\n \"setItemRaw\",\n \"removeItem\",\n \"getMeta\",\n \"setMeta\",\n \"removeMeta\",\n \"getKeys\",\n \"clear\",\n \"mount\",\n \"unmount\"\n];\nfunction prefixStorage(storage, base) {\n base = normalizeBaseKey(base);\n if (!base) {\n return storage;\n }\n const nsStorage = { ...storage };\n for (const property of storageKeyProperties) {\n nsStorage[property] = (key = \"\", ...args) => (\n // @ts-ignore\n storage[property](base + key, ...args)\n );\n }\n nsStorage.getKeys = (key = \"\", ...arguments_) => storage.getKeys(base + key, ...arguments_).then((keys) => keys.map((key2) => key2.slice(base.length)));\n return nsStorage;\n}\nfunction normalizeKey(key) {\n if (!key) {\n return \"\";\n }\n return key.split(\"?\")[0].replace(/[/\\\\]/g, \":\").replace(/:+/g, \":\").replace(/^:|:$/g, \"\");\n}\nfunction joinKeys(...keys) {\n return normalizeKey(keys.join(\":\"));\n}\nfunction normalizeBaseKey(base) {\n base = normalizeKey(base);\n return base ? base + \":\" : \"\";\n}\n\n\n\n\n//# sourceURL=webpack://wallet_connect_integration/./node_modules/unstorage/dist/shared/unstorage.8581f561.mjs?"); - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ id: moduleId, -/******/ loaded: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.loaded = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/amd options */ -/******/ (() => { -/******/ __webpack_require__.amdO = {}; -/******/ })(); -/******/ -/******/ /* webpack/runtime/compat get default export */ -/******/ (() => { -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = (module) => { -/******/ var getter = module && module.__esModule ? -/******/ () => (module['default']) : -/******/ () => (module); -/******/ __webpack_require__.d(getter, { a: getter }); -/******/ return getter; -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/define property getters */ -/******/ (() => { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = (exports, definition) => { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/global */ -/******/ (() => { -/******/ __webpack_require__.g = (function() { -/******/ if (typeof globalThis === 'object') return globalThis; -/******/ try { -/******/ return this || new Function('return this')(); -/******/ } catch (e) { -/******/ if (typeof window === 'object') return window; -/******/ } -/******/ })(); -/******/ })(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) -/******/ })(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ (() => { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/node module decorator */ -/******/ (() => { -/******/ __webpack_require__.nmd = (module) => { -/******/ module.paths = []; -/******/ if (!module.children) module.children = []; -/******/ return module; -/******/ }; -/******/ })(); -/******/ -/************************************************************************/ -/******/ -/******/ // startup -/******/ // Load entry module and return exports -/******/ // This entry module can't be inlined because the eval devtool is used. -/******/ var __webpack_exports__ = __webpack_require__("./src/index.js"); -/******/ +/*! For license information please see bundle.js.LICENSE.txt */ +var t={972:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});var i=r(4512);function n(t,e,r){return void 0===e&&(e=new Uint8Array(2)),void 0===r&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}function s(t,e,r){return void 0===e&&(e=new Uint8Array(2)),void 0===r&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}function o(t,e){return void 0===e&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}function a(t,e){return void 0===e&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}function h(t,e){return void 0===e&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}function u(t,e){return void 0===e&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}function c(t,e,r){return void 0===e&&(e=new Uint8Array(4)),void 0===r&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}function l(t,e,r){return void 0===e&&(e=new Uint8Array(4)),void 0===r&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}function f(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),c(t/4294967296>>>0,e,r),c(t>>>0,e,r+4),e}function d(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),l(t>>>0,e,r),l(t/4294967296>>>0,e,r+4),e}e.readInt16BE=function(t,e){return void 0===e&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16},e.readUint16BE=function(t,e){return void 0===e&&(e=0),(t[e+0]<<8|t[e+1])>>>0},e.readInt16LE=function(t,e){return void 0===e&&(e=0),(t[e+1]<<8|t[e])<<16>>16},e.readUint16LE=function(t,e){return void 0===e&&(e=0),(t[e+1]<<8|t[e])>>>0},e.writeUint16BE=n,e.writeInt16BE=n,e.writeUint16LE=s,e.writeInt16LE=s,e.readInt32BE=o,e.readUint32BE=a,e.readInt32LE=h,e.readUint32LE=u,e.writeUint32BE=c,e.writeInt32BE=c,e.writeUint32LE=l,e.writeInt32LE=l,e.readInt64BE=function(t,e){void 0===e&&(e=0);var r=o(t,e),i=o(t,e+4);return 4294967296*r+i-4294967296*(i>>31)},e.readUint64BE=function(t,e){return void 0===e&&(e=0),4294967296*a(t,e)+a(t,e+4)},e.readInt64LE=function(t,e){void 0===e&&(e=0);var r=h(t,e);return 4294967296*h(t,e+4)+r-4294967296*(r>>31)},e.readUint64LE=function(t,e){void 0===e&&(e=0);var r=u(t,e);return 4294967296*u(t,e+4)+r},e.writeUint64BE=f,e.writeInt64BE=f,e.writeUint64LE=d,e.writeInt64LE=d,e.readUintBE=function(t,e,r){if(void 0===r&&(r=0),t%8!=0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var i=0,n=1,s=t/8+r-1;s>=r;s--)i+=e[s]*n,n*=256;return i},e.readUintLE=function(t,e,r){if(void 0===r&&(r=0),t%8!=0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var i=0,n=1,s=r;s=n;o--)r[o]=e/s&255,s*=256;return r},e.writeUintLE=function(t,e,r,n){if(void 0===r&&(r=new Uint8Array(t/8)),void 0===n&&(n=0),t%8!=0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!i.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var s=1,o=n;o{Object.defineProperty(e,"__esModule",{value:!0});var i=r(972),n=r(6228),s=20;function o(t,e,r){for(var n=1634760805,o=857760878,a=2036477234,h=1797285236,u=r[3]<<24|r[2]<<16|r[1]<<8|r[0],c=r[7]<<24|r[6]<<16|r[5]<<8|r[4],l=r[11]<<24|r[10]<<16|r[9]<<8|r[8],f=r[15]<<24|r[14]<<16|r[13]<<8|r[12],d=r[19]<<24|r[18]<<16|r[17]<<8|r[16],p=r[23]<<24|r[22]<<16|r[21]<<8|r[20],g=r[27]<<24|r[26]<<16|r[25]<<8|r[24],m=r[31]<<24|r[30]<<16|r[29]<<8|r[28],y=e[3]<<24|e[2]<<16|e[1]<<8|e[0],v=e[7]<<24|e[6]<<16|e[5]<<8|e[4],w=e[11]<<24|e[10]<<16|e[9]<<8|e[8],b=e[15]<<24|e[14]<<16|e[13]<<8|e[12],A=n,_=o,E=a,S=h,M=u,I=c,x=l,N=f,O=d,P=p,R=g,C=m,T=y,k=v,U=w,L=b,q=0;q>>16|T<<16)|0)>>>20|M<<12,I=(I^=P=P+(k=(k^=_=_+I|0)>>>16|k<<16)|0)>>>20|I<<12,x=(x^=R=R+(U=(U^=E=E+x|0)>>>16|U<<16)|0)>>>20|x<<12,N=(N^=C=C+(L=(L^=S=S+N|0)>>>16|L<<16)|0)>>>20|N<<12,x=(x^=R=R+(U=(U^=E=E+x|0)>>>24|U<<8)|0)>>>25|x<<7,N=(N^=C=C+(L=(L^=S=S+N|0)>>>24|L<<8)|0)>>>25|N<<7,I=(I^=P=P+(k=(k^=_=_+I|0)>>>24|k<<8)|0)>>>25|I<<7,M=(M^=O=O+(T=(T^=A=A+M|0)>>>24|T<<8)|0)>>>25|M<<7,I=(I^=R=R+(L=(L^=A=A+I|0)>>>16|L<<16)|0)>>>20|I<<12,x=(x^=C=C+(T=(T^=_=_+x|0)>>>16|T<<16)|0)>>>20|x<<12,N=(N^=O=O+(k=(k^=E=E+N|0)>>>16|k<<16)|0)>>>20|N<<12,M=(M^=P=P+(U=(U^=S=S+M|0)>>>16|U<<16)|0)>>>20|M<<12,N=(N^=O=O+(k=(k^=E=E+N|0)>>>24|k<<8)|0)>>>25|N<<7,M=(M^=P=P+(U=(U^=S=S+M|0)>>>24|U<<8)|0)>>>25|M<<7,x=(x^=C=C+(T=(T^=_=_+x|0)>>>24|T<<8)|0)>>>25|x<<7,I=(I^=R=R+(L=(L^=A=A+I|0)>>>24|L<<8)|0)>>>25|I<<7;i.writeUint32LE(A+n|0,t,0),i.writeUint32LE(_+o|0,t,4),i.writeUint32LE(E+a|0,t,8),i.writeUint32LE(S+h|0,t,12),i.writeUint32LE(M+u|0,t,16),i.writeUint32LE(I+c|0,t,20),i.writeUint32LE(x+l|0,t,24),i.writeUint32LE(N+f|0,t,28),i.writeUint32LE(O+d|0,t,32),i.writeUint32LE(P+p|0,t,36),i.writeUint32LE(R+g|0,t,40),i.writeUint32LE(C+m|0,t,44),i.writeUint32LE(T+y|0,t,48),i.writeUint32LE(k+v|0,t,52),i.writeUint32LE(U+w|0,t,56),i.writeUint32LE(L+b|0,t,60)}function a(t,e,r,i,s){if(void 0===s&&(s=0),32!==t.length)throw new Error("ChaCha: key size must be 32 bytes");if(i.length>>=8,e++;if(i>0)throw new Error("ChaCha: counter overflow")}e.streamXOR=a,e.stream=function(t,e,r,i){return void 0===i&&(i=0),n.wipe(r),a(t,e,r,r,i)}},1612:(t,e,r)=>{var i=r(9918),n=r(7360),s=r(6228),o=r(972),a=r(6452);e.J4=32,e.PX=12,e.iW=16;var h=new Uint8Array(16),u=function(){function t(t){if(this.nonceLength=e.PX,this.tagLength=e.iW,t.length!==e.J4)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(t)}return t.prototype.seal=function(t,e,r,n){if(t.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var o=new Uint8Array(16);o.set(t,o.length-t.length);var a=new Uint8Array(32);i.stream(this._key,o,a,4);var h,u=e.length+this.tagLength;if(n){if(n.length!==u)throw new Error("ChaCha20Poly1305: incorrect destination length");h=n}else h=new Uint8Array(u);return i.streamXOR(this._key,o,e,h,4),this._authenticate(h.subarray(h.length-this.tagLength,h.length),a,h.subarray(0,h.length-this.tagLength),r),s.wipe(o),h},t.prototype.open=function(t,e,r,n){if(t.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(e.length0&&a.update(h.subarray(i.length%16))),a.update(r),r.length%16>0&&a.update(h.subarray(r.length%16));var u=new Uint8Array(8);i&&o.writeUint64LE(i.length,u),a.update(u),o.writeUint64LE(r.length,u),a.update(u);for(var c=a.digest(),l=0;l{function r(t,e){if(t.length!==e.length)return 0;for(var r=0,i=0;i>>8}Object.defineProperty(e,"__esModule",{value:!0}),e.select=function(t,e,r){return~(t-1)&e|t-1&r},e.lessOrEqual=function(t,e){return(0|t)-(0|e)-1>>>31&1},e.compare=r,e.equal=function(t,e){return 0!==t.length&&0!==e.length&&0!==r(t,e)}},4904:(t,e,r)=>{e._S=e.K=e.TP=e.wE=e.Ee=void 0;r(7052);const i=r(4974);r(6228);function n(t){const e=new Float64Array(16);if(t)for(let r=0;r>16&1),r[t-1]&=65535;r[15]=i[15]-32767-(r[14]>>16&1);const t=r[15]>>16&1;r[14]&=65535,f(i,r,1-t)}for(let e=0;e<16;e++)t[2*e]=255&i[e],t[2*e+1]=i[e]>>8}function p(t){const e=new Uint8Array(32);return d(e,t),1&e[0]}function g(t,e,r){for(let i=0;i<16;i++)t[i]=e[i]+r[i]}function m(t,e,r){for(let i=0;i<16;i++)t[i]=e[i]-r[i]}function y(t,e,r){let i,n,s=0,o=0,a=0,h=0,u=0,c=0,l=0,f=0,d=0,p=0,g=0,m=0,y=0,v=0,w=0,b=0,A=0,_=0,E=0,S=0,M=0,I=0,x=0,N=0,O=0,P=0,R=0,C=0,T=0,k=0,U=0,L=r[0],q=r[1],D=r[2],B=r[3],j=r[4],z=r[5],F=r[6],K=r[7],H=r[8],V=r[9],G=r[10],W=r[11],$=r[12],J=r[13],Y=r[14],Q=r[15];i=e[0],s+=i*L,o+=i*q,a+=i*D,h+=i*B,u+=i*j,c+=i*z,l+=i*F,f+=i*K,d+=i*H,p+=i*V,g+=i*G,m+=i*W,y+=i*$,v+=i*J,w+=i*Y,b+=i*Q,i=e[1],o+=i*L,a+=i*q,h+=i*D,u+=i*B,c+=i*j,l+=i*z,f+=i*F,d+=i*K,p+=i*H,g+=i*V,m+=i*G,y+=i*W,v+=i*$,w+=i*J,b+=i*Y,A+=i*Q,i=e[2],a+=i*L,h+=i*q,u+=i*D,c+=i*B,l+=i*j,f+=i*z,d+=i*F,p+=i*K,g+=i*H,m+=i*V,y+=i*G,v+=i*W,w+=i*$,b+=i*J,A+=i*Y,_+=i*Q,i=e[3],h+=i*L,u+=i*q,c+=i*D,l+=i*B,f+=i*j,d+=i*z,p+=i*F,g+=i*K,m+=i*H,y+=i*V,v+=i*G,w+=i*W,b+=i*$,A+=i*J,_+=i*Y,E+=i*Q,i=e[4],u+=i*L,c+=i*q,l+=i*D,f+=i*B,d+=i*j,p+=i*z,g+=i*F,m+=i*K,y+=i*H,v+=i*V,w+=i*G,b+=i*W,A+=i*$,_+=i*J,E+=i*Y,S+=i*Q,i=e[5],c+=i*L,l+=i*q,f+=i*D,d+=i*B,p+=i*j,g+=i*z,m+=i*F,y+=i*K,v+=i*H,w+=i*V,b+=i*G,A+=i*W,_+=i*$,E+=i*J,S+=i*Y,M+=i*Q,i=e[6],l+=i*L,f+=i*q,d+=i*D,p+=i*B,g+=i*j,m+=i*z,y+=i*F,v+=i*K,w+=i*H,b+=i*V,A+=i*G,_+=i*W,E+=i*$,S+=i*J,M+=i*Y,I+=i*Q,i=e[7],f+=i*L,d+=i*q,p+=i*D,g+=i*B,m+=i*j,y+=i*z,v+=i*F,w+=i*K,b+=i*H,A+=i*V,_+=i*G,E+=i*W,S+=i*$,M+=i*J,I+=i*Y,x+=i*Q,i=e[8],d+=i*L,p+=i*q,g+=i*D,m+=i*B,y+=i*j,v+=i*z,w+=i*F,b+=i*K,A+=i*H,_+=i*V,E+=i*G,S+=i*W,M+=i*$,I+=i*J,x+=i*Y,N+=i*Q,i=e[9],p+=i*L,g+=i*q,m+=i*D,y+=i*B,v+=i*j,w+=i*z,b+=i*F,A+=i*K,_+=i*H,E+=i*V,S+=i*G,M+=i*W,I+=i*$,x+=i*J,N+=i*Y,O+=i*Q,i=e[10],g+=i*L,m+=i*q,y+=i*D,v+=i*B,w+=i*j,b+=i*z,A+=i*F,_+=i*K,E+=i*H,S+=i*V,M+=i*G,I+=i*W,x+=i*$,N+=i*J,O+=i*Y,P+=i*Q,i=e[11],m+=i*L,y+=i*q,v+=i*D,w+=i*B,b+=i*j,A+=i*z,_+=i*F,E+=i*K,S+=i*H,M+=i*V,I+=i*G,x+=i*W,N+=i*$,O+=i*J,P+=i*Y,R+=i*Q,i=e[12],y+=i*L,v+=i*q,w+=i*D,b+=i*B,A+=i*j,_+=i*z,E+=i*F,S+=i*K,M+=i*H,I+=i*V,x+=i*G,N+=i*W,O+=i*$,P+=i*J,R+=i*Y,C+=i*Q,i=e[13],v+=i*L,w+=i*q,b+=i*D,A+=i*B,_+=i*j,E+=i*z,S+=i*F,M+=i*K,I+=i*H,x+=i*V,N+=i*G,O+=i*W,P+=i*$,R+=i*J,C+=i*Y,T+=i*Q,i=e[14],w+=i*L,b+=i*q,A+=i*D,_+=i*B,E+=i*j,S+=i*z,M+=i*F,I+=i*K,x+=i*H,N+=i*V,O+=i*G,P+=i*W,R+=i*$,C+=i*J,T+=i*Y,k+=i*Q,i=e[15],b+=i*L,A+=i*q,_+=i*D,E+=i*B,S+=i*j,M+=i*z,I+=i*F,x+=i*K,N+=i*H,O+=i*V,P+=i*G,R+=i*W,C+=i*$,T+=i*J,k+=i*Y,U+=i*Q,s+=38*A,o+=38*_,a+=38*E,h+=38*S,u+=38*M,c+=38*I,l+=38*x,f+=38*N,d+=38*O,p+=38*P,g+=38*R,m+=38*C,y+=38*T,v+=38*k,w+=38*U,n=1,i=s+n+65535,n=Math.floor(i/65536),s=i-65536*n,i=o+n+65535,n=Math.floor(i/65536),o=i-65536*n,i=a+n+65535,n=Math.floor(i/65536),a=i-65536*n,i=h+n+65535,n=Math.floor(i/65536),h=i-65536*n,i=u+n+65535,n=Math.floor(i/65536),u=i-65536*n,i=c+n+65535,n=Math.floor(i/65536),c=i-65536*n,i=l+n+65535,n=Math.floor(i/65536),l=i-65536*n,i=f+n+65535,n=Math.floor(i/65536),f=i-65536*n,i=d+n+65535,n=Math.floor(i/65536),d=i-65536*n,i=p+n+65535,n=Math.floor(i/65536),p=i-65536*n,i=g+n+65535,n=Math.floor(i/65536),g=i-65536*n,i=m+n+65535,n=Math.floor(i/65536),m=i-65536*n,i=y+n+65535,n=Math.floor(i/65536),y=i-65536*n,i=v+n+65535,n=Math.floor(i/65536),v=i-65536*n,i=w+n+65535,n=Math.floor(i/65536),w=i-65536*n,i=b+n+65535,n=Math.floor(i/65536),b=i-65536*n,s+=n-1+37*(n-1),n=1,i=s+n+65535,n=Math.floor(i/65536),s=i-65536*n,i=o+n+65535,n=Math.floor(i/65536),o=i-65536*n,i=a+n+65535,n=Math.floor(i/65536),a=i-65536*n,i=h+n+65535,n=Math.floor(i/65536),h=i-65536*n,i=u+n+65535,n=Math.floor(i/65536),u=i-65536*n,i=c+n+65535,n=Math.floor(i/65536),c=i-65536*n,i=l+n+65535,n=Math.floor(i/65536),l=i-65536*n,i=f+n+65535,n=Math.floor(i/65536),f=i-65536*n,i=d+n+65535,n=Math.floor(i/65536),d=i-65536*n,i=p+n+65535,n=Math.floor(i/65536),p=i-65536*n,i=g+n+65535,n=Math.floor(i/65536),g=i-65536*n,i=m+n+65535,n=Math.floor(i/65536),m=i-65536*n,i=y+n+65535,n=Math.floor(i/65536),y=i-65536*n,i=v+n+65535,n=Math.floor(i/65536),v=i-65536*n,i=w+n+65535,n=Math.floor(i/65536),w=i-65536*n,i=b+n+65535,n=Math.floor(i/65536),b=i-65536*n,s+=n-1+37*(n-1),t[0]=s,t[1]=o,t[2]=a,t[3]=h,t[4]=u,t[5]=c,t[6]=l,t[7]=f,t[8]=d,t[9]=p,t[10]=g,t[11]=m,t[12]=y,t[13]=v,t[14]=w,t[15]=b}function v(t,e){y(t,e,e)}function w(t,e){const r=n(),i=n(),s=n(),o=n(),h=n(),u=n(),c=n(),l=n(),f=n();m(r,t[1],t[0]),m(f,e[1],e[0]),y(r,r,f),g(i,t[0],t[1]),g(f,e[0],e[1]),y(i,i,f),y(s,t[3],e[3]),y(s,s,a),y(o,t[2],e[2]),g(o,o,o),m(h,i,r),m(u,o,s),g(c,o,s),g(l,i,r),y(t[0],h,u),y(t[1],l,c),y(t[2],c,u),y(t[3],h,l)}function b(t,e,r){for(let i=0;i<4;i++)f(t[i],e[i],r)}function A(t,e){const r=n(),i=n(),s=n();(function(t,e){const r=n();let i;for(i=0;i<16;i++)r[i]=e[i];for(i=253;i>=0;i--)v(r,r),2!==i&&4!==i&&y(r,r,e);for(i=0;i<16;i++)t[i]=r[i]})(s,e[2]),y(r,e[0],s),y(i,e[1],s),d(t,i),t[31]^=p(r)<<7}function _(t,e){const r=[n(),n(),n(),n()];c(r[0],h),c(r[1],u),c(r[2],o),y(r[3],h,u),function(t,e,r){c(t[0],s),c(t[1],o),c(t[2],o),c(t[3],s);for(let i=255;i>=0;--i){const n=r[i/8|0]>>(7&i)&1;b(t,e,n),w(e,t),w(t,t),b(t,e,n)}}(t,r,e)}e.K=function(t){if(t.length!==e.TP)throw new Error(`ed25519: seed must be ${e.TP} bytes`);const r=(0,i.hash)(t);r[0]&=248,r[31]&=127,r[31]|=64;const s=new Uint8Array(32),o=[n(),n(),n(),n()];_(o,r),A(s,o);const a=new Uint8Array(64);return a.set(t),a.set(s,32),{publicKey:s,secretKey:a}};const E=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function S(t,e){let r,i,n,s;for(i=63;i>=32;--i){for(r=0,n=i-32,s=i-12;n>4)*E[n],r=e[n]>>8,e[n]&=255;for(n=0;n<32;n++)e[n]-=r*E[n];for(i=0;i<32;i++)e[i+1]+=e[i]>>8,t[i]=255&e[i]}function M(t){const e=new Float64Array(64);for(let r=0;r<64;r++)e[r]=t[r];for(let e=0;e<64;e++)t[e]=0;S(t,e)}e._S=function(t,e){const r=new Float64Array(64),s=[n(),n(),n(),n()],o=(0,i.hash)(t.subarray(0,32));o[0]&=248,o[31]&=127,o[31]|=64;const a=new Uint8Array(64);a.set(o.subarray(32),32);const h=new i.SHA512;h.update(a.subarray(32)),h.update(e);const u=h.digest();h.clean(),M(u),_(s,u),A(a,s),h.reset(),h.update(a.subarray(0,32)),h.update(t.subarray(32)),h.update(e);const c=h.digest();M(c);for(let t=0;t<32;t++)r[t]=u[t];for(let t=0;t<32;t++)for(let e=0;e<32;e++)r[t+e]+=c[t]*o[e];return S(a.subarray(32),r),a}},2670:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isSerializableHash=function(t){return void 0!==t.saveState&&void 0!==t.restoreState&&void 0!==t.cleanSavedState}},6804:(t,e,r)=>{var i=r(2412),n=r(6228),s=function(){function t(t,e,r,n){void 0===r&&(r=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=t,this._info=n;var s=i.hmac(this._hash,r,e);this._hmac=new i.HMAC(t,s),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return t.prototype._fillBuffer=function(){this._counter[0]++;var t=this._counter[0];if(0===t)throw new Error("hkdf: cannot expand more");this._hmac.reset(),t>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(t){for(var e=new Uint8Array(t),r=0;r{Object.defineProperty(e,"__esModule",{value:!0});var i=r(2670),n=r(6452),s=r(6228),o=function(){function t(t,e){this._finished=!1,this._inner=new t,this._outer=new t,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var r=new Uint8Array(this.blockSize);e.length>this.blockSize?this._inner.update(e).finish(r).clean():r.set(e);for(var n=0;n{Object.defineProperty(e,"__esModule",{value:!0}),e.mul=Math.imul||function(t,e){var r=65535&t,i=65535&e;return r*i+((t>>>16&65535)*i+r*(e>>>16&65535)<<16>>>0)|0},e.add=function(t,e){return t+e|0},e.sub=function(t,e){return t-e|0},e.rotl=function(t,e){return t<>>32-e},e.rotr=function(t,e){return t<<32-e|t>>>e},e.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},e.MAX_SAFE_INTEGER=9007199254740991,e.isSafeInteger=function(t){return e.isInteger(t)&&t>=-e.MAX_SAFE_INTEGER&&t<=e.MAX_SAFE_INTEGER}},7360:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});var i=r(6452),n=r(6228);e.DIGEST_LENGTH=16;var s=function(){function t(t){this.digestLength=e.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var r=t[0]|t[1]<<8;this._r[0]=8191&r;var i=t[2]|t[3]<<8;this._r[1]=8191&(r>>>13|i<<3);var n=t[4]|t[5]<<8;this._r[2]=7939&(i>>>10|n<<6);var s=t[6]|t[7]<<8;this._r[3]=8191&(n>>>7|s<<9);var o=t[8]|t[9]<<8;this._r[4]=255&(s>>>4|o<<12),this._r[5]=o>>>1&8190;var a=t[10]|t[11]<<8;this._r[6]=8191&(o>>>14|a<<2);var h=t[12]|t[13]<<8;this._r[7]=8065&(a>>>11|h<<5);var u=t[14]|t[15]<<8;this._r[8]=8191&(h>>>8|u<<8),this._r[9]=u>>>5&127,this._pad[0]=t[16]|t[17]<<8,this._pad[1]=t[18]|t[19]<<8,this._pad[2]=t[20]|t[21]<<8,this._pad[3]=t[22]|t[23]<<8,this._pad[4]=t[24]|t[25]<<8,this._pad[5]=t[26]|t[27]<<8,this._pad[6]=t[28]|t[29]<<8,this._pad[7]=t[30]|t[31]<<8}return t.prototype._blocks=function(t,e,r){for(var i=this._fin?0:2048,n=this._h[0],s=this._h[1],o=this._h[2],a=this._h[3],h=this._h[4],u=this._h[5],c=this._h[6],l=this._h[7],f=this._h[8],d=this._h[9],p=this._r[0],g=this._r[1],m=this._r[2],y=this._r[3],v=this._r[4],w=this._r[5],b=this._r[6],A=this._r[7],_=this._r[8],E=this._r[9];r>=16;){var S=t[e+0]|t[e+1]<<8;n+=8191&S;var M=t[e+2]|t[e+3]<<8;s+=8191&(S>>>13|M<<3);var I=t[e+4]|t[e+5]<<8;o+=8191&(M>>>10|I<<6);var x=t[e+6]|t[e+7]<<8;a+=8191&(I>>>7|x<<9);var N=t[e+8]|t[e+9]<<8;h+=8191&(x>>>4|N<<12),u+=N>>>1&8191;var O=t[e+10]|t[e+11]<<8;c+=8191&(N>>>14|O<<2);var P=t[e+12]|t[e+13]<<8;l+=8191&(O>>>11|P<<5);var R=t[e+14]|t[e+15]<<8,C=0,T=C;T+=n*p,T+=s*(5*E),T+=o*(5*_),T+=a*(5*A),C=(T+=h*(5*b))>>>13,T&=8191,T+=u*(5*w),T+=c*(5*v),T+=l*(5*y),T+=(f+=8191&(P>>>8|R<<8))*(5*m);var k=C+=(T+=(d+=R>>>5|i)*(5*g))>>>13;k+=n*g,k+=s*p,k+=o*(5*E),k+=a*(5*_),C=(k+=h*(5*A))>>>13,k&=8191,k+=u*(5*b),k+=c*(5*w),k+=l*(5*v),k+=f*(5*y),C+=(k+=d*(5*m))>>>13,k&=8191;var U=C;U+=n*m,U+=s*g,U+=o*p,U+=a*(5*E),C=(U+=h*(5*_))>>>13,U&=8191,U+=u*(5*A),U+=c*(5*b),U+=l*(5*w),U+=f*(5*v);var L=C+=(U+=d*(5*y))>>>13;L+=n*y,L+=s*m,L+=o*g,L+=a*p,C=(L+=h*(5*E))>>>13,L&=8191,L+=u*(5*_),L+=c*(5*A),L+=l*(5*b),L+=f*(5*w);var q=C+=(L+=d*(5*v))>>>13;q+=n*v,q+=s*y,q+=o*m,q+=a*g,C=(q+=h*p)>>>13,q&=8191,q+=u*(5*E),q+=c*(5*_),q+=l*(5*A),q+=f*(5*b);var D=C+=(q+=d*(5*w))>>>13;D+=n*w,D+=s*v,D+=o*y,D+=a*m,C=(D+=h*g)>>>13,D&=8191,D+=u*p,D+=c*(5*E),D+=l*(5*_),D+=f*(5*A);var B=C+=(D+=d*(5*b))>>>13;B+=n*b,B+=s*w,B+=o*v,B+=a*y,C=(B+=h*m)>>>13,B&=8191,B+=u*g,B+=c*p,B+=l*(5*E),B+=f*(5*_);var j=C+=(B+=d*(5*A))>>>13;j+=n*A,j+=s*b,j+=o*w,j+=a*v,C=(j+=h*y)>>>13,j&=8191,j+=u*m,j+=c*g,j+=l*p,j+=f*(5*E);var z=C+=(j+=d*(5*_))>>>13;z+=n*_,z+=s*A,z+=o*b,z+=a*w,C=(z+=h*v)>>>13,z&=8191,z+=u*y,z+=c*m,z+=l*g,z+=f*p;var F=C+=(z+=d*(5*E))>>>13;F+=n*E,F+=s*_,F+=o*A,F+=a*b,C=(F+=h*w)>>>13,F&=8191,F+=u*v,F+=c*y,F+=l*m,F+=f*g,n=T=8191&(C=(C=((C+=(F+=d*p)>>>13)<<2)+C|0)+(T&=8191)|0),s=k+=C>>>=13,o=U&=8191,a=L&=8191,h=q&=8191,u=D&=8191,c=B&=8191,l=j&=8191,f=z&=8191,d=F&=8191,e+=16,r-=16}this._h[0]=n,this._h[1]=s,this._h[2]=o,this._h[3]=a,this._h[4]=h,this._h[5]=u,this._h[6]=c,this._h[7]=l,this._h[8]=f,this._h[9]=d},t.prototype.finish=function(t,e){void 0===e&&(e=0);var r,i,n,s,o=new Uint16Array(10);if(this._leftover){for(s=this._leftover,this._buffer[s++]=1;s<16;s++)this._buffer[s]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(r=this._h[1]>>>13,this._h[1]&=8191,s=2;s<10;s++)this._h[s]+=r,r=this._h[s]>>>13,this._h[s]&=8191;for(this._h[0]+=5*r,r=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=r,r=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=r,o[0]=this._h[0]+5,r=o[0]>>>13,o[0]&=8191,s=1;s<10;s++)o[s]=this._h[s]+r,r=o[s]>>>13,o[s]&=8191;for(o[9]-=8192,i=(1^r)-1,s=0;s<10;s++)o[s]&=i;for(i=~i,s=0;s<10;s++)this._h[s]=this._h[s]&i|o[s];for(this._h[0]=65535&(this._h[0]|this._h[1]<<13),this._h[1]=65535&(this._h[1]>>>3|this._h[2]<<10),this._h[2]=65535&(this._h[2]>>>6|this._h[3]<<7),this._h[3]=65535&(this._h[3]>>>9|this._h[4]<<4),this._h[4]=65535&(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14),this._h[5]=65535&(this._h[6]>>>2|this._h[7]<<11),this._h[6]=65535&(this._h[7]>>>5|this._h[8]<<8),this._h[7]=65535&(this._h[8]>>>8|this._h[9]<<5),n=this._h[0]+this._pad[0],this._h[0]=65535&n,s=1;s<8;s++)n=(this._h[s]+this._pad[s]|0)+(n>>>16)|0,this._h[s]=65535&n;return t[e+0]=this._h[0]>>>0,t[e+1]=this._h[0]>>>8,t[e+2]=this._h[1]>>>0,t[e+3]=this._h[1]>>>8,t[e+4]=this._h[2]>>>0,t[e+5]=this._h[2]>>>8,t[e+6]=this._h[3]>>>0,t[e+7]=this._h[3]>>>8,t[e+8]=this._h[4]>>>0,t[e+9]=this._h[4]>>>8,t[e+10]=this._h[5]>>>0,t[e+11]=this._h[5]>>>8,t[e+12]=this._h[6]>>>0,t[e+13]=this._h[6]>>>8,t[e+14]=this._h[7]>>>0,t[e+15]=this._h[7]>>>8,this._finished=!0,this},t.prototype.update=function(t){var e,r=0,i=t.length;if(this._leftover){(e=16-this._leftover)>i&&(e=i);for(var n=0;n=16&&(e=i-i%16,this._blocks(t,r,e),r+=e,i-=e),i){for(n=0;n{Object.defineProperty(e,"__esModule",{value:!0}),e.randomStringForEntropy=e.randomString=e.randomUint32=e.randomBytes=e.defaultRandomSource=void 0;const i=r(5492),n=r(972),s=r(6228);function o(t,r=e.defaultRandomSource){return r.randomBytes(t)}e.defaultRandomSource=new i.SystemRandomSource,e.randomBytes=o,e.randomUint32=function(t=e.defaultRandomSource){const r=o(4,t),i=(0,n.readUint32LE)(r);return(0,s.wipe)(r),i};const a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function h(t,r=a,i=e.defaultRandomSource){if(r.length<2)throw new Error("randomString charset is too short");if(r.length>256)throw new Error("randomString charset is too long");let n="";const h=r.length,u=256-256%h;for(;t>0;){const e=o(Math.ceil(256*t/u),i);for(let i=0;i0;i++){const s=e[i];s{Object.defineProperty(e,"__esModule",{value:!0}),e.BrowserRandomSource=void 0,e.BrowserRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const t="undefined"!=typeof self?self.crypto||self.msCrypto:null;t&&void 0!==t.getRandomValues&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(t){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const e=new Uint8Array(t);for(let t=0;t{Object.defineProperty(e,"__esModule",{value:!0}),e.NodeRandomSource=void 0;const i=r(6228);e.NodeRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;{const t=r(9432);t&&t.randomBytes&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(t){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let e=this._crypto.randomBytes(t);if(e.length!==t)throw new Error("NodeRandomSource: got fewer bytes than requested");const r=new Uint8Array(t);for(let t=0;t{Object.defineProperty(e,"__esModule",{value:!0}),e.SystemRandomSource=void 0;const i=r(7029),n=r(5821);e.SystemRandomSource=class{constructor(){return this.isAvailable=!1,this.name="",this._source=new i.BrowserRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Browser")):(this._source=new n.NodeRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Node")):void 0)}randomBytes(t){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(t)}}},204:(t,e,r)=>{var i=r(972),n=r(6228);e.On=32,e.cS=64;var s=function(){function t(){this.digestLength=e.On,this.blockSize=e.cS,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return t.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},t.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},t.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._temp),this.reset()},t.prototype.update=function(t,e){if(void 0===e&&(e=t.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var r=0;if(this._bytesHashed+=e,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=t[r++],e--;this._bufferLength===this.blockSize&&(a(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(e>=this.blockSize&&(r=a(this._temp,this._state,t,r,e),e%=this.blockSize);e>0;)this._buffer[this._bufferLength++]=t[r++],e--;return this},t.prototype.finish=function(t){if(!this._finished){var e=this._bytesHashed,r=this._bufferLength,n=e/536870912|0,s=e<<3,o=e%64<56?64:128;this._buffer[r]=128;for(var h=r+1;h0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},t.prototype.restoreState=function(t){return this._state.set(t.state),this._bufferLength=t.bufferLength,t.buffer&&this._buffer.set(t.buffer),this._bytesHashed=t.bytesHashed,this._finished=!1,this},t.prototype.cleanSavedState=function(t){n.wipe(t.state),t.buffer&&n.wipe(t.buffer),t.bufferLength=0,t.bytesHashed=0},t}();e.aD=s;var o=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function a(t,e,r,n,s){for(;s>=64;){for(var a=e[0],h=e[1],u=e[2],c=e[3],l=e[4],f=e[5],d=e[6],p=e[7],g=0;g<16;g++){var m=n+4*g;t[g]=i.readUint32BE(r,m)}for(g=16;g<64;g++){var y=t[g-2],v=(y>>>17|y<<15)^(y>>>19|y<<13)^y>>>10,w=((y=t[g-15])>>>7|y<<25)^(y>>>18|y<<14)^y>>>3;t[g]=(v+t[g-7]|0)+(w+t[g-16]|0)}for(g=0;g<64;g++)v=(((l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7))+(l&f^~l&d)|0)+(p+(o[g]+t[g]|0)|0)|0,w=((a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+(a&h^a&u^h&u)|0,p=d,d=f,f=l,l=c+v|0,c=u,u=h,h=a,a=v+w|0;e[0]+=a,e[1]+=h,e[2]+=u,e[3]+=c,e[4]+=l,e[5]+=f,e[6]+=d,e[7]+=p,n+=64,s-=64}return n}e.tW=function(t){var e=new s;e.update(t);var r=e.digest();return e.clean(),r}},4974:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});var i=r(972),n=r(6228);e.DIGEST_LENGTH=64,e.BLOCK_SIZE=128;var s=function(){function t(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return t.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},t.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},t.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._tempHi),n.wipe(this._tempLo),this.reset()},t.prototype.update=function(t,r){if(void 0===r&&(r=t.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var i=0;if(this._bytesHashed+=r,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=t[i++],r--;this._bufferLength===this.blockSize&&(a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(r>=this.blockSize&&(i=a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,t,i,r),r%=this.blockSize);r>0;)this._buffer[this._bufferLength++]=t[i++],r--;return this},t.prototype.finish=function(t){if(!this._finished){var e=this._bytesHashed,r=this._bufferLength,n=e/536870912|0,s=e<<3,o=e%128<112?128:256;this._buffer[r]=128;for(var h=r+1;h0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},t.prototype.restoreState=function(t){return this._stateHi.set(t.stateHi),this._stateLo.set(t.stateLo),this._bufferLength=t.bufferLength,t.buffer&&this._buffer.set(t.buffer),this._bytesHashed=t.bytesHashed,this._finished=!1,this},t.prototype.cleanSavedState=function(t){n.wipe(t.stateHi),n.wipe(t.stateLo),t.buffer&&n.wipe(t.buffer),t.bufferLength=0,t.bytesHashed=0},t}();e.SHA512=s;var o=new Int32Array([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]);function a(t,e,r,n,s,a,h){for(var u,c,l,f,d,p,g,m,y=r[0],v=r[1],w=r[2],b=r[3],A=r[4],_=r[5],E=r[6],S=r[7],M=n[0],I=n[1],x=n[2],N=n[3],O=n[4],P=n[5],R=n[6],C=n[7];h>=128;){for(var T=0;T<16;T++){var k=8*T+a;t[T]=i.readUint32BE(s,k),e[T]=i.readUint32BE(s,k+4)}for(T=0;T<80;T++){var U,L,q=y,D=v,B=w,j=b,z=A,F=_,K=E,H=M,V=I,G=x,W=N,$=O,J=P,Y=R;if(d=65535&(c=C),p=c>>>16,g=65535&(u=S),m=u>>>16,d+=65535&(c=(O>>>14|A<<18)^(O>>>18|A<<14)^(A>>>9|O<<23)),p+=c>>>16,g+=65535&(u=(A>>>14|O<<18)^(A>>>18|O<<14)^(O>>>9|A<<23)),m+=u>>>16,d+=65535&(c=O&P^~O&R),p+=c>>>16,g+=65535&(u=A&_^~A&E),m+=u>>>16,u=o[2*T],d+=65535&(c=o[2*T+1]),p+=c>>>16,g+=65535&u,m+=u>>>16,u=t[T%16],p+=(c=e[T%16])>>>16,g+=65535&u,m+=u>>>16,g+=(p+=(d+=65535&c)>>>16)>>>16,d=65535&(c=f=65535&d|p<<16),p=c>>>16,g=65535&(u=l=65535&g|(m+=g>>>16)<<16),m=u>>>16,d+=65535&(c=(M>>>28|y<<4)^(y>>>2|M<<30)^(y>>>7|M<<25)),p+=c>>>16,g+=65535&(u=(y>>>28|M<<4)^(M>>>2|y<<30)^(M>>>7|y<<25)),m+=u>>>16,p+=(c=M&I^M&x^I&x)>>>16,g+=65535&(u=y&v^y&w^v&w),m+=u>>>16,U=65535&(g+=(p+=(d+=65535&c)>>>16)>>>16)|(m+=g>>>16)<<16,L=65535&d|p<<16,d=65535&(c=W),p=c>>>16,g=65535&(u=j),m=u>>>16,p+=(c=f)>>>16,g+=65535&(u=l),m+=u>>>16,v=q,w=D,b=B,A=j=65535&(g+=(p+=(d+=65535&c)>>>16)>>>16)|(m+=g>>>16)<<16,_=z,E=F,S=K,y=U,I=H,x=V,N=G,O=W=65535&d|p<<16,P=$,R=J,C=Y,M=L,T%16==15)for(k=0;k<16;k++)u=t[k],d=65535&(c=e[k]),p=c>>>16,g=65535&u,m=u>>>16,u=t[(k+9)%16],d+=65535&(c=e[(k+9)%16]),p+=c>>>16,g+=65535&u,m+=u>>>16,l=t[(k+1)%16],d+=65535&(c=((f=e[(k+1)%16])>>>1|l<<31)^(f>>>8|l<<24)^(f>>>7|l<<25)),p+=c>>>16,g+=65535&(u=(l>>>1|f<<31)^(l>>>8|f<<24)^l>>>7),m+=u>>>16,l=t[(k+14)%16],p+=(c=((f=e[(k+14)%16])>>>19|l<<13)^(l>>>29|f<<3)^(f>>>6|l<<26))>>>16,g+=65535&(u=(l>>>19|f<<13)^(f>>>29|l<<3)^l>>>6),m+=u>>>16,m+=(g+=(p+=(d+=65535&c)>>>16)>>>16)>>>16,t[k]=65535&g|m<<16,e[k]=65535&d|p<<16}d=65535&(c=M),p=c>>>16,g=65535&(u=y),m=u>>>16,u=r[0],p+=(c=n[0])>>>16,g+=65535&u,m+=u>>>16,m+=(g+=(p+=(d+=65535&c)>>>16)>>>16)>>>16,r[0]=y=65535&g|m<<16,n[0]=M=65535&d|p<<16,d=65535&(c=I),p=c>>>16,g=65535&(u=v),m=u>>>16,u=r[1],p+=(c=n[1])>>>16,g+=65535&u,m+=u>>>16,m+=(g+=(p+=(d+=65535&c)>>>16)>>>16)>>>16,r[1]=v=65535&g|m<<16,n[1]=I=65535&d|p<<16,d=65535&(c=x),p=c>>>16,g=65535&(u=w),m=u>>>16,u=r[2],p+=(c=n[2])>>>16,g+=65535&u,m+=u>>>16,m+=(g+=(p+=(d+=65535&c)>>>16)>>>16)>>>16,r[2]=w=65535&g|m<<16,n[2]=x=65535&d|p<<16,d=65535&(c=N),p=c>>>16,g=65535&(u=b),m=u>>>16,u=r[3],p+=(c=n[3])>>>16,g+=65535&u,m+=u>>>16,m+=(g+=(p+=(d+=65535&c)>>>16)>>>16)>>>16,r[3]=b=65535&g|m<<16,n[3]=N=65535&d|p<<16,d=65535&(c=O),p=c>>>16,g=65535&(u=A),m=u>>>16,u=r[4],p+=(c=n[4])>>>16,g+=65535&u,m+=u>>>16,m+=(g+=(p+=(d+=65535&c)>>>16)>>>16)>>>16,r[4]=A=65535&g|m<<16,n[4]=O=65535&d|p<<16,d=65535&(c=P),p=c>>>16,g=65535&(u=_),m=u>>>16,u=r[5],p+=(c=n[5])>>>16,g+=65535&u,m+=u>>>16,m+=(g+=(p+=(d+=65535&c)>>>16)>>>16)>>>16,r[5]=_=65535&g|m<<16,n[5]=P=65535&d|p<<16,d=65535&(c=R),p=c>>>16,g=65535&(u=E),m=u>>>16,u=r[6],p+=(c=n[6])>>>16,g+=65535&u,m+=u>>>16,m+=(g+=(p+=(d+=65535&c)>>>16)>>>16)>>>16,r[6]=E=65535&g|m<<16,n[6]=R=65535&d|p<<16,d=65535&(c=C),p=c>>>16,g=65535&(u=S),m=u>>>16,u=r[7],p+=(c=n[7])>>>16,g+=65535&u,m+=u>>>16,m+=(g+=(p+=(d+=65535&c)>>>16)>>>16)>>>16,r[7]=S=65535&g|m<<16,n[7]=C=65535&d|p<<16,a+=128,h-=128}return a}e.hash=function(t){var e=new s;e.update(t);var r=e.digest();return e.clean(),r}},6228:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.wipe=function(t){for(var e=0;e{e.Tc=e.TZ=e.wE=e.Xx=void 0;const i=r(7052),n=r(6228);function s(t){const e=new Float64Array(16);if(t)for(let r=0;r=0;--t){const e=r[t>>>3]>>>(7&t)&1;u(n,o,e),u(p,g,e),c(m,n,p),l(n,n,p),c(p,o,g),l(o,o,g),d(g,m),d(y,n),f(n,p,n),f(p,o,m),c(m,n,p),l(n,n,p),d(o,n),l(p,g,y),f(n,p,a),c(n,n,g),f(p,p,n),f(n,g,y),f(g,o,i),d(o,m),u(n,o,e),u(p,g,e)}for(let t=0;t<16;t++)i[t+16]=n[t],i[t+32]=p[t],i[t+48]=o[t],i[t+64]=g[t];const v=i.subarray(32),w=i.subarray(16);!function(t,e){const r=s();for(let t=0;t<16;t++)r[t]=e[t];for(let t=253;t>=0;t--)d(r,r),2!==t&&4!==t&&f(r,r,e);for(let e=0;e<16;e++)t[e]=r[e]}(v,v),f(w,w,v);const b=new Uint8Array(32);return function(t,e){const r=s(),i=s();for(let t=0;t<16;t++)i[t]=e[t];h(i),h(i),h(i);for(let t=0;t<2;t++){r[0]=i[0]-65517;for(let t=1;t<15;t++)r[t]=i[t]-65535-(r[t-1]>>16&1),r[t-1]&=65535;r[15]=i[15]-32767-(r[14]>>16&1);const t=r[15]>>16&1;r[14]&=65535,u(i,r,1-t)}for(let e=0;e<16;e++)t[2*e]=255&i[e],t[2*e+1]=i[e]>>8}(b,w),b}function g(t){return p(t,o)}e.TZ=function(t){const r=(0,i.randomBytes)(32,t),s=function(t){if(t.length!==e.wE)throw new Error(`x25519: seed must be ${e.wE} bytes`);const r=new Uint8Array(t);return{publicKey:g(r),secretKey:r}}(r);return(0,n.wipe)(r),s},e.Tc=function(t,r,i=!1){if(t.length!==e.Xx)throw new Error("X25519: incorrect secret key length");if(r.length!==e.Xx)throw new Error("X25519: incorrect public key length");const n=p(t,r);if(i){let t=0;for(let e=0;e{function i(){return(null===r.g||void 0===r.g?void 0:r.g.crypto)||(null===r.g||void 0===r.g?void 0:r.g.msCrypto)||{}}function n(){const t=i();return t.subtle||t.webkitSubtle}Object.defineProperty(e,"__esModule",{value:!0}),e.isBrowserCryptoAvailable=e.getSubtleCrypto=e.getBrowerCrypto=void 0,e.getBrowerCrypto=i,e.getSubtleCrypto=n,e.isBrowserCryptoAvailable=function(){return!!i()&&!!n()}},1089:(t,e)=>{function r(){return"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product}function i(){return"undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.node}Object.defineProperty(e,"__esModule",{value:!0}),e.isBrowser=e.isNode=e.isReactNative=void 0,e.isReactNative=r,e.isNode=i,e.isBrowser=function(){return!r()&&!i()}},5682:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});const i=r(5215);i.__exportStar(r(7173),e),i.__exportStar(r(1089),e)},5665:()=>{},9026:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});const i=r(5215);i.__exportStar(r(9244),e),i.__exportStar(r(1861),e)},9244:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ONE_THOUSAND=e.ONE_HUNDRED=void 0,e.ONE_HUNDRED=100,e.ONE_THOUSAND=1e3},1861:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ONE_YEAR=e.FOUR_WEEKS=e.THREE_WEEKS=e.TWO_WEEKS=e.ONE_WEEK=e.THIRTY_DAYS=e.SEVEN_DAYS=e.FIVE_DAYS=e.THREE_DAYS=e.ONE_DAY=e.TWENTY_FOUR_HOURS=e.TWELVE_HOURS=e.SIX_HOURS=e.THREE_HOURS=e.ONE_HOUR=e.SIXTY_MINUTES=e.THIRTY_MINUTES=e.TEN_MINUTES=e.FIVE_MINUTES=e.ONE_MINUTE=e.SIXTY_SECONDS=e.THIRTY_SECONDS=e.TEN_SECONDS=e.FIVE_SECONDS=e.ONE_SECOND=void 0,e.ONE_SECOND=1,e.FIVE_SECONDS=5,e.TEN_SECONDS=10,e.THIRTY_SECONDS=30,e.SIXTY_SECONDS=60,e.ONE_MINUTE=e.SIXTY_SECONDS,e.FIVE_MINUTES=5*e.ONE_MINUTE,e.TEN_MINUTES=10*e.ONE_MINUTE,e.THIRTY_MINUTES=30*e.ONE_MINUTE,e.SIXTY_MINUTES=60*e.ONE_MINUTE,e.ONE_HOUR=e.SIXTY_MINUTES,e.THREE_HOURS=3*e.ONE_HOUR,e.SIX_HOURS=6*e.ONE_HOUR,e.TWELVE_HOURS=12*e.ONE_HOUR,e.TWENTY_FOUR_HOURS=24*e.ONE_HOUR,e.ONE_DAY=e.TWENTY_FOUR_HOURS,e.THREE_DAYS=3*e.ONE_DAY,e.FIVE_DAYS=5*e.ONE_DAY,e.SEVEN_DAYS=7*e.ONE_DAY,e.THIRTY_DAYS=30*e.ONE_DAY,e.ONE_WEEK=e.SEVEN_DAYS,e.TWO_WEEKS=2*e.ONE_WEEK,e.THREE_WEEKS=3*e.ONE_WEEK,e.FOUR_WEEKS=4*e.ONE_WEEK,e.ONE_YEAR=365*e.ONE_DAY},8900:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});const i=r(5215);i.__exportStar(r(9606),e),i.__exportStar(r(9883),e),i.__exportStar(r(2010),e),i.__exportStar(r(9026),e)},2010:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),r(5215).__exportStar(r(3093),e)},3093:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IWatch=void 0,e.IWatch=class{}},221:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.fromMiliseconds=e.toMiliseconds=void 0;const i=r(9026);e.toMiliseconds=function(t){return t*i.ONE_THOUSAND},e.fromMiliseconds=function(t){return Math.floor(t/i.ONE_THOUSAND)}},2985:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.delay=void 0,e.delay=function(t){return new Promise((e=>{setTimeout((()=>{e(!0)}),t)}))}},9606:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});const i=r(5215);i.__exportStar(r(2985),e),i.__exportStar(r(221),e)},9883:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Watch=void 0;class r{constructor(){this.timestamps=new Map}start(t){if(this.timestamps.has(t))throw new Error(`Watch already started for label: ${t}`);this.timestamps.set(t,{started:Date.now()})}stop(t){const e=this.get(t);if(void 0!==e.elapsed)throw new Error(`Watch already stopped for label: ${t}`);const r=Date.now()-e.started;this.timestamps.set(t,{started:e.started,elapsed:r})}get(t){const e=this.timestamps.get(t);if(void 0===e)throw new Error(`No timestamp found for label: ${t}`);return e}elapsed(t){const e=this.get(t);return e.elapsed||Date.now()-e.started}}e.Watch=r,e.default=r},8196:(t,e)=>{function r(t){let e;return"undefined"!=typeof window&&void 0!==window[t]&&(e=window[t]),e}function i(t){const e=r(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}Object.defineProperty(e,"__esModule",{value:!0}),e.getLocalStorage=e.getLocalStorageOrThrow=e.getCrypto=e.getCryptoOrThrow=e.getLocation=e.getLocationOrThrow=e.getNavigator=e.getNavigatorOrThrow=e.getDocument=e.getDocumentOrThrow=e.getFromWindowOrThrow=e.getFromWindow=void 0,e.getFromWindow=r,e.getFromWindowOrThrow=i,e.getDocumentOrThrow=function(){return i("document")},e.getDocument=function(){return r("document")},e.getNavigatorOrThrow=function(){return i("navigator")},e.getNavigator=function(){return r("navigator")},e.getLocationOrThrow=function(){return i("location")},e.getLocation=function(){return r("location")},e.getCryptoOrThrow=function(){return i("crypto")},e.getCrypto=function(){return r("crypto")},e.getLocalStorageOrThrow=function(){return i("localStorage")},e.getLocalStorage=function(){return r("localStorage")}},2063:(t,e,r)=>{e.g=void 0;const i=r(8196);e.g=function(){let t,e;try{t=i.getDocumentOrThrow(),e=i.getLocationOrThrow()}catch(t){return null}function r(...e){const r=t.getElementsByTagName("meta");for(let t=0;ti.getAttribute(t))).filter((t=>!!t&&e.includes(t)));if(n.length&&n){const t=i.getAttribute("content");if(t)return t}}return""}const n=function(){let e=r("name","og:site_name","og:title","twitter:title");return e||(e=t.title),e}(),s=r("description","og:description","twitter:description","keywords"),o=e.origin,a=function(){const r=t.getElementsByTagName("link"),i=[];for(let t=0;t-1){const t=n.getAttribute("href");if(t)if(-1===t.toLowerCase().indexOf("https:")&&-1===t.toLowerCase().indexOf("http:")&&0!==t.indexOf("//")){let r=e.protocol+"//"+e.host;if(0===t.indexOf("/"))r+=t;else{const i=e.pathname.split("/");i.pop(),r+=i.join("/")+"/"+t}i.push(r)}else if(0===t.indexOf("//")){const r=e.protocol+t;i.push(r)}else i.push(t)}}return i}();return{description:s,url:o,icons:a,name:n}}},9404:function(t,e,r){!function(t,e){function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function s(t,e,r){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof t?t.exports=s:e.BN=s,s.BN=s,s.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(7790).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void i(!1,"Invalid character in "+t)}function h(t,e,r){var i=a(t,r);return r-1>=e&&(i|=a(t,r-1)<<4),i}function u(t,e,r,n){for(var s=0,o=0,a=Math.min(t.length,r),h=e;h=49?u-49+10:u>=17?u-17+10:u,i(u>=0&&o0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[s]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===r)for(n=0,s=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this._strip()},s.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=2)n=h(t,e,i)<=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this._strip()},s.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var s=t.length-r,o=s%i,a=Math.min(s,s-o)+r,h=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(t){s.prototype.inspect=l}else s.prototype.inspect=l;function l(){return(this.red?""}var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],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 g(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],s=0|e.words[0],o=n*s,a=67108863&o,h=o/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,f=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=f;d++){var p=u-d|0;c+=(o=(n=0|t.words[p])*(s=0|e.words[d])+l)/67108864|0,l=67108863&o}r.words[u]=0|l,h=0|c}return 0!==h?r.words[u]=0|h:r.length--,r._strip()}s.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,s=0,o=0;o>>24-n&16777215,(n+=2)>=26&&(n-=26,o--),r=0!==s||o!==this.length-1?f[6-h.length]+h+r:h+r}for(0!==s&&(r=s.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var u=d[t],c=p[t];r="";var l=this.clone();for(l.negative=0;!l.isZero();){var g=l.modrn(c).toString(t);r=(l=l.idivn(c)).isZero()?g+r:f[u-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(t,e){return this.toArrayLike(o,t,e)}),s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},s.prototype.toArrayLike=function(t,e,r){this._strip();var n=this.byteLength(),s=r||Math.max(1,n);i(n<=s,"byte array longer than desired length"),i(s>0,"Requested array length <= 0");var o=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,s);return this["_toArrayLike"+("le"===e?"LE":"BE")](o,n),o},s.prototype._toArrayLikeLE=function(t,e){for(var r=0,i=0,n=0,s=0;n>8&255),r>16&255),6===s?(r>24&255),i=0,s=0):(i=o>>>24,s+=2)}if(r=0&&(t[r--]=o>>8&255),r>=0&&(t[r--]=o>>16&255),6===s?(r>=0&&(t[r--]=o>>24&255),i=0,s=0):(i=o>>>24,s+=2)}if(r>=0)for(t[r--]=i;r>=0;)t[r--]=0},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 8191&e||(r+=13,e>>>=13),127&e||(r+=7,e>>>=7),15&e||(r+=4,e>>>=4),3&e||(r+=2,e>>>=2),1&e||r++,r},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.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)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);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,i=t):(r=t,i=this);for(var n=0,s=0;s>>26;for(;0!==n&&s>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;st.length?this.clone().iadd(t):t.clone().iadd(this)},s.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,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var s=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==s&&o>26,this.words[o]=67108863&e;if(0===s&&o>>13,d=0|o[1],p=8191&d,g=d>>>13,m=0|o[2],y=8191&m,v=m>>>13,w=0|o[3],b=8191&w,A=w>>>13,_=0|o[4],E=8191&_,S=_>>>13,M=0|o[5],I=8191&M,x=M>>>13,N=0|o[6],O=8191&N,P=N>>>13,R=0|o[7],C=8191&R,T=R>>>13,k=0|o[8],U=8191&k,L=k>>>13,q=0|o[9],D=8191&q,B=q>>>13,j=0|a[0],z=8191&j,F=j>>>13,K=0|a[1],H=8191&K,V=K>>>13,G=0|a[2],W=8191&G,$=G>>>13,J=0|a[3],Y=8191&J,Q=J>>>13,X=0|a[4],Z=8191&X,tt=X>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],st=8191&nt,ot=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ct=0|a[8],lt=8191&ct,ft=ct>>>13,dt=0|a[9],pt=8191&dt,gt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(u+(i=Math.imul(l,z))|0)+((8191&(n=(n=Math.imul(l,F))+Math.imul(f,z)|0))<<13)|0;u=((s=Math.imul(f,F))+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(p,z),n=(n=Math.imul(p,F))+Math.imul(g,z)|0,s=Math.imul(g,F);var yt=(u+(i=i+Math.imul(l,H)|0)|0)+((8191&(n=(n=n+Math.imul(l,V)|0)+Math.imul(f,H)|0))<<13)|0;u=((s=s+Math.imul(f,V)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(y,z),n=(n=Math.imul(y,F))+Math.imul(v,z)|0,s=Math.imul(v,F),i=i+Math.imul(p,H)|0,n=(n=n+Math.imul(p,V)|0)+Math.imul(g,H)|0,s=s+Math.imul(g,V)|0;var vt=(u+(i=i+Math.imul(l,W)|0)|0)+((8191&(n=(n=n+Math.imul(l,$)|0)+Math.imul(f,W)|0))<<13)|0;u=((s=s+Math.imul(f,$)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(b,z),n=(n=Math.imul(b,F))+Math.imul(A,z)|0,s=Math.imul(A,F),i=i+Math.imul(y,H)|0,n=(n=n+Math.imul(y,V)|0)+Math.imul(v,H)|0,s=s+Math.imul(v,V)|0,i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(g,W)|0,s=s+Math.imul(g,$)|0;var wt=(u+(i=i+Math.imul(l,Y)|0)|0)+((8191&(n=(n=n+Math.imul(l,Q)|0)+Math.imul(f,Y)|0))<<13)|0;u=((s=s+Math.imul(f,Q)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(E,z),n=(n=Math.imul(E,F))+Math.imul(S,z)|0,s=Math.imul(S,F),i=i+Math.imul(b,H)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(A,H)|0,s=s+Math.imul(A,V)|0,i=i+Math.imul(y,W)|0,n=(n=n+Math.imul(y,$)|0)+Math.imul(v,W)|0,s=s+Math.imul(v,$)|0,i=i+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,Q)|0)+Math.imul(g,Y)|0,s=s+Math.imul(g,Q)|0;var bt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(f,Z)|0))<<13)|0;u=((s=s+Math.imul(f,tt)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(I,z),n=(n=Math.imul(I,F))+Math.imul(x,z)|0,s=Math.imul(x,F),i=i+Math.imul(E,H)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(S,H)|0,s=s+Math.imul(S,V)|0,i=i+Math.imul(b,W)|0,n=(n=n+Math.imul(b,$)|0)+Math.imul(A,W)|0,s=s+Math.imul(A,$)|0,i=i+Math.imul(y,Y)|0,n=(n=n+Math.imul(y,Q)|0)+Math.imul(v,Y)|0,s=s+Math.imul(v,Q)|0,i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(g,Z)|0,s=s+Math.imul(g,tt)|0;var At=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(f,rt)|0))<<13)|0;u=((s=s+Math.imul(f,it)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(O,z),n=(n=Math.imul(O,F))+Math.imul(P,z)|0,s=Math.imul(P,F),i=i+Math.imul(I,H)|0,n=(n=n+Math.imul(I,V)|0)+Math.imul(x,H)|0,s=s+Math.imul(x,V)|0,i=i+Math.imul(E,W)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(S,W)|0,s=s+Math.imul(S,$)|0,i=i+Math.imul(b,Y)|0,n=(n=n+Math.imul(b,Q)|0)+Math.imul(A,Y)|0,s=s+Math.imul(A,Q)|0,i=i+Math.imul(y,Z)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(v,Z)|0,s=s+Math.imul(v,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(g,rt)|0,s=s+Math.imul(g,it)|0;var _t=(u+(i=i+Math.imul(l,st)|0)|0)+((8191&(n=(n=n+Math.imul(l,ot)|0)+Math.imul(f,st)|0))<<13)|0;u=((s=s+Math.imul(f,ot)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(C,z),n=(n=Math.imul(C,F))+Math.imul(T,z)|0,s=Math.imul(T,F),i=i+Math.imul(O,H)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(P,H)|0,s=s+Math.imul(P,V)|0,i=i+Math.imul(I,W)|0,n=(n=n+Math.imul(I,$)|0)+Math.imul(x,W)|0,s=s+Math.imul(x,$)|0,i=i+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,Q)|0)+Math.imul(S,Y)|0,s=s+Math.imul(S,Q)|0,i=i+Math.imul(b,Z)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(A,Z)|0,s=s+Math.imul(A,tt)|0,i=i+Math.imul(y,rt)|0,n=(n=n+Math.imul(y,it)|0)+Math.imul(v,rt)|0,s=s+Math.imul(v,it)|0,i=i+Math.imul(p,st)|0,n=(n=n+Math.imul(p,ot)|0)+Math.imul(g,st)|0,s=s+Math.imul(g,ot)|0;var Et=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(f,ht)|0))<<13)|0;u=((s=s+Math.imul(f,ut)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(U,z),n=(n=Math.imul(U,F))+Math.imul(L,z)|0,s=Math.imul(L,F),i=i+Math.imul(C,H)|0,n=(n=n+Math.imul(C,V)|0)+Math.imul(T,H)|0,s=s+Math.imul(T,V)|0,i=i+Math.imul(O,W)|0,n=(n=n+Math.imul(O,$)|0)+Math.imul(P,W)|0,s=s+Math.imul(P,$)|0,i=i+Math.imul(I,Y)|0,n=(n=n+Math.imul(I,Q)|0)+Math.imul(x,Y)|0,s=s+Math.imul(x,Q)|0,i=i+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(S,Z)|0,s=s+Math.imul(S,tt)|0,i=i+Math.imul(b,rt)|0,n=(n=n+Math.imul(b,it)|0)+Math.imul(A,rt)|0,s=s+Math.imul(A,it)|0,i=i+Math.imul(y,st)|0,n=(n=n+Math.imul(y,ot)|0)+Math.imul(v,st)|0,s=s+Math.imul(v,ot)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(g,ht)|0,s=s+Math.imul(g,ut)|0;var St=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ft)|0)+Math.imul(f,lt)|0))<<13)|0;u=((s=s+Math.imul(f,ft)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(D,z),n=(n=Math.imul(D,F))+Math.imul(B,z)|0,s=Math.imul(B,F),i=i+Math.imul(U,H)|0,n=(n=n+Math.imul(U,V)|0)+Math.imul(L,H)|0,s=s+Math.imul(L,V)|0,i=i+Math.imul(C,W)|0,n=(n=n+Math.imul(C,$)|0)+Math.imul(T,W)|0,s=s+Math.imul(T,$)|0,i=i+Math.imul(O,Y)|0,n=(n=n+Math.imul(O,Q)|0)+Math.imul(P,Y)|0,s=s+Math.imul(P,Q)|0,i=i+Math.imul(I,Z)|0,n=(n=n+Math.imul(I,tt)|0)+Math.imul(x,Z)|0,s=s+Math.imul(x,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(S,rt)|0,s=s+Math.imul(S,it)|0,i=i+Math.imul(b,st)|0,n=(n=n+Math.imul(b,ot)|0)+Math.imul(A,st)|0,s=s+Math.imul(A,ot)|0,i=i+Math.imul(y,ht)|0,n=(n=n+Math.imul(y,ut)|0)+Math.imul(v,ht)|0,s=s+Math.imul(v,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ft)|0)+Math.imul(g,lt)|0,s=s+Math.imul(g,ft)|0;var Mt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,gt)|0)+Math.imul(f,pt)|0))<<13)|0;u=((s=s+Math.imul(f,gt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(D,H),n=(n=Math.imul(D,V))+Math.imul(B,H)|0,s=Math.imul(B,V),i=i+Math.imul(U,W)|0,n=(n=n+Math.imul(U,$)|0)+Math.imul(L,W)|0,s=s+Math.imul(L,$)|0,i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,Q)|0)+Math.imul(T,Y)|0,s=s+Math.imul(T,Q)|0,i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(P,Z)|0,s=s+Math.imul(P,tt)|0,i=i+Math.imul(I,rt)|0,n=(n=n+Math.imul(I,it)|0)+Math.imul(x,rt)|0,s=s+Math.imul(x,it)|0,i=i+Math.imul(E,st)|0,n=(n=n+Math.imul(E,ot)|0)+Math.imul(S,st)|0,s=s+Math.imul(S,ot)|0,i=i+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,ut)|0)+Math.imul(A,ht)|0,s=s+Math.imul(A,ut)|0,i=i+Math.imul(y,lt)|0,n=(n=n+Math.imul(y,ft)|0)+Math.imul(v,lt)|0,s=s+Math.imul(v,ft)|0;var It=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;u=((s=s+Math.imul(g,gt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(D,W),n=(n=Math.imul(D,$))+Math.imul(B,W)|0,s=Math.imul(B,$),i=i+Math.imul(U,Y)|0,n=(n=n+Math.imul(U,Q)|0)+Math.imul(L,Y)|0,s=s+Math.imul(L,Q)|0,i=i+Math.imul(C,Z)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(T,Z)|0,s=s+Math.imul(T,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(P,rt)|0,s=s+Math.imul(P,it)|0,i=i+Math.imul(I,st)|0,n=(n=n+Math.imul(I,ot)|0)+Math.imul(x,st)|0,s=s+Math.imul(x,ot)|0,i=i+Math.imul(E,ht)|0,n=(n=n+Math.imul(E,ut)|0)+Math.imul(S,ht)|0,s=s+Math.imul(S,ut)|0,i=i+Math.imul(b,lt)|0,n=(n=n+Math.imul(b,ft)|0)+Math.imul(A,lt)|0,s=s+Math.imul(A,ft)|0;var xt=(u+(i=i+Math.imul(y,pt)|0)|0)+((8191&(n=(n=n+Math.imul(y,gt)|0)+Math.imul(v,pt)|0))<<13)|0;u=((s=s+Math.imul(v,gt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(D,Y),n=(n=Math.imul(D,Q))+Math.imul(B,Y)|0,s=Math.imul(B,Q),i=i+Math.imul(U,Z)|0,n=(n=n+Math.imul(U,tt)|0)+Math.imul(L,Z)|0,s=s+Math.imul(L,tt)|0,i=i+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(T,rt)|0,s=s+Math.imul(T,it)|0,i=i+Math.imul(O,st)|0,n=(n=n+Math.imul(O,ot)|0)+Math.imul(P,st)|0,s=s+Math.imul(P,ot)|0,i=i+Math.imul(I,ht)|0,n=(n=n+Math.imul(I,ut)|0)+Math.imul(x,ht)|0,s=s+Math.imul(x,ut)|0,i=i+Math.imul(E,lt)|0,n=(n=n+Math.imul(E,ft)|0)+Math.imul(S,lt)|0,s=s+Math.imul(S,ft)|0;var Nt=(u+(i=i+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,gt)|0)+Math.imul(A,pt)|0))<<13)|0;u=((s=s+Math.imul(A,gt)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(D,Z),n=(n=Math.imul(D,tt))+Math.imul(B,Z)|0,s=Math.imul(B,tt),i=i+Math.imul(U,rt)|0,n=(n=n+Math.imul(U,it)|0)+Math.imul(L,rt)|0,s=s+Math.imul(L,it)|0,i=i+Math.imul(C,st)|0,n=(n=n+Math.imul(C,ot)|0)+Math.imul(T,st)|0,s=s+Math.imul(T,ot)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(P,ht)|0,s=s+Math.imul(P,ut)|0,i=i+Math.imul(I,lt)|0,n=(n=n+Math.imul(I,ft)|0)+Math.imul(x,lt)|0,s=s+Math.imul(x,ft)|0;var Ot=(u+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,gt)|0)+Math.imul(S,pt)|0))<<13)|0;u=((s=s+Math.imul(S,gt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(D,rt),n=(n=Math.imul(D,it))+Math.imul(B,rt)|0,s=Math.imul(B,it),i=i+Math.imul(U,st)|0,n=(n=n+Math.imul(U,ot)|0)+Math.imul(L,st)|0,s=s+Math.imul(L,ot)|0,i=i+Math.imul(C,ht)|0,n=(n=n+Math.imul(C,ut)|0)+Math.imul(T,ht)|0,s=s+Math.imul(T,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ft)|0)+Math.imul(P,lt)|0,s=s+Math.imul(P,ft)|0;var Pt=(u+(i=i+Math.imul(I,pt)|0)|0)+((8191&(n=(n=n+Math.imul(I,gt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((s=s+Math.imul(x,gt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(D,st),n=(n=Math.imul(D,ot))+Math.imul(B,st)|0,s=Math.imul(B,ot),i=i+Math.imul(U,ht)|0,n=(n=n+Math.imul(U,ut)|0)+Math.imul(L,ht)|0,s=s+Math.imul(L,ut)|0,i=i+Math.imul(C,lt)|0,n=(n=n+Math.imul(C,ft)|0)+Math.imul(T,lt)|0,s=s+Math.imul(T,ft)|0;var Rt=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,gt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((s=s+Math.imul(P,gt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(D,ht),n=(n=Math.imul(D,ut))+Math.imul(B,ht)|0,s=Math.imul(B,ut),i=i+Math.imul(U,lt)|0,n=(n=n+Math.imul(U,ft)|0)+Math.imul(L,lt)|0,s=s+Math.imul(L,ft)|0;var Ct=(u+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,gt)|0)+Math.imul(T,pt)|0))<<13)|0;u=((s=s+Math.imul(T,gt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,i=Math.imul(D,lt),n=(n=Math.imul(D,ft))+Math.imul(B,lt)|0,s=Math.imul(B,ft);var Tt=(u+(i=i+Math.imul(U,pt)|0)|0)+((8191&(n=(n=n+Math.imul(U,gt)|0)+Math.imul(L,pt)|0))<<13)|0;u=((s=s+Math.imul(L,gt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863;var kt=(u+(i=Math.imul(D,pt))|0)+((8191&(n=(n=Math.imul(D,gt))+Math.imul(B,pt)|0))<<13)|0;return u=((s=Math.imul(B,gt))+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,h[0]=mt,h[1]=yt,h[2]=vt,h[3]=wt,h[4]=bt,h[5]=At,h[6]=_t,h[7]=Et,h[8]=St,h[9]=Mt,h[10]=It,h[11]=xt,h[12]=Nt,h[13]=Ot,h[14]=Pt,h[15]=Rt,h[16]=Ct,h[17]=Tt,h[18]=kt,0!==u&&(h[19]=u,r.length++),r};function y(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,s=0;s>>26)|0)>>>26,o&=67108863}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r._strip()}function v(t,e,r){return y(t,e,r)}function w(t,e){this.x=t,this.y=e}Math.imul||(m=g),s.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?m(this,t,e):r<63?g(this,t,e):r<1024?y(this,t,e):v(this,t,e)},w.prototype.makeRBT=function(t){for(var e=new Array(t),r=s.prototype._countBits(t)-1,i=0;i>=1;return i},w.prototype.permute=function(t,e,r,i,n,s){for(var o=0;o>>=1)n++;return 1<>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*e;o>=26,r+=s/67108864|0,r+=o>>>26,this.words[n]=67108863&o}return 0!==r&&(this.words[n]=r,this.length++),e?this.ineg():this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n&1}return e}(t);if(0===e.length)return new s(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,s=67108863>>>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;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var s=t%26,o=Math.min((t-s)/26,this.length),a=67108863^67108863>>>s<o)for(this.length-=o,u=0;u=0&&(0!==c||u>=n);u--){var l=0|this.words[u];this.words[u]=c<<26-s|l>>>s,c=l&a}return h&&0!==c&&(h.words[h.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},s.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&s}for(;n>26,this.words[n+r]=67108863&s;if(0===a)return this._strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&s;return this.negative=1,this._strip()},s.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,o=0|n.words[n.length-1];0!=(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new s(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var f=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(f=Math.min(f/o|0,67108863),i._ishlnsubmul(n,f,l);0!==i.negative;)f--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=f)}return a&&a._strip(),i._strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},s.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):this.negative&t.negative?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modrn(t.words[0]))}:this._wordDiv(t,e);var n,o,a},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.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,i=t.ushrn(1),n=t.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modrn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var r=(1<<26)%t,n=0,s=this.length-1;s>=0;s--)n=(r*n+(0|this.words[s]))%t;return e?-n:n},s.prototype.modn=function(t){return this.modrn(t)},s.prototype.idivn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var s=(0|this.words[n])+67108864*r;this.words[n]=s/t|0,r=s%t}return this._strip(),e?this.ineg():this},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new s(1),o=new s(0),a=new s(0),h=new s(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),l=e.clone();!e.isZero();){for(var f=0,d=1;!(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(c),o.isub(l)),n.iushrn(1),o.iushrn(1);for(var p=0,g=1;!(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(c),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),o.isub(h)):(r.isub(e),a.isub(n),h.isub(o))}return{a,b:h,gcd:r.iushln(u)}},s.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new s(1),a=new s(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,c=1;!(e.words[0]&c)&&u<26;++u,c<<=1);if(u>0)for(e.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(h),o.iushrn(1);for(var l=0,f=1;!(r.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(a)):(r.isub(e),a.isub(o))}return(n=0===e.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(t),n},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var s=e;e=r,r=s}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return!(1&this.words[0])},s.prototype.isOdd=function(){return!(1&~this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new I(t)},s.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var b={k256:null,p224:null,p192:null,p25519:null};function A(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){A.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){A.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){A.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){A.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function I(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){I.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}A.prototype._tmp=function(){var t=new s(null);return t.words=new Array(Math.ceil(this.n/13)),t},A.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},A.prototype.split=function(t,e){t.iushrn(this.n,0,e)},A.prototype.imulK=function(t){return t.imul(this.k)},n(_,A),_.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n>>22,s=o}s>>>=22,t.words[n-10]=s,0===s&&t.length>10?t.length-=10:t.length-=9},_.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){if(b[t])return b[t];var e;if("k256"===t)e=new _;else if("p224"===t)e=new E;else if("p192"===t)e=new S;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return b[t]=e,e},I.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},I.prototype._verify2=function(t,e){i(!(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},I.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(c(t,t.umod(this.m)._forceRed(this)),t)},I.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},I.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},I.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},I.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)},I.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},I.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},I.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},I.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},I.prototype.isqr=function(t){return this.imul(t,t.clone())},I.prototype.sqr=function(t){return this.mul(t,t)},I.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new s(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var a=new s(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new s(2*c*c).toRed(this);0!==this.pow(c,u).cmp(h);)c.redIAdd(h);for(var l=this.pow(c,n),f=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=o;0!==d.cmp(a);){for(var g=d,m=0;0!==g.cmp(a);m++)g=g.redSqr();i(m=0;i--){for(var u=e.words[i],c=h-1;c>=0;c--){var l=u>>c&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==o?(o<<=1,o|=l,(4==++a||0===i&&0===c)&&(n=this.mul(n,r[o]),a=0,o=0)):a=0}h=26}return n},I.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},I.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new x(t)},n(x,I),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},454:t=>{var e="%[a-f0-9]{2}",r=new RegExp("("+e+")|([^%]+?)","gi"),i=new RegExp("("+e+")+","gi");function n(t,e){try{return[decodeURIComponent(t.join(""))]}catch(t){}if(1===t.length)return t;e=e||1;var r=t.slice(0,e),i=t.slice(e);return Array.prototype.concat.call([],n(r),n(i))}function s(t){try{return decodeURIComponent(t)}catch(s){for(var e=t.match(r)||[],i=1;i{var e,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var n=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(t,e){return new Promise((function(r,i){function n(r){t.removeListener(e,s),i(r)}function s(){"function"==typeof t.removeListener&&t.removeListener("error",n),r([].slice.call(arguments))}g(t,e,s,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&g(t,"error",e,{once:!0})}(t,n)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function h(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function u(t,e,r,i){var n,s,o,u;if(a(r),void 0===(s=t._events)?(s=t._events=Object.create(null),t._eventsCount=0):(void 0!==s.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),o=s[e]),void 0===o)o=s[e]=r,++t._eventsCount;else if("function"==typeof o?o=s[e]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),(n=h(t))>0&&o.length>n&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=o.length,u=c,console&&console.warn&&console.warn(u)}return t}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=c.bind(i);return n.listener=r,i.wrapFn=n,n}function f(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var h=s[t];if(void 0===h)return!1;if("function"==typeof h)i(h,this,e);else{var u=h.length,c=p(h,u);for(r=0;r=0;s--)if(r[s]===e||r[s].listener===e){o=r[s].listener,n=s;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},s.prototype.listeners=function(t){return f(this,t,!0)},s.prototype.rawListeners=function(t){return f(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},s.prototype.listenerCount=d,s.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},3055:t=>{t.exports=function(t,e){for(var r={},i=Object.keys(t),n=Array.isArray(e),s=0;s{var i=e;i.utils=r(7426),i.common=r(6166),i.sha=r(6229),i.ripemd=r(6784),i.hmac=r(8948),i.sha1=i.sha.sha1,i.sha256=i.sha.sha256,i.sha224=i.sha.sha224,i.sha384=i.sha.sha384,i.sha512=i.sha.sha512,i.ripemd160=i.ripemd.ripemd160},6166:(t,e,r)=>{var i=r(7426),n=r(3349);function s(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=s,s.prototype.update=function(t,e){if(t=i.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=i.join32(t,0,t.length-r,this.endian);for(var n=0;n>>24&255,i[n++]=t>>>16&255,i[n++]=t>>>8&255,i[n++]=255&t}else for(i[n++]=255&t,i[n++]=t>>>8&255,i[n++]=t>>>16&255,i[n++]=t>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,s=8;s{var i=r(7426),n=r(3349);function s(t,e,r){if(!(this instanceof s))return new s(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(i.toArray(e,r))}t.exports=s,s.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),n(t.length<=this.blockSize);for(var e=t.length;e{var i=r(7426),n=r(6166),s=i.rotl32,o=i.sum32,a=i.sum32_3,h=i.sum32_4,u=n.BlockHash;function c(){if(!(this instanceof c))return new c;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function l(t,e,r,i){return t<=15?e^r^i:t<=31?e&r|~e&i:t<=47?(e|~r)^i:t<=63?e&i|r&~i:e^(r|~i)}function f(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function d(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}i.inherits(c,u),e.ripemd160=c,c.blockSize=512,c.outSize=160,c.hmacStrength=192,c.padLength=64,c.prototype._update=function(t,e){for(var r=this.h[0],i=this.h[1],n=this.h[2],u=this.h[3],c=this.h[4],v=r,w=i,b=n,A=u,_=c,E=0;E<80;E++){var S=o(s(h(r,l(E,i,n,u),t[p[E]+e],f(E)),m[E]),c);r=c,c=u,u=s(n,10),n=i,i=S,S=o(s(h(v,l(79-E,w,b,A),t[g[E]+e],d(E)),y[E]),_),v=_,_=A,A=s(b,10),b=w,w=S}S=a(this.h[1],n,A),this.h[1]=a(this.h[2],u,_),this.h[2]=a(this.h[3],c,v),this.h[3]=a(this.h[4],r,w),this.h[4]=a(this.h[0],i,b),this.h[0]=S},c.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h,"little"):i.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],g=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],m=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],y=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},6229:(t,e,r)=>{e.sha1=r(3917),e.sha224=r(7714),e.sha256=r(2287),e.sha384=r(1911),e.sha512=r(7766)},3917:(t,e,r)=>{var i=r(7426),n=r(6166),s=r(6225),o=i.rotl32,a=i.sum32,h=i.sum32_5,u=s.ft_1,c=n.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];function f(){if(!(this instanceof f))return new f;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}i.inherits(f,c),t.exports=f,f.blockSize=512,f.outSize=160,f.hmacStrength=80,f.padLength=64,f.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i{var i=r(7426),n=r(2287);function s(){if(!(this instanceof s))return new s;n.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}i.inherits(s,n),t.exports=s,s.blockSize=512,s.outSize=224,s.hmacStrength=192,s.padLength=64,s.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h.slice(0,7),"big"):i.split32(this.h.slice(0,7),"big")}},2287:(t,e,r)=>{var i=r(7426),n=r(6166),s=r(6225),o=r(3349),a=i.sum32,h=i.sum32_4,u=i.sum32_5,c=s.ch32,l=s.maj32,f=s.s0_256,d=s.s1_256,p=s.g0_256,g=s.g1_256,m=n.BlockHash,y=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function v(){if(!(this instanceof v))return new v;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=y,this.W=new Array(64)}i.inherits(v,m),t.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i{var i=r(7426),n=r(7766);function s(){if(!(this instanceof s))return new s;n.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}i.inherits(s,n),t.exports=s,s.blockSize=1024,s.outSize=384,s.hmacStrength=192,s.padLength=128,s.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h.slice(0,12),"big"):i.split32(this.h.slice(0,12),"big")}},7766:(t,e,r)=>{var i=r(7426),n=r(6166),s=r(3349),o=i.rotr64_hi,a=i.rotr64_lo,h=i.shr64_hi,u=i.shr64_lo,c=i.sum64,l=i.sum64_hi,f=i.sum64_lo,d=i.sum64_4_hi,p=i.sum64_4_lo,g=i.sum64_5_hi,m=i.sum64_5_lo,y=n.BlockHash,v=[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];function w(){if(!(this instanceof w))return new w;y.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=v,this.W=new Array(160)}function b(t,e,r,i,n){var s=t&r^~t&n;return s<0&&(s+=4294967296),s}function A(t,e,r,i,n,s){var o=e&i^~e&s;return o<0&&(o+=4294967296),o}function _(t,e,r,i,n){var s=t&r^t&n^r&n;return s<0&&(s+=4294967296),s}function E(t,e,r,i,n,s){var o=e&i^e&s^i&s;return o<0&&(o+=4294967296),o}function S(t,e){var r=o(t,e,28)^o(e,t,2)^o(e,t,7);return r<0&&(r+=4294967296),r}function M(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function I(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function x(t,e){var r=o(t,e,1)^o(t,e,8)^h(t,e,7);return r<0&&(r+=4294967296),r}function N(t,e){var r=a(t,e,1)^a(t,e,8)^u(t,e,7);return r<0&&(r+=4294967296),r}function O(t,e){var r=a(t,e,19)^a(e,t,29)^u(t,e,6);return r<0&&(r+=4294967296),r}i.inherits(w,y),t.exports=w,w.blockSize=1024,w.outSize=512,w.hmacStrength=192,w.padLength=128,w.prototype._prepareBlock=function(t,e){for(var r=this.W,i=0;i<32;i++)r[i]=t[e+i];for(;i{var i=r(7426).rotr32;function n(t,e,r){return t&e^~t&r}function s(t,e,r){return t&e^t&r^e&r}function o(t,e,r){return t^e^r}e.ft_1=function(t,e,r,i){return 0===t?n(e,r,i):1===t||3===t?o(e,r,i):2===t?s(e,r,i):void 0},e.ch32=n,e.maj32=s,e.p32=o,e.s0_256=function(t){return i(t,2)^i(t,13)^i(t,22)},e.s1_256=function(t){return i(t,6)^i(t,11)^i(t,25)},e.g0_256=function(t){return i(t,7)^i(t,18)^t>>>3},e.g1_256=function(t){return i(t,17)^i(t,19)^t>>>10}},7426:(t,e,r)=>{var i=r(3349),n=r(6698);function s(t,e){return 55296==(64512&t.charCodeAt(e))&&!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1))}function o(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function h(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=n,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n>6|192,r[i++]=63&o|128):s(t,n)?(o=65536+((1023&o)<<10)+(1023&t.charCodeAt(++n)),r[i++]=o>>18|240,r[i++]=o>>12&63|128,r[i++]=o>>6&63|128,r[i++]=63&o|128):(r[i++]=o>>12|224,r[i++]=o>>6&63|128,r[i++]=63&o|128)}else for(n=0;n>>0}return o},e.split32=function(t,e){for(var r=new Array(4*t.length),i=0,n=0;i>>24,r[n+1]=s>>>16&255,r[n+2]=s>>>8&255,r[n+3]=255&s):(r[n+3]=s>>>24,r[n+2]=s>>>16&255,r[n+1]=s>>>8&255,r[n]=255&s)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,i){return t+e+r+i>>>0},e.sum32_5=function(t,e,r,i,n){return t+e+r+i+n>>>0},e.sum64=function(t,e,r,i){var n=t[e],s=i+t[e+1]>>>0,o=(s>>0,t[e+1]=s},e.sum64_hi=function(t,e,r,i){return(e+i>>>0>>0},e.sum64_lo=function(t,e,r,i){return e+i>>>0},e.sum64_4_hi=function(t,e,r,i,n,s,o,a){var h=0,u=e;return h+=(u=u+i>>>0)>>0)>>0)>>0},e.sum64_4_lo=function(t,e,r,i,n,s,o,a){return e+i+s+a>>>0},e.sum64_5_hi=function(t,e,r,i,n,s,o,a,h,u){var c=0,l=e;return c+=(l=l+i>>>0)>>0)>>0)>>0)>>0},e.sum64_5_lo=function(t,e,r,i,n,s,o,a,h,u){return e+i+s+a+u>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},6698:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},916:(t,e,r)=>{t.exports=self.fetch||(self.fetch=r(6782).default||r(6782))},1176:(t,e,r)=>{var i;!function(){var n="input is invalid type",s="object"==typeof window,o=s?window:{};o.JS_SHA3_NO_WINDOW&&(s=!1);var a=!s&&"object"==typeof self;!o.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?o=r.g:a&&(o=self);var h=!o.JS_SHA3_NO_COMMON_JS&&t.exports,u=r.amdO,c=!o.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,l="0123456789abcdef".split(""),f=[4,1024,262144,67108864],d=[0,8,16,24],p=[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],g=[224,256,384,512],m=[128,256],y=["hex","buffer","arrayBuffer","array","digest"],v={128:168,256:136};!o.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!c||!o.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var w=function(t,e,r){return function(i){return new k(t,e,t).update(i)[r]()}},b=function(t,e,r){return function(i,n){return new k(t,e,n).update(i)[r]()}},A=function(t,e,r){return function(e,i,n,s){return I["cshake"+t].update(e,i,n,s)[r]()}},_=function(t,e,r){return function(e,i,n,s){return I["kmac"+t].update(e,i,n,s)[r]()}},E=function(t,e,r,i){for(var n=0;n>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}function U(t,e,r){k.call(this,t,e,r)}k.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(n);if(null===t)throw new Error(n);if(c&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||c&&ArrayBuffer.isView(t)))throw new Error(n);e=!0}for(var i,s,o=this.blocks,a=this.byteCount,h=t.length,u=this.blockCount,l=0,f=this.s;l>2]|=t[l]<>2]|=s<>2]|=(192|s>>6)<>2]|=(128|63&s)<=57344?(o[i>>2]|=(224|s>>12)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<>2]|=(240|s>>18)<>2]|=(128|s>>12&63)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<=a){for(this.start=i-a,this.block=o[u],i=0;i>=8);r>0;)n.unshift(r),r=255&(t>>=8),++i;return e?n.push(i):n.unshift(i),this.update(n),n.length},k.prototype.encodeString=function(t){var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(n);if(null===t)throw new Error(n);if(c&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||c&&ArrayBuffer.isView(t)))throw new Error(n);e=!0}var i=0,s=t.length;if(e)i=s;else for(var o=0;o=57344?i+=3:(a=65536+((1023&a)<<10|1023&t.charCodeAt(++o)),i+=4)}return i+=this.encode(8*i),this.update(t),i},k.prototype.bytepad=function(t,e){for(var r=this.encode(e),i=0;i>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+l[15&t]+l[t>>12&15]+l[t>>8&15]+l[t>>20&15]+l[t>>16&15]+l[t>>28&15]+l[t>>24&15];o%e==0&&(L(r),s=0)}return n&&(t=r[s],a+=l[t>>4&15]+l[15&t],n>1&&(a+=l[t>>12&15]+l[t>>8&15]),n>2&&(a+=l[t>>20&15]+l[t>>16&15])),a},k.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,s=0,o=0,a=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var h=new Uint32Array(t);o>8&255,h[t+2]=e>>16&255,h[t+3]=e>>24&255;a%r==0&&L(i)}return s&&(t=a<<2,e=i[o],h[t]=255&e,s>1&&(h[t+1]=e>>8&255),s>2&&(h[t+2]=e>>16&255)),h},U.prototype=new k,U.prototype.finalize=function(){return this.encode(this.outputBits,!0),k.prototype.finalize.call(this)};var L=function(t){var e,r,i,n,s,o,a,h,u,c,l,f,d,g,m,y,v,w,b,A,_,E,S,M,I,x,N,O,P,R,C,T,k,U,L,q,D,B,j,z,F,K,H,V,G,W,$,J,Y,Q,X,Z,tt,et,rt,it,nt,st,ot,at,ht,ut,ct;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],o=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],u=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=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(o<<1|a>>>31),r=(d=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|o>>>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=n^(h<<1|u>>>31),r=s^(u<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=o^(c<<1|l>>>31),r=a^(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=h^(f<<1|d>>>31),r=u^(d<<1|f>>>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^(n<<1|s>>>31),r=l^(s<<1|n>>>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,g=t[0],m=t[1],W=t[11]<<4|t[10]>>>28,$=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,P=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ht=t[30]<<9|t[31]>>>23,K=t[40]<<18|t[41]>>>14,H=t[41]<<18|t[40]>>>14,U=t[2]<<1|t[3]>>>31,L=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,v=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,Y=t[23]<<10|t[22]>>>22,R=t[33]<<13|t[32]>>>19,C=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,ct=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,q=t[14]<<6|t[15]>>>26,D=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,b=t[24]<<11|t[25]>>>21,Q=t[34]<<15|t[35]>>>17,X=t[35]<<15|t[34]>>>17,T=t[45]<<29|t[44]>>>3,k=t[44]<<29|t[45]>>>3,M=t[6]<<28|t[7]>>>4,I=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,j=t[27]<<25|t[26]>>>7,A=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,Z=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,V=t[8]<<27|t[9]>>>5,G=t[9]<<27|t[8]>>>5,x=t[18]<<20|t[19]>>>12,N=t[19]<<20|t[18]>>>12,st=t[29]<<7|t[28]>>>25,ot=t[28]<<7|t[29]>>>25,z=t[38]<<8|t[39]>>>24,F=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,S=t[49]<<14|t[48]>>>18,t[0]=g^~y&w,t[1]=m^~v&b,t[10]=M^~x&O,t[11]=I^~N&P,t[20]=U^~q&B,t[21]=L^~D&j,t[30]=V^~W&J,t[31]=G^~$&Y,t[40]=et^~it&st,t[41]=rt^~nt&ot,t[2]=y^~w&A,t[3]=v^~b&_,t[12]=x^~O&R,t[13]=N^~P&C,t[22]=q^~B&z,t[23]=D^~j&F,t[32]=W^~J&Q,t[33]=$^~Y&X,t[42]=it^~st&at,t[43]=nt^~ot&ht,t[4]=w^~A&E,t[5]=b^~_&S,t[14]=O^~R&T,t[15]=P^~C&k,t[24]=B^~z&K,t[25]=j^~F&H,t[34]=J^~Q&Z,t[35]=Y^~X&tt,t[44]=st^~at&ut,t[45]=ot^~ht&ct,t[6]=A^~E&g,t[7]=_^~S&m,t[16]=R^~T&M,t[17]=C^~k&I,t[26]=z^~K&U,t[27]=F^~H&L,t[36]=Q^~Z&V,t[37]=X^~tt&G,t[46]=at^~ut&et,t[47]=ht^~ct&rt,t[8]=E^~g&y,t[9]=S^~m&v,t[18]=T^~M&x,t[19]=k^~I&N,t[28]=K^~U&q,t[29]=H^~L&D,t[38]=Z^~V&W,t[39]=tt^~G&$,t[48]=ut^~et&it,t[49]=ct^~rt&nt,t[0]^=p[i],t[1]^=p[i+1]};if(h)t.exports=I;else{for(N=0;N{t=r.nmd(t);var i="__lodash_hash_undefined__",n=1,s=2,o=9007199254740991,a="[object Arguments]",h="[object Array]",u="[object AsyncFunction]",c="[object Boolean]",l="[object Date]",f="[object Error]",d="[object Function]",p="[object GeneratorFunction]",g="[object Map]",m="[object Number]",y="[object Null]",v="[object Object]",w="[object Promise]",b="[object Proxy]",A="[object RegExp]",_="[object Set]",E="[object String]",S="[object Undefined]",M="[object WeakMap]",I="[object ArrayBuffer]",x="[object DataView]",N=/^\[object .+?Constructor\]$/,O=/^(?:0|[1-9]\d*)$/,P={};P["[object Float32Array]"]=P["[object Float64Array]"]=P["[object Int8Array]"]=P["[object Int16Array]"]=P["[object Int32Array]"]=P["[object Uint8Array]"]=P["[object Uint8ClampedArray]"]=P["[object Uint16Array]"]=P["[object Uint32Array]"]=!0,P[a]=P[h]=P[I]=P[c]=P[x]=P[l]=P[f]=P[d]=P[g]=P[m]=P[v]=P[A]=P[_]=P[E]=P[M]=!1;var R="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,C="object"==typeof self&&self&&self.Object===Object&&self,T=R||C||Function("return this")(),k=e&&!e.nodeType&&e,U=k&&t&&!t.nodeType&&t,L=U&&U.exports===k,q=L&&R.process,D=function(){try{return q&&q.binding&&q.binding("util")}catch(t){}}(),B=D&&D.isTypedArray;function j(t,e){for(var r=-1,i=null==t?0:t.length;++ru))return!1;var l=a.get(t);if(l&&a.get(e))return l==e;var f=-1,d=!0,p=r&s?new xt:void 0;for(a.set(t,e),a.set(e,t);++f-1},Mt.prototype.set=function(t,e){var r=this.__data__,i=Ot(r,t);return i<0?(++this.size,r.push([t,e])):r[i][1]=e,this},It.prototype.clear=function(){this.size=0,this.__data__={hash:new St,map:new(ft||Mt),string:new St}},It.prototype.delete=function(t){var e=Ut(this,t).delete(t);return this.size-=e?1:0,e},It.prototype.get=function(t){return Ut(this,t).get(t)},It.prototype.has=function(t){return Ut(this,t).has(t)},It.prototype.set=function(t,e){var r=Ut(this,t),i=r.size;return r.set(t,e),this.size+=r.size==i?0:1,this},xt.prototype.add=xt.prototype.push=function(t){return this.__data__.set(t,i),this},xt.prototype.has=function(t){return this.__data__.has(t)},Nt.prototype.clear=function(){this.__data__=new Mt,this.size=0},Nt.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Nt.prototype.get=function(t){return this.__data__.get(t)},Nt.prototype.has=function(t){return this.__data__.has(t)},Nt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Mt){var i=r.__data__;if(!ft||i.length<199)return i.push([t,e]),this.size=++r.size,this;r=this.__data__=new It(i)}return r.set(t,e),this.size=r.size,this};var qt=ht?function(t){return null==t?[]:(t=Object(t),function(e,r){for(var i=-1,n=null==e?0:e.length,s=0,o=[];++i-1&&t%1==0&&t-1&&t%1==0&&t<=o}function Wt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function $t(t){return null!=t&&"object"==typeof t}var Jt=B?function(t){return function(e){return t(e)}}(B):function(t){return $t(t)&&Gt(t.length)&&!!P[Pt(t)]};function Yt(t){return null!=(e=t)&&Gt(e.length)&&!Vt(e)?function(t,e){var r=Kt(t),i=!r&&Ft(t),n=!r&&!i&&Ht(t),s=!r&&!i&&!n&&Jt(t),o=r||i||n||s,a=o?function(t,e){for(var r=-1,i=Array(t);++r{function e(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=e,e.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},6663:(t,e,r)=>{const i=r(4280),n=r(454),s=r(528),o=r(3055),a=Symbol("encodeFragmentIdentifier");function h(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function u(t,e){return e.encode?e.strict?i(t):encodeURIComponent(t):t}function c(t,e){return e.decode?n(t):t}function l(t){return Array.isArray(t)?t.sort():"object"==typeof t?l(Object.keys(t)).sort(((t,e)=>Number(t)-Number(e))).map((e=>t[e])):t}function f(t){const e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function d(t){const e=(t=f(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function p(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):!e.parseBooleans||null===t||"true"!==t.toLowerCase()&&"false"!==t.toLowerCase()||(t="true"===t.toLowerCase()),t}function g(t,e){h((e=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},e)).arrayFormatSeparator);const r=function(t){let e;switch(t.arrayFormat){case"index":return(t,r,i)=>{e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),e?(void 0===i[t]&&(i[t]={}),i[t][e[1]]=r):i[t]=r};case"bracket":return(t,r,i)=>{e=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),e?void 0!==i[t]?i[t]=[].concat(i[t],r):i[t]=[r]:i[t]=r};case"colon-list-separator":return(t,r,i)=>{e=/(:list)$/.exec(t),t=t.replace(/:list$/,""),e?void 0!==i[t]?i[t]=[].concat(i[t],r):i[t]=[r]:i[t]=r};case"comma":case"separator":return(e,r,i)=>{const n="string"==typeof r&&r.includes(t.arrayFormatSeparator),s="string"==typeof r&&!n&&c(r,t).includes(t.arrayFormatSeparator);r=s?c(r,t):r;const o=n||s?r.split(t.arrayFormatSeparator).map((e=>c(e,t))):null===r?r:c(r,t);i[e]=o};case"bracket-separator":return(e,r,i)=>{const n=/(\[\])$/.test(e);if(e=e.replace(/\[\]$/,""),!n)return void(i[e]=r?c(r,t):r);const s=null===r?[]:r.split(t.arrayFormatSeparator).map((e=>c(e,t)));void 0!==i[e]?i[e]=[].concat(i[e],s):i[e]=s};default:return(t,e,r)=>{void 0!==r[t]?r[t]=[].concat(r[t],e):r[t]=e}}}(e),i=Object.create(null);if("string"!=typeof t)return i;if(!(t=t.trim().replace(/^[?#&]/,"")))return i;for(const n of t.split("&")){if(""===n)continue;let[t,o]=s(e.decode?n.replace(/\+/g," "):n,"=");o=void 0===o?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?o:c(o,e),r(c(t,e),o,i)}for(const t of Object.keys(i)){const r=i[t];if("object"==typeof r&&null!==r)for(const t of Object.keys(r))r[t]=p(r[t],e);else i[t]=p(r,e)}return!1===e.sort?i:(!0===e.sort?Object.keys(i).sort():Object.keys(i).sort(e.sort)).reduce(((t,e)=>{const r=i[e];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?t[e]=l(r):t[e]=r,t}),Object.create(null))}e.extract=d,e.parse=g,e.stringify=(t,e)=>{if(!t)return"";h((e=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e)).arrayFormatSeparator);const r=r=>e.skipNull&&null==t[r]||e.skipEmptyString&&""===t[r],i=function(t){switch(t.arrayFormat){case"index":return e=>(r,i)=>{const n=r.length;return void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:null===i?[...r,[u(e,t),"[",n,"]"].join("")]:[...r,[u(e,t),"[",u(n,t),"]=",u(i,t)].join("")]};case"bracket":return e=>(r,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:null===i?[...r,[u(e,t),"[]"].join("")]:[...r,[u(e,t),"[]=",u(i,t)].join("")];case"colon-list-separator":return e=>(r,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:null===i?[...r,[u(e,t),":list="].join("")]:[...r,[u(e,t),":list=",u(i,t)].join("")];case"comma":case"separator":case"bracket-separator":{const e="bracket-separator"===t.arrayFormat?"[]=":"=";return r=>(i,n)=>void 0===n||t.skipNull&&null===n||t.skipEmptyString&&""===n?i:(n=null===n?"":n,0===i.length?[[u(r,t),e,u(n,t)].join("")]:[[i,u(n,t)].join(t.arrayFormatSeparator)])}default:return e=>(r,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:null===i?[...r,u(e,t)]:[...r,[u(e,t),"=",u(i,t)].join("")]}}(e),n={};for(const e of Object.keys(t))r(e)||(n[e]=t[e]);const s=Object.keys(n);return!1!==e.sort&&s.sort(e.sort),s.map((r=>{const n=t[r];return void 0===n?"":null===n?u(r,e):Array.isArray(n)?0===n.length&&"bracket-separator"===e.arrayFormat?u(r,e)+"[]":n.reduce(i(r),[]).join("&"):u(r,e)+"="+u(n,e)})).filter((t=>t.length>0)).join("&")},e.parseUrl=(t,e)=>{e=Object.assign({decode:!0},e);const[r,i]=s(t,"#");return Object.assign({url:r.split("?")[0]||"",query:g(d(t),e)},e&&e.parseFragmentIdentifier&&i?{fragmentIdentifier:c(i,e)}:{})},e.stringifyUrl=(t,r)=>{r=Object.assign({encode:!0,strict:!0,[a]:!0},r);const i=f(t.url).split("?")[0]||"",n=e.extract(t.url),s=e.parse(n,{sort:!1}),o=Object.assign(s,t.query);let h=e.stringify(o,r);h&&(h=`?${h}`);let c=function(t){let e="";const r=t.indexOf("#");return-1!==r&&(e=t.slice(r)),e}(t.url);return t.fragmentIdentifier&&(c=`#${r[a]?u(t.fragmentIdentifier,r):t.fragmentIdentifier}`),`${i}${h}${c}`},e.pick=(t,r,i)=>{i=Object.assign({parseFragmentIdentifier:!0,[a]:!1},i);const{url:n,query:s,fragmentIdentifier:h}=e.parseUrl(t,i);return e.stringifyUrl({url:n,query:o(s,r),fragmentIdentifier:h},i)},e.exclude=(t,r,i)=>{const n=Array.isArray(r)?t=>!r.includes(t):(t,e)=>!r(t,e);return e.pick(t,n,i)}},793:t=>{function e(t){try{return JSON.stringify(t)}catch(t){return'"[Circular]"'}}t.exports=function(t,r,i){var n=i&&i.stringify||e;if("object"==typeof t&&null!==t){var s=r.length+1;if(1===s)return t;var o=new Array(s);o[0]=n(t);for(var a=1;a-1?l:0,t.charCodeAt(d+1)){case 100:case 102:if(c>=h)break;if(null==r[c])break;l=h)break;if(null==r[c])break;l=h)break;if(void 0===r[c])break;l",l=d+2,d++;break}u+=n(r[c]),l=d+2,d++;break;case 115:if(c>=h)break;l{t.exports=(t,e)=>{if("string"!=typeof t||"string"!=typeof e)throw new TypeError("Expected the arguments to be of type `string`");if(""===e)return[t];const r=t.indexOf(e);return-1===r?[t]:[t.slice(0,r),t.slice(r+e.length)]}},4280:t=>{t.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`))},5215:(t,e,r)=>{r.r(e),r.d(e,{__assign:()=>s,__asyncDelegator:()=>b,__asyncGenerator:()=>w,__asyncValues:()=>A,__await:()=>v,__awaiter:()=>c,__classPrivateFieldGet:()=>M,__classPrivateFieldSet:()=>I,__createBinding:()=>f,__decorate:()=>a,__exportStar:()=>d,__extends:()=>n,__generator:()=>l,__importDefault:()=>S,__importStar:()=>E,__makeTemplateObject:()=>_,__metadata:()=>u,__param:()=>h,__read:()=>g,__rest:()=>o,__spread:()=>m,__spreadArrays:()=>y,__values:()=>p});var i=function(t,e){return i=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])},i(t,e)};function n(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var s=function(){return s=Object.assign||function(t){for(var e,r=1,i=arguments.length;r=0;a--)(n=t[a])&&(o=(s<3?n(o):s>3?n(e,r,o):n(e,r))||o);return s>3&&o&&Object.defineProperty(e,r,o),o}function h(t,e){return function(r,i){e(r,i,t)}}function u(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function c(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{h(i.next(t))}catch(t){s(t)}}function a(t){try{h(i.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}h((i=i.apply(t,e||[])).next())}))}function l(t,e){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,s=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}function m(){for(var t=[],e=0;e1||a(t,e)}))})}function a(t,e){try{(r=n[t](e)).value instanceof v?Promise.resolve(r.value.v).then(h,u):c(s[0][2],r)}catch(t){c(s[0][3],t)}var r}function h(t){a("next",t)}function u(t){a("throw",t)}function c(t,e){t(e),s.shift(),s.length&&a(s[0][0],s[0][1])}}function b(t){var e,r;return e={},i("next"),i("throw",(function(t){throw t})),i("return"),e[Symbol.iterator]=function(){return this},e;function i(i,n){e[i]=t[i]?function(e){return(r=!r)?{value:v(t[i](e)),done:"return"===i}:n?n(e):e}:n}}function A(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,r=t[Symbol.asyncIterator];return r?r.call(t):(t=p(t),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(r){e[r]=t[r]&&function(e){return new Promise((function(i,n){!function(t,e,r,i){Promise.resolve(i).then((function(e){t({value:e,done:r})}),e)}(i,n,(e=t[r](e)).done,e.value)}))}}}function _(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function E(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}function S(t){return t&&t.__esModule?t:{default:t}}function M(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function I(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}},6782:(t,e,r)=>{function i(t,e){return e=e||{},new Promise((function(r,i){var n=new XMLHttpRequest,s=[],o=[],a={},h=function(){return{ok:2==(n.status/100|0),statusText:n.statusText,status:n.status,url:n.responseURL,text:function(){return Promise.resolve(n.responseText)},json:function(){return Promise.resolve(n.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([n.response]))},clone:h,headers:{keys:function(){return s},entries:function(){return o},get:function(t){return a[t.toLowerCase()]},has:function(t){return t.toLowerCase()in a}}}};for(var u in n.open(e.method||"get",t,!0),n.onload=function(){n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(t,e,r){s.push(e=e.toLowerCase()),o.push([e,r]),a[e]=a[e]?a[e]+","+r:r})),r(h())},n.onerror=i,n.withCredentials="include"==e.credentials,e.headers)n.setRequestHeader(u,e.headers[u]);n.send(e.body||null)}))}r.r(e),r.d(e,{default:()=>i})},1591:t=>{t.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},9432:()=>{},7790:()=>{},4874:(t,e,r)=>{const i=r(793);t.exports=o;const n=function(){function t(t){return void 0!==t&&t}try{return"undefined"!=typeof globalThis||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(e){return t(self)||t(window)||t(this)||{}}}().console||{},s={mapHttpRequest:f,mapHttpResponse:f,wrapRequestSerializer:d,wrapResponseSerializer:d,wrapErrorSerializer:d,req:f,res:f,err:function(t){const e={type:t.constructor.name,msg:t.message,stack:t.stack};for(const r in t)void 0===e[r]&&(e[r]=t[r]);return e}};function o(t){(t=t||{}).browser=t.browser||{};const e=t.browser.transmit;if(e&&"function"!=typeof e.send)throw Error("pino: transmit option must have a send function");const r=t.browser.write||n;t.browser.write&&(t.browser.asObject=!0);const i=t.serializers||{},s=function(t,e){if(Array.isArray(t)){const e=t.filter((function(t){return"!stdSerializers.err"!==t}));return e}return!0===t&&Object.keys(e)}(t.browser.serialize,i);let f=t.browser.serialize;Array.isArray(t.browser.serialize)&&t.browser.serialize.indexOf("!stdSerializers.err")>-1&&(f=!1),"function"==typeof r&&(r.error=r.fatal=r.warn=r.info=r.debug=r.trace=r),!1===t.enabled&&(t.level="silent");const d=t.level||"info",g=Object.create(r);g.log||(g.log=p),Object.defineProperty(g,"levelVal",{get:function(){return"silent"===this.level?1/0:this.levels.values[this.level]}}),Object.defineProperty(g,"level",{get:function(){return this._level},set:function(t){if("silent"!==t&&!this.levels.values[t])throw Error("unknown level "+t);this._level=t,a(m,g,"error","log"),a(m,g,"fatal","error"),a(m,g,"warn","error"),a(m,g,"info","log"),a(m,g,"debug","log"),a(m,g,"trace","log")}});const m={transmit:e,serialize:s,asObject:t.browser.asObject,levels:["error","fatal","warn","info","debug","trace"],timestamp:l(t)};return g.levels=o.levels,g.level=d,g.setMaxListeners=g.getMaxListeners=g.emit=g.addListener=g.on=g.prependListener=g.once=g.prependOnceListener=g.removeListener=g.removeAllListeners=g.listeners=g.listenerCount=g.eventNames=g.write=g.flush=p,g.serializers=i,g._serialize=s,g._stdErrSerialize=f,g.child=function(r,n){if(!r)throw new Error("missing bindings for child Pino");n=n||{},s&&r.serializers&&(n.serializers=r.serializers);const o=n.serializers;if(s&&o){var a=Object.assign({},i,o),l=!0===t.browser.serialize?Object.keys(a):s;delete r.serializers,h([r],l,a,this._stdErrSerialize)}function f(t){this._childLevel=1+(0|t._childLevel),this.error=u(t,r,"error"),this.fatal=u(t,r,"fatal"),this.warn=u(t,r,"warn"),this.info=u(t,r,"info"),this.debug=u(t,r,"debug"),this.trace=u(t,r,"trace"),a&&(this.serializers=a,this._serialize=l),e&&(this._logEvent=c([].concat(t._logEvent.bindings,r)))}return f.prototype=this,new f(this)},e&&(g._logEvent=c()),g}function a(t,e,r,s){const a=Object.getPrototypeOf(e);e[r]=e.levelVal>e.levels.values[r]?p:a[r]?a[r]:n[r]||n[s]||p,function(t,e,r){var s;(t.transmit||e[r]!==p)&&(e[r]=(s=e[r],function(){const a=t.timestamp(),u=new Array(arguments.length),l=Object.getPrototypeOf&&Object.getPrototypeOf(this)===n?n:this;for(var f=0;f-1&&i in r&&(t[n][i]=r[i](t[n][i]))}function u(t,e,r){return function(){const i=new Array(1+arguments.length);i[0]=e;for(var n=1;n{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var i={};r.r(i),r.d(i,{identity:()=>ie});var n={};r.r(n),r.d(n,{base2:()=>ne});var s={};r.r(s),r.d(s,{base8:()=>se});var o={};r.r(o),r.d(o,{base10:()=>oe});var a={};r.r(a),r.d(a,{base16:()=>ae,base16upper:()=>he});var h={};r.r(h),r.d(h,{base32:()=>ue,base32hex:()=>de,base32hexpad:()=>ge,base32hexpadupper:()=>me,base32hexupper:()=>pe,base32pad:()=>le,base32padupper:()=>fe,base32upper:()=>ce,base32z:()=>ye});var u={};r.r(u),r.d(u,{base36:()=>ve,base36upper:()=>we});var c={};r.r(c),r.d(c,{base58btc:()=>be,base58flickr:()=>Ae});var l={};r.r(l),r.d(l,{base64:()=>_e,base64pad:()=>Ee,base64url:()=>Se,base64urlpad:()=>Me});var f={};r.r(f),r.d(f,{base256emoji:()=>Oe});var d={};r.r(d),r.d(d,{sha256:()=>Qe,sha512:()=>Xe});var p={};r.r(p),r.d(p,{identity:()=>tr});var g={};r.r(g),r.d(g,{code:()=>rr,decode:()=>nr,encode:()=>ir,name:()=>er});var m={};r.r(m),r.d(m,{code:()=>hr,decode:()=>cr,encode:()=>ur,name:()=>ar});var y=r(7007),v=r.n(y);const w=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,b=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,A=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function _(t,e){if(!("__proto__"===t||"constructor"===t&&e&&"object"==typeof e&&"prototype"in e))return e;!function(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}(t)}function E(t,e={}){if("string"!=typeof t)return t;const r=t.trim();if('"'===t[0]&&'"'===t.at(-1)&&!t.includes("\\"))return r.slice(1,-1);if(r.length<=9){const t=r.toLowerCase();if("true"===t)return!0;if("false"===t)return!1;if("undefined"===t)return;if("null"===t)return null;if("nan"===t)return Number.NaN;if("infinity"===t)return Number.POSITIVE_INFINITY;if("-infinity"===t)return Number.NEGATIVE_INFINITY}if(!A.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(w.test(t)||b.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,_)}return JSON.parse(t)}catch(r){if(e.strict)throw r;return t}}function S(t,...e){try{return(r=t(...e))&&"function"==typeof r.then?r:Promise.resolve(r)}catch(t){return Promise.reject(t)}var r}function M(t){if(function(t){const e=typeof t;return null===t||"object"!==e&&"function"!==e}(t))return String(t);if(function(t){const e=Object.getPrototypeOf(t);return!e||e.isPrototypeOf(Object)}(t)||Array.isArray(t))return JSON.stringify(t);if("function"==typeof t.toJSON)return M(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function I(){if(void 0===typeof Buffer)throw new TypeError("[unstorage] Buffer is not supported!")}const x="base64:";function N(t){return t?t.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function O(...t){return N(t.join(":"))}function P(t){return(t=N(t))?t+":":""}const R=()=>{const t=new Map;return{name:"memory",options:{},hasItem:e=>t.has(e),getItem:e=>t.get(e)??null,getItemRaw:e=>t.get(e)??null,setItem(e,r){t.set(e,r)},setItemRaw(e,r){t.set(e,r)},removeItem(e){t.delete(e)},getKeys:()=>Array.from(t.keys()),clear(){t.clear()},dispose(){t.clear()}}};function C(t,e,r){return t.watch?t.watch(((t,i)=>e(t,r+i))):()=>{}}async function T(t){"function"==typeof t.dispose&&await S(t.dispose)}function k(t){return new Promise(((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)}))}function U(t,e){const r=indexedDB.open(t);r.onupgradeneeded=()=>r.result.createObjectStore(e);const i=k(r);return(t,r)=>i.then((i=>r(i.transaction(e,t).objectStore(e))))}let L;function q(){return L||(L=U("keyval-store","keyval")),L}function D(t,e=q()){return e("readonly",(e=>k(e.get(t))))}const B=t=>JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString()+"n":e)),j=t=>{const e=t.replace(/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,'$1"$2n"$3');return JSON.parse(e,((t,e)=>"string"==typeof e&&e.match(/^\d+n$/)?BigInt(e.substring(0,e.length-1)):e))};function z(t){if("string"!=typeof t)throw new Error("Cannot safe json parse value of type "+typeof t);try{return j(t)}catch(e){return t}}function F(t){return"string"==typeof t?t:B(t)||""}var K=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",r=t=>e+t;let i;return t.dbName&&t.storeName&&(i=U(t.dbName,t.storeName)),{name:"idb-keyval",options:t,hasItem:async t=>!(typeof await D(r(t),i)>"u"),getItem:async t=>await D(r(t),i)??null,setItem:(t,e)=>function(t,e,r=q()){return r("readwrite",(r=>(r.put(e,t),k(r.transaction))))}(r(t),e,i),removeItem:t=>function(t,e=q()){return e("readwrite",(e=>(e.delete(t),k(e.transaction))))}(r(t),i),getKeys:()=>function(t=q()){return t("readonly",(t=>{if(t.getAllKeys)return k(t.getAllKeys());const e=[];return function(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},k(t.transaction)}(t,(t=>e.push(t.key))).then((()=>e))}))}(i),clear:()=>function(t=q()){return t("readwrite",(t=>(t.clear(),k(t.transaction))))}(i)}};class H{constructor(){this.indexedDb=function(t={}){const e={mounts:{"":t.driver||R()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=t=>{for(const r of e.mountpoints)if(t.startsWith(r))return{base:r,relativeKey:t.slice(r.length),driver:e.mounts[r]};return{base:"",relativeKey:t,driver:e.mounts[""]}},i=(t,r)=>e.mountpoints.filter((e=>e.startsWith(t)||r&&t.startsWith(e))).map((r=>({relativeBase:t.length>r.length?t.slice(r.length):void 0,mountpoint:r,driver:e.mounts[r]}))),n=(t,r)=>{if(e.watching){r=N(r);for(const i of e.watchListeners)i(t,r)}},s=async()=>{if(e.watching){for(const t in e.unwatch)await e.unwatch[t]();e.unwatch={},e.watching=!1}},o=(t,e,i)=>{const n=new Map,s=t=>{let e=n.get(t.base);return e||(e={driver:t.driver,base:t.base,items:[]},n.set(t.base,e)),e};for(const i of t){const t="string"==typeof i,n=N(t?i:i.key),o=t?void 0:i.value,a=t||!i.options?e:{...e,...i.options},h=r(n);s(h).items.push({key:n,value:o,relativeKey:h.relativeKey,options:a})}return Promise.all([...n.values()].map((t=>i(t)))).then((t=>t.flat()))},a={hasItem(t,e={}){t=N(t);const{relativeKey:i,driver:n}=r(t);return S(n.hasItem,i,e)},getItem(t,e={}){t=N(t);const{relativeKey:i,driver:n}=r(t);return S(n.getItem,i,e).then((t=>E(t)))},getItems:(t,e)=>o(t,e,(t=>t.driver.getItems?S(t.driver.getItems,t.items.map((t=>({key:t.relativeKey,options:t.options}))),e).then((e=>e.map((e=>({key:O(t.base,e.key),value:E(e.value)}))))):Promise.all(t.items.map((e=>S(t.driver.getItem,e.relativeKey,e.options).then((t=>({key:e.key,value:E(t)})))))))),getItemRaw(t,e={}){t=N(t);const{relativeKey:i,driver:n}=r(t);return n.getItemRaw?S(n.getItemRaw,i,e):S(n.getItem,i,e).then((t=>function(t){return"string"!=typeof t?t:t.startsWith(x)?(I(),Buffer.from(t.slice(7),"base64")):t}(t)))},async setItem(t,e,i={}){if(void 0===e)return a.removeItem(t);t=N(t);const{relativeKey:s,driver:o}=r(t);o.setItem&&(await S(o.setItem,s,M(e),i),o.watch||n("update",t))},async setItems(t,e){await o(t,e,(async t=>{t.driver.setItems&&await S(t.driver.setItems,t.items.map((t=>({key:t.relativeKey,value:M(t.value),options:t.options}))),e),t.driver.setItem&&await Promise.all(t.items.map((e=>S(t.driver.setItem,e.relativeKey,M(e.value),e.options))))}))},async setItemRaw(t,e,i={}){if(void 0===e)return a.removeItem(t,i);t=N(t);const{relativeKey:s,driver:o}=r(t);if(o.setItemRaw)await S(o.setItemRaw,s,e,i);else{if(!o.setItem)return;await S(o.setItem,s,function(t){if("string"==typeof t)return t;I();const e=Buffer.from(t).toString("base64");return x+e}(e),i)}o.watch||n("update",t)},async removeItem(t,e={}){"boolean"==typeof e&&(e={removeMeta:e}),t=N(t);const{relativeKey:i,driver:s}=r(t);s.removeItem&&(await S(s.removeItem,i,e),(e.removeMeta||e.removeMata)&&await S(s.removeItem,i+"$",e),s.watch||n("remove",t))},async getMeta(t,e={}){"boolean"==typeof e&&(e={nativeOnly:e}),t=N(t);const{relativeKey:i,driver:n}=r(t),s=Object.create(null);if(n.getMeta&&Object.assign(s,await S(n.getMeta,i,e)),!e.nativeOnly){const t=await S(n.getItem,i+"$",e).then((t=>E(t)));t&&"object"==typeof t&&("string"==typeof t.atime&&(t.atime=new Date(t.atime)),"string"==typeof t.mtime&&(t.mtime=new Date(t.mtime)),Object.assign(s,t))}return s},setMeta(t,e,r={}){return this.setItem(t+"$",e,r)},removeMeta(t,e={}){return this.removeItem(t+"$",e)},async getKeys(t,e={}){t=P(t);const r=i(t,!0);let n=[];const s=[];for(const t of r){const r=(await S(t.driver.getKeys,t.relativeBase,e)).map((e=>t.mountpoint+N(e))).filter((t=>!n.some((e=>t.startsWith(e)))));s.push(...r),n=[t.mountpoint,...n.filter((e=>!e.startsWith(t.mountpoint)))]}return t?s.filter((e=>e.startsWith(t)&&!e.endsWith("$"))):s.filter((t=>!t.endsWith("$")))},async clear(t,e={}){t=P(t),await Promise.all(i(t,!1).map((async t=>{if(t.driver.clear)return S(t.driver.clear,t.relativeBase,e);if(t.driver.removeItem){const r=await t.driver.getKeys(t.relativeBase||"",e);return Promise.all(r.map((r=>t.driver.removeItem(r,e))))}})))},async dispose(){await Promise.all(Object.values(e.mounts).map((t=>T(t))))},watch:async t=>(await(async()=>{if(!e.watching){e.watching=!0;for(const t in e.mounts)e.unwatch[t]=await C(e.mounts[t],n,t)}})(),e.watchListeners.push(t),async()=>{e.watchListeners=e.watchListeners.filter((e=>e!==t)),0===e.watchListeners.length&&await s()}),async unwatch(){e.watchListeners=[],await s()},mount(t,r){if((t=P(t))&&e.mounts[t])throw new Error(`already mounted at ${t}`);return t&&(e.mountpoints.push(t),e.mountpoints.sort(((t,e)=>e.length-t.length))),e.mounts[t]=r,e.watching&&Promise.resolve(C(r,n,t)).then((r=>{e.unwatch[t]=r})).catch(console.error),a},async unmount(t,r=!0){(t=P(t))&&e.mounts[t]&&(e.watching&&t in e.unwatch&&(e.unwatch[t](),delete e.unwatch[t]),r&&await T(e.mounts[t]),e.mountpoints=e.mountpoints.filter((e=>e!==t)),delete e.mounts[t])},getMount(t=""){t=N(t)+":";const e=r(t);return{driver:e.driver,base:e.base}},getMounts:(t="",e={})=>(t=N(t),i(t,e.parents).map((t=>({driver:t.driver,base:t.mountpoint}))))};return a}({driver:K({dbName:"WALLET_CONNECT_V2_INDEXED_DB",storeName:"keyvaluestorage"})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map((t=>[t.key,t.value]))}async getItem(t){const e=await this.indexedDb.getItem(t);if(null!==e)return e}async setItem(t,e){await this.indexedDb.setItem(t,F(e))}async removeItem(t){await this.indexedDb.removeItem(t)}}var V=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof r.g<"u"?r.g:typeof self<"u"?self:{},G={exports:{}};function W(t){var e;return[t[0],z(null!=(e=t[1])?e:"")]}!function(){let t;function e(){}t=e,t.prototype.getItem=function(t){return this.hasOwnProperty(t)?String(this[t]):null},t.prototype.setItem=function(t,e){this[t]=String(e)},t.prototype.removeItem=function(t){delete this[t]},t.prototype.clear=function(){const t=this;Object.keys(t).forEach((function(e){t[e]=void 0,delete t[e]}))},t.prototype.key=function(t){return t=t||0,Object.keys(this)[t]},t.prototype.__defineGetter__("length",(function(){return Object.keys(this).length})),typeof V<"u"&&V.localStorage?G.exports=V.localStorage:typeof window<"u"&&window.localStorage?G.exports=window.localStorage:G.exports=new e}();class ${constructor(){this.localStorage=G.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(W)}async getItem(t){const e=this.localStorage.getItem(t);if(null!==e)return z(e)}async setItem(t,e){this.localStorage.setItem(t,F(e))}async removeItem(t){this.localStorage.removeItem(t)}}class J{constructor(){this.initialized=!1,this.setInitialized=t=>{this.storage=t,this.initialized=!0};const t=new $;this.storage=t;try{(async(t,e,r)=>{const i="wc_storage_version",n=await e.getItem(i);if(n&&n>=1)return void r(e);const s=await t.getKeys();if(!s.length)return void r(e);const o=[];for(;s.length;){const r=s.shift();if(!r)continue;const i=r.toLowerCase();if(i.includes("wc@")||i.includes("walletconnect")||i.includes("wc_")||i.includes("wallet_connect")){const i=await t.getItem(r);await e.setItem(r,i),o.push(r)}}await e.setItem(i,1),r(e),(async(t,e)=>{e.length&&e.forEach((async e=>{await t.removeItem(e)}))})(t,o)})(t,new H,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(t){return await this.initialize(),this.storage.getItem(t)}async setItem(t,e){return await this.initialize(),this.storage.setItem(t,e)}async removeItem(t){return await this.initialize(),this.storage.removeItem(t)}async initialize(){this.initialized||await new Promise((t=>{const e=setInterval((()=>{this.initialized&&(clearInterval(e),t())}),20)}))}}var Y=r(8900);class Q{}class X extends Q{constructor(t){super()}}const Z=Y.FIVE_SECONDS,tt="heartbeat_pulse";class et extends X{constructor(t){super(t),this.events=new y.EventEmitter,this.interval=Z,this.interval=t?.interval||Z}static async init(t){const e=new et(t);return await e.init(),e}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}off(t,e){this.events.off(t,e)}removeListener(t,e){this.events.removeListener(t,e)}async initialize(){this.intervalRef=setInterval((()=>this.pulse()),(0,Y.toMiliseconds)(this.interval))}pulse(){this.events.emit(tt)}}var rt=r(4874),it=r.n(rt);const nt="custom_context";class st{constructor(t){this.nodeValue=t,this.sizeInBytes=(new TextEncoder).encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class ot{constructor(t){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=t,this.sizeInBytes=0}append(t){const e=new st(t);if(e.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${t} with size ${e.size}`);for(;this.size+e.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=e),this.tail=e):(this.head=e,this.tail=e),this.lengthInNodes++,this.sizeInBytes+=e.size}shift(){if(!this.head)return;const t=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=t.size}toArray(){const t=[];let e=this.head;for(;null!==e;)t.push(e.value),e=e.next;return t}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let t=this.head;return{next:()=>{if(!t)return{done:!0,value:null};const e=t.value;return t=t.next,{done:!1,value:e}}}}}class at{constructor(t,e=1024e3){this.level=t??"error",this.levelValue=rt.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=e,this.logs=new ot(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(t,e){e===rt.levels.values.error?console.error(t):e===rt.levels.values.warn?console.warn(t):e===rt.levels.values.debug?console.debug(t):e===rt.levels.values.trace?console.trace(t):console.log(t)}appendToLogs(t){this.logs.append(F({timestamp:(new Date).toISOString(),log:t}));const e="string"==typeof t?JSON.parse(t).level:t.level;e>=this.levelValue&&this.forwardToConsole(t,e)}getLogs(){return this.logs}clearLogs(){this.logs=new ot(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(t){const e=this.getLogArray();return e.push(F({extraMetadata:t})),new Blob(e,{type:"application/json"})}}class ht{constructor(t,e=1024e3){this.baseChunkLogger=new at(t,e)}write(t){this.baseChunkLogger.appendToLogs(t)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(t){return this.baseChunkLogger.logsToBlob(t)}downloadLogsBlobInBrowser(t){const e=URL.createObjectURL(this.logsToBlob(t)),r=document.createElement("a");r.href=e,r.download=`walletconnect-logs-${(new Date).toISOString()}.txt`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(e)}}class ut{constructor(t,e=1024e3){this.baseChunkLogger=new at(t,e)}write(t){this.baseChunkLogger.appendToLogs(t)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(t){return this.baseChunkLogger.logsToBlob(t)}}var ct=Object.defineProperty,lt=Object.defineProperties,ft=Object.getOwnPropertyDescriptors,dt=Object.getOwnPropertySymbols,pt=Object.prototype.hasOwnProperty,gt=Object.prototype.propertyIsEnumerable,mt=(t,e,r)=>e in t?ct(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,yt=(t,e)=>{for(var r in e||(e={}))pt.call(e,r)&&mt(t,r,e[r]);if(dt)for(var r of dt(e))gt.call(e,r)&&mt(t,r,e[r]);return t},vt=(t,e)=>lt(t,ft(e));function wt(t){return vt(yt({},t),{level:t?.level||"info"})}function bt(t,e=nt){let r="";return r=typeof t.bindings>"u"?function(t,e=nt){return t[e]||""}(t,e):t.bindings().context||"",r}function At(t,e,r=nt){const i=function(t,e,r=nt){const i=bt(t,r);return i.trim()?`${i}/${e}`:e}(t,e,r);return function(t,e,r=nt){return t[r]=e,t}(t.child({context:i}),i,r)}function _t(t){return typeof t.loggerOverride<"u"&&"string"!=typeof t.loggerOverride?{logger:t.loggerOverride,chunkLoggerController:null}:typeof window<"u"?function(t){var e,r;const i=new ht(null==(e=t.opts)?void 0:e.level,t.maxSizeInBytes);return{logger:it()(vt(yt({},t.opts),{level:"trace",browser:vt(yt({},null==(r=t.opts)?void 0:r.browser),{write:t=>i.write(t)})})),chunkLoggerController:i}}(t):function(t){var e;const r=new ut(null==(e=t.opts)?void 0:e.level,t.maxSizeInBytes);return{logger:it()(vt(yt({},t.opts),{level:"trace"}),r),chunkLoggerController:r}}(t)}class Et extends Q{constructor(t){super(),this.opts=t,this.protocol="wc",this.version=2}}class St extends Q{constructor(t,e){super(),this.core=t,this.logger=e,this.records=new Map}}class Mt{constructor(t,e){this.logger=t,this.core=e}}class It extends Q{constructor(t,e){super(),this.relayer=t,this.logger=e}}class xt extends Q{constructor(t){super()}}class Nt{constructor(t,e,r,i){this.core=t,this.logger=e,this.name=r}}class Ot extends Q{constructor(t,e){super(),this.relayer=t,this.logger=e}}class Pt extends Q{constructor(t,e){super(),this.core=t,this.logger=e}}class Rt{constructor(t,e){this.projectId=t,this.logger=e}}class Ct{constructor(t,e){this.projectId=t,this.logger=e}}v();class Tt{constructor(t){this.opts=t,this.protocol="wc",this.version=2}}y.EventEmitter;class kt{constructor(t){this.client=t}}var Ut=r(4904),Lt=r(7052);const qt="base64url",Dt="utf8",Bt=":",jt="did",zt="key",Ft="base58btc",Kt="z",Ht="K36";function Vt(t){return null!=globalThis.Buffer?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function Gt(t=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?Vt(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}const Wt=function(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i>>0,o=new Uint8Array(s);t[e];){var c=r[t.charCodeAt(e)];if(255===c)return;for(var l=0,f=s-1;(0!==c||l>>0,o[f]=c%256>>>0,c=c/256>>>0;if(0!==c)throw new Error("Non-zero carry");n=l,e++}if(" "!==t[e]){for(var d=s-n;d!==s&&0===o[d];)d++;for(var p=new Uint8Array(i+(s-d)),g=i;d!==s;)p[g++]=o[d++];return p}}}return{encode:function(e){if(e instanceof Uint8Array||(ArrayBuffer.isView(e)?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Array.isArray(e)&&(e=Uint8Array.from(e))),!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===e.length)return"";for(var r=0,i=0,n=0,s=e.length;n!==s&&0===e[n];)n++,r++;for(var o=(s-n)*c+1>>>0,u=new Uint8Array(o);n!==s;){for(var l=e[n],f=0,d=o-1;(0!==l||f>>0,u[d]=l%a>>>0,l=l/a>>>0;if(0!==l)throw new Error("Non-zero carry");i=f,n++}for(var p=o-i;p!==o&&0===u[p];)p++;for(var g=h.repeat(r);p{if(t instanceof Uint8Array&&"Uint8Array"===t.constructor.name)return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")});class Jt{constructor(t,e,r){this.name=t,this.prefix=e,this.baseEncode=r}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class Yt{constructor(t,e,r){if(this.name=t,this.prefix=e,void 0===e.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=e.codePointAt(0),this.baseDecode=r}decode(t){if("string"==typeof t){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(t){return Xt(this,t)}}class Qt{constructor(t){this.decoders=t}or(t){return Xt(this,t)}decode(t){const e=t[0],r=this.decoders[e];if(r)return r.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Xt=(t,e)=>new Qt({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class Zt{constructor(t,e,r,i){this.name=t,this.prefix=e,this.baseEncode=r,this.baseDecode=i,this.encoder=new Jt(t,e,r),this.decoder=new Yt(t,e,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const te=({name:t,prefix:e,encode:r,decode:i})=>new Zt(t,e,r,i),ee=({prefix:t,name:e,alphabet:r})=>{const{encode:i,decode:n}=Wt(r,e);return te({prefix:t,name:e,encode:i,decode:t=>$t(n(t))})},re=({name:t,prefix:e,bitsPerChar:r,alphabet:i})=>te({prefix:e,name:t,encode:t=>((t,e,r)=>{const i="="===e[e.length-1],n=(1<r;)o-=r,s+=e[n&a>>o];if(o&&(s+=e[n&a<((t,e,r,i)=>{const n={};for(let t=0;t=8&&(a-=8,o[u++]=255&h>>a)}if(a>=r||255&h<<8-a)throw new SyntaxError("Unexpected end of data");return o})(e,i,r,t)}),ie=te({prefix:"\0",name:"identity",encode:t=>{return e=t,(new TextDecoder).decode(e);var e},decode:t=>(t=>(new TextEncoder).encode(t))(t)}),ne=re({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),se=re({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),oe=ee({prefix:"9",name:"base10",alphabet:"0123456789"}),ae=re({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),he=re({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),ue=re({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),ce=re({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),le=re({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),fe=re({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),de=re({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),pe=re({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),ge=re({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),me=re({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),ye=re({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),ve=ee({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),we=ee({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),be=ee({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Ae=ee({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),_e=re({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Ee=re({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Se=re({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Me=re({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),Ie=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),xe=Ie.reduce(((t,e,r)=>(t[r]=e,t)),[]),Ne=Ie.reduce(((t,e,r)=>(t[e.codePointAt(0)]=r,t)),[]),Oe=te({prefix:"🚀",name:"base256emoji",encode:function(t){return t.reduce(((t,e)=>t+xe[e]),"")},decode:function(t){const e=[];for(const r of t){const t=Ne[r.codePointAt(0)];if(void 0===t)throw new Error(`Non-base256emoji character: ${r}`);e.push(t)}return new Uint8Array(e)}});var Pe=128,Re=-128,Ce=Math.pow(2,31),Te=Math.pow(2,7),ke=Math.pow(2,14),Ue=Math.pow(2,21),Le=Math.pow(2,28),qe=Math.pow(2,35),De=Math.pow(2,42),Be=Math.pow(2,49),je=Math.pow(2,56),ze=Math.pow(2,63);const Fe=function t(e,r,i){r=r||[];for(var n=i=i||0;e>=Ce;)r[i++]=255&e|Pe,e/=128;for(;eℜ)r[i++]=255&e|Pe,e>>>=7;return r[i]=0|e,t.bytes=i-n+1,r},Ke=function(t){return t(Fe(t,e,r),e),Ve=t=>Ke(t),Ge=(t,e)=>{const r=e.byteLength,i=Ve(t),n=i+Ve(r),s=new Uint8Array(n+r);return He(t,s,0),He(r,s,i),s.set(e,n),new We(t,r,e,s)};class We{constructor(t,e,r,i){this.code=t,this.size=e,this.digest=r,this.bytes=i}}const $e=({name:t,code:e,encode:r})=>new Je(t,e,r);class Je{constructor(t,e,r){this.name=t,this.code=e,this.encode=r}digest(t){if(t instanceof Uint8Array){const e=this.encode(t);return e instanceof Uint8Array?Ge(this.code,e):e.then((t=>Ge(this.code,t)))}throw Error("Unknown type, must be binary type")}}const Ye=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Qe=$e({name:"sha2-256",code:18,encode:Ye("SHA-256")}),Xe=$e({name:"sha2-512",code:19,encode:Ye("SHA-512")}),Ze=$t,tr={code:0,name:"identity",encode:Ze,digest:t=>Ge(0,Ze(t))},er="raw",rr=85,ir=t=>$t(t),nr=t=>$t(t),sr=new TextEncoder,or=new TextDecoder,ar="json",hr=512,ur=t=>sr.encode(JSON.stringify(t)),cr=t=>JSON.parse(or.decode(t));Symbol.toStringTag,Symbol.for("nodejs.util.inspect.custom"),Symbol.for("@ipld/js-cid/CID");const lr={...i,...n,...s,...o,...a,...h,...u,...c,...l,...f};function fr(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}const dr=fr("utf8","u",(t=>"u"+new TextDecoder("utf8").decode(t)),(t=>(new TextEncoder).encode(t.substring(1)))),pr=fr("ascii","a",(t=>{let e="a";for(let r=0;r{const e=Gt((t=t.substring(1)).length);for(let r=0;rt+e.length),0));const r=Gt(e);let i=0;for(const e of t)r.set(e,i),i+=e.length;return Vt(r)}([e,t]),Ft);return[jt,zt,r].join(Bt)}function br(t=(0,Lt.randomBytes)(32)){return Ut.K(t)}r(5665);var Ar=function(t,e,r){if(r||2===arguments.length)for(var i,n=0,s=e.length;nt+e.length),0));const r=Br(e);let i=0;for(const e of t)r.set(e,i),i+=e.length;return r}function zr(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}const Fr=zr("utf8","u",(t=>"u"+new TextDecoder("utf8").decode(t)),(t=>(new TextEncoder).encode(t.substring(1)))),Kr=zr("ascii","a",(t=>{let e="a";for(let r=0;r{const e=Br((t=t.substring(1)).length);for(let r=0;re in t?Yr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ei=(t,e)=>{for(var r in e||(e={}))Xr.call(e,r)&&ti(t,r,e[r]);if(Qr)for(var r of Qr(e))Zr.call(e,r)&&ti(t,r,e[r]);return t};const ri="ReactNative",ii={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},ni="js";function si(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function oi(){return!(0,Cr.getDocument)()&&!!(0,Cr.getNavigator)()&&navigator.product===ri}function ai(){return!si()&&!!(0,Cr.getNavigator)()&&!!(0,Cr.getDocument)()}function hi(){return oi()?ii.reactNative:si()?ii.node:ai()?ii.browser:ii.unknown}function ui(t,e,i){const n=function(){if(hi()===ii.reactNative&&typeof r.g<"u"&&typeof(null==r.g?void 0:r.g.Platform)<"u"){const{OS:t,Version:e}=r.g.Platform;return[t,e].join("-")}const t=e?Rr(e):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new Ir:"undefined"!=typeof navigator?Rr(navigator.userAgent):"undefined"!=typeof process&&process.version?new Er(process.version.slice(1)):null;var e;if(null===t)return"unknown";const i=t.os?t.os.replace(" ","").toLowerCase():"unknown";return"browser"===t.type?[i,t.name,t.version].join("-"):[i,t.version].join("-")}(),s=function(){var t;const e=hi();return e===ii.browser?[e,(null==(t=(0,Cr.getLocation)())?void 0:t.host)||"unknown"].join(":"):e}();return[[t,e].join("-"),[ni,i].join("-"),n,s].join("/")}function ci(t,e){return t.filter((t=>e.includes(t))).length===t.length}function li(t){return Object.fromEntries(t.entries())}function fi(t){return new Map(Object.entries(t))}function di(t=Y.FIVE_MINUTES,e){const r=(0,Y.toMiliseconds)(t||Y.FIVE_MINUTES);let i,n,s;return{resolve:t=>{s&&i&&(clearTimeout(s),i(t))},reject:t=>{s&&n&&(clearTimeout(s),n(t))},done:()=>new Promise(((t,o)=>{s=setTimeout((()=>{o(new Error(e))}),r),i=t,n=o}))}}function pi(t,e,r){return new Promise((async(i,n)=>{const s=setTimeout((()=>n(new Error(r))),e);try{i(await t)}catch(t){n(t)}clearTimeout(s)}))}function gi(t,e){if("string"==typeof e&&e.startsWith(`${t}:`))return e;if("topic"===t.toLowerCase()){if("string"!=typeof e)throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}if("id"===t.toLowerCase()){if("number"!=typeof e)throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function mi(t){const[e,r]=t.split(":"),i={id:void 0,topic:void 0};if("topic"===e&&"string"==typeof r)i.topic=r;else{if("id"!==e||!Number.isInteger(Number(r)))throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);i.id=Number(r)}return i}function yi(t,e){return(0,Y.fromMiliseconds)((e||Date.now())+(0,Y.toMiliseconds)(t))}function vi(t){return Date.now()>=(0,Y.toMiliseconds)(t)}function wi(t,e){return`${t}${e?`:${e}`:""}`}function bi(t=[],e=[]){return[...new Set([...t,...e])]}var Ai,_i=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof r.g<"u"?r.g:typeof self<"u"?self:{},Ei={exports:{}};Ai=Ei,function(){var t="input is invalid type",e="object"==typeof window,r=e?window:{};r.JS_SHA3_NO_WINDOW&&(e=!1);var i=!e&&"object"==typeof self;!r.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?r=_i:i&&(r=self);var n=!r.JS_SHA3_NO_COMMON_JS&&Ai.exports,s=!r.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",o="0123456789abcdef".split(""),a=[4,1024,262144,67108864],h=[0,8,16,24],u=[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],c=[224,256,384,512],l=[128,256],f=["hex","buffer","arrayBuffer","array","digest"],d={128:168,256:136};(r.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),s&&(r.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var p=function(t,e,r){return function(i){return new O(t,e,t).update(i)[r]()}},g=function(t,e,r){return function(i,n){return new O(t,e,n).update(i)[r]()}},m=function(t,e,r){return function(e,i,n,s){return A["cshake"+t].update(e,i,n,s)[r]()}},y=function(t,e,r){return function(e,i,n,s){return A["kmac"+t].update(e,i,n,s)[r]()}},v=function(t,e,r,i){for(var n=0;n>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}function P(t,e,r){O.call(this,t,e,r)}O.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var r,i=typeof e;if("string"!==i){if("object"!==i)throw new Error(t);if(null===e)throw new Error(t);if(s&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||s&&ArrayBuffer.isView(e)))throw new Error(t);r=!0}for(var n,o,a=this.blocks,u=this.byteCount,c=e.length,l=this.blockCount,f=0,d=this.s;f>2]|=e[f]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(a[n>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=u){for(this.start=n-u,this.block=a[l],n=0;n>=8);r>0;)n.unshift(r),r=255&(t>>=8),++i;return e?n.push(i):n.unshift(i),this.update(n),n.length},O.prototype.encodeString=function(e){var r,i=typeof e;if("string"!==i){if("object"!==i)throw new Error(t);if(null===e)throw new Error(t);if(s&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||s&&ArrayBuffer.isView(e)))throw new Error(t);r=!0}var n=0,o=e.length;if(r)n=o;else for(var a=0;a=57344?n+=3:(h=65536+((1023&h)<<10|1023&e.charCodeAt(++a)),n+=4)}return n+=this.encode(8*n),this.update(e),n},O.prototype.bytepad=function(t,e){for(var r=this.encode(e),i=0;i>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];a%e==0&&(R(r),s=0)}return n&&(t=r[s],h+=o[t>>4&15]+o[15&t],n>1&&(h+=o[t>>12&15]+o[t>>8&15]),n>2&&(h+=o[t>>20&15]+o[t>>16&15])),h},O.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,s=0,o=0,a=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var h=new Uint32Array(t);o>8&255,h[t+2]=e>>16&255,h[t+3]=e>>24&255;a%r==0&&R(i)}return s&&(t=a<<2,e=i[o],h[t]=255&e,s>1&&(h[t+1]=e>>8&255),s>2&&(h[t+2]=e>>16&255)),h},P.prototype=new O,P.prototype.finalize=function(){return this.encode(this.outputBits,!0),O.prototype.finalize.call(this)};var R=function(t){var e,r,i,n,s,o,a,h,c,l,f,d,p,g,m,y,v,w,b,A,_,E,S,M,I,x,N,O,P,R,C,T,k,U,L,q,D,B,j,z,F,K,H,V,G,W,$,J,Y,Q,X,Z,tt,et,rt,it,nt,st,ot,at,ht,ut,ct;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],o=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],c=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(o<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|o>>>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=n^(h<<1|c>>>31),r=s^(c<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=o^(l<<1|f>>>31),r=a^(f<<1|l>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(d<<1|p>>>31),r=c^(p<<1|d>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=l^(n<<1|s>>>31),r=f^(s<<1|n>>>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,g=t[0],m=t[1],W=t[11]<<4|t[10]>>>28,$=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,P=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ht=t[30]<<9|t[31]>>>23,K=t[40]<<18|t[41]>>>14,H=t[41]<<18|t[40]>>>14,U=t[2]<<1|t[3]>>>31,L=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,v=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,Y=t[23]<<10|t[22]>>>22,R=t[33]<<13|t[32]>>>19,C=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,ct=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,q=t[14]<<6|t[15]>>>26,D=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,b=t[24]<<11|t[25]>>>21,Q=t[34]<<15|t[35]>>>17,X=t[35]<<15|t[34]>>>17,T=t[45]<<29|t[44]>>>3,k=t[44]<<29|t[45]>>>3,M=t[6]<<28|t[7]>>>4,I=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,j=t[27]<<25|t[26]>>>7,A=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,Z=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,V=t[8]<<27|t[9]>>>5,G=t[9]<<27|t[8]>>>5,x=t[18]<<20|t[19]>>>12,N=t[19]<<20|t[18]>>>12,st=t[29]<<7|t[28]>>>25,ot=t[28]<<7|t[29]>>>25,z=t[38]<<8|t[39]>>>24,F=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,S=t[49]<<14|t[48]>>>18,t[0]=g^~y&w,t[1]=m^~v&b,t[10]=M^~x&O,t[11]=I^~N&P,t[20]=U^~q&B,t[21]=L^~D&j,t[30]=V^~W&J,t[31]=G^~$&Y,t[40]=et^~it&st,t[41]=rt^~nt&ot,t[2]=y^~w&A,t[3]=v^~b&_,t[12]=x^~O&R,t[13]=N^~P&C,t[22]=q^~B&z,t[23]=D^~j&F,t[32]=W^~J&Q,t[33]=$^~Y&X,t[42]=it^~st&at,t[43]=nt^~ot&ht,t[4]=w^~A&E,t[5]=b^~_&S,t[14]=O^~R&T,t[15]=P^~C&k,t[24]=B^~z&K,t[25]=j^~F&H,t[34]=J^~Q&Z,t[35]=Y^~X&tt,t[44]=st^~at&ut,t[45]=ot^~ht&ct,t[6]=A^~E&g,t[7]=_^~S&m,t[16]=R^~T&M,t[17]=C^~k&I,t[26]=z^~K&U,t[27]=F^~H&L,t[36]=Q^~Z&V,t[37]=X^~tt&G,t[46]=at^~ut&et,t[47]=ht^~ct&rt,t[8]=E^~g&y,t[9]=S^~m&v,t[18]=T^~M&x,t[19]=k^~I&N,t[28]=K^~U&q,t[29]=H^~L&D,t[38]=Z^~V&W,t[39]=tt^~G&$,t[48]=ut^~et&it,t[49]=ct^~rt&nt,t[0]^=u[i],t[1]^=u[i+1]};if(n)Ai.exports=A;else for(E=0;E<_.length;++E)r[_[E]]=A[_[E]]}();var Si=Ei.exports;let Mi=!1,Ii=!1;const xi={debug:1,default:2,info:2,warning:3,error:4,off:5};let Ni=xi.default,Oi=null;const Pi=function(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach((e=>{try{if("test"!=="test".normalize(e))throw new Error("bad normalize")}catch{t.push(e)}})),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}();var Ri,Ci;!function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"}(Ri||(Ri={})),function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"}(Ci||(Ci={}));const Ti="0123456789abcdef";class ki{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const r=t.toLowerCase();null==xi[r]&&this.throwArgumentError("invalid log level name","logLevel",t),!(Ni>xi[r])&&console.log.apply(console,e)}debug(...t){this._log(ki.levels.DEBUG,t)}info(...t){this._log(ki.levels.INFO,t)}warn(...t){this._log(ki.levels.WARNING,t)}makeError(t,e,r){if(Ii)return this.makeError("censored error",e,{});e||(e=ki.errors.UNKNOWN_ERROR),r||(r={});const i=[];Object.keys(r).forEach((t=>{const e=r[t];try{if(e instanceof Uint8Array){let r="";for(let t=0;t>4],r+=Ti[15&e[t]];i.push(t+"=Uint8Array(0x"+r+")")}else i.push(t+"="+JSON.stringify(e))}catch{i.push(t+"="+JSON.stringify(r[t].toString()))}})),i.push(`code=${e}`),i.push(`version=${this.version}`);const n=t;let s="";switch(e){case Ci.NUMERIC_FAULT:{s="NUMERIC_FAULT";const e=t;switch(e){case"overflow":case"underflow":case"division-by-zero":s+="-"+e;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result"}break}case Ci.CALL_EXCEPTION:case Ci.INSUFFICIENT_FUNDS:case Ci.MISSING_NEW:case Ci.NONCE_EXPIRED:case Ci.REPLACEMENT_UNDERPRICED:case Ci.TRANSACTION_REPLACED:case Ci.UNPREDICTABLE_GAS_LIMIT:s=e}s&&(t+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),i.length&&(t+=" ("+i.join(", ")+")");const o=new Error(t);return o.reason=n,o.code=e,Object.keys(r).forEach((function(t){o[t]=r[t]})),o}throwError(t,e,r){throw this.makeError(t,e,r)}throwArgumentError(t,e,r){return this.throwError(t,ki.errors.INVALID_ARGUMENT,{argument:e,value:r})}assert(t,e,r,i){t||this.throwError(e,r,i)}assertArgument(t,e,r,i){t||this.throwArgumentError(e,r,i)}checkNormalize(t){Pi&&this.throwError("platform missing String.prototype.normalize",ki.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Pi})}checkSafeUint53(t,e){"number"==typeof t&&(null==e&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,ki.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,ki.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,r){r=r?": "+r:"",te&&this.throwError("too many arguments"+r,ki.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||null==t)&&this.throwError("missing new",ki.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",ki.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||null==t)&&this.throwError("missing new",ki.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return Oi||(Oi=new ki("logger/5.7.0")),Oi}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",ki.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Mi){if(!t)return;this.globalLogger().throwError("error censorship permanent",ki.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Ii=!!t,Mi=!!e}static setLogLevel(t){const e=xi[t.toLowerCase()];null!=e?Ni=e:ki.globalLogger().warn("invalid log level - "+t)}static from(t){return new ki(t)}}ki.errors=Ci,ki.levels=Ri;const Ui=new ki("bytes/5.7.0");function Li(t){return!!t.toHexString}function qi(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return qi(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function Di(t){return"number"==typeof t&&t==t&&t%1==0}function Bi(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t||!Di(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function ji(t,e){if(e||(e={}),"number"==typeof t){Ui.checkSafeUint53(t,"invalid arrayify value");const e=[];for(;t;)e.unshift(255&t),t=parseInt(String(t/256));return 0===e.length&&e.push(0),qi(new Uint8Array(e))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),Li(t)&&(t=t.toHexString()),zi(t)){let r=t.substring(2);r.length%2&&("left"===e.hexPad?r="0"+r:"right"===e.hexPad?r+="0":Ui.throwArgumentError("hex data is odd-length","value",t));const i=[];for(let t=0;t>4]+Fi[15&i]}return e}return Ui.throwArgumentError("invalid hexlify value","value",t)}function Hi(t,e,r){return"string"!=typeof t?t=Ki(t):(!zi(t)||t.length%2)&&Ui.throwArgumentError("invalid hexData","value",t),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function Vi(t,e){for("string"!=typeof t?t=Ki(t):zi(t)||Ui.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&Ui.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function Gi(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(function(t){return zi(t)&&!(t.length%2)||Bi(t)}(t)){let r=ji(t);64===r.length?(e.v=27+(r[32]>>7),r[32]&=127,e.r=Ki(r.slice(0,32)),e.s=Ki(r.slice(32,64))):65===r.length?(e.r=Ki(r.slice(0,32)),e.s=Ki(r.slice(32,64)),e.v=r[64]):Ui.throwArgumentError("invalid signature string","signature",t),e.v<27&&(0===e.v||1===e.v?e.v+=27:Ui.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=Ki(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,null!=e._vs){const r=function(t,e){(t=ji(t)).length>e&&Ui.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),qi(r)}(ji(e._vs),32);e._vs=Ki(r);const i=r[0]>=128?1:0;null==e.recoveryParam?e.recoveryParam=i:e.recoveryParam!==i&&Ui.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),r[0]&=127;const n=Ki(r);null==e.s?e.s=n:e.s!==n&&Ui.throwArgumentError("signature v mismatch _vs","signature",t)}if(null==e.recoveryParam)null==e.v?Ui.throwArgumentError("signature missing v and recoveryParam","signature",t):0===e.v||1===e.v?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(null==e.v)e.v=27+e.recoveryParam;else{const r=0===e.v||1===e.v?e.v:1-e.v%2;e.recoveryParam!==r&&Ui.throwArgumentError("signature recoveryParam mismatch v","signature",t)}null!=e.r&&zi(e.r)?e.r=Vi(e.r,32):Ui.throwArgumentError("signature missing or invalid r","signature",t),null!=e.s&&zi(e.s)?e.s=Vi(e.s,32):Ui.throwArgumentError("signature missing or invalid s","signature",t);const r=ji(e.s);r[0]>=128&&Ui.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const i=Ki(r);e._vs&&(zi(e._vs)||Ui.throwArgumentError("signature invalid _vs","signature",t),e._vs=Vi(e._vs,32)),null==e._vs?e._vs=i:e._vs!==i&&Ui.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function Wi(t){return"0x"+Si.keccak_256(ji(t))}var $i={exports:{}},Ji=function(t){var e=t.default;if("function"==typeof e){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,i.get?i:{enumerable:!0,get:function(){return t[e]}})})),r}(Object.freeze({__proto__:null,default:{}}));!function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function n(t,e,r){if(n.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&(("le"===e||"be"===e)&&(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof $i?$i.exports=n:e.BN=n,n.BN=n,n.wordSize=26;try{s=typeof window<"u"&&typeof window.Buffer<"u"?window.Buffer:Ji.Buffer}catch{}function o(t,e){var i=t.charCodeAt(e);return i>=48&&i<=57?i-48:i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:void r(!1,"Invalid character in "+t)}function a(t,e,r){var i=o(t,r);return r-1>=e&&(i|=o(t,r-1)<<4),i}function h(t,e,i,n){for(var s=0,o=0,a=Math.min(t.length,i),h=e;h=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&o0?t:e},n.min=function(t,e){return t.cmp(e)<0?t:e},n.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[s]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===i)for(n=0,s=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this._strip()},n.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=2)n=a(t,e,i)<=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this._strip()},n.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var s=t.length-r,o=s%i,a=Math.min(s,s-o)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},typeof Symbol<"u"&&"function"==typeof Symbol.for)try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch{n.prototype.inspect=c}else n.prototype.inspect=c;function c(){return(this.red?""}var l=["","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"],f=[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],d=[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 p(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],s=0|e.words[0],o=n*s,a=67108863&o,h=o/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,f=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=f;d++){var p=u-d|0;c+=(o=(n=0|t.words[p])*(s=0|e.words[d])+l)/67108864|0,l=67108863&o}r.words[u]=0|l,h=0|c}return 0!==h?r.words[u]=0|h:r.length--,r._strip()}n.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var n=0,s=0,o=0;o>>24-n&16777215,(n+=2)>=26&&(n-=26,o--),i=0!==s||o!==this.length-1?l[6-h.length]+h+i:h+i}for(0!==s&&(i=s.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var u=f[t],c=d[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modrn(c).toString(t);i=(p=p.idivn(c)).isZero()?g+i:l[u-g.length]+g+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},n.prototype.toJSON=function(){return this.toString(16,2)},s&&(n.prototype.toBuffer=function(t,e){return this.toArrayLike(s,t,e)}),n.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},n.prototype.toArrayLike=function(t,e,i){this._strip();var n=this.byteLength(),s=i||Math.max(1,n);r(n<=s,"byte array longer than desired length"),r(s>0,"Requested array length <= 0");var o=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,s);return this["_toArrayLike"+("le"===e?"LE":"BE")](o,n),o},n.prototype._toArrayLikeLE=function(t,e){for(var r=0,i=0,n=0,s=0;n>8&255),r>16&255),6===s?(r>24&255),i=0,s=0):(i=o>>>24,s+=2)}if(r=0&&(t[r--]=o>>8&255),r>=0&&(t[r--]=o>>16&255),6===s?(r>=0&&(t[r--]=o>>24&255),i=0,s=0):(i=o>>>24,s+=2)}if(r>=0)for(t[r--]=i;r>=0;)t[r--]=0},Math.clz32?n.prototype._countBits=function(t){return 32-Math.clz32(t)}:n.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},n.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 8191&e||(r+=13,e>>>=13),127&e||(r+=7,e>>>=7),15&e||(r+=4,e>>>=4),3&e||(r+=2,e>>>=2),1&e||r++,r},n.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},n.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},n.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)},n.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},n.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},n.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},n.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-i),this._strip()},n.prototype.notn=function(t){return this.clone().inotn(t)},n.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var i=t/26|0,n=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,s=0;s>>26;for(;0!==n&&s>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;st.length?this.clone().iadd(t):t.clone().iadd(this)},n.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,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var s=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==s&&o>26,this.words[o]=67108863&e;if(0===s&&o>>13,d=0|o[1],p=8191&d,g=d>>>13,m=0|o[2],y=8191&m,v=m>>>13,w=0|o[3],b=8191&w,A=w>>>13,_=0|o[4],E=8191&_,S=_>>>13,M=0|o[5],I=8191&M,x=M>>>13,N=0|o[6],O=8191&N,P=N>>>13,R=0|o[7],C=8191&R,T=R>>>13,k=0|o[8],U=8191&k,L=k>>>13,q=0|o[9],D=8191&q,B=q>>>13,j=0|a[0],z=8191&j,F=j>>>13,K=0|a[1],H=8191&K,V=K>>>13,G=0|a[2],W=8191&G,$=G>>>13,J=0|a[3],Y=8191&J,Q=J>>>13,X=0|a[4],Z=8191&X,tt=X>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],st=8191&nt,ot=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ct=0|a[8],lt=8191&ct,ft=ct>>>13,dt=0|a[9],pt=8191&dt,gt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(u+(i=Math.imul(l,z))|0)+((8191&(n=(n=Math.imul(l,F))+Math.imul(f,z)|0))<<13)|0;u=((s=Math.imul(f,F))+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(p,z),n=(n=Math.imul(p,F))+Math.imul(g,z)|0,s=Math.imul(g,F);var yt=(u+(i=i+Math.imul(l,H)|0)|0)+((8191&(n=(n=n+Math.imul(l,V)|0)+Math.imul(f,H)|0))<<13)|0;u=((s=s+Math.imul(f,V)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(y,z),n=(n=Math.imul(y,F))+Math.imul(v,z)|0,s=Math.imul(v,F),i=i+Math.imul(p,H)|0,n=(n=n+Math.imul(p,V)|0)+Math.imul(g,H)|0,s=s+Math.imul(g,V)|0;var vt=(u+(i=i+Math.imul(l,W)|0)|0)+((8191&(n=(n=n+Math.imul(l,$)|0)+Math.imul(f,W)|0))<<13)|0;u=((s=s+Math.imul(f,$)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(b,z),n=(n=Math.imul(b,F))+Math.imul(A,z)|0,s=Math.imul(A,F),i=i+Math.imul(y,H)|0,n=(n=n+Math.imul(y,V)|0)+Math.imul(v,H)|0,s=s+Math.imul(v,V)|0,i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(g,W)|0,s=s+Math.imul(g,$)|0;var wt=(u+(i=i+Math.imul(l,Y)|0)|0)+((8191&(n=(n=n+Math.imul(l,Q)|0)+Math.imul(f,Y)|0))<<13)|0;u=((s=s+Math.imul(f,Q)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(E,z),n=(n=Math.imul(E,F))+Math.imul(S,z)|0,s=Math.imul(S,F),i=i+Math.imul(b,H)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(A,H)|0,s=s+Math.imul(A,V)|0,i=i+Math.imul(y,W)|0,n=(n=n+Math.imul(y,$)|0)+Math.imul(v,W)|0,s=s+Math.imul(v,$)|0,i=i+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,Q)|0)+Math.imul(g,Y)|0,s=s+Math.imul(g,Q)|0;var bt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(f,Z)|0))<<13)|0;u=((s=s+Math.imul(f,tt)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(I,z),n=(n=Math.imul(I,F))+Math.imul(x,z)|0,s=Math.imul(x,F),i=i+Math.imul(E,H)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(S,H)|0,s=s+Math.imul(S,V)|0,i=i+Math.imul(b,W)|0,n=(n=n+Math.imul(b,$)|0)+Math.imul(A,W)|0,s=s+Math.imul(A,$)|0,i=i+Math.imul(y,Y)|0,n=(n=n+Math.imul(y,Q)|0)+Math.imul(v,Y)|0,s=s+Math.imul(v,Q)|0,i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(g,Z)|0,s=s+Math.imul(g,tt)|0;var At=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(f,rt)|0))<<13)|0;u=((s=s+Math.imul(f,it)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(O,z),n=(n=Math.imul(O,F))+Math.imul(P,z)|0,s=Math.imul(P,F),i=i+Math.imul(I,H)|0,n=(n=n+Math.imul(I,V)|0)+Math.imul(x,H)|0,s=s+Math.imul(x,V)|0,i=i+Math.imul(E,W)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(S,W)|0,s=s+Math.imul(S,$)|0,i=i+Math.imul(b,Y)|0,n=(n=n+Math.imul(b,Q)|0)+Math.imul(A,Y)|0,s=s+Math.imul(A,Q)|0,i=i+Math.imul(y,Z)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(v,Z)|0,s=s+Math.imul(v,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(g,rt)|0,s=s+Math.imul(g,it)|0;var _t=(u+(i=i+Math.imul(l,st)|0)|0)+((8191&(n=(n=n+Math.imul(l,ot)|0)+Math.imul(f,st)|0))<<13)|0;u=((s=s+Math.imul(f,ot)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(C,z),n=(n=Math.imul(C,F))+Math.imul(T,z)|0,s=Math.imul(T,F),i=i+Math.imul(O,H)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(P,H)|0,s=s+Math.imul(P,V)|0,i=i+Math.imul(I,W)|0,n=(n=n+Math.imul(I,$)|0)+Math.imul(x,W)|0,s=s+Math.imul(x,$)|0,i=i+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,Q)|0)+Math.imul(S,Y)|0,s=s+Math.imul(S,Q)|0,i=i+Math.imul(b,Z)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(A,Z)|0,s=s+Math.imul(A,tt)|0,i=i+Math.imul(y,rt)|0,n=(n=n+Math.imul(y,it)|0)+Math.imul(v,rt)|0,s=s+Math.imul(v,it)|0,i=i+Math.imul(p,st)|0,n=(n=n+Math.imul(p,ot)|0)+Math.imul(g,st)|0,s=s+Math.imul(g,ot)|0;var Et=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(f,ht)|0))<<13)|0;u=((s=s+Math.imul(f,ut)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(U,z),n=(n=Math.imul(U,F))+Math.imul(L,z)|0,s=Math.imul(L,F),i=i+Math.imul(C,H)|0,n=(n=n+Math.imul(C,V)|0)+Math.imul(T,H)|0,s=s+Math.imul(T,V)|0,i=i+Math.imul(O,W)|0,n=(n=n+Math.imul(O,$)|0)+Math.imul(P,W)|0,s=s+Math.imul(P,$)|0,i=i+Math.imul(I,Y)|0,n=(n=n+Math.imul(I,Q)|0)+Math.imul(x,Y)|0,s=s+Math.imul(x,Q)|0,i=i+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(S,Z)|0,s=s+Math.imul(S,tt)|0,i=i+Math.imul(b,rt)|0,n=(n=n+Math.imul(b,it)|0)+Math.imul(A,rt)|0,s=s+Math.imul(A,it)|0,i=i+Math.imul(y,st)|0,n=(n=n+Math.imul(y,ot)|0)+Math.imul(v,st)|0,s=s+Math.imul(v,ot)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(g,ht)|0,s=s+Math.imul(g,ut)|0;var St=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ft)|0)+Math.imul(f,lt)|0))<<13)|0;u=((s=s+Math.imul(f,ft)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(D,z),n=(n=Math.imul(D,F))+Math.imul(B,z)|0,s=Math.imul(B,F),i=i+Math.imul(U,H)|0,n=(n=n+Math.imul(U,V)|0)+Math.imul(L,H)|0,s=s+Math.imul(L,V)|0,i=i+Math.imul(C,W)|0,n=(n=n+Math.imul(C,$)|0)+Math.imul(T,W)|0,s=s+Math.imul(T,$)|0,i=i+Math.imul(O,Y)|0,n=(n=n+Math.imul(O,Q)|0)+Math.imul(P,Y)|0,s=s+Math.imul(P,Q)|0,i=i+Math.imul(I,Z)|0,n=(n=n+Math.imul(I,tt)|0)+Math.imul(x,Z)|0,s=s+Math.imul(x,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(S,rt)|0,s=s+Math.imul(S,it)|0,i=i+Math.imul(b,st)|0,n=(n=n+Math.imul(b,ot)|0)+Math.imul(A,st)|0,s=s+Math.imul(A,ot)|0,i=i+Math.imul(y,ht)|0,n=(n=n+Math.imul(y,ut)|0)+Math.imul(v,ht)|0,s=s+Math.imul(v,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ft)|0)+Math.imul(g,lt)|0,s=s+Math.imul(g,ft)|0;var Mt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,gt)|0)+Math.imul(f,pt)|0))<<13)|0;u=((s=s+Math.imul(f,gt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(D,H),n=(n=Math.imul(D,V))+Math.imul(B,H)|0,s=Math.imul(B,V),i=i+Math.imul(U,W)|0,n=(n=n+Math.imul(U,$)|0)+Math.imul(L,W)|0,s=s+Math.imul(L,$)|0,i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,Q)|0)+Math.imul(T,Y)|0,s=s+Math.imul(T,Q)|0,i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(P,Z)|0,s=s+Math.imul(P,tt)|0,i=i+Math.imul(I,rt)|0,n=(n=n+Math.imul(I,it)|0)+Math.imul(x,rt)|0,s=s+Math.imul(x,it)|0,i=i+Math.imul(E,st)|0,n=(n=n+Math.imul(E,ot)|0)+Math.imul(S,st)|0,s=s+Math.imul(S,ot)|0,i=i+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,ut)|0)+Math.imul(A,ht)|0,s=s+Math.imul(A,ut)|0,i=i+Math.imul(y,lt)|0,n=(n=n+Math.imul(y,ft)|0)+Math.imul(v,lt)|0,s=s+Math.imul(v,ft)|0;var It=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;u=((s=s+Math.imul(g,gt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(D,W),n=(n=Math.imul(D,$))+Math.imul(B,W)|0,s=Math.imul(B,$),i=i+Math.imul(U,Y)|0,n=(n=n+Math.imul(U,Q)|0)+Math.imul(L,Y)|0,s=s+Math.imul(L,Q)|0,i=i+Math.imul(C,Z)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(T,Z)|0,s=s+Math.imul(T,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(P,rt)|0,s=s+Math.imul(P,it)|0,i=i+Math.imul(I,st)|0,n=(n=n+Math.imul(I,ot)|0)+Math.imul(x,st)|0,s=s+Math.imul(x,ot)|0,i=i+Math.imul(E,ht)|0,n=(n=n+Math.imul(E,ut)|0)+Math.imul(S,ht)|0,s=s+Math.imul(S,ut)|0,i=i+Math.imul(b,lt)|0,n=(n=n+Math.imul(b,ft)|0)+Math.imul(A,lt)|0,s=s+Math.imul(A,ft)|0;var xt=(u+(i=i+Math.imul(y,pt)|0)|0)+((8191&(n=(n=n+Math.imul(y,gt)|0)+Math.imul(v,pt)|0))<<13)|0;u=((s=s+Math.imul(v,gt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(D,Y),n=(n=Math.imul(D,Q))+Math.imul(B,Y)|0,s=Math.imul(B,Q),i=i+Math.imul(U,Z)|0,n=(n=n+Math.imul(U,tt)|0)+Math.imul(L,Z)|0,s=s+Math.imul(L,tt)|0,i=i+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(T,rt)|0,s=s+Math.imul(T,it)|0,i=i+Math.imul(O,st)|0,n=(n=n+Math.imul(O,ot)|0)+Math.imul(P,st)|0,s=s+Math.imul(P,ot)|0,i=i+Math.imul(I,ht)|0,n=(n=n+Math.imul(I,ut)|0)+Math.imul(x,ht)|0,s=s+Math.imul(x,ut)|0,i=i+Math.imul(E,lt)|0,n=(n=n+Math.imul(E,ft)|0)+Math.imul(S,lt)|0,s=s+Math.imul(S,ft)|0;var Nt=(u+(i=i+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,gt)|0)+Math.imul(A,pt)|0))<<13)|0;u=((s=s+Math.imul(A,gt)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(D,Z),n=(n=Math.imul(D,tt))+Math.imul(B,Z)|0,s=Math.imul(B,tt),i=i+Math.imul(U,rt)|0,n=(n=n+Math.imul(U,it)|0)+Math.imul(L,rt)|0,s=s+Math.imul(L,it)|0,i=i+Math.imul(C,st)|0,n=(n=n+Math.imul(C,ot)|0)+Math.imul(T,st)|0,s=s+Math.imul(T,ot)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(P,ht)|0,s=s+Math.imul(P,ut)|0,i=i+Math.imul(I,lt)|0,n=(n=n+Math.imul(I,ft)|0)+Math.imul(x,lt)|0,s=s+Math.imul(x,ft)|0;var Ot=(u+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,gt)|0)+Math.imul(S,pt)|0))<<13)|0;u=((s=s+Math.imul(S,gt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(D,rt),n=(n=Math.imul(D,it))+Math.imul(B,rt)|0,s=Math.imul(B,it),i=i+Math.imul(U,st)|0,n=(n=n+Math.imul(U,ot)|0)+Math.imul(L,st)|0,s=s+Math.imul(L,ot)|0,i=i+Math.imul(C,ht)|0,n=(n=n+Math.imul(C,ut)|0)+Math.imul(T,ht)|0,s=s+Math.imul(T,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ft)|0)+Math.imul(P,lt)|0,s=s+Math.imul(P,ft)|0;var Pt=(u+(i=i+Math.imul(I,pt)|0)|0)+((8191&(n=(n=n+Math.imul(I,gt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((s=s+Math.imul(x,gt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(D,st),n=(n=Math.imul(D,ot))+Math.imul(B,st)|0,s=Math.imul(B,ot),i=i+Math.imul(U,ht)|0,n=(n=n+Math.imul(U,ut)|0)+Math.imul(L,ht)|0,s=s+Math.imul(L,ut)|0,i=i+Math.imul(C,lt)|0,n=(n=n+Math.imul(C,ft)|0)+Math.imul(T,lt)|0,s=s+Math.imul(T,ft)|0;var Rt=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,gt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((s=s+Math.imul(P,gt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(D,ht),n=(n=Math.imul(D,ut))+Math.imul(B,ht)|0,s=Math.imul(B,ut),i=i+Math.imul(U,lt)|0,n=(n=n+Math.imul(U,ft)|0)+Math.imul(L,lt)|0,s=s+Math.imul(L,ft)|0;var Ct=(u+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,gt)|0)+Math.imul(T,pt)|0))<<13)|0;u=((s=s+Math.imul(T,gt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,i=Math.imul(D,lt),n=(n=Math.imul(D,ft))+Math.imul(B,lt)|0,s=Math.imul(B,ft);var Tt=(u+(i=i+Math.imul(U,pt)|0)|0)+((8191&(n=(n=n+Math.imul(U,gt)|0)+Math.imul(L,pt)|0))<<13)|0;u=((s=s+Math.imul(L,gt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863;var kt=(u+(i=Math.imul(D,pt))|0)+((8191&(n=(n=Math.imul(D,gt))+Math.imul(B,pt)|0))<<13)|0;return u=((s=Math.imul(B,gt))+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,h[0]=mt,h[1]=yt,h[2]=vt,h[3]=wt,h[4]=bt,h[5]=At,h[6]=_t,h[7]=Et,h[8]=St,h[9]=Mt,h[10]=It,h[11]=xt,h[12]=Nt,h[13]=Ot,h[14]=Pt,h[15]=Rt,h[16]=Ct,h[17]=Tt,h[18]=kt,0!==u&&(h[19]=u,r.length++),r};function m(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,s=0;s>>26)|0)>>>26,o&=67108863}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r._strip()}function y(t,e,r){return m(t,e,r)}Math.imul||(g=p),n.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):r<63?p(this,t,e):r<1024?m(this,t,e):y(this,t,e)},n.prototype.mul=function(t){var e=new n(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},n.prototype.mulf=function(t){var e=new n(null);return e.words=new Array(this.length+t.length),y(this,t,e)},n.prototype.imul=function(t){return this.clone().mulTo(t,this)},n.prototype.imuln=function(t){var e=t<0;e&&(t=-t),r("number"==typeof t),r(t<67108864);for(var i=0,n=0;n>=26,i+=s/67108864|0,i+=o>>>26,this.words[n]=67108863&o}return 0!==i&&(this.words[n]=i,this.length++),e?this.ineg():this},n.prototype.muln=function(t){return this.clone().imuln(t)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n&1}return e}(t);if(0===e.length)return new n(1);for(var r=this,i=0;i=0);var e,i=t%26,n=(t-i)/26,s=67108863>>>26-i<<26-i;if(0!==i){var o=0;for(e=0;e>>26-i}o&&(this.words[e]=o,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var s=t%26,o=Math.min((t-s)/26,this.length),a=67108863^67108863>>>s<o)for(this.length-=o,u=0;u=0&&(0!==c||u>=n);u--){var l=0|this.words[u];this.words[u]=c<<26-s|l>>>s,c=l&a}return h&&0!==c&&(h.words[h.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(t,e,i){return r(0===this.negative),this.iushrn(t,e,i)},n.prototype.shln=function(t){return this.clone().ishln(t)},n.prototype.ushln=function(t){return this.clone().iushln(t)},n.prototype.shrn=function(t){return this.clone().ishrn(t)},n.prototype.ushrn=function(t){return this.clone().iushrn(t)},n.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26,n=1<=0);var e=t%26,i=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},n.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+i]=67108863&o}for(;n>26,this.words[n+i]=67108863&o;if(0===a)return this._strip();for(r(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this._strip()},n.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),s=t,o=0|s.words[s.length-1];0!=(r=26-this._countBits(o))&&(s=s.ushln(r),i.iushln(r),o=0|s.words[s.length-1]);var a,h=i.length-s.length;if("mod"!==e){(a=new n(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var f=67108864*(0|i.words[s.length+l])+(0|i.words[s.length+l-1]);for(f=Math.min(f/o|0,67108863),i._ishlnsubmul(s,f,l);0!==i.negative;)f--,i.negative=0,i._ishlnsubmul(s,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=f)}return a&&a._strip(),i._strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},n.prototype.divmod=function(t,e,i){return r(!t.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(s=a.div.neg()),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.iadd(t)),{div:s,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(s=a.div.neg()),{div:s,mod:a.mod}):this.negative&t.negative?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new n(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new n(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new n(this.modrn(t.words[0]))}:this._wordDiv(t,e);var s,o,a},n.prototype.div=function(t){return this.divmod(t,"div",!1).div},n.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},n.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},n.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,i=t.ushrn(1),n=t.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},n.prototype.modrn=function(t){var e=t<0;e&&(t=-t),r(t<=67108863);for(var i=(1<<26)%t,n=0,s=this.length-1;s>=0;s--)n=(i*n+(0|this.words[s]))%t;return e?-n:n},n.prototype.modn=function(t){return this.modrn(t)},n.prototype.idivn=function(t){var e=t<0;e&&(t=-t),r(t<=67108863);for(var i=0,n=this.length-1;n>=0;n--){var s=(0|this.words[n])+67108864*i;this.words[n]=s/t|0,i=s%t}return this._strip(),e?this.ineg():this},n.prototype.divn=function(t){return this.clone().idivn(t)},n.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var s=new n(1),o=new n(0),a=new n(0),h=new n(1),u=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++u;for(var c=i.clone(),l=e.clone();!e.isZero();){for(var f=0,d=1;!(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(s.isOdd()||o.isOdd())&&(s.iadd(c),o.isub(l)),s.iushrn(1),o.iushrn(1);for(var p=0,g=1;!(i.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(c),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(i)>=0?(e.isub(i),s.isub(a),o.isub(h)):(i.isub(e),a.isub(s),h.isub(o))}return{a,b:h,gcd:i.iushln(u)}},n.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e,i=this,s=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var o=new n(1),a=new n(0),h=s.clone();i.cmpn(1)>0&&s.cmpn(1)>0;){for(var u=0,c=1;!(i.words[0]&c)&&u<26;++u,c<<=1);if(u>0)for(i.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(h),o.iushrn(1);for(var l=0,f=1;!(s.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(s.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);i.cmp(s)>=0?(i.isub(s),o.isub(a)):(s.isub(i),a.isub(o))}return(e=0===i.cmpn(1)?o:a).cmpn(0)<0&&e.iadd(t),e},n.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var s=e;e=r,r=s}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},n.prototype.invm=function(t){return this.egcd(t).a.umod(t)},n.prototype.isEven=function(){return!(1&this.words[0])},n.prototype.isOdd=function(){return!(1&~this.words[0])},n.prototype.andln=function(t){return this.words[0]&t},n.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,i=(t-e)/26,n=1<>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this._strip(),this.length>1)e=1;else{i&&(t=-t),r(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},n.prototype.gtn=function(t){return 1===this.cmpn(t)},n.prototype.gt=function(t){return 1===this.cmp(t)},n.prototype.gten=function(t){return this.cmpn(t)>=0},n.prototype.gte=function(t){return this.cmp(t)>=0},n.prototype.ltn=function(t){return-1===this.cmpn(t)},n.prototype.lt=function(t){return-1===this.cmp(t)},n.prototype.lten=function(t){return this.cmpn(t)<=0},n.prototype.lte=function(t){return this.cmp(t)<=0},n.prototype.eqn=function(t){return 0===this.cmpn(t)},n.prototype.eq=function(t){return 0===this.cmp(t)},n.red=function(t){return new S(t)},n.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(t){return this.red=t,this},n.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},n.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},n.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},n.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},n.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},n.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},n.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},n.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function w(t,e){this.name=t,this.p=new n(e,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=n._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var t=new n(null);return t.words=new Array(Math.ceil(this.n/13)),t},w.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(t,e){t.iushrn(this.n,0,e)},w.prototype.imulK=function(t){return t.imul(this.k)},i(b,w),b.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n>>22,s=o}s>>>=22,t.words[n-10]=s,0===s&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},n._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new A;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return v[t]=e,e},S.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){r(!(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(u(t,t.umod(this.m)._forceRed(this)),t)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.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)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var i=this.m.add(new n(1)).iushrn(2);return this.pow(t,i)}for(var s=this.m.subn(1),o=0;!s.isZero()&&0===s.andln(1);)o++,s.iushrn(1);r(!s.isZero());var a=new n(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new n(2*c*c).toRed(this);0!==this.pow(c,u).cmp(h);)c.redIAdd(h);for(var l=this.pow(c,s),f=this.pow(t,s.addn(1).iushrn(1)),d=this.pow(t,s),p=o;0!==d.cmp(a);){for(var g=d,m=0;0!==g.cmp(a);m++)g=g.redSqr();r(m=0;i--){for(var u=e.words[i],c=h-1;c>=0;c--){var l=u>>c&1;s!==r[0]&&(s=this.sqr(s)),0!==l||0!==o?(o<<=1,o|=l,(4==++a||0===i&&0===c)&&(s=this.mul(s,r[o]),a=0,o=0)):a=0}h=26}return s},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},n.mont=function(t){return new M(t)},i(M,S),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new n(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=r.isub(i).iushrn(this.shift),o=s;return s.cmp(this.m)>=0?o=s.isub(this.m):s.cmpn(0)<0&&(o=s.iadd(this.m)),o._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(0,_i);var Yi=$i.exports;const Qi="bignumber/5.7.0";var Xi=Yi.BN;const Zi=new ki(Qi),tn={},en=9007199254740991;let rn=!1;class nn{constructor(t,e){t!==tn&&Zi.throwError("cannot call constructor directly; use BigNumber.from",ki.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return on(an(this).fromTwos(t))}toTwos(t){return on(an(this).toTwos(t))}abs(){return"-"===this._hex[0]?nn.from(this._hex.substring(1)):this}add(t){return on(an(this).add(an(t)))}sub(t){return on(an(this).sub(an(t)))}div(t){return nn.from(t).isZero()&&hn("division-by-zero","div"),on(an(this).div(an(t)))}mul(t){return on(an(this).mul(an(t)))}mod(t){const e=an(t);return e.isNeg()&&hn("division-by-zero","mod"),on(an(this).umod(e))}pow(t){const e=an(t);return e.isNeg()&&hn("negative-power","pow"),on(an(this).pow(e))}and(t){const e=an(t);return(this.isNegative()||e.isNeg())&&hn("unbound-bitwise-result","and"),on(an(this).and(e))}or(t){const e=an(t);return(this.isNegative()||e.isNeg())&&hn("unbound-bitwise-result","or"),on(an(this).or(e))}xor(t){const e=an(t);return(this.isNegative()||e.isNeg())&&hn("unbound-bitwise-result","xor"),on(an(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&hn("negative-width","mask"),on(an(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&hn("negative-width","shl"),on(an(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&hn("negative-width","shr"),on(an(this).shrn(t))}eq(t){return an(this).eq(an(t))}lt(t){return an(this).lt(an(t))}lte(t){return an(this).lte(an(t))}gt(t){return an(this).gt(an(t))}gte(t){return an(this).gte(an(t))}isNegative(){return"-"===this._hex[0]}isZero(){return an(this).isZero()}toNumber(){try{return an(this).toNumber()}catch{hn("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Zi.throwError("this platform does not support BigInt",ki.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?rn||(rn=!0,Zi.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?Zi.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",ki.errors.UNEXPECTED_ARGUMENT,{}):Zi.throwError("BigNumber.toString does not accept parameters",ki.errors.UNEXPECTED_ARGUMENT,{})),an(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof nn)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new nn(tn,sn(t)):t.match(/^-?[0-9]+$/)?new nn(tn,sn(new Xi(t))):Zi.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&hn("underflow","BigNumber.from",t),(t>=en||t<=-en)&&hn("overflow","BigNumber.from",t),nn.from(String(t));const e=t;if("bigint"==typeof e)return nn.from(e.toString());if(Bi(e))return nn.from(Ki(e));if(e)if(e.toHexString){const t=e.toHexString();if("string"==typeof t)return nn.from(t)}else{let t=e._hex;if(null==t&&"BigNumber"===e.type&&(t=e.hex),"string"==typeof t&&(zi(t)||"-"===t[0]&&zi(t.substring(1))))return nn.from(t)}return Zi.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!(!t||!t._isBigNumber)}}function sn(t){if("string"!=typeof t)return sn(t.toString(16));if("-"===t[0])return"-"===(t=t.substring(1))[0]&&Zi.throwArgumentError("invalid hex","value",t),"0x00"===(t=sn(t))?t:"-"+t;if("0x"!==t.substring(0,2)&&(t="0x"+t),"0x"===t)return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&"0x00"===t.substring(0,4);)t="0x"+t.substring(4);return t}function on(t){return nn.from(sn(t))}function an(t){const e=nn.from(t).toHexString();return"-"===e[0]?new Xi("-"+e.substring(3),16):new Xi(e.substring(2),16)}function hn(t,e,r){const i={fault:t,operation:e};return null!=r&&(i.value=r),Zi.throwError(t,ki.errors.NUMERIC_FAULT,i)}const un=new ki(Qi),cn={},ln=nn.from(0),fn=nn.from(-1);function dn(t,e,r,i){const n={fault:e,operation:r};return void 0!==i&&(n.value=i),un.throwError(t,ki.errors.NUMERIC_FAULT,n)}let pn="0";for(;pn.length<256;)pn+=pn;function gn(t){if("number"!=typeof t)try{t=nn.from(t).toNumber()}catch{}return"number"==typeof t&&t>=0&&t<=256&&!(t%1)?"1"+pn.substring(0,t):un.throwArgumentError("invalid decimal size","decimals",t)}function mn(t,e){null==e&&(e=0);const r=gn(e),i=(t=nn.from(t)).lt(ln);i&&(t=t.mul(fn));let n=t.mod(r).toString();for(;n.length2&&un.throwArgumentError("too many decimal points","value",t);let s=n[0],o=n[1];for(s||(s="0"),o||(o="0");"0"===o[o.length-1];)o=o.substring(0,o.length-1);for(o.length>r.length-1&&dn("fractional component exceeds decimals","underflow","parseFixed"),""===o&&(o="0");o.lengthnull==t[e]?i:(typeof t[e]!==r&&un.throwArgumentError("invalid fixed format ("+e+" not "+r+")","format."+e,t[e]),t[e]);e=n("signed","boolean",e),r=n("width","number",r),i=n("decimals","number",i)}return r%8&&un.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),i>80&&un.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new vn(cn,e,r,i)}}class wn{constructor(t,e,r,i){t!==cn&&un.throwError("cannot use FixedNumber constructor; use FixedNumber.from",ki.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=e,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(t){this.format.name!==t.format.name&&un.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}addUnsafe(t){this._checkFormat(t);const e=yn(this._value,this.format.decimals),r=yn(t._value,t.format.decimals);return wn.fromValue(e.add(r),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);const e=yn(this._value,this.format.decimals),r=yn(t._value,t.format.decimals);return wn.fromValue(e.sub(r),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);const e=yn(this._value,this.format.decimals),r=yn(t._value,t.format.decimals);return wn.fromValue(e.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);const e=yn(this._value,this.format.decimals),r=yn(t._value,t.format.decimals);return wn.fromValue(e.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=wn.from(t[0],this.format);const r=!t[1].match(/^(0*)$/);return this.isNegative()&&r&&(e=e.subUnsafe(bn.toFormat(e.format))),e}ceiling(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=wn.from(t[0],this.format);const r=!t[1].match(/^(0*)$/);return!this.isNegative()&&r&&(e=e.addUnsafe(bn.toFormat(e.format))),e}round(t){null==t&&(t=0);const e=this.toString().split(".");if(1===e.length&&e.push("0"),(t<0||t>80||t%1)&&un.throwArgumentError("invalid decimal count","decimals",t),e[1].length<=t)return this;const r=wn.from("1"+pn.substring(0,t),this.format),i=An.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(i).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(t){return null==t?this._hex:(t%8&&un.throwArgumentError("invalid byte width","width",t),Vi(nn.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString(),t/8))}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return wn.fromString(this._value,t)}static fromValue(t,e,r){return null==r&&null!=e&&!function(t){return null!=t&&(nn.isBigNumber(t)||"number"==typeof t&&t%1==0||"string"==typeof t&&!!t.match(/^-?[0-9]+$/)||zi(t)||"bigint"==typeof t||Bi(t))}(e)&&(r=e,e=null),null==e&&(e=0),null==r&&(r="fixed"),wn.fromString(mn(t,e),vn.from(r))}static fromString(t,e){null==e&&(e="fixed");const r=vn.from(e),i=yn(t,r.decimals);!r.signed&&i.lt(ln)&&dn("unsigned value cannot be negative","overflow","value",t);let n=null;r.signed?n=i.toTwos(r.width).toHexString():(n=i.toHexString(),n=Vi(n,r.width/8));const s=mn(i,r.decimals);return new wn(cn,n,s,r)}static fromBytes(t,e){null==e&&(e="fixed");const r=vn.from(e);if(ji(t).length>r.width/8)throw new Error("overflow");let i=nn.from(t);r.signed&&(i=i.fromTwos(r.width));const n=i.toTwos((r.signed?0:1)+r.width).toHexString(),s=mn(i,r.decimals);return new wn(cn,n,s,r)}static from(t,e){if("string"==typeof t)return wn.fromString(t,e);if(Bi(t))return wn.fromBytes(t,e);try{return wn.fromValue(t,0,e)}catch(t){if(t.code!==ki.errors.INVALID_ARGUMENT)throw t}return un.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(t){return!(!t||!t._isFixedNumber)}}const bn=wn.from(1),An=wn.from("0.5"),_n=new ki("strings/5.7.0");var En,Sn;function Mn(t,e,r,i,n){if(t===Sn.BAD_PREFIX||t===Sn.UNEXPECTED_CONTINUE){let t=0;for(let i=e+1;i>6==2;i++)t++;return t}return t===Sn.OVERRUN?r.length-e-1:0}function In(t,e=En.current){e!=En.current&&(_n.checkNormalize(),t=t.normalize(e));let r=[];for(let e=0;e>6|192),r.push(63&i|128);else if(55296==(64512&i)){e++;const n=t.charCodeAt(e);if(e>=t.length||56320!=(64512&n))throw new Error("invalid utf-8 string");const s=65536+((1023&i)<<10)+(1023&n);r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(63&s|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(63&i|128)}return ji(r)}function xn(t,e){e||(e=function(t){return[parseInt(t,16)]});let r=0,i={};return t.split(",").forEach((t=>{let n=t.split(":");r+=parseInt(n[0],16),i[r]=e(n[1])})),i}function Nn(t){let e=0;return t.split(",").map((t=>{let r=t.split("-");1===r.length?r[1]="0":""===r[1]&&(r[1]="1");let i=e+parseInt(r[0],16);return e=parseInt(r[1],16),{l:i,h:e}}))}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(En||(En={})),function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"}(Sn||(Sn={})),Object.freeze({error:function(t,e,r,i,n){return _n.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)},ignore:Mn,replace:function(t,e,r,i,n){return t===Sn.OVERLONG?(i.push(n),0):(i.push(65533),Mn(t,e,r))}}),Nn("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((t=>parseInt(t,16))),xn("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),xn("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),xn("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(t){if(t.length%4!=0)throw new Error("bad data");let e=[];for(let r=0;r0&&Array.isArray(t)?n(t,e-1):r.push(t)}))};return n(t,e),r}function Rn(t){return 1&t?~t>>1:t>>1}function Cn(t,e){let r=Array(t);for(let i=0,n=-1;ie[t])):r}function Un(t,e,r){let i=Array(t).fill(void 0).map((()=>[]));for(let n=0;ni[e].push(t)));return i}function Ln(t,e){let r=1+e(),i=e(),n=function(t){let e=[];for(;;){let r=t();if(0==r)break;e.push(r)}return e}(e);return Pn(Un(n.length,1+t,e).map(((t,e)=>{const s=t[0],o=t.slice(1);return Array(n[e]).fill(void 0).map(((t,e)=>{let n=e*i;return[s+e*r,o.map((t=>t+n))]}))})))}function qn(t,e){return Un(1+e(),1+t,e).map((t=>[t[0],t.slice(1)]))}const Dn=function(t){return function(t){let e=0;return()=>t[e++]}(function(t){let e=0;function r(){return t[e++]<<8|t[e++]}let i=r(),n=1,s=[0,1];for(let t=1;t>--h&1}const l=Math.pow(2,31),f=l>>>1,d=f>>1,p=l-1;let g=0;for(let t=0;t<31;t++)g=g<<1|c();let m=[],y=0,v=l;for(;;){let t=Math.floor(((g-y+1)*n-1)/v),e=0,r=i;for(;r-e>1;){let i=e+r>>>1;t>>1|c(),o=o<<1^f,a=(a^f)<<1|f|1;y=o,v=1+a-o}let w=i-4;return m.map((e=>{switch(e-w){case 3:return w+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return w+256+(t[a++]<<8|t[a++]);case 1:return w+t[a++];default:return e-1}}))}(t))}(function(t){t=atob(t);const e=[];for(let r=0;rt-e));!function r(){let i=[];for(;;){let n=kn(t,e);if(0==n.length)break;i.push({set:new Set(n),node:r()})}i.sort(((t,e)=>e.set.size-t.set.size));let n=t(),s=n%3;n=n/3|0;let o=!!(1&n);return n>>=1,{branches:i,valid:s,fe0f:o,save:1==n,check:2==n}}()}(Dn),new ki(On),new Uint8Array(32).fill(0);const Bn="Ethereum Signed Message:\n";function jn(t){return"string"==typeof t&&(t=In(t)),Wi(function(t){const e=t.map((t=>ji(t))),r=e.reduce(((t,e)=>t+e.length),0),i=new Uint8Array(r);return e.reduce(((t,e)=>(i.set(e,t),t+e.length)),0),qi(i)}([In(Bn),In(String(t.length)),t]))}new ki("rlp/5.7.0");const zn=new ki("address/5.7.0");function Fn(t){zi(t,20)||zn.throwArgumentError("invalid address","address",t);const e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let t=0;t<40;t++)r[t]=e[t].charCodeAt(0);const i=ji(Wi(r));for(let t=0;t<40;t+=2)i[t>>1]>>4>=8&&(e[t]=e[t].toUpperCase()),(15&i[t>>1])>=8&&(e[t+1]=e[t+1].toUpperCase());return"0x"+e.join("")}const Kn={};for(let t=0;t<10;t++)Kn[String(t)]=String(t);for(let t=0;t<26;t++)Kn[String.fromCharCode(65+t)]=String(10+t);const Hn=Math.floor(function(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}(9007199254740991));function Vn(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}new ki("properties/5.7.0"),new ki(On),new Uint8Array(32).fill(0),nn.from(-1);const Gn=nn.from(0),Wn=nn.from(1);nn.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Vi(Wn.toHexString(),32),Vi(Gn.toHexString(),32);var $n={},Jn={},Yn=Qn;function Qn(t,e){if(!t)throw new Error(e||"Assertion failed")}Qn.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var Xn={exports:{}};"function"==typeof Object.create?Xn.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Xn.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}};var Zn=Yn,ts=Xn.exports;function es(t,e){return!(55296!=(64512&t.charCodeAt(e))||e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1))}function rs(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function is(t){return 1===t.length?"0"+t:t}function ns(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}Jn.inherits=ts,Jn.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n>6|192,r[i++]=63&s|128):es(t,n)?(s=65536+((1023&s)<<10)+(1023&t.charCodeAt(++n)),r[i++]=s>>18|240,r[i++]=s>>12&63|128,r[i++]=s>>6&63|128,r[i++]=63&s|128):(r[i++]=s>>12|224,r[i++]=s>>6&63|128,r[i++]=63&s|128)}else for(n=0;n>>0}return s},Jn.split32=function(t,e){for(var r=new Array(4*t.length),i=0,n=0;i>>24,r[n+1]=s>>>16&255,r[n+2]=s>>>8&255,r[n+3]=255&s):(r[n+3]=s>>>24,r[n+2]=s>>>16&255,r[n+1]=s>>>8&255,r[n]=255&s)}return r},Jn.rotr32=function(t,e){return t>>>e|t<<32-e},Jn.rotl32=function(t,e){return t<>>32-e},Jn.sum32=function(t,e){return t+e>>>0},Jn.sum32_3=function(t,e,r){return t+e+r>>>0},Jn.sum32_4=function(t,e,r,i){return t+e+r+i>>>0},Jn.sum32_5=function(t,e,r,i,n){return t+e+r+i+n>>>0},Jn.sum64=function(t,e,r,i){var n=t[e],s=i+t[e+1]>>>0,o=(s>>0,t[e+1]=s},Jn.sum64_hi=function(t,e,r,i){return(e+i>>>0>>0},Jn.sum64_lo=function(t,e,r,i){return e+i>>>0},Jn.sum64_4_hi=function(t,e,r,i,n,s,o,a){var h=0,u=e;return h+=(u=u+i>>>0)>>0)>>0)>>0},Jn.sum64_4_lo=function(t,e,r,i,n,s,o,a){return e+i+s+a>>>0},Jn.sum64_5_hi=function(t,e,r,i,n,s,o,a,h,u){var c=0,l=e;return c+=(l=l+i>>>0)>>0)>>0)>>0)>>0},Jn.sum64_5_lo=function(t,e,r,i,n,s,o,a,h,u){return e+i+s+a+u>>>0},Jn.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},Jn.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},Jn.shr64_hi=function(t,e,r){return t>>>r},Jn.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0};var ss={},os=Jn,as=Yn;function hs(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}ss.BlockHash=hs,hs.prototype.update=function(t,e){if(t=os.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=os.join32(t,0,t.length-r,this.endian);for(var i=0;i>>24&255,i[n++]=t>>>16&255,i[n++]=t>>>8&255,i[n++]=255&t}else for(i[n++]=255&t,i[n++]=t>>>8&255,i[n++]=t>>>16&255,i[n++]=t>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,s=8;s>>3},cs.g1_256=function(t){return ls(t,17)^ls(t,19)^t>>>10};var gs=Jn,ms=ss,ys=cs,vs=gs.rotl32,ws=gs.sum32,bs=gs.sum32_5,As=ys.ft_1,_s=ms.BlockHash,Es=[1518500249,1859775393,2400959708,3395469782];function Ss(){if(!(this instanceof Ss))return new Ss;_s.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}gs.inherits(Ss,_s);var Ms=Ss;Ss.blockSize=512,Ss.outSize=160,Ss.hmacStrength=80,Ss.padLength=64,Ss.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;ithis.blockSize&&(t=(new this.Hash).update(t).digest()),Vo(t.length<=this.blockSize);for(var e=t.length;e>8,o=255&n;s?r.push(s,o):r.push(o)}return r},r.zero2=i,r.toHex=n,r.encode=function(t,e){return"hex"===e?n(t):t}})),Zo=Jo((function(t,e){var r=e;r.assert=Yo,r.toArray=Xo.toArray,r.zero2=Xo.zero2,r.toHex=Xo.toHex,r.encode=Xo.encode,r.getNAF=function(t,e,r){var i=new Array(Math.max(t.bitLength(),r)+1);i.fill(0);for(var n=1<(n>>1)-1?(n>>1)-h:h,s.isubn(a)):a=0,i[o]=a,s.iushrn(1)}return i},r.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var i,n=0,s=0;t.cmpn(-n)>0||e.cmpn(-s)>0;){var o,a,h=t.andln(3)+n&3,u=e.andln(3)+s&3;3===h&&(h=-1),3===u&&(u=-1),o=1&h?3!=(i=t.andln(7)+n&7)&&5!==i||2!==u?h:-h:0,r[0].push(o),a=1&u?3!=(i=e.andln(7)+s&7)&&5!==i||2!==h?u:-u:0,r[1].push(a),2*n===o+1&&(n=1-n),2*s===a+1&&(s=1-s),t.iushrn(1),e.iushrn(1)}return r},r.cachedProperty=function(t,e,r){var i="_"+e;t.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},r.parseBytes=function(t){return"string"==typeof t?r.toArray(t,"hex"):t},r.intFromLE=function(t){return new Yi(t,"hex","le")}})),ta=Zo.getNAF,ea=Zo.getJSF,ra=Zo.assert;function ia(t,e){this.type=t,this.p=new Yi(e.p,16),this.red=e.prime?Yi.red(e.prime):Yi.mont(this.p),this.zero=new Yi(0).toRed(this.red),this.one=new Yi(1).toRed(this.red),this.two=new Yi(2).toRed(this.red),this.n=e.n&&new Yi(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var na=ia;function sa(t,e){this.curve=t,this.type=e,this.precomputed=null}ia.prototype.point=function(){throw new Error("Not implemented")},ia.prototype.validate=function(){throw new Error("Not implemented")},ia.prototype._fixedNafMul=function(t,e){ra(t.precomputed);var r=t._getDoubles(),i=ta(e,1,this._bitLength),n=(1<=s;h--)o=(o<<1)+i[h];a.push(o)}for(var u=this.jpoint(null,null,null),c=this.jpoint(null,null,null),l=n;l>0;l--){for(s=0;s=0;a--){for(var h=0;a>=0&&0===s[a];a--)h++;if(a>=0&&h++,o=o.dblp(h),a<0)break;var u=s[a];ra(0!==u),o="affine"===t.type?u>0?o.mixedAdd(n[u-1>>1]):o.mixedAdd(n[-u-1>>1].neg()):u>0?o.add(n[u-1>>1]):o.add(n[-u-1>>1].neg())}return"affine"===t.type?o.toP():o},ia.prototype._wnafMulAdd=function(t,e,r,i,n){var s,o,a,h=this._wnafT1,u=this._wnafT2,c=this._wnafT3,l=0;for(s=0;s=1;s-=2){var d=s-1,p=s;if(1===h[d]&&1===h[p]){var g=[e[d],null,null,e[p]];0===e[d].y.cmp(e[p].y)?(g[1]=e[d].add(e[p]),g[2]=e[d].toJ().mixedAdd(e[p].neg())):0===e[d].y.cmp(e[p].y.redNeg())?(g[1]=e[d].toJ().mixedAdd(e[p]),g[2]=e[d].add(e[p].neg())):(g[1]=e[d].toJ().mixedAdd(e[p]),g[2]=e[d].toJ().mixedAdd(e[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],y=ea(r[d],r[p]);for(l=Math.max(y[0].length,l),c[d]=new Array(l),c[p]=new Array(l),o=0;o=0;s--){for(var _=0;s>=0;){var E=!0;for(o=0;o=0&&_++,b=b.dblp(_),s<0)break;for(o=0;o0?a=u[o][S-1>>1]:S<0&&(a=u[o][-S-1>>1].neg()),b="affine"===a.type?b.mixedAdd(a):b.add(a))}}for(s=0;s=Math.ceil((t.bitLength()+1)/e.step)},sa.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n=0&&(s=e,o=r),i.negative&&(i=i.neg(),n=n.neg()),s.negative&&(s=s.neg(),o=o.neg()),[{a:i,b:n},{a:s,b:o}]},ha.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],n=i.b.mul(t).divRound(this.n),s=r.b.neg().mul(t).divRound(this.n),o=n.mul(r.a),a=s.mul(i.a),h=n.mul(r.b),u=s.mul(i.b);return{k1:t.sub(o).sub(a),k2:h.add(u).neg()}},ha.prototype.pointFromX=function(t,e){(t=new Yi(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var n=i.fromRed().isOdd();return(e&&!n||!e&&n)&&(i=i.redNeg()),this.point(t,i)},ha.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},ha.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,s=0;s":""},ca.prototype.isInfinity=function(){return this.inf},ca.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),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},ca.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(),i=t.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(i),s=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)},ca.prototype.getX=function(){return this.x.fromRed()},ca.prototype.getY=function(){return this.y.fromRed()},ca.prototype.mul=function(t){return t=new Yi(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)},ca.prototype.mulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},ca.prototype.jmulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},ca.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))},ca.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,i=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return e},ca.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},oa(la,na.BasePoint),ha.prototype.jpoint=function(t,e,r){return new la(this,t,e,r)},la.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),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},la.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},la.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r),s=this.y.redMul(e.redMul(t.z)),o=t.y.redMul(r.redMul(this.z)),a=i.redSub(n),h=s.redSub(o);if(0===a.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),l=i.redMul(u),f=h.redSqr().redIAdd(c).redISub(l).redISub(l),d=h.redMul(l.redISub(f)).redISub(s.redMul(c)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(f,d,p)},la.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y,s=t.y.redMul(e).redMul(this.z),o=r.redSub(i),a=n.redSub(s);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=o.redSqr(),u=h.redMul(o),c=r.redMul(h),l=a.redSqr().redIAdd(u).redISub(c).redISub(c),f=a.redMul(c.redISub(l)).redISub(n.redMul(u)),d=this.z.redMul(o);return this.curve.jpoint(l,f,d)},la.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},la.prototype.inspect=function(){return this.isInfinity()?"":""},la.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var fa=Jo((function(t,e){var r=e;r.base=na,r.short=ua,r.mont=null,r.edwards=null})),da=Jo((function(t,e){var r,i=e,n=Zo.assert;function s(t){"short"===t.type?this.curve=new fa.short(t):"edwards"===t.type?this.curve=new fa.edwards(t):this.curve=new fa.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function o(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new s(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=s,o("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:$n.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),o("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:$n.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),o("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:$n.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),o("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:$n.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"]}),o("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:$n.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"]}),o("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:$n.sha256,gRed:!1,g:["9"]}),o("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:$n.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch{r=void 0}o("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:$n.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function pa(t){if(!(this instanceof pa))return new pa(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=Xo.toArray(t.entropy,t.entropyEnc||"hex"),r=Xo.toArray(t.nonce,t.nonceEnc||"hex"),i=Xo.toArray(t.pers,t.persEnc||"hex");Yo(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}var ga=pa;pa.prototype._init=function(t,e,r){var i=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},pa.prototype.generate=function(t,e,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(i=r,r=e,e=null),r&&(r=Xo.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length"};var wa=Zo.assert;function ba(t,e){if(t instanceof ba)return t;this._importDER(t,e)||(wa(t.r&&t.s,"Signature without r or s"),this.r=new Yi(t.r,16),this.s=new Yi(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var Aa=ba;function _a(){this.place=0}function Ea(t,e){var r=t[e.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;for(var n=0,s=0,o=e.place;s>>=0;return!(n<=127)&&(e.place=o,n)}function Sa(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}ba.prototype._importDER=function(t,e){t=Zo.toArray(t,e);var r=new _a;if(48!==t[r.place++])return!1;var i=Ea(t,r);if(!1===i||i+r.place!==t.length||2!==t[r.place++])return!1;var n=Ea(t,r);if(!1===n)return!1;var s=t.slice(r.place,n+r.place);if(r.place+=n,2!==t[r.place++])return!1;var o=Ea(t,r);if(!1===o||t.length!==o+r.place)return!1;var a=t.slice(r.place,o+r.place);if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}return this.r=new Yi(s),this.s=new Yi(a),this.recoveryParam=null,!0},ba.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=Sa(e),r=Sa(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];Ma(i,e.length),(i=i.concat(e)).push(2),Ma(i,r.length);var n=i.concat(r),s=[48];return Ma(s,n.length),s=s.concat(n),Zo.encode(s,t)};var Ia=function(){throw new Error("unsupported")},xa=Zo.assert;function Na(t){if(!(this instanceof Na))return new Na(t);"string"==typeof t&&(xa(Object.prototype.hasOwnProperty.call(da,t),"Unknown curve "+t),t=da[t]),t instanceof da.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var Oa=Na;Na.prototype.keyPair=function(t){return new va(this,t)},Na.prototype.keyFromPrivate=function(t,e){return va.fromPrivate(this,t,e)},Na.prototype.keyFromPublic=function(t,e){return va.fromPublic(this,t,e)},Na.prototype.genKeyPair=function(t){t||(t={});for(var e=new ga({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||Ia(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new Yi(2));;){var n=new Yi(e.generate(r));if(!(n.cmp(i)>0))return n.iaddn(1),this.keyFromPrivate(n)}},Na.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},Na.prototype.sign=function(t,e,r,i){"object"==typeof r&&(i=r,r=null),i||(i={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new Yi(t,16));for(var n=this.n.byteLength(),s=e.getPrivate().toArray("be",n),o=t.toArray("be",n),a=new ga({hash:this.hash,entropy:s,nonce:o,pers:i.pers,persEnc:i.persEnc||"utf8"}),h=this.n.sub(new Yi(1)),u=0;;u++){var c=i.k?i.k(u):new Yi(a.generate(this.n.byteLength()));if(!((c=this._truncateToN(c,!0)).cmpn(1)<=0||c.cmp(h)>=0)){var l=this.g.mul(c);if(!l.isInfinity()){var f=l.getX(),d=f.umod(this.n);if(0!==d.cmpn(0)){var p=c.invm(this.n).mul(d.mul(e.getPrivate()).iadd(t));if(0!==(p=p.umod(this.n)).cmpn(0)){var g=(l.getY().isOdd()?1:0)|(0!==f.cmp(d)?2:0);return i.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),g^=1),new Aa({r:d,s:p,recoveryParam:g})}}}}}},Na.prototype.verify=function(t,e,r,i){t=this._truncateToN(new Yi(t,16)),r=this.keyFromPublic(r,i);var n=(e=new Aa(e,"hex")).r,s=e.s;if(n.cmpn(1)<0||n.cmp(this.n)>=0||s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var o,a=s.invm(this.n),h=a.mul(t).umod(this.n),u=a.mul(n).umod(this.n);return this.curve._maxwellTrick?!(o=this.g.jmulAdd(h,r.getPublic(),u)).isInfinity()&&o.eqXToP(n):!(o=this.g.mulAdd(h,r.getPublic(),u)).isInfinity()&&0===o.getX().umod(this.n).cmp(n)},Na.prototype.recoverPubKey=function(t,e,r,i){xa((3&r)===r,"The recovery param is more than two bits"),e=new Aa(e,i);var n=this.n,s=new Yi(t),o=e.r,a=e.s,h=1&r,u=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");o=u?this.curve.pointFromX(o.add(this.curve.n),h):this.curve.pointFromX(o,h);var c=e.r.invm(n),l=n.sub(s).mul(c).umod(n),f=a.mul(c).umod(n);return this.g.mulAdd(l,o,f)},Na.prototype.getKeyRecoveryParam=function(t,e,r,i){if(null!==(e=new Aa(e,i)).recoveryParam)return e.recoveryParam;for(var n=0;n<4;n++){var s;try{s=this.recoverPubKey(t,e,n)}catch{continue}if(s.eq(r))return n}throw new Error("Unable to find valid recovery factor")};var Pa=Jo((function(t,e){var r=e;r.version="6.5.4",r.utils=Zo,r.rand=function(){throw new Error("unsupported")},r.curve=fa,r.curves=da,r.ec=Oa,r.eddsa=null})),Ra=Pa.ec;const Ca=new ki("signing-key/5.7.0");let Ta=null;function ka(){return Ta||(Ta=new Ra("secp256k1")),Ta}class Ua{constructor(t){Vn(this,"curve","secp256k1"),Vn(this,"privateKey",Ki(t)),32!==function(t){if("string"!=typeof t)t=Ki(t);else if(!zi(t)||t.length%2)return null;return(t.length-2)/2}(this.privateKey)&&Ca.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const e=ka().keyFromPrivate(ji(this.privateKey));Vn(this,"publicKey","0x"+e.getPublic(!1,"hex")),Vn(this,"compressedPublicKey","0x"+e.getPublic(!0,"hex")),Vn(this,"_isSigningKey",!0)}_addPoint(t){const e=ka().keyFromPublic(ji(this.publicKey)),r=ka().keyFromPublic(ji(t));return"0x"+e.pub.add(r.pub).encodeCompressed("hex")}signDigest(t){const e=ka().keyFromPrivate(ji(this.privateKey)),r=ji(t);32!==r.length&&Ca.throwArgumentError("bad digest length","digest",t);const i=e.sign(r,{canonical:!0});return Gi({recoveryParam:i.recoveryParam,r:Vi("0x"+i.r.toString(16),32),s:Vi("0x"+i.s.toString(16),32)})}computeSharedSecret(t){const e=ka().keyFromPrivate(ji(this.privateKey)),r=ka().keyFromPublic(ji(La(t)));return Vi("0x"+e.derive(r.getPublic()).toString(16),32)}static isSigningKey(t){return!(!t||!t._isSigningKey)}}function La(t,e){const r=ji(t);if(32===r.length){const t=new Ua(r);return e?"0x"+ka().keyFromPrivate(r).getPublic(!0,"hex"):t.publicKey}return 33===r.length?e?Ki(r):"0x"+ka().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?e?"0x"+ka().keyFromPublic(r).getPublic(!0,"hex"):Ki(r):Ca.throwArgumentError("invalid public or private key","key","[REDACTED]")}var qa;function Da(t,e){return function(t){return function(t){let e=null;if("string"!=typeof t&&zn.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=Fn(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&zn.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==function(t){let e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map((t=>Kn[t])).join("");for(;e.length>=Hn;){let t=e.substring(0,Hn);e=parseInt(t,10)%97+e.substring(t.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}(t)&&zn.throwArgumentError("bad icap checksum","address",t),e=function(t){return new Xi(t,36).toString(16)}(t.substring(4));e.length<40;)e="0"+e;e=Fn("0x"+e)}else zn.throwArgumentError("invalid address","address",t);return e}(Hi(Wi(Hi(La(t),1)),12))}(function(t,e){const r=Gi(e),i={r:ji(r.r),s:ji(r.s)};return"0x"+ka().recoverPubKey(ji(t),i,r.recoveryParam).encode("hex",!1)}(ji(t),e))}new ki("transactions/5.7.0"),function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"}(qa||(qa={}));const Ba="https://rpc.walletconnect.com/v1";var ja=Object.defineProperty,za=Object.defineProperties,Fa=Object.getOwnPropertyDescriptors,Ka=Object.getOwnPropertySymbols,Ha=Object.prototype.hasOwnProperty,Va=Object.prototype.propertyIsEnumerable,Ga=(t,e,r)=>e in t?ja(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;const Wa=t=>t?.split(":"),$a=t=>{const e=t&&Wa(t);if(e)return t.includes("did:pkh:")?e[3]:e[1]},Ja=t=>{const e=t&&Wa(t);if(e)return e[2]+":"+e[3]},Ya=t=>{const e=t&&Wa(t);if(e)return e.pop()};async function Qa(t){const{cacao:e,projectId:r}=t,{s:i,p:n}=e,s=Xa(n,n.iss),o=Ya(n.iss);return await async function(t,e,r,i,n,s){switch(r.t){case"eip191":return function(t,e,r){return Da(jn(e),r).toLowerCase()===t.toLowerCase()}(t,e,r.s);case"eip1271":return await async function(t,e,r,i,n,s){try{const o="0x1626ba7e",a="0000000000000000000000000000000000000000000000000000000000000040",h="0000000000000000000000000000000000000000000000000000000000000041",u=r.substring(2),c=o+jn(e).substring(2)+a+h+u,l=await fetch(`${s||Ba}/?chainId=${i}&projectId=${n}`,{method:"POST",body:JSON.stringify({id:Date.now()+Math.floor(1e3*Math.random()),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:c},"latest"]})}),{result:f}=await l.json();return!!f&&f.slice(0,o.length).toLowerCase()===o.toLowerCase()}catch(t){return console.error("isValidEip1271Signature: ",t),!1}}(t,e,r.s,i,n,s);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}(o,s,i,$a(n.iss),r)}const Xa=(t,e)=>{const r=`${t.domain} wants you to sign in with your Ethereum account:`,i=Ya(e);if(!t.aud&&!t.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let n=t.statement||void 0;const s=`URI: ${t.aud||t.uri}`,o=`Version: ${t.version}`,a=`Chain ID: ${$a(e)}`,h=`Nonce: ${t.nonce}`,u=`Issued At: ${t.iat}`,c=t.exp?`Expiration Time: ${t.exp}`:void 0,l=t.nbf?`Not Before: ${t.nbf}`:void 0,f=t.requestId?`Request ID: ${t.requestId}`:void 0,d=t.resources?`Resources:${t.resources.map((t=>`\n- ${t}`)).join("")}`:void 0,p=oh(t.resources);return p&&(n=function(t="",e){Za(e);const r="I further authorize the stated URI to perform the following actions on my behalf: ";if(t.includes(r))return t;const i=[];let n=0;return Object.keys(e.att).forEach((t=>{const r=Object.keys(e.att[t]).map((t=>({ability:t.split("/")[0],action:t.split("/")[1]})));r.sort(((t,e)=>t.action.localeCompare(e.action)));const s={};r.forEach((t=>{s[t.ability]||(s[t.ability]=[]),s[t.ability].push(t.action)}));const o=Object.keys(s).map((e=>(n++,`(${n}) '${e}': '${s[e].join("', '")}' for '${t}'.`)));i.push(o.join(", ").replace(".,","."))})),`${t?t+" ":""}${r}${i.join(" ")}`}(n,rh(p))),[r,i,"",n,"",s,o,a,h,u,c,l,f,d].filter((t=>null!=t)).join("\n")};function Za(t){if(!t)throw new Error("No recap provided, value is undefined");if(!t.att)throw new Error("No `att` property found");const e=Object.keys(t.att);if(null==e||!e.length)throw new Error("No resources found in `att` property");e.forEach((e=>{const r=t.att[e];if(Array.isArray(r))throw new Error(`Resource must be an object: ${e}`);if("object"!=typeof r)throw new Error(`Resource must be an object: ${e}`);if(!Object.keys(r).length)throw new Error(`Resource object is empty: ${e}`);Object.keys(r).forEach((t=>{const e=r[t];if(!Array.isArray(e))throw new Error(`Ability limits ${t} must be an array of objects, found: ${e}`);if(!e.length)throw new Error(`Value of ${t} is empty array, must be an array with objects`);e.forEach((e=>{if("object"!=typeof e)throw new Error(`Ability limits (${t}) must be an array of objects, found: ${e}`)}))}))}))}function th(t,e,r={}){e=e?.sort(((t,e)=>t.localeCompare(e)));const i=e.map((e=>({[`${t}/${e}`]:[r]})));return Object.assign({},...i)}function eh(t){return Za(t),`urn:recap:${function(t){return Buffer.from(JSON.stringify(t)).toString("base64")}(t).replace(/=/g,"")}`}function rh(t){const e=function(t){return JSON.parse(Buffer.from(t,"base64").toString("utf-8"))}(t.replace("urn:recap:",""));return Za(e),e}function ih(t,e){const r=function(t,e){Za(t),Za(e);const r=Object.keys(t.att).concat(Object.keys(e.att)).sort(((t,e)=>t.localeCompare(e))),i={att:{}};return r.forEach((r=>{var n,s;Object.keys((null==(n=t.att)?void 0:n[r])||{}).concat(Object.keys((null==(s=e.att)?void 0:s[r])||{})).sort(((t,e)=>t.localeCompare(e))).forEach((n=>{var s,o;i.att[r]=((t,e)=>za(t,Fa(e)))(((t,e)=>{for(var r in e||(e={}))Ha.call(e,r)&&Ga(t,r,e[r]);if(Ka)for(var r of Ka(e))Va.call(e,r)&&Ga(t,r,e[r]);return t})({},i.att[r]),{[n]:(null==(s=t.att[r])?void 0:s[n])||(null==(o=e.att[r])?void 0:o[n])})}))})),i}(rh(t),rh(e));return eh(r)}function nh(t){var e;const r=rh(t);Za(r);const i=null==(e=r.att)?void 0:e.eip155;return i?Object.keys(i).map((t=>t.split("/")[1])):[]}function sh(t){const e=rh(t);Za(e);const r=[];return Object.values(e.att).forEach((t=>{Object.values(t).forEach((t=>{var e;null!=(e=t?.[0])&&e.chains&&r.push(t[0].chains)}))})),[...new Set(r.flat())]}function oh(t){if(!t)return;const e=t?.[t.length-1];return function(t){return t&&t.includes("urn:recap:")}(e)?e:void 0}const ah="base10",hh="base16",uh="base64pad",ch="utf8";function lh(){return Gr((0,Lt.randomBytes)(32),hh)}function fh(t){return Gr((0,qr.tW)(Vr(t,hh)),hh)}function dh(t){return Gr((0,qr.tW)(Vr(t,ch)),hh)}function ph(t){return Number(Gr(t,ah))}function gh(t){const e=Vr(t,uh),r=e.slice(0,1);if(1===ph(r)){const t=33,i=t+12,n=e.slice(1,t),s=e.slice(t,i);return{type:r,sealed:e.slice(i),iv:s,senderPublicKey:n}}const i=e.slice(1,13);return{type:r,sealed:e.slice(13),iv:i}}function mh(t){const e=t?.type||0;if(1===e){if(typeof t?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof t?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t?.senderPublicKey,receiverPublicKey:t?.receiverPublicKey}}function yh(t){return 1===t.type&&"string"==typeof t.senderPublicKey&&"string"==typeof t.receiverPublicKey}function vh(t){return t?.relay||{protocol:"irn"}}function wh(t){const e=Wr[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var bh=Object.defineProperty,Ah=Object.defineProperties,_h=Object.getOwnPropertyDescriptors,Eh=Object.getOwnPropertySymbols,Sh=Object.prototype.hasOwnProperty,Mh=Object.prototype.propertyIsEnumerable,Ih=(t,e,r)=>e in t?bh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,xh=(t,e)=>{for(var r in e||(e={}))Sh.call(e,r)&&Ih(t,r,e[r]);if(Eh)for(var r of Eh(e))Mh.call(e,r)&&Ih(t,r,e[r]);return t};function Nh(t,e="-"){const r={},i="relay"+e;return Object.keys(t).forEach((e=>{if(e.startsWith(i)){const n=e.replace(i,""),s=t[e];r[n]=s}})),r}function Oh(t){const e=(t=(t=t.includes("wc://")?t.replace("wc://",""):t).includes("wc:")?t.replace("wc:",""):t).indexOf(":"),r=-1!==t.indexOf("?")?t.indexOf("?"):void 0,i=t.substring(0,e),n=t.substring(e+1,r).split("@"),s=typeof r<"u"?t.substring(r):"",o=kr.parse(s),a="string"==typeof o.methods?o.methods.split(","):void 0;return{protocol:i,topic:Ph(n[0]),version:parseInt(n[1],10),symKey:o.symKey,relay:Nh(o),methods:a,expiryTimestamp:o.expiryTimestamp?parseInt(o.expiryTimestamp,10):void 0}}function Ph(t){return t.startsWith("//")?t.substring(2):t}var Rh=Object.defineProperty,Ch=Object.defineProperties,Th=Object.getOwnPropertyDescriptors,kh=Object.getOwnPropertySymbols,Uh=Object.prototype.hasOwnProperty,Lh=Object.prototype.propertyIsEnumerable,qh=(t,e,r)=>e in t?Rh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Dh=(t,e)=>{for(var r in e||(e={}))Uh.call(e,r)&&qh(t,r,e[r]);if(kh)for(var r of kh(e))Lh.call(e,r)&&qh(t,r,e[r]);return t},Bh=(t,e)=>Ch(t,Th(e));function jh(t){const e=[];return t.forEach((t=>{const[r,i]=t.split(":");e.push(`${r}:${i}`)})),e}function zh(t){return t.includes(":")}function Fh(t){return zh(t)?t.split(":")[0]:t}function Kh(t){var e,r,i;const n={};if(!Yh(t))return n;for(const[s,o]of Object.entries(t)){const t=zh(s)?[s]:o.chains,a=o.methods||[],h=o.events||[],u=Fh(s);n[u]=Bh(Dh({},n[u]),{chains:bi(t,null==(e=n[u])?void 0:e.chains),methods:bi(a,null==(r=n[u])?void 0:r.methods),events:bi(h,null==(i=n[u])?void 0:i.events)})}return n}function Hh(t,e){e=e.map((t=>t.replace("did:pkh:","")));const r=function(t){const e={};return t?.forEach((t=>{const[r,i]=t.split(":");e[r]||(e[r]={accounts:[],chains:[],events:[]}),e[r].accounts.push(t),e[r].chains.push(`${r}:${i}`)})),e}(e);for(const[e,i]of Object.entries(r))i.methods?i.methods=bi(i.methods,t):i.methods=t,i.events=["chainChanged","accountsChanged"];return r}const Vh={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},Gh={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function Wh(t,e){const{message:r,code:i}=Gh[t];return{message:e?`${r} ${e}`:r,code:i}}function $h(t,e){const{message:r,code:i}=Vh[t];return{message:e?`${r} ${e}`:r,code:i}}function Jh(t,e){return!!Array.isArray(t)&&(!(typeof e<"u"&&t.length)||t.every(e))}function Yh(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Qh(t){return typeof t>"u"}function Xh(t,e){return!(!e||!Qh(t))||"string"==typeof t&&!!t.trim().length}function Zh(t,e){return!(!e||!Qh(t))||"number"==typeof t&&!isNaN(t)}function tu(t){return!(!Xh(t,!1)||!t.includes(":"))&&2===t.split(":").length}function eu(t){if(Xh(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function ru(t){let e=!0;return Jh(t)?t.length&&(e=t.every((t=>Xh(t,!1)))):e=!1,e}function iu(t,e){let r=null;return Object.values(t).forEach((t=>{if(r)return;const i=function(t,e){let r=null;return ru(t?.methods)?ru(t?.events)||(r=$h("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=$h("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}(t,`${e}, namespace`);i&&(r=i)})),r}function nu(t,e){let r=null;if(t&&Yh(t)){const i=iu(t,e);i&&(r=i);const n=function(t,e){let r=null;return Object.values(t).forEach((t=>{if(r)return;const i=function(t,e){let r=null;return Jh(t)?t.forEach((t=>{r||function(t){if(Xh(t,!1)&&t.includes(":")){const e=t.split(":");if(3===e.length){const t=e[0]+":"+e[1];return!!e[2]&&tu(t)}}return!1}(t)||(r=$h("UNSUPPORTED_ACCOUNTS",`${e}, account ${t} should be a string and conform to "namespace:chainId:address" format`))})):r=$h("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}(t?.accounts,`${e} namespace`);i&&(r=i)})),r}(t,e);n&&(r=n)}else r=Wh("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function su(t){return Xh(t.protocol,!0)}function ou(t){return typeof t<"u"&&null!==typeof t}function au(t,e){return!(!tu(e)||!function(t){const e=[];return Object.values(t).forEach((t=>{e.push(...jh(t.accounts))})),e}(t).includes(e))}function hu(t,e,r){let i=null;const n=function(t){const e={};return Object.keys(t).forEach((r=>{var i;r.includes(":")?e[r]=t[r]:null==(i=t[r].chains)||i.forEach((i=>{e[i]={methods:t[r].methods,events:t[r].events}}))})),e}(t),s=function(t){const e={};return Object.keys(t).forEach((r=>{if(r.includes(":"))e[r]=t[r];else{const i=jh(t[r].accounts);i?.forEach((i=>{e[i]={accounts:t[r].accounts.filter((t=>t.includes(`${i}:`))),methods:t[r].methods,events:t[r].events}}))}})),e}(e),o=Object.keys(n),a=Object.keys(s),h=uu(Object.keys(t)),u=uu(Object.keys(e)),c=h.filter((t=>!u.includes(t)));return c.length&&(i=Wh("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.\n Required: ${c.toString()}\n Received: ${Object.keys(e).toString()}`)),ci(o,a)||(i=Wh("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.\n Required: ${o.toString()}\n Approved: ${a.toString()}`)),Object.keys(e).forEach((t=>{if(!t.includes(":")||i)return;const n=jh(e[t].accounts);n.includes(t)||(i=Wh("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${t}\n Required: ${t}\n Approved: ${n.toString()}`))})),o.forEach((t=>{i||(ci(n[t].methods,s[t].methods)?ci(n[t].events,s[t].events)||(i=Wh("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${t}`)):i=Wh("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${t}`))})),i}function uu(t){return[...new Set(t.map((t=>t.includes(":")?t.split(":")[0]:t)))]}function cu(t,e){return Zh(t,!1)&&t<=e.max&&t>=e.min}function lu(){const t=hi();return new Promise((e=>{switch(t){case ii.browser:e(ai()&&navigator?.onLine);break;case ii.reactNative:e(async function(){if(oi()&&typeof r.g<"u"&&null!=r.g&&r.g.NetInfo){const t=await(null==r.g?void 0:r.g.NetInfo.fetch());return t?.isConnected}return!0}());break;case ii.node:default:e(!0)}}))}const fu={};class du{static get(t){return fu[t]}static set(t,e){fu[t]=e}static delete(t){delete fu[t]}}function pu(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}const gu=pu("utf8","u",(t=>"u"+new TextDecoder("utf8").decode(t)),(t=>(new TextEncoder).encode(t.substring(1)))),mu=pu("ascii","a",(t=>{let e="a";for(let r=0;r{const e=function(t=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}((t=t.substring(1)).length);for(let r=0;re.code===t));return e||Mu[Iu]}(t.code)),t);var r}class Uu{}class Lu extends Uu{constructor(){super()}}class qu extends Lu{constructor(t){super()}}function Du(t){return function(t,e){const r=function(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(e&&e.length)return e[0]}(t);return void 0!==r&&new RegExp(e).test(r)}(t,"^wss?:")}function Bu(t){return"object"==typeof t&&"id"in t&&"jsonrpc"in t&&"2.0"===t.jsonrpc}function ju(t){return Bu(t)&&"method"in t}function zu(t){return Bu(t)&&(Fu(t)||Ku(t))}function Fu(t){return"result"in t}function Ku(t){return"error"in t}class Hu extends qu{constructor(t){super(t),this.events=new y.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(t),this.connection.connected&&this.registerEventListeners()}async connect(t=this.connection){await this.open(t)}async disconnect(){await this.close()}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}off(t,e){this.events.off(t,e)}removeListener(t,e){this.events.removeListener(t,e)}async request(t,e){return this.requestStrict(Ru(t.method,t.params||[],t.id||Pu().toString()),e)}async requestStrict(t,e){return new Promise((async(r,i)=>{if(!this.connection.connected)try{await this.open()}catch(t){i(t)}this.events.on(`${t.id}`,(t=>{Ku(t)?i(t.error):r(t.result)}));try{await this.connection.send(t,e)}catch(t){i(t)}}))}setConnection(t=this.connection){return t}onPayload(t){this.events.emit("payload",t),zu(t)?this.events.emit(`${t.id}`,t):this.events.emit("message",{type:t.method,data:t.params})}onClose(t){t&&3e3===t.code&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${t.code} ${t.reason?`(${t.reason})`:""}`)),this.events.emit("disconnect")}async open(t=this.connection){this.connection===t&&this.connection.connected||(this.connection.connected&&this.close(),"string"==typeof t&&(await this.connection.open(t),t=this.connection),this.connection=this.setConnection(t),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",(t=>this.onPayload(t))),this.connection.on("close",(t=>this.onClose(t))),this.connection.on("error",(t=>this.events.emit("error",t))),this.connection.on("register_error",(t=>this.onClose())),this.hasRegisteredEventListeners=!0)}}const Vu=t=>t.split("?")[0],Gu=typeof WebSocket<"u"?WebSocket:typeof r.g<"u"&&typeof r.g.WebSocket<"u"?r.g.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:r(1591);class Wu{constructor(t){if(this.url=t,this.events=new y.EventEmitter,this.registering=!1,!Du(t))throw new Error(`Provided URL is not compatible with WebSocket connection: ${t}`);this.url=t}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}off(t,e){this.events.off(t,e)}removeListener(t,e){this.events.removeListener(t,e)}async open(t=this.url){await this.register(t)}async close(){return new Promise(((t,e)=>{typeof this.socket>"u"?e(new Error("Connection already closed")):(this.socket.onclose=e=>{this.onClose(e),t()},this.socket.close())}))}async send(t){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(F(t))}catch(e){this.onError(t.id,e)}}register(t=this.url){if(!Du(t))throw new Error(`Provided URL is not compatible with WebSocket connection: ${t}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise(((t,e)=>{this.events.once("register_error",(t=>{this.resetMaxListeners(),e(t)})),this.events.once("open",(()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return e(new Error("WebSocket connection is missing or invalid"));t(this.socket)}))}))}return this.url=t,this.registering=!0,new Promise(((e,i)=>{const n=new URLSearchParams(t).get("origin"),s=(0,Nu.isReactNative)()?{headers:{origin:n}}:{rejectUnauthorized:(a=t,!new RegExp("wss?://localhost(:d{2,5})?").test(a))},o=new Gu(t,[],s);var a;typeof WebSocket<"u"||typeof r.g<"u"&&typeof r.g.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u"?o.onerror=t=>{const e=t;i(this.emitError(e.error))}:o.on("error",(t=>{i(this.emitError(t))})),o.onopen=()=>{this.onOpen(o),e(o)}}))}onOpen(t){t.onmessage=t=>this.onPayload(t),t.onclose=t=>this.onClose(t),this.socket=t,this.registering=!1,this.events.emit("open")}onClose(t){this.socket=void 0,this.registering=!1,this.events.emit("close",t)}onPayload(t){if(typeof t.data>"u")return;const e="string"==typeof t.data?z(t.data):t.data;this.events.emit("payload",e)}onError(t,e){const r=this.parseError(e),i=Tu(t,r.message||r.toString());this.events.emit("payload",i)}parseError(t,e=this.url){return function(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable WS RPC url at ${e}`):t}(t,Vu(e))}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}emitError(t){const e=this.parseError(new Error(t?.message||`WebSocket connection failed for host: ${Vu(this.url)}`));return this.events.emit("register_error",e),e}}var $u=r(8142),Ju=r.n($u),Yu=r(916),Qu=r.n(Yu),Xu=function(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i>>0,o=new Uint8Array(s);t[e];){var c=r[t.charCodeAt(e)];if(255===c)return;for(var l=0,f=s-1;(0!==c||l>>0,o[f]=c%256>>>0,c=c/256>>>0;if(0!==c)throw new Error("Non-zero carry");n=l,e++}if(" "!==t[e]){for(var d=s-n;d!==s&&0===o[d];)d++;for(var p=new Uint8Array(i+(s-d)),g=i;d!==s;)p[g++]=o[d++];return p}}}return{encode:function(e){if(e instanceof Uint8Array||(ArrayBuffer.isView(e)?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Array.isArray(e)&&(e=Uint8Array.from(e))),!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===e.length)return"";for(var r=0,i=0,n=0,s=e.length;n!==s&&0===e[n];)n++,r++;for(var o=(s-n)*c+1>>>0,u=new Uint8Array(o);n!==s;){for(var l=e[n],f=0,d=o-1;(0!==l||f>>0,u[d]=l%a>>>0,l=l/a>>>0;if(0!==l)throw new Error("Non-zero carry");i=f,n++}for(var p=o-i;p!==o&&0===u[p];)p++;for(var g=h.repeat(r);p{if(t instanceof Uint8Array&&"Uint8Array"===t.constructor.name)return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")};class tc{constructor(t,e,r){this.name=t,this.prefix=e,this.baseEncode=r}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class ec{constructor(t,e,r){if(this.name=t,this.prefix=e,void 0===e.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=e.codePointAt(0),this.baseDecode=r}decode(t){if("string"==typeof t){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(t){return ic(this,t)}}class rc{constructor(t){this.decoders=t}or(t){return ic(this,t)}decode(t){const e=t[0],r=this.decoders[e];if(r)return r.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const ic=(t,e)=>new rc({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class nc{constructor(t,e,r,i){this.name=t,this.prefix=e,this.baseEncode=r,this.baseDecode=i,this.encoder=new tc(t,e,r),this.decoder=new ec(t,e,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const sc=({name:t,prefix:e,encode:r,decode:i})=>new nc(t,e,r,i),oc=({prefix:t,name:e,alphabet:r})=>{const{encode:i,decode:n}=Xu(r,e);return sc({prefix:t,name:e,encode:i,decode:t=>Zu(n(t))})},ac=({name:t,prefix:e,bitsPerChar:r,alphabet:i})=>sc({prefix:e,name:t,encode:t=>((t,e,r)=>{const i="="===e[e.length-1],n=(1<r;)o-=r,s+=e[n&a>>o];if(o&&(s+=e[n&a<((t,e,r,i)=>{const n={};for(let t=0;t=8&&(a-=8,o[u++]=255&h>>a)}if(a>=r||255&h<<8-a)throw new SyntaxError("Unexpected end of data");return o})(e,i,r,t)}),hc=sc({prefix:"\0",name:"identity",encode:t=>(t=>(new TextDecoder).decode(t))(t),decode:t=>(t=>(new TextEncoder).encode(t))(t)});var uc=Object.freeze({__proto__:null,identity:hc});const cc=ac({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var lc=Object.freeze({__proto__:null,base2:cc});const fc=ac({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var dc=Object.freeze({__proto__:null,base8:fc});const pc=oc({prefix:"9",name:"base10",alphabet:"0123456789"});var gc=Object.freeze({__proto__:null,base10:pc});const mc=ac({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),yc=ac({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var vc=Object.freeze({__proto__:null,base16:mc,base16upper:yc});const bc=ac({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Ac=ac({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),_c=ac({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Ec=ac({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Sc=ac({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Mc=ac({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Ic=ac({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),xc=ac({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Nc=ac({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Oc=Object.freeze({__proto__:null,base32:bc,base32upper:Ac,base32pad:_c,base32padupper:Ec,base32hex:Sc,base32hexupper:Mc,base32hexpad:Ic,base32hexpadupper:xc,base32z:Nc});const Pc=oc({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Rc=oc({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Cc=Object.freeze({__proto__:null,base36:Pc,base36upper:Rc});const Tc=oc({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),kc=oc({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Uc=Object.freeze({__proto__:null,base58btc:Tc,base58flickr:kc});const Lc=ac({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),qc=ac({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Dc=ac({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Bc=ac({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var jc=Object.freeze({__proto__:null,base64:Lc,base64pad:qc,base64url:Dc,base64urlpad:Bc});const zc=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Fc=zc.reduce(((t,e,r)=>(t[r]=e,t)),[]),Kc=zc.reduce(((t,e,r)=>(t[e.codePointAt(0)]=r,t)),[]),Hc=sc({prefix:"🚀",name:"base256emoji",encode:function(t){return t.reduce(((t,e)=>t+Fc[e]),"")},decode:function(t){const e=[];for(const r of t){const t=Kc[r.codePointAt(0)];if(void 0===t)throw new Error(`Non-base256emoji character: ${r}`);e.push(t)}return new Uint8Array(e)}});var Vc=Object.freeze({__proto__:null,base256emoji:Hc}),Gc=128,Wc=-128,$c=Math.pow(2,31),Jc=128,Yc=127,Qc=Math.pow(2,7),Xc=Math.pow(2,14),Zc=Math.pow(2,21),tl=Math.pow(2,28),el=Math.pow(2,35),rl=Math.pow(2,42),il=Math.pow(2,49),nl=Math.pow(2,56),sl=Math.pow(2,63),ol={encode:function t(e,r,i){r=r||[];for(var n=i=i||0;e>=$c;)r[i++]=255&e|Gc,e/=128;for(;e&Wc;)r[i++]=255&e|Gc,e>>>=7;return r[i]=0|e,t.bytes=i-n+1,r},decode:function t(e,r){var i,n=0,s=(r=r||0,0),o=r,a=e.length;do{if(o>=a)throw t.bytes=0,new RangeError("Could not decode varint");i=e[o++],n+=s<28?(i&Yc)<=Jc);return t.bytes=o-r,n},encodingLength:function(t){return t(al.encode(t,e,r),e),ul=t=>al.encodingLength(t),cl=(t,e)=>{const r=e.byteLength,i=ul(t),n=i+ul(r),s=new Uint8Array(n+r);return hl(t,s,0),hl(r,s,i),s.set(e,n),new ll(t,r,e,s)};class ll{constructor(t,e,r,i){this.code=t,this.size=e,this.digest=r,this.bytes=i}}const fl=({name:t,code:e,encode:r})=>new dl(t,e,r);class dl{constructor(t,e,r){this.name=t,this.code=e,this.encode=r}digest(t){if(t instanceof Uint8Array){const e=this.encode(t);return e instanceof Uint8Array?cl(this.code,e):e.then((t=>cl(this.code,t)))}throw Error("Unknown type, must be binary type")}}const pl=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),gl=fl({name:"sha2-256",code:18,encode:pl("SHA-256")}),ml=fl({name:"sha2-512",code:19,encode:pl("SHA-512")});Object.freeze({__proto__:null,sha256:gl,sha512:ml});const yl=Zu,vl={code:0,name:"identity",encode:yl,digest:t=>cl(0,yl(t))};Object.freeze({__proto__:null,identity:vl}),new TextEncoder,new TextDecoder;const wl={...uc,...lc,...dc,...gc,...vc,...Oc,...Cc,...Uc,...jc,...Vc};function bl(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}const Al=bl("utf8","u",(t=>"u"+new TextDecoder("utf8").decode(t)),(t=>(new TextEncoder).encode(t.substring(1)))),_l=bl("ascii","a",(t=>{let e="a";for(let r=0;r{const e=function(t=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}((t=t.substring(1)).length);for(let r=0;r{if(!this.initialized){const t=await this.getKeyChain();typeof t<"u"&&(this.keychain=t),this.initialized=!0}},this.has=t=>(this.isInitialized(),this.keychain.has(t)),this.set=async(t,e)=>{this.isInitialized(),this.keychain.set(t,e),await this.persist()},this.get=t=>{this.isInitialized();const e=this.keychain.get(t);if(typeof e>"u"){const{message:e}=Wh("NO_MATCHING_KEY",`${this.name}: ${t}`);throw new Error(e)}return e},this.del=async t=>{this.isInitialized(),this.keychain.delete(t),await this.persist()},this.core=t,this.logger=At(e,this.name)}get context(){return bt(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(t){await this.core.storage.setItem(this.storageKey,li(t))}async getKeyChain(){const t=await this.core.storage.getItem(this.storageKey);return typeof t<"u"?fi(t):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:t}=Wh("NOT_INITIALIZED",this.name);throw new Error(t)}}}class rf{constructor(t,e,r){this.core=t,this.logger=e,this.name="crypto",this.randomSessionIdentifier=lh(),this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=t=>(this.isInitialized(),this.keychain.has(t)),this.getClientId=async()=>(this.isInitialized(),wr(br(await this.getClientSeed()).publicKey)),this.generateKeyPair=()=>{this.isInitialized();const t=function(){const t=Dr.TZ();return{privateKey:Gr(t.secretKey,hh),publicKey:Gr(t.publicKey,hh)}}();return this.setPrivateKey(t.publicKey,t.privateKey)},this.signJWT=async t=>{this.isInitialized();const e=br(await this.getClientSeed()),r=this.randomSessionIdentifier,i=Nl;return await async function(t,e,r,i,n=(0,Y.fromMiliseconds)(Date.now())){const s={alg:"EdDSA",typ:"JWT"},o={iss:wr(i.publicKey),sub:t,aud:e,iat:n,exp:n+r},a=yr([vr((h={header:s,payload:o}).header),vr(h.payload)].join("."),"utf8");var h;return function(t){return[vr(t.header),vr(t.payload),(e=t.signature,mr(e,qt))].join(".");var e}({header:s,payload:o,signature:Ut._S(i.secretKey,a)})}(r,t,i,e)},this.generateSharedKey=(t,e,r)=>{this.isInitialized();const i=function(t,e){const r=Dr.Tc(Vr(t,hh),Vr(e,hh),!0);return Gr(new Lr.i(qr.aD,r).expand(32),hh)}(this.getPrivateKey(t),e);return this.setSymKey(i,r)},this.setSymKey=async(t,e)=>{this.isInitialized();const r=e||fh(t);return await this.keychain.set(r,t),r},this.deleteKeyPair=async t=>{this.isInitialized(),await this.keychain.del(t)},this.deleteSymKey=async t=>{this.isInitialized(),await this.keychain.del(t)},this.encode=async(t,e,r)=>{this.isInitialized();const i=mh(r),n=F(e);if(yh(i)){const e=i.senderPublicKey,r=i.receiverPublicKey;t=await this.generateSharedKey(e,r)}const s=this.getSymKey(t),{type:o,senderPublicKey:a}=i;return function(t){const e=function(t){return Vr(`${t}`,ah)}(typeof t.type<"u"?t.type:0);if(1===ph(e)&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?Vr(t.senderPublicKey,hh):void 0,i=typeof t.iv<"u"?Vr(t.iv,hh):(0,Lt.randomBytes)(12);return function(t){if(1===ph(t.type)){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Gr(jr([t.type,t.senderPublicKey,t.iv,t.sealed]),uh)}return Gr(jr([t.type,t.iv,t.sealed]),uh)}({type:e,sealed:new Ur.g6(Vr(t.symKey,hh)).seal(i,Vr(t.message,ch)),iv:i,senderPublicKey:r})}({type:o,symKey:s,message:n,senderPublicKey:a})},this.decode=async(t,e,r)=>{this.isInitialized();const i=function(t,e){const r=gh(t);return mh({type:ph(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Gr(r.senderPublicKey,hh):void 0,receiverPublicKey:e?.receiverPublicKey})}(e,r);if(yh(i)){const e=i.receiverPublicKey,r=i.senderPublicKey;t=await this.generateSharedKey(e,r)}try{const r=function(t){const e=new Ur.g6(Vr(t.symKey,hh)),{sealed:r,iv:i}=gh(t.encoded),n=e.open(i,r);if(null===n)throw new Error("Failed to decrypt");return Gr(n,ch)}({symKey:this.getSymKey(t),encoded:e});return z(r)}catch(e){this.logger.error(`Failed to decode message from topic: '${t}', clientId: '${await this.getClientId()}'`),this.logger.error(e)}},this.getPayloadType=t=>ph(gh(t).type),this.getPayloadSenderPublicKey=t=>{const e=gh(t);return e.senderPublicKey?function(t,e="utf8"){const r=yu[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return"utf8"!==e&&"utf-8"!==e||null==globalThis.Buffer||null==globalThis.Buffer.from?r.encoder.encode(t).substring(1):globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8")}(e.senderPublicKey,hh):void 0},this.core=t,this.logger=At(e,this.name),this.keychain=r||new ef(this.core,this.logger)}get context(){return bt(this.logger)}async setPrivateKey(t,e){return await this.keychain.set(t,e),t}getPrivateKey(t){return this.keychain.get(t)}async getClientSeed(){let t="";try{t=this.keychain.get(xl)}catch{t=lh(),await this.keychain.set(xl,t)}return function(t,e="utf8"){const r=El[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return"utf8"!==e&&"utf-8"!==e||null==globalThis.Buffer||null==globalThis.Buffer.from?r.decoder.decode(`${r.prefix}${t}`):globalThis.Buffer.from(t,"utf8")}(t,"base16")}getSymKey(t){return this.keychain.get(t)}isInitialized(){if(!this.initialized){const{message:t}=Wh("NOT_INITIALIZED",this.name);throw new Error(t)}}}class nf extends Mt{constructor(t,e){super(t,e),this.logger=t,this.core=e,this.messages=new Map,this.name="messages",this.version="0.3",this.initialized=!1,this.storagePrefix=Ml,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const t=await this.getRelayerMessages();typeof t<"u"&&(this.messages=t),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(t){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(t)}finally{this.initialized=!0}}},this.set=async(t,e)=>{this.isInitialized();const r=dh(e);let i=this.messages.get(t);return typeof i>"u"&&(i={}),typeof i[r]<"u"||(i[r]=e,this.messages.set(t,i),await this.persist()),r},this.get=t=>{this.isInitialized();let e=this.messages.get(t);return typeof e>"u"&&(e={}),e},this.has=(t,e)=>(this.isInitialized(),typeof this.get(t)[dh(e)]<"u"),this.del=async t=>{this.isInitialized(),this.messages.delete(t),await this.persist()},this.logger=At(t,this.name),this.core=e}get context(){return bt(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(t){await this.core.storage.setItem(this.storageKey,li(t))}async getRelayerMessages(){const t=await this.core.storage.getItem(this.storageKey);return typeof t<"u"?fi(t):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:t}=Wh("NOT_INITIALIZED",this.name);throw new Error(t)}}}class sf extends It{constructor(t,e){super(t,e),this.relayer=t,this.logger=e,this.events=new y.EventEmitter,this.name="publisher",this.queue=new Map,this.publishTimeout=(0,Y.toMiliseconds)(Y.ONE_MINUTE),this.failedPublishTimeout=(0,Y.toMiliseconds)(Y.ONE_SECOND),this.needsTransportRestart=!1,this.publish=async(t,e,r)=>{var i;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:t,message:e,opts:r}});const n=r?.ttl||Ol,s=vh(r),o=r?.prompt||!1,a=r?.tag||0,h=r?.id||Pu().toString(),u={topic:t,message:e,opts:{ttl:n,relay:s,prompt:o,tag:a,id:h}},c=`Failed to publish payload, please try again. id:${h} tag:${a}`,l=Date.now();let f,d=1;try{for(;void 0===f;){if(Date.now()-l>this.publishTimeout)throw new Error(c);this.logger.trace({id:h,attempts:d},`publisher.publish - attempt ${d}`),f=await await pi(this.rpcPublish(t,e,n,s,o,a,h).catch((t=>this.logger.warn(t))),this.publishTimeout,c),d++,f||await new Promise((t=>setTimeout(t,this.failedPublishTimeout)))}this.relayer.events.emit(kl,u),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{id:h,topic:t,message:e,opts:r}})}catch(t){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(t),null!=(i=r?.internal)&&i.throwOnFailedPublish)throw t;this.queue.set(h,u)}},this.on=(t,e)=>{this.events.on(t,e)},this.once=(t,e)=>{this.events.once(t,e)},this.off=(t,e)=>{this.events.off(t,e)},this.removeListener=(t,e)=>{this.events.removeListener(t,e)},this.relayer=t,this.logger=At(e,this.name),this.registerEventListeners()}get context(){return bt(this.logger)}rpcPublish(t,e,r,i,n,s,o){var a,h,u,c;const l={method:wh(i.protocol).publish,params:{topic:t,message:e,ttl:r,prompt:n,tag:s},id:o};return Qh(null==(a=l.params)?void 0:a.prompt)&&(null==(h=l.params)||delete h.prompt),Qh(null==(u=l.params)?void 0:u.tag)&&(null==(c=l.params)||delete c.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:l}),this.relayer.request(l)}removeRequestFromQueue(t){this.queue.delete(t)}checkQueue(){this.queue.forEach((async t=>{const{topic:e,message:r,opts:i}=t;await this.publish(e,r,i)}))}registerEventListeners(){this.relayer.core.heartbeat.on(tt,(()=>{if(this.needsTransportRestart)return this.needsTransportRestart=!1,void this.relayer.events.emit(Tl);this.checkQueue()})),this.relayer.on(Cl,(t=>{this.removeRequestFromQueue(t.id.toString())}))}}class of{constructor(){this.map=new Map,this.set=(t,e)=>{const r=this.get(t);this.exists(t,e)||this.map.set(t,[...r,e])},this.get=t=>this.map.get(t)||[],this.exists=(t,e)=>this.get(t).includes(e),this.delete=(t,e)=>{if(typeof e>"u")return void this.map.delete(t);if(!this.map.has(t))return;const r=this.get(t);if(!this.exists(t,e))return;const i=r.filter((t=>t!==e));i.length?this.map.set(t,i):this.map.delete(t)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var af=Object.defineProperty,hf=Object.defineProperties,uf=Object.getOwnPropertyDescriptors,cf=Object.getOwnPropertySymbols,lf=Object.prototype.hasOwnProperty,ff=Object.prototype.propertyIsEnumerable,df=(t,e,r)=>e in t?af(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,pf=(t,e)=>{for(var r in e||(e={}))lf.call(e,r)&&df(t,r,e[r]);if(cf)for(var r of cf(e))ff.call(e,r)&&df(t,r,e[r]);return t},gf=(t,e)=>hf(t,uf(e));class mf extends Ot{constructor(t,e){super(t,e),this.relayer=t,this.logger=e,this.subscriptions=new Map,this.topicMap=new of,this.events=new y.EventEmitter,this.name="subscription",this.version="0.3",this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=Ml,this.subscribeTimeout=(0,Y.toMiliseconds)(Y.ONE_MINUTE),this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.pendingBatchMessages=[],this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(t,e)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:t,opts:e}});try{const r=vh(e),i={topic:t,relay:r};this.pending.set(t,i);const n=await this.rpcSubscribe(t,r);return"string"==typeof n&&(this.onSubscribe(n,i),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:t,opts:e}})),n}catch(t){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(t),t}},this.unsubscribe=async(t,e)=>{await this.restartToComplete(),this.isInitialized(),typeof e?.id<"u"?await this.unsubscribeById(t,e.id,e):await this.unsubscribeByTopic(t,e)},this.isSubscribed=async t=>{if(this.topics.includes(t))return!0;const e=`${this.pendingSubscriptionWatchLabel}_${t}`;return await new Promise(((r,i)=>{const n=new Y.Watch;n.start(e);const s=setInterval((()=>{!this.pending.has(t)&&this.topics.includes(t)&&(clearInterval(s),n.stop(e),r(!0)),n.elapsed(e)>=zl&&(clearInterval(s),n.stop(e),i(new Error("Subscription resolution timeout")))}),this.pollingInterval)})).catch((()=>!1))},this.on=(t,e)=>{this.events.on(t,e)},this.once=(t,e)=>{this.events.once(t,e)},this.off=(t,e)=>{this.events.off(t,e)},this.removeListener=(t,e)=>{this.events.removeListener(t,e)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=t,this.logger=At(e,this.name),this.clientId=""}get context(){return bt(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(t,e){let r=!1;try{r=this.getSubscription(t).topic===e}catch{}return r}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(t,e){const r=this.topicMap.get(t);await Promise.all(r.map((async r=>await this.unsubscribeById(t,r,e))))}async unsubscribeById(t,e,r){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:t,id:e,opts:r}});try{const i=vh(r);await this.rpcUnsubscribe(t,e,i);const n=$h("USER_DISCONNECTED",`${this.name}, ${t}`);await this.onUnsubscribe(t,e,n),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:t,id:e,opts:r}})}catch(t){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(t),t}}async rpcSubscribe(t,e){const r={method:wh(e.protocol).subscribe,params:{topic:t}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r});try{return await await pi(this.relayer.request(r).catch((t=>this.logger.warn(t))),this.subscribeTimeout)?dh(t+this.clientId):null}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Tl)}return null}async rpcBatchSubscribe(t){if(!t.length)return;const e={method:wh(t[0].relay.protocol).batchSubscribe,params:{topics:t.map((t=>t.topic))}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:e});try{return await await pi(this.relayer.request(e).catch((t=>this.logger.warn(t))),this.subscribeTimeout)}catch{this.relayer.events.emit(Tl)}}async rpcBatchFetchMessages(t){if(!t.length)return;const e={method:wh(t[0].relay.protocol).batchFetchMessages,params:{topics:t.map((t=>t.topic))}};let r;this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:e});try{r=await await pi(this.relayer.request(e).catch((t=>this.logger.warn(t))),this.subscribeTimeout)}catch{this.relayer.events.emit(Tl)}return r}rpcUnsubscribe(t,e,r){const i={method:wh(r.protocol).unsubscribe,params:{topic:t,id:e}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(t,e){this.setSubscription(t,gf(pf({},e),{id:t})),this.pending.delete(e.topic)}onBatchSubscribe(t){t.length&&t.forEach((t=>{this.setSubscription(t.id,pf({},t)),this.pending.delete(t.topic)}))}async onUnsubscribe(t,e,r){this.events.removeAllListeners(e),this.hasSubscription(e,t)&&this.deleteSubscription(e,r),await this.relayer.messages.del(t)}async setRelayerSubscriptions(t){await this.relayer.core.storage.setItem(this.storageKey,t)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(t,e){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:t,subscription:e}),this.addSubscription(t,e)}addSubscription(t,e){this.subscriptions.set(t,pf({},e)),this.topicMap.set(e.topic,t),this.events.emit(Bl,e)}getSubscription(t){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:t});const e=this.subscriptions.get(t);if(!e){const{message:e}=Wh("NO_MATCHING_KEY",`${this.name}: ${t}`);throw new Error(e)}return e}deleteSubscription(t,e){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:t,reason:e});const r=this.getSubscription(t);this.subscriptions.delete(t),this.topicMap.delete(r.topic,t),this.events.emit(jl,gf(pf({},r),{reason:e}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit("subscription_sync")}async reset(){if(this.cached.length){const t=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let e=0;e"u"||!t.length)return;if(this.subscriptions.size){const{message:t}=Wh("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(t)}this.cached=t,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(t){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(t)}}async batchSubscribe(t){if(!t.length)return;const e=await this.rpcBatchSubscribe(t);Jh(e)&&this.onBatchSubscribe(e.map(((e,r)=>gf(pf({},t[r]),{id:e}))))}async batchFetchMessages(t){if(!t.length)return;this.logger.trace(`Fetching batch messages for ${t.length} subscriptions`);const e=await this.rpcBatchFetchMessages(t);e&&e.messages&&(this.pendingBatchMessages=this.pendingBatchMessages.concat(e.messages))}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||!this.relayer.connected)return;const t=[];this.pending.forEach((e=>{t.push(e)})),await this.batchSubscribe(t),this.pendingBatchMessages.length&&(await this.relayer.handleBatchMessageEvents(this.pendingBatchMessages),this.pendingBatchMessages=[])}registerEventListeners(){this.relayer.core.heartbeat.on(tt,(async()=>{await this.checkPending()})),this.events.on(Bl,(async t=>{const e=Bl;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,data:t}),await this.persist()})),this.events.on(jl,(async t=>{const e=jl;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,data:t}),await this.persist()}))}isInitialized(){if(!this.initialized){const{message:t}=Wh("NOT_INITIALIZED",this.name);throw new Error(t)}}async restartToComplete(){this.restartInProgress&&await new Promise((t=>{const e=setInterval((()=>{this.restartInProgress||(clearInterval(e),t())}),this.pollingInterval)}))}}var yf=Object.defineProperty,vf=Object.getOwnPropertySymbols,wf=Object.prototype.hasOwnProperty,bf=Object.prototype.propertyIsEnumerable,Af=(t,e,r)=>e in t?yf(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;class _f extends xt{constructor(t){super(t),this.protocol="wc",this.version=2,this.events=new y.EventEmitter,this.name="relayer",this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","stalled","interrupted"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.heartBeatTimeout=(0,Y.toMiliseconds)(Y.THIRTY_SECONDS+Y.ONE_SECOND),this.request=async t=>{var e,r;this.logger.debug("Publishing Request Payload");const i=t.id||Pu().toString();await this.toEstablishConnection();try{const n=this.provider.request(t);this.requestsInFlight.set(i,{promise:n,request:t}),this.logger.trace({id:i,method:t.method,topic:null==(e=t.params)?void 0:e.topic},"relayer.request - attempt to publish...");const s=await new Promise((async(t,e)=>{const r=()=>{e(new Error(`relayer.request - publish interrupted, id: ${i}`))};this.provider.on(ql,r);const s=await n;this.provider.off(ql,r),t(s)}));return this.logger.trace({id:i,method:t.method,topic:null==(r=t.params)?void 0:r.topic},"relayer.request - published"),s}catch(t){throw this.logger.debug(`Failed to Publish Request: ${i}`),t}finally{this.requestsInFlight.delete(i)}},this.resetPingTimeout=()=>{if(si())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout((()=>{var t,e,r;null==(r=null==(e=null==(t=this.provider)?void 0:t.connection)?void 0:e.socket)||r.terminate()}),this.heartBeatTimeout)}catch(t){this.logger.warn(t)}},this.onPayloadHandler=t=>{this.onProviderPayload(t),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.trace("relayer connected"),this.startPingTimeout(),this.events.emit("relayer_connect")},this.onDisconnectHandler=()=>{this.logger.trace("relayer disconnected"),this.onProviderDisconnect()},this.onProviderErrorHandler=t=>{this.logger.error(t),this.events.emit("relayer_error",t),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(Ul,this.onPayloadHandler),this.provider.on(Ll,this.onConnectHandler),this.provider.on(ql,this.onDisconnectHandler),this.provider.on(Dl,this.onProviderErrorHandler)},this.core=t.core,this.logger=typeof t.logger<"u"&&"string"!=typeof t.logger?At(t.logger,this.name):it()(wt({level:t.logger||"error"})),this.messages=new nf(this.logger,t.core),this.subscriber=new mf(this,this.logger),this.publisher=new sf(this,this.logger),this.relayUrl=t?.relayUrl||Pl,this.projectId=t.projectId,this.bundleId=function(){var t;try{return oi()&&typeof r.g<"u"&&typeof(null==r.g?void 0:r.g.Application)<"u"?null==(t=r.g.Application)?void 0:t.applicationId:void 0}catch{return}}(),this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),await this.transportOpen(),this.initialized=!0,setTimeout((async()=>{0===this.subscriber.topics.length&&0===this.subscriber.pending.size&&(this.logger.info("No topics subscribed to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)}),1e4)}get context(){return bt(this.logger)}get connected(){var t,e,r;return 1===(null==(r=null==(e=null==(t=this.provider)?void 0:t.connection)?void 0:e.socket)?void 0:r.readyState)}get connecting(){var t,e,r;return 0===(null==(r=null==(e=null==(t=this.provider)?void 0:t.connection)?void 0:e.socket)?void 0:r.readyState)}async publish(t,e,r){this.isInitialized(),await this.publisher.publish(t,e,r),await this.recordMessageEvent({topic:t,message:e,publishedAt:Date.now()})}async subscribe(t,e){var r;this.isInitialized();let i,n=(null==(r=this.subscriber.topicMap.get(t))?void 0:r[0])||"";const s=e=>{e.topic===t&&(this.subscriber.off(Bl,s),i())};return await Promise.all([new Promise((t=>{i=t,this.subscriber.on(Bl,s)})),new Promise((async r=>{n=await this.subscriber.subscribe(t,e)||n,r()}))]),n}async unsubscribe(t,e){this.isInitialized(),await this.subscriber.unsubscribe(t,e)}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}off(t,e){this.events.off(t,e)}removeListener(t,e){this.events.removeListener(t,e)}async transportDisconnect(){if(!this.hasExperiencedNetworkDisruption&&this.connected&&this.requestsInFlight.size>0)try{await Promise.all(Array.from(this.requestsInFlight.values()).map((t=>t.promise)))}catch(t){this.logger.warn(t)}this.hasExperiencedNetworkDisruption||this.connected?await pi(this.provider.disconnect(),2e3,"provider.disconnect()").catch((()=>this.onProviderDisconnect())):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(t){await this.confirmOnlineStateOrThrow(),t&&t!==this.relayUrl&&(this.relayUrl=t,await this.transportDisconnect()),await this.createProvider(),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;try{await new Promise((async(t,e)=>{const r=()=>{this.provider.off(ql,r),e(new Error("Connection interrupted while trying to subscribe"))};this.provider.on(ql,r),await pi(this.provider.connect(),(0,Y.toMiliseconds)(Y.ONE_MINUTE),`Socket stalled when trying to connect to ${this.relayUrl}`).catch((t=>{e(t)})),this.subscriber.start().catch((t=>{this.logger.error(t),this.onDisconnectHandler()})),this.hasExperiencedNetworkDisruption=!1,t()}))}catch(t){this.logger.error(t);const e=t;if(this.hasExperiencedNetworkDisruption=!0,!this.isConnectionStalled(e.message))throw t}finally{this.connectionAttemptInProgress=!1}}async restartTransport(t){this.connectionAttemptInProgress||(this.relayUrl=t||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await lu())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(t){if(0===t?.length)return void this.logger.trace("Batch message events is empty. Ignoring...");const e=t.sort(((t,e)=>t.publishedAt-e.publishedAt));this.logger.trace(`Batch of ${e.length} message events sorted`);for(const t of e)try{await this.onMessageEvent(t)}catch(t){this.logger.warn(t)}this.logger.trace(`Batch of ${e.length} message events processed`)}startPingTimeout(){var t,e,r,i,n;if(si())try{null!=(e=null==(t=this.provider)?void 0:t.connection)&&e.socket&&(null==(n=null==(i=null==(r=this.provider)?void 0:r.connection)?void 0:i.socket)||n.once("ping",(()=>{this.resetPingTimeout()}))),this.resetPingTimeout()}catch(t){this.logger.warn(t)}}isConnectionStalled(t){return this.staleConnectionErrors.some((e=>t.includes(e)))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const t=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Hu(new Wu(function({protocol:t,version:e,relayUrl:r,sdkVersion:i,auth:n,projectId:s,useOnCloseEvent:o,bundleId:a}){const h=r.split("?"),u={auth:n,ua:ui(t,e,i),projectId:s,useOnCloseEvent:o||void 0,origin:a||void 0},c=function(t,e){let r=kr.parse(t);return r=ei(ei({},r),e),kr.stringify(r)}(h[1]||"",u);return h[0]+"?"+c}({sdkVersion:"2.14.0",protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:t,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(t){const{topic:e,message:r}=t;await this.messages.set(e,r)}async shouldIgnoreMessageEvent(t){const{topic:e,message:r}=t;if(!r||0===r.length)return this.logger.debug(`Ignoring invalid/empty message: ${r}`),!0;if(!await this.subscriber.isSubscribed(e))return this.logger.debug(`Ignoring message for non-subscribed topic ${e}`),!0;const i=this.messages.has(e,r);return i&&this.logger.debug(`Ignoring duplicate message: ${r}`),i}async onProviderPayload(t){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:t}),ju(t)){if(!t.method.endsWith("_subscription"))return;const e=t.params,{topic:r,message:i,publishedAt:n}=e.data,s={topic:r,message:i,publishedAt:n};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(((t,e)=>{for(var r in e||(e={}))wf.call(e,r)&&Af(t,r,e[r]);if(vf)for(var r of vf(e))bf.call(e,r)&&Af(t,r,e[r]);return t})({type:"event",event:e.id},s)),this.events.emit(e.id,s),await this.acknowledgePayload(t),await this.onMessageEvent(s)}else zu(t)&&this.events.emit(Cl,t)}async onMessageEvent(t){await this.shouldIgnoreMessageEvent(t)||(this.events.emit(Rl,t),await this.recordMessageEvent(t))}async acknowledgePayload(t){const e=Cu(t.id,!0);await this.provider.connection.send(e)}unregisterProviderListeners(){this.provider.off(Ul,this.onPayloadHandler),this.provider.off(Ll,this.onConnectHandler),this.provider.off(ql,this.onDisconnectHandler),this.provider.off(Dl,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let t=await lu();!function(t){switch(hi()){case ii.browser:!function(t){!oi()&&ai()&&(window.addEventListener("online",(()=>t(!0))),window.addEventListener("offline",(()=>t(!1))))}(t);break;case ii.reactNative:!function(t){oi()&&typeof r.g<"u"&&null!=r.g&&r.g.NetInfo&&r.g?.NetInfo.addEventListener((e=>t(e?.isConnected)))}(t);case ii.node:}}((async e=>{t!==e&&(t=e,e?await this.restartTransport().catch((t=>this.logger.error(t))):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))}))}async onProviderDisconnect(){await this.subscriber.stop(),this.requestsInFlight.clear(),clearTimeout(this.pingTimeout),this.events.emit("relayer_disconnect"),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&setTimeout((async()=>{await this.transportOpen().catch((t=>this.logger.error(t)))}),(0,Y.toMiliseconds)(.1))}isInitialized(){if(!this.initialized){const{message:t}=Wh("NOT_INITIALIZED",this.name);throw new Error(t)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),!this.connected&&(this.connectionAttemptInProgress&&await new Promise((t=>{const e=setInterval((()=>{this.connected&&(clearInterval(e),t())}),this.connectionStatusPollingInterval)})),await this.transportOpen())}}var Ef=Object.defineProperty,Sf=Object.getOwnPropertySymbols,Mf=Object.prototype.hasOwnProperty,If=Object.prototype.propertyIsEnumerable,xf=(t,e,r)=>e in t?Ef(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Nf=(t,e)=>{for(var r in e||(e={}))Mf.call(e,r)&&xf(t,r,e[r]);if(Sf)for(var r of Sf(e))If.call(e,r)&&xf(t,r,e[r]);return t};class Of extends Nt{constructor(t,e,r,i=Ml,n=void 0){super(t,e,r,i),this.core=t,this.logger=e,this.name=r,this.map=new Map,this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=Ml,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach((t=>{this.getKey&&null!==t&&!Qh(t)?this.map.set(this.getKey(t),t):function(t){var e;return null==(e=t?.proposer)?void 0:e.publicKey}(t)?this.map.set(t.id,t):function(t){return t?.topic}(t)&&this.map.set(t.topic,t)})),this.cached=[],this.initialized=!0)},this.set=async(t,e)=>{this.isInitialized(),this.map.has(t)?await this.update(t,e):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:t,value:e}),this.map.set(t,e),await this.persist())},this.get=t=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:t}),this.getData(t)),this.getAll=t=>(this.isInitialized(),t?this.values.filter((e=>Object.keys(t).every((r=>Ju()(e[r],t[r]))))):this.values),this.update=async(t,e)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:t,update:e});const r=Nf(Nf({},this.getData(t)),e);this.map.set(t,r),await this.persist()},this.delete=async(t,e)=>{this.isInitialized(),this.map.has(t)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:t,reason:e}),this.map.delete(t),this.addToRecentlyDeleted(t),await this.persist())},this.logger=At(e,this.name),this.storagePrefix=i,this.getKey=n}get context(){return bt(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(t){this.recentlyDeleted.push(t),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(t){await this.core.storage.setItem(this.storageKey,t)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(t){const e=this.map.get(t);if(!e){if(this.recentlyDeleted.includes(t)){const{message:e}=Wh("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${t}`);throw this.logger.error(e),new Error(e)}const{message:e}=Wh("NO_MATCHING_KEY",`${this.name}: ${t}`);throw this.logger.error(e),new Error(e)}return e}async persist(){await this.setDataStore(this.values)}async restore(){try{const t=await this.getDataStore();if(typeof t>"u"||!t.length)return;if(this.map.size){const{message:t}=Wh("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=t,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(t){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(t)}}isInitialized(){if(!this.initialized){const{message:t}=Wh("NOT_INITIALIZED",this.name);throw new Error(t)}}}class Pf{constructor(t,e){this.core=t,this.logger=e,this.name="pairing",this.version="0.3",this.events=new(v()),this.initialized=!1,this.storagePrefix=Ml,this.ignoredPayloadTypes=[1],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:t})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...t])]},this.create=async t=>{this.isInitialized();const e=lh(),r=await this.core.crypto.setSymKey(e),i=yi(Y.FIVE_MINUTES),n={protocol:"irn"},s={topic:r,expiry:i,relay:n,active:!1},o=function(t){return`${t.protocol}:${t.topic}@${t.version}?`+kr.stringify(xh(((t,e)=>Ah(t,_h(e)))(xh({symKey:t.symKey},function(t,e="-"){const r={};return Object.keys(t).forEach((i=>{const n="relay"+e+i;t[i]&&(r[n]=t[i])})),r}(t.relay)),{expiryTimestamp:t.expiryTimestamp}),t.methods?{methods:t.methods.join(",")}:{}))}({protocol:this.core.protocol,version:this.core.version,topic:r,symKey:e,relay:n,expiryTimestamp:i,methods:t?.methods});return this.core.expirer.set(r,i),await this.pairings.set(r,s),await this.core.relayer.subscribe(r),{topic:r,uri:o}},this.pair=async t=>{this.isInitialized(),this.isValidPair(t);const{topic:e,symKey:r,relay:i,expiryTimestamp:n,methods:s}=Oh(t.uri);let o;if(this.pairings.keys.includes(e)&&(o=this.pairings.get(e),o.active))throw new Error(`Pairing already exists: ${e}. Please try again with a new connection URI.`);const a=n||yi(Y.FIVE_MINUTES),h={topic:e,relay:i,expiry:a,active:!1,methods:s};return this.core.expirer.set(e,a),await this.pairings.set(e,h),t.activatePairing&&await this.activate({topic:e}),this.events.emit(Kl,h),this.core.crypto.keychain.has(e)||await this.core.crypto.setSymKey(r,e),await this.core.relayer.subscribe(e,{relay:i}),h},this.activate=async({topic:t})=>{this.isInitialized();const e=yi(Y.THIRTY_DAYS);this.core.expirer.set(t,e),await this.pairings.update(t,{active:!0,expiry:e})},this.ping=async t=>{this.isInitialized(),await this.isValidPing(t);const{topic:e}=t;if(this.pairings.keys.includes(e)){const t=await this.sendRequest(e,"wc_pairingPing",{}),{done:r,resolve:i,reject:n}=di();this.events.once(wi("pairing_ping",t),(({error:t})=>{t?n(t):i()})),await r()}},this.updateExpiry=async({topic:t,expiry:e})=>{this.isInitialized(),await this.pairings.update(t,{expiry:e})},this.updateMetadata=async({topic:t,metadata:e})=>{this.isInitialized(),await this.pairings.update(t,{peerMetadata:e})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async t=>{this.isInitialized(),await this.isValidDisconnect(t);const{topic:e}=t;this.pairings.keys.includes(e)&&(await this.sendRequest(e,"wc_pairingDelete",$h("USER_DISCONNECTED")),await this.deletePairing(e))},this.sendRequest=async(t,e,r)=>{const i=Ru(e,r),n=await this.core.crypto.encode(t,i),s=Fl[e].req;return this.core.history.set(t,i),this.core.relayer.publish(t,n,s),i.id},this.sendResult=async(t,e,r)=>{const i=Cu(t,r),n=await this.core.crypto.encode(e,i),s=await this.core.history.get(e,t),o=Fl[s.request.method].res;await this.core.relayer.publish(e,n,o),await this.core.history.resolve(i)},this.sendError=async(t,e,r)=>{const i=Tu(t,r),n=await this.core.crypto.encode(e,i),s=await this.core.history.get(e,t),o=Fl[s.request.method]?Fl[s.request.method].res:Fl.unregistered_method.res;await this.core.relayer.publish(e,n,o),await this.core.history.resolve(i)},this.deletePairing=async(t,e)=>{await this.core.relayer.unsubscribe(t),await Promise.all([this.pairings.delete(t,$h("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(t),e?Promise.resolve():this.core.expirer.del(t)])},this.cleanup=async()=>{const t=this.pairings.getAll().filter((t=>vi(t.expiry)));await Promise.all(t.map((t=>this.deletePairing(t.topic))))},this.onRelayEventRequest=t=>{const{topic:e,payload:r}=t;switch(r.method){case"wc_pairingPing":return this.onPairingPingRequest(e,r);case"wc_pairingDelete":return this.onPairingDeleteRequest(e,r);default:return this.onUnknownRpcMethodRequest(e,r)}},this.onRelayEventResponse=async t=>{const{topic:e,payload:r}=t,i=(await this.core.history.get(e,r.id)).request.method;return"wc_pairingPing"===i?this.onPairingPingResponse(e,r):this.onUnknownRpcMethodResponse(i)},this.onPairingPingRequest=async(t,e)=>{const{id:r}=e;try{this.isValidPing({topic:t}),await this.sendResult(r,t,!0),this.events.emit("pairing_ping",{id:r,topic:t})}catch(e){await this.sendError(r,t,e),this.logger.error(e)}},this.onPairingPingResponse=(t,e)=>{const{id:r}=e;setTimeout((()=>{Fu(e)?this.events.emit(wi("pairing_ping",r),{}):Ku(e)&&this.events.emit(wi("pairing_ping",r),{error:e.error})}),500)},this.onPairingDeleteRequest=async(t,e)=>{const{id:r}=e;try{this.isValidDisconnect({topic:t}),await this.deletePairing(t),this.events.emit(Hl,{id:r,topic:t})}catch(e){await this.sendError(r,t,e),this.logger.error(e)}},this.onUnknownRpcMethodRequest=async(t,e)=>{const{id:r,method:i}=e;try{if(this.registeredMethods.includes(i))return;const e=$h("WC_METHOD_UNSUPPORTED",i);await this.sendError(r,t,e),this.logger.error(e)}catch(e){await this.sendError(r,t,e),this.logger.error(e)}},this.onUnknownRpcMethodResponse=t=>{this.registeredMethods.includes(t)||this.logger.error($h("WC_METHOD_UNSUPPORTED",t))},this.isValidPair=t=>{var e;if(!ou(t)){const{message:e}=Wh("MISSING_OR_INVALID",`pair() params: ${t}`);throw new Error(e)}if(!eu(t.uri)){const{message:e}=Wh("MISSING_OR_INVALID",`pair() uri: ${t.uri}`);throw new Error(e)}const r=Oh(t.uri);if(null==(e=r?.relay)||!e.protocol){const{message:t}=Wh("MISSING_OR_INVALID","pair() uri#relay-protocol");throw new Error(t)}if(null==r||!r.symKey){const{message:t}=Wh("MISSING_OR_INVALID","pair() uri#symKey");throw new Error(t)}if(null!=r&&r.expiryTimestamp&&(0,Y.toMiliseconds)(r?.expiryTimestamp){if(!ou(t)){const{message:e}=Wh("MISSING_OR_INVALID",`ping() params: ${t}`);throw new Error(e)}const{topic:e}=t;await this.isValidPairingTopic(e)},this.isValidDisconnect=async t=>{if(!ou(t)){const{message:e}=Wh("MISSING_OR_INVALID",`disconnect() params: ${t}`);throw new Error(e)}const{topic:e}=t;await this.isValidPairingTopic(e)},this.isValidPairingTopic=async t=>{if(!Xh(t,!1)){const{message:e}=Wh("MISSING_OR_INVALID",`pairing topic should be a string: ${t}`);throw new Error(e)}if(!this.pairings.keys.includes(t)){const{message:e}=Wh("NO_MATCHING_KEY",`pairing topic doesn't exist: ${t}`);throw new Error(e)}if(vi(this.pairings.get(t).expiry)){await this.deletePairing(t);const{message:e}=Wh("EXPIRED",`pairing topic: ${t}`);throw new Error(e)}},this.core=t,this.logger=At(e,this.name),this.pairings=new Of(this.core,this.logger,this.name,this.storagePrefix)}get context(){return bt(this.logger)}isInitialized(){if(!this.initialized){const{message:t}=Wh("NOT_INITIALIZED",this.name);throw new Error(t)}}registerRelayerEvents(){this.core.relayer.on(Rl,(async t=>{const{topic:e,message:r}=t;if(!this.pairings.keys.includes(e)||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(r)))return;const i=await this.core.crypto.decode(e,r);try{ju(i)?(this.core.history.set(e,i),this.onRelayEventRequest({topic:e,payload:i})):zu(i)&&(await this.core.history.resolve(i),await this.onRelayEventResponse({topic:e,payload:i}),this.core.history.delete(e,i.id))}catch(t){this.logger.error(t)}}))}registerExpirerEvents(){this.core.expirer.on(Yl,(async t=>{const{topic:e}=mi(t.target);e&&this.pairings.keys.includes(e)&&(await this.deletePairing(e,!0),this.events.emit("pairing_expire",{topic:e}))}))}}class Rf extends St{constructor(t,e){super(t,e),this.core=t,this.logger=e,this.records=new Map,this.events=new y.EventEmitter,this.name="history",this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=Ml,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach((t=>this.records.set(t.id,t))),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(t,e,r)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:t,request:e,chainId:r}),this.records.has(e.id))return;const i={id:e.id,topic:t,request:{method:e.method,params:e.params||null},chainId:r,expiry:yi(Y.THIRTY_DAYS)};this.records.set(i.id,i),this.persist(),this.events.emit(Vl,i)},this.resolve=async t=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:t}),!this.records.has(t.id))return;const e=await this.getRecord(t.id);typeof e.response>"u"&&(e.response=Ku(t)?{error:t.error}:{result:t.result},this.records.set(e.id,e),this.persist(),this.events.emit(Gl,e))},this.get=async(t,e)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:t,id:e}),await this.getRecord(e)),this.delete=(t,e)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:e}),this.values.forEach((r=>{if(r.topic===t){if(typeof e<"u"&&r.id!==e)return;this.records.delete(r.id),this.events.emit(Wl,r)}})),this.persist()},this.exists=async(t,e)=>(this.isInitialized(),!!this.records.has(e)&&(await this.getRecord(e)).topic===t),this.on=(t,e)=>{this.events.on(t,e)},this.once=(t,e)=>{this.events.once(t,e)},this.off=(t,e)=>{this.events.off(t,e)},this.removeListener=(t,e)=>{this.events.removeListener(t,e)},this.logger=At(e,this.name)}get context(){return bt(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const t=[];return this.values.forEach((e=>{if(typeof e.response<"u")return;const r={topic:e.topic,request:Ru(e.request.method,e.request.params,e.id),chainId:e.chainId};return t.push(r)})),t}async setJsonRpcRecords(t){await this.core.storage.setItem(this.storageKey,t)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(t){this.isInitialized();const e=this.records.get(t);if(!e){const{message:e}=Wh("NO_MATCHING_KEY",`${this.name}: ${t}`);throw new Error(e)}return e}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit("history_sync")}async restore(){try{const t=await this.getJsonRpcRecords();if(typeof t>"u"||!t.length)return;if(this.records.size){const{message:t}=Wh("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=t,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(t){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(t)}}registerEventListeners(){this.events.on(Vl,(t=>{const e=Vl;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,record:t})})),this.events.on(Gl,(t=>{const e=Gl;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,record:t})})),this.events.on(Wl,(t=>{const e=Wl;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,record:t})})),this.core.heartbeat.on(tt,(()=>{this.cleanup()}))}cleanup(){try{this.isInitialized();let t=!1;this.records.forEach((e=>{(0,Y.toMiliseconds)(e.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${e.id}`),this.records.delete(e.id),this.events.emit(Wl,e,!1),t=!0)})),t&&this.persist()}catch(t){this.logger.warn(t)}}isInitialized(){if(!this.initialized){const{message:t}=Wh("NOT_INITIALIZED",this.name);throw new Error(t)}}}class Cf extends Pt{constructor(t,e){super(t,e),this.core=t,this.logger=e,this.expirations=new Map,this.events=new y.EventEmitter,this.name="expirer",this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=Ml,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach((t=>this.expirations.set(t.target,t))),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=t=>{try{const e=this.formatTarget(t);return typeof this.getExpiration(e)<"u"}catch{return!1}},this.set=(t,e)=>{this.isInitialized();const r=this.formatTarget(t),i={target:r,expiry:e};this.expirations.set(r,i),this.checkExpiry(r,i),this.events.emit($l,{target:r,expiration:i})},this.get=t=>{this.isInitialized();const e=this.formatTarget(t);return this.getExpiration(e)},this.del=t=>{if(this.isInitialized(),this.has(t)){const e=this.formatTarget(t),r=this.getExpiration(e);this.expirations.delete(e),this.events.emit(Jl,{target:e,expiration:r})}},this.on=(t,e)=>{this.events.on(t,e)},this.once=(t,e)=>{this.events.once(t,e)},this.off=(t,e)=>{this.events.off(t,e)},this.removeListener=(t,e)=>{this.events.removeListener(t,e)},this.logger=At(e,this.name)}get context(){return bt(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(t){if("string"==typeof t)return function(t){return gi("topic",t)}(t);if("number"==typeof t)return function(t){return gi("id",t)}(t);const{message:e}=Wh("UNKNOWN_TYPE","Target type: "+typeof t);throw new Error(e)}async setExpirations(t){await this.core.storage.setItem(this.storageKey,t)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit("expirer_sync")}async restore(){try{const t=await this.getExpirations();if(typeof t>"u"||!t.length)return;if(this.expirations.size){const{message:t}=Wh("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=t,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(t){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(t)}}getExpiration(t){const e=this.expirations.get(t);if(!e){const{message:e}=Wh("NO_MATCHING_KEY",`${this.name}: ${t}`);throw this.logger.warn(e),new Error(e)}return e}checkExpiry(t,e){const{expiry:r}=e;(0,Y.toMiliseconds)(r)-Date.now()<=0&&this.expire(t,e)}expire(t,e){this.expirations.delete(t),this.events.emit(Yl,{target:t,expiration:e})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach(((t,e)=>this.checkExpiry(e,t)))}registerEventListeners(){this.core.heartbeat.on(tt,(()=>this.checkExpirations())),this.events.on($l,(t=>{const e=$l;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,data:t}),this.persist()})),this.events.on(Yl,(t=>{const e=Yl;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,data:t}),this.persist()})),this.events.on(Jl,(t=>{const e=Jl;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,data:t}),this.persist()}))}isInitialized(){if(!this.initialized){const{message:t}=Wh("NOT_INITIALIZED",this.name);throw new Error(t)}}}class Tf extends Rt{constructor(t,e){super(t,e),this.projectId=t,this.logger=e,this.name=Ql,this.initialized=!1,this.queue=[],this.verifyDisabled=!1,this.init=async t=>{if(this.verifyDisabled||oi()||!ai())return;const e=this.getVerifyUrl(t?.verifyUrl);this.verifyUrl!==e&&this.removeIframe(),this.verifyUrl=e;try{await this.createIframe()}catch(t){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(t),this.verifyDisabled=!0}},this.register=async t=>{this.initialized?this.sendPost(t.attestationId):(this.addToQueue(t.attestationId),await this.init())},this.resolve=async t=>{if(this.isDevEnv)return"";const e=this.getVerifyUrl(t?.verifyUrl);return this.fetchAttestation(t.attestationId,e)},this.fetchAttestation=async(t,e)=>{this.logger.info(`resolving attestation: ${t} from url: ${e}`);const r=this.startAbortTimer(5*Y.ONE_SECOND),i=await fetch(`${e}/attestation/${t}`,{signal:this.abortController.signal});return clearTimeout(r),200===i.status?await i.json():void 0},this.addToQueue=t=>{this.queue.push(t)},this.processQueue=()=>{0!==this.queue.length&&(this.queue.forEach((t=>this.sendPost(t))),this.queue=[])},this.sendPost=t=>{var e;try{if(!this.iframe)return;null==(e=this.iframe.contentWindow)||e.postMessage(t,"*"),this.logger.info(`postMessage sent: ${t} ${this.verifyUrl}`)}catch{}},this.createIframe=async()=>{let t;const e=r=>{"verify_ready"===r.data&&(this.onInit(),window.removeEventListener("message",e),t())};await Promise.race([new Promise((r=>{const i=document.getElementById(Ql);if(i)return this.iframe=i,this.onInit(),r();window.addEventListener("message",e);const n=document.createElement("iframe");n.id=Ql,n.src=`${this.verifyUrl}/${this.projectId}`,n.style.display="none",document.body.append(n),this.iframe=n,t=r})),new Promise(((t,r)=>setTimeout((()=>{window.removeEventListener("message",e),r("verify iframe load timeout")}),(0,Y.toMiliseconds)(Y.FIVE_SECONDS))))])},this.onInit=()=>{this.initialized=!0,this.processQueue()},this.removeIframe=()=>{this.iframe&&(this.iframe.remove(),this.iframe=void 0,this.initialized=!1)},this.getVerifyUrl=t=>{let e=t||Zl;return tf.includes(e)||(this.logger.info(`verify url: ${e}, not included in trusted list, assigning default: ${Zl}`),e=Zl),e},this.logger=At(e,this.name),this.verifyUrl=Zl,this.abortController=new AbortController,this.isDevEnv=si()&&process.env.IS_VITEST}get context(){return bt(this.logger)}startAbortTimer(t){return this.abortController=new AbortController,setTimeout((()=>this.abortController.abort()),(0,Y.toMiliseconds)(t))}}class kf extends Ct{constructor(t,e){super(t,e),this.projectId=t,this.logger=e,this.context="echo",this.registerDeviceToken=async t=>{const{clientId:e,token:r,notificationType:i,enableEncrypted:n=!1}=t,s=`https://echo.walletconnect.com/${this.projectId}/clients`;await Qu()(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:e,type:i,token:r,always_raw:n})})},this.logger=At(e,this.context)}}var Uf=Object.defineProperty,Lf=Object.getOwnPropertySymbols,qf=Object.prototype.hasOwnProperty,Df=Object.prototype.propertyIsEnumerable,Bf=(t,e,r)=>e in t?Uf(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,jf=(t,e)=>{for(var r in e||(e={}))qf.call(e,r)&&Bf(t,r,e[r]);if(Lf)for(var r of Lf(e))Df.call(e,r)&&Bf(t,r,e[r]);return t};class zf extends Et{constructor(t){var e;super(t),this.protocol="wc",this.version=2,this.name=Sl,this.events=new y.EventEmitter,this.initialized=!1,this.on=(t,e)=>this.events.on(t,e),this.once=(t,e)=>this.events.once(t,e),this.off=(t,e)=>this.events.off(t,e),this.removeListener=(t,e)=>this.events.removeListener(t,e),this.projectId=t?.projectId,this.relayUrl=t?.relayUrl||Pl,this.customStoragePrefix=null!=t&&t.customStoragePrefix?`:${t.customStoragePrefix}`:"";const r=wt({level:"string"==typeof t?.logger&&t.logger?t.logger:"error"}),{logger:i,chunkLoggerController:n}=_t({opts:r,maxSizeInBytes:t?.maxLogBlobSizeInBytes,loggerOverride:t?.logger});this.logChunkController=n,null!=(e=this.logChunkController)&&e.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var t,e;null!=(t=this.logChunkController)&&t.downloadLogsBlobInBrowser&&(null==(e=this.logChunkController)||e.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=At(i,this.name),this.heartbeat=new et,this.crypto=new rf(this,this.logger,t?.keychain),this.history=new Rf(this,this.logger),this.expirer=new Cf(this,this.logger),this.storage=null!=t&&t.storage?t.storage:new J(jf(jf({},Il),t?.storageOptions)),this.relayer=new _f({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new Pf(this,this.logger),this.verify=new Tf(this.projectId||"",this.logger),this.echoClient=new kf(this.projectId||"",this.logger)}static async init(t){const e=new zf(t);await e.initialize();const r=await e.crypto.getClientId();return await e.storage.setItem("WALLETCONNECT_CLIENT_ID",r),e}get context(){return bt(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var t;return null==(t=this.logChunkController)?void 0:t.logsToBlob({clientId:await this.crypto.getClientId()})}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.initialized=!0,this.logger.info("Core Initialization Success")}catch(t){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,t),this.logger.error(t.message),t}}}const Ff=zf;let Kf=!1,Hf=!1;const Vf={debug:1,default:2,info:2,warning:3,error:4,off:5};let Gf=Vf.default,Wf=null;const $f=function(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach((e=>{try{if("test"!=="test".normalize(e))throw new Error("bad normalize")}catch(r){t.push(e)}})),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}();var Jf,Yf;!function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"}(Jf||(Jf={})),function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"}(Yf||(Yf={}));const Qf="0123456789abcdef";class Xf{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const r=t.toLowerCase();null==Vf[r]&&this.throwArgumentError("invalid log level name","logLevel",t),Gf>Vf[r]||console.log.apply(console,e)}debug(...t){this._log(Xf.levels.DEBUG,t)}info(...t){this._log(Xf.levels.INFO,t)}warn(...t){this._log(Xf.levels.WARNING,t)}makeError(t,e,r){if(Hf)return this.makeError("censored error",e,{});e||(e=Xf.errors.UNKNOWN_ERROR),r||(r={});const i=[];Object.keys(r).forEach((t=>{const e=r[t];try{if(e instanceof Uint8Array){let r="";for(let t=0;t>4],r+=Qf[15&e[t]];i.push(t+"=Uint8Array(0x"+r+")")}else i.push(t+"="+JSON.stringify(e))}catch(e){i.push(t+"="+JSON.stringify(r[t].toString()))}})),i.push(`code=${e}`),i.push(`version=${this.version}`);const n=t;let s="";switch(e){case Yf.NUMERIC_FAULT:{s="NUMERIC_FAULT";const e=t;switch(e){case"overflow":case"underflow":case"division-by-zero":s+="-"+e;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result"}break}case Yf.CALL_EXCEPTION:case Yf.INSUFFICIENT_FUNDS:case Yf.MISSING_NEW:case Yf.NONCE_EXPIRED:case Yf.REPLACEMENT_UNDERPRICED:case Yf.TRANSACTION_REPLACED:case Yf.UNPREDICTABLE_GAS_LIMIT:s=e}s&&(t+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),i.length&&(t+=" ("+i.join(", ")+")");const o=new Error(t);return o.reason=n,o.code=e,Object.keys(r).forEach((function(t){o[t]=r[t]})),o}throwError(t,e,r){throw this.makeError(t,e,r)}throwArgumentError(t,e,r){return this.throwError(t,Xf.errors.INVALID_ARGUMENT,{argument:e,value:r})}assert(t,e,r,i){t||this.throwError(e,r,i)}assertArgument(t,e,r,i){t||this.throwArgumentError(e,r,i)}checkNormalize(t){null==t&&(t="platform missing String.prototype.normalize"),$f&&this.throwError("platform missing String.prototype.normalize",Xf.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:$f})}checkSafeUint53(t,e){"number"==typeof t&&(null==e&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,Xf.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,Xf.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,r){r=r?": "+r:"",te&&this.throwError("too many arguments"+r,Xf.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){t!==Object&&null!=t||this.throwError("missing new",Xf.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",Xf.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",Xf.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return Wf||(Wf=new Xf("logger/5.7.0")),Wf}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",Xf.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Kf){if(!t)return;this.globalLogger().throwError("error censorship permanent",Xf.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Hf=!!t,Kf=!!e}static setLogLevel(t){const e=Vf[t.toLowerCase()];null!=e?Gf=e:Xf.globalLogger().warn("invalid log level - "+t)}static from(t){return new Xf(t)}}Xf.errors=Yf,Xf.levels=Jf;const Zf=new Xf("bytes/5.7.0");function td(t){return!!t.toHexString}function ed(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return ed(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function rd(t){return"number"==typeof t&&t==t&&t%1==0}function id(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t)return!1;if(!rd(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function nd(t,e){if(e||(e={}),"number"==typeof t){Zf.checkSafeUint53(t,"invalid arrayify value");const e=[];for(;t;)e.unshift(255&t),t=parseInt(String(t/256));return 0===e.length&&e.push(0),ed(new Uint8Array(e))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),td(t)&&(t=t.toHexString()),sd(t)){let r=t.substring(2);r.length%2&&("left"===e.hexPad?r="0"+r:"right"===e.hexPad?r+="0":Zf.throwArgumentError("hex data is odd-length","value",t));const i=[];for(let t=0;t>4]+od[15&i]}return e}return Zf.throwArgumentError("invalid hexlify value","value",t)}function hd(t,e,r){return"string"!=typeof t?t=ad(t):(!sd(t)||t.length%2)&&Zf.throwArgumentError("invalid hexData","value",t),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function ud(t,e){for("string"!=typeof t?t=ad(t):sd(t)||Zf.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&Zf.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function cd(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(sd(r=t)&&!(r.length%2)||id(r)){let r=nd(t);64===r.length?(e.v=27+(r[32]>>7),r[32]&=127,e.r=ad(r.slice(0,32)),e.s=ad(r.slice(32,64))):65===r.length?(e.r=ad(r.slice(0,32)),e.s=ad(r.slice(32,64)),e.v=r[64]):Zf.throwArgumentError("invalid signature string","signature",t),e.v<27&&(0===e.v||1===e.v?e.v+=27:Zf.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=ad(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,null!=e._vs){const r=function(t,e){(t=nd(t)).length>e&&Zf.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),ed(r)}(nd(e._vs),32);e._vs=ad(r);const i=r[0]>=128?1:0;null==e.recoveryParam?e.recoveryParam=i:e.recoveryParam!==i&&Zf.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),r[0]&=127;const n=ad(r);null==e.s?e.s=n:e.s!==n&&Zf.throwArgumentError("signature v mismatch _vs","signature",t)}if(null==e.recoveryParam)null==e.v?Zf.throwArgumentError("signature missing v and recoveryParam","signature",t):0===e.v||1===e.v?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(null==e.v)e.v=27+e.recoveryParam;else{const r=0===e.v||1===e.v?e.v:1-e.v%2;e.recoveryParam!==r&&Zf.throwArgumentError("signature recoveryParam mismatch v","signature",t)}null!=e.r&&sd(e.r)?e.r=ud(e.r,32):Zf.throwArgumentError("signature missing or invalid r","signature",t),null!=e.s&&sd(e.s)?e.s=ud(e.s,32):Zf.throwArgumentError("signature missing or invalid s","signature",t);const r=nd(e.s);r[0]>=128&&Zf.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const i=ad(r);e._vs&&(sd(e._vs)||Zf.throwArgumentError("signature invalid _vs","signature",t),e._vs=ud(e._vs,32)),null==e._vs?e._vs=i:e._vs!==i&&Zf.throwArgumentError("signature _vs mismatch v and s","signature",t)}var r;return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}var ld=r(1176),fd=r.n(ld);function dd(t){return"0x"+fd().keccak_256(nd(t))}const pd=new Xf("strings/5.7.0");var gd,md;function yd(t,e,r,i,n){if(t===md.BAD_PREFIX||t===md.UNEXPECTED_CONTINUE){let t=0;for(let i=e+1;i>6==2;i++)t++;return t}return t===md.OVERRUN?r.length-e-1:0}function vd(t,e=gd.current){e!=gd.current&&(pd.checkNormalize(),t=t.normalize(e));let r=[];for(let e=0;e>6|192),r.push(63&i|128);else if(55296==(64512&i)){e++;const n=t.charCodeAt(e);if(e>=t.length||56320!=(64512&n))throw new Error("invalid utf-8 string");const s=65536+((1023&i)<<10)+(1023&n);r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(63&s|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(63&i|128)}return nd(r)}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(gd||(gd={})),function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"}(md||(md={})),Object.freeze({error:function(t,e,r,i,n){return pd.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)},ignore:yd,replace:function(t,e,r,i,n){return t===md.OVERLONG?(i.push(n),0):(i.push(65533),yd(t,e,r))}});const wd="Ethereum Signed Message:\n";function bd(t){return"string"==typeof t&&(t=vd(t)),dd(function(t){const e=t.map((t=>nd(t))),r=e.reduce(((t,e)=>t+e.length),0),i=new Uint8Array(r);return e.reduce(((t,e)=>(i.set(e,t),t+e.length)),0),ed(i)}([vd(wd),vd(String(t.length)),t]))}var Ad=r(9404),_d=r.n(Ad),Ed=_d().BN;new Xf("bignumber/5.7.0");const Sd=new Xf("address/5.7.0");function Md(t){sd(t,20)||Sd.throwArgumentError("invalid address","address",t);const e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let t=0;t<40;t++)r[t]=e[t].charCodeAt(0);const i=nd(dd(r));for(let t=0;t<40;t+=2)i[t>>1]>>4>=8&&(e[t]=e[t].toUpperCase()),(15&i[t>>1])>=8&&(e[t+1]=e[t+1].toUpperCase());return"0x"+e.join("")}const Id={};for(let t=0;t<10;t++)Id[String(t)]=String(t);for(let t=0;t<26;t++)Id[String.fromCharCode(65+t)]=String(10+t);const xd=Math.floor((Nd=9007199254740991,Math.log10?Math.log10(Nd):Math.log(Nd)/Math.LN10));var Nd;function Od(t){let e=null;if("string"!=typeof t&&Sd.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=Md(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&Sd.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==function(t){let e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map((t=>Id[t])).join("");for(;e.length>=xd;){let t=e.substring(0,xd);e=parseInt(t,10)%97+e.substring(t.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}(t)&&Sd.throwArgumentError("bad icap checksum","address",t),r=t.substring(4),e=new Ed(r,36).toString(16);e.length<40;)e="0"+e;e=Md("0x"+e)}else Sd.throwArgumentError("invalid address","address",t);var r;return e}var Pd=r(7952),Rd=r.n(Pd);function Cd(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self&&self;var Td=kd;function kd(t,e){if(!t)throw new Error(e||"Assertion failed")}kd.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var Ud=Cd((function(t,e){var r=e;function i(t){return 1===t.length?"0"+t:t}function n(t){for(var e="",r=0;r>8,o=255&n;s?r.push(s,o):r.push(o)}return r},r.zero2=i,r.toHex=n,r.encode=function(t,e){return"hex"===e?n(t):t}})),Ld=Cd((function(t,e){var r=e;r.assert=Td,r.toArray=Ud.toArray,r.zero2=Ud.zero2,r.toHex=Ud.toHex,r.encode=Ud.encode,r.getNAF=function(t,e,r){var i=new Array(Math.max(t.bitLength(),r)+1);i.fill(0);for(var n=1<(n>>1)-1?(n>>1)-h:h,s.isubn(a)):a=0,i[o]=a,s.iushrn(1)}return i},r.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var i,n=0,s=0;t.cmpn(-n)>0||e.cmpn(-s)>0;){var o,a,h=t.andln(3)+n&3,u=e.andln(3)+s&3;3===h&&(h=-1),3===u&&(u=-1),o=1&h?3!=(i=t.andln(7)+n&7)&&5!==i||2!==u?h:-h:0,r[0].push(o),a=1&u?3!=(i=e.andln(7)+s&7)&&5!==i||2!==h?u:-u:0,r[1].push(a),2*n===o+1&&(n=1-n),2*s===a+1&&(s=1-s),t.iushrn(1),e.iushrn(1)}return r},r.cachedProperty=function(t,e,r){var i="_"+e;t.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},r.parseBytes=function(t){return"string"==typeof t?r.toArray(t,"hex"):t},r.intFromLE=function(t){return new(_d())(t,"hex","le")}})),qd=Ld.getNAF,Dd=Ld.getJSF,Bd=Ld.assert;function jd(t,e){this.type=t,this.p=new(_d())(e.p,16),this.red=e.prime?_d().red(e.prime):_d().mont(this.p),this.zero=new(_d())(0).toRed(this.red),this.one=new(_d())(1).toRed(this.red),this.two=new(_d())(2).toRed(this.red),this.n=e.n&&new(_d())(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var zd=jd;function Fd(t,e){this.curve=t,this.type=e,this.precomputed=null}jd.prototype.point=function(){throw new Error("Not implemented")},jd.prototype.validate=function(){throw new Error("Not implemented")},jd.prototype._fixedNafMul=function(t,e){Bd(t.precomputed);var r=t._getDoubles(),i=qd(e,1,this._bitLength),n=(1<=s;h--)o=(o<<1)+i[h];a.push(o)}for(var u=this.jpoint(null,null,null),c=this.jpoint(null,null,null),l=n;l>0;l--){for(s=0;s=0;a--){for(var h=0;a>=0&&0===s[a];a--)h++;if(a>=0&&h++,o=o.dblp(h),a<0)break;var u=s[a];Bd(0!==u),o="affine"===t.type?u>0?o.mixedAdd(n[u-1>>1]):o.mixedAdd(n[-u-1>>1].neg()):u>0?o.add(n[u-1>>1]):o.add(n[-u-1>>1].neg())}return"affine"===t.type?o.toP():o},jd.prototype._wnafMulAdd=function(t,e,r,i,n){var s,o,a,h=this._wnafT1,u=this._wnafT2,c=this._wnafT3,l=0;for(s=0;s=1;s-=2){var d=s-1,p=s;if(1===h[d]&&1===h[p]){var g=[e[d],null,null,e[p]];0===e[d].y.cmp(e[p].y)?(g[1]=e[d].add(e[p]),g[2]=e[d].toJ().mixedAdd(e[p].neg())):0===e[d].y.cmp(e[p].y.redNeg())?(g[1]=e[d].toJ().mixedAdd(e[p]),g[2]=e[d].add(e[p].neg())):(g[1]=e[d].toJ().mixedAdd(e[p]),g[2]=e[d].toJ().mixedAdd(e[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],y=Dd(r[d],r[p]);for(l=Math.max(y[0].length,l),c[d]=new Array(l),c[p]=new Array(l),o=0;o=0;s--){for(var _=0;s>=0;){var E=!0;for(o=0;o=0&&_++,b=b.dblp(_),s<0)break;for(o=0;o0?a=u[o][S-1>>1]:S<0&&(a=u[o][-S-1>>1].neg()),b="affine"===a.type?b.mixedAdd(a):b.add(a))}}for(s=0;s=Math.ceil((t.bitLength()+1)/e.step)},Fd.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n=0&&(s=e,o=r),i.negative&&(i=i.neg(),n=n.neg()),s.negative&&(s=s.neg(),o=o.neg()),[{a:i,b:n},{a:s,b:o}]},Vd.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],n=i.b.mul(t).divRound(this.n),s=r.b.neg().mul(t).divRound(this.n),o=n.mul(r.a),a=s.mul(i.a),h=n.mul(r.b),u=s.mul(i.b);return{k1:t.sub(o).sub(a),k2:h.add(u).neg()}},Vd.prototype.pointFromX=function(t,e){(t=new(_d())(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var n=i.fromRed().isOdd();return(e&&!n||!e&&n)&&(i=i.redNeg()),this.point(t,i)},Vd.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},Vd.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,s=0;s":""},Wd.prototype.isInfinity=function(){return this.inf},Wd.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),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},Wd.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(),i=t.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(i),s=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)},Wd.prototype.getX=function(){return this.x.fromRed()},Wd.prototype.getY=function(){return this.y.fromRed()},Wd.prototype.mul=function(t){return t=new(_d())(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)},Wd.prototype.mulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},Wd.prototype.jmulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},Wd.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))},Wd.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,i=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return e},Wd.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},Kd($d,zd.BasePoint),Vd.prototype.jpoint=function(t,e,r){return new $d(this,t,e,r)},$d.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),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},$d.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},$d.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r),s=this.y.redMul(e.redMul(t.z)),o=t.y.redMul(r.redMul(this.z)),a=i.redSub(n),h=s.redSub(o);if(0===a.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),l=i.redMul(u),f=h.redSqr().redIAdd(c).redISub(l).redISub(l),d=h.redMul(l.redISub(f)).redISub(s.redMul(c)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(f,d,p)},$d.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y,s=t.y.redMul(e).redMul(this.z),o=r.redSub(i),a=n.redSub(s);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=o.redSqr(),u=h.redMul(o),c=r.redMul(h),l=a.redSqr().redIAdd(u).redISub(c).redISub(c),f=a.redMul(c.redISub(l)).redISub(n.redMul(u)),d=this.z.redMul(o);return this.curve.jpoint(l,f,d)},$d.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},$d.prototype.inspect=function(){return this.isInfinity()?"":""},$d.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Jd=Cd((function(t,e){var r=e;r.base=zd,r.short=Gd,r.mont=null,r.edwards=null})),Yd=Cd((function(t,e){var r,i=e,n=Ld.assert;function s(t){"short"===t.type?this.curve=new Jd.short(t):"edwards"===t.type?this.curve=new Jd.edwards(t):this.curve=new Jd.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function o(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new s(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=s,o("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:Rd().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),o("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:Rd().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),o("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:Rd().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),o("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:Rd().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"]}),o("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:Rd().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"]}),o("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Rd().sha256,gRed:!1,g:["9"]}),o("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:Rd().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(t){r=void 0}o("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:Rd().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function Qd(t){if(!(this instanceof Qd))return new Qd(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=Ud.toArray(t.entropy,t.entropyEnc||"hex"),r=Ud.toArray(t.nonce,t.nonceEnc||"hex"),i=Ud.toArray(t.pers,t.persEnc||"hex");Td(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}var Xd=Qd;Qd.prototype._init=function(t,e,r){var i=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},Qd.prototype.generate=function(t,e,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(i=r,r=e,e=null),r&&(r=Ud.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length"};var rp=Ld.assert;function ip(t,e){if(t instanceof ip)return t;this._importDER(t,e)||(rp(t.r&&t.s,"Signature without r or s"),this.r=new(_d())(t.r,16),this.s=new(_d())(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var np=ip;function sp(){this.place=0}function op(t,e){var r=t[e.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;for(var n=0,s=0,o=e.place;s>>=0;return!(n<=127)&&(e.place=o,n)}function ap(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}ip.prototype._importDER=function(t,e){t=Ld.toArray(t,e);var r=new sp;if(48!==t[r.place++])return!1;var i=op(t,r);if(!1===i)return!1;if(i+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var n=op(t,r);if(!1===n)return!1;var s=t.slice(r.place,n+r.place);if(r.place+=n,2!==t[r.place++])return!1;var o=op(t,r);if(!1===o)return!1;if(t.length!==o+r.place)return!1;var a=t.slice(r.place,o+r.place);if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}return this.r=new(_d())(s),this.s=new(_d())(a),this.recoveryParam=null,!0},ip.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=ap(e),r=ap(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];hp(i,e.length),(i=i.concat(e)).push(2),hp(i,r.length);var n=i.concat(r),s=[48];return hp(s,n.length),s=s.concat(n),Ld.encode(s,t)};var up=function(){throw new Error("unsupported")},cp=Ld.assert;function lp(t){if(!(this instanceof lp))return new lp(t);"string"==typeof t&&(cp(Object.prototype.hasOwnProperty.call(Yd,t),"Unknown curve "+t),t=Yd[t]),t instanceof Yd.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var fp=lp;lp.prototype.keyPair=function(t){return new ep(this,t)},lp.prototype.keyFromPrivate=function(t,e){return ep.fromPrivate(this,t,e)},lp.prototype.keyFromPublic=function(t,e){return ep.fromPublic(this,t,e)},lp.prototype.genKeyPair=function(t){t||(t={});for(var e=new Xd({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||up(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new(_d())(2));;){var n=new(_d())(e.generate(r));if(!(n.cmp(i)>0))return n.iaddn(1),this.keyFromPrivate(n)}},lp.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},lp.prototype.sign=function(t,e,r,i){"object"==typeof r&&(i=r,r=null),i||(i={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new(_d())(t,16));for(var n=this.n.byteLength(),s=e.getPrivate().toArray("be",n),o=t.toArray("be",n),a=new Xd({hash:this.hash,entropy:s,nonce:o,pers:i.pers,persEnc:i.persEnc||"utf8"}),h=this.n.sub(new(_d())(1)),u=0;;u++){var c=i.k?i.k(u):new(_d())(a.generate(this.n.byteLength()));if(!((c=this._truncateToN(c,!0)).cmpn(1)<=0||c.cmp(h)>=0)){var l=this.g.mul(c);if(!l.isInfinity()){var f=l.getX(),d=f.umod(this.n);if(0!==d.cmpn(0)){var p=c.invm(this.n).mul(d.mul(e.getPrivate()).iadd(t));if(0!==(p=p.umod(this.n)).cmpn(0)){var g=(l.getY().isOdd()?1:0)|(0!==f.cmp(d)?2:0);return i.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),g^=1),new np({r:d,s:p,recoveryParam:g})}}}}}},lp.prototype.verify=function(t,e,r,i){t=this._truncateToN(new(_d())(t,16)),r=this.keyFromPublic(r,i);var n=(e=new np(e,"hex")).r,s=e.s;if(n.cmpn(1)<0||n.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var o,a=s.invm(this.n),h=a.mul(t).umod(this.n),u=a.mul(n).umod(this.n);return this.curve._maxwellTrick?!(o=this.g.jmulAdd(h,r.getPublic(),u)).isInfinity()&&o.eqXToP(n):!(o=this.g.mulAdd(h,r.getPublic(),u)).isInfinity()&&0===o.getX().umod(this.n).cmp(n)},lp.prototype.recoverPubKey=function(t,e,r,i){cp((3&r)===r,"The recovery param is more than two bits"),e=new np(e,i);var n=this.n,s=new(_d())(t),o=e.r,a=e.s,h=1&r,u=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");o=u?this.curve.pointFromX(o.add(this.curve.n),h):this.curve.pointFromX(o,h);var c=e.r.invm(n),l=n.sub(s).mul(c).umod(n),f=a.mul(c).umod(n);return this.g.mulAdd(l,o,f)},lp.prototype.getKeyRecoveryParam=function(t,e,r,i){if(null!==(e=new np(e,i)).recoveryParam)return e.recoveryParam;for(var n=0;n<4;n++){var s;try{s=this.recoverPubKey(t,e,n)}catch(t){continue}if(s.eq(r))return n}throw new Error("Unable to find valid recovery factor")};var dp=Cd((function(t,e){var r=e;r.version="6.5.4",r.utils=Ld,r.rand=function(){throw new Error("unsupported")},r.curve=Jd,r.curves=Yd,r.ec=fp,r.eddsa=null})).ec;function pp(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}new Xf("properties/5.7.0");const gp=new Xf("signing-key/5.7.0");let mp=null;function yp(){return mp||(mp=new dp("secp256k1")),mp}class vp{constructor(t){pp(this,"curve","secp256k1"),pp(this,"privateKey",ad(t)),32!==function(t){if("string"!=typeof t)t=ad(t);else if(!sd(t)||t.length%2)return null;return(t.length-2)/2}(this.privateKey)&&gp.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const e=yp().keyFromPrivate(nd(this.privateKey));pp(this,"publicKey","0x"+e.getPublic(!1,"hex")),pp(this,"compressedPublicKey","0x"+e.getPublic(!0,"hex")),pp(this,"_isSigningKey",!0)}_addPoint(t){const e=yp().keyFromPublic(nd(this.publicKey)),r=yp().keyFromPublic(nd(t));return"0x"+e.pub.add(r.pub).encodeCompressed("hex")}signDigest(t){const e=yp().keyFromPrivate(nd(this.privateKey)),r=nd(t);32!==r.length&&gp.throwArgumentError("bad digest length","digest",t);const i=e.sign(r,{canonical:!0});return cd({recoveryParam:i.recoveryParam,r:ud("0x"+i.r.toString(16),32),s:ud("0x"+i.s.toString(16),32)})}computeSharedSecret(t){const e=yp().keyFromPrivate(nd(this.privateKey)),r=yp().keyFromPublic(nd(wp(t)));return ud("0x"+e.derive(r.getPublic()).toString(16),32)}static isSigningKey(t){return!(!t||!t._isSigningKey)}}function wp(t,e){const r=nd(t);if(32===r.length){const t=new vp(r);return e?"0x"+yp().keyFromPrivate(r).getPublic(!0,"hex"):t.publicKey}return 33===r.length?e?ad(r):"0x"+yp().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?e?"0x"+yp().keyFromPublic(r).getPublic(!0,"hex"):ad(r):gp.throwArgumentError("invalid public or private key","key","[REDACTED]")}var bp;new Xf("transactions/5.7.0"),function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"}(bp||(bp={}));class Ap{constructor(t){this.client=t}}class _p{constructor(t){this.opts=t}}const Ep={wc_authRequest:{req:{ttl:Y.ONE_DAY,prompt:!0,tag:3e3},res:{ttl:Y.ONE_DAY,prompt:!1,tag:3001}}},Sp={min:Y.FIVE_MINUTES,max:Y.SEVEN_DAYS},Mp="authClient",Ip="wc@1:auth:",xp=`${Ip}:PUB_KEY`;function Np(t){return t?.split(":")}function Op(t){const e=t&&Np(t);if(e)return e.pop()}async function Pp(t,e,r,i,n){switch(r.t){case"eip191":return function(t,e,r){return function(t,e){return function(t){return Od(hd(dd(hd(wp(t),1)),12))}(function(t,e){const r=cd(e),i={r:nd(r.r),s:nd(r.s)};return"0x"+yp().recoverPubKey(nd(t),i,r.recoveryParam).encode("hex",!1)}(nd(t),e))}(bd(e),r).toLowerCase()===t.toLowerCase()}(t,e,r.s);case"eip1271":return await async function(t,e,r,i,n){try{const s="0x1626ba7e",o="0000000000000000000000000000000000000000000000000000000000000040",a="0000000000000000000000000000000000000000000000000000000000000041",h=r.substring(2),u=s+bd(e).substring(2)+o+a+h,c=await Qu()(`https://rpc.walletconnect.com/v1/?chainId=${i}&projectId=${n}`,{method:"POST",body:JSON.stringify({id:Date.now()+Math.floor(1e3*Math.random()),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:u},"latest"]})}),{result:l}=await c.json();return!!l&&l.slice(0,s.length).toLowerCase()===s.toLowerCase()}catch(t){return console.error("isValidEip1271Signature: ",t),!1}}(t,e,r.s,i,n);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}function Rp(t){return t.getAll().filter((t=>"requester"in t))}function Cp(t,e){return Rp(t).find((t=>t.id===e))}var Tp=function(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i>>0,o=new Uint8Array(s);t[e];){var c=r[t.charCodeAt(e)];if(255===c)return;for(var l=0,f=s-1;(0!==c||l>>0,o[f]=c%256>>>0,c=c/256>>>0;if(0!==c)throw new Error("Non-zero carry");n=l,e++}if(" "!==t[e]){for(var d=s-n;d!==s&&0===o[d];)d++;for(var p=new Uint8Array(i+(s-d)),g=i;d!==s;)p[g++]=o[d++];return p}}}return{encode:function(e){if(e instanceof Uint8Array||(ArrayBuffer.isView(e)?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Array.isArray(e)&&(e=Uint8Array.from(e))),!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===e.length)return"";for(var r=0,i=0,n=0,s=e.length;n!==s&&0===e[n];)n++,r++;for(var o=(s-n)*c+1>>>0,u=new Uint8Array(o);n!==s;){for(var l=e[n],f=0,d=o-1;(0!==l||f>>0,u[d]=l%a>>>0,l=l/a>>>0;if(0!==l)throw new Error("Non-zero carry");i=f,n++}for(var p=o-i;p!==o&&0===u[p];)p++;for(var g=h.repeat(r);p{if(t instanceof Uint8Array&&"Uint8Array"===t.constructor.name)return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")};class Up{constructor(t,e,r){this.name=t,this.prefix=e,this.baseEncode=r}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class Lp{constructor(t,e,r){if(this.name=t,this.prefix=e,void 0===e.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=e.codePointAt(0),this.baseDecode=r}decode(t){if("string"==typeof t){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(t){return Dp(this,t)}}class qp{constructor(t){this.decoders=t}or(t){return Dp(this,t)}decode(t){const e=t[0],r=this.decoders[e];if(r)return r.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Dp=(t,e)=>new qp({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class Bp{constructor(t,e,r,i){this.name=t,this.prefix=e,this.baseEncode=r,this.baseDecode=i,this.encoder=new Up(t,e,r),this.decoder=new Lp(t,e,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const jp=({name:t,prefix:e,encode:r,decode:i})=>new Bp(t,e,r,i),zp=({prefix:t,name:e,alphabet:r})=>{const{encode:i,decode:n}=Tp(r,e);return jp({prefix:t,name:e,encode:i,decode:t=>kp(n(t))})},Fp=({name:t,prefix:e,bitsPerChar:r,alphabet:i})=>jp({prefix:e,name:t,encode:t=>((t,e,r)=>{const i="="===e[e.length-1],n=(1<r;)o-=r,s+=e[n&a>>o];if(o&&(s+=e[n&a<((t,e,r,i)=>{const n={};for(let t=0;t=8&&(a-=8,o[u++]=255&h>>a)}if(a>=r||255&h<<8-a)throw new SyntaxError("Unexpected end of data");return o})(e,i,r,t)}),Kp=jp({prefix:"\0",name:"identity",encode:t=>(t=>(new TextDecoder).decode(t))(t),decode:t=>(t=>(new TextEncoder).encode(t))(t)});var Hp=Object.freeze({__proto__:null,identity:Kp});const Vp=Fp({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Gp=Object.freeze({__proto__:null,base2:Vp});const Wp=Fp({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var $p=Object.freeze({__proto__:null,base8:Wp});const Jp=zp({prefix:"9",name:"base10",alphabet:"0123456789"});var Yp=Object.freeze({__proto__:null,base10:Jp});const Qp=Fp({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Xp=Fp({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Zp=Object.freeze({__proto__:null,base16:Qp,base16upper:Xp});const tg=Fp({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),eg=Fp({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),rg=Fp({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),ig=Fp({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),ng=Fp({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),sg=Fp({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),og=Fp({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),ag=Fp({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),hg=Fp({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ug=Object.freeze({__proto__:null,base32:tg,base32upper:eg,base32pad:rg,base32padupper:ig,base32hex:ng,base32hexupper:sg,base32hexpad:og,base32hexpadupper:ag,base32z:hg});const cg=zp({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),lg=zp({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var fg=Object.freeze({__proto__:null,base36:cg,base36upper:lg});const dg=zp({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),pg=zp({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var gg=Object.freeze({__proto__:null,base58btc:dg,base58flickr:pg});const mg=Fp({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),yg=Fp({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),vg=Fp({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),wg=Fp({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var bg=Object.freeze({__proto__:null,base64:mg,base64pad:yg,base64url:vg,base64urlpad:wg});const Ag=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),_g=Ag.reduce(((t,e,r)=>(t[r]=e,t)),[]),Eg=Ag.reduce(((t,e,r)=>(t[e.codePointAt(0)]=r,t)),[]),Sg=jp({prefix:"🚀",name:"base256emoji",encode:function(t){return t.reduce(((t,e)=>t+_g[e]),"")},decode:function(t){const e=[];for(const r of t){const t=Eg[r.codePointAt(0)];if(void 0===t)throw new Error(`Non-base256emoji character: ${r}`);e.push(t)}return new Uint8Array(e)}});var Mg=Object.freeze({__proto__:null,base256emoji:Sg}),Ig=128,xg=-128,Ng=Math.pow(2,31),Og=128,Pg=127,Rg=Math.pow(2,7),Cg=Math.pow(2,14),Tg=Math.pow(2,21),kg=Math.pow(2,28),Ug=Math.pow(2,35),Lg=Math.pow(2,42),qg=Math.pow(2,49),Dg=Math.pow(2,56),Bg=Math.pow(2,63),jg={encode:function t(e,r,i){r=r||[];for(var n=i=i||0;e>=Ng;)r[i++]=255&e|Ig,e/=128;for(;e&xg;)r[i++]=255&e|Ig,e>>>=7;return r[i]=0|e,t.bytes=i-n+1,r},decode:function t(e,r){var i,n=0,s=(r=r||0,0),o=r,a=e.length;do{if(o>=a)throw t.bytes=0,new RangeError("Could not decode varint");i=e[o++],n+=s<28?(i&Pg)<=Og);return t.bytes=o-r,n},encodingLength:function(t){return t(zg.encode(t,e,r),e),Kg=t=>zg.encodingLength(t),Hg=(t,e)=>{const r=e.byteLength,i=Kg(t),n=i+Kg(r),s=new Uint8Array(n+r);return Fg(t,s,0),Fg(r,s,i),s.set(e,n),new Vg(t,r,e,s)};class Vg{constructor(t,e,r,i){this.code=t,this.size=e,this.digest=r,this.bytes=i}}const Gg=({name:t,code:e,encode:r})=>new Wg(t,e,r);class Wg{constructor(t,e,r){this.name=t,this.code=e,this.encode=r}digest(t){if(t instanceof Uint8Array){const e=this.encode(t);return e instanceof Uint8Array?Hg(this.code,e):e.then((t=>Hg(this.code,t)))}throw Error("Unknown type, must be binary type")}}const $g=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Jg=Gg({name:"sha2-256",code:18,encode:$g("SHA-256")}),Yg=Gg({name:"sha2-512",code:19,encode:$g("SHA-512")});Object.freeze({__proto__:null,sha256:Jg,sha512:Yg});const Qg=kp,Xg={code:0,name:"identity",encode:Qg,digest:t=>Hg(0,Qg(t))};Object.freeze({__proto__:null,identity:Xg}),new TextEncoder,new TextDecoder;const Zg={...Hp,...Gp,...$p,...Yp,...Zp,...ug,...fg,...gg,...bg,...Mg};function tm(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}const em=tm("utf8","u",(t=>"u"+new TextDecoder("utf8").decode(t)),(t=>(new TextEncoder).encode(t.substring(1)))),rm=tm("ascii","a",(t=>{let e="a";for(let r=0;r{const e=function(t=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}((t=t.substring(1)).length);for(let r=0;re in t?sm(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,fm=(t,e)=>{for(var r in e||(e={}))um.call(e,r)&&lm(t,r,e[r]);if(hm)for(var r of hm(e))cm.call(e,r)&&lm(t,r,e[r]);return t},dm=(t,e)=>om(t,am(e));class pm extends Ap{constructor(t){super(t),this.initialized=!1,this.name="authEngine",this.init=()=>{this.initialized||(this.registerRelayerEvents(),this.registerPairingEvents(),this.client.core.pairing.register({methods:Object.keys(Ep)}),this.initialized=!0)},this.request=async(t,e)=>{if(this.isInitialized(),!function(t){const e=eu(t.aud),r=new RegExp(`${t.domain}`).test(t.aud),i=!!t.nonce,n=!t.type||"eip4361"===t.type,s=t.expiry;if(s&&!cu(s,Sp)){const{message:t}=Wh("MISSING_OR_INVALID",`request() expiry: ${s}. Expiry must be a number (in seconds) between ${Sp.min} and ${Sp.max}`);throw new Error(t)}return!!(e&&r&&i&&n)}(t))throw new Error("Invalid request");if(null!=e&&e.topic)return await this.requestOnKnownPairing(e.topic,t);const{chainId:r,statement:i,aud:n,domain:s,nonce:o,type:a,exp:h,nbf:u}=t,{topic:c,uri:l}=await this.client.core.pairing.create();this.client.logger.info({message:"Generated new pairing",pairing:{topic:c,uri:l}});const f=await this.client.core.crypto.generateKeyPair(),d=fh(f);await this.client.authKeys.set(xp,{responseTopic:d,publicKey:f}),await this.client.pairingTopics.set(d,{topic:d,pairingTopic:c}),await this.client.core.relayer.subscribe(d),this.client.logger.info(`sending request to new pairing topic: ${c}`);const p=await this.sendRequest(c,"wc_authRequest",{payloadParams:{type:a??"eip4361",chainId:r,statement:i,aud:n,domain:s,version:"1",nonce:o,iat:(new Date).toISOString(),exp:h,nbf:u},requester:{publicKey:f,metadata:this.client.metadata}},{},t.expiry);return this.client.logger.info(`sent request to new pairing topic: ${c}`),{uri:l,id:p}},this.respond=async(t,e)=>{if(this.isInitialized(),!function(t,e){return!!Cp(e,t.id)}(t,this.client.requests))throw new Error("Invalid response");const r=Cp(this.client.requests,t.id);if(!r)throw new Error(`Could not find pending auth request with id ${t.id}`);const i=r.requester.publicKey,n=await this.client.core.crypto.generateKeyPair(),s=fh(i),o={type:1,receiverPublicKey:i,senderPublicKey:n};if("error"in t)return void await this.sendError(r.id,s,t,o);const a={h:{t:"eip4361"},p:dm(fm({},r.cacaoPayload),{iss:e}),s:t.signature};await this.sendResult(r.id,s,a,o),await this.client.core.pairing.activate({topic:r.pairingTopic}),await this.client.requests.update(r.id,fm({},a))},this.getPendingRequests=()=>Rp(this.client.requests),this.formatMessage=(t,e)=>{this.client.logger.debug(`formatMessage, cacao is: ${JSON.stringify(t)}`);const r=`${t.domain} wants you to sign in with your Ethereum account:`,i=Op(e),n=t.statement,s=`URI: ${t.aud}`,o=`Version: ${t.version}`,a=`Chain ID: ${function(t){const e=t&&Np(t);if(e)return e[3]}(e)}`;return[r,i,"",n,"",s,o,a,`Nonce: ${t.nonce}`,`Issued At: ${t.iat}`,t.exp?`Expiry: ${t.exp}`:void 0,t.resources&&t.resources.length>0?`Resources:\n${t.resources.map((t=>`- ${t}`)).join("\n")}`:void 0].filter((t=>null!=t)).join("\n")},this.setExpiry=async(t,e)=>{this.client.core.pairing.pairings.keys.includes(t)&&await this.client.core.pairing.updateExpiry({topic:t,expiry:e}),this.client.core.expirer.set(t,e)},this.sendRequest=async(t,e,r,i,n)=>{const s=Ru(e,r),o=await this.client.core.crypto.encode(t,s,i),a=Ep[e].req;if(n&&(a.ttl=n),this.client.core.history.set(t,s),ai()){const t=nm(JSON.stringify(s));this.client.core.verify.register({attestationId:t})}return await this.client.core.relayer.publish(t,o,dm(fm({},a),{internal:{throwOnFailedPublish:!0}})),s.id},this.sendResult=async(t,e,r,i)=>{const n=Cu(t,r),s=await this.client.core.crypto.encode(e,n,i),o=await this.client.core.history.get(e,t),a=Ep[o.request.method].res;return await this.client.core.relayer.publish(e,s,dm(fm({},a),{internal:{throwOnFailedPublish:!0}})),await this.client.core.history.resolve(n),n.id},this.sendError=async(t,e,r,i)=>{const n=Tu(t,r.error),s=await this.client.core.crypto.encode(e,n,i),o=await this.client.core.history.get(e,t),a=Ep[o.request.method].res;return await this.client.core.relayer.publish(e,s,a),await this.client.core.history.resolve(n),n.id},this.requestOnKnownPairing=async(t,e)=>{const r=this.client.core.pairing.pairings.getAll({active:!0}).find((e=>e.topic===t));if(!r)throw new Error(`Could not find pairing for provided topic ${t}`);const{publicKey:i}=this.client.authKeys.get(xp),{chainId:n,statement:s,aud:o,domain:a,nonce:h,type:u}=e,c=await this.sendRequest(r.topic,"wc_authRequest",{payloadParams:{type:u??"eip4361",chainId:n,statement:s,aud:o,domain:a,version:"1",nonce:h,iat:(new Date).toISOString()},requester:{publicKey:i,metadata:this.client.metadata}},{},e.expiry);return this.client.logger.info(`sent request to known pairing topic: ${r.topic}`),{id:c}},this.onPairingCreated=t=>{const e=this.getPendingRequests();if(e){const r=Object.values(e).find((e=>e.pairingTopic===t.topic));r&&this.handleAuthRequest(r)}},this.onRelayEventRequest=t=>{const{topic:e,payload:r}=t,i=r.method;return"wc_authRequest"===i?this.onAuthRequest(e,r):this.client.logger.info(`Unsupported request method ${i}`)},this.onRelayEventResponse=async t=>{const{topic:e,payload:r}=t,i=(await this.client.core.history.get(e,r.id)).request.method;return"wc_authRequest"===i?this.onAuthResponse(e,r):this.client.logger.info(`Unsupported response method ${i}`)},this.onAuthRequest=async(t,e)=>{const{requester:r,payloadParams:i}=e.params;this.client.logger.info({type:"onAuthRequest",topic:t,payload:e});const n=nm(JSON.stringify(e)),s=await this.getVerifyContext(n,this.client.metadata),o={requester:r,pairingTopic:t,id:e.id,cacaoPayload:i,verifyContext:s};await this.client.requests.set(e.id,o),this.handleAuthRequest(o)},this.handleAuthRequest=async t=>{const{id:e,pairingTopic:r,requester:i,cacaoPayload:n,verifyContext:s}=t;try{this.client.emit("auth_request",{id:e,topic:r,params:{requester:i,cacaoPayload:n},verifyContext:s})}catch(e){await this.sendError(t.id,t.pairingTopic,e),this.client.logger.error(e)}},this.onAuthResponse=async(t,e)=>{const{id:r}=e;if(this.client.logger.info({type:"onAuthResponse",topic:t,response:e}),Fu(e)){const{pairingTopic:i}=this.client.pairingTopics.get(t);await this.client.core.pairing.activate({topic:i});const{s:n,p:s}=e.result;await this.client.requests.set(r,fm({id:r,pairingTopic:i},e.result));const o=this.formatMessage(s,s.iss);this.client.logger.debug("reconstructed message:\n",JSON.stringify(o)),this.client.logger.debug("payload.iss:",s.iss),this.client.logger.debug("signature:",n);const a=Op(s.iss),h=function(t){const e=t&&Np(t);if(e)return e[2]+":"+e[3]}(s.iss);if(!a)throw new Error("Could not derive address from `payload.iss`");if(!h)throw new Error("Could not derive chainId from `payload.iss`");this.client.logger.debug("walletAddress extracted from `payload.iss`:",a),await Pp(a,o,n,h,this.client.projectId)?this.client.emit("auth_response",{id:r,topic:t,params:e}):this.client.emit("auth_response",{id:r,topic:t,params:{message:"Invalid signature",code:-1}})}else Ku(e)&&this.client.emit("auth_response",{id:r,topic:t,params:e})},this.getVerifyContext=async(t,e)=>{const r={verified:{verifyUrl:e.verifyUrl||"",validation:"UNKNOWN",origin:e.url||""}};try{const i=await this.client.core.verify.resolve({attestationId:t,verifyUrl:e.verifyUrl});i&&(r.verified.origin=i.origin,r.verified.isScam=i.isScam,r.verified.validation=origin===new URL(e.url).origin?"VALID":"INVALID")}catch(t){this.client.logger.error(t)}return this.client.logger.info(`Verify context: ${JSON.stringify(r)}`),r}}isInitialized(){if(!this.initialized){const{message:t}=Wh("NOT_INITIALIZED",this.name);throw new Error(t)}}registerRelayerEvents(){this.client.core.relayer.on(Rl,(async t=>{const{topic:e,message:r}=t,{responseTopic:i,publicKey:n}=this.client.authKeys.keys.includes(xp)?this.client.authKeys.get(xp):{responseTopic:void 0,publicKey:void 0};if(i&&e!==i)return void this.client.logger.debug("[Auth] Ignoring message from unknown topic",e);const s=await this.client.core.crypto.decode(e,r,{receiverPublicKey:n});ju(s)?(this.client.core.history.set(e,s),this.onRelayEventRequest({topic:e,payload:s})):zu(s)&&(await this.client.core.history.resolve(s),this.onRelayEventResponse({topic:e,payload:s}))}))}registerPairingEvents(){this.client.core.pairing.events.on(Kl,(t=>this.onPairingCreated(t)))}}class gm extends _p{constructor(t){super(t),this.protocol="wc",this.version=1,this.name=Mp,this.events=new y.EventEmitter,this.emit=(t,e)=>this.events.emit(t,e),this.on=(t,e)=>this.events.on(t,e),this.once=(t,e)=>this.events.once(t,e),this.off=(t,e)=>this.events.off(t,e),this.removeListener=(t,e)=>this.events.removeListener(t,e),this.request=async(t,e)=>{try{return await this.engine.request(t,e)}catch(t){throw this.logger.error(t.message),t}},this.respond=async(t,e)=>{try{return await this.engine.respond(t,e)}catch(t){throw this.logger.error(t.message),t}},this.getPendingRequests=()=>{try{return this.engine.getPendingRequests()}catch(t){throw this.logger.error(t.message),t}},this.formatMessage=(t,e)=>{try{return this.engine.formatMessage(t,e)}catch(t){throw this.logger.error(t.message),t}};const e=typeof t.logger<"u"&&"string"!=typeof t.logger?t.logger:it()(wt({level:t.logger||"error"}));this.name=t?.name||Mp,this.metadata=t.metadata,this.projectId=t.projectId,this.core=t.core||new Ff(t),this.logger=At(e,this.name),this.authKeys=new Of(this.core,this.logger,"authKeys",Ip,(()=>xp)),this.pairingTopics=new Of(this.core,this.logger,"pairingTopics",Ip),this.requests=new Of(this.core,this.logger,"requests",Ip,(t=>t.id)),this.engine=new pm(this)}static async init(t){const e=new gm(t);return await e.initialize(),e}get context(){return bt(this.logger)}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.authKeys.init(),await this.requests.init(),await this.pairingTopics.init(),await this.engine.init(),this.logger.info("AuthClient Initialization Success"),this.logger.info({authClient:this})}catch(t){throw this.logger.info("AuthClient Initialization Failure"),this.logger.error(t.message),t}}}const mm=gm,ym="client",vm=`wc@2:${ym}:`,wm=ym,bm="WALLETCONNECT_DEEPLINK_CHOICE",Am=Y.SEVEN_DAYS,_m={wc_sessionPropose:{req:{ttl:Y.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:Y.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:Y.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:Y.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:Y.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:Y.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:Y.ONE_DAY,prompt:!1,tag:1104},res:{ttl:Y.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:Y.ONE_DAY,prompt:!1,tag:1106},res:{ttl:Y.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:Y.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:Y.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:Y.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:Y.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:Y.ONE_DAY,prompt:!1,tag:1112},res:{ttl:Y.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:Y.ONE_DAY,prompt:!1,tag:1114},res:{ttl:Y.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:Y.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:Y.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:Y.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:Y.FIVE_MINUTES,prompt:!1,tag:1119}}},Em={min:Y.FIVE_MINUTES,max:Y.SEVEN_DAYS},Sm="IDLE",Mm="ACTIVE",Im=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],xm="wc@1.5:auth:",Nm=`${xm}:PUB_KEY`;var Om=Object.defineProperty,Pm=Object.defineProperties,Rm=Object.getOwnPropertyDescriptors,Cm=Object.getOwnPropertySymbols,Tm=Object.prototype.hasOwnProperty,km=Object.prototype.propertyIsEnumerable,Um=(t,e,r)=>e in t?Om(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Lm=(t,e)=>{for(var r in e||(e={}))Tm.call(e,r)&&Um(t,r,e[r]);if(Cm)for(var r of Cm(e))km.call(e,r)&&Um(t,r,e[r]);return t},qm=(t,e)=>Pm(t,Rm(e));class Dm extends kt{constructor(t){super(t),this.name="engine",this.events=new(v()),this.initialized=!1,this.requestQueue={state:Sm,queue:[]},this.sessionRequestQueue={state:Sm,queue:[]},this.requestQueueDelay=Y.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),this.client.core.pairing.register({methods:Object.keys(_m)}),this.initialized=!0,setTimeout((()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()}),(0,Y.toMiliseconds)(this.requestQueueDelay)))},this.connect=async t=>{await this.isInitialized();const e=qm(Lm({},t),{requiredNamespaces:t.requiredNamespaces||{},optionalNamespaces:t.optionalNamespaces||{}});await this.isValidConnect(e);const{pairingTopic:r,requiredNamespaces:i,optionalNamespaces:n,sessionProperties:s,relays:o}=e;let a,h=r,u=!1;try{h&&(u=this.client.core.pairing.pairings.get(h).active)}catch(t){throw this.client.logger.error(`connect() -> pairing.get(${h}) failed`),t}if(!h||!u){const{topic:t,uri:e}=await this.client.core.pairing.create();h=t,a=e}if(!h){const{message:t}=Wh("NO_MATCHING_KEY",`connect() pairing topic: ${h}`);throw new Error(t)}const c=await this.client.core.crypto.generateKeyPair(),l=_m.wc_sessionPropose.req.ttl||Y.FIVE_MINUTES,f=yi(l),d=Lm({requiredNamespaces:i,optionalNamespaces:n,relays:o??[{protocol:"irn"}],proposer:{publicKey:c,metadata:this.client.metadata},expiryTimestamp:f,pairingTopic:h},s&&{sessionProperties:s}),{reject:p,resolve:g,done:m}=di(l,"Proposal expired");this.events.once(wi("session_connect"),(async({error:t,session:e})=>{if(t)p(t);else if(e){e.self.publicKey=c;const t=qm(Lm({},e),{pairingTopic:d.pairingTopic,requiredNamespaces:d.requiredNamespaces,optionalNamespaces:d.optionalNamespaces});await this.client.session.set(e.topic,t),await this.setExpiry(e.topic,e.expiry),h&&await this.client.core.pairing.updateMetadata({topic:h,metadata:e.peer.metadata}),this.cleanupDuplicatePairings(t),g(t)}}));const y=await this.sendRequest({topic:h,method:"wc_sessionPropose",params:d,throwOnFailedPublish:!0});return await this.setProposal(y,Lm({id:y},d)),{uri:a,approval:m}},this.pair=async t=>{await this.isInitialized();try{return await this.client.core.pairing.pair(t)}catch(t){throw this.client.logger.error("pair() failed"),t}},this.approve=async t=>{await this.isInitialized();try{await this.isValidApprove(t)}catch(t){throw this.client.logger.error("approve() -> isValidApprove() failed"),t}const{id:e,relayProtocol:r,namespaces:i,sessionProperties:n,sessionConfig:s}=t;let o;try{o=this.client.proposal.get(e)}catch(t){throw this.client.logger.error(`approve() -> proposal.get(${e}) failed`),t}const{pairingTopic:a,proposer:h,requiredNamespaces:u,optionalNamespaces:c}=o,l=await this.client.core.crypto.generateKeyPair(),f=h.publicKey,d=await this.client.core.crypto.generateSharedKey(l,f),p=Lm(Lm({relay:{protocol:r??"irn"},namespaces:i,controller:{publicKey:l,metadata:this.client.metadata},expiry:yi(Am)},n&&{sessionProperties:n}),s&&{sessionConfig:s});await this.client.core.relayer.subscribe(d);const g=qm(Lm({},p),{topic:d,requiredNamespaces:u,optionalNamespaces:c,pairingTopic:a,acknowledged:!1,self:p.controller,peer:{publicKey:h.publicKey,metadata:h.metadata},controller:l});await this.client.session.set(d,g);try{await this.sendResult({id:e,topic:a,result:{relay:{protocol:r??"irn"},responderPublicKey:l},throwOnFailedPublish:!0}),await this.sendRequest({topic:d,method:"wc_sessionSettle",params:p,throwOnFailedPublish:!0})}catch(t){throw this.client.logger.error(t),this.client.session.delete(d,$h("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(d),t}return await this.client.core.pairing.updateMetadata({topic:a,metadata:h.metadata}),await this.client.proposal.delete(e,$h("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:a}),await this.setExpiry(d,yi(Am)),{topic:d,acknowledged:()=>new Promise((t=>setTimeout((()=>t(this.client.session.get(d))),500)))}},this.reject=async t=>{await this.isInitialized();try{await this.isValidReject(t)}catch(t){throw this.client.logger.error("reject() -> isValidReject() failed"),t}const{id:e,reason:r}=t;let i;try{i=this.client.proposal.get(e).pairingTopic}catch(t){throw this.client.logger.error(`reject() -> proposal.get(${e}) failed`),t}i&&(await this.sendError({id:e,topic:i,error:r,rpcOpts:_m.wc_sessionPropose.reject}),await this.client.proposal.delete(e,$h("USER_DISCONNECTED")))},this.update=async t=>{await this.isInitialized();try{await this.isValidUpdate(t)}catch(t){throw this.client.logger.error("update() -> isValidUpdate() failed"),t}const{topic:e,namespaces:r}=t,{done:i,resolve:n,reject:s}=di(),o=Ou(),a=Pu().toString(),h=this.client.session.get(e).namespaces;return this.events.once(wi("session_update",o),(({error:t})=>{t?s(t):n()})),await this.client.session.update(e,{namespaces:r}),await this.sendRequest({topic:e,method:"wc_sessionUpdate",params:{namespaces:r},throwOnFailedPublish:!0,clientRpcId:o,relayRpcId:a}).catch((t=>{this.client.logger.error(t),this.client.session.update(e,{namespaces:h}),s(t)})),{acknowledged:i}},this.extend=async t=>{await this.isInitialized();try{await this.isValidExtend(t)}catch(t){throw this.client.logger.error("extend() -> isValidExtend() failed"),t}const{topic:e}=t,r=Ou(),{done:i,resolve:n,reject:s}=di();return this.events.once(wi("session_extend",r),(({error:t})=>{t?s(t):n()})),await this.setExpiry(e,yi(Am)),this.sendRequest({topic:e,method:"wc_sessionExtend",params:{},clientRpcId:r,throwOnFailedPublish:!0}).catch((t=>{s(t)})),{acknowledged:i}},this.request=async t=>{await this.isInitialized();try{await this.isValidRequest(t)}catch(t){throw this.client.logger.error("request() -> isValidRequest() failed"),t}const{chainId:e,request:i,topic:n,expiry:s=_m.wc_sessionRequest.req.ttl}=t,o=this.client.session.get(n),a=Ou(),h=Pu().toString(),{done:u,resolve:c,reject:l}=di(s,"Request expired. Please try again.");return this.events.once(wi("session_request",a),(({error:t,result:e})=>{t?l(t):c(e)})),await Promise.all([new Promise((async t=>{await this.sendRequest({clientRpcId:a,relayRpcId:h,topic:n,method:"wc_sessionRequest",params:{request:qm(Lm({},i),{expiryTimestamp:yi(s)}),chainId:e},expiry:s,throwOnFailedPublish:!0}).catch((t=>l(t))),this.client.events.emit("session_request_sent",{topic:n,request:i,chainId:e,id:a}),t()})),new Promise((async t=>{var e;if(null==(e=o.sessionConfig)||!e.disableDeepLink){const t=await async function(t,e){try{return await t.getItem(e)||(ai()?localStorage.getItem(e):void 0)}catch(t){console.error(t)}}(this.client.core.storage,bm);!async function({id:t,topic:e,wcDeepLink:i}){try{if(!i)return;const n="string"==typeof i?JSON.parse(i):i;let s=n?.href;if("string"!=typeof s)return;s.endsWith("/")&&(s=s.slice(0,-1));const o=`${s}/wc?requestId=${t}&sessionTopic=${e}`,a=hi();a===ii.browser?o.startsWith("https://")||o.startsWith("http://")?window.open(o,"_blank","noreferrer noopener"):window.open(o,"_self","noreferrer noopener"):a===ii.reactNative&&typeof(null==r.g?void 0:r.g.Linking)<"u"&&await r.g.Linking.openURL(o)}catch(t){console.error(t)}}({id:a,topic:n,wcDeepLink:t})}t()})),u()]).then((t=>t[2]))},this.respond=async t=>{await this.isInitialized(),await this.isValidRespond(t);const{topic:e,response:r}=t,{id:i}=r;Fu(r)?await this.sendResult({id:i,topic:e,result:r.result,throwOnFailedPublish:!0}):Ku(r)&&await this.sendError({id:i,topic:e,error:r.error}),this.cleanupAfterResponse(t)},this.ping=async t=>{await this.isInitialized();try{await this.isValidPing(t)}catch(t){throw this.client.logger.error("ping() -> isValidPing() failed"),t}const{topic:e}=t;if(this.client.session.keys.includes(e)){const t=Ou(),r=Pu().toString(),{done:i,resolve:n,reject:s}=di();this.events.once(wi("session_ping",t),(({error:t})=>{t?s(t):n()})),await Promise.all([this.sendRequest({topic:e,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:t,relayRpcId:r}),i()])}else this.client.core.pairing.pairings.keys.includes(e)&&await this.client.core.pairing.ping({topic:e})},this.emit=async t=>{await this.isInitialized(),await this.isValidEmit(t);const{topic:e,event:r,chainId:i}=t,n=Pu().toString();await this.sendRequest({topic:e,method:"wc_sessionEvent",params:{event:r,chainId:i},throwOnFailedPublish:!0,relayRpcId:n})},this.disconnect=async t=>{await this.isInitialized(),await this.isValidDisconnect(t);const{topic:e}=t;if(this.client.session.keys.includes(e))await this.sendRequest({topic:e,method:"wc_sessionDelete",params:$h("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:e,emitEvent:!1});else{if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:t}=Wh("MISMATCHED_TOPIC",`Session or pairing topic not found: ${e}`);throw new Error(t)}await this.client.core.pairing.disconnect({topic:e})}},this.find=t=>(this.isInitialized(),this.client.session.getAll().filter((e=>function(t,e){const{requiredNamespaces:r}=e,i=Object.keys(t.namespaces),n=Object.keys(r);let s=!0;return!!ci(n,i)&&(i.forEach((e=>{const{accounts:i,methods:n,events:o}=t.namespaces[e],a=jh(i),h=r[e];ci(Jr(e,h),a)&&ci(h.methods,n)&&ci(h.events,o)||(s=!1)})),s)}(e,t)))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async t=>{this.isInitialized(),this.isValidAuthenticate(t);const{chains:e,statement:r="",uri:i,domain:n,nonce:s,type:o,exp:a,nbf:h,methods:u=[],expiry:c}=t,l=[...t.resources||[]],{topic:f,uri:d}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"]});this.client.logger.info({message:"Generated new pairing",pairing:{topic:f,uri:d}});const p=await this.client.core.crypto.generateKeyPair(),g=fh(p);if(await Promise.all([this.client.auth.authKeys.set(Nm,{responseTopic:g,publicKey:p}),this.client.auth.pairingTopics.set(g,{topic:g,pairingTopic:f})]),await this.client.core.relayer.subscribe(g),this.client.logger.info(`sending request to new pairing topic: ${f}`),u.length>0){const{namespace:t}=$r(e[0]);let r=function(t,e,r){const i=function(t,e,r,i={}){return r?.sort(((t,e)=>t.localeCompare(e))),{att:{[t]:th(e,r,i)}}}(t,e,r);return eh(i)}(t,"request",u);oh(l)&&(r=ih(r,l.pop())),l.push(r)}const m=c&&c>_m.wc_sessionAuthenticate.req.ttl?c:_m.wc_sessionAuthenticate.req.ttl,y={authPayload:{type:o??"caip122",chains:e,statement:r,aud:i,domain:n,version:"1",nonce:s,iat:(new Date).toISOString(),exp:a,nbf:h,resources:l},requester:{publicKey:p,metadata:this.client.metadata},expiryTimestamp:yi(m)},v={requiredNamespaces:{},optionalNamespaces:{eip155:{chains:e,methods:[...new Set(["personal_sign",...u])],events:["chainChanged","accountsChanged"]}},relays:[{protocol:"irn"}],pairingTopic:f,proposer:{publicKey:p,metadata:this.client.metadata},expiryTimestamp:yi(_m.wc_sessionPropose.req.ttl)},{done:w,resolve:b,reject:A}=di(m,"Request expired"),_=async({error:t,session:e})=>{if(this.events.off(wi("session_request",S),E),t)A(t);else if(e){e.self.publicKey=p,await this.client.session.set(e.topic,e),await this.setExpiry(e.topic,e.expiry),f&&await this.client.core.pairing.updateMetadata({topic:f,metadata:e.peer.metadata});const t=this.client.session.get(e.topic);await this.deleteProposal(M),b({session:t})}},E=async t=>{if(await this.deletePendingAuthRequest(S,{message:"fulfilled",code:0}),t.error){const e=$h("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return t.error.code===e.code?void 0:(this.events.off(wi("session_connect"),_),A(t.error.message))}await this.deleteProposal(M),this.events.off(wi("session_connect"),_);const{cacaos:e,responder:r}=t.result,i=[],n=[];for(const t of e){await Qa({cacao:t,projectId:this.client.core.projectId})||(this.client.logger.error(t,"Signature verification failed"),A($h("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:e}=t,r=oh(e.resources),s=[Ja(e.iss)],o=Ya(e.iss);if(r){const t=nh(r),e=sh(r);i.push(...t),s.push(...e)}for(const t of s)n.push(`${t}:${o}`)}const s=await this.client.core.crypto.generateSharedKey(p,r.publicKey);let o;i.length>0&&(o={topic:s,acknowledged:!0,self:{publicKey:p,metadata:this.client.metadata},peer:r,controller:r.publicKey,expiry:yi(Am),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:f,namespaces:Hh([...new Set(i)],[...new Set(n)])},await this.client.core.relayer.subscribe(s),await this.client.session.set(s,o),f&&await this.client.core.pairing.updateMetadata({topic:f,metadata:r.metadata}),o=this.client.session.get(s)),b({auths:e,session:o})},S=Ou(),M=Ou();this.events.once(wi("session_connect"),_),this.events.once(wi("session_request",S),E);try{await Promise.all([this.sendRequest({topic:f,method:"wc_sessionAuthenticate",params:y,expiry:t.expiry,throwOnFailedPublish:!0,clientRpcId:S}),this.sendRequest({topic:f,method:"wc_sessionPropose",params:v,expiry:_m.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:M})])}catch(t){throw this.events.off(wi("session_connect"),_),this.events.off(wi("session_request",S),E),t}return await this.setProposal(M,Lm({id:M},v)),await this.setAuthRequest(S,{request:qm(Lm({},y),{verifyContext:{}}),pairingTopic:f}),{uri:d,response:w}},this.approveSessionAuthenticate=async t=>{this.isInitialized();const{id:e,auths:r}=t,i=this.getPendingAuthRequest(e);if(!i)throw new Error(`Could not find pending auth request with id ${e}`);const n=i.requester.publicKey,s=await this.client.core.crypto.generateKeyPair(),o=fh(n),a={type:1,receiverPublicKey:n,senderPublicKey:s},h=[],u=[];for(const t of r){if(!await Qa({cacao:t,projectId:this.client.core.projectId})){const t=$h("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:e,topic:o,error:t,encodeOpts:a}),new Error(t.message)}const{p:r}=t,i=oh(r.resources),n=[Ja(r.iss)],s=Ya(r.iss);if(i){const t=nh(i),e=sh(i);h.push(...t),n.push(...e)}for(const t of n)u.push(`${t}:${s}`)}const c=await this.client.core.crypto.generateSharedKey(s,n);let l;return h?.length>0&&(l={topic:c,acknowledged:!0,self:{publicKey:s,metadata:this.client.metadata},peer:{publicKey:n,metadata:i.requester.metadata},controller:n,expiry:yi(Am),authentication:r,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:i.pairingTopic,namespaces:Hh([...new Set(h)],[...new Set(u)])},await this.client.core.relayer.subscribe(c),await this.client.session.set(c,l),await this.client.core.pairing.updateMetadata({topic:i.pairingTopic,metadata:i.requester.metadata})),await this.sendResult({topic:o,id:e,result:{cacaos:r,responder:{publicKey:s,metadata:this.client.metadata}},encodeOpts:a,throwOnFailedPublish:!0}),await this.client.auth.requests.delete(e,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:i.pairingTopic}),{session:l}},this.rejectSessionAuthenticate=async t=>{await this.isInitialized();const{id:e,reason:r}=t,i=this.getPendingAuthRequest(e);if(!i)throw new Error(`Could not find pending auth request with id ${e}`);const n=i.requester.publicKey,s=await this.client.core.crypto.generateKeyPair(),o=fh(n),a={type:1,receiverPublicKey:n,senderPublicKey:s};await this.sendError({id:e,topic:o,error:r,encodeOpts:a,rpcOpts:_m.wc_sessionAuthenticate.reject}),await this.client.auth.requests.delete(e,{message:"rejected",code:0}),await this.client.proposal.delete(e,$h("USER_DISCONNECTED"))},this.formatAuthMessage=t=>{this.isInitialized();const{request:e,iss:r}=t;return Xa(e,r)},this.processRelayMessageCache=()=>{setTimeout((async()=>{if(0!==this.relayMessageCache.length)for(;this.relayMessageCache.length>0;)try{const t=this.relayMessageCache.shift();t&&await this.onRelayMessage(t)}catch(t){this.client.logger.error(t)}}),50)},this.cleanupDuplicatePairings=async t=>{if(t.pairingTopic)try{const e=this.client.core.pairing.pairings.get(t.pairingTopic),r=this.client.core.pairing.pairings.getAll().filter((r=>{var i,n;return(null==(i=r.peerMetadata)?void 0:i.url)&&(null==(n=r.peerMetadata)?void 0:n.url)===t.peer.metadata.url&&r.topic&&r.topic!==e.topic}));if(0===r.length)return;this.client.logger.info(`Cleaning up ${r.length} duplicate pairing(s)`),await Promise.all(r.map((t=>this.client.core.pairing.disconnect({topic:t.topic})))),this.client.logger.info("Duplicate pairings clean up finished")}catch(t){this.client.logger.error(t)}},this.deleteSession=async t=>{var e;const{topic:r,expirerHasDeleted:i=!1,emitEvent:n=!0,id:s=0}=t,{self:o}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),await this.client.session.delete(r,$h("USER_DISCONNECTED")),this.addToRecentlyDeleted(r,"session"),this.client.core.crypto.keychain.has(o.publicKey)&&await this.client.core.crypto.deleteKeyPair(o.publicKey),this.client.core.crypto.keychain.has(r)&&await this.client.core.crypto.deleteSymKey(r),i||this.client.core.expirer.del(r),this.client.core.storage.removeItem(bm).catch((t=>this.client.logger.warn(t))),this.getPendingSessionRequests().forEach((t=>{t.topic===r&&this.deletePendingSessionRequest(t.id,$h("USER_DISCONNECTED"))})),r===(null==(e=this.sessionRequestQueue.queue[0])?void 0:e.topic)&&(this.sessionRequestQueue.state=Sm),n&&this.client.events.emit("session_delete",{id:s,topic:r})},this.deleteProposal=async(t,e)=>{await Promise.all([this.client.proposal.delete(t,$h("USER_DISCONNECTED")),e?Promise.resolve():this.client.core.expirer.del(t)]),this.addToRecentlyDeleted(t,"proposal")},this.deletePendingSessionRequest=async(t,e,r=!1)=>{await Promise.all([this.client.pendingRequest.delete(t,e),r?Promise.resolve():this.client.core.expirer.del(t)]),this.addToRecentlyDeleted(t,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter((e=>e.id!==t)),r&&(this.sessionRequestQueue.state=Sm,this.client.events.emit("session_request_expire",{id:t}))},this.deletePendingAuthRequest=async(t,e,r=!1)=>{await Promise.all([this.client.auth.requests.delete(t,e),r?Promise.resolve():this.client.core.expirer.del(t)])},this.setExpiry=async(t,e)=>{this.client.session.keys.includes(t)&&(this.client.core.expirer.set(t,e),await this.client.session.update(t,{expiry:e}))},this.setProposal=async(t,e)=>{this.client.core.expirer.set(t,yi(_m.wc_sessionPropose.req.ttl)),await this.client.proposal.set(t,e)},this.setAuthRequest=async(t,e)=>{const{request:r,pairingTopic:i}=e;this.client.core.expirer.set(t,r.expiryTimestamp),await this.client.auth.requests.set(t,{authPayload:r.authPayload,requester:r.requester,expiryTimestamp:r.expiryTimestamp,id:t,pairingTopic:i,verifyContext:r.verifyContext})},this.setPendingSessionRequest=async t=>{const{id:e,topic:r,params:i,verifyContext:n}=t,s=i.request.expiryTimestamp||yi(_m.wc_sessionRequest.req.ttl);this.client.core.expirer.set(e,s),await this.client.pendingRequest.set(e,{id:e,topic:r,params:i,verifyContext:n})},this.sendRequest=async t=>{const{topic:e,method:r,params:i,expiry:n,relayRpcId:s,clientRpcId:o,throwOnFailedPublish:a}=t,h=Ru(r,i,o);if(ai()&&Im.includes(r)){const t=dh(JSON.stringify(h));this.client.core.verify.register({attestationId:t})}let u;try{u=await this.client.core.crypto.encode(e,h)}catch(t){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${e} failed`),t}const c=_m[r].req;return n&&(c.ttl=n),s&&(c.id=s),this.client.core.history.set(e,h),a?(c.internal=qm(Lm({},c.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(e,u,c)):this.client.core.relayer.publish(e,u,c).catch((t=>this.client.logger.error(t))),h.id},this.sendResult=async t=>{const{id:e,topic:r,result:i,throwOnFailedPublish:n,encodeOpts:s}=t,o=Cu(e,i);let a,h;try{a=await this.client.core.crypto.encode(r,o,s)}catch(t){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${r} failed`),t}try{h=await this.client.core.history.get(r,e)}catch(t){throw this.client.logger.error(`sendResult() -> history.get(${r}, ${e}) failed`),t}const u=_m[h.request.method].res;n?(u.internal=qm(Lm({},u.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(r,a,u)):this.client.core.relayer.publish(r,a,u).catch((t=>this.client.logger.error(t))),await this.client.core.history.resolve(o)},this.sendError=async t=>{const{id:e,topic:r,error:i,encodeOpts:n,rpcOpts:s}=t,o=Tu(e,i);let a,h;try{a=await this.client.core.crypto.encode(r,o,n)}catch(t){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${r} failed`),t}try{h=await this.client.core.history.get(r,e)}catch(t){throw this.client.logger.error(`sendError() -> history.get(${r}, ${e}) failed`),t}const u=s||_m[h.request.method].res;this.client.core.relayer.publish(r,a,u),await this.client.core.history.resolve(o)},this.cleanup=async()=>{const t=[],e=[];this.client.session.getAll().forEach((e=>{let r=!1;vi(e.expiry)&&(r=!0),this.client.core.crypto.keychain.has(e.topic)||(r=!0),r&&t.push(e.topic)})),this.client.proposal.getAll().forEach((t=>{vi(t.expiryTimestamp)&&e.push(t.id)})),await Promise.all([...t.map((t=>this.deleteSession({topic:t}))),...e.map((t=>this.deleteProposal(t)))])},this.onRelayEventRequest=async t=>{this.requestQueue.queue.push(t),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state!==Mm){for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=Mm;const t=this.requestQueue.queue.shift();if(t)try{await this.processRequest(t)}catch(t){this.client.logger.warn(t)}}this.requestQueue.state=Sm}else this.client.logger.info("Request queue already active, skipping...")},this.processRequest=async t=>{const{topic:e,payload:r}=t,i=r.method;if(!this.shouldIgnorePairingRequest({topic:e,requestMethod:i}))switch(i){case"wc_sessionPropose":return await this.onSessionProposeRequest(e,r);case"wc_sessionSettle":return await this.onSessionSettleRequest(e,r);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(e,r);case"wc_sessionExtend":return await this.onSessionExtendRequest(e,r);case"wc_sessionPing":return await this.onSessionPingRequest(e,r);case"wc_sessionDelete":return await this.onSessionDeleteRequest(e,r);case"wc_sessionRequest":return await this.onSessionRequest(e,r);case"wc_sessionEvent":return await this.onSessionEventRequest(e,r);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest(e,r);default:return this.client.logger.info(`Unsupported request method ${i}`)}},this.onRelayEventResponse=async t=>{const{topic:e,payload:r}=t,i=(await this.client.core.history.get(e,r.id)).request.method;switch(i){case"wc_sessionPropose":return this.onSessionProposeResponse(e,r);case"wc_sessionSettle":return this.onSessionSettleResponse(e,r);case"wc_sessionUpdate":return this.onSessionUpdateResponse(e,r);case"wc_sessionExtend":return this.onSessionExtendResponse(e,r);case"wc_sessionPing":return this.onSessionPingResponse(e,r);case"wc_sessionRequest":return this.onSessionRequestResponse(e,r);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(e,r);default:return this.client.logger.info(`Unsupported response method ${i}`)}},this.onRelayEventUnknownPayload=t=>{const{topic:e}=t,{message:r}=Wh("MISSING_OR_INVALID",`Decoded payload on topic ${e} is not identifiable as a JSON-RPC request or a response.`);throw new Error(r)},this.shouldIgnorePairingRequest=t=>{const{topic:e,requestMethod:r}=t,i=this.expectedPairingMethodMap.get(e);return!(!i||i.includes(r)||!(i.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0))},this.onSessionProposeRequest=async(t,e)=>{const{params:r,id:i}=e;try{this.isValidConnect(Lm({},e.params));const n=r.expiryTimestamp||yi(_m.wc_sessionPropose.req.ttl),s=Lm({id:i,pairingTopic:t,expiryTimestamp:n},r);await this.setProposal(i,s);const o=dh(JSON.stringify(e)),a=await this.getVerifyContext(o,s.proposer.metadata);this.client.events.emit("session_proposal",{id:i,params:s,verifyContext:a})}catch(e){await this.sendError({id:i,topic:t,error:e,rpcOpts:_m.wc_sessionPropose.autoReject}),this.client.logger.error(e)}},this.onSessionProposeResponse=async(t,e)=>{const{id:r}=e;if(Fu(e)){const{result:i}=e;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:i});const n=this.client.proposal.get(r);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:n});const s=n.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:s});const o=i.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:o});const a=await this.client.core.crypto.generateSharedKey(s,o);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:a});const h=await this.client.core.relayer.subscribe(a);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:h}),await this.client.core.pairing.activate({topic:t})}else if(Ku(e)){await this.client.proposal.delete(r,$h("USER_DISCONNECTED"));const t=wi("session_connect");if(0===this.events.listenerCount(t))throw new Error(`emitting ${t} without any listeners, 954`);this.events.emit(wi("session_connect"),{error:e.error})}},this.onSessionSettleRequest=async(t,e)=>{const{id:r,params:i}=e;try{this.isValidSessionSettleRequest(i);const{relay:r,controller:n,expiry:s,namespaces:o,sessionProperties:a,sessionConfig:h}=e.params,u=Lm(Lm({topic:t,relay:r,expiry:s,namespaces:o,acknowledged:!0,pairingTopic:"",requiredNamespaces:{},optionalNamespaces:{},controller:n.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:n.publicKey,metadata:n.metadata}},a&&{sessionProperties:a}),h&&{sessionConfig:h});await this.sendResult({id:e.id,topic:t,result:!0,throwOnFailedPublish:!0});const c=wi("session_connect");if(0===this.events.listenerCount(c))throw new Error(`emitting ${c} without any listeners 997`);this.events.emit(wi("session_connect"),{session:u})}catch(e){await this.sendError({id:r,topic:t,error:e}),this.client.logger.error(e)}},this.onSessionSettleResponse=async(t,e)=>{const{id:r}=e;Fu(e)?(await this.client.session.update(t,{acknowledged:!0}),this.events.emit(wi("session_approve",r),{})):Ku(e)&&(await this.client.session.delete(t,$h("USER_DISCONNECTED")),this.events.emit(wi("session_approve",r),{error:e.error}))},this.onSessionUpdateRequest=async(t,e)=>{const{params:r,id:i}=e;try{const e=`${t}_session_update`,n=du.get(e);if(n&&this.isRequestOutOfSync(n,i))return this.client.logger.info(`Discarding out of sync request - ${i}`),void this.sendError({id:i,topic:t,error:$h("INVALID_UPDATE_REQUEST")});this.isValidUpdate(Lm({topic:t},r));try{du.set(e,i),await this.client.session.update(t,{namespaces:r.namespaces}),await this.sendResult({id:i,topic:t,result:!0,throwOnFailedPublish:!0})}catch(t){throw du.delete(e),t}this.client.events.emit("session_update",{id:i,topic:t,params:r})}catch(e){await this.sendError({id:i,topic:t,error:e}),this.client.logger.error(e)}},this.isRequestOutOfSync=(t,e)=>parseInt(e.toString().slice(0,-3))<=parseInt(t.toString().slice(0,-3)),this.onSessionUpdateResponse=(t,e)=>{const{id:r}=e,i=wi("session_update",r);if(0===this.events.listenerCount(i))throw new Error(`emitting ${i} without any listeners`);Fu(e)?this.events.emit(wi("session_update",r),{}):Ku(e)&&this.events.emit(wi("session_update",r),{error:e.error})},this.onSessionExtendRequest=async(t,e)=>{const{id:r}=e;try{this.isValidExtend({topic:t}),await this.setExpiry(t,yi(Am)),await this.sendResult({id:r,topic:t,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:r,topic:t})}catch(e){await this.sendError({id:r,topic:t,error:e}),this.client.logger.error(e)}},this.onSessionExtendResponse=(t,e)=>{const{id:r}=e,i=wi("session_extend",r);if(0===this.events.listenerCount(i))throw new Error(`emitting ${i} without any listeners`);Fu(e)?this.events.emit(wi("session_extend",r),{}):Ku(e)&&this.events.emit(wi("session_extend",r),{error:e.error})},this.onSessionPingRequest=async(t,e)=>{const{id:r}=e;try{this.isValidPing({topic:t}),await this.sendResult({id:r,topic:t,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:r,topic:t})}catch(e){await this.sendError({id:r,topic:t,error:e}),this.client.logger.error(e)}},this.onSessionPingResponse=(t,e)=>{const{id:r}=e,i=wi("session_ping",r);if(0===this.events.listenerCount(i))throw new Error(`emitting ${i} without any listeners`);setTimeout((()=>{Fu(e)?this.events.emit(wi("session_ping",r),{}):Ku(e)&&this.events.emit(wi("session_ping",r),{error:e.error})}),500)},this.onSessionDeleteRequest=async(t,e)=>{const{id:r}=e;try{this.isValidDisconnect({topic:t,reason:e.params}),await Promise.all([new Promise((e=>{this.client.core.relayer.once(kl,(async()=>{e(await this.deleteSession({topic:t,id:r}))}))})),this.sendResult({id:r,topic:t,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:t,error:$h("USER_DISCONNECTED")})])}catch(t){this.client.logger.error(t)}},this.onSessionRequest=async(t,e)=>{var r;const{id:i,params:n}=e;try{await this.isValidRequest(Lm({topic:t},n));const e=dh(JSON.stringify(Ru("wc_sessionRequest",n,i))),s=this.client.session.get(t),o={id:i,topic:t,params:n,verifyContext:await this.getVerifyContext(e,s.peer.metadata)};await this.setPendingSessionRequest(o),null!=(r=this.client.signConfig)&&r.disableRequestQueue?this.emitSessionRequest(o):(this.addSessionRequestToSessionRequestQueue(o),this.processSessionRequestQueue())}catch(e){await this.sendError({id:i,topic:t,error:e}),this.client.logger.error(e)}},this.onSessionRequestResponse=(t,e)=>{const{id:r}=e,i=wi("session_request",r);if(0===this.events.listenerCount(i))throw new Error(`emitting ${i} without any listeners`);Fu(e)?this.events.emit(wi("session_request",r),{result:e.result}):Ku(e)&&this.events.emit(wi("session_request",r),{error:e.error})},this.onSessionEventRequest=async(t,e)=>{const{id:r,params:i}=e;try{const e=`${t}_session_event_${i.event.name}`,n=du.get(e);if(n&&this.isRequestOutOfSync(n,r))return void this.client.logger.info(`Discarding out of sync request - ${r}`);this.isValidEmit(Lm({topic:t},i)),this.client.events.emit("session_event",{id:r,topic:t,params:i}),du.set(e,r)}catch(e){await this.sendError({id:r,topic:t,error:e}),this.client.logger.error(e)}},this.onSessionAuthenticateResponse=(t,e)=>{const{id:r}=e;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:t,payload:e}),Fu(e)?this.events.emit(wi("session_request",r),{result:e.result}):Ku(e)&&this.events.emit(wi("session_request",r),{error:e.error})},this.onSessionAuthenticateRequest=async(t,e)=>{try{const{requester:r,authPayload:i,expiryTimestamp:n}=e.params,s=dh(JSON.stringify(e)),o=await this.getVerifyContext(s,this.client.metadata),a={requester:r,pairingTopic:t,id:e.id,authPayload:i,verifyContext:o,expiryTimestamp:n};await this.setAuthRequest(e.id,{request:a,pairingTopic:t}),this.client.events.emit("session_authenticate",{topic:t,params:e.params,id:e.id,verifyContext:o})}catch(r){this.client.logger.error(r);const i={type:1,receiverPublicKey:e.params.requester.publicKey,senderPublicKey:await this.client.core.crypto.generateKeyPair()};await this.sendError({id:e.id,topic:t,error:r,encodeOpts:i,rpcOpts:_m.wc_sessionAuthenticate.autoReject})}},this.addSessionRequestToSessionRequestQueue=t=>{this.sessionRequestQueue.queue.push(t)},this.cleanupAfterResponse=t=>{this.deletePendingSessionRequest(t.response.id,{message:"fulfilled",code:0}),setTimeout((()=>{this.sessionRequestQueue.state=Sm,this.processSessionRequestQueue()}),(0,Y.toMiliseconds)(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:t,error:e})=>{const r=this.client.core.history.pending;r.length>0&&r.filter((e=>e.topic===t&&"wc_sessionRequest"===e.request.method)).forEach((t=>{const r=wi("session_request",t.request.id);if(0===this.events.listenerCount(r))throw new Error(`emitting ${r} without any listeners`);this.events.emit(wi("session_request",t.request.id),{error:e})}))},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===Mm)return void this.client.logger.info("session request queue is already active.");const t=this.sessionRequestQueue.queue[0];if(t)try{this.sessionRequestQueue.state=Mm,this.emitSessionRequest(t)}catch(t){this.client.logger.error(t)}else this.client.logger.info("session request queue is empty.")},this.emitSessionRequest=t=>{this.client.events.emit("session_request",t)},this.onPairingCreated=t=>{if(t.methods&&this.expectedPairingMethodMap.set(t.topic,t.methods),t.active)return;const e=this.client.proposal.getAll().find((e=>e.pairingTopic===t.topic));e&&this.onSessionProposeRequest(t.topic,Ru("wc_sessionPropose",{requiredNamespaces:e.requiredNamespaces,optionalNamespaces:e.optionalNamespaces,relays:e.relays,proposer:e.proposer,sessionProperties:e.sessionProperties},e.id))},this.isValidConnect=async t=>{if(!ou(t)){const{message:e}=Wh("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(t)}`);throw new Error(e)}const{pairingTopic:e,requiredNamespaces:r,optionalNamespaces:i,sessionProperties:n,relays:s}=t;if(Qh(e)||await this.isValidPairingTopic(e),!function(t,e){let r=!1;return t?t&&Jh(t)&&t.length&&t.forEach((t=>{r=su(t)})):r=!0,r}(s)){const{message:t}=Wh("MISSING_OR_INVALID",`connect() relays: ${s}`);throw new Error(t)}!Qh(r)&&0!==Yh(r)&&this.validateNamespaces(r,"requiredNamespaces"),!Qh(i)&&0!==Yh(i)&&this.validateNamespaces(i,"optionalNamespaces"),Qh(n)||this.validateSessionProps(n,"sessionProperties")},this.validateNamespaces=(t,e)=>{const r=function(t,e,r){let i=null;if(t&&Yh(t)){const n=iu(t,e);n&&(i=n);const s=function(t,e,r){let i=null;return Object.entries(t).forEach((([t,n])=>{if(i)return;const s=function(t,e,r){let i=null;return Jh(e)&&e.length?e.forEach((t=>{i||tu(t)||(i=$h("UNSUPPORTED_CHAINS",`${r}, chain ${t} should be a string and conform to "namespace:chainId" format`))})):tu(t)||(i=$h("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),i}(t,Jr(t,n),`${e} ${r}`);s&&(i=s)})),i}(t,e,r);s&&(i=s)}else i=Wh("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return i}(t,"connect()",e);if(r)throw new Error(r.message)},this.isValidApprove=async t=>{if(!ou(t))throw new Error(Wh("MISSING_OR_INVALID",`approve() params: ${t}`).message);const{id:e,namespaces:r,relayProtocol:i,sessionProperties:n}=t;this.checkRecentlyDeleted(e),await this.isValidProposalId(e);const s=this.client.proposal.get(e),o=nu(r,"approve()");if(o)throw new Error(o.message);const a=hu(s.requiredNamespaces,r,"approve()");if(a)throw new Error(a.message);if(!Xh(i,!0)){const{message:t}=Wh("MISSING_OR_INVALID",`approve() relayProtocol: ${i}`);throw new Error(t)}Qh(n)||this.validateSessionProps(n,"sessionProperties")},this.isValidReject=async t=>{if(!ou(t)){const{message:e}=Wh("MISSING_OR_INVALID",`reject() params: ${t}`);throw new Error(e)}const{id:e,reason:r}=t;if(this.checkRecentlyDeleted(e),await this.isValidProposalId(e),!function(t){return!!(t&&"object"==typeof t&&t.code&&Zh(t.code,!1)&&t.message&&Xh(t.message,!1))}(r)){const{message:t}=Wh("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(r)}`);throw new Error(t)}},this.isValidSessionSettleRequest=t=>{if(!ou(t)){const{message:e}=Wh("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${t}`);throw new Error(e)}const{relay:e,controller:r,namespaces:i,expiry:n}=t;if(!su(e)){const{message:t}=Wh("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(t)}const s=function(t,e){let r=null;return Xh(t?.publicKey,!1)||(r=Wh("MISSING_OR_INVALID","onSessionSettleRequest() controller public key should be a string")),r}(r);if(s)throw new Error(s.message);const o=nu(i,"onSessionSettleRequest()");if(o)throw new Error(o.message);if(vi(n)){const{message:t}=Wh("EXPIRED","onSessionSettleRequest()");throw new Error(t)}},this.isValidUpdate=async t=>{if(!ou(t)){const{message:e}=Wh("MISSING_OR_INVALID",`update() params: ${t}`);throw new Error(e)}const{topic:e,namespaces:r}=t;this.checkRecentlyDeleted(e),await this.isValidSessionTopic(e);const i=this.client.session.get(e),n=nu(r,"update()");if(n)throw new Error(n.message);const s=hu(i.requiredNamespaces,r,"update()");if(s)throw new Error(s.message)},this.isValidExtend=async t=>{if(!ou(t)){const{message:e}=Wh("MISSING_OR_INVALID",`extend() params: ${t}`);throw new Error(e)}const{topic:e}=t;this.checkRecentlyDeleted(e),await this.isValidSessionTopic(e)},this.isValidRequest=async t=>{if(!ou(t)){const{message:e}=Wh("MISSING_OR_INVALID",`request() params: ${t}`);throw new Error(e)}const{topic:e,request:r,chainId:i,expiry:n}=t;this.checkRecentlyDeleted(e),await this.isValidSessionTopic(e);const{namespaces:s}=this.client.session.get(e);if(!au(s,i)){const{message:t}=Wh("MISSING_OR_INVALID",`request() chainId: ${i}`);throw new Error(t)}if(!function(t){return!(Qh(t)||!Xh(t.method,!1))}(r)){const{message:t}=Wh("MISSING_OR_INVALID",`request() ${JSON.stringify(r)}`);throw new Error(t)}if(!function(t,e,r){return!!Xh(r,!1)&&function(t,e){const r=[];return Object.values(t).forEach((t=>{jh(t.accounts).includes(e)&&r.push(...t.methods)})),r}(t,e).includes(r)}(s,i,r.method)){const{message:t}=Wh("MISSING_OR_INVALID",`request() method: ${r.method}`);throw new Error(t)}if(n&&!cu(n,Em)){const{message:t}=Wh("MISSING_OR_INVALID",`request() expiry: ${n}. Expiry must be a number (in seconds) between ${Em.min} and ${Em.max}`);throw new Error(t)}},this.isValidRespond=async t=>{var e;if(!ou(t)){const{message:e}=Wh("MISSING_OR_INVALID",`respond() params: ${t}`);throw new Error(e)}const{topic:r,response:i}=t;try{await this.isValidSessionTopic(r)}catch(r){throw null!=(e=t?.response)&&e.id&&this.cleanupAfterResponse(t),r}if(!function(t){return!(Qh(t)||Qh(t.result)&&Qh(t.error)||!Zh(t.id,!1)||!Xh(t.jsonrpc,!1))}(i)){const{message:t}=Wh("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(i)}`);throw new Error(t)}},this.isValidPing=async t=>{if(!ou(t)){const{message:e}=Wh("MISSING_OR_INVALID",`ping() params: ${t}`);throw new Error(e)}const{topic:e}=t;await this.isValidSessionOrPairingTopic(e)},this.isValidEmit=async t=>{if(!ou(t)){const{message:e}=Wh("MISSING_OR_INVALID",`emit() params: ${t}`);throw new Error(e)}const{topic:e,event:r,chainId:i}=t;await this.isValidSessionTopic(e);const{namespaces:n}=this.client.session.get(e);if(!au(n,i)){const{message:t}=Wh("MISSING_OR_INVALID",`emit() chainId: ${i}`);throw new Error(t)}if(!function(t){return!(Qh(t)||!Xh(t.name,!1))}(r)){const{message:t}=Wh("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(r)}`);throw new Error(t)}if(!function(t,e,r){return!!Xh(r,!1)&&function(t,e){const r=[];return Object.values(t).forEach((t=>{jh(t.accounts).includes(e)&&r.push(...t.events)})),r}(t,e).includes(r)}(n,i,r.name)){const{message:t}=Wh("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(r)}`);throw new Error(t)}},this.isValidDisconnect=async t=>{if(!ou(t)){const{message:e}=Wh("MISSING_OR_INVALID",`disconnect() params: ${t}`);throw new Error(e)}const{topic:e}=t;await this.isValidSessionOrPairingTopic(e)},this.isValidAuthenticate=t=>{const{chains:e,uri:r,domain:i,nonce:n}=t;if(!Array.isArray(e)||0===e.length)throw new Error("chains is required and must be a non-empty array");if(!Xh(r,!1))throw new Error("uri is required parameter");if(!Xh(i,!1))throw new Error("domain is required parameter");if(!Xh(n,!1))throw new Error("nonce is required parameter");if([...new Set(e.map((t=>$r(t).namespace)))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:s}=$r(e[0]);if("eip155"!==s)throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async(t,e)=>{const r={verified:{verifyUrl:e.verifyUrl||Zl,validation:"UNKNOWN",origin:e.url||""}};try{const i=await this.client.core.verify.resolve({attestationId:t,verifyUrl:e.verifyUrl});i&&(r.verified.origin=i.origin,r.verified.isScam=i.isScam,r.verified.validation=i.origin===new URL(e.url).origin?"VALID":"INVALID")}catch(t){this.client.logger.info(t)}return this.client.logger.info(`Verify context: ${JSON.stringify(r)}`),r},this.validateSessionProps=(t,e)=>{Object.values(t).forEach((t=>{if(!Xh(t,!1)){const{message:r}=Wh("MISSING_OR_INVALID",`${e} must be in Record format. Received: ${JSON.stringify(t)}`);throw new Error(r)}}))},this.getPendingAuthRequest=t=>{const e=this.client.auth.requests.get(t);return"object"==typeof e?e:void 0},this.addToRecentlyDeleted=(t,e)=>{if(this.recentlyDeletedMap.set(t,e),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let t=0;const e=this.recentlyDeletedLimit/2;for(const r of this.recentlyDeletedMap.keys()){if(t++>=e)break;this.recentlyDeletedMap.delete(r)}}},this.checkRecentlyDeleted=t=>{const e=this.recentlyDeletedMap.get(t);if(e){const{message:r}=Wh("MISSING_OR_INVALID",`Record was recently deleted - ${e}: ${t}`);throw new Error(r)}}}async isInitialized(){if(!this.initialized){const{message:t}=Wh("NOT_INITIALIZED",this.name);throw new Error(t)}await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(Rl,(t=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(t):this.onRelayMessage(t)}))}async onRelayMessage(t){const{topic:e,message:r}=t,{publicKey:i}=this.client.auth.authKeys.keys.includes(Nm)?this.client.auth.authKeys.get(Nm):{responseTopic:void 0,publicKey:void 0},n=await this.client.core.crypto.decode(e,r,{receiverPublicKey:i});try{ju(n)?(this.client.core.history.set(e,n),this.onRelayEventRequest({topic:e,payload:n})):zu(n)?(await this.client.core.history.resolve(n),await this.onRelayEventResponse({topic:e,payload:n}),this.client.core.history.delete(e,n.id)):this.onRelayEventUnknownPayload({topic:e,payload:n})}catch(t){this.client.logger.error(t)}}registerExpirerEvents(){this.client.core.expirer.on(Yl,(async t=>{const{topic:e,id:r}=mi(t.target);return r&&this.client.pendingRequest.keys.includes(r)?await this.deletePendingSessionRequest(r,Wh("EXPIRED"),!0):r&&this.client.auth.requests.keys.includes(r)?await this.deletePendingAuthRequest(r,Wh("EXPIRED"),!0):void(e?this.client.session.keys.includes(e)&&(await this.deleteSession({topic:e,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:e})):r&&(await this.deleteProposal(r,!0),this.client.events.emit("proposal_expire",{id:r})))}))}registerPairingEvents(){this.client.core.pairing.events.on(Kl,(t=>this.onPairingCreated(t))),this.client.core.pairing.events.on(Hl,(t=>{this.addToRecentlyDeleted(t.topic,"pairing")}))}isValidPairingTopic(t){if(!Xh(t,!1)){const{message:e}=Wh("MISSING_OR_INVALID",`pairing topic should be a string: ${t}`);throw new Error(e)}if(!this.client.core.pairing.pairings.keys.includes(t)){const{message:e}=Wh("NO_MATCHING_KEY",`pairing topic doesn't exist: ${t}`);throw new Error(e)}if(vi(this.client.core.pairing.pairings.get(t).expiry)){const{message:e}=Wh("EXPIRED",`pairing topic: ${t}`);throw new Error(e)}}async isValidSessionTopic(t){if(!Xh(t,!1)){const{message:e}=Wh("MISSING_OR_INVALID",`session topic should be a string: ${t}`);throw new Error(e)}if(this.checkRecentlyDeleted(t),!this.client.session.keys.includes(t)){const{message:e}=Wh("NO_MATCHING_KEY",`session topic doesn't exist: ${t}`);throw new Error(e)}if(vi(this.client.session.get(t).expiry)){await this.deleteSession({topic:t});const{message:e}=Wh("EXPIRED",`session topic: ${t}`);throw new Error(e)}if(!this.client.core.crypto.keychain.has(t)){const{message:e}=Wh("MISSING_OR_INVALID",`session topic does not exist in keychain: ${t}`);throw await this.deleteSession({topic:t}),new Error(e)}}async isValidSessionOrPairingTopic(t){if(this.checkRecentlyDeleted(t),this.client.session.keys.includes(t))await this.isValidSessionTopic(t);else{if(!this.client.core.pairing.pairings.keys.includes(t)){if(Xh(t,!1)){const{message:e}=Wh("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${t}`);throw new Error(e)}{const{message:e}=Wh("MISSING_OR_INVALID",`session or pairing topic should be a string: ${t}`);throw new Error(e)}}this.isValidPairingTopic(t)}}async isValidProposalId(t){if(!function(t){return"number"==typeof t}(t)){const{message:e}=Wh("MISSING_OR_INVALID",`proposal id should be a number: ${t}`);throw new Error(e)}if(!this.client.proposal.keys.includes(t)){const{message:e}=Wh("NO_MATCHING_KEY",`proposal id doesn't exist: ${t}`);throw new Error(e)}if(vi(this.client.proposal.get(t).expiryTimestamp)){await this.deleteProposal(t);const{message:e}=Wh("EXPIRED",`proposal id: ${t}`);throw new Error(e)}}}class Bm extends Of{constructor(t,e){super(t,e,"proposal",vm),this.core=t,this.logger=e}}class jm extends Of{constructor(t,e){super(t,e,"session",vm),this.core=t,this.logger=e}}class zm extends Of{constructor(t,e){super(t,e,"request",vm,(t=>t.id)),this.core=t,this.logger=e}}class Fm extends Of{constructor(t,e){super(t,e,"authKeys",xm,(()=>Nm)),this.core=t,this.logger=e}}class Km extends Of{constructor(t,e){super(t,e,"pairingTopics",xm),this.core=t,this.logger=e}}class Hm extends Of{constructor(t,e){super(t,e,"requests",xm,(t=>t.id)),this.core=t,this.logger=e}}class Vm{constructor(t,e){this.core=t,this.logger=e,this.authKeys=new Fm(this.core,this.logger),this.pairingTopics=new Km(this.core,this.logger),this.requests=new Hm(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}class Gm extends Tt{constructor(t){super(t),this.protocol="wc",this.version=2,this.name=wm,this.events=new y.EventEmitter,this.on=(t,e)=>this.events.on(t,e),this.once=(t,e)=>this.events.once(t,e),this.off=(t,e)=>this.events.off(t,e),this.removeListener=(t,e)=>this.events.removeListener(t,e),this.removeAllListeners=t=>this.events.removeAllListeners(t),this.connect=async t=>{try{return await this.engine.connect(t)}catch(t){throw this.logger.error(t.message),t}},this.pair=async t=>{try{return await this.engine.pair(t)}catch(t){throw this.logger.error(t.message),t}},this.approve=async t=>{try{return await this.engine.approve(t)}catch(t){throw this.logger.error(t.message),t}},this.reject=async t=>{try{return await this.engine.reject(t)}catch(t){throw this.logger.error(t.message),t}},this.update=async t=>{try{return await this.engine.update(t)}catch(t){throw this.logger.error(t.message),t}},this.extend=async t=>{try{return await this.engine.extend(t)}catch(t){throw this.logger.error(t.message),t}},this.request=async t=>{try{return await this.engine.request(t)}catch(t){throw this.logger.error(t.message),t}},this.respond=async t=>{try{return await this.engine.respond(t)}catch(t){throw this.logger.error(t.message),t}},this.ping=async t=>{try{return await this.engine.ping(t)}catch(t){throw this.logger.error(t.message),t}},this.emit=async t=>{try{return await this.engine.emit(t)}catch(t){throw this.logger.error(t.message),t}},this.disconnect=async t=>{try{return await this.engine.disconnect(t)}catch(t){throw this.logger.error(t.message),t}},this.find=t=>{try{return this.engine.find(t)}catch(t){throw this.logger.error(t.message),t}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(t){throw this.logger.error(t.message),t}},this.authenticate=async t=>{try{return await this.engine.authenticate(t)}catch(t){throw this.logger.error(t.message),t}},this.formatAuthMessage=t=>{try{return this.engine.formatAuthMessage(t)}catch(t){throw this.logger.error(t.message),t}},this.approveSessionAuthenticate=async t=>{try{return await this.engine.approveSessionAuthenticate(t)}catch(t){throw this.logger.error(t.message),t}},this.rejectSessionAuthenticate=async t=>{try{return await this.engine.rejectSessionAuthenticate(t)}catch(t){throw this.logger.error(t.message),t}},this.name=t?.name||wm,this.metadata=t?.metadata||(0,Tr.g)()||{name:"",description:"",url:"",icons:[""]},this.signConfig=t?.signConfig;const e=typeof t?.logger<"u"&&"string"!=typeof t?.logger?t.logger:it()(wt({level:t?.logger||"error"}));this.core=t?.core||new Ff(t),this.logger=At(e,this.name),this.session=new jm(this.core,this.logger),this.proposal=new Bm(this.core,this.logger),this.pendingRequest=new zm(this.core,this.logger),this.engine=new Dm(this),this.auth=new Vm(this.core,this.logger)}static async init(t){const e=new Gm(t);return await e.initialize(),e}get context(){return bt(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.engine.init(),await this.auth.init(),this.core.verify.init({verifyUrl:this.metadata.verifyUrl}),this.logger.info("SignClient Initialization Success"),this.engine.processRelayMessageCache()}catch(t){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(t.message),t}}}const Wm=jm,$m=Gm;var Jm,Ym={exports:{}},Qm="object"==typeof Reflect?Reflect:null,Xm=Qm&&"function"==typeof Qm.apply?Qm.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};Jm=Qm&&"function"==typeof Qm.ownKeys?Qm.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var Zm=Number.isNaN||function(t){return t!=t};function ty(){ty.init.call(this)}Ym.exports=ty,Ym.exports.once=function(t,e){return new Promise((function(r,i){function n(r){t.removeListener(e,s),i(r)}function s(){"function"==typeof t.removeListener&&t.removeListener("error",n),r([].slice.call(arguments))}cy(t,e,s,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&cy(t,"error",e,{once:!0})}(t,n)}))},ty.EventEmitter=ty,ty.prototype._events=void 0,ty.prototype._eventsCount=0,ty.prototype._maxListeners=void 0;var ey=10;function ry(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function iy(t){return void 0===t._maxListeners?ty.defaultMaxListeners:t._maxListeners}function ny(t,e,r,i){var n,s,o;if(ry(r),void 0===(s=t._events)?(s=t._events=Object.create(null),t._eventsCount=0):(void 0!==s.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),o=s[e]),void 0===o)o=s[e]=r,++t._eventsCount;else if("function"==typeof o?o=s[e]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),(n=iy(t))>0&&o.length>n&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,function(t){console&&console.warn&&console.warn(t)}(a)}return t}function sy(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function oy(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=sy.bind(i);return n.listener=r,i.wrapFn=n,n}function ay(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var a=n[t];if(void 0===a)return!1;if("function"==typeof a)Xm(a,this,e);else{var h=a.length,u=uy(a,h);for(r=0;r=0;s--)if(r[s]===e||r[s].listener===e){o=r[s].listener,n=s;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},ty.prototype.listeners=function(t){return ay(this,t,!0)},ty.prototype.rawListeners=function(t){return ay(this,t,!1)},ty.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):hy.call(t,e)},ty.prototype.listenerCount=hy,ty.prototype.eventNames=function(){return this._eventsCount>0?Jm(this._events):[]};Ym.exports;class ly{constructor(t){this.opts=t}}class fy{constructor(t){this.client=t}}var dy=Object.defineProperty,py=Object.defineProperties,gy=Object.getOwnPropertyDescriptors,my=Object.getOwnPropertySymbols,yy=Object.prototype.hasOwnProperty,vy=Object.prototype.propertyIsEnumerable,wy=(t,e,r)=>e in t?dy(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;class by extends fy{constructor(t){super(t),this.init=async()=>{this.signClient=await $m.init({core:this.client.core,metadata:this.client.metadata,signConfig:this.client.signConfig}),this.authClient=await mm.init({core:this.client.core,projectId:"",metadata:this.client.metadata})},this.pair=async t=>{await this.client.core.pairing.pair(t)},this.approveSession=async t=>{const{topic:e,acknowledged:r}=await this.signClient.approve(((t,e)=>py(t,gy(e)))(((t,e)=>{for(var r in e||(e={}))yy.call(e,r)&&wy(t,r,e[r]);if(my)for(var r of my(e))vy.call(e,r)&&wy(t,r,e[r]);return t})({},t),{id:t.id,namespaces:t.namespaces,sessionProperties:t.sessionProperties,sessionConfig:t.sessionConfig}));return await r(),this.signClient.session.get(e)},this.rejectSession=async t=>await this.signClient.reject(t),this.updateSession=async t=>await this.signClient.update(t),this.extendSession=async t=>await this.signClient.extend(t),this.respondSessionRequest=async t=>await this.signClient.respond(t),this.disconnectSession=async t=>await this.signClient.disconnect(t),this.emitSessionEvent=async t=>await this.signClient.emit(t),this.getActiveSessions=()=>this.signClient.session.getAll().reduce(((t,e)=>(t[e.topic]=e,t)),{}),this.getPendingSessionProposals=()=>this.signClient.proposal.getAll(),this.getPendingSessionRequests=()=>this.signClient.getPendingSessionRequests(),this.respondAuthRequest=async(t,e)=>await this.authClient.respond(t,e),this.getPendingAuthRequests=()=>this.authClient.requests.getAll().filter((t=>"requester"in t)),this.formatMessage=(t,e)=>this.authClient.formatMessage(t,e),this.approveSessionAuthenticate=async t=>await this.signClient.approveSessionAuthenticate(t),this.rejectSessionAuthenticate=async t=>await this.signClient.rejectSessionAuthenticate(t),this.formatAuthMessage=t=>this.signClient.formatAuthMessage(t),this.registerDeviceToken=t=>this.client.core.echoClient.registerDeviceToken(t),this.on=(t,e)=>(this.setEvent(t,"off"),this.setEvent(t,"on"),this.client.events.on(t,e)),this.once=(t,e)=>(this.setEvent(t,"off"),this.setEvent(t,"once"),this.client.events.once(t,e)),this.off=(t,e)=>(this.setEvent(t,"off"),this.client.events.off(t,e)),this.removeListener=(t,e)=>(this.setEvent(t,"removeListener"),this.client.events.removeListener(t,e)),this.onSessionRequest=t=>{this.client.events.emit("session_request",t)},this.onSessionProposal=t=>{this.client.events.emit("session_proposal",t)},this.onSessionDelete=t=>{this.client.events.emit("session_delete",t)},this.onAuthRequest=t=>{this.client.events.emit("auth_request",t)},this.onProposalExpire=t=>{this.client.events.emit("proposal_expire",t)},this.onSessionRequestExpire=t=>{this.client.events.emit("session_request_expire",t)},this.onSessionRequestAuthenticate=t=>{this.client.events.emit("session_authenticate",t)},this.setEvent=(t,e)=>{switch(t){case"session_request":this.signClient.events[e]("session_request",this.onSessionRequest);break;case"session_proposal":this.signClient.events[e]("session_proposal",this.onSessionProposal);break;case"session_delete":this.signClient.events[e]("session_delete",this.onSessionDelete);break;case"auth_request":this.authClient[e]("auth_request",this.onAuthRequest);break;case"proposal_expire":this.signClient.events[e]("proposal_expire",this.onProposalExpire);break;case"session_request_expire":this.signClient.events[e]("session_request_expire",this.onSessionRequestExpire);break;case"session_authenticate":this.signClient.events[e]("session_authenticate",this.onSessionRequestAuthenticate)}},this.signClient={},this.authClient={}}}const Ay={decryptMessage:async t=>{const e={core:new Ff({storageOptions:t.storageOptions,storage:t.storage})};await e.core.crypto.init();const r=e.core.crypto.decode(t.topic,t.encryptedMessage);return e.core=null,r},getMetadata:async t=>{const e={core:new Ff({storageOptions:t.storageOptions,storage:t.storage}),sessionStore:null};e.sessionStore=new Wm(e.core,e.core.logger),await e.sessionStore.init();const r=e.sessionStore.get(t.topic),i=r?.peer.metadata;return e.core=null,e.sessionStore=null,i}},_y=class extends ly{constructor(t){super(t),this.events=new Ym.exports,this.on=(t,e)=>this.engine.on(t,e),this.once=(t,e)=>this.engine.once(t,e),this.off=(t,e)=>this.engine.off(t,e),this.removeListener=(t,e)=>this.engine.removeListener(t,e),this.pair=async t=>{try{return await this.engine.pair(t)}catch(t){throw this.logger.error(t.message),t}},this.approveSession=async t=>{try{return await this.engine.approveSession(t)}catch(t){throw this.logger.error(t.message),t}},this.rejectSession=async t=>{try{return await this.engine.rejectSession(t)}catch(t){throw this.logger.error(t.message),t}},this.updateSession=async t=>{try{return await this.engine.updateSession(t)}catch(t){throw this.logger.error(t.message),t}},this.extendSession=async t=>{try{return await this.engine.extendSession(t)}catch(t){throw this.logger.error(t.message),t}},this.respondSessionRequest=async t=>{try{return await this.engine.respondSessionRequest(t)}catch(t){throw this.logger.error(t.message),t}},this.disconnectSession=async t=>{try{return await this.engine.disconnectSession(t)}catch(t){throw this.logger.error(t.message),t}},this.emitSessionEvent=async t=>{try{return await this.engine.emitSessionEvent(t)}catch(t){throw this.logger.error(t.message),t}},this.getActiveSessions=()=>{try{return this.engine.getActiveSessions()}catch(t){throw this.logger.error(t.message),t}},this.getPendingSessionProposals=()=>{try{return this.engine.getPendingSessionProposals()}catch(t){throw this.logger.error(t.message),t}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(t){throw this.logger.error(t.message),t}},this.respondAuthRequest=async(t,e)=>{try{return await this.engine.respondAuthRequest(t,e)}catch(t){throw this.logger.error(t.message),t}},this.getPendingAuthRequests=()=>{try{return this.engine.getPendingAuthRequests()}catch(t){throw this.logger.error(t.message),t}},this.formatMessage=(t,e)=>{try{return this.engine.formatMessage(t,e)}catch(t){throw this.logger.error(t.message),t}},this.registerDeviceToken=t=>{try{return this.engine.registerDeviceToken(t)}catch(t){throw this.logger.error(t.message),t}},this.approveSessionAuthenticate=t=>{try{return this.engine.approveSessionAuthenticate(t)}catch(t){throw this.logger.error(t.message),t}},this.rejectSessionAuthenticate=t=>{try{return this.engine.rejectSessionAuthenticate(t)}catch(t){throw this.logger.error(t.message),t}},this.formatAuthMessage=t=>{try{return this.engine.formatAuthMessage(t)}catch(t){throw this.logger.error(t.message),t}},this.metadata=t.metadata,this.name=t.name||"Web3Wallet",this.signConfig=t.signConfig,this.core=t.core,this.logger=this.core.logger,this.engine=new by(this)}static async init(t){const e=new _y(t);return await e.initialize(),e}async initialize(){this.logger.trace("Initialized");try{await this.engine.init(),this.logger.info("Web3Wallet Initialization Success")}catch(t){throw this.logger.info("Web3Wallet Initialization Failure"),this.logger.error(t.message),t}}};let Ey=_y;Ey.notifications=Ay;const Sy=Ey;window.wc={core:null,web3wallet:null,authClient:null,statusObject:null,init:function(t){return new Promise((async(e,r)=>{if(!window.statusq){const t='missing window.statusq! Forgot to execute "ui/StatusQ/src/StatusQ/Components/private/qwebchannel/helpers.js" first?';console.error(t),r(t)}if(window.statusq.error){const t="Failed initializing WebChannel: "+window.statusq.error;console.error(t),r(t)}if(wc.statusObject=window.statusq.channel.objects.statusObject,!wc.statusObject){const t="Failed initializing WebChannel or initialization not run";console.error(t),r(t)}window.wc.core=new Ff({projectId:t}),window.wc.web3wallet=await Sy.init({core:window.wc.core,metadata:{name:"Status",description:"Status Wallet",url:"http://localhost",icons:["https://status.im/img/status-footer-logo.svg"]}}),window.wc.authClient=await gm.init({projectId:t,metadata:window.wc.web3wallet.metadata}),window.wc.web3wallet.on("session_proposal",(t=>{wc.statusObject.onSessionProposal(t)})),window.wc.web3wallet.on("session_update",(t=>{wc.statusObject.onSessionUpdate(t)})),window.wc.web3wallet.on("session_extend",(t=>{wc.statusObject.onSessionExtend(t)})),window.wc.web3wallet.on("session_ping",(t=>{wc.statusObject.onSessionPing(t)})),window.wc.web3wallet.on("session_delete",(t=>{wc.statusObject.onSessionDelete(t)})),window.wc.web3wallet.on("session_expire",(t=>{wc.statusObject.onSessionExpire(t)})),window.wc.web3wallet.on("session_request",(t=>{wc.statusObject.onSessionRequest(t)})),window.wc.web3wallet.on("session_request_sent",(t=>{wc.statusObject.onSessionRequestSent(t)})),window.wc.web3wallet.on("session_event",(t=>{wc.statusObject.onSessionEvent(t)})),window.wc.web3wallet.on("proposal_expire",(t=>{wc.statusObject.onProposalExpire(t)})),window.wc.authClient.on("auth_request",(t=>{wc.statusObject.onAuthRequest(t)})),wc.statusObject.sdkInitialized(""),e("")}))},pair:async function(t){await window.wc.web3wallet.pair({uri:t})},getPairings:function(){return window.wc.web3wallet.core.pairing.getPairings()},getActiveSessions:function(){return window.wc.web3wallet.getActiveSessions()},disconnect:async function(t){await window.wc.web3wallet.disconnectSession({topic:t,reason:$h("USER_DISCONNECTED")})},ping:async function(t){await window.wc.web3wallet.engine.signClient.ping({topic:t})},buildApprovedNamespaces:async function(t,e){return function(t){const{proposal:{requiredNamespaces:e,optionalNamespaces:r={}},supportedNamespaces:i}=t,n=Kh(e),s=Kh(r),o={};Object.keys(i).forEach((t=>{const e=i[t].chains,r=i[t].methods,n=i[t].events,s=i[t].accounts;e.forEach((e=>{if(!s.some((t=>t.includes(e))))throw new Error(`No accounts provided for chain ${e} in namespace ${t}`)})),o[t]={chains:e,methods:r,events:n,accounts:s}}));const a=hu(e,o,"approve()");if(a)throw new Error(a.message);const h={};return Object.keys(e).length||Object.keys(r).length?(Object.keys(n).forEach((t=>{const e=i[t].chains.filter((e=>{var r,i;return null==(i=null==(r=n[t])?void 0:r.chains)?void 0:i.includes(e)})),r=i[t].methods.filter((e=>{var r,i;return null==(i=null==(r=n[t])?void 0:r.methods)?void 0:i.includes(e)})),s=i[t].events.filter((e=>{var r,i;return null==(i=null==(r=n[t])?void 0:r.events)?void 0:i.includes(e)})),o=e.map((e=>i[t].accounts.filter((t=>t.includes(`${e}:`))))).flat();h[t]={chains:e,methods:r,events:s,accounts:o}})),Object.keys(s).forEach((t=>{var e,r,n,o,a,u;if(!i[t])return;const c=null==(r=null==(e=s[t])?void 0:e.chains)?void 0:r.filter((e=>i[t].chains.includes(e))),l=i[t].methods.filter((e=>{var r,i;return null==(i=null==(r=s[t])?void 0:r.methods)?void 0:i.includes(e)})),f=i[t].events.filter((e=>{var r,i;return null==(i=null==(r=s[t])?void 0:r.events)?void 0:i.includes(e)})),d=c?.map((e=>i[t].accounts.filter((t=>t.includes(`${e}:`))))).flat();h[t]={chains:bi(null==(n=h[t])?void 0:n.chains,c),methods:bi(null==(o=h[t])?void 0:o.methods,l),events:bi(null==(a=h[t])?void 0:a.events,f),accounts:bi(null==(u=h[t])?void 0:u.accounts,d)}})),h):o}({proposal:t,supportedNamespaces:e})},approveSession:async function(t,e){const{id:r,params:i}=t,{relays:n}=i;return await window.wc.web3wallet.approveSession({id:r,relayProtocol:n[0].protocol,namespaces:e})},rejectSession:async function(t){await window.wc.web3wallet.rejectSession({id:t,reason:$h("USER_REJECTED")})},auth:async function(t){await window.wc.authClient.core.pairing.pair({uri:t})},formatAuthMessage:function(t,e){const r=`did:pkh:eip155:1:${e}`;return window.wc.authClient.formatMessage(t,r)},approveAuth:async function(t,e,r){const{id:i}=t,n=`did:pkh:eip155:1:${e}`;await window.wc.authClient.respond({id:i,signature:{s:r,t:"eip191"}},n)},rejectAuth:async function(t,e){const r=`did:pkh:eip155:1:${e}`;await window.wc.authClient.respond({id:t,error:{code:4001,message:"Auth request has been rejected"}},r)},respondSessionRequest:async function(t,e,r){const i=Cu(e,r);await window.wc.web3wallet.respondSessionRequest({topic:t,response:i})},rejectSessionRequest:async function(t,e,r=!1){const i=r?"SESSION_SETTLEMENT_FAILED":"USER_REJECTED";await window.wc.web3wallet.respondSessionRequest({topic:t,response:Tu(e,$h(i))})}}; \ No newline at end of file diff --git a/ui/app/AppLayouts/Wallet/services/dapps/sdk/package-lock.json b/ui/app/AppLayouts/Wallet/services/dapps/sdk/package-lock.json index 4dcd34eb25..cc2c97a596 100644 --- a/ui/app/AppLayouts/Wallet/services/dapps/sdk/package-lock.json +++ b/ui/app/AppLayouts/Wallet/services/dapps/sdk/package-lock.json @@ -9,12 +9,12 @@ "version": "0.1.0", "license": "MPL-2.0", "dependencies": { - "@walletconnect/web3wallet": "^1.11.2" + "@walletconnect/web3wallet": "^1.13.0" }, "devDependencies": { - "webpack": "^5.91.0", + "webpack": "^5.93.0", "webpack-cli": "^5.1.4", - "webpack-dev-server": "^4.15.2" + "webpack-dev-server": "^5.0.4" } }, "node_modules/@discoveryjs/json-ext": { @@ -379,6 +379,23 @@ "resolved": "https://registry.npmjs.org/@ioredis/commands/-/commands-1.2.0.tgz", "integrity": "sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==" }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.5", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", @@ -438,9 +455,9 @@ } }, "node_modules/@leichtgewicht/ip-codec": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz", - "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.5.tgz", + "integrity": "sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw==", "dev": true }, "node_modules/@parcel/watcher": { @@ -729,6 +746,16 @@ "url": "https://opencollective.com/parcel" } }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=14" + } + }, "node_modules/@stablelib/aead": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@stablelib/aead/-/aead-1.0.1.tgz", @@ -1021,9 +1048,9 @@ "dev": true }, "node_modules/@types/retry": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz", - "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==", + "version": "0.12.2", + "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.2.tgz", + "integrity": "sha512-XISRgDJ2Tc5q4TRqvgJtzsRkFYNJzZrhTdtMoGVBttwzzQJkPnS3WWTFc7kuDRoPtPakl+T+OfdEUjYJj7Jbow==", "dev": true }, "node_modules/@types/send": { @@ -1098,27 +1125,35 @@ } }, "node_modules/@walletconnect/core": { - "version": "2.12.2", - "resolved": "https://registry.npmjs.org/@walletconnect/core/-/core-2.12.2.tgz", - "integrity": "sha512-7Adv/b3pp9F42BkvReaaM4KS8NEvlkS7AMtwO3uF/o6aRMKtcfTJq9/jgWdKJh4RP8pPRTRFjCw6XQ/RZtT4aQ==", + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/@walletconnect/core/-/core-2.14.0.tgz", + "integrity": "sha512-E/dgBM9q3judXnTfZQ5ILvDpeSdDpabBLsXtYXa3Nyc26cfNplfLJ2nXm9FgtTdhM1nZ7yx4+zDPiXawBRZl2g==", "dependencies": { - "@walletconnect/heartbeat": "1.2.1", - "@walletconnect/jsonrpc-provider": "1.0.13", - "@walletconnect/jsonrpc-types": "1.0.3", + "@walletconnect/heartbeat": "1.2.2", + "@walletconnect/jsonrpc-provider": "1.0.14", + "@walletconnect/jsonrpc-types": "1.0.4", "@walletconnect/jsonrpc-utils": "1.0.8", "@walletconnect/jsonrpc-ws-connection": "1.0.14", - "@walletconnect/keyvaluestorage": "^1.1.1", - "@walletconnect/logger": "^2.1.2", - "@walletconnect/relay-api": "^1.0.9", - "@walletconnect/relay-auth": "^1.0.4", - "@walletconnect/safe-json": "^1.0.2", - "@walletconnect/time": "^1.0.2", - "@walletconnect/types": "2.12.2", - "@walletconnect/utils": "2.12.2", - "events": "^3.3.0", + "@walletconnect/keyvaluestorage": "1.1.1", + "@walletconnect/logger": "2.1.2", + "@walletconnect/relay-api": "1.0.10", + "@walletconnect/relay-auth": "1.0.4", + "@walletconnect/safe-json": "1.0.2", + "@walletconnect/time": "1.0.2", + "@walletconnect/types": "2.14.0", + "@walletconnect/utils": "2.14.0", + "events": "3.3.0", "isomorphic-unfetch": "3.1.0", "lodash.isequal": "4.5.0", - "uint8arrays": "^3.1.0" + "uint8arrays": "3.1.0" + } + }, + "node_modules/@walletconnect/core/node_modules/uint8arrays": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.1.0.tgz", + "integrity": "sha512-ei5rfKtoRO8OyOIor2Rz5fhzjThwIHJZ3uyDPnDHTXbP0aMQ1RN/6AI5B5d9dBxJOU+BvOAk7ZQ1xphsX8Lrog==", + "dependencies": { + "multiformats": "^9.4.2" } }, "node_modules/@walletconnect/environment": { @@ -1139,32 +1174,32 @@ } }, "node_modules/@walletconnect/heartbeat": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@walletconnect/heartbeat/-/heartbeat-1.2.1.tgz", - "integrity": "sha512-yVzws616xsDLJxuG/28FqtZ5rzrTA4gUjdEMTbWB5Y8V1XHRmqq4efAxCw5ie7WjbXFSUyBHaWlMR+2/CpQC5Q==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@walletconnect/heartbeat/-/heartbeat-1.2.2.tgz", + "integrity": "sha512-uASiRmC5MwhuRuf05vq4AT48Pq8RMi876zV8rr8cV969uTOzWdB/k+Lj5yI2PBtB1bGQisGen7MM1GcZlQTBXw==", "dependencies": { "@walletconnect/events": "^1.0.1", "@walletconnect/time": "^1.0.2", - "tslib": "1.14.1" + "events": "^3.3.0" } }, "node_modules/@walletconnect/jsonrpc-provider": { - "version": "1.0.13", - "resolved": "https://registry.npmjs.org/@walletconnect/jsonrpc-provider/-/jsonrpc-provider-1.0.13.tgz", - "integrity": "sha512-K73EpThqHnSR26gOyNEL+acEex3P7VWZe6KE12ZwKzAt2H4e5gldZHbjsu2QR9cLeJ8AXuO7kEMOIcRv1QEc7g==", + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/@walletconnect/jsonrpc-provider/-/jsonrpc-provider-1.0.14.tgz", + "integrity": "sha512-rtsNY1XqHvWj0EtITNeuf8PHMvlCLiS3EjQL+WOkxEOA4KPxsohFnBDeyPYiNm4ZvkQdLnece36opYidmtbmow==", "dependencies": { "@walletconnect/jsonrpc-utils": "^1.0.8", "@walletconnect/safe-json": "^1.0.2", - "tslib": "1.14.1" + "events": "^3.3.0" } }, "node_modules/@walletconnect/jsonrpc-types": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@walletconnect/jsonrpc-types/-/jsonrpc-types-1.0.3.tgz", - "integrity": "sha512-iIQ8hboBl3o5ufmJ8cuduGad0CQm3ZlsHtujv9Eu16xq89q+BG7Nh5VLxxUgmtpnrePgFkTwXirCTkwJH1v+Yw==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@walletconnect/jsonrpc-types/-/jsonrpc-types-1.0.4.tgz", + "integrity": "sha512-P6679fG/M+wuWg9TY8mh6xFSdYnFyFjwFelxyISxMDrlbXokorEVXYOxiqEbrU3x1BmBoCAJJ+vtEaEoMlpCBQ==", "dependencies": { - "keyvaluestorage-interface": "^1.0.0", - "tslib": "1.14.1" + "events": "^3.3.0", + "keyvaluestorage-interface": "^1.0.0" } }, "node_modules/@walletconnect/jsonrpc-utils": { @@ -1216,12 +1251,11 @@ } }, "node_modules/@walletconnect/relay-api": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@walletconnect/relay-api/-/relay-api-1.0.9.tgz", - "integrity": "sha512-Q3+rylJOqRkO1D9Su0DPE3mmznbAalYapJ9qmzDgK28mYF9alcP3UwG/og5V7l7CFOqzCLi7B8BvcBUrpDj0Rg==", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@walletconnect/relay-api/-/relay-api-1.0.10.tgz", + "integrity": "sha512-tqrdd4zU9VBNqUaXXQASaexklv6A54yEyQQEXYOCr+Jz8Ket0dmPBDyg19LVSNUN2cipAghQc45/KVmfFJ0cYw==", "dependencies": { - "@walletconnect/jsonrpc-types": "^1.0.2", - "tslib": "1.14.1" + "@walletconnect/jsonrpc-types": "^1.0.2" } }, "node_modules/@walletconnect/relay-auth": { @@ -1246,19 +1280,19 @@ } }, "node_modules/@walletconnect/sign-client": { - "version": "2.12.2", - "resolved": "https://registry.npmjs.org/@walletconnect/sign-client/-/sign-client-2.12.2.tgz", - "integrity": "sha512-cM0ualXj6nVvLqS4BDNRk+ZWR+lubcsz/IHreH+3wYrQ2sV+C0fN6ctrd7MMGZss0C0qacWCx0pm62ZBuoKvqA==", + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/@walletconnect/sign-client/-/sign-client-2.14.0.tgz", + "integrity": "sha512-UrB3S3eLjPYfBLCN3WJ5u7+WcZ8kFMe/QIDqLf76Jk6TaLwkSUy563LvnSw4KW/kA+/cY1KBSdUDfX1tzYJJXg==", "dependencies": { - "@walletconnect/core": "2.12.2", - "@walletconnect/events": "^1.0.1", - "@walletconnect/heartbeat": "1.2.1", + "@walletconnect/core": "2.14.0", + "@walletconnect/events": "1.0.1", + "@walletconnect/heartbeat": "1.2.2", "@walletconnect/jsonrpc-utils": "1.0.8", - "@walletconnect/logger": "^2.1.2", - "@walletconnect/time": "^1.0.2", - "@walletconnect/types": "2.12.2", - "@walletconnect/utils": "2.12.2", - "events": "^3.3.0" + "@walletconnect/logger": "2.1.2", + "@walletconnect/time": "1.0.2", + "@walletconnect/types": "2.14.0", + "@walletconnect/utils": "2.14.0", + "events": "3.3.0" } }, "node_modules/@walletconnect/time": { @@ -1270,52 +1304,60 @@ } }, "node_modules/@walletconnect/types": { - "version": "2.12.2", - "resolved": "https://registry.npmjs.org/@walletconnect/types/-/types-2.12.2.tgz", - "integrity": "sha512-9CmwTlPbrFTzayTL9q7xM7s3KTJkS6kYFtH2m1/fHFgALs6pIUjf1qAx1TF2E4tv7SEzLAIzU4NqgYUt2vWXTg==", + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/@walletconnect/types/-/types-2.14.0.tgz", + "integrity": "sha512-vevMi4jZLJ55vLuFOicQFmBBbLyb+S0sZS4IsaBdZkQflfGIq34HkN13c/KPl4Ye0aoR4/cUcUSitmGIzEQM5g==", "dependencies": { - "@walletconnect/events": "^1.0.1", - "@walletconnect/heartbeat": "1.2.1", - "@walletconnect/jsonrpc-types": "1.0.3", - "@walletconnect/keyvaluestorage": "^1.1.1", - "@walletconnect/logger": "^2.0.1", - "events": "^3.3.0" + "@walletconnect/events": "1.0.1", + "@walletconnect/heartbeat": "1.2.2", + "@walletconnect/jsonrpc-types": "1.0.4", + "@walletconnect/keyvaluestorage": "1.1.1", + "@walletconnect/logger": "2.1.2", + "events": "3.3.0" } }, "node_modules/@walletconnect/utils": { - "version": "2.12.2", - "resolved": "https://registry.npmjs.org/@walletconnect/utils/-/utils-2.12.2.tgz", - "integrity": "sha512-zf50HeS3SfoLv1N9GPl2IXTZ9TsXfet4usVAsZmX9P6/Xzq7d/7QakjVQCHH/Wk1O9XkcsfeoZoUhRxoMJ5uJw==", + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/@walletconnect/utils/-/utils-2.14.0.tgz", + "integrity": "sha512-vRVomYQEtEAyCK2c5bzzEvtgxaGGITF8mWuIL+WYSAMyEJLY97mirP2urDucNwcUczwxUgI+no9RiNFbUHreQQ==", "dependencies": { "@stablelib/chacha20poly1305": "1.0.1", "@stablelib/hkdf": "1.0.1", - "@stablelib/random": "^1.0.2", + "@stablelib/random": "1.0.2", "@stablelib/sha256": "1.0.1", - "@stablelib/x25519": "^1.0.3", - "@walletconnect/relay-api": "^1.0.9", - "@walletconnect/safe-json": "^1.0.2", - "@walletconnect/time": "^1.0.2", - "@walletconnect/types": "2.12.2", - "@walletconnect/window-getters": "^1.0.1", - "@walletconnect/window-metadata": "^1.0.1", + "@stablelib/x25519": "1.0.3", + "@walletconnect/relay-api": "1.0.10", + "@walletconnect/safe-json": "1.0.2", + "@walletconnect/time": "1.0.2", + "@walletconnect/types": "2.14.0", + "@walletconnect/window-getters": "1.0.1", + "@walletconnect/window-metadata": "1.0.1", "detect-browser": "5.3.0", "query-string": "7.1.3", - "uint8arrays": "^3.1.0" + "uint8arrays": "3.1.0" + } + }, + "node_modules/@walletconnect/utils/node_modules/uint8arrays": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.1.0.tgz", + "integrity": "sha512-ei5rfKtoRO8OyOIor2Rz5fhzjThwIHJZ3uyDPnDHTXbP0aMQ1RN/6AI5B5d9dBxJOU+BvOAk7ZQ1xphsX8Lrog==", + "dependencies": { + "multiformats": "^9.4.2" } }, "node_modules/@walletconnect/web3wallet": { - "version": "1.11.2", - "resolved": "https://registry.npmjs.org/@walletconnect/web3wallet/-/web3wallet-1.11.2.tgz", - "integrity": "sha512-jrxXmZyg+czkHXg4d0jdhxajjfbgPvS9dW4UzdGdz12dXsX7CFgZxz+LWc/oakhLyngUtwHtyBlgaFWxamS3AQ==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@walletconnect/web3wallet/-/web3wallet-1.13.0.tgz", + "integrity": "sha512-5fAe4rIe7B0Q8NpyEYfyYBjrbtC5H4/VZMSgg9LHxpChXIpjUX01hj7jdTPvE7EOzN1mt2w7hgnpI5jY883gXg==", "dependencies": { "@walletconnect/auth-client": "2.1.2", - "@walletconnect/core": "2.12.2", - "@walletconnect/jsonrpc-provider": "1.0.13", + "@walletconnect/core": "2.14.0", + "@walletconnect/jsonrpc-provider": "1.0.14", "@walletconnect/jsonrpc-utils": "1.0.8", "@walletconnect/logger": "2.1.2", - "@walletconnect/sign-client": "2.12.2", - "@walletconnect/types": "2.12.2", - "@walletconnect/utils": "2.12.2" + "@walletconnect/sign-client": "2.14.0", + "@walletconnect/types": "2.14.0", + "@walletconnect/utils": "2.14.0" } }, "node_modules/@walletconnect/window-getters": { @@ -1561,10 +1603,10 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-import-assertions": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", - "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", + "node_modules/acorn-import-attributes": { + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", "dev": true, "peerDependencies": { "acorn": "^8" @@ -1646,6 +1688,30 @@ "ansi-html": "bin/ansi-html" } }, + "node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", @@ -1677,12 +1743,6 @@ } ] }, - "node_modules/array-flatten": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.2.tgz", - "integrity": "sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ==", - "dev": true - }, "node_modules/atomic-sleep": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz", @@ -1765,25 +1825,22 @@ "dev": true }, "node_modules/bonjour-service": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/bonjour-service/-/bonjour-service-1.1.1.tgz", - "integrity": "sha512-Z/5lQRMOG9k7W+FkeGTNjh7htqn/2LMnfOvBZ8pynNZCM9MwkQkI3zeI4oz09uWdcgmgHugVvBqxGg4VQJ5PCg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/bonjour-service/-/bonjour-service-1.2.1.tgz", + "integrity": "sha512-oSzCS2zV14bh2kji6vNe7vrpJYCHGvcZnlffFQ1MEoX/WOeQ/teD8SYWKR942OI3INjq8OMNJlbPK5LLLUxFDw==", "dev": true, "dependencies": { - "array-flatten": "^2.1.2", - "dns-equal": "^1.0.0", "fast-deep-equal": "^3.1.3", "multicast-dns": "^7.2.5" } }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^1.0.0" } }, "node_modules/braces": { @@ -1840,6 +1897,21 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, + "node_modules/bundle-name": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.0.tgz", + "integrity": "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==", + "dev": true, + "dependencies": { + "run-applescript": "^7.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/bytes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", @@ -1884,15 +1956,9 @@ ] }, "node_modules/chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -1905,6 +1971,9 @@ "engines": { "node": ">= 8.10.0" }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, "optionalDependencies": { "fsevents": "~2.3.2" } @@ -1964,6 +2033,24 @@ "node": ">=0.10.0" } }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "node_modules/colorette": { "version": "2.0.20", "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", @@ -2027,12 +2114,6 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true - }, "node_modules/connect-history-api-fallback": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-2.0.0.tgz", @@ -2134,6 +2215,34 @@ "node": ">=0.10" } }, + "node_modules/default-browser": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.2.1.tgz", + "integrity": "sha512-WY/3TUME0x3KPYdRRxEJJvXRHV4PyPoUsxtZa78lwItwRQRHhd2U9xOscaT/YTf8uCXIAjeJOFBVEh/7FtD8Xg==", + "dev": true, + "dependencies": { + "bundle-name": "^4.1.0", + "default-browser-id": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser-id": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-5.0.0.tgz", + "integrity": "sha512-A6p/pu/6fyBcA1TRz/GqWYPViplrftcW2gZC9q79ngNCKAeR/X3gcEdXQHl4KNXV+3wgIJ1CPkJQ3IHM6lcsyA==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/default-gateway": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-6.0.3.tgz", @@ -2161,12 +2270,15 @@ } }, "node_modules/define-lazy-prop": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", - "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", + "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==", "dev": true, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/defu": { @@ -2228,12 +2340,6 @@ "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==", "dev": true }, - "node_modules/dns-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/dns-equal/-/dns-equal-1.0.0.tgz", - "integrity": "sha512-z+paD6YUQsk+AbGCEM4PrOXSss5gd66QfcVBFTKR/HpFL9jCqikS94HYwKww6fQyO7IxrIIyUu+g0Ka9tUS2Cg==", - "dev": true - }, "node_modules/dns-packet": { "version": "5.6.1", "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-5.6.1.tgz", @@ -2257,6 +2363,12 @@ "stream-shift": "^1.0.0" } }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -2288,6 +2400,12 @@ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, "node_modules/encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", @@ -2306,9 +2424,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.16.0.tgz", - "integrity": "sha512-O+QWCviPNSSLAD9Ucn8Awv+poAkqn3T1XY5/N7kR7rQO9yfSGWkYZDwpJ+iKF7B8rxaQKWngSqACpgzeapSyoA==", + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", "dev": true, "dependencies": { "graceful-fs": "^4.2.4", @@ -2522,6 +2640,12 @@ "node": ">=6" } }, + "node_modules/fast-uri": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.1.tgz", + "integrity": "sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==", + "dev": true + }, "node_modules/fastest-levenshtein": { "version": "1.0.16", "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", @@ -2637,6 +2761,34 @@ } } }, + "node_modules/foreground-child": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.2.1.tgz", + "integrity": "sha512-PXUUyLqrR2XCWICfv6ukppP96sdFwWbNEnfEMt7jNsISjMsvaLNinAHNDYyvkyU+SZG2BTSbT5NjG+vZslfGTA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/foreground-child/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", @@ -2655,18 +2807,6 @@ "node": ">= 0.6" } }, - "node_modules/fs-monkey": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.5.tgz", - "integrity": "sha512-8uMbBjrhzW76TYgEV27Y5E//W2f/lTFmx78P2w19FZSxarhI/798APGQyuGCwmkNxgwGRhrLfvWyLBvNtuOmew==", - "dev": true - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true - }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", @@ -2721,20 +2861,20 @@ } }, "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" }, - "engines": { - "node": "*" + "bin": { + "glob": "dist/esm/bin.mjs" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -3013,6 +3153,15 @@ "node": ">=10.17.0" } }, + "node_modules/hyperdyperid": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/hyperdyperid/-/hyperdyperid-1.2.0.tgz", + "integrity": "sha512-Y93lCzHYgGWdrJ66yIktxiaGULYc6oGiABxhcO5AufBeOyoIdZF7bIfLaOrbM0iGIOXQQgxxRrFEnb+Y6w1n4A==", + "dev": true, + "engines": { + "node": ">=10.18" + } + }, "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -3049,16 +3198,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -3158,6 +3297,15 @@ "node": ">=0.10.0" } }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -3169,6 +3317,51 @@ "node": ">=0.10.0" } }, + "node_modules/is-inside-container": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "dev": true, + "dependencies": { + "is-docker": "^3.0.0" + }, + "bin": { + "is-inside-container": "cli.js" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-inside-container/node_modules/is-docker": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "dev": true, + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-network-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-network-error/-/is-network-error-1.1.0.tgz", + "integrity": "sha512-tUdRRAnhT+OtCZR/LxZelH/C7QtjtFrTu5tXCA8pl55eTUElUHT+GPYV8MBMBvea/j+NxQqVt3LbWMRir7Gx9g==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -3252,6 +3445,21 @@ "unfetch": "^4.2.0" } }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, "node_modules/jest-worker": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", @@ -3385,12 +3593,9 @@ "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==" }, "node_modules/lru-cache": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.1.0.tgz", - "integrity": "sha512-/1clY/ui8CzjKFyjdvwPWJUYKiFVXG2I2cY0ssG7h4+hwk+XOIX7ZSG9Q7TW8TW3Kp3BUSqgFWBLgL4PJ+Blag==", - "engines": { - "node": "14 || >=16.14" - } + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==" }, "node_modules/media-typer": { "version": "0.3.0", @@ -3402,17 +3607,112 @@ } }, "node_modules/memfs": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.5.3.tgz", - "integrity": "sha512-UERzLsxzllchadvbPs5aolHh65ISpKpM+ccLbOJ8/vvpBKmAWf+la7dXFy7Mr0ySHbdHrFv5kGFCUHHe6GFEmw==", + "version": "4.9.4", + "resolved": "https://registry.npmjs.org/memfs/-/memfs-4.9.4.tgz", + "integrity": "sha512-Xlj8b2rU11nM6+KU6wC7cuWcHQhVINWCUgdPS4Ar9nPxLaOya3RghqK7ALyDW2QtGebYAYs6uEdEVnwPVT942A==", "dev": true, "dependencies": { - "fs-monkey": "^1.0.4" + "@jsonjoy.com/json-pack": "^1.0.3", + "@jsonjoy.com/util": "^1.1.2", + "tree-dump": "^1.0.1", + "tslib": "^2.0.0" }, "engines": { "node": ">= 4.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/streamich" } }, + "node_modules/memfs/node_modules/@jsonjoy.com/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jsonjoy.com/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-q6XAnWQDIMA3+FTiOYajoYqySkO+JSat0ytXGSuRdq9uXE7o92gzuQwQM14xaCRlBLGq3v5miDGC4vkVTn54xA==", + "dev": true, + "engines": { + "node": ">=10.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/streamich" + }, + "peerDependencies": { + "tslib": "2" + } + }, + "node_modules/memfs/node_modules/@jsonjoy.com/json-pack": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@jsonjoy.com/json-pack/-/json-pack-1.0.4.tgz", + "integrity": "sha512-aOcSN4MeAtFROysrbqG137b7gaDDSmVrl5mpo6sT/w+kcXpWnzhMjmY/Fh/sDx26NBxyIE7MB1seqLeCAzy9Sg==", + "dev": true, + "dependencies": { + "@jsonjoy.com/base64": "^1.1.1", + "@jsonjoy.com/util": "^1.1.2", + "hyperdyperid": "^1.2.0", + "thingies": "^1.20.0" + }, + "engines": { + "node": ">=10.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/streamich" + }, + "peerDependencies": { + "tslib": "2" + } + }, + "node_modules/memfs/node_modules/@jsonjoy.com/util": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@jsonjoy.com/util/-/util-1.2.0.tgz", + "integrity": "sha512-4B8B+3vFsY4eo33DMKyJPlQ3sBMpPFUZK2dr3O3rXrOGKKbYG44J0XSFkDo1VOQiri5HFEhIeVvItjR2xcazmg==", + "dev": true, + "engines": { + "node": ">=10.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/streamich" + }, + "peerDependencies": { + "tslib": "2" + } + }, + "node_modules/memfs/node_modules/thingies": { + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/thingies/-/thingies-1.21.0.tgz", + "integrity": "sha512-hsqsJsFMsV+aD4s3CWKk85ep/3I9XzYV/IXaSouJMYIoDlgyi11cBhsqYe9/geRfB0YIikBQg6raRaM+nIMP9g==", + "dev": true, + "engines": { + "node": ">=10.18" + }, + "peerDependencies": { + "tslib": "^2" + } + }, + "node_modules/memfs/node_modules/tree-dump": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/tree-dump/-/tree-dump-1.0.2.tgz", + "integrity": "sha512-dpev9ABuLWdEubk+cIaI9cHwRNNDjkBBLXTwI4UCUFdQ5xXKqNXoK4FEciw/vxf+NQ7Cb7sGUyeUtORvHIdRXQ==", + "dev": true, + "engines": { + "node": ">=10.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/streamich" + }, + "peerDependencies": { + "tslib": "2" + } + }, + "node_modules/memfs/node_modules/tslib": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", + "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", + "dev": true + }, "node_modules/merge-descriptors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", @@ -3496,15 +3796,27 @@ "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" }, "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "engines": { + "node": ">=16 || 14 >=14.17" } }, "node_modules/mlly": { @@ -3700,17 +4012,33 @@ } }, "node_modules/open": { - "version": "8.4.2", - "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", - "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/open/-/open-10.1.0.tgz", + "integrity": "sha512-mnkeQ1qP5Ue2wd+aivTD3NHd/lZ96Lu0jgf0pwktLPtx6cTZiH7tyeGRRHs0zX0rbrahXPnXlUnbeXyaBBuIaw==", "dev": true, "dependencies": { - "define-lazy-prop": "^2.0.0", - "is-docker": "^2.1.1", - "is-wsl": "^2.2.0" + "default-browser": "^5.2.1", + "define-lazy-prop": "^3.0.0", + "is-inside-container": "^1.0.0", + "is-wsl": "^3.1.0" }, "engines": { - "node": ">=12" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/open/node_modules/is-wsl": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz", + "integrity": "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==", + "dev": true, + "dependencies": { + "is-inside-container": "^1.0.0" + }, + "engines": { + "node": ">=16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -3744,16 +4072,20 @@ } }, "node_modules/p-retry": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-4.6.2.tgz", - "integrity": "sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-6.2.0.tgz", + "integrity": "sha512-JA6nkq6hKyWLLasXQXUrO4z8BUZGUt/LjlJxx8Gb2+2ntodU/SS63YZ8b0LUTbQ8ZB9iwOfhEPhg4ykKnn2KsA==", "dev": true, "dependencies": { - "@types/retry": "0.12.0", + "@types/retry": "0.12.2", + "is-network-error": "^1.0.0", "retry": "^0.13.1" }, "engines": { - "node": ">=8" + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-try": { @@ -3765,6 +4097,12 @@ "node": ">=6" } }, + "node_modules/package-json-from-dist": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", + "integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==", + "dev": true + }, "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -3783,15 +4121,6 @@ "node": ">=8" } }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -3806,6 +4135,22 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/path-to-regexp": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", @@ -4143,20 +4488,35 @@ } }, "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.9.tgz", + "integrity": "sha512-3i7b8OcswU6CpU8Ej89quJD4O98id7TtVM5U4Mybh84zQXdrFmDLouWBEEaD/QfO3gDDfH+AGFCGsR7kngzQnA==", "dev": true, "dependencies": { - "glob": "^7.1.3" + "glob": "^10.3.7" }, "bin": { - "rimraf": "bin.js" + "rimraf": "dist/esm/bin.mjs" + }, + "engines": { + "node": "14 >=14.20 || 16 >=16.20 || >=18" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/run-applescript": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-7.0.0.tgz", + "integrity": "sha512-9by4Ij99JUr/MCFBUkDKLWK3G9HVXmabKz9U5MlIAIuvuzkiOicRYs8XJLxX+xahD+mLiiCYDqF9dKAgtzKP1A==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -4590,6 +4950,102 @@ "safe-buffer": "~5.2.0" } }, + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-final-newline": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", @@ -4980,9 +5436,9 @@ "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" }, "node_modules/webpack": { - "version": "5.91.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.91.0.tgz", - "integrity": "sha512-rzVwlLeBWHJbmgTC/8TvAcu5vpJNII+MelQpylD4jNERPwpBJOE2lEcko1zJX3QJeLjTTAnQxn/OJ8bjDzVQaw==", + "version": "5.93.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.93.0.tgz", + "integrity": "sha512-Y0m5oEY1LRuwly578VqluorkXbvXKh7U3rLoQCEO04M97ScRr44afGVkI0FQFsXzysk5OgFAxjZAb9rsGQVihA==", "dev": true, "dependencies": { "@types/eslint-scope": "^3.7.3", @@ -4991,10 +5447,10 @@ "@webassemblyjs/wasm-edit": "^1.12.1", "@webassemblyjs/wasm-parser": "^1.12.1", "acorn": "^8.7.1", - "acorn-import-assertions": "^1.9.0", + "acorn-import-attributes": "^1.9.5", "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.16.0", + "enhanced-resolve": "^5.17.0", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", @@ -5081,38 +5537,44 @@ } }, "node_modules/webpack-dev-middleware": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-5.3.4.tgz", - "integrity": "sha512-BVdTqhhs+0IfoeAf7EoH5WE+exCmqGerHfDM0IL096Px60Tq2Mn9MAbnaGUe6HiMa41KMCYF19gyzZmBcq/o4Q==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-7.3.0.tgz", + "integrity": "sha512-xD2qnNew+F6KwOGZR7kWdbIou/ud7cVqLEXeK1q0nHcNsX/u7ul/fSdlOTX4ntSL5FNFy7ZJJXbf0piF591JYw==", "dev": true, "dependencies": { "colorette": "^2.0.10", - "memfs": "^3.4.3", + "memfs": "^4.6.0", "mime-types": "^2.1.31", + "on-finished": "^2.4.1", "range-parser": "^1.2.1", "schema-utils": "^4.0.0" }, "engines": { - "node": ">= 12.13.0" + "node": ">= 18.12.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/webpack" }, "peerDependencies": { - "webpack": "^4.0.0 || ^5.0.0" + "webpack": "^5.0.0" + }, + "peerDependenciesMeta": { + "webpack": { + "optional": true + } } }, "node_modules/webpack-dev-middleware/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", "dev": true, "dependencies": { - "fast-deep-equal": "^3.1.1", + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" + "require-from-string": "^2.0.2" }, "funding": { "type": "github", @@ -5157,54 +5619,54 @@ } }, "node_modules/webpack-dev-server": { - "version": "4.15.2", - "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.15.2.tgz", - "integrity": "sha512-0XavAZbNJ5sDrCbkpWL8mia0o5WPOd2YGtxrEiZkBK9FjLppIUK2TgxK6qGD2P3hUXTJNNPVibrerKcx5WkR1g==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-5.0.4.tgz", + "integrity": "sha512-dljXhUgx3HqKP2d8J/fUMvhxGhzjeNVarDLcbO/EWMSgRizDkxHQDZQaLFL5VJY9tRBj2Gz+rvCEYYvhbqPHNA==", "dev": true, "dependencies": { - "@types/bonjour": "^3.5.9", - "@types/connect-history-api-fallback": "^1.3.5", - "@types/express": "^4.17.13", - "@types/serve-index": "^1.9.1", - "@types/serve-static": "^1.13.10", - "@types/sockjs": "^0.3.33", - "@types/ws": "^8.5.5", + "@types/bonjour": "^3.5.13", + "@types/connect-history-api-fallback": "^1.5.4", + "@types/express": "^4.17.21", + "@types/serve-index": "^1.9.4", + "@types/serve-static": "^1.15.5", + "@types/sockjs": "^0.3.36", + "@types/ws": "^8.5.10", "ansi-html-community": "^0.0.8", - "bonjour-service": "^1.0.11", - "chokidar": "^3.5.3", + "bonjour-service": "^1.2.1", + "chokidar": "^3.6.0", "colorette": "^2.0.10", "compression": "^1.7.4", "connect-history-api-fallback": "^2.0.0", "default-gateway": "^6.0.3", "express": "^4.17.3", "graceful-fs": "^4.2.6", - "html-entities": "^2.3.2", + "html-entities": "^2.4.0", "http-proxy-middleware": "^2.0.3", - "ipaddr.js": "^2.0.1", - "launch-editor": "^2.6.0", - "open": "^8.0.9", - "p-retry": "^4.5.0", - "rimraf": "^3.0.2", - "schema-utils": "^4.0.0", - "selfsigned": "^2.1.1", + "ipaddr.js": "^2.1.0", + "launch-editor": "^2.6.1", + "open": "^10.0.3", + "p-retry": "^6.2.0", + "rimraf": "^5.0.5", + "schema-utils": "^4.2.0", + "selfsigned": "^2.4.1", "serve-index": "^1.9.1", "sockjs": "^0.3.24", "spdy": "^4.0.2", - "webpack-dev-middleware": "^5.3.4", - "ws": "^8.13.0" + "webpack-dev-middleware": "^7.1.0", + "ws": "^8.16.0" }, "bin": { "webpack-dev-server": "bin/webpack-dev-server.js" }, "engines": { - "node": ">= 12.13.0" + "node": ">= 18.12.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/webpack" }, "peerDependencies": { - "webpack": "^4.37.0 || ^5.0.0" + "webpack": "^5.0.0" }, "peerDependenciesMeta": { "webpack": { @@ -5269,9 +5731,9 @@ } }, "node_modules/webpack-dev-server/node_modules/ws": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz", - "integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", "dev": true, "engines": { "node": ">=10.0.0" @@ -5364,6 +5826,97 @@ "integrity": "sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==", "dev": true }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/ui/app/AppLayouts/Wallet/services/dapps/sdk/package.json b/ui/app/AppLayouts/Wallet/services/dapps/sdk/package.json index a08d2d598b..d339b2c477 100644 --- a/ui/app/AppLayouts/Wallet/services/dapps/sdk/package.json +++ b/ui/app/AppLayouts/Wallet/services/dapps/sdk/package.json @@ -4,9 +4,9 @@ "description": "Wallet Connect integration for status-desktop", "private": true, "devDependencies": { - "webpack": "^5.91.0", + "webpack": "^5.93.0", "webpack-cli": "^5.1.4", - "webpack-dev-server": "^4.15.2" + "webpack-dev-server": "^5.0.4" }, "license": "MPL-2.0", "scripts": { @@ -16,6 +16,6 @@ "start": "webpack serve --mode development --open" }, "dependencies": { - "@walletconnect/web3wallet": "^1.11.2" + "@walletconnect/web3wallet": "^1.13.0" } }