From 69f89ae5978401c6ea0b533de0f15efa38937c06 Mon Sep 17 00:00:00 2001 From: tornadocontrib Date: Tue, 19 Nov 2024 05:43:13 +0000 Subject: [PATCH] Force module resolution to make webpack build deterministic --- dist/tornado.umd.js | 7427 +++++++++++++++------------------- dist/tornado.umd.min.js | 6 +- dist/tornadoContracts.umd.js | 8 +- package.json | 6 + yarn.lock | 88 +- 5 files changed, 3384 insertions(+), 4151 deletions(-) diff --git a/dist/tornado.umd.js b/dist/tornado.umd.js index a9f4aff..0d4e415 100644 --- a/dist/tornado.umd.js +++ b/dist/tornado.umd.js @@ -5327,615 +5327,6 @@ exports.normalize = normalize; /***/ }), -/***/ 82102: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isBytes = isBytes; -exports.number = number; -exports.bool = bool; -exports.bytes = bytes; -exports.hash = hash; -exports.exists = exists; -exports.output = output; -function number(n) { - if (!Number.isSafeInteger(n) || n < 0) - throw new Error(`positive integer expected, not ${n}`); -} -function bool(b) { - if (typeof b !== 'boolean') - throw new Error(`boolean expected, not ${b}`); -} -// copied from utils -function isBytes(a) { - return (a instanceof Uint8Array || - (a != null && typeof a === 'object' && a.constructor.name === 'Uint8Array')); -} -function bytes(b, ...lengths) { - if (!isBytes(b)) - throw new Error('Uint8Array expected'); - if (lengths.length > 0 && !lengths.includes(b.length)) - throw new Error(`Uint8Array expected of length ${lengths}, not of length=${b.length}`); -} -function hash(h) { - if (typeof h !== 'function' || typeof h.create !== 'function') - throw new Error('Hash should be wrapped by utils.wrapConstructor'); - number(h.outputLen); - number(h.blockLen); -} -function exists(instance, checkFinished = true) { - if (instance.destroyed) - throw new Error('Hash instance has been destroyed'); - if (checkFinished && instance.finished) - throw new Error('Hash#digest() has already been called'); -} -function output(out, instance) { - bytes(out); - const min = instance.outputLen; - if (out.length < min) { - throw new Error(`digestInto() expects output buffer of length at least ${min}`); - } -} -const assert = { number, bool, bytes, hash, exists, output }; -exports["default"] = assert; -//# sourceMappingURL=_assert.js.map - -/***/ }), - -/***/ 17335: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.add5L = exports.add5H = exports.add4H = exports.add4L = exports.add3H = exports.add3L = exports.rotlBL = exports.rotlBH = exports.rotlSL = exports.rotlSH = exports.rotr32L = exports.rotr32H = exports.rotrBL = exports.rotrBH = exports.rotrSL = exports.rotrSH = exports.shrSL = exports.shrSH = exports.toBig = void 0; -exports.fromBig = fromBig; -exports.split = split; -exports.add = add; -const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1); -const _32n = /* @__PURE__ */ BigInt(32); -// We are not using BigUint64Array, because they are extremely slow as per 2022 -function fromBig(n, le = false) { - if (le) - return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) }; - return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 }; -} -function split(lst, le = false) { - let Ah = new Uint32Array(lst.length); - let Al = new Uint32Array(lst.length); - for (let i = 0; i < lst.length; i++) { - const { h, l } = fromBig(lst[i], le); - [Ah[i], Al[i]] = [h, l]; - } - return [Ah, Al]; -} -const toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0); -exports.toBig = toBig; -// for Shift in [0, 32) -const shrSH = (h, _l, s) => h >>> s; -exports.shrSH = shrSH; -const shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); -exports.shrSL = shrSL; -// Right rotate for Shift in [1, 32) -const rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s)); -exports.rotrSH = rotrSH; -const rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); -exports.rotrSL = rotrSL; -// Right rotate for Shift in (32, 64), NOTE: 32 is special case. -const rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32)); -exports.rotrBH = rotrBH; -const rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s)); -exports.rotrBL = rotrBL; -// Right rotate for shift===32 (just swaps l&h) -const rotr32H = (_h, l) => l; -exports.rotr32H = rotr32H; -const rotr32L = (h, _l) => h; -exports.rotr32L = rotr32L; -// Left rotate for Shift in [1, 32) -const rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s)); -exports.rotlSH = rotlSH; -const rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s)); -exports.rotlSL = rotlSL; -// Left rotate for Shift in (32, 64), NOTE: 32 is special case. -const rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s)); -exports.rotlBH = rotlBH; -const rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s)); -exports.rotlBL = rotlBL; -// JS uses 32-bit signed integers for bitwise operations which means we cannot -// simple take carry out of low bit sum by shift, we need to use division. -function add(Ah, Al, Bh, Bl) { - const l = (Al >>> 0) + (Bl >>> 0); - return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 }; -} -// Addition with more than 2 elements -const add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); -exports.add3L = add3L; -const add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0; -exports.add3H = add3H; -const add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); -exports.add4L = add4L; -const add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0; -exports.add4H = add4H; -const add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); -exports.add5L = add5L; -const add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0; -exports.add5H = add5H; -// prettier-ignore -const u64 = { - fromBig, split, toBig, - shrSH, shrSL, - rotrSH, rotrSL, rotrBH, rotrBL, - rotr32H, rotr32L, - rotlSH, rotlSL, rotlBH, rotlBL, - add, add3L, add3H, add4L, add4H, add5H, add5L, -}; -exports["default"] = u64; -//# sourceMappingURL=_u64.js.map - -/***/ }), - -/***/ 6256: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.crypto = void 0; -exports.crypto = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined; -//# sourceMappingURL=crypto.js.map - -/***/ }), - -/***/ 2214: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.shake256 = exports.shake128 = exports.keccak_512 = exports.keccak_384 = exports.keccak_256 = exports.keccak_224 = exports.sha3_512 = exports.sha3_384 = exports.sha3_256 = exports.sha3_224 = exports.Keccak = void 0; -exports.keccakP = keccakP; -const _assert_js_1 = __webpack_require__(82102); -const _u64_js_1 = __webpack_require__(17335); -const utils_js_1 = __webpack_require__(79520); -// SHA3 (keccak) is based on a new design: basically, the internal state is bigger than output size. -// It's called a sponge function. -// Various per round constants calculations -const SHA3_PI = []; -const SHA3_ROTL = []; -const _SHA3_IOTA = []; -const _0n = /* @__PURE__ */ BigInt(0); -const _1n = /* @__PURE__ */ BigInt(1); -const _2n = /* @__PURE__ */ BigInt(2); -const _7n = /* @__PURE__ */ BigInt(7); -const _256n = /* @__PURE__ */ BigInt(256); -const _0x71n = /* @__PURE__ */ BigInt(0x71); -for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) { - // Pi - [x, y] = [y, (2 * x + 3 * y) % 5]; - SHA3_PI.push(2 * (5 * y + x)); - // Rotational - SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64); - // Iota - let t = _0n; - for (let j = 0; j < 7; j++) { - R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n; - if (R & _2n) - t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n); - } - _SHA3_IOTA.push(t); -} -const [SHA3_IOTA_H, SHA3_IOTA_L] = /* @__PURE__ */ (0, _u64_js_1.split)(_SHA3_IOTA, true); -// Left rotation (without 0, 32, 64) -const rotlH = (h, l, s) => (s > 32 ? (0, _u64_js_1.rotlBH)(h, l, s) : (0, _u64_js_1.rotlSH)(h, l, s)); -const rotlL = (h, l, s) => (s > 32 ? (0, _u64_js_1.rotlBL)(h, l, s) : (0, _u64_js_1.rotlSL)(h, l, s)); -// Same as keccakf1600, but allows to skip some rounds -function keccakP(s, rounds = 24) { - const B = new Uint32Array(5 * 2); - // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js) - for (let round = 24 - rounds; round < 24; round++) { - // Theta θ - for (let x = 0; x < 10; x++) - B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40]; - for (let x = 0; x < 10; x += 2) { - const idx1 = (x + 8) % 10; - const idx0 = (x + 2) % 10; - const B0 = B[idx0]; - const B1 = B[idx0 + 1]; - const Th = rotlH(B0, B1, 1) ^ B[idx1]; - const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1]; - for (let y = 0; y < 50; y += 10) { - s[x + y] ^= Th; - s[x + y + 1] ^= Tl; - } - } - // Rho (ρ) and Pi (π) - let curH = s[2]; - let curL = s[3]; - for (let t = 0; t < 24; t++) { - const shift = SHA3_ROTL[t]; - const Th = rotlH(curH, curL, shift); - const Tl = rotlL(curH, curL, shift); - const PI = SHA3_PI[t]; - curH = s[PI]; - curL = s[PI + 1]; - s[PI] = Th; - s[PI + 1] = Tl; - } - // Chi (χ) - for (let y = 0; y < 50; y += 10) { - for (let x = 0; x < 10; x++) - B[x] = s[y + x]; - for (let x = 0; x < 10; x++) - s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10]; - } - // Iota (ι) - s[0] ^= SHA3_IOTA_H[round]; - s[1] ^= SHA3_IOTA_L[round]; - } - B.fill(0); -} -class Keccak extends utils_js_1.Hash { - // NOTE: we accept arguments in bytes instead of bits here. - constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) { - super(); - this.blockLen = blockLen; - this.suffix = suffix; - this.outputLen = outputLen; - this.enableXOF = enableXOF; - this.rounds = rounds; - this.pos = 0; - this.posOut = 0; - this.finished = false; - this.destroyed = false; - // Can be passed from user as dkLen - (0, _assert_js_1.number)(outputLen); - // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes - if (0 >= this.blockLen || this.blockLen >= 200) - throw new Error('Sha3 supports only keccak-f1600 function'); - this.state = new Uint8Array(200); - this.state32 = (0, utils_js_1.u32)(this.state); - } - keccak() { - if (!utils_js_1.isLE) - (0, utils_js_1.byteSwap32)(this.state32); - keccakP(this.state32, this.rounds); - if (!utils_js_1.isLE) - (0, utils_js_1.byteSwap32)(this.state32); - this.posOut = 0; - this.pos = 0; - } - update(data) { - (0, _assert_js_1.exists)(this); - const { blockLen, state } = this; - data = (0, utils_js_1.toBytes)(data); - const len = data.length; - for (let pos = 0; pos < len;) { - const take = Math.min(blockLen - this.pos, len - pos); - for (let i = 0; i < take; i++) - state[this.pos++] ^= data[pos++]; - if (this.pos === blockLen) - this.keccak(); - } - return this; - } - finish() { - if (this.finished) - return; - this.finished = true; - const { state, suffix, pos, blockLen } = this; - // Do the padding - state[pos] ^= suffix; - if ((suffix & 0x80) !== 0 && pos === blockLen - 1) - this.keccak(); - state[blockLen - 1] ^= 0x80; - this.keccak(); - } - writeInto(out) { - (0, _assert_js_1.exists)(this, false); - (0, _assert_js_1.bytes)(out); - this.finish(); - const bufferOut = this.state; - const { blockLen } = this; - for (let pos = 0, len = out.length; pos < len;) { - if (this.posOut >= blockLen) - this.keccak(); - const take = Math.min(blockLen - this.posOut, len - pos); - out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); - this.posOut += take; - pos += take; - } - return out; - } - xofInto(out) { - // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF - if (!this.enableXOF) - throw new Error('XOF is not possible for this instance'); - return this.writeInto(out); - } - xof(bytes) { - (0, _assert_js_1.number)(bytes); - return this.xofInto(new Uint8Array(bytes)); - } - digestInto(out) { - (0, _assert_js_1.output)(out, this); - if (this.finished) - throw new Error('digest() was already called'); - this.writeInto(out); - this.destroy(); - return out; - } - digest() { - return this.digestInto(new Uint8Array(this.outputLen)); - } - destroy() { - this.destroyed = true; - this.state.fill(0); - } - _cloneInto(to) { - const { blockLen, suffix, outputLen, rounds, enableXOF } = this; - to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds)); - to.state32.set(this.state32); - to.pos = this.pos; - to.posOut = this.posOut; - to.finished = this.finished; - to.rounds = rounds; - // Suffix can change in cSHAKE - to.suffix = suffix; - to.outputLen = outputLen; - to.enableXOF = enableXOF; - to.destroyed = this.destroyed; - return to; - } -} -exports.Keccak = Keccak; -const gen = (suffix, blockLen, outputLen) => (0, utils_js_1.wrapConstructor)(() => new Keccak(blockLen, suffix, outputLen)); -exports.sha3_224 = gen(0x06, 144, 224 / 8); -/** - * SHA3-256 hash function - * @param message - that would be hashed - */ -exports.sha3_256 = gen(0x06, 136, 256 / 8); -exports.sha3_384 = gen(0x06, 104, 384 / 8); -exports.sha3_512 = gen(0x06, 72, 512 / 8); -exports.keccak_224 = gen(0x01, 144, 224 / 8); -/** - * keccak-256 hash function. Different from SHA3-256. - * @param message - that would be hashed - */ -exports.keccak_256 = gen(0x01, 136, 256 / 8); -exports.keccak_384 = gen(0x01, 104, 384 / 8); -exports.keccak_512 = gen(0x01, 72, 512 / 8); -const genShake = (suffix, blockLen, outputLen) => (0, utils_js_1.wrapXOFConstructorWithOpts)((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true)); -exports.shake128 = genShake(0x1f, 168, 128 / 8); -exports.shake256 = genShake(0x1f, 136, 256 / 8); -//# sourceMappingURL=sha3.js.map - -/***/ }), - -/***/ 79520: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Hash = exports.nextTick = exports.byteSwapIfBE = exports.byteSwap = exports.isLE = exports.rotl = exports.rotr = exports.createView = exports.u32 = exports.u8 = void 0; -exports.isBytes = isBytes; -exports.byteSwap32 = byteSwap32; -exports.bytesToHex = bytesToHex; -exports.hexToBytes = hexToBytes; -exports.asyncLoop = asyncLoop; -exports.utf8ToBytes = utf8ToBytes; -exports.toBytes = toBytes; -exports.concatBytes = concatBytes; -exports.checkOpts = checkOpts; -exports.wrapConstructor = wrapConstructor; -exports.wrapConstructorWithOpts = wrapConstructorWithOpts; -exports.wrapXOFConstructorWithOpts = wrapXOFConstructorWithOpts; -exports.randomBytes = randomBytes; -// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. -// node.js versions earlier than v19 don't declare it in global scope. -// For node.js, package.json#exports field mapping rewrites import -// from `crypto` to `cryptoNode`, which imports native module. -// Makes the utils un-importable in browsers without a bundler. -// Once node.js 18 is deprecated (2025-04-30), we can just drop the import. -const crypto_1 = __webpack_require__(6256); -const _assert_js_1 = __webpack_require__(82102); -// export { isBytes } from './_assert.js'; -// We can't reuse isBytes from _assert, because somehow this causes huge perf issues -function isBytes(a) { - return (a instanceof Uint8Array || - (a != null && typeof a === 'object' && a.constructor.name === 'Uint8Array')); -} -// Cast array to different type -const u8 = (arr) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength); -exports.u8 = u8; -const u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); -exports.u32 = u32; -// Cast array to view -const createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength); -exports.createView = createView; -// The rotate right (circular right shift) operation for uint32 -const rotr = (word, shift) => (word << (32 - shift)) | (word >>> shift); -exports.rotr = rotr; -// The rotate left (circular left shift) operation for uint32 -const rotl = (word, shift) => (word << shift) | ((word >>> (32 - shift)) >>> 0); -exports.rotl = rotl; -exports.isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44; -// The byte swap operation for uint32 -const byteSwap = (word) => ((word << 24) & 0xff000000) | - ((word << 8) & 0xff0000) | - ((word >>> 8) & 0xff00) | - ((word >>> 24) & 0xff); -exports.byteSwap = byteSwap; -// Conditionally byte swap if on a big-endian platform -exports.byteSwapIfBE = exports.isLE ? (n) => n : (n) => (0, exports.byteSwap)(n); -// In place byte swap for Uint32Array -function byteSwap32(arr) { - for (let i = 0; i < arr.length; i++) { - arr[i] = (0, exports.byteSwap)(arr[i]); - } -} -// Array where index 0xf0 (240) is mapped to string 'f0' -const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0')); -/** - * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' - */ -function bytesToHex(bytes) { - (0, _assert_js_1.bytes)(bytes); - // pre-caching improves the speed 6x - let hex = ''; - for (let i = 0; i < bytes.length; i++) { - hex += hexes[bytes[i]]; - } - return hex; -} -// We use optimized technique to convert hex string to byte array -const asciis = { _0: 48, _9: 57, _A: 65, _F: 70, _a: 97, _f: 102 }; -function asciiToBase16(char) { - if (char >= asciis._0 && char <= asciis._9) - return char - asciis._0; - if (char >= asciis._A && char <= asciis._F) - return char - (asciis._A - 10); - if (char >= asciis._a && char <= asciis._f) - return char - (asciis._a - 10); - return; -} -/** - * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) - */ -function hexToBytes(hex) { - if (typeof hex !== 'string') - throw new Error('hex string expected, got ' + typeof hex); - const hl = hex.length; - const al = hl / 2; - if (hl % 2) - throw new Error('padded hex string expected, got unpadded hex of length ' + hl); - const array = new Uint8Array(al); - for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) { - const n1 = asciiToBase16(hex.charCodeAt(hi)); - const n2 = asciiToBase16(hex.charCodeAt(hi + 1)); - if (n1 === undefined || n2 === undefined) { - const char = hex[hi] + hex[hi + 1]; - throw new Error('hex string expected, got non-hex character "' + char + '" at index ' + hi); - } - array[ai] = n1 * 16 + n2; - } - return array; -} -// There is no setImmediate in browser and setTimeout is slow. -// call of async fn will return Promise, which will be fullfiled only on -// next scheduler queue processing step and this is exactly what we need. -const nextTick = async () => { }; -exports.nextTick = nextTick; -// Returns control to thread each 'tick' ms to avoid blocking -async function asyncLoop(iters, tick, cb) { - let ts = Date.now(); - for (let i = 0; i < iters; i++) { - cb(i); - // Date.now() is not monotonic, so in case if clock goes backwards we return return control too - const diff = Date.now() - ts; - if (diff >= 0 && diff < tick) - continue; - await (0, exports.nextTick)(); - ts += diff; - } -} -/** - * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) - */ -function utf8ToBytes(str) { - if (typeof str !== 'string') - throw new Error(`utf8ToBytes expected string, got ${typeof str}`); - return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 -} -/** - * Normalizes (non-hex) string or Uint8Array to Uint8Array. - * Warning: when Uint8Array is passed, it would NOT get copied. - * Keep in mind for future mutable operations. - */ -function toBytes(data) { - if (typeof data === 'string') - data = utf8ToBytes(data); - (0, _assert_js_1.bytes)(data); - return data; -} -/** - * Copies several Uint8Arrays into one. - */ -function concatBytes(...arrays) { - let sum = 0; - for (let i = 0; i < arrays.length; i++) { - const a = arrays[i]; - (0, _assert_js_1.bytes)(a); - sum += a.length; - } - const res = new Uint8Array(sum); - for (let i = 0, pad = 0; i < arrays.length; i++) { - const a = arrays[i]; - res.set(a, pad); - pad += a.length; - } - return res; -} -// For runtime check if class implements interface -class Hash { - // Safe version that clones internal state - clone() { - return this._cloneInto(); - } -} -exports.Hash = Hash; -const toStr = {}.toString; -function checkOpts(defaults, opts) { - if (opts !== undefined && toStr.call(opts) !== '[object Object]') - throw new Error('Options should be object or undefined'); - const merged = Object.assign(defaults, opts); - return merged; -} -function wrapConstructor(hashCons) { - const hashC = (msg) => hashCons().update(toBytes(msg)).digest(); - const tmp = hashCons(); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = () => hashCons(); - return hashC; -} -function wrapConstructorWithOpts(hashCons) { - const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest(); - const tmp = hashCons({}); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = (opts) => hashCons(opts); - return hashC; -} -function wrapXOFConstructorWithOpts(hashCons) { - const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest(); - const tmp = hashCons({}); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = (opts) => hashCons(opts); - return hashC; -} -/** - * Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS. - */ -function randomBytes(bytesLength = 32) { - if (crypto_1.crypto && typeof crypto_1.crypto.getRandomValues === 'function') { - return crypto_1.crypto.getRandomValues(new Uint8Array(bytesLength)); - } - // Legacy Node.js compatibility - if (crypto_1.crypto && typeof crypto_1.crypto.randomBytes === 'function') { - return crypto_1.crypto.randomBytes(bytesLength); - } - throw new Error('crypto.getRandomValues must be defined'); -} -//# sourceMappingURL=utils.js.map - -/***/ }), - /***/ 52139: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { @@ -8616,6 +8007,2466 @@ function base (ALPHABET) { module.exports = base +/***/ }), + +/***/ 73562: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.createCurve = exports.getHash = void 0; +/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +const hmac_1 = __webpack_require__(39615); +const utils_1 = __webpack_require__(99175); +const weierstrass_js_1 = __webpack_require__(91705); +// connects noble-curves to noble-hashes +function getHash(hash) { + return { + hash, + hmac: (key, ...msgs) => (0, hmac_1.hmac)(hash, key, (0, utils_1.concatBytes)(...msgs)), + randomBytes: utils_1.randomBytes, + }; +} +exports.getHash = getHash; +function createCurve(curveDef, defHash) { + const create = (hash) => (0, weierstrass_js_1.weierstrass)({ ...curveDef, ...getHash(hash) }); + return Object.freeze({ ...create(defHash), create }); +} +exports.createCurve = createCurve; +//# sourceMappingURL=_shortw_utils.js.map + +/***/ }), + +/***/ 62422: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.validateBasic = exports.wNAF = void 0; +/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +// Abelian group utilities +const modular_js_1 = __webpack_require__(24967); +const utils_js_1 = __webpack_require__(91484); +const _0n = BigInt(0); +const _1n = BigInt(1); +// Elliptic curve multiplication of Point by scalar. Fragile. +// Scalars should always be less than curve order: this should be checked inside of a curve itself. +// Creates precomputation tables for fast multiplication: +// - private scalar is split by fixed size windows of W bits +// - every window point is collected from window's table & added to accumulator +// - since windows are different, same point inside tables won't be accessed more than once per calc +// - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar) +// - +1 window is neccessary for wNAF +// - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication +// TODO: Research returning 2d JS array of windows, instead of a single window. This would allow +// windows to be in different memory locations +function wNAF(c, bits) { + const constTimeNegate = (condition, item) => { + const neg = item.negate(); + return condition ? neg : item; + }; + const opts = (W) => { + const windows = Math.ceil(bits / W) + 1; // +1, because + const windowSize = 2 ** (W - 1); // -1 because we skip zero + return { windows, windowSize }; + }; + return { + constTimeNegate, + // non-const time multiplication ladder + unsafeLadder(elm, n) { + let p = c.ZERO; + let d = elm; + while (n > _0n) { + if (n & _1n) + p = p.add(d); + d = d.double(); + n >>= _1n; + } + return p; + }, + /** + * Creates a wNAF precomputation window. Used for caching. + * Default window size is set by `utils.precompute()` and is equal to 8. + * Number of precomputed points depends on the curve size: + * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where: + * - 𝑊 is the window size + * - 𝑛 is the bitlength of the curve order. + * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224. + * @returns precomputed point tables flattened to a single array + */ + precomputeWindow(elm, W) { + const { windows, windowSize } = opts(W); + const points = []; + let p = elm; + let base = p; + for (let window = 0; window < windows; window++) { + base = p; + points.push(base); + // =1, because we skip zero + for (let i = 1; i < windowSize; i++) { + base = base.add(p); + points.push(base); + } + p = base.double(); + } + return points; + }, + /** + * Implements ec multiplication using precomputed tables and w-ary non-adjacent form. + * @param W window size + * @param precomputes precomputed tables + * @param n scalar (we don't check here, but should be less than curve order) + * @returns real and fake (for const-time) points + */ + wNAF(W, precomputes, n) { + // TODO: maybe check that scalar is less than group order? wNAF behavious is undefined otherwise + // But need to carefully remove other checks before wNAF. ORDER == bits here + const { windows, windowSize } = opts(W); + let p = c.ZERO; + let f = c.BASE; + const mask = BigInt(2 ** W - 1); // Create mask with W ones: 0b1111 for W=4 etc. + const maxNumber = 2 ** W; + const shiftBy = BigInt(W); + for (let window = 0; window < windows; window++) { + const offset = window * windowSize; + // Extract W bits. + let wbits = Number(n & mask); + // Shift number by W bits. + n >>= shiftBy; + // If the bits are bigger than max size, we'll split those. + // +224 => 256 - 32 + if (wbits > windowSize) { + wbits -= maxNumber; + n += _1n; + } + // This code was first written with assumption that 'f' and 'p' will never be infinity point: + // since each addition is multiplied by 2 ** W, it cannot cancel each other. However, + // there is negate now: it is possible that negated element from low value + // would be the same as high element, which will create carry into next window. + // It's not obvious how this can fail, but still worth investigating later. + // Check if we're onto Zero point. + // Add random point inside current window to f. + const offset1 = offset; + const offset2 = offset + Math.abs(wbits) - 1; // -1 because we skip zero + const cond1 = window % 2 !== 0; + const cond2 = wbits < 0; + if (wbits === 0) { + // The most important part for const-time getPublicKey + f = f.add(constTimeNegate(cond1, precomputes[offset1])); + } + else { + p = p.add(constTimeNegate(cond2, precomputes[offset2])); + } + } + // JIT-compiler should not eliminate f here, since it will later be used in normalizeZ() + // Even if the variable is still unused, there are some checks which will + // throw an exception, so compiler needs to prove they won't happen, which is hard. + // At this point there is a way to F be infinity-point even if p is not, + // which makes it less const-time: around 1 bigint multiply. + return { p, f }; + }, + wNAFCached(P, precomputesMap, n, transform) { + // @ts-ignore + const W = P._WINDOW_SIZE || 1; + // Calculate precomputes on a first run, reuse them after + let comp = precomputesMap.get(P); + if (!comp) { + comp = this.precomputeWindow(P, W); + if (W !== 1) { + precomputesMap.set(P, transform(comp)); + } + } + return this.wNAF(W, comp, n); + }, + }; +} +exports.wNAF = wNAF; +function validateBasic(curve) { + (0, modular_js_1.validateField)(curve.Fp); + (0, utils_js_1.validateObject)(curve, { + n: 'bigint', + h: 'bigint', + Gx: 'field', + Gy: 'field', + }, { + nBitLength: 'isSafeInteger', + nByteLength: 'isSafeInteger', + }); + // Set defaults + return Object.freeze({ + ...(0, modular_js_1.nLength)(curve.n, curve.nBitLength), + ...curve, + ...{ p: curve.Fp.ORDER }, + }); +} +exports.validateBasic = validateBasic; +//# sourceMappingURL=curve.js.map + +/***/ }), + +/***/ 71761: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.createHasher = exports.isogenyMap = exports.hash_to_field = exports.expand_message_xof = exports.expand_message_xmd = void 0; +const modular_js_1 = __webpack_require__(24967); +const utils_js_1 = __webpack_require__(91484); +function validateDST(dst) { + if (dst instanceof Uint8Array) + return dst; + if (typeof dst === 'string') + return (0, utils_js_1.utf8ToBytes)(dst); + throw new Error('DST must be Uint8Array or string'); +} +// Octet Stream to Integer. "spec" implementation of os2ip is 2.5x slower vs bytesToNumberBE. +const os2ip = utils_js_1.bytesToNumberBE; +// Integer to Octet Stream (numberToBytesBE) +function i2osp(value, length) { + if (value < 0 || value >= 1 << (8 * length)) { + throw new Error(`bad I2OSP call: value=${value} length=${length}`); + } + const res = Array.from({ length }).fill(0); + for (let i = length - 1; i >= 0; i--) { + res[i] = value & 0xff; + value >>>= 8; + } + return new Uint8Array(res); +} +function strxor(a, b) { + const arr = new Uint8Array(a.length); + for (let i = 0; i < a.length; i++) { + arr[i] = a[i] ^ b[i]; + } + return arr; +} +function isBytes(item) { + if (!(item instanceof Uint8Array)) + throw new Error('Uint8Array expected'); +} +function isNum(item) { + if (!Number.isSafeInteger(item)) + throw new Error('number expected'); +} +// Produces a uniformly random byte string using a cryptographic hash function H that outputs b bits +// https://www.rfc-editor.org/rfc/rfc9380#section-5.3.1 +function expand_message_xmd(msg, DST, lenInBytes, H) { + isBytes(msg); + isBytes(DST); + isNum(lenInBytes); + // https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3 + if (DST.length > 255) + DST = H((0, utils_js_1.concatBytes)((0, utils_js_1.utf8ToBytes)('H2C-OVERSIZE-DST-'), DST)); + const { outputLen: b_in_bytes, blockLen: r_in_bytes } = H; + const ell = Math.ceil(lenInBytes / b_in_bytes); + if (ell > 255) + throw new Error('Invalid xmd length'); + const DST_prime = (0, utils_js_1.concatBytes)(DST, i2osp(DST.length, 1)); + const Z_pad = i2osp(0, r_in_bytes); + const l_i_b_str = i2osp(lenInBytes, 2); // len_in_bytes_str + const b = new Array(ell); + const b_0 = H((0, utils_js_1.concatBytes)(Z_pad, msg, l_i_b_str, i2osp(0, 1), DST_prime)); + b[0] = H((0, utils_js_1.concatBytes)(b_0, i2osp(1, 1), DST_prime)); + for (let i = 1; i <= ell; i++) { + const args = [strxor(b_0, b[i - 1]), i2osp(i + 1, 1), DST_prime]; + b[i] = H((0, utils_js_1.concatBytes)(...args)); + } + const pseudo_random_bytes = (0, utils_js_1.concatBytes)(...b); + return pseudo_random_bytes.slice(0, lenInBytes); +} +exports.expand_message_xmd = expand_message_xmd; +// Produces a uniformly random byte string using an extendable-output function (XOF) H. +// 1. The collision resistance of H MUST be at least k bits. +// 2. H MUST be an XOF that has been proved indifferentiable from +// a random oracle under a reasonable cryptographic assumption. +// https://www.rfc-editor.org/rfc/rfc9380#section-5.3.2 +function expand_message_xof(msg, DST, lenInBytes, k, H) { + isBytes(msg); + isBytes(DST); + isNum(lenInBytes); + // https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3 + // DST = H('H2C-OVERSIZE-DST-' || a_very_long_DST, Math.ceil((lenInBytes * k) / 8)); + if (DST.length > 255) { + const dkLen = Math.ceil((2 * k) / 8); + DST = H.create({ dkLen }).update((0, utils_js_1.utf8ToBytes)('H2C-OVERSIZE-DST-')).update(DST).digest(); + } + if (lenInBytes > 65535 || DST.length > 255) + throw new Error('expand_message_xof: invalid lenInBytes'); + return (H.create({ dkLen: lenInBytes }) + .update(msg) + .update(i2osp(lenInBytes, 2)) + // 2. DST_prime = DST || I2OSP(len(DST), 1) + .update(DST) + .update(i2osp(DST.length, 1)) + .digest()); +} +exports.expand_message_xof = expand_message_xof; +/** + * Hashes arbitrary-length byte strings to a list of one or more elements of a finite field F + * https://www.rfc-editor.org/rfc/rfc9380#section-5.2 + * @param msg a byte string containing the message to hash + * @param count the number of elements of F to output + * @param options `{DST: string, p: bigint, m: number, k: number, expand: 'xmd' | 'xof', hash: H}`, see above + * @returns [u_0, ..., u_(count - 1)], a list of field elements. + */ +function hash_to_field(msg, count, options) { + (0, utils_js_1.validateObject)(options, { + DST: 'stringOrUint8Array', + p: 'bigint', + m: 'isSafeInteger', + k: 'isSafeInteger', + hash: 'hash', + }); + const { p, k, m, hash, expand, DST: _DST } = options; + isBytes(msg); + isNum(count); + const DST = validateDST(_DST); + const log2p = p.toString(2).length; + const L = Math.ceil((log2p + k) / 8); // section 5.1 of ietf draft link above + const len_in_bytes = count * m * L; + let prb; // pseudo_random_bytes + if (expand === 'xmd') { + prb = expand_message_xmd(msg, DST, len_in_bytes, hash); + } + else if (expand === 'xof') { + prb = expand_message_xof(msg, DST, len_in_bytes, k, hash); + } + else if (expand === '_internal_pass') { + // for internal tests only + prb = msg; + } + else { + throw new Error('expand must be "xmd" or "xof"'); + } + const u = new Array(count); + for (let i = 0; i < count; i++) { + const e = new Array(m); + for (let j = 0; j < m; j++) { + const elm_offset = L * (j + i * m); + const tv = prb.subarray(elm_offset, elm_offset + L); + e[j] = (0, modular_js_1.mod)(os2ip(tv), p); + } + u[i] = e; + } + return u; +} +exports.hash_to_field = hash_to_field; +function isogenyMap(field, map) { + // Make same order as in spec + const COEFF = map.map((i) => Array.from(i).reverse()); + return (x, y) => { + const [xNum, xDen, yNum, yDen] = COEFF.map((val) => val.reduce((acc, i) => field.add(field.mul(acc, x), i))); + x = field.div(xNum, xDen); // xNum / xDen + y = field.mul(y, field.div(yNum, yDen)); // y * (yNum / yDev) + return { x, y }; + }; +} +exports.isogenyMap = isogenyMap; +function createHasher(Point, mapToCurve, def) { + if (typeof mapToCurve !== 'function') + throw new Error('mapToCurve() must be defined'); + return { + // Encodes byte string to elliptic curve. + // hash_to_curve from https://www.rfc-editor.org/rfc/rfc9380#section-3 + hashToCurve(msg, options) { + const u = hash_to_field(msg, 2, { ...def, DST: def.DST, ...options }); + const u0 = Point.fromAffine(mapToCurve(u[0])); + const u1 = Point.fromAffine(mapToCurve(u[1])); + const P = u0.add(u1).clearCofactor(); + P.assertValidity(); + return P; + }, + // Encodes byte string to elliptic curve. + // encode_to_curve from https://www.rfc-editor.org/rfc/rfc9380#section-3 + encodeToCurve(msg, options) { + const u = hash_to_field(msg, 1, { ...def, DST: def.encodeDST, ...options }); + const P = Point.fromAffine(mapToCurve(u[0])).clearCofactor(); + P.assertValidity(); + return P; + }, + }; +} +exports.createHasher = createHasher; +//# sourceMappingURL=hash-to-curve.js.map + +/***/ }), + +/***/ 24967: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.mapHashToField = exports.getMinHashLength = exports.getFieldBytesLength = exports.hashToPrivateScalar = exports.FpSqrtEven = exports.FpSqrtOdd = exports.Field = exports.nLength = exports.FpIsSquare = exports.FpDiv = exports.FpInvertBatch = exports.FpPow = exports.validateField = exports.isNegativeLE = exports.FpSqrt = exports.tonelliShanks = exports.invert = exports.pow2 = exports.pow = exports.mod = void 0; +/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +// Utilities for modular arithmetics and finite fields +const utils_js_1 = __webpack_require__(91484); +// prettier-ignore +const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3); +// prettier-ignore +const _4n = BigInt(4), _5n = BigInt(5), _8n = BigInt(8); +// prettier-ignore +const _9n = BigInt(9), _16n = BigInt(16); +// Calculates a modulo b +function mod(a, b) { + const result = a % b; + return result >= _0n ? result : b + result; +} +exports.mod = mod; +/** + * Efficiently raise num to power and do modular division. + * Unsafe in some contexts: uses ladder, so can expose bigint bits. + * @example + * pow(2n, 6n, 11n) // 64n % 11n == 9n + */ +// TODO: use field version && remove +function pow(num, power, modulo) { + if (modulo <= _0n || power < _0n) + throw new Error('Expected power/modulo > 0'); + if (modulo === _1n) + return _0n; + let res = _1n; + while (power > _0n) { + if (power & _1n) + res = (res * num) % modulo; + num = (num * num) % modulo; + power >>= _1n; + } + return res; +} +exports.pow = pow; +// Does x ^ (2 ^ power) mod p. pow2(30, 4) == 30 ^ (2 ^ 4) +function pow2(x, power, modulo) { + let res = x; + while (power-- > _0n) { + res *= res; + res %= modulo; + } + return res; +} +exports.pow2 = pow2; +// Inverses number over modulo +function invert(number, modulo) { + if (number === _0n || modulo <= _0n) { + throw new Error(`invert: expected positive integers, got n=${number} mod=${modulo}`); + } + // Euclidean GCD https://brilliant.org/wiki/extended-euclidean-algorithm/ + // Fermat's little theorem "CT-like" version inv(n) = n^(m-2) mod m is 30x slower. + let a = mod(number, modulo); + let b = modulo; + // prettier-ignore + let x = _0n, y = _1n, u = _1n, v = _0n; + while (a !== _0n) { + // JIT applies optimization if those two lines follow each other + const q = b / a; + const r = b % a; + const m = x - u * q; + const n = y - v * q; + // prettier-ignore + b = a, a = r, x = u, y = v, u = m, v = n; + } + const gcd = b; + if (gcd !== _1n) + throw new Error('invert: does not exist'); + return mod(x, modulo); +} +exports.invert = invert; +/** + * Tonelli-Shanks square root search algorithm. + * 1. https://eprint.iacr.org/2012/685.pdf (page 12) + * 2. Square Roots from 1; 24, 51, 10 to Dan Shanks + * Will start an infinite loop if field order P is not prime. + * @param P field order + * @returns function that takes field Fp (created from P) and number n + */ +function tonelliShanks(P) { + // Legendre constant: used to calculate Legendre symbol (a | p), + // which denotes the value of a^((p-1)/2) (mod p). + // (a | p) ≡ 1 if a is a square (mod p) + // (a | p) ≡ -1 if a is not a square (mod p) + // (a | p) ≡ 0 if a ≡ 0 (mod p) + const legendreC = (P - _1n) / _2n; + let Q, S, Z; + // Step 1: By factoring out powers of 2 from p - 1, + // find q and s such that p - 1 = q*(2^s) with q odd + for (Q = P - _1n, S = 0; Q % _2n === _0n; Q /= _2n, S++) + ; + // Step 2: Select a non-square z such that (z | p) ≡ -1 and set c ≡ zq + for (Z = _2n; Z < P && pow(Z, legendreC, P) !== P - _1n; Z++) + ; + // Fast-path + if (S === 1) { + const p1div4 = (P + _1n) / _4n; + return function tonelliFast(Fp, n) { + const root = Fp.pow(n, p1div4); + if (!Fp.eql(Fp.sqr(root), n)) + throw new Error('Cannot find square root'); + return root; + }; + } + // Slow-path + const Q1div2 = (Q + _1n) / _2n; + return function tonelliSlow(Fp, n) { + // Step 0: Check that n is indeed a square: (n | p) should not be ≡ -1 + if (Fp.pow(n, legendreC) === Fp.neg(Fp.ONE)) + throw new Error('Cannot find square root'); + let r = S; + // TODO: will fail at Fp2/etc + let g = Fp.pow(Fp.mul(Fp.ONE, Z), Q); // will update both x and b + let x = Fp.pow(n, Q1div2); // first guess at the square root + let b = Fp.pow(n, Q); // first guess at the fudge factor + while (!Fp.eql(b, Fp.ONE)) { + if (Fp.eql(b, Fp.ZERO)) + return Fp.ZERO; // https://en.wikipedia.org/wiki/Tonelli%E2%80%93Shanks_algorithm (4. If t = 0, return r = 0) + // Find m such b^(2^m)==1 + let m = 1; + for (let t2 = Fp.sqr(b); m < r; m++) { + if (Fp.eql(t2, Fp.ONE)) + break; + t2 = Fp.sqr(t2); // t2 *= t2 + } + // NOTE: r-m-1 can be bigger than 32, need to convert to bigint before shift, otherwise there will be overflow + const ge = Fp.pow(g, _1n << BigInt(r - m - 1)); // ge = 2^(r-m-1) + g = Fp.sqr(ge); // g = ge * ge + x = Fp.mul(x, ge); // x *= ge + b = Fp.mul(b, g); // b *= g + r = m; + } + return x; + }; +} +exports.tonelliShanks = tonelliShanks; +function FpSqrt(P) { + // NOTE: different algorithms can give different roots, it is up to user to decide which one they want. + // For example there is FpSqrtOdd/FpSqrtEven to choice root based on oddness (used for hash-to-curve). + // P ≡ 3 (mod 4) + // √n = n^((P+1)/4) + if (P % _4n === _3n) { + // Not all roots possible! + // const ORDER = + // 0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaabn; + // const NUM = 72057594037927816n; + const p1div4 = (P + _1n) / _4n; + return function sqrt3mod4(Fp, n) { + const root = Fp.pow(n, p1div4); + // Throw if root**2 != n + if (!Fp.eql(Fp.sqr(root), n)) + throw new Error('Cannot find square root'); + return root; + }; + } + // Atkin algorithm for q ≡ 5 (mod 8), https://eprint.iacr.org/2012/685.pdf (page 10) + if (P % _8n === _5n) { + const c1 = (P - _5n) / _8n; + return function sqrt5mod8(Fp, n) { + const n2 = Fp.mul(n, _2n); + const v = Fp.pow(n2, c1); + const nv = Fp.mul(n, v); + const i = Fp.mul(Fp.mul(nv, _2n), v); + const root = Fp.mul(nv, Fp.sub(i, Fp.ONE)); + if (!Fp.eql(Fp.sqr(root), n)) + throw new Error('Cannot find square root'); + return root; + }; + } + // P ≡ 9 (mod 16) + if (P % _16n === _9n) { + // NOTE: tonelli is too slow for bls-Fp2 calculations even on start + // Means we cannot use sqrt for constants at all! + // + // const c1 = Fp.sqrt(Fp.negate(Fp.ONE)); // 1. c1 = sqrt(-1) in F, i.e., (c1^2) == -1 in F + // const c2 = Fp.sqrt(c1); // 2. c2 = sqrt(c1) in F, i.e., (c2^2) == c1 in F + // const c3 = Fp.sqrt(Fp.negate(c1)); // 3. c3 = sqrt(-c1) in F, i.e., (c3^2) == -c1 in F + // const c4 = (P + _7n) / _16n; // 4. c4 = (q + 7) / 16 # Integer arithmetic + // sqrt = (x) => { + // let tv1 = Fp.pow(x, c4); // 1. tv1 = x^c4 + // let tv2 = Fp.mul(c1, tv1); // 2. tv2 = c1 * tv1 + // const tv3 = Fp.mul(c2, tv1); // 3. tv3 = c2 * tv1 + // let tv4 = Fp.mul(c3, tv1); // 4. tv4 = c3 * tv1 + // const e1 = Fp.equals(Fp.square(tv2), x); // 5. e1 = (tv2^2) == x + // const e2 = Fp.equals(Fp.square(tv3), x); // 6. e2 = (tv3^2) == x + // tv1 = Fp.cmov(tv1, tv2, e1); // 7. tv1 = CMOV(tv1, tv2, e1) # Select tv2 if (tv2^2) == x + // tv2 = Fp.cmov(tv4, tv3, e2); // 8. tv2 = CMOV(tv4, tv3, e2) # Select tv3 if (tv3^2) == x + // const e3 = Fp.equals(Fp.square(tv2), x); // 9. e3 = (tv2^2) == x + // return Fp.cmov(tv1, tv2, e3); // 10. z = CMOV(tv1, tv2, e3) # Select the sqrt from tv1 and tv2 + // } + } + // Other cases: Tonelli-Shanks algorithm + return tonelliShanks(P); +} +exports.FpSqrt = FpSqrt; +// Little-endian check for first LE bit (last BE bit); +const isNegativeLE = (num, modulo) => (mod(num, modulo) & _1n) === _1n; +exports.isNegativeLE = isNegativeLE; +// prettier-ignore +const FIELD_FIELDS = [ + 'create', 'isValid', 'is0', 'neg', 'inv', 'sqrt', 'sqr', + 'eql', 'add', 'sub', 'mul', 'pow', 'div', + 'addN', 'subN', 'mulN', 'sqrN' +]; +function validateField(field) { + const initial = { + ORDER: 'bigint', + MASK: 'bigint', + BYTES: 'isSafeInteger', + BITS: 'isSafeInteger', + }; + const opts = FIELD_FIELDS.reduce((map, val) => { + map[val] = 'function'; + return map; + }, initial); + return (0, utils_js_1.validateObject)(field, opts); +} +exports.validateField = validateField; +// Generic field functions +/** + * Same as `pow` but for Fp: non-constant-time. + * Unsafe in some contexts: uses ladder, so can expose bigint bits. + */ +function FpPow(f, num, power) { + // Should have same speed as pow for bigints + // TODO: benchmark! + if (power < _0n) + throw new Error('Expected power > 0'); + if (power === _0n) + return f.ONE; + if (power === _1n) + return num; + let p = f.ONE; + let d = num; + while (power > _0n) { + if (power & _1n) + p = f.mul(p, d); + d = f.sqr(d); + power >>= _1n; + } + return p; +} +exports.FpPow = FpPow; +/** + * Efficiently invert an array of Field elements. + * `inv(0)` will return `undefined` here: make sure to throw an error. + */ +function FpInvertBatch(f, nums) { + const tmp = new Array(nums.length); + // Walk from first to last, multiply them by each other MOD p + const lastMultiplied = nums.reduce((acc, num, i) => { + if (f.is0(num)) + return acc; + tmp[i] = acc; + return f.mul(acc, num); + }, f.ONE); + // Invert last element + const inverted = f.inv(lastMultiplied); + // Walk from last to first, multiply them by inverted each other MOD p + nums.reduceRight((acc, num, i) => { + if (f.is0(num)) + return acc; + tmp[i] = f.mul(acc, tmp[i]); + return f.mul(acc, num); + }, inverted); + return tmp; +} +exports.FpInvertBatch = FpInvertBatch; +function FpDiv(f, lhs, rhs) { + return f.mul(lhs, typeof rhs === 'bigint' ? invert(rhs, f.ORDER) : f.inv(rhs)); +} +exports.FpDiv = FpDiv; +// This function returns True whenever the value x is a square in the field F. +function FpIsSquare(f) { + const legendreConst = (f.ORDER - _1n) / _2n; // Integer arithmetic + return (x) => { + const p = f.pow(x, legendreConst); + return f.eql(p, f.ZERO) || f.eql(p, f.ONE); + }; +} +exports.FpIsSquare = FpIsSquare; +// CURVE.n lengths +function nLength(n, nBitLength) { + // Bit size, byte size of CURVE.n + const _nBitLength = nBitLength !== undefined ? nBitLength : n.toString(2).length; + const nByteLength = Math.ceil(_nBitLength / 8); + return { nBitLength: _nBitLength, nByteLength }; +} +exports.nLength = nLength; +/** + * Initializes a finite field over prime. **Non-primes are not supported.** + * Do not init in loop: slow. Very fragile: always run a benchmark on a change. + * Major performance optimizations: + * * a) denormalized operations like mulN instead of mul + * * b) same object shape: never add or remove keys + * * c) Object.freeze + * @param ORDER prime positive bigint + * @param bitLen how many bits the field consumes + * @param isLE (def: false) if encoding / decoding should be in little-endian + * @param redef optional faster redefinitions of sqrt and other methods + */ +function Field(ORDER, bitLen, isLE = false, redef = {}) { + if (ORDER <= _0n) + throw new Error(`Expected Field ORDER > 0, got ${ORDER}`); + const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, bitLen); + if (BYTES > 2048) + throw new Error('Field lengths over 2048 bytes are not supported'); + const sqrtP = FpSqrt(ORDER); + const f = Object.freeze({ + ORDER, + BITS, + BYTES, + MASK: (0, utils_js_1.bitMask)(BITS), + ZERO: _0n, + ONE: _1n, + create: (num) => mod(num, ORDER), + isValid: (num) => { + if (typeof num !== 'bigint') + throw new Error(`Invalid field element: expected bigint, got ${typeof num}`); + return _0n <= num && num < ORDER; // 0 is valid element, but it's not invertible + }, + is0: (num) => num === _0n, + isOdd: (num) => (num & _1n) === _1n, + neg: (num) => mod(-num, ORDER), + eql: (lhs, rhs) => lhs === rhs, + sqr: (num) => mod(num * num, ORDER), + add: (lhs, rhs) => mod(lhs + rhs, ORDER), + sub: (lhs, rhs) => mod(lhs - rhs, ORDER), + mul: (lhs, rhs) => mod(lhs * rhs, ORDER), + pow: (num, power) => FpPow(f, num, power), + div: (lhs, rhs) => mod(lhs * invert(rhs, ORDER), ORDER), + // Same as above, but doesn't normalize + sqrN: (num) => num * num, + addN: (lhs, rhs) => lhs + rhs, + subN: (lhs, rhs) => lhs - rhs, + mulN: (lhs, rhs) => lhs * rhs, + inv: (num) => invert(num, ORDER), + sqrt: redef.sqrt || ((n) => sqrtP(f, n)), + invertBatch: (lst) => FpInvertBatch(f, lst), + // TODO: do we really need constant cmov? + // We don't have const-time bigints anyway, so probably will be not very useful + cmov: (a, b, c) => (c ? b : a), + toBytes: (num) => (isLE ? (0, utils_js_1.numberToBytesLE)(num, BYTES) : (0, utils_js_1.numberToBytesBE)(num, BYTES)), + fromBytes: (bytes) => { + if (bytes.length !== BYTES) + throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes.length}`); + return isLE ? (0, utils_js_1.bytesToNumberLE)(bytes) : (0, utils_js_1.bytesToNumberBE)(bytes); + }, + }); + return Object.freeze(f); +} +exports.Field = Field; +function FpSqrtOdd(Fp, elm) { + if (!Fp.isOdd) + throw new Error(`Field doesn't have isOdd`); + const root = Fp.sqrt(elm); + return Fp.isOdd(root) ? root : Fp.neg(root); +} +exports.FpSqrtOdd = FpSqrtOdd; +function FpSqrtEven(Fp, elm) { + if (!Fp.isOdd) + throw new Error(`Field doesn't have isOdd`); + const root = Fp.sqrt(elm); + return Fp.isOdd(root) ? Fp.neg(root) : root; +} +exports.FpSqrtEven = FpSqrtEven; +/** + * "Constant-time" private key generation utility. + * Same as mapKeyToField, but accepts less bytes (40 instead of 48 for 32-byte field). + * Which makes it slightly more biased, less secure. + * @deprecated use mapKeyToField instead + */ +function hashToPrivateScalar(hash, groupOrder, isLE = false) { + hash = (0, utils_js_1.ensureBytes)('privateHash', hash); + const hashLen = hash.length; + const minLen = nLength(groupOrder).nByteLength + 8; + if (minLen < 24 || hashLen < minLen || hashLen > 1024) + throw new Error(`hashToPrivateScalar: expected ${minLen}-1024 bytes of input, got ${hashLen}`); + const num = isLE ? (0, utils_js_1.bytesToNumberLE)(hash) : (0, utils_js_1.bytesToNumberBE)(hash); + return mod(num, groupOrder - _1n) + _1n; +} +exports.hashToPrivateScalar = hashToPrivateScalar; +/** + * Returns total number of bytes consumed by the field element. + * For example, 32 bytes for usual 256-bit weierstrass curve. + * @param fieldOrder number of field elements, usually CURVE.n + * @returns byte length of field + */ +function getFieldBytesLength(fieldOrder) { + if (typeof fieldOrder !== 'bigint') + throw new Error('field order must be bigint'); + const bitLength = fieldOrder.toString(2).length; + return Math.ceil(bitLength / 8); +} +exports.getFieldBytesLength = getFieldBytesLength; +/** + * Returns minimal amount of bytes that can be safely reduced + * by field order. + * Should be 2^-128 for 128-bit curve such as P256. + * @param fieldOrder number of field elements, usually CURVE.n + * @returns byte length of target hash + */ +function getMinHashLength(fieldOrder) { + const length = getFieldBytesLength(fieldOrder); + return length + Math.ceil(length / 2); +} +exports.getMinHashLength = getMinHashLength; +/** + * "Constant-time" private key generation utility. + * Can take (n + n/2) or more bytes of uniform input e.g. from CSPRNG or KDF + * and convert them into private scalar, with the modulo bias being negligible. + * Needs at least 48 bytes of input for 32-byte private key. + * https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/ + * FIPS 186-5, A.2 https://csrc.nist.gov/publications/detail/fips/186/5/final + * RFC 9380, https://www.rfc-editor.org/rfc/rfc9380#section-5 + * @param hash hash output from SHA3 or a similar function + * @param groupOrder size of subgroup - (e.g. secp256k1.CURVE.n) + * @param isLE interpret hash bytes as LE num + * @returns valid private scalar + */ +function mapHashToField(key, fieldOrder, isLE = false) { + const len = key.length; + const fieldLen = getFieldBytesLength(fieldOrder); + const minLen = getMinHashLength(fieldOrder); + // No small numbers: need to understand bias story. No huge numbers: easier to detect JS timings. + if (len < 16 || len < minLen || len > 1024) + throw new Error(`expected ${minLen}-1024 bytes of input, got ${len}`); + const num = isLE ? (0, utils_js_1.bytesToNumberBE)(key) : (0, utils_js_1.bytesToNumberLE)(key); + // `mod(x, 11)` can sometimes produce 0. `mod(x, 10) + 1` is the same, but no 0 + const reduced = mod(num, fieldOrder - _1n) + _1n; + return isLE ? (0, utils_js_1.numberToBytesLE)(reduced, fieldLen) : (0, utils_js_1.numberToBytesBE)(reduced, fieldLen); +} +exports.mapHashToField = mapHashToField; +//# sourceMappingURL=modular.js.map + +/***/ }), + +/***/ 91484: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.validateObject = exports.createHmacDrbg = exports.bitMask = exports.bitSet = exports.bitGet = exports.bitLen = exports.utf8ToBytes = exports.equalBytes = exports.concatBytes = exports.ensureBytes = exports.numberToVarBytesBE = exports.numberToBytesLE = exports.numberToBytesBE = exports.bytesToNumberLE = exports.bytesToNumberBE = exports.hexToBytes = exports.hexToNumber = exports.numberToHexUnpadded = exports.bytesToHex = void 0; +/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +// 100 lines of code in the file are duplicated from noble-hashes (utils). +// This is OK: `abstract` directory does not use noble-hashes. +// User may opt-in into using different hashing library. This way, noble-hashes +// won't be included into their bundle. +const _0n = BigInt(0); +const _1n = BigInt(1); +const _2n = BigInt(2); +const u8a = (a) => a instanceof Uint8Array; +const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0')); +/** + * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' + */ +function bytesToHex(bytes) { + if (!u8a(bytes)) + throw new Error('Uint8Array expected'); + // pre-caching improves the speed 6x + let hex = ''; + for (let i = 0; i < bytes.length; i++) { + hex += hexes[bytes[i]]; + } + return hex; +} +exports.bytesToHex = bytesToHex; +function numberToHexUnpadded(num) { + const hex = num.toString(16); + return hex.length & 1 ? `0${hex}` : hex; +} +exports.numberToHexUnpadded = numberToHexUnpadded; +function hexToNumber(hex) { + if (typeof hex !== 'string') + throw new Error('hex string expected, got ' + typeof hex); + // Big Endian + return BigInt(hex === '' ? '0' : `0x${hex}`); +} +exports.hexToNumber = hexToNumber; +/** + * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) + */ +function hexToBytes(hex) { + if (typeof hex !== 'string') + throw new Error('hex string expected, got ' + typeof hex); + const len = hex.length; + if (len % 2) + throw new Error('padded hex string expected, got unpadded hex of length ' + len); + const array = new Uint8Array(len / 2); + for (let i = 0; i < array.length; i++) { + const j = i * 2; + const hexByte = hex.slice(j, j + 2); + const byte = Number.parseInt(hexByte, 16); + if (Number.isNaN(byte) || byte < 0) + throw new Error('Invalid byte sequence'); + array[i] = byte; + } + return array; +} +exports.hexToBytes = hexToBytes; +// BE: Big Endian, LE: Little Endian +function bytesToNumberBE(bytes) { + return hexToNumber(bytesToHex(bytes)); +} +exports.bytesToNumberBE = bytesToNumberBE; +function bytesToNumberLE(bytes) { + if (!u8a(bytes)) + throw new Error('Uint8Array expected'); + return hexToNumber(bytesToHex(Uint8Array.from(bytes).reverse())); +} +exports.bytesToNumberLE = bytesToNumberLE; +function numberToBytesBE(n, len) { + return hexToBytes(n.toString(16).padStart(len * 2, '0')); +} +exports.numberToBytesBE = numberToBytesBE; +function numberToBytesLE(n, len) { + return numberToBytesBE(n, len).reverse(); +} +exports.numberToBytesLE = numberToBytesLE; +// Unpadded, rarely used +function numberToVarBytesBE(n) { + return hexToBytes(numberToHexUnpadded(n)); +} +exports.numberToVarBytesBE = numberToVarBytesBE; +/** + * Takes hex string or Uint8Array, converts to Uint8Array. + * Validates output length. + * Will throw error for other types. + * @param title descriptive title for an error e.g. 'private key' + * @param hex hex string or Uint8Array + * @param expectedLength optional, will compare to result array's length + * @returns + */ +function ensureBytes(title, hex, expectedLength) { + let res; + if (typeof hex === 'string') { + try { + res = hexToBytes(hex); + } + catch (e) { + throw new Error(`${title} must be valid hex string, got "${hex}". Cause: ${e}`); + } + } + else if (u8a(hex)) { + // Uint8Array.from() instead of hash.slice() because node.js Buffer + // is instance of Uint8Array, and its slice() creates **mutable** copy + res = Uint8Array.from(hex); + } + else { + throw new Error(`${title} must be hex string or Uint8Array`); + } + const len = res.length; + if (typeof expectedLength === 'number' && len !== expectedLength) + throw new Error(`${title} expected ${expectedLength} bytes, got ${len}`); + return res; +} +exports.ensureBytes = ensureBytes; +/** + * Copies several Uint8Arrays into one. + */ +function concatBytes(...arrays) { + const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0)); + let pad = 0; // walk through each item, ensure they have proper type + arrays.forEach((a) => { + if (!u8a(a)) + throw new Error('Uint8Array expected'); + r.set(a, pad); + pad += a.length; + }); + return r; +} +exports.concatBytes = concatBytes; +function equalBytes(b1, b2) { + // We don't care about timing attacks here + if (b1.length !== b2.length) + return false; + for (let i = 0; i < b1.length; i++) + if (b1[i] !== b2[i]) + return false; + return true; +} +exports.equalBytes = equalBytes; +/** + * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) + */ +function utf8ToBytes(str) { + if (typeof str !== 'string') + throw new Error(`utf8ToBytes expected string, got ${typeof str}`); + return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 +} +exports.utf8ToBytes = utf8ToBytes; +// Bit operations +/** + * Calculates amount of bits in a bigint. + * Same as `n.toString(2).length` + */ +function bitLen(n) { + let len; + for (len = 0; n > _0n; n >>= _1n, len += 1) + ; + return len; +} +exports.bitLen = bitLen; +/** + * Gets single bit at position. + * NOTE: first bit position is 0 (same as arrays) + * Same as `!!+Array.from(n.toString(2)).reverse()[pos]` + */ +function bitGet(n, pos) { + return (n >> BigInt(pos)) & _1n; +} +exports.bitGet = bitGet; +/** + * Sets single bit at position. + */ +const bitSet = (n, pos, value) => { + return n | ((value ? _1n : _0n) << BigInt(pos)); +}; +exports.bitSet = bitSet; +/** + * Calculate mask for N bits. Not using ** operator with bigints because of old engines. + * Same as BigInt(`0b${Array(i).fill('1').join('')}`) + */ +const bitMask = (n) => (_2n << BigInt(n - 1)) - _1n; +exports.bitMask = bitMask; +// DRBG +const u8n = (data) => new Uint8Array(data); // creates Uint8Array +const u8fr = (arr) => Uint8Array.from(arr); // another shortcut +/** + * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs. + * @returns function that will call DRBG until 2nd arg returns something meaningful + * @example + * const drbg = createHmacDRBG(32, 32, hmac); + * drbg(seed, bytesToKey); // bytesToKey must return Key or undefined + */ +function createHmacDrbg(hashLen, qByteLen, hmacFn) { + if (typeof hashLen !== 'number' || hashLen < 2) + throw new Error('hashLen must be a number'); + if (typeof qByteLen !== 'number' || qByteLen < 2) + throw new Error('qByteLen must be a number'); + if (typeof hmacFn !== 'function') + throw new Error('hmacFn must be a function'); + // Step B, Step C: set hashLen to 8*ceil(hlen/8) + let v = u8n(hashLen); // Minimal non-full-spec HMAC-DRBG from NIST 800-90 for RFC6979 sigs. + let k = u8n(hashLen); // Steps B and C of RFC6979 3.2: set hashLen, in our case always same + let i = 0; // Iterations counter, will throw when over 1000 + const reset = () => { + v.fill(1); + k.fill(0); + i = 0; + }; + const h = (...b) => hmacFn(k, v, ...b); // hmac(k)(v, ...values) + const reseed = (seed = u8n()) => { + // HMAC-DRBG reseed() function. Steps D-G + k = h(u8fr([0x00]), seed); // k = hmac(k || v || 0x00 || seed) + v = h(); // v = hmac(k || v) + if (seed.length === 0) + return; + k = h(u8fr([0x01]), seed); // k = hmac(k || v || 0x01 || seed) + v = h(); // v = hmac(k || v) + }; + const gen = () => { + // HMAC-DRBG generate() function + if (i++ >= 1000) + throw new Error('drbg: tried 1000 values'); + let len = 0; + const out = []; + while (len < qByteLen) { + v = h(); + const sl = v.slice(); + out.push(sl); + len += v.length; + } + return concatBytes(...out); + }; + const genUntil = (seed, pred) => { + reset(); + reseed(seed); // Steps D-G + let res = undefined; // Step H: grind until k is in [1..n-1] + while (!(res = pred(gen()))) + reseed(); + reset(); + return res; + }; + return genUntil; +} +exports.createHmacDrbg = createHmacDrbg; +// Validating curves and fields +const validatorFns = { + bigint: (val) => typeof val === 'bigint', + function: (val) => typeof val === 'function', + boolean: (val) => typeof val === 'boolean', + string: (val) => typeof val === 'string', + stringOrUint8Array: (val) => typeof val === 'string' || val instanceof Uint8Array, + isSafeInteger: (val) => Number.isSafeInteger(val), + array: (val) => Array.isArray(val), + field: (val, object) => object.Fp.isValid(val), + hash: (val) => typeof val === 'function' && Number.isSafeInteger(val.outputLen), +}; +// type Record = { [P in K]: T; } +function validateObject(object, validators, optValidators = {}) { + const checkField = (fieldName, type, isOptional) => { + const checkVal = validatorFns[type]; + if (typeof checkVal !== 'function') + throw new Error(`Invalid validator "${type}", expected function`); + const val = object[fieldName]; + if (isOptional && val === undefined) + return; + if (!checkVal(val, object)) { + throw new Error(`Invalid param ${String(fieldName)}=${val} (${typeof val}), expected ${type}`); + } + }; + for (const [fieldName, type] of Object.entries(validators)) + checkField(fieldName, type, false); + for (const [fieldName, type] of Object.entries(optValidators)) + checkField(fieldName, type, true); + return object; +} +exports.validateObject = validateObject; +// validate type tests +// const o: { a: number; b: number; c: number } = { a: 1, b: 5, c: 6 }; +// const z0 = validateObject(o, { a: 'isSafeInteger' }, { c: 'bigint' }); // Ok! +// // Should fail type-check +// const z1 = validateObject(o, { a: 'tmp' }, { c: 'zz' }); +// const z2 = validateObject(o, { a: 'isSafeInteger' }, { c: 'zz' }); +// const z3 = validateObject(o, { test: 'boolean', z: 'bug' }); +// const z4 = validateObject(o, { a: 'boolean', z: 'bug' }); +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 91705: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.mapToCurveSimpleSWU = exports.SWUFpSqrtRatio = exports.weierstrass = exports.weierstrassPoints = exports.DER = void 0; +/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +// Short Weierstrass curve. The formula is: y² = x³ + ax + b +const mod = __webpack_require__(24967); +const ut = __webpack_require__(91484); +const utils_js_1 = __webpack_require__(91484); +const curve_js_1 = __webpack_require__(62422); +function validatePointOpts(curve) { + const opts = (0, curve_js_1.validateBasic)(curve); + ut.validateObject(opts, { + a: 'field', + b: 'field', + }, { + allowedPrivateKeyLengths: 'array', + wrapPrivateKey: 'boolean', + isTorsionFree: 'function', + clearCofactor: 'function', + allowInfinityPoint: 'boolean', + fromBytes: 'function', + toBytes: 'function', + }); + const { endo, Fp, a } = opts; + if (endo) { + if (!Fp.eql(a, Fp.ZERO)) { + throw new Error('Endomorphism can only be defined for Koblitz curves that have a=0'); + } + if (typeof endo !== 'object' || + typeof endo.beta !== 'bigint' || + typeof endo.splitScalar !== 'function') { + throw new Error('Expected endomorphism with beta: bigint and splitScalar: function'); + } + } + return Object.freeze({ ...opts }); +} +// ASN.1 DER encoding utilities +const { bytesToNumberBE: b2n, hexToBytes: h2b } = ut; +exports.DER = { + // asn.1 DER encoding utils + Err: class DERErr extends Error { + constructor(m = '') { + super(m); + } + }, + _parseInt(data) { + const { Err: E } = exports.DER; + if (data.length < 2 || data[0] !== 0x02) + throw new E('Invalid signature integer tag'); + const len = data[1]; + const res = data.subarray(2, len + 2); + if (!len || res.length !== len) + throw new E('Invalid signature integer: wrong length'); + // https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag, + // since we always use positive integers here. It must always be empty: + // - add zero byte if exists + // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding) + if (res[0] & 0b10000000) + throw new E('Invalid signature integer: negative'); + if (res[0] === 0x00 && !(res[1] & 0b10000000)) + throw new E('Invalid signature integer: unnecessary leading zero'); + return { d: b2n(res), l: data.subarray(len + 2) }; // d is data, l is left + }, + toSig(hex) { + // parse DER signature + const { Err: E } = exports.DER; + const data = typeof hex === 'string' ? h2b(hex) : hex; + if (!(data instanceof Uint8Array)) + throw new Error('ui8a expected'); + let l = data.length; + if (l < 2 || data[0] != 0x30) + throw new E('Invalid signature tag'); + if (data[1] !== l - 2) + throw new E('Invalid signature: incorrect length'); + const { d: r, l: sBytes } = exports.DER._parseInt(data.subarray(2)); + const { d: s, l: rBytesLeft } = exports.DER._parseInt(sBytes); + if (rBytesLeft.length) + throw new E('Invalid signature: left bytes after parsing'); + return { r, s }; + }, + hexFromSig(sig) { + // Add leading zero if first byte has negative bit enabled. More details in '_parseInt' + const slice = (s) => (Number.parseInt(s[0], 16) & 0b1000 ? '00' + s : s); + const h = (num) => { + const hex = num.toString(16); + return hex.length & 1 ? `0${hex}` : hex; + }; + const s = slice(h(sig.s)); + const r = slice(h(sig.r)); + const shl = s.length / 2; + const rhl = r.length / 2; + const sl = h(shl); + const rl = h(rhl); + return `30${h(rhl + shl + 4)}02${rl}${r}02${sl}${s}`; + }, +}; +// Be friendly to bad ECMAScript parsers by not using bigint literals +// prettier-ignore +const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4); +function weierstrassPoints(opts) { + const CURVE = validatePointOpts(opts); + const { Fp } = CURVE; // All curves has same field / group length as for now, but they can differ + const toBytes = CURVE.toBytes || + ((_c, point, _isCompressed) => { + const a = point.toAffine(); + return ut.concatBytes(Uint8Array.from([0x04]), Fp.toBytes(a.x), Fp.toBytes(a.y)); + }); + const fromBytes = CURVE.fromBytes || + ((bytes) => { + // const head = bytes[0]; + const tail = bytes.subarray(1); + // if (head !== 0x04) throw new Error('Only non-compressed encoding is supported'); + const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES)); + const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES)); + return { x, y }; + }); + /** + * y² = x³ + ax + b: Short weierstrass curve formula + * @returns y² + */ + function weierstrassEquation(x) { + const { a, b } = CURVE; + const x2 = Fp.sqr(x); // x * x + const x3 = Fp.mul(x2, x); // x2 * x + return Fp.add(Fp.add(x3, Fp.mul(x, a)), b); // x3 + a * x + b + } + // Validate whether the passed curve params are valid. + // We check if curve equation works for generator point. + // `assertValidity()` won't work: `isTorsionFree()` is not available at this point in bls12-381. + // ProjectivePoint class has not been initialized yet. + if (!Fp.eql(Fp.sqr(CURVE.Gy), weierstrassEquation(CURVE.Gx))) + throw new Error('bad generator point: equation left != right'); + // Valid group elements reside in range 1..n-1 + function isWithinCurveOrder(num) { + return typeof num === 'bigint' && _0n < num && num < CURVE.n; + } + function assertGE(num) { + if (!isWithinCurveOrder(num)) + throw new Error('Expected valid bigint: 0 < bigint < curve.n'); + } + // Validates if priv key is valid and converts it to bigint. + // Supports options allowedPrivateKeyLengths and wrapPrivateKey. + function normPrivateKeyToScalar(key) { + const { allowedPrivateKeyLengths: lengths, nByteLength, wrapPrivateKey, n } = CURVE; + if (lengths && typeof key !== 'bigint') { + if (key instanceof Uint8Array) + key = ut.bytesToHex(key); + // Normalize to hex string, pad. E.g. P521 would norm 130-132 char hex to 132-char bytes + if (typeof key !== 'string' || !lengths.includes(key.length)) + throw new Error('Invalid key'); + key = key.padStart(nByteLength * 2, '0'); + } + let num; + try { + num = + typeof key === 'bigint' + ? key + : ut.bytesToNumberBE((0, utils_js_1.ensureBytes)('private key', key, nByteLength)); + } + catch (error) { + throw new Error(`private key must be ${nByteLength} bytes, hex or bigint, not ${typeof key}`); + } + if (wrapPrivateKey) + num = mod.mod(num, n); // disabled by default, enabled for BLS + assertGE(num); // num in range [1..N-1] + return num; + } + const pointPrecomputes = new Map(); + function assertPrjPoint(other) { + if (!(other instanceof Point)) + throw new Error('ProjectivePoint expected'); + } + /** + * Projective Point works in 3d / projective (homogeneous) coordinates: (x, y, z) ∋ (x=x/z, y=y/z) + * Default Point works in 2d / affine coordinates: (x, y) + * We're doing calculations in projective, because its operations don't require costly inversion. + */ + class Point { + constructor(px, py, pz) { + this.px = px; + this.py = py; + this.pz = pz; + if (px == null || !Fp.isValid(px)) + throw new Error('x required'); + if (py == null || !Fp.isValid(py)) + throw new Error('y required'); + if (pz == null || !Fp.isValid(pz)) + throw new Error('z required'); + } + // Does not validate if the point is on-curve. + // Use fromHex instead, or call assertValidity() later. + static fromAffine(p) { + const { x, y } = p || {}; + if (!p || !Fp.isValid(x) || !Fp.isValid(y)) + throw new Error('invalid affine point'); + if (p instanceof Point) + throw new Error('projective point not allowed'); + const is0 = (i) => Fp.eql(i, Fp.ZERO); + // fromAffine(x:0, y:0) would produce (x:0, y:0, z:1), but we need (x:0, y:1, z:0) + if (is0(x) && is0(y)) + return Point.ZERO; + return new Point(x, y, Fp.ONE); + } + get x() { + return this.toAffine().x; + } + get y() { + return this.toAffine().y; + } + /** + * Takes a bunch of Projective Points but executes only one + * inversion on all of them. Inversion is very slow operation, + * so this improves performance massively. + * Optimization: converts a list of projective points to a list of identical points with Z=1. + */ + static normalizeZ(points) { + const toInv = Fp.invertBatch(points.map((p) => p.pz)); + return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine); + } + /** + * Converts hash string or Uint8Array to Point. + * @param hex short/long ECDSA hex + */ + static fromHex(hex) { + const P = Point.fromAffine(fromBytes((0, utils_js_1.ensureBytes)('pointHex', hex))); + P.assertValidity(); + return P; + } + // Multiplies generator point by privateKey. + static fromPrivateKey(privateKey) { + return Point.BASE.multiply(normPrivateKeyToScalar(privateKey)); + } + // "Private method", don't use it directly + _setWindowSize(windowSize) { + this._WINDOW_SIZE = windowSize; + pointPrecomputes.delete(this); + } + // A point on curve is valid if it conforms to equation. + assertValidity() { + if (this.is0()) { + // (0, 1, 0) aka ZERO is invalid in most contexts. + // In BLS, ZERO can be serialized, so we allow it. + // (0, 0, 0) is wrong representation of ZERO and is always invalid. + if (CURVE.allowInfinityPoint && !Fp.is0(this.py)) + return; + throw new Error('bad point: ZERO'); + } + // Some 3rd-party test vectors require different wording between here & `fromCompressedHex` + const { x, y } = this.toAffine(); + // Check if x, y are valid field elements + if (!Fp.isValid(x) || !Fp.isValid(y)) + throw new Error('bad point: x or y not FE'); + const left = Fp.sqr(y); // y² + const right = weierstrassEquation(x); // x³ + ax + b + if (!Fp.eql(left, right)) + throw new Error('bad point: equation left != right'); + if (!this.isTorsionFree()) + throw new Error('bad point: not in prime-order subgroup'); + } + hasEvenY() { + const { y } = this.toAffine(); + if (Fp.isOdd) + return !Fp.isOdd(y); + throw new Error("Field doesn't support isOdd"); + } + /** + * Compare one point to another. + */ + equals(other) { + assertPrjPoint(other); + const { px: X1, py: Y1, pz: Z1 } = this; + const { px: X2, py: Y2, pz: Z2 } = other; + const U1 = Fp.eql(Fp.mul(X1, Z2), Fp.mul(X2, Z1)); + const U2 = Fp.eql(Fp.mul(Y1, Z2), Fp.mul(Y2, Z1)); + return U1 && U2; + } + /** + * Flips point to one corresponding to (x, -y) in Affine coordinates. + */ + negate() { + return new Point(this.px, Fp.neg(this.py), this.pz); + } + // Renes-Costello-Batina exception-free doubling formula. + // There is 30% faster Jacobian formula, but it is not complete. + // https://eprint.iacr.org/2015/1060, algorithm 3 + // Cost: 8M + 3S + 3*a + 2*b3 + 15add. + double() { + const { a, b } = CURVE; + const b3 = Fp.mul(b, _3n); + const { px: X1, py: Y1, pz: Z1 } = this; + let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore + let t0 = Fp.mul(X1, X1); // step 1 + let t1 = Fp.mul(Y1, Y1); + let t2 = Fp.mul(Z1, Z1); + let t3 = Fp.mul(X1, Y1); + t3 = Fp.add(t3, t3); // step 5 + Z3 = Fp.mul(X1, Z1); + Z3 = Fp.add(Z3, Z3); + X3 = Fp.mul(a, Z3); + Y3 = Fp.mul(b3, t2); + Y3 = Fp.add(X3, Y3); // step 10 + X3 = Fp.sub(t1, Y3); + Y3 = Fp.add(t1, Y3); + Y3 = Fp.mul(X3, Y3); + X3 = Fp.mul(t3, X3); + Z3 = Fp.mul(b3, Z3); // step 15 + t2 = Fp.mul(a, t2); + t3 = Fp.sub(t0, t2); + t3 = Fp.mul(a, t3); + t3 = Fp.add(t3, Z3); + Z3 = Fp.add(t0, t0); // step 20 + t0 = Fp.add(Z3, t0); + t0 = Fp.add(t0, t2); + t0 = Fp.mul(t0, t3); + Y3 = Fp.add(Y3, t0); + t2 = Fp.mul(Y1, Z1); // step 25 + t2 = Fp.add(t2, t2); + t0 = Fp.mul(t2, t3); + X3 = Fp.sub(X3, t0); + Z3 = Fp.mul(t2, t1); + Z3 = Fp.add(Z3, Z3); // step 30 + Z3 = Fp.add(Z3, Z3); + return new Point(X3, Y3, Z3); + } + // Renes-Costello-Batina exception-free addition formula. + // There is 30% faster Jacobian formula, but it is not complete. + // https://eprint.iacr.org/2015/1060, algorithm 1 + // Cost: 12M + 0S + 3*a + 3*b3 + 23add. + add(other) { + assertPrjPoint(other); + const { px: X1, py: Y1, pz: Z1 } = this; + const { px: X2, py: Y2, pz: Z2 } = other; + let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore + const a = CURVE.a; + const b3 = Fp.mul(CURVE.b, _3n); + let t0 = Fp.mul(X1, X2); // step 1 + let t1 = Fp.mul(Y1, Y2); + let t2 = Fp.mul(Z1, Z2); + let t3 = Fp.add(X1, Y1); + let t4 = Fp.add(X2, Y2); // step 5 + t3 = Fp.mul(t3, t4); + t4 = Fp.add(t0, t1); + t3 = Fp.sub(t3, t4); + t4 = Fp.add(X1, Z1); + let t5 = Fp.add(X2, Z2); // step 10 + t4 = Fp.mul(t4, t5); + t5 = Fp.add(t0, t2); + t4 = Fp.sub(t4, t5); + t5 = Fp.add(Y1, Z1); + X3 = Fp.add(Y2, Z2); // step 15 + t5 = Fp.mul(t5, X3); + X3 = Fp.add(t1, t2); + t5 = Fp.sub(t5, X3); + Z3 = Fp.mul(a, t4); + X3 = Fp.mul(b3, t2); // step 20 + Z3 = Fp.add(X3, Z3); + X3 = Fp.sub(t1, Z3); + Z3 = Fp.add(t1, Z3); + Y3 = Fp.mul(X3, Z3); + t1 = Fp.add(t0, t0); // step 25 + t1 = Fp.add(t1, t0); + t2 = Fp.mul(a, t2); + t4 = Fp.mul(b3, t4); + t1 = Fp.add(t1, t2); + t2 = Fp.sub(t0, t2); // step 30 + t2 = Fp.mul(a, t2); + t4 = Fp.add(t4, t2); + t0 = Fp.mul(t1, t4); + Y3 = Fp.add(Y3, t0); + t0 = Fp.mul(t5, t4); // step 35 + X3 = Fp.mul(t3, X3); + X3 = Fp.sub(X3, t0); + t0 = Fp.mul(t3, t1); + Z3 = Fp.mul(t5, Z3); + Z3 = Fp.add(Z3, t0); // step 40 + return new Point(X3, Y3, Z3); + } + subtract(other) { + return this.add(other.negate()); + } + is0() { + return this.equals(Point.ZERO); + } + wNAF(n) { + return wnaf.wNAFCached(this, pointPrecomputes, n, (comp) => { + const toInv = Fp.invertBatch(comp.map((p) => p.pz)); + return comp.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine); + }); + } + /** + * Non-constant-time multiplication. Uses double-and-add algorithm. + * It's faster, but should only be used when you don't care about + * an exposed private key e.g. sig verification, which works over *public* keys. + */ + multiplyUnsafe(n) { + const I = Point.ZERO; + if (n === _0n) + return I; + assertGE(n); // Will throw on 0 + if (n === _1n) + return this; + const { endo } = CURVE; + if (!endo) + return wnaf.unsafeLadder(this, n); + // Apply endomorphism + let { k1neg, k1, k2neg, k2 } = endo.splitScalar(n); + let k1p = I; + let k2p = I; + let d = this; + while (k1 > _0n || k2 > _0n) { + if (k1 & _1n) + k1p = k1p.add(d); + if (k2 & _1n) + k2p = k2p.add(d); + d = d.double(); + k1 >>= _1n; + k2 >>= _1n; + } + if (k1neg) + k1p = k1p.negate(); + if (k2neg) + k2p = k2p.negate(); + k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz); + return k1p.add(k2p); + } + /** + * Constant time multiplication. + * Uses wNAF method. Windowed method may be 10% faster, + * but takes 2x longer to generate and consumes 2x memory. + * Uses precomputes when available. + * Uses endomorphism for Koblitz curves. + * @param scalar by which the point would be multiplied + * @returns New point + */ + multiply(scalar) { + assertGE(scalar); + let n = scalar; + let point, fake; // Fake point is used to const-time mult + const { endo } = CURVE; + if (endo) { + const { k1neg, k1, k2neg, k2 } = endo.splitScalar(n); + let { p: k1p, f: f1p } = this.wNAF(k1); + let { p: k2p, f: f2p } = this.wNAF(k2); + k1p = wnaf.constTimeNegate(k1neg, k1p); + k2p = wnaf.constTimeNegate(k2neg, k2p); + k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz); + point = k1p.add(k2p); + fake = f1p.add(f2p); + } + else { + const { p, f } = this.wNAF(n); + point = p; + fake = f; + } + // Normalize `z` for both points, but return only real one + return Point.normalizeZ([point, fake])[0]; + } + /** + * Efficiently calculate `aP + bQ`. Unsafe, can expose private key, if used incorrectly. + * Not using Strauss-Shamir trick: precomputation tables are faster. + * The trick could be useful if both P and Q are not G (not in our case). + * @returns non-zero affine point + */ + multiplyAndAddUnsafe(Q, a, b) { + const G = Point.BASE; // No Strauss-Shamir trick: we have 10% faster G precomputes + const mul = (P, a // Select faster multiply() method + ) => (a === _0n || a === _1n || !P.equals(G) ? P.multiplyUnsafe(a) : P.multiply(a)); + const sum = mul(this, a).add(mul(Q, b)); + return sum.is0() ? undefined : sum; + } + // Converts Projective point to affine (x, y) coordinates. + // Can accept precomputed Z^-1 - for example, from invertBatch. + // (x, y, z) ∋ (x=x/z, y=y/z) + toAffine(iz) { + const { px: x, py: y, pz: z } = this; + const is0 = this.is0(); + // If invZ was 0, we return zero point. However we still want to execute + // all operations, so we replace invZ with a random number, 1. + if (iz == null) + iz = is0 ? Fp.ONE : Fp.inv(z); + const ax = Fp.mul(x, iz); + const ay = Fp.mul(y, iz); + const zz = Fp.mul(z, iz); + if (is0) + return { x: Fp.ZERO, y: Fp.ZERO }; + if (!Fp.eql(zz, Fp.ONE)) + throw new Error('invZ was invalid'); + return { x: ax, y: ay }; + } + isTorsionFree() { + const { h: cofactor, isTorsionFree } = CURVE; + if (cofactor === _1n) + return true; // No subgroups, always torsion-free + if (isTorsionFree) + return isTorsionFree(Point, this); + throw new Error('isTorsionFree() has not been declared for the elliptic curve'); + } + clearCofactor() { + const { h: cofactor, clearCofactor } = CURVE; + if (cofactor === _1n) + return this; // Fast-path + if (clearCofactor) + return clearCofactor(Point, this); + return this.multiplyUnsafe(CURVE.h); + } + toRawBytes(isCompressed = true) { + this.assertValidity(); + return toBytes(Point, this, isCompressed); + } + toHex(isCompressed = true) { + return ut.bytesToHex(this.toRawBytes(isCompressed)); + } + } + Point.BASE = new Point(CURVE.Gx, CURVE.Gy, Fp.ONE); + Point.ZERO = new Point(Fp.ZERO, Fp.ONE, Fp.ZERO); + const _bits = CURVE.nBitLength; + const wnaf = (0, curve_js_1.wNAF)(Point, CURVE.endo ? Math.ceil(_bits / 2) : _bits); + // Validate if generator point is on curve + return { + CURVE, + ProjectivePoint: Point, + normPrivateKeyToScalar, + weierstrassEquation, + isWithinCurveOrder, + }; +} +exports.weierstrassPoints = weierstrassPoints; +function validateOpts(curve) { + const opts = (0, curve_js_1.validateBasic)(curve); + ut.validateObject(opts, { + hash: 'hash', + hmac: 'function', + randomBytes: 'function', + }, { + bits2int: 'function', + bits2int_modN: 'function', + lowS: 'boolean', + }); + return Object.freeze({ lowS: true, ...opts }); +} +function weierstrass(curveDef) { + const CURVE = validateOpts(curveDef); + const { Fp, n: CURVE_ORDER } = CURVE; + const compressedLen = Fp.BYTES + 1; // e.g. 33 for 32 + const uncompressedLen = 2 * Fp.BYTES + 1; // e.g. 65 for 32 + function isValidFieldElement(num) { + return _0n < num && num < Fp.ORDER; // 0 is banned since it's not invertible FE + } + function modN(a) { + return mod.mod(a, CURVE_ORDER); + } + function invN(a) { + return mod.invert(a, CURVE_ORDER); + } + const { ProjectivePoint: Point, normPrivateKeyToScalar, weierstrassEquation, isWithinCurveOrder, } = weierstrassPoints({ + ...CURVE, + toBytes(_c, point, isCompressed) { + const a = point.toAffine(); + const x = Fp.toBytes(a.x); + const cat = ut.concatBytes; + if (isCompressed) { + return cat(Uint8Array.from([point.hasEvenY() ? 0x02 : 0x03]), x); + } + else { + return cat(Uint8Array.from([0x04]), x, Fp.toBytes(a.y)); + } + }, + fromBytes(bytes) { + const len = bytes.length; + const head = bytes[0]; + const tail = bytes.subarray(1); + // this.assertValidity() is done inside of fromHex + if (len === compressedLen && (head === 0x02 || head === 0x03)) { + const x = ut.bytesToNumberBE(tail); + if (!isValidFieldElement(x)) + throw new Error('Point is not on curve'); + const y2 = weierstrassEquation(x); // y² = x³ + ax + b + let y = Fp.sqrt(y2); // y = y² ^ (p+1)/4 + const isYOdd = (y & _1n) === _1n; + // ECDSA + const isHeadOdd = (head & 1) === 1; + if (isHeadOdd !== isYOdd) + y = Fp.neg(y); + return { x, y }; + } + else if (len === uncompressedLen && head === 0x04) { + const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES)); + const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES)); + return { x, y }; + } + else { + throw new Error(`Point of length ${len} was invalid. Expected ${compressedLen} compressed bytes or ${uncompressedLen} uncompressed bytes`); + } + }, + }); + const numToNByteStr = (num) => ut.bytesToHex(ut.numberToBytesBE(num, CURVE.nByteLength)); + function isBiggerThanHalfOrder(number) { + const HALF = CURVE_ORDER >> _1n; + return number > HALF; + } + function normalizeS(s) { + return isBiggerThanHalfOrder(s) ? modN(-s) : s; + } + // slice bytes num + const slcNum = (b, from, to) => ut.bytesToNumberBE(b.slice(from, to)); + /** + * ECDSA signature with its (r, s) properties. Supports DER & compact representations. + */ + class Signature { + constructor(r, s, recovery) { + this.r = r; + this.s = s; + this.recovery = recovery; + this.assertValidity(); + } + // pair (bytes of r, bytes of s) + static fromCompact(hex) { + const l = CURVE.nByteLength; + hex = (0, utils_js_1.ensureBytes)('compactSignature', hex, l * 2); + return new Signature(slcNum(hex, 0, l), slcNum(hex, l, 2 * l)); + } + // DER encoded ECDSA signature + // https://bitcoin.stackexchange.com/questions/57644/what-are-the-parts-of-a-bitcoin-transaction-input-script + static fromDER(hex) { + const { r, s } = exports.DER.toSig((0, utils_js_1.ensureBytes)('DER', hex)); + return new Signature(r, s); + } + assertValidity() { + // can use assertGE here + if (!isWithinCurveOrder(this.r)) + throw new Error('r must be 0 < r < CURVE.n'); + if (!isWithinCurveOrder(this.s)) + throw new Error('s must be 0 < s < CURVE.n'); + } + addRecoveryBit(recovery) { + return new Signature(this.r, this.s, recovery); + } + recoverPublicKey(msgHash) { + const { r, s, recovery: rec } = this; + const h = bits2int_modN((0, utils_js_1.ensureBytes)('msgHash', msgHash)); // Truncate hash + if (rec == null || ![0, 1, 2, 3].includes(rec)) + throw new Error('recovery id invalid'); + const radj = rec === 2 || rec === 3 ? r + CURVE.n : r; + if (radj >= Fp.ORDER) + throw new Error('recovery id 2 or 3 invalid'); + const prefix = (rec & 1) === 0 ? '02' : '03'; + const R = Point.fromHex(prefix + numToNByteStr(radj)); + const ir = invN(radj); // r^-1 + const u1 = modN(-h * ir); // -hr^-1 + const u2 = modN(s * ir); // sr^-1 + const Q = Point.BASE.multiplyAndAddUnsafe(R, u1, u2); // (sr^-1)R-(hr^-1)G = -(hr^-1)G + (sr^-1) + if (!Q) + throw new Error('point at infinify'); // unsafe is fine: no priv data leaked + Q.assertValidity(); + return Q; + } + // Signatures should be low-s, to prevent malleability. + hasHighS() { + return isBiggerThanHalfOrder(this.s); + } + normalizeS() { + return this.hasHighS() ? new Signature(this.r, modN(-this.s), this.recovery) : this; + } + // DER-encoded + toDERRawBytes() { + return ut.hexToBytes(this.toDERHex()); + } + toDERHex() { + return exports.DER.hexFromSig({ r: this.r, s: this.s }); + } + // padded bytes of r, then padded bytes of s + toCompactRawBytes() { + return ut.hexToBytes(this.toCompactHex()); + } + toCompactHex() { + return numToNByteStr(this.r) + numToNByteStr(this.s); + } + } + const utils = { + isValidPrivateKey(privateKey) { + try { + normPrivateKeyToScalar(privateKey); + return true; + } + catch (error) { + return false; + } + }, + normPrivateKeyToScalar: normPrivateKeyToScalar, + /** + * Produces cryptographically secure private key from random of size + * (groupLen + ceil(groupLen / 2)) with modulo bias being negligible. + */ + randomPrivateKey: () => { + const length = mod.getMinHashLength(CURVE.n); + return mod.mapHashToField(CURVE.randomBytes(length), CURVE.n); + }, + /** + * Creates precompute table for an arbitrary EC point. Makes point "cached". + * Allows to massively speed-up `point.multiply(scalar)`. + * @returns cached point + * @example + * const fast = utils.precompute(8, ProjectivePoint.fromHex(someonesPubKey)); + * fast.multiply(privKey); // much faster ECDH now + */ + precompute(windowSize = 8, point = Point.BASE) { + point._setWindowSize(windowSize); + point.multiply(BigInt(3)); // 3 is arbitrary, just need any number here + return point; + }, + }; + /** + * Computes public key for a private key. Checks for validity of the private key. + * @param privateKey private key + * @param isCompressed whether to return compact (default), or full key + * @returns Public key, full when isCompressed=false; short when isCompressed=true + */ + function getPublicKey(privateKey, isCompressed = true) { + return Point.fromPrivateKey(privateKey).toRawBytes(isCompressed); + } + /** + * Quick and dirty check for item being public key. Does not validate hex, or being on-curve. + */ + function isProbPub(item) { + const arr = item instanceof Uint8Array; + const str = typeof item === 'string'; + const len = (arr || str) && item.length; + if (arr) + return len === compressedLen || len === uncompressedLen; + if (str) + return len === 2 * compressedLen || len === 2 * uncompressedLen; + if (item instanceof Point) + return true; + return false; + } + /** + * ECDH (Elliptic Curve Diffie Hellman). + * Computes shared public key from private key and public key. + * Checks: 1) private key validity 2) shared key is on-curve. + * Does NOT hash the result. + * @param privateA private key + * @param publicB different public key + * @param isCompressed whether to return compact (default), or full key + * @returns shared public key + */ + function getSharedSecret(privateA, publicB, isCompressed = true) { + if (isProbPub(privateA)) + throw new Error('first arg must be private key'); + if (!isProbPub(publicB)) + throw new Error('second arg must be public key'); + const b = Point.fromHex(publicB); // check for being on-curve + return b.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed); + } + // RFC6979: ensure ECDSA msg is X bytes and < N. RFC suggests optional truncating via bits2octets. + // FIPS 186-4 4.6 suggests the leftmost min(nBitLen, outLen) bits, which matches bits2int. + // bits2int can produce res>N, we can do mod(res, N) since the bitLen is the same. + // int2octets can't be used; pads small msgs with 0: unacceptatble for trunc as per RFC vectors + const bits2int = CURVE.bits2int || + function (bytes) { + // For curves with nBitLength % 8 !== 0: bits2octets(bits2octets(m)) !== bits2octets(m) + // for some cases, since bytes.length * 8 is not actual bitLength. + const num = ut.bytesToNumberBE(bytes); // check for == u8 done here + const delta = bytes.length * 8 - CURVE.nBitLength; // truncate to nBitLength leftmost bits + return delta > 0 ? num >> BigInt(delta) : num; + }; + const bits2int_modN = CURVE.bits2int_modN || + function (bytes) { + return modN(bits2int(bytes)); // can't use bytesToNumberBE here + }; + // NOTE: pads output with zero as per spec + const ORDER_MASK = ut.bitMask(CURVE.nBitLength); + /** + * Converts to bytes. Checks if num in `[0..ORDER_MASK-1]` e.g.: `[0..2^256-1]`. + */ + function int2octets(num) { + if (typeof num !== 'bigint') + throw new Error('bigint expected'); + if (!(_0n <= num && num < ORDER_MASK)) + throw new Error(`bigint expected < 2^${CURVE.nBitLength}`); + // works with order, can have different size than numToField! + return ut.numberToBytesBE(num, CURVE.nByteLength); + } + // Steps A, D of RFC6979 3.2 + // Creates RFC6979 seed; converts msg/privKey to numbers. + // Used only in sign, not in verify. + // NOTE: we cannot assume here that msgHash has same amount of bytes as curve order, this will be wrong at least for P521. + // Also it can be bigger for P224 + SHA256 + function prepSig(msgHash, privateKey, opts = defaultSigOpts) { + if (['recovered', 'canonical'].some((k) => k in opts)) + throw new Error('sign() legacy options not supported'); + const { hash, randomBytes } = CURVE; + let { lowS, prehash, extraEntropy: ent } = opts; // generates low-s sigs by default + if (lowS == null) + lowS = true; // RFC6979 3.2: we skip step A, because we already provide hash + msgHash = (0, utils_js_1.ensureBytes)('msgHash', msgHash); + if (prehash) + msgHash = (0, utils_js_1.ensureBytes)('prehashed msgHash', hash(msgHash)); + // We can't later call bits2octets, since nested bits2int is broken for curves + // with nBitLength % 8 !== 0. Because of that, we unwrap it here as int2octets call. + // const bits2octets = (bits) => int2octets(bits2int_modN(bits)) + const h1int = bits2int_modN(msgHash); + const d = normPrivateKeyToScalar(privateKey); // validate private key, convert to bigint + const seedArgs = [int2octets(d), int2octets(h1int)]; + // extraEntropy. RFC6979 3.6: additional k' (optional). + if (ent != null) { + // K = HMAC_K(V || 0x00 || int2octets(x) || bits2octets(h1) || k') + const e = ent === true ? randomBytes(Fp.BYTES) : ent; // generate random bytes OR pass as-is + seedArgs.push((0, utils_js_1.ensureBytes)('extraEntropy', e)); // check for being bytes + } + const seed = ut.concatBytes(...seedArgs); // Step D of RFC6979 3.2 + const m = h1int; // NOTE: no need to call bits2int second time here, it is inside truncateHash! + // Converts signature params into point w r/s, checks result for validity. + function k2sig(kBytes) { + // RFC 6979 Section 3.2, step 3: k = bits2int(T) + const k = bits2int(kBytes); // Cannot use fields methods, since it is group element + if (!isWithinCurveOrder(k)) + return; // Important: all mod() calls here must be done over N + const ik = invN(k); // k^-1 mod n + const q = Point.BASE.multiply(k).toAffine(); // q = Gk + const r = modN(q.x); // r = q.x mod n + if (r === _0n) + return; + // Can use scalar blinding b^-1(bm + bdr) where b ∈ [1,q−1] according to + // https://tches.iacr.org/index.php/TCHES/article/view/7337/6509. We've decided against it: + // a) dependency on CSPRNG b) 15% slowdown c) doesn't really help since bigints are not CT + const s = modN(ik * modN(m + r * d)); // Not using blinding here + if (s === _0n) + return; + let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n); // recovery bit (2 or 3, when q.x > n) + let normS = s; + if (lowS && isBiggerThanHalfOrder(s)) { + normS = normalizeS(s); // if lowS was passed, ensure s is always + recovery ^= 1; // // in the bottom half of N + } + return new Signature(r, normS, recovery); // use normS, not s + } + return { seed, k2sig }; + } + const defaultSigOpts = { lowS: CURVE.lowS, prehash: false }; + const defaultVerOpts = { lowS: CURVE.lowS, prehash: false }; + /** + * Signs message hash with a private key. + * ``` + * sign(m, d, k) where + * (x, y) = G × k + * r = x mod n + * s = (m + dr)/k mod n + * ``` + * @param msgHash NOT message. msg needs to be hashed to `msgHash`, or use `prehash`. + * @param privKey private key + * @param opts lowS for non-malleable sigs. extraEntropy for mixing randomness into k. prehash will hash first arg. + * @returns signature with recovery param + */ + function sign(msgHash, privKey, opts = defaultSigOpts) { + const { seed, k2sig } = prepSig(msgHash, privKey, opts); // Steps A, D of RFC6979 3.2. + const C = CURVE; + const drbg = ut.createHmacDrbg(C.hash.outputLen, C.nByteLength, C.hmac); + return drbg(seed, k2sig); // Steps B, C, D, E, F, G + } + // Enable precomputes. Slows down first publicKey computation by 20ms. + Point.BASE._setWindowSize(8); + // utils.precompute(8, ProjectivePoint.BASE) + /** + * Verifies a signature against message hash and public key. + * Rejects lowS signatures by default: to override, + * specify option `{lowS: false}`. Implements section 4.1.4 from https://www.secg.org/sec1-v2.pdf: + * + * ``` + * verify(r, s, h, P) where + * U1 = hs^-1 mod n + * U2 = rs^-1 mod n + * R = U1⋅G - U2⋅P + * mod(R.x, n) == r + * ``` + */ + function verify(signature, msgHash, publicKey, opts = defaultVerOpts) { + const sg = signature; + msgHash = (0, utils_js_1.ensureBytes)('msgHash', msgHash); + publicKey = (0, utils_js_1.ensureBytes)('publicKey', publicKey); + if ('strict' in opts) + throw new Error('options.strict was renamed to lowS'); + const { lowS, prehash } = opts; + let _sig = undefined; + let P; + try { + if (typeof sg === 'string' || sg instanceof Uint8Array) { + // Signature can be represented in 2 ways: compact (2*nByteLength) & DER (variable-length). + // Since DER can also be 2*nByteLength bytes, we check for it first. + try { + _sig = Signature.fromDER(sg); + } + catch (derError) { + if (!(derError instanceof exports.DER.Err)) + throw derError; + _sig = Signature.fromCompact(sg); + } + } + else if (typeof sg === 'object' && typeof sg.r === 'bigint' && typeof sg.s === 'bigint') { + const { r, s } = sg; + _sig = new Signature(r, s); + } + else { + throw new Error('PARSE'); + } + P = Point.fromHex(publicKey); + } + catch (error) { + if (error.message === 'PARSE') + throw new Error(`signature must be Signature instance, Uint8Array or hex string`); + return false; + } + if (lowS && _sig.hasHighS()) + return false; + if (prehash) + msgHash = CURVE.hash(msgHash); + const { r, s } = _sig; + const h = bits2int_modN(msgHash); // Cannot use fields methods, since it is group element + const is = invN(s); // s^-1 + const u1 = modN(h * is); // u1 = hs^-1 mod n + const u2 = modN(r * is); // u2 = rs^-1 mod n + const R = Point.BASE.multiplyAndAddUnsafe(P, u1, u2)?.toAffine(); // R = u1⋅G + u2⋅P + if (!R) + return false; + const v = modN(R.x); + return v === r; + } + return { + CURVE, + getPublicKey, + getSharedSecret, + sign, + verify, + ProjectivePoint: Point, + Signature, + utils, + }; +} +exports.weierstrass = weierstrass; +/** + * Implementation of the Shallue and van de Woestijne method for any weierstrass curve. + * TODO: check if there is a way to merge this with uvRatio in Edwards; move to modular. + * b = True and y = sqrt(u / v) if (u / v) is square in F, and + * b = False and y = sqrt(Z * (u / v)) otherwise. + * @param Fp + * @param Z + * @returns + */ +function SWUFpSqrtRatio(Fp, Z) { + // Generic implementation + const q = Fp.ORDER; + let l = _0n; + for (let o = q - _1n; o % _2n === _0n; o /= _2n) + l += _1n; + const c1 = l; // 1. c1, the largest integer such that 2^c1 divides q - 1. + // We need 2n ** c1 and 2n ** (c1-1). We can't use **; but we can use <<. + // 2n ** c1 == 2n << (c1-1) + const _2n_pow_c1_1 = _2n << (c1 - _1n - _1n); + const _2n_pow_c1 = _2n_pow_c1_1 * _2n; + const c2 = (q - _1n) / _2n_pow_c1; // 2. c2 = (q - 1) / (2^c1) # Integer arithmetic + const c3 = (c2 - _1n) / _2n; // 3. c3 = (c2 - 1) / 2 # Integer arithmetic + const c4 = _2n_pow_c1 - _1n; // 4. c4 = 2^c1 - 1 # Integer arithmetic + const c5 = _2n_pow_c1_1; // 5. c5 = 2^(c1 - 1) # Integer arithmetic + const c6 = Fp.pow(Z, c2); // 6. c6 = Z^c2 + const c7 = Fp.pow(Z, (c2 + _1n) / _2n); // 7. c7 = Z^((c2 + 1) / 2) + let sqrtRatio = (u, v) => { + let tv1 = c6; // 1. tv1 = c6 + let tv2 = Fp.pow(v, c4); // 2. tv2 = v^c4 + let tv3 = Fp.sqr(tv2); // 3. tv3 = tv2^2 + tv3 = Fp.mul(tv3, v); // 4. tv3 = tv3 * v + let tv5 = Fp.mul(u, tv3); // 5. tv5 = u * tv3 + tv5 = Fp.pow(tv5, c3); // 6. tv5 = tv5^c3 + tv5 = Fp.mul(tv5, tv2); // 7. tv5 = tv5 * tv2 + tv2 = Fp.mul(tv5, v); // 8. tv2 = tv5 * v + tv3 = Fp.mul(tv5, u); // 9. tv3 = tv5 * u + let tv4 = Fp.mul(tv3, tv2); // 10. tv4 = tv3 * tv2 + tv5 = Fp.pow(tv4, c5); // 11. tv5 = tv4^c5 + let isQR = Fp.eql(tv5, Fp.ONE); // 12. isQR = tv5 == 1 + tv2 = Fp.mul(tv3, c7); // 13. tv2 = tv3 * c7 + tv5 = Fp.mul(tv4, tv1); // 14. tv5 = tv4 * tv1 + tv3 = Fp.cmov(tv2, tv3, isQR); // 15. tv3 = CMOV(tv2, tv3, isQR) + tv4 = Fp.cmov(tv5, tv4, isQR); // 16. tv4 = CMOV(tv5, tv4, isQR) + // 17. for i in (c1, c1 - 1, ..., 2): + for (let i = c1; i > _1n; i--) { + let tv5 = i - _2n; // 18. tv5 = i - 2 + tv5 = _2n << (tv5 - _1n); // 19. tv5 = 2^tv5 + let tvv5 = Fp.pow(tv4, tv5); // 20. tv5 = tv4^tv5 + const e1 = Fp.eql(tvv5, Fp.ONE); // 21. e1 = tv5 == 1 + tv2 = Fp.mul(tv3, tv1); // 22. tv2 = tv3 * tv1 + tv1 = Fp.mul(tv1, tv1); // 23. tv1 = tv1 * tv1 + tvv5 = Fp.mul(tv4, tv1); // 24. tv5 = tv4 * tv1 + tv3 = Fp.cmov(tv2, tv3, e1); // 25. tv3 = CMOV(tv2, tv3, e1) + tv4 = Fp.cmov(tvv5, tv4, e1); // 26. tv4 = CMOV(tv5, tv4, e1) + } + return { isValid: isQR, value: tv3 }; + }; + if (Fp.ORDER % _4n === _3n) { + // sqrt_ratio_3mod4(u, v) + const c1 = (Fp.ORDER - _3n) / _4n; // 1. c1 = (q - 3) / 4 # Integer arithmetic + const c2 = Fp.sqrt(Fp.neg(Z)); // 2. c2 = sqrt(-Z) + sqrtRatio = (u, v) => { + let tv1 = Fp.sqr(v); // 1. tv1 = v^2 + const tv2 = Fp.mul(u, v); // 2. tv2 = u * v + tv1 = Fp.mul(tv1, tv2); // 3. tv1 = tv1 * tv2 + let y1 = Fp.pow(tv1, c1); // 4. y1 = tv1^c1 + y1 = Fp.mul(y1, tv2); // 5. y1 = y1 * tv2 + const y2 = Fp.mul(y1, c2); // 6. y2 = y1 * c2 + const tv3 = Fp.mul(Fp.sqr(y1), v); // 7. tv3 = y1^2; 8. tv3 = tv3 * v + const isQR = Fp.eql(tv3, u); // 9. isQR = tv3 == u + let y = Fp.cmov(y2, y1, isQR); // 10. y = CMOV(y2, y1, isQR) + return { isValid: isQR, value: y }; // 11. return (isQR, y) isQR ? y : y*c2 + }; + } + // No curves uses that + // if (Fp.ORDER % _8n === _5n) // sqrt_ratio_5mod8 + return sqrtRatio; +} +exports.SWUFpSqrtRatio = SWUFpSqrtRatio; +/** + * Simplified Shallue-van de Woestijne-Ulas Method + * https://www.rfc-editor.org/rfc/rfc9380#section-6.6.2 + */ +function mapToCurveSimpleSWU(Fp, opts) { + mod.validateField(Fp); + if (!Fp.isValid(opts.A) || !Fp.isValid(opts.B) || !Fp.isValid(opts.Z)) + throw new Error('mapToCurveSimpleSWU: invalid opts'); + const sqrtRatio = SWUFpSqrtRatio(Fp, opts.Z); + if (!Fp.isOdd) + throw new Error('Fp.isOdd is not implemented!'); + // Input: u, an element of F. + // Output: (x, y), a point on E. + return (u) => { + // prettier-ignore + let tv1, tv2, tv3, tv4, tv5, tv6, x, y; + tv1 = Fp.sqr(u); // 1. tv1 = u^2 + tv1 = Fp.mul(tv1, opts.Z); // 2. tv1 = Z * tv1 + tv2 = Fp.sqr(tv1); // 3. tv2 = tv1^2 + tv2 = Fp.add(tv2, tv1); // 4. tv2 = tv2 + tv1 + tv3 = Fp.add(tv2, Fp.ONE); // 5. tv3 = tv2 + 1 + tv3 = Fp.mul(tv3, opts.B); // 6. tv3 = B * tv3 + tv4 = Fp.cmov(opts.Z, Fp.neg(tv2), !Fp.eql(tv2, Fp.ZERO)); // 7. tv4 = CMOV(Z, -tv2, tv2 != 0) + tv4 = Fp.mul(tv4, opts.A); // 8. tv4 = A * tv4 + tv2 = Fp.sqr(tv3); // 9. tv2 = tv3^2 + tv6 = Fp.sqr(tv4); // 10. tv6 = tv4^2 + tv5 = Fp.mul(tv6, opts.A); // 11. tv5 = A * tv6 + tv2 = Fp.add(tv2, tv5); // 12. tv2 = tv2 + tv5 + tv2 = Fp.mul(tv2, tv3); // 13. tv2 = tv2 * tv3 + tv6 = Fp.mul(tv6, tv4); // 14. tv6 = tv6 * tv4 + tv5 = Fp.mul(tv6, opts.B); // 15. tv5 = B * tv6 + tv2 = Fp.add(tv2, tv5); // 16. tv2 = tv2 + tv5 + x = Fp.mul(tv1, tv3); // 17. x = tv1 * tv3 + const { isValid, value } = sqrtRatio(tv2, tv6); // 18. (is_gx1_square, y1) = sqrt_ratio(tv2, tv6) + y = Fp.mul(tv1, u); // 19. y = tv1 * u -> Z * u^3 * y1 + y = Fp.mul(y, value); // 20. y = y * y1 + x = Fp.cmov(x, tv3, isValid); // 21. x = CMOV(x, tv3, is_gx1_square) + y = Fp.cmov(y, value, isValid); // 22. y = CMOV(y, y1, is_gx1_square) + const e1 = Fp.isOdd(u) === Fp.isOdd(y); // 23. e1 = sgn0(u) == sgn0(y) + y = Fp.cmov(Fp.neg(y), y, e1); // 24. y = CMOV(-y, y, e1) + x = Fp.div(x, tv4); // 25. x = x / tv4 + return { x, y }; + }; +} +exports.mapToCurveSimpleSWU = mapToCurveSimpleSWU; +//# sourceMappingURL=weierstrass.js.map + +/***/ }), + +/***/ 8510: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.encodeToCurve = exports.hashToCurve = exports.schnorr = exports.secp256k1 = void 0; +/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +const sha256_1 = __webpack_require__(22623); +const utils_1 = __webpack_require__(99175); +const modular_js_1 = __webpack_require__(24967); +const weierstrass_js_1 = __webpack_require__(91705); +const utils_js_1 = __webpack_require__(91484); +const hash_to_curve_js_1 = __webpack_require__(71761); +const _shortw_utils_js_1 = __webpack_require__(73562); +const secp256k1P = BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f'); +const secp256k1N = BigInt('0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141'); +const _1n = BigInt(1); +const _2n = BigInt(2); +const divNearest = (a, b) => (a + b / _2n) / b; +/** + * √n = n^((p+1)/4) for fields p = 3 mod 4. We unwrap the loop and multiply bit-by-bit. + * (P+1n/4n).toString(2) would produce bits [223x 1, 0, 22x 1, 4x 0, 11, 00] + */ +function sqrtMod(y) { + const P = secp256k1P; + // prettier-ignore + const _3n = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22); + // prettier-ignore + const _23n = BigInt(23), _44n = BigInt(44), _88n = BigInt(88); + const b2 = (y * y * y) % P; // x^3, 11 + const b3 = (b2 * b2 * y) % P; // x^7 + const b6 = ((0, modular_js_1.pow2)(b3, _3n, P) * b3) % P; + const b9 = ((0, modular_js_1.pow2)(b6, _3n, P) * b3) % P; + const b11 = ((0, modular_js_1.pow2)(b9, _2n, P) * b2) % P; + const b22 = ((0, modular_js_1.pow2)(b11, _11n, P) * b11) % P; + const b44 = ((0, modular_js_1.pow2)(b22, _22n, P) * b22) % P; + const b88 = ((0, modular_js_1.pow2)(b44, _44n, P) * b44) % P; + const b176 = ((0, modular_js_1.pow2)(b88, _88n, P) * b88) % P; + const b220 = ((0, modular_js_1.pow2)(b176, _44n, P) * b44) % P; + const b223 = ((0, modular_js_1.pow2)(b220, _3n, P) * b3) % P; + const t1 = ((0, modular_js_1.pow2)(b223, _23n, P) * b22) % P; + const t2 = ((0, modular_js_1.pow2)(t1, _6n, P) * b2) % P; + const root = (0, modular_js_1.pow2)(t2, _2n, P); + if (!Fp.eql(Fp.sqr(root), y)) + throw new Error('Cannot find square root'); + return root; +} +const Fp = (0, modular_js_1.Field)(secp256k1P, undefined, undefined, { sqrt: sqrtMod }); +exports.secp256k1 = (0, _shortw_utils_js_1.createCurve)({ + a: BigInt(0), + b: BigInt(7), + Fp, + n: secp256k1N, + // Base point (x, y) aka generator point + Gx: BigInt('55066263022277343669578718895168534326250603453777594175500187360389116729240'), + Gy: BigInt('32670510020758816978083085130507043184471273380659243275938904335757337482424'), + h: BigInt(1), + lowS: true, + /** + * secp256k1 belongs to Koblitz curves: it has efficiently computable endomorphism. + * Endomorphism uses 2x less RAM, speeds up precomputation by 2x and ECDH / key recovery by 20%. + * For precomputed wNAF it trades off 1/2 init time & 1/3 ram for 20% perf hit. + * Explanation: https://gist.github.com/paulmillr/eb670806793e84df628a7c434a873066 + */ + endo: { + beta: BigInt('0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee'), + splitScalar: (k) => { + const n = secp256k1N; + const a1 = BigInt('0x3086d221a7d46bcde86c90e49284eb15'); + const b1 = -_1n * BigInt('0xe4437ed6010e88286f547fa90abfe4c3'); + const a2 = BigInt('0x114ca50f7a8e2f3f657c1108d9d44cfd8'); + const b2 = a1; + const POW_2_128 = BigInt('0x100000000000000000000000000000000'); // (2n**128n).toString(16) + const c1 = divNearest(b2 * k, n); + const c2 = divNearest(-b1 * k, n); + let k1 = (0, modular_js_1.mod)(k - c1 * a1 - c2 * a2, n); + let k2 = (0, modular_js_1.mod)(-c1 * b1 - c2 * b2, n); + const k1neg = k1 > POW_2_128; + const k2neg = k2 > POW_2_128; + if (k1neg) + k1 = n - k1; + if (k2neg) + k2 = n - k2; + if (k1 > POW_2_128 || k2 > POW_2_128) { + throw new Error('splitScalar: Endomorphism failed, k=' + k); + } + return { k1neg, k1, k2neg, k2 }; + }, + }, +}, sha256_1.sha256); +// Schnorr signatures are superior to ECDSA from above. Below is Schnorr-specific BIP0340 code. +// https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki +const _0n = BigInt(0); +const fe = (x) => typeof x === 'bigint' && _0n < x && x < secp256k1P; +const ge = (x) => typeof x === 'bigint' && _0n < x && x < secp256k1N; +/** An object mapping tags to their tagged hash prefix of [SHA256(tag) | SHA256(tag)] */ +const TAGGED_HASH_PREFIXES = {}; +function taggedHash(tag, ...messages) { + let tagP = TAGGED_HASH_PREFIXES[tag]; + if (tagP === undefined) { + const tagH = (0, sha256_1.sha256)(Uint8Array.from(tag, (c) => c.charCodeAt(0))); + tagP = (0, utils_js_1.concatBytes)(tagH, tagH); + TAGGED_HASH_PREFIXES[tag] = tagP; + } + return (0, sha256_1.sha256)((0, utils_js_1.concatBytes)(tagP, ...messages)); +} +// ECDSA compact points are 33-byte. Schnorr is 32: we strip first byte 0x02 or 0x03 +const pointToBytes = (point) => point.toRawBytes(true).slice(1); +const numTo32b = (n) => (0, utils_js_1.numberToBytesBE)(n, 32); +const modP = (x) => (0, modular_js_1.mod)(x, secp256k1P); +const modN = (x) => (0, modular_js_1.mod)(x, secp256k1N); +const Point = exports.secp256k1.ProjectivePoint; +const GmulAdd = (Q, a, b) => Point.BASE.multiplyAndAddUnsafe(Q, a, b); +// Calculate point, scalar and bytes +function schnorrGetExtPubKey(priv) { + let d_ = exports.secp256k1.utils.normPrivateKeyToScalar(priv); // same method executed in fromPrivateKey + let p = Point.fromPrivateKey(d_); // P = d'⋅G; 0 < d' < n check is done inside + const scalar = p.hasEvenY() ? d_ : modN(-d_); + return { scalar: scalar, bytes: pointToBytes(p) }; +} +/** + * lift_x from BIP340. Convert 32-byte x coordinate to elliptic curve point. + * @returns valid point checked for being on-curve + */ +function lift_x(x) { + if (!fe(x)) + throw new Error('bad x: need 0 < x < p'); // Fail if x ≥ p. + const xx = modP(x * x); + const c = modP(xx * x + BigInt(7)); // Let c = x³ + 7 mod p. + let y = sqrtMod(c); // Let y = c^(p+1)/4 mod p. + if (y % _2n !== _0n) + y = modP(-y); // Return the unique point P such that x(P) = x and + const p = new Point(x, y, _1n); // y(P) = y if y mod 2 = 0 or y(P) = p-y otherwise. + p.assertValidity(); + return p; +} +/** + * Create tagged hash, convert it to bigint, reduce modulo-n. + */ +function challenge(...args) { + return modN((0, utils_js_1.bytesToNumberBE)(taggedHash('BIP0340/challenge', ...args))); +} +/** + * Schnorr public key is just `x` coordinate of Point as per BIP340. + */ +function schnorrGetPublicKey(privateKey) { + return schnorrGetExtPubKey(privateKey).bytes; // d'=int(sk). Fail if d'=0 or d'≥n. Ret bytes(d'⋅G) +} +/** + * Creates Schnorr signature as per BIP340. Verifies itself before returning anything. + * auxRand is optional and is not the sole source of k generation: bad CSPRNG won't be dangerous. + */ +function schnorrSign(message, privateKey, auxRand = (0, utils_1.randomBytes)(32)) { + const m = (0, utils_js_1.ensureBytes)('message', message); + const { bytes: px, scalar: d } = schnorrGetExtPubKey(privateKey); // checks for isWithinCurveOrder + const a = (0, utils_js_1.ensureBytes)('auxRand', auxRand, 32); // Auxiliary random data a: a 32-byte array + const t = numTo32b(d ^ (0, utils_js_1.bytesToNumberBE)(taggedHash('BIP0340/aux', a))); // Let t be the byte-wise xor of bytes(d) and hash/aux(a) + const rand = taggedHash('BIP0340/nonce', t, px, m); // Let rand = hash/nonce(t || bytes(P) || m) + const k_ = modN((0, utils_js_1.bytesToNumberBE)(rand)); // Let k' = int(rand) mod n + if (k_ === _0n) + throw new Error('sign failed: k is zero'); // Fail if k' = 0. + const { bytes: rx, scalar: k } = schnorrGetExtPubKey(k_); // Let R = k'⋅G. + const e = challenge(rx, px, m); // Let e = int(hash/challenge(bytes(R) || bytes(P) || m)) mod n. + const sig = new Uint8Array(64); // Let sig = bytes(R) || bytes((k + ed) mod n). + sig.set(rx, 0); + sig.set(numTo32b(modN(k + e * d)), 32); + // If Verify(bytes(P), m, sig) (see below) returns failure, abort + if (!schnorrVerify(sig, m, px)) + throw new Error('sign: Invalid signature produced'); + return sig; +} +/** + * Verifies Schnorr signature. + * Will swallow errors & return false except for initial type validation of arguments. + */ +function schnorrVerify(signature, message, publicKey) { + const sig = (0, utils_js_1.ensureBytes)('signature', signature, 64); + const m = (0, utils_js_1.ensureBytes)('message', message); + const pub = (0, utils_js_1.ensureBytes)('publicKey', publicKey, 32); + try { + const P = lift_x((0, utils_js_1.bytesToNumberBE)(pub)); // P = lift_x(int(pk)); fail if that fails + const r = (0, utils_js_1.bytesToNumberBE)(sig.subarray(0, 32)); // Let r = int(sig[0:32]); fail if r ≥ p. + if (!fe(r)) + return false; + const s = (0, utils_js_1.bytesToNumberBE)(sig.subarray(32, 64)); // Let s = int(sig[32:64]); fail if s ≥ n. + if (!ge(s)) + return false; + const e = challenge(numTo32b(r), pointToBytes(P), m); // int(challenge(bytes(r)||bytes(P)||m))%n + const R = GmulAdd(P, s, modN(-e)); // R = s⋅G - e⋅P + if (!R || !R.hasEvenY() || R.toAffine().x !== r) + return false; // -eP == (n-e)P + return true; // Fail if is_infinite(R) / not has_even_y(R) / x(R) ≠ r. + } + catch (error) { + return false; + } +} +exports.schnorr = (() => ({ + getPublicKey: schnorrGetPublicKey, + sign: schnorrSign, + verify: schnorrVerify, + utils: { + randomPrivateKey: exports.secp256k1.utils.randomPrivateKey, + lift_x, + pointToBytes, + numberToBytesBE: utils_js_1.numberToBytesBE, + bytesToNumberBE: utils_js_1.bytesToNumberBE, + taggedHash, + mod: modular_js_1.mod, + }, +}))(); +const isoMap = /* @__PURE__ */ (() => (0, hash_to_curve_js_1.isogenyMap)(Fp, [ + // xNum + [ + '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7', + '0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581', + '0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262', + '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c', + ], + // xDen + [ + '0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b', + '0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14', + '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1 + ], + // yNum + [ + '0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c', + '0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3', + '0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931', + '0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84', + ], + // yDen + [ + '0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b', + '0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573', + '0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f', + '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1 + ], +].map((i) => i.map((j) => BigInt(j)))))(); +const mapSWU = /* @__PURE__ */ (() => (0, weierstrass_js_1.mapToCurveSimpleSWU)(Fp, { + A: BigInt('0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533'), + B: BigInt('1771'), + Z: Fp.create(BigInt('-11')), +}))(); +const htf = /* @__PURE__ */ (() => (0, hash_to_curve_js_1.createHasher)(exports.secp256k1.ProjectivePoint, (scalars) => { + const { x, y } = mapSWU(Fp.create(scalars[0])); + return isoMap(x, y); +}, { + DST: 'secp256k1_XMD:SHA-256_SSWU_RO_', + encodeDST: 'secp256k1_XMD:SHA-256_SSWU_NU_', + p: Fp.ORDER, + m: 1, + k: 128, + expand: 'xmd', + hash: sha256_1.sha256, +}))(); +exports.hashToCurve = (() => htf.hashToCurve)(); +exports.encodeToCurve = (() => htf.encodeToCurve)(); +//# sourceMappingURL=secp256k1.js.map + /***/ }), /***/ 67557: @@ -8624,35 +10475,29 @@ module.exports = base "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.output = exports.exists = exports.hash = exports.bytes = exports.bool = exports.number = exports.isBytes = void 0; +exports.output = exports.exists = exports.hash = exports.bytes = exports.bool = exports.number = void 0; function number(n) { if (!Number.isSafeInteger(n) || n < 0) - throw new Error(`positive integer expected, not ${n}`); + throw new Error(`Wrong positive integer: ${n}`); } exports.number = number; function bool(b) { if (typeof b !== 'boolean') - throw new Error(`boolean expected, not ${b}`); + throw new Error(`Expected boolean, not ${b}`); } exports.bool = bool; -// copied from utils -function isBytes(a) { - return (a instanceof Uint8Array || - (a != null && typeof a === 'object' && a.constructor.name === 'Uint8Array')); -} -exports.isBytes = isBytes; function bytes(b, ...lengths) { - if (!isBytes(b)) - throw new Error('Uint8Array expected'); + if (!(b instanceof Uint8Array)) + throw new Error('Expected Uint8Array'); if (lengths.length > 0 && !lengths.includes(b.length)) - throw new Error(`Uint8Array expected of length ${lengths}, not of length=${b.length}`); + throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`); } exports.bytes = bytes; -function hash(h) { - if (typeof h !== 'function' || typeof h.create !== 'function') +function hash(hash) { + if (typeof hash !== 'function' || typeof hash.create !== 'function') throw new Error('Hash should be wrapped by utils.wrapConstructor'); - number(h.outputLen); - number(h.blockLen); + number(hash.outputLen); + number(hash.blockLen); } exports.hash = hash; function exists(instance, checkFinished = true) { @@ -8676,13 +10521,13 @@ exports["default"] = assert; /***/ }), -/***/ 37202: +/***/ 90915: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HashMD = exports.Maj = exports.Chi = void 0; +exports.SHA2 = void 0; const _assert_js_1 = __webpack_require__(67557); const utils_js_1 = __webpack_require__(99175); // Polyfill for Safari 14 @@ -8698,17 +10543,8 @@ function setBigUint64(view, byteOffset, value, isLE) { view.setUint32(byteOffset + h, wh, isLE); view.setUint32(byteOffset + l, wl, isLE); } -// Choice: a ? b : c -const Chi = (a, b, c) => (a & b) ^ (~a & c); -exports.Chi = Chi; -// Majority function, true if any two inpust is true -const Maj = (a, b, c) => (a & b) ^ (a & c) ^ (b & c); -exports.Maj = Maj; -/** - * Merkle-Damgard hash construction base class. - * Could be used to create MD5, RIPEMD, SHA1, SHA2. - */ -class HashMD extends utils_js_1.Hash { +// Base SHA2 class (RFC 6234) +class SHA2 extends utils_js_1.Hash { constructor(blockLen, outputLen, padOffset, isLE) { super(); this.blockLen = blockLen; @@ -8760,8 +10596,7 @@ class HashMD extends utils_js_1.Hash { // append the bit '1' to the message buffer[pos++] = 0b10000000; this.buffer.subarray(pos).fill(0); - // we have less than padOffset left in buffer, so we cannot put length in - // current block, need process it and pad again + // we have less than padOffset left in buffer, so we cannot put length in current block, need process it and pad again if (this.padOffset > blockLen - pos) { this.process(view, 0); pos = 0; @@ -8806,8 +10641,8 @@ class HashMD extends utils_js_1.Hash { return to; } } -exports.HashMD = HashMD; -//# sourceMappingURL=_md.js.map +exports.SHA2 = SHA2; +//# sourceMappingURL=_sha2.js.map /***/ }), @@ -9011,10 +10846,14 @@ exports.hmac.create = (hash, key) => new HMAC(hash, key); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.sha224 = exports.sha256 = void 0; -const _md_js_1 = __webpack_require__(37202); +const _sha2_js_1 = __webpack_require__(90915); const utils_js_1 = __webpack_require__(99175); // SHA2-256 need to try 2^128 hashes to execute birthday attack. // BTC network is doing 2^67 hashes/sec as per early 2023. +// Choice: a ? b : c +const Chi = (a, b, c) => (a & b) ^ (~a & c); +// Majority function, true if any two inpust is true +const Maj = (a, b, c) => (a & b) ^ (a & c) ^ (b & c); // Round constants: // first 32 bits of the fractional parts of the cube roots of the first 64 primes 2..311) // prettier-ignore @@ -9028,28 +10867,27 @@ const SHA256_K = /* @__PURE__ */ new Uint32Array([ 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 ]); -// Initial state: -// first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19 +// Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19): // prettier-ignore -const SHA256_IV = /* @__PURE__ */ new Uint32Array([ +const IV = /* @__PURE__ */ new Uint32Array([ 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 ]); // Temporary buffer, not used to store anything between runs // Named this way because it matches specification. const SHA256_W = /* @__PURE__ */ new Uint32Array(64); -class SHA256 extends _md_js_1.HashMD { +class SHA256 extends _sha2_js_1.SHA2 { constructor() { super(64, 32, 8, false); // We cannot use array here since array allows indexing by variable // which means optimizer/compiler cannot use registers. - this.A = SHA256_IV[0] | 0; - this.B = SHA256_IV[1] | 0; - this.C = SHA256_IV[2] | 0; - this.D = SHA256_IV[3] | 0; - this.E = SHA256_IV[4] | 0; - this.F = SHA256_IV[5] | 0; - this.G = SHA256_IV[6] | 0; - this.H = SHA256_IV[7] | 0; + this.A = IV[0] | 0; + this.B = IV[1] | 0; + this.C = IV[2] | 0; + this.D = IV[3] | 0; + this.E = IV[4] | 0; + this.F = IV[5] | 0; + this.G = IV[6] | 0; + this.H = IV[7] | 0; } get() { const { A, B, C, D, E, F, G, H } = this; @@ -9081,9 +10919,9 @@ class SHA256 extends _md_js_1.HashMD { let { A, B, C, D, E, F, G, H } = this; for (let i = 0; i < 64; i++) { const sigma1 = (0, utils_js_1.rotr)(E, 6) ^ (0, utils_js_1.rotr)(E, 11) ^ (0, utils_js_1.rotr)(E, 25); - const T1 = (H + sigma1 + (0, _md_js_1.Chi)(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; + const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; const sigma0 = (0, utils_js_1.rotr)(A, 2) ^ (0, utils_js_1.rotr)(A, 13) ^ (0, utils_js_1.rotr)(A, 22); - const T2 = (sigma0 + (0, _md_js_1.Maj)(A, B, C)) | 0; + const T2 = (sigma0 + Maj(A, B, C)) | 0; H = G; G = F; F = E; @@ -9150,9 +10988,7 @@ const utils_js_1 = __webpack_require__(99175); // SHA3 (keccak) is based on a new design: basically, the internal state is bigger than output size. // It's called a sponge function. // Various per round constants calculations -const SHA3_PI = []; -const SHA3_ROTL = []; -const _SHA3_IOTA = []; +const [SHA3_PI, SHA3_ROTL, _SHA3_IOTA] = [[], [], []]; const _0n = /* @__PURE__ */ BigInt(0); const _1n = /* @__PURE__ */ BigInt(1); const _2n = /* @__PURE__ */ BigInt(2); @@ -9247,11 +11083,7 @@ class Keccak extends utils_js_1.Hash { this.state32 = (0, utils_js_1.u32)(this.state); } keccak() { - if (!utils_js_1.isLE) - (0, utils_js_1.byteSwap32)(this.state32); keccakP(this.state32, this.rounds); - if (!utils_js_1.isLE) - (0, utils_js_1.byteSwap32)(this.state32); this.posOut = 0; this.pos = 0; } @@ -9370,22 +11202,15 @@ exports.shake256 = genShake(0x1f, 136, 256 / 8); /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.randomBytes = exports.wrapXOFConstructorWithOpts = exports.wrapConstructorWithOpts = exports.wrapConstructor = exports.checkOpts = exports.Hash = exports.concatBytes = exports.toBytes = exports.utf8ToBytes = exports.asyncLoop = exports.nextTick = exports.hexToBytes = exports.bytesToHex = exports.byteSwap32 = exports.byteSwapIfBE = exports.byteSwap = exports.isLE = exports.rotl = exports.rotr = exports.createView = exports.u32 = exports.u8 = exports.isBytes = void 0; +exports.randomBytes = exports.wrapXOFConstructorWithOpts = exports.wrapConstructorWithOpts = exports.wrapConstructor = exports.checkOpts = exports.Hash = exports.concatBytes = exports.toBytes = exports.utf8ToBytes = exports.asyncLoop = exports.nextTick = exports.hexToBytes = exports.bytesToHex = exports.isLE = exports.rotr = exports.createView = exports.u32 = exports.u8 = void 0; // We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. // node.js versions earlier than v19 don't declare it in global scope. // For node.js, package.json#exports field mapping rewrites import // from `crypto` to `cryptoNode`, which imports native module. // Makes the utils un-importable in browsers without a bundler. -// Once node.js 18 is deprecated (2025-04-30), we can just drop the import. +// Once node.js 18 is deprecated, we can just drop the import. const crypto_1 = __webpack_require__(25145); -const _assert_js_1 = __webpack_require__(67557); -// export { isBytes } from './_assert.js'; -// We can't reuse isBytes from _assert, because somehow this causes huge perf issues -function isBytes(a) { - return (a instanceof Uint8Array || - (a != null && typeof a === 'object' && a.constructor.name === 'Uint8Array')); -} -exports.isBytes = isBytes; +const u8a = (a) => a instanceof Uint8Array; // Cast array to different type const u8 = (arr) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength); exports.u8 = u8; @@ -9397,32 +11222,18 @@ exports.createView = createView; // The rotate right (circular right shift) operation for uint32 const rotr = (word, shift) => (word << (32 - shift)) | (word >>> shift); exports.rotr = rotr; -// The rotate left (circular left shift) operation for uint32 -const rotl = (word, shift) => (word << shift) | ((word >>> (32 - shift)) >>> 0); -exports.rotl = rotl; +// big-endian hardware is rare. Just in case someone still decides to run hashes: +// early-throw an error because we don't support BE yet. exports.isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44; -// The byte swap operation for uint32 -const byteSwap = (word) => ((word << 24) & 0xff000000) | - ((word << 8) & 0xff0000) | - ((word >>> 8) & 0xff00) | - ((word >>> 24) & 0xff); -exports.byteSwap = byteSwap; -// Conditionally byte swap if on a big-endian platform -exports.byteSwapIfBE = exports.isLE ? (n) => n : (n) => (0, exports.byteSwap)(n); -// In place byte swap for Uint32Array -function byteSwap32(arr) { - for (let i = 0; i < arr.length; i++) { - arr[i] = (0, exports.byteSwap)(arr[i]); - } -} -exports.byteSwap32 = byteSwap32; -// Array where index 0xf0 (240) is mapped to string 'f0' +if (!exports.isLE) + throw new Error('Non little-endian hardware is not supported'); const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0')); /** * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' */ function bytesToHex(bytes) { - (0, _assert_js_1.bytes)(bytes); + if (!u8a(bytes)) + throw new Error('Uint8Array expected'); // pre-caching improves the speed 6x let hex = ''; for (let i = 0; i < bytes.length; i++) { @@ -9431,36 +11242,23 @@ function bytesToHex(bytes) { return hex; } exports.bytesToHex = bytesToHex; -// We use optimized technique to convert hex string to byte array -const asciis = { _0: 48, _9: 57, _A: 65, _F: 70, _a: 97, _f: 102 }; -function asciiToBase16(char) { - if (char >= asciis._0 && char <= asciis._9) - return char - asciis._0; - if (char >= asciis._A && char <= asciis._F) - return char - (asciis._A - 10); - if (char >= asciis._a && char <= asciis._f) - return char - (asciis._a - 10); - return; -} /** * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) */ function hexToBytes(hex) { if (typeof hex !== 'string') throw new Error('hex string expected, got ' + typeof hex); - const hl = hex.length; - const al = hl / 2; - if (hl % 2) - throw new Error('padded hex string expected, got unpadded hex of length ' + hl); - const array = new Uint8Array(al); - for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) { - const n1 = asciiToBase16(hex.charCodeAt(hi)); - const n2 = asciiToBase16(hex.charCodeAt(hi + 1)); - if (n1 === undefined || n2 === undefined) { - const char = hex[hi] + hex[hi + 1]; - throw new Error('hex string expected, got non-hex character "' + char + '" at index ' + hi); - } - array[ai] = n1 * 16 + n2; + const len = hex.length; + if (len % 2) + throw new Error('padded hex string expected, got unpadded hex of length ' + len); + const array = new Uint8Array(len / 2); + for (let i = 0; i < array.length; i++) { + const j = i * 2; + const hexByte = hex.slice(j, j + 2); + const byte = Number.parseInt(hexByte, 16); + if (Number.isNaN(byte) || byte < 0) + throw new Error('Invalid byte sequence'); + array[i] = byte; } return array; } @@ -9501,7 +11299,8 @@ exports.utf8ToBytes = utf8ToBytes; function toBytes(data) { if (typeof data === 'string') data = utf8ToBytes(data); - (0, _assert_js_1.bytes)(data); + if (!u8a(data)) + throw new Error(`expected Uint8Array, got ${typeof data}`); return data; } exports.toBytes = toBytes; @@ -9509,19 +11308,15 @@ exports.toBytes = toBytes; * Copies several Uint8Arrays into one. */ function concatBytes(...arrays) { - let sum = 0; - for (let i = 0; i < arrays.length; i++) { - const a = arrays[i]; - (0, _assert_js_1.bytes)(a); - sum += a.length; - } - const res = new Uint8Array(sum); - for (let i = 0, pad = 0; i < arrays.length; i++) { - const a = arrays[i]; - res.set(a, pad); + const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0)); + let pad = 0; // walk through each item, ensure they have proper type + arrays.forEach((a) => { + if (!u8a(a)) + throw new Error('Uint8Array expected'); + r.set(a, pad); pad += a.length; - } - return res; + }); + return r; } exports.concatBytes = concatBytes; // For runtime check if class implements interface @@ -60734,7 +62529,7 @@ class NoteAccount { /* harmony export */ gH: () => (/* binding */ ENSUtils), /* harmony export */ qX: () => (/* binding */ encodedLabelToLabelhash) /* harmony export */ }); -/* harmony import */ var ethers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(15539); +/* harmony import */ var ethers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2011); /* harmony import */ var ethers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(64563); /* harmony import */ var ethers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(97876); /* harmony import */ var _typechain__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(62463); @@ -90362,7 +92157,7 @@ var index = /*#__PURE__*/Object.freeze({ // EXTERNAL MODULE: ./src/batch.ts var batch = __webpack_require__(9723); // EXTERNAL MODULE: ./src/providers.ts + 39 modules -var providers = __webpack_require__(68909); +var providers = __webpack_require__(46170); // EXTERNAL MODULE: ./src/networkConfig.ts var networkConfig = __webpack_require__(59499); // EXTERNAL MODULE: ./src/relayerClient.ts @@ -91436,7 +93231,7 @@ RevenueService: Mismatch on withdrawal logs (${withdrawalLogs.length} ) and even /* harmony export */ }); /* harmony import */ var _zip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18995); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(67418); -/* harmony import */ var _providers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(68909); +/* harmony import */ var _providers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(46170); /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96221); @@ -92743,7 +94538,7 @@ async function getIndexedDB(netId) { /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ W: () => (/* binding */ fetchIp) /* harmony export */ }); -/* harmony import */ var _providers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(68909); +/* harmony import */ var _providers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(46170); async function fetchIp(ipEcho) { @@ -93748,7 +95543,7 @@ const MaxInt256 = BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffff // EXTERNAL MODULE: ./node_modules/ethers/lib.esm/address/address.js var address = __webpack_require__(30031); // EXTERNAL MODULE: ./node_modules/ethers/lib.esm/crypto/keccak.js + 1 modules -var keccak = __webpack_require__(15539); +var keccak = __webpack_require__(2011); // EXTERNAL MODULE: ./node_modules/ethers/lib.esm/utils/data.js var data = __webpack_require__(36212); // EXTERNAL MODULE: ./node_modules/ethers/lib.esm/utils/utf8.js @@ -94118,7 +95913,7 @@ class TokenPriceOracle { /***/ }), -/***/ 68909: +/***/ 46170: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; @@ -98084,9 +99879,9 @@ function spelunkMessage(value) { } //# sourceMappingURL=provider-jsonrpc.js.map // EXTERNAL MODULE: ./node_modules/ethers/lib.esm/crypto/signing-key.js + 6 modules -var signing_key = __webpack_require__(15496); +var signing_key = __webpack_require__(72588); // EXTERNAL MODULE: ./node_modules/ethers/lib.esm/crypto/keccak.js + 1 modules -var keccak = __webpack_require__(15539); +var keccak = __webpack_require__(2011); ;// ./node_modules/ethers/lib.esm/constants/strings.js // NFKC (composed) // (decomposed) /** @@ -98262,7 +100057,7 @@ class BaseWallet extends AbstractSigner { // EXTERNAL MODULE: ./node_modules/ethers/lib.esm/crypto/sha2.js var sha2 = __webpack_require__(68650); // EXTERNAL MODULE: ./node_modules/ethers/lib.esm/crypto/crypto-browser.js + 1 modules -var crypto_browser = __webpack_require__(8180); +var crypto_browser = __webpack_require__(68682); ;// ./node_modules/ethers/lib.esm/crypto/hmac.js /** * An **HMAC** enables verification that a given key was used @@ -98311,11 +100106,11 @@ computeHmac.register = function (func) { }; Object.freeze(computeHmac); //# sourceMappingURL=hmac.js.map -// EXTERNAL MODULE: ./node_modules/ethers/node_modules/@noble/hashes/esm/_sha2.js -var _sha2 = __webpack_require__(37171); -// EXTERNAL MODULE: ./node_modules/ethers/node_modules/@noble/hashes/esm/utils.js + 1 modules -var utils = __webpack_require__(10750); -;// ./node_modules/ethers/node_modules/@noble/hashes/esm/ripemd160.js +// EXTERNAL MODULE: ./node_modules/@noble/hashes/esm/_sha2.js +var _sha2 = __webpack_require__(6800); +// EXTERNAL MODULE: ./node_modules/@noble/hashes/esm/utils.js + 1 modules +var utils = __webpack_require__(32531); +;// ./node_modules/@noble/hashes/esm/ripemd160.js // https://homes.esat.kuleuven.be/~bosselae/ripemd160.html @@ -99473,13 +101268,13 @@ function pkcs7Strip(data) { //# sourceMappingURL=index.js.map -// EXTERNAL MODULE: ./node_modules/ethers/node_modules/@noble/hashes/esm/_assert.js -var _assert = __webpack_require__(27125); -// EXTERNAL MODULE: ./node_modules/ethers/node_modules/@noble/hashes/esm/sha256.js -var sha256 = __webpack_require__(3439); -// EXTERNAL MODULE: ./node_modules/ethers/node_modules/@noble/hashes/esm/pbkdf2.js -var esm_pbkdf2 = __webpack_require__(84877); -;// ./node_modules/ethers/node_modules/@noble/hashes/esm/scrypt.js +// EXTERNAL MODULE: ./node_modules/@noble/hashes/esm/_assert.js +var _assert = __webpack_require__(89190); +// EXTERNAL MODULE: ./node_modules/@noble/hashes/esm/sha256.js +var sha256 = __webpack_require__(78226); +// EXTERNAL MODULE: ./node_modules/@noble/hashes/esm/pbkdf2.js +var esm_pbkdf2 = __webpack_require__(2200); +;// ./node_modules/@noble/hashes/esm/scrypt.js @@ -101404,7 +103199,7 @@ class TornadoBrowserProvider extends BrowserProvider { /* harmony import */ var ethers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(30031); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67418); /* harmony import */ var _networkConfig__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(59499); -/* harmony import */ var _providers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(68909); +/* harmony import */ var _providers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(46170); /* harmony import */ var _schemas__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(59511); @@ -102264,7 +104059,7 @@ async function getTokenBalances({ /* harmony export */ }); /* harmony import */ var ethers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(30031); /* harmony import */ var _relayerClient__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57194); -/* harmony import */ var _providers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(68909); +/* harmony import */ var _providers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(46170); /* harmony import */ var _schemas__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(59511); /* harmony import */ var _networkConfig__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(59499); @@ -110776,7 +112571,7 @@ function unzipSync(data, opts) { } // EXTERNAL MODULE: ./src/providers.ts + 39 modules -var providers = __webpack_require__(68909); +var providers = __webpack_require__(46170); // EXTERNAL MODULE: ./src/utils.ts var utils = __webpack_require__(67418); ;// ./src/zip.ts @@ -110855,2494 +112650,6 @@ exports.keccak384 = (0, utils_js_1.wrapHash)(sha3_1.keccak_384); exports.keccak512 = (0, utils_js_1.wrapHash)(sha3_1.keccak_512); -/***/ }), - -/***/ 40714: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getHash = getHash; -exports.createCurve = createCurve; -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const hmac_1 = __webpack_require__(39615); -const utils_1 = __webpack_require__(99175); -const weierstrass_js_1 = __webpack_require__(20489); -// connects noble-curves to noble-hashes -function getHash(hash) { - return { - hash, - hmac: (key, ...msgs) => (0, hmac_1.hmac)(hash, key, (0, utils_1.concatBytes)(...msgs)), - randomBytes: utils_1.randomBytes, - }; -} -function createCurve(curveDef, defHash) { - const create = (hash) => (0, weierstrass_js_1.weierstrass)({ ...curveDef, ...getHash(hash) }); - return Object.freeze({ ...create(defHash), create }); -} -//# sourceMappingURL=_shortw_utils.js.map - -/***/ }), - -/***/ 59206: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.wNAF = wNAF; -exports.validateBasic = validateBasic; -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// Abelian group utilities -const modular_js_1 = __webpack_require__(89015); -const utils_js_1 = __webpack_require__(19372); -const _0n = BigInt(0); -const _1n = BigInt(1); -// Elliptic curve multiplication of Point by scalar. Fragile. -// Scalars should always be less than curve order: this should be checked inside of a curve itself. -// Creates precomputation tables for fast multiplication: -// - private scalar is split by fixed size windows of W bits -// - every window point is collected from window's table & added to accumulator -// - since windows are different, same point inside tables won't be accessed more than once per calc -// - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar) -// - +1 window is neccessary for wNAF -// - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication -// TODO: Research returning 2d JS array of windows, instead of a single window. This would allow -// windows to be in different memory locations -function wNAF(c, bits) { - const constTimeNegate = (condition, item) => { - const neg = item.negate(); - return condition ? neg : item; - }; - const opts = (W) => { - const windows = Math.ceil(bits / W) + 1; // +1, because - const windowSize = 2 ** (W - 1); // -1 because we skip zero - return { windows, windowSize }; - }; - return { - constTimeNegate, - // non-const time multiplication ladder - unsafeLadder(elm, n) { - let p = c.ZERO; - let d = elm; - while (n > _0n) { - if (n & _1n) - p = p.add(d); - d = d.double(); - n >>= _1n; - } - return p; - }, - /** - * Creates a wNAF precomputation window. Used for caching. - * Default window size is set by `utils.precompute()` and is equal to 8. - * Number of precomputed points depends on the curve size: - * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where: - * - 𝑊 is the window size - * - 𝑛 is the bitlength of the curve order. - * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224. - * @returns precomputed point tables flattened to a single array - */ - precomputeWindow(elm, W) { - const { windows, windowSize } = opts(W); - const points = []; - let p = elm; - let base = p; - for (let window = 0; window < windows; window++) { - base = p; - points.push(base); - // =1, because we skip zero - for (let i = 1; i < windowSize; i++) { - base = base.add(p); - points.push(base); - } - p = base.double(); - } - return points; - }, - /** - * Implements ec multiplication using precomputed tables and w-ary non-adjacent form. - * @param W window size - * @param precomputes precomputed tables - * @param n scalar (we don't check here, but should be less than curve order) - * @returns real and fake (for const-time) points - */ - wNAF(W, precomputes, n) { - // TODO: maybe check that scalar is less than group order? wNAF behavious is undefined otherwise - // But need to carefully remove other checks before wNAF. ORDER == bits here - const { windows, windowSize } = opts(W); - let p = c.ZERO; - let f = c.BASE; - const mask = BigInt(2 ** W - 1); // Create mask with W ones: 0b1111 for W=4 etc. - const maxNumber = 2 ** W; - const shiftBy = BigInt(W); - for (let window = 0; window < windows; window++) { - const offset = window * windowSize; - // Extract W bits. - let wbits = Number(n & mask); - // Shift number by W bits. - n >>= shiftBy; - // If the bits are bigger than max size, we'll split those. - // +224 => 256 - 32 - if (wbits > windowSize) { - wbits -= maxNumber; - n += _1n; - } - // This code was first written with assumption that 'f' and 'p' will never be infinity point: - // since each addition is multiplied by 2 ** W, it cannot cancel each other. However, - // there is negate now: it is possible that negated element from low value - // would be the same as high element, which will create carry into next window. - // It's not obvious how this can fail, but still worth investigating later. - // Check if we're onto Zero point. - // Add random point inside current window to f. - const offset1 = offset; - const offset2 = offset + Math.abs(wbits) - 1; // -1 because we skip zero - const cond1 = window % 2 !== 0; - const cond2 = wbits < 0; - if (wbits === 0) { - // The most important part for const-time getPublicKey - f = f.add(constTimeNegate(cond1, precomputes[offset1])); - } - else { - p = p.add(constTimeNegate(cond2, precomputes[offset2])); - } - } - // JIT-compiler should not eliminate f here, since it will later be used in normalizeZ() - // Even if the variable is still unused, there are some checks which will - // throw an exception, so compiler needs to prove they won't happen, which is hard. - // At this point there is a way to F be infinity-point even if p is not, - // which makes it less const-time: around 1 bigint multiply. - return { p, f }; - }, - wNAFCached(P, precomputesMap, n, transform) { - // @ts-ignore - const W = P._WINDOW_SIZE || 1; - // Calculate precomputes on a first run, reuse them after - let comp = precomputesMap.get(P); - if (!comp) { - comp = this.precomputeWindow(P, W); - if (W !== 1) { - precomputesMap.set(P, transform(comp)); - } - } - return this.wNAF(W, comp, n); - }, - }; -} -function validateBasic(curve) { - (0, modular_js_1.validateField)(curve.Fp); - (0, utils_js_1.validateObject)(curve, { - n: 'bigint', - h: 'bigint', - Gx: 'field', - Gy: 'field', - }, { - nBitLength: 'isSafeInteger', - nByteLength: 'isSafeInteger', - }); - // Set defaults - return Object.freeze({ - ...(0, modular_js_1.nLength)(curve.n, curve.nBitLength), - ...curve, - ...{ p: curve.Fp.ORDER }, - }); -} -//# sourceMappingURL=curve.js.map - -/***/ }), - -/***/ 81761: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.expand_message_xmd = expand_message_xmd; -exports.expand_message_xof = expand_message_xof; -exports.hash_to_field = hash_to_field; -exports.isogenyMap = isogenyMap; -exports.createHasher = createHasher; -const modular_js_1 = __webpack_require__(89015); -const utils_js_1 = __webpack_require__(19372); -// Octet Stream to Integer. "spec" implementation of os2ip is 2.5x slower vs bytesToNumberBE. -const os2ip = utils_js_1.bytesToNumberBE; -// Integer to Octet Stream (numberToBytesBE) -function i2osp(value, length) { - if (value < 0 || value >= 1 << (8 * length)) { - throw new Error(`bad I2OSP call: value=${value} length=${length}`); - } - const res = Array.from({ length }).fill(0); - for (let i = length - 1; i >= 0; i--) { - res[i] = value & 0xff; - value >>>= 8; - } - return new Uint8Array(res); -} -function strxor(a, b) { - const arr = new Uint8Array(a.length); - for (let i = 0; i < a.length; i++) { - arr[i] = a[i] ^ b[i]; - } - return arr; -} -function anum(item) { - if (!Number.isSafeInteger(item)) - throw new Error('number expected'); -} -// Produces a uniformly random byte string using a cryptographic hash function H that outputs b bits -// https://www.rfc-editor.org/rfc/rfc9380#section-5.3.1 -function expand_message_xmd(msg, DST, lenInBytes, H) { - (0, utils_js_1.abytes)(msg); - (0, utils_js_1.abytes)(DST); - anum(lenInBytes); - // https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3 - if (DST.length > 255) - DST = H((0, utils_js_1.concatBytes)((0, utils_js_1.utf8ToBytes)('H2C-OVERSIZE-DST-'), DST)); - const { outputLen: b_in_bytes, blockLen: r_in_bytes } = H; - const ell = Math.ceil(lenInBytes / b_in_bytes); - if (ell > 255) - throw new Error('Invalid xmd length'); - const DST_prime = (0, utils_js_1.concatBytes)(DST, i2osp(DST.length, 1)); - const Z_pad = i2osp(0, r_in_bytes); - const l_i_b_str = i2osp(lenInBytes, 2); // len_in_bytes_str - const b = new Array(ell); - const b_0 = H((0, utils_js_1.concatBytes)(Z_pad, msg, l_i_b_str, i2osp(0, 1), DST_prime)); - b[0] = H((0, utils_js_1.concatBytes)(b_0, i2osp(1, 1), DST_prime)); - for (let i = 1; i <= ell; i++) { - const args = [strxor(b_0, b[i - 1]), i2osp(i + 1, 1), DST_prime]; - b[i] = H((0, utils_js_1.concatBytes)(...args)); - } - const pseudo_random_bytes = (0, utils_js_1.concatBytes)(...b); - return pseudo_random_bytes.slice(0, lenInBytes); -} -// Produces a uniformly random byte string using an extendable-output function (XOF) H. -// 1. The collision resistance of H MUST be at least k bits. -// 2. H MUST be an XOF that has been proved indifferentiable from -// a random oracle under a reasonable cryptographic assumption. -// https://www.rfc-editor.org/rfc/rfc9380#section-5.3.2 -function expand_message_xof(msg, DST, lenInBytes, k, H) { - (0, utils_js_1.abytes)(msg); - (0, utils_js_1.abytes)(DST); - anum(lenInBytes); - // https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3 - // DST = H('H2C-OVERSIZE-DST-' || a_very_long_DST, Math.ceil((lenInBytes * k) / 8)); - if (DST.length > 255) { - const dkLen = Math.ceil((2 * k) / 8); - DST = H.create({ dkLen }).update((0, utils_js_1.utf8ToBytes)('H2C-OVERSIZE-DST-')).update(DST).digest(); - } - if (lenInBytes > 65535 || DST.length > 255) - throw new Error('expand_message_xof: invalid lenInBytes'); - return (H.create({ dkLen: lenInBytes }) - .update(msg) - .update(i2osp(lenInBytes, 2)) - // 2. DST_prime = DST || I2OSP(len(DST), 1) - .update(DST) - .update(i2osp(DST.length, 1)) - .digest()); -} -/** - * Hashes arbitrary-length byte strings to a list of one or more elements of a finite field F - * https://www.rfc-editor.org/rfc/rfc9380#section-5.2 - * @param msg a byte string containing the message to hash - * @param count the number of elements of F to output - * @param options `{DST: string, p: bigint, m: number, k: number, expand: 'xmd' | 'xof', hash: H}`, see above - * @returns [u_0, ..., u_(count - 1)], a list of field elements. - */ -function hash_to_field(msg, count, options) { - (0, utils_js_1.validateObject)(options, { - DST: 'stringOrUint8Array', - p: 'bigint', - m: 'isSafeInteger', - k: 'isSafeInteger', - hash: 'hash', - }); - const { p, k, m, hash, expand, DST: _DST } = options; - (0, utils_js_1.abytes)(msg); - anum(count); - const DST = typeof _DST === 'string' ? (0, utils_js_1.utf8ToBytes)(_DST) : _DST; - const log2p = p.toString(2).length; - const L = Math.ceil((log2p + k) / 8); // section 5.1 of ietf draft link above - const len_in_bytes = count * m * L; - let prb; // pseudo_random_bytes - if (expand === 'xmd') { - prb = expand_message_xmd(msg, DST, len_in_bytes, hash); - } - else if (expand === 'xof') { - prb = expand_message_xof(msg, DST, len_in_bytes, k, hash); - } - else if (expand === '_internal_pass') { - // for internal tests only - prb = msg; - } - else { - throw new Error('expand must be "xmd" or "xof"'); - } - const u = new Array(count); - for (let i = 0; i < count; i++) { - const e = new Array(m); - for (let j = 0; j < m; j++) { - const elm_offset = L * (j + i * m); - const tv = prb.subarray(elm_offset, elm_offset + L); - e[j] = (0, modular_js_1.mod)(os2ip(tv), p); - } - u[i] = e; - } - return u; -} -function isogenyMap(field, map) { - // Make same order as in spec - const COEFF = map.map((i) => Array.from(i).reverse()); - return (x, y) => { - const [xNum, xDen, yNum, yDen] = COEFF.map((val) => val.reduce((acc, i) => field.add(field.mul(acc, x), i))); - x = field.div(xNum, xDen); // xNum / xDen - y = field.mul(y, field.div(yNum, yDen)); // y * (yNum / yDev) - return { x, y }; - }; -} -function createHasher(Point, mapToCurve, def) { - if (typeof mapToCurve !== 'function') - throw new Error('mapToCurve() must be defined'); - return { - // Encodes byte string to elliptic curve. - // hash_to_curve from https://www.rfc-editor.org/rfc/rfc9380#section-3 - hashToCurve(msg, options) { - const u = hash_to_field(msg, 2, { ...def, DST: def.DST, ...options }); - const u0 = Point.fromAffine(mapToCurve(u[0])); - const u1 = Point.fromAffine(mapToCurve(u[1])); - const P = u0.add(u1).clearCofactor(); - P.assertValidity(); - return P; - }, - // Encodes byte string to elliptic curve. - // encode_to_curve from https://www.rfc-editor.org/rfc/rfc9380#section-3 - encodeToCurve(msg, options) { - const u = hash_to_field(msg, 1, { ...def, DST: def.encodeDST, ...options }); - const P = Point.fromAffine(mapToCurve(u[0])).clearCofactor(); - P.assertValidity(); - return P; - }, - // Same as encodeToCurve, but without hash - mapToCurve(scalars) { - if (!Array.isArray(scalars)) - throw new Error('mapToCurve: expected array of bigints'); - for (const i of scalars) - if (typeof i !== 'bigint') - throw new Error(`mapToCurve: expected array of bigints, got ${i} in array`); - const P = Point.fromAffine(mapToCurve(scalars)).clearCofactor(); - P.assertValidity(); - return P; - }, - }; -} -//# sourceMappingURL=hash-to-curve.js.map - -/***/ }), - -/***/ 89015: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isNegativeLE = void 0; -exports.mod = mod; -exports.pow = pow; -exports.pow2 = pow2; -exports.invert = invert; -exports.tonelliShanks = tonelliShanks; -exports.FpSqrt = FpSqrt; -exports.validateField = validateField; -exports.FpPow = FpPow; -exports.FpInvertBatch = FpInvertBatch; -exports.FpDiv = FpDiv; -exports.FpIsSquare = FpIsSquare; -exports.nLength = nLength; -exports.Field = Field; -exports.FpSqrtOdd = FpSqrtOdd; -exports.FpSqrtEven = FpSqrtEven; -exports.hashToPrivateScalar = hashToPrivateScalar; -exports.getFieldBytesLength = getFieldBytesLength; -exports.getMinHashLength = getMinHashLength; -exports.mapHashToField = mapHashToField; -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// Utilities for modular arithmetics and finite fields -const utils_js_1 = __webpack_require__(19372); -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3); -// prettier-ignore -const _4n = BigInt(4), _5n = BigInt(5), _8n = BigInt(8); -// prettier-ignore -const _9n = BigInt(9), _16n = BigInt(16); -// Calculates a modulo b -function mod(a, b) { - const result = a % b; - return result >= _0n ? result : b + result; -} -/** - * Efficiently raise num to power and do modular division. - * Unsafe in some contexts: uses ladder, so can expose bigint bits. - * @example - * pow(2n, 6n, 11n) // 64n % 11n == 9n - */ -// TODO: use field version && remove -function pow(num, power, modulo) { - if (modulo <= _0n || power < _0n) - throw new Error('Expected power/modulo > 0'); - if (modulo === _1n) - return _0n; - let res = _1n; - while (power > _0n) { - if (power & _1n) - res = (res * num) % modulo; - num = (num * num) % modulo; - power >>= _1n; - } - return res; -} -// Does x ^ (2 ^ power) mod p. pow2(30, 4) == 30 ^ (2 ^ 4) -function pow2(x, power, modulo) { - let res = x; - while (power-- > _0n) { - res *= res; - res %= modulo; - } - return res; -} -// Inverses number over modulo -function invert(number, modulo) { - if (number === _0n || modulo <= _0n) { - throw new Error(`invert: expected positive integers, got n=${number} mod=${modulo}`); - } - // Euclidean GCD https://brilliant.org/wiki/extended-euclidean-algorithm/ - // Fermat's little theorem "CT-like" version inv(n) = n^(m-2) mod m is 30x slower. - let a = mod(number, modulo); - let b = modulo; - // prettier-ignore - let x = _0n, y = _1n, u = _1n, v = _0n; - while (a !== _0n) { - // JIT applies optimization if those two lines follow each other - const q = b / a; - const r = b % a; - const m = x - u * q; - const n = y - v * q; - // prettier-ignore - b = a, a = r, x = u, y = v, u = m, v = n; - } - const gcd = b; - if (gcd !== _1n) - throw new Error('invert: does not exist'); - return mod(x, modulo); -} -/** - * Tonelli-Shanks square root search algorithm. - * 1. https://eprint.iacr.org/2012/685.pdf (page 12) - * 2. Square Roots from 1; 24, 51, 10 to Dan Shanks - * Will start an infinite loop if field order P is not prime. - * @param P field order - * @returns function that takes field Fp (created from P) and number n - */ -function tonelliShanks(P) { - // Legendre constant: used to calculate Legendre symbol (a | p), - // which denotes the value of a^((p-1)/2) (mod p). - // (a | p) ≡ 1 if a is a square (mod p) - // (a | p) ≡ -1 if a is not a square (mod p) - // (a | p) ≡ 0 if a ≡ 0 (mod p) - const legendreC = (P - _1n) / _2n; - let Q, S, Z; - // Step 1: By factoring out powers of 2 from p - 1, - // find q and s such that p - 1 = q*(2^s) with q odd - for (Q = P - _1n, S = 0; Q % _2n === _0n; Q /= _2n, S++) - ; - // Step 2: Select a non-square z such that (z | p) ≡ -1 and set c ≡ zq - for (Z = _2n; Z < P && pow(Z, legendreC, P) !== P - _1n; Z++) - ; - // Fast-path - if (S === 1) { - const p1div4 = (P + _1n) / _4n; - return function tonelliFast(Fp, n) { - const root = Fp.pow(n, p1div4); - if (!Fp.eql(Fp.sqr(root), n)) - throw new Error('Cannot find square root'); - return root; - }; - } - // Slow-path - const Q1div2 = (Q + _1n) / _2n; - return function tonelliSlow(Fp, n) { - // Step 0: Check that n is indeed a square: (n | p) should not be ≡ -1 - if (Fp.pow(n, legendreC) === Fp.neg(Fp.ONE)) - throw new Error('Cannot find square root'); - let r = S; - // TODO: will fail at Fp2/etc - let g = Fp.pow(Fp.mul(Fp.ONE, Z), Q); // will update both x and b - let x = Fp.pow(n, Q1div2); // first guess at the square root - let b = Fp.pow(n, Q); // first guess at the fudge factor - while (!Fp.eql(b, Fp.ONE)) { - if (Fp.eql(b, Fp.ZERO)) - return Fp.ZERO; // https://en.wikipedia.org/wiki/Tonelli%E2%80%93Shanks_algorithm (4. If t = 0, return r = 0) - // Find m such b^(2^m)==1 - let m = 1; - for (let t2 = Fp.sqr(b); m < r; m++) { - if (Fp.eql(t2, Fp.ONE)) - break; - t2 = Fp.sqr(t2); // t2 *= t2 - } - // NOTE: r-m-1 can be bigger than 32, need to convert to bigint before shift, otherwise there will be overflow - const ge = Fp.pow(g, _1n << BigInt(r - m - 1)); // ge = 2^(r-m-1) - g = Fp.sqr(ge); // g = ge * ge - x = Fp.mul(x, ge); // x *= ge - b = Fp.mul(b, g); // b *= g - r = m; - } - return x; - }; -} -function FpSqrt(P) { - // NOTE: different algorithms can give different roots, it is up to user to decide which one they want. - // For example there is FpSqrtOdd/FpSqrtEven to choice root based on oddness (used for hash-to-curve). - // P ≡ 3 (mod 4) - // √n = n^((P+1)/4) - if (P % _4n === _3n) { - // Not all roots possible! - // const ORDER = - // 0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaabn; - // const NUM = 72057594037927816n; - const p1div4 = (P + _1n) / _4n; - return function sqrt3mod4(Fp, n) { - const root = Fp.pow(n, p1div4); - // Throw if root**2 != n - if (!Fp.eql(Fp.sqr(root), n)) - throw new Error('Cannot find square root'); - return root; - }; - } - // Atkin algorithm for q ≡ 5 (mod 8), https://eprint.iacr.org/2012/685.pdf (page 10) - if (P % _8n === _5n) { - const c1 = (P - _5n) / _8n; - return function sqrt5mod8(Fp, n) { - const n2 = Fp.mul(n, _2n); - const v = Fp.pow(n2, c1); - const nv = Fp.mul(n, v); - const i = Fp.mul(Fp.mul(nv, _2n), v); - const root = Fp.mul(nv, Fp.sub(i, Fp.ONE)); - if (!Fp.eql(Fp.sqr(root), n)) - throw new Error('Cannot find square root'); - return root; - }; - } - // P ≡ 9 (mod 16) - if (P % _16n === _9n) { - // NOTE: tonelli is too slow for bls-Fp2 calculations even on start - // Means we cannot use sqrt for constants at all! - // - // const c1 = Fp.sqrt(Fp.negate(Fp.ONE)); // 1. c1 = sqrt(-1) in F, i.e., (c1^2) == -1 in F - // const c2 = Fp.sqrt(c1); // 2. c2 = sqrt(c1) in F, i.e., (c2^2) == c1 in F - // const c3 = Fp.sqrt(Fp.negate(c1)); // 3. c3 = sqrt(-c1) in F, i.e., (c3^2) == -c1 in F - // const c4 = (P + _7n) / _16n; // 4. c4 = (q + 7) / 16 # Integer arithmetic - // sqrt = (x) => { - // let tv1 = Fp.pow(x, c4); // 1. tv1 = x^c4 - // let tv2 = Fp.mul(c1, tv1); // 2. tv2 = c1 * tv1 - // const tv3 = Fp.mul(c2, tv1); // 3. tv3 = c2 * tv1 - // let tv4 = Fp.mul(c3, tv1); // 4. tv4 = c3 * tv1 - // const e1 = Fp.equals(Fp.square(tv2), x); // 5. e1 = (tv2^2) == x - // const e2 = Fp.equals(Fp.square(tv3), x); // 6. e2 = (tv3^2) == x - // tv1 = Fp.cmov(tv1, tv2, e1); // 7. tv1 = CMOV(tv1, tv2, e1) # Select tv2 if (tv2^2) == x - // tv2 = Fp.cmov(tv4, tv3, e2); // 8. tv2 = CMOV(tv4, tv3, e2) # Select tv3 if (tv3^2) == x - // const e3 = Fp.equals(Fp.square(tv2), x); // 9. e3 = (tv2^2) == x - // return Fp.cmov(tv1, tv2, e3); // 10. z = CMOV(tv1, tv2, e3) # Select the sqrt from tv1 and tv2 - // } - } - // Other cases: Tonelli-Shanks algorithm - return tonelliShanks(P); -} -// Little-endian check for first LE bit (last BE bit); -const isNegativeLE = (num, modulo) => (mod(num, modulo) & _1n) === _1n; -exports.isNegativeLE = isNegativeLE; -// prettier-ignore -const FIELD_FIELDS = [ - 'create', 'isValid', 'is0', 'neg', 'inv', 'sqrt', 'sqr', - 'eql', 'add', 'sub', 'mul', 'pow', 'div', - 'addN', 'subN', 'mulN', 'sqrN' -]; -function validateField(field) { - const initial = { - ORDER: 'bigint', - MASK: 'bigint', - BYTES: 'isSafeInteger', - BITS: 'isSafeInteger', - }; - const opts = FIELD_FIELDS.reduce((map, val) => { - map[val] = 'function'; - return map; - }, initial); - return (0, utils_js_1.validateObject)(field, opts); -} -// Generic field functions -/** - * Same as `pow` but for Fp: non-constant-time. - * Unsafe in some contexts: uses ladder, so can expose bigint bits. - */ -function FpPow(f, num, power) { - // Should have same speed as pow for bigints - // TODO: benchmark! - if (power < _0n) - throw new Error('Expected power > 0'); - if (power === _0n) - return f.ONE; - if (power === _1n) - return num; - let p = f.ONE; - let d = num; - while (power > _0n) { - if (power & _1n) - p = f.mul(p, d); - d = f.sqr(d); - power >>= _1n; - } - return p; -} -/** - * Efficiently invert an array of Field elements. - * `inv(0)` will return `undefined` here: make sure to throw an error. - */ -function FpInvertBatch(f, nums) { - const tmp = new Array(nums.length); - // Walk from first to last, multiply them by each other MOD p - const lastMultiplied = nums.reduce((acc, num, i) => { - if (f.is0(num)) - return acc; - tmp[i] = acc; - return f.mul(acc, num); - }, f.ONE); - // Invert last element - const inverted = f.inv(lastMultiplied); - // Walk from last to first, multiply them by inverted each other MOD p - nums.reduceRight((acc, num, i) => { - if (f.is0(num)) - return acc; - tmp[i] = f.mul(acc, tmp[i]); - return f.mul(acc, num); - }, inverted); - return tmp; -} -function FpDiv(f, lhs, rhs) { - return f.mul(lhs, typeof rhs === 'bigint' ? invert(rhs, f.ORDER) : f.inv(rhs)); -} -// This function returns True whenever the value x is a square in the field F. -function FpIsSquare(f) { - const legendreConst = (f.ORDER - _1n) / _2n; // Integer arithmetic - return (x) => { - const p = f.pow(x, legendreConst); - return f.eql(p, f.ZERO) || f.eql(p, f.ONE); - }; -} -// CURVE.n lengths -function nLength(n, nBitLength) { - // Bit size, byte size of CURVE.n - const _nBitLength = nBitLength !== undefined ? nBitLength : n.toString(2).length; - const nByteLength = Math.ceil(_nBitLength / 8); - return { nBitLength: _nBitLength, nByteLength }; -} -/** - * Initializes a finite field over prime. **Non-primes are not supported.** - * Do not init in loop: slow. Very fragile: always run a benchmark on a change. - * Major performance optimizations: - * * a) denormalized operations like mulN instead of mul - * * b) same object shape: never add or remove keys - * * c) Object.freeze - * @param ORDER prime positive bigint - * @param bitLen how many bits the field consumes - * @param isLE (def: false) if encoding / decoding should be in little-endian - * @param redef optional faster redefinitions of sqrt and other methods - */ -function Field(ORDER, bitLen, isLE = false, redef = {}) { - if (ORDER <= _0n) - throw new Error(`Expected Field ORDER > 0, got ${ORDER}`); - const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, bitLen); - if (BYTES > 2048) - throw new Error('Field lengths over 2048 bytes are not supported'); - const sqrtP = FpSqrt(ORDER); - const f = Object.freeze({ - ORDER, - BITS, - BYTES, - MASK: (0, utils_js_1.bitMask)(BITS), - ZERO: _0n, - ONE: _1n, - create: (num) => mod(num, ORDER), - isValid: (num) => { - if (typeof num !== 'bigint') - throw new Error(`Invalid field element: expected bigint, got ${typeof num}`); - return _0n <= num && num < ORDER; // 0 is valid element, but it's not invertible - }, - is0: (num) => num === _0n, - isOdd: (num) => (num & _1n) === _1n, - neg: (num) => mod(-num, ORDER), - eql: (lhs, rhs) => lhs === rhs, - sqr: (num) => mod(num * num, ORDER), - add: (lhs, rhs) => mod(lhs + rhs, ORDER), - sub: (lhs, rhs) => mod(lhs - rhs, ORDER), - mul: (lhs, rhs) => mod(lhs * rhs, ORDER), - pow: (num, power) => FpPow(f, num, power), - div: (lhs, rhs) => mod(lhs * invert(rhs, ORDER), ORDER), - // Same as above, but doesn't normalize - sqrN: (num) => num * num, - addN: (lhs, rhs) => lhs + rhs, - subN: (lhs, rhs) => lhs - rhs, - mulN: (lhs, rhs) => lhs * rhs, - inv: (num) => invert(num, ORDER), - sqrt: redef.sqrt || ((n) => sqrtP(f, n)), - invertBatch: (lst) => FpInvertBatch(f, lst), - // TODO: do we really need constant cmov? - // We don't have const-time bigints anyway, so probably will be not very useful - cmov: (a, b, c) => (c ? b : a), - toBytes: (num) => (isLE ? (0, utils_js_1.numberToBytesLE)(num, BYTES) : (0, utils_js_1.numberToBytesBE)(num, BYTES)), - fromBytes: (bytes) => { - if (bytes.length !== BYTES) - throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes.length}`); - return isLE ? (0, utils_js_1.bytesToNumberLE)(bytes) : (0, utils_js_1.bytesToNumberBE)(bytes); - }, - }); - return Object.freeze(f); -} -function FpSqrtOdd(Fp, elm) { - if (!Fp.isOdd) - throw new Error(`Field doesn't have isOdd`); - const root = Fp.sqrt(elm); - return Fp.isOdd(root) ? root : Fp.neg(root); -} -function FpSqrtEven(Fp, elm) { - if (!Fp.isOdd) - throw new Error(`Field doesn't have isOdd`); - const root = Fp.sqrt(elm); - return Fp.isOdd(root) ? Fp.neg(root) : root; -} -/** - * "Constant-time" private key generation utility. - * Same as mapKeyToField, but accepts less bytes (40 instead of 48 for 32-byte field). - * Which makes it slightly more biased, less secure. - * @deprecated use mapKeyToField instead - */ -function hashToPrivateScalar(hash, groupOrder, isLE = false) { - hash = (0, utils_js_1.ensureBytes)('privateHash', hash); - const hashLen = hash.length; - const minLen = nLength(groupOrder).nByteLength + 8; - if (minLen < 24 || hashLen < minLen || hashLen > 1024) - throw new Error(`hashToPrivateScalar: expected ${minLen}-1024 bytes of input, got ${hashLen}`); - const num = isLE ? (0, utils_js_1.bytesToNumberLE)(hash) : (0, utils_js_1.bytesToNumberBE)(hash); - return mod(num, groupOrder - _1n) + _1n; -} -/** - * Returns total number of bytes consumed by the field element. - * For example, 32 bytes for usual 256-bit weierstrass curve. - * @param fieldOrder number of field elements, usually CURVE.n - * @returns byte length of field - */ -function getFieldBytesLength(fieldOrder) { - if (typeof fieldOrder !== 'bigint') - throw new Error('field order must be bigint'); - const bitLength = fieldOrder.toString(2).length; - return Math.ceil(bitLength / 8); -} -/** - * Returns minimal amount of bytes that can be safely reduced - * by field order. - * Should be 2^-128 for 128-bit curve such as P256. - * @param fieldOrder number of field elements, usually CURVE.n - * @returns byte length of target hash - */ -function getMinHashLength(fieldOrder) { - const length = getFieldBytesLength(fieldOrder); - return length + Math.ceil(length / 2); -} -/** - * "Constant-time" private key generation utility. - * Can take (n + n/2) or more bytes of uniform input e.g. from CSPRNG or KDF - * and convert them into private scalar, with the modulo bias being negligible. - * Needs at least 48 bytes of input for 32-byte private key. - * https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/ - * FIPS 186-5, A.2 https://csrc.nist.gov/publications/detail/fips/186/5/final - * RFC 9380, https://www.rfc-editor.org/rfc/rfc9380#section-5 - * @param hash hash output from SHA3 or a similar function - * @param groupOrder size of subgroup - (e.g. secp256k1.CURVE.n) - * @param isLE interpret hash bytes as LE num - * @returns valid private scalar - */ -function mapHashToField(key, fieldOrder, isLE = false) { - const len = key.length; - const fieldLen = getFieldBytesLength(fieldOrder); - const minLen = getMinHashLength(fieldOrder); - // No small numbers: need to understand bias story. No huge numbers: easier to detect JS timings. - if (len < 16 || len < minLen || len > 1024) - throw new Error(`expected ${minLen}-1024 bytes of input, got ${len}`); - const num = isLE ? (0, utils_js_1.bytesToNumberBE)(key) : (0, utils_js_1.bytesToNumberLE)(key); - // `mod(x, 11)` can sometimes produce 0. `mod(x, 10) + 1` is the same, but no 0 - const reduced = mod(num, fieldOrder - _1n) + _1n; - return isLE ? (0, utils_js_1.numberToBytesLE)(reduced, fieldLen) : (0, utils_js_1.numberToBytesBE)(reduced, fieldLen); -} -//# sourceMappingURL=modular.js.map - -/***/ }), - -/***/ 19372: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.bitMask = void 0; -exports.isBytes = isBytes; -exports.abytes = abytes; -exports.bytesToHex = bytesToHex; -exports.numberToHexUnpadded = numberToHexUnpadded; -exports.hexToNumber = hexToNumber; -exports.hexToBytes = hexToBytes; -exports.bytesToNumberBE = bytesToNumberBE; -exports.bytesToNumberLE = bytesToNumberLE; -exports.numberToBytesBE = numberToBytesBE; -exports.numberToBytesLE = numberToBytesLE; -exports.numberToVarBytesBE = numberToVarBytesBE; -exports.ensureBytes = ensureBytes; -exports.concatBytes = concatBytes; -exports.equalBytes = equalBytes; -exports.utf8ToBytes = utf8ToBytes; -exports.bitLen = bitLen; -exports.bitGet = bitGet; -exports.bitSet = bitSet; -exports.createHmacDrbg = createHmacDrbg; -exports.validateObject = validateObject; -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// 100 lines of code in the file are duplicated from noble-hashes (utils). -// This is OK: `abstract` directory does not use noble-hashes. -// User may opt-in into using different hashing library. This way, noble-hashes -// won't be included into their bundle. -const _0n = /* @__PURE__ */ BigInt(0); -const _1n = /* @__PURE__ */ BigInt(1); -const _2n = /* @__PURE__ */ BigInt(2); -function isBytes(a) { - return (a instanceof Uint8Array || - (a != null && typeof a === 'object' && a.constructor.name === 'Uint8Array')); -} -function abytes(item) { - if (!isBytes(item)) - throw new Error('Uint8Array expected'); -} -// Array where index 0xf0 (240) is mapped to string 'f0' -const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0')); -/** - * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' - */ -function bytesToHex(bytes) { - abytes(bytes); - // pre-caching improves the speed 6x - let hex = ''; - for (let i = 0; i < bytes.length; i++) { - hex += hexes[bytes[i]]; - } - return hex; -} -function numberToHexUnpadded(num) { - const hex = num.toString(16); - return hex.length & 1 ? `0${hex}` : hex; -} -function hexToNumber(hex) { - if (typeof hex !== 'string') - throw new Error('hex string expected, got ' + typeof hex); - // Big Endian - return BigInt(hex === '' ? '0' : `0x${hex}`); -} -// We use optimized technique to convert hex string to byte array -const asciis = { _0: 48, _9: 57, _A: 65, _F: 70, _a: 97, _f: 102 }; -function asciiToBase16(char) { - if (char >= asciis._0 && char <= asciis._9) - return char - asciis._0; - if (char >= asciis._A && char <= asciis._F) - return char - (asciis._A - 10); - if (char >= asciis._a && char <= asciis._f) - return char - (asciis._a - 10); - return; -} -/** - * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) - */ -function hexToBytes(hex) { - if (typeof hex !== 'string') - throw new Error('hex string expected, got ' + typeof hex); - const hl = hex.length; - const al = hl / 2; - if (hl % 2) - throw new Error('padded hex string expected, got unpadded hex of length ' + hl); - const array = new Uint8Array(al); - for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) { - const n1 = asciiToBase16(hex.charCodeAt(hi)); - const n2 = asciiToBase16(hex.charCodeAt(hi + 1)); - if (n1 === undefined || n2 === undefined) { - const char = hex[hi] + hex[hi + 1]; - throw new Error('hex string expected, got non-hex character "' + char + '" at index ' + hi); - } - array[ai] = n1 * 16 + n2; - } - return array; -} -// BE: Big Endian, LE: Little Endian -function bytesToNumberBE(bytes) { - return hexToNumber(bytesToHex(bytes)); -} -function bytesToNumberLE(bytes) { - abytes(bytes); - return hexToNumber(bytesToHex(Uint8Array.from(bytes).reverse())); -} -function numberToBytesBE(n, len) { - return hexToBytes(n.toString(16).padStart(len * 2, '0')); -} -function numberToBytesLE(n, len) { - return numberToBytesBE(n, len).reverse(); -} -// Unpadded, rarely used -function numberToVarBytesBE(n) { - return hexToBytes(numberToHexUnpadded(n)); -} -/** - * Takes hex string or Uint8Array, converts to Uint8Array. - * Validates output length. - * Will throw error for other types. - * @param title descriptive title for an error e.g. 'private key' - * @param hex hex string or Uint8Array - * @param expectedLength optional, will compare to result array's length - * @returns - */ -function ensureBytes(title, hex, expectedLength) { - let res; - if (typeof hex === 'string') { - try { - res = hexToBytes(hex); - } - catch (e) { - throw new Error(`${title} must be valid hex string, got "${hex}". Cause: ${e}`); - } - } - else if (isBytes(hex)) { - // Uint8Array.from() instead of hash.slice() because node.js Buffer - // is instance of Uint8Array, and its slice() creates **mutable** copy - res = Uint8Array.from(hex); - } - else { - throw new Error(`${title} must be hex string or Uint8Array`); - } - const len = res.length; - if (typeof expectedLength === 'number' && len !== expectedLength) - throw new Error(`${title} expected ${expectedLength} bytes, got ${len}`); - return res; -} -/** - * Copies several Uint8Arrays into one. - */ -function concatBytes(...arrays) { - let sum = 0; - for (let i = 0; i < arrays.length; i++) { - const a = arrays[i]; - abytes(a); - sum += a.length; - } - const res = new Uint8Array(sum); - for (let i = 0, pad = 0; i < arrays.length; i++) { - const a = arrays[i]; - res.set(a, pad); - pad += a.length; - } - return res; -} -// Compares 2 u8a-s in kinda constant time -function equalBytes(a, b) { - if (a.length !== b.length) - return false; - let diff = 0; - for (let i = 0; i < a.length; i++) - diff |= a[i] ^ b[i]; - return diff === 0; -} -/** - * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) - */ -function utf8ToBytes(str) { - if (typeof str !== 'string') - throw new Error(`utf8ToBytes expected string, got ${typeof str}`); - return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 -} -// Bit operations -/** - * Calculates amount of bits in a bigint. - * Same as `n.toString(2).length` - */ -function bitLen(n) { - let len; - for (len = 0; n > _0n; n >>= _1n, len += 1) - ; - return len; -} -/** - * Gets single bit at position. - * NOTE: first bit position is 0 (same as arrays) - * Same as `!!+Array.from(n.toString(2)).reverse()[pos]` - */ -function bitGet(n, pos) { - return (n >> BigInt(pos)) & _1n; -} -/** - * Sets single bit at position. - */ -function bitSet(n, pos, value) { - return n | ((value ? _1n : _0n) << BigInt(pos)); -} -/** - * Calculate mask for N bits. Not using ** operator with bigints because of old engines. - * Same as BigInt(`0b${Array(i).fill('1').join('')}`) - */ -const bitMask = (n) => (_2n << BigInt(n - 1)) - _1n; -exports.bitMask = bitMask; -// DRBG -const u8n = (data) => new Uint8Array(data); // creates Uint8Array -const u8fr = (arr) => Uint8Array.from(arr); // another shortcut -/** - * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs. - * @returns function that will call DRBG until 2nd arg returns something meaningful - * @example - * const drbg = createHmacDRBG(32, 32, hmac); - * drbg(seed, bytesToKey); // bytesToKey must return Key or undefined - */ -function createHmacDrbg(hashLen, qByteLen, hmacFn) { - if (typeof hashLen !== 'number' || hashLen < 2) - throw new Error('hashLen must be a number'); - if (typeof qByteLen !== 'number' || qByteLen < 2) - throw new Error('qByteLen must be a number'); - if (typeof hmacFn !== 'function') - throw new Error('hmacFn must be a function'); - // Step B, Step C: set hashLen to 8*ceil(hlen/8) - let v = u8n(hashLen); // Minimal non-full-spec HMAC-DRBG from NIST 800-90 for RFC6979 sigs. - let k = u8n(hashLen); // Steps B and C of RFC6979 3.2: set hashLen, in our case always same - let i = 0; // Iterations counter, will throw when over 1000 - const reset = () => { - v.fill(1); - k.fill(0); - i = 0; - }; - const h = (...b) => hmacFn(k, v, ...b); // hmac(k)(v, ...values) - const reseed = (seed = u8n()) => { - // HMAC-DRBG reseed() function. Steps D-G - k = h(u8fr([0x00]), seed); // k = hmac(k || v || 0x00 || seed) - v = h(); // v = hmac(k || v) - if (seed.length === 0) - return; - k = h(u8fr([0x01]), seed); // k = hmac(k || v || 0x01 || seed) - v = h(); // v = hmac(k || v) - }; - const gen = () => { - // HMAC-DRBG generate() function - if (i++ >= 1000) - throw new Error('drbg: tried 1000 values'); - let len = 0; - const out = []; - while (len < qByteLen) { - v = h(); - const sl = v.slice(); - out.push(sl); - len += v.length; - } - return concatBytes(...out); - }; - const genUntil = (seed, pred) => { - reset(); - reseed(seed); // Steps D-G - let res = undefined; // Step H: grind until k is in [1..n-1] - while (!(res = pred(gen()))) - reseed(); - reset(); - return res; - }; - return genUntil; -} -// Validating curves and fields -const validatorFns = { - bigint: (val) => typeof val === 'bigint', - function: (val) => typeof val === 'function', - boolean: (val) => typeof val === 'boolean', - string: (val) => typeof val === 'string', - stringOrUint8Array: (val) => typeof val === 'string' || isBytes(val), - isSafeInteger: (val) => Number.isSafeInteger(val), - array: (val) => Array.isArray(val), - field: (val, object) => object.Fp.isValid(val), - hash: (val) => typeof val === 'function' && Number.isSafeInteger(val.outputLen), -}; -// type Record = { [P in K]: T; } -function validateObject(object, validators, optValidators = {}) { - const checkField = (fieldName, type, isOptional) => { - const checkVal = validatorFns[type]; - if (typeof checkVal !== 'function') - throw new Error(`Invalid validator "${type}", expected function`); - const val = object[fieldName]; - if (isOptional && val === undefined) - return; - if (!checkVal(val, object)) { - throw new Error(`Invalid param ${String(fieldName)}=${val} (${typeof val}), expected ${type}`); - } - }; - for (const [fieldName, type] of Object.entries(validators)) - checkField(fieldName, type, false); - for (const [fieldName, type] of Object.entries(optValidators)) - checkField(fieldName, type, true); - return object; -} -// validate type tests -// const o: { a: number; b: number; c: number } = { a: 1, b: 5, c: 6 }; -// const z0 = validateObject(o, { a: 'isSafeInteger' }, { c: 'bigint' }); // Ok! -// // Should fail type-check -// const z1 = validateObject(o, { a: 'tmp' }, { c: 'zz' }); -// const z2 = validateObject(o, { a: 'isSafeInteger' }, { c: 'zz' }); -// const z3 = validateObject(o, { test: 'boolean', z: 'bug' }); -// const z4 = validateObject(o, { a: 'boolean', z: 'bug' }); -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 20489: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DER = void 0; -exports.weierstrassPoints = weierstrassPoints; -exports.weierstrass = weierstrass; -exports.SWUFpSqrtRatio = SWUFpSqrtRatio; -exports.mapToCurveSimpleSWU = mapToCurveSimpleSWU; -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// Short Weierstrass curve. The formula is: y² = x³ + ax + b -const curve_js_1 = __webpack_require__(59206); -const mod = __webpack_require__(89015); -const ut = __webpack_require__(19372); -const utils_js_1 = __webpack_require__(19372); -function validatePointOpts(curve) { - const opts = (0, curve_js_1.validateBasic)(curve); - ut.validateObject(opts, { - a: 'field', - b: 'field', - }, { - allowedPrivateKeyLengths: 'array', - wrapPrivateKey: 'boolean', - isTorsionFree: 'function', - clearCofactor: 'function', - allowInfinityPoint: 'boolean', - fromBytes: 'function', - toBytes: 'function', - }); - const { endo, Fp, a } = opts; - if (endo) { - if (!Fp.eql(a, Fp.ZERO)) { - throw new Error('Endomorphism can only be defined for Koblitz curves that have a=0'); - } - if (typeof endo !== 'object' || - typeof endo.beta !== 'bigint' || - typeof endo.splitScalar !== 'function') { - throw new Error('Expected endomorphism with beta: bigint and splitScalar: function'); - } - } - return Object.freeze({ ...opts }); -} -// ASN.1 DER encoding utilities -const { bytesToNumberBE: b2n, hexToBytes: h2b } = ut; -exports.DER = { - // asn.1 DER encoding utils - Err: class DERErr extends Error { - constructor(m = '') { - super(m); - } - }, - _parseInt(data) { - const { Err: E } = exports.DER; - if (data.length < 2 || data[0] !== 0x02) - throw new E('Invalid signature integer tag'); - const len = data[1]; - const res = data.subarray(2, len + 2); - if (!len || res.length !== len) - throw new E('Invalid signature integer: wrong length'); - // https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag, - // since we always use positive integers here. It must always be empty: - // - add zero byte if exists - // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding) - if (res[0] & 0b10000000) - throw new E('Invalid signature integer: negative'); - if (res[0] === 0x00 && !(res[1] & 0b10000000)) - throw new E('Invalid signature integer: unnecessary leading zero'); - return { d: b2n(res), l: data.subarray(len + 2) }; // d is data, l is left - }, - toSig(hex) { - // parse DER signature - const { Err: E } = exports.DER; - const data = typeof hex === 'string' ? h2b(hex) : hex; - ut.abytes(data); - let l = data.length; - if (l < 2 || data[0] != 0x30) - throw new E('Invalid signature tag'); - if (data[1] !== l - 2) - throw new E('Invalid signature: incorrect length'); - const { d: r, l: sBytes } = exports.DER._parseInt(data.subarray(2)); - const { d: s, l: rBytesLeft } = exports.DER._parseInt(sBytes); - if (rBytesLeft.length) - throw new E('Invalid signature: left bytes after parsing'); - return { r, s }; - }, - hexFromSig(sig) { - // Add leading zero if first byte has negative bit enabled. More details in '_parseInt' - const slice = (s) => (Number.parseInt(s[0], 16) & 0b1000 ? '00' + s : s); - const h = (num) => { - const hex = num.toString(16); - return hex.length & 1 ? `0${hex}` : hex; - }; - const s = slice(h(sig.s)); - const r = slice(h(sig.r)); - const shl = s.length / 2; - const rhl = r.length / 2; - const sl = h(shl); - const rl = h(rhl); - return `30${h(rhl + shl + 4)}02${rl}${r}02${sl}${s}`; - }, -}; -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4); -function weierstrassPoints(opts) { - const CURVE = validatePointOpts(opts); - const { Fp } = CURVE; // All curves has same field / group length as for now, but they can differ - const toBytes = CURVE.toBytes || - ((_c, point, _isCompressed) => { - const a = point.toAffine(); - return ut.concatBytes(Uint8Array.from([0x04]), Fp.toBytes(a.x), Fp.toBytes(a.y)); - }); - const fromBytes = CURVE.fromBytes || - ((bytes) => { - // const head = bytes[0]; - const tail = bytes.subarray(1); - // if (head !== 0x04) throw new Error('Only non-compressed encoding is supported'); - const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES)); - const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES)); - return { x, y }; - }); - /** - * y² = x³ + ax + b: Short weierstrass curve formula - * @returns y² - */ - function weierstrassEquation(x) { - const { a, b } = CURVE; - const x2 = Fp.sqr(x); // x * x - const x3 = Fp.mul(x2, x); // x2 * x - return Fp.add(Fp.add(x3, Fp.mul(x, a)), b); // x3 + a * x + b - } - // Validate whether the passed curve params are valid. - // We check if curve equation works for generator point. - // `assertValidity()` won't work: `isTorsionFree()` is not available at this point in bls12-381. - // ProjectivePoint class has not been initialized yet. - if (!Fp.eql(Fp.sqr(CURVE.Gy), weierstrassEquation(CURVE.Gx))) - throw new Error('bad generator point: equation left != right'); - // Valid group elements reside in range 1..n-1 - function isWithinCurveOrder(num) { - return typeof num === 'bigint' && _0n < num && num < CURVE.n; - } - function assertGE(num) { - if (!isWithinCurveOrder(num)) - throw new Error('Expected valid bigint: 0 < bigint < curve.n'); - } - // Validates if priv key is valid and converts it to bigint. - // Supports options allowedPrivateKeyLengths and wrapPrivateKey. - function normPrivateKeyToScalar(key) { - const { allowedPrivateKeyLengths: lengths, nByteLength, wrapPrivateKey, n } = CURVE; - if (lengths && typeof key !== 'bigint') { - if (ut.isBytes(key)) - key = ut.bytesToHex(key); - // Normalize to hex string, pad. E.g. P521 would norm 130-132 char hex to 132-char bytes - if (typeof key !== 'string' || !lengths.includes(key.length)) - throw new Error('Invalid key'); - key = key.padStart(nByteLength * 2, '0'); - } - let num; - try { - num = - typeof key === 'bigint' - ? key - : ut.bytesToNumberBE((0, utils_js_1.ensureBytes)('private key', key, nByteLength)); - } - catch (error) { - throw new Error(`private key must be ${nByteLength} bytes, hex or bigint, not ${typeof key}`); - } - if (wrapPrivateKey) - num = mod.mod(num, n); // disabled by default, enabled for BLS - assertGE(num); // num in range [1..N-1] - return num; - } - const pointPrecomputes = new Map(); - function assertPrjPoint(other) { - if (!(other instanceof Point)) - throw new Error('ProjectivePoint expected'); - } - /** - * Projective Point works in 3d / projective (homogeneous) coordinates: (x, y, z) ∋ (x=x/z, y=y/z) - * Default Point works in 2d / affine coordinates: (x, y) - * We're doing calculations in projective, because its operations don't require costly inversion. - */ - class Point { - constructor(px, py, pz) { - this.px = px; - this.py = py; - this.pz = pz; - if (px == null || !Fp.isValid(px)) - throw new Error('x required'); - if (py == null || !Fp.isValid(py)) - throw new Error('y required'); - if (pz == null || !Fp.isValid(pz)) - throw new Error('z required'); - } - // Does not validate if the point is on-curve. - // Use fromHex instead, or call assertValidity() later. - static fromAffine(p) { - const { x, y } = p || {}; - if (!p || !Fp.isValid(x) || !Fp.isValid(y)) - throw new Error('invalid affine point'); - if (p instanceof Point) - throw new Error('projective point not allowed'); - const is0 = (i) => Fp.eql(i, Fp.ZERO); - // fromAffine(x:0, y:0) would produce (x:0, y:0, z:1), but we need (x:0, y:1, z:0) - if (is0(x) && is0(y)) - return Point.ZERO; - return new Point(x, y, Fp.ONE); - } - get x() { - return this.toAffine().x; - } - get y() { - return this.toAffine().y; - } - /** - * Takes a bunch of Projective Points but executes only one - * inversion on all of them. Inversion is very slow operation, - * so this improves performance massively. - * Optimization: converts a list of projective points to a list of identical points with Z=1. - */ - static normalizeZ(points) { - const toInv = Fp.invertBatch(points.map((p) => p.pz)); - return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine); - } - /** - * Converts hash string or Uint8Array to Point. - * @param hex short/long ECDSA hex - */ - static fromHex(hex) { - const P = Point.fromAffine(fromBytes((0, utils_js_1.ensureBytes)('pointHex', hex))); - P.assertValidity(); - return P; - } - // Multiplies generator point by privateKey. - static fromPrivateKey(privateKey) { - return Point.BASE.multiply(normPrivateKeyToScalar(privateKey)); - } - // "Private method", don't use it directly - _setWindowSize(windowSize) { - this._WINDOW_SIZE = windowSize; - pointPrecomputes.delete(this); - } - // A point on curve is valid if it conforms to equation. - assertValidity() { - if (this.is0()) { - // (0, 1, 0) aka ZERO is invalid in most contexts. - // In BLS, ZERO can be serialized, so we allow it. - // (0, 0, 0) is wrong representation of ZERO and is always invalid. - if (CURVE.allowInfinityPoint && !Fp.is0(this.py)) - return; - throw new Error('bad point: ZERO'); - } - // Some 3rd-party test vectors require different wording between here & `fromCompressedHex` - const { x, y } = this.toAffine(); - // Check if x, y are valid field elements - if (!Fp.isValid(x) || !Fp.isValid(y)) - throw new Error('bad point: x or y not FE'); - const left = Fp.sqr(y); // y² - const right = weierstrassEquation(x); // x³ + ax + b - if (!Fp.eql(left, right)) - throw new Error('bad point: equation left != right'); - if (!this.isTorsionFree()) - throw new Error('bad point: not in prime-order subgroup'); - } - hasEvenY() { - const { y } = this.toAffine(); - if (Fp.isOdd) - return !Fp.isOdd(y); - throw new Error("Field doesn't support isOdd"); - } - /** - * Compare one point to another. - */ - equals(other) { - assertPrjPoint(other); - const { px: X1, py: Y1, pz: Z1 } = this; - const { px: X2, py: Y2, pz: Z2 } = other; - const U1 = Fp.eql(Fp.mul(X1, Z2), Fp.mul(X2, Z1)); - const U2 = Fp.eql(Fp.mul(Y1, Z2), Fp.mul(Y2, Z1)); - return U1 && U2; - } - /** - * Flips point to one corresponding to (x, -y) in Affine coordinates. - */ - negate() { - return new Point(this.px, Fp.neg(this.py), this.pz); - } - // Renes-Costello-Batina exception-free doubling formula. - // There is 30% faster Jacobian formula, but it is not complete. - // https://eprint.iacr.org/2015/1060, algorithm 3 - // Cost: 8M + 3S + 3*a + 2*b3 + 15add. - double() { - const { a, b } = CURVE; - const b3 = Fp.mul(b, _3n); - const { px: X1, py: Y1, pz: Z1 } = this; - let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore - let t0 = Fp.mul(X1, X1); // step 1 - let t1 = Fp.mul(Y1, Y1); - let t2 = Fp.mul(Z1, Z1); - let t3 = Fp.mul(X1, Y1); - t3 = Fp.add(t3, t3); // step 5 - Z3 = Fp.mul(X1, Z1); - Z3 = Fp.add(Z3, Z3); - X3 = Fp.mul(a, Z3); - Y3 = Fp.mul(b3, t2); - Y3 = Fp.add(X3, Y3); // step 10 - X3 = Fp.sub(t1, Y3); - Y3 = Fp.add(t1, Y3); - Y3 = Fp.mul(X3, Y3); - X3 = Fp.mul(t3, X3); - Z3 = Fp.mul(b3, Z3); // step 15 - t2 = Fp.mul(a, t2); - t3 = Fp.sub(t0, t2); - t3 = Fp.mul(a, t3); - t3 = Fp.add(t3, Z3); - Z3 = Fp.add(t0, t0); // step 20 - t0 = Fp.add(Z3, t0); - t0 = Fp.add(t0, t2); - t0 = Fp.mul(t0, t3); - Y3 = Fp.add(Y3, t0); - t2 = Fp.mul(Y1, Z1); // step 25 - t2 = Fp.add(t2, t2); - t0 = Fp.mul(t2, t3); - X3 = Fp.sub(X3, t0); - Z3 = Fp.mul(t2, t1); - Z3 = Fp.add(Z3, Z3); // step 30 - Z3 = Fp.add(Z3, Z3); - return new Point(X3, Y3, Z3); - } - // Renes-Costello-Batina exception-free addition formula. - // There is 30% faster Jacobian formula, but it is not complete. - // https://eprint.iacr.org/2015/1060, algorithm 1 - // Cost: 12M + 0S + 3*a + 3*b3 + 23add. - add(other) { - assertPrjPoint(other); - const { px: X1, py: Y1, pz: Z1 } = this; - const { px: X2, py: Y2, pz: Z2 } = other; - let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore - const a = CURVE.a; - const b3 = Fp.mul(CURVE.b, _3n); - let t0 = Fp.mul(X1, X2); // step 1 - let t1 = Fp.mul(Y1, Y2); - let t2 = Fp.mul(Z1, Z2); - let t3 = Fp.add(X1, Y1); - let t4 = Fp.add(X2, Y2); // step 5 - t3 = Fp.mul(t3, t4); - t4 = Fp.add(t0, t1); - t3 = Fp.sub(t3, t4); - t4 = Fp.add(X1, Z1); - let t5 = Fp.add(X2, Z2); // step 10 - t4 = Fp.mul(t4, t5); - t5 = Fp.add(t0, t2); - t4 = Fp.sub(t4, t5); - t5 = Fp.add(Y1, Z1); - X3 = Fp.add(Y2, Z2); // step 15 - t5 = Fp.mul(t5, X3); - X3 = Fp.add(t1, t2); - t5 = Fp.sub(t5, X3); - Z3 = Fp.mul(a, t4); - X3 = Fp.mul(b3, t2); // step 20 - Z3 = Fp.add(X3, Z3); - X3 = Fp.sub(t1, Z3); - Z3 = Fp.add(t1, Z3); - Y3 = Fp.mul(X3, Z3); - t1 = Fp.add(t0, t0); // step 25 - t1 = Fp.add(t1, t0); - t2 = Fp.mul(a, t2); - t4 = Fp.mul(b3, t4); - t1 = Fp.add(t1, t2); - t2 = Fp.sub(t0, t2); // step 30 - t2 = Fp.mul(a, t2); - t4 = Fp.add(t4, t2); - t0 = Fp.mul(t1, t4); - Y3 = Fp.add(Y3, t0); - t0 = Fp.mul(t5, t4); // step 35 - X3 = Fp.mul(t3, X3); - X3 = Fp.sub(X3, t0); - t0 = Fp.mul(t3, t1); - Z3 = Fp.mul(t5, Z3); - Z3 = Fp.add(Z3, t0); // step 40 - return new Point(X3, Y3, Z3); - } - subtract(other) { - return this.add(other.negate()); - } - is0() { - return this.equals(Point.ZERO); - } - wNAF(n) { - return wnaf.wNAFCached(this, pointPrecomputes, n, (comp) => { - const toInv = Fp.invertBatch(comp.map((p) => p.pz)); - return comp.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine); - }); - } - /** - * Non-constant-time multiplication. Uses double-and-add algorithm. - * It's faster, but should only be used when you don't care about - * an exposed private key e.g. sig verification, which works over *public* keys. - */ - multiplyUnsafe(n) { - const I = Point.ZERO; - if (n === _0n) - return I; - assertGE(n); // Will throw on 0 - if (n === _1n) - return this; - const { endo } = CURVE; - if (!endo) - return wnaf.unsafeLadder(this, n); - // Apply endomorphism - let { k1neg, k1, k2neg, k2 } = endo.splitScalar(n); - let k1p = I; - let k2p = I; - let d = this; - while (k1 > _0n || k2 > _0n) { - if (k1 & _1n) - k1p = k1p.add(d); - if (k2 & _1n) - k2p = k2p.add(d); - d = d.double(); - k1 >>= _1n; - k2 >>= _1n; - } - if (k1neg) - k1p = k1p.negate(); - if (k2neg) - k2p = k2p.negate(); - k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz); - return k1p.add(k2p); - } - /** - * Constant time multiplication. - * Uses wNAF method. Windowed method may be 10% faster, - * but takes 2x longer to generate and consumes 2x memory. - * Uses precomputes when available. - * Uses endomorphism for Koblitz curves. - * @param scalar by which the point would be multiplied - * @returns New point - */ - multiply(scalar) { - assertGE(scalar); - let n = scalar; - let point, fake; // Fake point is used to const-time mult - const { endo } = CURVE; - if (endo) { - const { k1neg, k1, k2neg, k2 } = endo.splitScalar(n); - let { p: k1p, f: f1p } = this.wNAF(k1); - let { p: k2p, f: f2p } = this.wNAF(k2); - k1p = wnaf.constTimeNegate(k1neg, k1p); - k2p = wnaf.constTimeNegate(k2neg, k2p); - k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz); - point = k1p.add(k2p); - fake = f1p.add(f2p); - } - else { - const { p, f } = this.wNAF(n); - point = p; - fake = f; - } - // Normalize `z` for both points, but return only real one - return Point.normalizeZ([point, fake])[0]; - } - /** - * Efficiently calculate `aP + bQ`. Unsafe, can expose private key, if used incorrectly. - * Not using Strauss-Shamir trick: precomputation tables are faster. - * The trick could be useful if both P and Q are not G (not in our case). - * @returns non-zero affine point - */ - multiplyAndAddUnsafe(Q, a, b) { - const G = Point.BASE; // No Strauss-Shamir trick: we have 10% faster G precomputes - const mul = (P, a // Select faster multiply() method - ) => (a === _0n || a === _1n || !P.equals(G) ? P.multiplyUnsafe(a) : P.multiply(a)); - const sum = mul(this, a).add(mul(Q, b)); - return sum.is0() ? undefined : sum; - } - // Converts Projective point to affine (x, y) coordinates. - // Can accept precomputed Z^-1 - for example, from invertBatch. - // (x, y, z) ∋ (x=x/z, y=y/z) - toAffine(iz) { - const { px: x, py: y, pz: z } = this; - const is0 = this.is0(); - // If invZ was 0, we return zero point. However we still want to execute - // all operations, so we replace invZ with a random number, 1. - if (iz == null) - iz = is0 ? Fp.ONE : Fp.inv(z); - const ax = Fp.mul(x, iz); - const ay = Fp.mul(y, iz); - const zz = Fp.mul(z, iz); - if (is0) - return { x: Fp.ZERO, y: Fp.ZERO }; - if (!Fp.eql(zz, Fp.ONE)) - throw new Error('invZ was invalid'); - return { x: ax, y: ay }; - } - isTorsionFree() { - const { h: cofactor, isTorsionFree } = CURVE; - if (cofactor === _1n) - return true; // No subgroups, always torsion-free - if (isTorsionFree) - return isTorsionFree(Point, this); - throw new Error('isTorsionFree() has not been declared for the elliptic curve'); - } - clearCofactor() { - const { h: cofactor, clearCofactor } = CURVE; - if (cofactor === _1n) - return this; // Fast-path - if (clearCofactor) - return clearCofactor(Point, this); - return this.multiplyUnsafe(CURVE.h); - } - toRawBytes(isCompressed = true) { - this.assertValidity(); - return toBytes(Point, this, isCompressed); - } - toHex(isCompressed = true) { - return ut.bytesToHex(this.toRawBytes(isCompressed)); - } - } - Point.BASE = new Point(CURVE.Gx, CURVE.Gy, Fp.ONE); - Point.ZERO = new Point(Fp.ZERO, Fp.ONE, Fp.ZERO); - const _bits = CURVE.nBitLength; - const wnaf = (0, curve_js_1.wNAF)(Point, CURVE.endo ? Math.ceil(_bits / 2) : _bits); - // Validate if generator point is on curve - return { - CURVE, - ProjectivePoint: Point, - normPrivateKeyToScalar, - weierstrassEquation, - isWithinCurveOrder, - }; -} -function validateOpts(curve) { - const opts = (0, curve_js_1.validateBasic)(curve); - ut.validateObject(opts, { - hash: 'hash', - hmac: 'function', - randomBytes: 'function', - }, { - bits2int: 'function', - bits2int_modN: 'function', - lowS: 'boolean', - }); - return Object.freeze({ lowS: true, ...opts }); -} -function weierstrass(curveDef) { - const CURVE = validateOpts(curveDef); - const { Fp, n: CURVE_ORDER } = CURVE; - const compressedLen = Fp.BYTES + 1; // e.g. 33 for 32 - const uncompressedLen = 2 * Fp.BYTES + 1; // e.g. 65 for 32 - function isValidFieldElement(num) { - return _0n < num && num < Fp.ORDER; // 0 is banned since it's not invertible FE - } - function modN(a) { - return mod.mod(a, CURVE_ORDER); - } - function invN(a) { - return mod.invert(a, CURVE_ORDER); - } - const { ProjectivePoint: Point, normPrivateKeyToScalar, weierstrassEquation, isWithinCurveOrder, } = weierstrassPoints({ - ...CURVE, - toBytes(_c, point, isCompressed) { - const a = point.toAffine(); - const x = Fp.toBytes(a.x); - const cat = ut.concatBytes; - if (isCompressed) { - return cat(Uint8Array.from([point.hasEvenY() ? 0x02 : 0x03]), x); - } - else { - return cat(Uint8Array.from([0x04]), x, Fp.toBytes(a.y)); - } - }, - fromBytes(bytes) { - const len = bytes.length; - const head = bytes[0]; - const tail = bytes.subarray(1); - // this.assertValidity() is done inside of fromHex - if (len === compressedLen && (head === 0x02 || head === 0x03)) { - const x = ut.bytesToNumberBE(tail); - if (!isValidFieldElement(x)) - throw new Error('Point is not on curve'); - const y2 = weierstrassEquation(x); // y² = x³ + ax + b - let y; - try { - y = Fp.sqrt(y2); // y = y² ^ (p+1)/4 - } - catch (sqrtError) { - const suffix = sqrtError instanceof Error ? ': ' + sqrtError.message : ''; - throw new Error('Point is not on curve' + suffix); - } - const isYOdd = (y & _1n) === _1n; - // ECDSA - const isHeadOdd = (head & 1) === 1; - if (isHeadOdd !== isYOdd) - y = Fp.neg(y); - return { x, y }; - } - else if (len === uncompressedLen && head === 0x04) { - const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES)); - const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES)); - return { x, y }; - } - else { - throw new Error(`Point of length ${len} was invalid. Expected ${compressedLen} compressed bytes or ${uncompressedLen} uncompressed bytes`); - } - }, - }); - const numToNByteStr = (num) => ut.bytesToHex(ut.numberToBytesBE(num, CURVE.nByteLength)); - function isBiggerThanHalfOrder(number) { - const HALF = CURVE_ORDER >> _1n; - return number > HALF; - } - function normalizeS(s) { - return isBiggerThanHalfOrder(s) ? modN(-s) : s; - } - // slice bytes num - const slcNum = (b, from, to) => ut.bytesToNumberBE(b.slice(from, to)); - /** - * ECDSA signature with its (r, s) properties. Supports DER & compact representations. - */ - class Signature { - constructor(r, s, recovery) { - this.r = r; - this.s = s; - this.recovery = recovery; - this.assertValidity(); - } - // pair (bytes of r, bytes of s) - static fromCompact(hex) { - const l = CURVE.nByteLength; - hex = (0, utils_js_1.ensureBytes)('compactSignature', hex, l * 2); - return new Signature(slcNum(hex, 0, l), slcNum(hex, l, 2 * l)); - } - // DER encoded ECDSA signature - // https://bitcoin.stackexchange.com/questions/57644/what-are-the-parts-of-a-bitcoin-transaction-input-script - static fromDER(hex) { - const { r, s } = exports.DER.toSig((0, utils_js_1.ensureBytes)('DER', hex)); - return new Signature(r, s); - } - assertValidity() { - // can use assertGE here - if (!isWithinCurveOrder(this.r)) - throw new Error('r must be 0 < r < CURVE.n'); - if (!isWithinCurveOrder(this.s)) - throw new Error('s must be 0 < s < CURVE.n'); - } - addRecoveryBit(recovery) { - return new Signature(this.r, this.s, recovery); - } - recoverPublicKey(msgHash) { - const { r, s, recovery: rec } = this; - const h = bits2int_modN((0, utils_js_1.ensureBytes)('msgHash', msgHash)); // Truncate hash - if (rec == null || ![0, 1, 2, 3].includes(rec)) - throw new Error('recovery id invalid'); - const radj = rec === 2 || rec === 3 ? r + CURVE.n : r; - if (radj >= Fp.ORDER) - throw new Error('recovery id 2 or 3 invalid'); - const prefix = (rec & 1) === 0 ? '02' : '03'; - const R = Point.fromHex(prefix + numToNByteStr(radj)); - const ir = invN(radj); // r^-1 - const u1 = modN(-h * ir); // -hr^-1 - const u2 = modN(s * ir); // sr^-1 - const Q = Point.BASE.multiplyAndAddUnsafe(R, u1, u2); // (sr^-1)R-(hr^-1)G = -(hr^-1)G + (sr^-1) - if (!Q) - throw new Error('point at infinify'); // unsafe is fine: no priv data leaked - Q.assertValidity(); - return Q; - } - // Signatures should be low-s, to prevent malleability. - hasHighS() { - return isBiggerThanHalfOrder(this.s); - } - normalizeS() { - return this.hasHighS() ? new Signature(this.r, modN(-this.s), this.recovery) : this; - } - // DER-encoded - toDERRawBytes() { - return ut.hexToBytes(this.toDERHex()); - } - toDERHex() { - return exports.DER.hexFromSig({ r: this.r, s: this.s }); - } - // padded bytes of r, then padded bytes of s - toCompactRawBytes() { - return ut.hexToBytes(this.toCompactHex()); - } - toCompactHex() { - return numToNByteStr(this.r) + numToNByteStr(this.s); - } - } - const utils = { - isValidPrivateKey(privateKey) { - try { - normPrivateKeyToScalar(privateKey); - return true; - } - catch (error) { - return false; - } - }, - normPrivateKeyToScalar: normPrivateKeyToScalar, - /** - * Produces cryptographically secure private key from random of size - * (groupLen + ceil(groupLen / 2)) with modulo bias being negligible. - */ - randomPrivateKey: () => { - const length = mod.getMinHashLength(CURVE.n); - return mod.mapHashToField(CURVE.randomBytes(length), CURVE.n); - }, - /** - * Creates precompute table for an arbitrary EC point. Makes point "cached". - * Allows to massively speed-up `point.multiply(scalar)`. - * @returns cached point - * @example - * const fast = utils.precompute(8, ProjectivePoint.fromHex(someonesPubKey)); - * fast.multiply(privKey); // much faster ECDH now - */ - precompute(windowSize = 8, point = Point.BASE) { - point._setWindowSize(windowSize); - point.multiply(BigInt(3)); // 3 is arbitrary, just need any number here - return point; - }, - }; - /** - * Computes public key for a private key. Checks for validity of the private key. - * @param privateKey private key - * @param isCompressed whether to return compact (default), or full key - * @returns Public key, full when isCompressed=false; short when isCompressed=true - */ - function getPublicKey(privateKey, isCompressed = true) { - return Point.fromPrivateKey(privateKey).toRawBytes(isCompressed); - } - /** - * Quick and dirty check for item being public key. Does not validate hex, or being on-curve. - */ - function isProbPub(item) { - const arr = ut.isBytes(item); - const str = typeof item === 'string'; - const len = (arr || str) && item.length; - if (arr) - return len === compressedLen || len === uncompressedLen; - if (str) - return len === 2 * compressedLen || len === 2 * uncompressedLen; - if (item instanceof Point) - return true; - return false; - } - /** - * ECDH (Elliptic Curve Diffie Hellman). - * Computes shared public key from private key and public key. - * Checks: 1) private key validity 2) shared key is on-curve. - * Does NOT hash the result. - * @param privateA private key - * @param publicB different public key - * @param isCompressed whether to return compact (default), or full key - * @returns shared public key - */ - function getSharedSecret(privateA, publicB, isCompressed = true) { - if (isProbPub(privateA)) - throw new Error('first arg must be private key'); - if (!isProbPub(publicB)) - throw new Error('second arg must be public key'); - const b = Point.fromHex(publicB); // check for being on-curve - return b.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed); - } - // RFC6979: ensure ECDSA msg is X bytes and < N. RFC suggests optional truncating via bits2octets. - // FIPS 186-4 4.6 suggests the leftmost min(nBitLen, outLen) bits, which matches bits2int. - // bits2int can produce res>N, we can do mod(res, N) since the bitLen is the same. - // int2octets can't be used; pads small msgs with 0: unacceptatble for trunc as per RFC vectors - const bits2int = CURVE.bits2int || - function (bytes) { - // For curves with nBitLength % 8 !== 0: bits2octets(bits2octets(m)) !== bits2octets(m) - // for some cases, since bytes.length * 8 is not actual bitLength. - const num = ut.bytesToNumberBE(bytes); // check for == u8 done here - const delta = bytes.length * 8 - CURVE.nBitLength; // truncate to nBitLength leftmost bits - return delta > 0 ? num >> BigInt(delta) : num; - }; - const bits2int_modN = CURVE.bits2int_modN || - function (bytes) { - return modN(bits2int(bytes)); // can't use bytesToNumberBE here - }; - // NOTE: pads output with zero as per spec - const ORDER_MASK = ut.bitMask(CURVE.nBitLength); - /** - * Converts to bytes. Checks if num in `[0..ORDER_MASK-1]` e.g.: `[0..2^256-1]`. - */ - function int2octets(num) { - if (typeof num !== 'bigint') - throw new Error('bigint expected'); - if (!(_0n <= num && num < ORDER_MASK)) - throw new Error(`bigint expected < 2^${CURVE.nBitLength}`); - // works with order, can have different size than numToField! - return ut.numberToBytesBE(num, CURVE.nByteLength); - } - // Steps A, D of RFC6979 3.2 - // Creates RFC6979 seed; converts msg/privKey to numbers. - // Used only in sign, not in verify. - // NOTE: we cannot assume here that msgHash has same amount of bytes as curve order, this will be wrong at least for P521. - // Also it can be bigger for P224 + SHA256 - function prepSig(msgHash, privateKey, opts = defaultSigOpts) { - if (['recovered', 'canonical'].some((k) => k in opts)) - throw new Error('sign() legacy options not supported'); - const { hash, randomBytes } = CURVE; - let { lowS, prehash, extraEntropy: ent } = opts; // generates low-s sigs by default - if (lowS == null) - lowS = true; // RFC6979 3.2: we skip step A, because we already provide hash - msgHash = (0, utils_js_1.ensureBytes)('msgHash', msgHash); - if (prehash) - msgHash = (0, utils_js_1.ensureBytes)('prehashed msgHash', hash(msgHash)); - // We can't later call bits2octets, since nested bits2int is broken for curves - // with nBitLength % 8 !== 0. Because of that, we unwrap it here as int2octets call. - // const bits2octets = (bits) => int2octets(bits2int_modN(bits)) - const h1int = bits2int_modN(msgHash); - const d = normPrivateKeyToScalar(privateKey); // validate private key, convert to bigint - const seedArgs = [int2octets(d), int2octets(h1int)]; - // extraEntropy. RFC6979 3.6: additional k' (optional). - if (ent != null && ent !== false) { - // K = HMAC_K(V || 0x00 || int2octets(x) || bits2octets(h1) || k') - const e = ent === true ? randomBytes(Fp.BYTES) : ent; // generate random bytes OR pass as-is - seedArgs.push((0, utils_js_1.ensureBytes)('extraEntropy', e)); // check for being bytes - } - const seed = ut.concatBytes(...seedArgs); // Step D of RFC6979 3.2 - const m = h1int; // NOTE: no need to call bits2int second time here, it is inside truncateHash! - // Converts signature params into point w r/s, checks result for validity. - function k2sig(kBytes) { - // RFC 6979 Section 3.2, step 3: k = bits2int(T) - const k = bits2int(kBytes); // Cannot use fields methods, since it is group element - if (!isWithinCurveOrder(k)) - return; // Important: all mod() calls here must be done over N - const ik = invN(k); // k^-1 mod n - const q = Point.BASE.multiply(k).toAffine(); // q = Gk - const r = modN(q.x); // r = q.x mod n - if (r === _0n) - return; - // Can use scalar blinding b^-1(bm + bdr) where b ∈ [1,q−1] according to - // https://tches.iacr.org/index.php/TCHES/article/view/7337/6509. We've decided against it: - // a) dependency on CSPRNG b) 15% slowdown c) doesn't really help since bigints are not CT - const s = modN(ik * modN(m + r * d)); // Not using blinding here - if (s === _0n) - return; - let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n); // recovery bit (2 or 3, when q.x > n) - let normS = s; - if (lowS && isBiggerThanHalfOrder(s)) { - normS = normalizeS(s); // if lowS was passed, ensure s is always - recovery ^= 1; // // in the bottom half of N - } - return new Signature(r, normS, recovery); // use normS, not s - } - return { seed, k2sig }; - } - const defaultSigOpts = { lowS: CURVE.lowS, prehash: false }; - const defaultVerOpts = { lowS: CURVE.lowS, prehash: false }; - /** - * Signs message hash with a private key. - * ``` - * sign(m, d, k) where - * (x, y) = G × k - * r = x mod n - * s = (m + dr)/k mod n - * ``` - * @param msgHash NOT message. msg needs to be hashed to `msgHash`, or use `prehash`. - * @param privKey private key - * @param opts lowS for non-malleable sigs. extraEntropy for mixing randomness into k. prehash will hash first arg. - * @returns signature with recovery param - */ - function sign(msgHash, privKey, opts = defaultSigOpts) { - const { seed, k2sig } = prepSig(msgHash, privKey, opts); // Steps A, D of RFC6979 3.2. - const C = CURVE; - const drbg = ut.createHmacDrbg(C.hash.outputLen, C.nByteLength, C.hmac); - return drbg(seed, k2sig); // Steps B, C, D, E, F, G - } - // Enable precomputes. Slows down first publicKey computation by 20ms. - Point.BASE._setWindowSize(8); - // utils.precompute(8, ProjectivePoint.BASE) - /** - * Verifies a signature against message hash and public key. - * Rejects lowS signatures by default: to override, - * specify option `{lowS: false}`. Implements section 4.1.4 from https://www.secg.org/sec1-v2.pdf: - * - * ``` - * verify(r, s, h, P) where - * U1 = hs^-1 mod n - * U2 = rs^-1 mod n - * R = U1⋅G - U2⋅P - * mod(R.x, n) == r - * ``` - */ - function verify(signature, msgHash, publicKey, opts = defaultVerOpts) { - const sg = signature; - msgHash = (0, utils_js_1.ensureBytes)('msgHash', msgHash); - publicKey = (0, utils_js_1.ensureBytes)('publicKey', publicKey); - if ('strict' in opts) - throw new Error('options.strict was renamed to lowS'); - const { lowS, prehash } = opts; - let _sig = undefined; - let P; - try { - if (typeof sg === 'string' || ut.isBytes(sg)) { - // Signature can be represented in 2 ways: compact (2*nByteLength) & DER (variable-length). - // Since DER can also be 2*nByteLength bytes, we check for it first. - try { - _sig = Signature.fromDER(sg); - } - catch (derError) { - if (!(derError instanceof exports.DER.Err)) - throw derError; - _sig = Signature.fromCompact(sg); - } - } - else if (typeof sg === 'object' && typeof sg.r === 'bigint' && typeof sg.s === 'bigint') { - const { r, s } = sg; - _sig = new Signature(r, s); - } - else { - throw new Error('PARSE'); - } - P = Point.fromHex(publicKey); - } - catch (error) { - if (error.message === 'PARSE') - throw new Error(`signature must be Signature instance, Uint8Array or hex string`); - return false; - } - if (lowS && _sig.hasHighS()) - return false; - if (prehash) - msgHash = CURVE.hash(msgHash); - const { r, s } = _sig; - const h = bits2int_modN(msgHash); // Cannot use fields methods, since it is group element - const is = invN(s); // s^-1 - const u1 = modN(h * is); // u1 = hs^-1 mod n - const u2 = modN(r * is); // u2 = rs^-1 mod n - const R = Point.BASE.multiplyAndAddUnsafe(P, u1, u2)?.toAffine(); // R = u1⋅G + u2⋅P - if (!R) - return false; - const v = modN(R.x); - return v === r; - } - return { - CURVE, - getPublicKey, - getSharedSecret, - sign, - verify, - ProjectivePoint: Point, - Signature, - utils, - }; -} -/** - * Implementation of the Shallue and van de Woestijne method for any weierstrass curve. - * TODO: check if there is a way to merge this with uvRatio in Edwards; move to modular. - * b = True and y = sqrt(u / v) if (u / v) is square in F, and - * b = False and y = sqrt(Z * (u / v)) otherwise. - * @param Fp - * @param Z - * @returns - */ -function SWUFpSqrtRatio(Fp, Z) { - // Generic implementation - const q = Fp.ORDER; - let l = _0n; - for (let o = q - _1n; o % _2n === _0n; o /= _2n) - l += _1n; - const c1 = l; // 1. c1, the largest integer such that 2^c1 divides q - 1. - // We need 2n ** c1 and 2n ** (c1-1). We can't use **; but we can use <<. - // 2n ** c1 == 2n << (c1-1) - const _2n_pow_c1_1 = _2n << (c1 - _1n - _1n); - const _2n_pow_c1 = _2n_pow_c1_1 * _2n; - const c2 = (q - _1n) / _2n_pow_c1; // 2. c2 = (q - 1) / (2^c1) # Integer arithmetic - const c3 = (c2 - _1n) / _2n; // 3. c3 = (c2 - 1) / 2 # Integer arithmetic - const c4 = _2n_pow_c1 - _1n; // 4. c4 = 2^c1 - 1 # Integer arithmetic - const c5 = _2n_pow_c1_1; // 5. c5 = 2^(c1 - 1) # Integer arithmetic - const c6 = Fp.pow(Z, c2); // 6. c6 = Z^c2 - const c7 = Fp.pow(Z, (c2 + _1n) / _2n); // 7. c7 = Z^((c2 + 1) / 2) - let sqrtRatio = (u, v) => { - let tv1 = c6; // 1. tv1 = c6 - let tv2 = Fp.pow(v, c4); // 2. tv2 = v^c4 - let tv3 = Fp.sqr(tv2); // 3. tv3 = tv2^2 - tv3 = Fp.mul(tv3, v); // 4. tv3 = tv3 * v - let tv5 = Fp.mul(u, tv3); // 5. tv5 = u * tv3 - tv5 = Fp.pow(tv5, c3); // 6. tv5 = tv5^c3 - tv5 = Fp.mul(tv5, tv2); // 7. tv5 = tv5 * tv2 - tv2 = Fp.mul(tv5, v); // 8. tv2 = tv5 * v - tv3 = Fp.mul(tv5, u); // 9. tv3 = tv5 * u - let tv4 = Fp.mul(tv3, tv2); // 10. tv4 = tv3 * tv2 - tv5 = Fp.pow(tv4, c5); // 11. tv5 = tv4^c5 - let isQR = Fp.eql(tv5, Fp.ONE); // 12. isQR = tv5 == 1 - tv2 = Fp.mul(tv3, c7); // 13. tv2 = tv3 * c7 - tv5 = Fp.mul(tv4, tv1); // 14. tv5 = tv4 * tv1 - tv3 = Fp.cmov(tv2, tv3, isQR); // 15. tv3 = CMOV(tv2, tv3, isQR) - tv4 = Fp.cmov(tv5, tv4, isQR); // 16. tv4 = CMOV(tv5, tv4, isQR) - // 17. for i in (c1, c1 - 1, ..., 2): - for (let i = c1; i > _1n; i--) { - let tv5 = i - _2n; // 18. tv5 = i - 2 - tv5 = _2n << (tv5 - _1n); // 19. tv5 = 2^tv5 - let tvv5 = Fp.pow(tv4, tv5); // 20. tv5 = tv4^tv5 - const e1 = Fp.eql(tvv5, Fp.ONE); // 21. e1 = tv5 == 1 - tv2 = Fp.mul(tv3, tv1); // 22. tv2 = tv3 * tv1 - tv1 = Fp.mul(tv1, tv1); // 23. tv1 = tv1 * tv1 - tvv5 = Fp.mul(tv4, tv1); // 24. tv5 = tv4 * tv1 - tv3 = Fp.cmov(tv2, tv3, e1); // 25. tv3 = CMOV(tv2, tv3, e1) - tv4 = Fp.cmov(tvv5, tv4, e1); // 26. tv4 = CMOV(tv5, tv4, e1) - } - return { isValid: isQR, value: tv3 }; - }; - if (Fp.ORDER % _4n === _3n) { - // sqrt_ratio_3mod4(u, v) - const c1 = (Fp.ORDER - _3n) / _4n; // 1. c1 = (q - 3) / 4 # Integer arithmetic - const c2 = Fp.sqrt(Fp.neg(Z)); // 2. c2 = sqrt(-Z) - sqrtRatio = (u, v) => { - let tv1 = Fp.sqr(v); // 1. tv1 = v^2 - const tv2 = Fp.mul(u, v); // 2. tv2 = u * v - tv1 = Fp.mul(tv1, tv2); // 3. tv1 = tv1 * tv2 - let y1 = Fp.pow(tv1, c1); // 4. y1 = tv1^c1 - y1 = Fp.mul(y1, tv2); // 5. y1 = y1 * tv2 - const y2 = Fp.mul(y1, c2); // 6. y2 = y1 * c2 - const tv3 = Fp.mul(Fp.sqr(y1), v); // 7. tv3 = y1^2; 8. tv3 = tv3 * v - const isQR = Fp.eql(tv3, u); // 9. isQR = tv3 == u - let y = Fp.cmov(y2, y1, isQR); // 10. y = CMOV(y2, y1, isQR) - return { isValid: isQR, value: y }; // 11. return (isQR, y) isQR ? y : y*c2 - }; - } - // No curves uses that - // if (Fp.ORDER % _8n === _5n) // sqrt_ratio_5mod8 - return sqrtRatio; -} -/** - * Simplified Shallue-van de Woestijne-Ulas Method - * https://www.rfc-editor.org/rfc/rfc9380#section-6.6.2 - */ -function mapToCurveSimpleSWU(Fp, opts) { - mod.validateField(Fp); - if (!Fp.isValid(opts.A) || !Fp.isValid(opts.B) || !Fp.isValid(opts.Z)) - throw new Error('mapToCurveSimpleSWU: invalid opts'); - const sqrtRatio = SWUFpSqrtRatio(Fp, opts.Z); - if (!Fp.isOdd) - throw new Error('Fp.isOdd is not implemented!'); - // Input: u, an element of F. - // Output: (x, y), a point on E. - return (u) => { - // prettier-ignore - let tv1, tv2, tv3, tv4, tv5, tv6, x, y; - tv1 = Fp.sqr(u); // 1. tv1 = u^2 - tv1 = Fp.mul(tv1, opts.Z); // 2. tv1 = Z * tv1 - tv2 = Fp.sqr(tv1); // 3. tv2 = tv1^2 - tv2 = Fp.add(tv2, tv1); // 4. tv2 = tv2 + tv1 - tv3 = Fp.add(tv2, Fp.ONE); // 5. tv3 = tv2 + 1 - tv3 = Fp.mul(tv3, opts.B); // 6. tv3 = B * tv3 - tv4 = Fp.cmov(opts.Z, Fp.neg(tv2), !Fp.eql(tv2, Fp.ZERO)); // 7. tv4 = CMOV(Z, -tv2, tv2 != 0) - tv4 = Fp.mul(tv4, opts.A); // 8. tv4 = A * tv4 - tv2 = Fp.sqr(tv3); // 9. tv2 = tv3^2 - tv6 = Fp.sqr(tv4); // 10. tv6 = tv4^2 - tv5 = Fp.mul(tv6, opts.A); // 11. tv5 = A * tv6 - tv2 = Fp.add(tv2, tv5); // 12. tv2 = tv2 + tv5 - tv2 = Fp.mul(tv2, tv3); // 13. tv2 = tv2 * tv3 - tv6 = Fp.mul(tv6, tv4); // 14. tv6 = tv6 * tv4 - tv5 = Fp.mul(tv6, opts.B); // 15. tv5 = B * tv6 - tv2 = Fp.add(tv2, tv5); // 16. tv2 = tv2 + tv5 - x = Fp.mul(tv1, tv3); // 17. x = tv1 * tv3 - const { isValid, value } = sqrtRatio(tv2, tv6); // 18. (is_gx1_square, y1) = sqrt_ratio(tv2, tv6) - y = Fp.mul(tv1, u); // 19. y = tv1 * u -> Z * u^3 * y1 - y = Fp.mul(y, value); // 20. y = y * y1 - x = Fp.cmov(x, tv3, isValid); // 21. x = CMOV(x, tv3, is_gx1_square) - y = Fp.cmov(y, value, isValid); // 22. y = CMOV(y, y1, is_gx1_square) - const e1 = Fp.isOdd(u) === Fp.isOdd(y); // 23. e1 = sgn0(u) == sgn0(y) - y = Fp.cmov(Fp.neg(y), y, e1); // 24. y = CMOV(-y, y, e1) - x = Fp.div(x, tv4); // 25. x = x / tv4 - return { x, y }; - }; -} -//# sourceMappingURL=weierstrass.js.map - -/***/ }), - -/***/ 67694: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.encodeToCurve = exports.hashToCurve = exports.schnorr = exports.secp256k1 = void 0; -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const sha256_1 = __webpack_require__(22623); -const utils_1 = __webpack_require__(99175); -const _shortw_utils_js_1 = __webpack_require__(40714); -const hash_to_curve_js_1 = __webpack_require__(81761); -const modular_js_1 = __webpack_require__(89015); -const utils_js_1 = __webpack_require__(19372); -const weierstrass_js_1 = __webpack_require__(20489); -const secp256k1P = BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f'); -const secp256k1N = BigInt('0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141'); -const _1n = BigInt(1); -const _2n = BigInt(2); -const divNearest = (a, b) => (a + b / _2n) / b; -/** - * √n = n^((p+1)/4) for fields p = 3 mod 4. We unwrap the loop and multiply bit-by-bit. - * (P+1n/4n).toString(2) would produce bits [223x 1, 0, 22x 1, 4x 0, 11, 00] - */ -function sqrtMod(y) { - const P = secp256k1P; - // prettier-ignore - const _3n = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22); - // prettier-ignore - const _23n = BigInt(23), _44n = BigInt(44), _88n = BigInt(88); - const b2 = (y * y * y) % P; // x^3, 11 - const b3 = (b2 * b2 * y) % P; // x^7 - const b6 = ((0, modular_js_1.pow2)(b3, _3n, P) * b3) % P; - const b9 = ((0, modular_js_1.pow2)(b6, _3n, P) * b3) % P; - const b11 = ((0, modular_js_1.pow2)(b9, _2n, P) * b2) % P; - const b22 = ((0, modular_js_1.pow2)(b11, _11n, P) * b11) % P; - const b44 = ((0, modular_js_1.pow2)(b22, _22n, P) * b22) % P; - const b88 = ((0, modular_js_1.pow2)(b44, _44n, P) * b44) % P; - const b176 = ((0, modular_js_1.pow2)(b88, _88n, P) * b88) % P; - const b220 = ((0, modular_js_1.pow2)(b176, _44n, P) * b44) % P; - const b223 = ((0, modular_js_1.pow2)(b220, _3n, P) * b3) % P; - const t1 = ((0, modular_js_1.pow2)(b223, _23n, P) * b22) % P; - const t2 = ((0, modular_js_1.pow2)(t1, _6n, P) * b2) % P; - const root = (0, modular_js_1.pow2)(t2, _2n, P); - if (!Fp.eql(Fp.sqr(root), y)) - throw new Error('Cannot find square root'); - return root; -} -const Fp = (0, modular_js_1.Field)(secp256k1P, undefined, undefined, { sqrt: sqrtMod }); -exports.secp256k1 = (0, _shortw_utils_js_1.createCurve)({ - a: BigInt(0), // equation params: a, b - b: BigInt(7), // Seem to be rigid: bitcointalk.org/index.php?topic=289795.msg3183975#msg3183975 - Fp, // Field's prime: 2n**256n - 2n**32n - 2n**9n - 2n**8n - 2n**7n - 2n**6n - 2n**4n - 1n - n: secp256k1N, // Curve order, total count of valid points in the field - // Base point (x, y) aka generator point - Gx: BigInt('55066263022277343669578718895168534326250603453777594175500187360389116729240'), - Gy: BigInt('32670510020758816978083085130507043184471273380659243275938904335757337482424'), - h: BigInt(1), // Cofactor - lowS: true, // Allow only low-S signatures by default in sign() and verify() - /** - * secp256k1 belongs to Koblitz curves: it has efficiently computable endomorphism. - * Endomorphism uses 2x less RAM, speeds up precomputation by 2x and ECDH / key recovery by 20%. - * For precomputed wNAF it trades off 1/2 init time & 1/3 ram for 20% perf hit. - * Explanation: https://gist.github.com/paulmillr/eb670806793e84df628a7c434a873066 - */ - endo: { - beta: BigInt('0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee'), - splitScalar: (k) => { - const n = secp256k1N; - const a1 = BigInt('0x3086d221a7d46bcde86c90e49284eb15'); - const b1 = -_1n * BigInt('0xe4437ed6010e88286f547fa90abfe4c3'); - const a2 = BigInt('0x114ca50f7a8e2f3f657c1108d9d44cfd8'); - const b2 = a1; - const POW_2_128 = BigInt('0x100000000000000000000000000000000'); // (2n**128n).toString(16) - const c1 = divNearest(b2 * k, n); - const c2 = divNearest(-b1 * k, n); - let k1 = (0, modular_js_1.mod)(k - c1 * a1 - c2 * a2, n); - let k2 = (0, modular_js_1.mod)(-c1 * b1 - c2 * b2, n); - const k1neg = k1 > POW_2_128; - const k2neg = k2 > POW_2_128; - if (k1neg) - k1 = n - k1; - if (k2neg) - k2 = n - k2; - if (k1 > POW_2_128 || k2 > POW_2_128) { - throw new Error('splitScalar: Endomorphism failed, k=' + k); - } - return { k1neg, k1, k2neg, k2 }; - }, - }, -}, sha256_1.sha256); -// Schnorr signatures are superior to ECDSA from above. Below is Schnorr-specific BIP0340 code. -// https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki -const _0n = BigInt(0); -const fe = (x) => typeof x === 'bigint' && _0n < x && x < secp256k1P; -const ge = (x) => typeof x === 'bigint' && _0n < x && x < secp256k1N; -/** An object mapping tags to their tagged hash prefix of [SHA256(tag) | SHA256(tag)] */ -const TAGGED_HASH_PREFIXES = {}; -function taggedHash(tag, ...messages) { - let tagP = TAGGED_HASH_PREFIXES[tag]; - if (tagP === undefined) { - const tagH = (0, sha256_1.sha256)(Uint8Array.from(tag, (c) => c.charCodeAt(0))); - tagP = (0, utils_js_1.concatBytes)(tagH, tagH); - TAGGED_HASH_PREFIXES[tag] = tagP; - } - return (0, sha256_1.sha256)((0, utils_js_1.concatBytes)(tagP, ...messages)); -} -// ECDSA compact points are 33-byte. Schnorr is 32: we strip first byte 0x02 or 0x03 -const pointToBytes = (point) => point.toRawBytes(true).slice(1); -const numTo32b = (n) => (0, utils_js_1.numberToBytesBE)(n, 32); -const modP = (x) => (0, modular_js_1.mod)(x, secp256k1P); -const modN = (x) => (0, modular_js_1.mod)(x, secp256k1N); -const Point = exports.secp256k1.ProjectivePoint; -const GmulAdd = (Q, a, b) => Point.BASE.multiplyAndAddUnsafe(Q, a, b); -// Calculate point, scalar and bytes -function schnorrGetExtPubKey(priv) { - let d_ = exports.secp256k1.utils.normPrivateKeyToScalar(priv); // same method executed in fromPrivateKey - let p = Point.fromPrivateKey(d_); // P = d'⋅G; 0 < d' < n check is done inside - const scalar = p.hasEvenY() ? d_ : modN(-d_); - return { scalar: scalar, bytes: pointToBytes(p) }; -} -/** - * lift_x from BIP340. Convert 32-byte x coordinate to elliptic curve point. - * @returns valid point checked for being on-curve - */ -function lift_x(x) { - if (!fe(x)) - throw new Error('bad x: need 0 < x < p'); // Fail if x ≥ p. - const xx = modP(x * x); - const c = modP(xx * x + BigInt(7)); // Let c = x³ + 7 mod p. - let y = sqrtMod(c); // Let y = c^(p+1)/4 mod p. - if (y % _2n !== _0n) - y = modP(-y); // Return the unique point P such that x(P) = x and - const p = new Point(x, y, _1n); // y(P) = y if y mod 2 = 0 or y(P) = p-y otherwise. - p.assertValidity(); - return p; -} -/** - * Create tagged hash, convert it to bigint, reduce modulo-n. - */ -function challenge(...args) { - return modN((0, utils_js_1.bytesToNumberBE)(taggedHash('BIP0340/challenge', ...args))); -} -/** - * Schnorr public key is just `x` coordinate of Point as per BIP340. - */ -function schnorrGetPublicKey(privateKey) { - return schnorrGetExtPubKey(privateKey).bytes; // d'=int(sk). Fail if d'=0 or d'≥n. Ret bytes(d'⋅G) -} -/** - * Creates Schnorr signature as per BIP340. Verifies itself before returning anything. - * auxRand is optional and is not the sole source of k generation: bad CSPRNG won't be dangerous. - */ -function schnorrSign(message, privateKey, auxRand = (0, utils_1.randomBytes)(32)) { - const m = (0, utils_js_1.ensureBytes)('message', message); - const { bytes: px, scalar: d } = schnorrGetExtPubKey(privateKey); // checks for isWithinCurveOrder - const a = (0, utils_js_1.ensureBytes)('auxRand', auxRand, 32); // Auxiliary random data a: a 32-byte array - const t = numTo32b(d ^ (0, utils_js_1.bytesToNumberBE)(taggedHash('BIP0340/aux', a))); // Let t be the byte-wise xor of bytes(d) and hash/aux(a) - const rand = taggedHash('BIP0340/nonce', t, px, m); // Let rand = hash/nonce(t || bytes(P) || m) - const k_ = modN((0, utils_js_1.bytesToNumberBE)(rand)); // Let k' = int(rand) mod n - if (k_ === _0n) - throw new Error('sign failed: k is zero'); // Fail if k' = 0. - const { bytes: rx, scalar: k } = schnorrGetExtPubKey(k_); // Let R = k'⋅G. - const e = challenge(rx, px, m); // Let e = int(hash/challenge(bytes(R) || bytes(P) || m)) mod n. - const sig = new Uint8Array(64); // Let sig = bytes(R) || bytes((k + ed) mod n). - sig.set(rx, 0); - sig.set(numTo32b(modN(k + e * d)), 32); - // If Verify(bytes(P), m, sig) (see below) returns failure, abort - if (!schnorrVerify(sig, m, px)) - throw new Error('sign: Invalid signature produced'); - return sig; -} -/** - * Verifies Schnorr signature. - * Will swallow errors & return false except for initial type validation of arguments. - */ -function schnorrVerify(signature, message, publicKey) { - const sig = (0, utils_js_1.ensureBytes)('signature', signature, 64); - const m = (0, utils_js_1.ensureBytes)('message', message); - const pub = (0, utils_js_1.ensureBytes)('publicKey', publicKey, 32); - try { - const P = lift_x((0, utils_js_1.bytesToNumberBE)(pub)); // P = lift_x(int(pk)); fail if that fails - const r = (0, utils_js_1.bytesToNumberBE)(sig.subarray(0, 32)); // Let r = int(sig[0:32]); fail if r ≥ p. - if (!fe(r)) - return false; - const s = (0, utils_js_1.bytesToNumberBE)(sig.subarray(32, 64)); // Let s = int(sig[32:64]); fail if s ≥ n. - if (!ge(s)) - return false; - const e = challenge(numTo32b(r), pointToBytes(P), m); // int(challenge(bytes(r)||bytes(P)||m))%n - const R = GmulAdd(P, s, modN(-e)); // R = s⋅G - e⋅P - if (!R || !R.hasEvenY() || R.toAffine().x !== r) - return false; // -eP == (n-e)P - return true; // Fail if is_infinite(R) / not has_even_y(R) / x(R) ≠ r. - } - catch (error) { - return false; - } -} -exports.schnorr = (() => ({ - getPublicKey: schnorrGetPublicKey, - sign: schnorrSign, - verify: schnorrVerify, - utils: { - randomPrivateKey: exports.secp256k1.utils.randomPrivateKey, - lift_x, - pointToBytes, - numberToBytesBE: utils_js_1.numberToBytesBE, - bytesToNumberBE: utils_js_1.bytesToNumberBE, - taggedHash, - mod: modular_js_1.mod, - }, -}))(); -const isoMap = /* @__PURE__ */ (() => (0, hash_to_curve_js_1.isogenyMap)(Fp, [ - // xNum - [ - '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7', - '0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581', - '0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262', - '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c', - ], - // xDen - [ - '0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b', - '0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14', - '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], - // yNum - [ - '0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c', - '0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3', - '0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931', - '0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84', - ], - // yDen - [ - '0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b', - '0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573', - '0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f', - '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], -].map((i) => i.map((j) => BigInt(j)))))(); -const mapSWU = /* @__PURE__ */ (() => (0, weierstrass_js_1.mapToCurveSimpleSWU)(Fp, { - A: BigInt('0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533'), - B: BigInt('1771'), - Z: Fp.create(BigInt('-11')), -}))(); -const htf = /* @__PURE__ */ (() => (0, hash_to_curve_js_1.createHasher)(exports.secp256k1.ProjectivePoint, (scalars) => { - const { x, y } = mapSWU(Fp.create(scalars[0])); - return isoMap(x, y); -}, { - DST: 'secp256k1_XMD:SHA-256_SSWU_RO_', - encodeDST: 'secp256k1_XMD:SHA-256_SSWU_NU_', - p: Fp.ORDER, - m: 1, - k: 128, - expand: 'xmd', - hash: sha256_1.sha256, -}))(); -exports.hashToCurve = (() => htf.hashToCurve)(); -exports.encodeToCurve = (() => htf.encodeToCurve)(); -//# sourceMappingURL=secp256k1.js.map - /***/ }), /***/ 26513: @@ -113352,7 +112659,7 @@ exports.encodeToCurve = (() => htf.encodeToCurve)(); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.secp256k1 = void 0; -var secp256k1_1 = __webpack_require__(67694); +var secp256k1_1 = __webpack_require__(8510); Object.defineProperty(exports, "secp256k1", ({ enumerable: true, get: function () { return secp256k1_1.secp256k1; } })); @@ -149816,7 +149123,7 @@ exports.wrapError = wrapError; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.remove0x = exports.add0x = exports.isValidChecksumAddress = exports.getChecksumAddress = exports.isValidHexAddress = exports.assertIsStrictHexString = exports.assertIsHexString = exports.isStrictHexString = exports.isHexString = exports.HexChecksumAddressStruct = exports.HexAddressStruct = exports.StrictHexStruct = exports.HexStruct = void 0; const superstruct_1 = __webpack_require__(35620); -const sha3_1 = __webpack_require__(2214); +const sha3_1 = __webpack_require__(32955); const assert_1 = __webpack_require__(22011); const bytes_1 = __webpack_require__(77862); exports.HexStruct = (0, superstruct_1.pattern)((0, superstruct_1.string)(), /^(?:0x)?[0-9a-f]+$/iu); @@ -151805,6 +151112,773 @@ module.exports = { } +/***/ }), + +/***/ 89190: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ CG: () => (/* binding */ output), +/* harmony export */ ai: () => (/* binding */ number), +/* harmony export */ ee: () => (/* binding */ bytes), +/* harmony export */ t2: () => (/* binding */ exists), +/* harmony export */ tW: () => (/* binding */ hash) +/* harmony export */ }); +/* unused harmony export bool */ +function number(n) { + if (!Number.isSafeInteger(n) || n < 0) + throw new Error(`Wrong positive integer: ${n}`); +} +function bool(b) { + if (typeof b !== 'boolean') + throw new Error(`Expected boolean, not ${b}`); +} +function bytes(b, ...lengths) { + if (!(b instanceof Uint8Array)) + throw new Error('Expected Uint8Array'); + if (lengths.length > 0 && !lengths.includes(b.length)) + throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`); +} +function hash(hash) { + if (typeof hash !== 'function' || typeof hash.create !== 'function') + throw new Error('Hash should be wrapped by utils.wrapConstructor'); + number(hash.outputLen); + number(hash.blockLen); +} +function exists(instance, checkFinished = true) { + if (instance.destroyed) + throw new Error('Hash instance has been destroyed'); + if (checkFinished && instance.finished) + throw new Error('Hash#digest() has already been called'); +} +function output(out, instance) { + bytes(out); + const min = instance.outputLen; + if (out.length < min) { + throw new Error(`digestInto() expects output buffer of length at least ${min}`); + } +} + +const assert = { number, bool, bytes, hash, exists, output }; +/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ((/* unused pure expression or super */ null && (assert))); +//# sourceMappingURL=_assert.js.map + +/***/ }), + +/***/ 6800: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ D: () => (/* binding */ SHA2) +/* harmony export */ }); +/* harmony import */ var _assert_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(89190); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(32531); + + +// Polyfill for Safari 14 +function setBigUint64(view, byteOffset, value, isLE) { + if (typeof view.setBigUint64 === 'function') + return view.setBigUint64(byteOffset, value, isLE); + const _32n = BigInt(32); + const _u32_max = BigInt(0xffffffff); + const wh = Number((value >> _32n) & _u32_max); + const wl = Number(value & _u32_max); + const h = isLE ? 4 : 0; + const l = isLE ? 0 : 4; + view.setUint32(byteOffset + h, wh, isLE); + view.setUint32(byteOffset + l, wl, isLE); +} +// Base SHA2 class (RFC 6234) +class SHA2 extends _utils_js__WEBPACK_IMPORTED_MODULE_0__/* .Hash */ .Vw { + constructor(blockLen, outputLen, padOffset, isLE) { + super(); + this.blockLen = blockLen; + this.outputLen = outputLen; + this.padOffset = padOffset; + this.isLE = isLE; + this.finished = false; + this.length = 0; + this.pos = 0; + this.destroyed = false; + this.buffer = new Uint8Array(blockLen); + this.view = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__/* .createView */ .O8)(this.buffer); + } + update(data) { + (0,_assert_js__WEBPACK_IMPORTED_MODULE_1__/* .exists */ .t2)(this); + const { view, buffer, blockLen } = this; + data = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__/* .toBytes */ .ZJ)(data); + const len = data.length; + for (let pos = 0; pos < len;) { + const take = Math.min(blockLen - this.pos, len - pos); + // Fast path: we have at least one block in input, cast it to view and process + if (take === blockLen) { + const dataView = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__/* .createView */ .O8)(data); + for (; blockLen <= len - pos; pos += blockLen) + this.process(dataView, pos); + continue; + } + buffer.set(data.subarray(pos, pos + take), this.pos); + this.pos += take; + pos += take; + if (this.pos === blockLen) { + this.process(view, 0); + this.pos = 0; + } + } + this.length += data.length; + this.roundClean(); + return this; + } + digestInto(out) { + (0,_assert_js__WEBPACK_IMPORTED_MODULE_1__/* .exists */ .t2)(this); + (0,_assert_js__WEBPACK_IMPORTED_MODULE_1__/* .output */ .CG)(out, this); + this.finished = true; + // Padding + // We can avoid allocation of buffer for padding completely if it + // was previously not allocated here. But it won't change performance. + const { buffer, view, blockLen, isLE } = this; + let { pos } = this; + // append the bit '1' to the message + buffer[pos++] = 0b10000000; + this.buffer.subarray(pos).fill(0); + // we have less than padOffset left in buffer, so we cannot put length in current block, need process it and pad again + if (this.padOffset > blockLen - pos) { + this.process(view, 0); + pos = 0; + } + // Pad until full block byte with zeros + for (let i = pos; i < blockLen; i++) + buffer[i] = 0; + // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that + // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen. + // So we just write lowest 64 bits of that value. + setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE); + this.process(view, 0); + const oview = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__/* .createView */ .O8)(out); + const len = this.outputLen; + // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT + if (len % 4) + throw new Error('_sha2: outputLen should be aligned to 32bit'); + const outLen = len / 4; + const state = this.get(); + if (outLen > state.length) + throw new Error('_sha2: outputLen bigger than state'); + for (let i = 0; i < outLen; i++) + oview.setUint32(4 * i, state[i], isLE); + } + digest() { + const { buffer, outputLen } = this; + this.digestInto(buffer); + const res = buffer.slice(0, outputLen); + this.destroy(); + return res; + } + _cloneInto(to) { + to || (to = new this.constructor()); + to.set(...this.get()); + const { blockLen, buffer, length, finished, destroyed, pos } = this; + to.length = length; + to.pos = pos; + to.finished = finished; + to.destroyed = destroyed; + if (length % blockLen) + to.buffer.set(buffer); + return to; + } +} +//# sourceMappingURL=_sha2.js.map + +/***/ }), + +/***/ 79271: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Ay: () => (__WEBPACK_DEFAULT_EXPORT__), +/* harmony export */ B4: () => (/* binding */ rotlSL), +/* harmony export */ P5: () => (/* binding */ rotlSH), +/* harmony export */ WM: () => (/* binding */ rotlBH), +/* harmony export */ im: () => (/* binding */ rotlBL), +/* harmony export */ lD: () => (/* binding */ split) +/* harmony export */ }); +/* unused harmony exports fromBig, toBig, shrSH, shrSL, rotrSH, rotrSL, rotrBH, rotrBL, rotr32H, rotr32L, add, add3L, add3H, add4L, add4H, add5H, add5L */ +const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1); +const _32n = /* @__PURE__ */ BigInt(32); +// We are not using BigUint64Array, because they are extremely slow as per 2022 +function fromBig(n, le = false) { + if (le) + return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) }; + return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 }; +} +function split(lst, le = false) { + let Ah = new Uint32Array(lst.length); + let Al = new Uint32Array(lst.length); + for (let i = 0; i < lst.length; i++) { + const { h, l } = fromBig(lst[i], le); + [Ah[i], Al[i]] = [h, l]; + } + return [Ah, Al]; +} +const toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0); +// for Shift in [0, 32) +const shrSH = (h, _l, s) => h >>> s; +const shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); +// Right rotate for Shift in [1, 32) +const rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s)); +const rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); +// Right rotate for Shift in (32, 64), NOTE: 32 is special case. +const rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32)); +const rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s)); +// Right rotate for shift===32 (just swaps l&h) +const rotr32H = (_h, l) => l; +const rotr32L = (h, _l) => h; +// Left rotate for Shift in [1, 32) +const rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s)); +const rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s)); +// Left rotate for Shift in (32, 64), NOTE: 32 is special case. +const rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s)); +const rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s)); +// JS uses 32-bit signed integers for bitwise operations which means we cannot +// simple take carry out of low bit sum by shift, we need to use division. +function add(Ah, Al, Bh, Bl) { + const l = (Al >>> 0) + (Bl >>> 0); + return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 }; +} +// Addition with more than 2 elements +const add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); +const add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0; +const add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); +const add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0; +const add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); +const add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0; +// prettier-ignore + +// prettier-ignore +const u64 = { + fromBig, split, toBig, + shrSH, shrSL, + rotrSH, rotrSL, rotrBH, rotrBL, + rotr32H, rotr32L, + rotlSH, rotlSL, rotlBH, rotlBL, + add, add3L, add3H, add4L, add4H, add5H, add5L, +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (u64); +//# sourceMappingURL=_u64.js.map + +/***/ }), + +/***/ 21454: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ w: () => (/* binding */ hmac) +/* harmony export */ }); +/* unused harmony export HMAC */ +/* harmony import */ var _assert_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(89190); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(32531); + + +// HMAC (RFC 2104) +class HMAC extends _utils_js__WEBPACK_IMPORTED_MODULE_0__/* .Hash */ .Vw { + constructor(hash, _key) { + super(); + this.finished = false; + this.destroyed = false; + (0,_assert_js__WEBPACK_IMPORTED_MODULE_1__/* .hash */ .tW)(hash); + const key = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__/* .toBytes */ .ZJ)(_key); + this.iHash = hash.create(); + if (typeof this.iHash.update !== 'function') + throw new Error('Expected instance of class which extends utils.Hash'); + this.blockLen = this.iHash.blockLen; + this.outputLen = this.iHash.outputLen; + const blockLen = this.blockLen; + const pad = new Uint8Array(blockLen); + // blockLen can be bigger than outputLen + pad.set(key.length > blockLen ? hash.create().update(key).digest() : key); + for (let i = 0; i < pad.length; i++) + pad[i] ^= 0x36; + this.iHash.update(pad); + // By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone + this.oHash = hash.create(); + // Undo internal XOR && apply outer XOR + for (let i = 0; i < pad.length; i++) + pad[i] ^= 0x36 ^ 0x5c; + this.oHash.update(pad); + pad.fill(0); + } + update(buf) { + (0,_assert_js__WEBPACK_IMPORTED_MODULE_1__/* .exists */ .t2)(this); + this.iHash.update(buf); + return this; + } + digestInto(out) { + (0,_assert_js__WEBPACK_IMPORTED_MODULE_1__/* .exists */ .t2)(this); + (0,_assert_js__WEBPACK_IMPORTED_MODULE_1__/* .bytes */ .ee)(out, this.outputLen); + this.finished = true; + this.iHash.digestInto(out); + this.oHash.update(out); + this.oHash.digestInto(out); + this.destroy(); + } + digest() { + const out = new Uint8Array(this.oHash.outputLen); + this.digestInto(out); + return out; + } + _cloneInto(to) { + // Create new instance without calling constructor since key already in state and we don't know it. + to || (to = Object.create(Object.getPrototypeOf(this), {})); + const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this; + to = to; + to.finished = finished; + to.destroyed = destroyed; + to.blockLen = blockLen; + to.outputLen = outputLen; + to.oHash = oHash._cloneInto(to.oHash); + to.iHash = iHash._cloneInto(to.iHash); + return to; + } + destroy() { + this.destroyed = true; + this.oHash.destroy(); + this.iHash.destroy(); + } +} +/** + * HMAC: RFC2104 message authentication code. + * @param hash - function that would be used e.g. sha256 + * @param key - message key + * @param message - message data + */ +const hmac = (hash, key, message) => new HMAC(hash, key).update(message).digest(); +hmac.create = (hash, key) => new HMAC(hash, key); +//# sourceMappingURL=hmac.js.map + +/***/ }), + +/***/ 2200: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ A: () => (/* binding */ pbkdf2) +/* harmony export */ }); +/* unused harmony export pbkdf2Async */ +/* harmony import */ var _assert_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(89190); +/* harmony import */ var _hmac_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(21454); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32531); + + + +// Common prologue and epilogue for sync/async functions +function pbkdf2Init(hash, _password, _salt, _opts) { + (0,_assert_js__WEBPACK_IMPORTED_MODULE_0__/* .hash */ .tW)(hash); + const opts = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .checkOpts */ .tY)({ dkLen: 32, asyncTick: 10 }, _opts); + const { c, dkLen, asyncTick } = opts; + (0,_assert_js__WEBPACK_IMPORTED_MODULE_0__/* .number */ .ai)(c); + (0,_assert_js__WEBPACK_IMPORTED_MODULE_0__/* .number */ .ai)(dkLen); + (0,_assert_js__WEBPACK_IMPORTED_MODULE_0__/* .number */ .ai)(asyncTick); + if (c < 1) + throw new Error('PBKDF2: iterations (c) should be >= 1'); + const password = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .toBytes */ .ZJ)(_password); + const salt = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .toBytes */ .ZJ)(_salt); + // DK = PBKDF2(PRF, Password, Salt, c, dkLen); + const DK = new Uint8Array(dkLen); + // U1 = PRF(Password, Salt + INT_32_BE(i)) + const PRF = _hmac_js__WEBPACK_IMPORTED_MODULE_2__/* .hmac */ .w.create(hash, password); + const PRFSalt = PRF._cloneInto().update(salt); + return { c, dkLen, asyncTick, DK, PRF, PRFSalt }; +} +function pbkdf2Output(PRF, PRFSalt, DK, prfW, u) { + PRF.destroy(); + PRFSalt.destroy(); + if (prfW) + prfW.destroy(); + u.fill(0); + return DK; +} +/** + * PBKDF2-HMAC: RFC 2898 key derivation function + * @param hash - hash function that would be used e.g. sha256 + * @param password - password from which a derived key is generated + * @param salt - cryptographic salt + * @param opts - {c, dkLen} where c is work factor and dkLen is output message size + */ +function pbkdf2(hash, password, salt, opts) { + const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); + let prfW; // Working copy + const arr = new Uint8Array(4); + const view = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .createView */ .O8)(arr); + const u = new Uint8Array(PRF.outputLen); + // DK = T1 + T2 + ⋯ + Tdklen/hlen + for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { + // Ti = F(Password, Salt, c, i) + const Ti = DK.subarray(pos, pos + PRF.outputLen); + view.setInt32(0, ti, false); + // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc + // U1 = PRF(Password, Salt + INT_32_BE(i)) + (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); + Ti.set(u.subarray(0, Ti.length)); + for (let ui = 1; ui < c; ui++) { + // Uc = PRF(Password, Uc−1) + PRF._cloneInto(prfW).update(u).digestInto(u); + for (let i = 0; i < Ti.length; i++) + Ti[i] ^= u[i]; + } + } + return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); +} +async function pbkdf2Async(hash, password, salt, opts) { + const { c, dkLen, asyncTick, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); + let prfW; // Working copy + const arr = new Uint8Array(4); + const view = createView(arr); + const u = new Uint8Array(PRF.outputLen); + // DK = T1 + T2 + ⋯ + Tdklen/hlen + for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { + // Ti = F(Password, Salt, c, i) + const Ti = DK.subarray(pos, pos + PRF.outputLen); + view.setInt32(0, ti, false); + // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc + // U1 = PRF(Password, Salt + INT_32_BE(i)) + (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); + Ti.set(u.subarray(0, Ti.length)); + await asyncLoop(c - 1, asyncTick, () => { + // Uc = PRF(Password, Uc−1) + PRF._cloneInto(prfW).update(u).digestInto(u); + for (let i = 0; i < Ti.length; i++) + Ti[i] ^= u[i]; + }); + } + return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); +} +//# sourceMappingURL=pbkdf2.js.map + +/***/ }), + +/***/ 78226: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ s: () => (/* binding */ sha256) +/* harmony export */ }); +/* unused harmony export sha224 */ +/* harmony import */ var _sha2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6800); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32531); + + +// SHA2-256 need to try 2^128 hashes to execute birthday attack. +// BTC network is doing 2^67 hashes/sec as per early 2023. +// Choice: a ? b : c +const Chi = (a, b, c) => (a & b) ^ (~a & c); +// Majority function, true if any two inpust is true +const Maj = (a, b, c) => (a & b) ^ (a & c) ^ (b & c); +// Round constants: +// first 32 bits of the fractional parts of the cube roots of the first 64 primes 2..311) +// prettier-ignore +const SHA256_K = /* @__PURE__ */ new Uint32Array([ + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 +]); +// Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19): +// prettier-ignore +const IV = /* @__PURE__ */ new Uint32Array([ + 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 +]); +// Temporary buffer, not used to store anything between runs +// Named this way because it matches specification. +const SHA256_W = /* @__PURE__ */ new Uint32Array(64); +class SHA256 extends _sha2_js__WEBPACK_IMPORTED_MODULE_0__/* .SHA2 */ .D { + constructor() { + super(64, 32, 8, false); + // We cannot use array here since array allows indexing by variable + // which means optimizer/compiler cannot use registers. + this.A = IV[0] | 0; + this.B = IV[1] | 0; + this.C = IV[2] | 0; + this.D = IV[3] | 0; + this.E = IV[4] | 0; + this.F = IV[5] | 0; + this.G = IV[6] | 0; + this.H = IV[7] | 0; + } + get() { + const { A, B, C, D, E, F, G, H } = this; + return [A, B, C, D, E, F, G, H]; + } + // prettier-ignore + set(A, B, C, D, E, F, G, H) { + this.A = A | 0; + this.B = B | 0; + this.C = C | 0; + this.D = D | 0; + this.E = E | 0; + this.F = F | 0; + this.G = G | 0; + this.H = H | 0; + } + process(view, offset) { + // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array + for (let i = 0; i < 16; i++, offset += 4) + SHA256_W[i] = view.getUint32(offset, false); + for (let i = 16; i < 64; i++) { + const W15 = SHA256_W[i - 15]; + const W2 = SHA256_W[i - 2]; + const s0 = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .rotr */ .Ow)(W15, 7) ^ (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .rotr */ .Ow)(W15, 18) ^ (W15 >>> 3); + const s1 = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .rotr */ .Ow)(W2, 17) ^ (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .rotr */ .Ow)(W2, 19) ^ (W2 >>> 10); + SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0; + } + // Compression function main loop, 64 rounds + let { A, B, C, D, E, F, G, H } = this; + for (let i = 0; i < 64; i++) { + const sigma1 = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .rotr */ .Ow)(E, 6) ^ (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .rotr */ .Ow)(E, 11) ^ (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .rotr */ .Ow)(E, 25); + const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; + const sigma0 = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .rotr */ .Ow)(A, 2) ^ (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .rotr */ .Ow)(A, 13) ^ (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .rotr */ .Ow)(A, 22); + const T2 = (sigma0 + Maj(A, B, C)) | 0; + H = G; + G = F; + F = E; + E = (D + T1) | 0; + D = C; + C = B; + B = A; + A = (T1 + T2) | 0; + } + // Add the compressed chunk to the current hash value + A = (A + this.A) | 0; + B = (B + this.B) | 0; + C = (C + this.C) | 0; + D = (D + this.D) | 0; + E = (E + this.E) | 0; + F = (F + this.F) | 0; + G = (G + this.G) | 0; + H = (H + this.H) | 0; + this.set(A, B, C, D, E, F, G, H); + } + roundClean() { + SHA256_W.fill(0); + } + destroy() { + this.set(0, 0, 0, 0, 0, 0, 0, 0); + this.buffer.fill(0); + } +} +// Constants from https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf +class SHA224 extends SHA256 { + constructor() { + super(); + this.A = 0xc1059ed8 | 0; + this.B = 0x367cd507 | 0; + this.C = 0x3070dd17 | 0; + this.D = 0xf70e5939 | 0; + this.E = 0xffc00b31 | 0; + this.F = 0x68581511 | 0; + this.G = 0x64f98fa7 | 0; + this.H = 0xbefa4fa4 | 0; + this.outputLen = 28; + } +} +/** + * SHA2-256 hash function + * @param message - data that would be hashed + */ +const sha256 = /* @__PURE__ */ (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .wrapConstructor */ .ld)(() => new SHA256()); +const sha224 = /* @__PURE__ */ (/* unused pure expression or super */ null && (wrapConstructor(() => new SHA224()))); +//# sourceMappingURL=sha256.js.map + +/***/ }), + +/***/ 32531: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + Vw: () => (/* binding */ Hash), + $h: () => (/* binding */ asyncLoop), + tY: () => (/* binding */ checkOpts), + Id: () => (/* binding */ concatBytes), + O8: () => (/* binding */ createView), + po: () => (/* binding */ randomBytes), + Ow: () => (/* binding */ rotr), + ZJ: () => (/* binding */ toBytes), + DH: () => (/* binding */ u32), + ld: () => (/* binding */ wrapConstructor) +}); + +// UNUSED EXPORTS: bytesToHex, hexToBytes, isLE, nextTick, u8, utf8ToBytes, wrapConstructorWithOpts, wrapXOFConstructorWithOpts + +;// ./node_modules/@noble/hashes/esm/crypto.js +const crypto_crypto = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined; +//# sourceMappingURL=crypto.js.map +;// ./node_modules/@noble/hashes/esm/utils.js +/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. +// node.js versions earlier than v19 don't declare it in global scope. +// For node.js, package.json#exports field mapping rewrites import +// from `crypto` to `cryptoNode`, which imports native module. +// Makes the utils un-importable in browsers without a bundler. +// Once node.js 18 is deprecated, we can just drop the import. + +const u8a = (a) => a instanceof Uint8Array; +// Cast array to different type +const u8 = (arr) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength); +const u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); +// Cast array to view +const createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength); +// The rotate right (circular right shift) operation for uint32 +const rotr = (word, shift) => (word << (32 - shift)) | (word >>> shift); +// big-endian hardware is rare. Just in case someone still decides to run hashes: +// early-throw an error because we don't support BE yet. +const isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44; +if (!isLE) + throw new Error('Non little-endian hardware is not supported'); +const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0')); +/** + * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' + */ +function bytesToHex(bytes) { + if (!u8a(bytes)) + throw new Error('Uint8Array expected'); + // pre-caching improves the speed 6x + let hex = ''; + for (let i = 0; i < bytes.length; i++) { + hex += hexes[bytes[i]]; + } + return hex; +} +/** + * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) + */ +function hexToBytes(hex) { + if (typeof hex !== 'string') + throw new Error('hex string expected, got ' + typeof hex); + const len = hex.length; + if (len % 2) + throw new Error('padded hex string expected, got unpadded hex of length ' + len); + const array = new Uint8Array(len / 2); + for (let i = 0; i < array.length; i++) { + const j = i * 2; + const hexByte = hex.slice(j, j + 2); + const byte = Number.parseInt(hexByte, 16); + if (Number.isNaN(byte) || byte < 0) + throw new Error('Invalid byte sequence'); + array[i] = byte; + } + return array; +} +// There is no setImmediate in browser and setTimeout is slow. +// call of async fn will return Promise, which will be fullfiled only on +// next scheduler queue processing step and this is exactly what we need. +const nextTick = async () => { }; +// Returns control to thread each 'tick' ms to avoid blocking +async function asyncLoop(iters, tick, cb) { + let ts = Date.now(); + for (let i = 0; i < iters; i++) { + cb(i); + // Date.now() is not monotonic, so in case if clock goes backwards we return return control too + const diff = Date.now() - ts; + if (diff >= 0 && diff < tick) + continue; + await nextTick(); + ts += diff; + } +} +/** + * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) + */ +function utf8ToBytes(str) { + if (typeof str !== 'string') + throw new Error(`utf8ToBytes expected string, got ${typeof str}`); + return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 +} +/** + * Normalizes (non-hex) string or Uint8Array to Uint8Array. + * Warning: when Uint8Array is passed, it would NOT get copied. + * Keep in mind for future mutable operations. + */ +function toBytes(data) { + if (typeof data === 'string') + data = utf8ToBytes(data); + if (!u8a(data)) + throw new Error(`expected Uint8Array, got ${typeof data}`); + return data; +} +/** + * Copies several Uint8Arrays into one. + */ +function concatBytes(...arrays) { + const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0)); + let pad = 0; // walk through each item, ensure they have proper type + arrays.forEach((a) => { + if (!u8a(a)) + throw new Error('Uint8Array expected'); + r.set(a, pad); + pad += a.length; + }); + return r; +} +// For runtime check if class implements interface +class Hash { + // Safe version that clones internal state + clone() { + return this._cloneInto(); + } +} +const toStr = {}.toString; +function checkOpts(defaults, opts) { + if (opts !== undefined && toStr.call(opts) !== '[object Object]') + throw new Error('Options should be object or undefined'); + const merged = Object.assign(defaults, opts); + return merged; +} +function wrapConstructor(hashCons) { + const hashC = (msg) => hashCons().update(toBytes(msg)).digest(); + const tmp = hashCons(); + hashC.outputLen = tmp.outputLen; + hashC.blockLen = tmp.blockLen; + hashC.create = () => hashCons(); + return hashC; +} +function wrapConstructorWithOpts(hashCons) { + const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest(); + const tmp = hashCons({}); + hashC.outputLen = tmp.outputLen; + hashC.blockLen = tmp.blockLen; + hashC.create = (opts) => hashCons(opts); + return hashC; +} +function wrapXOFConstructorWithOpts(hashCons) { + const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest(); + const tmp = hashCons({}); + hashC.outputLen = tmp.outputLen; + hashC.blockLen = tmp.blockLen; + hashC.create = (opts) => hashCons(opts); + return hashC; +} +/** + * Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS. + */ +function randomBytes(bytesLength = 32) { + if (crypto_crypto && typeof crypto_crypto.getRandomValues === 'function') { + return crypto_crypto.getRandomValues(new Uint8Array(bytesLength)); + } + throw new Error('crypto.getRandomValues must be defined'); +} +//# sourceMappingURL=utils.js.map + /***/ }), /***/ 90294: @@ -201045,7 +201119,7 @@ class StructFragment extends NamedFragment { /* harmony export */ KA: () => (/* binding */ Interface) /* harmony export */ }); /* unused harmony exports LogDescription, TransactionDescription, ErrorDescription, Indexed */ -/* harmony import */ var _crypto_index_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(15539); +/* harmony import */ var _crypto_index_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2011); /* harmony import */ var _hash_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(38264); /* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(88081); /* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57339); @@ -202781,7 +202855,7 @@ class Typed { /* harmony export */ b: () => (/* binding */ getAddress) /* harmony export */ }); /* unused harmony export getIcapAddress */ -/* harmony import */ var _crypto_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15539); +/* harmony import */ var _crypto_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2011); /* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36212); /* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57339); @@ -203079,7 +203153,7 @@ function resolveAddress(target, resolver) { /* harmony export */ t: () => (/* binding */ getCreateAddress) /* harmony export */ }); /* unused harmony export getCreate2Address */ -/* harmony import */ var _crypto_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(15539); +/* harmony import */ var _crypto_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2011); /* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(27033); /* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(36212); /* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(65735); @@ -204343,7 +204417,7 @@ class ContractEventPayload extends ContractUnknownEventPayload { /***/ }), -/***/ 8180: +/***/ 68682: /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; @@ -204356,19 +204430,19 @@ __webpack_require__.d(__webpack_exports__, { po: () => (/* binding */ randomBytes) }); -// EXTERNAL MODULE: ./node_modules/ethers/node_modules/@noble/hashes/esm/hmac.js -var hmac = __webpack_require__(4655); -// EXTERNAL MODULE: ./node_modules/ethers/node_modules/@noble/hashes/esm/pbkdf2.js -var pbkdf2 = __webpack_require__(84877); -// EXTERNAL MODULE: ./node_modules/ethers/node_modules/@noble/hashes/esm/sha256.js -var sha256 = __webpack_require__(3439); -// EXTERNAL MODULE: ./node_modules/ethers/node_modules/@noble/hashes/esm/_sha2.js -var _sha2 = __webpack_require__(37171); -// EXTERNAL MODULE: ./node_modules/ethers/node_modules/@noble/hashes/esm/_u64.js -var _u64 = __webpack_require__(86558); -// EXTERNAL MODULE: ./node_modules/ethers/node_modules/@noble/hashes/esm/utils.js + 1 modules -var utils = __webpack_require__(10750); -;// ./node_modules/ethers/node_modules/@noble/hashes/esm/sha512.js +// EXTERNAL MODULE: ./node_modules/@noble/hashes/esm/hmac.js +var hmac = __webpack_require__(21454); +// EXTERNAL MODULE: ./node_modules/@noble/hashes/esm/pbkdf2.js +var pbkdf2 = __webpack_require__(2200); +// EXTERNAL MODULE: ./node_modules/@noble/hashes/esm/sha256.js +var sha256 = __webpack_require__(78226); +// EXTERNAL MODULE: ./node_modules/@noble/hashes/esm/_sha2.js +var _sha2 = __webpack_require__(6800); +// EXTERNAL MODULE: ./node_modules/@noble/hashes/esm/_u64.js +var _u64 = __webpack_require__(79271); +// EXTERNAL MODULE: ./node_modules/@noble/hashes/esm/utils.js + 1 modules +var utils = __webpack_require__(32531); +;// ./node_modules/@noble/hashes/esm/sha512.js @@ -204654,7 +204728,7 @@ function randomBytes(length) { /***/ }), -/***/ 15539: +/***/ 2011: /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; @@ -204664,13 +204738,13 @@ __webpack_require__.d(__webpack_exports__, { S: () => (/* binding */ keccak256) }); -// EXTERNAL MODULE: ./node_modules/ethers/node_modules/@noble/hashes/esm/_assert.js -var _assert = __webpack_require__(27125); -// EXTERNAL MODULE: ./node_modules/ethers/node_modules/@noble/hashes/esm/_u64.js -var _u64 = __webpack_require__(86558); -// EXTERNAL MODULE: ./node_modules/ethers/node_modules/@noble/hashes/esm/utils.js + 1 modules -var utils = __webpack_require__(10750); -;// ./node_modules/ethers/node_modules/@noble/hashes/esm/sha3.js +// EXTERNAL MODULE: ./node_modules/@noble/hashes/esm/_assert.js +var _assert = __webpack_require__(89190); +// EXTERNAL MODULE: ./node_modules/@noble/hashes/esm/_u64.js +var _u64 = __webpack_require__(79271); +// EXTERNAL MODULE: ./node_modules/@noble/hashes/esm/utils.js + 1 modules +var utils = __webpack_require__(32531); +;// ./node_modules/@noble/hashes/esm/sha3.js @@ -204941,7 +205015,7 @@ Object.freeze(keccak256); /* harmony export */ s: () => (/* binding */ sha256) /* harmony export */ }); /* unused harmony export sha512 */ -/* harmony import */ var _crypto_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8180); +/* harmony import */ var _crypto_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(68682); /* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(36212); @@ -205346,7 +205420,7 @@ class Signature { /***/ }), -/***/ 15496: +/***/ 72588: /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; @@ -205356,7 +205430,7 @@ __webpack_require__.d(__webpack_exports__, { h: () => (/* binding */ SigningKey) }); -// NAMESPACE OBJECT: ./node_modules/ethers/node_modules/@noble/curves/esm/abstract/utils.js +// NAMESPACE OBJECT: ./node_modules/@noble/curves/esm/abstract/utils.js var utils_namespaceObject = {}; __webpack_require__.r(utils_namespaceObject); __webpack_require__.d(utils_namespaceObject, { @@ -205373,9 +205447,9 @@ __webpack_require__.d(utils_namespaceObject, { Q5: () => (validateObject) }); -// EXTERNAL MODULE: ./node_modules/ethers/node_modules/@noble/hashes/esm/sha256.js -var esm_sha256 = __webpack_require__(3439); -;// ./node_modules/ethers/node_modules/@noble/curves/esm/abstract/utils.js +// EXTERNAL MODULE: ./node_modules/@noble/hashes/esm/sha256.js +var esm_sha256 = __webpack_require__(78226); +;// ./node_modules/@noble/curves/esm/abstract/utils.js /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ // 100 lines of code in the file are duplicated from noble-hashes (utils). // This is OK: `abstract` directory does not use noble-hashes. @@ -205642,7 +205716,7 @@ function validateObject(object, validators, optValidators = {}) { // const z3 = validateObject(o, { test: 'boolean', z: 'bug' }); // const z4 = validateObject(o, { a: 'boolean', z: 'bug' }); //# sourceMappingURL=utils.js.map -;// ./node_modules/ethers/node_modules/@noble/curves/esm/abstract/modular.js +;// ./node_modules/@noble/curves/esm/abstract/modular.js /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ // Utilities for modular arithmetics and finite fields @@ -206059,11 +206133,11 @@ function mapHashToField(key, fieldOrder, isLE = false) { return isLE ? numberToBytesLE(reduced, fieldLen) : utils_numberToBytesBE(reduced, fieldLen); } //# sourceMappingURL=modular.js.map -// EXTERNAL MODULE: ./node_modules/ethers/node_modules/@noble/hashes/esm/hmac.js -var hmac = __webpack_require__(4655); -// EXTERNAL MODULE: ./node_modules/ethers/node_modules/@noble/hashes/esm/utils.js + 1 modules -var utils = __webpack_require__(10750); -;// ./node_modules/ethers/node_modules/@noble/curves/esm/abstract/curve.js +// EXTERNAL MODULE: ./node_modules/@noble/hashes/esm/hmac.js +var hmac = __webpack_require__(21454); +// EXTERNAL MODULE: ./node_modules/@noble/hashes/esm/utils.js + 1 modules +var utils = __webpack_require__(32531); +;// ./node_modules/@noble/curves/esm/abstract/curve.js /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ // Abelian group utilities @@ -206220,7 +206294,7 @@ function validateBasic(curve) { }); } //# sourceMappingURL=curve.js.map -;// ./node_modules/ethers/node_modules/@noble/curves/esm/abstract/weierstrass.js +;// ./node_modules/@noble/curves/esm/abstract/weierstrass.js /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ // Short Weierstrass curve. The formula is: y² = x³ + ax + b @@ -207277,7 +207351,7 @@ function weierstrass_mapToCurveSimpleSWU(Fp, opts) { }; } //# sourceMappingURL=weierstrass.js.map -;// ./node_modules/ethers/node_modules/@noble/curves/esm/_shortw_utils.js +;// ./node_modules/@noble/curves/esm/_shortw_utils.js /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ @@ -207295,7 +207369,7 @@ function createCurve(curveDef, defHash) { return Object.freeze({ ...create(defHash), create }); } //# sourceMappingURL=_shortw_utils.js.map -;// ./node_modules/ethers/node_modules/@noble/curves/esm/secp256k1.js +;// ./node_modules/@noble/curves/esm/secp256k1.js /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ @@ -207735,7 +207809,7 @@ class SigningKey { /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ id: () => (/* binding */ id) /* harmony export */ }); -/* harmony import */ var _crypto_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15539); +/* harmony import */ var _crypto_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2011); /* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(87303); @@ -207771,7 +207845,7 @@ __webpack_require__.d(__webpack_exports__, { // UNUSED EXPORTS: ensNormalize, isValidName // EXTERNAL MODULE: ./node_modules/ethers/lib.esm/crypto/keccak.js + 1 modules -var keccak = __webpack_require__(15539); +var keccak = __webpack_require__(2011); // EXTERNAL MODULE: ./node_modules/ethers/lib.esm/utils/errors.js var errors = __webpack_require__(57339); // EXTERNAL MODULE: ./node_modules/ethers/lib.esm/utils/utf8.js @@ -209117,7 +209191,7 @@ function dnsEncode(name, _maxLength) { /* harmony export */ }); /* unused harmony export verifyTypedData */ /* harmony import */ var _address_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(30031); -/* harmony import */ var _crypto_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(15539); +/* harmony import */ var _crypto_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2011); /* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36212); /* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(27033); /* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57339); @@ -211545,8 +211619,8 @@ function accessListify(value) { /* harmony export */ x: () => (/* binding */ recoverAddress) /* harmony export */ }); /* harmony import */ var _address_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(30031); -/* harmony import */ var _crypto_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15496); -/* harmony import */ var _crypto_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15539); +/* harmony import */ var _crypto_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72588); +/* harmony import */ var _crypto_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2011); /** @@ -211594,9 +211668,9 @@ var sha2 = __webpack_require__(68650); // EXTERNAL MODULE: ./node_modules/ethers/lib.esm/crypto/signature.js + 1 modules var crypto_signature = __webpack_require__(20260); // EXTERNAL MODULE: ./node_modules/ethers/lib.esm/crypto/keccak.js + 1 modules -var keccak = __webpack_require__(15539); +var keccak = __webpack_require__(2011); // EXTERNAL MODULE: ./node_modules/ethers/lib.esm/crypto/signing-key.js + 6 modules -var signing_key = __webpack_require__(15496); +var signing_key = __webpack_require__(72588); // EXTERNAL MODULE: ./node_modules/ethers/lib.esm/utils/errors.js var errors = __webpack_require__(57339); // EXTERNAL MODULE: ./node_modules/ethers/lib.esm/utils/maths.js @@ -215430,773 +215504,6 @@ function toUtf8CodePoints(str, form) { /***/ }), -/***/ 27125: -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ CG: () => (/* binding */ output), -/* harmony export */ ai: () => (/* binding */ number), -/* harmony export */ ee: () => (/* binding */ bytes), -/* harmony export */ t2: () => (/* binding */ exists), -/* harmony export */ tW: () => (/* binding */ hash) -/* harmony export */ }); -/* unused harmony export bool */ -function number(n) { - if (!Number.isSafeInteger(n) || n < 0) - throw new Error(`Wrong positive integer: ${n}`); -} -function bool(b) { - if (typeof b !== 'boolean') - throw new Error(`Expected boolean, not ${b}`); -} -function bytes(b, ...lengths) { - if (!(b instanceof Uint8Array)) - throw new Error('Expected Uint8Array'); - if (lengths.length > 0 && !lengths.includes(b.length)) - throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`); -} -function hash(hash) { - if (typeof hash !== 'function' || typeof hash.create !== 'function') - throw new Error('Hash should be wrapped by utils.wrapConstructor'); - number(hash.outputLen); - number(hash.blockLen); -} -function exists(instance, checkFinished = true) { - if (instance.destroyed) - throw new Error('Hash instance has been destroyed'); - if (checkFinished && instance.finished) - throw new Error('Hash#digest() has already been called'); -} -function output(out, instance) { - bytes(out); - const min = instance.outputLen; - if (out.length < min) { - throw new Error(`digestInto() expects output buffer of length at least ${min}`); - } -} - -const assert = { number, bool, bytes, hash, exists, output }; -/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ((/* unused pure expression or super */ null && (assert))); -//# sourceMappingURL=_assert.js.map - -/***/ }), - -/***/ 37171: -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ D: () => (/* binding */ SHA2) -/* harmony export */ }); -/* harmony import */ var _assert_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(27125); -/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10750); - - -// Polyfill for Safari 14 -function setBigUint64(view, byteOffset, value, isLE) { - if (typeof view.setBigUint64 === 'function') - return view.setBigUint64(byteOffset, value, isLE); - const _32n = BigInt(32); - const _u32_max = BigInt(0xffffffff); - const wh = Number((value >> _32n) & _u32_max); - const wl = Number(value & _u32_max); - const h = isLE ? 4 : 0; - const l = isLE ? 0 : 4; - view.setUint32(byteOffset + h, wh, isLE); - view.setUint32(byteOffset + l, wl, isLE); -} -// Base SHA2 class (RFC 6234) -class SHA2 extends _utils_js__WEBPACK_IMPORTED_MODULE_0__/* .Hash */ .Vw { - constructor(blockLen, outputLen, padOffset, isLE) { - super(); - this.blockLen = blockLen; - this.outputLen = outputLen; - this.padOffset = padOffset; - this.isLE = isLE; - this.finished = false; - this.length = 0; - this.pos = 0; - this.destroyed = false; - this.buffer = new Uint8Array(blockLen); - this.view = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__/* .createView */ .O8)(this.buffer); - } - update(data) { - (0,_assert_js__WEBPACK_IMPORTED_MODULE_1__/* .exists */ .t2)(this); - const { view, buffer, blockLen } = this; - data = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__/* .toBytes */ .ZJ)(data); - const len = data.length; - for (let pos = 0; pos < len;) { - const take = Math.min(blockLen - this.pos, len - pos); - // Fast path: we have at least one block in input, cast it to view and process - if (take === blockLen) { - const dataView = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__/* .createView */ .O8)(data); - for (; blockLen <= len - pos; pos += blockLen) - this.process(dataView, pos); - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - pos += take; - if (this.pos === blockLen) { - this.process(view, 0); - this.pos = 0; - } - } - this.length += data.length; - this.roundClean(); - return this; - } - digestInto(out) { - (0,_assert_js__WEBPACK_IMPORTED_MODULE_1__/* .exists */ .t2)(this); - (0,_assert_js__WEBPACK_IMPORTED_MODULE_1__/* .output */ .CG)(out, this); - this.finished = true; - // Padding - // We can avoid allocation of buffer for padding completely if it - // was previously not allocated here. But it won't change performance. - const { buffer, view, blockLen, isLE } = this; - let { pos } = this; - // append the bit '1' to the message - buffer[pos++] = 0b10000000; - this.buffer.subarray(pos).fill(0); - // we have less than padOffset left in buffer, so we cannot put length in current block, need process it and pad again - if (this.padOffset > blockLen - pos) { - this.process(view, 0); - pos = 0; - } - // Pad until full block byte with zeros - for (let i = pos; i < blockLen; i++) - buffer[i] = 0; - // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that - // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen. - // So we just write lowest 64 bits of that value. - setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE); - this.process(view, 0); - const oview = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__/* .createView */ .O8)(out); - const len = this.outputLen; - // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT - if (len % 4) - throw new Error('_sha2: outputLen should be aligned to 32bit'); - const outLen = len / 4; - const state = this.get(); - if (outLen > state.length) - throw new Error('_sha2: outputLen bigger than state'); - for (let i = 0; i < outLen; i++) - oview.setUint32(4 * i, state[i], isLE); - } - digest() { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } - _cloneInto(to) { - to || (to = new this.constructor()); - to.set(...this.get()); - const { blockLen, buffer, length, finished, destroyed, pos } = this; - to.length = length; - to.pos = pos; - to.finished = finished; - to.destroyed = destroyed; - if (length % blockLen) - to.buffer.set(buffer); - return to; - } -} -//# sourceMappingURL=_sha2.js.map - -/***/ }), - -/***/ 86558: -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ Ay: () => (__WEBPACK_DEFAULT_EXPORT__), -/* harmony export */ B4: () => (/* binding */ rotlSL), -/* harmony export */ P5: () => (/* binding */ rotlSH), -/* harmony export */ WM: () => (/* binding */ rotlBH), -/* harmony export */ im: () => (/* binding */ rotlBL), -/* harmony export */ lD: () => (/* binding */ split) -/* harmony export */ }); -/* unused harmony exports fromBig, toBig, shrSH, shrSL, rotrSH, rotrSL, rotrBH, rotrBL, rotr32H, rotr32L, add, add3L, add3H, add4L, add4H, add5H, add5L */ -const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1); -const _32n = /* @__PURE__ */ BigInt(32); -// We are not using BigUint64Array, because they are extremely slow as per 2022 -function fromBig(n, le = false) { - if (le) - return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) }; - return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 }; -} -function split(lst, le = false) { - let Ah = new Uint32Array(lst.length); - let Al = new Uint32Array(lst.length); - for (let i = 0; i < lst.length; i++) { - const { h, l } = fromBig(lst[i], le); - [Ah[i], Al[i]] = [h, l]; - } - return [Ah, Al]; -} -const toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0); -// for Shift in [0, 32) -const shrSH = (h, _l, s) => h >>> s; -const shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); -// Right rotate for Shift in [1, 32) -const rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s)); -const rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); -// Right rotate for Shift in (32, 64), NOTE: 32 is special case. -const rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32)); -const rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s)); -// Right rotate for shift===32 (just swaps l&h) -const rotr32H = (_h, l) => l; -const rotr32L = (h, _l) => h; -// Left rotate for Shift in [1, 32) -const rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s)); -const rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s)); -// Left rotate for Shift in (32, 64), NOTE: 32 is special case. -const rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s)); -const rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s)); -// JS uses 32-bit signed integers for bitwise operations which means we cannot -// simple take carry out of low bit sum by shift, we need to use division. -function add(Ah, Al, Bh, Bl) { - const l = (Al >>> 0) + (Bl >>> 0); - return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 }; -} -// Addition with more than 2 elements -const add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); -const add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0; -const add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); -const add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0; -const add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); -const add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0; -// prettier-ignore - -// prettier-ignore -const u64 = { - fromBig, split, toBig, - shrSH, shrSL, - rotrSH, rotrSL, rotrBH, rotrBL, - rotr32H, rotr32L, - rotlSH, rotlSL, rotlBH, rotlBL, - add, add3L, add3H, add4L, add4H, add5H, add5L, -}; -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (u64); -//# sourceMappingURL=_u64.js.map - -/***/ }), - -/***/ 4655: -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ w: () => (/* binding */ hmac) -/* harmony export */ }); -/* unused harmony export HMAC */ -/* harmony import */ var _assert_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(27125); -/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10750); - - -// HMAC (RFC 2104) -class HMAC extends _utils_js__WEBPACK_IMPORTED_MODULE_0__/* .Hash */ .Vw { - constructor(hash, _key) { - super(); - this.finished = false; - this.destroyed = false; - (0,_assert_js__WEBPACK_IMPORTED_MODULE_1__/* .hash */ .tW)(hash); - const key = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__/* .toBytes */ .ZJ)(_key); - this.iHash = hash.create(); - if (typeof this.iHash.update !== 'function') - throw new Error('Expected instance of class which extends utils.Hash'); - this.blockLen = this.iHash.blockLen; - this.outputLen = this.iHash.outputLen; - const blockLen = this.blockLen; - const pad = new Uint8Array(blockLen); - // blockLen can be bigger than outputLen - pad.set(key.length > blockLen ? hash.create().update(key).digest() : key); - for (let i = 0; i < pad.length; i++) - pad[i] ^= 0x36; - this.iHash.update(pad); - // By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone - this.oHash = hash.create(); - // Undo internal XOR && apply outer XOR - for (let i = 0; i < pad.length; i++) - pad[i] ^= 0x36 ^ 0x5c; - this.oHash.update(pad); - pad.fill(0); - } - update(buf) { - (0,_assert_js__WEBPACK_IMPORTED_MODULE_1__/* .exists */ .t2)(this); - this.iHash.update(buf); - return this; - } - digestInto(out) { - (0,_assert_js__WEBPACK_IMPORTED_MODULE_1__/* .exists */ .t2)(this); - (0,_assert_js__WEBPACK_IMPORTED_MODULE_1__/* .bytes */ .ee)(out, this.outputLen); - this.finished = true; - this.iHash.digestInto(out); - this.oHash.update(out); - this.oHash.digestInto(out); - this.destroy(); - } - digest() { - const out = new Uint8Array(this.oHash.outputLen); - this.digestInto(out); - return out; - } - _cloneInto(to) { - // Create new instance without calling constructor since key already in state and we don't know it. - to || (to = Object.create(Object.getPrototypeOf(this), {})); - const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this; - to = to; - to.finished = finished; - to.destroyed = destroyed; - to.blockLen = blockLen; - to.outputLen = outputLen; - to.oHash = oHash._cloneInto(to.oHash); - to.iHash = iHash._cloneInto(to.iHash); - return to; - } - destroy() { - this.destroyed = true; - this.oHash.destroy(); - this.iHash.destroy(); - } -} -/** - * HMAC: RFC2104 message authentication code. - * @param hash - function that would be used e.g. sha256 - * @param key - message key - * @param message - message data - */ -const hmac = (hash, key, message) => new HMAC(hash, key).update(message).digest(); -hmac.create = (hash, key) => new HMAC(hash, key); -//# sourceMappingURL=hmac.js.map - -/***/ }), - -/***/ 84877: -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ A: () => (/* binding */ pbkdf2) -/* harmony export */ }); -/* unused harmony export pbkdf2Async */ -/* harmony import */ var _assert_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27125); -/* harmony import */ var _hmac_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4655); -/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10750); - - - -// Common prologue and epilogue for sync/async functions -function pbkdf2Init(hash, _password, _salt, _opts) { - (0,_assert_js__WEBPACK_IMPORTED_MODULE_0__/* .hash */ .tW)(hash); - const opts = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .checkOpts */ .tY)({ dkLen: 32, asyncTick: 10 }, _opts); - const { c, dkLen, asyncTick } = opts; - (0,_assert_js__WEBPACK_IMPORTED_MODULE_0__/* .number */ .ai)(c); - (0,_assert_js__WEBPACK_IMPORTED_MODULE_0__/* .number */ .ai)(dkLen); - (0,_assert_js__WEBPACK_IMPORTED_MODULE_0__/* .number */ .ai)(asyncTick); - if (c < 1) - throw new Error('PBKDF2: iterations (c) should be >= 1'); - const password = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .toBytes */ .ZJ)(_password); - const salt = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .toBytes */ .ZJ)(_salt); - // DK = PBKDF2(PRF, Password, Salt, c, dkLen); - const DK = new Uint8Array(dkLen); - // U1 = PRF(Password, Salt + INT_32_BE(i)) - const PRF = _hmac_js__WEBPACK_IMPORTED_MODULE_2__/* .hmac */ .w.create(hash, password); - const PRFSalt = PRF._cloneInto().update(salt); - return { c, dkLen, asyncTick, DK, PRF, PRFSalt }; -} -function pbkdf2Output(PRF, PRFSalt, DK, prfW, u) { - PRF.destroy(); - PRFSalt.destroy(); - if (prfW) - prfW.destroy(); - u.fill(0); - return DK; -} -/** - * PBKDF2-HMAC: RFC 2898 key derivation function - * @param hash - hash function that would be used e.g. sha256 - * @param password - password from which a derived key is generated - * @param salt - cryptographic salt - * @param opts - {c, dkLen} where c is work factor and dkLen is output message size - */ -function pbkdf2(hash, password, salt, opts) { - const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); - let prfW; // Working copy - const arr = new Uint8Array(4); - const view = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .createView */ .O8)(arr); - const u = new Uint8Array(PRF.outputLen); - // DK = T1 + T2 + ⋯ + Tdklen/hlen - for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { - // Ti = F(Password, Salt, c, i) - const Ti = DK.subarray(pos, pos + PRF.outputLen); - view.setInt32(0, ti, false); - // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc - // U1 = PRF(Password, Salt + INT_32_BE(i)) - (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); - Ti.set(u.subarray(0, Ti.length)); - for (let ui = 1; ui < c; ui++) { - // Uc = PRF(Password, Uc−1) - PRF._cloneInto(prfW).update(u).digestInto(u); - for (let i = 0; i < Ti.length; i++) - Ti[i] ^= u[i]; - } - } - return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); -} -async function pbkdf2Async(hash, password, salt, opts) { - const { c, dkLen, asyncTick, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); - let prfW; // Working copy - const arr = new Uint8Array(4); - const view = createView(arr); - const u = new Uint8Array(PRF.outputLen); - // DK = T1 + T2 + ⋯ + Tdklen/hlen - for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { - // Ti = F(Password, Salt, c, i) - const Ti = DK.subarray(pos, pos + PRF.outputLen); - view.setInt32(0, ti, false); - // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc - // U1 = PRF(Password, Salt + INT_32_BE(i)) - (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); - Ti.set(u.subarray(0, Ti.length)); - await asyncLoop(c - 1, asyncTick, () => { - // Uc = PRF(Password, Uc−1) - PRF._cloneInto(prfW).update(u).digestInto(u); - for (let i = 0; i < Ti.length; i++) - Ti[i] ^= u[i]; - }); - } - return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); -} -//# sourceMappingURL=pbkdf2.js.map - -/***/ }), - -/***/ 3439: -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ s: () => (/* binding */ sha256) -/* harmony export */ }); -/* unused harmony export sha224 */ -/* harmony import */ var _sha2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37171); -/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10750); - - -// SHA2-256 need to try 2^128 hashes to execute birthday attack. -// BTC network is doing 2^67 hashes/sec as per early 2023. -// Choice: a ? b : c -const Chi = (a, b, c) => (a & b) ^ (~a & c); -// Majority function, true if any two inpust is true -const Maj = (a, b, c) => (a & b) ^ (a & c) ^ (b & c); -// Round constants: -// first 32 bits of the fractional parts of the cube roots of the first 64 primes 2..311) -// prettier-ignore -const SHA256_K = /* @__PURE__ */ new Uint32Array([ - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 -]); -// Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19): -// prettier-ignore -const IV = /* @__PURE__ */ new Uint32Array([ - 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 -]); -// Temporary buffer, not used to store anything between runs -// Named this way because it matches specification. -const SHA256_W = /* @__PURE__ */ new Uint32Array(64); -class SHA256 extends _sha2_js__WEBPACK_IMPORTED_MODULE_0__/* .SHA2 */ .D { - constructor() { - super(64, 32, 8, false); - // We cannot use array here since array allows indexing by variable - // which means optimizer/compiler cannot use registers. - this.A = IV[0] | 0; - this.B = IV[1] | 0; - this.C = IV[2] | 0; - this.D = IV[3] | 0; - this.E = IV[4] | 0; - this.F = IV[5] | 0; - this.G = IV[6] | 0; - this.H = IV[7] | 0; - } - get() { - const { A, B, C, D, E, F, G, H } = this; - return [A, B, C, D, E, F, G, H]; - } - // prettier-ignore - set(A, B, C, D, E, F, G, H) { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - this.E = E | 0; - this.F = F | 0; - this.G = G | 0; - this.H = H | 0; - } - process(view, offset) { - // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) - SHA256_W[i] = view.getUint32(offset, false); - for (let i = 16; i < 64; i++) { - const W15 = SHA256_W[i - 15]; - const W2 = SHA256_W[i - 2]; - const s0 = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .rotr */ .Ow)(W15, 7) ^ (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .rotr */ .Ow)(W15, 18) ^ (W15 >>> 3); - const s1 = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .rotr */ .Ow)(W2, 17) ^ (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .rotr */ .Ow)(W2, 19) ^ (W2 >>> 10); - SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0; - } - // Compression function main loop, 64 rounds - let { A, B, C, D, E, F, G, H } = this; - for (let i = 0; i < 64; i++) { - const sigma1 = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .rotr */ .Ow)(E, 6) ^ (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .rotr */ .Ow)(E, 11) ^ (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .rotr */ .Ow)(E, 25); - const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const sigma0 = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .rotr */ .Ow)(A, 2) ^ (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .rotr */ .Ow)(A, 13) ^ (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .rotr */ .Ow)(A, 22); - const T2 = (sigma0 + Maj(A, B, C)) | 0; - H = G; - G = F; - F = E; - E = (D + T1) | 0; - D = C; - C = B; - B = A; - A = (T1 + T2) | 0; - } - // Add the compressed chunk to the current hash value - A = (A + this.A) | 0; - B = (B + this.B) | 0; - C = (C + this.C) | 0; - D = (D + this.D) | 0; - E = (E + this.E) | 0; - F = (F + this.F) | 0; - G = (G + this.G) | 0; - H = (H + this.H) | 0; - this.set(A, B, C, D, E, F, G, H); - } - roundClean() { - SHA256_W.fill(0); - } - destroy() { - this.set(0, 0, 0, 0, 0, 0, 0, 0); - this.buffer.fill(0); - } -} -// Constants from https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf -class SHA224 extends SHA256 { - constructor() { - super(); - this.A = 0xc1059ed8 | 0; - this.B = 0x367cd507 | 0; - this.C = 0x3070dd17 | 0; - this.D = 0xf70e5939 | 0; - this.E = 0xffc00b31 | 0; - this.F = 0x68581511 | 0; - this.G = 0x64f98fa7 | 0; - this.H = 0xbefa4fa4 | 0; - this.outputLen = 28; - } -} -/** - * SHA2-256 hash function - * @param message - data that would be hashed - */ -const sha256 = /* @__PURE__ */ (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .wrapConstructor */ .ld)(() => new SHA256()); -const sha224 = /* @__PURE__ */ (/* unused pure expression or super */ null && (wrapConstructor(() => new SHA224()))); -//# sourceMappingURL=sha256.js.map - -/***/ }), - -/***/ 10750: -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, { - Vw: () => (/* binding */ Hash), - $h: () => (/* binding */ asyncLoop), - tY: () => (/* binding */ checkOpts), - Id: () => (/* binding */ concatBytes), - O8: () => (/* binding */ createView), - po: () => (/* binding */ randomBytes), - Ow: () => (/* binding */ rotr), - ZJ: () => (/* binding */ toBytes), - DH: () => (/* binding */ u32), - ld: () => (/* binding */ wrapConstructor) -}); - -// UNUSED EXPORTS: bytesToHex, hexToBytes, isLE, nextTick, u8, utf8ToBytes, wrapConstructorWithOpts, wrapXOFConstructorWithOpts - -;// ./node_modules/ethers/node_modules/@noble/hashes/esm/crypto.js -const crypto_crypto = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined; -//# sourceMappingURL=crypto.js.map -;// ./node_modules/ethers/node_modules/@noble/hashes/esm/utils.js -/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. -// node.js versions earlier than v19 don't declare it in global scope. -// For node.js, package.json#exports field mapping rewrites import -// from `crypto` to `cryptoNode`, which imports native module. -// Makes the utils un-importable in browsers without a bundler. -// Once node.js 18 is deprecated, we can just drop the import. - -const u8a = (a) => a instanceof Uint8Array; -// Cast array to different type -const u8 = (arr) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength); -const u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); -// Cast array to view -const createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength); -// The rotate right (circular right shift) operation for uint32 -const rotr = (word, shift) => (word << (32 - shift)) | (word >>> shift); -// big-endian hardware is rare. Just in case someone still decides to run hashes: -// early-throw an error because we don't support BE yet. -const isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44; -if (!isLE) - throw new Error('Non little-endian hardware is not supported'); -const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0')); -/** - * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' - */ -function bytesToHex(bytes) { - if (!u8a(bytes)) - throw new Error('Uint8Array expected'); - // pre-caching improves the speed 6x - let hex = ''; - for (let i = 0; i < bytes.length; i++) { - hex += hexes[bytes[i]]; - } - return hex; -} -/** - * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) - */ -function hexToBytes(hex) { - if (typeof hex !== 'string') - throw new Error('hex string expected, got ' + typeof hex); - const len = hex.length; - if (len % 2) - throw new Error('padded hex string expected, got unpadded hex of length ' + len); - const array = new Uint8Array(len / 2); - for (let i = 0; i < array.length; i++) { - const j = i * 2; - const hexByte = hex.slice(j, j + 2); - const byte = Number.parseInt(hexByte, 16); - if (Number.isNaN(byte) || byte < 0) - throw new Error('Invalid byte sequence'); - array[i] = byte; - } - return array; -} -// There is no setImmediate in browser and setTimeout is slow. -// call of async fn will return Promise, which will be fullfiled only on -// next scheduler queue processing step and this is exactly what we need. -const nextTick = async () => { }; -// Returns control to thread each 'tick' ms to avoid blocking -async function asyncLoop(iters, tick, cb) { - let ts = Date.now(); - for (let i = 0; i < iters; i++) { - cb(i); - // Date.now() is not monotonic, so in case if clock goes backwards we return return control too - const diff = Date.now() - ts; - if (diff >= 0 && diff < tick) - continue; - await nextTick(); - ts += diff; - } -} -/** - * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) - */ -function utf8ToBytes(str) { - if (typeof str !== 'string') - throw new Error(`utf8ToBytes expected string, got ${typeof str}`); - return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 -} -/** - * Normalizes (non-hex) string or Uint8Array to Uint8Array. - * Warning: when Uint8Array is passed, it would NOT get copied. - * Keep in mind for future mutable operations. - */ -function toBytes(data) { - if (typeof data === 'string') - data = utf8ToBytes(data); - if (!u8a(data)) - throw new Error(`expected Uint8Array, got ${typeof data}`); - return data; -} -/** - * Copies several Uint8Arrays into one. - */ -function concatBytes(...arrays) { - const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0)); - let pad = 0; // walk through each item, ensure they have proper type - arrays.forEach((a) => { - if (!u8a(a)) - throw new Error('Uint8Array expected'); - r.set(a, pad); - pad += a.length; - }); - return r; -} -// For runtime check if class implements interface -class Hash { - // Safe version that clones internal state - clone() { - return this._cloneInto(); - } -} -const toStr = {}.toString; -function checkOpts(defaults, opts) { - if (opts !== undefined && toStr.call(opts) !== '[object Object]') - throw new Error('Options should be object or undefined'); - const merged = Object.assign(defaults, opts); - return merged; -} -function wrapConstructor(hashCons) { - const hashC = (msg) => hashCons().update(toBytes(msg)).digest(); - const tmp = hashCons(); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = () => hashCons(); - return hashC; -} -function wrapConstructorWithOpts(hashCons) { - const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest(); - const tmp = hashCons({}); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = (opts) => hashCons(opts); - return hashC; -} -function wrapXOFConstructorWithOpts(hashCons) { - const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest(); - const tmp = hashCons({}); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = (opts) => hashCons(opts); - return hashC; -} -/** - * Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS. - */ -function randomBytes(bytesLength = 32) { - if (crypto_crypto && typeof crypto_crypto.getRandomValues === 'function') { - return crypto_crypto.getRandomValues(new Uint8Array(bytesLength)); - } - throw new Error('crypto.getRandomValues must be defined'); -} -//# sourceMappingURL=utils.js.map - -/***/ }), - /***/ 45238: /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { @@ -217870,7 +217177,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _pedersen__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(85111); /* harmony import */ var _permit__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(1180); /* harmony import */ var _prices__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(34525); -/* harmony import */ var _providers__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(68909); +/* harmony import */ var _providers__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(46170); /* harmony import */ var _relayerClient__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(57194); /* harmony import */ var _tokens__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(7393); /* harmony import */ var _tovarishClient__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(96838); diff --git a/dist/tornado.umd.min.js b/dist/tornado.umd.min.js index d4421c3..902c443 100644 --- a/dist/tornado.umd.min.js +++ b/dist/tornado.umd.min.js @@ -1,8 +1,8 @@ /*! For license information please see tornado.umd.min.js.LICENSE.txt */ -!function(e,a){"object"==typeof exports&&"object"==typeof module?module.exports=a():"function"==typeof define&&define.amd?define([],a):"object"==typeof exports?exports.Tornado=a():e.Tornado=a()}(self,(()=>(()=>{var __webpack_modules__={15795:(e,a,t)=>{const c=t(26613);a.cidForWeb=e=>{let a=new c(e);0===a.version&&(a=a.toV1());let t=a.toString("base32");if(t.length>63){const e=a.toString("base36");if(e.length<=63)return e;throw new TypeError("CID is longer than DNS limit of 63 characters and is not compatible with public gateways")}return t},a.cidV0ToV1Base32=e=>{let a=new c(e);return 0===a.version&&(a=a.toV1()),a.toString("base32")}},81810:(e,a,t)=>{const c=t(52021),f=t(14243),{hexStringToBuffer:d,profiles:r}=t(55262),{cidForWeb:n,cidV0ToV1Base32:i}=t(15795);e.exports={helpers:{cidForWeb:n,cidV0ToV1Base32:i},decode:function(e){const a=d(e),t=c.getCodec(a),f=c.rmPrefix(a);let n=r[t];return n||(n=r.default),n.decode(f)},fromIpfs:function(e){return this.encode("ipfs-ns",e)},fromSkylink:function(e){return this.encode("skynet-ns",e)},fromSwarm:function(e){return this.encode("swarm-ns",e)},fromArweave:function(e){return this.encode("arweave-ns",e)},encode:function(e,a){let t=r[e];t||(t=r.default);const d=t.encode(a);return f.toHexString(c.addPrefix(e,d))},getCodec:function(e){let a=d(e);return c.getCodec(a)}}},55262:(e,a,t)=>{var c=t(62045).hp;const f=t(26613),d=t(14243),r=t(8127),n=e=>{let a=e.slice(0,2),t=e.slice(2),c="";return c="0x"===a?t:e,d.fromHexString(c)},i=e=>{try{const{multihash:a}=e;if(a.length<38){const e=d.decode(a);if("identity"===e.name&&e.length<36)return!1}return!0}catch(e){return!1}},b={skynet:e=>r.toUint8Array(e),swarm:e=>{const a=d.encode(n(e),"keccak-256");return new f(1,"swarm-manifest",a).bytes},ipfs:e=>new f(e).toV1().bytes,ipns:e=>{const a=new f(e);if(!i(a))throw Error("ipns-ns allows only valid cryptographic libp2p-key identifiers, try using ED25519 pubkey instead");return new f(1,"libp2p-key",a.multihash).bytes},utf8:e=>c.from(e,"utf8"),arweave:e=>r.toUint8Array(e)},o={hexMultiHash:e=>{const a=new f(e);return d.decode(a.multihash).digest.toString("hex")},ipfs:e=>{const a=new f(e).toV1();return a.toString("libp2p-key"===a.codec?"base36":"base32")},ipns:e=>{const a=new f(e).toV1();return i(a)?a.toString("base36"):(console.warn("[ensdomains/content-hash] use of non-cryptographic identifiers in ipns-ns is deprecated and will be removed, migrate to ED25519 libp2p-key"),String(d.decode(new f(e).multihash).digest))},utf8:e=>e.toString("utf8"),base64:e=>r.fromUint8Array(e,!0)},s={"skynet-ns":{encode:b.skynet,decode:o.base64},"swarm-ns":{encode:b.swarm,decode:o.hexMultiHash},"ipfs-ns":{encode:b.ipfs,decode:o.ipfs},"ipns-ns":{encode:b.ipns,decode:o.ipns},"arweave-ns":{encode:b.arweave,decode:o.base64},default:{encode:b.utf8,decode:o.utf8}};a.hexStringToBuffer=n,a.profiles=s},66289:(e,a)=>{"use strict";function t(e){if(Array.isArray(e)){const a=[];let c=0;for(let f=0;fe.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return e.slice(a,t)}function f(e){if(0===e[0])throw new Error("invalid RLP: extra zeros");return o(b(e))}function d(e,a){if(e<56)return Uint8Array.from([e+a]);const t=h(e),c=h(a+55+t.length/2);return Uint8Array.from(s(c+t))}function r(e,a=!1){if(null==e||0===e.length)return Uint8Array.from([]);const t=n(g(e));if(a)return t;if(0!==t.remainder.length)throw new Error("invalid RLP: remainder must be zero");return t.data}function n(e){let a,t,d,r,i;const b=[],o=e[0];if(o<=127)return{data:e.slice(0,1),remainder:e.slice(1)};if(o<=183){if(a=o-127,d=128===o?Uint8Array.from([]):c(e,1,a),2===a&&d[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:d,remainder:e.slice(a)}}if(o<=191){if(t=o-182,e.length-1e.length)throw new Error("invalid RLP: total length is larger than the data");for(r=c(e,t,d);r.length;)i=n(r),b.push(i.data),r=i.remainder;return{data:b,remainder:e.slice(d)}}}Object.defineProperty(a,"__esModule",{value:!0}),a.RLP=a.utils=a.decode=a.encode=void 0,a.encode=t,a.decode=r;const i=Array.from({length:256},((e,a)=>a.toString(16).padStart(2,"0")));function b(e){let a="";for(let t=0;te+a.length),0),t=new Uint8Array(a);for(let a=0,c=0;a=2&&"0"===e[0]&&"x"===e[1]}function g(e){if(e instanceof Uint8Array)return e;if("string"==typeof e)return p(e)?s((a="string"!=typeof(t=e)?t:p(t)?t.slice(2):t).length%2?`0${a}`:a):u(e);var a,t;if("number"==typeof e||"bigint"==typeof e)return e?s(h(e)):Uint8Array.from([]);if(null==e)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof e)}a.utils={bytesToHex:b,concatBytes:l,hexToBytes:s,utf8ToBytes:u},a.RLP={encode:t,decode:r}},16284:(e,a,t)=>{"use strict";var c=t(62045).hp;Object.defineProperty(a,"__esModule",{value:!0}),a.accountBodyToRLP=a.accountBodyToSlim=a.accountBodyFromSlim=a.isZeroAddress=a.zeroAddress=a.importPublic=a.privateToAddress=a.privateToPublic=a.publicToAddress=a.pubToAddress=a.isValidPublic=a.isValidPrivate=a.generateAddress2=a.generateAddress=a.isValidChecksumAddress=a.toChecksumAddress=a.isValidAddress=a.Account=void 0;const f=t(66289),d=t(32019),r=t(26513),n=t(82672),i=t(77312),b=t(89838),o=t(35546),s=t(59498),l=BigInt(0);class u{constructor(e=l,a=l,t=b.KECCAK256_RLP,c=b.KECCAK256_NULL){this.nonce=e,this.balance=a,this.storageRoot=t,this.codeHash=c,this._validate()}static fromAccountData(e){const{nonce:a,balance:t,storageRoot:c,codeHash:f}=e;return new u(void 0!==a?(0,i.bufferToBigInt)((0,i.toBuffer)(a)):void 0,void 0!==t?(0,i.bufferToBigInt)((0,i.toBuffer)(t)):void 0,void 0!==c?(0,i.toBuffer)(c):void 0,void 0!==f?(0,i.toBuffer)(f):void 0)}static fromRlpSerializedAccount(e){const a=(0,i.arrToBufArr)(f.RLP.decode(Uint8Array.from(e)));if(!Array.isArray(a))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(a)}static fromValuesArray(e){const[a,t,c,f]=e;return new u((0,i.bufferToBigInt)(a),(0,i.bufferToBigInt)(t),c,f)}_validate(){if(this.nonce=8?l+=t[e].toUpperCase():l+=t[e];return l},a.isValidChecksumAddress=function(e,t){return(0,a.isValidAddress)(e)&&(0,a.toChecksumAddress)(e,t)===e},a.generateAddress=function(e,a){return(0,o.assertIsBuffer)(e),(0,o.assertIsBuffer)(a),(0,i.bufferToBigInt)(a)===BigInt(0)?c.from((0,d.keccak256)(f.RLP.encode((0,i.bufArrToArr)([e,null])))).slice(-20):c.from((0,d.keccak256)(f.RLP.encode((0,i.bufArrToArr)([e,a])))).slice(-20)},a.generateAddress2=function(e,a,t){if((0,o.assertIsBuffer)(e),(0,o.assertIsBuffer)(a),(0,o.assertIsBuffer)(t),20!==e.length)throw new Error("Expected from to be of length 20");if(32!==a.length)throw new Error("Expected salt to be of length 32");const f=(0,d.keccak256)(c.concat([c.from("ff","hex"),e,a,(0,d.keccak256)(t)]));return(0,i.toBuffer)(f).slice(-20)},a.isValidPrivate=function(e){return r.secp256k1.utils.isValidPrivateKey(e)},a.isValidPublic=function(e,a=!1){if((0,o.assertIsBuffer)(e),64===e.length)try{return r.secp256k1.ProjectivePoint.fromHex(c.concat([c.from([4]),e])),!0}catch(e){return!1}if(!a)return!1;try{return r.secp256k1.ProjectivePoint.fromHex(e),!0}catch(e){return!1}},a.pubToAddress=function(e,a=!1){if((0,o.assertIsBuffer)(e),a&&64!==e.length&&(e=c.from(r.secp256k1.ProjectivePoint.fromHex(e).toRawBytes(!1).slice(1))),64!==e.length)throw new Error("Expected pubKey to be of length 64");return c.from((0,d.keccak256)(e)).slice(-20)},a.publicToAddress=a.pubToAddress,a.privateToPublic=function(e){return(0,o.assertIsBuffer)(e),c.from(r.secp256k1.ProjectivePoint.fromPrivateKey(e).toRawBytes(!1).slice(1))},a.privateToAddress=function(e){return(0,a.publicToAddress)((0,a.privateToPublic)(e))},a.importPublic=function(e){return(0,o.assertIsBuffer)(e),64!==e.length&&(e=c.from(r.secp256k1.ProjectivePoint.fromHex(e).toRawBytes(!1).slice(1))),e},a.zeroAddress=function(){const e=(0,i.zeros)(20);return(0,i.bufferToHex)(e)},a.isZeroAddress=function(e){try{(0,o.assertIsString)(e)}catch(e){return!1}return(0,a.zeroAddress)()===e},a.accountBodyFromSlim=h;const p=new Uint8Array(0);a.accountBodyToSlim=function(e){const[a,t,c,f]=e;return[a,t,(0,i.arrToBufArr)(c).equals(b.KECCAK256_RLP)?p:c,(0,i.arrToBufArr)(f).equals(b.KECCAK256_NULL)?p:f]},a.accountBodyToRLP=function(e,a=!0){const t=a?h(e):e;return(0,i.arrToBufArr)(f.RLP.encode(t))}},86727:(e,a,t)=>{"use strict";var c=t(62045).hp;Object.defineProperty(a,"__esModule",{value:!0}),a.Address=void 0;const f=t(16284),d=t(77312);class r{constructor(e){if(20!==e.length)throw new Error("Invalid address length");this.buf=e}static zero(){return new r((0,d.zeros)(20))}static fromString(e){if(!(0,f.isValidAddress)(e))throw new Error("Invalid address");return new r((0,d.toBuffer)(e))}static fromPublicKey(e){if(!c.isBuffer(e))throw new Error("Public key should be Buffer");const a=(0,f.pubToAddress)(e);return new r(a)}static fromPrivateKey(e){if(!c.isBuffer(e))throw new Error("Private key should be Buffer");const a=(0,f.privateToAddress)(e);return new r(a)}static generate(e,a){if("bigint"!=typeof a)throw new Error("Expected nonce to be a bigint");return new r((0,f.generateAddress)(e.buf,(0,d.bigIntToBuffer)(a)))}static generate2(e,a,t){if(!c.isBuffer(a))throw new Error("Expected salt to be a Buffer");if(!c.isBuffer(t))throw new Error("Expected initCode to be a Buffer");return new r((0,f.generateAddress2)(e.buf,a,t))}equals(e){return this.buf.equals(e.buf)}isZero(){return this.equals(r.zero())}isPrecompileOrSystemAddress(){const e=(0,d.bufferToBigInt)(this.buf),a=BigInt(0),t=BigInt("0xffff");return e>=a&&e<=t}toString(){return"0x"+this.buf.toString("hex")}toBuffer(){return c.from(this.buf)}}a.Address=r},98421:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.AsyncEventEmitter=void 0;const c=t(37007);class f extends c.EventEmitter{emit(e,...a){let[t,c]=a;const f=this;let d=f._events[e]??[];return void 0===c&&"function"==typeof t&&(c=t,t=void 0),"newListener"!==e&&"removeListener"!==e||(t={event:t,fn:c},c=void 0),d=Array.isArray(d)?d:[d],async function(e,a,t){let c;for await(const f of a)try{f.length<2?f.call(e,t):await new Promise(((a,c)=>{f.call(e,t,(e=>{e?c(e):a()}))}))}catch(e){c=e}if(c)throw c}(f,d.slice(),t).then(c).catch(c),f.listenerCount(e)>0}once(e,a){const t=this;let c;if("function"!=typeof a)throw new TypeError("listener must be a function");return c=a.length>=2?function(f,d){t.removeListener(e,c),a(f,d)}:function(f){t.removeListener(e,c),a(f,c)},t.on(e,c),t}first(e,a){let t=this._events[e]??[];if("function"!=typeof a)throw new TypeError("listener must be a function");return Array.isArray(t)||(this._events[e]=t=[t]),t.unshift(a),this}before(e,a,t){return this.beforeOrAfter(e,a,t)}after(e,a,t){return this.beforeOrAfter(e,a,t,"after")}beforeOrAfter(e,a,t,c){let f,d,r=this._events[e]??[];const n="after"===c?1:0;if("function"!=typeof t)throw new TypeError("listener must be a function");if("function"!=typeof a)throw new TypeError("target must be a function");for(Array.isArray(r)||(this._events[e]=r=[r]),d=r.length,f=r.length;f--;)if(r[f]===a){d=f+n;break}return r.splice(d,0,t),this}on(e,a){return super.on(e,a)}addListener(e,a){return super.addListener(e,a)}prependListener(e,a){return super.prependListener(e,a)}prependOnceListener(e,a){return super.prependOnceListener(e,a)}removeAllListeners(e){return super.removeAllListeners(e)}removeListener(e,a){return super.removeListener(e,a)}eventNames(){return super.eventNames()}listeners(e){return super.listeners(e)}listenerCount(e){return super.listenerCount(e)}getMaxListeners(){return super.getMaxListeners()}setMaxListeners(e){return super.setMaxListeners(e)}}a.AsyncEventEmitter=f},77312:(e,a,t)=>{"use strict";var c=t(62045).hp;Object.defineProperty(a,"__esModule",{value:!0}),a.intToUnpaddedBuffer=a.bigIntToUnpaddedBuffer=a.bigIntToHex=a.bufArrToArr=a.arrToBufArr=a.validateNoLeadingZeroes=a.baToJSON=a.toUtf8=a.short=a.addHexPrefix=a.toUnsigned=a.fromSigned=a.bufferToInt=a.bigIntToBuffer=a.bufferToBigInt=a.bufferToHex=a.toBuffer=a.unpadHexString=a.unpadArray=a.unpadBuffer=a.setLengthRight=a.setLengthLeft=a.zeros=a.intToBuffer=a.intToHex=void 0;const f=t(35546),d=t(59498);a.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Received an invalid integer type: ${e}`);return`0x${e.toString(16)}`},a.intToBuffer=function(e){const t=(0,a.intToHex)(e);return c.from((0,d.padToEven)(t.slice(2)),"hex")},a.zeros=function(e){return c.allocUnsafe(e).fill(0)};const r=function(e,t,c){const f=(0,a.zeros)(t);return c?e.length0&&"0"===a.toString();)a=(e=e.slice(1))[0];return e};function i(e){const t=(0,a.bufferToHex)(e);return"0x"===t?BigInt(0):BigInt(t)}function b(e){return(0,a.toBuffer)("0x"+e.toString(16))}a.unpadBuffer=function(e){return(0,f.assertIsBuffer)(e),n(e)},a.unpadArray=function(e){return(0,f.assertIsArray)(e),n(e)},a.unpadHexString=function(e){return(0,f.assertIsHexString)(e),e=(0,d.stripHexPrefix)(e),"0x"+n(e)},a.toBuffer=function(e){if(null==e)return c.allocUnsafe(0);if(c.isBuffer(e))return c.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return c.from(e);if("string"==typeof e){if(!(0,d.isHexString)(e))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${e}`);return c.from((0,d.padToEven)((0,d.stripHexPrefix)(e)),"hex")}if("number"==typeof e)return(0,a.intToBuffer)(e);if("bigint"==typeof e){if(e0&&0===t[0])throw new Error(`${a} cannot have leading zeroes, received: ${t.toString("hex")}`)},a.arrToBufArr=function e(a){return Array.isArray(a)?a.map((a=>e(a))):c.from(a)},a.bufArrToArr=function e(a){return Array.isArray(a)?a.map((a=>e(a))):Uint8Array.from(a??[])},a.bigIntToHex=e=>"0x"+e.toString(16),a.bigIntToUnpaddedBuffer=function(e){return(0,a.unpadBuffer)(b(e))},a.intToUnpaddedBuffer=function(e){return(0,a.unpadBuffer)((0,a.intToBuffer)(e))}},89838:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.MAX_WITHDRAWALS_PER_PAYLOAD=a.RLP_EMPTY_STRING=a.KECCAK256_RLP=a.KECCAK256_RLP_S=a.KECCAK256_RLP_ARRAY=a.KECCAK256_RLP_ARRAY_S=a.KECCAK256_NULL=a.KECCAK256_NULL_S=a.TWO_POW256=a.SECP256K1_ORDER_DIV_2=a.SECP256K1_ORDER=a.MAX_INTEGER_BIGINT=a.MAX_INTEGER=a.MAX_UINT64=void 0;const c=t(48287),f=t(26513);a.MAX_UINT64=BigInt("0xffffffffffffffff"),a.MAX_INTEGER=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),a.MAX_INTEGER_BIGINT=BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935"),a.SECP256K1_ORDER=f.secp256k1.CURVE.n,a.SECP256K1_ORDER_DIV_2=f.secp256k1.CURVE.n/BigInt(2),a.TWO_POW256=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),a.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",a.KECCAK256_NULL=c.Buffer.from(a.KECCAK256_NULL_S,"hex"),a.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",a.KECCAK256_RLP_ARRAY=c.Buffer.from(a.KECCAK256_RLP_ARRAY_S,"hex"),a.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",a.KECCAK256_RLP=c.Buffer.from(a.KECCAK256_RLP_S,"hex"),a.RLP_EMPTY_STRING=c.Buffer.from([128]),a.MAX_WITHDRAWALS_PER_PAYLOAD=16},45062:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.compactBytesToNibbles=a.bytesToNibbles=a.nibblesToCompactBytes=a.nibblesToBytes=a.hasTerminator=void 0,a.hasTerminator=e=>e.length>0&&16===e[e.length-1],a.nibblesToBytes=(e,a)=>{for(let t=0,c=0;c{let t=0;(0,a.hasTerminator)(e)&&(t=1,e=e.subarray(0,e.length-1));const c=new Uint8Array(e.length/2+1);return c[0]=t<<5,1&~e.length||(c[0]|=16,c[0]|=e[0],e=e.subarray(1)),(0,a.nibblesToBytes)(e,c.subarray(1)),c},a.bytesToNibbles=e=>{const a=2*e.length+1,t=new Uint8Array(a);for(let a=0;a{if(0===e.length)return e;let t=(0,a.bytesToNibbles)(e);t[0]<2&&(t=t.subarray(0,t.length-1));const c=2-(1&t[0]);return t.subarray(c)}},35546:(e,a,t)=>{"use strict";var c=t(62045).hp;Object.defineProperty(a,"__esModule",{value:!0}),a.assertIsString=a.assertIsArray=a.assertIsBuffer=a.assertIsHexString=void 0;const f=t(59498);a.assertIsHexString=function(e){if(!(0,f.isHexString)(e))throw new Error(`This method only supports 0x-prefixed hex strings but input was: ${e}`)},a.assertIsBuffer=function(e){if(!c.isBuffer(e))throw new Error(`This method only supports Buffer but input was: ${e}`)},a.assertIsArray=function(e){if(!Array.isArray(e))throw new Error(`This method only supports number arrays but input was: ${e}`)},a.assertIsString=function(e){if("string"!=typeof e)throw new Error(`This method only supports strings but input was: ${e}`)}},68683:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),a.toAscii=a.stripHexPrefix=a.padToEven=a.isHexString=a.isHexPrefixed=a.getKeys=a.getBinarySize=a.fromUtf8=a.fromAscii=a.arrayContainsArray=void 0,f(t(89838),a),f(t(52652),a),f(t(16284),a),f(t(86727),a),f(t(37380),a),f(t(92133),a),f(t(77312),a),f(t(42666),a),f(t(45062),a),f(t(98421),a);var d=t(59498);Object.defineProperty(a,"arrayContainsArray",{enumerable:!0,get:function(){return d.arrayContainsArray}}),Object.defineProperty(a,"fromAscii",{enumerable:!0,get:function(){return d.fromAscii}}),Object.defineProperty(a,"fromUtf8",{enumerable:!0,get:function(){return d.fromUtf8}}),Object.defineProperty(a,"getBinarySize",{enumerable:!0,get:function(){return d.getBinarySize}}),Object.defineProperty(a,"getKeys",{enumerable:!0,get:function(){return d.getKeys}}),Object.defineProperty(a,"isHexPrefixed",{enumerable:!0,get:function(){return d.isHexPrefixed}}),Object.defineProperty(a,"isHexString",{enumerable:!0,get:function(){return d.isHexString}}),Object.defineProperty(a,"padToEven",{enumerable:!0,get:function(){return d.padToEven}}),Object.defineProperty(a,"stripHexPrefix",{enumerable:!0,get:function(){return d.stripHexPrefix}}),Object.defineProperty(a,"toAscii",{enumerable:!0,get:function(){return d.toAscii}}),f(t(31708),a),f(t(81862),a)},59498:(e,a,t)=>{"use strict";var c=t(62045).hp;function f(e){if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type "+typeof e);return"0"===e[0]&&"x"===e[1]}function d(e){let a=e;if("string"!=typeof a)throw new Error("[padToEven] value must be type 'string', received "+typeof a);return a.length%2&&(a=`0${a}`),a}Object.defineProperty(a,"__esModule",{value:!0}),a.isHexString=a.getKeys=a.fromAscii=a.fromUtf8=a.toAscii=a.arrayContainsArray=a.getBinarySize=a.padToEven=a.stripHexPrefix=a.isHexPrefixed=void 0,a.isHexPrefixed=f,a.stripHexPrefix=e=>{if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received "+typeof e);return f(e)?e.slice(2):e},a.padToEven=d,a.getBinarySize=function(e){if("string"!=typeof e)throw new Error("[getBinarySize] method requires input type 'string', received "+typeof e);return c.byteLength(e,"utf8")},a.arrayContainsArray=function(e,a,t){if(!0!==Array.isArray(e))throw new Error(`[arrayContainsArray] method requires input 'superset' to be an array, got type '${typeof e}'`);if(!0!==Array.isArray(a))throw new Error(`[arrayContainsArray] method requires input 'subset' to be an array, got type '${typeof a}'`);return a[!0===t?"some":"every"]((a=>e.indexOf(a)>=0))},a.toAscii=function(e){let a="",t=0;const c=e.length;for("0x"===e.substring(0,2)&&(t=2);t0&&e.length!==2+2*a)}},31708:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.Lock=void 0,a.Lock=class{constructor(){this.permits=1,this.promiseResolverQueue=[]}async acquire(){return this.permits>0?(this.permits-=1,Promise.resolve(!0)):new Promise((e=>this.promiseResolverQueue.push(e)))}release(){if(this.permits+=1,this.permits>1&&this.promiseResolverQueue.length>0)console.warn("Lock.permits should never be > 0 when there is someone waiting.");else if(1===this.permits&&this.promiseResolverQueue.length>0){this.permits-=1;const e=this.promiseResolverQueue.shift();e&&e(!0)}}}},81862:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.getProvider=a.fetchFromProvider=void 0;const c=t(6215);a.fetchFromProvider=async(e,a)=>(await(0,c.default)(e,{headers:{"content-type":"application/json"},type:"json",data:{method:a.method,params:a.params,jsonrpc:"2.0",id:1}})).result,a.getProvider=e=>{if("string"==typeof e)return e;if(void 0!==e?.connection?.url)return e.connection.url;throw new Error("Must provide valid provider URL or Web3Provider")}},92133:(e,a,t)=>{"use strict";var c=t(62045).hp;Object.defineProperty(a,"__esModule",{value:!0}),a.hashPersonalMessage=a.isValidSignature=a.fromRpcSig=a.toCompactSig=a.toRpcSig=a.ecrecover=a.ecsign=void 0;const f=t(32019),d=t(26513),r=t(77312),n=t(89838),i=t(35546);function b(e,a){return e===BigInt(0)||e===BigInt(1)?e:void 0===a?e-BigInt(27):e-(a*BigInt(2)+BigInt(35))}function o(e){return e===BigInt(0)||e===BigInt(1)}a.ecsign=function(e,a,t){const f=d.secp256k1.sign(e,a),r=f.toCompactRawBytes();return{r:c.from(r.slice(0,32)),s:c.from(r.slice(32,64)),v:void 0===t?BigInt(f.recovery+27):BigInt(f.recovery+35)+BigInt(t)*BigInt(2)}},a.ecrecover=function(e,a,t,f,n){const i=c.concat([(0,r.setLengthLeft)(t,32),(0,r.setLengthLeft)(f,32)],64),s=b(a,n);if(!o(s))throw new Error("Invalid signature v value");const l=d.secp256k1.Signature.fromCompact(i).addRecoveryBit(Number(s)).recoverPublicKey(e);return c.from(l.toRawBytes(!1).slice(1))},a.toRpcSig=function(e,a,t,f){if(!o(b(e,f)))throw new Error("Invalid signature v value");return(0,r.bufferToHex)(c.concat([(0,r.setLengthLeft)(a,32),(0,r.setLengthLeft)(t,32),(0,r.toBuffer)(e)]))},a.toCompactSig=function(e,a,t,f){if(!o(b(e,f)))throw new Error("Invalid signature v value");let d=t;return(e>BigInt(28)&&e%BigInt(2)===BigInt(1)||e===BigInt(1)||e===BigInt(28))&&(d=c.from(t),d[0]|=128),(0,r.bufferToHex)(c.concat([(0,r.setLengthLeft)(a,32),(0,r.setLengthLeft)(d,32)]))},a.fromRpcSig=function(e){const a=(0,r.toBuffer)(e);let t,c,f;if(a.length>=65)t=a.slice(0,32),c=a.slice(32,64),f=(0,r.bufferToBigInt)(a.slice(64));else{if(64!==a.length)throw new Error("Invalid signature length");t=a.slice(0,32),c=a.slice(32,64),f=BigInt((0,r.bufferToInt)(a.slice(32,33))>>7),c[0]&=127}return f<27&&(f+=BigInt(27)),{v:f,r:t,s:c}},a.isValidSignature=function(e,a,t,c=!0,f){if(32!==a.length||32!==t.length)return!1;if(!o(b(e,f)))return!1;const d=(0,r.bufferToBigInt)(a),i=(0,r.bufferToBigInt)(t);return!(d===BigInt(0)||d>=n.SECP256K1_ORDER||i===BigInt(0)||i>=n.SECP256K1_ORDER||c&&i>=n.SECP256K1_ORDER_DIV_2)},a.hashPersonalMessage=function(e){(0,i.assertIsBuffer)(e);const a=c.from(`Ethereum Signed Message:\n${e.length}`,"utf-8");return c.from((0,f.keccak256)(c.concat([a,e])))}},42666:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.toType=a.TypeOutput=void 0;const c=t(77312),f=t(59498);var d;!function(e){e[e.Number=0]="Number",e[e.BigInt=1]="BigInt",e[e.Buffer=2]="Buffer",e[e.PrefixedHexString=3]="PrefixedHexString"}(d=a.TypeOutput||(a.TypeOutput={})),a.toType=function(e,a){if(null===e)return null;if(void 0===e)return;if("string"==typeof e&&!(0,f.isHexString)(e))throw new Error(`A string must be provided with a 0x-prefix, given: ${e}`);if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const t=(0,c.toBuffer)(e);switch(a){case d.Buffer:return t;case d.BigInt:return(0,c.bufferToBigInt)(t);case d.Number:{const e=(0,c.bufferToBigInt)(t);if(e>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return Number(e)}case d.PrefixedHexString:return(0,c.bufferToHex)(t);default:throw new Error("unknown outputType")}}},52652:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.GWEI_TO_WEI=void 0,a.GWEI_TO_WEI=BigInt(1e9)},37380:(e,a,t)=>{"use strict";var c=t(62045).hp;Object.defineProperty(a,"__esModule",{value:!0}),a.Withdrawal=void 0;const f=t(86727),d=t(77312),r=t(42666);class n{constructor(e,a,t,c){this.index=e,this.validatorIndex=a,this.address=t,this.amount=c}static fromWithdrawalData(e){const{index:a,validatorIndex:t,address:c,amount:d}=e,i=(0,r.toType)(a,r.TypeOutput.BigInt),b=(0,r.toType)(t,r.TypeOutput.BigInt),o=new f.Address((0,r.toType)(c,r.TypeOutput.Buffer)),s=(0,r.toType)(d,r.TypeOutput.BigInt);return new n(i,b,o,s)}static fromValuesArray(e){if(4!==e.length)throw Error(`Invalid withdrawalArray length expected=4 actual=${e.length}`);const[a,t,c,f]=e;return n.fromWithdrawalData({index:a,validatorIndex:t,address:c,amount:f})}static toBufferArray(e){const{index:a,validatorIndex:t,address:d,amount:n}=e,i=(0,r.toType)(a,r.TypeOutput.BigInt)===BigInt(0)?c.alloc(0):(0,r.toType)(a,r.TypeOutput.Buffer),b=(0,r.toType)(t,r.TypeOutput.BigInt)===BigInt(0)?c.alloc(0):(0,r.toType)(t,r.TypeOutput.Buffer);let o;return o=d instanceof f.Address?d.buf:(0,r.toType)(d,r.TypeOutput.Buffer),[i,b,o,(0,r.toType)(n,r.TypeOutput.BigInt)===BigInt(0)?c.alloc(0):(0,r.toType)(n,r.TypeOutput.Buffer)]}raw(){return n.toBufferArray(this)}toValue(){return{index:this.index,validatorIndex:this.validatorIndex,address:this.address.buf,amount:this.amount}}toJSON(){return{index:(0,d.bigIntToHex)(this.index),validatorIndex:(0,d.bigIntToHex)(this.validatorIndex),address:"0x"+this.address.buf.toString("hex"),amount:(0,d.bigIntToHex)(this.amount)}}}a.Withdrawal=n},56498:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.decodeSingle=a.decode=a.encodePacked=a.encodeSingle=a.encode=void 0;const c=t(52367),f=t(5961),d=t(37700);a.encode=(e,a,t,c)=>{try{return(0,d.pack)({types:e,values:a,packed:t,tight:c})}catch(e){if(e instanceof f.ParserError)throw new f.ParserError(`Unable to encode value: ${e.message}`,e);throw new f.ParserError(`An unexpected error occurred: ${(0,f.getErrorMessage)(e)}`,e)}},a.encodeSingle=(e,t)=>(0,a.encode)([e],[t]),a.encodePacked=(e,t,c)=>(0,a.encode)(e,t,!0,c),a.decode=(e,a)=>{const t=(0,c.createBytes)(a);try{return(0,d.unpack)(e,t)}catch(e){if(e instanceof f.ParserError)throw new f.ParserError(`Unable to decode value: ${e.message}`,e);throw new f.ParserError(`An unexpected error occurred: ${(0,f.getErrorMessage)(e)}`,e)}},a.decodeSingle=(e,t)=>{const d=(0,a.decode)([e],t);return(0,c.assert)(1===d.length,new f.ParserError("Decoded value array has unexpected length.")),d[0]}},5961:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.ParserError=a.getErrorStack=a.getErrorMessage=void 0;const c=t(52367);a.getErrorMessage=e=>"string"==typeof e?e:e instanceof Error||(0,c.isObject)(e)&&(0,c.hasProperty)(e,"message")&&"string"==typeof e.message?e.message:"Unknown error.",a.getErrorStack=e=>{if(e instanceof Error)return e.stack};class f extends Error{constructor(e,t){super(e),this.name="ParserError";const c=(0,a.getErrorStack)(t);c&&(this.stack=c)}}a.ParserError=f},93256:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),f(t(56498),a),f(t(5961),a),f(t(11126),a)},57924:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.iterate=void 0;const c=t(52367);a.iterate=function*(e,a=32){for(let t=0;t{(0,c.assert)(e>=0,"Cannot skip a negative number of bytes."),(0,c.assert)(e%a==0,"Length must be a multiple of the size."),t+=e},d=e.subarray(t);yield{skip:f,value:d}}return{skip:()=>{},value:new Uint8Array}}},37700:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.unpack=a.pack=a.isDynamicParser=a.getParser=void 0;const c=t(52367),f=t(5961),d=t(57924),r=t(46207),n=t(26365);a.getParser=e=>{const a={address:r.address,array:r.array,bool:r.bool,bytes:r.bytes,fixedBytes:r.fixedBytes,function:r.fn,number:r.number,string:r.string,tuple:r.tuple},t=a[e];if(t)return t;const c=Object.values(a).find((a=>a.isType(e)));if(c)return c;throw new f.ParserError(`The type "${e}" is not supported.`)},a.isDynamicParser=(e,a)=>{const{isDynamic:t}=e;return"function"==typeof t?t(a):t},a.pack=({types:e,values:t,packed:d=!1,tight:r=!1,arrayPacked:i=!1,byteArray:b=new Uint8Array})=>{(0,c.assert)(e.length===t.length,new f.ParserError(`The number of types (${e.length}) does not match the number of values (${t.length}).`));const{staticBuffer:o,dynamicBuffer:s,pointers:l}=e.reduce((({staticBuffer:e,dynamicBuffer:f,pointers:n},b,o)=>{const s=(0,a.getParser)(b),l=t[o];return d||i||!(0,a.isDynamicParser)(s,b)?{staticBuffer:s.encode({buffer:e,value:l,type:b,packed:d,tight:r}),dynamicBuffer:f,pointers:n}:{staticBuffer:(0,c.concatBytes)([e,new Uint8Array(32)]),dynamicBuffer:s.encode({buffer:f,value:l,type:b,packed:d,tight:r}),pointers:[...n,{position:e.length,pointer:f.length}]}}),{staticBuffer:new Uint8Array,dynamicBuffer:new Uint8Array,pointers:[]});(0,c.assert)(!d&&!i||0===s.length,new f.ParserError("Invalid pack state."));const u=o.length,h=l.reduce(((e,{pointer:a,position:t})=>{const f=(0,n.padStart)((0,c.numberToBytes)(u+a));return(0,n.set)(e,f,t)}),o);return(0,c.concatBytes)([b,h,s])},a.unpack=(e,t)=>{const r=(0,d.iterate)(t);return e.map((e=>{const{value:{value:d,skip:n},done:i}=r.next();(0,c.assert)(!i,new f.ParserError(`The encoded value is invalid for the provided types. Reached end of buffer while attempting to parse "${e}".`));const b=(0,a.getParser)(e);if((0,a.isDynamicParser)(b,e)){const a=(0,c.bytesToNumber)(d.subarray(0,32)),f=t.subarray(a);return b.decode({type:e,value:f,skip:n})}return b.decode({type:e,value:d,skip:n})}))}},91563:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.address=a.getAddress=void 0;const c=t(52367),f=t(5961),d=t(26365);a.getAddress=e=>{const a=(0,c.createBytes)(e);return(0,c.assert)(a.length<=20,new f.ParserError(`Invalid address value. Expected address to be 20 bytes long, but received ${a.length} bytes.`)),(0,d.padStart)(a,20)},a.address={isDynamic:!1,isType:e=>"address"===e,getByteLength:()=>32,encode({buffer:e,value:t,packed:f}){const r=(0,a.getAddress)(t);if(f)return(0,c.concatBytes)([e,r]);const n=(0,d.padStart)(r);return(0,c.concatBytes)([e,n])},decode:({value:e})=>(0,c.add0x)((0,c.bytesToHex)(e.slice(12,32)))}},186:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.array=a.getTupleType=a.getArrayType=a.isArrayType=void 0;const c=t(52367),f=t(5961),d=t(37700),r=t(26365),n=t(83415),i=t(30717),b=/^(?.*)\[(?\d*?)\]$/u;a.isArrayType=e=>b.test(e),a.getArrayType=e=>{const a=e.match(b);return(0,c.assert)(a?.groups?.type,new f.ParserError(`Invalid array type. Expected an array type, but received "${e}".`)),[a.groups.type,a.groups.length?parseInt(a.groups.length,10):void 0]},a.getTupleType=(e,a)=>`(${new Array(a).fill(e).join(",")})`,a.array={isDynamic(e){const[t,c]=(0,a.getArrayType)(e);return void 0===c||(0,d.isDynamicParser)((0,d.getParser)(t),t)},isType:e=>(0,a.isArrayType)(e),getByteLength(e){(0,c.assert)((0,a.isArrayType)(e),new f.ParserError(`Expected an array type, but received "${e}".`));const[t,r]=(0,a.getArrayType)(e);return(0,d.isDynamicParser)(this,e)||void 0===r?32:i.tuple.getByteLength((0,a.getTupleType)(t,r))},encode({type:e,buffer:t,value:b,packed:o,tight:s}){const[l,u]=(0,a.getArrayType)(e);if((0,c.assert)(!o||!(0,a.isArrayType)(l),new f.ParserError("Cannot pack nested arrays.")),o&&(0,d.isDynamicParser)((0,d.getParser)(l),l))return(0,d.pack)({types:new Array(b.length).fill(l),values:b,byteArray:t,packed:o,arrayPacked:!0,tight:s});if(u)return(0,c.assert)(u===b.length,new f.ParserError(`Array length does not match type length. Expected a length of ${u}, but received ${b.length}.`)),i.tuple.encode({type:(0,a.getTupleType)(l,u),buffer:t,value:b,packed:n.fixedBytes.isType(l)&&s,tight:s});if(o)return(0,d.pack)({types:new Array(b.length).fill(l),values:b,byteArray:t,packed:n.fixedBytes.isType(l)&&s,arrayPacked:!0,tight:s});const h=(0,r.padStart)((0,c.numberToBytes)(b.length));return(0,d.pack)({types:new Array(b.length).fill(l),values:b,byteArray:(0,c.concatBytes)([t,h]),packed:o,tight:s})},decode({type:e,value:t,...r}){const[n,b]=(0,a.getArrayType)(e);if(b){const e=i.tuple.decode({type:(0,a.getTupleType)(n,b),value:t,...r});return(0,c.assert)(e.length===b,new f.ParserError(`Array length does not match type length. Expected a length of ${b}, but received ${e.length}.`)),e}const o=(0,c.bytesToNumber)(t.subarray(0,32));return(0,d.unpack)(new Array(o).fill(n),t.subarray(32))}}},47435:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.bool=a.getBooleanValue=void 0;const c=t(35620),f=t(52367),d=t(5961),r=t(6150),n=(0,c.coerce)((0,c.boolean)(),(0,c.union)([(0,c.literal)("true"),(0,c.literal)("false")]),(e=>"true"===e));a.getBooleanValue=e=>{try{return(0,c.create)(e,n)?BigInt(1):BigInt(0)}catch{throw new d.ParserError(`Invalid boolean value. Expected a boolean literal, or the string "true" or "false", but received "${e}".`)}},a.bool={isDynamic:!1,isType:e=>"bool"===e,getByteLength:()=>32,encode({buffer:e,value:t,packed:c,tight:d}){const n=(0,a.getBooleanValue)(t);return c?(0,f.concatBytes)([e,(0,f.bigIntToBytes)(n)]):r.number.encode({type:"uint256",buffer:e,value:n,packed:c,tight:d})},decode:e=>r.number.decode({...e,type:"uint256"})===BigInt(1)}},99356:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.bytes=void 0;const c=t(52367),f=t(26365);a.bytes={isDynamic:!0,isType:e=>"bytes"===e,getByteLength:()=>32,encode({buffer:e,value:a,packed:t}){const d=(0,c.createBytes)(a);if(t)return(0,c.concatBytes)([e,d]);const r=32*Math.ceil(d.byteLength/32);return(0,c.concatBytes)([e,(0,f.padStart)((0,c.numberToBytes)(d.byteLength)),(0,f.padEnd)(d,r)])},decode({value:e}){const a=e.subarray(0,32),t=(0,c.bytesToNumber)(a);return e.slice(32,32+t)}}},83415:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.fixedBytes=a.getByteLength=void 0;const c=t(52367),f=t(5961),d=t(26365),r=/^bytes([0-9]{1,2})$/u;a.getByteLength=e=>{const a=e.match(r)?.[1];(0,c.assert)(a,`Invalid byte length. Expected a number between 1 and 32, but received "${e}".`);const t=Number(a);return(0,c.assert)(t>0&&t<=32,new f.ParserError(`Invalid byte length. Expected a number between 1 and 32, but received "${e}".`)),t},a.fixedBytes={isDynamic:!1,isType:e=>r.test(e),getByteLength:()=>32,encode({type:e,buffer:t,value:r,packed:n}){const i=(0,a.getByteLength)(e),b=(0,c.createBytes)(r);return(0,c.assert)(b.length<=i,new f.ParserError(`Expected a value of length ${i}, but received a value of length ${b.length}.`)),n?(0,c.concatBytes)([t,(0,d.padEnd)(b,i)]):(0,c.concatBytes)([t,(0,d.padEnd)(b)])},decode({type:e,value:t}){const c=(0,a.getByteLength)(e);return t.slice(0,c)}}},27827:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.fn=a.getFunction=void 0;const c=t(35620),f=t(52367),d=t(5961),r=t(83415),n=(0,c.coerce)((0,c.object)({address:f.StrictHexStruct,selector:f.StrictHexStruct}),(0,c.union)([f.StrictHexStruct,(0,c.instance)(Uint8Array)]),(e=>{const a=(0,f.createBytes)(e);return(0,f.assert)(24===a.length,new d.ParserError(`Invalid Solidity function. Expected function to be 24 bytes long, but received ${a.length} bytes.`)),{address:(0,f.bytesToHex)(a.subarray(0,20)),selector:(0,f.bytesToHex)(a.subarray(20,24))}}));a.getFunction=e=>{const a=(0,c.create)(e,n);return(0,f.concatBytes)([(0,f.hexToBytes)(a.address),(0,f.hexToBytes)(a.selector)])},a.fn={isDynamic:!1,isType:e=>"function"===e,getByteLength:()=>32,encode({buffer:e,value:t,packed:c,tight:f}){const d=(0,a.getFunction)(t);return r.fixedBytes.encode({type:"bytes24",buffer:e,value:d,packed:c,tight:f})},decode:({value:e})=>({address:(0,f.bytesToHex)(e.slice(0,20)),selector:(0,f.bytesToHex)(e.slice(20,24))})}},46207:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),f(t(91563),a),f(t(186),a),f(t(47435),a),f(t(99356),a),f(t(83415),a),f(t(27827),a),f(t(6150),a),f(t(28160),a),f(t(8446),a),f(t(30717),a)},6150:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.number=a.getBigInt=a.assertNumberLength=a.getLength=a.isSigned=void 0;const c=t(52367),f=t(5961),d=t(26365),r=/^u?int(?[0-9]*)?$/u;a.isSigned=e=>!e.startsWith("u"),a.getLength=e=>{if("int"===e||"uint"===e)return 256;const a=e.match(r);(0,c.assert)(a?.groups?.length,new f.ParserError(`Invalid number type. Expected a number type, but received "${e}".`));const t=parseInt(a.groups.length,10);return(0,c.assert)(t>=8&&t<=256,new f.ParserError(`Invalid number length. Expected a number between 8 and 256, but received "${e}".`)),(0,c.assert)(t%8==0,new f.ParserError(`Invalid number length. Expected a multiple of 8, but received "${e}".`)),t},a.assertNumberLength=(e,t)=>{const d=(0,a.getLength)(t),r=BigInt(2)**BigInt(d-((0,a.isSigned)(t)?1:0))-BigInt(1);(0,a.isSigned)(t)?(0,c.assert)(e>=-(r+BigInt(1))&&e<=r,new f.ParserError(`Number "${e}" is out of range for type "${t}".`)):(0,c.assert)(e<=r,new f.ParserError(`Number "${e}" is out of range for type "${t}".`))},a.getBigInt=e=>{try{return(0,c.createBigInt)(e)}catch{throw new f.ParserError(`Invalid number. Expected a valid number value, but received "${e}".`)}},a.number={isDynamic:!1,isType:e=>r.test(e),getByteLength:()=>32,encode({type:e,buffer:t,value:f,packed:r}){const n=(0,a.getBigInt)(f);if((0,a.assertNumberLength)(n,e),(0,a.isSigned)(e)){if(r){const f=(0,a.getLength)(e)/8;return(0,c.concatBytes)([t,(0,c.signedBigIntToBytes)(n,f)])}return(0,c.concatBytes)([t,(0,d.padStart)((0,c.signedBigIntToBytes)(n,32))])}if(r){const f=(0,a.getLength)(e)/8;return(0,c.concatBytes)([t,(0,d.padStart)((0,c.bigIntToBytes)(n),f)])}return(0,c.concatBytes)([t,(0,d.padStart)((0,c.bigIntToBytes)(n))])},decode({type:e,value:t}){const f=t.subarray(0,32);if((0,a.isSigned)(e)){const t=(0,c.bytesToSignedBigInt)(f);return(0,a.assertNumberLength)(t,e),t}const d=(0,c.bytesToBigInt)(f);return(0,a.assertNumberLength)(d,e),d}}},28160:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0})},8446:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.string=void 0;const c=t(52367),f=t(99356);a.string={isDynamic:!0,isType:e=>"string"===e,getByteLength:()=>32,encode:({buffer:e,value:a,packed:t,tight:d})=>f.bytes.encode({type:"bytes",buffer:e,value:(0,c.stringToBytes)(a),packed:t,tight:d}),decode:e=>(0,c.bytesToString)(f.bytes.decode(e))}},30717:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.tuple=a.getTupleElements=void 0;const c=t(52367),f=t(5961),d=t(37700),r=/^\((.+)\)$/u;a.getTupleElements=e=>{(0,c.assert)(e.startsWith("(")&&e.endsWith(")"),new f.ParserError(`Invalid tuple type. Expected tuple type, but received "${e}".`));const a=[];let t="",d=0;for(let c=1;c(0,a.getTupleElements)(e).some((e=>{const a=(0,d.getParser)(e);return(0,d.isDynamicParser)(a,e)})),isType:e=>(e=>r.test(e))(e),getByteLength(e){return(0,d.isDynamicParser)(this,e)?32:(0,a.getTupleElements)(e).reduce(((e,a)=>e+(0,d.getParser)(a).getByteLength(a)),0)},encode({type:e,buffer:t,value:c,packed:f,tight:r}){const n=(0,a.getTupleElements)(e);return(0,d.pack)({types:n,values:c,byteArray:t,packed:f,tight:r})},decode({type:e,value:t,skip:c}){const f=(0,a.getTupleElements)(e);return c(this.getByteLength(e)-32),(0,d.unpack)(f,t)}}},15744:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0})},11126:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),f(t(15744),a)},59194:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.padEnd=a.padStart=a.set=void 0;const c=t(52367);a.set=(e,a,t)=>(0,c.concatBytes)([e.subarray(0,t),a,e.subarray(t+a.length)]),a.padStart=(e,a=32)=>{const t=new Uint8Array(Math.max(a-e.length,0)).fill(0);return(0,c.concatBytes)([t,e])},a.padEnd=(e,a=32)=>{const t=new Uint8Array(Math.max(a-e.length,0)).fill(0);return(0,c.concatBytes)([e,t])}},26365:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),f(t(59194),a)},98537:function(e,a,t){"use strict";var c=t(62045).hp,f=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),d=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:!0,value:a})}:function(e,a){e.default=a}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(null!=e)for(var t in e)"default"!==t&&Object.prototype.hasOwnProperty.call(e,t)&&f(a,e,t);return d(a,e),a};Object.defineProperty(a,"__esModule",{value:!0}),a.getEncryptionPublicKey=a.decryptSafely=a.decrypt=a.encryptSafely=a.encrypt=void 0;const n=t(63203),i=r(t(88947)),b=t(54907);function o({publicKey:e,data:a,version:t}){if((0,b.isNullish)(e))throw new Error("Missing publicKey parameter");if((0,b.isNullish)(a))throw new Error("Missing data parameter");if((0,b.isNullish)(t))throw new Error("Missing version parameter");if("x25519-xsalsa20-poly1305"===t){if("string"!=typeof a)throw new Error("Message data must be given as a string");const t=i.box.keyPair();let c;try{c=n.base64.decode(e)}catch(e){throw new Error("Bad public key")}const f=n.utf8.decode(a),d=i.randomBytes(i.box.nonceLength),r=i.box(f,d,c,t.secretKey);return{version:"x25519-xsalsa20-poly1305",nonce:n.base64.encode(d),ephemPublicKey:n.base64.encode(t.publicKey),ciphertext:n.base64.encode(r)}}throw new Error("Encryption type/version not supported")}function s({encryptedData:e,privateKey:a}){if((0,b.isNullish)(e))throw new Error("Missing encryptedData parameter");if((0,b.isNullish)(a))throw new Error("Missing privateKey parameter");if("x25519-xsalsa20-poly1305"===e.version){const t=c.from(a,"hex"),f=i.box.keyPair.fromSecretKey(t).secretKey,d=n.base64.decode(e.nonce),r=n.base64.decode(e.ciphertext),b=n.base64.decode(e.ephemPublicKey),o=i.box.open(r,d,b,f);try{if(!o)throw new Error;const e=n.utf8.encode(o);if(!e)throw new Error;return e}catch(e){if(e&&"string"==typeof e.message&&e.message.length)throw new Error(`Decryption failed: ${e.message}`);throw new Error("Decryption failed.")}}throw new Error("Encryption type/version not supported.")}a.encrypt=o,a.encryptSafely=function({publicKey:e,data:a,version:t}){if((0,b.isNullish)(e))throw new Error("Missing publicKey parameter");if((0,b.isNullish)(a))throw new Error("Missing data parameter");if((0,b.isNullish)(t))throw new Error("Missing version parameter");if("object"==typeof a&&a&&"toJSON"in a)throw new Error("Cannot encrypt with toJSON property. Please remove toJSON property");const f={data:a,padding:""},d=c.byteLength(JSON.stringify(f),"utf-8")%2048;let r=0;return d>0&&(r=2048-d-16),f.padding="0".repeat(r),o({publicKey:e,data:JSON.stringify(f),version:t})},a.decrypt=s,a.decryptSafely=function({encryptedData:e,privateKey:a}){if((0,b.isNullish)(e))throw new Error("Missing encryptedData parameter");if((0,b.isNullish)(a))throw new Error("Missing privateKey parameter");return JSON.parse(s({encryptedData:e,privateKey:a})).data},a.getEncryptionPublicKey=function(e){const a=c.from(e,"hex"),t=i.box.keyPair.fromSecretKey(a).publicKey;return n.base64.encode(t)}},51594:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),a.normalize=a.concatSig=void 0,f(t(20252),a),f(t(10169),a),f(t(98537),a);var d=t(54907);Object.defineProperty(a,"concatSig",{enumerable:!0,get:function(){return d.concatSig}}),Object.defineProperty(a,"normalize",{enumerable:!0,get:function(){return d.normalize}})},20252:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.extractPublicKey=a.recoverPersonalSignature=a.personalSign=void 0;const c=t(68683),f=t(54907);function d(e,a){const t=(0,c.hashPersonalMessage)((0,f.legacyToBuffer)(e));return(0,f.recoverPublicKey)(t,a)}a.personalSign=function({privateKey:e,data:a}){if((0,f.isNullish)(a))throw new Error("Missing data parameter");if((0,f.isNullish)(e))throw new Error("Missing privateKey parameter");const t=(0,f.legacyToBuffer)(a),d=(0,c.hashPersonalMessage)(t),r=(0,c.ecsign)(d,e);return(0,f.concatSig)((0,c.toBuffer)(r.v),r.r,r.s)},a.recoverPersonalSignature=function({data:e,signature:a}){if((0,f.isNullish)(e))throw new Error("Missing data parameter");if((0,f.isNullish)(a))throw new Error("Missing signature parameter");const t=d(e,a),r=(0,c.publicToAddress)(t);return(0,c.bufferToHex)(r)},a.extractPublicKey=function({data:e,signature:a}){if((0,f.isNullish)(e))throw new Error("Missing data parameter");if((0,f.isNullish)(a))throw new Error("Missing signature parameter");return`0x${d(e,a).toString("hex")}`}},10169:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.recoverTypedSignature=a.signTypedData=a.typedSignatureHash=a.TypedDataUtils=a.TYPED_MESSAGE_SCHEMA=a.SignTypedDataVersion=void 0;const c=t(68683),f=t(93256),d=t(46207),r=t(26365),n=t(52367),i=t(32019),b=t(54907);var o;function s(e,a){if(!Object.keys(o).includes(e))throw new Error(`Invalid version: '${e}'`);if(a&&!a.includes(e))throw new Error(`SignTypedDataVersion not allowed: '${e}'. Allowed versions are: ${a.join(", ")}`)}function l(e,a){(0,n.assert)(null!==a,`Unable to encode value: Invalid number. Expected a valid number value, but received "${a}".`);const t=BigInt(a),c=(0,d.getLength)(e),f=BigInt(2)**BigInt(c)-BigInt(1);return(0,n.assert)(t>=-f&&t<=f,`Unable to encode value: Number "${a}" is out of range for type "${e}".`),t}function u(e){let a=BigInt(0);for(let t=0;t=49?c-BigInt(49)+BigInt(10):c>=17?c-BigInt(17)+BigInt(10):c}return(0,r.padStart)((0,n.bigIntToBytes)(a),20)}function h(e,a,t,d,b){if(s(b,[o.V3,o.V4]),void 0!==e[t])return["bytes32",b===o.V4&&null==d?"0x0000000000000000000000000000000000000000000000000000000000000000":(0,c.arrToBufArr)((0,i.keccak256)(p(t,d,e,b)))];if("function"===t)throw new Error('Unsupported or invalid type: "function"');if(void 0===d)throw new Error(`missing value for field ${a} of type ${t}`);if("address"===t){if("number"==typeof d)return["address",(0,r.padStart)((0,n.numberToBytes)(d),20)];if((0,n.isStrictHexString)(d))return["address",(0,n.add0x)(d)];if("string"==typeof d)return["address",u(d).subarray(0,20)]}if("bool"===t)return["bool",Boolean(d)];if("bytes"===t)return"number"==typeof d?d=(0,n.numberToBytes)(d):(0,n.isStrictHexString)(d)||"0x"===d?d=(0,n.hexToBytes)(d):"string"==typeof d&&(d=(0,n.stringToBytes)(d)),["bytes32",(0,c.arrToBufArr)((0,i.keccak256)(d))];if(t.startsWith("bytes")&&"bytes"!==t&&!t.includes("["))return"number"==typeof d?d<0?["bytes32",new Uint8Array(32)]:["bytes32",(0,n.bigIntToBytes)(BigInt(d))]:(0,n.isStrictHexString)(d)?["bytes32",(0,n.hexToBytes)(d)]:["bytes32",d];if(t.startsWith("int")&&!t.includes("[")){const e=l(t,d);return e>=BigInt(0)?["uint256",e]:["int256",e]}if("string"===t)return d="number"==typeof d?(0,n.numberToBytes)(d):(0,n.stringToBytes)(null!=d?d:""),["bytes32",(0,c.arrToBufArr)((0,i.keccak256)(d))];if(t.endsWith("]")){if(b===o.V3)throw new Error("Arrays are unimplemented in encodeData; use V4 extension");const r=t.slice(0,t.lastIndexOf("[")),n=d.map((t=>h(e,a,r,t,b)));return["bytes32",(0,c.arrToBufArr)((0,i.keccak256)((0,f.encode)(n.map((([e])=>e)),n.map((([,e])=>e)))))]}return[t,d]}function p(e,a,t,d){s(d,[o.V3,o.V4]);const r=["bytes32"],n=[x(e,t)];for(const c of t[e]){if(d===o.V3&&void 0===a[c.name])continue;const[e,f]=h(t,c.name,c.type,a[c.name],d);r.push(e),n.push(f)}return(0,c.arrToBufArr)((0,f.encode)(r,n))}function g(e,a){let t="";const c=m(e,a);c.delete(e);const f=[e,...Array.from(c).sort()];for(const e of f){if(!a[e])throw new Error(`No type definition specified: ${e}`);t+=`${e}(${a[e].map((({name:e,type:a})=>`${a} ${e}`)).join(",")})`}return t}function m(e,a,t=new Set){if("string"!=typeof e)throw new Error(`Invalid findTypeDependencies input ${JSON.stringify(e)}`);const c=e.match(/^\w*/u);if([e]=c,t.has(e)||void 0===a[e])return t;t.add(e);for(const c of a[e])m(c.type,a,t);return t}function y(e,a,t,f){s(f,[o.V3,o.V4]);const d=p(e,a,t,f),r=(0,i.keccak256)(d);return(0,c.arrToBufArr)(r)}function x(e,a){const t=(0,n.stringToBytes)(g(e,a));return(0,c.arrToBufArr)((0,i.keccak256)(t))}function A(e){const t={};for(const c in a.TYPED_MESSAGE_SCHEMA.properties)e[c]&&(t[c]=e[c]);return"types"in t&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t}function v(e,a){s(a,[o.V3,o.V4]);const t=A(e),{domain:c}=t;return y("EIP712Domain",c,{EIP712Domain:t.types.EIP712Domain},a)}function w(e,a){if((0,d.isArrayType)(e)&&Array.isArray(a)){const[t]=(0,d.getArrayType)(e);return a.map((e=>w(t,e)))}if("address"===e){if((0,n.isStrictHexString)(a))return(0,r.padStart)((0,n.hexToBytes)(a).subarray(0,20),20);if(a instanceof Uint8Array)return(0,r.padStart)(a.subarray(0,20),20)}if("bool"===e)return Boolean(a);if(e.startsWith("bytes")&&"bytes"!==e){const t=(0,d.getByteLength)(e);if("number"==typeof a)return a<0?new Uint8Array:(0,n.numberToBytes)(a).subarray(0,t);if((0,n.isStrictHexString)(a))return(0,n.hexToBytes)(a).subarray(0,t);if(a instanceof Uint8Array)return a.subarray(0,t)}if(e.startsWith("uint")&&"number"==typeof a)return Math.abs(a);if(e.startsWith("int")&&"number"==typeof a){const t=(0,d.getLength)(e);return BigInt.asIntN(t,BigInt(a))}return a}function _(e,a){return a.map((a=>{if("string"==typeof a||"number"==typeof a||"bigint"==typeof a){const t=l(e,a);if(t>=BigInt(0))return(0,r.padStart)((0,n.bigIntToBytes)(t),32);const c=(0,d.getLength)(e),f=BigInt.asIntN(c,t);return(0,n.signedBigIntToBytes)(f,32)}return a}))}function I(e){const a=new Error("Expect argument to be non-empty array");if("object"!=typeof e||!("length"in e)||!e.length)throw a;const t=e.map((({name:e,type:a,value:t})=>{if("address[]"===a)return{name:e,type:"bytes32[]",value:(c=t,c.map((e=>"number"==typeof e?(0,r.padStart)((0,n.numberToBytes)(e),32):(0,n.isStrictHexString)(e)?(0,r.padStart)((0,n.hexToBytes)(e).subarray(0,32),32):e instanceof Uint8Array?(0,r.padStart)(e.subarray(0,32),32):e)))};var c;if(a.startsWith("int")&&(0,d.isArrayType)(a)){const[c,f]=(0,d.getArrayType)(a);return{name:e,type:`bytes32[${null!=f?f:""}]`,value:_(c,t)}}return{name:e,type:a,value:w(a,t)}})),o=t.map((e=>"bytes"!==e.type?e.value:(0,b.legacyToBuffer)(e.value))),s=t.map((e=>{if("function"===e.type)throw new Error('Unsupported or invalid type: "function"');return e.type})),l=e.map((e=>{if(!e.name)throw a;return`${e.type} ${e.name}`}));return(0,c.arrToBufArr)((0,i.keccak256)((0,f.encodePacked)(["bytes32","bytes32"],[(0,i.keccak256)((0,f.encodePacked)(["string[]"],[l],!0)),(0,i.keccak256)((0,f.encodePacked)(s,o,!0))])))}!function(e){e.V1="V1",e.V3="V3",e.V4="V4"}(o=a.SignTypedDataVersion||(a.SignTypedDataVersion={})),a.TYPED_MESSAGE_SCHEMA={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},a.TypedDataUtils={encodeData:p,encodeType:g,findTypeDependencies:m,hashStruct:y,hashType:x,sanitizeData:A,eip712Hash:function(e,a){s(a,[o.V3,o.V4]);const t=A(e),f=[(0,n.hexToBytes)("1901")];return f.push(v(e,a)),"EIP712Domain"!==t.primaryType&&f.push(y(t.primaryType,t.message,t.types,a)),(0,c.arrToBufArr)((0,i.keccak256)((0,n.concatBytes)(f)))},eip712DomainHash:v},a.typedSignatureHash=function(e){const a=I(e);return(0,n.bytesToHex)(a)},a.signTypedData=function({privateKey:e,data:t,version:f}){if(s(f),(0,b.isNullish)(t))throw new Error("Missing data parameter");if((0,b.isNullish)(e))throw new Error("Missing private key parameter");const d=f===o.V1?I(t):a.TypedDataUtils.eip712Hash(t,f),r=(0,c.ecsign)(d,e);return(0,b.concatSig)((0,c.arrToBufArr)((0,n.bigIntToBytes)(r.v)),r.r,r.s)},a.recoverTypedSignature=function({data:e,signature:t,version:f}){if(s(f),(0,b.isNullish)(e))throw new Error("Missing data parameter");if((0,b.isNullish)(t))throw new Error("Missing signature parameter");const d=f===o.V1?I(e):a.TypedDataUtils.eip712Hash(e,f),r=(0,b.recoverPublicKey)(d,t),i=(0,c.publicToAddress)(r);return(0,n.bytesToHex)(i)}},54907:(e,a,t)=>{"use strict";var c=t(62045).hp;Object.defineProperty(a,"__esModule",{value:!0}),a.normalize=a.recoverPublicKey=a.concatSig=a.legacyToBuffer=a.isNullish=a.padWithZeroes=void 0;const f=t(68683),d=t(52367);function r(e,a){if(""!==e&&!/^[a-f0-9]+$/iu.test(e))throw new Error(`Expected an unprefixed hex string. Received: ${e}`);if(a<0)throw new Error(`Expected a non-negative integer target length. Received: ${a}`);return String.prototype.padStart.call(e,a,"0")}function n(e){return null==e}a.padWithZeroes=r,a.isNullish=n,a.legacyToBuffer=function(e){return"string"!=typeof e||(0,f.isHexString)(e)?(0,f.toBuffer)(e):c.from(e)},a.concatSig=function(e,a,t){const c=(0,f.fromSigned)(a),n=(0,f.fromSigned)(t),i=(0,f.bufferToInt)(e),b=r((0,f.toUnsigned)(c).toString("hex"),64),o=r((0,f.toUnsigned)(n).toString("hex"),64),s=(0,d.remove0x)((0,d.numberToHex)(i));return(0,d.add0x)(b.concat(o,s))},a.recoverPublicKey=function(e,a){const t=(0,f.fromRpcSig)(a);return(0,f.ecrecover)(e,t.v,t.r,t.s)},a.normalize=function(e){if(!n(e)){if("number"==typeof e){if(e<0)return"0x";const a=(0,d.numberToBytes)(e);e=(0,d.bytesToHex)(a)}if("string"!=typeof e){let a="eth-sig-util.normalize() requires hex string or integer input.";throw a+=` received ${typeof e}: ${e}`,new Error(a)}return(0,d.add0x)(e.toLowerCase())}}},82102:(e,a)=>{"use strict";function t(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function c(e){if("boolean"!=typeof e)throw new Error(`boolean expected, not ${e}`)}function f(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function d(e,...a){if(!f(e))throw new Error("Uint8Array expected");if(a.length>0&&!a.includes(e.length))throw new Error(`Uint8Array expected of length ${a}, not of length=${e.length}`)}function r(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");t(e.outputLen),t(e.blockLen)}function n(e,a=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(a&&e.finished)throw new Error("Hash#digest() has already been called")}function i(e,a){d(e);const t=a.outputLen;if(e.length{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.add5L=a.add5H=a.add4H=a.add4L=a.add3H=a.add3L=a.rotlBL=a.rotlBH=a.rotlSL=a.rotlSH=a.rotr32L=a.rotr32H=a.rotrBL=a.rotrBH=a.rotrSL=a.rotrSH=a.shrSL=a.shrSH=a.toBig=void 0,a.fromBig=f,a.split=d,a.add=x;const t=BigInt(2**32-1),c=BigInt(32);function f(e,a=!1){return a?{h:Number(e&t),l:Number(e>>c&t)}:{h:0|Number(e>>c&t),l:0|Number(e&t)}}function d(e,a=!1){let t=new Uint32Array(e.length),c=new Uint32Array(e.length);for(let d=0;dBigInt(e>>>0)<>>0);a.toBig=r;const n=(e,a,t)=>e>>>t;a.shrSH=n;const i=(e,a,t)=>e<<32-t|a>>>t;a.shrSL=i;const b=(e,a,t)=>e>>>t|a<<32-t;a.rotrSH=b;const o=(e,a,t)=>e<<32-t|a>>>t;a.rotrSL=o;const s=(e,a,t)=>e<<64-t|a>>>t-32;a.rotrBH=s;const l=(e,a,t)=>e>>>t-32|a<<64-t;a.rotrBL=l;const u=(e,a)=>a;a.rotr32H=u;const h=(e,a)=>e;a.rotr32L=h;const p=(e,a,t)=>e<>>32-t;a.rotlSH=p;const g=(e,a,t)=>a<>>32-t;a.rotlSL=g;const m=(e,a,t)=>a<>>64-t;a.rotlBH=m;const y=(e,a,t)=>e<>>64-t;function x(e,a,t,c){const f=(a>>>0)+(c>>>0);return{h:e+t+(f/2**32|0)|0,l:0|f}}a.rotlBL=y;const A=(e,a,t)=>(e>>>0)+(a>>>0)+(t>>>0);a.add3L=A;const v=(e,a,t,c)=>a+t+c+(e/2**32|0)|0;a.add3H=v;const w=(e,a,t,c)=>(e>>>0)+(a>>>0)+(t>>>0)+(c>>>0);a.add4L=w;const _=(e,a,t,c,f)=>a+t+c+f+(e/2**32|0)|0;a.add4H=_;const I=(e,a,t,c,f)=>(e>>>0)+(a>>>0)+(t>>>0)+(c>>>0)+(f>>>0);a.add5L=I;const E=(e,a,t,c,f,d)=>a+t+c+f+d+(e/2**32|0)|0;a.add5H=E;const C={fromBig:f,split:d,toBig:r,shrSH:n,shrSL:i,rotrSH:b,rotrSL:o,rotrBH:s,rotrBL:l,rotr32H:u,rotr32L:h,rotlSH:p,rotlSL:g,rotlBH:m,rotlBL:y,add:x,add3L:A,add3H:v,add4L:w,add4H:_,add5H:E,add5L:I};a.default=C},6256:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.crypto=void 0,a.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},2214:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.shake256=a.shake128=a.keccak_512=a.keccak_384=a.keccak_256=a.keccak_224=a.sha3_512=a.sha3_384=a.sha3_256=a.sha3_224=a.Keccak=void 0,a.keccakP=x;const c=t(82102),f=t(17335),d=t(79520),r=[],n=[],i=[],b=BigInt(0),o=BigInt(1),s=BigInt(2),l=BigInt(7),u=BigInt(256),h=BigInt(113);for(let e=0,a=o,t=1,c=0;e<24;e++){[t,c]=[c,(2*t+3*c)%5],r.push(2*(5*c+t)),n.push((e+1)*(e+2)/2%64);let f=b;for(let e=0;e<7;e++)a=(a<>l)*h)%u,a&s&&(f^=o<<(o<t>32?(0,f.rotlBH)(e,a,t):(0,f.rotlSH)(e,a,t),y=(e,a,t)=>t>32?(0,f.rotlBL)(e,a,t):(0,f.rotlSL)(e,a,t);function x(e,a=24){const t=new Uint32Array(10);for(let c=24-a;c<24;c++){for(let a=0;a<10;a++)t[a]=e[a]^e[a+10]^e[a+20]^e[a+30]^e[a+40];for(let a=0;a<10;a+=2){const c=(a+8)%10,f=(a+2)%10,d=t[f],r=t[f+1],n=m(d,r,1)^t[c],i=y(d,r,1)^t[c+1];for(let t=0;t<50;t+=10)e[a+t]^=n,e[a+t+1]^=i}let a=e[2],f=e[3];for(let t=0;t<24;t++){const c=n[t],d=m(a,f,c),i=y(a,f,c),b=r[t];a=e[b],f=e[b+1],e[b]=d,e[b+1]=i}for(let a=0;a<50;a+=10){for(let c=0;c<10;c++)t[c]=e[a+c];for(let c=0;c<10;c++)e[a+c]^=~t[(c+2)%10]&t[(c+4)%10]}e[0]^=p[c],e[1]^=g[c]}t.fill(0)}class A extends d.Hash{constructor(e,a,t,f=!1,r=24){if(super(),this.blockLen=e,this.suffix=a,this.outputLen=t,this.enableXOF=f,this.rounds=r,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,c.number)(t),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,d.u32)(this.state)}keccak(){d.isLE||(0,d.byteSwap32)(this.state32),x(this.state32,this.rounds),d.isLE||(0,d.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(e){(0,c.exists)(this);const{blockLen:a,state:t}=this,f=(e=(0,d.toBytes)(e)).length;for(let c=0;c=t&&this.keccak();const d=Math.min(t-this.posOut,f-c);e.set(a.subarray(this.posOut,this.posOut+d),c),this.posOut+=d,c+=d}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,c.number)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,c.output)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:a,suffix:t,outputLen:c,rounds:f,enableXOF:d}=this;return e||(e=new A(a,t,c,d,f)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=f,e.suffix=t,e.outputLen=c,e.enableXOF=d,e.destroyed=this.destroyed,e}}a.Keccak=A;const v=(e,a,t)=>(0,d.wrapConstructor)((()=>new A(a,e,t)));a.sha3_224=v(6,144,28),a.sha3_256=v(6,136,32),a.sha3_384=v(6,104,48),a.sha3_512=v(6,72,64),a.keccak_224=v(1,144,28),a.keccak_256=v(1,136,32),a.keccak_384=v(1,104,48),a.keccak_512=v(1,72,64);const w=(e,a,t)=>(0,d.wrapXOFConstructorWithOpts)(((c={})=>new A(a,e,void 0===c.dkLen?t:c.dkLen,!0)));a.shake128=w(31,168,16),a.shake256=w(31,136,32)},79520:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.Hash=a.nextTick=a.byteSwapIfBE=a.byteSwap=a.isLE=a.rotl=a.rotr=a.createView=a.u32=a.u8=void 0,a.isBytes=function(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name},a.byteSwap32=function(e){for(let t=0;t=0&&ee().update(b(a)).digest(),t=e();return a.outputLen=t.outputLen,a.blockLen=t.blockLen,a.create=()=>e(),a},a.wrapConstructorWithOpts=function(e){const a=(a,t)=>e(t).update(b(a)).digest(),t=e({});return a.outputLen=t.outputLen,a.blockLen=t.blockLen,a.create=a=>e(a),a},a.wrapXOFConstructorWithOpts=function(e){const a=(a,t)=>e(t).update(b(a)).digest(),t=e({});return a.outputLen=t.outputLen,a.blockLen=t.blockLen,a.create=a=>e(a),a},a.randomBytes=function(e=32){if(c.crypto&&"function"==typeof c.crypto.getRandomValues)return c.crypto.getRandomValues(new Uint8Array(e));if(c.crypto&&"function"==typeof c.crypto.randomBytes)return c.crypto.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")};const c=t(6256),f=t(82102);a.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),a.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),a.rotr=(e,a)=>e<<32-a|e>>>a,a.rotl=(e,a)=>e<>>32-a>>>0,a.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],a.byteSwap=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,a.byteSwapIfBE=a.isLE?e=>e:e=>(0,a.byteSwap)(e);const d=Array.from({length:256},((e,a)=>a.toString(16).padStart(2,"0"))),r={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function n(e){return e>=r._0&&e<=r._9?e-r._0:e>=r._A&&e<=r._F?e-(r._A-10):e>=r._a&&e<=r._f?e-(r._a-10):void 0}function i(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function b(e){return"string"==typeof e&&(e=i(e)),(0,f.bytes)(e),e}a.nextTick=async()=>{},a.Hash=class{clone(){return this._cloneInto()}};const o={}.toString},52139:(e,a,t)=>{const c=Symbol("SemVer ANY");class f{static get ANY(){return c}constructor(e,a){if(a=d(a),e instanceof f){if(e.loose===!!a.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),b("comparator",e,a),this.options=a,this.loose=!!a.loose,this.parse(e),this.semver===c?this.value="":this.value=this.operator+this.semver.version,b("comp",this)}parse(e){const a=this.options.loose?r[n.COMPARATORLOOSE]:r[n.COMPARATOR],t=e.match(a);if(!t)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==t[1]?t[1]:"","="===this.operator&&(this.operator=""),t[2]?this.semver=new o(t[2],this.options.loose):this.semver=c}toString(){return this.value}test(e){if(b("Comparator.test",e,this.options.loose),this.semver===c||e===c)return!0;if("string"==typeof e)try{e=new o(e,this.options)}catch(e){return!1}return i(e,this.operator,this.semver,this.options)}intersects(e,a){if(!(e instanceof f))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new s(e.value,a).test(this.value):""===e.operator?""===e.value||new s(this.value,a).test(e.semver):!((a=d(a)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!a.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(i(this.semver,"<",e.semver,a)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(i(this.semver,">",e.semver,a)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=f;const d=t(69932),{safeRe:r,t:n}=t(34567),i=t(73646),b=t(52207),o=t(64739),s=t(25926)},25926:(e,a,t)=>{const c=/\s+/g;class f{constructor(e,a){if(a=r(a),e instanceof f)return e.loose===!!a.loose&&e.includePrerelease===!!a.includePrerelease?e:new f(e.raw,a);if(e instanceof n)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=a,this.loose=!!a.loose,this.includePrerelease=!!a.includePrerelease,this.raw=e.trim().replace(c," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!m(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&y(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e0&&(this.formatted+="||");const a=this.set[e];for(let e=0;e0&&(this.formatted+=" "),this.formatted+=a[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const a=((this.options.includePrerelease&&p)|(this.options.loose&&g))+":"+e,t=d.get(a);if(t)return t;const c=this.options.loose,f=c?o[s.HYPHENRANGELOOSE]:o[s.HYPHENRANGE];e=e.replace(f,L(this.options.includePrerelease)),i("hyphen replace",e),e=e.replace(o[s.COMPARATORTRIM],l),i("comparator trim",e),e=e.replace(o[s.TILDETRIM],u),i("tilde trim",e),e=e.replace(o[s.CARETTRIM],h),i("caret trim",e);let r=e.split(" ").map((e=>A(e,this.options))).join(" ").split(/\s+/).map((e=>k(e,this.options)));c&&(r=r.filter((e=>(i("loose invalid filter",e,this.options),!!e.match(o[s.COMPARATORLOOSE]))))),i("range list",r);const b=new Map,y=r.map((e=>new n(e,this.options)));for(const e of y){if(m(e))return[e];b.set(e.value,e)}b.size>1&&b.has("")&&b.delete("");const x=[...b.values()];return d.set(a,x),x}intersects(e,a){if(!(e instanceof f))throw new TypeError("a Range is required");return this.set.some((t=>x(t,a)&&e.set.some((e=>x(e,a)&&t.every((t=>e.every((e=>t.intersects(e,a)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new b(e,this.options)}catch(e){return!1}for(let a=0;a"<0.0.0-0"===e.value,y=e=>""===e.value,x=(e,a)=>{let t=!0;const c=e.slice();let f=c.pop();for(;t&&c.length;)t=c.every((e=>f.intersects(e,a))),f=c.pop();return t},A=(e,a)=>(i("comp",e,a),e=I(e,a),i("caret",e),e=w(e,a),i("tildes",e),e=C(e,a),i("xrange",e),e=B(e,a),i("stars",e),e),v=e=>!e||"x"===e.toLowerCase()||"*"===e,w=(e,a)=>e.trim().split(/\s+/).map((e=>_(e,a))).join(" "),_=(e,a)=>{const t=a.loose?o[s.TILDELOOSE]:o[s.TILDE];return e.replace(t,((a,t,c,f,d)=>{let r;return i("tilde",e,a,t,c,f,d),v(t)?r="":v(c)?r=`>=${t}.0.0 <${+t+1}.0.0-0`:v(f)?r=`>=${t}.${c}.0 <${t}.${+c+1}.0-0`:d?(i("replaceTilde pr",d),r=`>=${t}.${c}.${f}-${d} <${t}.${+c+1}.0-0`):r=`>=${t}.${c}.${f} <${t}.${+c+1}.0-0`,i("tilde return",r),r}))},I=(e,a)=>e.trim().split(/\s+/).map((e=>E(e,a))).join(" "),E=(e,a)=>{i("caret",e,a);const t=a.loose?o[s.CARETLOOSE]:o[s.CARET],c=a.includePrerelease?"-0":"";return e.replace(t,((a,t,f,d,r)=>{let n;return i("caret",e,a,t,f,d,r),v(t)?n="":v(f)?n=`>=${t}.0.0${c} <${+t+1}.0.0-0`:v(d)?n="0"===t?`>=${t}.${f}.0${c} <${t}.${+f+1}.0-0`:`>=${t}.${f}.0${c} <${+t+1}.0.0-0`:r?(i("replaceCaret pr",r),n="0"===t?"0"===f?`>=${t}.${f}.${d}-${r} <${t}.${f}.${+d+1}-0`:`>=${t}.${f}.${d}-${r} <${t}.${+f+1}.0-0`:`>=${t}.${f}.${d}-${r} <${+t+1}.0.0-0`):(i("no pr"),n="0"===t?"0"===f?`>=${t}.${f}.${d}${c} <${t}.${f}.${+d+1}-0`:`>=${t}.${f}.${d}${c} <${t}.${+f+1}.0-0`:`>=${t}.${f}.${d} <${+t+1}.0.0-0`),i("caret return",n),n}))},C=(e,a)=>(i("replaceXRanges",e,a),e.split(/\s+/).map((e=>M(e,a))).join(" ")),M=(e,a)=>{e=e.trim();const t=a.loose?o[s.XRANGELOOSE]:o[s.XRANGE];return e.replace(t,((t,c,f,d,r,n)=>{i("xRange",e,t,c,f,d,r,n);const b=v(f),o=b||v(d),s=o||v(r),l=s;return"="===c&&l&&(c=""),n=a.includePrerelease?"-0":"",b?t=">"===c||"<"===c?"<0.0.0-0":"*":c&&l?(o&&(d=0),r=0,">"===c?(c=">=",o?(f=+f+1,d=0,r=0):(d=+d+1,r=0)):"<="===c&&(c="<",o?f=+f+1:d=+d+1),"<"===c&&(n="-0"),t=`${c+f}.${d}.${r}${n}`):o?t=`>=${f}.0.0${n} <${+f+1}.0.0-0`:s&&(t=`>=${f}.${d}.0${n} <${f}.${+d+1}.0-0`),i("xRange return",t),t}))},B=(e,a)=>(i("replaceStars",e,a),e.trim().replace(o[s.STAR],"")),k=(e,a)=>(i("replaceGTE0",e,a),e.trim().replace(o[a.includePrerelease?s.GTE0PRE:s.GTE0],"")),L=e=>(a,t,c,f,d,r,n,i,b,o,s,l)=>`${t=v(c)?"":v(f)?`>=${c}.0.0${e?"-0":""}`:v(d)?`>=${c}.${f}.0${e?"-0":""}`:r?`>=${t}`:`>=${t}${e?"-0":""}`} ${i=v(b)?"":v(o)?`<${+b+1}.0.0-0`:v(s)?`<${b}.${+o+1}.0-0`:l?`<=${b}.${o}.${s}-${l}`:e?`<${b}.${o}.${+s+1}-0`:`<=${i}`}`.trim(),S=(e,a,t)=>{for(let t=0;t0){const c=e[t].semver;if(c.major===a.major&&c.minor===a.minor&&c.patch===a.patch)return!0}return!1}return!0}},64739:(e,a,t)=>{const c=t(52207),{MAX_LENGTH:f,MAX_SAFE_INTEGER:d}=t(35237),{safeRe:r,t:n}=t(34567),i=t(69932),{compareIdentifiers:b}=t(27660);class o{constructor(e,a){if(a=i(a),e instanceof o){if(e.loose===!!a.loose&&e.includePrerelease===!!a.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>f)throw new TypeError(`version is longer than ${f} characters`);c("SemVer",e,a),this.options=a,this.loose=!!a.loose,this.includePrerelease=!!a.includePrerelease;const t=e.trim().match(a.loose?r[n.LOOSE]:r[n.FULL]);if(!t)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+t[1],this.minor=+t[2],this.patch=+t[3],this.major>d||this.major<0)throw new TypeError("Invalid major version");if(this.minor>d||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>d||this.patch<0)throw new TypeError("Invalid patch version");t[4]?this.prerelease=t[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const a=+e;if(a>=0&&a=0;)"number"==typeof this.prerelease[c]&&(this.prerelease[c]++,c=-2);if(-1===c){if(a===this.prerelease.join(".")&&!1===t)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(a){let c=[a,e];!1===t&&(c=[a]),0===b(this.prerelease[0],a)?isNaN(this.prerelease[1])&&(this.prerelease=c):this.prerelease=c}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=o},30911:(e,a,t)=>{const c=t(83321);e.exports=(e,a)=>{const t=c(e.trim().replace(/^[=v]+/,""),a);return t?t.version:null}},73646:(e,a,t)=>{const c=t(5778),f=t(10710),d=t(90047),r=t(70668),n=t(15960),i=t(99925);e.exports=(e,a,t,b)=>{switch(a){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof t&&(t=t.version),e===t;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof t&&(t=t.version),e!==t;case"":case"=":case"==":return c(e,t,b);case"!=":return f(e,t,b);case">":return d(e,t,b);case">=":return r(e,t,b);case"<":return n(e,t,b);case"<=":return i(e,t,b);default:throw new TypeError(`Invalid operator: ${a}`)}}},17425:(e,a,t)=>{const c=t(64739),f=t(83321),{safeRe:d,t:r}=t(34567);e.exports=(e,a)=>{if(e instanceof c)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let t=null;if((a=a||{}).rtl){const c=a.includePrerelease?d[r.COERCERTLFULL]:d[r.COERCERTL];let f;for(;(f=c.exec(e))&&(!t||t.index+t[0].length!==e.length);)t&&f.index+f[0].length===t.index+t[0].length||(t=f),c.lastIndex=f.index+f[1].length+f[2].length;c.lastIndex=-1}else t=e.match(a.includePrerelease?d[r.COERCEFULL]:d[r.COERCE]);if(null===t)return null;const n=t[2],i=t[3]||"0",b=t[4]||"0",o=a.includePrerelease&&t[5]?`-${t[5]}`:"",s=a.includePrerelease&&t[6]?`+${t[6]}`:"";return f(`${n}.${i}.${b}${o}${s}`,a)}},67544:(e,a,t)=>{const c=t(64739);e.exports=(e,a,t)=>{const f=new c(e,t),d=new c(a,t);return f.compare(d)||f.compareBuild(d)}},91554:(e,a,t)=>{const c=t(8317);e.exports=(e,a)=>c(e,a,!0)},8317:(e,a,t)=>{const c=t(64739);e.exports=(e,a,t)=>new c(e,t).compare(new c(a,t))},45007:(e,a,t)=>{const c=t(83321);e.exports=(e,a)=>{const t=c(e,null,!0),f=c(a,null,!0),d=t.compare(f);if(0===d)return null;const r=d>0,n=r?t:f,i=r?f:t,b=!!n.prerelease.length;if(i.prerelease.length&&!b)return i.patch||i.minor?n.patch?"patch":n.minor?"minor":"major":"major";const o=b?"pre":"";return t.major!==f.major?o+"major":t.minor!==f.minor?o+"minor":t.patch!==f.patch?o+"patch":"prerelease"}},5778:(e,a,t)=>{const c=t(8317);e.exports=(e,a,t)=>0===c(e,a,t)},90047:(e,a,t)=>{const c=t(8317);e.exports=(e,a,t)=>c(e,a,t)>0},70668:(e,a,t)=>{const c=t(8317);e.exports=(e,a,t)=>c(e,a,t)>=0},94586:(e,a,t)=>{const c=t(64739);e.exports=(e,a,t,f,d)=>{"string"==typeof t&&(d=f,f=t,t=void 0);try{return new c(e instanceof c?e.version:e,t).inc(a,f,d).version}catch(e){return null}}},15960:(e,a,t)=>{const c=t(8317);e.exports=(e,a,t)=>c(e,a,t)<0},99925:(e,a,t)=>{const c=t(8317);e.exports=(e,a,t)=>c(e,a,t)<=0},95207:(e,a,t)=>{const c=t(64739);e.exports=(e,a)=>new c(e,a).major},70547:(e,a,t)=>{const c=t(64739);e.exports=(e,a)=>new c(e,a).minor},10710:(e,a,t)=>{const c=t(8317);e.exports=(e,a,t)=>0!==c(e,a,t)},83321:(e,a,t)=>{const c=t(64739);e.exports=(e,a,t=!1)=>{if(e instanceof c)return e;try{return new c(e,a)}catch(e){if(!t)return null;throw e}}},5852:(e,a,t)=>{const c=t(64739);e.exports=(e,a)=>new c(e,a).patch},84058:(e,a,t)=>{const c=t(83321);e.exports=(e,a)=>{const t=c(e,a);return t&&t.prerelease.length?t.prerelease:null}},69173:(e,a,t)=>{const c=t(8317);e.exports=(e,a,t)=>c(a,e,t)},51200:(e,a,t)=>{const c=t(67544);e.exports=(e,a)=>e.sort(((e,t)=>c(t,e,a)))},52643:(e,a,t)=>{const c=t(25926);e.exports=(e,a,t)=>{try{a=new c(a,t)}catch(e){return!1}return a.test(e)}},63400:(e,a,t)=>{const c=t(67544);e.exports=(e,a)=>e.sort(((e,t)=>c(e,t,a)))},79572:(e,a,t)=>{const c=t(83321);e.exports=(e,a)=>{const t=c(e,a);return t?t.version:null}},56864:(e,a,t)=>{const c=t(34567),f=t(35237),d=t(64739),r=t(27660),n=t(83321),i=t(79572),b=t(30911),o=t(94586),s=t(45007),l=t(95207),u=t(70547),h=t(5852),p=t(84058),g=t(8317),m=t(69173),y=t(91554),x=t(67544),A=t(63400),v=t(51200),w=t(90047),_=t(15960),I=t(5778),E=t(10710),C=t(70668),M=t(99925),B=t(73646),k=t(17425),L=t(52139),S=t(25926),T=t(52643),N=t(24054),R=t(83777),P=t(63099),D=t(36258),O=t(77529),F=t(22944),Q=t(14316),U=t(12373),j=t(48337),H=t(72196),$=t(72505);e.exports={parse:n,valid:i,clean:b,inc:o,diff:s,major:l,minor:u,patch:h,prerelease:p,compare:g,rcompare:m,compareLoose:y,compareBuild:x,sort:A,rsort:v,gt:w,lt:_,eq:I,neq:E,gte:C,lte:M,cmp:B,coerce:k,Comparator:L,Range:S,satisfies:T,toComparators:N,maxSatisfying:R,minSatisfying:P,minVersion:D,validRange:O,outside:F,gtr:Q,ltr:U,intersects:j,simplifyRange:H,subset:$,SemVer:d,re:c.re,src:c.src,tokens:c.t,SEMVER_SPEC_VERSION:f.SEMVER_SPEC_VERSION,RELEASE_TYPES:f.RELEASE_TYPES,compareIdentifiers:r.compareIdentifiers,rcompareIdentifiers:r.rcompareIdentifiers}},35237:e=>{const a=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:a,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},52207:e=>{const a="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=a},27660:e=>{const a=/^[0-9]+$/,t=(e,t)=>{const c=a.test(e),f=a.test(t);return c&&f&&(e=+e,t=+t),e===t?0:c&&!f?-1:f&&!c?1:et(a,e)}},97228:e=>{e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const a=this.map.get(e);return void 0===a?void 0:(this.map.delete(e),this.map.set(e,a),a)}delete(e){return this.map.delete(e)}set(e,a){if(!this.delete(e)&&void 0!==a){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,a)}return this}}},69932:e=>{const a=Object.freeze({loose:!0}),t=Object.freeze({});e.exports=e=>e?"object"!=typeof e?a:e:t},34567:(e,a,t)=>{const{MAX_SAFE_COMPONENT_LENGTH:c,MAX_SAFE_BUILD_LENGTH:f,MAX_LENGTH:d}=t(35237),r=t(52207),n=(a=e.exports={}).re=[],i=a.safeRe=[],b=a.src=[],o=a.t={};let s=0;const l="[a-zA-Z0-9-]",u=[["\\s",1],["\\d",d],[l,f]],h=(e,a,t)=>{const c=(e=>{for(const[a,t]of u)e=e.split(`${a}*`).join(`${a}{0,${t}}`).split(`${a}+`).join(`${a}{1,${t}}`);return e})(a),f=s++;r(e,f,a),o[e]=f,b[f]=a,n[f]=new RegExp(a,t?"g":void 0),i[f]=new RegExp(c,t?"g":void 0)};h("NUMERICIDENTIFIER","0|[1-9]\\d*"),h("NUMERICIDENTIFIERLOOSE","\\d+"),h("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${l}*`),h("MAINVERSION",`(${b[o.NUMERICIDENTIFIER]})\\.(${b[o.NUMERICIDENTIFIER]})\\.(${b[o.NUMERICIDENTIFIER]})`),h("MAINVERSIONLOOSE",`(${b[o.NUMERICIDENTIFIERLOOSE]})\\.(${b[o.NUMERICIDENTIFIERLOOSE]})\\.(${b[o.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASEIDENTIFIER",`(?:${b[o.NUMERICIDENTIFIER]}|${b[o.NONNUMERICIDENTIFIER]})`),h("PRERELEASEIDENTIFIERLOOSE",`(?:${b[o.NUMERICIDENTIFIERLOOSE]}|${b[o.NONNUMERICIDENTIFIER]})`),h("PRERELEASE",`(?:-(${b[o.PRERELEASEIDENTIFIER]}(?:\\.${b[o.PRERELEASEIDENTIFIER]})*))`),h("PRERELEASELOOSE",`(?:-?(${b[o.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${b[o.PRERELEASEIDENTIFIERLOOSE]})*))`),h("BUILDIDENTIFIER",`${l}+`),h("BUILD",`(?:\\+(${b[o.BUILDIDENTIFIER]}(?:\\.${b[o.BUILDIDENTIFIER]})*))`),h("FULLPLAIN",`v?${b[o.MAINVERSION]}${b[o.PRERELEASE]}?${b[o.BUILD]}?`),h("FULL",`^${b[o.FULLPLAIN]}$`),h("LOOSEPLAIN",`[v=\\s]*${b[o.MAINVERSIONLOOSE]}${b[o.PRERELEASELOOSE]}?${b[o.BUILD]}?`),h("LOOSE",`^${b[o.LOOSEPLAIN]}$`),h("GTLT","((?:<|>)?=?)"),h("XRANGEIDENTIFIERLOOSE",`${b[o.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h("XRANGEIDENTIFIER",`${b[o.NUMERICIDENTIFIER]}|x|X|\\*`),h("XRANGEPLAIN",`[v=\\s]*(${b[o.XRANGEIDENTIFIER]})(?:\\.(${b[o.XRANGEIDENTIFIER]})(?:\\.(${b[o.XRANGEIDENTIFIER]})(?:${b[o.PRERELEASE]})?${b[o.BUILD]}?)?)?`),h("XRANGEPLAINLOOSE",`[v=\\s]*(${b[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${b[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${b[o.XRANGEIDENTIFIERLOOSE]})(?:${b[o.PRERELEASELOOSE]})?${b[o.BUILD]}?)?)?`),h("XRANGE",`^${b[o.GTLT]}\\s*${b[o.XRANGEPLAIN]}$`),h("XRANGELOOSE",`^${b[o.GTLT]}\\s*${b[o.XRANGEPLAINLOOSE]}$`),h("COERCEPLAIN",`(^|[^\\d])(\\d{1,${c}})(?:\\.(\\d{1,${c}}))?(?:\\.(\\d{1,${c}}))?`),h("COERCE",`${b[o.COERCEPLAIN]}(?:$|[^\\d])`),h("COERCEFULL",b[o.COERCEPLAIN]+`(?:${b[o.PRERELEASE]})?`+`(?:${b[o.BUILD]})?(?:$|[^\\d])`),h("COERCERTL",b[o.COERCE],!0),h("COERCERTLFULL",b[o.COERCEFULL],!0),h("LONETILDE","(?:~>?)"),h("TILDETRIM",`(\\s*)${b[o.LONETILDE]}\\s+`,!0),a.tildeTrimReplace="$1~",h("TILDE",`^${b[o.LONETILDE]}${b[o.XRANGEPLAIN]}$`),h("TILDELOOSE",`^${b[o.LONETILDE]}${b[o.XRANGEPLAINLOOSE]}$`),h("LONECARET","(?:\\^)"),h("CARETTRIM",`(\\s*)${b[o.LONECARET]}\\s+`,!0),a.caretTrimReplace="$1^",h("CARET",`^${b[o.LONECARET]}${b[o.XRANGEPLAIN]}$`),h("CARETLOOSE",`^${b[o.LONECARET]}${b[o.XRANGEPLAINLOOSE]}$`),h("COMPARATORLOOSE",`^${b[o.GTLT]}\\s*(${b[o.LOOSEPLAIN]})$|^$`),h("COMPARATOR",`^${b[o.GTLT]}\\s*(${b[o.FULLPLAIN]})$|^$`),h("COMPARATORTRIM",`(\\s*)${b[o.GTLT]}\\s*(${b[o.LOOSEPLAIN]}|${b[o.XRANGEPLAIN]})`,!0),a.comparatorTrimReplace="$1$2$3",h("HYPHENRANGE",`^\\s*(${b[o.XRANGEPLAIN]})\\s+-\\s+(${b[o.XRANGEPLAIN]})\\s*$`),h("HYPHENRANGELOOSE",`^\\s*(${b[o.XRANGEPLAINLOOSE]})\\s+-\\s+(${b[o.XRANGEPLAINLOOSE]})\\s*$`),h("STAR","(<|>)?=?\\s*\\*"),h("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),h("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},14316:(e,a,t)=>{const c=t(22944);e.exports=(e,a,t)=>c(e,a,">",t)},48337:(e,a,t)=>{const c=t(25926);e.exports=(e,a,t)=>(e=new c(e,t),a=new c(a,t),e.intersects(a,t))},12373:(e,a,t)=>{const c=t(22944);e.exports=(e,a,t)=>c(e,a,"<",t)},83777:(e,a,t)=>{const c=t(64739),f=t(25926);e.exports=(e,a,t)=>{let d=null,r=null,n=null;try{n=new f(a,t)}catch(e){return null}return e.forEach((e=>{n.test(e)&&(d&&-1!==r.compare(e)||(d=e,r=new c(d,t)))})),d}},63099:(e,a,t)=>{const c=t(64739),f=t(25926);e.exports=(e,a,t)=>{let d=null,r=null,n=null;try{n=new f(a,t)}catch(e){return null}return e.forEach((e=>{n.test(e)&&(d&&1!==r.compare(e)||(d=e,r=new c(d,t)))})),d}},36258:(e,a,t)=>{const c=t(64739),f=t(25926),d=t(90047);e.exports=(e,a)=>{e=new f(e,a);let t=new c("0.0.0");if(e.test(t))return t;if(t=new c("0.0.0-0"),e.test(t))return t;t=null;for(let a=0;a{const a=new c(e.semver.version);switch(e.operator){case">":0===a.prerelease.length?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":r&&!d(a,r)||(r=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!r||t&&!d(t,r)||(t=r)}return t&&e.test(t)?t:null}},22944:(e,a,t)=>{const c=t(64739),f=t(52139),{ANY:d}=f,r=t(25926),n=t(52643),i=t(90047),b=t(15960),o=t(99925),s=t(70668);e.exports=(e,a,t,l)=>{let u,h,p,g,m;switch(e=new c(e,l),a=new r(a,l),t){case">":u=i,h=o,p=b,g=">",m=">=";break;case"<":u=b,h=s,p=i,g="<",m="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(n(e,a,l))return!1;for(let t=0;t{e.semver===d&&(e=new f(">=0.0.0")),r=r||e,n=n||e,u(e.semver,r.semver,l)?r=e:p(e.semver,n.semver,l)&&(n=e)})),r.operator===g||r.operator===m)return!1;if((!n.operator||n.operator===g)&&h(e,n.semver))return!1;if(n.operator===m&&p(e,n.semver))return!1}return!0}},72196:(e,a,t)=>{const c=t(52643),f=t(8317);e.exports=(e,a,t)=>{const d=[];let r=null,n=null;const i=e.sort(((e,a)=>f(e,a,t)));for(const e of i)c(e,a,t)?(n=e,r||(r=e)):(n&&d.push([r,n]),n=null,r=null);r&&d.push([r,null]);const b=[];for(const[e,a]of d)e===a?b.push(e):a||e!==i[0]?a?e===i[0]?b.push(`<=${a}`):b.push(`${e} - ${a}`):b.push(`>=${e}`):b.push("*");const o=b.join(" || "),s="string"==typeof a.raw?a.raw:String(a);return o.length{const c=t(25926),f=t(52139),{ANY:d}=f,r=t(52643),n=t(8317),i=[new f(">=0.0.0-0")],b=[new f(">=0.0.0")],o=(e,a,t)=>{if(e===a)return!0;if(1===e.length&&e[0].semver===d){if(1===a.length&&a[0].semver===d)return!0;e=t.includePrerelease?i:b}if(1===a.length&&a[0].semver===d){if(t.includePrerelease)return!0;a=b}const c=new Set;let f,o,u,h,p,g,m;for(const a of e)">"===a.operator||">="===a.operator?f=s(f,a,t):"<"===a.operator||"<="===a.operator?o=l(o,a,t):c.add(a.semver);if(c.size>1)return null;if(f&&o){if(u=n(f.semver,o.semver,t),u>0)return null;if(0===u&&(">="!==f.operator||"<="!==o.operator))return null}for(const e of c){if(f&&!r(e,String(f),t))return null;if(o&&!r(e,String(o),t))return null;for(const c of a)if(!r(e,String(c),t))return!1;return!0}let y=!(!o||t.includePrerelease||!o.semver.prerelease.length)&&o.semver,x=!(!f||t.includePrerelease||!f.semver.prerelease.length)&&f.semver;y&&1===y.prerelease.length&&"<"===o.operator&&0===y.prerelease[0]&&(y=!1);for(const e of a){if(m=m||">"===e.operator||">="===e.operator,g=g||"<"===e.operator||"<="===e.operator,f)if(x&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===x.major&&e.semver.minor===x.minor&&e.semver.patch===x.patch&&(x=!1),">"===e.operator||">="===e.operator){if(h=s(f,e,t),h===e&&h!==f)return!1}else if(">="===f.operator&&!r(f.semver,String(e),t))return!1;if(o)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),"<"===e.operator||"<="===e.operator){if(p=l(o,e,t),p===e&&p!==o)return!1}else if("<="===o.operator&&!r(o.semver,String(e),t))return!1;if(!e.operator&&(o||f)&&0!==u)return!1}return!(f&&g&&!o&&0!==u||o&&m&&!f&&0!==u||x||y)},s=(e,a,t)=>{if(!e)return a;const c=n(e.semver,a.semver,t);return c>0?e:c<0||">"===a.operator&&">="===e.operator?a:e},l=(e,a,t)=>{if(!e)return a;const c=n(e.semver,a.semver,t);return c<0?e:c>0||"<"===a.operator&&"<="===e.operator?a:e};e.exports=(e,a,t={})=>{if(e===a)return!0;e=new c(e,t),a=new c(a,t);let f=!1;e:for(const c of e.set){for(const e of a.set){const a=o(c,e,t);if(f=f||null!==a,a)continue e}if(f)return!1}return!0}},24054:(e,a,t)=>{const c=t(25926);e.exports=(e,a)=>new c(e,a).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},77529:(e,a,t)=>{const c=t(25926);e.exports=(e,a)=>{try{return new c(e,a).range||"*"}catch(e){return null}}},25084:e=>{"use strict";e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var a=new Uint8Array(256),t=0;t>>0,b=new Uint8Array(d);e[t];){var o=a[e.charCodeAt(t)];if(255===o)return;for(var s=0,l=d-1;(0!==o||s>>0,b[l]=o%256>>>0,o=o/256>>>0;if(0!==o)throw new Error("Non-zero carry");f=s,t++}if(" "!==e[t]){for(var u=d-f;u!==d&&0===b[u];)u++;for(var h=new Uint8Array(c+(d-u)),p=c;u!==d;)h[p++]=b[u++];return h}}}return{encode:function(a){if(a instanceof Uint8Array||(ArrayBuffer.isView(a)?a=new Uint8Array(a.buffer,a.byteOffset,a.byteLength):Array.isArray(a)&&(a=Uint8Array.from(a))),!(a instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===a.length)return"";for(var t=0,c=0,f=0,d=a.length;f!==d&&0===a[f];)f++,t++;for(var i=(d-f)*b+1>>>0,o=new Uint8Array(i);f!==d;){for(var s=a[f],l=0,u=i-1;(0!==s||l>>0,o[u]=s%r>>>0,s=s/r>>>0;if(0!==s)throw new Error("Non-zero carry");c=l,f++}for(var h=i-c;h!==i&&0===o[h];)h++;for(var p=n.repeat(t);h{"use strict";function t(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function c(e){if("boolean"!=typeof e)throw new Error(`boolean expected, not ${e}`)}function f(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function d(e,...a){if(!f(e))throw new Error("Uint8Array expected");if(a.length>0&&!a.includes(e.length))throw new Error(`Uint8Array expected of length ${a}, not of length=${e.length}`)}function r(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");t(e.outputLen),t(e.blockLen)}function n(e,a=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(a&&e.finished)throw new Error("Hash#digest() has already been called")}function i(e,a){d(e);const t=a.outputLen;if(e.length{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.HashMD=a.Maj=a.Chi=void 0;const c=t(67557),f=t(99175);a.Chi=(e,a,t)=>e&a^~e&t,a.Maj=(e,a,t)=>e&a^e&t^a&t;class d extends f.Hash{constructor(e,a,t,c){super(),this.blockLen=e,this.outputLen=a,this.padOffset=t,this.isLE=c,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,f.createView)(this.buffer)}update(e){(0,c.exists)(this);const{view:a,buffer:t,blockLen:d}=this,r=(e=(0,f.toBytes)(e)).length;for(let c=0;cd-n&&(this.process(t,0),n=0);for(let e=n;e>f&d),n=Number(t&d),i=c?4:0,b=c?0:4;e.setUint32(a+i,r,c),e.setUint32(a+b,n,c)}(t,d-8,BigInt(8*this.length),r),this.process(t,0);const i=(0,f.createView)(e),b=this.outputLen;if(b%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const o=b/4,s=this.get();if(o>s.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.add5L=a.add5H=a.add4H=a.add4L=a.add3H=a.add3L=a.add=a.rotlBL=a.rotlBH=a.rotlSL=a.rotlSH=a.rotr32L=a.rotr32H=a.rotrBL=a.rotrBH=a.rotrSL=a.rotrSH=a.shrSL=a.shrSH=a.toBig=a.split=a.fromBig=void 0;const t=BigInt(2**32-1),c=BigInt(32);function f(e,a=!1){return a?{h:Number(e&t),l:Number(e>>c&t)}:{h:0|Number(e>>c&t),l:0|Number(e&t)}}function d(e,a=!1){let t=new Uint32Array(e.length),c=new Uint32Array(e.length);for(let d=0;dBigInt(e>>>0)<>>0);a.toBig=r;const n=(e,a,t)=>e>>>t;a.shrSH=n;const i=(e,a,t)=>e<<32-t|a>>>t;a.shrSL=i;const b=(e,a,t)=>e>>>t|a<<32-t;a.rotrSH=b;const o=(e,a,t)=>e<<32-t|a>>>t;a.rotrSL=o;const s=(e,a,t)=>e<<64-t|a>>>t-32;a.rotrBH=s;const l=(e,a,t)=>e>>>t-32|a<<64-t;a.rotrBL=l;const u=(e,a)=>a;a.rotr32H=u;const h=(e,a)=>e;a.rotr32L=h;const p=(e,a,t)=>e<>>32-t;a.rotlSH=p;const g=(e,a,t)=>a<>>32-t;a.rotlSL=g;const m=(e,a,t)=>a<>>64-t;a.rotlBH=m;const y=(e,a,t)=>e<>>64-t;function x(e,a,t,c){const f=(a>>>0)+(c>>>0);return{h:e+t+(f/2**32|0)|0,l:0|f}}a.rotlBL=y,a.add=x;const A=(e,a,t)=>(e>>>0)+(a>>>0)+(t>>>0);a.add3L=A;const v=(e,a,t,c)=>a+t+c+(e/2**32|0)|0;a.add3H=v;const w=(e,a,t,c)=>(e>>>0)+(a>>>0)+(t>>>0)+(c>>>0);a.add4L=w;const _=(e,a,t,c,f)=>a+t+c+f+(e/2**32|0)|0;a.add4H=_;const I=(e,a,t,c,f)=>(e>>>0)+(a>>>0)+(t>>>0)+(c>>>0)+(f>>>0);a.add5L=I;const E=(e,a,t,c,f,d)=>a+t+c+f+d+(e/2**32|0)|0;a.add5H=E;const C={fromBig:f,split:d,toBig:r,shrSH:n,shrSL:i,rotrSH:b,rotrSL:o,rotrBH:s,rotrBL:l,rotr32H:u,rotr32L:h,rotlSH:p,rotlSL:g,rotlBH:m,rotlBL:y,add:x,add3L:A,add3H:v,add4L:w,add4H:_,add5H:E,add5L:I};a.default=C},25145:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.crypto=void 0,a.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},39615:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.hmac=a.HMAC=void 0;const c=t(67557),f=t(99175);class d extends f.Hash{constructor(e,a){super(),this.finished=!1,this.destroyed=!1,(0,c.hash)(e);const t=(0,f.toBytes)(a);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const d=this.blockLen,r=new Uint8Array(d);r.set(t.length>d?e.create().update(t).digest():t);for(let e=0;enew d(e,a).update(t).digest(),a.hmac.create=(e,a)=>new d(e,a)},22623:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.sha224=a.sha256=void 0;const c=t(37202),f=t(99175),d=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),r=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),n=new Uint32Array(64);class i extends c.HashMD{constructor(){super(64,32,8,!1),this.A=0|r[0],this.B=0|r[1],this.C=0|r[2],this.D=0|r[3],this.E=0|r[4],this.F=0|r[5],this.G=0|r[6],this.H=0|r[7]}get(){const{A:e,B:a,C:t,D:c,E:f,F:d,G:r,H:n}=this;return[e,a,t,c,f,d,r,n]}set(e,a,t,c,f,d,r,n){this.A=0|e,this.B=0|a,this.C=0|t,this.D=0|c,this.E=0|f,this.F=0|d,this.G=0|r,this.H=0|n}process(e,a){for(let t=0;t<16;t++,a+=4)n[t]=e.getUint32(a,!1);for(let e=16;e<64;e++){const a=n[e-15],t=n[e-2],c=(0,f.rotr)(a,7)^(0,f.rotr)(a,18)^a>>>3,d=(0,f.rotr)(t,17)^(0,f.rotr)(t,19)^t>>>10;n[e]=d+n[e-7]+c+n[e-16]|0}let{A:t,B:r,C:i,D:b,E:o,F:s,G:l,H:u}=this;for(let e=0;e<64;e++){const a=u+((0,f.rotr)(o,6)^(0,f.rotr)(o,11)^(0,f.rotr)(o,25))+(0,c.Chi)(o,s,l)+d[e]+n[e]|0,h=((0,f.rotr)(t,2)^(0,f.rotr)(t,13)^(0,f.rotr)(t,22))+(0,c.Maj)(t,r,i)|0;u=l,l=s,s=o,o=b+a|0,b=i,i=r,r=t,t=a+h|0}t=t+this.A|0,r=r+this.B|0,i=i+this.C|0,b=b+this.D|0,o=o+this.E|0,s=s+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(t,r,i,b,o,s,l,u)}roundClean(){n.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class b extends i{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}a.sha256=(0,f.wrapConstructor)((()=>new i)),a.sha224=(0,f.wrapConstructor)((()=>new b))},32955:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.shake256=a.shake128=a.keccak_512=a.keccak_384=a.keccak_256=a.keccak_224=a.sha3_512=a.sha3_384=a.sha3_256=a.sha3_224=a.Keccak=a.keccakP=void 0;const c=t(67557),f=t(22318),d=t(99175),r=[],n=[],i=[],b=BigInt(0),o=BigInt(1),s=BigInt(2),l=BigInt(7),u=BigInt(256),h=BigInt(113);for(let e=0,a=o,t=1,c=0;e<24;e++){[t,c]=[c,(2*t+3*c)%5],r.push(2*(5*c+t)),n.push((e+1)*(e+2)/2%64);let f=b;for(let e=0;e<7;e++)a=(a<>l)*h)%u,a&s&&(f^=o<<(o<t>32?(0,f.rotlBH)(e,a,t):(0,f.rotlSH)(e,a,t),y=(e,a,t)=>t>32?(0,f.rotlBL)(e,a,t):(0,f.rotlSL)(e,a,t);function x(e,a=24){const t=new Uint32Array(10);for(let c=24-a;c<24;c++){for(let a=0;a<10;a++)t[a]=e[a]^e[a+10]^e[a+20]^e[a+30]^e[a+40];for(let a=0;a<10;a+=2){const c=(a+8)%10,f=(a+2)%10,d=t[f],r=t[f+1],n=m(d,r,1)^t[c],i=y(d,r,1)^t[c+1];for(let t=0;t<50;t+=10)e[a+t]^=n,e[a+t+1]^=i}let a=e[2],f=e[3];for(let t=0;t<24;t++){const c=n[t],d=m(a,f,c),i=y(a,f,c),b=r[t];a=e[b],f=e[b+1],e[b]=d,e[b+1]=i}for(let a=0;a<50;a+=10){for(let c=0;c<10;c++)t[c]=e[a+c];for(let c=0;c<10;c++)e[a+c]^=~t[(c+2)%10]&t[(c+4)%10]}e[0]^=p[c],e[1]^=g[c]}t.fill(0)}a.keccakP=x;class A extends d.Hash{constructor(e,a,t,f=!1,r=24){if(super(),this.blockLen=e,this.suffix=a,this.outputLen=t,this.enableXOF=f,this.rounds=r,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,c.number)(t),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,d.u32)(this.state)}keccak(){d.isLE||(0,d.byteSwap32)(this.state32),x(this.state32,this.rounds),d.isLE||(0,d.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(e){(0,c.exists)(this);const{blockLen:a,state:t}=this,f=(e=(0,d.toBytes)(e)).length;for(let c=0;c=t&&this.keccak();const d=Math.min(t-this.posOut,f-c);e.set(a.subarray(this.posOut,this.posOut+d),c),this.posOut+=d,c+=d}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,c.number)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,c.output)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:a,suffix:t,outputLen:c,rounds:f,enableXOF:d}=this;return e||(e=new A(a,t,c,d,f)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=f,e.suffix=t,e.outputLen=c,e.enableXOF=d,e.destroyed=this.destroyed,e}}a.Keccak=A;const v=(e,a,t)=>(0,d.wrapConstructor)((()=>new A(a,e,t)));a.sha3_224=v(6,144,28),a.sha3_256=v(6,136,32),a.sha3_384=v(6,104,48),a.sha3_512=v(6,72,64),a.keccak_224=v(1,144,28),a.keccak_256=v(1,136,32),a.keccak_384=v(1,104,48),a.keccak_512=v(1,72,64);const w=(e,a,t)=>(0,d.wrapXOFConstructorWithOpts)(((c={})=>new A(a,e,void 0===c.dkLen?t:c.dkLen,!0)));a.shake128=w(31,168,16),a.shake256=w(31,136,32)},99175:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.randomBytes=a.wrapXOFConstructorWithOpts=a.wrapConstructorWithOpts=a.wrapConstructor=a.checkOpts=a.Hash=a.concatBytes=a.toBytes=a.utf8ToBytes=a.asyncLoop=a.nextTick=a.hexToBytes=a.bytesToHex=a.byteSwap32=a.byteSwapIfBE=a.byteSwap=a.isLE=a.rotl=a.rotr=a.createView=a.u32=a.u8=a.isBytes=void 0;const c=t(25145),f=t(67557);a.isBytes=function(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name},a.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),a.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),a.rotr=(e,a)=>e<<32-a|e>>>a,a.rotl=(e,a)=>e<>>32-a>>>0,a.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],a.byteSwap=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,a.byteSwapIfBE=a.isLE?e=>e:e=>(0,a.byteSwap)(e),a.byteSwap32=function(e){for(let t=0;ta.toString(16).padStart(2,"0")));a.bytesToHex=function(e){(0,f.bytes)(e);let a="";for(let t=0;t=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function n(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function i(e){return"string"==typeof e&&(e=n(e)),(0,f.bytes)(e),e}a.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const a=e.length,t=a/2;if(a%2)throw new Error("padded hex string expected, got unpadded hex of length "+a);const c=new Uint8Array(t);for(let a=0,f=0;a{},a.asyncLoop=async function(e,t,c){let f=Date.now();for(let d=0;d=0&&ee().update(i(a)).digest(),t=e();return a.outputLen=t.outputLen,a.blockLen=t.blockLen,a.create=()=>e(),a},a.wrapConstructorWithOpts=function(e){const a=(a,t)=>e(t).update(i(a)).digest(),t=e({});return a.outputLen=t.outputLen,a.blockLen=t.blockLen,a.create=a=>e(a),a},a.wrapXOFConstructorWithOpts=function(e){const a=(a,t)=>e(t).update(i(a)).digest(),t=e({});return a.outputLen=t.outputLen,a.blockLen=t.blockLen,a.create=a=>e(a),a},a.randomBytes=function(e=32){if(c.crypto&&"function"==typeof c.crypto.getRandomValues)return c.crypto.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}},63203:(e,a)=>{"use strict";function t(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}function c(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function f(...e){const a=e=>e,t=(e,a)=>t=>e(a(t));return{encode:e.map((e=>e.encode)).reduceRight(t,a),decode:e.map((e=>e.decode)).reduce(t,a)}}function d(e){return{encode:a=>{if(!Array.isArray(a)||a.length&&"number"!=typeof a[0])throw new Error("alphabet.encode input should be an array of numbers");return a.map((a=>{if(t(a),a<0||a>=e.length)throw new Error(`Digit index outside alphabet: ${a} (alphabet: ${e.length})`);return e[a]}))},decode:a=>{if(!Array.isArray(a)||a.length&&"string"!=typeof a[0])throw new Error("alphabet.decode input should be array of strings");return a.map((a=>{if("string"!=typeof a)throw new Error(`alphabet.decode: not string element=${a}`);const t=e.indexOf(a);if(-1===t)throw new Error(`Unknown letter: "${a}". Allowed: ${e}`);return t}))}}}function r(e=""){if("string"!=typeof e)throw new Error("join separator should be string");return{encode:a=>{if(!Array.isArray(a)||a.length&&"string"!=typeof a[0])throw new Error("join.encode input should be array of strings");for(let e of a)if("string"!=typeof e)throw new Error(`join.encode: non-string input=${e}`);return a.join(e)},decode:a=>{if("string"!=typeof a)throw new Error("join.decode input should be string");return a.split(e)}}}function n(e,a="="){if(t(e),"string"!=typeof a)throw new Error("padding chr should be string");return{encode(t){if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("padding.encode input should be array of strings");for(let e of t)if("string"!=typeof e)throw new Error(`padding.encode: non-string input=${e}`);for(;t.length*e%8;)t.push(a);return t},decode(t){if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("padding.encode input should be array of strings");for(let e of t)if("string"!=typeof e)throw new Error(`padding.decode: non-string input=${e}`);let c=t.length;if(c*e%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;c>0&&t[c-1]===a;c--)if(!((c-1)*e%8))throw new Error("Invalid padding: string has too much padding");return t.slice(0,c)}}}function i(e){if("function"!=typeof e)throw new Error("normalize fn should be function");return{encode:e=>e,decode:a=>e(a)}}function b(e,a,c){if(a<2)throw new Error(`convertRadix: wrong from=${a}, base cannot be less than 2`);if(c<2)throw new Error(`convertRadix: wrong to=${c}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let f=0;const d=[],r=Array.from(e);for(r.forEach((e=>{if(t(e),e<0||e>=a)throw new Error(`Wrong integer: ${e}`)}));;){let e=0,t=!0;for(let d=f;da?o(a,e%a):e,s=(e,a)=>e+(a-o(e,a));function l(e,a,c,f){if(!Array.isArray(e))throw new Error("convertRadix2: data should be array");if(a<=0||a>32)throw new Error(`convertRadix2: wrong from=${a}`);if(c<=0||c>32)throw new Error(`convertRadix2: wrong to=${c}`);if(s(a,c)>32)throw new Error(`convertRadix2: carry overflow from=${a} to=${c} carryBits=${s(a,c)}`);let d=0,r=0;const n=2**c-1,i=[];for(const f of e){if(t(f),f>=2**a)throw new Error(`convertRadix2: invalid data word=${f} from=${a}`);if(d=d<32)throw new Error(`convertRadix2: carry overflow pos=${r} from=${a}`);for(r+=a;r>=c;r-=c)i.push((d>>r-c&n)>>>0);d&=2**r-1}if(d=d<=a)throw new Error("Excess padding");if(!f&&d)throw new Error(`Non-zero padding: ${d}`);return f&&r>0&&i.push(d>>>0),i}function u(e){return t(e),{encode:a=>{if(!c(a))throw new Error("radix.encode input should be Uint8Array");return b(Array.from(a),256,e)},decode:a=>{if(!Array.isArray(a)||a.length&&"number"!=typeof a[0])throw new Error("radix.decode input should be array of numbers");return Uint8Array.from(b(a,e,256))}}}function h(e,a=!1){if(t(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(s(8,e)>32||s(e,8)>32)throw new Error("radix2: carry overflow");return{encode:t=>{if(!c(t))throw new Error("radix2.encode input should be Uint8Array");return l(Array.from(t),8,e,!a)},decode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("radix2.decode input should be array of numbers");return Uint8Array.from(l(t,e,8,a))}}}function p(e){if("function"!=typeof e)throw new Error("unsafeWrapper fn should be function");return function(...a){try{return e.apply(null,a)}catch(e){}}}function g(e,a){if(t(e),"function"!=typeof a)throw new Error("checksum fn should be function");return{encode(t){if(!c(t))throw new Error("checksum.encode: input should be Uint8Array");const f=a(t).slice(0,e),d=new Uint8Array(t.length+e);return d.set(t),d.set(f,t.length),d},decode(t){if(!c(t))throw new Error("checksum.decode: input should be Uint8Array");const f=t.slice(0,-e),d=a(f).slice(0,e),r=t.slice(-e);for(let a=0;ae.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")))),a.base64=f(h(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),n(6),r("")),a.base64nopad=f(h(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),r("")),a.base64url=f(h(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),n(6),r("")),a.base64urlnopad=f(h(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),r(""));const m=e=>f(u(58),d(e),r(""));a.base58=m("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),a.base58flickr=m("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),a.base58xrp=m("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const y=[0,2,3,5,6,7,9,10,11];a.base58xmr={encode(e){let t="";for(let c=0;cf(g(4,(a=>e(e(a)))),a.base58),a.base58check=a.createBase58check;const x=f(d("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),r("")),A=[996825010,642813549,513874426,1027748829,705979059];function v(e){const a=e>>25;let t=(33554431&e)<<5;for(let e=0;e>e&1)&&(t^=A[e]);return t}function w(e,a,t=1){const c=e.length;let f=1;for(let a=0;a126)throw new Error(`Invalid prefix (${e})`);f=v(f)^t>>5}f=v(f);for(let a=0;ac)throw new TypeError(`Length ${f} exceeds limit ${c}`);const d=e.toLowerCase(),r=w(d,t,a);return`${d}1${x.encode(t)}${r}`}function n(e,t=90){if("string"!=typeof e)throw new Error("bech32.decode input should be string, not "+typeof e);if(e.length<8||!1!==t&&e.length>t)throw new TypeError(`Wrong string length: ${e.length} (${e}). Expected (8..${t})`);const c=e.toLowerCase();if(e!==c&&e!==e.toUpperCase())throw new Error("String must be lowercase or uppercase");const f=c.lastIndexOf("1");if(0===f||-1===f)throw new Error('Letter "1" must be present between prefix and data only');const d=c.slice(0,f),r=c.slice(f+1);if(r.length<6)throw new Error("Data must be at least 6 characters long");const n=x.decode(r).slice(0,-6),i=w(d,n,a);if(!r.endsWith(i))throw new Error(`Invalid checksum in ${e}: expected "${i}"`);return{prefix:d,words:n}}return{encode:r,decode:n,encodeFromBytes:function(e,a){return r(e,f(a))},decodeToBytes:function(e){const{prefix:a,words:t}=n(e,!1);return{prefix:a,words:t,bytes:c(t)}},decodeUnsafe:p(n),fromWords:c,fromWordsUnsafe:d,toWords:f}}a.bech32=_("bech32"),a.bech32m=_("bech32m"),a.utf8={encode:e=>(new TextDecoder).decode(e),decode:e=>(new TextEncoder).encode(e)},a.hex=f(h(4),d("0123456789abcdef"),r(""),i((e=>{if("string"!=typeof e||e.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()})));const I={utf8:a.utf8,hex:a.hex,base16:a.base16,base32:a.base32,base64:a.base64,base64url:a.base64url,base58:a.base58,base58xmr:a.base58xmr},E="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr";a.bytesToString=(e,a)=>{if("string"!=typeof e||!I.hasOwnProperty(e))throw new TypeError(E);if(!c(a))throw new TypeError("bytesToString() expects Uint8Array");return I[e].encode(a)},a.str=a.bytesToString,a.stringToBytes=(e,a)=>{if(!I.hasOwnProperty(e))throw new TypeError(E);if("string"!=typeof a)throw new TypeError("stringToBytes() expects string");return I[e].decode(a)},a.bytes=a.stringToBytes},7736:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.BaseTree=void 0,a.BaseTree=class{get capacity(){return 2**this.levels}get layers(){return this._layers.slice()}get zeros(){return this._zeros.slice()}get elements(){return this._layers[0].slice()}get root(){var e;return null!==(e=this._layers[this.levels][0])&&void 0!==e?e:this._zeros[this.levels]}static indexOf(e,a,t,c){return c?e.findIndex((e=>c(a,e))):e.indexOf(a,t)}insert(e){if(this._layers[0].length>=this.capacity)throw new Error("Tree is full");this.update(this._layers[0].length,e)}bulkInsert(e){if(e.length){if(this._layers[0].length+e.length>this.capacity)throw new Error("Tree is full");for(let a=0;a>=1;const e=this._layers[t-1][2*c],a=this._layers[t-1][2*c+1];this._layers[t][c]=this._hashFn(e,a)}}this.insert(e[e.length-1])}}update(e,a){if(isNaN(Number(e))||e<0||e>this._layers[0].length||e>=this.capacity)throw new Error("Insert index out of bounds: "+e);this._layers[0][e]=a,this._processUpdate(e)}path(e){if(isNaN(Number(e))||e<0||e>=this._layers[0].length)throw new Error("Index out of bounds: "+e);let a=+e;const t=[],c=[],f=[];for(let e=0;e>=1}return{pathElements:t,pathIndices:c,pathPositions:f,pathRoot:this.root}}_buildZeros(){this._zeros=[this.zeroElement];for(let e=1;e<=this.levels;e++)this._zeros[e]=this._hashFn(this._zeros[e-1],this._zeros[e-1])}_processNodes(e,a){const t=e.length;let c=Math.ceil(t/2);const f=new Array(c);c--;const d=t-(t%2^1);let r=0;for(let n=d;n>=0&&void 0!==e[n-1];n-=2){const i=e[n-1],b=n===d&&t%2==1?this._zeros[a-1]:e[n];f[c-r]=this._hashFn(i,b),r++}return f}_processUpdate(e){for(let a=1;a<=this.levels;a++){e>>=1;const t=this._layers[a-1][2*e],c=2*e+1this.capacity)throw new Error("Tree is full");this._hashFn=t,this.zeroElement=c,this._layers=[];const d=a.slice();this._layers=[d],this._buildZeros(),this._buildHashes()}_buildHashes(){for(let e=1;e<=this.levels;e++){const a=this._layers[e-1];this._layers[e]=this._processNodes(a,e)}}bulkInsert(e){if(e.length){if(this._layers[0].length+e.length>this.capacity)throw new Error("Tree is full");for(let a=0;a>=1,this._layers[t][c]=this._hashFn(this._layers[t-1][2*c],this._layers[t-1][2*c+1])}this.insert(e[e.length-1])}}indexOf(e,a){return d.BaseTree.indexOf(this._layers[0],e,0,a)}proof(e){const a=this.indexOf(e);return this.path(a)}getTreeEdge(e){const a=this._layers[0][e];if(void 0===a)throw new Error("Element not found");return{edgePath:this.path(e),edgeElement:a,edgeIndex:e,edgeElementsCount:this._layers[0].length}}getTreeSlices(e=4){const a=this._layers[0].length;let t=Math.ceil(a/e);t%2&&t++;const c=[];for(let e=0;e(e.set(t,[a,this.edgeLeafProof.pathElements[t]]),e)),new Map),this._proofMap.set(this.levels,[0,this.edgeLeafProof.pathRoot])}_buildTree(){const e=this._edgeLeaf.index;if(this._leaves=Array(e).concat(this._leavesAfterEdge),this._proofMap.has(0)){const[e,a]=this._proofMap.get(0);this._leaves[e]=a}this._layers=[this._leaves],this._buildZeros(),this._buildHashes()}_buildHashes(){for(let e=1;e<=this.levels;e++){const a=this._layers[e-1],t=this._processNodes(a,e);if(this._proofMap.has(e)){const[a,c]=this._proofMap.get(e);t[a]||(t[a]=c)}this._layers[e]=t}}update(e,a){if(isNaN(Number(e))||e<0||e>this._layers[0].length||e>=this.capacity)throw new Error("Insert index out of bounds: "+e);if(e=this._layers[0].length)throw new Error("Index out of bounds: "+e);if(e>=1}return{pathElements:c,pathIndices:f,pathPositions:d,pathRoot:this.root}}indexOf(e,a){return d.BaseTree.indexOf(this._layers[0],e,this.edgeIndex,a)}proof(e){const a=this.indexOf(e);return this.path(a)}shiftEdge(e,a){if(this._edgeLeaf.index<=e.edgeIndex)throw new Error(`New edgeIndex should be smaller then ${this._edgeLeaf.index}`);if(a.length!==this._edgeLeaf.index-e.edgeIndex)throw new Error("Elements length should be "+(this._edgeLeaf.index-e.edgeIndex));this._edgeLeafProof=e.edgePath,this._edgeLeaf={index:e.edgeIndex,data:e.edgeElement},this._leavesAfterEdge=[...a,...this._leavesAfterEdge],this._createProofMap(),this._buildTree()}serialize(){return{_edgeLeafProof:this._edgeLeafProof,_edgeLeaf:this._edgeLeaf,_layers:this._layers,_zeros:this._zeros,levels:this.levels}}static deserialize(e,a){const t=Object.assign(Object.create(this.prototype),e);return t._hashFn=a||f.default,t._initialRoot=e._edgeLeafProof.pathRoot,t.zeroElement=t._zeros[0],t._leavesAfterEdge=t._layers[0].slice(e._edgeLeaf.index),t._createProofMap(),t}toString(){return JSON.stringify(this.serialize())}}a.PartialMerkleTree=r},41217:function(e,a,t){"use strict";var c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0}),a.MerkleTree=a.simpleHash=a.PartialMerkleTree=void 0;const f=c(t(9093));Object.defineProperty(a,"MerkleTree",{enumerable:!0,get:function(){return f.default}});var d=t(91230);Object.defineProperty(a,"PartialMerkleTree",{enumerable:!0,get:function(){return d.PartialMerkleTree}});var r=t(5319);Object.defineProperty(a,"simpleHash",{enumerable:!0,get:function(){return r.simpleHash}}),a.default=f.default},5319:(e,a)=>{"use strict";function t(e,a,t=40){const c=e.join("");let f,d,r=null!=a?a:34658180293;for(f=0,d=c.length;f>>0).toString(16);return BigInt("0x"+n.padEnd(t-(n.length-1),"0")).toString(10)}Object.defineProperty(a,"__esModule",{value:!0}),a.simpleHash=void 0,a.simpleHash=t,a.default=(e,a)=>t([e,a])},27351:(e,a,t)=>{var c=t(62045).hp;const f=t(92096);let d;if("undefined"!=typeof BigInt)d=BigInt,d.one=d(1),d.zero=d(0),d.genAffine=e=>{const a=-e;return t=>{let c=t;return c<0?(c<=a&&(c%=e),c=e&&(c%=e),c.valueOf()}},d.genInverse=e=>a=>{let t=d.zero,c=e,f=d.one,r=d.affine(a,e);for(;r!=d.zero;){let e=c/r;[t,f]=[f,t-e*f],[c,r]=[r,c-e*r]}return te?(a,t)=>(a+t)%e:(e,a)=>e+a,d.genSub=e=>e?(a,t)=>(a-t)%e:(e,a)=>e-a,d.genNeg=e=>e?a=>-a%e:e=>-e,d.genMul=e=>e?(a,t)=>a*t%e:(e,a)=>e*a,d.genShr=()=>(e,a)=>e>>d(a),d.genShl=e=>e?(a,t)=>(a<e<e?(a,t)=>a.affine(e)==t.affine(e):(e,a)=>e==a,d.genSquare=e=>e?a=>a*a%e:e=>e*e,d.genDouble=e=>e?a=>(a+a)%e:e=>e+e,d.genIsZero=e=>e?a=>a.affine(e)==d.zero:e=>e==d.zero,d.prototype.isOdd=function(){return(this&d.one)==d(1)},d.prototype.isNegative=function(){return thisd.zero?this:-this},d.prototype.modPow=function(e,a){let t=d.one,c=this,f=e;for(;f;)f&d.one&&(t=t*c%a),c=c*c%a,f>>=d.one;return t},d.prototype.greaterOrEquals=function(e){return this>=e},d.prototype.greater=function(e){return this>e},d.prototype.gt=d.prototype.greater,d.prototype.lesserOrEquals=function(e){return this<=e},d.prototype.lesser=function(e){return this{const a=d.zero.minus(e);return t=>{let c=t;return c.isNegative()?(c.lesserOrEquals(a)&&(c=c.mod(e)),c.isNegative()&&(c=c.add(e))):c.greaterOrEquals(e)&&(c=c.mod(e)),c}},d.genInverse=e=>a=>a.affine(e).modInv(e),d.genAdd=e=>e?(a,t)=>{const c=a.add(t);return c.greaterOrEquals(e)?c.minus(e):c}:(e,a)=>e.add(a),d.genSub=e=>e?(a,t)=>a.greaterOrEquals(t)?a.minus(t):a.minus(t).add(e):(e,a)=>e.minus(a),d.genNeg=e=>e?a=>a.isZero()?a:e.minus(a):e=>d.zero.minus(e),d.genMul=e=>e?(a,t)=>a.times(t).mod(e):(e,a)=>e.times(a),d.genShr=()=>(e,a)=>e.shiftRight(d(a).value),d.genShl=e=>e?(a,t)=>a.shiftLeft(d(t).value).mod(e):(e,a)=>e.shiftLeft(d(a).value),d.genSquare=e=>e?a=>a.square().mod(e):e=>e.square(),d.genDouble=e=>e?a=>a.add(a).mod(e):e=>e.add(e),d.genEquals=e=>e?(a,t)=>a.affine(e).equals(t.affine(e)):(e,a)=>e.equals(a),d.genIsZero=e=>e?a=>a.affine(e).isZero():e=>e.isZero()}d.affine=function(e,a){return d.genAffine(a)(e)},d.prototype.affine=function(e){return d.affine(this,e)},d.inverse=function(e,a){return d.genInverse(a)(e)},d.prototype.inverse=function(e){return d.genInverse(e)(this)},d.add=function(e,a,t){return d.genAdd(t)(e,a)},d.prototype.add=function(e,a){return d.genAdd(a)(this,e)},d.sub=function(e,a,t){return d.genSub(t)(e,a)},d.prototype.sub=function(e,a){return d.genSub(a)(this,e)},d.neg=function(e,a){return d.genNeg(a)(e)},d.prototype.neg=function(e){return d.genNeg(e)(this)},d.mul=function(e,a,t){return d.genMul(t)(e,a)},d.prototype.mul=function(e,a){return d.genMul(a)(this,e)},d.shr=function(e,a,t){return d.genShr(t)(e,a)},d.prototype.shr=function(e,a){return d.genShr(a)(this,e)},d.shl=function(e,a,t){return d.genShl(t)(e,a)},d.prototype.shl=function(e,a){return d.genShl(a)(this,e)},d.equals=function(e,a,t){return d.genEquals(t)(e,a)},d.prototype.equals=function(e,a){return d.genEquals(a)(this,e)},d.square=function(e,a){return d.genSquare(a)(e)},d.prototype.square=function(e){return d.genSquare(e)(this)},d.double=function(e,a){return d.genDouble(a)(e)},d.prototype.double=function(e){return d.genDouble(e)(this)},d.isZero=function(e,a){return d.genIsZero(a)(e)},d.prototype.isZero=function(e){return d.genIsZero(e)(this)},d.leBuff2int=function(e){let a=d.zero;for(let t=0;t=0;){let e=Number(t.and(d("255")));r[f]=e,f--,t=t.shr(8)}if(t.greater(d.zero))throw new Error("Number does not feed in buffer");return r},d.prototype.beInt2Buff=function(e){return d.beInt2Buff(this,e)},e.exports=d},28803:(e,a,t)=>{const c=t(27351);e.exports=function(e,a,t){(t=t||{}).logFunction||(t.logFunction=console.log);const d=new f(e,t);function r(e,a,t){if(!Array.isArray(e))return t(a,e);for(let c=0;c{0==this.notInitSignals[e]&&this.triggerComponent(e)})),this.witness[t]}setVar(e,a,t){const c=this.scopes[this.scopes.length-1];return 0==a.length?c[e]=t:(void 0===c[e]&&(c[e]=[]),function e(a,t,c){1==t.length?a[t[0]]=c:(void 0===a[t[0]]&&(a[t[0]]=[]),e(a[t[0]],t.slice(1),c))}(c[e],a,t)),t}getVar(e,a){function t(e,a){return 0==a.length?e:t(e[a[0]],a.slice(1))}for(let c=this.scopes.length-1;c>=0;c--)if(void 0!==this.scopes[c][e])return t(this.scopes[c][e],a);throw new Error("Variable not defined: "+e)}getSignal(e,a){let t="one"==e?"one":this.currentComponent+"."+e;return t+=this._sels2str(a),this.getSignalFullName(t)}getPin(e,a,t,c){let f="one"==e?"one":this.currentComponent+"."+e;return f+=this._sels2str(a)+"."+t+this._sels2str(c),this.getSignalFullName(f)}getSignalFullName(e){const a=this.circuit.getSignalIdx(e);if(void 0===this.witness[a])throw new Error("Signal not initialized: "+e);return this.options.logGet&&this.options.logFunction("get ---\x3e"+e+" = "+this.witness[a].toString()),this.witness[a]}assert(e,a,t){const f=c(e),d=c(a);if(!f.equals(d))throw new Error("Constraint doesn't match "+this.currentComponent+": "+t+" -> "+f.toString()+" != "+d.toString())}}},98665:(module,__unused_webpack_exports,__webpack_require__)=>{const bigInt=__webpack_require__(27351),__P__=bigInt("21888242871839275222246405745257275088548364400416034343698204186575808495617"),__MASK__=bigInt("28948022309329048855892746252171976963317496166410141009864396001978282409983"),calculateWitness=__webpack_require__(28803);module.exports=class Circuit{constructor(circuitDef){this.nPubInputs=circuitDef.nPubInputs,this.nPrvInputs=circuitDef.nPrvInputs,this.nInputs=circuitDef.nInputs,this.nOutputs=circuitDef.nOutputs,this.nVars=circuitDef.nVars,this.nSignals=circuitDef.nSignals,this.nConstants=circuitDef.nConstants,this.nConstraints=circuitDef.constraints.length,this.signalName2Idx=circuitDef.signalName2Idx,this.components=circuitDef.components,this.componentName2Idx=circuitDef.componentName2Idx,this.signals=circuitDef.signals,this.constraints=circuitDef.constraints,this.templates={};for(let t in circuitDef.templates)this.templates[t]=eval(" const __f= "+circuitDef.templates[t]+"\n__f");this.functions={};for(let f in circuitDef.functions)this.functions[f]={params:circuitDef.functions[f].params,func:eval(" const __f= "+circuitDef.functions[f].func+"\n__f;")}}calculateWitness(e,a){return calculateWitness(this,e,a)}checkWitness(e){const a=(e,a)=>{let t=bigInt(0);for(let c in e)t=t.add(bigInt(a[c]).mul(bigInt(e[c]))).mod(__P__);return t},t=(e,t)=>{const c=a(e[0],t),f=a(e[1],t),d=a(e[2],t);return!!c.mul(f).sub(d).affine(__P__).isZero()};for(let a=0;a{let a="";for(let t in e){let c=this.signals[t].names[0];"one"==c&&(c="");let f,d=bigInt(e[t]);d.lesserOrEquals(__P__.shr(bigInt(1)))?(f=""!=a?"+"+d.toString():"","1"!=f&&(f+=d.toString())):(d=__P__.sub(d),f="-"+d.toString()),a=a+" "+f+c}return a},t=`[ ${a(e[0])} ] * [ ${a(e[1])} ] - [ ${a(e[2])} ] = 0`;console.log(t)}printConstraints(){for(let e=0;e=this.nOutputs)throw new Error("Accessing an invalid output: "+e);return e+1}inputIdx(e){if(e>=this.nInputs)throw new Error("Accessing an invalid input: "+e);return this.nOutputs+1+e}pubInputIdx(e){if(e>=this.nPubInputs)throw new Error("Accessing an invalid pubInput: "+e);return this.inputIdx(e)}prvInputIdx(e){if(e>=this.nPrvInputs)throw new Error("Accessing an invalid prvInput: "+e);return this.inputIdx(this.nPubInputs+e)}varIdx(e){if(e>=this.nVars)throw new Error("Accessing an invalid variable: "+e);return e}constantIdx(e){if(e>=this.nConstants)throw new Error("Accessing an invalid constant: "+e);return this.nVars+e}signalIdx(e){if(e>=this.nSignls)throw new Error("Accessing an invalid signal: "+e);return e}signalNames(e){return this.signals[this.getSignalIdx(e)].names.join(", ")}a(e,a){return bigInt(this.constraints[e][0][a]||0)}b(e,a){return bigInt(this.constraints[e][1][a]||0)}c(e,a){return bigInt(this.constraints[e][2][a]||0)}}},73248:(e,a,t)=>{const c=t(27351);e.exports.e=function e(a){if("bigint"==typeof a||void 0!==a.isZero)return a.toString(10);if(Array.isArray(a))return a.map(e);if("object"==typeof a){const t={};for(let c in a)t[c]=e(a[c]);return t}return a},e.exports.H=function e(a){if("string"==typeof a&&/^[0-9]+$/.test(a))return c(a);if(Array.isArray(a))return a.map(e);if("object"==typeof a){const t={};for(let c in a)t[c]=e(a[c]);return t}return a}},71293:(e,a,t)=>{var c=t(62045).hp;a.code=new c("AGFzbQEAAAABPApgAn9/AGABfwBgAX8Bf2ACf38Bf2ADf39/AX9gA39/fwBgA39+fwBgAn9+AGAEf39/fwBgBX9/f39/AAIQAQNlbnYGbWVtb3J5AgDoBwNsawABAgEDAwQEBQUGBwgFBQUAAAUFAAAAAQUFAAAFBQAAAAEFAAIBAAAFAAUAAAAIAQIAAgUICQgABQkDAAUFBQUAAgUFCAAIAgEBAAUFBQAAAAMAAgEAAAUABQAAAAgBAgACBQgJCAAFCQgIB8gJYghpbnRfY29weQAACGludF96ZXJvAAEHaW50X29uZQADCmludF9pc1plcm8AAgZpbnRfZXEABAdpbnRfZ3RlAAUHaW50X2FkZAAGB2ludF9zdWIABwppbnRfbXVsT2xkAAkHaW50X211bAAIB2ludF9kaXYADA5pbnRfaW52ZXJzZU1vZAANB2YxbV9hZGQADgdmMW1fc3ViAA8HZjFtX25lZwAQC2YxbV9tUmVkdWN0ABEHZjFtX211bAASCmYxbV9tdWxPbGQAExJmMW1fZnJvbU1vbnRnb21lcnkAFRBmMW1fdG9Nb250Z29tZXJ5ABQLZjFtX2ludmVyc2UAFghmMW1fY29weQAACGYxbV96ZXJvAAEKZjFtX2lzWmVybwACBmYxbV9lcQAEB2YxbV9vbmUAFwdmcm1fYWRkABgHZnJtX3N1YgAZB2ZybV9uZWcAGgtmcm1fbVJlZHVjdAAbB2ZybV9tdWwAHApmcm1fbXVsT2xkAB0SZnJtX2Zyb21Nb250Z29tZXJ5AB8QZnJtX3RvTW9udGdvbWVyeQAeC2ZybV9pbnZlcnNlACAIZnJtX2NvcHkAAAhmcm1femVybwABCmZybV9pc1plcm8AAgZmcm1fZXEABAdmcm1fb25lACEGZnJfYWRkABgGZnJfc3ViABkGZnJfbmVnABoGZnJfbXVsACIKZnJfaW52ZXJzZQAjB2ZyX2NvcHkAAAdmcl96ZXJvAAEGZnJfb25lACEJZnJfaXNaZXJvAAIFZnJfZXEABAlnMV9pc1plcm8AJAdnMV9jb3B5ACYHZzFfemVybwAlCWcxX2RvdWJsZQAnBmcxX2FkZAAoBmcxX25lZwApBmcxX3N1YgAqEWcxX2Zyb21Nb250Z29tZXJ5ACsPZzFfdG9Nb250Z29tZXJ5ACwJZzFfYWZmaW5lAC0OZzFfdGltZXNTY2FsYXIALgtnMV9tdWx0aWV4cAA1DGcxX211bHRpZXhwMgA5B2ZmdF9mZnQAQghmZnRfaWZmdABDEWZmdF90b01vbnRnb21lcnlOAD8TZmZ0X2Zyb21Nb250Z29tZXJ5TgA+FGZmdF9jb3B5TkludGVybGVhdmVkAD0IZmZ0X211bE4ARAhwb2xfemVybwBFD3BvbF9jb25zdHJ1Y3RMQwBGCmYybV9pc1plcm8ARwhmMm1femVybwBIB2YybV9vbmUASQhmMm1fY29weQBKB2YybV9tdWwASwdmMm1fYWRkAEwHZjJtX3N1YgBNB2YybV9uZWcAThJmMm1fZnJvbU1vbnRnb21lcnkAUBBmMm1fdG9Nb250Z29tZXJ5AE8GZjJtX2VxAFELZjJtX2ludmVyc2UAUglnMl9pc1plcm8AUwdnMl9jb3B5AFUHZzJfemVybwBUCWcyX2RvdWJsZQBWBmcyX2FkZABXBmcyX25lZwBYBmcyX3N1YgBZEWcyX2Zyb21Nb250Z29tZXJ5AFoPZzJfdG9Nb250Z29tZXJ5AFsJZzJfYWZmaW5lAFwOZzJfdGltZXNTY2FsYXIAXQtnMl9tdWx0aWV4cABkDGcyX211bHRpZXhwMgBoDHRlc3RfZjFtX211bABpD3Rlc3RfZjFtX211bE9sZABqCsfEAWsqACABIAApAwA3AwAgASAAKQMINwMIIAEgACkDEDcDECABIAApAxg3AxgLHgAgAEIANwMAIABCADcDCCAAQgA3AxAgAEIANwMYCzMAIAApAxhQBEAgACkDEFAEQCAAKQMIUARAIAApAwBQDwVBAA8LBUEADwsFQQAPC0EADwseACAAQgE3AwAgAEIANwMIIABCADcDECAAQgA3AxgLRwAgACkDGCABKQMYUQRAIAApAxAgASkDEFEEQCAAKQMIIAEpAwhRBEAgACkDACABKQMAUQ8FQQAPCwVBAA8LBUEADwtBAA8LfQAgACkDGCABKQMYVARAQQAPBSAAKQMYIAEpAxhWBEBBAQ8FIAApAxAgASkDEFQEQEEADwUgACkDECABKQMQVgRAQQEPBSAAKQMIIAEpAwhUBEBBAA8FIAApAwggASkDCFYEQEEBDwUgACkDACABKQMAWg8LCwsLCwtBAA8L1AEBAX4gADUCACABNQIAfCEDIAIgAz4CACAANQIEIAE1AgR8IANCIIh8IQMgAiADPgIEIAA1AgggATUCCHwgA0IgiHwhAyACIAM+AgggADUCDCABNQIMfCADQiCIfCEDIAIgAz4CDCAANQIQIAE1AhB8IANCIIh8IQMgAiADPgIQIAA1AhQgATUCFHwgA0IgiHwhAyACIAM+AhQgADUCGCABNQIYfCADQiCIfCEDIAIgAz4CGCAANQIcIAE1Ahx8IANCIIh8IQMgAiADPgIcIANCIIinC4wCAQF+IAA1AgAgATUCAH0hAyACIANC/////w+DPgIAIAA1AgQgATUCBH0gA0Igh3whAyACIANC/////w+DPgIEIAA1AgggATUCCH0gA0Igh3whAyACIANC/////w+DPgIIIAA1AgwgATUCDH0gA0Igh3whAyACIANC/////w+DPgIMIAA1AhAgATUCEH0gA0Igh3whAyACIANC/////w+DPgIQIAA1AhQgATUCFH0gA0Igh3whAyACIANC/////w+DPgIUIAA1AhggATUCGH0gA0Igh3whAyACIANC/////w+DPgIYIAA1AhwgATUCHH0gA0Igh3whAyACIANC/////w+DPgIcIANCIIenC48QEgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfiADQv////8PgyAANQIAIgUgATUCACIGfnwhAyAEIANCIIh8IQQgAiADPgIAIARCIIghAyAEQv////8PgyAFIAE1AgQiCH58IQQgAyAEQiCIfCEDIARC/////w+DIAA1AgQiByAGfnwhBCADIARCIIh8IQMgAiAEPgIEIANCIIghBCADQv////8PgyAFIAE1AggiCn58IQMgBCADQiCIfCEEIANC/////w+DIAcgCH58IQMgBCADQiCIfCEEIANC/////w+DIAA1AggiCSAGfnwhAyAEIANCIIh8IQQgAiADPgIIIARCIIghAyAEQv////8PgyAFIAE1AgwiDH58IQQgAyAEQiCIfCEDIARC/////w+DIAcgCn58IQQgAyAEQiCIfCEDIARC/////w+DIAkgCH58IQQgAyAEQiCIfCEDIARC/////w+DIAA1AgwiCyAGfnwhBCADIARCIIh8IQMgAiAEPgIMIANCIIghBCADQv////8PgyAFIAE1AhAiDn58IQMgBCADQiCIfCEEIANC/////w+DIAcgDH58IQMgBCADQiCIfCEEIANC/////w+DIAkgCn58IQMgBCADQiCIfCEEIANC/////w+DIAsgCH58IQMgBCADQiCIfCEEIANC/////w+DIAA1AhAiDSAGfnwhAyAEIANCIIh8IQQgAiADPgIQIARCIIghAyAEQv////8PgyAFIAE1AhQiEH58IQQgAyAEQiCIfCEDIARC/////w+DIAcgDn58IQQgAyAEQiCIfCEDIARC/////w+DIAkgDH58IQQgAyAEQiCIfCEDIARC/////w+DIAsgCn58IQQgAyAEQiCIfCEDIARC/////w+DIA0gCH58IQQgAyAEQiCIfCEDIARC/////w+DIAA1AhQiDyAGfnwhBCADIARCIIh8IQMgAiAEPgIUIANCIIghBCADQv////8PgyAFIAE1AhgiEn58IQMgBCADQiCIfCEEIANC/////w+DIAcgEH58IQMgBCADQiCIfCEEIANC/////w+DIAkgDn58IQMgBCADQiCIfCEEIANC/////w+DIAsgDH58IQMgBCADQiCIfCEEIANC/////w+DIA0gCn58IQMgBCADQiCIfCEEIANC/////w+DIA8gCH58IQMgBCADQiCIfCEEIANC/////w+DIAA1AhgiESAGfnwhAyAEIANCIIh8IQQgAiADPgIYIARCIIghAyAEQv////8PgyAFIAE1AhwiFH58IQQgAyAEQiCIfCEDIARC/////w+DIAcgEn58IQQgAyAEQiCIfCEDIARC/////w+DIAkgEH58IQQgAyAEQiCIfCEDIARC/////w+DIAsgDn58IQQgAyAEQiCIfCEDIARC/////w+DIA0gDH58IQQgAyAEQiCIfCEDIARC/////w+DIA8gCn58IQQgAyAEQiCIfCEDIARC/////w+DIBEgCH58IQQgAyAEQiCIfCEDIARC/////w+DIAA1AhwiEyAGfnwhBCADIARCIIh8IQMgAiAEPgIcIANCIIghBCADQv////8PgyAHIBR+fCEDIAQgA0IgiHwhBCADQv////8PgyAJIBJ+fCEDIAQgA0IgiHwhBCADQv////8PgyALIBB+fCEDIAQgA0IgiHwhBCADQv////8PgyANIA5+fCEDIAQgA0IgiHwhBCADQv////8PgyAPIAx+fCEDIAQgA0IgiHwhBCADQv////8PgyARIAp+fCEDIAQgA0IgiHwhBCADQv////8PgyATIAh+fCEDIAQgA0IgiHwhBCACIAM+AiAgBEIgiCEDIARC/////w+DIAkgFH58IQQgAyAEQiCIfCEDIARC/////w+DIAsgEn58IQQgAyAEQiCIfCEDIARC/////w+DIA0gEH58IQQgAyAEQiCIfCEDIARC/////w+DIA8gDn58IQQgAyAEQiCIfCEDIARC/////w+DIBEgDH58IQQgAyAEQiCIfCEDIARC/////w+DIBMgCn58IQQgAyAEQiCIfCEDIAIgBD4CJCADQiCIIQQgA0L/////D4MgCyAUfnwhAyAEIANCIIh8IQQgA0L/////D4MgDSASfnwhAyAEIANCIIh8IQQgA0L/////D4MgDyAQfnwhAyAEIANCIIh8IQQgA0L/////D4MgESAOfnwhAyAEIANCIIh8IQQgA0L/////D4MgEyAMfnwhAyAEIANCIIh8IQQgAiADPgIoIARCIIghAyAEQv////8PgyANIBR+fCEEIAMgBEIgiHwhAyAEQv////8PgyAPIBJ+fCEEIAMgBEIgiHwhAyAEQv////8PgyARIBB+fCEEIAMgBEIgiHwhAyAEQv////8PgyATIA5+fCEEIAMgBEIgiHwhAyACIAQ+AiwgA0IgiCEEIANC/////w+DIA8gFH58IQMgBCADQiCIfCEEIANC/////w+DIBEgEn58IQMgBCADQiCIfCEEIANC/////w+DIBMgEH58IQMgBCADQiCIfCEEIAIgAz4CMCAEQiCIIQMgBEL/////D4MgESAUfnwhBCADIARCIIh8IQMgBEL/////D4MgEyASfnwhBCADIARCIIh8IQMgAiAEPgI0IANCIIghBCADQv////8PgyATIBR+fCEDIAQgA0IgiHwhBCACIAM+AjggBEIgiCEDIAIgBD4CPAv0EAEBfkEoIAA1AgAgATUCAH43AwBBKCAANQIAIAE1AgR+NwMIQSggADUCACABNQIIfjcDEEEoIAA1AgAgATUCDH43AxhBKCAANQIAIAE1AhB+NwMgQSggADUCACABNQIUfjcDKEEoIAA1AgAgATUCGH43AzBBKCAANQIAIAE1Ahx+NwM4QSggADUCBCABNQIAfjcDQEEoIAA1AgQgATUCBH43A0hBKCAANQIEIAE1Agh+NwNQQSggADUCBCABNQIMfjcDWEEoIAA1AgQgATUCEH43A2BBKCAANQIEIAE1AhR+NwNoQSggADUCBCABNQIYfjcDcEEoIAA1AgQgATUCHH43A3hBKCAANQIIIAE1AgB+NwOAAUEoIAA1AgggATUCBH43A4gBQSggADUCCCABNQIIfjcDkAFBKCAANQIIIAE1Agx+NwOYAUEoIAA1AgggATUCEH43A6ABQSggADUCCCABNQIUfjcDqAFBKCAANQIIIAE1Ahh+NwOwAUEoIAA1AgggATUCHH43A7gBQSggADUCDCABNQIAfjcDwAFBKCAANQIMIAE1AgR+NwPIAUEoIAA1AgwgATUCCH43A9ABQSggADUCDCABNQIMfjcD2AFBKCAANQIMIAE1AhB+NwPgAUEoIAA1AgwgATUCFH43A+gBQSggADUCDCABNQIYfjcD8AFBKCAANQIMIAE1Ahx+NwP4AUEoIAA1AhAgATUCAH43A4ACQSggADUCECABNQIEfjcDiAJBKCAANQIQIAE1Agh+NwOQAkEoIAA1AhAgATUCDH43A5gCQSggADUCECABNQIQfjcDoAJBKCAANQIQIAE1AhR+NwOoAkEoIAA1AhAgATUCGH43A7ACQSggADUCECABNQIcfjcDuAJBKCAANQIUIAE1AgB+NwPAAkEoIAA1AhQgATUCBH43A8gCQSggADUCFCABNQIIfjcD0AJBKCAANQIUIAE1Agx+NwPYAkEoIAA1AhQgATUCEH43A+ACQSggADUCFCABNQIUfjcD6AJBKCAANQIUIAE1Ahh+NwPwAkEoIAA1AhQgATUCHH43A/gCQSggADUCGCABNQIAfjcDgANBKCAANQIYIAE1AgR+NwOIA0EoIAA1AhggATUCCH43A5ADQSggADUCGCABNQIMfjcDmANBKCAANQIYIAE1AhB+NwOgA0EoIAA1AhggATUCFH43A6gDQSggADUCGCABNQIYfjcDsANBKCAANQIYIAE1Ahx+NwO4A0EoIAA1AhwgATUCAH43A8ADQSggADUCHCABNQIEfjcDyANBKCAANQIcIAE1Agh+NwPQA0EoIAA1AhwgATUCDH43A9gDQSggADUCHCABNQIQfjcD4ANBKCAANQIcIAE1AhR+NwPoA0EoIAA1AhwgATUCGH43A/ADQSggADUCHCABNQIcfjcD+AMgA0IgiEEoNQIAfCEDIAIgAz4CACADQiCIQSg1AgR8QSg1Agh8QSg1AkB8IQMgAiADPgIEIANCIIhBKDUCDHxBKDUCRHxBKDUCEHxBKDUCSHxBKDUCgAF8IQMgAiADPgIIIANCIIhBKDUCFHxBKDUCTHxBKDUChAF8QSg1Ahh8QSg1AlB8QSg1AogBfEEoNQLAAXwhAyACIAM+AgwgA0IgiEEoNQIcfEEoNQJUfEEoNQKMAXxBKDUCxAF8QSg1AiB8QSg1Alh8QSg1ApABfEEoNQLIAXxBKDUCgAJ8IQMgAiADPgIQIANCIIhBKDUCJHxBKDUCXHxBKDUClAF8QSg1AswBfEEoNQKEAnxBKDUCKHxBKDUCYHxBKDUCmAF8QSg1AtABfEEoNQKIAnxBKDUCwAJ8IQMgAiADPgIUIANCIIhBKDUCLHxBKDUCZHxBKDUCnAF8QSg1AtQBfEEoNQKMAnxBKDUCxAJ8QSg1AjB8QSg1Amh8QSg1AqABfEEoNQLYAXxBKDUCkAJ8QSg1AsgCfEEoNQKAA3whAyACIAM+AhggA0IgiEEoNQI0fEEoNQJsfEEoNQKkAXxBKDUC3AF8QSg1ApQCfEEoNQLMAnxBKDUChAN8QSg1Ajh8QSg1AnB8QSg1AqgBfEEoNQLgAXxBKDUCmAJ8QSg1AtACfEEoNQKIA3xBKDUCwAN8IQMgAiADPgIcIANCIIhBKDUCPHxBKDUCdHxBKDUCrAF8QSg1AuQBfEEoNQKcAnxBKDUC1AJ8QSg1AowDfEEoNQLEA3xBKDUCeHxBKDUCsAF8QSg1AugBfEEoNQKgAnxBKDUC2AJ8QSg1ApADfEEoNQLIA3whAyACIAM+AiAgA0IgiEEoNQJ8fEEoNQK0AXxBKDUC7AF8QSg1AqQCfEEoNQLcAnxBKDUClAN8QSg1AswDfEEoNQK4AXxBKDUC8AF8QSg1AqgCfEEoNQLgAnxBKDUCmAN8QSg1AtADfCEDIAIgAz4CJCADQiCIQSg1ArwBfEEoNQL0AXxBKDUCrAJ8QSg1AuQCfEEoNQKcA3xBKDUC1AN8QSg1AvgBfEEoNQKwAnxBKDUC6AJ8QSg1AqADfEEoNQLYA3whAyACIAM+AiggA0IgiEEoNQL8AXxBKDUCtAJ8QSg1AuwCfEEoNQKkA3xBKDUC3AN8QSg1ArgCfEEoNQLwAnxBKDUCqAN8QSg1AuADfCEDIAIgAz4CLCADQiCIQSg1ArwCfEEoNQL0AnxBKDUCrAN8QSg1AuQDfEEoNQL4AnxBKDUCsAN8QSg1AugDfCEDIAIgAz4CMCADQiCIQSg1AvwCfEEoNQK0A3xBKDUC7AN8QSg1ArgDfEEoNQLwA3whAyACIAM+AjQgA0IgiEEoNQK8A3xBKDUC9AN8QSg1AvgDfCEDIAIgAz4COCADQiCIQSg1AvwDfCEDIAIgAz4CPAu2AQEBfiAANQAAIAF+IQMgAiADPgAAIAA1AAQgAX4gA0IgiHwhAyACIAM+AAQgADUACCABfiADQiCIfCEDIAIgAz4ACCAANQAMIAF+IANCIIh8IQMgAiADPgAMIAA1ABAgAX4gA0IgiHwhAyACIAM+ABAgADUAFCABfiADQiCIfCEDIAIgAz4AFCAANQAYIAF+IANCIIh8IQMgAiADPgAYIAA1ABwgAX4gA0IgiHwhAyACIAM+ABwLTgIBfgF/IAAhAyADNQAAIAF8IQIgAyACPgAAIAJCIIghAgJAA0AgAlANASADQQRqIQMgAzUAACACfCECIAMgAj4AACACQiCIIQIMAAsLC7ACBwF/AX8BfwF/AX4BfgF/IAIEQCACIQUFQcgEIQULIAMEQCADIQQFQegEIQQLIAAgBBAAIAFBqAQQACAFEAFBiAUQAUEfIQZBHyEHAkADQEGoBCAHai0AACAHQQNGcg0BIAdBAWshBwwACwtBqAQgB2pBA2s1AABCAXwhCCAIQgFRBEBCAEIAgBoLAkADQAJAA0AgBCAGai0AACAGQQdGcg0BIAZBAWshBgwACwsgBCAGakEHaykAACEJIAkgCIAhCSAGIAdrQQRrIQoCQANAIAlCgICAgHCDUCAKQQBOcQ0BIAlCCIghCSAKQQFqIQoMAAsLIAlQBEAgBEGoBBAFRQ0CQgEhCUEAIQoLQagEIAlBqAUQCiAEQagFIAprIAQQBxogBSAKaiAJEAsMAAsLC7UCCwF/AX8BfwF/AX8BfwF/AX8BfwF/AX9ByAUhA0HIBRABQQAhC0HoBSEFIAFB6AUQAEGIBiEEQYgGEANBACEMQagGIQggAEGoBhAAQcgGIQZB6AYhB0HIByEKAkADQCAIEAINASAFIAggBiAHEAwgBiAEQYgHEAggCwRAIAwEQEGIByADEAUEQEGIByADIAoQBxpBACENBSADQYgHIAoQBxpBASENCwVBiAcgAyAKEAYaQQEhDQsFIAwEQEGIByADIAoQBhpBACENBSADQYgHEAUEQCADQYgHIAoQBxpBACENBUGIByADIAoQBxpBASENCwsLIAMhCSAEIQMgCiEEIAkhCiAMIQsgDSEMIAUhCSAIIQUgByEIIAkhBwwACwsgCwRAIAEgAyACEAcaBSADIAIQAAsLLAAgACABIAIQBgRAIAJB6AcgAhAHGgUgAkHoBxAFBEAgAkHoByACEAcaCwsLFwAgACABIAIQBwRAIAJB6AcgAhAGGgsLFAAgABACRQRAQegHIAAgARAHGgsLnBEDAX4BfgF+QonHmaQOIQJCACEDIAA1AgAgAn5C/////w+DIQQgADUCACADQiCIfEHoBzUCACAEfnwhAyAAIAM+AgAgADUCBCADQiCIfEHoBzUCBCAEfnwhAyAAIAM+AgQgADUCCCADQiCIfEHoBzUCCCAEfnwhAyAAIAM+AgggADUCDCADQiCIfEHoBzUCDCAEfnwhAyAAIAM+AgwgADUCECADQiCIfEHoBzUCECAEfnwhAyAAIAM+AhAgADUCFCADQiCIfEHoBzUCFCAEfnwhAyAAIAM+AhQgADUCGCADQiCIfEHoBzUCGCAEfnwhAyAAIAM+AhggADUCHCADQiCIfEHoBzUCHCAEfnwhAyAAIAM+AhxB6AggA0IgiD4CAEIAIQMgADUCBCACfkL/////D4MhBCAANQIEIANCIIh8QegHNQIAIAR+fCEDIAAgAz4CBCAANQIIIANCIIh8QegHNQIEIAR+fCEDIAAgAz4CCCAANQIMIANCIIh8QegHNQIIIAR+fCEDIAAgAz4CDCAANQIQIANCIIh8QegHNQIMIAR+fCEDIAAgAz4CECAANQIUIANCIIh8QegHNQIQIAR+fCEDIAAgAz4CFCAANQIYIANCIIh8QegHNQIUIAR+fCEDIAAgAz4CGCAANQIcIANCIIh8QegHNQIYIAR+fCEDIAAgAz4CHCAANQIgIANCIIh8QegHNQIcIAR+fCEDIAAgAz4CIEHoCCADQiCIPgIEQgAhAyAANQIIIAJ+Qv////8PgyEEIAA1AgggA0IgiHxB6Ac1AgAgBH58IQMgACADPgIIIAA1AgwgA0IgiHxB6Ac1AgQgBH58IQMgACADPgIMIAA1AhAgA0IgiHxB6Ac1AgggBH58IQMgACADPgIQIAA1AhQgA0IgiHxB6Ac1AgwgBH58IQMgACADPgIUIAA1AhggA0IgiHxB6Ac1AhAgBH58IQMgACADPgIYIAA1AhwgA0IgiHxB6Ac1AhQgBH58IQMgACADPgIcIAA1AiAgA0IgiHxB6Ac1AhggBH58IQMgACADPgIgIAA1AiQgA0IgiHxB6Ac1AhwgBH58IQMgACADPgIkQegIIANCIIg+AghCACEDIAA1AgwgAn5C/////w+DIQQgADUCDCADQiCIfEHoBzUCACAEfnwhAyAAIAM+AgwgADUCECADQiCIfEHoBzUCBCAEfnwhAyAAIAM+AhAgADUCFCADQiCIfEHoBzUCCCAEfnwhAyAAIAM+AhQgADUCGCADQiCIfEHoBzUCDCAEfnwhAyAAIAM+AhggADUCHCADQiCIfEHoBzUCECAEfnwhAyAAIAM+AhwgADUCICADQiCIfEHoBzUCFCAEfnwhAyAAIAM+AiAgADUCJCADQiCIfEHoBzUCGCAEfnwhAyAAIAM+AiQgADUCKCADQiCIfEHoBzUCHCAEfnwhAyAAIAM+AihB6AggA0IgiD4CDEIAIQMgADUCECACfkL/////D4MhBCAANQIQIANCIIh8QegHNQIAIAR+fCEDIAAgAz4CECAANQIUIANCIIh8QegHNQIEIAR+fCEDIAAgAz4CFCAANQIYIANCIIh8QegHNQIIIAR+fCEDIAAgAz4CGCAANQIcIANCIIh8QegHNQIMIAR+fCEDIAAgAz4CHCAANQIgIANCIIh8QegHNQIQIAR+fCEDIAAgAz4CICAANQIkIANCIIh8QegHNQIUIAR+fCEDIAAgAz4CJCAANQIoIANCIIh8QegHNQIYIAR+fCEDIAAgAz4CKCAANQIsIANCIIh8QegHNQIcIAR+fCEDIAAgAz4CLEHoCCADQiCIPgIQQgAhAyAANQIUIAJ+Qv////8PgyEEIAA1AhQgA0IgiHxB6Ac1AgAgBH58IQMgACADPgIUIAA1AhggA0IgiHxB6Ac1AgQgBH58IQMgACADPgIYIAA1AhwgA0IgiHxB6Ac1AgggBH58IQMgACADPgIcIAA1AiAgA0IgiHxB6Ac1AgwgBH58IQMgACADPgIgIAA1AiQgA0IgiHxB6Ac1AhAgBH58IQMgACADPgIkIAA1AiggA0IgiHxB6Ac1AhQgBH58IQMgACADPgIoIAA1AiwgA0IgiHxB6Ac1AhggBH58IQMgACADPgIsIAA1AjAgA0IgiHxB6Ac1AhwgBH58IQMgACADPgIwQegIIANCIIg+AhRCACEDIAA1AhggAn5C/////w+DIQQgADUCGCADQiCIfEHoBzUCACAEfnwhAyAAIAM+AhggADUCHCADQiCIfEHoBzUCBCAEfnwhAyAAIAM+AhwgADUCICADQiCIfEHoBzUCCCAEfnwhAyAAIAM+AiAgADUCJCADQiCIfEHoBzUCDCAEfnwhAyAAIAM+AiQgADUCKCADQiCIfEHoBzUCECAEfnwhAyAAIAM+AiggADUCLCADQiCIfEHoBzUCFCAEfnwhAyAAIAM+AiwgADUCMCADQiCIfEHoBzUCGCAEfnwhAyAAIAM+AjAgADUCNCADQiCIfEHoBzUCHCAEfnwhAyAAIAM+AjRB6AggA0IgiD4CGEIAIQMgADUCHCACfkL/////D4MhBCAANQIcIANCIIh8QegHNQIAIAR+fCEDIAAgAz4CHCAANQIgIANCIIh8QegHNQIEIAR+fCEDIAAgAz4CICAANQIkIANCIIh8QegHNQIIIAR+fCEDIAAgAz4CJCAANQIoIANCIIh8QegHNQIMIAR+fCEDIAAgAz4CKCAANQIsIANCIIh8QegHNQIQIAR+fCEDIAAgAz4CLCAANQIwIANCIIh8QegHNQIUIAR+fCEDIAAgAz4CMCAANQI0IANCIIh8QegHNQIYIAR+fCEDIAAgAz4CNCAANQI4IANCIIh8QegHNQIcIAR+fCEDIAAgAz4COEHoCCADQiCIPgIcQegIIABBIGogARAOC74fIwF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX5CiceZpA4hBSADQv////8PgyAANQIAIgYgATUCACIHfnwhAyAEIANCIIh8IQQgA0L/////D4MgBX5C/////w+DIQggA0L/////D4NBADUC6AciCSAIfnwhAyAEIANCIIh8IQQgBEIgiCEDIARC/////w+DIAYgATUCBCILfnwhBCADIARCIIh8IQMgBEL/////D4MgADUCBCIKIAd+fCEEIAMgBEIgiHwhAyAEQv////8Pg0EANQLsByINIAh+fCEEIAMgBEIgiHwhAyAEQv////8PgyAFfkL/////D4MhDCAEQv////8PgyAJIAx+fCEEIAMgBEIgiHwhAyADQiCIIQQgA0L/////D4MgBiABNQIIIg9+fCEDIAQgA0IgiHwhBCADQv////8PgyAKIAt+fCEDIAQgA0IgiHwhBCADQv////8PgyAANQIIIg4gB358IQMgBCADQiCIfCEEIANC/////w+DIA0gDH58IQMgBCADQiCIfCEEIANC/////w+DQQA1AvAHIhEgCH58IQMgBCADQiCIfCEEIANC/////w+DIAV+Qv////8PgyEQIANC/////w+DIAkgEH58IQMgBCADQiCIfCEEIARCIIghAyAEQv////8PgyAGIAE1AgwiE358IQQgAyAEQiCIfCEDIARC/////w+DIAogD358IQQgAyAEQiCIfCEDIARC/////w+DIA4gC358IQQgAyAEQiCIfCEDIARC/////w+DIAA1AgwiEiAHfnwhBCADIARCIIh8IQMgBEL/////D4MgDSAQfnwhBCADIARCIIh8IQMgBEL/////D4MgESAMfnwhBCADIARCIIh8IQMgBEL/////D4NBADUC9AciFSAIfnwhBCADIARCIIh8IQMgBEL/////D4MgBX5C/////w+DIRQgBEL/////D4MgCSAUfnwhBCADIARCIIh8IQMgA0IgiCEEIANC/////w+DIAYgATUCECIXfnwhAyAEIANCIIh8IQQgA0L/////D4MgCiATfnwhAyAEIANCIIh8IQQgA0L/////D4MgDiAPfnwhAyAEIANCIIh8IQQgA0L/////D4MgEiALfnwhAyAEIANCIIh8IQQgA0L/////D4MgADUCECIWIAd+fCEDIAQgA0IgiHwhBCADQv////8PgyANIBR+fCEDIAQgA0IgiHwhBCADQv////8PgyARIBB+fCEDIAQgA0IgiHwhBCADQv////8PgyAVIAx+fCEDIAQgA0IgiHwhBCADQv////8Pg0EANQL4ByIZIAh+fCEDIAQgA0IgiHwhBCADQv////8PgyAFfkL/////D4MhGCADQv////8PgyAJIBh+fCEDIAQgA0IgiHwhBCAEQiCIIQMgBEL/////D4MgBiABNQIUIht+fCEEIAMgBEIgiHwhAyAEQv////8PgyAKIBd+fCEEIAMgBEIgiHwhAyAEQv////8PgyAOIBN+fCEEIAMgBEIgiHwhAyAEQv////8PgyASIA9+fCEEIAMgBEIgiHwhAyAEQv////8PgyAWIAt+fCEEIAMgBEIgiHwhAyAEQv////8PgyAANQIUIhogB358IQQgAyAEQiCIfCEDIARC/////w+DIA0gGH58IQQgAyAEQiCIfCEDIARC/////w+DIBEgFH58IQQgAyAEQiCIfCEDIARC/////w+DIBUgEH58IQQgAyAEQiCIfCEDIARC/////w+DIBkgDH58IQQgAyAEQiCIfCEDIARC/////w+DQQA1AvwHIh0gCH58IQQgAyAEQiCIfCEDIARC/////w+DIAV+Qv////8PgyEcIARC/////w+DIAkgHH58IQQgAyAEQiCIfCEDIANCIIghBCADQv////8PgyAGIAE1AhgiH358IQMgBCADQiCIfCEEIANC/////w+DIAogG358IQMgBCADQiCIfCEEIANC/////w+DIA4gF358IQMgBCADQiCIfCEEIANC/////w+DIBIgE358IQMgBCADQiCIfCEEIANC/////w+DIBYgD358IQMgBCADQiCIfCEEIANC/////w+DIBogC358IQMgBCADQiCIfCEEIANC/////w+DIAA1AhgiHiAHfnwhAyAEIANCIIh8IQQgA0L/////D4MgDSAcfnwhAyAEIANCIIh8IQQgA0L/////D4MgESAYfnwhAyAEIANCIIh8IQQgA0L/////D4MgFSAUfnwhAyAEIANCIIh8IQQgA0L/////D4MgGSAQfnwhAyAEIANCIIh8IQQgA0L/////D4MgHSAMfnwhAyAEIANCIIh8IQQgA0L/////D4NBADUCgAgiISAIfnwhAyAEIANCIIh8IQQgA0L/////D4MgBX5C/////w+DISAgA0L/////D4MgCSAgfnwhAyAEIANCIIh8IQQgBEIgiCEDIARC/////w+DIAYgATUCHCIjfnwhBCADIARCIIh8IQMgBEL/////D4MgCiAffnwhBCADIARCIIh8IQMgBEL/////D4MgDiAbfnwhBCADIARCIIh8IQMgBEL/////D4MgEiAXfnwhBCADIARCIIh8IQMgBEL/////D4MgFiATfnwhBCADIARCIIh8IQMgBEL/////D4MgGiAPfnwhBCADIARCIIh8IQMgBEL/////D4MgHiALfnwhBCADIARCIIh8IQMgBEL/////D4MgADUCHCIiIAd+fCEEIAMgBEIgiHwhAyAEQv////8PgyANICB+fCEEIAMgBEIgiHwhAyAEQv////8PgyARIBx+fCEEIAMgBEIgiHwhAyAEQv////8PgyAVIBh+fCEEIAMgBEIgiHwhAyAEQv////8PgyAZIBR+fCEEIAMgBEIgiHwhAyAEQv////8PgyAdIBB+fCEEIAMgBEIgiHwhAyAEQv////8PgyAhIAx+fCEEIAMgBEIgiHwhAyAEQv////8Pg0EANQKECCIlIAh+fCEEIAMgBEIgiHwhAyAEQv////8PgyAFfkL/////D4MhJCAEQv////8PgyAJICR+fCEEIAMgBEIgiHwhAyADQiCIIQQgA0L/////D4MgCiAjfnwhAyAEIANCIIh8IQQgA0L/////D4MgDiAffnwhAyAEIANCIIh8IQQgA0L/////D4MgEiAbfnwhAyAEIANCIIh8IQQgA0L/////D4MgFiAXfnwhAyAEIANCIIh8IQQgA0L/////D4MgGiATfnwhAyAEIANCIIh8IQQgA0L/////D4MgHiAPfnwhAyAEIANCIIh8IQQgA0L/////D4MgIiALfnwhAyAEIANCIIh8IQQgA0L/////D4MgDSAkfnwhAyAEIANCIIh8IQQgA0L/////D4MgESAgfnwhAyAEIANCIIh8IQQgA0L/////D4MgFSAcfnwhAyAEIANCIIh8IQQgA0L/////D4MgGSAYfnwhAyAEIANCIIh8IQQgA0L/////D4MgHSAUfnwhAyAEIANCIIh8IQQgA0L/////D4MgISAQfnwhAyAEIANCIIh8IQQgA0L/////D4MgJSAMfnwhAyAEIANCIIh8IQQgAiADPgIAIARCIIghAyAEQv////8PgyAOICN+fCEEIAMgBEIgiHwhAyAEQv////8PgyASIB9+fCEEIAMgBEIgiHwhAyAEQv////8PgyAWIBt+fCEEIAMgBEIgiHwhAyAEQv////8PgyAaIBd+fCEEIAMgBEIgiHwhAyAEQv////8PgyAeIBN+fCEEIAMgBEIgiHwhAyAEQv////8PgyAiIA9+fCEEIAMgBEIgiHwhAyAEQv////8PgyARICR+fCEEIAMgBEIgiHwhAyAEQv////8PgyAVICB+fCEEIAMgBEIgiHwhAyAEQv////8PgyAZIBx+fCEEIAMgBEIgiHwhAyAEQv////8PgyAdIBh+fCEEIAMgBEIgiHwhAyAEQv////8PgyAhIBR+fCEEIAMgBEIgiHwhAyAEQv////8PgyAlIBB+fCEEIAMgBEIgiHwhAyACIAQ+AgQgA0IgiCEEIANC/////w+DIBIgI358IQMgBCADQiCIfCEEIANC/////w+DIBYgH358IQMgBCADQiCIfCEEIANC/////w+DIBogG358IQMgBCADQiCIfCEEIANC/////w+DIB4gF358IQMgBCADQiCIfCEEIANC/////w+DICIgE358IQMgBCADQiCIfCEEIANC/////w+DIBUgJH58IQMgBCADQiCIfCEEIANC/////w+DIBkgIH58IQMgBCADQiCIfCEEIANC/////w+DIB0gHH58IQMgBCADQiCIfCEEIANC/////w+DICEgGH58IQMgBCADQiCIfCEEIANC/////w+DICUgFH58IQMgBCADQiCIfCEEIAIgAz4CCCAEQiCIIQMgBEL/////D4MgFiAjfnwhBCADIARCIIh8IQMgBEL/////D4MgGiAffnwhBCADIARCIIh8IQMgBEL/////D4MgHiAbfnwhBCADIARCIIh8IQMgBEL/////D4MgIiAXfnwhBCADIARCIIh8IQMgBEL/////D4MgGSAkfnwhBCADIARCIIh8IQMgBEL/////D4MgHSAgfnwhBCADIARCIIh8IQMgBEL/////D4MgISAcfnwhBCADIARCIIh8IQMgBEL/////D4MgJSAYfnwhBCADIARCIIh8IQMgAiAEPgIMIANCIIghBCADQv////8PgyAaICN+fCEDIAQgA0IgiHwhBCADQv////8PgyAeIB9+fCEDIAQgA0IgiHwhBCADQv////8PgyAiIBt+fCEDIAQgA0IgiHwhBCADQv////8PgyAdICR+fCEDIAQgA0IgiHwhBCADQv////8PgyAhICB+fCEDIAQgA0IgiHwhBCADQv////8PgyAlIBx+fCEDIAQgA0IgiHwhBCACIAM+AhAgBEIgiCEDIARC/////w+DIB4gI358IQQgAyAEQiCIfCEDIARC/////w+DICIgH358IQQgAyAEQiCIfCEDIARC/////w+DICEgJH58IQQgAyAEQiCIfCEDIARC/////w+DICUgIH58IQQgAyAEQiCIfCEDIAIgBD4CFCADQiCIIQQgA0L/////D4MgIiAjfnwhAyAEIANCIIh8IQQgA0L/////D4MgJSAkfnwhAyAEIANCIIh8IQQgAiADPgIYIARCIIghAyACIAQ+AhwgA6cEQCACQegHIAIQBxoFIAJB6AcQBQRAIAJB6AcgAhAHGgsLCxIAIAAgAUHoDBAJQegMIAIQEQsLACAAQYgIIAEQEgsVACAAQagNEABByA0QAUGoDSABEBELFwAgACABEBUgAUHoByABEA0gASABEBQLCQBBqAggABAACywAIAAgASACEAYEQCACQegNIAIQBxoFIAJB6A0QBQRAIAJB6A0gAhAHGgsLCxcAIAAgASACEAcEQCACQegNIAIQBhoLCxQAIAAQAkUEQEHoDSAAIAEQBxoLC5wRAwF+AX4BfkL/////DiECQgAhAyAANQIAIAJ+Qv////8PgyEEIAA1AgAgA0IgiHxB6A01AgAgBH58IQMgACADPgIAIAA1AgQgA0IgiHxB6A01AgQgBH58IQMgACADPgIEIAA1AgggA0IgiHxB6A01AgggBH58IQMgACADPgIIIAA1AgwgA0IgiHxB6A01AgwgBH58IQMgACADPgIMIAA1AhAgA0IgiHxB6A01AhAgBH58IQMgACADPgIQIAA1AhQgA0IgiHxB6A01AhQgBH58IQMgACADPgIUIAA1AhggA0IgiHxB6A01AhggBH58IQMgACADPgIYIAA1AhwgA0IgiHxB6A01AhwgBH58IQMgACADPgIcQegOIANCIIg+AgBCACEDIAA1AgQgAn5C/////w+DIQQgADUCBCADQiCIfEHoDTUCACAEfnwhAyAAIAM+AgQgADUCCCADQiCIfEHoDTUCBCAEfnwhAyAAIAM+AgggADUCDCADQiCIfEHoDTUCCCAEfnwhAyAAIAM+AgwgADUCECADQiCIfEHoDTUCDCAEfnwhAyAAIAM+AhAgADUCFCADQiCIfEHoDTUCECAEfnwhAyAAIAM+AhQgADUCGCADQiCIfEHoDTUCFCAEfnwhAyAAIAM+AhggADUCHCADQiCIfEHoDTUCGCAEfnwhAyAAIAM+AhwgADUCICADQiCIfEHoDTUCHCAEfnwhAyAAIAM+AiBB6A4gA0IgiD4CBEIAIQMgADUCCCACfkL/////D4MhBCAANQIIIANCIIh8QegNNQIAIAR+fCEDIAAgAz4CCCAANQIMIANCIIh8QegNNQIEIAR+fCEDIAAgAz4CDCAANQIQIANCIIh8QegNNQIIIAR+fCEDIAAgAz4CECAANQIUIANCIIh8QegNNQIMIAR+fCEDIAAgAz4CFCAANQIYIANCIIh8QegNNQIQIAR+fCEDIAAgAz4CGCAANQIcIANCIIh8QegNNQIUIAR+fCEDIAAgAz4CHCAANQIgIANCIIh8QegNNQIYIAR+fCEDIAAgAz4CICAANQIkIANCIIh8QegNNQIcIAR+fCEDIAAgAz4CJEHoDiADQiCIPgIIQgAhAyAANQIMIAJ+Qv////8PgyEEIAA1AgwgA0IgiHxB6A01AgAgBH58IQMgACADPgIMIAA1AhAgA0IgiHxB6A01AgQgBH58IQMgACADPgIQIAA1AhQgA0IgiHxB6A01AgggBH58IQMgACADPgIUIAA1AhggA0IgiHxB6A01AgwgBH58IQMgACADPgIYIAA1AhwgA0IgiHxB6A01AhAgBH58IQMgACADPgIcIAA1AiAgA0IgiHxB6A01AhQgBH58IQMgACADPgIgIAA1AiQgA0IgiHxB6A01AhggBH58IQMgACADPgIkIAA1AiggA0IgiHxB6A01AhwgBH58IQMgACADPgIoQegOIANCIIg+AgxCACEDIAA1AhAgAn5C/////w+DIQQgADUCECADQiCIfEHoDTUCACAEfnwhAyAAIAM+AhAgADUCFCADQiCIfEHoDTUCBCAEfnwhAyAAIAM+AhQgADUCGCADQiCIfEHoDTUCCCAEfnwhAyAAIAM+AhggADUCHCADQiCIfEHoDTUCDCAEfnwhAyAAIAM+AhwgADUCICADQiCIfEHoDTUCECAEfnwhAyAAIAM+AiAgADUCJCADQiCIfEHoDTUCFCAEfnwhAyAAIAM+AiQgADUCKCADQiCIfEHoDTUCGCAEfnwhAyAAIAM+AiggADUCLCADQiCIfEHoDTUCHCAEfnwhAyAAIAM+AixB6A4gA0IgiD4CEEIAIQMgADUCFCACfkL/////D4MhBCAANQIUIANCIIh8QegNNQIAIAR+fCEDIAAgAz4CFCAANQIYIANCIIh8QegNNQIEIAR+fCEDIAAgAz4CGCAANQIcIANCIIh8QegNNQIIIAR+fCEDIAAgAz4CHCAANQIgIANCIIh8QegNNQIMIAR+fCEDIAAgAz4CICAANQIkIANCIIh8QegNNQIQIAR+fCEDIAAgAz4CJCAANQIoIANCIIh8QegNNQIUIAR+fCEDIAAgAz4CKCAANQIsIANCIIh8QegNNQIYIAR+fCEDIAAgAz4CLCAANQIwIANCIIh8QegNNQIcIAR+fCEDIAAgAz4CMEHoDiADQiCIPgIUQgAhAyAANQIYIAJ+Qv////8PgyEEIAA1AhggA0IgiHxB6A01AgAgBH58IQMgACADPgIYIAA1AhwgA0IgiHxB6A01AgQgBH58IQMgACADPgIcIAA1AiAgA0IgiHxB6A01AgggBH58IQMgACADPgIgIAA1AiQgA0IgiHxB6A01AgwgBH58IQMgACADPgIkIAA1AiggA0IgiHxB6A01AhAgBH58IQMgACADPgIoIAA1AiwgA0IgiHxB6A01AhQgBH58IQMgACADPgIsIAA1AjAgA0IgiHxB6A01AhggBH58IQMgACADPgIwIAA1AjQgA0IgiHxB6A01AhwgBH58IQMgACADPgI0QegOIANCIIg+AhhCACEDIAA1AhwgAn5C/////w+DIQQgADUCHCADQiCIfEHoDTUCACAEfnwhAyAAIAM+AhwgADUCICADQiCIfEHoDTUCBCAEfnwhAyAAIAM+AiAgADUCJCADQiCIfEHoDTUCCCAEfnwhAyAAIAM+AiQgADUCKCADQiCIfEHoDTUCDCAEfnwhAyAAIAM+AiggADUCLCADQiCIfEHoDTUCECAEfnwhAyAAIAM+AiwgADUCMCADQiCIfEHoDTUCFCAEfnwhAyAAIAM+AjAgADUCNCADQiCIfEHoDTUCGCAEfnwhAyAAIAM+AjQgADUCOCADQiCIfEHoDTUCHCAEfnwhAyAAIAM+AjhB6A4gA0IgiD4CHEHoDiAAQSBqIAEQGAu+HyMBfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+Qv////8OIQUgA0L/////D4MgADUCACIGIAE1AgAiB358IQMgBCADQiCIfCEEIANC/////w+DIAV+Qv////8PgyEIIANC/////w+DQQA1AugNIgkgCH58IQMgBCADQiCIfCEEIARCIIghAyAEQv////8PgyAGIAE1AgQiC358IQQgAyAEQiCIfCEDIARC/////w+DIAA1AgQiCiAHfnwhBCADIARCIIh8IQMgBEL/////D4NBADUC7A0iDSAIfnwhBCADIARCIIh8IQMgBEL/////D4MgBX5C/////w+DIQwgBEL/////D4MgCSAMfnwhBCADIARCIIh8IQMgA0IgiCEEIANC/////w+DIAYgATUCCCIPfnwhAyAEIANCIIh8IQQgA0L/////D4MgCiALfnwhAyAEIANCIIh8IQQgA0L/////D4MgADUCCCIOIAd+fCEDIAQgA0IgiHwhBCADQv////8PgyANIAx+fCEDIAQgA0IgiHwhBCADQv////8Pg0EANQLwDSIRIAh+fCEDIAQgA0IgiHwhBCADQv////8PgyAFfkL/////D4MhECADQv////8PgyAJIBB+fCEDIAQgA0IgiHwhBCAEQiCIIQMgBEL/////D4MgBiABNQIMIhN+fCEEIAMgBEIgiHwhAyAEQv////8PgyAKIA9+fCEEIAMgBEIgiHwhAyAEQv////8PgyAOIAt+fCEEIAMgBEIgiHwhAyAEQv////8PgyAANQIMIhIgB358IQQgAyAEQiCIfCEDIARC/////w+DIA0gEH58IQQgAyAEQiCIfCEDIARC/////w+DIBEgDH58IQQgAyAEQiCIfCEDIARC/////w+DQQA1AvQNIhUgCH58IQQgAyAEQiCIfCEDIARC/////w+DIAV+Qv////8PgyEUIARC/////w+DIAkgFH58IQQgAyAEQiCIfCEDIANCIIghBCADQv////8PgyAGIAE1AhAiF358IQMgBCADQiCIfCEEIANC/////w+DIAogE358IQMgBCADQiCIfCEEIANC/////w+DIA4gD358IQMgBCADQiCIfCEEIANC/////w+DIBIgC358IQMgBCADQiCIfCEEIANC/////w+DIAA1AhAiFiAHfnwhAyAEIANCIIh8IQQgA0L/////D4MgDSAUfnwhAyAEIANCIIh8IQQgA0L/////D4MgESAQfnwhAyAEIANCIIh8IQQgA0L/////D4MgFSAMfnwhAyAEIANCIIh8IQQgA0L/////D4NBADUC+A0iGSAIfnwhAyAEIANCIIh8IQQgA0L/////D4MgBX5C/////w+DIRggA0L/////D4MgCSAYfnwhAyAEIANCIIh8IQQgBEIgiCEDIARC/////w+DIAYgATUCFCIbfnwhBCADIARCIIh8IQMgBEL/////D4MgCiAXfnwhBCADIARCIIh8IQMgBEL/////D4MgDiATfnwhBCADIARCIIh8IQMgBEL/////D4MgEiAPfnwhBCADIARCIIh8IQMgBEL/////D4MgFiALfnwhBCADIARCIIh8IQMgBEL/////D4MgADUCFCIaIAd+fCEEIAMgBEIgiHwhAyAEQv////8PgyANIBh+fCEEIAMgBEIgiHwhAyAEQv////8PgyARIBR+fCEEIAMgBEIgiHwhAyAEQv////8PgyAVIBB+fCEEIAMgBEIgiHwhAyAEQv////8PgyAZIAx+fCEEIAMgBEIgiHwhAyAEQv////8Pg0EANQL8DSIdIAh+fCEEIAMgBEIgiHwhAyAEQv////8PgyAFfkL/////D4MhHCAEQv////8PgyAJIBx+fCEEIAMgBEIgiHwhAyADQiCIIQQgA0L/////D4MgBiABNQIYIh9+fCEDIAQgA0IgiHwhBCADQv////8PgyAKIBt+fCEDIAQgA0IgiHwhBCADQv////8PgyAOIBd+fCEDIAQgA0IgiHwhBCADQv////8PgyASIBN+fCEDIAQgA0IgiHwhBCADQv////8PgyAWIA9+fCEDIAQgA0IgiHwhBCADQv////8PgyAaIAt+fCEDIAQgA0IgiHwhBCADQv////8PgyAANQIYIh4gB358IQMgBCADQiCIfCEEIANC/////w+DIA0gHH58IQMgBCADQiCIfCEEIANC/////w+DIBEgGH58IQMgBCADQiCIfCEEIANC/////w+DIBUgFH58IQMgBCADQiCIfCEEIANC/////w+DIBkgEH58IQMgBCADQiCIfCEEIANC/////w+DIB0gDH58IQMgBCADQiCIfCEEIANC/////w+DQQA1AoAOIiEgCH58IQMgBCADQiCIfCEEIANC/////w+DIAV+Qv////8PgyEgIANC/////w+DIAkgIH58IQMgBCADQiCIfCEEIARCIIghAyAEQv////8PgyAGIAE1AhwiI358IQQgAyAEQiCIfCEDIARC/////w+DIAogH358IQQgAyAEQiCIfCEDIARC/////w+DIA4gG358IQQgAyAEQiCIfCEDIARC/////w+DIBIgF358IQQgAyAEQiCIfCEDIARC/////w+DIBYgE358IQQgAyAEQiCIfCEDIARC/////w+DIBogD358IQQgAyAEQiCIfCEDIARC/////w+DIB4gC358IQQgAyAEQiCIfCEDIARC/////w+DIAA1AhwiIiAHfnwhBCADIARCIIh8IQMgBEL/////D4MgDSAgfnwhBCADIARCIIh8IQMgBEL/////D4MgESAcfnwhBCADIARCIIh8IQMgBEL/////D4MgFSAYfnwhBCADIARCIIh8IQMgBEL/////D4MgGSAUfnwhBCADIARCIIh8IQMgBEL/////D4MgHSAQfnwhBCADIARCIIh8IQMgBEL/////D4MgISAMfnwhBCADIARCIIh8IQMgBEL/////D4NBADUChA4iJSAIfnwhBCADIARCIIh8IQMgBEL/////D4MgBX5C/////w+DISQgBEL/////D4MgCSAkfnwhBCADIARCIIh8IQMgA0IgiCEEIANC/////w+DIAogI358IQMgBCADQiCIfCEEIANC/////w+DIA4gH358IQMgBCADQiCIfCEEIANC/////w+DIBIgG358IQMgBCADQiCIfCEEIANC/////w+DIBYgF358IQMgBCADQiCIfCEEIANC/////w+DIBogE358IQMgBCADQiCIfCEEIANC/////w+DIB4gD358IQMgBCADQiCIfCEEIANC/////w+DICIgC358IQMgBCADQiCIfCEEIANC/////w+DIA0gJH58IQMgBCADQiCIfCEEIANC/////w+DIBEgIH58IQMgBCADQiCIfCEEIANC/////w+DIBUgHH58IQMgBCADQiCIfCEEIANC/////w+DIBkgGH58IQMgBCADQiCIfCEEIANC/////w+DIB0gFH58IQMgBCADQiCIfCEEIANC/////w+DICEgEH58IQMgBCADQiCIfCEEIANC/////w+DICUgDH58IQMgBCADQiCIfCEEIAIgAz4CACAEQiCIIQMgBEL/////D4MgDiAjfnwhBCADIARCIIh8IQMgBEL/////D4MgEiAffnwhBCADIARCIIh8IQMgBEL/////D4MgFiAbfnwhBCADIARCIIh8IQMgBEL/////D4MgGiAXfnwhBCADIARCIIh8IQMgBEL/////D4MgHiATfnwhBCADIARCIIh8IQMgBEL/////D4MgIiAPfnwhBCADIARCIIh8IQMgBEL/////D4MgESAkfnwhBCADIARCIIh8IQMgBEL/////D4MgFSAgfnwhBCADIARCIIh8IQMgBEL/////D4MgGSAcfnwhBCADIARCIIh8IQMgBEL/////D4MgHSAYfnwhBCADIARCIIh8IQMgBEL/////D4MgISAUfnwhBCADIARCIIh8IQMgBEL/////D4MgJSAQfnwhBCADIARCIIh8IQMgAiAEPgIEIANCIIghBCADQv////8PgyASICN+fCEDIAQgA0IgiHwhBCADQv////8PgyAWIB9+fCEDIAQgA0IgiHwhBCADQv////8PgyAaIBt+fCEDIAQgA0IgiHwhBCADQv////8PgyAeIBd+fCEDIAQgA0IgiHwhBCADQv////8PgyAiIBN+fCEDIAQgA0IgiHwhBCADQv////8PgyAVICR+fCEDIAQgA0IgiHwhBCADQv////8PgyAZICB+fCEDIAQgA0IgiHwhBCADQv////8PgyAdIBx+fCEDIAQgA0IgiHwhBCADQv////8PgyAhIBh+fCEDIAQgA0IgiHwhBCADQv////8PgyAlIBR+fCEDIAQgA0IgiHwhBCACIAM+AgggBEIgiCEDIARC/////w+DIBYgI358IQQgAyAEQiCIfCEDIARC/////w+DIBogH358IQQgAyAEQiCIfCEDIARC/////w+DIB4gG358IQQgAyAEQiCIfCEDIARC/////w+DICIgF358IQQgAyAEQiCIfCEDIARC/////w+DIBkgJH58IQQgAyAEQiCIfCEDIARC/////w+DIB0gIH58IQQgAyAEQiCIfCEDIARC/////w+DICEgHH58IQQgAyAEQiCIfCEDIARC/////w+DICUgGH58IQQgAyAEQiCIfCEDIAIgBD4CDCADQiCIIQQgA0L/////D4MgGiAjfnwhAyAEIANCIIh8IQQgA0L/////D4MgHiAffnwhAyAEIANCIIh8IQQgA0L/////D4MgIiAbfnwhAyAEIANCIIh8IQQgA0L/////D4MgHSAkfnwhAyAEIANCIIh8IQQgA0L/////D4MgISAgfnwhAyAEIANCIIh8IQQgA0L/////D4MgJSAcfnwhAyAEIANCIIh8IQQgAiADPgIQIARCIIghAyAEQv////8PgyAeICN+fCEEIAMgBEIgiHwhAyAEQv////8PgyAiIB9+fCEEIAMgBEIgiHwhAyAEQv////8PgyAhICR+fCEEIAMgBEIgiHwhAyAEQv////8PgyAlICB+fCEEIAMgBEIgiHwhAyACIAQ+AhQgA0IgiCEEIANC/////w+DICIgI358IQMgBCADQiCIfCEEIANC/////w+DICUgJH58IQMgBCADQiCIfCEEIAIgAz4CGCAEQiCIIQMgAiAEPgIcIAOnBEAgAkHoDSACEAcaBSACQegNEAUEQCACQegNIAIQBxoLCwsSACAAIAFB6BIQCUHoEiACEBsLCwAgAEGIDiABEBwLFQAgAEGoExAAQcgTEAFBqBMgARAbCxcAIAAgARAfIAFB6A0gARANIAEgARAeCwkAQagOIAAQAAsVACAAIAFB6BMQHEHoE0GIDiACEBwLCwAgAEHoDSABEA0LCgAgAEHAAGoQAgsVACAAEAEgAEEgahAXIABBwABqEAELIgAgACABEAAgAEEgaiABQSBqEAAgAEHAAGogAUHAAGoQAAuGAgAgABAkBEAgACABECYPCyAAIABBiBQQEiAAQSBqIABBIGpBqBQQEkGoFEGoFEHIFBASIABBqBRB6BQQDkHoFEHoFEHoFBASQegUQYgUQegUEA9B6BRByBRB6BQQD0HoFEHoFEHoFBAOQYgUQYgUQYgVEA5BiBVBiBRBiBUQDkGIFUGIFUGoFRASIABBIGogAEHAAGpByBUQEkHoFEHoFCABEA5BqBUgASABEA9ByBRByBRB6BUQDkHoFUHoFUHoFRAOQegVQegVQegVEA5B6BQgASABQSBqEA8gAUEgakGIFSABQSBqEBIgAUEgakHoFSABQSBqEA9ByBVByBUgAUHAAGoQDgusAwIBfwF/IABBwABqIQMgAUHAAGohBCAAECQEQCABIAIQJg8LIAEQJARAIAAgAhAmDwsgAyADQYgWEBIgBCAEQagWEBIgAEGoFkHIFhASIAFBiBZB6BYQEiADQYgWQYgXEBIgBEGoFkGoFxASIABBIGpBqBdByBcQEiABQSBqQYgXQegXEBJByBZB6BYQBARAQcgXQegXEAQEQCAAIAIQJw8LC0HoFkHIFkGIGBAPQegXQcgXQagYEA9BiBhBiBhByBgQDkHIGEHIGEHIGBASQYgYQcgYQegYEBJBqBhBqBhBiBkQDkHIFkHIGEHIGRASQYgZQYgZQagZEBJByBlByBlB6BkQDkGoGUHoGCACEA8gAkHoGSACEA9ByBdB6BhBiBoQEkGIGkGIGkGIGhAOQcgZIAIgAkEgahAPIAJBIGpBiBkgAkEgahASIAJBIGpBiBogAkEgahAPIAMgBCACQcAAahAOIAJBwABqIAJBwABqIAJBwABqEBIgAkHAAGpBiBYgAkHAAGoQDyACQcAAakGoFiACQcAAahAPIAJBwABqQYgYIAJBwABqEBILIgAgACABEAAgAEEgaiABQSBqEBAgAEHAAGogAUHAAGoQAAsQACABIAIQKSAAIAIgAhAoCyIAIAAgARAVIABBIGogAUEgahAVIABBwABqIAFBwABqEBULIgAgACABEBQgAEEgaiABQSBqEBQgAEHAAGogAUHAAGoQFAtPACAAECQEQCABECUFIABBwABqQagaEBZBqBpBqBpByBoQEkGoGkHIGkHoGhASIABByBogARASIABBIGpB6BogAUEgahASIAFBwABqEBcLC6cCAgF/AX8gAEGIGxAmIAMQJSACIQQCQANAIARBAWshBCABIARqLQAAIQUgAyADECcgBUGAAU8EQCAFQYABayEFQYgbIAMgAxAoCyADIAMQJyAFQcAATwRAIAVBwABrIQVBiBsgAyADECgLIAMgAxAnIAVBIE8EQCAFQSBrIQVBiBsgAyADECgLIAMgAxAnIAVBEE8EQCAFQRBrIQVBiBsgAyADECgLIAMgAxAnIAVBCE8EQCAFQQhrIQVBiBsgAyADECgLIAMgAxAnIAVBBE8EQCAFQQRrIQVBiBsgAyADECgLIAMgAxAnIAVBAk8EQCAFQQJrIQVBiBsgAyADECgLIAMgAxAnIAVBAU8EQCAFQQFrIQVBiBsgAyADECgLIARFDQEMAAsLCysCAX8BfyAAQQV2QQJ0IQFBASAAQR9xdCECIAEgASgC6NsBIAJyNgLo2wELJAIBfwF/IABBBXZBAnQhAUEBIABBH3F0IQIgASgC6NsBIAJxC6ABBAF/AX8BfwF/IAAhAkHoGxAlQQAhBAJAA0AgBCABRg0BQegbQQEgBHRB4ABsaiEDIAIQAiEFIAIgAxAAIAJBIGohAiADQSBqIQMgAiADEAAgAkEgaiECIANBIGohAyAFBEAgAxABBSADEBcLIARBAWohBAwACwtB6NsBQpeChIAQNwMAQfDbAUIBNwMAQfjbAUIBNwMAQYDcAUIANwMAC0ADAX8BfwF/QegbIABB4ABsaiEBIAAQMEUEQCAALQCI3AEQMiECIAAtAIjeARAyIQMgAiADIAEQKCAAEC8LIAELpQEEAX8BfwF+AX5BACEDAkADQCADQSBGDQFCACEGQQAhBAJAA0AgBCABRg0BIAAgBEEgbCADamoxAAAhBSAFIAVCHIaEQo+AgIDwAYMhBSAFIAVCDoaEQoOAjICwgMABgyEFIAUgBUIHhoRCgYKEiJCgwIABgyEFIAYgBSAErYaEIQYgBEEBaiEEDAALCyACIANBCGxqIAY3AwAgA0EBaiEDDAALCwtLAQF/IAAgAkGI4AEQMyADECUgASACEDFBACEEAkADQCAEQYACRg0BIAMgAxAnIANBh+IBIARrLQAAEDIgAxAoIARBAWohBAwACwsLfgQBfwF/AX8BfyAAIQUgASEGIAUgAiADbiADbEEgbGohCAJAA0AgBSAIRg0BIAUgBiADQYjiARA0QYjiASAEIAQQKCAFQSAgA2xqIQUgBkHAACADbGohBgwACwsgAiADcCEHIAcEQCAFIAYgB0GI4gEQNEGI4gEgBCAEECgLC04CAX8BfyAAIAJB6OIBEDMgASACEDFBACEEAkADQCAEQYACRg0BIAMgBEHgAGxqIQUgBUHn5AEgBGstAAAQMiAFECggBEEBaiEEDAALCwspAQF/QQAhAgJAA0AgAiABRg0BIAAgAkHgAGxqECUgAkEBaiECDAALCwtIAgF/AX8gACEEIAQgAhAmIARB4ABqIQRBASEDAkADQCADIAFGDQEgAiACECcgBCACIAIQKCAEQeAAaiEEIANBAWohAwwACwsLigEEAX8BfwF/AX9B6OQBQYACEDcgACEFIAEhBiAFIAIgA24gA2xBIGxqIQgCQANAIAUgCEYNASAFIAYgA0Ho5AEQNiAFQSAgA2xqIQUgBkHAACADbGohBgwACwsgAiADcCEHIAcEQCAFIAYgB0Ho5AEQNgtB6OQBQYACQeikAxA4QeikAyAEIAQQKAtGACAAQf8BcS0AiLQDQRh0IABBCHZB/wFxLQCItANBEHRqIABBEHZB/wFxLQCItANBCHQgAEEYdkH/AXEtAIi0A2pqIAF3C2cFAX8BfwF/AX8Bf0EBIAF0IQJBACEDAkADQCADIAJGDQEgACADQSBsaiEFIAMgARA6IQQgACAEQSBsaiEGIAMgBEkEQCAFQYi2AxAAIAYgBRAAQYi2AyAGEAALIANBAWohAwwACwsL7wEJAX8BfwF/AX8BfwF/AX8BfwF/IAAgARA7QQEgAXQhCEEBIQMCQANAIAMgAUsNAUEBIAN0IQZByKUDIANBIGxqIQlBACEEAkADQCAEIAhPDQEgAgRAIAlBIGpBqLYDEAAFQai2AxAhCyAGQQF2IQdBACEFAkADQCAFIAdPDQEgACAEIAVqQSBsaiEKIAogB0EgbGohC0GotgMgC0HItgMQHCAKQei2AxAAQei2A0HItgMgChAYQei2A0HItgMgCxAZQai2AyAJQai2AxAcIAVBAWohBQwACwsgBCAGaiEEDAALCyADQQFqIQMMAAsLCz4DAX8BfwF/IAAhAyABIQQgACACQSBsaiEFAkADQCADIAVGDQEgAyAEEAAgA0EgaiEDIARBwABqIQQMAAsLCz0DAX8BfwF/IAAhAyABIQQgACACQSBsaiEFAkADQCADIAVGDQEgAyAEEB8gA0EgaiEDIARBIGohBAwACwsLPQMBfwF/AX8gACEDIAEhBCAAIAJBIGxqIQUCQANAIAMgBUYNASADIAQQHiADQSBqIQMgBEEgaiEEDAALCwuWAQcBfwF/AX8BfwF/AX8Bf0EBIAF0IQJB6KwDIAFBIGxqIQQgAkEBayEGQQEhBSACQQF2IQMCQANAIAUgA0YNASAAIAVBIGxqIQcgACACIAVrQSBsaiEIIAdBiLcDEAAgCCAEIAcQHEGItwMgBCAIEBwgBUEBaiEFDAALCyAAIAQgABAcIAAgA0EgbGohCCAIIAQgCBAcC0MCAX8BfyAAQQF2IQJBACEBAkADQCACRQ0BIAJBAXYhAiABQQFqIQEMAAsLIABBASABdEcEQAALIAFBHEsEQAALIAELEgEBfyABEEEhAyAAIAMgAhA8CxgBAX8gARBBIQMgACADIAIQPCAAIAMQQAtMBAF/AX8BfwF/IAAhBCABIQUgAyEGIAAgAkEgbGohBwJAA0AgBCAHRg0BIAQgBSAGEBwgBEEgaiEEIAVBIGohBSAGQSBqIQYMAAsLCy4CAX8BfyAAIQMgACABQSBsaiECAkADQCADIAJGDQEgAxABIANBIGohAwwACwsLjgEGAX8BfwF/AX8BfwF/QQAhBCAAIQYgASEHAkADQCAEIAJGDQEgBigCACEJIAZBBGohBkEAIQUCQANAIAUgCUYNASADIAYoAgBBIGxqIQggBkEEaiEGIAcgBkGotwMQHEGotwMgCCAIEBggBkEgaiEGIAVBAWohBQwACwsgB0EgaiEHIARBAWohBAwACwsLDgAgABACIABBIGoQAnELDQAgABABIABBIGoQAQsNACAAEBcgAEEgahABCxQAIAAgARAAIABBIGogAUEgahAAC3kAIAAgAUHotwMQEiAAQSBqIAFBIGpBiLgDEBIgACAAQSBqQai4AxAOIAEgAUEgakHIuAMQDkGouANByLgDQai4AxASQYi4A0HItwMgAhASQei3AyACIAIQDkHotwNBiLgDIAJBIGoQDkGouAMgAkEgaiACQSBqEA8LGwAgACABIAIQDiAAQSBqIAFBIGogAkEgahAOCxsAIAAgASACEA8gAEEgaiABQSBqIAJBIGoQDwsUACAAIAEQECAAQSBqIAFBIGoQEAsUACAAIAEQFCAAQSBqIAFBIGoQFAsUACAAIAEQFSAAQSBqIAFBIGoQFQsVACAAIAEQBCAAQSBqIAFBIGoQBHELaAAgACAAQei4AxASIABBIGogAEEgakGIuQMQEkGIuQNByLcDQai5AxASQei4A0GouQNBqLkDEA9BqLkDQci5AxAWIABByLkDIAEQEiAAQSBqQci5AyABQSBqEBIgAUEgaiABQSBqEBALCgAgAEGAAWoQRwsWACAAEEggAEHAAGoQSSAAQYABahBICyQAIAAgARBKIABBwABqIAFBwABqEEogAEGAAWogAUGAAWoQSgu8AgAgABBTBEAgACABEFUPCyAAIABB6LkDEEsgAEHAAGogAEHAAGpBqLoDEEtBqLoDQai6A0HougMQSyAAQai6A0GouwMQTEGouwNBqLsDQai7AxBLQai7A0HouQNBqLsDEE1BqLsDQei6A0GouwMQTUGouwNBqLsDQai7AxBMQei5A0HouQNB6LsDEExB6LsDQei5A0HouwMQTEHouwNB6LsDQai8AxBLIABBwABqIABBgAFqQei8AxBLQai7A0GouwMgARBMQai8AyABIAEQTUHougNB6LoDQai9AxBMQai9A0GovQNBqL0DEExBqL0DQai9A0GovQMQTEGouwMgASABQcAAahBNIAFBwABqQei7AyABQcAAahBLIAFBwABqQai9AyABQcAAahBNQei8A0HovAMgAUGAAWoQTAvvAwIBfwF/IABBgAFqIQMgAUGAAWohBCAAEFMEQCABIAIQVQ8LIAEQUwRAIAAgAhBVDwsgAyADQei9AxBLIAQgBEGovgMQSyAAQai+A0HovgMQSyABQei9A0GovwMQSyADQei9A0HovwMQSyAEQai+A0GowAMQSyAAQcAAakGowANB6MADEEsgAUHAAGpB6L8DQajBAxBLQei+A0GovwMQUQRAQejAA0GowQMQUQRAIAAgAhBWDwsLQai/A0HovgNB6MEDEE1BqMEDQejAA0GowgMQTUHowQNB6MEDQejCAxBMQejCA0HowgNB6MIDEEtB6MEDQejCA0GowwMQS0GowgNBqMIDQejDAxBMQei+A0HowgNB6MQDEEtB6MMDQejDA0GoxAMQS0HoxANB6MQDQajFAxBMQajEA0GowwMgAhBNIAJBqMUDIAIQTUHowANBqMMDQejFAxBLQejFA0HoxQNB6MUDEExB6MQDIAIgAkHAAGoQTSACQcAAakHowwMgAkHAAGoQSyACQcAAakHoxQMgAkHAAGoQTSADIAQgAkGAAWoQTCACQYABaiACQYABaiACQYABahBLIAJBgAFqQei9AyACQYABahBNIAJBgAFqQai+AyACQYABahBNIAJBgAFqQejBAyACQYABahBLCyQAIAAgARBKIABBwABqIAFBwABqEE4gAEGAAWogAUGAAWoQSgsQACABIAIQWCAAIAIgAhBXCyQAIAAgARBQIABBwABqIAFBwABqEFAgAEGAAWogAUGAAWoQUAskACAAIAEQTyAAQcAAaiABQcAAahBPIABBgAFqIAFBgAFqEE8LWgAgABBTBEAgARBUBSAAQYABakGoxgMQUkGoxgNBqMYDQejGAxBLQajGA0HoxgNBqMcDEEsgAEHoxgMgARBLIABBwABqQajHAyABQcAAahBLIAFBgAFqEEkLC7ACAgF/AX8gAEHoxwMQVSADEFQgAiEEAkADQCAEQQFrIQQgASAEai0AACEFIAMgAxBWIAVBgAFPBEAgBUGAAWshBUHoxwMgAyADEFcLIAMgAxBWIAVBwABPBEAgBUHAAGshBUHoxwMgAyADEFcLIAMgAxBWIAVBIE8EQCAFQSBrIQVB6McDIAMgAxBXCyADIAMQViAFQRBPBEAgBUEQayEFQejHAyADIAMQVwsgAyADEFYgBUEITwRAIAVBCGshBUHoxwMgAyADEFcLIAMgAxBWIAVBBE8EQCAFQQRrIQVB6McDIAMgAxBXCyADIAMQViAFQQJPBEAgBUECayEFQejHAyADIAMQVwsgAyADEFYgBUEBTwRAIAVBAWshBUHoxwMgAyADEFcLIARFDQEMAAsLCysCAX8BfyAAQQV2QQJ0IQFBASAAQR9xdCECIAEgASgCqMkGIAJyNgKoyQYLJAIBfwF/IABBBXZBAnQhAUEBIABBH3F0IQIgASgCqMkGIAJxC6YBBAF/AX8BfwF/IAAhAkGoyQMQVEEAIQQCQANAIAQgAUYNAUGoyQNBASAEdEHAAWxqIQMgAhBHIQUgAiADEEogAkHAAGohAiADQcAAaiEDIAIgAxBKIAJBwABqIQIgA0HAAGohAyAFBEAgAxBIBSADEEkLIARBAWohBAwACwtBqMkGQpeChIAQNwMAQbDJBkIBNwMAQbjJBkIBNwMAQcDJBkIANwMAC0EDAX8BfwF/QajJAyAAQcABbGohASAAEF9FBEAgAC0AyMkGEGEhAiAALQDIywYQYSEDIAIgAyABEFcgABBeCyABC6UBBAF/AX8BfgF+QQAhAwJAA0AgA0EgRg0BQgAhBkEAIQQCQANAIAQgAUYNASAAIARBIGwgA2pqMQAAIQUgBSAFQhyGhEKPgICA8AGDIQUgBSAFQg6GhEKDgIyAsIDAAYMhBSAFIAVCB4aEQoGChIiQoMCAAYMhBSAGIAUgBK2GhCEGIARBAWohBAwACwsgAiADQQhsaiAGNwMAIANBAWohAwwACwsLSwEBfyAAIAJByM0GEGIgAxBUIAEgAhBgQQAhBAJAA0AgBEGAAkYNASADIAMQViADQcfPBiAEay0AABBhIAMQVyAEQQFqIQQMAAsLC34EAX8BfwF/AX8gACEFIAEhBiAFIAIgA24gA2xBIGxqIQgCQANAIAUgCEYNASAFIAYgA0HIzwYQY0HIzwYgBCAEEFcgBUEgIANsaiEFIAZBgAEgA2xqIQYMAAsLIAIgA3AhByAHBEAgBSAGIAdByM8GEGNByM8GIAQgBBBXCwtOAgF/AX8gACACQYjRBhBiIAEgAhBgQQAhBAJAA0AgBEGAAkYNASADIARBwAFsaiEFIAVBh9MGIARrLQAAEGEgBRBXIARBAWohBAwACwsLKQEBf0EAIQICQANAIAIgAUYNASAAIAJBwAFsahBUIAJBAWohAgwACwsLSAIBfwF/IAAhBCAEIAIQVSAEQcABaiEEQQEhAwJAA0AgAyABRg0BIAIgAhBWIAQgAiACEFcgBEHAAWohBCADQQFqIQMMAAsLC4oBBAF/AX8BfwF/QYjTBkGAAhBmIAAhBSABIQYgBSACIANuIANsQSBsaiEIAkADQCAFIAhGDQEgBSAGIANBiNMGEGUgBUEgIANsaiEFIAZBgAEgA2xqIQYMAAsLIAIgA3AhByAHBEAgBSAGIAdBiNMGEGULQYjTBkGAAkGI0wkQZ0GI0wkgBCAEEFcLJAEBfyADIQQCQANAIAAgASACEBIgBEEBayEEIARFDQEMAAsLCyQBAX8gAyEEAkADQCAAIAEgAhATIARBAWshBCAERQ0BDAALCwsL/hsSAEEACwRIagIAAEEICyABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABB6AcLIEf9fNgWjCA8jcpxaJFqgZddWIGBtkVQuCmgMeFyTmQwAEGICAsgifqKU1v8LPP7AUXUERnntfZ/QQr/HqtHHzW4ynGf2AYAQagICyCdDY/FjUNd0z0Lx/Uo63gKLEZ5eG+jbmYv3weawXcKDgBByAgLIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEHoDQsgAQAA8JP14UORcLl5SOgzKF1YgYG2RVC4KaAx4XJOZDAAQYgOCyCnbSGuRea4G+NZXOOxOv5ThYC7Uz2DSYylRE5/sdAWAgBBqA4LIPv//08cNJasKc1gn5V2/DYuRnl4b6NuZi/fB5rBdwoOAEHIDgsgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQYjcAQuAAgAAAAIABAQGAAgICggMDAwAEBASEBQUFBAYGBgYGBgcACAgIiAkJCQgKCgoKCgoLCAwMDAwMDA0MDAwODA4ODgAQEBCQEREREBISEhISEhMQFBQUFBQUFRQUFBYUFhYWEBgYGBgYGBkYGBgaGBoaGhgYGBwYHBwcGBwcHBwcHB4AICAgoCEhISAiIiIiIiIjICQkJCQkJCUkJCQmJCYmJiAoKCgoKCgpKCgoKigqKiooKCgsKCwsLCgsLCwsLCwuIDAwMDAwMDEwMDAyMDIyMjAwMDQwNDQ0MDQ0NDQ0NDYwMDA4MDg4ODA4ODg4ODg6MDg4ODg4ODw4ODg8ODw8PAAQYjeAQuAAgAAAAEAAQIBAAECAQQBAgMAAQIBBAECAwgBAgMEBQYDAAECAQQBAgMIAQIDBAUGAxABAgMEBQYDCAkKAwwFBgcAAQIBBAECAwgBAgMEBQYDEAECAwQFBgMICQoDDAUGByABAgMEBQYDCAkKAwwFBgcQERIDFAUGBxgJCgsMDQ4HAAECAQQBAgMIAQIDBAUGAxABAgMEBQYDCAkKAwwFBgcgAQIDBAUGAwgJCgMMBQYHEBESAxQFBgcYCQoLDA0OB0ABAgMEBQYDCAkKAwwFBgcQERIDFAUGBxgJCgsMDQ4HICEiAyQFBgcoCQoLDA0OBzAREhMUFRYHGBkaCxwNDg8AQcilAwugB/v//08cNJasKc1gn5V2/DYuRnl4b6NuZi/fB5rBdwoOBgAAoHfBS5dno1jasnE38S4SCAlHouFR+sApR7HWWSKL79yelz11fyCRR7EsFz9fbmwJdHlisY3PCME5NXs3Kz98rbXiSq34voXLg//GYC33KZRdK/122anZmj/nfEAkA48vdHx9tvTMaNBj3C0baGpX+xvvvOWM/jy20lEpfBZkTFe/sfcUIvJ9MfcvI/kozXWtsKiEdeUDbRfcWfuBK0KecG6u8VG1znHA3RMpmJsOBYBC6VZzZO31B/wGuNMJgFNdsQYNFKuXWzG8zDovjE+ZBJIlN1l4NCbiWfDzshwAnKOeMZOPf4JXzPlZECV7fFP7zWe9g1asm6gYrsbsFzMECZKPksjJo/TZf6YBR9mLJ4/9+1Xmzt4OLRdwRY4VE6UgZnX5WZ2ZVwHqo0XnM2zdv2C/4paJx+I1twLvpiIudgBd/OlRSeWuZMGCrX128iJOQvGv4V+XE7D47etlI9kBPlZnQaSjJboMUrpemCwhbXCfkuALYy7ljTRjrYwPGmYZCIlu6JiUND20wnGJpQyvbkFNfcvYJ1nvfCLUBAERlgf+kG8TKjJxjFo7lZGQN1CWNzfy380mlBQCXqEpDNRyDoJMZGltDMJyc8g9YzCdm1pCQQw7VxcnCqB/QlgeELjTUZK0AZScwI809Zg83oOT1AeLGbXPYwx/RlvO7CngQ+GA5vdXj3vbSsX5Loork99rO4/jEMoAAl1nXrctKecj6qy4yOYv8R6NjwW1zvfwzRJ8H4QnUTCoubd9byIhzi1+AHOxdSTqeQVkX6otYtxn8e7Xdq71fylqiLEQ7iUzR54WRLPrASD4tYlq3XaJ3TQOTAP7n6IA4mGcFayzGX0R+krdZAdiV5Mti3GsHJG6+FYYISp3CMFg9aFV9WgXZIs6zEmo7UWQbqVH9LpafStbw6/v4Ua/Pkg47qP9/RfvaMRqvM7HsG9Jryf2s34eEapUzcyjkkpfuMOubR1HFMwGf4lFmV7tafi5x3bRxWN5uYLSR51EFtxVzV1/hyoj2h08y2o/HLkYoHNUZKTEngzfD2tkXfnp9i7EyNy6ei9uxcz31cVAdqfy89gf8xbnR/8w9Pae3HbbOE42ZfQcIrN9xQ6tQO/ha7dA7s7CGs1m0ftNi8+MHDB7M+wTiPEQuP45tsXHMpaZ8g8NQONcmNjssAEAiN2yKc6YbQ0HaR0AQeisAwugB/v//08cNJasKc1gn5V2/DYuRnl4b6NuZi/fB5rBdwoO/v//H9gUPHjdHo0Mby+Yr0VP/fySdF+PrL+cPRpjNx////8PbAoevG6PRoa3F8zXoqd+fkm6r0fWX84ejbGbDwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAQYi0AwuAAgCAQMAgoGDgEJBQ0DCwcPAIiEjIKKho6BiYWNg4uHj4BIRExCSkZOQUlFTUNLR09AyMTMwsrGzsHJxc3Dy8fPwCgkLCIqJi4hKSUtIysnLyCopKyiqqauoamlraOrp6+gaGRsYmpmbmFpZW1ja2dvYOjk7OLq5u7h6eXt4+vn7+AYFBwSGhYeERkVHRMbFx8QmJSckpqWnpGZlZ2Tm5efkFhUXFJaVl5RWVVdU1tXX1DY1NzS2tbe0dnV3dPb19/QODQ8Mjo2PjE5NT0zOzc/MLi0vLK6tr6xubW9s7u3v7B4dHxyenZ+cXl1fXN7d39w+PT88vr2/vH59f3z+/f/8AQci3Awsgqu/tEolIw2hPv6pyaH8IjTESCAlHouFR+sApR7HWWSIAQcjJBguAAgAAAAIABAQGAAgICggMDAwAEBASEBQUFBAYGBgYGBgcACAgIiAkJCQgKCgoKCgoLCAwMDAwMDA0MDAwODA4ODgAQEBCQEREREBISEhISEhMQFBQUFBQUFRQUFBYUFhYWEBgYGBgYGBkYGBgaGBoaGhgYGBwYHBwcGBwcHBwcHB4AICAgoCEhISAiIiIiIiIjICQkJCQkJCUkJCQmJCYmJiAoKCgoKCgpKCgoKigqKiooKCgsKCwsLCgsLCwsLCwuIDAwMDAwMDEwMDAyMDIyMjAwMDQwNDQ0MDQ0NDQ0NDYwMDA4MDg4ODA4ODg4ODg6MDg4ODg4ODw4ODg8ODw8PAAQcjLBguAAgAAAAEAAQIBAAECAQQBAgMAAQIBBAECAwgBAgMEBQYDAAECAQQBAgMIAQIDBAUGAxABAgMEBQYDCAkKAwwFBgcAAQIBBAECAwgBAgMEBQYDEAECAwQFBgMICQoDDAUGByABAgMEBQYDCAkKAwwFBgcQERIDFAUGBxgJCgsMDQ4HAAECAQQBAgMIAQIDBAUGAxABAgMEBQYDCAkKAwwFBgcgAQIDBAUGAwgJCgMMBQYHEBESAxQFBgcYCQoLDA0OB0ABAgMEBQYDCAkKAwwFBgcQERIDFAUGBxgJCgsMDQ4HICEiAyQFBgcoCQoLDA0OBzAREhMUFRYHGBkaCxwNDg8=","base64"),a.pq=1e3,a.pr=1768},9565:(e,a,t)=>{var c;e=t.nmd(e);var f=function(e){"use strict";var a=1e7,t=9007199254740992,c=l(t),d="0123456789abcdefghijklmnopqrstuvwxyz",r="function"==typeof BigInt;function n(e,a,t,c){return void 0===e?n[0]:void 0===a||10==+a&&!t?Z(e):q(e,a,t,c)}function i(e,a){this.value=e,this.sign=a,this.isSmall=!1}function b(e){this.value=e,this.sign=e<0,this.isSmall=!0}function o(e){this.value=e}function s(e){return-t0?Math.floor(e):Math.ceil(e)}function m(e,t){var c,f,d=e.length,r=t.length,n=new Array(d),i=0,b=a;for(f=0;f=b?1:0,n[f]=c-i*b;for(;f0&&n.push(i),n}function y(e,a){return e.length>=a.length?m(e,a):m(a,e)}function x(e,t){var c,f,d=e.length,r=new Array(d),n=a;for(f=0;f0;)r[f++]=t%n,t=Math.floor(t/n);return r}function A(e,t){var c,f,d=e.length,r=t.length,n=new Array(d),i=0,b=a;for(c=0;c0;)r[f++]=i%n,i=Math.floor(i/n);return r}function I(e,a){for(var t=[];a-- >0;)t.push(0);return t.concat(e)}function E(e,a){var t=Math.max(e.length,a.length);if(t<=30)return w(e,a);t=Math.ceil(t/2);var c=e.slice(t),f=e.slice(0,t),d=a.slice(t),r=a.slice(0,t),n=E(f,r),i=E(c,d),b=E(y(f,c),y(r,d)),o=y(y(n,I(A(A(b,n),i),t)),I(i,2*t));return h(o),o}function C(e,t,c){return new i(e=0;--c)d=(r=d*b+e[c])-(f=g(r/t))*t,i[c]=0|f;return[i,0|d]}function k(e,t){var c,f=Z(t);if(r)return[new o(e.value/f.value),new o(e.value%f.value)];var d,s=e.value,m=f.value;if(0===m)throw new Error("Cannot divide by zero");if(e.isSmall)return f.isSmall?[new b(g(s/m)),new b(s%m)]:[n[0],e];if(f.isSmall){if(1===m)return[e,n[0]];if(-1==m)return[e.negate(),n[0]];var y=Math.abs(m);if(y=0;f--){for(c=l-1,y[f+s]!==g&&(c=Math.floor((y[f+s]*l+y[f+s-1])/g)),d=0,r=0,i=x.length,n=0;nb&&(d=(d+1)*l),c=Math.ceil(d/r);do{if(L(n=_(t,c),s)<=0)break;c--}while(c);o.push(c),s=A(s,n)}return o.reverse(),[u(o),u(s)]}(s,m),d=c[0];var w=e.sign!==f.sign,I=c[1],E=e.sign;return"number"==typeof d?(w&&(d=-d),d=new b(d)):d=new i(d,w),"number"==typeof I?(E&&(I=-I),I=new b(I)):I=new i(I,E),[d,I]}function L(e,a){if(e.length!==a.length)return e.length>a.length?1:-1;for(var t=e.length-1;t>=0;t--)if(e[t]!==a[t])return e[t]>a[t]?1:-1;return 0}function S(e){var a=e.abs();return!a.isUnit()&&(!!(a.equals(2)||a.equals(3)||a.equals(5))||!(a.isEven()||a.isDivisibleBy(3)||a.isDivisibleBy(5))&&(!!a.lesser(49)||void 0))}function T(e,a){for(var t,c,d,r=e.prev(),n=r,i=0;n.isEven();)n=n.divide(2),i++;e:for(c=0;c=0?c=A(e,a):(c=A(a,e),t=!t),"number"==typeof(c=u(c))?(t&&(c=-c),new b(c)):new i(c,t)}(t,c,this.sign)},i.prototype.minus=i.prototype.subtract,b.prototype.subtract=function(e){var a=Z(e),t=this.value;if(t<0!==a.sign)return this.add(a.negate());var c=a.value;return a.isSmall?new b(t-c):v(c,Math.abs(t),t>=0)},b.prototype.minus=b.prototype.subtract,o.prototype.subtract=function(e){return new o(this.value-Z(e).value)},o.prototype.minus=o.prototype.subtract,i.prototype.negate=function(){return new i(this.value,!this.sign)},b.prototype.negate=function(){var e=this.sign,a=new b(-this.value);return a.sign=!e,a},o.prototype.negate=function(){return new o(-this.value)},i.prototype.abs=function(){return new i(this.value,!1)},b.prototype.abs=function(){return new b(Math.abs(this.value))},o.prototype.abs=function(){return new o(this.value>=0?this.value:-this.value)},i.prototype.multiply=function(e){var t,c,f,d=Z(e),r=this.value,b=d.value,o=this.sign!==d.sign;if(d.isSmall){if(0===b)return n[0];if(1===b)return this;if(-1===b)return this.negate();if((t=Math.abs(b))0?E(r,b):w(r,b),o)},i.prototype.times=i.prototype.multiply,b.prototype._multiplyBySmall=function(e){return s(e.value*this.value)?new b(e.value*this.value):C(Math.abs(e.value),l(Math.abs(this.value)),this.sign!==e.sign)},i.prototype._multiplyBySmall=function(e){return 0===e.value?n[0]:1===e.value?this:-1===e.value?this.negate():C(Math.abs(e.value),this.value,this.sign!==e.sign)},b.prototype.multiply=function(e){return Z(e)._multiplyBySmall(this)},b.prototype.times=b.prototype.multiply,o.prototype.multiply=function(e){return new o(this.value*Z(e).value)},o.prototype.times=o.prototype.multiply,i.prototype.square=function(){return new i(M(this.value),!1)},b.prototype.square=function(){var e=this.value*this.value;return s(e)?new b(e):new i(M(l(Math.abs(this.value))),!1)},o.prototype.square=function(e){return new o(this.value*this.value)},i.prototype.divmod=function(e){var a=k(this,e);return{quotient:a[0],remainder:a[1]}},o.prototype.divmod=b.prototype.divmod=i.prototype.divmod,i.prototype.divide=function(e){return k(this,e)[0]},o.prototype.over=o.prototype.divide=function(e){return new o(this.value/Z(e).value)},b.prototype.over=b.prototype.divide=i.prototype.over=i.prototype.divide,i.prototype.mod=function(e){return k(this,e)[1]},o.prototype.mod=o.prototype.remainder=function(e){return new o(this.value%Z(e).value)},b.prototype.remainder=b.prototype.mod=i.prototype.remainder=i.prototype.mod,i.prototype.pow=function(e){var a,t,c,f=Z(e),d=this.value,r=f.value;if(0===r)return n[1];if(0===d)return n[0];if(1===d)return n[1];if(-1===d)return f.isEven()?n[1]:n[-1];if(f.sign)return n[0];if(!f.isSmall)throw new Error("The exponent "+f.toString()+" is too large.");if(this.isSmall&&s(a=Math.pow(d,r)))return new b(g(a));for(t=this,c=n[1];!0&r&&(c=c.times(t),--r),0!==r;)r/=2,t=t.square();return c},b.prototype.pow=i.prototype.pow,o.prototype.pow=function(e){var a=Z(e),t=this.value,c=a.value,f=BigInt(0),d=BigInt(1),r=BigInt(2);if(c===f)return n[1];if(t===f)return n[0];if(t===d)return n[1];if(t===BigInt(-1))return a.isEven()?n[1]:n[-1];if(a.isNegative())return new o(f);for(var i=this,b=n[1];(c&d)===d&&(b=b.times(i),--c),c!==f;)c/=r,i=i.square();return b},i.prototype.modPow=function(e,a){if(e=Z(e),(a=Z(a)).isZero())throw new Error("Cannot take modPow with modulus 0");for(var t=n[1],c=this.mod(a);e.isPositive();){if(c.isZero())return n[0];e.isOdd()&&(t=t.multiply(c).mod(a)),e=e.divide(2),c=c.square().mod(a)}return t},o.prototype.modPow=b.prototype.modPow=i.prototype.modPow,i.prototype.compareAbs=function(e){var a=Z(e),t=this.value,c=a.value;return a.isSmall?1:L(t,c)},b.prototype.compareAbs=function(e){var a=Z(e),t=Math.abs(this.value),c=a.value;return a.isSmall?t===(c=Math.abs(c))?0:t>c?1:-1:-1},o.prototype.compareAbs=function(e){var a=this.value,t=Z(e).value;return(a=a>=0?a:-a)===(t=t>=0?t:-t)?0:a>t?1:-1},i.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var a=Z(e),t=this.value,c=a.value;return this.sign!==a.sign?a.sign?1:-1:a.isSmall?this.sign?-1:1:L(t,c)*(this.sign?-1:1)},i.prototype.compareTo=i.prototype.compare,b.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var a=Z(e),t=this.value,c=a.value;return a.isSmall?t==c?0:t>c?1:-1:t<0!==a.sign?t<0?-1:1:t<0?1:-1},b.prototype.compareTo=b.prototype.compare,o.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var a=this.value,t=Z(e).value;return a===t?0:a>t?1:-1},o.prototype.compareTo=o.prototype.compare,i.prototype.equals=function(e){return 0===this.compare(e)},o.prototype.eq=o.prototype.equals=b.prototype.eq=b.prototype.equals=i.prototype.eq=i.prototype.equals,i.prototype.notEquals=function(e){return 0!==this.compare(e)},o.prototype.neq=o.prototype.notEquals=b.prototype.neq=b.prototype.notEquals=i.prototype.neq=i.prototype.notEquals,i.prototype.greater=function(e){return this.compare(e)>0},o.prototype.gt=o.prototype.greater=b.prototype.gt=b.prototype.greater=i.prototype.gt=i.prototype.greater,i.prototype.lesser=function(e){return this.compare(e)<0},o.prototype.lt=o.prototype.lesser=b.prototype.lt=b.prototype.lesser=i.prototype.lt=i.prototype.lesser,i.prototype.greaterOrEquals=function(e){return this.compare(e)>=0},o.prototype.geq=o.prototype.greaterOrEquals=b.prototype.geq=b.prototype.greaterOrEquals=i.prototype.geq=i.prototype.greaterOrEquals,i.prototype.lesserOrEquals=function(e){return this.compare(e)<=0},o.prototype.leq=o.prototype.lesserOrEquals=b.prototype.leq=b.prototype.lesserOrEquals=i.prototype.leq=i.prototype.lesserOrEquals,i.prototype.isEven=function(){return!(1&this.value[0])},b.prototype.isEven=function(){return!(1&this.value)},o.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)},i.prototype.isOdd=function(){return!(1&~this.value[0])},b.prototype.isOdd=function(){return!(1&~this.value)},o.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)},i.prototype.isPositive=function(){return!this.sign},b.prototype.isPositive=function(){return this.value>0},o.prototype.isPositive=b.prototype.isPositive,i.prototype.isNegative=function(){return this.sign},b.prototype.isNegative=function(){return this.value<0},o.prototype.isNegative=b.prototype.isNegative,i.prototype.isUnit=function(){return!1},b.prototype.isUnit=function(){return 1===Math.abs(this.value)},o.prototype.isUnit=function(){return this.abs().value===BigInt(1)},i.prototype.isZero=function(){return!1},b.prototype.isZero=function(){return 0===this.value},o.prototype.isZero=function(){return this.value===BigInt(0)},i.prototype.isDivisibleBy=function(e){var a=Z(e);return!a.isZero()&&(!!a.isUnit()||(0===a.compareAbs(2)?this.isEven():this.mod(a).isZero()))},o.prototype.isDivisibleBy=b.prototype.isDivisibleBy=i.prototype.isDivisibleBy,i.prototype.isPrime=function(a){var t=S(this);if(t!==e)return t;var c=this.abs(),d=c.bitLength();if(d<=64)return T(c,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var r=Math.log(2)*d.toJSNumber(),n=Math.ceil(!0===a?2*Math.pow(r,2):r),i=[],b=0;b-t?new b(e-1):new i(c,!0)},o.prototype.prev=function(){return new o(this.value-BigInt(1))};for(var N=[1];2*N[N.length-1]<=a;)N.push(2*N[N.length-1]);var R=N.length,P=N[R-1];function D(e){return Math.abs(e)<=a}function O(e,a,t){a=Z(a);for(var c=e.isNegative(),d=a.isNegative(),r=c?e.not():e,n=d?a.not():a,i=0,b=0,o=null,s=null,l=[];!r.isZero()||!n.isZero();)i=(o=k(r,P))[1].toJSNumber(),c&&(i=P-1-i),b=(s=k(n,P))[1].toJSNumber(),d&&(b=P-1-b),r=o[0],n=s[0],l.push(t(i,b));for(var u=0!==t(c?1:0,d?1:0)?f(-1):f(0),h=l.length-1;h>=0;h-=1)u=u.multiply(P).add(f(l[h]));return u}i.prototype.shiftLeft=function(e){var a=Z(e).toJSNumber();if(!D(a))throw new Error(String(a)+" is too large for shifting.");if(a<0)return this.shiftRight(-a);var t=this;if(t.isZero())return t;for(;a>=R;)t=t.multiply(P),a-=R-1;return t.multiply(N[a])},o.prototype.shiftLeft=b.prototype.shiftLeft=i.prototype.shiftLeft,i.prototype.shiftRight=function(e){var a,t=Z(e).toJSNumber();if(!D(t))throw new Error(String(t)+" is too large for shifting.");if(t<0)return this.shiftLeft(-t);for(var c=this;t>=R;){if(c.isZero()||c.isNegative()&&c.isUnit())return c;c=(a=k(c,P))[1].isNegative()?a[0].prev():a[0],t-=R-1}return(a=k(c,N[t]))[1].isNegative()?a[0].prev():a[0]},o.prototype.shiftRight=b.prototype.shiftRight=i.prototype.shiftRight,i.prototype.not=function(){return this.negate().prev()},o.prototype.not=b.prototype.not=i.prototype.not,i.prototype.and=function(e){return O(this,e,(function(e,a){return e&a}))},o.prototype.and=b.prototype.and=i.prototype.and,i.prototype.or=function(e){return O(this,e,(function(e,a){return e|a}))},o.prototype.or=b.prototype.or=i.prototype.or,i.prototype.xor=function(e){return O(this,e,(function(e,a){return e^a}))},o.prototype.xor=b.prototype.xor=i.prototype.xor;var F=1<<30;function Q(e){var t=e.value,c="number"==typeof t?t|F:"bigint"==typeof t?t|BigInt(F):t[0]+t[1]*a|1073758208;return c&-c}function U(e,a){if(a.compareTo(e)<=0){var t=U(e,a.square(a)),c=t.p,d=t.e,r=c.multiply(a);return r.compareTo(e)<=0?{p:r,e:2*d+1}:{p:c,e:2*d}}return{p:f(1),e:0}}function j(e,a){return e=Z(e),a=Z(a),e.greater(a)?e:a}function H(e,a){return e=Z(e),a=Z(a),e.lesser(a)?e:a}function $(e,a){if(e=Z(e).abs(),a=Z(a).abs(),e.equals(a))return e;if(e.isZero())return a;if(a.isZero())return e;for(var t,c,f=n[1];e.isEven()&&a.isEven();)t=H(Q(e),Q(a)),e=e.divide(t),a=a.divide(t),f=f.multiply(t);for(;e.isEven();)e=e.divide(Q(e));do{for(;a.isEven();)a=a.divide(Q(a));e.greater(a)&&(c=a,a=e,e=c),a=a.subtract(e)}while(!a.isZero());return f.isUnit()?e:e.multiply(f)}i.prototype.bitLength=function(){var e=this;return e.compareTo(f(0))<0&&(e=e.negate().subtract(f(1))),0===e.compareTo(f(0))?f(0):f(U(e,f(2)).e).add(f(1))},o.prototype.bitLength=b.prototype.bitLength=i.prototype.bitLength;var q=function(e,a,t,c){t=t||d,e=String(e),c||(e=e.toLowerCase(),t=t.toLowerCase());var f,r=e.length,n=Math.abs(a),i={};for(f=0;f=n){if("1"===s&&1===n)continue;throw new Error(s+" is not a valid digit in base "+a+".")}a=Z(a);var b=[],o="-"===e[0];for(f=o?1:0;f"!==e[f]&&f=0;c--)f=f.add(e[c].times(d)),d=d.times(a);return t?f.negate():f}function G(e,a){if((a=f(a)).isZero()){if(e.isZero())return{value:[0],isNegative:!1};throw new Error("Cannot convert nonzero numbers to base 0.")}if(a.equals(-1)){if(e.isZero())return{value:[0],isNegative:!1};if(e.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-e.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var t=Array.apply(null,Array(e.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);return t.unshift([1]),{value:[].concat.apply([],t),isNegative:!1}}var c=!1;if(e.isNegative()&&a.isPositive()&&(c=!0,e=e.abs()),a.isUnit())return e.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(e.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:c};for(var d,r=[],n=e;n.isNegative()||n.compareAbs(a)>=0;){d=n.divmod(a),n=d.quotient;var i=d.remainder;i.isNegative()&&(i=a.minus(i).abs(),n=n.next()),r.push(i.toJSNumber())}return r.push(n.toJSNumber()),{value:r.reverse(),isNegative:c}}function K(e,a,t){var c=G(e,a);return(c.isNegative?"-":"")+c.value.map((function(e){return function(e,a){return e<(a=a||d).length?a[e]:"<"+e+">"}(e,t)})).join("")}function V(e){if(s(+e)){var a=+e;if(a===g(a))return r?new o(BigInt(a)):new b(a);throw new Error("Invalid integer: "+e)}var t="-"===e[0];t&&(e=e.slice(1));var c=e.split(/e/i);if(c.length>2)throw new Error("Invalid integer: "+c.join("e"));if(2===c.length){var f=c[1];if("+"===f[0]&&(f=f.slice(1)),(f=+f)!==g(f)||!s(f))throw new Error("Invalid integer: "+f+" is not a valid exponent.");var d=c[0],n=d.indexOf(".");if(n>=0&&(f-=d.length-n-1,d=d.slice(0,n)+d.slice(n+1)),f<0)throw new Error("Cannot include negative exponent part for integers");e=d+=new Array(f+1).join("0")}if(!/^([0-9][0-9]*)$/.test(e))throw new Error("Invalid integer: "+e);if(r)return new o(BigInt(t?"-"+e:e));for(var l=[],u=e.length,p=u-7;u>0;)l.push(+e.slice(p,u)),(p-=7)<0&&(p=0),u-=7;return h(l),new i(l,t)}function Z(e){return"number"==typeof e?function(e){if(r)return new o(BigInt(e));if(s(e)){if(e!==g(e))throw new Error(e+" is not an integer.");return new b(e)}return V(e.toString())}(e):"string"==typeof e?V(e):"bigint"==typeof e?new o(e):e}i.prototype.toArray=function(e){return G(this,e)},b.prototype.toArray=function(e){return G(this,e)},o.prototype.toArray=function(e){return G(this,e)},i.prototype.toString=function(a,t){if(a===e&&(a=10),10!==a)return K(this,a,t);for(var c,f=this.value,d=f.length,r=String(f[--d]);--d>=0;)c=String(f[d]),r+="0000000".slice(c.length)+c;return(this.sign?"-":"")+r},b.prototype.toString=function(a,t){return a===e&&(a=10),10!=a?K(this,a,t):String(this.value)},o.prototype.toString=b.prototype.toString,o.prototype.toJSON=i.prototype.toJSON=b.prototype.toJSON=function(){return this.toString()},i.prototype.valueOf=function(){return parseInt(this.toString(),10)},i.prototype.toJSNumber=i.prototype.valueOf,b.prototype.valueOf=function(){return this.value},b.prototype.toJSNumber=b.prototype.valueOf,o.prototype.valueOf=o.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};for(var J=0;J<1e3;J++)n[J]=Z(J),J>0&&(n[-J]=Z(-J));return n.one=n[1],n.zero=n[0],n.minusOne=n[-1],n.max=j,n.min=H,n.gcd=$,n.lcm=function(e,a){return e=Z(e).abs(),a=Z(a).abs(),e.divide($(e,a)).multiply(a)},n.isInstance=function(e){return e instanceof i||e instanceof b||e instanceof o},n.randBetween=function(e,t){var c=H(e=Z(e),t=Z(t)),f=j(e,t).subtract(c).add(1);if(f.isSmall)return c.add(Math.floor(Math.random()*f));for(var d=G(f,a).value,r=[],i=!0,b=0;b{const c=t(9565),f=t(71293),d=t(94148),r="undefined"!=typeof window;let n,i;r||(n=t(5183).Worker,i=t(91565));class b{constructor(){this.promise=new Promise(((e,a)=>{this.reject=a,this.resolve=e}))}}function o(e){let a,t,c;function f(e){for(;3&c[0];)c[0]++;const a=c[0];for(c[0]+=e;c[0]>t.buffer.byteLength;)t.grow(100);return c=new Uint32Array(t.buffer),a}function d(e){const a=f(e.byteLength),t=new Uint32Array(e);return c.set(t,a/4),a}function r(e,a){return t.buffer.slice(e,e+a)}e.onmessage=function(n){let i;if(i=n.data?n.data:n,"INIT"==i.command)(async function(e){const f=new Uint8Array(e.code),d=await WebAssembly.compile(f);t=new WebAssembly.Memory({initial:e.init}),c=new Uint32Array(t.buffer),a=await WebAssembly.instantiate(d,{env:{memory:t}})})(i).then((function(){e.postMessage(i.result)}));else if("G1_MULTIEXP"==i.command){const t=c[0],n=d(i.scalars),b=d(i.points),o=f(96);a.exports.g1_zero(o),a.exports.g1_multiexp2(n,b,i.n,7,o),i.result=r(o,96),c[0]=t,e.postMessage(i.result,[i.result])}else if("G2_MULTIEXP"==i.command){const t=c[0],n=d(i.scalars),b=d(i.points),o=f(192);a.exports.g2_zero(o),a.exports.g2_multiexp(n,b,i.n,7,o),i.result=r(o,192),c[0]=t,e.postMessage(i.result,[i.result])}else if("CALC_H"==i.command){const t=c[0],n=d(i.signals),b=d(i.polsA),o=d(i.polsB),s=i.nSignals,l=i.domainSize,u=f(32*s),h=f(32*l),p=f(32*l),g=f(32*l*2),m=f(32*l*2);a.exports.fft_toMontgomeryN(n,u,s),a.exports.pol_zero(h,l),a.exports.pol_zero(p,l),a.exports.pol_constructLC(b,u,s,h),a.exports.pol_constructLC(o,u,s,p),a.exports.fft_copyNInterleaved(h,g,l),a.exports.fft_copyNInterleaved(p,m,l),a.exports.fft_ifft(h,l,0),a.exports.fft_ifft(p,l,0),a.exports.fft_fft(h,l,1),a.exports.fft_fft(p,l,1),a.exports.fft_copyNInterleaved(h,g+32,l),a.exports.fft_copyNInterleaved(p,m+32,l),a.exports.fft_mulN(g,m,2*l,g),a.exports.fft_ifft(g,2*l,0),a.exports.fft_fromMontgomeryN(g+32*l,g+32*l,l),i.result=r(g+32*l,32*l),c[0]=t,e.postMessage(i.result,[i.result])}else"TERMINATE"==i.command&&process.exit()}}class s{constructor(){this.actionQueue=[]}postAction(e,a,t,c){return d(0==this.working[e]),this.working[e]=!0,this.pendingDeferreds[e]=c||new b,this.workers[e].postMessage(a,t),this.pendingDeferreds[e].promise}processWorks(){for(let e=0;e0;e++)if(0==this.working[e]){const a=this.actionQueue.shift();this.postAction(e,a.data,a.transfers,a.deferred)}}queueAction(e,a){const t=new b;return this.actionQueue.push({data:e,transfers:a,deferred:t}),this.processWorks(),t.promise}alloc(e){for(;3&this.i32[0];)this.i32[0]++;const a=this.i32[0];return this.i32[0]+=e,a}putBin(e,a){const t=new Uint32Array(a);this.i32.set(t,e/4)}getBin(e,a){return this.memory.buffer.slice(e,e+a)}bin2int(e){const a=new Uint32Array(e);let t=c(a[7]);for(let e=6;e>=0;e--)t=t.shiftLeft(32),t=t.add(a[e]);return t.toString()}bin2g1(e){return[this.bin2int(e.slice(0,32)),this.bin2int(e.slice(32,64)),this.bin2int(e.slice(64,96))]}bin2g2(e){return[[this.bin2int(e.slice(0,32)),this.bin2int(e.slice(32,64))],[this.bin2int(e.slice(64,96)),this.bin2int(e.slice(96,128))],[this.bin2int(e.slice(128,160)),this.bin2int(e.slice(160,192))]]}async g1_multiexp(e,a){const t=e.byteLength/32,c=Math.floor(t/this.workers.length),f=[];for(let d=0;dthis.g1_multiexp(e,v))),B=this.g1_multiexp(e.slice(0),m),k=this.g1_multiexp(e.slice(0),y),L=this.g2_multiexp(e.slice(0),x),S=this.g1_multiexp(e.slice(32*(f+1)),A),T=await Promise.all([B,k,L,S,M]),N=this.alloc(96),R=this.alloc(192),P=this.alloc(96),D=this.alloc(96);this.putBin(N,T[0]),this.putBin(D,T[1]),this.putBin(R,T[2]),this.putBin(P,T[3]);const O=this.loadPoint1(w),F=this.loadPoint1(_),Q=this.loadPoint1(I),U=this.loadPoint2(E),j=this.loadPoint2(C);let H=new Uint32Array(8);const $=this.alloc(96),q=this.alloc(192),z=this.alloc(32),G=this.alloc(32);if(r)window.crypto.getRandomValues(H),this.putBin(z,H),window.crypto.getRandomValues(H),this.putBin(G,H);else{const e=i.randomBytes(32);this.putBin(z,e);const a=i.randomBytes(32);this.putBin(G,a)}this.instance.exports.g1_add(O,N,N),this.instance.exports.g1_timesScalar(Q,z,32,$),this.instance.exports.g1_add($,N,N),this.instance.exports.g2_add(U,R,R),this.instance.exports.g2_timesScalar(j,G,32,q),this.instance.exports.g2_add(q,R,R),this.instance.exports.g1_add(F,D,D),this.instance.exports.g1_timesScalar(Q,G,32,$),this.instance.exports.g1_add($,D,D),this.putBin($,T[4]),this.instance.exports.g1_add($,P,P),this.instance.exports.g1_timesScalar(N,G,32,$),this.instance.exports.g1_add($,P,P),this.instance.exports.g1_timesScalar(D,z,32,$),this.instance.exports.g1_add($,P,P);const K=this.alloc(64);return this.instance.exports.int_mul(z,G,K),this.instance.exports.g1_timesScalar(Q,K,64,$),this.instance.exports.g1_neg($,$),this.instance.exports.g1_add($,P,P),this.instance.exports.g1_affine(N,N),this.instance.exports.g2_affine(R,R),this.instance.exports.g1_affine(P,P),this.instance.exports.g1_fromMontgomery(N,N),this.instance.exports.g2_fromMontgomery(R,R),this.instance.exports.g1_fromMontgomery(P,P),{pi_a:this.bin2g1(this.getBin(N,96)),pi_b:this.bin2g2(this.getBin(R,192)),pi_c:this.bin2g1(this.getBin(P,96))}}}e.exports=async function(e){const a={wasmInitialMemory:5e3};Object.assign(a,e);const t=new s;t.q=c("21888242871839275222246405745257275088696311157297823662689037894645226208583"),t.r=c("21888242871839275222246405745257275088548364400416034343698204186575808495617"),t.n64=Math.floor((t.q.minus(1).bitLength()-1)/64)+1,t.n32=2*t.n64,t.n8=8*t.n64,t.memory=new WebAssembly.Memory({initial:a.wasmInitialMemory}),t.i32=new Uint32Array(t.memory.buffer);const d=await WebAssembly.compile(f.code);let i;function b(e){return function(a){let c;c=a&&a.data?a.data:a,t.working[e]=!1,t.pendingDeferreds[e].resolve(c),t.processWorks()}}t.instance=await WebAssembly.instantiate(d,{env:{memory:t.memory}}),t.pq=f.pq,t.pr=f.pr,t.pr0=t.alloc(192),t.pr1=t.alloc(192),t.workers=[],t.pendingDeferreds=[],t.working=[],i="object"==typeof navigator&&navigator.hardwareConcurrency?navigator.hardwareConcurrency:8;for(let e=0;e{const c=t(9565),f=t(98665),d=t(27351),r=t(56274).cL,n=(t(56274).XL,t(56274).ex,t(56274).Hf),i=t(73248).e,b=t(73248).H;e.exports={bigInt2BytesLE:function(e,a){const t=Array(a);let f=c(e);for(let e=0;efunction(e){let a=e.toString(16);for(;a.length<64;)a="0"+a;return a}(e))).join("")};return e.publicSignals&&(a.publicSignals=r(n(e.publicSignals))),a},genWitnessAndProve:async function(e,a,t,c){const r=function(e,a){const t=new f(b(a)),c=t.calculateWitness(b(e)),d=c.slice(1,t.nPubInputs+t.nOutputs+1);return{witness:c,publicSignals:d}}(a,t),n=function(e){const a=32*e.length,t=new ArrayBuffer(a),c={dataView:new DataView(t),offset:0},f=d(4294967295);for(let a=0;a{const c=t(9565);e.exports.ex=function e(a){if("bigint"==typeof a||a instanceof c)return a.toString(10);if(Array.isArray(a))return a.map(e);if("object"==typeof a){const t={};for(let c in a)t[c]=e(a[c]);return t}return a},e.exports.Hf=function e(a){if("string"==typeof a&&/^[0-9]+$/.test(a))return c(a);if(Array.isArray(a))return a.map(e);if("object"!=typeof a||a instanceof c)return a;{const t={};for(let c in a)t[c]=e(a[c]);return t}},e.exports.cL=function e(a){if("bigInt"==typeof a||a instanceof c){let e=a.toString(16);for(;e.length<64;)e="0"+e;return e="0x"+e,e}if(Array.isArray(a))return a.map(e);if("object"==typeof a){const t={};for(let c in a)t[c]=e(a[c]);return t}return a},e.exports.XL=function e(a){if("string"==typeof a&&/^0x[0-9a-fA-F]+$/.test(a))return c(a);if(Array.isArray(a))return a.map(e);if("object"==typeof a){const t={};for(let c in a)t[c]=e(a[c]);return t}return a}},63282:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.MissingRefError=a.ValidationError=a.CodeGen=a.Name=a.nil=a.stringify=a.str=a._=a.KeywordCxt=a.Ajv=void 0;const c=t(4042),f=t(86144),d=t(36653),r=t(72079),n=["/properties"],i="http://json-schema.org/draft-07/schema";class b extends c.default{_addVocabularies(){super._addVocabularies(),f.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(d.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(r,n):r;this.addMetaSchema(e,i,!1),this.refs["http://json-schema.org/schema"]=i}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}}a.Ajv=b,e.exports=a=b,e.exports.Ajv=b,Object.defineProperty(a,"__esModule",{value:!0}),a.default=b;var o=t(62586);Object.defineProperty(a,"KeywordCxt",{enumerable:!0,get:function(){return o.KeywordCxt}});var s=t(99029);Object.defineProperty(a,"_",{enumerable:!0,get:function(){return s._}}),Object.defineProperty(a,"str",{enumerable:!0,get:function(){return s.str}}),Object.defineProperty(a,"stringify",{enumerable:!0,get:function(){return s.stringify}}),Object.defineProperty(a,"nil",{enumerable:!0,get:function(){return s.nil}}),Object.defineProperty(a,"Name",{enumerable:!0,get:function(){return s.Name}}),Object.defineProperty(a,"CodeGen",{enumerable:!0,get:function(){return s.CodeGen}});var l=t(13558);Object.defineProperty(a,"ValidationError",{enumerable:!0,get:function(){return l.default}});var u=t(34551);Object.defineProperty(a,"MissingRefError",{enumerable:!0,get:function(){return u.default}})},41520:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.regexpCode=a.getEsmExportName=a.getProperty=a.safeStringify=a.stringify=a.strConcat=a.addCodeArg=a.str=a._=a.nil=a._Code=a.Name=a.IDENTIFIER=a._CodeOrName=void 0;class t{}a._CodeOrName=t,a.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class c extends t{constructor(e){if(super(),!a.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}a.Name=c;class f extends t{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,a)=>`${e}${a}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,a)=>(a instanceof c&&(e[a.str]=(e[a.str]||0)+1),e)),{})}}function d(e,...a){const t=[e[0]];let c=0;for(;c{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.or=a.and=a.not=a.CodeGen=a.operators=a.varKinds=a.ValueScopeName=a.ValueScope=a.Scope=a.Name=a.regexpCode=a.stringify=a.getProperty=a.nil=a.strConcat=a.str=a._=void 0;const c=t(41520),f=t(57845);var d=t(41520);Object.defineProperty(a,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(a,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(a,"strConcat",{enumerable:!0,get:function(){return d.strConcat}}),Object.defineProperty(a,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(a,"getProperty",{enumerable:!0,get:function(){return d.getProperty}}),Object.defineProperty(a,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(a,"regexpCode",{enumerable:!0,get:function(){return d.regexpCode}}),Object.defineProperty(a,"Name",{enumerable:!0,get:function(){return d.Name}});var r=t(57845);Object.defineProperty(a,"Scope",{enumerable:!0,get:function(){return r.Scope}}),Object.defineProperty(a,"ValueScope",{enumerable:!0,get:function(){return r.ValueScope}}),Object.defineProperty(a,"ValueScopeName",{enumerable:!0,get:function(){return r.ValueScopeName}}),Object.defineProperty(a,"varKinds",{enumerable:!0,get:function(){return r.varKinds}}),a.operators={GT:new c._Code(">"),GTE:new c._Code(">="),LT:new c._Code("<"),LTE:new c._Code("<="),EQ:new c._Code("==="),NEQ:new c._Code("!=="),NOT:new c._Code("!"),OR:new c._Code("||"),AND:new c._Code("&&"),ADD:new c._Code("+")};class n{optimizeNodes(){return this}optimizeNames(e,a){return this}}class i extends n{constructor(e,a,t){super(),this.varKind=e,this.name=a,this.rhs=t}render({es5:e,_n:a}){const t=e?f.varKinds.var:this.varKind,c=void 0===this.rhs?"":` = ${this.rhs}`;return`${t} ${this.name}${c};`+a}optimizeNames(e,a){if(e[this.name.str])return this.rhs&&(this.rhs=S(this.rhs,e,a)),this}get names(){return this.rhs instanceof c._CodeOrName?this.rhs.names:{}}}class b extends n{constructor(e,a,t){super(),this.lhs=e,this.rhs=a,this.sideEffects=t}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,a){if(!(this.lhs instanceof c.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=S(this.rhs,e,a),this}get names(){return L(this.lhs instanceof c.Name?{}:{...this.lhs.names},this.rhs)}}class o extends b{constructor(e,a,t,c){super(e,t,c),this.op=a}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class s extends n{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class l extends n{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class u extends n{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class h extends n{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,a){return this.code=S(this.code,e,a),this}get names(){return this.code instanceof c._CodeOrName?this.code.names:{}}}class p extends n{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((a,t)=>a+t.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let a=e.length;for(;a--;){const t=e[a].optimizeNodes();Array.isArray(t)?e.splice(a,1,...t):t?e[a]=t:e.splice(a,1)}return e.length>0?this:void 0}optimizeNames(e,a){const{nodes:t}=this;let c=t.length;for(;c--;){const f=t[c];f.optimizeNames(e,a)||(T(e,f.names),t.splice(c,1))}return t.length>0?this:void 0}get names(){return this.nodes.reduce(((e,a)=>k(e,a.names)),{})}}class g extends p{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class m extends p{}class y extends g{}y.kind="else";class x extends g{constructor(e,a){super(a),this.condition=e}render(e){let a=`if(${this.condition})`+super.render(e);return this.else&&(a+="else "+this.else.render(e)),a}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let a=this.else;if(a){const e=a.optimizeNodes();a=this.else=Array.isArray(e)?new y(e):e}return a?!1===e?a instanceof x?a:a.nodes:this.nodes.length?this:new x(N(e),a instanceof x?[a]:a.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,a){var t;if(this.else=null===(t=this.else)||void 0===t?void 0:t.optimizeNames(e,a),super.optimizeNames(e,a)||this.else)return this.condition=S(this.condition,e,a),this}get names(){const e=super.names;return L(e,this.condition),this.else&&k(e,this.else.names),e}}x.kind="if";class A extends g{}A.kind="for";class v extends A{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,a){if(super.optimizeNames(e,a))return this.iteration=S(this.iteration,e,a),this}get names(){return k(super.names,this.iteration.names)}}class w extends A{constructor(e,a,t,c){super(),this.varKind=e,this.name=a,this.from=t,this.to=c}render(e){const a=e.es5?f.varKinds.var:this.varKind,{name:t,from:c,to:d}=this;return`for(${a} ${t}=${c}; ${t}<${d}; ${t}++)`+super.render(e)}get names(){const e=L(super.names,this.from);return L(e,this.to)}}class _ extends A{constructor(e,a,t,c){super(),this.loop=e,this.varKind=a,this.name=t,this.iterable=c}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,a){if(super.optimizeNames(e,a))return this.iterable=S(this.iterable,e,a),this}get names(){return k(super.names,this.iterable.names)}}class I extends g{constructor(e,a,t){super(),this.name=e,this.args=a,this.async=t}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}I.kind="func";class E extends p{render(e){return"return "+super.render(e)}}E.kind="return";class C extends g{render(e){let a="try"+super.render(e);return this.catch&&(a+=this.catch.render(e)),this.finally&&(a+=this.finally.render(e)),a}optimizeNodes(){var e,a;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(a=this.finally)||void 0===a||a.optimizeNodes(),this}optimizeNames(e,a){var t,c;return super.optimizeNames(e,a),null===(t=this.catch)||void 0===t||t.optimizeNames(e,a),null===(c=this.finally)||void 0===c||c.optimizeNames(e,a),this}get names(){const e=super.names;return this.catch&&k(e,this.catch.names),this.finally&&k(e,this.finally.names),e}}class M extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}M.kind="catch";class B extends g{render(e){return"finally"+super.render(e)}}function k(e,a){for(const t in a)e[t]=(e[t]||0)+(a[t]||0);return e}function L(e,a){return a instanceof c._CodeOrName?k(e,a.names):e}function S(e,a,t){return e instanceof c.Name?d(e):(f=e)instanceof c._Code&&f._items.some((e=>e instanceof c.Name&&1===a[e.str]&&void 0!==t[e.str]))?new c._Code(e._items.reduce(((e,a)=>(a instanceof c.Name&&(a=d(a)),a instanceof c._Code?e.push(...a._items):e.push(a),e)),[])):e;var f;function d(e){const c=t[e.str];return void 0===c||1!==a[e.str]?e:(delete a[e.str],c)}}function T(e,a){for(const t in a)e[t]=(e[t]||0)-(a[t]||0)}function N(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:c._`!${O(e)}`}B.kind="finally",a.CodeGen=class{constructor(e,a={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...a,_n:a.lines?"\n":""},this._extScope=e,this._scope=new f.Scope({parent:e}),this._nodes=[new m]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,a){const t=this._extScope.value(e,a);return(this._values[t.prefix]||(this._values[t.prefix]=new Set)).add(t),t}getScopeValue(e,a){return this._extScope.getValue(e,a)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,a,t,c){const f=this._scope.toName(a);return void 0!==t&&c&&(this._constants[f.str]=t),this._leafNode(new i(e,f,t)),f}const(e,a,t){return this._def(f.varKinds.const,e,a,t)}let(e,a,t){return this._def(f.varKinds.let,e,a,t)}var(e,a,t){return this._def(f.varKinds.var,e,a,t)}assign(e,a,t){return this._leafNode(new b(e,a,t))}add(e,t){return this._leafNode(new o(e,a.operators.ADD,t))}code(e){return"function"==typeof e?e():e!==c.nil&&this._leafNode(new h(e)),this}object(...e){const a=["{"];for(const[t,f]of e)a.length>1&&a.push(","),a.push(t),(t!==f||this.opts.es5)&&(a.push(":"),(0,c.addCodeArg)(a,f));return a.push("}"),new c._Code(a)}if(e,a,t){if(this._blockNode(new x(e)),a&&t)this.code(a).else().code(t).endIf();else if(a)this.code(a).endIf();else if(t)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new x(e))}else(){return this._elseNode(new y)}endIf(){return this._endBlockNode(x,y)}_for(e,a){return this._blockNode(e),a&&this.code(a).endFor(),this}for(e,a){return this._for(new v(e),a)}forRange(e,a,t,c,d=(this.opts.es5?f.varKinds.var:f.varKinds.let)){const r=this._scope.toName(e);return this._for(new w(d,r,a,t),(()=>c(r)))}forOf(e,a,t,d=f.varKinds.const){const r=this._scope.toName(e);if(this.opts.es5){const e=a instanceof c.Name?a:this.var("_arr",a);return this.forRange("_i",0,c._`${e}.length`,(a=>{this.var(r,c._`${e}[${a}]`),t(r)}))}return this._for(new _("of",d,r,a),(()=>t(r)))}forIn(e,a,t,d=(this.opts.es5?f.varKinds.var:f.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,c._`Object.keys(${a})`,t);const r=this._scope.toName(e);return this._for(new _("in",d,r,a),(()=>t(r)))}endFor(){return this._endBlockNode(A)}label(e){return this._leafNode(new s(e))}break(e){return this._leafNode(new l(e))}return(e){const a=new E;if(this._blockNode(a),this.code(e),1!==a.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(e,a,t){if(!a&&!t)throw new Error('CodeGen: "try" without "catch" and "finally"');const c=new C;if(this._blockNode(c),this.code(e),a){const e=this.name("e");this._currNode=c.catch=new M(e),a(e)}return t&&(this._currNode=c.finally=new B,this.code(t)),this._endBlockNode(M,B)}throw(e){return this._leafNode(new u(e))}block(e,a){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(a),this}endBlock(e){const a=this._blockStarts.pop();if(void 0===a)throw new Error("CodeGen: not in self-balancing block");const t=this._nodes.length-a;if(t<0||void 0!==e&&t!==e)throw new Error(`CodeGen: wrong number of nodes: ${t} vs ${e} expected`);return this._nodes.length=a,this}func(e,a=c.nil,t,f){return this._blockNode(new I(e,a,t)),f&&this.code(f).endFunc(),this}endFunc(){return this._endBlockNode(I)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,a){const t=this._currNode;if(t instanceof e||a&&t instanceof a)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${a?`${e.kind}/${a.kind}`:e.kind}"`)}_elseNode(e){const a=this._currNode;if(!(a instanceof x))throw new Error('CodeGen: "else" without "if"');return this._currNode=a.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const a=this._nodes;a[a.length-1]=e}},a.not=N;const R=D(a.operators.AND);a.and=function(...e){return e.reduce(R)};const P=D(a.operators.OR);function D(e){return(a,t)=>a===c.nil?t:t===c.nil?a:c._`${O(a)} ${e} ${O(t)}`}function O(e){return e instanceof c.Name?e:c._`(${e})`}a.or=function(...e){return e.reduce(P)}},57845:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.ValueScope=a.ValueScopeName=a.Scope=a.varKinds=a.UsedValueState=void 0;const c=t(41520);class f extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var d;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(d||(a.UsedValueState=d={})),a.varKinds={const:new c.Name("const"),let:new c.Name("let"),var:new c.Name("var")};class r{constructor({prefixes:e,parent:a}={}){this._names={},this._prefixes=e,this._parent=a}toName(e){return e instanceof c.Name?e:this.name(e)}name(e){return new c.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var a,t;if((null===(t=null===(a=this._parent)||void 0===a?void 0:a._prefixes)||void 0===t?void 0:t.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}a.Scope=r;class n extends c.Name{constructor(e,a){super(a),this.prefix=e}setValue(e,{property:a,itemIndex:t}){this.value=e,this.scopePath=c._`.${new c.Name(a)}[${t}]`}}a.ValueScopeName=n;const i=c._`\n`;a.ValueScope=class extends r{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?i:c.nil}}get(){return this._scope}name(e){return new n(e,this._newName(e))}value(e,a){var t;if(void 0===a.ref)throw new Error("CodeGen: ref must be passed in value");const c=this.toName(e),{prefix:f}=c,d=null!==(t=a.key)&&void 0!==t?t:a.ref;let r=this._values[f];if(r){const e=r.get(d);if(e)return e}else r=this._values[f]=new Map;r.set(d,c);const n=this._scope[f]||(this._scope[f]=[]),i=n.length;return n[i]=a.ref,c.setValue(a,{property:f,itemIndex:i}),c}getValue(e,a){const t=this._values[e];if(t)return t.get(a)}scopeRefs(e,a=this._values){return this._reduceValues(a,(a=>{if(void 0===a.scopePath)throw new Error(`CodeGen: name "${a}" has no value`);return c._`${e}${a.scopePath}`}))}scopeCode(e=this._values,a,t){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),a,t)}_reduceValues(e,t,r={},n){let i=c.nil;for(const b in e){const o=e[b];if(!o)continue;const s=r[b]=r[b]||new Map;o.forEach((e=>{if(s.has(e))return;s.set(e,d.Started);let r=t(e);if(r){const t=this.opts.es5?a.varKinds.var:a.varKinds.const;i=c._`${i}${t} ${e} = ${r};${this.opts._n}`}else{if(!(r=null==n?void 0:n(e)))throw new f(e);i=c._`${i}${r}${this.opts._n}`}s.set(e,d.Completed)}))}return i}}},48708:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.extendErrors=a.resetErrorsCount=a.reportExtraError=a.reportError=a.keyword$DataError=a.keywordError=void 0;const c=t(99029),f=t(94227),d=t(42023);function r(e,a){const t=e.const("err",a);e.if(c._`${d.default.vErrors} === null`,(()=>e.assign(d.default.vErrors,c._`[${t}]`)),c._`${d.default.vErrors}.push(${t})`),e.code(c._`${d.default.errors}++`)}function n(e,a){const{gen:t,validateName:f,schemaEnv:d}=e;d.$async?t.throw(c._`new ${e.ValidationError}(${a})`):(t.assign(c._`${f}.errors`,a),t.return(!1))}a.keywordError={message:({keyword:e})=>c.str`must pass "${e}" keyword validation`},a.keyword$DataError={message:({keyword:e,schemaType:a})=>a?c.str`"${e}" keyword must be ${a} ($data)`:c.str`"${e}" keyword is invalid ($data)`},a.reportError=function(e,t=a.keywordError,f,d){const{it:i}=e,{gen:o,compositeRule:s,allErrors:l}=i,u=b(e,t,f);(null!=d?d:s||l)?r(o,u):n(i,c._`[${u}]`)},a.reportExtraError=function(e,t=a.keywordError,c){const{it:f}=e,{gen:i,compositeRule:o,allErrors:s}=f;r(i,b(e,t,c)),o||s||n(f,d.default.vErrors)},a.resetErrorsCount=function(e,a){e.assign(d.default.errors,a),e.if(c._`${d.default.vErrors} !== null`,(()=>e.if(a,(()=>e.assign(c._`${d.default.vErrors}.length`,a)),(()=>e.assign(d.default.vErrors,null)))))},a.extendErrors=function({gen:e,keyword:a,schemaValue:t,data:f,errsCount:r,it:n}){if(void 0===r)throw new Error("ajv implementation error");const i=e.name("err");e.forRange("i",r,d.default.errors,(r=>{e.const(i,c._`${d.default.vErrors}[${r}]`),e.if(c._`${i}.instancePath === undefined`,(()=>e.assign(c._`${i}.instancePath`,(0,c.strConcat)(d.default.instancePath,n.errorPath)))),e.assign(c._`${i}.schemaPath`,c.str`${n.errSchemaPath}/${a}`),n.opts.verbose&&(e.assign(c._`${i}.schema`,t),e.assign(c._`${i}.data`,f))}))};const i={keyword:new c.Name("keyword"),schemaPath:new c.Name("schemaPath"),params:new c.Name("params"),propertyName:new c.Name("propertyName"),message:new c.Name("message"),schema:new c.Name("schema"),parentSchema:new c.Name("parentSchema")};function b(e,a,t){const{createErrors:f}=e.it;return!1===f?c._`{}`:function(e,a,t={}){const{gen:f,it:r}=e,n=[o(r,t),s(e,t)];return function(e,{params:a,message:t},f){const{keyword:r,data:n,schemaValue:b,it:o}=e,{opts:s,propertyName:l,topSchemaRef:u,schemaPath:h}=o;f.push([i.keyword,r],[i.params,"function"==typeof a?a(e):a||c._`{}`]),s.messages&&f.push([i.message,"function"==typeof t?t(e):t]),s.verbose&&f.push([i.schema,b],[i.parentSchema,c._`${u}${h}`],[d.default.data,n]),l&&f.push([i.propertyName,l])}(e,a,n),f.object(...n)}(e,a,t)}function o({errorPath:e},{instancePath:a}){const t=a?c.str`${e}${(0,f.getErrorPath)(a,f.Type.Str)}`:e;return[d.default.instancePath,(0,c.strConcat)(d.default.instancePath,t)]}function s({keyword:e,it:{errSchemaPath:a}},{schemaPath:t,parentSchema:d}){let r=d?a:c.str`${a}/${e}`;return t&&(r=c.str`${r}${(0,f.getErrorPath)(t,f.Type.Str)}`),[i.schemaPath,r]}},73835:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.resolveSchema=a.getCompilingSchema=a.resolveRef=a.compileSchema=a.SchemaEnv=void 0;const c=t(99029),f=t(13558),d=t(42023),r=t(66939),n=t(94227),i=t(62586);class b{constructor(e){var a;let t;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(t=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(a=e.baseId)&&void 0!==a?a:(0,r.normalizeId)(null==t?void 0:t[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==t?void 0:t.$async,this.refs={}}}function o(e){const a=l.call(this,e);if(a)return a;const t=(0,r.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:b}=this.opts.code,{ownProperties:o}=this.opts,s=new c.CodeGen(this.scope,{es5:n,lines:b,ownProperties:o});let u;e.$async&&(u=s.scopeValue("Error",{ref:f.default,code:c._`require("ajv/dist/runtime/validation_error").default`}));const h=s.scopeName("validate");e.validateName=h;const p={gen:s,allErrors:this.opts.allErrors,data:d.default.data,parentData:d.default.parentData,parentDataProperty:d.default.parentDataProperty,dataNames:[d.default.data],dataPathArr:[c.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,c.stringify)(e.schema)}:{ref:e.schema}),validateName:h,ValidationError:u,schema:e.schema,schemaEnv:e,rootId:t,baseId:e.baseId||t,schemaPath:c.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:c._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(e),(0,i.validateFunctionCode)(p),s.optimize(this.opts.code.optimize);const a=s.toString();g=`${s.scopeRefs(d.default.scope)}return ${a}`,this.opts.code.process&&(g=this.opts.code.process(g,e));const t=new Function(`${d.default.self}`,`${d.default.scope}`,g)(this,this.scope.get());if(this.scope.value(h,{ref:t}),t.errors=null,t.schema=e.schema,t.schemaEnv=e,e.$async&&(t.$async=!0),!0===this.opts.code.source&&(t.source={validateName:h,validateCode:a,scopeValues:s._values}),this.opts.unevaluated){const{props:e,items:a}=p;t.evaluated={props:e instanceof c.Name?void 0:e,items:a instanceof c.Name?void 0:a,dynamicProps:e instanceof c.Name,dynamicItems:a instanceof c.Name},t.source&&(t.source.evaluated=(0,c.stringify)(t.evaluated))}return e.validate=t,e}catch(a){throw delete e.validate,delete e.validateName,g&&this.logger.error("Error compiling schema, function code:",g),a}finally{this._compilations.delete(e)}}function s(e){return(0,r.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:o.call(this,e)}function l(e){for(const c of this._compilations)if(t=e,(a=c).schema===t.schema&&a.root===t.root&&a.baseId===t.baseId)return c;var a,t}function u(e,a){let t;for(;"string"==typeof(t=this.refs[a]);)a=t;return t||this.schemas[a]||h.call(this,e,a)}function h(e,a){const t=this.opts.uriResolver.parse(a),c=(0,r._getFullPath)(this.opts.uriResolver,t);let f=(0,r.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&c===f)return g.call(this,t,e);const d=(0,r.normalizeId)(c),n=this.refs[d]||this.schemas[d];if("string"==typeof n){const a=h.call(this,e,n);if("object"!=typeof(null==a?void 0:a.schema))return;return g.call(this,t,a)}if("object"==typeof(null==n?void 0:n.schema)){if(n.validate||o.call(this,n),d===(0,r.normalizeId)(a)){const{schema:a}=n,{schemaId:t}=this.opts,c=a[t];return c&&(f=(0,r.resolveUrl)(this.opts.uriResolver,f,c)),new b({schema:a,schemaId:t,root:e,baseId:f})}return g.call(this,t,n)}}a.SchemaEnv=b,a.compileSchema=o,a.resolveRef=function(e,a,t){var c;t=(0,r.resolveUrl)(this.opts.uriResolver,a,t);const f=e.refs[t];if(f)return f;let d=u.call(this,e,t);if(void 0===d){const f=null===(c=e.localRefs)||void 0===c?void 0:c[t],{schemaId:r}=this.opts;f&&(d=new b({schema:f,schemaId:r,root:e,baseId:a}))}return void 0!==d?e.refs[t]=s.call(this,d):void 0},a.getCompilingSchema=l,a.resolveSchema=h;const p=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function g(e,{baseId:a,schema:t,root:c}){var f;if("/"!==(null===(f=e.fragment)||void 0===f?void 0:f[0]))return;for(const c of e.fragment.slice(1).split("/")){if("boolean"==typeof t)return;const e=t[(0,n.unescapeFragment)(c)];if(void 0===e)return;const f="object"==typeof(t=e)&&t[this.opts.schemaId];!p.has(c)&&f&&(a=(0,r.resolveUrl)(this.opts.uriResolver,a,f))}let d;if("boolean"!=typeof t&&t.$ref&&!(0,n.schemaHasRulesButRef)(t,this.RULES)){const e=(0,r.resolveUrl)(this.opts.uriResolver,a,t.$ref);d=h.call(this,c,e)}const{schemaId:i}=this.opts;return d=d||new b({schema:t,schemaId:i,root:c,baseId:a}),d.schema!==d.root.schema?d:void 0}},42023:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f={data:new c.Name("data"),valCxt:new c.Name("valCxt"),instancePath:new c.Name("instancePath"),parentData:new c.Name("parentData"),parentDataProperty:new c.Name("parentDataProperty"),rootData:new c.Name("rootData"),dynamicAnchors:new c.Name("dynamicAnchors"),vErrors:new c.Name("vErrors"),errors:new c.Name("errors"),this:new c.Name("this"),self:new c.Name("self"),scope:new c.Name("scope"),json:new c.Name("json"),jsonPos:new c.Name("jsonPos"),jsonLen:new c.Name("jsonLen"),jsonPart:new c.Name("jsonPart")};a.default=f},34551:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(66939);class f extends Error{constructor(e,a,t,f){super(f||`can't resolve reference ${t} from id ${a}`),this.missingRef=(0,c.resolveUrl)(e,a,t),this.missingSchema=(0,c.normalizeId)((0,c.getFullPath)(e,this.missingRef))}}a.default=f},66939:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.getSchemaRefs=a.resolveUrl=a.normalizeId=a._getFullPath=a.getFullPath=a.inlineRef=void 0;const c=t(94227),f=t(32017),d=t(7106),r=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);a.inlineRef=function(e,a=!0){return"boolean"==typeof e||(!0===a?!i(e):!!a&&b(e)<=a)};const n=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function i(e){for(const a in e){if(n.has(a))return!0;const t=e[a];if(Array.isArray(t)&&t.some(i))return!0;if("object"==typeof t&&i(t))return!0}return!1}function b(e){let a=0;for(const t in e){if("$ref"===t)return 1/0;if(a++,!r.has(t)&&("object"==typeof e[t]&&(0,c.eachItem)(e[t],(e=>a+=b(e))),a===1/0))return 1/0}return a}function o(e,a="",t){!1!==t&&(a=u(a));const c=e.parse(a);return s(e,c)}function s(e,a){return e.serialize(a).split("#")[0]+"#"}a.getFullPath=o,a._getFullPath=s;const l=/#\/?$/;function u(e){return e?e.replace(l,""):""}a.normalizeId=u,a.resolveUrl=function(e,a,t){return t=u(t),e.resolve(a,t)};const h=/^[a-z_][-a-z0-9._]*$/i;a.getSchemaRefs=function(e,a){if("boolean"==typeof e)return{};const{schemaId:t,uriResolver:c}=this.opts,r=u(e[t]||a),n={"":r},i=o(c,r,!1),b={},s=new Set;return d(e,{allKeys:!0},((e,a,c,f)=>{if(void 0===f)return;const d=i+a;let r=n[f];function o(a){const t=this.opts.uriResolver.resolve;if(a=u(r?t(r,a):a),s.has(a))throw p(a);s.add(a);let c=this.refs[a];return"string"==typeof c&&(c=this.refs[c]),"object"==typeof c?l(e,c.schema,a):a!==u(d)&&("#"===a[0]?(l(e,b[a],a),b[a]=e):this.refs[a]=d),a}function g(e){if("string"==typeof e){if(!h.test(e))throw new Error(`invalid anchor "${e}"`);o.call(this,`#${e}`)}}"string"==typeof e[t]&&(r=o.call(this,e[t])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),n[a]=r})),b;function l(e,a,t){if(void 0!==a&&!f(e,a))throw p(t)}function p(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},10396:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.getRules=a.isJSONType=void 0;const t=new Set(["string","number","integer","boolean","null","object","array"]);a.isJSONType=function(e){return"string"==typeof e&&t.has(e)},a.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},94227:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.checkStrictMode=a.getErrorPath=a.Type=a.useFunc=a.setEvaluated=a.evaluatedPropsToName=a.mergeEvaluated=a.eachItem=a.unescapeJsonPointer=a.escapeJsonPointer=a.escapeFragment=a.unescapeFragment=a.schemaRefOrVal=a.schemaHasRulesButRef=a.schemaHasRules=a.checkUnknownRules=a.alwaysValidSchema=a.toHash=void 0;const c=t(99029),f=t(41520);function d(e,a=e.schema){const{opts:t,self:c}=e;if(!t.strictSchema)return;if("boolean"==typeof a)return;const f=c.RULES.keywords;for(const t in a)f[t]||h(e,`unknown keyword: "${t}"`)}function r(e,a){if("boolean"==typeof e)return!e;for(const t in e)if(a[t])return!0;return!1}function n(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function i(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function b({mergeNames:e,mergeToName:a,mergeValues:t,resultToName:f}){return(d,r,n,i)=>{const b=void 0===n?r:n instanceof c.Name?(r instanceof c.Name?e(d,r,n):a(d,r,n),n):r instanceof c.Name?(a(d,n,r),r):t(r,n);return i!==c.Name||b instanceof c.Name?b:f(d,b)}}function o(e,a){if(!0===a)return e.var("props",!0);const t=e.var("props",c._`{}`);return void 0!==a&&s(e,t,a),t}function s(e,a,t){Object.keys(t).forEach((t=>e.assign(c._`${a}${(0,c.getProperty)(t)}`,!0)))}a.toHash=function(e){const a={};for(const t of e)a[t]=!0;return a},a.alwaysValidSchema=function(e,a){return"boolean"==typeof a?a:0===Object.keys(a).length||(d(e,a),!r(a,e.self.RULES.all))},a.checkUnknownRules=d,a.schemaHasRules=r,a.schemaHasRulesButRef=function(e,a){if("boolean"==typeof e)return!e;for(const t in e)if("$ref"!==t&&a.all[t])return!0;return!1},a.schemaRefOrVal=function({topSchemaRef:e,schemaPath:a},t,f,d){if(!d){if("number"==typeof t||"boolean"==typeof t)return t;if("string"==typeof t)return c._`${t}`}return c._`${e}${a}${(0,c.getProperty)(f)}`},a.unescapeFragment=function(e){return i(decodeURIComponent(e))},a.escapeFragment=function(e){return encodeURIComponent(n(e))},a.escapeJsonPointer=n,a.unescapeJsonPointer=i,a.eachItem=function(e,a){if(Array.isArray(e))for(const t of e)a(t);else a(e)},a.mergeEvaluated={props:b({mergeNames:(e,a,t)=>e.if(c._`${t} !== true && ${a} !== undefined`,(()=>{e.if(c._`${a} === true`,(()=>e.assign(t,!0)),(()=>e.assign(t,c._`${t} || {}`).code(c._`Object.assign(${t}, ${a})`)))})),mergeToName:(e,a,t)=>e.if(c._`${t} !== true`,(()=>{!0===a?e.assign(t,!0):(e.assign(t,c._`${t} || {}`),s(e,t,a))})),mergeValues:(e,a)=>!0===e||{...e,...a},resultToName:o}),items:b({mergeNames:(e,a,t)=>e.if(c._`${t} !== true && ${a} !== undefined`,(()=>e.assign(t,c._`${a} === true ? true : ${t} > ${a} ? ${t} : ${a}`))),mergeToName:(e,a,t)=>e.if(c._`${t} !== true`,(()=>e.assign(t,!0===a||c._`${t} > ${a} ? ${t} : ${a}`))),mergeValues:(e,a)=>!0===e||Math.max(e,a),resultToName:(e,a)=>e.var("items",a)})},a.evaluatedPropsToName=o,a.setEvaluated=s;const l={};var u;function h(e,a,t=e.opts.strictSchema){if(t){if(a=`strict mode: ${a}`,!0===t)throw new Error(a);e.self.logger.warn(a)}}a.useFunc=function(e,a){return e.scopeValue("func",{ref:a,code:l[a.code]||(l[a.code]=new f._Code(a.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(u||(a.Type=u={})),a.getErrorPath=function(e,a,t){if(e instanceof c.Name){const f=a===u.Num;return t?f?c._`"[" + ${e} + "]"`:c._`"['" + ${e} + "']"`:f?c._`"/" + ${e}`:c._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return t?(0,c.getProperty)(e).toString():"/"+n(e)},a.checkStrictMode=h},7887:(e,a)=>{"use strict";function t(e,a){return a.rules.some((a=>c(e,a)))}function c(e,a){var t;return void 0!==e[a.keyword]||(null===(t=a.definition.implements)||void 0===t?void 0:t.some((a=>void 0!==e[a])))}Object.defineProperty(a,"__esModule",{value:!0}),a.shouldUseRule=a.shouldUseGroup=a.schemaHasRulesForType=void 0,a.schemaHasRulesForType=function({schema:e,self:a},c){const f=a.RULES.types[c];return f&&!0!==f&&t(e,f)},a.shouldUseGroup=t,a.shouldUseRule=c},28727:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.boolOrEmptySchema=a.topBoolOrEmptySchema=void 0;const c=t(48708),f=t(99029),d=t(42023),r={message:"boolean schema is false"};function n(e,a){const{gen:t,data:f}=e,d={gen:t,keyword:"false schema",data:f,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,c.reportError)(d,r,void 0,a)}a.topBoolOrEmptySchema=function(e){const{gen:a,schema:t,validateName:c}=e;!1===t?n(e,!1):"object"==typeof t&&!0===t.$async?a.return(d.default.data):(a.assign(f._`${c}.errors`,null),a.return(!0))},a.boolOrEmptySchema=function(e,a){const{gen:t,schema:c}=e;!1===c?(t.var(a,!1),n(e)):t.var(a,!0)}},10208:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.reportTypeError=a.checkDataTypes=a.checkDataType=a.coerceAndCheckDataType=a.getJSONTypes=a.getSchemaTypes=a.DataType=void 0;const c=t(10396),f=t(7887),d=t(48708),r=t(99029),n=t(94227);var i;function b(e){const a=Array.isArray(e)?e:e?[e]:[];if(a.every(c.isJSONType))return a;throw new Error("type must be JSONType or JSONType[]: "+a.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(i||(a.DataType=i={})),a.getSchemaTypes=function(e){const a=b(e.type);if(a.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!a.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&a.push("null")}return a},a.getJSONTypes=b,a.coerceAndCheckDataType=function(e,a){const{gen:t,data:c,opts:d}=e,n=function(e,a){return a?e.filter((e=>o.has(e)||"array"===a&&"array"===e)):[]}(a,d.coerceTypes),b=a.length>0&&!(0===n.length&&1===a.length&&(0,f.schemaHasRulesForType)(e,a[0]));if(b){const f=l(a,c,d.strictNumbers,i.Wrong);t.if(f,(()=>{n.length?function(e,a,t){const{gen:c,data:f,opts:d}=e,n=c.let("dataType",r._`typeof ${f}`),i=c.let("coerced",r._`undefined`);"array"===d.coerceTypes&&c.if(r._`${n} == 'object' && Array.isArray(${f}) && ${f}.length == 1`,(()=>c.assign(f,r._`${f}[0]`).assign(n,r._`typeof ${f}`).if(l(a,f,d.strictNumbers),(()=>c.assign(i,f))))),c.if(r._`${i} !== undefined`);for(const e of t)(o.has(e)||"array"===e&&"array"===d.coerceTypes)&&b(e);function b(e){switch(e){case"string":return void c.elseIf(r._`${n} == "number" || ${n} == "boolean"`).assign(i,r._`"" + ${f}`).elseIf(r._`${f} === null`).assign(i,r._`""`);case"number":return void c.elseIf(r._`${n} == "boolean" || ${f} === null +!function(e,a){"object"==typeof exports&&"object"==typeof module?module.exports=a():"function"==typeof define&&define.amd?define([],a):"object"==typeof exports?exports.Tornado=a():e.Tornado=a()}(self,(()=>(()=>{var __webpack_modules__={15795:(e,a,t)=>{const c=t(26613);a.cidForWeb=e=>{let a=new c(e);0===a.version&&(a=a.toV1());let t=a.toString("base32");if(t.length>63){const e=a.toString("base36");if(e.length<=63)return e;throw new TypeError("CID is longer than DNS limit of 63 characters and is not compatible with public gateways")}return t},a.cidV0ToV1Base32=e=>{let a=new c(e);return 0===a.version&&(a=a.toV1()),a.toString("base32")}},81810:(e,a,t)=>{const c=t(52021),f=t(14243),{hexStringToBuffer:d,profiles:r}=t(55262),{cidForWeb:n,cidV0ToV1Base32:i}=t(15795);e.exports={helpers:{cidForWeb:n,cidV0ToV1Base32:i},decode:function(e){const a=d(e),t=c.getCodec(a),f=c.rmPrefix(a);let n=r[t];return n||(n=r.default),n.decode(f)},fromIpfs:function(e){return this.encode("ipfs-ns",e)},fromSkylink:function(e){return this.encode("skynet-ns",e)},fromSwarm:function(e){return this.encode("swarm-ns",e)},fromArweave:function(e){return this.encode("arweave-ns",e)},encode:function(e,a){let t=r[e];t||(t=r.default);const d=t.encode(a);return f.toHexString(c.addPrefix(e,d))},getCodec:function(e){let a=d(e);return c.getCodec(a)}}},55262:(e,a,t)=>{var c=t(62045).hp;const f=t(26613),d=t(14243),r=t(8127),n=e=>{let a=e.slice(0,2),t=e.slice(2),c="";return c="0x"===a?t:e,d.fromHexString(c)},i=e=>{try{const{multihash:a}=e;if(a.length<38){const e=d.decode(a);if("identity"===e.name&&e.length<36)return!1}return!0}catch(e){return!1}},b={skynet:e=>r.toUint8Array(e),swarm:e=>{const a=d.encode(n(e),"keccak-256");return new f(1,"swarm-manifest",a).bytes},ipfs:e=>new f(e).toV1().bytes,ipns:e=>{const a=new f(e);if(!i(a))throw Error("ipns-ns allows only valid cryptographic libp2p-key identifiers, try using ED25519 pubkey instead");return new f(1,"libp2p-key",a.multihash).bytes},utf8:e=>c.from(e,"utf8"),arweave:e=>r.toUint8Array(e)},o={hexMultiHash:e=>{const a=new f(e);return d.decode(a.multihash).digest.toString("hex")},ipfs:e=>{const a=new f(e).toV1();return a.toString("libp2p-key"===a.codec?"base36":"base32")},ipns:e=>{const a=new f(e).toV1();return i(a)?a.toString("base36"):(console.warn("[ensdomains/content-hash] use of non-cryptographic identifiers in ipns-ns is deprecated and will be removed, migrate to ED25519 libp2p-key"),String(d.decode(new f(e).multihash).digest))},utf8:e=>e.toString("utf8"),base64:e=>r.fromUint8Array(e,!0)},s={"skynet-ns":{encode:b.skynet,decode:o.base64},"swarm-ns":{encode:b.swarm,decode:o.hexMultiHash},"ipfs-ns":{encode:b.ipfs,decode:o.ipfs},"ipns-ns":{encode:b.ipns,decode:o.ipns},"arweave-ns":{encode:b.arweave,decode:o.base64},default:{encode:b.utf8,decode:o.utf8}};a.hexStringToBuffer=n,a.profiles=s},66289:(e,a)=>{"use strict";function t(e){if(Array.isArray(e)){const a=[];let c=0;for(let f=0;fe.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return e.slice(a,t)}function f(e){if(0===e[0])throw new Error("invalid RLP: extra zeros");return o(b(e))}function d(e,a){if(e<56)return Uint8Array.from([e+a]);const t=h(e),c=h(a+55+t.length/2);return Uint8Array.from(s(c+t))}function r(e,a=!1){if(null==e||0===e.length)return Uint8Array.from([]);const t=n(g(e));if(a)return t;if(0!==t.remainder.length)throw new Error("invalid RLP: remainder must be zero");return t.data}function n(e){let a,t,d,r,i;const b=[],o=e[0];if(o<=127)return{data:e.slice(0,1),remainder:e.slice(1)};if(o<=183){if(a=o-127,d=128===o?Uint8Array.from([]):c(e,1,a),2===a&&d[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:d,remainder:e.slice(a)}}if(o<=191){if(t=o-182,e.length-1e.length)throw new Error("invalid RLP: total length is larger than the data");for(r=c(e,t,d);r.length;)i=n(r),b.push(i.data),r=i.remainder;return{data:b,remainder:e.slice(d)}}}Object.defineProperty(a,"__esModule",{value:!0}),a.RLP=a.utils=a.decode=a.encode=void 0,a.encode=t,a.decode=r;const i=Array.from({length:256},((e,a)=>a.toString(16).padStart(2,"0")));function b(e){let a="";for(let t=0;te+a.length),0),t=new Uint8Array(a);for(let a=0,c=0;a=2&&"0"===e[0]&&"x"===e[1]}function g(e){if(e instanceof Uint8Array)return e;if("string"==typeof e)return p(e)?s((a="string"!=typeof(t=e)?t:p(t)?t.slice(2):t).length%2?`0${a}`:a):u(e);var a,t;if("number"==typeof e||"bigint"==typeof e)return e?s(h(e)):Uint8Array.from([]);if(null==e)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof e)}a.utils={bytesToHex:b,concatBytes:l,hexToBytes:s,utf8ToBytes:u},a.RLP={encode:t,decode:r}},16284:(e,a,t)=>{"use strict";var c=t(62045).hp;Object.defineProperty(a,"__esModule",{value:!0}),a.accountBodyToRLP=a.accountBodyToSlim=a.accountBodyFromSlim=a.isZeroAddress=a.zeroAddress=a.importPublic=a.privateToAddress=a.privateToPublic=a.publicToAddress=a.pubToAddress=a.isValidPublic=a.isValidPrivate=a.generateAddress2=a.generateAddress=a.isValidChecksumAddress=a.toChecksumAddress=a.isValidAddress=a.Account=void 0;const f=t(66289),d=t(32019),r=t(26513),n=t(82672),i=t(77312),b=t(89838),o=t(35546),s=t(59498),l=BigInt(0);class u{constructor(e=l,a=l,t=b.KECCAK256_RLP,c=b.KECCAK256_NULL){this.nonce=e,this.balance=a,this.storageRoot=t,this.codeHash=c,this._validate()}static fromAccountData(e){const{nonce:a,balance:t,storageRoot:c,codeHash:f}=e;return new u(void 0!==a?(0,i.bufferToBigInt)((0,i.toBuffer)(a)):void 0,void 0!==t?(0,i.bufferToBigInt)((0,i.toBuffer)(t)):void 0,void 0!==c?(0,i.toBuffer)(c):void 0,void 0!==f?(0,i.toBuffer)(f):void 0)}static fromRlpSerializedAccount(e){const a=(0,i.arrToBufArr)(f.RLP.decode(Uint8Array.from(e)));if(!Array.isArray(a))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(a)}static fromValuesArray(e){const[a,t,c,f]=e;return new u((0,i.bufferToBigInt)(a),(0,i.bufferToBigInt)(t),c,f)}_validate(){if(this.nonce=8?l+=t[e].toUpperCase():l+=t[e];return l},a.isValidChecksumAddress=function(e,t){return(0,a.isValidAddress)(e)&&(0,a.toChecksumAddress)(e,t)===e},a.generateAddress=function(e,a){return(0,o.assertIsBuffer)(e),(0,o.assertIsBuffer)(a),(0,i.bufferToBigInt)(a)===BigInt(0)?c.from((0,d.keccak256)(f.RLP.encode((0,i.bufArrToArr)([e,null])))).slice(-20):c.from((0,d.keccak256)(f.RLP.encode((0,i.bufArrToArr)([e,a])))).slice(-20)},a.generateAddress2=function(e,a,t){if((0,o.assertIsBuffer)(e),(0,o.assertIsBuffer)(a),(0,o.assertIsBuffer)(t),20!==e.length)throw new Error("Expected from to be of length 20");if(32!==a.length)throw new Error("Expected salt to be of length 32");const f=(0,d.keccak256)(c.concat([c.from("ff","hex"),e,a,(0,d.keccak256)(t)]));return(0,i.toBuffer)(f).slice(-20)},a.isValidPrivate=function(e){return r.secp256k1.utils.isValidPrivateKey(e)},a.isValidPublic=function(e,a=!1){if((0,o.assertIsBuffer)(e),64===e.length)try{return r.secp256k1.ProjectivePoint.fromHex(c.concat([c.from([4]),e])),!0}catch(e){return!1}if(!a)return!1;try{return r.secp256k1.ProjectivePoint.fromHex(e),!0}catch(e){return!1}},a.pubToAddress=function(e,a=!1){if((0,o.assertIsBuffer)(e),a&&64!==e.length&&(e=c.from(r.secp256k1.ProjectivePoint.fromHex(e).toRawBytes(!1).slice(1))),64!==e.length)throw new Error("Expected pubKey to be of length 64");return c.from((0,d.keccak256)(e)).slice(-20)},a.publicToAddress=a.pubToAddress,a.privateToPublic=function(e){return(0,o.assertIsBuffer)(e),c.from(r.secp256k1.ProjectivePoint.fromPrivateKey(e).toRawBytes(!1).slice(1))},a.privateToAddress=function(e){return(0,a.publicToAddress)((0,a.privateToPublic)(e))},a.importPublic=function(e){return(0,o.assertIsBuffer)(e),64!==e.length&&(e=c.from(r.secp256k1.ProjectivePoint.fromHex(e).toRawBytes(!1).slice(1))),e},a.zeroAddress=function(){const e=(0,i.zeros)(20);return(0,i.bufferToHex)(e)},a.isZeroAddress=function(e){try{(0,o.assertIsString)(e)}catch(e){return!1}return(0,a.zeroAddress)()===e},a.accountBodyFromSlim=h;const p=new Uint8Array(0);a.accountBodyToSlim=function(e){const[a,t,c,f]=e;return[a,t,(0,i.arrToBufArr)(c).equals(b.KECCAK256_RLP)?p:c,(0,i.arrToBufArr)(f).equals(b.KECCAK256_NULL)?p:f]},a.accountBodyToRLP=function(e,a=!0){const t=a?h(e):e;return(0,i.arrToBufArr)(f.RLP.encode(t))}},86727:(e,a,t)=>{"use strict";var c=t(62045).hp;Object.defineProperty(a,"__esModule",{value:!0}),a.Address=void 0;const f=t(16284),d=t(77312);class r{constructor(e){if(20!==e.length)throw new Error("Invalid address length");this.buf=e}static zero(){return new r((0,d.zeros)(20))}static fromString(e){if(!(0,f.isValidAddress)(e))throw new Error("Invalid address");return new r((0,d.toBuffer)(e))}static fromPublicKey(e){if(!c.isBuffer(e))throw new Error("Public key should be Buffer");const a=(0,f.pubToAddress)(e);return new r(a)}static fromPrivateKey(e){if(!c.isBuffer(e))throw new Error("Private key should be Buffer");const a=(0,f.privateToAddress)(e);return new r(a)}static generate(e,a){if("bigint"!=typeof a)throw new Error("Expected nonce to be a bigint");return new r((0,f.generateAddress)(e.buf,(0,d.bigIntToBuffer)(a)))}static generate2(e,a,t){if(!c.isBuffer(a))throw new Error("Expected salt to be a Buffer");if(!c.isBuffer(t))throw new Error("Expected initCode to be a Buffer");return new r((0,f.generateAddress2)(e.buf,a,t))}equals(e){return this.buf.equals(e.buf)}isZero(){return this.equals(r.zero())}isPrecompileOrSystemAddress(){const e=(0,d.bufferToBigInt)(this.buf),a=BigInt(0),t=BigInt("0xffff");return e>=a&&e<=t}toString(){return"0x"+this.buf.toString("hex")}toBuffer(){return c.from(this.buf)}}a.Address=r},98421:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.AsyncEventEmitter=void 0;const c=t(37007);class f extends c.EventEmitter{emit(e,...a){let[t,c]=a;const f=this;let d=f._events[e]??[];return void 0===c&&"function"==typeof t&&(c=t,t=void 0),"newListener"!==e&&"removeListener"!==e||(t={event:t,fn:c},c=void 0),d=Array.isArray(d)?d:[d],async function(e,a,t){let c;for await(const f of a)try{f.length<2?f.call(e,t):await new Promise(((a,c)=>{f.call(e,t,(e=>{e?c(e):a()}))}))}catch(e){c=e}if(c)throw c}(f,d.slice(),t).then(c).catch(c),f.listenerCount(e)>0}once(e,a){const t=this;let c;if("function"!=typeof a)throw new TypeError("listener must be a function");return c=a.length>=2?function(f,d){t.removeListener(e,c),a(f,d)}:function(f){t.removeListener(e,c),a(f,c)},t.on(e,c),t}first(e,a){let t=this._events[e]??[];if("function"!=typeof a)throw new TypeError("listener must be a function");return Array.isArray(t)||(this._events[e]=t=[t]),t.unshift(a),this}before(e,a,t){return this.beforeOrAfter(e,a,t)}after(e,a,t){return this.beforeOrAfter(e,a,t,"after")}beforeOrAfter(e,a,t,c){let f,d,r=this._events[e]??[];const n="after"===c?1:0;if("function"!=typeof t)throw new TypeError("listener must be a function");if("function"!=typeof a)throw new TypeError("target must be a function");for(Array.isArray(r)||(this._events[e]=r=[r]),d=r.length,f=r.length;f--;)if(r[f]===a){d=f+n;break}return r.splice(d,0,t),this}on(e,a){return super.on(e,a)}addListener(e,a){return super.addListener(e,a)}prependListener(e,a){return super.prependListener(e,a)}prependOnceListener(e,a){return super.prependOnceListener(e,a)}removeAllListeners(e){return super.removeAllListeners(e)}removeListener(e,a){return super.removeListener(e,a)}eventNames(){return super.eventNames()}listeners(e){return super.listeners(e)}listenerCount(e){return super.listenerCount(e)}getMaxListeners(){return super.getMaxListeners()}setMaxListeners(e){return super.setMaxListeners(e)}}a.AsyncEventEmitter=f},77312:(e,a,t)=>{"use strict";var c=t(62045).hp;Object.defineProperty(a,"__esModule",{value:!0}),a.intToUnpaddedBuffer=a.bigIntToUnpaddedBuffer=a.bigIntToHex=a.bufArrToArr=a.arrToBufArr=a.validateNoLeadingZeroes=a.baToJSON=a.toUtf8=a.short=a.addHexPrefix=a.toUnsigned=a.fromSigned=a.bufferToInt=a.bigIntToBuffer=a.bufferToBigInt=a.bufferToHex=a.toBuffer=a.unpadHexString=a.unpadArray=a.unpadBuffer=a.setLengthRight=a.setLengthLeft=a.zeros=a.intToBuffer=a.intToHex=void 0;const f=t(35546),d=t(59498);a.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Received an invalid integer type: ${e}`);return`0x${e.toString(16)}`},a.intToBuffer=function(e){const t=(0,a.intToHex)(e);return c.from((0,d.padToEven)(t.slice(2)),"hex")},a.zeros=function(e){return c.allocUnsafe(e).fill(0)};const r=function(e,t,c){const f=(0,a.zeros)(t);return c?e.length0&&"0"===a.toString();)a=(e=e.slice(1))[0];return e};function i(e){const t=(0,a.bufferToHex)(e);return"0x"===t?BigInt(0):BigInt(t)}function b(e){return(0,a.toBuffer)("0x"+e.toString(16))}a.unpadBuffer=function(e){return(0,f.assertIsBuffer)(e),n(e)},a.unpadArray=function(e){return(0,f.assertIsArray)(e),n(e)},a.unpadHexString=function(e){return(0,f.assertIsHexString)(e),e=(0,d.stripHexPrefix)(e),"0x"+n(e)},a.toBuffer=function(e){if(null==e)return c.allocUnsafe(0);if(c.isBuffer(e))return c.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return c.from(e);if("string"==typeof e){if(!(0,d.isHexString)(e))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${e}`);return c.from((0,d.padToEven)((0,d.stripHexPrefix)(e)),"hex")}if("number"==typeof e)return(0,a.intToBuffer)(e);if("bigint"==typeof e){if(e0&&0===t[0])throw new Error(`${a} cannot have leading zeroes, received: ${t.toString("hex")}`)},a.arrToBufArr=function e(a){return Array.isArray(a)?a.map((a=>e(a))):c.from(a)},a.bufArrToArr=function e(a){return Array.isArray(a)?a.map((a=>e(a))):Uint8Array.from(a??[])},a.bigIntToHex=e=>"0x"+e.toString(16),a.bigIntToUnpaddedBuffer=function(e){return(0,a.unpadBuffer)(b(e))},a.intToUnpaddedBuffer=function(e){return(0,a.unpadBuffer)((0,a.intToBuffer)(e))}},89838:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.MAX_WITHDRAWALS_PER_PAYLOAD=a.RLP_EMPTY_STRING=a.KECCAK256_RLP=a.KECCAK256_RLP_S=a.KECCAK256_RLP_ARRAY=a.KECCAK256_RLP_ARRAY_S=a.KECCAK256_NULL=a.KECCAK256_NULL_S=a.TWO_POW256=a.SECP256K1_ORDER_DIV_2=a.SECP256K1_ORDER=a.MAX_INTEGER_BIGINT=a.MAX_INTEGER=a.MAX_UINT64=void 0;const c=t(48287),f=t(26513);a.MAX_UINT64=BigInt("0xffffffffffffffff"),a.MAX_INTEGER=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),a.MAX_INTEGER_BIGINT=BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935"),a.SECP256K1_ORDER=f.secp256k1.CURVE.n,a.SECP256K1_ORDER_DIV_2=f.secp256k1.CURVE.n/BigInt(2),a.TWO_POW256=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),a.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",a.KECCAK256_NULL=c.Buffer.from(a.KECCAK256_NULL_S,"hex"),a.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",a.KECCAK256_RLP_ARRAY=c.Buffer.from(a.KECCAK256_RLP_ARRAY_S,"hex"),a.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",a.KECCAK256_RLP=c.Buffer.from(a.KECCAK256_RLP_S,"hex"),a.RLP_EMPTY_STRING=c.Buffer.from([128]),a.MAX_WITHDRAWALS_PER_PAYLOAD=16},45062:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.compactBytesToNibbles=a.bytesToNibbles=a.nibblesToCompactBytes=a.nibblesToBytes=a.hasTerminator=void 0,a.hasTerminator=e=>e.length>0&&16===e[e.length-1],a.nibblesToBytes=(e,a)=>{for(let t=0,c=0;c{let t=0;(0,a.hasTerminator)(e)&&(t=1,e=e.subarray(0,e.length-1));const c=new Uint8Array(e.length/2+1);return c[0]=t<<5,1&~e.length||(c[0]|=16,c[0]|=e[0],e=e.subarray(1)),(0,a.nibblesToBytes)(e,c.subarray(1)),c},a.bytesToNibbles=e=>{const a=2*e.length+1,t=new Uint8Array(a);for(let a=0;a{if(0===e.length)return e;let t=(0,a.bytesToNibbles)(e);t[0]<2&&(t=t.subarray(0,t.length-1));const c=2-(1&t[0]);return t.subarray(c)}},35546:(e,a,t)=>{"use strict";var c=t(62045).hp;Object.defineProperty(a,"__esModule",{value:!0}),a.assertIsString=a.assertIsArray=a.assertIsBuffer=a.assertIsHexString=void 0;const f=t(59498);a.assertIsHexString=function(e){if(!(0,f.isHexString)(e))throw new Error(`This method only supports 0x-prefixed hex strings but input was: ${e}`)},a.assertIsBuffer=function(e){if(!c.isBuffer(e))throw new Error(`This method only supports Buffer but input was: ${e}`)},a.assertIsArray=function(e){if(!Array.isArray(e))throw new Error(`This method only supports number arrays but input was: ${e}`)},a.assertIsString=function(e){if("string"!=typeof e)throw new Error(`This method only supports strings but input was: ${e}`)}},68683:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),a.toAscii=a.stripHexPrefix=a.padToEven=a.isHexString=a.isHexPrefixed=a.getKeys=a.getBinarySize=a.fromUtf8=a.fromAscii=a.arrayContainsArray=void 0,f(t(89838),a),f(t(52652),a),f(t(16284),a),f(t(86727),a),f(t(37380),a),f(t(92133),a),f(t(77312),a),f(t(42666),a),f(t(45062),a),f(t(98421),a);var d=t(59498);Object.defineProperty(a,"arrayContainsArray",{enumerable:!0,get:function(){return d.arrayContainsArray}}),Object.defineProperty(a,"fromAscii",{enumerable:!0,get:function(){return d.fromAscii}}),Object.defineProperty(a,"fromUtf8",{enumerable:!0,get:function(){return d.fromUtf8}}),Object.defineProperty(a,"getBinarySize",{enumerable:!0,get:function(){return d.getBinarySize}}),Object.defineProperty(a,"getKeys",{enumerable:!0,get:function(){return d.getKeys}}),Object.defineProperty(a,"isHexPrefixed",{enumerable:!0,get:function(){return d.isHexPrefixed}}),Object.defineProperty(a,"isHexString",{enumerable:!0,get:function(){return d.isHexString}}),Object.defineProperty(a,"padToEven",{enumerable:!0,get:function(){return d.padToEven}}),Object.defineProperty(a,"stripHexPrefix",{enumerable:!0,get:function(){return d.stripHexPrefix}}),Object.defineProperty(a,"toAscii",{enumerable:!0,get:function(){return d.toAscii}}),f(t(31708),a),f(t(81862),a)},59498:(e,a,t)=>{"use strict";var c=t(62045).hp;function f(e){if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type "+typeof e);return"0"===e[0]&&"x"===e[1]}function d(e){let a=e;if("string"!=typeof a)throw new Error("[padToEven] value must be type 'string', received "+typeof a);return a.length%2&&(a=`0${a}`),a}Object.defineProperty(a,"__esModule",{value:!0}),a.isHexString=a.getKeys=a.fromAscii=a.fromUtf8=a.toAscii=a.arrayContainsArray=a.getBinarySize=a.padToEven=a.stripHexPrefix=a.isHexPrefixed=void 0,a.isHexPrefixed=f,a.stripHexPrefix=e=>{if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received "+typeof e);return f(e)?e.slice(2):e},a.padToEven=d,a.getBinarySize=function(e){if("string"!=typeof e)throw new Error("[getBinarySize] method requires input type 'string', received "+typeof e);return c.byteLength(e,"utf8")},a.arrayContainsArray=function(e,a,t){if(!0!==Array.isArray(e))throw new Error(`[arrayContainsArray] method requires input 'superset' to be an array, got type '${typeof e}'`);if(!0!==Array.isArray(a))throw new Error(`[arrayContainsArray] method requires input 'subset' to be an array, got type '${typeof a}'`);return a[!0===t?"some":"every"]((a=>e.indexOf(a)>=0))},a.toAscii=function(e){let a="",t=0;const c=e.length;for("0x"===e.substring(0,2)&&(t=2);t0&&e.length!==2+2*a)}},31708:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.Lock=void 0,a.Lock=class{constructor(){this.permits=1,this.promiseResolverQueue=[]}async acquire(){return this.permits>0?(this.permits-=1,Promise.resolve(!0)):new Promise((e=>this.promiseResolverQueue.push(e)))}release(){if(this.permits+=1,this.permits>1&&this.promiseResolverQueue.length>0)console.warn("Lock.permits should never be > 0 when there is someone waiting.");else if(1===this.permits&&this.promiseResolverQueue.length>0){this.permits-=1;const e=this.promiseResolverQueue.shift();e&&e(!0)}}}},81862:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.getProvider=a.fetchFromProvider=void 0;const c=t(6215);a.fetchFromProvider=async(e,a)=>(await(0,c.default)(e,{headers:{"content-type":"application/json"},type:"json",data:{method:a.method,params:a.params,jsonrpc:"2.0",id:1}})).result,a.getProvider=e=>{if("string"==typeof e)return e;if(void 0!==e?.connection?.url)return e.connection.url;throw new Error("Must provide valid provider URL or Web3Provider")}},92133:(e,a,t)=>{"use strict";var c=t(62045).hp;Object.defineProperty(a,"__esModule",{value:!0}),a.hashPersonalMessage=a.isValidSignature=a.fromRpcSig=a.toCompactSig=a.toRpcSig=a.ecrecover=a.ecsign=void 0;const f=t(32019),d=t(26513),r=t(77312),n=t(89838),i=t(35546);function b(e,a){return e===BigInt(0)||e===BigInt(1)?e:void 0===a?e-BigInt(27):e-(a*BigInt(2)+BigInt(35))}function o(e){return e===BigInt(0)||e===BigInt(1)}a.ecsign=function(e,a,t){const f=d.secp256k1.sign(e,a),r=f.toCompactRawBytes();return{r:c.from(r.slice(0,32)),s:c.from(r.slice(32,64)),v:void 0===t?BigInt(f.recovery+27):BigInt(f.recovery+35)+BigInt(t)*BigInt(2)}},a.ecrecover=function(e,a,t,f,n){const i=c.concat([(0,r.setLengthLeft)(t,32),(0,r.setLengthLeft)(f,32)],64),s=b(a,n);if(!o(s))throw new Error("Invalid signature v value");const l=d.secp256k1.Signature.fromCompact(i).addRecoveryBit(Number(s)).recoverPublicKey(e);return c.from(l.toRawBytes(!1).slice(1))},a.toRpcSig=function(e,a,t,f){if(!o(b(e,f)))throw new Error("Invalid signature v value");return(0,r.bufferToHex)(c.concat([(0,r.setLengthLeft)(a,32),(0,r.setLengthLeft)(t,32),(0,r.toBuffer)(e)]))},a.toCompactSig=function(e,a,t,f){if(!o(b(e,f)))throw new Error("Invalid signature v value");let d=t;return(e>BigInt(28)&&e%BigInt(2)===BigInt(1)||e===BigInt(1)||e===BigInt(28))&&(d=c.from(t),d[0]|=128),(0,r.bufferToHex)(c.concat([(0,r.setLengthLeft)(a,32),(0,r.setLengthLeft)(d,32)]))},a.fromRpcSig=function(e){const a=(0,r.toBuffer)(e);let t,c,f;if(a.length>=65)t=a.slice(0,32),c=a.slice(32,64),f=(0,r.bufferToBigInt)(a.slice(64));else{if(64!==a.length)throw new Error("Invalid signature length");t=a.slice(0,32),c=a.slice(32,64),f=BigInt((0,r.bufferToInt)(a.slice(32,33))>>7),c[0]&=127}return f<27&&(f+=BigInt(27)),{v:f,r:t,s:c}},a.isValidSignature=function(e,a,t,c=!0,f){if(32!==a.length||32!==t.length)return!1;if(!o(b(e,f)))return!1;const d=(0,r.bufferToBigInt)(a),i=(0,r.bufferToBigInt)(t);return!(d===BigInt(0)||d>=n.SECP256K1_ORDER||i===BigInt(0)||i>=n.SECP256K1_ORDER||c&&i>=n.SECP256K1_ORDER_DIV_2)},a.hashPersonalMessage=function(e){(0,i.assertIsBuffer)(e);const a=c.from(`Ethereum Signed Message:\n${e.length}`,"utf-8");return c.from((0,f.keccak256)(c.concat([a,e])))}},42666:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.toType=a.TypeOutput=void 0;const c=t(77312),f=t(59498);var d;!function(e){e[e.Number=0]="Number",e[e.BigInt=1]="BigInt",e[e.Buffer=2]="Buffer",e[e.PrefixedHexString=3]="PrefixedHexString"}(d=a.TypeOutput||(a.TypeOutput={})),a.toType=function(e,a){if(null===e)return null;if(void 0===e)return;if("string"==typeof e&&!(0,f.isHexString)(e))throw new Error(`A string must be provided with a 0x-prefix, given: ${e}`);if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const t=(0,c.toBuffer)(e);switch(a){case d.Buffer:return t;case d.BigInt:return(0,c.bufferToBigInt)(t);case d.Number:{const e=(0,c.bufferToBigInt)(t);if(e>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return Number(e)}case d.PrefixedHexString:return(0,c.bufferToHex)(t);default:throw new Error("unknown outputType")}}},52652:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.GWEI_TO_WEI=void 0,a.GWEI_TO_WEI=BigInt(1e9)},37380:(e,a,t)=>{"use strict";var c=t(62045).hp;Object.defineProperty(a,"__esModule",{value:!0}),a.Withdrawal=void 0;const f=t(86727),d=t(77312),r=t(42666);class n{constructor(e,a,t,c){this.index=e,this.validatorIndex=a,this.address=t,this.amount=c}static fromWithdrawalData(e){const{index:a,validatorIndex:t,address:c,amount:d}=e,i=(0,r.toType)(a,r.TypeOutput.BigInt),b=(0,r.toType)(t,r.TypeOutput.BigInt),o=new f.Address((0,r.toType)(c,r.TypeOutput.Buffer)),s=(0,r.toType)(d,r.TypeOutput.BigInt);return new n(i,b,o,s)}static fromValuesArray(e){if(4!==e.length)throw Error(`Invalid withdrawalArray length expected=4 actual=${e.length}`);const[a,t,c,f]=e;return n.fromWithdrawalData({index:a,validatorIndex:t,address:c,amount:f})}static toBufferArray(e){const{index:a,validatorIndex:t,address:d,amount:n}=e,i=(0,r.toType)(a,r.TypeOutput.BigInt)===BigInt(0)?c.alloc(0):(0,r.toType)(a,r.TypeOutput.Buffer),b=(0,r.toType)(t,r.TypeOutput.BigInt)===BigInt(0)?c.alloc(0):(0,r.toType)(t,r.TypeOutput.Buffer);let o;return o=d instanceof f.Address?d.buf:(0,r.toType)(d,r.TypeOutput.Buffer),[i,b,o,(0,r.toType)(n,r.TypeOutput.BigInt)===BigInt(0)?c.alloc(0):(0,r.toType)(n,r.TypeOutput.Buffer)]}raw(){return n.toBufferArray(this)}toValue(){return{index:this.index,validatorIndex:this.validatorIndex,address:this.address.buf,amount:this.amount}}toJSON(){return{index:(0,d.bigIntToHex)(this.index),validatorIndex:(0,d.bigIntToHex)(this.validatorIndex),address:"0x"+this.address.buf.toString("hex"),amount:(0,d.bigIntToHex)(this.amount)}}}a.Withdrawal=n},56498:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.decodeSingle=a.decode=a.encodePacked=a.encodeSingle=a.encode=void 0;const c=t(52367),f=t(5961),d=t(37700);a.encode=(e,a,t,c)=>{try{return(0,d.pack)({types:e,values:a,packed:t,tight:c})}catch(e){if(e instanceof f.ParserError)throw new f.ParserError(`Unable to encode value: ${e.message}`,e);throw new f.ParserError(`An unexpected error occurred: ${(0,f.getErrorMessage)(e)}`,e)}},a.encodeSingle=(e,t)=>(0,a.encode)([e],[t]),a.encodePacked=(e,t,c)=>(0,a.encode)(e,t,!0,c),a.decode=(e,a)=>{const t=(0,c.createBytes)(a);try{return(0,d.unpack)(e,t)}catch(e){if(e instanceof f.ParserError)throw new f.ParserError(`Unable to decode value: ${e.message}`,e);throw new f.ParserError(`An unexpected error occurred: ${(0,f.getErrorMessage)(e)}`,e)}},a.decodeSingle=(e,t)=>{const d=(0,a.decode)([e],t);return(0,c.assert)(1===d.length,new f.ParserError("Decoded value array has unexpected length.")),d[0]}},5961:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.ParserError=a.getErrorStack=a.getErrorMessage=void 0;const c=t(52367);a.getErrorMessage=e=>"string"==typeof e?e:e instanceof Error||(0,c.isObject)(e)&&(0,c.hasProperty)(e,"message")&&"string"==typeof e.message?e.message:"Unknown error.",a.getErrorStack=e=>{if(e instanceof Error)return e.stack};class f extends Error{constructor(e,t){super(e),this.name="ParserError";const c=(0,a.getErrorStack)(t);c&&(this.stack=c)}}a.ParserError=f},93256:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),f(t(56498),a),f(t(5961),a),f(t(11126),a)},57924:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.iterate=void 0;const c=t(52367);a.iterate=function*(e,a=32){for(let t=0;t{(0,c.assert)(e>=0,"Cannot skip a negative number of bytes."),(0,c.assert)(e%a==0,"Length must be a multiple of the size."),t+=e},d=e.subarray(t);yield{skip:f,value:d}}return{skip:()=>{},value:new Uint8Array}}},37700:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.unpack=a.pack=a.isDynamicParser=a.getParser=void 0;const c=t(52367),f=t(5961),d=t(57924),r=t(46207),n=t(26365);a.getParser=e=>{const a={address:r.address,array:r.array,bool:r.bool,bytes:r.bytes,fixedBytes:r.fixedBytes,function:r.fn,number:r.number,string:r.string,tuple:r.tuple},t=a[e];if(t)return t;const c=Object.values(a).find((a=>a.isType(e)));if(c)return c;throw new f.ParserError(`The type "${e}" is not supported.`)},a.isDynamicParser=(e,a)=>{const{isDynamic:t}=e;return"function"==typeof t?t(a):t},a.pack=({types:e,values:t,packed:d=!1,tight:r=!1,arrayPacked:i=!1,byteArray:b=new Uint8Array})=>{(0,c.assert)(e.length===t.length,new f.ParserError(`The number of types (${e.length}) does not match the number of values (${t.length}).`));const{staticBuffer:o,dynamicBuffer:s,pointers:l}=e.reduce((({staticBuffer:e,dynamicBuffer:f,pointers:n},b,o)=>{const s=(0,a.getParser)(b),l=t[o];return d||i||!(0,a.isDynamicParser)(s,b)?{staticBuffer:s.encode({buffer:e,value:l,type:b,packed:d,tight:r}),dynamicBuffer:f,pointers:n}:{staticBuffer:(0,c.concatBytes)([e,new Uint8Array(32)]),dynamicBuffer:s.encode({buffer:f,value:l,type:b,packed:d,tight:r}),pointers:[...n,{position:e.length,pointer:f.length}]}}),{staticBuffer:new Uint8Array,dynamicBuffer:new Uint8Array,pointers:[]});(0,c.assert)(!d&&!i||0===s.length,new f.ParserError("Invalid pack state."));const u=o.length,h=l.reduce(((e,{pointer:a,position:t})=>{const f=(0,n.padStart)((0,c.numberToBytes)(u+a));return(0,n.set)(e,f,t)}),o);return(0,c.concatBytes)([b,h,s])},a.unpack=(e,t)=>{const r=(0,d.iterate)(t);return e.map((e=>{const{value:{value:d,skip:n},done:i}=r.next();(0,c.assert)(!i,new f.ParserError(`The encoded value is invalid for the provided types. Reached end of buffer while attempting to parse "${e}".`));const b=(0,a.getParser)(e);if((0,a.isDynamicParser)(b,e)){const a=(0,c.bytesToNumber)(d.subarray(0,32)),f=t.subarray(a);return b.decode({type:e,value:f,skip:n})}return b.decode({type:e,value:d,skip:n})}))}},91563:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.address=a.getAddress=void 0;const c=t(52367),f=t(5961),d=t(26365);a.getAddress=e=>{const a=(0,c.createBytes)(e);return(0,c.assert)(a.length<=20,new f.ParserError(`Invalid address value. Expected address to be 20 bytes long, but received ${a.length} bytes.`)),(0,d.padStart)(a,20)},a.address={isDynamic:!1,isType:e=>"address"===e,getByteLength:()=>32,encode({buffer:e,value:t,packed:f}){const r=(0,a.getAddress)(t);if(f)return(0,c.concatBytes)([e,r]);const n=(0,d.padStart)(r);return(0,c.concatBytes)([e,n])},decode:({value:e})=>(0,c.add0x)((0,c.bytesToHex)(e.slice(12,32)))}},186:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.array=a.getTupleType=a.getArrayType=a.isArrayType=void 0;const c=t(52367),f=t(5961),d=t(37700),r=t(26365),n=t(83415),i=t(30717),b=/^(?.*)\[(?\d*?)\]$/u;a.isArrayType=e=>b.test(e),a.getArrayType=e=>{const a=e.match(b);return(0,c.assert)(a?.groups?.type,new f.ParserError(`Invalid array type. Expected an array type, but received "${e}".`)),[a.groups.type,a.groups.length?parseInt(a.groups.length,10):void 0]},a.getTupleType=(e,a)=>`(${new Array(a).fill(e).join(",")})`,a.array={isDynamic(e){const[t,c]=(0,a.getArrayType)(e);return void 0===c||(0,d.isDynamicParser)((0,d.getParser)(t),t)},isType:e=>(0,a.isArrayType)(e),getByteLength(e){(0,c.assert)((0,a.isArrayType)(e),new f.ParserError(`Expected an array type, but received "${e}".`));const[t,r]=(0,a.getArrayType)(e);return(0,d.isDynamicParser)(this,e)||void 0===r?32:i.tuple.getByteLength((0,a.getTupleType)(t,r))},encode({type:e,buffer:t,value:b,packed:o,tight:s}){const[l,u]=(0,a.getArrayType)(e);if((0,c.assert)(!o||!(0,a.isArrayType)(l),new f.ParserError("Cannot pack nested arrays.")),o&&(0,d.isDynamicParser)((0,d.getParser)(l),l))return(0,d.pack)({types:new Array(b.length).fill(l),values:b,byteArray:t,packed:o,arrayPacked:!0,tight:s});if(u)return(0,c.assert)(u===b.length,new f.ParserError(`Array length does not match type length. Expected a length of ${u}, but received ${b.length}.`)),i.tuple.encode({type:(0,a.getTupleType)(l,u),buffer:t,value:b,packed:n.fixedBytes.isType(l)&&s,tight:s});if(o)return(0,d.pack)({types:new Array(b.length).fill(l),values:b,byteArray:t,packed:n.fixedBytes.isType(l)&&s,arrayPacked:!0,tight:s});const h=(0,r.padStart)((0,c.numberToBytes)(b.length));return(0,d.pack)({types:new Array(b.length).fill(l),values:b,byteArray:(0,c.concatBytes)([t,h]),packed:o,tight:s})},decode({type:e,value:t,...r}){const[n,b]=(0,a.getArrayType)(e);if(b){const e=i.tuple.decode({type:(0,a.getTupleType)(n,b),value:t,...r});return(0,c.assert)(e.length===b,new f.ParserError(`Array length does not match type length. Expected a length of ${b}, but received ${e.length}.`)),e}const o=(0,c.bytesToNumber)(t.subarray(0,32));return(0,d.unpack)(new Array(o).fill(n),t.subarray(32))}}},47435:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.bool=a.getBooleanValue=void 0;const c=t(35620),f=t(52367),d=t(5961),r=t(6150),n=(0,c.coerce)((0,c.boolean)(),(0,c.union)([(0,c.literal)("true"),(0,c.literal)("false")]),(e=>"true"===e));a.getBooleanValue=e=>{try{return(0,c.create)(e,n)?BigInt(1):BigInt(0)}catch{throw new d.ParserError(`Invalid boolean value. Expected a boolean literal, or the string "true" or "false", but received "${e}".`)}},a.bool={isDynamic:!1,isType:e=>"bool"===e,getByteLength:()=>32,encode({buffer:e,value:t,packed:c,tight:d}){const n=(0,a.getBooleanValue)(t);return c?(0,f.concatBytes)([e,(0,f.bigIntToBytes)(n)]):r.number.encode({type:"uint256",buffer:e,value:n,packed:c,tight:d})},decode:e=>r.number.decode({...e,type:"uint256"})===BigInt(1)}},99356:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.bytes=void 0;const c=t(52367),f=t(26365);a.bytes={isDynamic:!0,isType:e=>"bytes"===e,getByteLength:()=>32,encode({buffer:e,value:a,packed:t}){const d=(0,c.createBytes)(a);if(t)return(0,c.concatBytes)([e,d]);const r=32*Math.ceil(d.byteLength/32);return(0,c.concatBytes)([e,(0,f.padStart)((0,c.numberToBytes)(d.byteLength)),(0,f.padEnd)(d,r)])},decode({value:e}){const a=e.subarray(0,32),t=(0,c.bytesToNumber)(a);return e.slice(32,32+t)}}},83415:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.fixedBytes=a.getByteLength=void 0;const c=t(52367),f=t(5961),d=t(26365),r=/^bytes([0-9]{1,2})$/u;a.getByteLength=e=>{const a=e.match(r)?.[1];(0,c.assert)(a,`Invalid byte length. Expected a number between 1 and 32, but received "${e}".`);const t=Number(a);return(0,c.assert)(t>0&&t<=32,new f.ParserError(`Invalid byte length. Expected a number between 1 and 32, but received "${e}".`)),t},a.fixedBytes={isDynamic:!1,isType:e=>r.test(e),getByteLength:()=>32,encode({type:e,buffer:t,value:r,packed:n}){const i=(0,a.getByteLength)(e),b=(0,c.createBytes)(r);return(0,c.assert)(b.length<=i,new f.ParserError(`Expected a value of length ${i}, but received a value of length ${b.length}.`)),n?(0,c.concatBytes)([t,(0,d.padEnd)(b,i)]):(0,c.concatBytes)([t,(0,d.padEnd)(b)])},decode({type:e,value:t}){const c=(0,a.getByteLength)(e);return t.slice(0,c)}}},27827:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.fn=a.getFunction=void 0;const c=t(35620),f=t(52367),d=t(5961),r=t(83415),n=(0,c.coerce)((0,c.object)({address:f.StrictHexStruct,selector:f.StrictHexStruct}),(0,c.union)([f.StrictHexStruct,(0,c.instance)(Uint8Array)]),(e=>{const a=(0,f.createBytes)(e);return(0,f.assert)(24===a.length,new d.ParserError(`Invalid Solidity function. Expected function to be 24 bytes long, but received ${a.length} bytes.`)),{address:(0,f.bytesToHex)(a.subarray(0,20)),selector:(0,f.bytesToHex)(a.subarray(20,24))}}));a.getFunction=e=>{const a=(0,c.create)(e,n);return(0,f.concatBytes)([(0,f.hexToBytes)(a.address),(0,f.hexToBytes)(a.selector)])},a.fn={isDynamic:!1,isType:e=>"function"===e,getByteLength:()=>32,encode({buffer:e,value:t,packed:c,tight:f}){const d=(0,a.getFunction)(t);return r.fixedBytes.encode({type:"bytes24",buffer:e,value:d,packed:c,tight:f})},decode:({value:e})=>({address:(0,f.bytesToHex)(e.slice(0,20)),selector:(0,f.bytesToHex)(e.slice(20,24))})}},46207:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),f(t(91563),a),f(t(186),a),f(t(47435),a),f(t(99356),a),f(t(83415),a),f(t(27827),a),f(t(6150),a),f(t(28160),a),f(t(8446),a),f(t(30717),a)},6150:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.number=a.getBigInt=a.assertNumberLength=a.getLength=a.isSigned=void 0;const c=t(52367),f=t(5961),d=t(26365),r=/^u?int(?[0-9]*)?$/u;a.isSigned=e=>!e.startsWith("u"),a.getLength=e=>{if("int"===e||"uint"===e)return 256;const a=e.match(r);(0,c.assert)(a?.groups?.length,new f.ParserError(`Invalid number type. Expected a number type, but received "${e}".`));const t=parseInt(a.groups.length,10);return(0,c.assert)(t>=8&&t<=256,new f.ParserError(`Invalid number length. Expected a number between 8 and 256, but received "${e}".`)),(0,c.assert)(t%8==0,new f.ParserError(`Invalid number length. Expected a multiple of 8, but received "${e}".`)),t},a.assertNumberLength=(e,t)=>{const d=(0,a.getLength)(t),r=BigInt(2)**BigInt(d-((0,a.isSigned)(t)?1:0))-BigInt(1);(0,a.isSigned)(t)?(0,c.assert)(e>=-(r+BigInt(1))&&e<=r,new f.ParserError(`Number "${e}" is out of range for type "${t}".`)):(0,c.assert)(e<=r,new f.ParserError(`Number "${e}" is out of range for type "${t}".`))},a.getBigInt=e=>{try{return(0,c.createBigInt)(e)}catch{throw new f.ParserError(`Invalid number. Expected a valid number value, but received "${e}".`)}},a.number={isDynamic:!1,isType:e=>r.test(e),getByteLength:()=>32,encode({type:e,buffer:t,value:f,packed:r}){const n=(0,a.getBigInt)(f);if((0,a.assertNumberLength)(n,e),(0,a.isSigned)(e)){if(r){const f=(0,a.getLength)(e)/8;return(0,c.concatBytes)([t,(0,c.signedBigIntToBytes)(n,f)])}return(0,c.concatBytes)([t,(0,d.padStart)((0,c.signedBigIntToBytes)(n,32))])}if(r){const f=(0,a.getLength)(e)/8;return(0,c.concatBytes)([t,(0,d.padStart)((0,c.bigIntToBytes)(n),f)])}return(0,c.concatBytes)([t,(0,d.padStart)((0,c.bigIntToBytes)(n))])},decode({type:e,value:t}){const f=t.subarray(0,32);if((0,a.isSigned)(e)){const t=(0,c.bytesToSignedBigInt)(f);return(0,a.assertNumberLength)(t,e),t}const d=(0,c.bytesToBigInt)(f);return(0,a.assertNumberLength)(d,e),d}}},28160:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0})},8446:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.string=void 0;const c=t(52367),f=t(99356);a.string={isDynamic:!0,isType:e=>"string"===e,getByteLength:()=>32,encode:({buffer:e,value:a,packed:t,tight:d})=>f.bytes.encode({type:"bytes",buffer:e,value:(0,c.stringToBytes)(a),packed:t,tight:d}),decode:e=>(0,c.bytesToString)(f.bytes.decode(e))}},30717:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.tuple=a.getTupleElements=void 0;const c=t(52367),f=t(5961),d=t(37700),r=/^\((.+)\)$/u;a.getTupleElements=e=>{(0,c.assert)(e.startsWith("(")&&e.endsWith(")"),new f.ParserError(`Invalid tuple type. Expected tuple type, but received "${e}".`));const a=[];let t="",d=0;for(let c=1;c(0,a.getTupleElements)(e).some((e=>{const a=(0,d.getParser)(e);return(0,d.isDynamicParser)(a,e)})),isType:e=>(e=>r.test(e))(e),getByteLength(e){return(0,d.isDynamicParser)(this,e)?32:(0,a.getTupleElements)(e).reduce(((e,a)=>e+(0,d.getParser)(a).getByteLength(a)),0)},encode({type:e,buffer:t,value:c,packed:f,tight:r}){const n=(0,a.getTupleElements)(e);return(0,d.pack)({types:n,values:c,byteArray:t,packed:f,tight:r})},decode({type:e,value:t,skip:c}){const f=(0,a.getTupleElements)(e);return c(this.getByteLength(e)-32),(0,d.unpack)(f,t)}}},15744:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0})},11126:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),f(t(15744),a)},59194:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.padEnd=a.padStart=a.set=void 0;const c=t(52367);a.set=(e,a,t)=>(0,c.concatBytes)([e.subarray(0,t),a,e.subarray(t+a.length)]),a.padStart=(e,a=32)=>{const t=new Uint8Array(Math.max(a-e.length,0)).fill(0);return(0,c.concatBytes)([t,e])},a.padEnd=(e,a=32)=>{const t=new Uint8Array(Math.max(a-e.length,0)).fill(0);return(0,c.concatBytes)([e,t])}},26365:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),f(t(59194),a)},98537:function(e,a,t){"use strict";var c=t(62045).hp,f=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),d=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:!0,value:a})}:function(e,a){e.default=a}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(null!=e)for(var t in e)"default"!==t&&Object.prototype.hasOwnProperty.call(e,t)&&f(a,e,t);return d(a,e),a};Object.defineProperty(a,"__esModule",{value:!0}),a.getEncryptionPublicKey=a.decryptSafely=a.decrypt=a.encryptSafely=a.encrypt=void 0;const n=t(63203),i=r(t(88947)),b=t(54907);function o({publicKey:e,data:a,version:t}){if((0,b.isNullish)(e))throw new Error("Missing publicKey parameter");if((0,b.isNullish)(a))throw new Error("Missing data parameter");if((0,b.isNullish)(t))throw new Error("Missing version parameter");if("x25519-xsalsa20-poly1305"===t){if("string"!=typeof a)throw new Error("Message data must be given as a string");const t=i.box.keyPair();let c;try{c=n.base64.decode(e)}catch(e){throw new Error("Bad public key")}const f=n.utf8.decode(a),d=i.randomBytes(i.box.nonceLength),r=i.box(f,d,c,t.secretKey);return{version:"x25519-xsalsa20-poly1305",nonce:n.base64.encode(d),ephemPublicKey:n.base64.encode(t.publicKey),ciphertext:n.base64.encode(r)}}throw new Error("Encryption type/version not supported")}function s({encryptedData:e,privateKey:a}){if((0,b.isNullish)(e))throw new Error("Missing encryptedData parameter");if((0,b.isNullish)(a))throw new Error("Missing privateKey parameter");if("x25519-xsalsa20-poly1305"===e.version){const t=c.from(a,"hex"),f=i.box.keyPair.fromSecretKey(t).secretKey,d=n.base64.decode(e.nonce),r=n.base64.decode(e.ciphertext),b=n.base64.decode(e.ephemPublicKey),o=i.box.open(r,d,b,f);try{if(!o)throw new Error;const e=n.utf8.encode(o);if(!e)throw new Error;return e}catch(e){if(e&&"string"==typeof e.message&&e.message.length)throw new Error(`Decryption failed: ${e.message}`);throw new Error("Decryption failed.")}}throw new Error("Encryption type/version not supported.")}a.encrypt=o,a.encryptSafely=function({publicKey:e,data:a,version:t}){if((0,b.isNullish)(e))throw new Error("Missing publicKey parameter");if((0,b.isNullish)(a))throw new Error("Missing data parameter");if((0,b.isNullish)(t))throw new Error("Missing version parameter");if("object"==typeof a&&a&&"toJSON"in a)throw new Error("Cannot encrypt with toJSON property. Please remove toJSON property");const f={data:a,padding:""},d=c.byteLength(JSON.stringify(f),"utf-8")%2048;let r=0;return d>0&&(r=2048-d-16),f.padding="0".repeat(r),o({publicKey:e,data:JSON.stringify(f),version:t})},a.decrypt=s,a.decryptSafely=function({encryptedData:e,privateKey:a}){if((0,b.isNullish)(e))throw new Error("Missing encryptedData parameter");if((0,b.isNullish)(a))throw new Error("Missing privateKey parameter");return JSON.parse(s({encryptedData:e,privateKey:a})).data},a.getEncryptionPublicKey=function(e){const a=c.from(e,"hex"),t=i.box.keyPair.fromSecretKey(a).publicKey;return n.base64.encode(t)}},51594:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),a.normalize=a.concatSig=void 0,f(t(20252),a),f(t(10169),a),f(t(98537),a);var d=t(54907);Object.defineProperty(a,"concatSig",{enumerable:!0,get:function(){return d.concatSig}}),Object.defineProperty(a,"normalize",{enumerable:!0,get:function(){return d.normalize}})},20252:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.extractPublicKey=a.recoverPersonalSignature=a.personalSign=void 0;const c=t(68683),f=t(54907);function d(e,a){const t=(0,c.hashPersonalMessage)((0,f.legacyToBuffer)(e));return(0,f.recoverPublicKey)(t,a)}a.personalSign=function({privateKey:e,data:a}){if((0,f.isNullish)(a))throw new Error("Missing data parameter");if((0,f.isNullish)(e))throw new Error("Missing privateKey parameter");const t=(0,f.legacyToBuffer)(a),d=(0,c.hashPersonalMessage)(t),r=(0,c.ecsign)(d,e);return(0,f.concatSig)((0,c.toBuffer)(r.v),r.r,r.s)},a.recoverPersonalSignature=function({data:e,signature:a}){if((0,f.isNullish)(e))throw new Error("Missing data parameter");if((0,f.isNullish)(a))throw new Error("Missing signature parameter");const t=d(e,a),r=(0,c.publicToAddress)(t);return(0,c.bufferToHex)(r)},a.extractPublicKey=function({data:e,signature:a}){if((0,f.isNullish)(e))throw new Error("Missing data parameter");if((0,f.isNullish)(a))throw new Error("Missing signature parameter");return`0x${d(e,a).toString("hex")}`}},10169:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.recoverTypedSignature=a.signTypedData=a.typedSignatureHash=a.TypedDataUtils=a.TYPED_MESSAGE_SCHEMA=a.SignTypedDataVersion=void 0;const c=t(68683),f=t(93256),d=t(46207),r=t(26365),n=t(52367),i=t(32019),b=t(54907);var o;function s(e,a){if(!Object.keys(o).includes(e))throw new Error(`Invalid version: '${e}'`);if(a&&!a.includes(e))throw new Error(`SignTypedDataVersion not allowed: '${e}'. Allowed versions are: ${a.join(", ")}`)}function l(e,a){(0,n.assert)(null!==a,`Unable to encode value: Invalid number. Expected a valid number value, but received "${a}".`);const t=BigInt(a),c=(0,d.getLength)(e),f=BigInt(2)**BigInt(c)-BigInt(1);return(0,n.assert)(t>=-f&&t<=f,`Unable to encode value: Number "${a}" is out of range for type "${e}".`),t}function u(e){let a=BigInt(0);for(let t=0;t=49?c-BigInt(49)+BigInt(10):c>=17?c-BigInt(17)+BigInt(10):c}return(0,r.padStart)((0,n.bigIntToBytes)(a),20)}function h(e,a,t,d,b){if(s(b,[o.V3,o.V4]),void 0!==e[t])return["bytes32",b===o.V4&&null==d?"0x0000000000000000000000000000000000000000000000000000000000000000":(0,c.arrToBufArr)((0,i.keccak256)(p(t,d,e,b)))];if("function"===t)throw new Error('Unsupported or invalid type: "function"');if(void 0===d)throw new Error(`missing value for field ${a} of type ${t}`);if("address"===t){if("number"==typeof d)return["address",(0,r.padStart)((0,n.numberToBytes)(d),20)];if((0,n.isStrictHexString)(d))return["address",(0,n.add0x)(d)];if("string"==typeof d)return["address",u(d).subarray(0,20)]}if("bool"===t)return["bool",Boolean(d)];if("bytes"===t)return"number"==typeof d?d=(0,n.numberToBytes)(d):(0,n.isStrictHexString)(d)||"0x"===d?d=(0,n.hexToBytes)(d):"string"==typeof d&&(d=(0,n.stringToBytes)(d)),["bytes32",(0,c.arrToBufArr)((0,i.keccak256)(d))];if(t.startsWith("bytes")&&"bytes"!==t&&!t.includes("["))return"number"==typeof d?d<0?["bytes32",new Uint8Array(32)]:["bytes32",(0,n.bigIntToBytes)(BigInt(d))]:(0,n.isStrictHexString)(d)?["bytes32",(0,n.hexToBytes)(d)]:["bytes32",d];if(t.startsWith("int")&&!t.includes("[")){const e=l(t,d);return e>=BigInt(0)?["uint256",e]:["int256",e]}if("string"===t)return d="number"==typeof d?(0,n.numberToBytes)(d):(0,n.stringToBytes)(null!=d?d:""),["bytes32",(0,c.arrToBufArr)((0,i.keccak256)(d))];if(t.endsWith("]")){if(b===o.V3)throw new Error("Arrays are unimplemented in encodeData; use V4 extension");const r=t.slice(0,t.lastIndexOf("[")),n=d.map((t=>h(e,a,r,t,b)));return["bytes32",(0,c.arrToBufArr)((0,i.keccak256)((0,f.encode)(n.map((([e])=>e)),n.map((([,e])=>e)))))]}return[t,d]}function p(e,a,t,d){s(d,[o.V3,o.V4]);const r=["bytes32"],n=[y(e,t)];for(const c of t[e]){if(d===o.V3&&void 0===a[c.name])continue;const[e,f]=h(t,c.name,c.type,a[c.name],d);r.push(e),n.push(f)}return(0,c.arrToBufArr)((0,f.encode)(r,n))}function g(e,a){let t="";const c=m(e,a);c.delete(e);const f=[e,...Array.from(c).sort()];for(const e of f){if(!a[e])throw new Error(`No type definition specified: ${e}`);t+=`${e}(${a[e].map((({name:e,type:a})=>`${a} ${e}`)).join(",")})`}return t}function m(e,a,t=new Set){if("string"!=typeof e)throw new Error(`Invalid findTypeDependencies input ${JSON.stringify(e)}`);const c=e.match(/^\w*/u);if([e]=c,t.has(e)||void 0===a[e])return t;t.add(e);for(const c of a[e])m(c.type,a,t);return t}function x(e,a,t,f){s(f,[o.V3,o.V4]);const d=p(e,a,t,f),r=(0,i.keccak256)(d);return(0,c.arrToBufArr)(r)}function y(e,a){const t=(0,n.stringToBytes)(g(e,a));return(0,c.arrToBufArr)((0,i.keccak256)(t))}function A(e){const t={};for(const c in a.TYPED_MESSAGE_SCHEMA.properties)e[c]&&(t[c]=e[c]);return"types"in t&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t}function v(e,a){s(a,[o.V3,o.V4]);const t=A(e),{domain:c}=t;return x("EIP712Domain",c,{EIP712Domain:t.types.EIP712Domain},a)}function w(e,a){if((0,d.isArrayType)(e)&&Array.isArray(a)){const[t]=(0,d.getArrayType)(e);return a.map((e=>w(t,e)))}if("address"===e){if((0,n.isStrictHexString)(a))return(0,r.padStart)((0,n.hexToBytes)(a).subarray(0,20),20);if(a instanceof Uint8Array)return(0,r.padStart)(a.subarray(0,20),20)}if("bool"===e)return Boolean(a);if(e.startsWith("bytes")&&"bytes"!==e){const t=(0,d.getByteLength)(e);if("number"==typeof a)return a<0?new Uint8Array:(0,n.numberToBytes)(a).subarray(0,t);if((0,n.isStrictHexString)(a))return(0,n.hexToBytes)(a).subarray(0,t);if(a instanceof Uint8Array)return a.subarray(0,t)}if(e.startsWith("uint")&&"number"==typeof a)return Math.abs(a);if(e.startsWith("int")&&"number"==typeof a){const t=(0,d.getLength)(e);return BigInt.asIntN(t,BigInt(a))}return a}function _(e,a){return a.map((a=>{if("string"==typeof a||"number"==typeof a||"bigint"==typeof a){const t=l(e,a);if(t>=BigInt(0))return(0,r.padStart)((0,n.bigIntToBytes)(t),32);const c=(0,d.getLength)(e),f=BigInt.asIntN(c,t);return(0,n.signedBigIntToBytes)(f,32)}return a}))}function I(e){const a=new Error("Expect argument to be non-empty array");if("object"!=typeof e||!("length"in e)||!e.length)throw a;const t=e.map((({name:e,type:a,value:t})=>{if("address[]"===a)return{name:e,type:"bytes32[]",value:(c=t,c.map((e=>"number"==typeof e?(0,r.padStart)((0,n.numberToBytes)(e),32):(0,n.isStrictHexString)(e)?(0,r.padStart)((0,n.hexToBytes)(e).subarray(0,32),32):e instanceof Uint8Array?(0,r.padStart)(e.subarray(0,32),32):e)))};var c;if(a.startsWith("int")&&(0,d.isArrayType)(a)){const[c,f]=(0,d.getArrayType)(a);return{name:e,type:`bytes32[${null!=f?f:""}]`,value:_(c,t)}}return{name:e,type:a,value:w(a,t)}})),o=t.map((e=>"bytes"!==e.type?e.value:(0,b.legacyToBuffer)(e.value))),s=t.map((e=>{if("function"===e.type)throw new Error('Unsupported or invalid type: "function"');return e.type})),l=e.map((e=>{if(!e.name)throw a;return`${e.type} ${e.name}`}));return(0,c.arrToBufArr)((0,i.keccak256)((0,f.encodePacked)(["bytes32","bytes32"],[(0,i.keccak256)((0,f.encodePacked)(["string[]"],[l],!0)),(0,i.keccak256)((0,f.encodePacked)(s,o,!0))])))}!function(e){e.V1="V1",e.V3="V3",e.V4="V4"}(o=a.SignTypedDataVersion||(a.SignTypedDataVersion={})),a.TYPED_MESSAGE_SCHEMA={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},a.TypedDataUtils={encodeData:p,encodeType:g,findTypeDependencies:m,hashStruct:x,hashType:y,sanitizeData:A,eip712Hash:function(e,a){s(a,[o.V3,o.V4]);const t=A(e),f=[(0,n.hexToBytes)("1901")];return f.push(v(e,a)),"EIP712Domain"!==t.primaryType&&f.push(x(t.primaryType,t.message,t.types,a)),(0,c.arrToBufArr)((0,i.keccak256)((0,n.concatBytes)(f)))},eip712DomainHash:v},a.typedSignatureHash=function(e){const a=I(e);return(0,n.bytesToHex)(a)},a.signTypedData=function({privateKey:e,data:t,version:f}){if(s(f),(0,b.isNullish)(t))throw new Error("Missing data parameter");if((0,b.isNullish)(e))throw new Error("Missing private key parameter");const d=f===o.V1?I(t):a.TypedDataUtils.eip712Hash(t,f),r=(0,c.ecsign)(d,e);return(0,b.concatSig)((0,c.arrToBufArr)((0,n.bigIntToBytes)(r.v)),r.r,r.s)},a.recoverTypedSignature=function({data:e,signature:t,version:f}){if(s(f),(0,b.isNullish)(e))throw new Error("Missing data parameter");if((0,b.isNullish)(t))throw new Error("Missing signature parameter");const d=f===o.V1?I(e):a.TypedDataUtils.eip712Hash(e,f),r=(0,b.recoverPublicKey)(d,t),i=(0,c.publicToAddress)(r);return(0,n.bytesToHex)(i)}},54907:(e,a,t)=>{"use strict";var c=t(62045).hp;Object.defineProperty(a,"__esModule",{value:!0}),a.normalize=a.recoverPublicKey=a.concatSig=a.legacyToBuffer=a.isNullish=a.padWithZeroes=void 0;const f=t(68683),d=t(52367);function r(e,a){if(""!==e&&!/^[a-f0-9]+$/iu.test(e))throw new Error(`Expected an unprefixed hex string. Received: ${e}`);if(a<0)throw new Error(`Expected a non-negative integer target length. Received: ${a}`);return String.prototype.padStart.call(e,a,"0")}function n(e){return null==e}a.padWithZeroes=r,a.isNullish=n,a.legacyToBuffer=function(e){return"string"!=typeof e||(0,f.isHexString)(e)?(0,f.toBuffer)(e):c.from(e)},a.concatSig=function(e,a,t){const c=(0,f.fromSigned)(a),n=(0,f.fromSigned)(t),i=(0,f.bufferToInt)(e),b=r((0,f.toUnsigned)(c).toString("hex"),64),o=r((0,f.toUnsigned)(n).toString("hex"),64),s=(0,d.remove0x)((0,d.numberToHex)(i));return(0,d.add0x)(b.concat(o,s))},a.recoverPublicKey=function(e,a){const t=(0,f.fromRpcSig)(a);return(0,f.ecrecover)(e,t.v,t.r,t.s)},a.normalize=function(e){if(!n(e)){if("number"==typeof e){if(e<0)return"0x";const a=(0,d.numberToBytes)(e);e=(0,d.bytesToHex)(a)}if("string"!=typeof e){let a="eth-sig-util.normalize() requires hex string or integer input.";throw a+=` received ${typeof e}: ${e}`,new Error(a)}return(0,d.add0x)(e.toLowerCase())}}},52139:(e,a,t)=>{const c=Symbol("SemVer ANY");class f{static get ANY(){return c}constructor(e,a){if(a=d(a),e instanceof f){if(e.loose===!!a.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),b("comparator",e,a),this.options=a,this.loose=!!a.loose,this.parse(e),this.semver===c?this.value="":this.value=this.operator+this.semver.version,b("comp",this)}parse(e){const a=this.options.loose?r[n.COMPARATORLOOSE]:r[n.COMPARATOR],t=e.match(a);if(!t)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==t[1]?t[1]:"","="===this.operator&&(this.operator=""),t[2]?this.semver=new o(t[2],this.options.loose):this.semver=c}toString(){return this.value}test(e){if(b("Comparator.test",e,this.options.loose),this.semver===c||e===c)return!0;if("string"==typeof e)try{e=new o(e,this.options)}catch(e){return!1}return i(e,this.operator,this.semver,this.options)}intersects(e,a){if(!(e instanceof f))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new s(e.value,a).test(this.value):""===e.operator?""===e.value||new s(this.value,a).test(e.semver):!((a=d(a)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!a.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(i(this.semver,"<",e.semver,a)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(i(this.semver,">",e.semver,a)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=f;const d=t(69932),{safeRe:r,t:n}=t(34567),i=t(73646),b=t(52207),o=t(64739),s=t(25926)},25926:(e,a,t)=>{const c=/\s+/g;class f{constructor(e,a){if(a=r(a),e instanceof f)return e.loose===!!a.loose&&e.includePrerelease===!!a.includePrerelease?e:new f(e.raw,a);if(e instanceof n)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=a,this.loose=!!a.loose,this.includePrerelease=!!a.includePrerelease,this.raw=e.trim().replace(c," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!m(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&x(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e0&&(this.formatted+="||");const a=this.set[e];for(let e=0;e0&&(this.formatted+=" "),this.formatted+=a[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const a=((this.options.includePrerelease&&p)|(this.options.loose&&g))+":"+e,t=d.get(a);if(t)return t;const c=this.options.loose,f=c?o[s.HYPHENRANGELOOSE]:o[s.HYPHENRANGE];e=e.replace(f,L(this.options.includePrerelease)),i("hyphen replace",e),e=e.replace(o[s.COMPARATORTRIM],l),i("comparator trim",e),e=e.replace(o[s.TILDETRIM],u),i("tilde trim",e),e=e.replace(o[s.CARETTRIM],h),i("caret trim",e);let r=e.split(" ").map((e=>A(e,this.options))).join(" ").split(/\s+/).map((e=>k(e,this.options)));c&&(r=r.filter((e=>(i("loose invalid filter",e,this.options),!!e.match(o[s.COMPARATORLOOSE]))))),i("range list",r);const b=new Map,x=r.map((e=>new n(e,this.options)));for(const e of x){if(m(e))return[e];b.set(e.value,e)}b.size>1&&b.has("")&&b.delete("");const y=[...b.values()];return d.set(a,y),y}intersects(e,a){if(!(e instanceof f))throw new TypeError("a Range is required");return this.set.some((t=>y(t,a)&&e.set.some((e=>y(e,a)&&t.every((t=>e.every((e=>t.intersects(e,a)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new b(e,this.options)}catch(e){return!1}for(let a=0;a"<0.0.0-0"===e.value,x=e=>""===e.value,y=(e,a)=>{let t=!0;const c=e.slice();let f=c.pop();for(;t&&c.length;)t=c.every((e=>f.intersects(e,a))),f=c.pop();return t},A=(e,a)=>(i("comp",e,a),e=I(e,a),i("caret",e),e=w(e,a),i("tildes",e),e=C(e,a),i("xrange",e),e=B(e,a),i("stars",e),e),v=e=>!e||"x"===e.toLowerCase()||"*"===e,w=(e,a)=>e.trim().split(/\s+/).map((e=>_(e,a))).join(" "),_=(e,a)=>{const t=a.loose?o[s.TILDELOOSE]:o[s.TILDE];return e.replace(t,((a,t,c,f,d)=>{let r;return i("tilde",e,a,t,c,f,d),v(t)?r="":v(c)?r=`>=${t}.0.0 <${+t+1}.0.0-0`:v(f)?r=`>=${t}.${c}.0 <${t}.${+c+1}.0-0`:d?(i("replaceTilde pr",d),r=`>=${t}.${c}.${f}-${d} <${t}.${+c+1}.0-0`):r=`>=${t}.${c}.${f} <${t}.${+c+1}.0-0`,i("tilde return",r),r}))},I=(e,a)=>e.trim().split(/\s+/).map((e=>E(e,a))).join(" "),E=(e,a)=>{i("caret",e,a);const t=a.loose?o[s.CARETLOOSE]:o[s.CARET],c=a.includePrerelease?"-0":"";return e.replace(t,((a,t,f,d,r)=>{let n;return i("caret",e,a,t,f,d,r),v(t)?n="":v(f)?n=`>=${t}.0.0${c} <${+t+1}.0.0-0`:v(d)?n="0"===t?`>=${t}.${f}.0${c} <${t}.${+f+1}.0-0`:`>=${t}.${f}.0${c} <${+t+1}.0.0-0`:r?(i("replaceCaret pr",r),n="0"===t?"0"===f?`>=${t}.${f}.${d}-${r} <${t}.${f}.${+d+1}-0`:`>=${t}.${f}.${d}-${r} <${t}.${+f+1}.0-0`:`>=${t}.${f}.${d}-${r} <${+t+1}.0.0-0`):(i("no pr"),n="0"===t?"0"===f?`>=${t}.${f}.${d}${c} <${t}.${f}.${+d+1}-0`:`>=${t}.${f}.${d}${c} <${t}.${+f+1}.0-0`:`>=${t}.${f}.${d} <${+t+1}.0.0-0`),i("caret return",n),n}))},C=(e,a)=>(i("replaceXRanges",e,a),e.split(/\s+/).map((e=>M(e,a))).join(" ")),M=(e,a)=>{e=e.trim();const t=a.loose?o[s.XRANGELOOSE]:o[s.XRANGE];return e.replace(t,((t,c,f,d,r,n)=>{i("xRange",e,t,c,f,d,r,n);const b=v(f),o=b||v(d),s=o||v(r),l=s;return"="===c&&l&&(c=""),n=a.includePrerelease?"-0":"",b?t=">"===c||"<"===c?"<0.0.0-0":"*":c&&l?(o&&(d=0),r=0,">"===c?(c=">=",o?(f=+f+1,d=0,r=0):(d=+d+1,r=0)):"<="===c&&(c="<",o?f=+f+1:d=+d+1),"<"===c&&(n="-0"),t=`${c+f}.${d}.${r}${n}`):o?t=`>=${f}.0.0${n} <${+f+1}.0.0-0`:s&&(t=`>=${f}.${d}.0${n} <${f}.${+d+1}.0-0`),i("xRange return",t),t}))},B=(e,a)=>(i("replaceStars",e,a),e.trim().replace(o[s.STAR],"")),k=(e,a)=>(i("replaceGTE0",e,a),e.trim().replace(o[a.includePrerelease?s.GTE0PRE:s.GTE0],"")),L=e=>(a,t,c,f,d,r,n,i,b,o,s,l)=>`${t=v(c)?"":v(f)?`>=${c}.0.0${e?"-0":""}`:v(d)?`>=${c}.${f}.0${e?"-0":""}`:r?`>=${t}`:`>=${t}${e?"-0":""}`} ${i=v(b)?"":v(o)?`<${+b+1}.0.0-0`:v(s)?`<${b}.${+o+1}.0-0`:l?`<=${b}.${o}.${s}-${l}`:e?`<${b}.${o}.${+s+1}-0`:`<=${i}`}`.trim(),S=(e,a,t)=>{for(let t=0;t0){const c=e[t].semver;if(c.major===a.major&&c.minor===a.minor&&c.patch===a.patch)return!0}return!1}return!0}},64739:(e,a,t)=>{const c=t(52207),{MAX_LENGTH:f,MAX_SAFE_INTEGER:d}=t(35237),{safeRe:r,t:n}=t(34567),i=t(69932),{compareIdentifiers:b}=t(27660);class o{constructor(e,a){if(a=i(a),e instanceof o){if(e.loose===!!a.loose&&e.includePrerelease===!!a.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>f)throw new TypeError(`version is longer than ${f} characters`);c("SemVer",e,a),this.options=a,this.loose=!!a.loose,this.includePrerelease=!!a.includePrerelease;const t=e.trim().match(a.loose?r[n.LOOSE]:r[n.FULL]);if(!t)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+t[1],this.minor=+t[2],this.patch=+t[3],this.major>d||this.major<0)throw new TypeError("Invalid major version");if(this.minor>d||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>d||this.patch<0)throw new TypeError("Invalid patch version");t[4]?this.prerelease=t[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const a=+e;if(a>=0&&a=0;)"number"==typeof this.prerelease[c]&&(this.prerelease[c]++,c=-2);if(-1===c){if(a===this.prerelease.join(".")&&!1===t)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(a){let c=[a,e];!1===t&&(c=[a]),0===b(this.prerelease[0],a)?isNaN(this.prerelease[1])&&(this.prerelease=c):this.prerelease=c}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=o},30911:(e,a,t)=>{const c=t(83321);e.exports=(e,a)=>{const t=c(e.trim().replace(/^[=v]+/,""),a);return t?t.version:null}},73646:(e,a,t)=>{const c=t(5778),f=t(10710),d=t(90047),r=t(70668),n=t(15960),i=t(99925);e.exports=(e,a,t,b)=>{switch(a){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof t&&(t=t.version),e===t;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof t&&(t=t.version),e!==t;case"":case"=":case"==":return c(e,t,b);case"!=":return f(e,t,b);case">":return d(e,t,b);case">=":return r(e,t,b);case"<":return n(e,t,b);case"<=":return i(e,t,b);default:throw new TypeError(`Invalid operator: ${a}`)}}},17425:(e,a,t)=>{const c=t(64739),f=t(83321),{safeRe:d,t:r}=t(34567);e.exports=(e,a)=>{if(e instanceof c)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let t=null;if((a=a||{}).rtl){const c=a.includePrerelease?d[r.COERCERTLFULL]:d[r.COERCERTL];let f;for(;(f=c.exec(e))&&(!t||t.index+t[0].length!==e.length);)t&&f.index+f[0].length===t.index+t[0].length||(t=f),c.lastIndex=f.index+f[1].length+f[2].length;c.lastIndex=-1}else t=e.match(a.includePrerelease?d[r.COERCEFULL]:d[r.COERCE]);if(null===t)return null;const n=t[2],i=t[3]||"0",b=t[4]||"0",o=a.includePrerelease&&t[5]?`-${t[5]}`:"",s=a.includePrerelease&&t[6]?`+${t[6]}`:"";return f(`${n}.${i}.${b}${o}${s}`,a)}},67544:(e,a,t)=>{const c=t(64739);e.exports=(e,a,t)=>{const f=new c(e,t),d=new c(a,t);return f.compare(d)||f.compareBuild(d)}},91554:(e,a,t)=>{const c=t(8317);e.exports=(e,a)=>c(e,a,!0)},8317:(e,a,t)=>{const c=t(64739);e.exports=(e,a,t)=>new c(e,t).compare(new c(a,t))},45007:(e,a,t)=>{const c=t(83321);e.exports=(e,a)=>{const t=c(e,null,!0),f=c(a,null,!0),d=t.compare(f);if(0===d)return null;const r=d>0,n=r?t:f,i=r?f:t,b=!!n.prerelease.length;if(i.prerelease.length&&!b)return i.patch||i.minor?n.patch?"patch":n.minor?"minor":"major":"major";const o=b?"pre":"";return t.major!==f.major?o+"major":t.minor!==f.minor?o+"minor":t.patch!==f.patch?o+"patch":"prerelease"}},5778:(e,a,t)=>{const c=t(8317);e.exports=(e,a,t)=>0===c(e,a,t)},90047:(e,a,t)=>{const c=t(8317);e.exports=(e,a,t)=>c(e,a,t)>0},70668:(e,a,t)=>{const c=t(8317);e.exports=(e,a,t)=>c(e,a,t)>=0},94586:(e,a,t)=>{const c=t(64739);e.exports=(e,a,t,f,d)=>{"string"==typeof t&&(d=f,f=t,t=void 0);try{return new c(e instanceof c?e.version:e,t).inc(a,f,d).version}catch(e){return null}}},15960:(e,a,t)=>{const c=t(8317);e.exports=(e,a,t)=>c(e,a,t)<0},99925:(e,a,t)=>{const c=t(8317);e.exports=(e,a,t)=>c(e,a,t)<=0},95207:(e,a,t)=>{const c=t(64739);e.exports=(e,a)=>new c(e,a).major},70547:(e,a,t)=>{const c=t(64739);e.exports=(e,a)=>new c(e,a).minor},10710:(e,a,t)=>{const c=t(8317);e.exports=(e,a,t)=>0!==c(e,a,t)},83321:(e,a,t)=>{const c=t(64739);e.exports=(e,a,t=!1)=>{if(e instanceof c)return e;try{return new c(e,a)}catch(e){if(!t)return null;throw e}}},5852:(e,a,t)=>{const c=t(64739);e.exports=(e,a)=>new c(e,a).patch},84058:(e,a,t)=>{const c=t(83321);e.exports=(e,a)=>{const t=c(e,a);return t&&t.prerelease.length?t.prerelease:null}},69173:(e,a,t)=>{const c=t(8317);e.exports=(e,a,t)=>c(a,e,t)},51200:(e,a,t)=>{const c=t(67544);e.exports=(e,a)=>e.sort(((e,t)=>c(t,e,a)))},52643:(e,a,t)=>{const c=t(25926);e.exports=(e,a,t)=>{try{a=new c(a,t)}catch(e){return!1}return a.test(e)}},63400:(e,a,t)=>{const c=t(67544);e.exports=(e,a)=>e.sort(((e,t)=>c(e,t,a)))},79572:(e,a,t)=>{const c=t(83321);e.exports=(e,a)=>{const t=c(e,a);return t?t.version:null}},56864:(e,a,t)=>{const c=t(34567),f=t(35237),d=t(64739),r=t(27660),n=t(83321),i=t(79572),b=t(30911),o=t(94586),s=t(45007),l=t(95207),u=t(70547),h=t(5852),p=t(84058),g=t(8317),m=t(69173),x=t(91554),y=t(67544),A=t(63400),v=t(51200),w=t(90047),_=t(15960),I=t(5778),E=t(10710),C=t(70668),M=t(99925),B=t(73646),k=t(17425),L=t(52139),S=t(25926),T=t(52643),N=t(24054),R=t(83777),P=t(63099),D=t(36258),O=t(77529),F=t(22944),Q=t(14316),U=t(12373),j=t(48337),H=t(72196),q=t(72505);e.exports={parse:n,valid:i,clean:b,inc:o,diff:s,major:l,minor:u,patch:h,prerelease:p,compare:g,rcompare:m,compareLoose:x,compareBuild:y,sort:A,rsort:v,gt:w,lt:_,eq:I,neq:E,gte:C,lte:M,cmp:B,coerce:k,Comparator:L,Range:S,satisfies:T,toComparators:N,maxSatisfying:R,minSatisfying:P,minVersion:D,validRange:O,outside:F,gtr:Q,ltr:U,intersects:j,simplifyRange:H,subset:q,SemVer:d,re:c.re,src:c.src,tokens:c.t,SEMVER_SPEC_VERSION:f.SEMVER_SPEC_VERSION,RELEASE_TYPES:f.RELEASE_TYPES,compareIdentifiers:r.compareIdentifiers,rcompareIdentifiers:r.rcompareIdentifiers}},35237:e=>{const a=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:a,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},52207:e=>{const a="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=a},27660:e=>{const a=/^[0-9]+$/,t=(e,t)=>{const c=a.test(e),f=a.test(t);return c&&f&&(e=+e,t=+t),e===t?0:c&&!f?-1:f&&!c?1:et(a,e)}},97228:e=>{e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const a=this.map.get(e);return void 0===a?void 0:(this.map.delete(e),this.map.set(e,a),a)}delete(e){return this.map.delete(e)}set(e,a){if(!this.delete(e)&&void 0!==a){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,a)}return this}}},69932:e=>{const a=Object.freeze({loose:!0}),t=Object.freeze({});e.exports=e=>e?"object"!=typeof e?a:e:t},34567:(e,a,t)=>{const{MAX_SAFE_COMPONENT_LENGTH:c,MAX_SAFE_BUILD_LENGTH:f,MAX_LENGTH:d}=t(35237),r=t(52207),n=(a=e.exports={}).re=[],i=a.safeRe=[],b=a.src=[],o=a.t={};let s=0;const l="[a-zA-Z0-9-]",u=[["\\s",1],["\\d",d],[l,f]],h=(e,a,t)=>{const c=(e=>{for(const[a,t]of u)e=e.split(`${a}*`).join(`${a}{0,${t}}`).split(`${a}+`).join(`${a}{1,${t}}`);return e})(a),f=s++;r(e,f,a),o[e]=f,b[f]=a,n[f]=new RegExp(a,t?"g":void 0),i[f]=new RegExp(c,t?"g":void 0)};h("NUMERICIDENTIFIER","0|[1-9]\\d*"),h("NUMERICIDENTIFIERLOOSE","\\d+"),h("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${l}*`),h("MAINVERSION",`(${b[o.NUMERICIDENTIFIER]})\\.(${b[o.NUMERICIDENTIFIER]})\\.(${b[o.NUMERICIDENTIFIER]})`),h("MAINVERSIONLOOSE",`(${b[o.NUMERICIDENTIFIERLOOSE]})\\.(${b[o.NUMERICIDENTIFIERLOOSE]})\\.(${b[o.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASEIDENTIFIER",`(?:${b[o.NUMERICIDENTIFIER]}|${b[o.NONNUMERICIDENTIFIER]})`),h("PRERELEASEIDENTIFIERLOOSE",`(?:${b[o.NUMERICIDENTIFIERLOOSE]}|${b[o.NONNUMERICIDENTIFIER]})`),h("PRERELEASE",`(?:-(${b[o.PRERELEASEIDENTIFIER]}(?:\\.${b[o.PRERELEASEIDENTIFIER]})*))`),h("PRERELEASELOOSE",`(?:-?(${b[o.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${b[o.PRERELEASEIDENTIFIERLOOSE]})*))`),h("BUILDIDENTIFIER",`${l}+`),h("BUILD",`(?:\\+(${b[o.BUILDIDENTIFIER]}(?:\\.${b[o.BUILDIDENTIFIER]})*))`),h("FULLPLAIN",`v?${b[o.MAINVERSION]}${b[o.PRERELEASE]}?${b[o.BUILD]}?`),h("FULL",`^${b[o.FULLPLAIN]}$`),h("LOOSEPLAIN",`[v=\\s]*${b[o.MAINVERSIONLOOSE]}${b[o.PRERELEASELOOSE]}?${b[o.BUILD]}?`),h("LOOSE",`^${b[o.LOOSEPLAIN]}$`),h("GTLT","((?:<|>)?=?)"),h("XRANGEIDENTIFIERLOOSE",`${b[o.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h("XRANGEIDENTIFIER",`${b[o.NUMERICIDENTIFIER]}|x|X|\\*`),h("XRANGEPLAIN",`[v=\\s]*(${b[o.XRANGEIDENTIFIER]})(?:\\.(${b[o.XRANGEIDENTIFIER]})(?:\\.(${b[o.XRANGEIDENTIFIER]})(?:${b[o.PRERELEASE]})?${b[o.BUILD]}?)?)?`),h("XRANGEPLAINLOOSE",`[v=\\s]*(${b[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${b[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${b[o.XRANGEIDENTIFIERLOOSE]})(?:${b[o.PRERELEASELOOSE]})?${b[o.BUILD]}?)?)?`),h("XRANGE",`^${b[o.GTLT]}\\s*${b[o.XRANGEPLAIN]}$`),h("XRANGELOOSE",`^${b[o.GTLT]}\\s*${b[o.XRANGEPLAINLOOSE]}$`),h("COERCEPLAIN",`(^|[^\\d])(\\d{1,${c}})(?:\\.(\\d{1,${c}}))?(?:\\.(\\d{1,${c}}))?`),h("COERCE",`${b[o.COERCEPLAIN]}(?:$|[^\\d])`),h("COERCEFULL",b[o.COERCEPLAIN]+`(?:${b[o.PRERELEASE]})?`+`(?:${b[o.BUILD]})?(?:$|[^\\d])`),h("COERCERTL",b[o.COERCE],!0),h("COERCERTLFULL",b[o.COERCEFULL],!0),h("LONETILDE","(?:~>?)"),h("TILDETRIM",`(\\s*)${b[o.LONETILDE]}\\s+`,!0),a.tildeTrimReplace="$1~",h("TILDE",`^${b[o.LONETILDE]}${b[o.XRANGEPLAIN]}$`),h("TILDELOOSE",`^${b[o.LONETILDE]}${b[o.XRANGEPLAINLOOSE]}$`),h("LONECARET","(?:\\^)"),h("CARETTRIM",`(\\s*)${b[o.LONECARET]}\\s+`,!0),a.caretTrimReplace="$1^",h("CARET",`^${b[o.LONECARET]}${b[o.XRANGEPLAIN]}$`),h("CARETLOOSE",`^${b[o.LONECARET]}${b[o.XRANGEPLAINLOOSE]}$`),h("COMPARATORLOOSE",`^${b[o.GTLT]}\\s*(${b[o.LOOSEPLAIN]})$|^$`),h("COMPARATOR",`^${b[o.GTLT]}\\s*(${b[o.FULLPLAIN]})$|^$`),h("COMPARATORTRIM",`(\\s*)${b[o.GTLT]}\\s*(${b[o.LOOSEPLAIN]}|${b[o.XRANGEPLAIN]})`,!0),a.comparatorTrimReplace="$1$2$3",h("HYPHENRANGE",`^\\s*(${b[o.XRANGEPLAIN]})\\s+-\\s+(${b[o.XRANGEPLAIN]})\\s*$`),h("HYPHENRANGELOOSE",`^\\s*(${b[o.XRANGEPLAINLOOSE]})\\s+-\\s+(${b[o.XRANGEPLAINLOOSE]})\\s*$`),h("STAR","(<|>)?=?\\s*\\*"),h("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),h("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},14316:(e,a,t)=>{const c=t(22944);e.exports=(e,a,t)=>c(e,a,">",t)},48337:(e,a,t)=>{const c=t(25926);e.exports=(e,a,t)=>(e=new c(e,t),a=new c(a,t),e.intersects(a,t))},12373:(e,a,t)=>{const c=t(22944);e.exports=(e,a,t)=>c(e,a,"<",t)},83777:(e,a,t)=>{const c=t(64739),f=t(25926);e.exports=(e,a,t)=>{let d=null,r=null,n=null;try{n=new f(a,t)}catch(e){return null}return e.forEach((e=>{n.test(e)&&(d&&-1!==r.compare(e)||(d=e,r=new c(d,t)))})),d}},63099:(e,a,t)=>{const c=t(64739),f=t(25926);e.exports=(e,a,t)=>{let d=null,r=null,n=null;try{n=new f(a,t)}catch(e){return null}return e.forEach((e=>{n.test(e)&&(d&&1!==r.compare(e)||(d=e,r=new c(d,t)))})),d}},36258:(e,a,t)=>{const c=t(64739),f=t(25926),d=t(90047);e.exports=(e,a)=>{e=new f(e,a);let t=new c("0.0.0");if(e.test(t))return t;if(t=new c("0.0.0-0"),e.test(t))return t;t=null;for(let a=0;a{const a=new c(e.semver.version);switch(e.operator){case">":0===a.prerelease.length?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":r&&!d(a,r)||(r=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!r||t&&!d(t,r)||(t=r)}return t&&e.test(t)?t:null}},22944:(e,a,t)=>{const c=t(64739),f=t(52139),{ANY:d}=f,r=t(25926),n=t(52643),i=t(90047),b=t(15960),o=t(99925),s=t(70668);e.exports=(e,a,t,l)=>{let u,h,p,g,m;switch(e=new c(e,l),a=new r(a,l),t){case">":u=i,h=o,p=b,g=">",m=">=";break;case"<":u=b,h=s,p=i,g="<",m="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(n(e,a,l))return!1;for(let t=0;t{e.semver===d&&(e=new f(">=0.0.0")),r=r||e,n=n||e,u(e.semver,r.semver,l)?r=e:p(e.semver,n.semver,l)&&(n=e)})),r.operator===g||r.operator===m)return!1;if((!n.operator||n.operator===g)&&h(e,n.semver))return!1;if(n.operator===m&&p(e,n.semver))return!1}return!0}},72196:(e,a,t)=>{const c=t(52643),f=t(8317);e.exports=(e,a,t)=>{const d=[];let r=null,n=null;const i=e.sort(((e,a)=>f(e,a,t)));for(const e of i)c(e,a,t)?(n=e,r||(r=e)):(n&&d.push([r,n]),n=null,r=null);r&&d.push([r,null]);const b=[];for(const[e,a]of d)e===a?b.push(e):a||e!==i[0]?a?e===i[0]?b.push(`<=${a}`):b.push(`${e} - ${a}`):b.push(`>=${e}`):b.push("*");const o=b.join(" || "),s="string"==typeof a.raw?a.raw:String(a);return o.length{const c=t(25926),f=t(52139),{ANY:d}=f,r=t(52643),n=t(8317),i=[new f(">=0.0.0-0")],b=[new f(">=0.0.0")],o=(e,a,t)=>{if(e===a)return!0;if(1===e.length&&e[0].semver===d){if(1===a.length&&a[0].semver===d)return!0;e=t.includePrerelease?i:b}if(1===a.length&&a[0].semver===d){if(t.includePrerelease)return!0;a=b}const c=new Set;let f,o,u,h,p,g,m;for(const a of e)">"===a.operator||">="===a.operator?f=s(f,a,t):"<"===a.operator||"<="===a.operator?o=l(o,a,t):c.add(a.semver);if(c.size>1)return null;if(f&&o){if(u=n(f.semver,o.semver,t),u>0)return null;if(0===u&&(">="!==f.operator||"<="!==o.operator))return null}for(const e of c){if(f&&!r(e,String(f),t))return null;if(o&&!r(e,String(o),t))return null;for(const c of a)if(!r(e,String(c),t))return!1;return!0}let x=!(!o||t.includePrerelease||!o.semver.prerelease.length)&&o.semver,y=!(!f||t.includePrerelease||!f.semver.prerelease.length)&&f.semver;x&&1===x.prerelease.length&&"<"===o.operator&&0===x.prerelease[0]&&(x=!1);for(const e of a){if(m=m||">"===e.operator||">="===e.operator,g=g||"<"===e.operator||"<="===e.operator,f)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),">"===e.operator||">="===e.operator){if(h=s(f,e,t),h===e&&h!==f)return!1}else if(">="===f.operator&&!r(f.semver,String(e),t))return!1;if(o)if(x&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===x.major&&e.semver.minor===x.minor&&e.semver.patch===x.patch&&(x=!1),"<"===e.operator||"<="===e.operator){if(p=l(o,e,t),p===e&&p!==o)return!1}else if("<="===o.operator&&!r(o.semver,String(e),t))return!1;if(!e.operator&&(o||f)&&0!==u)return!1}return!(f&&g&&!o&&0!==u||o&&m&&!f&&0!==u||y||x)},s=(e,a,t)=>{if(!e)return a;const c=n(e.semver,a.semver,t);return c>0?e:c<0||">"===a.operator&&">="===e.operator?a:e},l=(e,a,t)=>{if(!e)return a;const c=n(e.semver,a.semver,t);return c<0?e:c>0||"<"===a.operator&&"<="===e.operator?a:e};e.exports=(e,a,t={})=>{if(e===a)return!0;e=new c(e,t),a=new c(a,t);let f=!1;e:for(const c of e.set){for(const e of a.set){const a=o(c,e,t);if(f=f||null!==a,a)continue e}if(f)return!1}return!0}},24054:(e,a,t)=>{const c=t(25926);e.exports=(e,a)=>new c(e,a).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},77529:(e,a,t)=>{const c=t(25926);e.exports=(e,a)=>{try{return new c(e,a).range||"*"}catch(e){return null}}},25084:e=>{"use strict";e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var a=new Uint8Array(256),t=0;t>>0,b=new Uint8Array(d);e[t];){var o=a[e.charCodeAt(t)];if(255===o)return;for(var s=0,l=d-1;(0!==o||s>>0,b[l]=o%256>>>0,o=o/256>>>0;if(0!==o)throw new Error("Non-zero carry");f=s,t++}if(" "!==e[t]){for(var u=d-f;u!==d&&0===b[u];)u++;for(var h=new Uint8Array(c+(d-u)),p=c;u!==d;)h[p++]=b[u++];return h}}}return{encode:function(a){if(a instanceof Uint8Array||(ArrayBuffer.isView(a)?a=new Uint8Array(a.buffer,a.byteOffset,a.byteLength):Array.isArray(a)&&(a=Uint8Array.from(a))),!(a instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===a.length)return"";for(var t=0,c=0,f=0,d=a.length;f!==d&&0===a[f];)f++,t++;for(var i=(d-f)*b+1>>>0,o=new Uint8Array(i);f!==d;){for(var s=a[f],l=0,u=i-1;(0!==s||l>>0,o[u]=s%r>>>0,s=s/r>>>0;if(0!==s)throw new Error("Non-zero carry");c=l,f++}for(var h=i-c;h!==i&&0===o[h];)h++;for(var p=n.repeat(t);h{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.createCurve=a.getHash=void 0;const c=t(39615),f=t(99175),d=t(91705);function r(e){return{hash:e,hmac:(a,...t)=>(0,c.hmac)(e,a,(0,f.concatBytes)(...t)),randomBytes:f.randomBytes}}a.getHash=r,a.createCurve=function(e,a){const t=a=>(0,d.weierstrass)({...e,...r(a)});return Object.freeze({...t(a),create:t})}},62422:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.validateBasic=a.wNAF=void 0;const c=t(24967),f=t(91484),d=BigInt(0),r=BigInt(1);a.wNAF=function(e,a){const t=(e,a)=>{const t=a.negate();return e?t:a},c=e=>({windows:Math.ceil(a/e)+1,windowSize:2**(e-1)});return{constTimeNegate:t,unsafeLadder(a,t){let c=e.ZERO,f=a;for(;t>d;)t&r&&(c=c.add(f)),f=f.double(),t>>=r;return c},precomputeWindow(e,a){const{windows:t,windowSize:f}=c(a),d=[];let r=e,n=r;for(let e=0;e>=u,c>i&&(c-=l,d+=r);const n=a,h=a+Math.abs(c)-1,p=e%2!=0,g=c<0;0===c?o=o.add(t(p,f[n])):b=b.add(t(g,f[h]))}return{p:b,f:o}},wNAFCached(e,a,t,c){const f=e._WINDOW_SIZE||1;let d=a.get(e);return d||(d=this.precomputeWindow(e,f),1!==f&&a.set(e,c(d))),this.wNAF(f,d,t)}}},a.validateBasic=function(e){return(0,c.validateField)(e.Fp),(0,f.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,c.nLength)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}},71761:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.createHasher=a.isogenyMap=a.hash_to_field=a.expand_message_xof=a.expand_message_xmd=void 0;const c=t(24967),f=t(91484),d=f.bytesToNumberBE;function r(e,a){if(e<0||e>=1<<8*a)throw new Error(`bad I2OSP call: value=${e} length=${a}`);const t=Array.from({length:a}).fill(0);for(let c=a-1;c>=0;c--)t[c]=255&e,e>>>=8;return new Uint8Array(t)}function n(e,a){const t=new Uint8Array(e.length);for(let c=0;c255&&(a=c((0,f.concatBytes)((0,f.utf8ToBytes)("H2C-OVERSIZE-DST-"),a)));const{outputLen:d,blockLen:o}=c,s=Math.ceil(t/d);if(s>255)throw new Error("Invalid xmd length");const l=(0,f.concatBytes)(a,r(a.length,1)),u=r(0,o),h=r(t,2),p=new Array(s),g=c((0,f.concatBytes)(u,e,h,r(0,1),l));p[0]=c((0,f.concatBytes)(g,r(1,1),l));for(let e=1;e<=s;e++){const a=[n(g,p[e-1]),r(e+1,1),l];p[e]=c((0,f.concatBytes)(...a))}return(0,f.concatBytes)(...p).slice(0,t)}function s(e,a,t,c,d){if(i(e),i(a),b(t),a.length>255){const e=Math.ceil(2*c/8);a=d.create({dkLen:e}).update((0,f.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(a).digest()}if(t>65535||a.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return d.create({dkLen:t}).update(e).update(r(t,2)).update(a).update(r(a.length,1)).digest()}function l(e,a,t){(0,f.validateObject)(t,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:r,k:n,m:l,hash:u,expand:h,DST:p}=t;i(e),b(a);const g=function(e){if(e instanceof Uint8Array)return e;if("string"==typeof e)return(0,f.utf8ToBytes)(e);throw new Error("DST must be Uint8Array or string")}(p),m=r.toString(2).length,x=Math.ceil((m+n)/8),y=a*l*x;let A;if("xmd"===h)A=o(e,g,y,u);else if("xof"===h)A=s(e,g,y,n,u);else{if("_internal_pass"!==h)throw new Error('expand must be "xmd" or "xof"');A=e}const v=new Array(a);for(let e=0;eArray.from(e).reverse()));return(a,c)=>{const[f,d,r,n]=t.map((t=>t.reduce(((t,c)=>e.add(e.mul(t,a),c)))));return a=e.div(f,d),c=e.mul(c,e.div(r,n)),{x:a,y:c}}},a.createHasher=function(e,a,t){if("function"!=typeof a)throw new Error("mapToCurve() must be defined");return{hashToCurve(c,f){const d=l(c,2,{...t,DST:t.DST,...f}),r=e.fromAffine(a(d[0])),n=e.fromAffine(a(d[1])),i=r.add(n).clearCofactor();return i.assertValidity(),i},encodeToCurve(c,f){const d=l(c,1,{...t,DST:t.encodeDST,...f}),r=e.fromAffine(a(d[0])).clearCofactor();return r.assertValidity(),r}}}},24967:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.mapHashToField=a.getMinHashLength=a.getFieldBytesLength=a.hashToPrivateScalar=a.FpSqrtEven=a.FpSqrtOdd=a.Field=a.nLength=a.FpIsSquare=a.FpDiv=a.FpInvertBatch=a.FpPow=a.validateField=a.isNegativeLE=a.FpSqrt=a.tonelliShanks=a.invert=a.pow2=a.pow=a.mod=void 0;const c=t(91484),f=BigInt(0),d=BigInt(1),r=BigInt(2),n=BigInt(3),i=BigInt(4),b=BigInt(5),o=BigInt(8);function s(e,a){const t=e%a;return t>=f?t:a+t}function l(e,a,t){if(t<=f||a 0");if(t===d)return f;let c=d;for(;a>f;)a&d&&(c=c*e%t),e=e*e%t,a>>=d;return c}function u(e,a){if(e===f||a<=f)throw new Error(`invert: expected positive integers, got n=${e} mod=${a}`);let t=s(e,a),c=a,r=f,n=d,i=d,b=f;for(;t!==f;){const e=c/t,a=c%t,f=r-i*e,d=n-b*e;c=t,t=a,r=i,n=b,i=f,b=d}if(c!==d)throw new Error("invert: does not exist");return s(r,a)}function h(e){const a=(e-d)/r;let t,c,n;for(t=e-d,c=0;t%r===f;t/=r,c++);for(n=r;nf;)c*=c,c%=t;return c},a.invert=u,a.tonelliShanks=h,a.FpSqrt=p,a.isNegativeLE=(e,a)=>(s(e,a)&d)===d;const g=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function m(e,a,t){if(t 0");if(t===f)return e.ONE;if(t===d)return a;let c=e.ONE,r=a;for(;t>f;)t&d&&(c=e.mul(c,r)),r=e.sqr(r),t>>=d;return c}function x(e,a){const t=new Array(a.length),c=a.reduce(((a,c,f)=>e.is0(c)?a:(t[f]=a,e.mul(a,c))),e.ONE),f=e.inv(c);return a.reduceRight(((a,c,f)=>e.is0(c)?a:(t[f]=e.mul(a,t[f]),e.mul(a,c))),f),t}function y(e,a){const t=void 0!==a?a:e.toString(2).length;return{nBitLength:t,nByteLength:Math.ceil(t/8)}}function A(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const a=e.toString(2).length;return Math.ceil(a/8)}function v(e){const a=A(e);return a+Math.ceil(a/2)}a.validateField=function(e){const a=g.reduce(((e,a)=>(e[a]="function",e)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,c.validateObject)(e,a)},a.FpPow=m,a.FpInvertBatch=x,a.FpDiv=function(e,a,t){return e.mul(a,"bigint"==typeof t?u(t,e.ORDER):e.inv(t))},a.FpIsSquare=function(e){const a=(e.ORDER-d)/r;return t=>{const c=e.pow(t,a);return e.eql(c,e.ZERO)||e.eql(c,e.ONE)}},a.nLength=y,a.Field=function(e,a,t=!1,r={}){if(e<=f)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:n,nByteLength:i}=y(e,a);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");const b=p(e),o=Object.freeze({ORDER:e,BITS:n,BYTES:i,MASK:(0,c.bitMask)(n),ZERO:f,ONE:d,create:a=>s(a,e),isValid:a=>{if("bigint"!=typeof a)throw new Error("Invalid field element: expected bigint, got "+typeof a);return f<=a&&ae===f,isOdd:e=>(e&d)===d,neg:a=>s(-a,e),eql:(e,a)=>e===a,sqr:a=>s(a*a,e),add:(a,t)=>s(a+t,e),sub:(a,t)=>s(a-t,e),mul:(a,t)=>s(a*t,e),pow:(e,a)=>m(o,e,a),div:(a,t)=>s(a*u(t,e),e),sqrN:e=>e*e,addN:(e,a)=>e+a,subN:(e,a)=>e-a,mulN:(e,a)=>e*a,inv:a=>u(a,e),sqrt:r.sqrt||(e=>b(o,e)),invertBatch:e=>x(o,e),cmov:(e,a,t)=>t?a:e,toBytes:e=>t?(0,c.numberToBytesLE)(e,i):(0,c.numberToBytesBE)(e,i),fromBytes:e=>{if(e.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${e.length}`);return t?(0,c.bytesToNumberLE)(e):(0,c.bytesToNumberBE)(e)}});return Object.freeze(o)},a.FpSqrtOdd=function(e,a){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const t=e.sqrt(a);return e.isOdd(t)?t:e.neg(t)},a.FpSqrtEven=function(e,a){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const t=e.sqrt(a);return e.isOdd(t)?e.neg(t):t},a.hashToPrivateScalar=function(e,a,t=!1){const f=(e=(0,c.ensureBytes)("privateHash",e)).length,r=y(a).nByteLength+8;if(r<24||f1024)throw new Error(`hashToPrivateScalar: expected ${r}-1024 bytes of input, got ${f}`);return s(t?(0,c.bytesToNumberLE)(e):(0,c.bytesToNumberBE)(e),a-d)+d},a.getFieldBytesLength=A,a.getMinHashLength=v,a.mapHashToField=function(e,a,t=!1){const f=e.length,r=A(a),n=v(a);if(f<16||f1024)throw new Error(`expected ${n}-1024 bytes of input, got ${f}`);const i=s(t?(0,c.bytesToNumberBE)(e):(0,c.bytesToNumberLE)(e),a-d)+d;return t?(0,c.numberToBytesLE)(i,r):(0,c.numberToBytesBE)(i,r)}},91484:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.validateObject=a.createHmacDrbg=a.bitMask=a.bitSet=a.bitGet=a.bitLen=a.utf8ToBytes=a.equalBytes=a.concatBytes=a.ensureBytes=a.numberToVarBytesBE=a.numberToBytesLE=a.numberToBytesBE=a.bytesToNumberLE=a.bytesToNumberBE=a.hexToBytes=a.hexToNumber=a.numberToHexUnpadded=a.bytesToHex=void 0;const t=BigInt(0),c=BigInt(1),f=BigInt(2),d=e=>e instanceof Uint8Array,r=Array.from({length:256},((e,a)=>a.toString(16).padStart(2,"0")));function n(e){if(!d(e))throw new Error("Uint8Array expected");let a="";for(let t=0;te+a.length),0));let t=0;return e.forEach((e=>{if(!d(e))throw new Error("Uint8Array expected");a.set(e,t),t+=e.length})),a}a.bytesToHex=n,a.numberToHexUnpadded=i,a.hexToNumber=b,a.hexToBytes=o,a.bytesToNumberBE=function(e){return b(n(e))},a.bytesToNumberLE=function(e){if(!d(e))throw new Error("Uint8Array expected");return b(n(Uint8Array.from(e).reverse()))},a.numberToBytesBE=s,a.numberToBytesLE=function(e,a){return s(e,a).reverse()},a.numberToVarBytesBE=function(e){return o(i(e))},a.ensureBytes=function(e,a,t){let c;if("string"==typeof a)try{c=o(a)}catch(t){throw new Error(`${e} must be valid hex string, got "${a}". Cause: ${t}`)}else{if(!d(a))throw new Error(`${e} must be hex string or Uint8Array`);c=Uint8Array.from(a)}const f=c.length;if("number"==typeof t&&f!==t)throw new Error(`${e} expected ${t} bytes, got ${f}`);return c},a.concatBytes=l,a.equalBytes=function(e,a){if(e.length!==a.length)return!1;for(let t=0;tt;e>>=c,a+=1);return a},a.bitGet=function(e,a){return e>>BigInt(a)&c},a.bitSet=(e,a,f)=>e|(f?c:t)<(f<new Uint8Array(e),h=e=>Uint8Array.from(e);a.createHmacDrbg=function(e,a,t){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof a||a<2)throw new Error("qByteLen must be a number");if("function"!=typeof t)throw new Error("hmacFn must be a function");let c=u(e),f=u(e),d=0;const r=()=>{c.fill(1),f.fill(0),d=0},n=(...e)=>t(f,c,...e),i=(e=u())=>{f=n(h([0]),e),c=n(),0!==e.length&&(f=n(h([1]),e),c=n())},b=()=>{if(d++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const t=[];for(;e{let t;for(r(),i(e);!(t=a(b()));)i();return r(),t}};const p={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,a)=>a.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};a.validateObject=function(e,a,t={}){const c=(a,t,c)=>{const f=p[t];if("function"!=typeof f)throw new Error(`Invalid validator "${t}", expected function`);const d=e[a];if(!(c&&void 0===d||f(d,e)))throw new Error(`Invalid param ${String(a)}=${d} (${typeof d}), expected ${t}`)};for(const[e,t]of Object.entries(a))c(e,t,!1);for(const[e,a]of Object.entries(t))c(e,a,!0);return e}},91705:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.mapToCurveSimpleSWU=a.SWUFpSqrtRatio=a.weierstrass=a.weierstrassPoints=a.DER=void 0;const c=t(24967),f=t(91484),d=t(91484),r=t(62422),{bytesToNumberBE:n,hexToBytes:i}=f;a.DER={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(e){const{Err:t}=a.DER;if(e.length<2||2!==e[0])throw new t("Invalid signature integer tag");const c=e[1],f=e.subarray(2,c+2);if(!c||f.length!==c)throw new t("Invalid signature integer: wrong length");if(128&f[0])throw new t("Invalid signature integer: negative");if(0===f[0]&&!(128&f[1]))throw new t("Invalid signature integer: unnecessary leading zero");return{d:n(f),l:e.subarray(c+2)}},toSig(e){const{Err:t}=a.DER,c="string"==typeof e?i(e):e;if(!(c instanceof Uint8Array))throw new Error("ui8a expected");let f=c.length;if(f<2||48!=c[0])throw new t("Invalid signature tag");if(c[1]!==f-2)throw new t("Invalid signature: incorrect length");const{d,l:r}=a.DER._parseInt(c.subarray(2)),{d:n,l:b}=a.DER._parseInt(r);if(b.length)throw new t("Invalid signature: left bytes after parsing");return{r:d,s:n}},hexFromSig(e){const a=e=>8&Number.parseInt(e[0],16)?"00"+e:e,t=e=>{const a=e.toString(16);return 1&a.length?`0${a}`:a},c=a(t(e.s)),f=a(t(e.r)),d=c.length/2,r=f.length/2,n=t(d),i=t(r);return`30${t(r+d+4)}02${i}${f}02${n}${c}`}};const b=BigInt(0),o=BigInt(1),s=BigInt(2),l=BigInt(3),u=BigInt(4);function h(e){const a=function(e){const a=(0,r.validateBasic)(e);f.validateObject(a,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:t,Fp:c,a:d}=a;if(t){if(!c.eql(d,c.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof t||"bigint"!=typeof t.beta||"function"!=typeof t.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...a})}(e),{Fp:t}=a,n=a.toBytes||((e,a,c)=>{const d=a.toAffine();return f.concatBytes(Uint8Array.from([4]),t.toBytes(d.x),t.toBytes(d.y))}),i=a.fromBytes||(e=>{const a=e.subarray(1);return{x:t.fromBytes(a.subarray(0,t.BYTES)),y:t.fromBytes(a.subarray(t.BYTES,2*t.BYTES))}});function s(e){const{a:c,b:f}=a,d=t.sqr(e),r=t.mul(d,e);return t.add(t.add(r,t.mul(e,c)),f)}if(!t.eql(t.sqr(a.Gy),s(a.Gx)))throw new Error("bad generator point: equation left != right");function u(e){return"bigint"==typeof e&&bt.eql(e,t.ZERO);return f(a)&&f(c)?x.ZERO:new x(a,c,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const a=t.invertBatch(e.map((e=>e.pz)));return e.map(((e,t)=>e.toAffine(a[t]))).map(x.fromAffine)}static fromHex(e){const a=x.fromAffine(i((0,d.ensureBytes)("pointHex",e)));return a.assertValidity(),a}static fromPrivateKey(e){return x.BASE.multiply(p(e))}_setWindowSize(e){this._WINDOW_SIZE=e,g.delete(this)}assertValidity(){if(this.is0()){if(a.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:e,y:c}=this.toAffine();if(!t.isValid(e)||!t.isValid(c))throw new Error("bad point: x or y not FE");const f=t.sqr(c),d=s(e);if(!t.eql(f,d))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:e}=this.toAffine();if(t.isOdd)return!t.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){m(e);const{px:a,py:c,pz:f}=this,{px:d,py:r,pz:n}=e,i=t.eql(t.mul(a,n),t.mul(d,f)),b=t.eql(t.mul(c,n),t.mul(r,f));return i&&b}negate(){return new x(this.px,t.neg(this.py),this.pz)}double(){const{a:e,b:c}=a,f=t.mul(c,l),{px:d,py:r,pz:n}=this;let i=t.ZERO,b=t.ZERO,o=t.ZERO,s=t.mul(d,d),u=t.mul(r,r),h=t.mul(n,n),p=t.mul(d,r);return p=t.add(p,p),o=t.mul(d,n),o=t.add(o,o),i=t.mul(e,o),b=t.mul(f,h),b=t.add(i,b),i=t.sub(u,b),b=t.add(u,b),b=t.mul(i,b),i=t.mul(p,i),o=t.mul(f,o),h=t.mul(e,h),p=t.sub(s,h),p=t.mul(e,p),p=t.add(p,o),o=t.add(s,s),s=t.add(o,s),s=t.add(s,h),s=t.mul(s,p),b=t.add(b,s),h=t.mul(r,n),h=t.add(h,h),s=t.mul(h,p),i=t.sub(i,s),o=t.mul(h,u),o=t.add(o,o),o=t.add(o,o),new x(i,b,o)}add(e){m(e);const{px:c,py:f,pz:d}=this,{px:r,py:n,pz:i}=e;let b=t.ZERO,o=t.ZERO,s=t.ZERO;const u=a.a,h=t.mul(a.b,l);let p=t.mul(c,r),g=t.mul(f,n),y=t.mul(d,i),A=t.add(c,f),v=t.add(r,n);A=t.mul(A,v),v=t.add(p,g),A=t.sub(A,v),v=t.add(c,d);let w=t.add(r,i);return v=t.mul(v,w),w=t.add(p,y),v=t.sub(v,w),w=t.add(f,d),b=t.add(n,i),w=t.mul(w,b),b=t.add(g,y),w=t.sub(w,b),s=t.mul(u,v),b=t.mul(h,y),s=t.add(b,s),b=t.sub(g,s),s=t.add(g,s),o=t.mul(b,s),g=t.add(p,p),g=t.add(g,p),y=t.mul(u,y),v=t.mul(h,v),g=t.add(g,y),y=t.sub(p,y),y=t.mul(u,y),v=t.add(v,y),p=t.mul(g,v),o=t.add(o,p),p=t.mul(w,v),b=t.mul(A,b),b=t.sub(b,p),p=t.mul(A,g),s=t.mul(w,s),s=t.add(s,p),new x(b,o,s)}subtract(e){return this.add(e.negate())}is0(){return this.equals(x.ZERO)}wNAF(e){return A.wNAFCached(this,g,e,(e=>{const a=t.invertBatch(e.map((e=>e.pz)));return e.map(((e,t)=>e.toAffine(a[t]))).map(x.fromAffine)}))}multiplyUnsafe(e){const c=x.ZERO;if(e===b)return c;if(h(e),e===o)return this;const{endo:f}=a;if(!f)return A.unsafeLadder(this,e);let{k1neg:d,k1:r,k2neg:n,k2:i}=f.splitScalar(e),s=c,l=c,u=this;for(;r>b||i>b;)r&o&&(s=s.add(u)),i&o&&(l=l.add(u)),u=u.double(),r>>=o,i>>=o;return d&&(s=s.negate()),n&&(l=l.negate()),l=new x(t.mul(l.px,f.beta),l.py,l.pz),s.add(l)}multiply(e){h(e);let c,f,d=e;const{endo:r}=a;if(r){const{k1neg:e,k1:a,k2neg:n,k2:i}=r.splitScalar(d);let{p:b,f:o}=this.wNAF(a),{p:s,f:l}=this.wNAF(i);b=A.constTimeNegate(e,b),s=A.constTimeNegate(n,s),s=new x(t.mul(s.px,r.beta),s.py,s.pz),c=b.add(s),f=o.add(l)}else{const{p:e,f:a}=this.wNAF(d);c=e,f=a}return x.normalizeZ([c,f])[0]}multiplyAndAddUnsafe(e,a,t){const c=x.BASE,f=(e,a)=>a!==b&&a!==o&&e.equals(c)?e.multiply(a):e.multiplyUnsafe(a),d=f(this,a).add(f(e,t));return d.is0()?void 0:d}toAffine(e){const{px:a,py:c,pz:f}=this,d=this.is0();null==e&&(e=d?t.ONE:t.inv(f));const r=t.mul(a,e),n=t.mul(c,e),i=t.mul(f,e);if(d)return{x:t.ZERO,y:t.ZERO};if(!t.eql(i,t.ONE))throw new Error("invZ was invalid");return{x:r,y:n}}isTorsionFree(){const{h:e,isTorsionFree:t}=a;if(e===o)return!0;if(t)return t(x,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:t}=a;return e===o?this:t?t(x,this):this.multiplyUnsafe(a.h)}toRawBytes(e=!0){return this.assertValidity(),n(x,this,e)}toHex(e=!0){return f.bytesToHex(this.toRawBytes(e))}}x.BASE=new x(a.Gx,a.Gy,t.ONE),x.ZERO=new x(t.ZERO,t.ONE,t.ZERO);const y=a.nBitLength,A=(0,r.wNAF)(x,a.endo?Math.ceil(y/2):y);return{CURVE:a,ProjectivePoint:x,normPrivateKeyToScalar:p,weierstrassEquation:s,isWithinCurveOrder:u}}function p(e,a){const t=e.ORDER;let c=b;for(let e=t-o;e%s===b;e/=s)c+=o;const f=c,d=s<{let c=g,d=e.pow(t,h),r=e.sqr(d);r=e.mul(r,t);let n=e.mul(a,r);n=e.pow(n,i),n=e.mul(n,d),d=e.mul(n,t),r=e.mul(n,a);let b=e.mul(r,d);n=e.pow(b,p);let l=e.eql(n,e.ONE);d=e.mul(r,m),n=e.mul(b,c),r=e.cmov(d,r,l),b=e.cmov(n,b,l);for(let a=f;a>o;a--){let t=a-s;t=s<{let d=e.sqr(f);const r=e.mul(a,f);d=e.mul(d,r);let n=e.pow(d,t);n=e.mul(n,r);const i=e.mul(n,c),b=e.mul(e.sqr(n),f),o=e.eql(b,a);return{isValid:o,value:e.cmov(i,n,o)}}}return x}a.weierstrassPoints=h,a.weierstrass=function(e){const t=function(e){const a=(0,r.validateBasic)(e);return f.validateObject(a,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...a})}(e),{Fp:n,n:i}=t,s=n.BYTES+1,l=2*n.BYTES+1;function u(e){return c.mod(e,i)}function p(e){return c.invert(e,i)}const{ProjectivePoint:g,normPrivateKeyToScalar:m,weierstrassEquation:x,isWithinCurveOrder:y}=h({...t,toBytes(e,a,t){const c=a.toAffine(),d=n.toBytes(c.x),r=f.concatBytes;return t?r(Uint8Array.from([a.hasEvenY()?2:3]),d):r(Uint8Array.from([4]),d,n.toBytes(c.y))},fromBytes(e){const a=e.length,t=e[0],c=e.subarray(1);if(a!==s||2!==t&&3!==t){if(a===l&&4===t)return{x:n.fromBytes(c.subarray(0,n.BYTES)),y:n.fromBytes(c.subarray(n.BYTES,2*n.BYTES))};throw new Error(`Point of length ${a} was invalid. Expected ${s} compressed bytes or ${l} uncompressed bytes`)}{const e=f.bytesToNumberBE(c);if(!(b<(d=e)&&df.bytesToHex(f.numberToBytesBE(e,t.nByteLength));function v(e){return e>i>>o}const w=(e,a,t)=>f.bytesToNumberBE(e.slice(a,t));class _{constructor(e,a,t){this.r=e,this.s=a,this.recovery=t,this.assertValidity()}static fromCompact(e){const a=t.nByteLength;return e=(0,d.ensureBytes)("compactSignature",e,2*a),new _(w(e,0,a),w(e,a,2*a))}static fromDER(e){const{r:t,s:c}=a.DER.toSig((0,d.ensureBytes)("DER",e));return new _(t,c)}assertValidity(){if(!y(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!y(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new _(this.r,this.s,e)}recoverPublicKey(e){const{r:a,s:c,recovery:f}=this,r=M((0,d.ensureBytes)("msgHash",e));if(null==f||![0,1,2,3].includes(f))throw new Error("recovery id invalid");const i=2===f||3===f?a+t.n:a;if(i>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const b=1&f?"03":"02",o=g.fromHex(b+A(i)),s=p(i),l=u(-r*s),h=u(c*s),m=g.BASE.multiplyAndAddUnsafe(o,l,h);if(!m)throw new Error("point at infinify");return m.assertValidity(),m}hasHighS(){return v(this.s)}normalizeS(){return this.hasHighS()?new _(this.r,u(-this.s),this.recovery):this}toDERRawBytes(){return f.hexToBytes(this.toDERHex())}toDERHex(){return a.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return f.hexToBytes(this.toCompactHex())}toCompactHex(){return A(this.r)+A(this.s)}}const I={isValidPrivateKey(e){try{return m(e),!0}catch(e){return!1}},normPrivateKeyToScalar:m,randomPrivateKey:()=>{const e=c.getMinHashLength(t.n);return c.mapHashToField(t.randomBytes(e),t.n)},precompute:(e=8,a=g.BASE)=>(a._setWindowSize(e),a.multiply(BigInt(3)),a)};function E(e){const a=e instanceof Uint8Array,t="string"==typeof e,c=(a||t)&&e.length;return a?c===s||c===l:t?c===2*s||c===2*l:e instanceof g}const C=t.bits2int||function(e){const a=f.bytesToNumberBE(e),c=8*e.length-t.nBitLength;return c>0?a>>BigInt(c):a},M=t.bits2int_modN||function(e){return u(C(e))},B=f.bitMask(t.nBitLength);function k(e){if("bigint"!=typeof e)throw new Error("bigint expected");if(!(b<=e&&ee in c)))throw new Error("sign() legacy options not supported");const{hash:r,randomBytes:i}=t;let{lowS:s,prehash:l,extraEntropy:h}=c;null==s&&(s=!0),e=(0,d.ensureBytes)("msgHash",e),l&&(e=(0,d.ensureBytes)("prehashed msgHash",r(e)));const x=M(e),A=m(a),w=[k(A),k(x)];if(null!=h){const e=!0===h?i(n.BYTES):h;w.push((0,d.ensureBytes)("extraEntropy",e))}const I=f.concatBytes(...w),E=x;return{seed:I,k2sig:function(e){const a=C(e);if(!y(a))return;const t=p(a),c=g.BASE.multiply(a).toAffine(),f=u(c.x);if(f===b)return;const d=u(t*u(E+f*A));if(d===b)return;let r=(c.x===f?0:2)|Number(c.y&o),n=d;return s&&v(d)&&(n=function(e){return v(e)?u(-e):e}(d),r^=1),new _(f,n,r)}}}(e,a,c),s=t;return f.createHmacDrbg(s.hash.outputLen,s.nByteLength,s.hmac)(r,i)},verify:function(e,c,f,r=S){const n=e;if(c=(0,d.ensureBytes)("msgHash",c),f=(0,d.ensureBytes)("publicKey",f),"strict"in r)throw new Error("options.strict was renamed to lowS");const{lowS:i,prehash:b}=r;let o,s;try{if("string"==typeof n||n instanceof Uint8Array)try{o=_.fromDER(n)}catch(e){if(!(e instanceof a.DER.Err))throw e;o=_.fromCompact(n)}else{if("object"!=typeof n||"bigint"!=typeof n.r||"bigint"!=typeof n.s)throw new Error("PARSE");{const{r:e,s:a}=n;o=new _(e,a)}}s=g.fromHex(f)}catch(e){if("PARSE"===e.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(i&&o.hasHighS())return!1;b&&(c=t.hash(c));const{r:l,s:h}=o,m=M(c),x=p(h),y=u(m*x),A=u(l*x),v=g.BASE.multiplyAndAddUnsafe(s,y,A)?.toAffine();return!!v&&u(v.x)===l},ProjectivePoint:g,Signature:_,utils:I}},a.SWUFpSqrtRatio=p,a.mapToCurveSimpleSWU=function(e,a){if(c.validateField(e),!e.isValid(a.A)||!e.isValid(a.B)||!e.isValid(a.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const t=p(e,a.Z);if(!e.isOdd)throw new Error("Fp.isOdd is not implemented!");return c=>{let f,d,r,n,i,b,o,s;f=e.sqr(c),f=e.mul(f,a.Z),d=e.sqr(f),d=e.add(d,f),r=e.add(d,e.ONE),r=e.mul(r,a.B),n=e.cmov(a.Z,e.neg(d),!e.eql(d,e.ZERO)),n=e.mul(n,a.A),d=e.sqr(r),b=e.sqr(n),i=e.mul(b,a.A),d=e.add(d,i),d=e.mul(d,r),b=e.mul(b,n),i=e.mul(b,a.B),d=e.add(d,i),o=e.mul(f,r);const{isValid:l,value:u}=t(d,b);s=e.mul(f,c),s=e.mul(s,u),o=e.cmov(o,r,l),s=e.cmov(s,u,l);const h=e.isOdd(c)===e.isOdd(s);return s=e.cmov(e.neg(s),s,h),o=e.div(o,n),{x:o,y:s}}}},8510:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.encodeToCurve=a.hashToCurve=a.schnorr=a.secp256k1=void 0;const c=t(22623),f=t(99175),d=t(24967),r=t(91705),n=t(91484),i=t(71761),b=t(73562),o=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),s=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),l=BigInt(1),u=BigInt(2),h=(e,a)=>(e+a/u)/a;function p(e){const a=o,t=BigInt(3),c=BigInt(6),f=BigInt(11),r=BigInt(22),n=BigInt(23),i=BigInt(44),b=BigInt(88),s=e*e*e%a,l=s*s*e%a,h=(0,d.pow2)(l,t,a)*l%a,p=(0,d.pow2)(h,t,a)*l%a,m=(0,d.pow2)(p,u,a)*s%a,x=(0,d.pow2)(m,f,a)*m%a,y=(0,d.pow2)(x,r,a)*x%a,A=(0,d.pow2)(y,i,a)*y%a,v=(0,d.pow2)(A,b,a)*A%a,w=(0,d.pow2)(v,i,a)*y%a,_=(0,d.pow2)(w,t,a)*l%a,I=(0,d.pow2)(_,n,a)*x%a,E=(0,d.pow2)(I,c,a)*s%a,C=(0,d.pow2)(E,u,a);if(!g.eql(g.sqr(C),e))throw new Error("Cannot find square root");return C}const g=(0,d.Field)(o,void 0,void 0,{sqrt:p});a.secp256k1=(0,b.createCurve)({a:BigInt(0),b:BigInt(7),Fp:g,n:s,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const a=s,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),c=-l*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),f=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),r=t,n=BigInt("0x100000000000000000000000000000000"),i=h(r*e,a),b=h(-c*e,a);let o=(0,d.mod)(e-i*t-b*f,a),u=(0,d.mod)(-i*c-b*r,a);const p=o>n,g=u>n;if(p&&(o=a-o),g&&(u=a-u),o>n||u>n)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:p,k1:o,k2neg:g,k2:u}}}},c.sha256);const m=BigInt(0),x=e=>"bigint"==typeof e&&me.charCodeAt(0))));t=(0,n.concatBytes)(a,a),y[e]=t}return(0,c.sha256)((0,n.concatBytes)(t,...a))}const v=e=>e.toRawBytes(!0).slice(1),w=e=>(0,n.numberToBytesBE)(e,32),_=e=>(0,d.mod)(e,o),I=e=>(0,d.mod)(e,s),E=a.secp256k1.ProjectivePoint;function C(e){let t=a.secp256k1.utils.normPrivateKeyToScalar(e),c=E.fromPrivateKey(t);return{scalar:c.hasEvenY()?t:I(-t),bytes:v(c)}}function M(e){if(!x(e))throw new Error("bad x: need 0 < x < p");const a=_(e*e);let t=p(_(a*e+BigInt(7)));t%u!==m&&(t=_(-t));const c=new E(e,t,l);return c.assertValidity(),c}function B(...e){return I((0,n.bytesToNumberBE)(A("BIP0340/challenge",...e)))}function k(e,a,t){const c=(0,n.ensureBytes)("signature",e,64),f=(0,n.ensureBytes)("message",a),d=(0,n.ensureBytes)("publicKey",t,32);try{const e=M((0,n.bytesToNumberBE)(d)),a=(0,n.bytesToNumberBE)(c.subarray(0,32));if(!x(a))return!1;const t=(0,n.bytesToNumberBE)(c.subarray(32,64));if(!("bigint"==typeof(o=t)&&m(0,i.isogenyMap)(g,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map((e=>e.map((e=>BigInt(e)))))))(),S=(()=>(0,r.mapToCurveSimpleSWU)(g,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:g.create(BigInt("-11"))}))(),T=(()=>(0,i.createHasher)(a.secp256k1.ProjectivePoint,(e=>{const{x:a,y:t}=S(g.create(e[0]));return L(a,t)}),{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:g.ORDER,m:1,k:128,expand:"xmd",hash:c.sha256}))();a.hashToCurve=T.hashToCurve,a.encodeToCurve=T.encodeToCurve},67557:(e,a)=>{"use strict";function t(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function c(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)}function f(e,...a){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(a.length>0&&!a.includes(e.length))throw new Error(`Expected Uint8Array of length ${a}, not of length=${e.length}`)}function d(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");t(e.outputLen),t(e.blockLen)}function r(e,a=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(a&&e.finished)throw new Error("Hash#digest() has already been called")}function n(e,a){f(e);const t=a.outputLen;if(e.length{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.SHA2=void 0;const c=t(67557),f=t(99175);class d extends f.Hash{constructor(e,a,t,c){super(),this.blockLen=e,this.outputLen=a,this.padOffset=t,this.isLE=c,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,f.createView)(this.buffer)}update(e){(0,c.exists)(this);const{view:a,buffer:t,blockLen:d}=this,r=(e=(0,f.toBytes)(e)).length;for(let c=0;cd-n&&(this.process(t,0),n=0);for(let e=n;e>f&d),n=Number(t&d),i=c?4:0,b=c?0:4;e.setUint32(a+i,r,c),e.setUint32(a+b,n,c)}(t,d-8,BigInt(8*this.length),r),this.process(t,0);const i=(0,f.createView)(e),b=this.outputLen;if(b%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const o=b/4,s=this.get();if(o>s.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.add5L=a.add5H=a.add4H=a.add4L=a.add3H=a.add3L=a.add=a.rotlBL=a.rotlBH=a.rotlSL=a.rotlSH=a.rotr32L=a.rotr32H=a.rotrBL=a.rotrBH=a.rotrSL=a.rotrSH=a.shrSL=a.shrSH=a.toBig=a.split=a.fromBig=void 0;const t=BigInt(2**32-1),c=BigInt(32);function f(e,a=!1){return a?{h:Number(e&t),l:Number(e>>c&t)}:{h:0|Number(e>>c&t),l:0|Number(e&t)}}function d(e,a=!1){let t=new Uint32Array(e.length),c=new Uint32Array(e.length);for(let d=0;dBigInt(e>>>0)<>>0);a.toBig=r;const n=(e,a,t)=>e>>>t;a.shrSH=n;const i=(e,a,t)=>e<<32-t|a>>>t;a.shrSL=i;const b=(e,a,t)=>e>>>t|a<<32-t;a.rotrSH=b;const o=(e,a,t)=>e<<32-t|a>>>t;a.rotrSL=o;const s=(e,a,t)=>e<<64-t|a>>>t-32;a.rotrBH=s;const l=(e,a,t)=>e>>>t-32|a<<64-t;a.rotrBL=l;const u=(e,a)=>a;a.rotr32H=u;const h=(e,a)=>e;a.rotr32L=h;const p=(e,a,t)=>e<>>32-t;a.rotlSH=p;const g=(e,a,t)=>a<>>32-t;a.rotlSL=g;const m=(e,a,t)=>a<>>64-t;a.rotlBH=m;const x=(e,a,t)=>e<>>64-t;function y(e,a,t,c){const f=(a>>>0)+(c>>>0);return{h:e+t+(f/2**32|0)|0,l:0|f}}a.rotlBL=x,a.add=y;const A=(e,a,t)=>(e>>>0)+(a>>>0)+(t>>>0);a.add3L=A;const v=(e,a,t,c)=>a+t+c+(e/2**32|0)|0;a.add3H=v;const w=(e,a,t,c)=>(e>>>0)+(a>>>0)+(t>>>0)+(c>>>0);a.add4L=w;const _=(e,a,t,c,f)=>a+t+c+f+(e/2**32|0)|0;a.add4H=_;const I=(e,a,t,c,f)=>(e>>>0)+(a>>>0)+(t>>>0)+(c>>>0)+(f>>>0);a.add5L=I;const E=(e,a,t,c,f,d)=>a+t+c+f+d+(e/2**32|0)|0;a.add5H=E;const C={fromBig:f,split:d,toBig:r,shrSH:n,shrSL:i,rotrSH:b,rotrSL:o,rotrBH:s,rotrBL:l,rotr32H:u,rotr32L:h,rotlSH:p,rotlSL:g,rotlBH:m,rotlBL:x,add:y,add3L:A,add3H:v,add4L:w,add4H:_,add5H:E,add5L:I};a.default=C},25145:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.crypto=void 0,a.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},39615:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.hmac=a.HMAC=void 0;const c=t(67557),f=t(99175);class d extends f.Hash{constructor(e,a){super(),this.finished=!1,this.destroyed=!1,(0,c.hash)(e);const t=(0,f.toBytes)(a);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const d=this.blockLen,r=new Uint8Array(d);r.set(t.length>d?e.create().update(t).digest():t);for(let e=0;enew d(e,a).update(t).digest(),a.hmac.create=(e,a)=>new d(e,a)},22623:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.sha224=a.sha256=void 0;const c=t(90915),f=t(99175),d=(e,a,t)=>e&a^e&t^a&t,r=new Uint32Array([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]),n=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),i=new Uint32Array(64);class b extends c.SHA2{constructor(){super(64,32,8,!1),this.A=0|n[0],this.B=0|n[1],this.C=0|n[2],this.D=0|n[3],this.E=0|n[4],this.F=0|n[5],this.G=0|n[6],this.H=0|n[7]}get(){const{A:e,B:a,C:t,D:c,E:f,F:d,G:r,H:n}=this;return[e,a,t,c,f,d,r,n]}set(e,a,t,c,f,d,r,n){this.A=0|e,this.B=0|a,this.C=0|t,this.D=0|c,this.E=0|f,this.F=0|d,this.G=0|r,this.H=0|n}process(e,a){for(let t=0;t<16;t++,a+=4)i[t]=e.getUint32(a,!1);for(let e=16;e<64;e++){const a=i[e-15],t=i[e-2],c=(0,f.rotr)(a,7)^(0,f.rotr)(a,18)^a>>>3,d=(0,f.rotr)(t,17)^(0,f.rotr)(t,19)^t>>>10;i[e]=d+i[e-7]+c+i[e-16]|0}let{A:t,B:c,C:n,D:b,E:o,F:s,G:l,H:u}=this;for(let e=0;e<64;e++){const a=u+((0,f.rotr)(o,6)^(0,f.rotr)(o,11)^(0,f.rotr)(o,25))+((h=o)&s^~h&l)+r[e]+i[e]|0,p=((0,f.rotr)(t,2)^(0,f.rotr)(t,13)^(0,f.rotr)(t,22))+d(t,c,n)|0;u=l,l=s,s=o,o=b+a|0,b=n,n=c,c=t,t=a+p|0}var h;t=t+this.A|0,c=c+this.B|0,n=n+this.C|0,b=b+this.D|0,o=o+this.E|0,s=s+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(t,c,n,b,o,s,l,u)}roundClean(){i.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class o extends b{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}a.sha256=(0,f.wrapConstructor)((()=>new b)),a.sha224=(0,f.wrapConstructor)((()=>new o))},32955:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.shake256=a.shake128=a.keccak_512=a.keccak_384=a.keccak_256=a.keccak_224=a.sha3_512=a.sha3_384=a.sha3_256=a.sha3_224=a.Keccak=a.keccakP=void 0;const c=t(67557),f=t(22318),d=t(99175),[r,n,i]=[[],[],[]],b=BigInt(0),o=BigInt(1),s=BigInt(2),l=BigInt(7),u=BigInt(256),h=BigInt(113);for(let e=0,a=o,t=1,c=0;e<24;e++){[t,c]=[c,(2*t+3*c)%5],r.push(2*(5*c+t)),n.push((e+1)*(e+2)/2%64);let f=b;for(let e=0;e<7;e++)a=(a<>l)*h)%u,a&s&&(f^=o<<(o<t>32?(0,f.rotlBH)(e,a,t):(0,f.rotlSH)(e,a,t),x=(e,a,t)=>t>32?(0,f.rotlBL)(e,a,t):(0,f.rotlSL)(e,a,t);function y(e,a=24){const t=new Uint32Array(10);for(let c=24-a;c<24;c++){for(let a=0;a<10;a++)t[a]=e[a]^e[a+10]^e[a+20]^e[a+30]^e[a+40];for(let a=0;a<10;a+=2){const c=(a+8)%10,f=(a+2)%10,d=t[f],r=t[f+1],n=m(d,r,1)^t[c],i=x(d,r,1)^t[c+1];for(let t=0;t<50;t+=10)e[a+t]^=n,e[a+t+1]^=i}let a=e[2],f=e[3];for(let t=0;t<24;t++){const c=n[t],d=m(a,f,c),i=x(a,f,c),b=r[t];a=e[b],f=e[b+1],e[b]=d,e[b+1]=i}for(let a=0;a<50;a+=10){for(let c=0;c<10;c++)t[c]=e[a+c];for(let c=0;c<10;c++)e[a+c]^=~t[(c+2)%10]&t[(c+4)%10]}e[0]^=p[c],e[1]^=g[c]}t.fill(0)}a.keccakP=y;class A extends d.Hash{constructor(e,a,t,f=!1,r=24){if(super(),this.blockLen=e,this.suffix=a,this.outputLen=t,this.enableXOF=f,this.rounds=r,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,c.number)(t),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,d.u32)(this.state)}keccak(){y(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){(0,c.exists)(this);const{blockLen:a,state:t}=this,f=(e=(0,d.toBytes)(e)).length;for(let c=0;c=t&&this.keccak();const d=Math.min(t-this.posOut,f-c);e.set(a.subarray(this.posOut,this.posOut+d),c),this.posOut+=d,c+=d}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,c.number)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,c.output)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:a,suffix:t,outputLen:c,rounds:f,enableXOF:d}=this;return e||(e=new A(a,t,c,d,f)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=f,e.suffix=t,e.outputLen=c,e.enableXOF=d,e.destroyed=this.destroyed,e}}a.Keccak=A;const v=(e,a,t)=>(0,d.wrapConstructor)((()=>new A(a,e,t)));a.sha3_224=v(6,144,28),a.sha3_256=v(6,136,32),a.sha3_384=v(6,104,48),a.sha3_512=v(6,72,64),a.keccak_224=v(1,144,28),a.keccak_256=v(1,136,32),a.keccak_384=v(1,104,48),a.keccak_512=v(1,72,64);const w=(e,a,t)=>(0,d.wrapXOFConstructorWithOpts)(((c={})=>new A(a,e,void 0===c.dkLen?t:c.dkLen,!0)));a.shake128=w(31,168,16),a.shake256=w(31,136,32)},99175:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.randomBytes=a.wrapXOFConstructorWithOpts=a.wrapConstructorWithOpts=a.wrapConstructor=a.checkOpts=a.Hash=a.concatBytes=a.toBytes=a.utf8ToBytes=a.asyncLoop=a.nextTick=a.hexToBytes=a.bytesToHex=a.isLE=a.rotr=a.createView=a.u32=a.u8=void 0;const c=t(25145),f=e=>e instanceof Uint8Array;if(a.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),a.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),a.rotr=(e,a)=>e<<32-a|e>>>a,a.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!a.isLE)throw new Error("Non little-endian hardware is not supported");const d=Array.from({length:256},((e,a)=>a.toString(16).padStart(2,"0")));function r(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function n(e){if("string"==typeof e&&(e=r(e)),!f(e))throw new Error("expected Uint8Array, got "+typeof e);return e}a.bytesToHex=function(e){if(!f(e))throw new Error("Uint8Array expected");let a="";for(let t=0;t{},a.asyncLoop=async function(e,t,c){let f=Date.now();for(let d=0;d=0&&ee+a.length),0));let t=0;return e.forEach((e=>{if(!f(e))throw new Error("Uint8Array expected");a.set(e,t),t+=e.length})),a},a.Hash=class{clone(){return this._cloneInto()}};const i={}.toString;a.checkOpts=function(e,a){if(void 0!==a&&"[object Object]"!==i.call(a))throw new Error("Options should be object or undefined");return Object.assign(e,a)},a.wrapConstructor=function(e){const a=a=>e().update(n(a)).digest(),t=e();return a.outputLen=t.outputLen,a.blockLen=t.blockLen,a.create=()=>e(),a},a.wrapConstructorWithOpts=function(e){const a=(a,t)=>e(t).update(n(a)).digest(),t=e({});return a.outputLen=t.outputLen,a.blockLen=t.blockLen,a.create=a=>e(a),a},a.wrapXOFConstructorWithOpts=function(e){const a=(a,t)=>e(t).update(n(a)).digest(),t=e({});return a.outputLen=t.outputLen,a.blockLen=t.blockLen,a.create=a=>e(a),a},a.randomBytes=function(e=32){if(c.crypto&&"function"==typeof c.crypto.getRandomValues)return c.crypto.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}},63203:(e,a)=>{"use strict";function t(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}function c(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function f(...e){const a=e=>e,t=(e,a)=>t=>e(a(t));return{encode:e.map((e=>e.encode)).reduceRight(t,a),decode:e.map((e=>e.decode)).reduce(t,a)}}function d(e){return{encode:a=>{if(!Array.isArray(a)||a.length&&"number"!=typeof a[0])throw new Error("alphabet.encode input should be an array of numbers");return a.map((a=>{if(t(a),a<0||a>=e.length)throw new Error(`Digit index outside alphabet: ${a} (alphabet: ${e.length})`);return e[a]}))},decode:a=>{if(!Array.isArray(a)||a.length&&"string"!=typeof a[0])throw new Error("alphabet.decode input should be array of strings");return a.map((a=>{if("string"!=typeof a)throw new Error(`alphabet.decode: not string element=${a}`);const t=e.indexOf(a);if(-1===t)throw new Error(`Unknown letter: "${a}". Allowed: ${e}`);return t}))}}}function r(e=""){if("string"!=typeof e)throw new Error("join separator should be string");return{encode:a=>{if(!Array.isArray(a)||a.length&&"string"!=typeof a[0])throw new Error("join.encode input should be array of strings");for(let e of a)if("string"!=typeof e)throw new Error(`join.encode: non-string input=${e}`);return a.join(e)},decode:a=>{if("string"!=typeof a)throw new Error("join.decode input should be string");return a.split(e)}}}function n(e,a="="){if(t(e),"string"!=typeof a)throw new Error("padding chr should be string");return{encode(t){if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("padding.encode input should be array of strings");for(let e of t)if("string"!=typeof e)throw new Error(`padding.encode: non-string input=${e}`);for(;t.length*e%8;)t.push(a);return t},decode(t){if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("padding.encode input should be array of strings");for(let e of t)if("string"!=typeof e)throw new Error(`padding.decode: non-string input=${e}`);let c=t.length;if(c*e%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;c>0&&t[c-1]===a;c--)if(!((c-1)*e%8))throw new Error("Invalid padding: string has too much padding");return t.slice(0,c)}}}function i(e){if("function"!=typeof e)throw new Error("normalize fn should be function");return{encode:e=>e,decode:a=>e(a)}}function b(e,a,c){if(a<2)throw new Error(`convertRadix: wrong from=${a}, base cannot be less than 2`);if(c<2)throw new Error(`convertRadix: wrong to=${c}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let f=0;const d=[],r=Array.from(e);for(r.forEach((e=>{if(t(e),e<0||e>=a)throw new Error(`Wrong integer: ${e}`)}));;){let e=0,t=!0;for(let d=f;da?o(a,e%a):e,s=(e,a)=>e+(a-o(e,a));function l(e,a,c,f){if(!Array.isArray(e))throw new Error("convertRadix2: data should be array");if(a<=0||a>32)throw new Error(`convertRadix2: wrong from=${a}`);if(c<=0||c>32)throw new Error(`convertRadix2: wrong to=${c}`);if(s(a,c)>32)throw new Error(`convertRadix2: carry overflow from=${a} to=${c} carryBits=${s(a,c)}`);let d=0,r=0;const n=2**c-1,i=[];for(const f of e){if(t(f),f>=2**a)throw new Error(`convertRadix2: invalid data word=${f} from=${a}`);if(d=d<32)throw new Error(`convertRadix2: carry overflow pos=${r} from=${a}`);for(r+=a;r>=c;r-=c)i.push((d>>r-c&n)>>>0);d&=2**r-1}if(d=d<=a)throw new Error("Excess padding");if(!f&&d)throw new Error(`Non-zero padding: ${d}`);return f&&r>0&&i.push(d>>>0),i}function u(e){return t(e),{encode:a=>{if(!c(a))throw new Error("radix.encode input should be Uint8Array");return b(Array.from(a),256,e)},decode:a=>{if(!Array.isArray(a)||a.length&&"number"!=typeof a[0])throw new Error("radix.decode input should be array of numbers");return Uint8Array.from(b(a,e,256))}}}function h(e,a=!1){if(t(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(s(8,e)>32||s(e,8)>32)throw new Error("radix2: carry overflow");return{encode:t=>{if(!c(t))throw new Error("radix2.encode input should be Uint8Array");return l(Array.from(t),8,e,!a)},decode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("radix2.decode input should be array of numbers");return Uint8Array.from(l(t,e,8,a))}}}function p(e){if("function"!=typeof e)throw new Error("unsafeWrapper fn should be function");return function(...a){try{return e.apply(null,a)}catch(e){}}}function g(e,a){if(t(e),"function"!=typeof a)throw new Error("checksum fn should be function");return{encode(t){if(!c(t))throw new Error("checksum.encode: input should be Uint8Array");const f=a(t).slice(0,e),d=new Uint8Array(t.length+e);return d.set(t),d.set(f,t.length),d},decode(t){if(!c(t))throw new Error("checksum.decode: input should be Uint8Array");const f=t.slice(0,-e),d=a(f).slice(0,e),r=t.slice(-e);for(let a=0;ae.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")))),a.base64=f(h(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),n(6),r("")),a.base64nopad=f(h(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),r("")),a.base64url=f(h(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),n(6),r("")),a.base64urlnopad=f(h(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),r(""));const m=e=>f(u(58),d(e),r(""));a.base58=m("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),a.base58flickr=m("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),a.base58xrp=m("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const x=[0,2,3,5,6,7,9,10,11];a.base58xmr={encode(e){let t="";for(let c=0;cf(g(4,(a=>e(e(a)))),a.base58),a.base58check=a.createBase58check;const y=f(d("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),r("")),A=[996825010,642813549,513874426,1027748829,705979059];function v(e){const a=e>>25;let t=(33554431&e)<<5;for(let e=0;e>e&1)&&(t^=A[e]);return t}function w(e,a,t=1){const c=e.length;let f=1;for(let a=0;a126)throw new Error(`Invalid prefix (${e})`);f=v(f)^t>>5}f=v(f);for(let a=0;ac)throw new TypeError(`Length ${f} exceeds limit ${c}`);const d=e.toLowerCase(),r=w(d,t,a);return`${d}1${y.encode(t)}${r}`}function n(e,t=90){if("string"!=typeof e)throw new Error("bech32.decode input should be string, not "+typeof e);if(e.length<8||!1!==t&&e.length>t)throw new TypeError(`Wrong string length: ${e.length} (${e}). Expected (8..${t})`);const c=e.toLowerCase();if(e!==c&&e!==e.toUpperCase())throw new Error("String must be lowercase or uppercase");const f=c.lastIndexOf("1");if(0===f||-1===f)throw new Error('Letter "1" must be present between prefix and data only');const d=c.slice(0,f),r=c.slice(f+1);if(r.length<6)throw new Error("Data must be at least 6 characters long");const n=y.decode(r).slice(0,-6),i=w(d,n,a);if(!r.endsWith(i))throw new Error(`Invalid checksum in ${e}: expected "${i}"`);return{prefix:d,words:n}}return{encode:r,decode:n,encodeFromBytes:function(e,a){return r(e,f(a))},decodeToBytes:function(e){const{prefix:a,words:t}=n(e,!1);return{prefix:a,words:t,bytes:c(t)}},decodeUnsafe:p(n),fromWords:c,fromWordsUnsafe:d,toWords:f}}a.bech32=_("bech32"),a.bech32m=_("bech32m"),a.utf8={encode:e=>(new TextDecoder).decode(e),decode:e=>(new TextEncoder).encode(e)},a.hex=f(h(4),d("0123456789abcdef"),r(""),i((e=>{if("string"!=typeof e||e.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()})));const I={utf8:a.utf8,hex:a.hex,base16:a.base16,base32:a.base32,base64:a.base64,base64url:a.base64url,base58:a.base58,base58xmr:a.base58xmr},E="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr";a.bytesToString=(e,a)=>{if("string"!=typeof e||!I.hasOwnProperty(e))throw new TypeError(E);if(!c(a))throw new TypeError("bytesToString() expects Uint8Array");return I[e].encode(a)},a.str=a.bytesToString,a.stringToBytes=(e,a)=>{if(!I.hasOwnProperty(e))throw new TypeError(E);if("string"!=typeof a)throw new TypeError("stringToBytes() expects string");return I[e].decode(a)},a.bytes=a.stringToBytes},7736:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.BaseTree=void 0,a.BaseTree=class{get capacity(){return 2**this.levels}get layers(){return this._layers.slice()}get zeros(){return this._zeros.slice()}get elements(){return this._layers[0].slice()}get root(){var e;return null!==(e=this._layers[this.levels][0])&&void 0!==e?e:this._zeros[this.levels]}static indexOf(e,a,t,c){return c?e.findIndex((e=>c(a,e))):e.indexOf(a,t)}insert(e){if(this._layers[0].length>=this.capacity)throw new Error("Tree is full");this.update(this._layers[0].length,e)}bulkInsert(e){if(e.length){if(this._layers[0].length+e.length>this.capacity)throw new Error("Tree is full");for(let a=0;a>=1;const e=this._layers[t-1][2*c],a=this._layers[t-1][2*c+1];this._layers[t][c]=this._hashFn(e,a)}}this.insert(e[e.length-1])}}update(e,a){if(isNaN(Number(e))||e<0||e>this._layers[0].length||e>=this.capacity)throw new Error("Insert index out of bounds: "+e);this._layers[0][e]=a,this._processUpdate(e)}path(e){if(isNaN(Number(e))||e<0||e>=this._layers[0].length)throw new Error("Index out of bounds: "+e);let a=+e;const t=[],c=[],f=[];for(let e=0;e>=1}return{pathElements:t,pathIndices:c,pathPositions:f,pathRoot:this.root}}_buildZeros(){this._zeros=[this.zeroElement];for(let e=1;e<=this.levels;e++)this._zeros[e]=this._hashFn(this._zeros[e-1],this._zeros[e-1])}_processNodes(e,a){const t=e.length;let c=Math.ceil(t/2);const f=new Array(c);c--;const d=t-(t%2^1);let r=0;for(let n=d;n>=0&&void 0!==e[n-1];n-=2){const i=e[n-1],b=n===d&&t%2==1?this._zeros[a-1]:e[n];f[c-r]=this._hashFn(i,b),r++}return f}_processUpdate(e){for(let a=1;a<=this.levels;a++){e>>=1;const t=this._layers[a-1][2*e],c=2*e+1this.capacity)throw new Error("Tree is full");this._hashFn=t,this.zeroElement=c,this._layers=[];const d=a.slice();this._layers=[d],this._buildZeros(),this._buildHashes()}_buildHashes(){for(let e=1;e<=this.levels;e++){const a=this._layers[e-1];this._layers[e]=this._processNodes(a,e)}}bulkInsert(e){if(e.length){if(this._layers[0].length+e.length>this.capacity)throw new Error("Tree is full");for(let a=0;a>=1,this._layers[t][c]=this._hashFn(this._layers[t-1][2*c],this._layers[t-1][2*c+1])}this.insert(e[e.length-1])}}indexOf(e,a){return d.BaseTree.indexOf(this._layers[0],e,0,a)}proof(e){const a=this.indexOf(e);return this.path(a)}getTreeEdge(e){const a=this._layers[0][e];if(void 0===a)throw new Error("Element not found");return{edgePath:this.path(e),edgeElement:a,edgeIndex:e,edgeElementsCount:this._layers[0].length}}getTreeSlices(e=4){const a=this._layers[0].length;let t=Math.ceil(a/e);t%2&&t++;const c=[];for(let e=0;e(e.set(t,[a,this.edgeLeafProof.pathElements[t]]),e)),new Map),this._proofMap.set(this.levels,[0,this.edgeLeafProof.pathRoot])}_buildTree(){const e=this._edgeLeaf.index;if(this._leaves=Array(e).concat(this._leavesAfterEdge),this._proofMap.has(0)){const[e,a]=this._proofMap.get(0);this._leaves[e]=a}this._layers=[this._leaves],this._buildZeros(),this._buildHashes()}_buildHashes(){for(let e=1;e<=this.levels;e++){const a=this._layers[e-1],t=this._processNodes(a,e);if(this._proofMap.has(e)){const[a,c]=this._proofMap.get(e);t[a]||(t[a]=c)}this._layers[e]=t}}update(e,a){if(isNaN(Number(e))||e<0||e>this._layers[0].length||e>=this.capacity)throw new Error("Insert index out of bounds: "+e);if(e=this._layers[0].length)throw new Error("Index out of bounds: "+e);if(e>=1}return{pathElements:c,pathIndices:f,pathPositions:d,pathRoot:this.root}}indexOf(e,a){return d.BaseTree.indexOf(this._layers[0],e,this.edgeIndex,a)}proof(e){const a=this.indexOf(e);return this.path(a)}shiftEdge(e,a){if(this._edgeLeaf.index<=e.edgeIndex)throw new Error(`New edgeIndex should be smaller then ${this._edgeLeaf.index}`);if(a.length!==this._edgeLeaf.index-e.edgeIndex)throw new Error("Elements length should be "+(this._edgeLeaf.index-e.edgeIndex));this._edgeLeafProof=e.edgePath,this._edgeLeaf={index:e.edgeIndex,data:e.edgeElement},this._leavesAfterEdge=[...a,...this._leavesAfterEdge],this._createProofMap(),this._buildTree()}serialize(){return{_edgeLeafProof:this._edgeLeafProof,_edgeLeaf:this._edgeLeaf,_layers:this._layers,_zeros:this._zeros,levels:this.levels}}static deserialize(e,a){const t=Object.assign(Object.create(this.prototype),e);return t._hashFn=a||f.default,t._initialRoot=e._edgeLeafProof.pathRoot,t.zeroElement=t._zeros[0],t._leavesAfterEdge=t._layers[0].slice(e._edgeLeaf.index),t._createProofMap(),t}toString(){return JSON.stringify(this.serialize())}}a.PartialMerkleTree=r},41217:function(e,a,t){"use strict";var c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0}),a.MerkleTree=a.simpleHash=a.PartialMerkleTree=void 0;const f=c(t(9093));Object.defineProperty(a,"MerkleTree",{enumerable:!0,get:function(){return f.default}});var d=t(91230);Object.defineProperty(a,"PartialMerkleTree",{enumerable:!0,get:function(){return d.PartialMerkleTree}});var r=t(5319);Object.defineProperty(a,"simpleHash",{enumerable:!0,get:function(){return r.simpleHash}}),a.default=f.default},5319:(e,a)=>{"use strict";function t(e,a,t=40){const c=e.join("");let f,d,r=null!=a?a:34658180293;for(f=0,d=c.length;f>>0).toString(16);return BigInt("0x"+n.padEnd(t-(n.length-1),"0")).toString(10)}Object.defineProperty(a,"__esModule",{value:!0}),a.simpleHash=void 0,a.simpleHash=t,a.default=(e,a)=>t([e,a])},27351:(e,a,t)=>{var c=t(62045).hp;const f=t(92096);let d;if("undefined"!=typeof BigInt)d=BigInt,d.one=d(1),d.zero=d(0),d.genAffine=e=>{const a=-e;return t=>{let c=t;return c<0?(c<=a&&(c%=e),c=e&&(c%=e),c.valueOf()}},d.genInverse=e=>a=>{let t=d.zero,c=e,f=d.one,r=d.affine(a,e);for(;r!=d.zero;){let e=c/r;[t,f]=[f,t-e*f],[c,r]=[r,c-e*r]}return te?(a,t)=>(a+t)%e:(e,a)=>e+a,d.genSub=e=>e?(a,t)=>(a-t)%e:(e,a)=>e-a,d.genNeg=e=>e?a=>-a%e:e=>-e,d.genMul=e=>e?(a,t)=>a*t%e:(e,a)=>e*a,d.genShr=()=>(e,a)=>e>>d(a),d.genShl=e=>e?(a,t)=>(a<e<e?(a,t)=>a.affine(e)==t.affine(e):(e,a)=>e==a,d.genSquare=e=>e?a=>a*a%e:e=>e*e,d.genDouble=e=>e?a=>(a+a)%e:e=>e+e,d.genIsZero=e=>e?a=>a.affine(e)==d.zero:e=>e==d.zero,d.prototype.isOdd=function(){return(this&d.one)==d(1)},d.prototype.isNegative=function(){return thisd.zero?this:-this},d.prototype.modPow=function(e,a){let t=d.one,c=this,f=e;for(;f;)f&d.one&&(t=t*c%a),c=c*c%a,f>>=d.one;return t},d.prototype.greaterOrEquals=function(e){return this>=e},d.prototype.greater=function(e){return this>e},d.prototype.gt=d.prototype.greater,d.prototype.lesserOrEquals=function(e){return this<=e},d.prototype.lesser=function(e){return this{const a=d.zero.minus(e);return t=>{let c=t;return c.isNegative()?(c.lesserOrEquals(a)&&(c=c.mod(e)),c.isNegative()&&(c=c.add(e))):c.greaterOrEquals(e)&&(c=c.mod(e)),c}},d.genInverse=e=>a=>a.affine(e).modInv(e),d.genAdd=e=>e?(a,t)=>{const c=a.add(t);return c.greaterOrEquals(e)?c.minus(e):c}:(e,a)=>e.add(a),d.genSub=e=>e?(a,t)=>a.greaterOrEquals(t)?a.minus(t):a.minus(t).add(e):(e,a)=>e.minus(a),d.genNeg=e=>e?a=>a.isZero()?a:e.minus(a):e=>d.zero.minus(e),d.genMul=e=>e?(a,t)=>a.times(t).mod(e):(e,a)=>e.times(a),d.genShr=()=>(e,a)=>e.shiftRight(d(a).value),d.genShl=e=>e?(a,t)=>a.shiftLeft(d(t).value).mod(e):(e,a)=>e.shiftLeft(d(a).value),d.genSquare=e=>e?a=>a.square().mod(e):e=>e.square(),d.genDouble=e=>e?a=>a.add(a).mod(e):e=>e.add(e),d.genEquals=e=>e?(a,t)=>a.affine(e).equals(t.affine(e)):(e,a)=>e.equals(a),d.genIsZero=e=>e?a=>a.affine(e).isZero():e=>e.isZero()}d.affine=function(e,a){return d.genAffine(a)(e)},d.prototype.affine=function(e){return d.affine(this,e)},d.inverse=function(e,a){return d.genInverse(a)(e)},d.prototype.inverse=function(e){return d.genInverse(e)(this)},d.add=function(e,a,t){return d.genAdd(t)(e,a)},d.prototype.add=function(e,a){return d.genAdd(a)(this,e)},d.sub=function(e,a,t){return d.genSub(t)(e,a)},d.prototype.sub=function(e,a){return d.genSub(a)(this,e)},d.neg=function(e,a){return d.genNeg(a)(e)},d.prototype.neg=function(e){return d.genNeg(e)(this)},d.mul=function(e,a,t){return d.genMul(t)(e,a)},d.prototype.mul=function(e,a){return d.genMul(a)(this,e)},d.shr=function(e,a,t){return d.genShr(t)(e,a)},d.prototype.shr=function(e,a){return d.genShr(a)(this,e)},d.shl=function(e,a,t){return d.genShl(t)(e,a)},d.prototype.shl=function(e,a){return d.genShl(a)(this,e)},d.equals=function(e,a,t){return d.genEquals(t)(e,a)},d.prototype.equals=function(e,a){return d.genEquals(a)(this,e)},d.square=function(e,a){return d.genSquare(a)(e)},d.prototype.square=function(e){return d.genSquare(e)(this)},d.double=function(e,a){return d.genDouble(a)(e)},d.prototype.double=function(e){return d.genDouble(e)(this)},d.isZero=function(e,a){return d.genIsZero(a)(e)},d.prototype.isZero=function(e){return d.genIsZero(e)(this)},d.leBuff2int=function(e){let a=d.zero;for(let t=0;t=0;){let e=Number(t.and(d("255")));r[f]=e,f--,t=t.shr(8)}if(t.greater(d.zero))throw new Error("Number does not feed in buffer");return r},d.prototype.beInt2Buff=function(e){return d.beInt2Buff(this,e)},e.exports=d},28803:(e,a,t)=>{const c=t(27351);e.exports=function(e,a,t){(t=t||{}).logFunction||(t.logFunction=console.log);const d=new f(e,t);function r(e,a,t){if(!Array.isArray(e))return t(a,e);for(let c=0;c{0==this.notInitSignals[e]&&this.triggerComponent(e)})),this.witness[t]}setVar(e,a,t){const c=this.scopes[this.scopes.length-1];return 0==a.length?c[e]=t:(void 0===c[e]&&(c[e]=[]),function e(a,t,c){1==t.length?a[t[0]]=c:(void 0===a[t[0]]&&(a[t[0]]=[]),e(a[t[0]],t.slice(1),c))}(c[e],a,t)),t}getVar(e,a){function t(e,a){return 0==a.length?e:t(e[a[0]],a.slice(1))}for(let c=this.scopes.length-1;c>=0;c--)if(void 0!==this.scopes[c][e])return t(this.scopes[c][e],a);throw new Error("Variable not defined: "+e)}getSignal(e,a){let t="one"==e?"one":this.currentComponent+"."+e;return t+=this._sels2str(a),this.getSignalFullName(t)}getPin(e,a,t,c){let f="one"==e?"one":this.currentComponent+"."+e;return f+=this._sels2str(a)+"."+t+this._sels2str(c),this.getSignalFullName(f)}getSignalFullName(e){const a=this.circuit.getSignalIdx(e);if(void 0===this.witness[a])throw new Error("Signal not initialized: "+e);return this.options.logGet&&this.options.logFunction("get ---\x3e"+e+" = "+this.witness[a].toString()),this.witness[a]}assert(e,a,t){const f=c(e),d=c(a);if(!f.equals(d))throw new Error("Constraint doesn't match "+this.currentComponent+": "+t+" -> "+f.toString()+" != "+d.toString())}}},98665:(module,__unused_webpack_exports,__webpack_require__)=>{const bigInt=__webpack_require__(27351),__P__=bigInt("21888242871839275222246405745257275088548364400416034343698204186575808495617"),__MASK__=bigInt("28948022309329048855892746252171976963317496166410141009864396001978282409983"),calculateWitness=__webpack_require__(28803);module.exports=class Circuit{constructor(circuitDef){this.nPubInputs=circuitDef.nPubInputs,this.nPrvInputs=circuitDef.nPrvInputs,this.nInputs=circuitDef.nInputs,this.nOutputs=circuitDef.nOutputs,this.nVars=circuitDef.nVars,this.nSignals=circuitDef.nSignals,this.nConstants=circuitDef.nConstants,this.nConstraints=circuitDef.constraints.length,this.signalName2Idx=circuitDef.signalName2Idx,this.components=circuitDef.components,this.componentName2Idx=circuitDef.componentName2Idx,this.signals=circuitDef.signals,this.constraints=circuitDef.constraints,this.templates={};for(let t in circuitDef.templates)this.templates[t]=eval(" const __f= "+circuitDef.templates[t]+"\n__f");this.functions={};for(let f in circuitDef.functions)this.functions[f]={params:circuitDef.functions[f].params,func:eval(" const __f= "+circuitDef.functions[f].func+"\n__f;")}}calculateWitness(e,a){return calculateWitness(this,e,a)}checkWitness(e){const a=(e,a)=>{let t=bigInt(0);for(let c in e)t=t.add(bigInt(a[c]).mul(bigInt(e[c]))).mod(__P__);return t},t=(e,t)=>{const c=a(e[0],t),f=a(e[1],t),d=a(e[2],t);return!!c.mul(f).sub(d).affine(__P__).isZero()};for(let a=0;a{let a="";for(let t in e){let c=this.signals[t].names[0];"one"==c&&(c="");let f,d=bigInt(e[t]);d.lesserOrEquals(__P__.shr(bigInt(1)))?(f=""!=a?"+"+d.toString():"","1"!=f&&(f+=d.toString())):(d=__P__.sub(d),f="-"+d.toString()),a=a+" "+f+c}return a},t=`[ ${a(e[0])} ] * [ ${a(e[1])} ] - [ ${a(e[2])} ] = 0`;console.log(t)}printConstraints(){for(let e=0;e=this.nOutputs)throw new Error("Accessing an invalid output: "+e);return e+1}inputIdx(e){if(e>=this.nInputs)throw new Error("Accessing an invalid input: "+e);return this.nOutputs+1+e}pubInputIdx(e){if(e>=this.nPubInputs)throw new Error("Accessing an invalid pubInput: "+e);return this.inputIdx(e)}prvInputIdx(e){if(e>=this.nPrvInputs)throw new Error("Accessing an invalid prvInput: "+e);return this.inputIdx(this.nPubInputs+e)}varIdx(e){if(e>=this.nVars)throw new Error("Accessing an invalid variable: "+e);return e}constantIdx(e){if(e>=this.nConstants)throw new Error("Accessing an invalid constant: "+e);return this.nVars+e}signalIdx(e){if(e>=this.nSignls)throw new Error("Accessing an invalid signal: "+e);return e}signalNames(e){return this.signals[this.getSignalIdx(e)].names.join(", ")}a(e,a){return bigInt(this.constraints[e][0][a]||0)}b(e,a){return bigInt(this.constraints[e][1][a]||0)}c(e,a){return bigInt(this.constraints[e][2][a]||0)}}},73248:(e,a,t)=>{const c=t(27351);e.exports.e=function e(a){if("bigint"==typeof a||void 0!==a.isZero)return a.toString(10);if(Array.isArray(a))return a.map(e);if("object"==typeof a){const t={};for(let c in a)t[c]=e(a[c]);return t}return a},e.exports.H=function e(a){if("string"==typeof a&&/^[0-9]+$/.test(a))return c(a);if(Array.isArray(a))return a.map(e);if("object"==typeof a){const t={};for(let c in a)t[c]=e(a[c]);return t}return a}},71293:(e,a,t)=>{var c=t(62045).hp;a.code=new c("AGFzbQEAAAABPApgAn9/AGABfwBgAX8Bf2ACf38Bf2ADf39/AX9gA39/fwBgA39+fwBgAn9+AGAEf39/fwBgBX9/f39/AAIQAQNlbnYGbWVtb3J5AgDoBwNsawABAgEDAwQEBQUGBwgFBQUAAAUFAAAAAQUFAAAFBQAAAAEFAAIBAAAFAAUAAAAIAQIAAgUICQgABQkDAAUFBQUAAgUFCAAIAgEBAAUFBQAAAAMAAgEAAAUABQAAAAgBAgACBQgJCAAFCQgIB8gJYghpbnRfY29weQAACGludF96ZXJvAAEHaW50X29uZQADCmludF9pc1plcm8AAgZpbnRfZXEABAdpbnRfZ3RlAAUHaW50X2FkZAAGB2ludF9zdWIABwppbnRfbXVsT2xkAAkHaW50X211bAAIB2ludF9kaXYADA5pbnRfaW52ZXJzZU1vZAANB2YxbV9hZGQADgdmMW1fc3ViAA8HZjFtX25lZwAQC2YxbV9tUmVkdWN0ABEHZjFtX211bAASCmYxbV9tdWxPbGQAExJmMW1fZnJvbU1vbnRnb21lcnkAFRBmMW1fdG9Nb250Z29tZXJ5ABQLZjFtX2ludmVyc2UAFghmMW1fY29weQAACGYxbV96ZXJvAAEKZjFtX2lzWmVybwACBmYxbV9lcQAEB2YxbV9vbmUAFwdmcm1fYWRkABgHZnJtX3N1YgAZB2ZybV9uZWcAGgtmcm1fbVJlZHVjdAAbB2ZybV9tdWwAHApmcm1fbXVsT2xkAB0SZnJtX2Zyb21Nb250Z29tZXJ5AB8QZnJtX3RvTW9udGdvbWVyeQAeC2ZybV9pbnZlcnNlACAIZnJtX2NvcHkAAAhmcm1femVybwABCmZybV9pc1plcm8AAgZmcm1fZXEABAdmcm1fb25lACEGZnJfYWRkABgGZnJfc3ViABkGZnJfbmVnABoGZnJfbXVsACIKZnJfaW52ZXJzZQAjB2ZyX2NvcHkAAAdmcl96ZXJvAAEGZnJfb25lACEJZnJfaXNaZXJvAAIFZnJfZXEABAlnMV9pc1plcm8AJAdnMV9jb3B5ACYHZzFfemVybwAlCWcxX2RvdWJsZQAnBmcxX2FkZAAoBmcxX25lZwApBmcxX3N1YgAqEWcxX2Zyb21Nb250Z29tZXJ5ACsPZzFfdG9Nb250Z29tZXJ5ACwJZzFfYWZmaW5lAC0OZzFfdGltZXNTY2FsYXIALgtnMV9tdWx0aWV4cAA1DGcxX211bHRpZXhwMgA5B2ZmdF9mZnQAQghmZnRfaWZmdABDEWZmdF90b01vbnRnb21lcnlOAD8TZmZ0X2Zyb21Nb250Z29tZXJ5TgA+FGZmdF9jb3B5TkludGVybGVhdmVkAD0IZmZ0X211bE4ARAhwb2xfemVybwBFD3BvbF9jb25zdHJ1Y3RMQwBGCmYybV9pc1plcm8ARwhmMm1femVybwBIB2YybV9vbmUASQhmMm1fY29weQBKB2YybV9tdWwASwdmMm1fYWRkAEwHZjJtX3N1YgBNB2YybV9uZWcAThJmMm1fZnJvbU1vbnRnb21lcnkAUBBmMm1fdG9Nb250Z29tZXJ5AE8GZjJtX2VxAFELZjJtX2ludmVyc2UAUglnMl9pc1plcm8AUwdnMl9jb3B5AFUHZzJfemVybwBUCWcyX2RvdWJsZQBWBmcyX2FkZABXBmcyX25lZwBYBmcyX3N1YgBZEWcyX2Zyb21Nb250Z29tZXJ5AFoPZzJfdG9Nb250Z29tZXJ5AFsJZzJfYWZmaW5lAFwOZzJfdGltZXNTY2FsYXIAXQtnMl9tdWx0aWV4cABkDGcyX211bHRpZXhwMgBoDHRlc3RfZjFtX211bABpD3Rlc3RfZjFtX211bE9sZABqCsfEAWsqACABIAApAwA3AwAgASAAKQMINwMIIAEgACkDEDcDECABIAApAxg3AxgLHgAgAEIANwMAIABCADcDCCAAQgA3AxAgAEIANwMYCzMAIAApAxhQBEAgACkDEFAEQCAAKQMIUARAIAApAwBQDwVBAA8LBUEADwsFQQAPC0EADwseACAAQgE3AwAgAEIANwMIIABCADcDECAAQgA3AxgLRwAgACkDGCABKQMYUQRAIAApAxAgASkDEFEEQCAAKQMIIAEpAwhRBEAgACkDACABKQMAUQ8FQQAPCwVBAA8LBUEADwtBAA8LfQAgACkDGCABKQMYVARAQQAPBSAAKQMYIAEpAxhWBEBBAQ8FIAApAxAgASkDEFQEQEEADwUgACkDECABKQMQVgRAQQEPBSAAKQMIIAEpAwhUBEBBAA8FIAApAwggASkDCFYEQEEBDwUgACkDACABKQMAWg8LCwsLCwtBAA8L1AEBAX4gADUCACABNQIAfCEDIAIgAz4CACAANQIEIAE1AgR8IANCIIh8IQMgAiADPgIEIAA1AgggATUCCHwgA0IgiHwhAyACIAM+AgggADUCDCABNQIMfCADQiCIfCEDIAIgAz4CDCAANQIQIAE1AhB8IANCIIh8IQMgAiADPgIQIAA1AhQgATUCFHwgA0IgiHwhAyACIAM+AhQgADUCGCABNQIYfCADQiCIfCEDIAIgAz4CGCAANQIcIAE1Ahx8IANCIIh8IQMgAiADPgIcIANCIIinC4wCAQF+IAA1AgAgATUCAH0hAyACIANC/////w+DPgIAIAA1AgQgATUCBH0gA0Igh3whAyACIANC/////w+DPgIEIAA1AgggATUCCH0gA0Igh3whAyACIANC/////w+DPgIIIAA1AgwgATUCDH0gA0Igh3whAyACIANC/////w+DPgIMIAA1AhAgATUCEH0gA0Igh3whAyACIANC/////w+DPgIQIAA1AhQgATUCFH0gA0Igh3whAyACIANC/////w+DPgIUIAA1AhggATUCGH0gA0Igh3whAyACIANC/////w+DPgIYIAA1AhwgATUCHH0gA0Igh3whAyACIANC/////w+DPgIcIANCIIenC48QEgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfiADQv////8PgyAANQIAIgUgATUCACIGfnwhAyAEIANCIIh8IQQgAiADPgIAIARCIIghAyAEQv////8PgyAFIAE1AgQiCH58IQQgAyAEQiCIfCEDIARC/////w+DIAA1AgQiByAGfnwhBCADIARCIIh8IQMgAiAEPgIEIANCIIghBCADQv////8PgyAFIAE1AggiCn58IQMgBCADQiCIfCEEIANC/////w+DIAcgCH58IQMgBCADQiCIfCEEIANC/////w+DIAA1AggiCSAGfnwhAyAEIANCIIh8IQQgAiADPgIIIARCIIghAyAEQv////8PgyAFIAE1AgwiDH58IQQgAyAEQiCIfCEDIARC/////w+DIAcgCn58IQQgAyAEQiCIfCEDIARC/////w+DIAkgCH58IQQgAyAEQiCIfCEDIARC/////w+DIAA1AgwiCyAGfnwhBCADIARCIIh8IQMgAiAEPgIMIANCIIghBCADQv////8PgyAFIAE1AhAiDn58IQMgBCADQiCIfCEEIANC/////w+DIAcgDH58IQMgBCADQiCIfCEEIANC/////w+DIAkgCn58IQMgBCADQiCIfCEEIANC/////w+DIAsgCH58IQMgBCADQiCIfCEEIANC/////w+DIAA1AhAiDSAGfnwhAyAEIANCIIh8IQQgAiADPgIQIARCIIghAyAEQv////8PgyAFIAE1AhQiEH58IQQgAyAEQiCIfCEDIARC/////w+DIAcgDn58IQQgAyAEQiCIfCEDIARC/////w+DIAkgDH58IQQgAyAEQiCIfCEDIARC/////w+DIAsgCn58IQQgAyAEQiCIfCEDIARC/////w+DIA0gCH58IQQgAyAEQiCIfCEDIARC/////w+DIAA1AhQiDyAGfnwhBCADIARCIIh8IQMgAiAEPgIUIANCIIghBCADQv////8PgyAFIAE1AhgiEn58IQMgBCADQiCIfCEEIANC/////w+DIAcgEH58IQMgBCADQiCIfCEEIANC/////w+DIAkgDn58IQMgBCADQiCIfCEEIANC/////w+DIAsgDH58IQMgBCADQiCIfCEEIANC/////w+DIA0gCn58IQMgBCADQiCIfCEEIANC/////w+DIA8gCH58IQMgBCADQiCIfCEEIANC/////w+DIAA1AhgiESAGfnwhAyAEIANCIIh8IQQgAiADPgIYIARCIIghAyAEQv////8PgyAFIAE1AhwiFH58IQQgAyAEQiCIfCEDIARC/////w+DIAcgEn58IQQgAyAEQiCIfCEDIARC/////w+DIAkgEH58IQQgAyAEQiCIfCEDIARC/////w+DIAsgDn58IQQgAyAEQiCIfCEDIARC/////w+DIA0gDH58IQQgAyAEQiCIfCEDIARC/////w+DIA8gCn58IQQgAyAEQiCIfCEDIARC/////w+DIBEgCH58IQQgAyAEQiCIfCEDIARC/////w+DIAA1AhwiEyAGfnwhBCADIARCIIh8IQMgAiAEPgIcIANCIIghBCADQv////8PgyAHIBR+fCEDIAQgA0IgiHwhBCADQv////8PgyAJIBJ+fCEDIAQgA0IgiHwhBCADQv////8PgyALIBB+fCEDIAQgA0IgiHwhBCADQv////8PgyANIA5+fCEDIAQgA0IgiHwhBCADQv////8PgyAPIAx+fCEDIAQgA0IgiHwhBCADQv////8PgyARIAp+fCEDIAQgA0IgiHwhBCADQv////8PgyATIAh+fCEDIAQgA0IgiHwhBCACIAM+AiAgBEIgiCEDIARC/////w+DIAkgFH58IQQgAyAEQiCIfCEDIARC/////w+DIAsgEn58IQQgAyAEQiCIfCEDIARC/////w+DIA0gEH58IQQgAyAEQiCIfCEDIARC/////w+DIA8gDn58IQQgAyAEQiCIfCEDIARC/////w+DIBEgDH58IQQgAyAEQiCIfCEDIARC/////w+DIBMgCn58IQQgAyAEQiCIfCEDIAIgBD4CJCADQiCIIQQgA0L/////D4MgCyAUfnwhAyAEIANCIIh8IQQgA0L/////D4MgDSASfnwhAyAEIANCIIh8IQQgA0L/////D4MgDyAQfnwhAyAEIANCIIh8IQQgA0L/////D4MgESAOfnwhAyAEIANCIIh8IQQgA0L/////D4MgEyAMfnwhAyAEIANCIIh8IQQgAiADPgIoIARCIIghAyAEQv////8PgyANIBR+fCEEIAMgBEIgiHwhAyAEQv////8PgyAPIBJ+fCEEIAMgBEIgiHwhAyAEQv////8PgyARIBB+fCEEIAMgBEIgiHwhAyAEQv////8PgyATIA5+fCEEIAMgBEIgiHwhAyACIAQ+AiwgA0IgiCEEIANC/////w+DIA8gFH58IQMgBCADQiCIfCEEIANC/////w+DIBEgEn58IQMgBCADQiCIfCEEIANC/////w+DIBMgEH58IQMgBCADQiCIfCEEIAIgAz4CMCAEQiCIIQMgBEL/////D4MgESAUfnwhBCADIARCIIh8IQMgBEL/////D4MgEyASfnwhBCADIARCIIh8IQMgAiAEPgI0IANCIIghBCADQv////8PgyATIBR+fCEDIAQgA0IgiHwhBCACIAM+AjggBEIgiCEDIAIgBD4CPAv0EAEBfkEoIAA1AgAgATUCAH43AwBBKCAANQIAIAE1AgR+NwMIQSggADUCACABNQIIfjcDEEEoIAA1AgAgATUCDH43AxhBKCAANQIAIAE1AhB+NwMgQSggADUCACABNQIUfjcDKEEoIAA1AgAgATUCGH43AzBBKCAANQIAIAE1Ahx+NwM4QSggADUCBCABNQIAfjcDQEEoIAA1AgQgATUCBH43A0hBKCAANQIEIAE1Agh+NwNQQSggADUCBCABNQIMfjcDWEEoIAA1AgQgATUCEH43A2BBKCAANQIEIAE1AhR+NwNoQSggADUCBCABNQIYfjcDcEEoIAA1AgQgATUCHH43A3hBKCAANQIIIAE1AgB+NwOAAUEoIAA1AgggATUCBH43A4gBQSggADUCCCABNQIIfjcDkAFBKCAANQIIIAE1Agx+NwOYAUEoIAA1AgggATUCEH43A6ABQSggADUCCCABNQIUfjcDqAFBKCAANQIIIAE1Ahh+NwOwAUEoIAA1AgggATUCHH43A7gBQSggADUCDCABNQIAfjcDwAFBKCAANQIMIAE1AgR+NwPIAUEoIAA1AgwgATUCCH43A9ABQSggADUCDCABNQIMfjcD2AFBKCAANQIMIAE1AhB+NwPgAUEoIAA1AgwgATUCFH43A+gBQSggADUCDCABNQIYfjcD8AFBKCAANQIMIAE1Ahx+NwP4AUEoIAA1AhAgATUCAH43A4ACQSggADUCECABNQIEfjcDiAJBKCAANQIQIAE1Agh+NwOQAkEoIAA1AhAgATUCDH43A5gCQSggADUCECABNQIQfjcDoAJBKCAANQIQIAE1AhR+NwOoAkEoIAA1AhAgATUCGH43A7ACQSggADUCECABNQIcfjcDuAJBKCAANQIUIAE1AgB+NwPAAkEoIAA1AhQgATUCBH43A8gCQSggADUCFCABNQIIfjcD0AJBKCAANQIUIAE1Agx+NwPYAkEoIAA1AhQgATUCEH43A+ACQSggADUCFCABNQIUfjcD6AJBKCAANQIUIAE1Ahh+NwPwAkEoIAA1AhQgATUCHH43A/gCQSggADUCGCABNQIAfjcDgANBKCAANQIYIAE1AgR+NwOIA0EoIAA1AhggATUCCH43A5ADQSggADUCGCABNQIMfjcDmANBKCAANQIYIAE1AhB+NwOgA0EoIAA1AhggATUCFH43A6gDQSggADUCGCABNQIYfjcDsANBKCAANQIYIAE1Ahx+NwO4A0EoIAA1AhwgATUCAH43A8ADQSggADUCHCABNQIEfjcDyANBKCAANQIcIAE1Agh+NwPQA0EoIAA1AhwgATUCDH43A9gDQSggADUCHCABNQIQfjcD4ANBKCAANQIcIAE1AhR+NwPoA0EoIAA1AhwgATUCGH43A/ADQSggADUCHCABNQIcfjcD+AMgA0IgiEEoNQIAfCEDIAIgAz4CACADQiCIQSg1AgR8QSg1Agh8QSg1AkB8IQMgAiADPgIEIANCIIhBKDUCDHxBKDUCRHxBKDUCEHxBKDUCSHxBKDUCgAF8IQMgAiADPgIIIANCIIhBKDUCFHxBKDUCTHxBKDUChAF8QSg1Ahh8QSg1AlB8QSg1AogBfEEoNQLAAXwhAyACIAM+AgwgA0IgiEEoNQIcfEEoNQJUfEEoNQKMAXxBKDUCxAF8QSg1AiB8QSg1Alh8QSg1ApABfEEoNQLIAXxBKDUCgAJ8IQMgAiADPgIQIANCIIhBKDUCJHxBKDUCXHxBKDUClAF8QSg1AswBfEEoNQKEAnxBKDUCKHxBKDUCYHxBKDUCmAF8QSg1AtABfEEoNQKIAnxBKDUCwAJ8IQMgAiADPgIUIANCIIhBKDUCLHxBKDUCZHxBKDUCnAF8QSg1AtQBfEEoNQKMAnxBKDUCxAJ8QSg1AjB8QSg1Amh8QSg1AqABfEEoNQLYAXxBKDUCkAJ8QSg1AsgCfEEoNQKAA3whAyACIAM+AhggA0IgiEEoNQI0fEEoNQJsfEEoNQKkAXxBKDUC3AF8QSg1ApQCfEEoNQLMAnxBKDUChAN8QSg1Ajh8QSg1AnB8QSg1AqgBfEEoNQLgAXxBKDUCmAJ8QSg1AtACfEEoNQKIA3xBKDUCwAN8IQMgAiADPgIcIANCIIhBKDUCPHxBKDUCdHxBKDUCrAF8QSg1AuQBfEEoNQKcAnxBKDUC1AJ8QSg1AowDfEEoNQLEA3xBKDUCeHxBKDUCsAF8QSg1AugBfEEoNQKgAnxBKDUC2AJ8QSg1ApADfEEoNQLIA3whAyACIAM+AiAgA0IgiEEoNQJ8fEEoNQK0AXxBKDUC7AF8QSg1AqQCfEEoNQLcAnxBKDUClAN8QSg1AswDfEEoNQK4AXxBKDUC8AF8QSg1AqgCfEEoNQLgAnxBKDUCmAN8QSg1AtADfCEDIAIgAz4CJCADQiCIQSg1ArwBfEEoNQL0AXxBKDUCrAJ8QSg1AuQCfEEoNQKcA3xBKDUC1AN8QSg1AvgBfEEoNQKwAnxBKDUC6AJ8QSg1AqADfEEoNQLYA3whAyACIAM+AiggA0IgiEEoNQL8AXxBKDUCtAJ8QSg1AuwCfEEoNQKkA3xBKDUC3AN8QSg1ArgCfEEoNQLwAnxBKDUCqAN8QSg1AuADfCEDIAIgAz4CLCADQiCIQSg1ArwCfEEoNQL0AnxBKDUCrAN8QSg1AuQDfEEoNQL4AnxBKDUCsAN8QSg1AugDfCEDIAIgAz4CMCADQiCIQSg1AvwCfEEoNQK0A3xBKDUC7AN8QSg1ArgDfEEoNQLwA3whAyACIAM+AjQgA0IgiEEoNQK8A3xBKDUC9AN8QSg1AvgDfCEDIAIgAz4COCADQiCIQSg1AvwDfCEDIAIgAz4CPAu2AQEBfiAANQAAIAF+IQMgAiADPgAAIAA1AAQgAX4gA0IgiHwhAyACIAM+AAQgADUACCABfiADQiCIfCEDIAIgAz4ACCAANQAMIAF+IANCIIh8IQMgAiADPgAMIAA1ABAgAX4gA0IgiHwhAyACIAM+ABAgADUAFCABfiADQiCIfCEDIAIgAz4AFCAANQAYIAF+IANCIIh8IQMgAiADPgAYIAA1ABwgAX4gA0IgiHwhAyACIAM+ABwLTgIBfgF/IAAhAyADNQAAIAF8IQIgAyACPgAAIAJCIIghAgJAA0AgAlANASADQQRqIQMgAzUAACACfCECIAMgAj4AACACQiCIIQIMAAsLC7ACBwF/AX8BfwF/AX4BfgF/IAIEQCACIQUFQcgEIQULIAMEQCADIQQFQegEIQQLIAAgBBAAIAFBqAQQACAFEAFBiAUQAUEfIQZBHyEHAkADQEGoBCAHai0AACAHQQNGcg0BIAdBAWshBwwACwtBqAQgB2pBA2s1AABCAXwhCCAIQgFRBEBCAEIAgBoLAkADQAJAA0AgBCAGai0AACAGQQdGcg0BIAZBAWshBgwACwsgBCAGakEHaykAACEJIAkgCIAhCSAGIAdrQQRrIQoCQANAIAlCgICAgHCDUCAKQQBOcQ0BIAlCCIghCSAKQQFqIQoMAAsLIAlQBEAgBEGoBBAFRQ0CQgEhCUEAIQoLQagEIAlBqAUQCiAEQagFIAprIAQQBxogBSAKaiAJEAsMAAsLC7UCCwF/AX8BfwF/AX8BfwF/AX8BfwF/AX9ByAUhA0HIBRABQQAhC0HoBSEFIAFB6AUQAEGIBiEEQYgGEANBACEMQagGIQggAEGoBhAAQcgGIQZB6AYhB0HIByEKAkADQCAIEAINASAFIAggBiAHEAwgBiAEQYgHEAggCwRAIAwEQEGIByADEAUEQEGIByADIAoQBxpBACENBSADQYgHIAoQBxpBASENCwVBiAcgAyAKEAYaQQEhDQsFIAwEQEGIByADIAoQBhpBACENBSADQYgHEAUEQCADQYgHIAoQBxpBACENBUGIByADIAoQBxpBASENCwsLIAMhCSAEIQMgCiEEIAkhCiAMIQsgDSEMIAUhCSAIIQUgByEIIAkhBwwACwsgCwRAIAEgAyACEAcaBSADIAIQAAsLLAAgACABIAIQBgRAIAJB6AcgAhAHGgUgAkHoBxAFBEAgAkHoByACEAcaCwsLFwAgACABIAIQBwRAIAJB6AcgAhAGGgsLFAAgABACRQRAQegHIAAgARAHGgsLnBEDAX4BfgF+QonHmaQOIQJCACEDIAA1AgAgAn5C/////w+DIQQgADUCACADQiCIfEHoBzUCACAEfnwhAyAAIAM+AgAgADUCBCADQiCIfEHoBzUCBCAEfnwhAyAAIAM+AgQgADUCCCADQiCIfEHoBzUCCCAEfnwhAyAAIAM+AgggADUCDCADQiCIfEHoBzUCDCAEfnwhAyAAIAM+AgwgADUCECADQiCIfEHoBzUCECAEfnwhAyAAIAM+AhAgADUCFCADQiCIfEHoBzUCFCAEfnwhAyAAIAM+AhQgADUCGCADQiCIfEHoBzUCGCAEfnwhAyAAIAM+AhggADUCHCADQiCIfEHoBzUCHCAEfnwhAyAAIAM+AhxB6AggA0IgiD4CAEIAIQMgADUCBCACfkL/////D4MhBCAANQIEIANCIIh8QegHNQIAIAR+fCEDIAAgAz4CBCAANQIIIANCIIh8QegHNQIEIAR+fCEDIAAgAz4CCCAANQIMIANCIIh8QegHNQIIIAR+fCEDIAAgAz4CDCAANQIQIANCIIh8QegHNQIMIAR+fCEDIAAgAz4CECAANQIUIANCIIh8QegHNQIQIAR+fCEDIAAgAz4CFCAANQIYIANCIIh8QegHNQIUIAR+fCEDIAAgAz4CGCAANQIcIANCIIh8QegHNQIYIAR+fCEDIAAgAz4CHCAANQIgIANCIIh8QegHNQIcIAR+fCEDIAAgAz4CIEHoCCADQiCIPgIEQgAhAyAANQIIIAJ+Qv////8PgyEEIAA1AgggA0IgiHxB6Ac1AgAgBH58IQMgACADPgIIIAA1AgwgA0IgiHxB6Ac1AgQgBH58IQMgACADPgIMIAA1AhAgA0IgiHxB6Ac1AgggBH58IQMgACADPgIQIAA1AhQgA0IgiHxB6Ac1AgwgBH58IQMgACADPgIUIAA1AhggA0IgiHxB6Ac1AhAgBH58IQMgACADPgIYIAA1AhwgA0IgiHxB6Ac1AhQgBH58IQMgACADPgIcIAA1AiAgA0IgiHxB6Ac1AhggBH58IQMgACADPgIgIAA1AiQgA0IgiHxB6Ac1AhwgBH58IQMgACADPgIkQegIIANCIIg+AghCACEDIAA1AgwgAn5C/////w+DIQQgADUCDCADQiCIfEHoBzUCACAEfnwhAyAAIAM+AgwgADUCECADQiCIfEHoBzUCBCAEfnwhAyAAIAM+AhAgADUCFCADQiCIfEHoBzUCCCAEfnwhAyAAIAM+AhQgADUCGCADQiCIfEHoBzUCDCAEfnwhAyAAIAM+AhggADUCHCADQiCIfEHoBzUCECAEfnwhAyAAIAM+AhwgADUCICADQiCIfEHoBzUCFCAEfnwhAyAAIAM+AiAgADUCJCADQiCIfEHoBzUCGCAEfnwhAyAAIAM+AiQgADUCKCADQiCIfEHoBzUCHCAEfnwhAyAAIAM+AihB6AggA0IgiD4CDEIAIQMgADUCECACfkL/////D4MhBCAANQIQIANCIIh8QegHNQIAIAR+fCEDIAAgAz4CECAANQIUIANCIIh8QegHNQIEIAR+fCEDIAAgAz4CFCAANQIYIANCIIh8QegHNQIIIAR+fCEDIAAgAz4CGCAANQIcIANCIIh8QegHNQIMIAR+fCEDIAAgAz4CHCAANQIgIANCIIh8QegHNQIQIAR+fCEDIAAgAz4CICAANQIkIANCIIh8QegHNQIUIAR+fCEDIAAgAz4CJCAANQIoIANCIIh8QegHNQIYIAR+fCEDIAAgAz4CKCAANQIsIANCIIh8QegHNQIcIAR+fCEDIAAgAz4CLEHoCCADQiCIPgIQQgAhAyAANQIUIAJ+Qv////8PgyEEIAA1AhQgA0IgiHxB6Ac1AgAgBH58IQMgACADPgIUIAA1AhggA0IgiHxB6Ac1AgQgBH58IQMgACADPgIYIAA1AhwgA0IgiHxB6Ac1AgggBH58IQMgACADPgIcIAA1AiAgA0IgiHxB6Ac1AgwgBH58IQMgACADPgIgIAA1AiQgA0IgiHxB6Ac1AhAgBH58IQMgACADPgIkIAA1AiggA0IgiHxB6Ac1AhQgBH58IQMgACADPgIoIAA1AiwgA0IgiHxB6Ac1AhggBH58IQMgACADPgIsIAA1AjAgA0IgiHxB6Ac1AhwgBH58IQMgACADPgIwQegIIANCIIg+AhRCACEDIAA1AhggAn5C/////w+DIQQgADUCGCADQiCIfEHoBzUCACAEfnwhAyAAIAM+AhggADUCHCADQiCIfEHoBzUCBCAEfnwhAyAAIAM+AhwgADUCICADQiCIfEHoBzUCCCAEfnwhAyAAIAM+AiAgADUCJCADQiCIfEHoBzUCDCAEfnwhAyAAIAM+AiQgADUCKCADQiCIfEHoBzUCECAEfnwhAyAAIAM+AiggADUCLCADQiCIfEHoBzUCFCAEfnwhAyAAIAM+AiwgADUCMCADQiCIfEHoBzUCGCAEfnwhAyAAIAM+AjAgADUCNCADQiCIfEHoBzUCHCAEfnwhAyAAIAM+AjRB6AggA0IgiD4CGEIAIQMgADUCHCACfkL/////D4MhBCAANQIcIANCIIh8QegHNQIAIAR+fCEDIAAgAz4CHCAANQIgIANCIIh8QegHNQIEIAR+fCEDIAAgAz4CICAANQIkIANCIIh8QegHNQIIIAR+fCEDIAAgAz4CJCAANQIoIANCIIh8QegHNQIMIAR+fCEDIAAgAz4CKCAANQIsIANCIIh8QegHNQIQIAR+fCEDIAAgAz4CLCAANQIwIANCIIh8QegHNQIUIAR+fCEDIAAgAz4CMCAANQI0IANCIIh8QegHNQIYIAR+fCEDIAAgAz4CNCAANQI4IANCIIh8QegHNQIcIAR+fCEDIAAgAz4COEHoCCADQiCIPgIcQegIIABBIGogARAOC74fIwF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX5CiceZpA4hBSADQv////8PgyAANQIAIgYgATUCACIHfnwhAyAEIANCIIh8IQQgA0L/////D4MgBX5C/////w+DIQggA0L/////D4NBADUC6AciCSAIfnwhAyAEIANCIIh8IQQgBEIgiCEDIARC/////w+DIAYgATUCBCILfnwhBCADIARCIIh8IQMgBEL/////D4MgADUCBCIKIAd+fCEEIAMgBEIgiHwhAyAEQv////8Pg0EANQLsByINIAh+fCEEIAMgBEIgiHwhAyAEQv////8PgyAFfkL/////D4MhDCAEQv////8PgyAJIAx+fCEEIAMgBEIgiHwhAyADQiCIIQQgA0L/////D4MgBiABNQIIIg9+fCEDIAQgA0IgiHwhBCADQv////8PgyAKIAt+fCEDIAQgA0IgiHwhBCADQv////8PgyAANQIIIg4gB358IQMgBCADQiCIfCEEIANC/////w+DIA0gDH58IQMgBCADQiCIfCEEIANC/////w+DQQA1AvAHIhEgCH58IQMgBCADQiCIfCEEIANC/////w+DIAV+Qv////8PgyEQIANC/////w+DIAkgEH58IQMgBCADQiCIfCEEIARCIIghAyAEQv////8PgyAGIAE1AgwiE358IQQgAyAEQiCIfCEDIARC/////w+DIAogD358IQQgAyAEQiCIfCEDIARC/////w+DIA4gC358IQQgAyAEQiCIfCEDIARC/////w+DIAA1AgwiEiAHfnwhBCADIARCIIh8IQMgBEL/////D4MgDSAQfnwhBCADIARCIIh8IQMgBEL/////D4MgESAMfnwhBCADIARCIIh8IQMgBEL/////D4NBADUC9AciFSAIfnwhBCADIARCIIh8IQMgBEL/////D4MgBX5C/////w+DIRQgBEL/////D4MgCSAUfnwhBCADIARCIIh8IQMgA0IgiCEEIANC/////w+DIAYgATUCECIXfnwhAyAEIANCIIh8IQQgA0L/////D4MgCiATfnwhAyAEIANCIIh8IQQgA0L/////D4MgDiAPfnwhAyAEIANCIIh8IQQgA0L/////D4MgEiALfnwhAyAEIANCIIh8IQQgA0L/////D4MgADUCECIWIAd+fCEDIAQgA0IgiHwhBCADQv////8PgyANIBR+fCEDIAQgA0IgiHwhBCADQv////8PgyARIBB+fCEDIAQgA0IgiHwhBCADQv////8PgyAVIAx+fCEDIAQgA0IgiHwhBCADQv////8Pg0EANQL4ByIZIAh+fCEDIAQgA0IgiHwhBCADQv////8PgyAFfkL/////D4MhGCADQv////8PgyAJIBh+fCEDIAQgA0IgiHwhBCAEQiCIIQMgBEL/////D4MgBiABNQIUIht+fCEEIAMgBEIgiHwhAyAEQv////8PgyAKIBd+fCEEIAMgBEIgiHwhAyAEQv////8PgyAOIBN+fCEEIAMgBEIgiHwhAyAEQv////8PgyASIA9+fCEEIAMgBEIgiHwhAyAEQv////8PgyAWIAt+fCEEIAMgBEIgiHwhAyAEQv////8PgyAANQIUIhogB358IQQgAyAEQiCIfCEDIARC/////w+DIA0gGH58IQQgAyAEQiCIfCEDIARC/////w+DIBEgFH58IQQgAyAEQiCIfCEDIARC/////w+DIBUgEH58IQQgAyAEQiCIfCEDIARC/////w+DIBkgDH58IQQgAyAEQiCIfCEDIARC/////w+DQQA1AvwHIh0gCH58IQQgAyAEQiCIfCEDIARC/////w+DIAV+Qv////8PgyEcIARC/////w+DIAkgHH58IQQgAyAEQiCIfCEDIANCIIghBCADQv////8PgyAGIAE1AhgiH358IQMgBCADQiCIfCEEIANC/////w+DIAogG358IQMgBCADQiCIfCEEIANC/////w+DIA4gF358IQMgBCADQiCIfCEEIANC/////w+DIBIgE358IQMgBCADQiCIfCEEIANC/////w+DIBYgD358IQMgBCADQiCIfCEEIANC/////w+DIBogC358IQMgBCADQiCIfCEEIANC/////w+DIAA1AhgiHiAHfnwhAyAEIANCIIh8IQQgA0L/////D4MgDSAcfnwhAyAEIANCIIh8IQQgA0L/////D4MgESAYfnwhAyAEIANCIIh8IQQgA0L/////D4MgFSAUfnwhAyAEIANCIIh8IQQgA0L/////D4MgGSAQfnwhAyAEIANCIIh8IQQgA0L/////D4MgHSAMfnwhAyAEIANCIIh8IQQgA0L/////D4NBADUCgAgiISAIfnwhAyAEIANCIIh8IQQgA0L/////D4MgBX5C/////w+DISAgA0L/////D4MgCSAgfnwhAyAEIANCIIh8IQQgBEIgiCEDIARC/////w+DIAYgATUCHCIjfnwhBCADIARCIIh8IQMgBEL/////D4MgCiAffnwhBCADIARCIIh8IQMgBEL/////D4MgDiAbfnwhBCADIARCIIh8IQMgBEL/////D4MgEiAXfnwhBCADIARCIIh8IQMgBEL/////D4MgFiATfnwhBCADIARCIIh8IQMgBEL/////D4MgGiAPfnwhBCADIARCIIh8IQMgBEL/////D4MgHiALfnwhBCADIARCIIh8IQMgBEL/////D4MgADUCHCIiIAd+fCEEIAMgBEIgiHwhAyAEQv////8PgyANICB+fCEEIAMgBEIgiHwhAyAEQv////8PgyARIBx+fCEEIAMgBEIgiHwhAyAEQv////8PgyAVIBh+fCEEIAMgBEIgiHwhAyAEQv////8PgyAZIBR+fCEEIAMgBEIgiHwhAyAEQv////8PgyAdIBB+fCEEIAMgBEIgiHwhAyAEQv////8PgyAhIAx+fCEEIAMgBEIgiHwhAyAEQv////8Pg0EANQKECCIlIAh+fCEEIAMgBEIgiHwhAyAEQv////8PgyAFfkL/////D4MhJCAEQv////8PgyAJICR+fCEEIAMgBEIgiHwhAyADQiCIIQQgA0L/////D4MgCiAjfnwhAyAEIANCIIh8IQQgA0L/////D4MgDiAffnwhAyAEIANCIIh8IQQgA0L/////D4MgEiAbfnwhAyAEIANCIIh8IQQgA0L/////D4MgFiAXfnwhAyAEIANCIIh8IQQgA0L/////D4MgGiATfnwhAyAEIANCIIh8IQQgA0L/////D4MgHiAPfnwhAyAEIANCIIh8IQQgA0L/////D4MgIiALfnwhAyAEIANCIIh8IQQgA0L/////D4MgDSAkfnwhAyAEIANCIIh8IQQgA0L/////D4MgESAgfnwhAyAEIANCIIh8IQQgA0L/////D4MgFSAcfnwhAyAEIANCIIh8IQQgA0L/////D4MgGSAYfnwhAyAEIANCIIh8IQQgA0L/////D4MgHSAUfnwhAyAEIANCIIh8IQQgA0L/////D4MgISAQfnwhAyAEIANCIIh8IQQgA0L/////D4MgJSAMfnwhAyAEIANCIIh8IQQgAiADPgIAIARCIIghAyAEQv////8PgyAOICN+fCEEIAMgBEIgiHwhAyAEQv////8PgyASIB9+fCEEIAMgBEIgiHwhAyAEQv////8PgyAWIBt+fCEEIAMgBEIgiHwhAyAEQv////8PgyAaIBd+fCEEIAMgBEIgiHwhAyAEQv////8PgyAeIBN+fCEEIAMgBEIgiHwhAyAEQv////8PgyAiIA9+fCEEIAMgBEIgiHwhAyAEQv////8PgyARICR+fCEEIAMgBEIgiHwhAyAEQv////8PgyAVICB+fCEEIAMgBEIgiHwhAyAEQv////8PgyAZIBx+fCEEIAMgBEIgiHwhAyAEQv////8PgyAdIBh+fCEEIAMgBEIgiHwhAyAEQv////8PgyAhIBR+fCEEIAMgBEIgiHwhAyAEQv////8PgyAlIBB+fCEEIAMgBEIgiHwhAyACIAQ+AgQgA0IgiCEEIANC/////w+DIBIgI358IQMgBCADQiCIfCEEIANC/////w+DIBYgH358IQMgBCADQiCIfCEEIANC/////w+DIBogG358IQMgBCADQiCIfCEEIANC/////w+DIB4gF358IQMgBCADQiCIfCEEIANC/////w+DICIgE358IQMgBCADQiCIfCEEIANC/////w+DIBUgJH58IQMgBCADQiCIfCEEIANC/////w+DIBkgIH58IQMgBCADQiCIfCEEIANC/////w+DIB0gHH58IQMgBCADQiCIfCEEIANC/////w+DICEgGH58IQMgBCADQiCIfCEEIANC/////w+DICUgFH58IQMgBCADQiCIfCEEIAIgAz4CCCAEQiCIIQMgBEL/////D4MgFiAjfnwhBCADIARCIIh8IQMgBEL/////D4MgGiAffnwhBCADIARCIIh8IQMgBEL/////D4MgHiAbfnwhBCADIARCIIh8IQMgBEL/////D4MgIiAXfnwhBCADIARCIIh8IQMgBEL/////D4MgGSAkfnwhBCADIARCIIh8IQMgBEL/////D4MgHSAgfnwhBCADIARCIIh8IQMgBEL/////D4MgISAcfnwhBCADIARCIIh8IQMgBEL/////D4MgJSAYfnwhBCADIARCIIh8IQMgAiAEPgIMIANCIIghBCADQv////8PgyAaICN+fCEDIAQgA0IgiHwhBCADQv////8PgyAeIB9+fCEDIAQgA0IgiHwhBCADQv////8PgyAiIBt+fCEDIAQgA0IgiHwhBCADQv////8PgyAdICR+fCEDIAQgA0IgiHwhBCADQv////8PgyAhICB+fCEDIAQgA0IgiHwhBCADQv////8PgyAlIBx+fCEDIAQgA0IgiHwhBCACIAM+AhAgBEIgiCEDIARC/////w+DIB4gI358IQQgAyAEQiCIfCEDIARC/////w+DICIgH358IQQgAyAEQiCIfCEDIARC/////w+DICEgJH58IQQgAyAEQiCIfCEDIARC/////w+DICUgIH58IQQgAyAEQiCIfCEDIAIgBD4CFCADQiCIIQQgA0L/////D4MgIiAjfnwhAyAEIANCIIh8IQQgA0L/////D4MgJSAkfnwhAyAEIANCIIh8IQQgAiADPgIYIARCIIghAyACIAQ+AhwgA6cEQCACQegHIAIQBxoFIAJB6AcQBQRAIAJB6AcgAhAHGgsLCxIAIAAgAUHoDBAJQegMIAIQEQsLACAAQYgIIAEQEgsVACAAQagNEABByA0QAUGoDSABEBELFwAgACABEBUgAUHoByABEA0gASABEBQLCQBBqAggABAACywAIAAgASACEAYEQCACQegNIAIQBxoFIAJB6A0QBQRAIAJB6A0gAhAHGgsLCxcAIAAgASACEAcEQCACQegNIAIQBhoLCxQAIAAQAkUEQEHoDSAAIAEQBxoLC5wRAwF+AX4BfkL/////DiECQgAhAyAANQIAIAJ+Qv////8PgyEEIAA1AgAgA0IgiHxB6A01AgAgBH58IQMgACADPgIAIAA1AgQgA0IgiHxB6A01AgQgBH58IQMgACADPgIEIAA1AgggA0IgiHxB6A01AgggBH58IQMgACADPgIIIAA1AgwgA0IgiHxB6A01AgwgBH58IQMgACADPgIMIAA1AhAgA0IgiHxB6A01AhAgBH58IQMgACADPgIQIAA1AhQgA0IgiHxB6A01AhQgBH58IQMgACADPgIUIAA1AhggA0IgiHxB6A01AhggBH58IQMgACADPgIYIAA1AhwgA0IgiHxB6A01AhwgBH58IQMgACADPgIcQegOIANCIIg+AgBCACEDIAA1AgQgAn5C/////w+DIQQgADUCBCADQiCIfEHoDTUCACAEfnwhAyAAIAM+AgQgADUCCCADQiCIfEHoDTUCBCAEfnwhAyAAIAM+AgggADUCDCADQiCIfEHoDTUCCCAEfnwhAyAAIAM+AgwgADUCECADQiCIfEHoDTUCDCAEfnwhAyAAIAM+AhAgADUCFCADQiCIfEHoDTUCECAEfnwhAyAAIAM+AhQgADUCGCADQiCIfEHoDTUCFCAEfnwhAyAAIAM+AhggADUCHCADQiCIfEHoDTUCGCAEfnwhAyAAIAM+AhwgADUCICADQiCIfEHoDTUCHCAEfnwhAyAAIAM+AiBB6A4gA0IgiD4CBEIAIQMgADUCCCACfkL/////D4MhBCAANQIIIANCIIh8QegNNQIAIAR+fCEDIAAgAz4CCCAANQIMIANCIIh8QegNNQIEIAR+fCEDIAAgAz4CDCAANQIQIANCIIh8QegNNQIIIAR+fCEDIAAgAz4CECAANQIUIANCIIh8QegNNQIMIAR+fCEDIAAgAz4CFCAANQIYIANCIIh8QegNNQIQIAR+fCEDIAAgAz4CGCAANQIcIANCIIh8QegNNQIUIAR+fCEDIAAgAz4CHCAANQIgIANCIIh8QegNNQIYIAR+fCEDIAAgAz4CICAANQIkIANCIIh8QegNNQIcIAR+fCEDIAAgAz4CJEHoDiADQiCIPgIIQgAhAyAANQIMIAJ+Qv////8PgyEEIAA1AgwgA0IgiHxB6A01AgAgBH58IQMgACADPgIMIAA1AhAgA0IgiHxB6A01AgQgBH58IQMgACADPgIQIAA1AhQgA0IgiHxB6A01AgggBH58IQMgACADPgIUIAA1AhggA0IgiHxB6A01AgwgBH58IQMgACADPgIYIAA1AhwgA0IgiHxB6A01AhAgBH58IQMgACADPgIcIAA1AiAgA0IgiHxB6A01AhQgBH58IQMgACADPgIgIAA1AiQgA0IgiHxB6A01AhggBH58IQMgACADPgIkIAA1AiggA0IgiHxB6A01AhwgBH58IQMgACADPgIoQegOIANCIIg+AgxCACEDIAA1AhAgAn5C/////w+DIQQgADUCECADQiCIfEHoDTUCACAEfnwhAyAAIAM+AhAgADUCFCADQiCIfEHoDTUCBCAEfnwhAyAAIAM+AhQgADUCGCADQiCIfEHoDTUCCCAEfnwhAyAAIAM+AhggADUCHCADQiCIfEHoDTUCDCAEfnwhAyAAIAM+AhwgADUCICADQiCIfEHoDTUCECAEfnwhAyAAIAM+AiAgADUCJCADQiCIfEHoDTUCFCAEfnwhAyAAIAM+AiQgADUCKCADQiCIfEHoDTUCGCAEfnwhAyAAIAM+AiggADUCLCADQiCIfEHoDTUCHCAEfnwhAyAAIAM+AixB6A4gA0IgiD4CEEIAIQMgADUCFCACfkL/////D4MhBCAANQIUIANCIIh8QegNNQIAIAR+fCEDIAAgAz4CFCAANQIYIANCIIh8QegNNQIEIAR+fCEDIAAgAz4CGCAANQIcIANCIIh8QegNNQIIIAR+fCEDIAAgAz4CHCAANQIgIANCIIh8QegNNQIMIAR+fCEDIAAgAz4CICAANQIkIANCIIh8QegNNQIQIAR+fCEDIAAgAz4CJCAANQIoIANCIIh8QegNNQIUIAR+fCEDIAAgAz4CKCAANQIsIANCIIh8QegNNQIYIAR+fCEDIAAgAz4CLCAANQIwIANCIIh8QegNNQIcIAR+fCEDIAAgAz4CMEHoDiADQiCIPgIUQgAhAyAANQIYIAJ+Qv////8PgyEEIAA1AhggA0IgiHxB6A01AgAgBH58IQMgACADPgIYIAA1AhwgA0IgiHxB6A01AgQgBH58IQMgACADPgIcIAA1AiAgA0IgiHxB6A01AgggBH58IQMgACADPgIgIAA1AiQgA0IgiHxB6A01AgwgBH58IQMgACADPgIkIAA1AiggA0IgiHxB6A01AhAgBH58IQMgACADPgIoIAA1AiwgA0IgiHxB6A01AhQgBH58IQMgACADPgIsIAA1AjAgA0IgiHxB6A01AhggBH58IQMgACADPgIwIAA1AjQgA0IgiHxB6A01AhwgBH58IQMgACADPgI0QegOIANCIIg+AhhCACEDIAA1AhwgAn5C/////w+DIQQgADUCHCADQiCIfEHoDTUCACAEfnwhAyAAIAM+AhwgADUCICADQiCIfEHoDTUCBCAEfnwhAyAAIAM+AiAgADUCJCADQiCIfEHoDTUCCCAEfnwhAyAAIAM+AiQgADUCKCADQiCIfEHoDTUCDCAEfnwhAyAAIAM+AiggADUCLCADQiCIfEHoDTUCECAEfnwhAyAAIAM+AiwgADUCMCADQiCIfEHoDTUCFCAEfnwhAyAAIAM+AjAgADUCNCADQiCIfEHoDTUCGCAEfnwhAyAAIAM+AjQgADUCOCADQiCIfEHoDTUCHCAEfnwhAyAAIAM+AjhB6A4gA0IgiD4CHEHoDiAAQSBqIAEQGAu+HyMBfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+Qv////8OIQUgA0L/////D4MgADUCACIGIAE1AgAiB358IQMgBCADQiCIfCEEIANC/////w+DIAV+Qv////8PgyEIIANC/////w+DQQA1AugNIgkgCH58IQMgBCADQiCIfCEEIARCIIghAyAEQv////8PgyAGIAE1AgQiC358IQQgAyAEQiCIfCEDIARC/////w+DIAA1AgQiCiAHfnwhBCADIARCIIh8IQMgBEL/////D4NBADUC7A0iDSAIfnwhBCADIARCIIh8IQMgBEL/////D4MgBX5C/////w+DIQwgBEL/////D4MgCSAMfnwhBCADIARCIIh8IQMgA0IgiCEEIANC/////w+DIAYgATUCCCIPfnwhAyAEIANCIIh8IQQgA0L/////D4MgCiALfnwhAyAEIANCIIh8IQQgA0L/////D4MgADUCCCIOIAd+fCEDIAQgA0IgiHwhBCADQv////8PgyANIAx+fCEDIAQgA0IgiHwhBCADQv////8Pg0EANQLwDSIRIAh+fCEDIAQgA0IgiHwhBCADQv////8PgyAFfkL/////D4MhECADQv////8PgyAJIBB+fCEDIAQgA0IgiHwhBCAEQiCIIQMgBEL/////D4MgBiABNQIMIhN+fCEEIAMgBEIgiHwhAyAEQv////8PgyAKIA9+fCEEIAMgBEIgiHwhAyAEQv////8PgyAOIAt+fCEEIAMgBEIgiHwhAyAEQv////8PgyAANQIMIhIgB358IQQgAyAEQiCIfCEDIARC/////w+DIA0gEH58IQQgAyAEQiCIfCEDIARC/////w+DIBEgDH58IQQgAyAEQiCIfCEDIARC/////w+DQQA1AvQNIhUgCH58IQQgAyAEQiCIfCEDIARC/////w+DIAV+Qv////8PgyEUIARC/////w+DIAkgFH58IQQgAyAEQiCIfCEDIANCIIghBCADQv////8PgyAGIAE1AhAiF358IQMgBCADQiCIfCEEIANC/////w+DIAogE358IQMgBCADQiCIfCEEIANC/////w+DIA4gD358IQMgBCADQiCIfCEEIANC/////w+DIBIgC358IQMgBCADQiCIfCEEIANC/////w+DIAA1AhAiFiAHfnwhAyAEIANCIIh8IQQgA0L/////D4MgDSAUfnwhAyAEIANCIIh8IQQgA0L/////D4MgESAQfnwhAyAEIANCIIh8IQQgA0L/////D4MgFSAMfnwhAyAEIANCIIh8IQQgA0L/////D4NBADUC+A0iGSAIfnwhAyAEIANCIIh8IQQgA0L/////D4MgBX5C/////w+DIRggA0L/////D4MgCSAYfnwhAyAEIANCIIh8IQQgBEIgiCEDIARC/////w+DIAYgATUCFCIbfnwhBCADIARCIIh8IQMgBEL/////D4MgCiAXfnwhBCADIARCIIh8IQMgBEL/////D4MgDiATfnwhBCADIARCIIh8IQMgBEL/////D4MgEiAPfnwhBCADIARCIIh8IQMgBEL/////D4MgFiALfnwhBCADIARCIIh8IQMgBEL/////D4MgADUCFCIaIAd+fCEEIAMgBEIgiHwhAyAEQv////8PgyANIBh+fCEEIAMgBEIgiHwhAyAEQv////8PgyARIBR+fCEEIAMgBEIgiHwhAyAEQv////8PgyAVIBB+fCEEIAMgBEIgiHwhAyAEQv////8PgyAZIAx+fCEEIAMgBEIgiHwhAyAEQv////8Pg0EANQL8DSIdIAh+fCEEIAMgBEIgiHwhAyAEQv////8PgyAFfkL/////D4MhHCAEQv////8PgyAJIBx+fCEEIAMgBEIgiHwhAyADQiCIIQQgA0L/////D4MgBiABNQIYIh9+fCEDIAQgA0IgiHwhBCADQv////8PgyAKIBt+fCEDIAQgA0IgiHwhBCADQv////8PgyAOIBd+fCEDIAQgA0IgiHwhBCADQv////8PgyASIBN+fCEDIAQgA0IgiHwhBCADQv////8PgyAWIA9+fCEDIAQgA0IgiHwhBCADQv////8PgyAaIAt+fCEDIAQgA0IgiHwhBCADQv////8PgyAANQIYIh4gB358IQMgBCADQiCIfCEEIANC/////w+DIA0gHH58IQMgBCADQiCIfCEEIANC/////w+DIBEgGH58IQMgBCADQiCIfCEEIANC/////w+DIBUgFH58IQMgBCADQiCIfCEEIANC/////w+DIBkgEH58IQMgBCADQiCIfCEEIANC/////w+DIB0gDH58IQMgBCADQiCIfCEEIANC/////w+DQQA1AoAOIiEgCH58IQMgBCADQiCIfCEEIANC/////w+DIAV+Qv////8PgyEgIANC/////w+DIAkgIH58IQMgBCADQiCIfCEEIARCIIghAyAEQv////8PgyAGIAE1AhwiI358IQQgAyAEQiCIfCEDIARC/////w+DIAogH358IQQgAyAEQiCIfCEDIARC/////w+DIA4gG358IQQgAyAEQiCIfCEDIARC/////w+DIBIgF358IQQgAyAEQiCIfCEDIARC/////w+DIBYgE358IQQgAyAEQiCIfCEDIARC/////w+DIBogD358IQQgAyAEQiCIfCEDIARC/////w+DIB4gC358IQQgAyAEQiCIfCEDIARC/////w+DIAA1AhwiIiAHfnwhBCADIARCIIh8IQMgBEL/////D4MgDSAgfnwhBCADIARCIIh8IQMgBEL/////D4MgESAcfnwhBCADIARCIIh8IQMgBEL/////D4MgFSAYfnwhBCADIARCIIh8IQMgBEL/////D4MgGSAUfnwhBCADIARCIIh8IQMgBEL/////D4MgHSAQfnwhBCADIARCIIh8IQMgBEL/////D4MgISAMfnwhBCADIARCIIh8IQMgBEL/////D4NBADUChA4iJSAIfnwhBCADIARCIIh8IQMgBEL/////D4MgBX5C/////w+DISQgBEL/////D4MgCSAkfnwhBCADIARCIIh8IQMgA0IgiCEEIANC/////w+DIAogI358IQMgBCADQiCIfCEEIANC/////w+DIA4gH358IQMgBCADQiCIfCEEIANC/////w+DIBIgG358IQMgBCADQiCIfCEEIANC/////w+DIBYgF358IQMgBCADQiCIfCEEIANC/////w+DIBogE358IQMgBCADQiCIfCEEIANC/////w+DIB4gD358IQMgBCADQiCIfCEEIANC/////w+DICIgC358IQMgBCADQiCIfCEEIANC/////w+DIA0gJH58IQMgBCADQiCIfCEEIANC/////w+DIBEgIH58IQMgBCADQiCIfCEEIANC/////w+DIBUgHH58IQMgBCADQiCIfCEEIANC/////w+DIBkgGH58IQMgBCADQiCIfCEEIANC/////w+DIB0gFH58IQMgBCADQiCIfCEEIANC/////w+DICEgEH58IQMgBCADQiCIfCEEIANC/////w+DICUgDH58IQMgBCADQiCIfCEEIAIgAz4CACAEQiCIIQMgBEL/////D4MgDiAjfnwhBCADIARCIIh8IQMgBEL/////D4MgEiAffnwhBCADIARCIIh8IQMgBEL/////D4MgFiAbfnwhBCADIARCIIh8IQMgBEL/////D4MgGiAXfnwhBCADIARCIIh8IQMgBEL/////D4MgHiATfnwhBCADIARCIIh8IQMgBEL/////D4MgIiAPfnwhBCADIARCIIh8IQMgBEL/////D4MgESAkfnwhBCADIARCIIh8IQMgBEL/////D4MgFSAgfnwhBCADIARCIIh8IQMgBEL/////D4MgGSAcfnwhBCADIARCIIh8IQMgBEL/////D4MgHSAYfnwhBCADIARCIIh8IQMgBEL/////D4MgISAUfnwhBCADIARCIIh8IQMgBEL/////D4MgJSAQfnwhBCADIARCIIh8IQMgAiAEPgIEIANCIIghBCADQv////8PgyASICN+fCEDIAQgA0IgiHwhBCADQv////8PgyAWIB9+fCEDIAQgA0IgiHwhBCADQv////8PgyAaIBt+fCEDIAQgA0IgiHwhBCADQv////8PgyAeIBd+fCEDIAQgA0IgiHwhBCADQv////8PgyAiIBN+fCEDIAQgA0IgiHwhBCADQv////8PgyAVICR+fCEDIAQgA0IgiHwhBCADQv////8PgyAZICB+fCEDIAQgA0IgiHwhBCADQv////8PgyAdIBx+fCEDIAQgA0IgiHwhBCADQv////8PgyAhIBh+fCEDIAQgA0IgiHwhBCADQv////8PgyAlIBR+fCEDIAQgA0IgiHwhBCACIAM+AgggBEIgiCEDIARC/////w+DIBYgI358IQQgAyAEQiCIfCEDIARC/////w+DIBogH358IQQgAyAEQiCIfCEDIARC/////w+DIB4gG358IQQgAyAEQiCIfCEDIARC/////w+DICIgF358IQQgAyAEQiCIfCEDIARC/////w+DIBkgJH58IQQgAyAEQiCIfCEDIARC/////w+DIB0gIH58IQQgAyAEQiCIfCEDIARC/////w+DICEgHH58IQQgAyAEQiCIfCEDIARC/////w+DICUgGH58IQQgAyAEQiCIfCEDIAIgBD4CDCADQiCIIQQgA0L/////D4MgGiAjfnwhAyAEIANCIIh8IQQgA0L/////D4MgHiAffnwhAyAEIANCIIh8IQQgA0L/////D4MgIiAbfnwhAyAEIANCIIh8IQQgA0L/////D4MgHSAkfnwhAyAEIANCIIh8IQQgA0L/////D4MgISAgfnwhAyAEIANCIIh8IQQgA0L/////D4MgJSAcfnwhAyAEIANCIIh8IQQgAiADPgIQIARCIIghAyAEQv////8PgyAeICN+fCEEIAMgBEIgiHwhAyAEQv////8PgyAiIB9+fCEEIAMgBEIgiHwhAyAEQv////8PgyAhICR+fCEEIAMgBEIgiHwhAyAEQv////8PgyAlICB+fCEEIAMgBEIgiHwhAyACIAQ+AhQgA0IgiCEEIANC/////w+DICIgI358IQMgBCADQiCIfCEEIANC/////w+DICUgJH58IQMgBCADQiCIfCEEIAIgAz4CGCAEQiCIIQMgAiAEPgIcIAOnBEAgAkHoDSACEAcaBSACQegNEAUEQCACQegNIAIQBxoLCwsSACAAIAFB6BIQCUHoEiACEBsLCwAgAEGIDiABEBwLFQAgAEGoExAAQcgTEAFBqBMgARAbCxcAIAAgARAfIAFB6A0gARANIAEgARAeCwkAQagOIAAQAAsVACAAIAFB6BMQHEHoE0GIDiACEBwLCwAgAEHoDSABEA0LCgAgAEHAAGoQAgsVACAAEAEgAEEgahAXIABBwABqEAELIgAgACABEAAgAEEgaiABQSBqEAAgAEHAAGogAUHAAGoQAAuGAgAgABAkBEAgACABECYPCyAAIABBiBQQEiAAQSBqIABBIGpBqBQQEkGoFEGoFEHIFBASIABBqBRB6BQQDkHoFEHoFEHoFBASQegUQYgUQegUEA9B6BRByBRB6BQQD0HoFEHoFEHoFBAOQYgUQYgUQYgVEA5BiBVBiBRBiBUQDkGIFUGIFUGoFRASIABBIGogAEHAAGpByBUQEkHoFEHoFCABEA5BqBUgASABEA9ByBRByBRB6BUQDkHoFUHoFUHoFRAOQegVQegVQegVEA5B6BQgASABQSBqEA8gAUEgakGIFSABQSBqEBIgAUEgakHoFSABQSBqEA9ByBVByBUgAUHAAGoQDgusAwIBfwF/IABBwABqIQMgAUHAAGohBCAAECQEQCABIAIQJg8LIAEQJARAIAAgAhAmDwsgAyADQYgWEBIgBCAEQagWEBIgAEGoFkHIFhASIAFBiBZB6BYQEiADQYgWQYgXEBIgBEGoFkGoFxASIABBIGpBqBdByBcQEiABQSBqQYgXQegXEBJByBZB6BYQBARAQcgXQegXEAQEQCAAIAIQJw8LC0HoFkHIFkGIGBAPQegXQcgXQagYEA9BiBhBiBhByBgQDkHIGEHIGEHIGBASQYgYQcgYQegYEBJBqBhBqBhBiBkQDkHIFkHIGEHIGRASQYgZQYgZQagZEBJByBlByBlB6BkQDkGoGUHoGCACEA8gAkHoGSACEA9ByBdB6BhBiBoQEkGIGkGIGkGIGhAOQcgZIAIgAkEgahAPIAJBIGpBiBkgAkEgahASIAJBIGpBiBogAkEgahAPIAMgBCACQcAAahAOIAJBwABqIAJBwABqIAJBwABqEBIgAkHAAGpBiBYgAkHAAGoQDyACQcAAakGoFiACQcAAahAPIAJBwABqQYgYIAJBwABqEBILIgAgACABEAAgAEEgaiABQSBqEBAgAEHAAGogAUHAAGoQAAsQACABIAIQKSAAIAIgAhAoCyIAIAAgARAVIABBIGogAUEgahAVIABBwABqIAFBwABqEBULIgAgACABEBQgAEEgaiABQSBqEBQgAEHAAGogAUHAAGoQFAtPACAAECQEQCABECUFIABBwABqQagaEBZBqBpBqBpByBoQEkGoGkHIGkHoGhASIABByBogARASIABBIGpB6BogAUEgahASIAFBwABqEBcLC6cCAgF/AX8gAEGIGxAmIAMQJSACIQQCQANAIARBAWshBCABIARqLQAAIQUgAyADECcgBUGAAU8EQCAFQYABayEFQYgbIAMgAxAoCyADIAMQJyAFQcAATwRAIAVBwABrIQVBiBsgAyADECgLIAMgAxAnIAVBIE8EQCAFQSBrIQVBiBsgAyADECgLIAMgAxAnIAVBEE8EQCAFQRBrIQVBiBsgAyADECgLIAMgAxAnIAVBCE8EQCAFQQhrIQVBiBsgAyADECgLIAMgAxAnIAVBBE8EQCAFQQRrIQVBiBsgAyADECgLIAMgAxAnIAVBAk8EQCAFQQJrIQVBiBsgAyADECgLIAMgAxAnIAVBAU8EQCAFQQFrIQVBiBsgAyADECgLIARFDQEMAAsLCysCAX8BfyAAQQV2QQJ0IQFBASAAQR9xdCECIAEgASgC6NsBIAJyNgLo2wELJAIBfwF/IABBBXZBAnQhAUEBIABBH3F0IQIgASgC6NsBIAJxC6ABBAF/AX8BfwF/IAAhAkHoGxAlQQAhBAJAA0AgBCABRg0BQegbQQEgBHRB4ABsaiEDIAIQAiEFIAIgAxAAIAJBIGohAiADQSBqIQMgAiADEAAgAkEgaiECIANBIGohAyAFBEAgAxABBSADEBcLIARBAWohBAwACwtB6NsBQpeChIAQNwMAQfDbAUIBNwMAQfjbAUIBNwMAQYDcAUIANwMAC0ADAX8BfwF/QegbIABB4ABsaiEBIAAQMEUEQCAALQCI3AEQMiECIAAtAIjeARAyIQMgAiADIAEQKCAAEC8LIAELpQEEAX8BfwF+AX5BACEDAkADQCADQSBGDQFCACEGQQAhBAJAA0AgBCABRg0BIAAgBEEgbCADamoxAAAhBSAFIAVCHIaEQo+AgIDwAYMhBSAFIAVCDoaEQoOAjICwgMABgyEFIAUgBUIHhoRCgYKEiJCgwIABgyEFIAYgBSAErYaEIQYgBEEBaiEEDAALCyACIANBCGxqIAY3AwAgA0EBaiEDDAALCwtLAQF/IAAgAkGI4AEQMyADECUgASACEDFBACEEAkADQCAEQYACRg0BIAMgAxAnIANBh+IBIARrLQAAEDIgAxAoIARBAWohBAwACwsLfgQBfwF/AX8BfyAAIQUgASEGIAUgAiADbiADbEEgbGohCAJAA0AgBSAIRg0BIAUgBiADQYjiARA0QYjiASAEIAQQKCAFQSAgA2xqIQUgBkHAACADbGohBgwACwsgAiADcCEHIAcEQCAFIAYgB0GI4gEQNEGI4gEgBCAEECgLC04CAX8BfyAAIAJB6OIBEDMgASACEDFBACEEAkADQCAEQYACRg0BIAMgBEHgAGxqIQUgBUHn5AEgBGstAAAQMiAFECggBEEBaiEEDAALCwspAQF/QQAhAgJAA0AgAiABRg0BIAAgAkHgAGxqECUgAkEBaiECDAALCwtIAgF/AX8gACEEIAQgAhAmIARB4ABqIQRBASEDAkADQCADIAFGDQEgAiACECcgBCACIAIQKCAEQeAAaiEEIANBAWohAwwACwsLigEEAX8BfwF/AX9B6OQBQYACEDcgACEFIAEhBiAFIAIgA24gA2xBIGxqIQgCQANAIAUgCEYNASAFIAYgA0Ho5AEQNiAFQSAgA2xqIQUgBkHAACADbGohBgwACwsgAiADcCEHIAcEQCAFIAYgB0Ho5AEQNgtB6OQBQYACQeikAxA4QeikAyAEIAQQKAtGACAAQf8BcS0AiLQDQRh0IABBCHZB/wFxLQCItANBEHRqIABBEHZB/wFxLQCItANBCHQgAEEYdkH/AXEtAIi0A2pqIAF3C2cFAX8BfwF/AX8Bf0EBIAF0IQJBACEDAkADQCADIAJGDQEgACADQSBsaiEFIAMgARA6IQQgACAEQSBsaiEGIAMgBEkEQCAFQYi2AxAAIAYgBRAAQYi2AyAGEAALIANBAWohAwwACwsL7wEJAX8BfwF/AX8BfwF/AX8BfwF/IAAgARA7QQEgAXQhCEEBIQMCQANAIAMgAUsNAUEBIAN0IQZByKUDIANBIGxqIQlBACEEAkADQCAEIAhPDQEgAgRAIAlBIGpBqLYDEAAFQai2AxAhCyAGQQF2IQdBACEFAkADQCAFIAdPDQEgACAEIAVqQSBsaiEKIAogB0EgbGohC0GotgMgC0HItgMQHCAKQei2AxAAQei2A0HItgMgChAYQei2A0HItgMgCxAZQai2AyAJQai2AxAcIAVBAWohBQwACwsgBCAGaiEEDAALCyADQQFqIQMMAAsLCz4DAX8BfwF/IAAhAyABIQQgACACQSBsaiEFAkADQCADIAVGDQEgAyAEEAAgA0EgaiEDIARBwABqIQQMAAsLCz0DAX8BfwF/IAAhAyABIQQgACACQSBsaiEFAkADQCADIAVGDQEgAyAEEB8gA0EgaiEDIARBIGohBAwACwsLPQMBfwF/AX8gACEDIAEhBCAAIAJBIGxqIQUCQANAIAMgBUYNASADIAQQHiADQSBqIQMgBEEgaiEEDAALCwuWAQcBfwF/AX8BfwF/AX8Bf0EBIAF0IQJB6KwDIAFBIGxqIQQgAkEBayEGQQEhBSACQQF2IQMCQANAIAUgA0YNASAAIAVBIGxqIQcgACACIAVrQSBsaiEIIAdBiLcDEAAgCCAEIAcQHEGItwMgBCAIEBwgBUEBaiEFDAALCyAAIAQgABAcIAAgA0EgbGohCCAIIAQgCBAcC0MCAX8BfyAAQQF2IQJBACEBAkADQCACRQ0BIAJBAXYhAiABQQFqIQEMAAsLIABBASABdEcEQAALIAFBHEsEQAALIAELEgEBfyABEEEhAyAAIAMgAhA8CxgBAX8gARBBIQMgACADIAIQPCAAIAMQQAtMBAF/AX8BfwF/IAAhBCABIQUgAyEGIAAgAkEgbGohBwJAA0AgBCAHRg0BIAQgBSAGEBwgBEEgaiEEIAVBIGohBSAGQSBqIQYMAAsLCy4CAX8BfyAAIQMgACABQSBsaiECAkADQCADIAJGDQEgAxABIANBIGohAwwACwsLjgEGAX8BfwF/AX8BfwF/QQAhBCAAIQYgASEHAkADQCAEIAJGDQEgBigCACEJIAZBBGohBkEAIQUCQANAIAUgCUYNASADIAYoAgBBIGxqIQggBkEEaiEGIAcgBkGotwMQHEGotwMgCCAIEBggBkEgaiEGIAVBAWohBQwACwsgB0EgaiEHIARBAWohBAwACwsLDgAgABACIABBIGoQAnELDQAgABABIABBIGoQAQsNACAAEBcgAEEgahABCxQAIAAgARAAIABBIGogAUEgahAAC3kAIAAgAUHotwMQEiAAQSBqIAFBIGpBiLgDEBIgACAAQSBqQai4AxAOIAEgAUEgakHIuAMQDkGouANByLgDQai4AxASQYi4A0HItwMgAhASQei3AyACIAIQDkHotwNBiLgDIAJBIGoQDkGouAMgAkEgaiACQSBqEA8LGwAgACABIAIQDiAAQSBqIAFBIGogAkEgahAOCxsAIAAgASACEA8gAEEgaiABQSBqIAJBIGoQDwsUACAAIAEQECAAQSBqIAFBIGoQEAsUACAAIAEQFCAAQSBqIAFBIGoQFAsUACAAIAEQFSAAQSBqIAFBIGoQFQsVACAAIAEQBCAAQSBqIAFBIGoQBHELaAAgACAAQei4AxASIABBIGogAEEgakGIuQMQEkGIuQNByLcDQai5AxASQei4A0GouQNBqLkDEA9BqLkDQci5AxAWIABByLkDIAEQEiAAQSBqQci5AyABQSBqEBIgAUEgaiABQSBqEBALCgAgAEGAAWoQRwsWACAAEEggAEHAAGoQSSAAQYABahBICyQAIAAgARBKIABBwABqIAFBwABqEEogAEGAAWogAUGAAWoQSgu8AgAgABBTBEAgACABEFUPCyAAIABB6LkDEEsgAEHAAGogAEHAAGpBqLoDEEtBqLoDQai6A0HougMQSyAAQai6A0GouwMQTEGouwNBqLsDQai7AxBLQai7A0HouQNBqLsDEE1BqLsDQei6A0GouwMQTUGouwNBqLsDQai7AxBMQei5A0HouQNB6LsDEExB6LsDQei5A0HouwMQTEHouwNB6LsDQai8AxBLIABBwABqIABBgAFqQei8AxBLQai7A0GouwMgARBMQai8AyABIAEQTUHougNB6LoDQai9AxBMQai9A0GovQNBqL0DEExBqL0DQai9A0GovQMQTEGouwMgASABQcAAahBNIAFBwABqQei7AyABQcAAahBLIAFBwABqQai9AyABQcAAahBNQei8A0HovAMgAUGAAWoQTAvvAwIBfwF/IABBgAFqIQMgAUGAAWohBCAAEFMEQCABIAIQVQ8LIAEQUwRAIAAgAhBVDwsgAyADQei9AxBLIAQgBEGovgMQSyAAQai+A0HovgMQSyABQei9A0GovwMQSyADQei9A0HovwMQSyAEQai+A0GowAMQSyAAQcAAakGowANB6MADEEsgAUHAAGpB6L8DQajBAxBLQei+A0GovwMQUQRAQejAA0GowQMQUQRAIAAgAhBWDwsLQai/A0HovgNB6MEDEE1BqMEDQejAA0GowgMQTUHowQNB6MEDQejCAxBMQejCA0HowgNB6MIDEEtB6MEDQejCA0GowwMQS0GowgNBqMIDQejDAxBMQei+A0HowgNB6MQDEEtB6MMDQejDA0GoxAMQS0HoxANB6MQDQajFAxBMQajEA0GowwMgAhBNIAJBqMUDIAIQTUHowANBqMMDQejFAxBLQejFA0HoxQNB6MUDEExB6MQDIAIgAkHAAGoQTSACQcAAakHowwMgAkHAAGoQSyACQcAAakHoxQMgAkHAAGoQTSADIAQgAkGAAWoQTCACQYABaiACQYABaiACQYABahBLIAJBgAFqQei9AyACQYABahBNIAJBgAFqQai+AyACQYABahBNIAJBgAFqQejBAyACQYABahBLCyQAIAAgARBKIABBwABqIAFBwABqEE4gAEGAAWogAUGAAWoQSgsQACABIAIQWCAAIAIgAhBXCyQAIAAgARBQIABBwABqIAFBwABqEFAgAEGAAWogAUGAAWoQUAskACAAIAEQTyAAQcAAaiABQcAAahBPIABBgAFqIAFBgAFqEE8LWgAgABBTBEAgARBUBSAAQYABakGoxgMQUkGoxgNBqMYDQejGAxBLQajGA0HoxgNBqMcDEEsgAEHoxgMgARBLIABBwABqQajHAyABQcAAahBLIAFBgAFqEEkLC7ACAgF/AX8gAEHoxwMQVSADEFQgAiEEAkADQCAEQQFrIQQgASAEai0AACEFIAMgAxBWIAVBgAFPBEAgBUGAAWshBUHoxwMgAyADEFcLIAMgAxBWIAVBwABPBEAgBUHAAGshBUHoxwMgAyADEFcLIAMgAxBWIAVBIE8EQCAFQSBrIQVB6McDIAMgAxBXCyADIAMQViAFQRBPBEAgBUEQayEFQejHAyADIAMQVwsgAyADEFYgBUEITwRAIAVBCGshBUHoxwMgAyADEFcLIAMgAxBWIAVBBE8EQCAFQQRrIQVB6McDIAMgAxBXCyADIAMQViAFQQJPBEAgBUECayEFQejHAyADIAMQVwsgAyADEFYgBUEBTwRAIAVBAWshBUHoxwMgAyADEFcLIARFDQEMAAsLCysCAX8BfyAAQQV2QQJ0IQFBASAAQR9xdCECIAEgASgCqMkGIAJyNgKoyQYLJAIBfwF/IABBBXZBAnQhAUEBIABBH3F0IQIgASgCqMkGIAJxC6YBBAF/AX8BfwF/IAAhAkGoyQMQVEEAIQQCQANAIAQgAUYNAUGoyQNBASAEdEHAAWxqIQMgAhBHIQUgAiADEEogAkHAAGohAiADQcAAaiEDIAIgAxBKIAJBwABqIQIgA0HAAGohAyAFBEAgAxBIBSADEEkLIARBAWohBAwACwtBqMkGQpeChIAQNwMAQbDJBkIBNwMAQbjJBkIBNwMAQcDJBkIANwMAC0EDAX8BfwF/QajJAyAAQcABbGohASAAEF9FBEAgAC0AyMkGEGEhAiAALQDIywYQYSEDIAIgAyABEFcgABBeCyABC6UBBAF/AX8BfgF+QQAhAwJAA0AgA0EgRg0BQgAhBkEAIQQCQANAIAQgAUYNASAAIARBIGwgA2pqMQAAIQUgBSAFQhyGhEKPgICA8AGDIQUgBSAFQg6GhEKDgIyAsIDAAYMhBSAFIAVCB4aEQoGChIiQoMCAAYMhBSAGIAUgBK2GhCEGIARBAWohBAwACwsgAiADQQhsaiAGNwMAIANBAWohAwwACwsLSwEBfyAAIAJByM0GEGIgAxBUIAEgAhBgQQAhBAJAA0AgBEGAAkYNASADIAMQViADQcfPBiAEay0AABBhIAMQVyAEQQFqIQQMAAsLC34EAX8BfwF/AX8gACEFIAEhBiAFIAIgA24gA2xBIGxqIQgCQANAIAUgCEYNASAFIAYgA0HIzwYQY0HIzwYgBCAEEFcgBUEgIANsaiEFIAZBgAEgA2xqIQYMAAsLIAIgA3AhByAHBEAgBSAGIAdByM8GEGNByM8GIAQgBBBXCwtOAgF/AX8gACACQYjRBhBiIAEgAhBgQQAhBAJAA0AgBEGAAkYNASADIARBwAFsaiEFIAVBh9MGIARrLQAAEGEgBRBXIARBAWohBAwACwsLKQEBf0EAIQICQANAIAIgAUYNASAAIAJBwAFsahBUIAJBAWohAgwACwsLSAIBfwF/IAAhBCAEIAIQVSAEQcABaiEEQQEhAwJAA0AgAyABRg0BIAIgAhBWIAQgAiACEFcgBEHAAWohBCADQQFqIQMMAAsLC4oBBAF/AX8BfwF/QYjTBkGAAhBmIAAhBSABIQYgBSACIANuIANsQSBsaiEIAkADQCAFIAhGDQEgBSAGIANBiNMGEGUgBUEgIANsaiEFIAZBgAEgA2xqIQYMAAsLIAIgA3AhByAHBEAgBSAGIAdBiNMGEGULQYjTBkGAAkGI0wkQZ0GI0wkgBCAEEFcLJAEBfyADIQQCQANAIAAgASACEBIgBEEBayEEIARFDQEMAAsLCyQBAX8gAyEEAkADQCAAIAEgAhATIARBAWshBCAERQ0BDAALCwsL/hsSAEEACwRIagIAAEEICyABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABB6AcLIEf9fNgWjCA8jcpxaJFqgZddWIGBtkVQuCmgMeFyTmQwAEGICAsgifqKU1v8LPP7AUXUERnntfZ/QQr/HqtHHzW4ynGf2AYAQagICyCdDY/FjUNd0z0Lx/Uo63gKLEZ5eG+jbmYv3weawXcKDgBByAgLIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEHoDQsgAQAA8JP14UORcLl5SOgzKF1YgYG2RVC4KaAx4XJOZDAAQYgOCyCnbSGuRea4G+NZXOOxOv5ThYC7Uz2DSYylRE5/sdAWAgBBqA4LIPv//08cNJasKc1gn5V2/DYuRnl4b6NuZi/fB5rBdwoOAEHIDgsgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQYjcAQuAAgAAAAIABAQGAAgICggMDAwAEBASEBQUFBAYGBgYGBgcACAgIiAkJCQgKCgoKCgoLCAwMDAwMDA0MDAwODA4ODgAQEBCQEREREBISEhISEhMQFBQUFBQUFRQUFBYUFhYWEBgYGBgYGBkYGBgaGBoaGhgYGBwYHBwcGBwcHBwcHB4AICAgoCEhISAiIiIiIiIjICQkJCQkJCUkJCQmJCYmJiAoKCgoKCgpKCgoKigqKiooKCgsKCwsLCgsLCwsLCwuIDAwMDAwMDEwMDAyMDIyMjAwMDQwNDQ0MDQ0NDQ0NDYwMDA4MDg4ODA4ODg4ODg6MDg4ODg4ODw4ODg8ODw8PAAQYjeAQuAAgAAAAEAAQIBAAECAQQBAgMAAQIBBAECAwgBAgMEBQYDAAECAQQBAgMIAQIDBAUGAxABAgMEBQYDCAkKAwwFBgcAAQIBBAECAwgBAgMEBQYDEAECAwQFBgMICQoDDAUGByABAgMEBQYDCAkKAwwFBgcQERIDFAUGBxgJCgsMDQ4HAAECAQQBAgMIAQIDBAUGAxABAgMEBQYDCAkKAwwFBgcgAQIDBAUGAwgJCgMMBQYHEBESAxQFBgcYCQoLDA0OB0ABAgMEBQYDCAkKAwwFBgcQERIDFAUGBxgJCgsMDQ4HICEiAyQFBgcoCQoLDA0OBzAREhMUFRYHGBkaCxwNDg8AQcilAwugB/v//08cNJasKc1gn5V2/DYuRnl4b6NuZi/fB5rBdwoOBgAAoHfBS5dno1jasnE38S4SCAlHouFR+sApR7HWWSKL79yelz11fyCRR7EsFz9fbmwJdHlisY3PCME5NXs3Kz98rbXiSq34voXLg//GYC33KZRdK/122anZmj/nfEAkA48vdHx9tvTMaNBj3C0baGpX+xvvvOWM/jy20lEpfBZkTFe/sfcUIvJ9MfcvI/kozXWtsKiEdeUDbRfcWfuBK0KecG6u8VG1znHA3RMpmJsOBYBC6VZzZO31B/wGuNMJgFNdsQYNFKuXWzG8zDovjE+ZBJIlN1l4NCbiWfDzshwAnKOeMZOPf4JXzPlZECV7fFP7zWe9g1asm6gYrsbsFzMECZKPksjJo/TZf6YBR9mLJ4/9+1Xmzt4OLRdwRY4VE6UgZnX5WZ2ZVwHqo0XnM2zdv2C/4paJx+I1twLvpiIudgBd/OlRSeWuZMGCrX128iJOQvGv4V+XE7D47etlI9kBPlZnQaSjJboMUrpemCwhbXCfkuALYy7ljTRjrYwPGmYZCIlu6JiUND20wnGJpQyvbkFNfcvYJ1nvfCLUBAERlgf+kG8TKjJxjFo7lZGQN1CWNzfy380mlBQCXqEpDNRyDoJMZGltDMJyc8g9YzCdm1pCQQw7VxcnCqB/QlgeELjTUZK0AZScwI809Zg83oOT1AeLGbXPYwx/RlvO7CngQ+GA5vdXj3vbSsX5Loork99rO4/jEMoAAl1nXrctKecj6qy4yOYv8R6NjwW1zvfwzRJ8H4QnUTCoubd9byIhzi1+AHOxdSTqeQVkX6otYtxn8e7Xdq71fylqiLEQ7iUzR54WRLPrASD4tYlq3XaJ3TQOTAP7n6IA4mGcFayzGX0R+krdZAdiV5Mti3GsHJG6+FYYISp3CMFg9aFV9WgXZIs6zEmo7UWQbqVH9LpafStbw6/v4Ua/Pkg47qP9/RfvaMRqvM7HsG9Jryf2s34eEapUzcyjkkpfuMOubR1HFMwGf4lFmV7tafi5x3bRxWN5uYLSR51EFtxVzV1/hyoj2h08y2o/HLkYoHNUZKTEngzfD2tkXfnp9i7EyNy6ei9uxcz31cVAdqfy89gf8xbnR/8w9Pae3HbbOE42ZfQcIrN9xQ6tQO/ha7dA7s7CGs1m0ftNi8+MHDB7M+wTiPEQuP45tsXHMpaZ8g8NQONcmNjssAEAiN2yKc6YbQ0HaR0AQeisAwugB/v//08cNJasKc1gn5V2/DYuRnl4b6NuZi/fB5rBdwoO/v//H9gUPHjdHo0Mby+Yr0VP/fySdF+PrL+cPRpjNx////8PbAoevG6PRoa3F8zXoqd+fkm6r0fWX84ejbGbDwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAQYi0AwuAAgCAQMAgoGDgEJBQ0DCwcPAIiEjIKKho6BiYWNg4uHj4BIRExCSkZOQUlFTUNLR09AyMTMwsrGzsHJxc3Dy8fPwCgkLCIqJi4hKSUtIysnLyCopKyiqqauoamlraOrp6+gaGRsYmpmbmFpZW1ja2dvYOjk7OLq5u7h6eXt4+vn7+AYFBwSGhYeERkVHRMbFx8QmJSckpqWnpGZlZ2Tm5efkFhUXFJaVl5RWVVdU1tXX1DY1NzS2tbe0dnV3dPb19/QODQ8Mjo2PjE5NT0zOzc/MLi0vLK6tr6xubW9s7u3v7B4dHxyenZ+cXl1fXN7d39w+PT88vr2/vH59f3z+/f/8AQci3Awsgqu/tEolIw2hPv6pyaH8IjTESCAlHouFR+sApR7HWWSIAQcjJBguAAgAAAAIABAQGAAgICggMDAwAEBASEBQUFBAYGBgYGBgcACAgIiAkJCQgKCgoKCgoLCAwMDAwMDA0MDAwODA4ODgAQEBCQEREREBISEhISEhMQFBQUFBQUFRQUFBYUFhYWEBgYGBgYGBkYGBgaGBoaGhgYGBwYHBwcGBwcHBwcHB4AICAgoCEhISAiIiIiIiIjICQkJCQkJCUkJCQmJCYmJiAoKCgoKCgpKCgoKigqKiooKCgsKCwsLCgsLCwsLCwuIDAwMDAwMDEwMDAyMDIyMjAwMDQwNDQ0MDQ0NDQ0NDYwMDA4MDg4ODA4ODg4ODg6MDg4ODg4ODw4ODg8ODw8PAAQcjLBguAAgAAAAEAAQIBAAECAQQBAgMAAQIBBAECAwgBAgMEBQYDAAECAQQBAgMIAQIDBAUGAxABAgMEBQYDCAkKAwwFBgcAAQIBBAECAwgBAgMEBQYDEAECAwQFBgMICQoDDAUGByABAgMEBQYDCAkKAwwFBgcQERIDFAUGBxgJCgsMDQ4HAAECAQQBAgMIAQIDBAUGAxABAgMEBQYDCAkKAwwFBgcgAQIDBAUGAwgJCgMMBQYHEBESAxQFBgcYCQoLDA0OB0ABAgMEBQYDCAkKAwwFBgcQERIDFAUGBxgJCgsMDQ4HICEiAyQFBgcoCQoLDA0OBzAREhMUFRYHGBkaCxwNDg8=","base64"),a.pq=1e3,a.pr=1768},9565:(e,a,t)=>{var c;e=t.nmd(e);var f=function(e){"use strict";var a=1e7,t=9007199254740992,c=l(t),d="0123456789abcdefghijklmnopqrstuvwxyz",r="function"==typeof BigInt;function n(e,a,t,c){return void 0===e?n[0]:void 0===a||10==+a&&!t?Z(e):$(e,a,t,c)}function i(e,a){this.value=e,this.sign=a,this.isSmall=!1}function b(e){this.value=e,this.sign=e<0,this.isSmall=!0}function o(e){this.value=e}function s(e){return-t0?Math.floor(e):Math.ceil(e)}function m(e,t){var c,f,d=e.length,r=t.length,n=new Array(d),i=0,b=a;for(f=0;f=b?1:0,n[f]=c-i*b;for(;f0&&n.push(i),n}function x(e,a){return e.length>=a.length?m(e,a):m(a,e)}function y(e,t){var c,f,d=e.length,r=new Array(d),n=a;for(f=0;f0;)r[f++]=t%n,t=Math.floor(t/n);return r}function A(e,t){var c,f,d=e.length,r=t.length,n=new Array(d),i=0,b=a;for(c=0;c0;)r[f++]=i%n,i=Math.floor(i/n);return r}function I(e,a){for(var t=[];a-- >0;)t.push(0);return t.concat(e)}function E(e,a){var t=Math.max(e.length,a.length);if(t<=30)return w(e,a);t=Math.ceil(t/2);var c=e.slice(t),f=e.slice(0,t),d=a.slice(t),r=a.slice(0,t),n=E(f,r),i=E(c,d),b=E(x(f,c),x(r,d)),o=x(x(n,I(A(A(b,n),i),t)),I(i,2*t));return h(o),o}function C(e,t,c){return new i(e=0;--c)d=(r=d*b+e[c])-(f=g(r/t))*t,i[c]=0|f;return[i,0|d]}function k(e,t){var c,f=Z(t);if(r)return[new o(e.value/f.value),new o(e.value%f.value)];var d,s=e.value,m=f.value;if(0===m)throw new Error("Cannot divide by zero");if(e.isSmall)return f.isSmall?[new b(g(s/m)),new b(s%m)]:[n[0],e];if(f.isSmall){if(1===m)return[e,n[0]];if(-1==m)return[e.negate(),n[0]];var x=Math.abs(m);if(x=0;f--){for(c=l-1,x[f+s]!==g&&(c=Math.floor((x[f+s]*l+x[f+s-1])/g)),d=0,r=0,i=y.length,n=0;nb&&(d=(d+1)*l),c=Math.ceil(d/r);do{if(L(n=_(t,c),s)<=0)break;c--}while(c);o.push(c),s=A(s,n)}return o.reverse(),[u(o),u(s)]}(s,m),d=c[0];var w=e.sign!==f.sign,I=c[1],E=e.sign;return"number"==typeof d?(w&&(d=-d),d=new b(d)):d=new i(d,w),"number"==typeof I?(E&&(I=-I),I=new b(I)):I=new i(I,E),[d,I]}function L(e,a){if(e.length!==a.length)return e.length>a.length?1:-1;for(var t=e.length-1;t>=0;t--)if(e[t]!==a[t])return e[t]>a[t]?1:-1;return 0}function S(e){var a=e.abs();return!a.isUnit()&&(!!(a.equals(2)||a.equals(3)||a.equals(5))||!(a.isEven()||a.isDivisibleBy(3)||a.isDivisibleBy(5))&&(!!a.lesser(49)||void 0))}function T(e,a){for(var t,c,d,r=e.prev(),n=r,i=0;n.isEven();)n=n.divide(2),i++;e:for(c=0;c=0?c=A(e,a):(c=A(a,e),t=!t),"number"==typeof(c=u(c))?(t&&(c=-c),new b(c)):new i(c,t)}(t,c,this.sign)},i.prototype.minus=i.prototype.subtract,b.prototype.subtract=function(e){var a=Z(e),t=this.value;if(t<0!==a.sign)return this.add(a.negate());var c=a.value;return a.isSmall?new b(t-c):v(c,Math.abs(t),t>=0)},b.prototype.minus=b.prototype.subtract,o.prototype.subtract=function(e){return new o(this.value-Z(e).value)},o.prototype.minus=o.prototype.subtract,i.prototype.negate=function(){return new i(this.value,!this.sign)},b.prototype.negate=function(){var e=this.sign,a=new b(-this.value);return a.sign=!e,a},o.prototype.negate=function(){return new o(-this.value)},i.prototype.abs=function(){return new i(this.value,!1)},b.prototype.abs=function(){return new b(Math.abs(this.value))},o.prototype.abs=function(){return new o(this.value>=0?this.value:-this.value)},i.prototype.multiply=function(e){var t,c,f,d=Z(e),r=this.value,b=d.value,o=this.sign!==d.sign;if(d.isSmall){if(0===b)return n[0];if(1===b)return this;if(-1===b)return this.negate();if((t=Math.abs(b))0?E(r,b):w(r,b),o)},i.prototype.times=i.prototype.multiply,b.prototype._multiplyBySmall=function(e){return s(e.value*this.value)?new b(e.value*this.value):C(Math.abs(e.value),l(Math.abs(this.value)),this.sign!==e.sign)},i.prototype._multiplyBySmall=function(e){return 0===e.value?n[0]:1===e.value?this:-1===e.value?this.negate():C(Math.abs(e.value),this.value,this.sign!==e.sign)},b.prototype.multiply=function(e){return Z(e)._multiplyBySmall(this)},b.prototype.times=b.prototype.multiply,o.prototype.multiply=function(e){return new o(this.value*Z(e).value)},o.prototype.times=o.prototype.multiply,i.prototype.square=function(){return new i(M(this.value),!1)},b.prototype.square=function(){var e=this.value*this.value;return s(e)?new b(e):new i(M(l(Math.abs(this.value))),!1)},o.prototype.square=function(e){return new o(this.value*this.value)},i.prototype.divmod=function(e){var a=k(this,e);return{quotient:a[0],remainder:a[1]}},o.prototype.divmod=b.prototype.divmod=i.prototype.divmod,i.prototype.divide=function(e){return k(this,e)[0]},o.prototype.over=o.prototype.divide=function(e){return new o(this.value/Z(e).value)},b.prototype.over=b.prototype.divide=i.prototype.over=i.prototype.divide,i.prototype.mod=function(e){return k(this,e)[1]},o.prototype.mod=o.prototype.remainder=function(e){return new o(this.value%Z(e).value)},b.prototype.remainder=b.prototype.mod=i.prototype.remainder=i.prototype.mod,i.prototype.pow=function(e){var a,t,c,f=Z(e),d=this.value,r=f.value;if(0===r)return n[1];if(0===d)return n[0];if(1===d)return n[1];if(-1===d)return f.isEven()?n[1]:n[-1];if(f.sign)return n[0];if(!f.isSmall)throw new Error("The exponent "+f.toString()+" is too large.");if(this.isSmall&&s(a=Math.pow(d,r)))return new b(g(a));for(t=this,c=n[1];!0&r&&(c=c.times(t),--r),0!==r;)r/=2,t=t.square();return c},b.prototype.pow=i.prototype.pow,o.prototype.pow=function(e){var a=Z(e),t=this.value,c=a.value,f=BigInt(0),d=BigInt(1),r=BigInt(2);if(c===f)return n[1];if(t===f)return n[0];if(t===d)return n[1];if(t===BigInt(-1))return a.isEven()?n[1]:n[-1];if(a.isNegative())return new o(f);for(var i=this,b=n[1];(c&d)===d&&(b=b.times(i),--c),c!==f;)c/=r,i=i.square();return b},i.prototype.modPow=function(e,a){if(e=Z(e),(a=Z(a)).isZero())throw new Error("Cannot take modPow with modulus 0");for(var t=n[1],c=this.mod(a);e.isPositive();){if(c.isZero())return n[0];e.isOdd()&&(t=t.multiply(c).mod(a)),e=e.divide(2),c=c.square().mod(a)}return t},o.prototype.modPow=b.prototype.modPow=i.prototype.modPow,i.prototype.compareAbs=function(e){var a=Z(e),t=this.value,c=a.value;return a.isSmall?1:L(t,c)},b.prototype.compareAbs=function(e){var a=Z(e),t=Math.abs(this.value),c=a.value;return a.isSmall?t===(c=Math.abs(c))?0:t>c?1:-1:-1},o.prototype.compareAbs=function(e){var a=this.value,t=Z(e).value;return(a=a>=0?a:-a)===(t=t>=0?t:-t)?0:a>t?1:-1},i.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var a=Z(e),t=this.value,c=a.value;return this.sign!==a.sign?a.sign?1:-1:a.isSmall?this.sign?-1:1:L(t,c)*(this.sign?-1:1)},i.prototype.compareTo=i.prototype.compare,b.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var a=Z(e),t=this.value,c=a.value;return a.isSmall?t==c?0:t>c?1:-1:t<0!==a.sign?t<0?-1:1:t<0?1:-1},b.prototype.compareTo=b.prototype.compare,o.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var a=this.value,t=Z(e).value;return a===t?0:a>t?1:-1},o.prototype.compareTo=o.prototype.compare,i.prototype.equals=function(e){return 0===this.compare(e)},o.prototype.eq=o.prototype.equals=b.prototype.eq=b.prototype.equals=i.prototype.eq=i.prototype.equals,i.prototype.notEquals=function(e){return 0!==this.compare(e)},o.prototype.neq=o.prototype.notEquals=b.prototype.neq=b.prototype.notEquals=i.prototype.neq=i.prototype.notEquals,i.prototype.greater=function(e){return this.compare(e)>0},o.prototype.gt=o.prototype.greater=b.prototype.gt=b.prototype.greater=i.prototype.gt=i.prototype.greater,i.prototype.lesser=function(e){return this.compare(e)<0},o.prototype.lt=o.prototype.lesser=b.prototype.lt=b.prototype.lesser=i.prototype.lt=i.prototype.lesser,i.prototype.greaterOrEquals=function(e){return this.compare(e)>=0},o.prototype.geq=o.prototype.greaterOrEquals=b.prototype.geq=b.prototype.greaterOrEquals=i.prototype.geq=i.prototype.greaterOrEquals,i.prototype.lesserOrEquals=function(e){return this.compare(e)<=0},o.prototype.leq=o.prototype.lesserOrEquals=b.prototype.leq=b.prototype.lesserOrEquals=i.prototype.leq=i.prototype.lesserOrEquals,i.prototype.isEven=function(){return!(1&this.value[0])},b.prototype.isEven=function(){return!(1&this.value)},o.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)},i.prototype.isOdd=function(){return!(1&~this.value[0])},b.prototype.isOdd=function(){return!(1&~this.value)},o.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)},i.prototype.isPositive=function(){return!this.sign},b.prototype.isPositive=function(){return this.value>0},o.prototype.isPositive=b.prototype.isPositive,i.prototype.isNegative=function(){return this.sign},b.prototype.isNegative=function(){return this.value<0},o.prototype.isNegative=b.prototype.isNegative,i.prototype.isUnit=function(){return!1},b.prototype.isUnit=function(){return 1===Math.abs(this.value)},o.prototype.isUnit=function(){return this.abs().value===BigInt(1)},i.prototype.isZero=function(){return!1},b.prototype.isZero=function(){return 0===this.value},o.prototype.isZero=function(){return this.value===BigInt(0)},i.prototype.isDivisibleBy=function(e){var a=Z(e);return!a.isZero()&&(!!a.isUnit()||(0===a.compareAbs(2)?this.isEven():this.mod(a).isZero()))},o.prototype.isDivisibleBy=b.prototype.isDivisibleBy=i.prototype.isDivisibleBy,i.prototype.isPrime=function(a){var t=S(this);if(t!==e)return t;var c=this.abs(),d=c.bitLength();if(d<=64)return T(c,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var r=Math.log(2)*d.toJSNumber(),n=Math.ceil(!0===a?2*Math.pow(r,2):r),i=[],b=0;b-t?new b(e-1):new i(c,!0)},o.prototype.prev=function(){return new o(this.value-BigInt(1))};for(var N=[1];2*N[N.length-1]<=a;)N.push(2*N[N.length-1]);var R=N.length,P=N[R-1];function D(e){return Math.abs(e)<=a}function O(e,a,t){a=Z(a);for(var c=e.isNegative(),d=a.isNegative(),r=c?e.not():e,n=d?a.not():a,i=0,b=0,o=null,s=null,l=[];!r.isZero()||!n.isZero();)i=(o=k(r,P))[1].toJSNumber(),c&&(i=P-1-i),b=(s=k(n,P))[1].toJSNumber(),d&&(b=P-1-b),r=o[0],n=s[0],l.push(t(i,b));for(var u=0!==t(c?1:0,d?1:0)?f(-1):f(0),h=l.length-1;h>=0;h-=1)u=u.multiply(P).add(f(l[h]));return u}i.prototype.shiftLeft=function(e){var a=Z(e).toJSNumber();if(!D(a))throw new Error(String(a)+" is too large for shifting.");if(a<0)return this.shiftRight(-a);var t=this;if(t.isZero())return t;for(;a>=R;)t=t.multiply(P),a-=R-1;return t.multiply(N[a])},o.prototype.shiftLeft=b.prototype.shiftLeft=i.prototype.shiftLeft,i.prototype.shiftRight=function(e){var a,t=Z(e).toJSNumber();if(!D(t))throw new Error(String(t)+" is too large for shifting.");if(t<0)return this.shiftLeft(-t);for(var c=this;t>=R;){if(c.isZero()||c.isNegative()&&c.isUnit())return c;c=(a=k(c,P))[1].isNegative()?a[0].prev():a[0],t-=R-1}return(a=k(c,N[t]))[1].isNegative()?a[0].prev():a[0]},o.prototype.shiftRight=b.prototype.shiftRight=i.prototype.shiftRight,i.prototype.not=function(){return this.negate().prev()},o.prototype.not=b.prototype.not=i.prototype.not,i.prototype.and=function(e){return O(this,e,(function(e,a){return e&a}))},o.prototype.and=b.prototype.and=i.prototype.and,i.prototype.or=function(e){return O(this,e,(function(e,a){return e|a}))},o.prototype.or=b.prototype.or=i.prototype.or,i.prototype.xor=function(e){return O(this,e,(function(e,a){return e^a}))},o.prototype.xor=b.prototype.xor=i.prototype.xor;var F=1<<30;function Q(e){var t=e.value,c="number"==typeof t?t|F:"bigint"==typeof t?t|BigInt(F):t[0]+t[1]*a|1073758208;return c&-c}function U(e,a){if(a.compareTo(e)<=0){var t=U(e,a.square(a)),c=t.p,d=t.e,r=c.multiply(a);return r.compareTo(e)<=0?{p:r,e:2*d+1}:{p:c,e:2*d}}return{p:f(1),e:0}}function j(e,a){return e=Z(e),a=Z(a),e.greater(a)?e:a}function H(e,a){return e=Z(e),a=Z(a),e.lesser(a)?e:a}function q(e,a){if(e=Z(e).abs(),a=Z(a).abs(),e.equals(a))return e;if(e.isZero())return a;if(a.isZero())return e;for(var t,c,f=n[1];e.isEven()&&a.isEven();)t=H(Q(e),Q(a)),e=e.divide(t),a=a.divide(t),f=f.multiply(t);for(;e.isEven();)e=e.divide(Q(e));do{for(;a.isEven();)a=a.divide(Q(a));e.greater(a)&&(c=a,a=e,e=c),a=a.subtract(e)}while(!a.isZero());return f.isUnit()?e:e.multiply(f)}i.prototype.bitLength=function(){var e=this;return e.compareTo(f(0))<0&&(e=e.negate().subtract(f(1))),0===e.compareTo(f(0))?f(0):f(U(e,f(2)).e).add(f(1))},o.prototype.bitLength=b.prototype.bitLength=i.prototype.bitLength;var $=function(e,a,t,c){t=t||d,e=String(e),c||(e=e.toLowerCase(),t=t.toLowerCase());var f,r=e.length,n=Math.abs(a),i={};for(f=0;f=n){if("1"===s&&1===n)continue;throw new Error(s+" is not a valid digit in base "+a+".")}a=Z(a);var b=[],o="-"===e[0];for(f=o?1:0;f"!==e[f]&&f=0;c--)f=f.add(e[c].times(d)),d=d.times(a);return t?f.negate():f}function G(e,a){if((a=f(a)).isZero()){if(e.isZero())return{value:[0],isNegative:!1};throw new Error("Cannot convert nonzero numbers to base 0.")}if(a.equals(-1)){if(e.isZero())return{value:[0],isNegative:!1};if(e.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-e.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var t=Array.apply(null,Array(e.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);return t.unshift([1]),{value:[].concat.apply([],t),isNegative:!1}}var c=!1;if(e.isNegative()&&a.isPositive()&&(c=!0,e=e.abs()),a.isUnit())return e.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(e.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:c};for(var d,r=[],n=e;n.isNegative()||n.compareAbs(a)>=0;){d=n.divmod(a),n=d.quotient;var i=d.remainder;i.isNegative()&&(i=a.minus(i).abs(),n=n.next()),r.push(i.toJSNumber())}return r.push(n.toJSNumber()),{value:r.reverse(),isNegative:c}}function K(e,a,t){var c=G(e,a);return(c.isNegative?"-":"")+c.value.map((function(e){return function(e,a){return e<(a=a||d).length?a[e]:"<"+e+">"}(e,t)})).join("")}function V(e){if(s(+e)){var a=+e;if(a===g(a))return r?new o(BigInt(a)):new b(a);throw new Error("Invalid integer: "+e)}var t="-"===e[0];t&&(e=e.slice(1));var c=e.split(/e/i);if(c.length>2)throw new Error("Invalid integer: "+c.join("e"));if(2===c.length){var f=c[1];if("+"===f[0]&&(f=f.slice(1)),(f=+f)!==g(f)||!s(f))throw new Error("Invalid integer: "+f+" is not a valid exponent.");var d=c[0],n=d.indexOf(".");if(n>=0&&(f-=d.length-n-1,d=d.slice(0,n)+d.slice(n+1)),f<0)throw new Error("Cannot include negative exponent part for integers");e=d+=new Array(f+1).join("0")}if(!/^([0-9][0-9]*)$/.test(e))throw new Error("Invalid integer: "+e);if(r)return new o(BigInt(t?"-"+e:e));for(var l=[],u=e.length,p=u-7;u>0;)l.push(+e.slice(p,u)),(p-=7)<0&&(p=0),u-=7;return h(l),new i(l,t)}function Z(e){return"number"==typeof e?function(e){if(r)return new o(BigInt(e));if(s(e)){if(e!==g(e))throw new Error(e+" is not an integer.");return new b(e)}return V(e.toString())}(e):"string"==typeof e?V(e):"bigint"==typeof e?new o(e):e}i.prototype.toArray=function(e){return G(this,e)},b.prototype.toArray=function(e){return G(this,e)},o.prototype.toArray=function(e){return G(this,e)},i.prototype.toString=function(a,t){if(a===e&&(a=10),10!==a)return K(this,a,t);for(var c,f=this.value,d=f.length,r=String(f[--d]);--d>=0;)c=String(f[d]),r+="0000000".slice(c.length)+c;return(this.sign?"-":"")+r},b.prototype.toString=function(a,t){return a===e&&(a=10),10!=a?K(this,a,t):String(this.value)},o.prototype.toString=b.prototype.toString,o.prototype.toJSON=i.prototype.toJSON=b.prototype.toJSON=function(){return this.toString()},i.prototype.valueOf=function(){return parseInt(this.toString(),10)},i.prototype.toJSNumber=i.prototype.valueOf,b.prototype.valueOf=function(){return this.value},b.prototype.toJSNumber=b.prototype.valueOf,o.prototype.valueOf=o.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};for(var J=0;J<1e3;J++)n[J]=Z(J),J>0&&(n[-J]=Z(-J));return n.one=n[1],n.zero=n[0],n.minusOne=n[-1],n.max=j,n.min=H,n.gcd=q,n.lcm=function(e,a){return e=Z(e).abs(),a=Z(a).abs(),e.divide(q(e,a)).multiply(a)},n.isInstance=function(e){return e instanceof i||e instanceof b||e instanceof o},n.randBetween=function(e,t){var c=H(e=Z(e),t=Z(t)),f=j(e,t).subtract(c).add(1);if(f.isSmall)return c.add(Math.floor(Math.random()*f));for(var d=G(f,a).value,r=[],i=!0,b=0;b{const c=t(9565),f=t(71293),d=t(94148),r="undefined"!=typeof window;let n,i;r||(n=t(5183).Worker,i=t(91565));class b{constructor(){this.promise=new Promise(((e,a)=>{this.reject=a,this.resolve=e}))}}function o(e){let a,t,c;function f(e){for(;3&c[0];)c[0]++;const a=c[0];for(c[0]+=e;c[0]>t.buffer.byteLength;)t.grow(100);return c=new Uint32Array(t.buffer),a}function d(e){const a=f(e.byteLength),t=new Uint32Array(e);return c.set(t,a/4),a}function r(e,a){return t.buffer.slice(e,e+a)}e.onmessage=function(n){let i;if(i=n.data?n.data:n,"INIT"==i.command)(async function(e){const f=new Uint8Array(e.code),d=await WebAssembly.compile(f);t=new WebAssembly.Memory({initial:e.init}),c=new Uint32Array(t.buffer),a=await WebAssembly.instantiate(d,{env:{memory:t}})})(i).then((function(){e.postMessage(i.result)}));else if("G1_MULTIEXP"==i.command){const t=c[0],n=d(i.scalars),b=d(i.points),o=f(96);a.exports.g1_zero(o),a.exports.g1_multiexp2(n,b,i.n,7,o),i.result=r(o,96),c[0]=t,e.postMessage(i.result,[i.result])}else if("G2_MULTIEXP"==i.command){const t=c[0],n=d(i.scalars),b=d(i.points),o=f(192);a.exports.g2_zero(o),a.exports.g2_multiexp(n,b,i.n,7,o),i.result=r(o,192),c[0]=t,e.postMessage(i.result,[i.result])}else if("CALC_H"==i.command){const t=c[0],n=d(i.signals),b=d(i.polsA),o=d(i.polsB),s=i.nSignals,l=i.domainSize,u=f(32*s),h=f(32*l),p=f(32*l),g=f(32*l*2),m=f(32*l*2);a.exports.fft_toMontgomeryN(n,u,s),a.exports.pol_zero(h,l),a.exports.pol_zero(p,l),a.exports.pol_constructLC(b,u,s,h),a.exports.pol_constructLC(o,u,s,p),a.exports.fft_copyNInterleaved(h,g,l),a.exports.fft_copyNInterleaved(p,m,l),a.exports.fft_ifft(h,l,0),a.exports.fft_ifft(p,l,0),a.exports.fft_fft(h,l,1),a.exports.fft_fft(p,l,1),a.exports.fft_copyNInterleaved(h,g+32,l),a.exports.fft_copyNInterleaved(p,m+32,l),a.exports.fft_mulN(g,m,2*l,g),a.exports.fft_ifft(g,2*l,0),a.exports.fft_fromMontgomeryN(g+32*l,g+32*l,l),i.result=r(g+32*l,32*l),c[0]=t,e.postMessage(i.result,[i.result])}else"TERMINATE"==i.command&&process.exit()}}class s{constructor(){this.actionQueue=[]}postAction(e,a,t,c){return d(0==this.working[e]),this.working[e]=!0,this.pendingDeferreds[e]=c||new b,this.workers[e].postMessage(a,t),this.pendingDeferreds[e].promise}processWorks(){for(let e=0;e0;e++)if(0==this.working[e]){const a=this.actionQueue.shift();this.postAction(e,a.data,a.transfers,a.deferred)}}queueAction(e,a){const t=new b;return this.actionQueue.push({data:e,transfers:a,deferred:t}),this.processWorks(),t.promise}alloc(e){for(;3&this.i32[0];)this.i32[0]++;const a=this.i32[0];return this.i32[0]+=e,a}putBin(e,a){const t=new Uint32Array(a);this.i32.set(t,e/4)}getBin(e,a){return this.memory.buffer.slice(e,e+a)}bin2int(e){const a=new Uint32Array(e);let t=c(a[7]);for(let e=6;e>=0;e--)t=t.shiftLeft(32),t=t.add(a[e]);return t.toString()}bin2g1(e){return[this.bin2int(e.slice(0,32)),this.bin2int(e.slice(32,64)),this.bin2int(e.slice(64,96))]}bin2g2(e){return[[this.bin2int(e.slice(0,32)),this.bin2int(e.slice(32,64))],[this.bin2int(e.slice(64,96)),this.bin2int(e.slice(96,128))],[this.bin2int(e.slice(128,160)),this.bin2int(e.slice(160,192))]]}async g1_multiexp(e,a){const t=e.byteLength/32,c=Math.floor(t/this.workers.length),f=[];for(let d=0;dthis.g1_multiexp(e,v))),B=this.g1_multiexp(e.slice(0),m),k=this.g1_multiexp(e.slice(0),x),L=this.g2_multiexp(e.slice(0),y),S=this.g1_multiexp(e.slice(32*(f+1)),A),T=await Promise.all([B,k,L,S,M]),N=this.alloc(96),R=this.alloc(192),P=this.alloc(96),D=this.alloc(96);this.putBin(N,T[0]),this.putBin(D,T[1]),this.putBin(R,T[2]),this.putBin(P,T[3]);const O=this.loadPoint1(w),F=this.loadPoint1(_),Q=this.loadPoint1(I),U=this.loadPoint2(E),j=this.loadPoint2(C);let H=new Uint32Array(8);const q=this.alloc(96),$=this.alloc(192),z=this.alloc(32),G=this.alloc(32);if(r)window.crypto.getRandomValues(H),this.putBin(z,H),window.crypto.getRandomValues(H),this.putBin(G,H);else{const e=i.randomBytes(32);this.putBin(z,e);const a=i.randomBytes(32);this.putBin(G,a)}this.instance.exports.g1_add(O,N,N),this.instance.exports.g1_timesScalar(Q,z,32,q),this.instance.exports.g1_add(q,N,N),this.instance.exports.g2_add(U,R,R),this.instance.exports.g2_timesScalar(j,G,32,$),this.instance.exports.g2_add($,R,R),this.instance.exports.g1_add(F,D,D),this.instance.exports.g1_timesScalar(Q,G,32,q),this.instance.exports.g1_add(q,D,D),this.putBin(q,T[4]),this.instance.exports.g1_add(q,P,P),this.instance.exports.g1_timesScalar(N,G,32,q),this.instance.exports.g1_add(q,P,P),this.instance.exports.g1_timesScalar(D,z,32,q),this.instance.exports.g1_add(q,P,P);const K=this.alloc(64);return this.instance.exports.int_mul(z,G,K),this.instance.exports.g1_timesScalar(Q,K,64,q),this.instance.exports.g1_neg(q,q),this.instance.exports.g1_add(q,P,P),this.instance.exports.g1_affine(N,N),this.instance.exports.g2_affine(R,R),this.instance.exports.g1_affine(P,P),this.instance.exports.g1_fromMontgomery(N,N),this.instance.exports.g2_fromMontgomery(R,R),this.instance.exports.g1_fromMontgomery(P,P),{pi_a:this.bin2g1(this.getBin(N,96)),pi_b:this.bin2g2(this.getBin(R,192)),pi_c:this.bin2g1(this.getBin(P,96))}}}e.exports=async function(e){const a={wasmInitialMemory:5e3};Object.assign(a,e);const t=new s;t.q=c("21888242871839275222246405745257275088696311157297823662689037894645226208583"),t.r=c("21888242871839275222246405745257275088548364400416034343698204186575808495617"),t.n64=Math.floor((t.q.minus(1).bitLength()-1)/64)+1,t.n32=2*t.n64,t.n8=8*t.n64,t.memory=new WebAssembly.Memory({initial:a.wasmInitialMemory}),t.i32=new Uint32Array(t.memory.buffer);const d=await WebAssembly.compile(f.code);let i;function b(e){return function(a){let c;c=a&&a.data?a.data:a,t.working[e]=!1,t.pendingDeferreds[e].resolve(c),t.processWorks()}}t.instance=await WebAssembly.instantiate(d,{env:{memory:t.memory}}),t.pq=f.pq,t.pr=f.pr,t.pr0=t.alloc(192),t.pr1=t.alloc(192),t.workers=[],t.pendingDeferreds=[],t.working=[],i="object"==typeof navigator&&navigator.hardwareConcurrency?navigator.hardwareConcurrency:8;for(let e=0;e{const c=t(9565),f=t(98665),d=t(27351),r=t(56274).cL,n=(t(56274).XL,t(56274).ex,t(56274).Hf),i=t(73248).e,b=t(73248).H;e.exports={bigInt2BytesLE:function(e,a){const t=Array(a);let f=c(e);for(let e=0;efunction(e){let a=e.toString(16);for(;a.length<64;)a="0"+a;return a}(e))).join("")};return e.publicSignals&&(a.publicSignals=r(n(e.publicSignals))),a},genWitnessAndProve:async function(e,a,t,c){const r=function(e,a){const t=new f(b(a)),c=t.calculateWitness(b(e)),d=c.slice(1,t.nPubInputs+t.nOutputs+1);return{witness:c,publicSignals:d}}(a,t),n=function(e){const a=32*e.length,t=new ArrayBuffer(a),c={dataView:new DataView(t),offset:0},f=d(4294967295);for(let a=0;a{const c=t(9565);e.exports.ex=function e(a){if("bigint"==typeof a||a instanceof c)return a.toString(10);if(Array.isArray(a))return a.map(e);if("object"==typeof a){const t={};for(let c in a)t[c]=e(a[c]);return t}return a},e.exports.Hf=function e(a){if("string"==typeof a&&/^[0-9]+$/.test(a))return c(a);if(Array.isArray(a))return a.map(e);if("object"!=typeof a||a instanceof c)return a;{const t={};for(let c in a)t[c]=e(a[c]);return t}},e.exports.cL=function e(a){if("bigInt"==typeof a||a instanceof c){let e=a.toString(16);for(;e.length<64;)e="0"+e;return e="0x"+e,e}if(Array.isArray(a))return a.map(e);if("object"==typeof a){const t={};for(let c in a)t[c]=e(a[c]);return t}return a},e.exports.XL=function e(a){if("string"==typeof a&&/^0x[0-9a-fA-F]+$/.test(a))return c(a);if(Array.isArray(a))return a.map(e);if("object"==typeof a){const t={};for(let c in a)t[c]=e(a[c]);return t}return a}},63282:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.MissingRefError=a.ValidationError=a.CodeGen=a.Name=a.nil=a.stringify=a.str=a._=a.KeywordCxt=a.Ajv=void 0;const c=t(4042),f=t(86144),d=t(36653),r=t(72079),n=["/properties"],i="http://json-schema.org/draft-07/schema";class b extends c.default{_addVocabularies(){super._addVocabularies(),f.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(d.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(r,n):r;this.addMetaSchema(e,i,!1),this.refs["http://json-schema.org/schema"]=i}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}}a.Ajv=b,e.exports=a=b,e.exports.Ajv=b,Object.defineProperty(a,"__esModule",{value:!0}),a.default=b;var o=t(62586);Object.defineProperty(a,"KeywordCxt",{enumerable:!0,get:function(){return o.KeywordCxt}});var s=t(99029);Object.defineProperty(a,"_",{enumerable:!0,get:function(){return s._}}),Object.defineProperty(a,"str",{enumerable:!0,get:function(){return s.str}}),Object.defineProperty(a,"stringify",{enumerable:!0,get:function(){return s.stringify}}),Object.defineProperty(a,"nil",{enumerable:!0,get:function(){return s.nil}}),Object.defineProperty(a,"Name",{enumerable:!0,get:function(){return s.Name}}),Object.defineProperty(a,"CodeGen",{enumerable:!0,get:function(){return s.CodeGen}});var l=t(13558);Object.defineProperty(a,"ValidationError",{enumerable:!0,get:function(){return l.default}});var u=t(34551);Object.defineProperty(a,"MissingRefError",{enumerable:!0,get:function(){return u.default}})},41520:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.regexpCode=a.getEsmExportName=a.getProperty=a.safeStringify=a.stringify=a.strConcat=a.addCodeArg=a.str=a._=a.nil=a._Code=a.Name=a.IDENTIFIER=a._CodeOrName=void 0;class t{}a._CodeOrName=t,a.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class c extends t{constructor(e){if(super(),!a.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}a.Name=c;class f extends t{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,a)=>`${e}${a}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,a)=>(a instanceof c&&(e[a.str]=(e[a.str]||0)+1),e)),{})}}function d(e,...a){const t=[e[0]];let c=0;for(;c{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.or=a.and=a.not=a.CodeGen=a.operators=a.varKinds=a.ValueScopeName=a.ValueScope=a.Scope=a.Name=a.regexpCode=a.stringify=a.getProperty=a.nil=a.strConcat=a.str=a._=void 0;const c=t(41520),f=t(57845);var d=t(41520);Object.defineProperty(a,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(a,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(a,"strConcat",{enumerable:!0,get:function(){return d.strConcat}}),Object.defineProperty(a,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(a,"getProperty",{enumerable:!0,get:function(){return d.getProperty}}),Object.defineProperty(a,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(a,"regexpCode",{enumerable:!0,get:function(){return d.regexpCode}}),Object.defineProperty(a,"Name",{enumerable:!0,get:function(){return d.Name}});var r=t(57845);Object.defineProperty(a,"Scope",{enumerable:!0,get:function(){return r.Scope}}),Object.defineProperty(a,"ValueScope",{enumerable:!0,get:function(){return r.ValueScope}}),Object.defineProperty(a,"ValueScopeName",{enumerable:!0,get:function(){return r.ValueScopeName}}),Object.defineProperty(a,"varKinds",{enumerable:!0,get:function(){return r.varKinds}}),a.operators={GT:new c._Code(">"),GTE:new c._Code(">="),LT:new c._Code("<"),LTE:new c._Code("<="),EQ:new c._Code("==="),NEQ:new c._Code("!=="),NOT:new c._Code("!"),OR:new c._Code("||"),AND:new c._Code("&&"),ADD:new c._Code("+")};class n{optimizeNodes(){return this}optimizeNames(e,a){return this}}class i extends n{constructor(e,a,t){super(),this.varKind=e,this.name=a,this.rhs=t}render({es5:e,_n:a}){const t=e?f.varKinds.var:this.varKind,c=void 0===this.rhs?"":` = ${this.rhs}`;return`${t} ${this.name}${c};`+a}optimizeNames(e,a){if(e[this.name.str])return this.rhs&&(this.rhs=S(this.rhs,e,a)),this}get names(){return this.rhs instanceof c._CodeOrName?this.rhs.names:{}}}class b extends n{constructor(e,a,t){super(),this.lhs=e,this.rhs=a,this.sideEffects=t}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,a){if(!(this.lhs instanceof c.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=S(this.rhs,e,a),this}get names(){return L(this.lhs instanceof c.Name?{}:{...this.lhs.names},this.rhs)}}class o extends b{constructor(e,a,t,c){super(e,t,c),this.op=a}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class s extends n{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class l extends n{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class u extends n{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class h extends n{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,a){return this.code=S(this.code,e,a),this}get names(){return this.code instanceof c._CodeOrName?this.code.names:{}}}class p extends n{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((a,t)=>a+t.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let a=e.length;for(;a--;){const t=e[a].optimizeNodes();Array.isArray(t)?e.splice(a,1,...t):t?e[a]=t:e.splice(a,1)}return e.length>0?this:void 0}optimizeNames(e,a){const{nodes:t}=this;let c=t.length;for(;c--;){const f=t[c];f.optimizeNames(e,a)||(T(e,f.names),t.splice(c,1))}return t.length>0?this:void 0}get names(){return this.nodes.reduce(((e,a)=>k(e,a.names)),{})}}class g extends p{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class m extends p{}class x extends g{}x.kind="else";class y extends g{constructor(e,a){super(a),this.condition=e}render(e){let a=`if(${this.condition})`+super.render(e);return this.else&&(a+="else "+this.else.render(e)),a}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let a=this.else;if(a){const e=a.optimizeNodes();a=this.else=Array.isArray(e)?new x(e):e}return a?!1===e?a instanceof y?a:a.nodes:this.nodes.length?this:new y(N(e),a instanceof y?[a]:a.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,a){var t;if(this.else=null===(t=this.else)||void 0===t?void 0:t.optimizeNames(e,a),super.optimizeNames(e,a)||this.else)return this.condition=S(this.condition,e,a),this}get names(){const e=super.names;return L(e,this.condition),this.else&&k(e,this.else.names),e}}y.kind="if";class A extends g{}A.kind="for";class v extends A{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,a){if(super.optimizeNames(e,a))return this.iteration=S(this.iteration,e,a),this}get names(){return k(super.names,this.iteration.names)}}class w extends A{constructor(e,a,t,c){super(),this.varKind=e,this.name=a,this.from=t,this.to=c}render(e){const a=e.es5?f.varKinds.var:this.varKind,{name:t,from:c,to:d}=this;return`for(${a} ${t}=${c}; ${t}<${d}; ${t}++)`+super.render(e)}get names(){const e=L(super.names,this.from);return L(e,this.to)}}class _ extends A{constructor(e,a,t,c){super(),this.loop=e,this.varKind=a,this.name=t,this.iterable=c}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,a){if(super.optimizeNames(e,a))return this.iterable=S(this.iterable,e,a),this}get names(){return k(super.names,this.iterable.names)}}class I extends g{constructor(e,a,t){super(),this.name=e,this.args=a,this.async=t}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}I.kind="func";class E extends p{render(e){return"return "+super.render(e)}}E.kind="return";class C extends g{render(e){let a="try"+super.render(e);return this.catch&&(a+=this.catch.render(e)),this.finally&&(a+=this.finally.render(e)),a}optimizeNodes(){var e,a;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(a=this.finally)||void 0===a||a.optimizeNodes(),this}optimizeNames(e,a){var t,c;return super.optimizeNames(e,a),null===(t=this.catch)||void 0===t||t.optimizeNames(e,a),null===(c=this.finally)||void 0===c||c.optimizeNames(e,a),this}get names(){const e=super.names;return this.catch&&k(e,this.catch.names),this.finally&&k(e,this.finally.names),e}}class M extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}M.kind="catch";class B extends g{render(e){return"finally"+super.render(e)}}function k(e,a){for(const t in a)e[t]=(e[t]||0)+(a[t]||0);return e}function L(e,a){return a instanceof c._CodeOrName?k(e,a.names):e}function S(e,a,t){return e instanceof c.Name?d(e):(f=e)instanceof c._Code&&f._items.some((e=>e instanceof c.Name&&1===a[e.str]&&void 0!==t[e.str]))?new c._Code(e._items.reduce(((e,a)=>(a instanceof c.Name&&(a=d(a)),a instanceof c._Code?e.push(...a._items):e.push(a),e)),[])):e;var f;function d(e){const c=t[e.str];return void 0===c||1!==a[e.str]?e:(delete a[e.str],c)}}function T(e,a){for(const t in a)e[t]=(e[t]||0)-(a[t]||0)}function N(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:c._`!${O(e)}`}B.kind="finally",a.CodeGen=class{constructor(e,a={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...a,_n:a.lines?"\n":""},this._extScope=e,this._scope=new f.Scope({parent:e}),this._nodes=[new m]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,a){const t=this._extScope.value(e,a);return(this._values[t.prefix]||(this._values[t.prefix]=new Set)).add(t),t}getScopeValue(e,a){return this._extScope.getValue(e,a)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,a,t,c){const f=this._scope.toName(a);return void 0!==t&&c&&(this._constants[f.str]=t),this._leafNode(new i(e,f,t)),f}const(e,a,t){return this._def(f.varKinds.const,e,a,t)}let(e,a,t){return this._def(f.varKinds.let,e,a,t)}var(e,a,t){return this._def(f.varKinds.var,e,a,t)}assign(e,a,t){return this._leafNode(new b(e,a,t))}add(e,t){return this._leafNode(new o(e,a.operators.ADD,t))}code(e){return"function"==typeof e?e():e!==c.nil&&this._leafNode(new h(e)),this}object(...e){const a=["{"];for(const[t,f]of e)a.length>1&&a.push(","),a.push(t),(t!==f||this.opts.es5)&&(a.push(":"),(0,c.addCodeArg)(a,f));return a.push("}"),new c._Code(a)}if(e,a,t){if(this._blockNode(new y(e)),a&&t)this.code(a).else().code(t).endIf();else if(a)this.code(a).endIf();else if(t)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new y(e))}else(){return this._elseNode(new x)}endIf(){return this._endBlockNode(y,x)}_for(e,a){return this._blockNode(e),a&&this.code(a).endFor(),this}for(e,a){return this._for(new v(e),a)}forRange(e,a,t,c,d=(this.opts.es5?f.varKinds.var:f.varKinds.let)){const r=this._scope.toName(e);return this._for(new w(d,r,a,t),(()=>c(r)))}forOf(e,a,t,d=f.varKinds.const){const r=this._scope.toName(e);if(this.opts.es5){const e=a instanceof c.Name?a:this.var("_arr",a);return this.forRange("_i",0,c._`${e}.length`,(a=>{this.var(r,c._`${e}[${a}]`),t(r)}))}return this._for(new _("of",d,r,a),(()=>t(r)))}forIn(e,a,t,d=(this.opts.es5?f.varKinds.var:f.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,c._`Object.keys(${a})`,t);const r=this._scope.toName(e);return this._for(new _("in",d,r,a),(()=>t(r)))}endFor(){return this._endBlockNode(A)}label(e){return this._leafNode(new s(e))}break(e){return this._leafNode(new l(e))}return(e){const a=new E;if(this._blockNode(a),this.code(e),1!==a.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(e,a,t){if(!a&&!t)throw new Error('CodeGen: "try" without "catch" and "finally"');const c=new C;if(this._blockNode(c),this.code(e),a){const e=this.name("e");this._currNode=c.catch=new M(e),a(e)}return t&&(this._currNode=c.finally=new B,this.code(t)),this._endBlockNode(M,B)}throw(e){return this._leafNode(new u(e))}block(e,a){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(a),this}endBlock(e){const a=this._blockStarts.pop();if(void 0===a)throw new Error("CodeGen: not in self-balancing block");const t=this._nodes.length-a;if(t<0||void 0!==e&&t!==e)throw new Error(`CodeGen: wrong number of nodes: ${t} vs ${e} expected`);return this._nodes.length=a,this}func(e,a=c.nil,t,f){return this._blockNode(new I(e,a,t)),f&&this.code(f).endFunc(),this}endFunc(){return this._endBlockNode(I)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,a){const t=this._currNode;if(t instanceof e||a&&t instanceof a)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${a?`${e.kind}/${a.kind}`:e.kind}"`)}_elseNode(e){const a=this._currNode;if(!(a instanceof y))throw new Error('CodeGen: "else" without "if"');return this._currNode=a.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const a=this._nodes;a[a.length-1]=e}},a.not=N;const R=D(a.operators.AND);a.and=function(...e){return e.reduce(R)};const P=D(a.operators.OR);function D(e){return(a,t)=>a===c.nil?t:t===c.nil?a:c._`${O(a)} ${e} ${O(t)}`}function O(e){return e instanceof c.Name?e:c._`(${e})`}a.or=function(...e){return e.reduce(P)}},57845:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.ValueScope=a.ValueScopeName=a.Scope=a.varKinds=a.UsedValueState=void 0;const c=t(41520);class f extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var d;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(d||(a.UsedValueState=d={})),a.varKinds={const:new c.Name("const"),let:new c.Name("let"),var:new c.Name("var")};class r{constructor({prefixes:e,parent:a}={}){this._names={},this._prefixes=e,this._parent=a}toName(e){return e instanceof c.Name?e:this.name(e)}name(e){return new c.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var a,t;if((null===(t=null===(a=this._parent)||void 0===a?void 0:a._prefixes)||void 0===t?void 0:t.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}a.Scope=r;class n extends c.Name{constructor(e,a){super(a),this.prefix=e}setValue(e,{property:a,itemIndex:t}){this.value=e,this.scopePath=c._`.${new c.Name(a)}[${t}]`}}a.ValueScopeName=n;const i=c._`\n`;a.ValueScope=class extends r{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?i:c.nil}}get(){return this._scope}name(e){return new n(e,this._newName(e))}value(e,a){var t;if(void 0===a.ref)throw new Error("CodeGen: ref must be passed in value");const c=this.toName(e),{prefix:f}=c,d=null!==(t=a.key)&&void 0!==t?t:a.ref;let r=this._values[f];if(r){const e=r.get(d);if(e)return e}else r=this._values[f]=new Map;r.set(d,c);const n=this._scope[f]||(this._scope[f]=[]),i=n.length;return n[i]=a.ref,c.setValue(a,{property:f,itemIndex:i}),c}getValue(e,a){const t=this._values[e];if(t)return t.get(a)}scopeRefs(e,a=this._values){return this._reduceValues(a,(a=>{if(void 0===a.scopePath)throw new Error(`CodeGen: name "${a}" has no value`);return c._`${e}${a.scopePath}`}))}scopeCode(e=this._values,a,t){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),a,t)}_reduceValues(e,t,r={},n){let i=c.nil;for(const b in e){const o=e[b];if(!o)continue;const s=r[b]=r[b]||new Map;o.forEach((e=>{if(s.has(e))return;s.set(e,d.Started);let r=t(e);if(r){const t=this.opts.es5?a.varKinds.var:a.varKinds.const;i=c._`${i}${t} ${e} = ${r};${this.opts._n}`}else{if(!(r=null==n?void 0:n(e)))throw new f(e);i=c._`${i}${r}${this.opts._n}`}s.set(e,d.Completed)}))}return i}}},48708:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.extendErrors=a.resetErrorsCount=a.reportExtraError=a.reportError=a.keyword$DataError=a.keywordError=void 0;const c=t(99029),f=t(94227),d=t(42023);function r(e,a){const t=e.const("err",a);e.if(c._`${d.default.vErrors} === null`,(()=>e.assign(d.default.vErrors,c._`[${t}]`)),c._`${d.default.vErrors}.push(${t})`),e.code(c._`${d.default.errors}++`)}function n(e,a){const{gen:t,validateName:f,schemaEnv:d}=e;d.$async?t.throw(c._`new ${e.ValidationError}(${a})`):(t.assign(c._`${f}.errors`,a),t.return(!1))}a.keywordError={message:({keyword:e})=>c.str`must pass "${e}" keyword validation`},a.keyword$DataError={message:({keyword:e,schemaType:a})=>a?c.str`"${e}" keyword must be ${a} ($data)`:c.str`"${e}" keyword is invalid ($data)`},a.reportError=function(e,t=a.keywordError,f,d){const{it:i}=e,{gen:o,compositeRule:s,allErrors:l}=i,u=b(e,t,f);(null!=d?d:s||l)?r(o,u):n(i,c._`[${u}]`)},a.reportExtraError=function(e,t=a.keywordError,c){const{it:f}=e,{gen:i,compositeRule:o,allErrors:s}=f;r(i,b(e,t,c)),o||s||n(f,d.default.vErrors)},a.resetErrorsCount=function(e,a){e.assign(d.default.errors,a),e.if(c._`${d.default.vErrors} !== null`,(()=>e.if(a,(()=>e.assign(c._`${d.default.vErrors}.length`,a)),(()=>e.assign(d.default.vErrors,null)))))},a.extendErrors=function({gen:e,keyword:a,schemaValue:t,data:f,errsCount:r,it:n}){if(void 0===r)throw new Error("ajv implementation error");const i=e.name("err");e.forRange("i",r,d.default.errors,(r=>{e.const(i,c._`${d.default.vErrors}[${r}]`),e.if(c._`${i}.instancePath === undefined`,(()=>e.assign(c._`${i}.instancePath`,(0,c.strConcat)(d.default.instancePath,n.errorPath)))),e.assign(c._`${i}.schemaPath`,c.str`${n.errSchemaPath}/${a}`),n.opts.verbose&&(e.assign(c._`${i}.schema`,t),e.assign(c._`${i}.data`,f))}))};const i={keyword:new c.Name("keyword"),schemaPath:new c.Name("schemaPath"),params:new c.Name("params"),propertyName:new c.Name("propertyName"),message:new c.Name("message"),schema:new c.Name("schema"),parentSchema:new c.Name("parentSchema")};function b(e,a,t){const{createErrors:f}=e.it;return!1===f?c._`{}`:function(e,a,t={}){const{gen:f,it:r}=e,n=[o(r,t),s(e,t)];return function(e,{params:a,message:t},f){const{keyword:r,data:n,schemaValue:b,it:o}=e,{opts:s,propertyName:l,topSchemaRef:u,schemaPath:h}=o;f.push([i.keyword,r],[i.params,"function"==typeof a?a(e):a||c._`{}`]),s.messages&&f.push([i.message,"function"==typeof t?t(e):t]),s.verbose&&f.push([i.schema,b],[i.parentSchema,c._`${u}${h}`],[d.default.data,n]),l&&f.push([i.propertyName,l])}(e,a,n),f.object(...n)}(e,a,t)}function o({errorPath:e},{instancePath:a}){const t=a?c.str`${e}${(0,f.getErrorPath)(a,f.Type.Str)}`:e;return[d.default.instancePath,(0,c.strConcat)(d.default.instancePath,t)]}function s({keyword:e,it:{errSchemaPath:a}},{schemaPath:t,parentSchema:d}){let r=d?a:c.str`${a}/${e}`;return t&&(r=c.str`${r}${(0,f.getErrorPath)(t,f.Type.Str)}`),[i.schemaPath,r]}},73835:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.resolveSchema=a.getCompilingSchema=a.resolveRef=a.compileSchema=a.SchemaEnv=void 0;const c=t(99029),f=t(13558),d=t(42023),r=t(66939),n=t(94227),i=t(62586);class b{constructor(e){var a;let t;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(t=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(a=e.baseId)&&void 0!==a?a:(0,r.normalizeId)(null==t?void 0:t[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==t?void 0:t.$async,this.refs={}}}function o(e){const a=l.call(this,e);if(a)return a;const t=(0,r.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:b}=this.opts.code,{ownProperties:o}=this.opts,s=new c.CodeGen(this.scope,{es5:n,lines:b,ownProperties:o});let u;e.$async&&(u=s.scopeValue("Error",{ref:f.default,code:c._`require("ajv/dist/runtime/validation_error").default`}));const h=s.scopeName("validate");e.validateName=h;const p={gen:s,allErrors:this.opts.allErrors,data:d.default.data,parentData:d.default.parentData,parentDataProperty:d.default.parentDataProperty,dataNames:[d.default.data],dataPathArr:[c.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,c.stringify)(e.schema)}:{ref:e.schema}),validateName:h,ValidationError:u,schema:e.schema,schemaEnv:e,rootId:t,baseId:e.baseId||t,schemaPath:c.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:c._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(e),(0,i.validateFunctionCode)(p),s.optimize(this.opts.code.optimize);const a=s.toString();g=`${s.scopeRefs(d.default.scope)}return ${a}`,this.opts.code.process&&(g=this.opts.code.process(g,e));const t=new Function(`${d.default.self}`,`${d.default.scope}`,g)(this,this.scope.get());if(this.scope.value(h,{ref:t}),t.errors=null,t.schema=e.schema,t.schemaEnv=e,e.$async&&(t.$async=!0),!0===this.opts.code.source&&(t.source={validateName:h,validateCode:a,scopeValues:s._values}),this.opts.unevaluated){const{props:e,items:a}=p;t.evaluated={props:e instanceof c.Name?void 0:e,items:a instanceof c.Name?void 0:a,dynamicProps:e instanceof c.Name,dynamicItems:a instanceof c.Name},t.source&&(t.source.evaluated=(0,c.stringify)(t.evaluated))}return e.validate=t,e}catch(a){throw delete e.validate,delete e.validateName,g&&this.logger.error("Error compiling schema, function code:",g),a}finally{this._compilations.delete(e)}}function s(e){return(0,r.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:o.call(this,e)}function l(e){for(const c of this._compilations)if(t=e,(a=c).schema===t.schema&&a.root===t.root&&a.baseId===t.baseId)return c;var a,t}function u(e,a){let t;for(;"string"==typeof(t=this.refs[a]);)a=t;return t||this.schemas[a]||h.call(this,e,a)}function h(e,a){const t=this.opts.uriResolver.parse(a),c=(0,r._getFullPath)(this.opts.uriResolver,t);let f=(0,r.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&c===f)return g.call(this,t,e);const d=(0,r.normalizeId)(c),n=this.refs[d]||this.schemas[d];if("string"==typeof n){const a=h.call(this,e,n);if("object"!=typeof(null==a?void 0:a.schema))return;return g.call(this,t,a)}if("object"==typeof(null==n?void 0:n.schema)){if(n.validate||o.call(this,n),d===(0,r.normalizeId)(a)){const{schema:a}=n,{schemaId:t}=this.opts,c=a[t];return c&&(f=(0,r.resolveUrl)(this.opts.uriResolver,f,c)),new b({schema:a,schemaId:t,root:e,baseId:f})}return g.call(this,t,n)}}a.SchemaEnv=b,a.compileSchema=o,a.resolveRef=function(e,a,t){var c;t=(0,r.resolveUrl)(this.opts.uriResolver,a,t);const f=e.refs[t];if(f)return f;let d=u.call(this,e,t);if(void 0===d){const f=null===(c=e.localRefs)||void 0===c?void 0:c[t],{schemaId:r}=this.opts;f&&(d=new b({schema:f,schemaId:r,root:e,baseId:a}))}return void 0!==d?e.refs[t]=s.call(this,d):void 0},a.getCompilingSchema=l,a.resolveSchema=h;const p=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function g(e,{baseId:a,schema:t,root:c}){var f;if("/"!==(null===(f=e.fragment)||void 0===f?void 0:f[0]))return;for(const c of e.fragment.slice(1).split("/")){if("boolean"==typeof t)return;const e=t[(0,n.unescapeFragment)(c)];if(void 0===e)return;const f="object"==typeof(t=e)&&t[this.opts.schemaId];!p.has(c)&&f&&(a=(0,r.resolveUrl)(this.opts.uriResolver,a,f))}let d;if("boolean"!=typeof t&&t.$ref&&!(0,n.schemaHasRulesButRef)(t,this.RULES)){const e=(0,r.resolveUrl)(this.opts.uriResolver,a,t.$ref);d=h.call(this,c,e)}const{schemaId:i}=this.opts;return d=d||new b({schema:t,schemaId:i,root:c,baseId:a}),d.schema!==d.root.schema?d:void 0}},42023:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f={data:new c.Name("data"),valCxt:new c.Name("valCxt"),instancePath:new c.Name("instancePath"),parentData:new c.Name("parentData"),parentDataProperty:new c.Name("parentDataProperty"),rootData:new c.Name("rootData"),dynamicAnchors:new c.Name("dynamicAnchors"),vErrors:new c.Name("vErrors"),errors:new c.Name("errors"),this:new c.Name("this"),self:new c.Name("self"),scope:new c.Name("scope"),json:new c.Name("json"),jsonPos:new c.Name("jsonPos"),jsonLen:new c.Name("jsonLen"),jsonPart:new c.Name("jsonPart")};a.default=f},34551:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(66939);class f extends Error{constructor(e,a,t,f){super(f||`can't resolve reference ${t} from id ${a}`),this.missingRef=(0,c.resolveUrl)(e,a,t),this.missingSchema=(0,c.normalizeId)((0,c.getFullPath)(e,this.missingRef))}}a.default=f},66939:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.getSchemaRefs=a.resolveUrl=a.normalizeId=a._getFullPath=a.getFullPath=a.inlineRef=void 0;const c=t(94227),f=t(32017),d=t(7106),r=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);a.inlineRef=function(e,a=!0){return"boolean"==typeof e||(!0===a?!i(e):!!a&&b(e)<=a)};const n=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function i(e){for(const a in e){if(n.has(a))return!0;const t=e[a];if(Array.isArray(t)&&t.some(i))return!0;if("object"==typeof t&&i(t))return!0}return!1}function b(e){let a=0;for(const t in e){if("$ref"===t)return 1/0;if(a++,!r.has(t)&&("object"==typeof e[t]&&(0,c.eachItem)(e[t],(e=>a+=b(e))),a===1/0))return 1/0}return a}function o(e,a="",t){!1!==t&&(a=u(a));const c=e.parse(a);return s(e,c)}function s(e,a){return e.serialize(a).split("#")[0]+"#"}a.getFullPath=o,a._getFullPath=s;const l=/#\/?$/;function u(e){return e?e.replace(l,""):""}a.normalizeId=u,a.resolveUrl=function(e,a,t){return t=u(t),e.resolve(a,t)};const h=/^[a-z_][-a-z0-9._]*$/i;a.getSchemaRefs=function(e,a){if("boolean"==typeof e)return{};const{schemaId:t,uriResolver:c}=this.opts,r=u(e[t]||a),n={"":r},i=o(c,r,!1),b={},s=new Set;return d(e,{allKeys:!0},((e,a,c,f)=>{if(void 0===f)return;const d=i+a;let r=n[f];function o(a){const t=this.opts.uriResolver.resolve;if(a=u(r?t(r,a):a),s.has(a))throw p(a);s.add(a);let c=this.refs[a];return"string"==typeof c&&(c=this.refs[c]),"object"==typeof c?l(e,c.schema,a):a!==u(d)&&("#"===a[0]?(l(e,b[a],a),b[a]=e):this.refs[a]=d),a}function g(e){if("string"==typeof e){if(!h.test(e))throw new Error(`invalid anchor "${e}"`);o.call(this,`#${e}`)}}"string"==typeof e[t]&&(r=o.call(this,e[t])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),n[a]=r})),b;function l(e,a,t){if(void 0!==a&&!f(e,a))throw p(t)}function p(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},10396:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.getRules=a.isJSONType=void 0;const t=new Set(["string","number","integer","boolean","null","object","array"]);a.isJSONType=function(e){return"string"==typeof e&&t.has(e)},a.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},94227:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.checkStrictMode=a.getErrorPath=a.Type=a.useFunc=a.setEvaluated=a.evaluatedPropsToName=a.mergeEvaluated=a.eachItem=a.unescapeJsonPointer=a.escapeJsonPointer=a.escapeFragment=a.unescapeFragment=a.schemaRefOrVal=a.schemaHasRulesButRef=a.schemaHasRules=a.checkUnknownRules=a.alwaysValidSchema=a.toHash=void 0;const c=t(99029),f=t(41520);function d(e,a=e.schema){const{opts:t,self:c}=e;if(!t.strictSchema)return;if("boolean"==typeof a)return;const f=c.RULES.keywords;for(const t in a)f[t]||h(e,`unknown keyword: "${t}"`)}function r(e,a){if("boolean"==typeof e)return!e;for(const t in e)if(a[t])return!0;return!1}function n(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function i(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function b({mergeNames:e,mergeToName:a,mergeValues:t,resultToName:f}){return(d,r,n,i)=>{const b=void 0===n?r:n instanceof c.Name?(r instanceof c.Name?e(d,r,n):a(d,r,n),n):r instanceof c.Name?(a(d,n,r),r):t(r,n);return i!==c.Name||b instanceof c.Name?b:f(d,b)}}function o(e,a){if(!0===a)return e.var("props",!0);const t=e.var("props",c._`{}`);return void 0!==a&&s(e,t,a),t}function s(e,a,t){Object.keys(t).forEach((t=>e.assign(c._`${a}${(0,c.getProperty)(t)}`,!0)))}a.toHash=function(e){const a={};for(const t of e)a[t]=!0;return a},a.alwaysValidSchema=function(e,a){return"boolean"==typeof a?a:0===Object.keys(a).length||(d(e,a),!r(a,e.self.RULES.all))},a.checkUnknownRules=d,a.schemaHasRules=r,a.schemaHasRulesButRef=function(e,a){if("boolean"==typeof e)return!e;for(const t in e)if("$ref"!==t&&a.all[t])return!0;return!1},a.schemaRefOrVal=function({topSchemaRef:e,schemaPath:a},t,f,d){if(!d){if("number"==typeof t||"boolean"==typeof t)return t;if("string"==typeof t)return c._`${t}`}return c._`${e}${a}${(0,c.getProperty)(f)}`},a.unescapeFragment=function(e){return i(decodeURIComponent(e))},a.escapeFragment=function(e){return encodeURIComponent(n(e))},a.escapeJsonPointer=n,a.unescapeJsonPointer=i,a.eachItem=function(e,a){if(Array.isArray(e))for(const t of e)a(t);else a(e)},a.mergeEvaluated={props:b({mergeNames:(e,a,t)=>e.if(c._`${t} !== true && ${a} !== undefined`,(()=>{e.if(c._`${a} === true`,(()=>e.assign(t,!0)),(()=>e.assign(t,c._`${t} || {}`).code(c._`Object.assign(${t}, ${a})`)))})),mergeToName:(e,a,t)=>e.if(c._`${t} !== true`,(()=>{!0===a?e.assign(t,!0):(e.assign(t,c._`${t} || {}`),s(e,t,a))})),mergeValues:(e,a)=>!0===e||{...e,...a},resultToName:o}),items:b({mergeNames:(e,a,t)=>e.if(c._`${t} !== true && ${a} !== undefined`,(()=>e.assign(t,c._`${a} === true ? true : ${t} > ${a} ? ${t} : ${a}`))),mergeToName:(e,a,t)=>e.if(c._`${t} !== true`,(()=>e.assign(t,!0===a||c._`${t} > ${a} ? ${t} : ${a}`))),mergeValues:(e,a)=>!0===e||Math.max(e,a),resultToName:(e,a)=>e.var("items",a)})},a.evaluatedPropsToName=o,a.setEvaluated=s;const l={};var u;function h(e,a,t=e.opts.strictSchema){if(t){if(a=`strict mode: ${a}`,!0===t)throw new Error(a);e.self.logger.warn(a)}}a.useFunc=function(e,a){return e.scopeValue("func",{ref:a,code:l[a.code]||(l[a.code]=new f._Code(a.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(u||(a.Type=u={})),a.getErrorPath=function(e,a,t){if(e instanceof c.Name){const f=a===u.Num;return t?f?c._`"[" + ${e} + "]"`:c._`"['" + ${e} + "']"`:f?c._`"/" + ${e}`:c._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return t?(0,c.getProperty)(e).toString():"/"+n(e)},a.checkStrictMode=h},7887:(e,a)=>{"use strict";function t(e,a){return a.rules.some((a=>c(e,a)))}function c(e,a){var t;return void 0!==e[a.keyword]||(null===(t=a.definition.implements)||void 0===t?void 0:t.some((a=>void 0!==e[a])))}Object.defineProperty(a,"__esModule",{value:!0}),a.shouldUseRule=a.shouldUseGroup=a.schemaHasRulesForType=void 0,a.schemaHasRulesForType=function({schema:e,self:a},c){const f=a.RULES.types[c];return f&&!0!==f&&t(e,f)},a.shouldUseGroup=t,a.shouldUseRule=c},28727:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.boolOrEmptySchema=a.topBoolOrEmptySchema=void 0;const c=t(48708),f=t(99029),d=t(42023),r={message:"boolean schema is false"};function n(e,a){const{gen:t,data:f}=e,d={gen:t,keyword:"false schema",data:f,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,c.reportError)(d,r,void 0,a)}a.topBoolOrEmptySchema=function(e){const{gen:a,schema:t,validateName:c}=e;!1===t?n(e,!1):"object"==typeof t&&!0===t.$async?a.return(d.default.data):(a.assign(f._`${c}.errors`,null),a.return(!0))},a.boolOrEmptySchema=function(e,a){const{gen:t,schema:c}=e;!1===c?(t.var(a,!1),n(e)):t.var(a,!0)}},10208:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.reportTypeError=a.checkDataTypes=a.checkDataType=a.coerceAndCheckDataType=a.getJSONTypes=a.getSchemaTypes=a.DataType=void 0;const c=t(10396),f=t(7887),d=t(48708),r=t(99029),n=t(94227);var i;function b(e){const a=Array.isArray(e)?e:e?[e]:[];if(a.every(c.isJSONType))return a;throw new Error("type must be JSONType or JSONType[]: "+a.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(i||(a.DataType=i={})),a.getSchemaTypes=function(e){const a=b(e.type);if(a.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!a.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&a.push("null")}return a},a.getJSONTypes=b,a.coerceAndCheckDataType=function(e,a){const{gen:t,data:c,opts:d}=e,n=function(e,a){return a?e.filter((e=>o.has(e)||"array"===a&&"array"===e)):[]}(a,d.coerceTypes),b=a.length>0&&!(0===n.length&&1===a.length&&(0,f.schemaHasRulesForType)(e,a[0]));if(b){const f=l(a,c,d.strictNumbers,i.Wrong);t.if(f,(()=>{n.length?function(e,a,t){const{gen:c,data:f,opts:d}=e,n=c.let("dataType",r._`typeof ${f}`),i=c.let("coerced",r._`undefined`);"array"===d.coerceTypes&&c.if(r._`${n} == 'object' && Array.isArray(${f}) && ${f}.length == 1`,(()=>c.assign(f,r._`${f}[0]`).assign(n,r._`typeof ${f}`).if(l(a,f,d.strictNumbers),(()=>c.assign(i,f))))),c.if(r._`${i} !== undefined`);for(const e of t)(o.has(e)||"array"===e&&"array"===d.coerceTypes)&&b(e);function b(e){switch(e){case"string":return void c.elseIf(r._`${n} == "number" || ${n} == "boolean"`).assign(i,r._`"" + ${f}`).elseIf(r._`${f} === null`).assign(i,r._`""`);case"number":return void c.elseIf(r._`${n} == "boolean" || ${f} === null || (${n} == "string" && ${f} && ${f} == +${f})`).assign(i,r._`+${f}`);case"integer":return void c.elseIf(r._`${n} === "boolean" || ${f} === null || (${n} === "string" && ${f} && ${f} == +${f} && !(${f} % 1))`).assign(i,r._`+${f}`);case"boolean":return void c.elseIf(r._`${f} === "false" || ${f} === 0 || ${f} === null`).assign(i,!1).elseIf(r._`${f} === "true" || ${f} === 1`).assign(i,!0);case"null":return c.elseIf(r._`${f} === "" || ${f} === 0 || ${f} === false`),void c.assign(i,null);case"array":c.elseIf(r._`${n} === "string" || ${n} === "number" - || ${n} === "boolean" || ${f} === null`).assign(i,r._`[${f}]`)}}c.else(),h(e),c.endIf(),c.if(r._`${i} !== undefined`,(()=>{c.assign(f,i),function({gen:e,parentData:a,parentDataProperty:t},c){e.if(r._`${a} !== undefined`,(()=>e.assign(r._`${a}[${t}]`,c)))}(e,i)}))}(e,a,n):h(e)}))}return b};const o=new Set(["string","number","integer","boolean","null"]);function s(e,a,t,c=i.Correct){const f=c===i.Correct?r.operators.EQ:r.operators.NEQ;let d;switch(e){case"null":return r._`${a} ${f} null`;case"array":d=r._`Array.isArray(${a})`;break;case"object":d=r._`${a} && typeof ${a} == "object" && !Array.isArray(${a})`;break;case"integer":d=n(r._`!(${a} % 1) && !isNaN(${a})`);break;case"number":d=n();break;default:return r._`typeof ${a} ${f} ${e}`}return c===i.Correct?d:(0,r.not)(d);function n(e=r.nil){return(0,r.and)(r._`typeof ${a} == "number"`,e,t?r._`isFinite(${a})`:r.nil)}}function l(e,a,t,c){if(1===e.length)return s(e[0],a,t,c);let f;const d=(0,n.toHash)(e);if(d.array&&d.object){const e=r._`typeof ${a} != "object"`;f=d.null?e:r._`!${a} || ${e}`,delete d.null,delete d.array,delete d.object}else f=r.nil;d.number&&delete d.integer;for(const e in d)f=(0,r.and)(f,s(e,a,t,c));return f}a.checkDataType=s,a.checkDataTypes=l;const u={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:a})=>"string"==typeof e?r._`{type: ${e}}`:r._`{type: ${a}}`};function h(e){const a=function(e){const{gen:a,data:t,schema:c}=e,f=(0,n.schemaRefOrVal)(e,c,"type");return{gen:a,keyword:"type",data:t,schema:c.type,schemaCode:f,schemaValue:f,parentSchema:c,params:{},it:e}}(e);(0,d.reportError)(a,u)}a.reportTypeError=h},7870:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.assignDefaults=void 0;const c=t(99029),f=t(94227);function d(e,a,t){const{gen:d,compositeRule:r,data:n,opts:i}=e;if(void 0===t)return;const b=c._`${n}${(0,c.getProperty)(a)}`;if(r)return void(0,f.checkStrictMode)(e,`default is ignored for: ${b}`);let o=c._`${b} === undefined`;"empty"===i.useDefaults&&(o=c._`${o} || ${b} === null || ${b} === ""`),d.if(o,c._`${b} = ${(0,c.stringify)(t)}`)}a.assignDefaults=function(e,a){const{properties:t,items:c}=e.schema;if("object"===a&&t)for(const a in t)d(e,a,t[a].default);else"array"===a&&Array.isArray(c)&&c.forEach(((a,t)=>d(e,t,a.default)))}},62586:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.getData=a.KeywordCxt=a.validateFunctionCode=void 0;const c=t(28727),f=t(10208),d=t(7887),r=t(10208),n=t(7870),i=t(33673),b=t(24495),o=t(99029),s=t(42023),l=t(66939),u=t(94227),h=t(48708);function p({gen:e,validateName:a,schema:t,schemaEnv:c,opts:f},d){f.code.es5?e.func(a,o._`${s.default.data}, ${s.default.valCxt}`,c.$async,(()=>{e.code(o._`"use strict"; ${g(t,f)}`),function(e,a){e.if(s.default.valCxt,(()=>{e.var(s.default.instancePath,o._`${s.default.valCxt}.${s.default.instancePath}`),e.var(s.default.parentData,o._`${s.default.valCxt}.${s.default.parentData}`),e.var(s.default.parentDataProperty,o._`${s.default.valCxt}.${s.default.parentDataProperty}`),e.var(s.default.rootData,o._`${s.default.valCxt}.${s.default.rootData}`),a.dynamicRef&&e.var(s.default.dynamicAnchors,o._`${s.default.valCxt}.${s.default.dynamicAnchors}`)}),(()=>{e.var(s.default.instancePath,o._`""`),e.var(s.default.parentData,o._`undefined`),e.var(s.default.parentDataProperty,o._`undefined`),e.var(s.default.rootData,s.default.data),a.dynamicRef&&e.var(s.default.dynamicAnchors,o._`{}`)}))}(e,f),e.code(d)})):e.func(a,o._`${s.default.data}, ${function(e){return o._`{${s.default.instancePath}="", ${s.default.parentData}, ${s.default.parentDataProperty}, ${s.default.rootData}=${s.default.data}${e.dynamicRef?o._`, ${s.default.dynamicAnchors}={}`:o.nil}}={}`}(f)}`,c.$async,(()=>e.code(g(t,f)).code(d)))}function g(e,a){const t="object"==typeof e&&e[a.schemaId];return t&&(a.code.source||a.code.process)?o._`/*# sourceURL=${t} */`:o.nil}function m({schema:e,self:a}){if("boolean"==typeof e)return!e;for(const t in e)if(a.RULES.all[t])return!0;return!1}function y(e){return"boolean"!=typeof e.schema}function x(e){(0,u.checkUnknownRules)(e),function(e){const{schema:a,errSchemaPath:t,opts:c,self:f}=e;a.$ref&&c.ignoreKeywordsWithRef&&(0,u.schemaHasRulesButRef)(a,f.RULES)&&f.logger.warn(`$ref: keywords ignored in schema at path "${t}"`)}(e)}function A(e,a){if(e.opts.jtd)return w(e,[],!1,a);const t=(0,f.getSchemaTypes)(e.schema);w(e,t,!(0,f.coerceAndCheckDataType)(e,t),a)}function v({gen:e,schemaEnv:a,schema:t,errSchemaPath:c,opts:f}){const d=t.$comment;if(!0===f.$comment)e.code(o._`${s.default.self}.logger.log(${d})`);else if("function"==typeof f.$comment){const t=o.str`${c}/$comment`,f=e.scopeValue("root",{ref:a.root});e.code(o._`${s.default.self}.opts.$comment(${d}, ${t}, ${f}.schema)`)}}function w(e,a,t,c){const{gen:f,schema:n,data:i,allErrors:b,opts:l,self:h}=e,{RULES:p}=h;function g(u){(0,d.shouldUseGroup)(n,u)&&(u.type?(f.if((0,r.checkDataType)(u.type,i,l.strictNumbers)),_(e,u),1===a.length&&a[0]===u.type&&t&&(f.else(),(0,r.reportTypeError)(e)),f.endIf()):_(e,u),b||f.if(o._`${s.default.errors} === ${c||0}`))}!n.$ref||!l.ignoreKeywordsWithRef&&(0,u.schemaHasRulesButRef)(n,p)?(l.jtd||function(e,a){!e.schemaEnv.meta&&e.opts.strictTypes&&(function(e,a){a.length&&(e.dataTypes.length?(a.forEach((a=>{I(e.dataTypes,a)||E(e,`type "${a}" not allowed by context "${e.dataTypes.join(",")}"`)})),function(e,a){const t=[];for(const c of e.dataTypes)I(a,c)?t.push(c):a.includes("integer")&&"number"===c&&t.push("integer");e.dataTypes=t}(e,a)):e.dataTypes=a)}(e,a),e.opts.allowUnionTypes||function(e,a){a.length>1&&(2!==a.length||!a.includes("null"))&&E(e,"use allowUnionTypes to allow union type keyword")}(e,a),function(e,a){const t=e.self.RULES.all;for(const c in t){const f=t[c];if("object"==typeof f&&(0,d.shouldUseRule)(e.schema,f)){const{type:t}=f.definition;t.length&&!t.some((e=>{return c=e,(t=a).includes(c)||"number"===c&&t.includes("integer");var t,c}))&&E(e,`missing type "${t.join(",")}" for keyword "${c}"`)}}}(e,e.dataTypes))}(e,a),f.block((()=>{for(const e of p.rules)g(e);g(p.post)}))):f.block((()=>M(e,"$ref",p.all.$ref.definition)))}function _(e,a){const{gen:t,schema:c,opts:{useDefaults:f}}=e;f&&(0,n.assignDefaults)(e,a.type),t.block((()=>{for(const t of a.rules)(0,d.shouldUseRule)(c,t)&&M(e,t.keyword,t.definition,a.type)}))}function I(e,a){return e.includes(a)||"integer"===a&&e.includes("number")}function E(e,a){a+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,u.checkStrictMode)(e,a,e.opts.strictTypes)}a.validateFunctionCode=function(e){y(e)&&(x(e),m(e))?function(e){const{schema:a,opts:t,gen:c}=e;p(e,(()=>{t.$comment&&a.$comment&&v(e),function(e){const{schema:a,opts:t}=e;void 0!==a.default&&t.useDefaults&&t.strictSchema&&(0,u.checkStrictMode)(e,"default is ignored in the schema root")}(e),c.let(s.default.vErrors,null),c.let(s.default.errors,0),t.unevaluated&&function(e){const{gen:a,validateName:t}=e;e.evaluated=a.const("evaluated",o._`${t}.evaluated`),a.if(o._`${e.evaluated}.dynamicProps`,(()=>a.assign(o._`${e.evaluated}.props`,o._`undefined`))),a.if(o._`${e.evaluated}.dynamicItems`,(()=>a.assign(o._`${e.evaluated}.items`,o._`undefined`)))}(e),A(e),function(e){const{gen:a,schemaEnv:t,validateName:c,ValidationError:f,opts:d}=e;t.$async?a.if(o._`${s.default.errors} === 0`,(()=>a.return(s.default.data)),(()=>a.throw(o._`new ${f}(${s.default.vErrors})`))):(a.assign(o._`${c}.errors`,s.default.vErrors),d.unevaluated&&function({gen:e,evaluated:a,props:t,items:c}){t instanceof o.Name&&e.assign(o._`${a}.props`,t),c instanceof o.Name&&e.assign(o._`${a}.items`,c)}(e),a.return(o._`${s.default.errors} === 0`))}(e)}))}(e):p(e,(()=>(0,c.topBoolOrEmptySchema)(e)))};class C{constructor(e,a,t){if((0,i.validateKeywordUsage)(e,a,t),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=t,this.data=e.data,this.schema=e.schema[t],this.$data=a.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,u.schemaRefOrVal)(e,this.schema,t,this.$data),this.schemaType=a.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=a,this.$data)this.schemaCode=e.gen.const("vSchema",L(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,a.schemaType,a.allowUndefined))throw new Error(`${t} value must be ${JSON.stringify(a.schemaType)}`);("code"in a?a.trackErrors:!1!==a.errors)&&(this.errsCount=e.gen.const("_errs",s.default.errors))}result(e,a,t){this.failResult((0,o.not)(e),a,t)}failResult(e,a,t){this.gen.if(e),t?t():this.error(),a?(this.gen.else(),a(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,a){this.failResult((0,o.not)(e),void 0,a)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:a}=this;this.fail(o._`${a} !== undefined && (${(0,o.or)(this.invalid$data(),e)})`)}error(e,a,t){if(a)return this.setParams(a),this._error(e,t),void this.setParams({});this._error(e,t)}_error(e,a){(e?h.reportExtraError:h.reportError)(this,this.def.error,a)}$dataError(){(0,h.reportError)(this,this.def.$dataError||h.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,h.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,a){a?Object.assign(this.params,e):this.params=e}block$data(e,a,t=o.nil){this.gen.block((()=>{this.check$data(e,t),a()}))}check$data(e=o.nil,a=o.nil){if(!this.$data)return;const{gen:t,schemaCode:c,schemaType:f,def:d}=this;t.if((0,o.or)(o._`${c} === undefined`,a)),e!==o.nil&&t.assign(e,!0),(f.length||d.validateSchema)&&(t.elseIf(this.invalid$data()),this.$dataError(),e!==o.nil&&t.assign(e,!1)),t.else()}invalid$data(){const{gen:e,schemaCode:a,schemaType:t,def:c,it:f}=this;return(0,o.or)(function(){if(t.length){if(!(a instanceof o.Name))throw new Error("ajv implementation error");const e=Array.isArray(t)?t:[t];return o._`${(0,r.checkDataTypes)(e,a,f.opts.strictNumbers,r.DataType.Wrong)}`}return o.nil}(),function(){if(c.validateSchema){const t=e.scopeValue("validate$data",{ref:c.validateSchema});return o._`!${t}(${a})`}return o.nil}())}subschema(e,a){const t=(0,b.getSubschema)(this.it,e);(0,b.extendSubschemaData)(t,this.it,e),(0,b.extendSubschemaMode)(t,e);const f={...this.it,...t,items:void 0,props:void 0};return function(e,a){y(e)&&(x(e),m(e))?function(e,a){const{schema:t,gen:c,opts:f}=e;f.$comment&&t.$comment&&v(e),function(e){const a=e.schema[e.opts.schemaId];a&&(e.baseId=(0,l.resolveUrl)(e.opts.uriResolver,e.baseId,a))}(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const d=c.const("_errs",s.default.errors);A(e,d),c.var(a,o._`${d} === ${s.default.errors}`)}(e,a):(0,c.boolOrEmptySchema)(e,a)}(f,a),f}mergeEvaluated(e,a){const{it:t,gen:c}=this;t.opts.unevaluated&&(!0!==t.props&&void 0!==e.props&&(t.props=u.mergeEvaluated.props(c,e.props,t.props,a)),!0!==t.items&&void 0!==e.items&&(t.items=u.mergeEvaluated.items(c,e.items,t.items,a)))}mergeValidEvaluated(e,a){const{it:t,gen:c}=this;if(t.opts.unevaluated&&(!0!==t.props||!0!==t.items))return c.if(a,(()=>this.mergeEvaluated(e,o.Name))),!0}}function M(e,a,t,c){const f=new C(e,t,a);"code"in t?t.code(f,c):f.$data&&t.validate?(0,i.funcKeywordCode)(f,t):"macro"in t?(0,i.macroKeywordCode)(f,t):(t.compile||t.validate)&&(0,i.funcKeywordCode)(f,t)}a.KeywordCxt=C;const B=/^\/(?:[^~]|~0|~1)*$/,k=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function L(e,{dataLevel:a,dataNames:t,dataPathArr:c}){let f,d;if(""===e)return s.default.rootData;if("/"===e[0]){if(!B.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);f=e,d=s.default.rootData}else{const r=k.exec(e);if(!r)throw new Error(`Invalid JSON-pointer: ${e}`);const n=+r[1];if(f=r[2],"#"===f){if(n>=a)throw new Error(i("property/index",n));return c[a-n]}if(n>a)throw new Error(i("data",n));if(d=t[a-n],!f)return d}let r=d;const n=f.split("/");for(const e of n)e&&(d=o._`${d}${(0,o.getProperty)((0,u.unescapeJsonPointer)(e))}`,r=o._`${r} && ${d}`);return r;function i(e,t){return`Cannot access ${e} ${t} levels up, current level is ${a}`}}a.getData=L},33673:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.validateKeywordUsage=a.validSchemaType=a.funcKeywordCode=a.macroKeywordCode=void 0;const c=t(99029),f=t(42023),d=t(15765),r=t(48708);function n(e){const{gen:a,data:t,it:f}=e;a.if(f.parentData,(()=>a.assign(t,c._`${f.parentData}[${f.parentDataProperty}]`)))}function i(e,a,t){if(void 0===t)throw new Error(`keyword "${a}" failed to compile`);return e.scopeValue("keyword","function"==typeof t?{ref:t}:{ref:t,code:(0,c.stringify)(t)})}a.macroKeywordCode=function(e,a){const{gen:t,keyword:f,schema:d,parentSchema:r,it:n}=e,b=a.macro.call(n.self,d,r,n),o=i(t,f,b);!1!==n.opts.validateSchema&&n.self.validateSchema(b,!0);const s=t.name("valid");e.subschema({schema:b,schemaPath:c.nil,errSchemaPath:`${n.errSchemaPath}/${f}`,topSchemaRef:o,compositeRule:!0},s),e.pass(s,(()=>e.error(!0)))},a.funcKeywordCode=function(e,a){var t;const{gen:b,keyword:o,schema:s,parentSchema:l,$data:u,it:h}=e;!function({schemaEnv:e},a){if(a.async&&!e.$async)throw new Error("async keyword in sync schema")}(h,a);const p=!u&&a.compile?a.compile.call(h.self,s,l,h):a.validate,g=i(b,o,p),m=b.let("valid");function y(t=(a.async?c._`await `:c.nil)){const r=h.opts.passContext?f.default.this:f.default.self,n=!("compile"in a&&!u||!1===a.schema);b.assign(m,c._`${t}${(0,d.callValidateCode)(e,g,r,n)}`,a.modifying)}function x(e){var t;b.if((0,c.not)(null!==(t=a.valid)&&void 0!==t?t:m),e)}e.block$data(m,(function(){if(!1===a.errors)y(),a.modifying&&n(e),x((()=>e.error()));else{const t=a.async?function(){const e=b.let("ruleErrs",null);return b.try((()=>y(c._`await `)),(a=>b.assign(m,!1).if(c._`${a} instanceof ${h.ValidationError}`,(()=>b.assign(e,c._`${a}.errors`)),(()=>b.throw(a))))),e}():function(){const e=c._`${g}.errors`;return b.assign(e,null),y(c.nil),e}();a.modifying&&n(e),x((()=>function(e,a){const{gen:t}=e;t.if(c._`Array.isArray(${a})`,(()=>{t.assign(f.default.vErrors,c._`${f.default.vErrors} === null ? ${a} : ${f.default.vErrors}.concat(${a})`).assign(f.default.errors,c._`${f.default.vErrors}.length`),(0,r.extendErrors)(e)}),(()=>e.error()))}(e,t)))}})),e.ok(null!==(t=a.valid)&&void 0!==t?t:m)},a.validSchemaType=function(e,a,t=!1){return!a.length||a.some((a=>"array"===a?Array.isArray(e):"object"===a?e&&"object"==typeof e&&!Array.isArray(e):typeof e==a||t&&void 0===e))},a.validateKeywordUsage=function({schema:e,opts:a,self:t,errSchemaPath:c},f,d){if(Array.isArray(f.keyword)?!f.keyword.includes(d):f.keyword!==d)throw new Error("ajv implementation error");const r=f.dependencies;if(null==r?void 0:r.some((a=>!Object.prototype.hasOwnProperty.call(e,a))))throw new Error(`parent schema must have dependencies of ${d}: ${r.join(",")}`);if(f.validateSchema&&!f.validateSchema(e[d])){const e=`keyword "${d}" value is invalid at path "${c}": `+t.errorsText(f.validateSchema.errors);if("log"!==a.validateSchema)throw new Error(e);t.logger.error(e)}}},24495:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.extendSubschemaMode=a.extendSubschemaData=a.getSubschema=void 0;const c=t(99029),f=t(94227);a.getSubschema=function(e,{keyword:a,schemaProp:t,schema:d,schemaPath:r,errSchemaPath:n,topSchemaRef:i}){if(void 0!==a&&void 0!==d)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==a){const d=e.schema[a];return void 0===t?{schema:d,schemaPath:c._`${e.schemaPath}${(0,c.getProperty)(a)}`,errSchemaPath:`${e.errSchemaPath}/${a}`}:{schema:d[t],schemaPath:c._`${e.schemaPath}${(0,c.getProperty)(a)}${(0,c.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${a}/${(0,f.escapeFragment)(t)}`}}if(void 0!==d){if(void 0===r||void 0===n||void 0===i)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:d,schemaPath:r,topSchemaRef:i,errSchemaPath:n}}throw new Error('either "keyword" or "schema" must be passed')},a.extendSubschemaData=function(e,a,{dataProp:t,dataPropType:d,data:r,dataTypes:n,propertyName:i}){if(void 0!==r&&void 0!==t)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:b}=a;if(void 0!==t){const{errorPath:r,dataPathArr:n,opts:i}=a;o(b.let("data",c._`${a.data}${(0,c.getProperty)(t)}`,!0)),e.errorPath=c.str`${r}${(0,f.getErrorPath)(t,d,i.jsPropertySyntax)}`,e.parentDataProperty=c._`${t}`,e.dataPathArr=[...n,e.parentDataProperty]}function o(t){e.data=t,e.dataLevel=a.dataLevel+1,e.dataTypes=[],a.definedProperties=new Set,e.parentData=a.data,e.dataNames=[...a.dataNames,t]}void 0!==r&&(o(r instanceof c.Name?r:b.let("data",r,!0)),void 0!==i&&(e.propertyName=i)),n&&(e.dataTypes=n)},a.extendSubschemaMode=function(e,{jtdDiscriminator:a,jtdMetadata:t,compositeRule:c,createErrors:f,allErrors:d}){void 0!==c&&(e.compositeRule=c),void 0!==f&&(e.createErrors=f),void 0!==d&&(e.allErrors=d),e.jtdDiscriminator=a,e.jtdMetadata=t}},4042:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.CodeGen=a.Name=a.nil=a.stringify=a.str=a._=a.KeywordCxt=void 0;var c=t(62586);Object.defineProperty(a,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var f=t(99029);Object.defineProperty(a,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(a,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(a,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(a,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(a,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(a,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});const d=t(13558),r=t(34551),n=t(10396),i=t(73835),b=t(99029),o=t(66939),s=t(10208),l=t(94227),u=t(63837),h=t(55944),p=(e,a)=>new RegExp(e,a);p.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),y={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},x={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function A(e){var a,t,c,f,d,r,n,i,b,o,s,l,u,g,m,y,x,A,v,w,_,I,E,C,M;const B=e.strict,k=null===(a=e.code)||void 0===a?void 0:a.optimize,L=!0===k||void 0===k?1:k||0,S=null!==(c=null===(t=e.code)||void 0===t?void 0:t.regExp)&&void 0!==c?c:p,T=null!==(f=e.uriResolver)&&void 0!==f?f:h.default;return{strictSchema:null===(r=null!==(d=e.strictSchema)&&void 0!==d?d:B)||void 0===r||r,strictNumbers:null===(i=null!==(n=e.strictNumbers)&&void 0!==n?n:B)||void 0===i||i,strictTypes:null!==(o=null!==(b=e.strictTypes)&&void 0!==b?b:B)&&void 0!==o?o:"log",strictTuples:null!==(l=null!==(s=e.strictTuples)&&void 0!==s?s:B)&&void 0!==l?l:"log",strictRequired:null!==(g=null!==(u=e.strictRequired)&&void 0!==u?u:B)&&void 0!==g&&g,code:e.code?{...e.code,optimize:L,regExp:S}:{optimize:L,regExp:S},loopRequired:null!==(m=e.loopRequired)&&void 0!==m?m:200,loopEnum:null!==(y=e.loopEnum)&&void 0!==y?y:200,meta:null===(x=e.meta)||void 0===x||x,messages:null===(A=e.messages)||void 0===A||A,inlineRefs:null===(v=e.inlineRefs)||void 0===v||v,schemaId:null!==(w=e.schemaId)&&void 0!==w?w:"$id",addUsedSchema:null===(_=e.addUsedSchema)||void 0===_||_,validateSchema:null===(I=e.validateSchema)||void 0===I||I,validateFormats:null===(E=e.validateFormats)||void 0===E||E,unicodeRegExp:null===(C=e.unicodeRegExp)||void 0===C||C,int32range:null===(M=e.int32range)||void 0===M||M,uriResolver:T}}class v{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...A(e)};const{es5:a,lines:t}=this.opts.code;this.scope=new b.ValueScope({scope:{},prefixes:m,es5:a,lines:t}),this.logger=function(e){if(!1===e)return B;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const c=e.validateFormats;e.validateFormats=!1,this.RULES=(0,n.getRules)(),w.call(this,y,e,"NOT SUPPORTED"),w.call(this,x,e,"DEPRECATED","warn"),this._metaOpts=M.call(this),e.formats&&E.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&C.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),I.call(this),e.validateFormats=c}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:a,schemaId:t}=this.opts;let c=u;"id"===t&&(c={...u},c.id=c.$id,delete c.$id),a&&e&&this.addMetaSchema(c,c[t],!1)}defaultMeta(){const{meta:e,schemaId:a}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[a]||e:void 0}validate(e,a){let t;if("string"==typeof e){if(t=this.getSchema(e),!t)throw new Error(`no schema with key or ref "${e}"`)}else t=this.compile(e);const c=t(a);return"$async"in t||(this.errors=t.errors),c}compile(e,a){const t=this._addSchema(e,a);return t.validate||this._compileSchemaEnv(t)}compileAsync(e,a){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:t}=this.opts;return c.call(this,e,a);async function c(e,a){await f.call(this,e.$schema);const t=this._addSchema(e,a);return t.validate||d.call(this,t)}async function f(e){e&&!this.getSchema(e)&&await c.call(this,{$ref:e},!0)}async function d(e){try{return this._compileSchemaEnv(e)}catch(a){if(!(a instanceof r.default))throw a;return n.call(this,a),await i.call(this,a.missingSchema),d.call(this,e)}}function n({missingSchema:e,missingRef:a}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${a} cannot be resolved`)}async function i(e){const t=await b.call(this,e);this.refs[e]||await f.call(this,t.$schema),this.refs[e]||this.addSchema(t,e,a)}async function b(e){const a=this._loading[e];if(a)return a;try{return await(this._loading[e]=t(e))}finally{delete this._loading[e]}}}addSchema(e,a,t,c=this.opts.validateSchema){if(Array.isArray(e)){for(const a of e)this.addSchema(a,void 0,t,c);return this}let f;if("object"==typeof e){const{schemaId:a}=this.opts;if(f=e[a],void 0!==f&&"string"!=typeof f)throw new Error(`schema ${a} must be string`)}return a=(0,o.normalizeId)(a||f),this._checkUnique(a),this.schemas[a]=this._addSchema(e,t,a,c,!0),this}addMetaSchema(e,a,t=this.opts.validateSchema){return this.addSchema(e,a,!0,t),this}validateSchema(e,a){if("boolean"==typeof e)return!0;let t;if(t=e.$schema,void 0!==t&&"string"!=typeof t)throw new Error("$schema must be a string");if(t=t||this.opts.defaultMeta||this.defaultMeta(),!t)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const c=this.validate(t,e);if(!c&&a){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return c}getSchema(e){let a;for(;"string"==typeof(a=_.call(this,e));)e=a;if(void 0===a){const{schemaId:t}=this.opts,c=new i.SchemaEnv({schema:{},schemaId:t});if(a=i.resolveSchema.call(this,c,e),!a)return;this.refs[e]=a}return a.validate||this._compileSchemaEnv(a)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const a=_.call(this,e);return"object"==typeof a&&this._cache.delete(a.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const a=e;this._cache.delete(a);let t=e[this.opts.schemaId];return t&&(t=(0,o.normalizeId)(t),delete this.schemas[t],delete this.refs[t]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const a of e)this.addKeyword(a);return this}addKeyword(e,a){let t;if("string"==typeof e)t=e,"object"==typeof a&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),a.keyword=t);else{if("object"!=typeof e||void 0!==a)throw new Error("invalid addKeywords parameters");if(t=(a=e).keyword,Array.isArray(t)&&!t.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(L.call(this,t,a),!a)return(0,l.eachItem)(t,(e=>S.call(this,e))),this;N.call(this,a);const c={...a,type:(0,s.getJSONTypes)(a.type),schemaType:(0,s.getJSONTypes)(a.schemaType)};return(0,l.eachItem)(t,0===c.type.length?e=>S.call(this,e,c):e=>c.type.forEach((a=>S.call(this,e,c,a)))),this}getKeyword(e){const a=this.RULES.all[e];return"object"==typeof a?a.definition:!!a}removeKeyword(e){const{RULES:a}=this;delete a.keywords[e],delete a.all[e];for(const t of a.rules){const a=t.rules.findIndex((a=>a.keyword===e));a>=0&&t.rules.splice(a,1)}return this}addFormat(e,a){return"string"==typeof a&&(a=new RegExp(a)),this.formats[e]=a,this}errorsText(e=this.errors,{separator:a=", ",dataVar:t="data"}={}){return e&&0!==e.length?e.map((e=>`${t}${e.instancePath} ${e.message}`)).reduce(((e,t)=>e+a+t)):"No errors"}$dataMetaSchema(e,a){const t=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const c of a){const a=c.split("/").slice(1);let f=e;for(const e of a)f=f[e];for(const e in t){const a=t[e];if("object"!=typeof a)continue;const{$data:c}=a.definition,d=f[e];c&&d&&(f[e]=P(d))}}return e}_removeAllSchemas(e,a){for(const t in e){const c=e[t];a&&!a.test(t)||("string"==typeof c?delete e[t]:c&&!c.meta&&(this._cache.delete(c.schema),delete e[t]))}}_addSchema(e,a,t,c=this.opts.validateSchema,f=this.opts.addUsedSchema){let d;const{schemaId:r}=this.opts;if("object"==typeof e)d=e[r];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let n=this._cache.get(e);if(void 0!==n)return n;t=(0,o.normalizeId)(d||t);const b=o.getSchemaRefs.call(this,e,t);return n=new i.SchemaEnv({schema:e,schemaId:r,meta:a,baseId:t,localRefs:b}),this._cache.set(n.schema,n),f&&!t.startsWith("#")&&(t&&this._checkUnique(t),this.refs[t]=n),c&&this.validateSchema(e,!0),n}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):i.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const a=this.opts;this.opts=this._metaOpts;try{i.compileSchema.call(this,e)}finally{this.opts=a}}}function w(e,a,t,c="error"){for(const f in e){const d=f;d in a&&this.logger[c](`${t}: option ${f}. ${e[d]}`)}}function _(e){return e=(0,o.normalizeId)(e),this.schemas[e]||this.refs[e]}function I(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const a in e)this.addSchema(e[a],a)}function E(){for(const e in this.opts.formats){const a=this.opts.formats[e];a&&this.addFormat(e,a)}}function C(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const a in e){const t=e[a];t.keyword||(t.keyword=a),this.addKeyword(t)}}}function M(){const e={...this.opts};for(const a of g)delete e[a];return e}v.ValidationError=d.default,v.MissingRefError=r.default,a.default=v;const B={log(){},warn(){},error(){}},k=/^[a-z_$][a-z0-9_$:-]*$/i;function L(e,a){const{RULES:t}=this;if((0,l.eachItem)(e,(e=>{if(t.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!k.test(e))throw new Error(`Keyword ${e} has invalid name`)})),a&&a.$data&&!("code"in a)&&!("validate"in a))throw new Error('$data keyword must have "code" or "validate" function')}function S(e,a,t){var c;const f=null==a?void 0:a.post;if(t&&f)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:d}=this;let r=f?d.post:d.rules.find((({type:e})=>e===t));if(r||(r={type:t,rules:[]},d.rules.push(r)),d.keywords[e]=!0,!a)return;const n={keyword:e,definition:{...a,type:(0,s.getJSONTypes)(a.type),schemaType:(0,s.getJSONTypes)(a.schemaType)}};a.before?T.call(this,r,n,a.before):r.rules.push(n),d.all[e]=n,null===(c=a.implements)||void 0===c||c.forEach((e=>this.addKeyword(e)))}function T(e,a,t){const c=e.rules.findIndex((e=>e.keyword===t));c>=0?e.rules.splice(c,0,a):(e.rules.push(a),this.logger.warn(`rule ${t} is not defined`))}function N(e){let{metaSchema:a}=e;void 0!==a&&(e.$data&&this.opts.$data&&(a=P(a)),e.validateSchema=this.compile(a,!0))}const R={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function P(e){return{anyOf:[e,R]}}},76250:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(32017);c.code='require("ajv/dist/runtime/equal").default',a.default=c},53853:(e,a)=>{"use strict";function t(e){const a=e.length;let t,c=0,f=0;for(;f=55296&&t<=56319&&f{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(48343);c.code='require("ajv/dist/runtime/uri").default',a.default=c},13558:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});class t extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}a.default=t},15457:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.validateAdditionalItems=void 0;const c=t(99029),f=t(94227),d={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>c.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>c._`{limit: ${e}}`},code(e){const{parentSchema:a,it:t}=e,{items:c}=a;Array.isArray(c)?r(e,c):(0,f.checkStrictMode)(t,'"additionalItems" is ignored when "items" is not an array of schemas')}};function r(e,a){const{gen:t,schema:d,data:r,keyword:n,it:i}=e;i.items=!0;const b=t.const("len",c._`${r}.length`);if(!1===d)e.setParams({len:a.length}),e.pass(c._`${b} <= ${a.length}`);else if("object"==typeof d&&!(0,f.alwaysValidSchema)(i,d)){const d=t.var("valid",c._`${b} <= ${a.length}`);t.if((0,c.not)(d),(()=>function(d){t.forRange("i",a.length,b,(a=>{e.subschema({keyword:n,dataProp:a,dataPropType:f.Type.Num},d),i.allErrors||t.if((0,c.not)(d),(()=>t.break()))}))}(d))),e.ok(d)}}a.validateAdditionalItems=r,a.default=d},38660:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(15765),f=t(99029),d=t(42023),r=t(94227),n={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>f._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:a,schema:t,parentSchema:n,data:i,errsCount:b,it:o}=e;if(!b)throw new Error("ajv implementation error");const{allErrors:s,opts:l}=o;if(o.props=!0,"all"!==l.removeAdditional&&(0,r.alwaysValidSchema)(o,t))return;const u=(0,c.allSchemaProperties)(n.properties),h=(0,c.allSchemaProperties)(n.patternProperties);function p(e){a.code(f._`delete ${i}[${e}]`)}function g(c){if("all"===l.removeAdditional||l.removeAdditional&&!1===t)p(c);else{if(!1===t)return e.setParams({additionalProperty:c}),e.error(),void(s||a.break());if("object"==typeof t&&!(0,r.alwaysValidSchema)(o,t)){const t=a.name("valid");"failing"===l.removeAdditional?(m(c,t,!1),a.if((0,f.not)(t),(()=>{e.reset(),p(c)}))):(m(c,t),s||a.if((0,f.not)(t),(()=>a.break())))}}}function m(a,t,c){const f={keyword:"additionalProperties",dataProp:a,dataPropType:r.Type.Str};!1===c&&Object.assign(f,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(f,t)}a.forIn("key",i,(t=>{u.length||h.length?a.if(function(t){let d;if(u.length>8){const e=(0,r.schemaRefOrVal)(o,n.properties,"properties");d=(0,c.isOwnProperty)(a,e,t)}else d=u.length?(0,f.or)(...u.map((e=>f._`${t} === ${e}`))):f.nil;return h.length&&(d=(0,f.or)(d,...h.map((a=>f._`${(0,c.usePattern)(e,a)}.test(${t})`)))),(0,f.not)(d)}(t),(()=>g(t))):g(t)})),e.ok(f._`${b} === ${d.default.errors}`)}};a.default=n},15844:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(94227),f={keyword:"allOf",schemaType:"array",code(e){const{gen:a,schema:t,it:f}=e;if(!Array.isArray(t))throw new Error("ajv implementation error");const d=a.name("valid");t.forEach(((a,t)=>{if((0,c.alwaysValidSchema)(f,a))return;const r=e.subschema({keyword:"allOf",schemaProp:t},d);e.ok(d),e.mergeEvaluated(r)}))}};a.default=f},16505:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:t(15765).validateUnion,error:{message:"must match a schema in anyOf"}};a.default=c},12661:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:a}})=>void 0===a?c.str`must contain at least ${e} valid item(s)`:c.str`must contain at least ${e} and no more than ${a} valid item(s)`,params:({params:{min:e,max:a}})=>void 0===a?c._`{minContains: ${e}}`:c._`{minContains: ${e}, maxContains: ${a}}`},code(e){const{gen:a,schema:t,parentSchema:d,data:r,it:n}=e;let i,b;const{minContains:o,maxContains:s}=d;n.opts.next?(i=void 0===o?1:o,b=s):i=1;const l=a.const("len",c._`${r}.length`);if(e.setParams({min:i,max:b}),void 0===b&&0===i)return void(0,f.checkStrictMode)(n,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==b&&i>b)return(0,f.checkStrictMode)(n,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,f.alwaysValidSchema)(n,t)){let a=c._`${l} >= ${i}`;return void 0!==b&&(a=c._`${a} && ${l} <= ${b}`),void e.pass(a)}n.items=!0;const u=a.name("valid");function h(){const e=a.name("_valid"),t=a.let("count",0);p(e,(()=>a.if(e,(()=>function(e){a.code(c._`${e}++`),void 0===b?a.if(c._`${e} >= ${i}`,(()=>a.assign(u,!0).break())):(a.if(c._`${e} > ${b}`,(()=>a.assign(u,!1).break())),1===i?a.assign(u,!0):a.if(c._`${e} >= ${i}`,(()=>a.assign(u,!0))))}(t)))))}function p(t,c){a.forRange("i",0,l,(a=>{e.subschema({keyword:"contains",dataProp:a,dataPropType:f.Type.Num,compositeRule:!0},t),c()}))}void 0===b&&1===i?p(u,(()=>a.if(u,(()=>a.break())))):0===i?(a.let(u,!0),void 0!==b&&a.if(c._`${r}.length > 0`,h)):(a.let(u,!1),h()),e.result(u,(()=>e.reset()))}};a.default=d},83025:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.validateSchemaDeps=a.validatePropertyDeps=a.error=void 0;const c=t(99029),f=t(94227),d=t(15765);a.error={message:({params:{property:e,depsCount:a,deps:t}})=>{const f=1===a?"property":"properties";return c.str`must have ${f} ${t} when property ${e} is present`},params:({params:{property:e,depsCount:a,deps:t,missingProperty:f}})=>c._`{property: ${e}, + || ${n} === "boolean" || ${f} === null`).assign(i,r._`[${f}]`)}}c.else(),h(e),c.endIf(),c.if(r._`${i} !== undefined`,(()=>{c.assign(f,i),function({gen:e,parentData:a,parentDataProperty:t},c){e.if(r._`${a} !== undefined`,(()=>e.assign(r._`${a}[${t}]`,c)))}(e,i)}))}(e,a,n):h(e)}))}return b};const o=new Set(["string","number","integer","boolean","null"]);function s(e,a,t,c=i.Correct){const f=c===i.Correct?r.operators.EQ:r.operators.NEQ;let d;switch(e){case"null":return r._`${a} ${f} null`;case"array":d=r._`Array.isArray(${a})`;break;case"object":d=r._`${a} && typeof ${a} == "object" && !Array.isArray(${a})`;break;case"integer":d=n(r._`!(${a} % 1) && !isNaN(${a})`);break;case"number":d=n();break;default:return r._`typeof ${a} ${f} ${e}`}return c===i.Correct?d:(0,r.not)(d);function n(e=r.nil){return(0,r.and)(r._`typeof ${a} == "number"`,e,t?r._`isFinite(${a})`:r.nil)}}function l(e,a,t,c){if(1===e.length)return s(e[0],a,t,c);let f;const d=(0,n.toHash)(e);if(d.array&&d.object){const e=r._`typeof ${a} != "object"`;f=d.null?e:r._`!${a} || ${e}`,delete d.null,delete d.array,delete d.object}else f=r.nil;d.number&&delete d.integer;for(const e in d)f=(0,r.and)(f,s(e,a,t,c));return f}a.checkDataType=s,a.checkDataTypes=l;const u={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:a})=>"string"==typeof e?r._`{type: ${e}}`:r._`{type: ${a}}`};function h(e){const a=function(e){const{gen:a,data:t,schema:c}=e,f=(0,n.schemaRefOrVal)(e,c,"type");return{gen:a,keyword:"type",data:t,schema:c.type,schemaCode:f,schemaValue:f,parentSchema:c,params:{},it:e}}(e);(0,d.reportError)(a,u)}a.reportTypeError=h},7870:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.assignDefaults=void 0;const c=t(99029),f=t(94227);function d(e,a,t){const{gen:d,compositeRule:r,data:n,opts:i}=e;if(void 0===t)return;const b=c._`${n}${(0,c.getProperty)(a)}`;if(r)return void(0,f.checkStrictMode)(e,`default is ignored for: ${b}`);let o=c._`${b} === undefined`;"empty"===i.useDefaults&&(o=c._`${o} || ${b} === null || ${b} === ""`),d.if(o,c._`${b} = ${(0,c.stringify)(t)}`)}a.assignDefaults=function(e,a){const{properties:t,items:c}=e.schema;if("object"===a&&t)for(const a in t)d(e,a,t[a].default);else"array"===a&&Array.isArray(c)&&c.forEach(((a,t)=>d(e,t,a.default)))}},62586:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.getData=a.KeywordCxt=a.validateFunctionCode=void 0;const c=t(28727),f=t(10208),d=t(7887),r=t(10208),n=t(7870),i=t(33673),b=t(24495),o=t(99029),s=t(42023),l=t(66939),u=t(94227),h=t(48708);function p({gen:e,validateName:a,schema:t,schemaEnv:c,opts:f},d){f.code.es5?e.func(a,o._`${s.default.data}, ${s.default.valCxt}`,c.$async,(()=>{e.code(o._`"use strict"; ${g(t,f)}`),function(e,a){e.if(s.default.valCxt,(()=>{e.var(s.default.instancePath,o._`${s.default.valCxt}.${s.default.instancePath}`),e.var(s.default.parentData,o._`${s.default.valCxt}.${s.default.parentData}`),e.var(s.default.parentDataProperty,o._`${s.default.valCxt}.${s.default.parentDataProperty}`),e.var(s.default.rootData,o._`${s.default.valCxt}.${s.default.rootData}`),a.dynamicRef&&e.var(s.default.dynamicAnchors,o._`${s.default.valCxt}.${s.default.dynamicAnchors}`)}),(()=>{e.var(s.default.instancePath,o._`""`),e.var(s.default.parentData,o._`undefined`),e.var(s.default.parentDataProperty,o._`undefined`),e.var(s.default.rootData,s.default.data),a.dynamicRef&&e.var(s.default.dynamicAnchors,o._`{}`)}))}(e,f),e.code(d)})):e.func(a,o._`${s.default.data}, ${function(e){return o._`{${s.default.instancePath}="", ${s.default.parentData}, ${s.default.parentDataProperty}, ${s.default.rootData}=${s.default.data}${e.dynamicRef?o._`, ${s.default.dynamicAnchors}={}`:o.nil}}={}`}(f)}`,c.$async,(()=>e.code(g(t,f)).code(d)))}function g(e,a){const t="object"==typeof e&&e[a.schemaId];return t&&(a.code.source||a.code.process)?o._`/*# sourceURL=${t} */`:o.nil}function m({schema:e,self:a}){if("boolean"==typeof e)return!e;for(const t in e)if(a.RULES.all[t])return!0;return!1}function x(e){return"boolean"!=typeof e.schema}function y(e){(0,u.checkUnknownRules)(e),function(e){const{schema:a,errSchemaPath:t,opts:c,self:f}=e;a.$ref&&c.ignoreKeywordsWithRef&&(0,u.schemaHasRulesButRef)(a,f.RULES)&&f.logger.warn(`$ref: keywords ignored in schema at path "${t}"`)}(e)}function A(e,a){if(e.opts.jtd)return w(e,[],!1,a);const t=(0,f.getSchemaTypes)(e.schema);w(e,t,!(0,f.coerceAndCheckDataType)(e,t),a)}function v({gen:e,schemaEnv:a,schema:t,errSchemaPath:c,opts:f}){const d=t.$comment;if(!0===f.$comment)e.code(o._`${s.default.self}.logger.log(${d})`);else if("function"==typeof f.$comment){const t=o.str`${c}/$comment`,f=e.scopeValue("root",{ref:a.root});e.code(o._`${s.default.self}.opts.$comment(${d}, ${t}, ${f}.schema)`)}}function w(e,a,t,c){const{gen:f,schema:n,data:i,allErrors:b,opts:l,self:h}=e,{RULES:p}=h;function g(u){(0,d.shouldUseGroup)(n,u)&&(u.type?(f.if((0,r.checkDataType)(u.type,i,l.strictNumbers)),_(e,u),1===a.length&&a[0]===u.type&&t&&(f.else(),(0,r.reportTypeError)(e)),f.endIf()):_(e,u),b||f.if(o._`${s.default.errors} === ${c||0}`))}!n.$ref||!l.ignoreKeywordsWithRef&&(0,u.schemaHasRulesButRef)(n,p)?(l.jtd||function(e,a){!e.schemaEnv.meta&&e.opts.strictTypes&&(function(e,a){a.length&&(e.dataTypes.length?(a.forEach((a=>{I(e.dataTypes,a)||E(e,`type "${a}" not allowed by context "${e.dataTypes.join(",")}"`)})),function(e,a){const t=[];for(const c of e.dataTypes)I(a,c)?t.push(c):a.includes("integer")&&"number"===c&&t.push("integer");e.dataTypes=t}(e,a)):e.dataTypes=a)}(e,a),e.opts.allowUnionTypes||function(e,a){a.length>1&&(2!==a.length||!a.includes("null"))&&E(e,"use allowUnionTypes to allow union type keyword")}(e,a),function(e,a){const t=e.self.RULES.all;for(const c in t){const f=t[c];if("object"==typeof f&&(0,d.shouldUseRule)(e.schema,f)){const{type:t}=f.definition;t.length&&!t.some((e=>{return c=e,(t=a).includes(c)||"number"===c&&t.includes("integer");var t,c}))&&E(e,`missing type "${t.join(",")}" for keyword "${c}"`)}}}(e,e.dataTypes))}(e,a),f.block((()=>{for(const e of p.rules)g(e);g(p.post)}))):f.block((()=>M(e,"$ref",p.all.$ref.definition)))}function _(e,a){const{gen:t,schema:c,opts:{useDefaults:f}}=e;f&&(0,n.assignDefaults)(e,a.type),t.block((()=>{for(const t of a.rules)(0,d.shouldUseRule)(c,t)&&M(e,t.keyword,t.definition,a.type)}))}function I(e,a){return e.includes(a)||"integer"===a&&e.includes("number")}function E(e,a){a+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,u.checkStrictMode)(e,a,e.opts.strictTypes)}a.validateFunctionCode=function(e){x(e)&&(y(e),m(e))?function(e){const{schema:a,opts:t,gen:c}=e;p(e,(()=>{t.$comment&&a.$comment&&v(e),function(e){const{schema:a,opts:t}=e;void 0!==a.default&&t.useDefaults&&t.strictSchema&&(0,u.checkStrictMode)(e,"default is ignored in the schema root")}(e),c.let(s.default.vErrors,null),c.let(s.default.errors,0),t.unevaluated&&function(e){const{gen:a,validateName:t}=e;e.evaluated=a.const("evaluated",o._`${t}.evaluated`),a.if(o._`${e.evaluated}.dynamicProps`,(()=>a.assign(o._`${e.evaluated}.props`,o._`undefined`))),a.if(o._`${e.evaluated}.dynamicItems`,(()=>a.assign(o._`${e.evaluated}.items`,o._`undefined`)))}(e),A(e),function(e){const{gen:a,schemaEnv:t,validateName:c,ValidationError:f,opts:d}=e;t.$async?a.if(o._`${s.default.errors} === 0`,(()=>a.return(s.default.data)),(()=>a.throw(o._`new ${f}(${s.default.vErrors})`))):(a.assign(o._`${c}.errors`,s.default.vErrors),d.unevaluated&&function({gen:e,evaluated:a,props:t,items:c}){t instanceof o.Name&&e.assign(o._`${a}.props`,t),c instanceof o.Name&&e.assign(o._`${a}.items`,c)}(e),a.return(o._`${s.default.errors} === 0`))}(e)}))}(e):p(e,(()=>(0,c.topBoolOrEmptySchema)(e)))};class C{constructor(e,a,t){if((0,i.validateKeywordUsage)(e,a,t),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=t,this.data=e.data,this.schema=e.schema[t],this.$data=a.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,u.schemaRefOrVal)(e,this.schema,t,this.$data),this.schemaType=a.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=a,this.$data)this.schemaCode=e.gen.const("vSchema",L(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,a.schemaType,a.allowUndefined))throw new Error(`${t} value must be ${JSON.stringify(a.schemaType)}`);("code"in a?a.trackErrors:!1!==a.errors)&&(this.errsCount=e.gen.const("_errs",s.default.errors))}result(e,a,t){this.failResult((0,o.not)(e),a,t)}failResult(e,a,t){this.gen.if(e),t?t():this.error(),a?(this.gen.else(),a(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,a){this.failResult((0,o.not)(e),void 0,a)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:a}=this;this.fail(o._`${a} !== undefined && (${(0,o.or)(this.invalid$data(),e)})`)}error(e,a,t){if(a)return this.setParams(a),this._error(e,t),void this.setParams({});this._error(e,t)}_error(e,a){(e?h.reportExtraError:h.reportError)(this,this.def.error,a)}$dataError(){(0,h.reportError)(this,this.def.$dataError||h.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,h.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,a){a?Object.assign(this.params,e):this.params=e}block$data(e,a,t=o.nil){this.gen.block((()=>{this.check$data(e,t),a()}))}check$data(e=o.nil,a=o.nil){if(!this.$data)return;const{gen:t,schemaCode:c,schemaType:f,def:d}=this;t.if((0,o.or)(o._`${c} === undefined`,a)),e!==o.nil&&t.assign(e,!0),(f.length||d.validateSchema)&&(t.elseIf(this.invalid$data()),this.$dataError(),e!==o.nil&&t.assign(e,!1)),t.else()}invalid$data(){const{gen:e,schemaCode:a,schemaType:t,def:c,it:f}=this;return(0,o.or)(function(){if(t.length){if(!(a instanceof o.Name))throw new Error("ajv implementation error");const e=Array.isArray(t)?t:[t];return o._`${(0,r.checkDataTypes)(e,a,f.opts.strictNumbers,r.DataType.Wrong)}`}return o.nil}(),function(){if(c.validateSchema){const t=e.scopeValue("validate$data",{ref:c.validateSchema});return o._`!${t}(${a})`}return o.nil}())}subschema(e,a){const t=(0,b.getSubschema)(this.it,e);(0,b.extendSubschemaData)(t,this.it,e),(0,b.extendSubschemaMode)(t,e);const f={...this.it,...t,items:void 0,props:void 0};return function(e,a){x(e)&&(y(e),m(e))?function(e,a){const{schema:t,gen:c,opts:f}=e;f.$comment&&t.$comment&&v(e),function(e){const a=e.schema[e.opts.schemaId];a&&(e.baseId=(0,l.resolveUrl)(e.opts.uriResolver,e.baseId,a))}(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const d=c.const("_errs",s.default.errors);A(e,d),c.var(a,o._`${d} === ${s.default.errors}`)}(e,a):(0,c.boolOrEmptySchema)(e,a)}(f,a),f}mergeEvaluated(e,a){const{it:t,gen:c}=this;t.opts.unevaluated&&(!0!==t.props&&void 0!==e.props&&(t.props=u.mergeEvaluated.props(c,e.props,t.props,a)),!0!==t.items&&void 0!==e.items&&(t.items=u.mergeEvaluated.items(c,e.items,t.items,a)))}mergeValidEvaluated(e,a){const{it:t,gen:c}=this;if(t.opts.unevaluated&&(!0!==t.props||!0!==t.items))return c.if(a,(()=>this.mergeEvaluated(e,o.Name))),!0}}function M(e,a,t,c){const f=new C(e,t,a);"code"in t?t.code(f,c):f.$data&&t.validate?(0,i.funcKeywordCode)(f,t):"macro"in t?(0,i.macroKeywordCode)(f,t):(t.compile||t.validate)&&(0,i.funcKeywordCode)(f,t)}a.KeywordCxt=C;const B=/^\/(?:[^~]|~0|~1)*$/,k=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function L(e,{dataLevel:a,dataNames:t,dataPathArr:c}){let f,d;if(""===e)return s.default.rootData;if("/"===e[0]){if(!B.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);f=e,d=s.default.rootData}else{const r=k.exec(e);if(!r)throw new Error(`Invalid JSON-pointer: ${e}`);const n=+r[1];if(f=r[2],"#"===f){if(n>=a)throw new Error(i("property/index",n));return c[a-n]}if(n>a)throw new Error(i("data",n));if(d=t[a-n],!f)return d}let r=d;const n=f.split("/");for(const e of n)e&&(d=o._`${d}${(0,o.getProperty)((0,u.unescapeJsonPointer)(e))}`,r=o._`${r} && ${d}`);return r;function i(e,t){return`Cannot access ${e} ${t} levels up, current level is ${a}`}}a.getData=L},33673:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.validateKeywordUsage=a.validSchemaType=a.funcKeywordCode=a.macroKeywordCode=void 0;const c=t(99029),f=t(42023),d=t(15765),r=t(48708);function n(e){const{gen:a,data:t,it:f}=e;a.if(f.parentData,(()=>a.assign(t,c._`${f.parentData}[${f.parentDataProperty}]`)))}function i(e,a,t){if(void 0===t)throw new Error(`keyword "${a}" failed to compile`);return e.scopeValue("keyword","function"==typeof t?{ref:t}:{ref:t,code:(0,c.stringify)(t)})}a.macroKeywordCode=function(e,a){const{gen:t,keyword:f,schema:d,parentSchema:r,it:n}=e,b=a.macro.call(n.self,d,r,n),o=i(t,f,b);!1!==n.opts.validateSchema&&n.self.validateSchema(b,!0);const s=t.name("valid");e.subschema({schema:b,schemaPath:c.nil,errSchemaPath:`${n.errSchemaPath}/${f}`,topSchemaRef:o,compositeRule:!0},s),e.pass(s,(()=>e.error(!0)))},a.funcKeywordCode=function(e,a){var t;const{gen:b,keyword:o,schema:s,parentSchema:l,$data:u,it:h}=e;!function({schemaEnv:e},a){if(a.async&&!e.$async)throw new Error("async keyword in sync schema")}(h,a);const p=!u&&a.compile?a.compile.call(h.self,s,l,h):a.validate,g=i(b,o,p),m=b.let("valid");function x(t=(a.async?c._`await `:c.nil)){const r=h.opts.passContext?f.default.this:f.default.self,n=!("compile"in a&&!u||!1===a.schema);b.assign(m,c._`${t}${(0,d.callValidateCode)(e,g,r,n)}`,a.modifying)}function y(e){var t;b.if((0,c.not)(null!==(t=a.valid)&&void 0!==t?t:m),e)}e.block$data(m,(function(){if(!1===a.errors)x(),a.modifying&&n(e),y((()=>e.error()));else{const t=a.async?function(){const e=b.let("ruleErrs",null);return b.try((()=>x(c._`await `)),(a=>b.assign(m,!1).if(c._`${a} instanceof ${h.ValidationError}`,(()=>b.assign(e,c._`${a}.errors`)),(()=>b.throw(a))))),e}():function(){const e=c._`${g}.errors`;return b.assign(e,null),x(c.nil),e}();a.modifying&&n(e),y((()=>function(e,a){const{gen:t}=e;t.if(c._`Array.isArray(${a})`,(()=>{t.assign(f.default.vErrors,c._`${f.default.vErrors} === null ? ${a} : ${f.default.vErrors}.concat(${a})`).assign(f.default.errors,c._`${f.default.vErrors}.length`),(0,r.extendErrors)(e)}),(()=>e.error()))}(e,t)))}})),e.ok(null!==(t=a.valid)&&void 0!==t?t:m)},a.validSchemaType=function(e,a,t=!1){return!a.length||a.some((a=>"array"===a?Array.isArray(e):"object"===a?e&&"object"==typeof e&&!Array.isArray(e):typeof e==a||t&&void 0===e))},a.validateKeywordUsage=function({schema:e,opts:a,self:t,errSchemaPath:c},f,d){if(Array.isArray(f.keyword)?!f.keyword.includes(d):f.keyword!==d)throw new Error("ajv implementation error");const r=f.dependencies;if(null==r?void 0:r.some((a=>!Object.prototype.hasOwnProperty.call(e,a))))throw new Error(`parent schema must have dependencies of ${d}: ${r.join(",")}`);if(f.validateSchema&&!f.validateSchema(e[d])){const e=`keyword "${d}" value is invalid at path "${c}": `+t.errorsText(f.validateSchema.errors);if("log"!==a.validateSchema)throw new Error(e);t.logger.error(e)}}},24495:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.extendSubschemaMode=a.extendSubschemaData=a.getSubschema=void 0;const c=t(99029),f=t(94227);a.getSubschema=function(e,{keyword:a,schemaProp:t,schema:d,schemaPath:r,errSchemaPath:n,topSchemaRef:i}){if(void 0!==a&&void 0!==d)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==a){const d=e.schema[a];return void 0===t?{schema:d,schemaPath:c._`${e.schemaPath}${(0,c.getProperty)(a)}`,errSchemaPath:`${e.errSchemaPath}/${a}`}:{schema:d[t],schemaPath:c._`${e.schemaPath}${(0,c.getProperty)(a)}${(0,c.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${a}/${(0,f.escapeFragment)(t)}`}}if(void 0!==d){if(void 0===r||void 0===n||void 0===i)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:d,schemaPath:r,topSchemaRef:i,errSchemaPath:n}}throw new Error('either "keyword" or "schema" must be passed')},a.extendSubschemaData=function(e,a,{dataProp:t,dataPropType:d,data:r,dataTypes:n,propertyName:i}){if(void 0!==r&&void 0!==t)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:b}=a;if(void 0!==t){const{errorPath:r,dataPathArr:n,opts:i}=a;o(b.let("data",c._`${a.data}${(0,c.getProperty)(t)}`,!0)),e.errorPath=c.str`${r}${(0,f.getErrorPath)(t,d,i.jsPropertySyntax)}`,e.parentDataProperty=c._`${t}`,e.dataPathArr=[...n,e.parentDataProperty]}function o(t){e.data=t,e.dataLevel=a.dataLevel+1,e.dataTypes=[],a.definedProperties=new Set,e.parentData=a.data,e.dataNames=[...a.dataNames,t]}void 0!==r&&(o(r instanceof c.Name?r:b.let("data",r,!0)),void 0!==i&&(e.propertyName=i)),n&&(e.dataTypes=n)},a.extendSubschemaMode=function(e,{jtdDiscriminator:a,jtdMetadata:t,compositeRule:c,createErrors:f,allErrors:d}){void 0!==c&&(e.compositeRule=c),void 0!==f&&(e.createErrors=f),void 0!==d&&(e.allErrors=d),e.jtdDiscriminator=a,e.jtdMetadata=t}},4042:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.CodeGen=a.Name=a.nil=a.stringify=a.str=a._=a.KeywordCxt=void 0;var c=t(62586);Object.defineProperty(a,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var f=t(99029);Object.defineProperty(a,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(a,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(a,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(a,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(a,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(a,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});const d=t(13558),r=t(34551),n=t(10396),i=t(73835),b=t(99029),o=t(66939),s=t(10208),l=t(94227),u=t(63837),h=t(55944),p=(e,a)=>new RegExp(e,a);p.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),x={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},y={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function A(e){var a,t,c,f,d,r,n,i,b,o,s,l,u,g,m,x,y,A,v,w,_,I,E,C,M;const B=e.strict,k=null===(a=e.code)||void 0===a?void 0:a.optimize,L=!0===k||void 0===k?1:k||0,S=null!==(c=null===(t=e.code)||void 0===t?void 0:t.regExp)&&void 0!==c?c:p,T=null!==(f=e.uriResolver)&&void 0!==f?f:h.default;return{strictSchema:null===(r=null!==(d=e.strictSchema)&&void 0!==d?d:B)||void 0===r||r,strictNumbers:null===(i=null!==(n=e.strictNumbers)&&void 0!==n?n:B)||void 0===i||i,strictTypes:null!==(o=null!==(b=e.strictTypes)&&void 0!==b?b:B)&&void 0!==o?o:"log",strictTuples:null!==(l=null!==(s=e.strictTuples)&&void 0!==s?s:B)&&void 0!==l?l:"log",strictRequired:null!==(g=null!==(u=e.strictRequired)&&void 0!==u?u:B)&&void 0!==g&&g,code:e.code?{...e.code,optimize:L,regExp:S}:{optimize:L,regExp:S},loopRequired:null!==(m=e.loopRequired)&&void 0!==m?m:200,loopEnum:null!==(x=e.loopEnum)&&void 0!==x?x:200,meta:null===(y=e.meta)||void 0===y||y,messages:null===(A=e.messages)||void 0===A||A,inlineRefs:null===(v=e.inlineRefs)||void 0===v||v,schemaId:null!==(w=e.schemaId)&&void 0!==w?w:"$id",addUsedSchema:null===(_=e.addUsedSchema)||void 0===_||_,validateSchema:null===(I=e.validateSchema)||void 0===I||I,validateFormats:null===(E=e.validateFormats)||void 0===E||E,unicodeRegExp:null===(C=e.unicodeRegExp)||void 0===C||C,int32range:null===(M=e.int32range)||void 0===M||M,uriResolver:T}}class v{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...A(e)};const{es5:a,lines:t}=this.opts.code;this.scope=new b.ValueScope({scope:{},prefixes:m,es5:a,lines:t}),this.logger=function(e){if(!1===e)return B;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const c=e.validateFormats;e.validateFormats=!1,this.RULES=(0,n.getRules)(),w.call(this,x,e,"NOT SUPPORTED"),w.call(this,y,e,"DEPRECATED","warn"),this._metaOpts=M.call(this),e.formats&&E.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&C.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),I.call(this),e.validateFormats=c}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:a,schemaId:t}=this.opts;let c=u;"id"===t&&(c={...u},c.id=c.$id,delete c.$id),a&&e&&this.addMetaSchema(c,c[t],!1)}defaultMeta(){const{meta:e,schemaId:a}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[a]||e:void 0}validate(e,a){let t;if("string"==typeof e){if(t=this.getSchema(e),!t)throw new Error(`no schema with key or ref "${e}"`)}else t=this.compile(e);const c=t(a);return"$async"in t||(this.errors=t.errors),c}compile(e,a){const t=this._addSchema(e,a);return t.validate||this._compileSchemaEnv(t)}compileAsync(e,a){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:t}=this.opts;return c.call(this,e,a);async function c(e,a){await f.call(this,e.$schema);const t=this._addSchema(e,a);return t.validate||d.call(this,t)}async function f(e){e&&!this.getSchema(e)&&await c.call(this,{$ref:e},!0)}async function d(e){try{return this._compileSchemaEnv(e)}catch(a){if(!(a instanceof r.default))throw a;return n.call(this,a),await i.call(this,a.missingSchema),d.call(this,e)}}function n({missingSchema:e,missingRef:a}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${a} cannot be resolved`)}async function i(e){const t=await b.call(this,e);this.refs[e]||await f.call(this,t.$schema),this.refs[e]||this.addSchema(t,e,a)}async function b(e){const a=this._loading[e];if(a)return a;try{return await(this._loading[e]=t(e))}finally{delete this._loading[e]}}}addSchema(e,a,t,c=this.opts.validateSchema){if(Array.isArray(e)){for(const a of e)this.addSchema(a,void 0,t,c);return this}let f;if("object"==typeof e){const{schemaId:a}=this.opts;if(f=e[a],void 0!==f&&"string"!=typeof f)throw new Error(`schema ${a} must be string`)}return a=(0,o.normalizeId)(a||f),this._checkUnique(a),this.schemas[a]=this._addSchema(e,t,a,c,!0),this}addMetaSchema(e,a,t=this.opts.validateSchema){return this.addSchema(e,a,!0,t),this}validateSchema(e,a){if("boolean"==typeof e)return!0;let t;if(t=e.$schema,void 0!==t&&"string"!=typeof t)throw new Error("$schema must be a string");if(t=t||this.opts.defaultMeta||this.defaultMeta(),!t)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const c=this.validate(t,e);if(!c&&a){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return c}getSchema(e){let a;for(;"string"==typeof(a=_.call(this,e));)e=a;if(void 0===a){const{schemaId:t}=this.opts,c=new i.SchemaEnv({schema:{},schemaId:t});if(a=i.resolveSchema.call(this,c,e),!a)return;this.refs[e]=a}return a.validate||this._compileSchemaEnv(a)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const a=_.call(this,e);return"object"==typeof a&&this._cache.delete(a.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const a=e;this._cache.delete(a);let t=e[this.opts.schemaId];return t&&(t=(0,o.normalizeId)(t),delete this.schemas[t],delete this.refs[t]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const a of e)this.addKeyword(a);return this}addKeyword(e,a){let t;if("string"==typeof e)t=e,"object"==typeof a&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),a.keyword=t);else{if("object"!=typeof e||void 0!==a)throw new Error("invalid addKeywords parameters");if(t=(a=e).keyword,Array.isArray(t)&&!t.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(L.call(this,t,a),!a)return(0,l.eachItem)(t,(e=>S.call(this,e))),this;N.call(this,a);const c={...a,type:(0,s.getJSONTypes)(a.type),schemaType:(0,s.getJSONTypes)(a.schemaType)};return(0,l.eachItem)(t,0===c.type.length?e=>S.call(this,e,c):e=>c.type.forEach((a=>S.call(this,e,c,a)))),this}getKeyword(e){const a=this.RULES.all[e];return"object"==typeof a?a.definition:!!a}removeKeyword(e){const{RULES:a}=this;delete a.keywords[e],delete a.all[e];for(const t of a.rules){const a=t.rules.findIndex((a=>a.keyword===e));a>=0&&t.rules.splice(a,1)}return this}addFormat(e,a){return"string"==typeof a&&(a=new RegExp(a)),this.formats[e]=a,this}errorsText(e=this.errors,{separator:a=", ",dataVar:t="data"}={}){return e&&0!==e.length?e.map((e=>`${t}${e.instancePath} ${e.message}`)).reduce(((e,t)=>e+a+t)):"No errors"}$dataMetaSchema(e,a){const t=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const c of a){const a=c.split("/").slice(1);let f=e;for(const e of a)f=f[e];for(const e in t){const a=t[e];if("object"!=typeof a)continue;const{$data:c}=a.definition,d=f[e];c&&d&&(f[e]=P(d))}}return e}_removeAllSchemas(e,a){for(const t in e){const c=e[t];a&&!a.test(t)||("string"==typeof c?delete e[t]:c&&!c.meta&&(this._cache.delete(c.schema),delete e[t]))}}_addSchema(e,a,t,c=this.opts.validateSchema,f=this.opts.addUsedSchema){let d;const{schemaId:r}=this.opts;if("object"==typeof e)d=e[r];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let n=this._cache.get(e);if(void 0!==n)return n;t=(0,o.normalizeId)(d||t);const b=o.getSchemaRefs.call(this,e,t);return n=new i.SchemaEnv({schema:e,schemaId:r,meta:a,baseId:t,localRefs:b}),this._cache.set(n.schema,n),f&&!t.startsWith("#")&&(t&&this._checkUnique(t),this.refs[t]=n),c&&this.validateSchema(e,!0),n}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):i.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const a=this.opts;this.opts=this._metaOpts;try{i.compileSchema.call(this,e)}finally{this.opts=a}}}function w(e,a,t,c="error"){for(const f in e){const d=f;d in a&&this.logger[c](`${t}: option ${f}. ${e[d]}`)}}function _(e){return e=(0,o.normalizeId)(e),this.schemas[e]||this.refs[e]}function I(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const a in e)this.addSchema(e[a],a)}function E(){for(const e in this.opts.formats){const a=this.opts.formats[e];a&&this.addFormat(e,a)}}function C(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const a in e){const t=e[a];t.keyword||(t.keyword=a),this.addKeyword(t)}}}function M(){const e={...this.opts};for(const a of g)delete e[a];return e}v.ValidationError=d.default,v.MissingRefError=r.default,a.default=v;const B={log(){},warn(){},error(){}},k=/^[a-z_$][a-z0-9_$:-]*$/i;function L(e,a){const{RULES:t}=this;if((0,l.eachItem)(e,(e=>{if(t.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!k.test(e))throw new Error(`Keyword ${e} has invalid name`)})),a&&a.$data&&!("code"in a)&&!("validate"in a))throw new Error('$data keyword must have "code" or "validate" function')}function S(e,a,t){var c;const f=null==a?void 0:a.post;if(t&&f)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:d}=this;let r=f?d.post:d.rules.find((({type:e})=>e===t));if(r||(r={type:t,rules:[]},d.rules.push(r)),d.keywords[e]=!0,!a)return;const n={keyword:e,definition:{...a,type:(0,s.getJSONTypes)(a.type),schemaType:(0,s.getJSONTypes)(a.schemaType)}};a.before?T.call(this,r,n,a.before):r.rules.push(n),d.all[e]=n,null===(c=a.implements)||void 0===c||c.forEach((e=>this.addKeyword(e)))}function T(e,a,t){const c=e.rules.findIndex((e=>e.keyword===t));c>=0?e.rules.splice(c,0,a):(e.rules.push(a),this.logger.warn(`rule ${t} is not defined`))}function N(e){let{metaSchema:a}=e;void 0!==a&&(e.$data&&this.opts.$data&&(a=P(a)),e.validateSchema=this.compile(a,!0))}const R={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function P(e){return{anyOf:[e,R]}}},76250:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(32017);c.code='require("ajv/dist/runtime/equal").default',a.default=c},53853:(e,a)=>{"use strict";function t(e){const a=e.length;let t,c=0,f=0;for(;f=55296&&t<=56319&&f{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(48343);c.code='require("ajv/dist/runtime/uri").default',a.default=c},13558:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});class t extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}a.default=t},15457:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.validateAdditionalItems=void 0;const c=t(99029),f=t(94227),d={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>c.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>c._`{limit: ${e}}`},code(e){const{parentSchema:a,it:t}=e,{items:c}=a;Array.isArray(c)?r(e,c):(0,f.checkStrictMode)(t,'"additionalItems" is ignored when "items" is not an array of schemas')}};function r(e,a){const{gen:t,schema:d,data:r,keyword:n,it:i}=e;i.items=!0;const b=t.const("len",c._`${r}.length`);if(!1===d)e.setParams({len:a.length}),e.pass(c._`${b} <= ${a.length}`);else if("object"==typeof d&&!(0,f.alwaysValidSchema)(i,d)){const d=t.var("valid",c._`${b} <= ${a.length}`);t.if((0,c.not)(d),(()=>function(d){t.forRange("i",a.length,b,(a=>{e.subschema({keyword:n,dataProp:a,dataPropType:f.Type.Num},d),i.allErrors||t.if((0,c.not)(d),(()=>t.break()))}))}(d))),e.ok(d)}}a.validateAdditionalItems=r,a.default=d},38660:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(15765),f=t(99029),d=t(42023),r=t(94227),n={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>f._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:a,schema:t,parentSchema:n,data:i,errsCount:b,it:o}=e;if(!b)throw new Error("ajv implementation error");const{allErrors:s,opts:l}=o;if(o.props=!0,"all"!==l.removeAdditional&&(0,r.alwaysValidSchema)(o,t))return;const u=(0,c.allSchemaProperties)(n.properties),h=(0,c.allSchemaProperties)(n.patternProperties);function p(e){a.code(f._`delete ${i}[${e}]`)}function g(c){if("all"===l.removeAdditional||l.removeAdditional&&!1===t)p(c);else{if(!1===t)return e.setParams({additionalProperty:c}),e.error(),void(s||a.break());if("object"==typeof t&&!(0,r.alwaysValidSchema)(o,t)){const t=a.name("valid");"failing"===l.removeAdditional?(m(c,t,!1),a.if((0,f.not)(t),(()=>{e.reset(),p(c)}))):(m(c,t),s||a.if((0,f.not)(t),(()=>a.break())))}}}function m(a,t,c){const f={keyword:"additionalProperties",dataProp:a,dataPropType:r.Type.Str};!1===c&&Object.assign(f,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(f,t)}a.forIn("key",i,(t=>{u.length||h.length?a.if(function(t){let d;if(u.length>8){const e=(0,r.schemaRefOrVal)(o,n.properties,"properties");d=(0,c.isOwnProperty)(a,e,t)}else d=u.length?(0,f.or)(...u.map((e=>f._`${t} === ${e}`))):f.nil;return h.length&&(d=(0,f.or)(d,...h.map((a=>f._`${(0,c.usePattern)(e,a)}.test(${t})`)))),(0,f.not)(d)}(t),(()=>g(t))):g(t)})),e.ok(f._`${b} === ${d.default.errors}`)}};a.default=n},15844:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(94227),f={keyword:"allOf",schemaType:"array",code(e){const{gen:a,schema:t,it:f}=e;if(!Array.isArray(t))throw new Error("ajv implementation error");const d=a.name("valid");t.forEach(((a,t)=>{if((0,c.alwaysValidSchema)(f,a))return;const r=e.subschema({keyword:"allOf",schemaProp:t},d);e.ok(d),e.mergeEvaluated(r)}))}};a.default=f},16505:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:t(15765).validateUnion,error:{message:"must match a schema in anyOf"}};a.default=c},12661:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:a}})=>void 0===a?c.str`must contain at least ${e} valid item(s)`:c.str`must contain at least ${e} and no more than ${a} valid item(s)`,params:({params:{min:e,max:a}})=>void 0===a?c._`{minContains: ${e}}`:c._`{minContains: ${e}, maxContains: ${a}}`},code(e){const{gen:a,schema:t,parentSchema:d,data:r,it:n}=e;let i,b;const{minContains:o,maxContains:s}=d;n.opts.next?(i=void 0===o?1:o,b=s):i=1;const l=a.const("len",c._`${r}.length`);if(e.setParams({min:i,max:b}),void 0===b&&0===i)return void(0,f.checkStrictMode)(n,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==b&&i>b)return(0,f.checkStrictMode)(n,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,f.alwaysValidSchema)(n,t)){let a=c._`${l} >= ${i}`;return void 0!==b&&(a=c._`${a} && ${l} <= ${b}`),void e.pass(a)}n.items=!0;const u=a.name("valid");function h(){const e=a.name("_valid"),t=a.let("count",0);p(e,(()=>a.if(e,(()=>function(e){a.code(c._`${e}++`),void 0===b?a.if(c._`${e} >= ${i}`,(()=>a.assign(u,!0).break())):(a.if(c._`${e} > ${b}`,(()=>a.assign(u,!1).break())),1===i?a.assign(u,!0):a.if(c._`${e} >= ${i}`,(()=>a.assign(u,!0))))}(t)))))}function p(t,c){a.forRange("i",0,l,(a=>{e.subschema({keyword:"contains",dataProp:a,dataPropType:f.Type.Num,compositeRule:!0},t),c()}))}void 0===b&&1===i?p(u,(()=>a.if(u,(()=>a.break())))):0===i?(a.let(u,!0),void 0!==b&&a.if(c._`${r}.length > 0`,h)):(a.let(u,!1),h()),e.result(u,(()=>e.reset()))}};a.default=d},83025:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.validateSchemaDeps=a.validatePropertyDeps=a.error=void 0;const c=t(99029),f=t(94227),d=t(15765);a.error={message:({params:{property:e,depsCount:a,deps:t}})=>{const f=1===a?"property":"properties";return c.str`must have ${f} ${t} when property ${e} is present`},params:({params:{property:e,depsCount:a,deps:t,missingProperty:f}})=>c._`{property: ${e}, missingProperty: ${f}, depsCount: ${a}, - deps: ${t}}`};const r={keyword:"dependencies",type:"object",schemaType:"object",error:a.error,code(e){const[a,t]=function({schema:e}){const a={},t={};for(const c in e)"__proto__"!==c&&((Array.isArray(e[c])?a:t)[c]=e[c]);return[a,t]}(e);n(e,a),i(e,t)}};function n(e,a=e.schema){const{gen:t,data:f,it:r}=e;if(0===Object.keys(a).length)return;const n=t.let("missing");for(const i in a){const b=a[i];if(0===b.length)continue;const o=(0,d.propertyInData)(t,f,i,r.opts.ownProperties);e.setParams({property:i,depsCount:b.length,deps:b.join(", ")}),r.allErrors?t.if(o,(()=>{for(const a of b)(0,d.checkReportMissingProp)(e,a)})):(t.if(c._`${o} && (${(0,d.checkMissingProp)(e,b,n)})`),(0,d.reportMissingProp)(e,n),t.else())}}function i(e,a=e.schema){const{gen:t,data:c,keyword:r,it:n}=e,i=t.name("valid");for(const b in a)(0,f.alwaysValidSchema)(n,a[b])||(t.if((0,d.propertyInData)(t,c,b,n.opts.ownProperties),(()=>{const a=e.subschema({keyword:r,schemaProp:b},i);e.mergeValidEvaluated(a,i)}),(()=>t.var(i,!0))),e.ok(i))}a.validatePropertyDeps=n,a.validateSchemaDeps=i,a.default=r},1239:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>c.str`must match "${e.ifClause}" schema`,params:({params:e})=>c._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:a,parentSchema:t,it:d}=e;void 0===t.then&&void 0===t.else&&(0,f.checkStrictMode)(d,'"if" without "then" and "else" is ignored');const n=r(d,"then"),i=r(d,"else");if(!n&&!i)return;const b=a.let("valid",!0),o=a.name("_valid");if(function(){const a=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},o);e.mergeEvaluated(a)}(),e.reset(),n&&i){const t=a.let("ifClause");e.setParams({ifClause:t}),a.if(o,s("then",t),s("else",t))}else n?a.if(o,s("then")):a.if((0,c.not)(o),s("else"));function s(t,f){return()=>{const d=e.subschema({keyword:t},o);a.assign(b,o),e.mergeValidEvaluated(d,b),f?a.assign(f,c._`${t}`):e.setParams({ifClause:t})}}e.pass(b,(()=>e.error(!0)))}};function r(e,a){const t=e.schema[a];return void 0!==t&&!(0,f.alwaysValidSchema)(e,t)}a.default=d},56378:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(15457),f=t(65354),d=t(20494),r=t(93966),n=t(12661),i=t(83025),b=t(19713),o=t(38660),s=t(40117),l=t(45333),u=t(57923),h=t(16505),p=t(96163),g=t(15844),m=t(1239),y=t(14426);a.default=function(e=!1){const a=[u.default,h.default,p.default,g.default,m.default,y.default,b.default,o.default,i.default,s.default,l.default];return e?a.push(f.default,r.default):a.push(c.default,d.default),a.push(n.default),a}},20494:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.validateTuple=void 0;const c=t(99029),f=t(94227),d=t(15765),r={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:a,it:t}=e;if(Array.isArray(a))return n(e,"additionalItems",a);t.items=!0,(0,f.alwaysValidSchema)(t,a)||e.ok((0,d.validateArray)(e))}};function n(e,a,t=e.schema){const{gen:d,parentSchema:r,data:n,keyword:i,it:b}=e;!function(e){const{opts:c,errSchemaPath:d}=b,r=t.length,n=r===e.minItems&&(r===e.maxItems||!1===e[a]);if(c.strictTuples&&!n){const e=`"${i}" is ${r}-tuple, but minItems or maxItems/${a} are not specified or different at path "${d}"`;(0,f.checkStrictMode)(b,e,c.strictTuples)}}(r),b.opts.unevaluated&&t.length&&!0!==b.items&&(b.items=f.mergeEvaluated.items(d,t.length,b.items));const o=d.name("valid"),s=d.const("len",c._`${n}.length`);t.forEach(((a,t)=>{(0,f.alwaysValidSchema)(b,a)||(d.if(c._`${s} > ${t}`,(()=>e.subschema({keyword:i,schemaProp:t,dataProp:t},o))),e.ok(o))}))}a.validateTuple=n,a.default=r},93966:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d=t(15765),r=t(15457),n={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>c.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>c._`{limit: ${e}}`},code(e){const{schema:a,parentSchema:t,it:c}=e,{prefixItems:n}=t;c.items=!0,(0,f.alwaysValidSchema)(c,a)||(n?(0,r.validateAdditionalItems)(e,n):e.ok((0,d.validateArray)(e)))}};a.default=n},57923:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(94227),f={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:a,schema:t,it:f}=e;if((0,c.alwaysValidSchema)(f,t))return void e.fail();const d=a.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},d),e.failResult(d,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};a.default=f},96163:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>c._`{passingSchemas: ${e.passing}}`},code(e){const{gen:a,schema:t,parentSchema:d,it:r}=e;if(!Array.isArray(t))throw new Error("ajv implementation error");if(r.opts.discriminator&&d.discriminator)return;const n=t,i=a.let("valid",!1),b=a.let("passing",null),o=a.name("_valid");e.setParams({passing:b}),a.block((function(){n.forEach(((t,d)=>{let n;(0,f.alwaysValidSchema)(r,t)?a.var(o,!0):n=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},o),d>0&&a.if(c._`${o} && ${i}`).assign(i,!1).assign(b,c._`[${b}, ${d}]`).else(),a.if(o,(()=>{a.assign(i,!0),a.assign(b,d),n&&e.mergeEvaluated(n,c.Name)}))}))})),e.result(i,(()=>e.reset()),(()=>e.error(!0)))}};a.default=d},45333:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(15765),f=t(99029),d=t(94227),r=t(94227),n={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:a,schema:t,data:n,parentSchema:i,it:b}=e,{opts:o}=b,s=(0,c.allSchemaProperties)(t),l=s.filter((e=>(0,d.alwaysValidSchema)(b,t[e])));if(0===s.length||l.length===s.length&&(!b.opts.unevaluated||!0===b.props))return;const u=o.strictSchema&&!o.allowMatchingProperties&&i.properties,h=a.name("valid");!0===b.props||b.props instanceof f.Name||(b.props=(0,r.evaluatedPropsToName)(a,b.props));const{props:p}=b;function g(e){for(const a in u)new RegExp(e).test(a)&&(0,d.checkStrictMode)(b,`property ${a} matches pattern ${e} (use allowMatchingProperties)`)}function m(t){a.forIn("key",n,(d=>{a.if(f._`${(0,c.usePattern)(e,t)}.test(${d})`,(()=>{const c=l.includes(t);c||e.subschema({keyword:"patternProperties",schemaProp:t,dataProp:d,dataPropType:r.Type.Str},h),b.opts.unevaluated&&!0!==p?a.assign(f._`${p}[${d}]`,!0):c||b.allErrors||a.if((0,f.not)(h),(()=>a.break()))}))}))}!function(){for(const e of s)u&&g(e),b.allErrors?m(e):(a.var(h,!0),m(e),a.if(h))}()}};a.default=n},65354:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(20494),f={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,c.validateTuple)(e,"items")};a.default=f},40117:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(62586),f=t(15765),d=t(94227),r=t(38660),n={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:a,schema:t,parentSchema:n,data:i,it:b}=e;"all"===b.opts.removeAdditional&&void 0===n.additionalProperties&&r.default.code(new c.KeywordCxt(b,r.default,"additionalProperties"));const o=(0,f.allSchemaProperties)(t);for(const e of o)b.definedProperties.add(e);b.opts.unevaluated&&o.length&&!0!==b.props&&(b.props=d.mergeEvaluated.props(a,(0,d.toHash)(o),b.props));const s=o.filter((e=>!(0,d.alwaysValidSchema)(b,t[e])));if(0===s.length)return;const l=a.name("valid");for(const t of s)u(t)?h(t):(a.if((0,f.propertyInData)(a,i,t,b.opts.ownProperties)),h(t),b.allErrors||a.else().var(l,!0),a.endIf()),e.it.definedProperties.add(t),e.ok(l);function u(e){return b.opts.useDefaults&&!b.compositeRule&&void 0!==t[e].default}function h(a){e.subschema({keyword:"properties",schemaProp:a,dataProp:a},l)}}};a.default=n},19713:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>c._`{propertyName: ${e.propertyName}}`},code(e){const{gen:a,schema:t,data:d,it:r}=e;if((0,f.alwaysValidSchema)(r,t))return;const n=a.name("valid");a.forIn("key",d,(t=>{e.setParams({propertyName:t}),e.subschema({keyword:"propertyNames",data:t,dataTypes:["string"],propertyName:t,compositeRule:!0},n),a.if((0,c.not)(n),(()=>{e.error(!0),r.allErrors||a.break()}))})),e.ok(n)}};a.default=d},14426:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(94227),f={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:a,it:t}){void 0===a.if&&(0,c.checkStrictMode)(t,`"${e}" without "if" is ignored`)}};a.default=f},15765:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.validateUnion=a.validateArray=a.usePattern=a.callValidateCode=a.schemaProperties=a.allSchemaProperties=a.noPropertyInData=a.propertyInData=a.isOwnProperty=a.hasPropFunc=a.reportMissingProp=a.checkMissingProp=a.checkReportMissingProp=void 0;const c=t(99029),f=t(94227),d=t(42023),r=t(94227);function n(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:c._`Object.prototype.hasOwnProperty`})}function i(e,a,t){return c._`${n(e)}.call(${a}, ${t})`}function b(e,a,t,f){const d=c._`${a}${(0,c.getProperty)(t)} === undefined`;return f?(0,c.or)(d,(0,c.not)(i(e,a,t))):d}function o(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}a.checkReportMissingProp=function(e,a){const{gen:t,data:f,it:d}=e;t.if(b(t,f,a,d.opts.ownProperties),(()=>{e.setParams({missingProperty:c._`${a}`},!0),e.error()}))},a.checkMissingProp=function({gen:e,data:a,it:{opts:t}},f,d){return(0,c.or)(...f.map((f=>(0,c.and)(b(e,a,f,t.ownProperties),c._`${d} = ${f}`))))},a.reportMissingProp=function(e,a){e.setParams({missingProperty:a},!0),e.error()},a.hasPropFunc=n,a.isOwnProperty=i,a.propertyInData=function(e,a,t,f){const d=c._`${a}${(0,c.getProperty)(t)} !== undefined`;return f?c._`${d} && ${i(e,a,t)}`:d},a.noPropertyInData=b,a.allSchemaProperties=o,a.schemaProperties=function(e,a){return o(a).filter((t=>!(0,f.alwaysValidSchema)(e,a[t])))},a.callValidateCode=function({schemaCode:e,data:a,it:{gen:t,topSchemaRef:f,schemaPath:r,errorPath:n},it:i},b,o,s){const l=s?c._`${e}, ${a}, ${f}${r}`:a,u=[[d.default.instancePath,(0,c.strConcat)(d.default.instancePath,n)],[d.default.parentData,i.parentData],[d.default.parentDataProperty,i.parentDataProperty],[d.default.rootData,d.default.rootData]];i.opts.dynamicRef&&u.push([d.default.dynamicAnchors,d.default.dynamicAnchors]);const h=c._`${l}, ${t.object(...u)}`;return o!==c.nil?c._`${b}.call(${o}, ${h})`:c._`${b}(${h})`};const s=c._`new RegExp`;a.usePattern=function({gen:e,it:{opts:a}},t){const f=a.unicodeRegExp?"u":"",{regExp:d}=a.code,n=d(t,f);return e.scopeValue("pattern",{key:n.toString(),ref:n,code:c._`${"new RegExp"===d.code?s:(0,r.useFunc)(e,d)}(${t}, ${f})`})},a.validateArray=function(e){const{gen:a,data:t,keyword:d,it:r}=e,n=a.name("valid");if(r.allErrors){const e=a.let("valid",!0);return i((()=>a.assign(e,!1))),e}return a.var(n,!0),i((()=>a.break())),n;function i(r){const i=a.const("len",c._`${t}.length`);a.forRange("i",0,i,(t=>{e.subschema({keyword:d,dataProp:t,dataPropType:f.Type.Num},n),a.if((0,c.not)(n),r)}))}},a.validateUnion=function(e){const{gen:a,schema:t,keyword:d,it:r}=e;if(!Array.isArray(t))throw new Error("ajv implementation error");if(t.some((e=>(0,f.alwaysValidSchema)(r,e)))&&!r.opts.unevaluated)return;const n=a.let("valid",!1),i=a.name("_valid");a.block((()=>t.forEach(((t,f)=>{const r=e.subschema({keyword:d,schemaProp:f,compositeRule:!0},i);a.assign(n,c._`${n} || ${i}`),e.mergeValidEvaluated(r,i)||a.if((0,c.not)(n))})))),e.result(n,(()=>e.reset()),(()=>e.error(!0)))}},83463:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const t={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};a.default=t},72128:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(83463),f=t(13693),d=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",c.default,f.default];a.default=d},13693:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.callRef=a.getValidate=void 0;const c=t(34551),f=t(15765),d=t(99029),r=t(42023),n=t(73835),i=t(94227),b={keyword:"$ref",schemaType:"string",code(e){const{gen:a,schema:t,it:f}=e,{baseId:r,schemaEnv:i,validateName:b,opts:l,self:u}=f,{root:h}=i;if(("#"===t||"#/"===t)&&r===h.baseId)return function(){if(i===h)return s(e,b,i,i.$async);const t=a.scopeValue("root",{ref:h});return s(e,d._`${t}.validate`,h,h.$async)}();const p=n.resolveRef.call(u,h,r,t);if(void 0===p)throw new c.default(f.opts.uriResolver,r,t);return p instanceof n.SchemaEnv?function(a){const t=o(e,a);s(e,t,a,a.$async)}(p):function(c){const f=a.scopeValue("schema",!0===l.code.source?{ref:c,code:(0,d.stringify)(c)}:{ref:c}),r=a.name("valid"),n=e.subschema({schema:c,dataTypes:[],schemaPath:d.nil,topSchemaRef:f,errSchemaPath:t},r);e.mergeEvaluated(n),e.ok(r)}(p)}};function o(e,a){const{gen:t}=e;return a.validate?t.scopeValue("validate",{ref:a.validate}):d._`${t.scopeValue("wrapper",{ref:a})}.validate`}function s(e,a,t,c){const{gen:n,it:b}=e,{allErrors:o,schemaEnv:s,opts:l}=b,u=l.passContext?r.default.this:d.nil;function h(e){const a=d._`${e}.errors`;n.assign(r.default.vErrors,d._`${r.default.vErrors} === null ? ${a} : ${r.default.vErrors}.concat(${a})`),n.assign(r.default.errors,d._`${r.default.vErrors}.length`)}function p(e){var a;if(!b.opts.unevaluated)return;const c=null===(a=null==t?void 0:t.validate)||void 0===a?void 0:a.evaluated;if(!0!==b.props)if(c&&!c.dynamicProps)void 0!==c.props&&(b.props=i.mergeEvaluated.props(n,c.props,b.props));else{const a=n.var("props",d._`${e}.evaluated.props`);b.props=i.mergeEvaluated.props(n,a,b.props,d.Name)}if(!0!==b.items)if(c&&!c.dynamicItems)void 0!==c.items&&(b.items=i.mergeEvaluated.items(n,c.items,b.items));else{const a=n.var("items",d._`${e}.evaluated.items`);b.items=i.mergeEvaluated.items(n,a,b.items,d.Name)}}c?function(){if(!s.$async)throw new Error("async schema referenced by sync schema");const t=n.let("valid");n.try((()=>{n.code(d._`await ${(0,f.callValidateCode)(e,a,u)}`),p(a),o||n.assign(t,!0)}),(e=>{n.if(d._`!(${e} instanceof ${b.ValidationError})`,(()=>n.throw(e))),h(e),o||n.assign(t,!1)})),e.ok(t)}():e.result((0,f.callValidateCode)(e,a,u),(()=>p(a)),(()=>h(a)))}a.getValidate=o,a.callRef=s,a.default=b},36653:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(97652),d=t(73835),r=t(34551),n=t(94227),i={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:a}})=>e===f.DiscrError.Tag?`tag "${a}" must be string`:`value of tag "${a}" must be in oneOf`,params:({params:{discrError:e,tag:a,tagName:t}})=>c._`{error: ${e}, tag: ${t}, tagValue: ${a}}`},code(e){const{gen:a,data:t,schema:i,parentSchema:b,it:o}=e,{oneOf:s}=b;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");const l=i.propertyName;if("string"!=typeof l)throw new Error("discriminator: requires propertyName");if(i.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");const u=a.let("valid",!1),h=a.const("tag",c._`${t}${(0,c.getProperty)(l)}`);function p(t){const f=a.name("valid"),d=e.subschema({keyword:"oneOf",schemaProp:t},f);return e.mergeEvaluated(d,c.Name),f}a.if(c._`typeof ${h} == "string"`,(()=>function(){const t=function(){var e;const a={},t=f(b);let c=!0;for(let a=0;ae.error(!1,{discrError:f.DiscrError.Tag,tag:h,tagName:l}))),e.ok(u)}};a.default=i},97652:(e,a)=>{"use strict";var t;Object.defineProperty(a,"__esModule",{value:!0}),a.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(t||(a.DiscrError=t={}))},86144:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(72128),f=t(67060),d=t(56378),r=t(97532),n=t(69857),i=[c.default,f.default,(0,d.default)(),r.default,n.metadataVocabulary,n.contentVocabulary];a.default=i},94737:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>c.str`must match format "${e}"`,params:({schemaCode:e})=>c._`{format: ${e}}`},code(e,a){const{gen:t,data:f,$data:d,schema:r,schemaCode:n,it:i}=e,{opts:b,errSchemaPath:o,schemaEnv:s,self:l}=i;b.validateFormats&&(d?function(){const d=t.scopeValue("formats",{ref:l.formats,code:b.code.formats}),r=t.const("fDef",c._`${d}[${n}]`),i=t.let("fType"),o=t.let("format");t.if(c._`typeof ${r} == "object" && !(${r} instanceof RegExp)`,(()=>t.assign(i,c._`${r}.type || "string"`).assign(o,c._`${r}.validate`)),(()=>t.assign(i,c._`"string"`).assign(o,r))),e.fail$data((0,c.or)(!1===b.strictSchema?c.nil:c._`${n} && !${o}`,function(){const e=s.$async?c._`(${r}.async ? await ${o}(${f}) : ${o}(${f}))`:c._`${o}(${f})`,t=c._`(typeof ${o} == "function" ? ${e} : ${o}.test(${f}))`;return c._`${o} && ${o} !== true && ${i} === ${a} && !${t}`}()))}():function(){const d=l.formats[r];if(!d)return void function(){if(!1!==b.strictSchema)throw new Error(e());function e(){return`unknown format "${r}" ignored in schema at path "${o}"`}l.logger.warn(e())}();if(!0===d)return;const[n,i,u]=function(e){const a=e instanceof RegExp?(0,c.regexpCode)(e):b.code.formats?c._`${b.code.formats}${(0,c.getProperty)(r)}`:void 0,f=t.scopeValue("formats",{key:r,ref:e,code:a});return"object"!=typeof e||e instanceof RegExp?["string",e,f]:[e.type||"string",e.validate,c._`${f}.validate`]}(d);n===a&&e.pass(function(){if("object"==typeof d&&!(d instanceof RegExp)&&d.async){if(!s.$async)throw new Error("async format in sync schema");return c._`await ${u}(${f})`}return"function"==typeof i?c._`${u}(${f})`:c._`${u}.test(${f})`}())}())}};a.default=f},97532:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=[t(94737).default];a.default=c},69857:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.contentVocabulary=a.metadataVocabulary=void 0,a.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],a.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},27935:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d=t(76250),r={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>c._`{allowedValue: ${e}}`},code(e){const{gen:a,data:t,$data:r,schemaCode:n,schema:i}=e;r||i&&"object"==typeof i?e.fail$data(c._`!${(0,f.useFunc)(a,d.default)}(${t}, ${n})`):e.fail(c._`${i} !== ${t}`)}};a.default=r},28643:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d=t(76250),r={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>c._`{allowedValues: ${e}}`},code(e){const{gen:a,data:t,$data:r,schema:n,schemaCode:i,it:b}=e;if(!r&&0===n.length)throw new Error("enum must have non-empty array");const o=n.length>=b.opts.loopEnum;let s;const l=()=>null!=s?s:s=(0,f.useFunc)(a,d.default);let u;if(o||r)u=a.let("valid"),e.block$data(u,(function(){a.assign(u,!1),a.forOf("v",i,(e=>a.if(c._`${l()}(${t}, ${e})`,(()=>a.assign(u,!0).break()))))}));else{if(!Array.isArray(n))throw new Error("ajv implementation error");const e=a.const("vSchema",i);u=(0,c.or)(...n.map(((a,f)=>function(e,a){const f=n[a];return"object"==typeof f&&null!==f?c._`${l()}(${t}, ${e}[${a}])`:c._`${t} === ${f}`}(e,f))))}e.pass(u)}};a.default=r},67060:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(75882),f=t(63439),d=t(77307),r=t(90422),n=t(34486),i=t(34003),b=t(61163),o=t(60617),s=t(27935),l=t(28643),u=[c.default,f.default,d.default,r.default,n.default,i.default,b.default,o.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},s.default,l.default];a.default=u},61163:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:a}){const t="maxItems"===e?"more":"fewer";return c.str`must NOT have ${t} than ${a} items`},params:({schemaCode:e})=>c._`{limit: ${e}}`},code(e){const{keyword:a,data:t,schemaCode:f}=e,d="maxItems"===a?c.operators.GT:c.operators.LT;e.fail$data(c._`${t}.length ${d} ${f}`)}};a.default=f},77307:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d=t(53853),r={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:a}){const t="maxLength"===e?"more":"fewer";return c.str`must NOT have ${t} than ${a} characters`},params:({schemaCode:e})=>c._`{limit: ${e}}`},code(e){const{keyword:a,data:t,schemaCode:r,it:n}=e,i="maxLength"===a?c.operators.GT:c.operators.LT,b=!1===n.opts.unicode?c._`${t}.length`:c._`${(0,f.useFunc)(e.gen,d.default)}(${t})`;e.fail$data(c._`${b} ${i} ${r}`)}};a.default=r},75882:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=c.operators,d={maximum:{okStr:"<=",ok:f.LTE,fail:f.GT},minimum:{okStr:">=",ok:f.GTE,fail:f.LT},exclusiveMaximum:{okStr:"<",ok:f.LT,fail:f.GTE},exclusiveMinimum:{okStr:">",ok:f.GT,fail:f.LTE}},r={message:({keyword:e,schemaCode:a})=>c.str`must be ${d[e].okStr} ${a}`,params:({keyword:e,schemaCode:a})=>c._`{comparison: ${d[e].okStr}, limit: ${a}}`},n={keyword:Object.keys(d),type:"number",schemaType:"number",$data:!0,error:r,code(e){const{keyword:a,data:t,schemaCode:f}=e;e.fail$data(c._`${t} ${d[a].fail} ${f} || isNaN(${t})`)}};a.default=n},34486:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:a}){const t="maxProperties"===e?"more":"fewer";return c.str`must NOT have ${t} than ${a} properties`},params:({schemaCode:e})=>c._`{limit: ${e}}`},code(e){const{keyword:a,data:t,schemaCode:f}=e,d="maxProperties"===a?c.operators.GT:c.operators.LT;e.fail$data(c._`Object.keys(${t}).length ${d} ${f}`)}};a.default=f},63439:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>c.str`must be multiple of ${e}`,params:({schemaCode:e})=>c._`{multipleOf: ${e}}`},code(e){const{gen:a,data:t,schemaCode:f,it:d}=e,r=d.opts.multipleOfPrecision,n=a.let("res"),i=r?c._`Math.abs(Math.round(${n}) - ${n}) > 1e-${r}`:c._`${n} !== parseInt(${n})`;e.fail$data(c._`(${f} === 0 || (${n} = ${t}/${f}, ${i}))`)}};a.default=f},90422:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(15765),f=t(99029),d={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>f.str`must match pattern "${e}"`,params:({schemaCode:e})=>f._`{pattern: ${e}}`},code(e){const{data:a,$data:t,schema:d,schemaCode:r,it:n}=e,i=n.opts.unicodeRegExp?"u":"",b=t?f._`(new RegExp(${r}, ${i}))`:(0,c.usePattern)(e,d);e.fail$data(f._`!${b}.test(${a})`)}};a.default=d},34003:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(15765),f=t(99029),d=t(94227),r={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>f.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>f._`{missingProperty: ${e}}`},code(e){const{gen:a,schema:t,schemaCode:r,data:n,$data:i,it:b}=e,{opts:o}=b;if(!i&&0===t.length)return;const s=t.length>=o.loopRequired;if(b.allErrors?function(){if(s||i)e.block$data(f.nil,l);else for(const a of t)(0,c.checkReportMissingProp)(e,a)}():function(){const d=a.let("missing");if(s||i){const t=a.let("valid",!0);e.block$data(t,(()=>function(t,d){e.setParams({missingProperty:t}),a.forOf(t,r,(()=>{a.assign(d,(0,c.propertyInData)(a,n,t,o.ownProperties)),a.if((0,f.not)(d),(()=>{e.error(),a.break()}))}),f.nil)}(d,t))),e.ok(t)}else a.if((0,c.checkMissingProp)(e,t,d)),(0,c.reportMissingProp)(e,d),a.else()}(),o.strictRequired){const a=e.parentSchema.properties,{definedProperties:c}=e.it;for(const e of t)if(void 0===(null==a?void 0:a[e])&&!c.has(e)){const a=`required property "${e}" is not defined at "${b.schemaEnv.baseId+b.errSchemaPath}" (strictRequired)`;(0,d.checkStrictMode)(b,a,b.opts.strictRequired)}}function l(){a.forOf("prop",r,(t=>{e.setParams({missingProperty:t}),a.if((0,c.noPropertyInData)(a,n,t,o.ownProperties),(()=>e.error()))}))}}};a.default=r},60617:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(10208),f=t(99029),d=t(94227),r=t(76250),n={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:a}})=>f.str`must NOT have duplicate items (items ## ${a} and ${e} are identical)`,params:({params:{i:e,j:a}})=>f._`{i: ${e}, j: ${a}}`},code(e){const{gen:a,data:t,$data:n,schema:i,parentSchema:b,schemaCode:o,it:s}=e;if(!n&&!i)return;const l=a.let("valid"),u=b.items?(0,c.getSchemaTypes)(b.items):[];function h(d,r){const n=a.name("item"),i=(0,c.checkDataTypes)(u,n,s.opts.strictNumbers,c.DataType.Wrong),b=a.const("indices",f._`{}`);a.for(f._`;${d}--;`,(()=>{a.let(n,f._`${t}[${d}]`),a.if(i,f._`continue`),u.length>1&&a.if(f._`typeof ${n} == "string"`,f._`${n} += "_"`),a.if(f._`typeof ${b}[${n}] == "number"`,(()=>{a.assign(r,f._`${b}[${n}]`),e.error(),a.assign(l,!1).break()})).code(f._`${b}[${n}] = ${d}`)}))}function p(c,n){const i=(0,d.useFunc)(a,r.default),b=a.name("outer");a.label(b).for(f._`;${c}--;`,(()=>a.for(f._`${n} = ${c}; ${n}--;`,(()=>a.if(f._`${i}(${t}[${c}], ${t}[${n}])`,(()=>{e.error(),a.assign(l,!1).break(b)}))))))}e.block$data(l,(function(){const c=a.let("i",f._`${t}.length`),d=a.let("j");e.setParams({i:c,j:d}),a.assign(l,!0),a.if(f._`${c} > 1`,(()=>(u.length>0&&!u.some((e=>"object"===e||"array"===e))?h:p)(c,d)))}),f._`${o} === false`),e.ok(l)}};a.default=n},87568:(e,a,t)=>{var c=a;c.bignum=t(72344),c.define=t(47363).define,c.base=t(9673),c.constants=t(22153),c.decoders=t(22853),c.encoders=t(24669)},47363:(e,a,t)=>{var c=t(87568),f=t(56698);function d(e,a){this.name=e,this.body=a,this.decoders={},this.encoders={}}a.define=function(e,a){return new d(e,a)},d.prototype._createNamed=function(e){var a;try{a=t(68961).runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(e){a=function(e){this._initNamed(e)}}return f(a,e),a.prototype._initNamed=function(a){e.call(this,a)},new a(this)},d.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(c.decoders[e])),this.decoders[e]},d.prototype.decode=function(e,a,t){return this._getDecoder(a).decode(e,t)},d.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(c.encoders[e])),this.encoders[e]},d.prototype.encode=function(e,a,t){return this._getEncoder(a).encode(e,t)}},47227:(e,a,t)=>{var c=t(56698),f=t(9673).Reporter,d=t(48287).Buffer;function r(e,a){f.call(this,a),d.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function n(e,a){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return e instanceof n||(e=new n(e,a)),this.length+=e.length,e}),this);else if("number"==typeof e){if(!(0<=e&&e<=255))return a.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=d.byteLength(e);else{if(!d.isBuffer(e))return a.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}c(r,f),a.t=r,r.prototype.save=function(){return{offset:this.offset,reporter:f.prototype.save.call(this)}},r.prototype.restore=function(e){var a=new r(this.base);return a.offset=e.offset,a.length=this.offset,this.offset=e.offset,f.prototype.restore.call(this,e.reporter),a},r.prototype.isEmpty=function(){return this.offset===this.length},r.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},r.prototype.skip=function(e,a){if(!(this.offset+e<=this.length))return this.error(a||"DecoderBuffer overrun");var t=new r(this.base);return t._reporterState=this._reporterState,t.offset=this.offset,t.length=this.offset+e,this.offset+=e,t},r.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},a.d=n,n.prototype.join=function(e,a){return e||(e=new d(this.length)),a||(a=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(t){t.join(e,a),a+=t.length})):("number"==typeof this.value?e[a]=this.value:"string"==typeof this.value?e.write(this.value,a):d.isBuffer(this.value)&&this.value.copy(e,a),a+=this.length)),e}},9673:(e,a,t)=>{var c=a;c.Reporter=t(89220).a,c.DecoderBuffer=t(47227).t,c.EncoderBuffer=t(47227).d,c.Node=t(90993)},90993:(e,a,t)=>{var c=t(9673).Reporter,f=t(9673).EncoderBuffer,d=t(9673).DecoderBuffer,r=t(43349),n=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],i=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(n);function b(e,a){var t={};this._baseState=t,t.enc=e,t.parent=a||null,t.children=null,t.tag=null,t.args=null,t.reverseArgs=null,t.choice=null,t.optional=!1,t.any=!1,t.obj=!1,t.use=null,t.useDecoder=null,t.key=null,t.default=null,t.explicit=null,t.implicit=null,t.contains=null,t.parent||(t.children=[],this._wrap())}e.exports=b;var o=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];b.prototype.clone=function(){var e=this._baseState,a={};o.forEach((function(t){a[t]=e[t]}));var t=new this.constructor(a.parent);return t._baseState=a,t},b.prototype._wrap=function(){var e=this._baseState;i.forEach((function(a){this[a]=function(){var t=new this.constructor(this);return e.children.push(t),t[a].apply(t,arguments)}}),this)},b.prototype._init=function(e){var a=this._baseState;r(null===a.parent),e.call(this),a.children=a.children.filter((function(e){return e._baseState.parent===this}),this),r.equal(a.children.length,1,"Root node can have only one child")},b.prototype._useArgs=function(e){var a=this._baseState,t=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==t.length&&(r(null===a.children),a.children=t,t.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(r(null===a.args),a.args=e,a.reverseArgs=e.map((function(e){if("object"!=typeof e||e.constructor!==Object)return e;var a={};return Object.keys(e).forEach((function(t){t==(0|t)&&(t|=0);var c=e[t];a[c]=t})),a})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){b.prototype[e]=function(){var a=this._baseState;throw new Error(e+" not implemented for encoding: "+a.enc)}})),n.forEach((function(e){b.prototype[e]=function(){var a=this._baseState,t=Array.prototype.slice.call(arguments);return r(null===a.tag),a.tag=e,this._useArgs(t),this}})),b.prototype.use=function(e){r(e);var a=this._baseState;return r(null===a.use),a.use=e,this},b.prototype.optional=function(){return this._baseState.optional=!0,this},b.prototype.def=function(e){var a=this._baseState;return r(null===a.default),a.default=e,a.optional=!0,this},b.prototype.explicit=function(e){var a=this._baseState;return r(null===a.explicit&&null===a.implicit),a.explicit=e,this},b.prototype.implicit=function(e){var a=this._baseState;return r(null===a.explicit&&null===a.implicit),a.implicit=e,this},b.prototype.obj=function(){var e=this._baseState,a=Array.prototype.slice.call(arguments);return e.obj=!0,0!==a.length&&this._useArgs(a),this},b.prototype.key=function(e){var a=this._baseState;return r(null===a.key),a.key=e,this},b.prototype.any=function(){return this._baseState.any=!0,this},b.prototype.choice=function(e){var a=this._baseState;return r(null===a.choice),a.choice=e,this._useArgs(Object.keys(e).map((function(a){return e[a]}))),this},b.prototype.contains=function(e){var a=this._baseState;return r(null===a.use),a.contains=e,this},b.prototype._decode=function(e,a){var t=this._baseState;if(null===t.parent)return e.wrapResult(t.children[0]._decode(e,a));var c,f=t.default,r=!0,n=null;if(null!==t.key&&(n=e.enterKey(t.key)),t.optional){var i=null;if(null!==t.explicit?i=t.explicit:null!==t.implicit?i=t.implicit:null!==t.tag&&(i=t.tag),null!==i||t.any){if(r=this._peekTag(e,i,t.any),e.isError(r))return r}else{var b=e.save();try{null===t.choice?this._decodeGeneric(t.tag,e,a):this._decodeChoice(e,a),r=!0}catch(e){r=!1}e.restore(b)}}if(t.obj&&r&&(c=e.enterObject()),r){if(null!==t.explicit){var o=this._decodeTag(e,t.explicit);if(e.isError(o))return o;e=o}var s=e.offset;if(null===t.use&&null===t.choice){t.any&&(b=e.save());var l=this._decodeTag(e,null!==t.implicit?t.implicit:t.tag,t.any);if(e.isError(l))return l;t.any?f=e.raw(b):e=l}if(a&&a.track&&null!==t.tag&&a.track(e.path(),s,e.length,"tagged"),a&&a.track&&null!==t.tag&&a.track(e.path(),e.offset,e.length,"content"),t.any||(f=null===t.choice?this._decodeGeneric(t.tag,e,a):this._decodeChoice(e,a)),e.isError(f))return f;if(t.any||null!==t.choice||null===t.children||t.children.forEach((function(t){t._decode(e,a)})),t.contains&&("octstr"===t.tag||"bitstr"===t.tag)){var u=new d(f);f=this._getUse(t.contains,e._reporterState.obj)._decode(u,a)}}return t.obj&&r&&(f=e.leaveObject(c)),null===t.key||null===f&&!0!==r?null!==n&&e.exitKey(n):e.leaveKey(n,t.key,f),f},b.prototype._decodeGeneric=function(e,a,t){var c=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(a,e,c.args[0],t):/str$/.test(e)?this._decodeStr(a,e,t):"objid"===e&&c.args?this._decodeObjid(a,c.args[0],c.args[1],t):"objid"===e?this._decodeObjid(a,null,null,t):"gentime"===e||"utctime"===e?this._decodeTime(a,e,t):"null_"===e?this._decodeNull(a,t):"bool"===e?this._decodeBool(a,t):"objDesc"===e?this._decodeStr(a,e,t):"int"===e||"enum"===e?this._decodeInt(a,c.args&&c.args[0],t):null!==c.use?this._getUse(c.use,a._reporterState.obj)._decode(a,t):a.error("unknown tag: "+e)},b.prototype._getUse=function(e,a){var t=this._baseState;return t.useDecoder=this._use(e,a),r(null===t.useDecoder._baseState.parent),t.useDecoder=t.useDecoder._baseState.children[0],t.implicit!==t.useDecoder._baseState.implicit&&(t.useDecoder=t.useDecoder.clone(),t.useDecoder._baseState.implicit=t.implicit),t.useDecoder},b.prototype._decodeChoice=function(e,a){var t=this._baseState,c=null,f=!1;return Object.keys(t.choice).some((function(d){var r=e.save(),n=t.choice[d];try{var i=n._decode(e,a);if(e.isError(i))return!1;c={type:d,value:i},f=!0}catch(a){return e.restore(r),!1}return!0}),this),f?c:e.error("Choice not matched")},b.prototype._createEncoderBuffer=function(e){return new f(e,this.reporter)},b.prototype._encode=function(e,a,t){var c=this._baseState;if(null===c.default||c.default!==e){var f=this._encodeValue(e,a,t);if(void 0!==f&&!this._skipDefault(f,a,t))return f}},b.prototype._encodeValue=function(e,a,t){var f=this._baseState;if(null===f.parent)return f.children[0]._encode(e,a||new c);var d=null;if(this.reporter=a,f.optional&&void 0===e){if(null===f.default)return;e=f.default}var r=null,n=!1;if(f.any)d=this._createEncoderBuffer(e);else if(f.choice)d=this._encodeChoice(e,a);else if(f.contains)r=this._getUse(f.contains,t)._encode(e,a),n=!0;else if(f.children)r=f.children.map((function(t){if("null_"===t._baseState.tag)return t._encode(null,a,e);if(null===t._baseState.key)return a.error("Child should have a key");var c=a.enterKey(t._baseState.key);if("object"!=typeof e)return a.error("Child expected, but input is not object");var f=t._encode(e[t._baseState.key],a,e);return a.leaveKey(c),f}),this).filter((function(e){return e})),r=this._createEncoderBuffer(r);else if("seqof"===f.tag||"setof"===f.tag){if(!f.args||1!==f.args.length)return a.error("Too many args for : "+f.tag);if(!Array.isArray(e))return a.error("seqof/setof, but data is not Array");var i=this.clone();i._baseState.implicit=null,r=this._createEncoderBuffer(e.map((function(t){var c=this._baseState;return this._getUse(c.args[0],e)._encode(t,a)}),i))}else null!==f.use?d=this._getUse(f.use,t)._encode(e,a):(r=this._encodePrimitive(f.tag,e),n=!0);if(!f.any&&null===f.choice){var b=null!==f.implicit?f.implicit:f.tag,o=null===f.implicit?"universal":"context";null===b?null===f.use&&a.error("Tag could be omitted only for .use()"):null===f.use&&(d=this._encodeComposite(b,n,o,r))}return null!==f.explicit&&(d=this._encodeComposite(f.explicit,!1,"context",d)),d},b.prototype._encodeChoice=function(e,a){var t=this._baseState,c=t.choice[e.type];return c||r(!1,e.type+" not found in "+JSON.stringify(Object.keys(t.choice))),c._encode(e.value,a)},b.prototype._encodePrimitive=function(e,a){var t=this._baseState;if(/str$/.test(e))return this._encodeStr(a,e);if("objid"===e&&t.args)return this._encodeObjid(a,t.reverseArgs[0],t.args[1]);if("objid"===e)return this._encodeObjid(a,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(a,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(a,t.args&&t.reverseArgs[0]);if("bool"===e)return this._encodeBool(a);if("objDesc"===e)return this._encodeStr(a,e);throw new Error("Unsupported tag: "+e)},b.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},b.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e)}},89220:(e,a,t)=>{var c=t(56698);function f(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function d(e,a){this.path=e,this.rethrow(a)}a.a=f,f.prototype.isError=function(e){return e instanceof d},f.prototype.save=function(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},f.prototype.restore=function(e){var a=this._reporterState;a.obj=e.obj,a.path=a.path.slice(0,e.pathLen)},f.prototype.enterKey=function(e){return this._reporterState.path.push(e)},f.prototype.exitKey=function(e){var a=this._reporterState;a.path=a.path.slice(0,e-1)},f.prototype.leaveKey=function(e,a,t){var c=this._reporterState;this.exitKey(e),null!==c.obj&&(c.obj[a]=t)},f.prototype.path=function(){return this._reporterState.path.join("/")},f.prototype.enterObject=function(){var e=this._reporterState,a=e.obj;return e.obj={},a},f.prototype.leaveObject=function(e){var a=this._reporterState,t=a.obj;return a.obj=e,t},f.prototype.error=function(e){var a,t=this._reporterState,c=e instanceof d;if(a=c?e:new d(t.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!t.options.partial)throw a;return c||t.errors.push(a),a},f.prototype.wrapResult=function(e){var a=this._reporterState;return a.options.partial?{result:this.isError(e)?null:e,errors:a.errors}:e},c(d,Error),d.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,d),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},74598:(e,a,t)=>{var c=t(22153);a.tagClass={0:"universal",1:"application",2:"context",3:"private"},a.tagClassByName=c._reverse(a.tagClass),a.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},a.tagByName=c._reverse(a.tag)},22153:(e,a,t)=>{var c=a;c._reverse=function(e){var a={};return Object.keys(e).forEach((function(t){(0|t)==t&&(t|=0);var c=e[t];a[c]=t})),a},c.der=t(74598)},62010:(e,a,t)=>{var c=t(56698),f=t(87568),d=f.base,r=f.bignum,n=f.constants.der;function i(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new b,this.tree._init(e.body)}function b(e){d.Node.call(this,"der",e)}function o(e,a){var t=e.readUInt8(a);if(e.isError(t))return t;var c=n.tagClass[t>>6],f=!(32&t);if(31&~t)t&=31;else{var d=t;for(t=0;!(128&~d);){if(d=e.readUInt8(a),e.isError(d))return d;t<<=7,t|=127&d}}return{cls:c,primitive:f,tag:t,tagStr:n.tag[t]}}function s(e,a,t){var c=e.readUInt8(t);if(e.isError(c))return c;if(!a&&128===c)return null;if(!(128&c))return c;var f=127&c;if(f>4)return e.error("length octect is too long");c=0;for(var d=0;d{var c=a;c.der=t(62010),c.pem=t(58903)},58903:(e,a,t)=>{var c=t(56698),f=t(48287).Buffer,d=t(62010);function r(e){d.call(this,e),this.enc="pem"}c(r,d),e.exports=r,r.prototype.decode=function(e,a){for(var t=e.toString().split(/[\r\n]+/g),c=a.label.toUpperCase(),r=/^-----(BEGIN|END) ([^-]+)-----$/,n=-1,i=-1,b=0;b{var c=t(56698),f=t(48287).Buffer,d=t(87568),r=d.base,n=d.constants.der;function i(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new b,this.tree._init(e.body)}function b(e){r.Node.call(this,"der",e)}function o(e){return e<10?"0"+e:e}e.exports=i,i.prototype.encode=function(e,a){return this.tree._encode(e,a).join()},c(b,r.Node),b.prototype._encodeComposite=function(e,a,t,c){var d,r=function(e,a,t,c){var f;if("seqof"===e?e="seq":"setof"===e&&(e="set"),n.tagByName.hasOwnProperty(e))f=n.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return c.error("Unknown tag: "+e);f=e}return f>=31?c.error("Multi-octet tag encoding unsupported"):(a||(f|=32),f|=n.tagClassByName[t||"universal"]<<6)}(e,a,t,this.reporter);if(c.length<128)return(d=new f(2))[0]=r,d[1]=c.length,this._createEncoderBuffer([d,c]);for(var i=1,b=c.length;b>=256;b>>=8)i++;(d=new f(2+i))[0]=r,d[1]=128|i,b=1+i;for(var o=c.length;o>0;b--,o>>=8)d[b]=255&o;return this._createEncoderBuffer([d,c])},b.prototype._encodeStr=function(e,a){if("bitstr"===a)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===a){for(var t=new f(2*e.length),c=0;c=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}var d=0;for(c=0;c=128;r>>=7)d++}var n=new f(d),i=n.length-1;for(c=e.length-1;c>=0;c--)for(r=e[c],n[i--]=127&r;(r>>=7)>0;)n[i--]=128|127&r;return this._createEncoderBuffer(n)},b.prototype._encodeTime=function(e,a){var t,c=new Date(e);return"gentime"===a?t=[o(c.getFullYear()),o(c.getUTCMonth()+1),o(c.getUTCDate()),o(c.getUTCHours()),o(c.getUTCMinutes()),o(c.getUTCSeconds()),"Z"].join(""):"utctime"===a?t=[o(c.getFullYear()%100),o(c.getUTCMonth()+1),o(c.getUTCDate()),o(c.getUTCHours()),o(c.getUTCMinutes()),o(c.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+a+" time is not supported yet"),this._encodeStr(t,"octstr")},b.prototype._encodeNull=function(){return this._createEncoderBuffer("")},b.prototype._encodeInt=function(e,a){if("string"==typeof e){if(!a)return this.reporter.error("String int or enum given, but no values map");if(!a.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=a[e]}if("number"!=typeof e&&!f.isBuffer(e)){var t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=new f(t)}if(f.isBuffer(e)){var c=e.length;0===e.length&&c++;var d=new f(c);return e.copy(d),0===e.length&&(d[0]=0),this._createEncoderBuffer(d)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);c=1;for(var r=e;r>=256;r>>=8)c++;for(r=(d=new Array(c)).length-1;r>=0;r--)d[r]=255&e,e>>=8;return 128&d[0]&&d.unshift(0),this._createEncoderBuffer(new f(d))},b.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},b.prototype._use=function(e,a){return"function"==typeof e&&(e=e(a)),e._getEncoder("der").tree},b.prototype._skipDefault=function(e,a,t){var c,f=this._baseState;if(null===f.default)return!1;var d=e.join();if(void 0===f.defaultBuffer&&(f.defaultBuffer=this._encodeValue(f.default,a,t).join()),d.length!==f.defaultBuffer.length)return!1;for(c=0;c{var c=a;c.der=t(70082),c.pem=t(90735)},90735:(e,a,t)=>{var c=t(56698),f=t(70082);function d(e){f.call(this,e),this.enc="pem"}c(d,f),e.exports=d,d.prototype.encode=function(e,a){for(var t=f.prototype.encode.call(this,e).toString("base64"),c=["-----BEGIN "+a.label+"-----"],d=0;d=65&&t<=70?t-55:t>=97&&t<=102?t-87:t-48&15}function i(e,a,t){var c=n(e,t);return t-1>=a&&(c|=n(e,t-1)<<4),c}function b(e,a,t,c){for(var f=0,d=Math.min(e.length,t),r=a;r=49?n-49+10:n>=17?n-17+10:n}return f}d.isBN=function(e){return e instanceof d||null!==e&&"object"==typeof e&&e.constructor.wordSize===d.wordSize&&Array.isArray(e.words)},d.max=function(e,a){return e.cmp(a)>0?e:a},d.min=function(e,a){return e.cmp(a)<0?e:a},d.prototype._init=function(e,a,t){if("number"==typeof e)return this._initNumber(e,a,t);if("object"==typeof e)return this._initArray(e,a,t);"hex"===a&&(a=16),c(a===(0|a)&&a>=2&&a<=36);var f=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(f++,this.negative=1),f=0;f-=3)r=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[d]|=r<>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);else if("le"===t)for(f=0,d=0;f>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);return this.strip()},d.prototype._parseHex=function(e,a,t){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)f=i(e,a,c)<=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;else for(c=(e.length-a)%2==0?a+1:a;c=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;this.strip()},d.prototype._parseBase=function(e,a,t){this.words=[0],this.length=1;for(var c=0,f=1;f<=67108863;f*=a)c++;c--,f=f/a|0;for(var d=e.length-t,r=d%c,n=Math.min(d,d-r)+t,i=0,o=t;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},d.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},d.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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],l=[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 u(e,a,t){t.negative=a.negative^e.negative;var c=e.length+a.length|0;t.length=c,c=c-1|0;var f=0|e.words[0],d=0|a.words[0],r=f*d,n=67108863&r,i=r/67108864|0;t.words[0]=n;for(var b=1;b>>26,s=67108863&i,l=Math.min(b,a.length-1),u=Math.max(0,b-e.length+1);u<=l;u++){var h=b-u|0;o+=(r=(f=0|e.words[h])*(d=0|a.words[u])+s)/67108864|0,s=67108863&r}t.words[b]=0|s,i=0|o}return 0!==i?t.words[b]=0|i:t.length--,t.strip()}d.prototype.toString=function(e,a){var t;if(a=0|a||1,16===(e=e||10)||"hex"===e){t="";for(var f=0,d=0,r=0;r>>24-f&16777215)||r!==this.length-1?o[6-i.length]+i+t:i+t,(f+=2)>=26&&(f-=26,r--)}for(0!==d&&(t=d.toString(16)+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(e===(0|e)&&e>=2&&e<=36){var b=s[e],u=l[e];t="";var h=this.clone();for(h.negative=0;!h.isZero();){var p=h.modn(u).toString(e);t=(h=h.idivn(u)).isZero()?p+t:o[b-p.length]+p+t}for(this.isZero()&&(t="0"+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}c(!1,"Base should be between 2 and 36")},d.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&c(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},d.prototype.toJSON=function(){return this.toString(16)},d.prototype.toBuffer=function(e,a){return c(void 0!==r),this.toArrayLike(r,e,a)},d.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},d.prototype.toArrayLike=function(e,a,t){var f=this.byteLength(),d=t||Math.max(1,f);c(f<=d,"byte array longer than desired length"),c(d>0,"Requested array length <= 0"),this.strip();var r,n,i="le"===a,b=new e(d),o=this.clone();if(i){for(n=0;!o.isZero();n++)r=o.andln(255),o.iushrn(8),b[n]=r;for(;n=4096&&(t+=13,a>>>=13),a>=64&&(t+=7,a>>>=7),a>=8&&(t+=4,a>>>=4),a>=2&&(t+=2,a>>>=2),t+a},d.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,t=0;return 8191&a||(t+=13,a>>>=13),127&a||(t+=7,a>>>=7),15&a||(t+=4,a>>>=4),3&a||(t+=2,a>>>=2),1&a||t++,t},d.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},d.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},d.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},d.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var t=0;te.length?this.clone().iand(e):e.clone().iand(this)},d.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},d.prototype.iuxor=function(e){var a,t;this.length>e.length?(a=this,t=e):(a=e,t=this);for(var c=0;ce.length?this.clone().ixor(e):e.clone().ixor(this)},d.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},d.prototype.inotn=function(e){c("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),t=e%26;this._expand(a),t>0&&a--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-t),this.strip()},d.prototype.notn=function(e){return this.clone().inotn(e)},d.prototype.setn=function(e,a){c("number"==typeof e&&e>=0);var t=e/26|0,f=e%26;return this._expand(t+1),this.words[t]=a?this.words[t]|1<e.length?(t=this,c=e):(t=e,c=this);for(var f=0,d=0;d>>26;for(;0!==f&&d>>26;if(this.length=t.length,0!==f)this.words[this.length]=f,this.length++;else if(t!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},d.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var t,c,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(t=this,c=e):(t=e,c=this);for(var d=0,r=0;r>26,this.words[r]=67108863&a;for(;0!==d&&r>26,this.words[r]=67108863&a;if(0===d&&r>>13,u=0|r[1],h=8191&u,p=u>>>13,g=0|r[2],m=8191&g,y=g>>>13,x=0|r[3],A=8191&x,v=x>>>13,w=0|r[4],_=8191&w,I=w>>>13,E=0|r[5],C=8191&E,M=E>>>13,B=0|r[6],k=8191&B,L=B>>>13,S=0|r[7],T=8191&S,N=S>>>13,R=0|r[8],P=8191&R,D=R>>>13,O=0|r[9],F=8191&O,Q=O>>>13,U=0|n[0],j=8191&U,H=U>>>13,$=0|n[1],q=8191&$,z=$>>>13,G=0|n[2],K=8191&G,V=G>>>13,Z=0|n[3],J=8191&Z,W=Z>>>13,Y=0|n[4],X=8191&Y,ee=Y>>>13,ae=0|n[5],te=8191&ae,ce=ae>>>13,fe=0|n[6],de=8191&fe,re=fe>>>13,ne=0|n[7],ie=8191&ne,be=ne>>>13,oe=0|n[8],se=8191&oe,le=oe>>>13,ue=0|n[9],he=8191&ue,pe=ue>>>13;t.negative=e.negative^a.negative,t.length=19;var ge=(b+(c=Math.imul(s,j))|0)+((8191&(f=(f=Math.imul(s,H))+Math.imul(l,j)|0))<<13)|0;b=((d=Math.imul(l,H))+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,c=Math.imul(h,j),f=(f=Math.imul(h,H))+Math.imul(p,j)|0,d=Math.imul(p,H);var me=(b+(c=c+Math.imul(s,q)|0)|0)+((8191&(f=(f=f+Math.imul(s,z)|0)+Math.imul(l,q)|0))<<13)|0;b=((d=d+Math.imul(l,z)|0)+(f>>>13)|0)+(me>>>26)|0,me&=67108863,c=Math.imul(m,j),f=(f=Math.imul(m,H))+Math.imul(y,j)|0,d=Math.imul(y,H),c=c+Math.imul(h,q)|0,f=(f=f+Math.imul(h,z)|0)+Math.imul(p,q)|0,d=d+Math.imul(p,z)|0;var ye=(b+(c=c+Math.imul(s,K)|0)|0)+((8191&(f=(f=f+Math.imul(s,V)|0)+Math.imul(l,K)|0))<<13)|0;b=((d=d+Math.imul(l,V)|0)+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,c=Math.imul(A,j),f=(f=Math.imul(A,H))+Math.imul(v,j)|0,d=Math.imul(v,H),c=c+Math.imul(m,q)|0,f=(f=f+Math.imul(m,z)|0)+Math.imul(y,q)|0,d=d+Math.imul(y,z)|0,c=c+Math.imul(h,K)|0,f=(f=f+Math.imul(h,V)|0)+Math.imul(p,K)|0,d=d+Math.imul(p,V)|0;var xe=(b+(c=c+Math.imul(s,J)|0)|0)+((8191&(f=(f=f+Math.imul(s,W)|0)+Math.imul(l,J)|0))<<13)|0;b=((d=d+Math.imul(l,W)|0)+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,c=Math.imul(_,j),f=(f=Math.imul(_,H))+Math.imul(I,j)|0,d=Math.imul(I,H),c=c+Math.imul(A,q)|0,f=(f=f+Math.imul(A,z)|0)+Math.imul(v,q)|0,d=d+Math.imul(v,z)|0,c=c+Math.imul(m,K)|0,f=(f=f+Math.imul(m,V)|0)+Math.imul(y,K)|0,d=d+Math.imul(y,V)|0,c=c+Math.imul(h,J)|0,f=(f=f+Math.imul(h,W)|0)+Math.imul(p,J)|0,d=d+Math.imul(p,W)|0;var Ae=(b+(c=c+Math.imul(s,X)|0)|0)+((8191&(f=(f=f+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;b=((d=d+Math.imul(l,ee)|0)+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,c=Math.imul(C,j),f=(f=Math.imul(C,H))+Math.imul(M,j)|0,d=Math.imul(M,H),c=c+Math.imul(_,q)|0,f=(f=f+Math.imul(_,z)|0)+Math.imul(I,q)|0,d=d+Math.imul(I,z)|0,c=c+Math.imul(A,K)|0,f=(f=f+Math.imul(A,V)|0)+Math.imul(v,K)|0,d=d+Math.imul(v,V)|0,c=c+Math.imul(m,J)|0,f=(f=f+Math.imul(m,W)|0)+Math.imul(y,J)|0,d=d+Math.imul(y,W)|0,c=c+Math.imul(h,X)|0,f=(f=f+Math.imul(h,ee)|0)+Math.imul(p,X)|0,d=d+Math.imul(p,ee)|0;var ve=(b+(c=c+Math.imul(s,te)|0)|0)+((8191&(f=(f=f+Math.imul(s,ce)|0)+Math.imul(l,te)|0))<<13)|0;b=((d=d+Math.imul(l,ce)|0)+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,c=Math.imul(k,j),f=(f=Math.imul(k,H))+Math.imul(L,j)|0,d=Math.imul(L,H),c=c+Math.imul(C,q)|0,f=(f=f+Math.imul(C,z)|0)+Math.imul(M,q)|0,d=d+Math.imul(M,z)|0,c=c+Math.imul(_,K)|0,f=(f=f+Math.imul(_,V)|0)+Math.imul(I,K)|0,d=d+Math.imul(I,V)|0,c=c+Math.imul(A,J)|0,f=(f=f+Math.imul(A,W)|0)+Math.imul(v,J)|0,d=d+Math.imul(v,W)|0,c=c+Math.imul(m,X)|0,f=(f=f+Math.imul(m,ee)|0)+Math.imul(y,X)|0,d=d+Math.imul(y,ee)|0,c=c+Math.imul(h,te)|0,f=(f=f+Math.imul(h,ce)|0)+Math.imul(p,te)|0,d=d+Math.imul(p,ce)|0;var we=(b+(c=c+Math.imul(s,de)|0)|0)+((8191&(f=(f=f+Math.imul(s,re)|0)+Math.imul(l,de)|0))<<13)|0;b=((d=d+Math.imul(l,re)|0)+(f>>>13)|0)+(we>>>26)|0,we&=67108863,c=Math.imul(T,j),f=(f=Math.imul(T,H))+Math.imul(N,j)|0,d=Math.imul(N,H),c=c+Math.imul(k,q)|0,f=(f=f+Math.imul(k,z)|0)+Math.imul(L,q)|0,d=d+Math.imul(L,z)|0,c=c+Math.imul(C,K)|0,f=(f=f+Math.imul(C,V)|0)+Math.imul(M,K)|0,d=d+Math.imul(M,V)|0,c=c+Math.imul(_,J)|0,f=(f=f+Math.imul(_,W)|0)+Math.imul(I,J)|0,d=d+Math.imul(I,W)|0,c=c+Math.imul(A,X)|0,f=(f=f+Math.imul(A,ee)|0)+Math.imul(v,X)|0,d=d+Math.imul(v,ee)|0,c=c+Math.imul(m,te)|0,f=(f=f+Math.imul(m,ce)|0)+Math.imul(y,te)|0,d=d+Math.imul(y,ce)|0,c=c+Math.imul(h,de)|0,f=(f=f+Math.imul(h,re)|0)+Math.imul(p,de)|0,d=d+Math.imul(p,re)|0;var _e=(b+(c=c+Math.imul(s,ie)|0)|0)+((8191&(f=(f=f+Math.imul(s,be)|0)+Math.imul(l,ie)|0))<<13)|0;b=((d=d+Math.imul(l,be)|0)+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,c=Math.imul(P,j),f=(f=Math.imul(P,H))+Math.imul(D,j)|0,d=Math.imul(D,H),c=c+Math.imul(T,q)|0,f=(f=f+Math.imul(T,z)|0)+Math.imul(N,q)|0,d=d+Math.imul(N,z)|0,c=c+Math.imul(k,K)|0,f=(f=f+Math.imul(k,V)|0)+Math.imul(L,K)|0,d=d+Math.imul(L,V)|0,c=c+Math.imul(C,J)|0,f=(f=f+Math.imul(C,W)|0)+Math.imul(M,J)|0,d=d+Math.imul(M,W)|0,c=c+Math.imul(_,X)|0,f=(f=f+Math.imul(_,ee)|0)+Math.imul(I,X)|0,d=d+Math.imul(I,ee)|0,c=c+Math.imul(A,te)|0,f=(f=f+Math.imul(A,ce)|0)+Math.imul(v,te)|0,d=d+Math.imul(v,ce)|0,c=c+Math.imul(m,de)|0,f=(f=f+Math.imul(m,re)|0)+Math.imul(y,de)|0,d=d+Math.imul(y,re)|0,c=c+Math.imul(h,ie)|0,f=(f=f+Math.imul(h,be)|0)+Math.imul(p,ie)|0,d=d+Math.imul(p,be)|0;var Ie=(b+(c=c+Math.imul(s,se)|0)|0)+((8191&(f=(f=f+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;b=((d=d+Math.imul(l,le)|0)+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,c=Math.imul(F,j),f=(f=Math.imul(F,H))+Math.imul(Q,j)|0,d=Math.imul(Q,H),c=c+Math.imul(P,q)|0,f=(f=f+Math.imul(P,z)|0)+Math.imul(D,q)|0,d=d+Math.imul(D,z)|0,c=c+Math.imul(T,K)|0,f=(f=f+Math.imul(T,V)|0)+Math.imul(N,K)|0,d=d+Math.imul(N,V)|0,c=c+Math.imul(k,J)|0,f=(f=f+Math.imul(k,W)|0)+Math.imul(L,J)|0,d=d+Math.imul(L,W)|0,c=c+Math.imul(C,X)|0,f=(f=f+Math.imul(C,ee)|0)+Math.imul(M,X)|0,d=d+Math.imul(M,ee)|0,c=c+Math.imul(_,te)|0,f=(f=f+Math.imul(_,ce)|0)+Math.imul(I,te)|0,d=d+Math.imul(I,ce)|0,c=c+Math.imul(A,de)|0,f=(f=f+Math.imul(A,re)|0)+Math.imul(v,de)|0,d=d+Math.imul(v,re)|0,c=c+Math.imul(m,ie)|0,f=(f=f+Math.imul(m,be)|0)+Math.imul(y,ie)|0,d=d+Math.imul(y,be)|0,c=c+Math.imul(h,se)|0,f=(f=f+Math.imul(h,le)|0)+Math.imul(p,se)|0,d=d+Math.imul(p,le)|0;var Ee=(b+(c=c+Math.imul(s,he)|0)|0)+((8191&(f=(f=f+Math.imul(s,pe)|0)+Math.imul(l,he)|0))<<13)|0;b=((d=d+Math.imul(l,pe)|0)+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,c=Math.imul(F,q),f=(f=Math.imul(F,z))+Math.imul(Q,q)|0,d=Math.imul(Q,z),c=c+Math.imul(P,K)|0,f=(f=f+Math.imul(P,V)|0)+Math.imul(D,K)|0,d=d+Math.imul(D,V)|0,c=c+Math.imul(T,J)|0,f=(f=f+Math.imul(T,W)|0)+Math.imul(N,J)|0,d=d+Math.imul(N,W)|0,c=c+Math.imul(k,X)|0,f=(f=f+Math.imul(k,ee)|0)+Math.imul(L,X)|0,d=d+Math.imul(L,ee)|0,c=c+Math.imul(C,te)|0,f=(f=f+Math.imul(C,ce)|0)+Math.imul(M,te)|0,d=d+Math.imul(M,ce)|0,c=c+Math.imul(_,de)|0,f=(f=f+Math.imul(_,re)|0)+Math.imul(I,de)|0,d=d+Math.imul(I,re)|0,c=c+Math.imul(A,ie)|0,f=(f=f+Math.imul(A,be)|0)+Math.imul(v,ie)|0,d=d+Math.imul(v,be)|0,c=c+Math.imul(m,se)|0,f=(f=f+Math.imul(m,le)|0)+Math.imul(y,se)|0,d=d+Math.imul(y,le)|0;var Ce=(b+(c=c+Math.imul(h,he)|0)|0)+((8191&(f=(f=f+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;b=((d=d+Math.imul(p,pe)|0)+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c=Math.imul(F,K),f=(f=Math.imul(F,V))+Math.imul(Q,K)|0,d=Math.imul(Q,V),c=c+Math.imul(P,J)|0,f=(f=f+Math.imul(P,W)|0)+Math.imul(D,J)|0,d=d+Math.imul(D,W)|0,c=c+Math.imul(T,X)|0,f=(f=f+Math.imul(T,ee)|0)+Math.imul(N,X)|0,d=d+Math.imul(N,ee)|0,c=c+Math.imul(k,te)|0,f=(f=f+Math.imul(k,ce)|0)+Math.imul(L,te)|0,d=d+Math.imul(L,ce)|0,c=c+Math.imul(C,de)|0,f=(f=f+Math.imul(C,re)|0)+Math.imul(M,de)|0,d=d+Math.imul(M,re)|0,c=c+Math.imul(_,ie)|0,f=(f=f+Math.imul(_,be)|0)+Math.imul(I,ie)|0,d=d+Math.imul(I,be)|0,c=c+Math.imul(A,se)|0,f=(f=f+Math.imul(A,le)|0)+Math.imul(v,se)|0,d=d+Math.imul(v,le)|0;var Me=(b+(c=c+Math.imul(m,he)|0)|0)+((8191&(f=(f=f+Math.imul(m,pe)|0)+Math.imul(y,he)|0))<<13)|0;b=((d=d+Math.imul(y,pe)|0)+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,c=Math.imul(F,J),f=(f=Math.imul(F,W))+Math.imul(Q,J)|0,d=Math.imul(Q,W),c=c+Math.imul(P,X)|0,f=(f=f+Math.imul(P,ee)|0)+Math.imul(D,X)|0,d=d+Math.imul(D,ee)|0,c=c+Math.imul(T,te)|0,f=(f=f+Math.imul(T,ce)|0)+Math.imul(N,te)|0,d=d+Math.imul(N,ce)|0,c=c+Math.imul(k,de)|0,f=(f=f+Math.imul(k,re)|0)+Math.imul(L,de)|0,d=d+Math.imul(L,re)|0,c=c+Math.imul(C,ie)|0,f=(f=f+Math.imul(C,be)|0)+Math.imul(M,ie)|0,d=d+Math.imul(M,be)|0,c=c+Math.imul(_,se)|0,f=(f=f+Math.imul(_,le)|0)+Math.imul(I,se)|0,d=d+Math.imul(I,le)|0;var Be=(b+(c=c+Math.imul(A,he)|0)|0)+((8191&(f=(f=f+Math.imul(A,pe)|0)+Math.imul(v,he)|0))<<13)|0;b=((d=d+Math.imul(v,pe)|0)+(f>>>13)|0)+(Be>>>26)|0,Be&=67108863,c=Math.imul(F,X),f=(f=Math.imul(F,ee))+Math.imul(Q,X)|0,d=Math.imul(Q,ee),c=c+Math.imul(P,te)|0,f=(f=f+Math.imul(P,ce)|0)+Math.imul(D,te)|0,d=d+Math.imul(D,ce)|0,c=c+Math.imul(T,de)|0,f=(f=f+Math.imul(T,re)|0)+Math.imul(N,de)|0,d=d+Math.imul(N,re)|0,c=c+Math.imul(k,ie)|0,f=(f=f+Math.imul(k,be)|0)+Math.imul(L,ie)|0,d=d+Math.imul(L,be)|0,c=c+Math.imul(C,se)|0,f=(f=f+Math.imul(C,le)|0)+Math.imul(M,se)|0,d=d+Math.imul(M,le)|0;var ke=(b+(c=c+Math.imul(_,he)|0)|0)+((8191&(f=(f=f+Math.imul(_,pe)|0)+Math.imul(I,he)|0))<<13)|0;b=((d=d+Math.imul(I,pe)|0)+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,c=Math.imul(F,te),f=(f=Math.imul(F,ce))+Math.imul(Q,te)|0,d=Math.imul(Q,ce),c=c+Math.imul(P,de)|0,f=(f=f+Math.imul(P,re)|0)+Math.imul(D,de)|0,d=d+Math.imul(D,re)|0,c=c+Math.imul(T,ie)|0,f=(f=f+Math.imul(T,be)|0)+Math.imul(N,ie)|0,d=d+Math.imul(N,be)|0,c=c+Math.imul(k,se)|0,f=(f=f+Math.imul(k,le)|0)+Math.imul(L,se)|0,d=d+Math.imul(L,le)|0;var Le=(b+(c=c+Math.imul(C,he)|0)|0)+((8191&(f=(f=f+Math.imul(C,pe)|0)+Math.imul(M,he)|0))<<13)|0;b=((d=d+Math.imul(M,pe)|0)+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,c=Math.imul(F,de),f=(f=Math.imul(F,re))+Math.imul(Q,de)|0,d=Math.imul(Q,re),c=c+Math.imul(P,ie)|0,f=(f=f+Math.imul(P,be)|0)+Math.imul(D,ie)|0,d=d+Math.imul(D,be)|0,c=c+Math.imul(T,se)|0,f=(f=f+Math.imul(T,le)|0)+Math.imul(N,se)|0,d=d+Math.imul(N,le)|0;var Se=(b+(c=c+Math.imul(k,he)|0)|0)+((8191&(f=(f=f+Math.imul(k,pe)|0)+Math.imul(L,he)|0))<<13)|0;b=((d=d+Math.imul(L,pe)|0)+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,c=Math.imul(F,ie),f=(f=Math.imul(F,be))+Math.imul(Q,ie)|0,d=Math.imul(Q,be),c=c+Math.imul(P,se)|0,f=(f=f+Math.imul(P,le)|0)+Math.imul(D,se)|0,d=d+Math.imul(D,le)|0;var Te=(b+(c=c+Math.imul(T,he)|0)|0)+((8191&(f=(f=f+Math.imul(T,pe)|0)+Math.imul(N,he)|0))<<13)|0;b=((d=d+Math.imul(N,pe)|0)+(f>>>13)|0)+(Te>>>26)|0,Te&=67108863,c=Math.imul(F,se),f=(f=Math.imul(F,le))+Math.imul(Q,se)|0,d=Math.imul(Q,le);var Ne=(b+(c=c+Math.imul(P,he)|0)|0)+((8191&(f=(f=f+Math.imul(P,pe)|0)+Math.imul(D,he)|0))<<13)|0;b=((d=d+Math.imul(D,pe)|0)+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Re=(b+(c=Math.imul(F,he))|0)+((8191&(f=(f=Math.imul(F,pe))+Math.imul(Q,he)|0))<<13)|0;return b=((d=Math.imul(Q,pe))+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,i[0]=ge,i[1]=me,i[2]=ye,i[3]=xe,i[4]=Ae,i[5]=ve,i[6]=we,i[7]=_e,i[8]=Ie,i[9]=Ee,i[10]=Ce,i[11]=Me,i[12]=Be,i[13]=ke,i[14]=Le,i[15]=Se,i[16]=Te,i[17]=Ne,i[18]=Re,0!==b&&(i[19]=b,t.length++),t};function p(e,a,t){return(new g).mulp(e,a,t)}function g(e,a){this.x=e,this.y=a}Math.imul||(h=u),d.prototype.mulTo=function(e,a){var t,c=this.length+e.length;return t=10===this.length&&10===e.length?h(this,e,a):c<63?u(this,e,a):c<1024?function(e,a,t){t.negative=a.negative^e.negative,t.length=e.length+a.length;for(var c=0,f=0,d=0;d>>26)|0)>>>26,r&=67108863}t.words[d]=n,c=r,r=f}return 0!==c?t.words[d]=c:t.length--,t.strip()}(this,e,a):p(this,e,a),t},g.prototype.makeRBT=function(e){for(var a=new Array(e),t=d.prototype._countBits(e)-1,c=0;c>=1;return c},g.prototype.permute=function(e,a,t,c,f,d){for(var r=0;r>>=1)f++;return 1<>>=13,t[2*r+1]=8191&d,d>>>=13;for(r=2*a;r>=26,a+=f/67108864|0,a+=d>>>26,this.words[t]=67108863&d}return 0!==a&&(this.words[t]=a,this.length++),this},d.prototype.muln=function(e){return this.clone().imuln(e)},d.prototype.sqr=function(){return this.mul(this)},d.prototype.isqr=function(){return this.imul(this.clone())},d.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),t=0;t>>f}return a}(e);if(0===a.length)return new d(1);for(var t=this,c=0;c=0);var a,t=e%26,f=(e-t)/26,d=67108863>>>26-t<<26-t;if(0!==t){var r=0;for(a=0;a>>26-t}r&&(this.words[a]=r,this.length++)}if(0!==f){for(a=this.length-1;a>=0;a--)this.words[a+f]=this.words[a];for(a=0;a=0),f=a?(a-a%26)/26:0;var d=e%26,r=Math.min((e-d)/26,this.length),n=67108863^67108863>>>d<r)for(this.length-=r,b=0;b=0&&(0!==o||b>=f);b--){var s=0|this.words[b];this.words[b]=o<<26-d|s>>>d,o=s&n}return i&&0!==o&&(i.words[i.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},d.prototype.ishrn=function(e,a,t){return c(0===this.negative),this.iushrn(e,a,t)},d.prototype.shln=function(e){return this.clone().ishln(e)},d.prototype.ushln=function(e){return this.clone().iushln(e)},d.prototype.shrn=function(e){return this.clone().ishrn(e)},d.prototype.ushrn=function(e){return this.clone().iushrn(e)},d.prototype.testn=function(e){c("number"==typeof e&&e>=0);var a=e%26,t=(e-a)/26,f=1<=0);var a=e%26,t=(e-a)/26;if(c(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==a&&t++,this.length=Math.min(t,this.length),0!==a){var f=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},d.prototype.isubn=function(e){if(c("number"==typeof e),c(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(i/67108864|0),this.words[f+t]=67108863&d}for(;f>26,this.words[f+t]=67108863&d;if(0===n)return this.strip();for(c(-1===n),n=0,f=0;f>26,this.words[f]=67108863&d;return this.negative=1,this.strip()},d.prototype._wordDiv=function(e,a){var t=(this.length,e.length),c=this.clone(),f=e,r=0|f.words[f.length-1];0!=(t=26-this._countBits(r))&&(f=f.ushln(t),c.iushln(t),r=0|f.words[f.length-1]);var n,i=c.length-f.length;if("mod"!==a){(n=new d(null)).length=i+1,n.words=new Array(n.length);for(var b=0;b=0;s--){var l=67108864*(0|c.words[f.length+s])+(0|c.words[f.length+s-1]);for(l=Math.min(l/r|0,67108863),c._ishlnsubmul(f,l,s);0!==c.negative;)l--,c.negative=0,c._ishlnsubmul(f,1,s),c.isZero()||(c.negative^=1);n&&(n.words[s]=l)}return n&&n.strip(),c.strip(),"div"!==a&&0!==t&&c.iushrn(t),{div:n||null,mod:c}},d.prototype.divmod=function(e,a,t){return c(!e.isZero()),this.isZero()?{div:new d(0),mod:new d(0)}:0!==this.negative&&0===e.negative?(n=this.neg().divmod(e,a),"mod"!==a&&(f=n.div.neg()),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.iadd(e)),{div:f,mod:r}):0===this.negative&&0!==e.negative?(n=this.divmod(e.neg(),a),"mod"!==a&&(f=n.div.neg()),{div:f,mod:n.mod}):this.negative&e.negative?(n=this.neg().divmod(e.neg(),a),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.isub(e)),{div:n.div,mod:r}):e.length>this.length||this.cmp(e)<0?{div:new d(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new d(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new d(this.modn(e.words[0]))}:this._wordDiv(e,a);var f,r,n},d.prototype.div=function(e){return this.divmod(e,"div",!1).div},d.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},d.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},d.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var t=0!==a.div.negative?a.mod.isub(e):a.mod,c=e.ushrn(1),f=e.andln(1),d=t.cmp(c);return d<0||1===f&&0===d?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},d.prototype.modn=function(e){c(e<=67108863);for(var a=(1<<26)%e,t=0,f=this.length-1;f>=0;f--)t=(a*t+(0|this.words[f]))%e;return t},d.prototype.idivn=function(e){c(e<=67108863);for(var a=0,t=this.length-1;t>=0;t--){var f=(0|this.words[t])+67108864*a;this.words[t]=f/e|0,a=f%e}return this.strip()},d.prototype.divn=function(e){return this.clone().idivn(e)},d.prototype.egcd=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f=new d(1),r=new d(0),n=new d(0),i=new d(1),b=0;a.isEven()&&t.isEven();)a.iushrn(1),t.iushrn(1),++b;for(var o=t.clone(),s=a.clone();!a.isZero();){for(var l=0,u=1;!(a.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(f.isOdd()||r.isOdd())&&(f.iadd(o),r.isub(s)),f.iushrn(1),r.iushrn(1);for(var h=0,p=1;!(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(o),i.isub(s)),n.iushrn(1),i.iushrn(1);a.cmp(t)>=0?(a.isub(t),f.isub(n),r.isub(i)):(t.isub(a),n.isub(f),i.isub(r))}return{a:n,b:i,gcd:t.iushln(b)}},d.prototype._invmp=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f,r=new d(1),n=new d(0),i=t.clone();a.cmpn(1)>0&&t.cmpn(1)>0;){for(var b=0,o=1;!(a.words[0]&o)&&b<26;++b,o<<=1);if(b>0)for(a.iushrn(b);b-- >0;)r.isOdd()&&r.iadd(i),r.iushrn(1);for(var s=0,l=1;!(t.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(t.iushrn(s);s-- >0;)n.isOdd()&&n.iadd(i),n.iushrn(1);a.cmp(t)>=0?(a.isub(t),r.isub(n)):(t.isub(a),n.isub(r))}return(f=0===a.cmpn(1)?r:n).cmpn(0)<0&&f.iadd(e),f},d.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),t=e.clone();a.negative=0,t.negative=0;for(var c=0;a.isEven()&&t.isEven();c++)a.iushrn(1),t.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;t.isEven();)t.iushrn(1);var f=a.cmp(t);if(f<0){var d=a;a=t,t=d}else if(0===f||0===t.cmpn(1))break;a.isub(t)}return t.iushln(c)},d.prototype.invm=function(e){return this.egcd(e).a.umod(e)},d.prototype.isEven=function(){return!(1&this.words[0])},d.prototype.isOdd=function(){return!(1&~this.words[0])},d.prototype.andln=function(e){return this.words[0]&e},d.prototype.bincn=function(e){c("number"==typeof e);var a=e%26,t=(e-a)/26,f=1<>>26,n&=67108863,this.words[r]=n}return 0!==d&&(this.words[r]=d,this.length++),this},d.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},d.prototype.cmpn=function(e){var a,t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)a=1;else{t&&(e=-e),c(e<=67108863,"Number is too big");var f=0|this.words[0];a=f===e?0:fe.length)return 1;if(this.length=0;t--){var c=0|this.words[t],f=0|e.words[t];if(c!==f){cf&&(a=1);break}}return a},d.prototype.gtn=function(e){return 1===this.cmpn(e)},d.prototype.gt=function(e){return 1===this.cmp(e)},d.prototype.gten=function(e){return this.cmpn(e)>=0},d.prototype.gte=function(e){return this.cmp(e)>=0},d.prototype.ltn=function(e){return-1===this.cmpn(e)},d.prototype.lt=function(e){return-1===this.cmp(e)},d.prototype.lten=function(e){return this.cmpn(e)<=0},d.prototype.lte=function(e){return this.cmp(e)<=0},d.prototype.eqn=function(e){return 0===this.cmpn(e)},d.prototype.eq=function(e){return 0===this.cmp(e)},d.red=function(e){return new _(e)},d.prototype.toRed=function(e){return c(!this.red,"Already a number in reduction context"),c(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},d.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},d.prototype._forceRed=function(e){return this.red=e,this},d.prototype.forceRed=function(e){return c(!this.red,"Already a number in reduction context"),this._forceRed(e)},d.prototype.redAdd=function(e){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},d.prototype.redIAdd=function(e){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},d.prototype.redSub=function(e){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},d.prototype.redISub=function(e){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},d.prototype.redShl=function(e){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},d.prototype.redMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},d.prototype.redIMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},d.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},d.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},d.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},d.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},d.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},d.prototype.redPow=function(e){return c(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function y(e,a){this.name=e,this.p=new d(a,16),this.n=this.p.bitLength(),this.k=new d(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function x(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var a=d._prime(e);this.m=a.p,this.prime=a}else c(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new d(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var e=new d(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var a,t=e;do{this.split(t,this.tmp),a=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(a>this.n);var c=a0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},y.prototype.split=function(e,a){e.iushrn(this.n,0,a)},y.prototype.imulK=function(e){return e.imul(this.k)},f(x,y),x.prototype.split=function(e,a){for(var t=4194303,c=Math.min(e.length,9),f=0;f>>22,d=r}d>>>=22,e.words[f-10]=d,0===d&&e.length>10?e.length-=10:e.length-=9},x.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,t=0;t>>=26,e.words[t]=f,a=c}return 0!==a&&(e.words[e.length++]=a),e},d._prime=function(e){if(m[e])return m[e];var a;if("k256"===e)a=new x;else if("p224"===e)a=new A;else if("p192"===e)a=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new w}return m[e]=a,a},_.prototype._verify1=function(e){c(0===e.negative,"red works only with positives"),c(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,a){c(!(e.negative|a.negative),"red works only with positives"),c(e.red&&e.red===a.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,a){this._verify2(e,a);var t=e.add(a);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},_.prototype.iadd=function(e,a){this._verify2(e,a);var t=e.iadd(a);return t.cmp(this.m)>=0&&t.isub(this.m),t},_.prototype.sub=function(e,a){this._verify2(e,a);var t=e.sub(a);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},_.prototype.isub=function(e,a){this._verify2(e,a);var t=e.isub(a);return t.cmpn(0)<0&&t.iadd(this.m),t},_.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},_.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},_.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(c(a%2==1),3===a){var t=this.m.add(new d(1)).iushrn(2);return this.pow(e,t)}for(var f=this.m.subn(1),r=0;!f.isZero()&&0===f.andln(1);)r++,f.iushrn(1);c(!f.isZero());var n=new d(1).toRed(this),i=n.redNeg(),b=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new d(2*o*o).toRed(this);0!==this.pow(o,b).cmp(i);)o.redIAdd(i);for(var s=this.pow(o,f),l=this.pow(e,f.addn(1).iushrn(1)),u=this.pow(e,f),h=r;0!==u.cmp(n);){for(var p=u,g=0;0!==p.cmp(n);g++)p=p.redSqr();c(g=0;c--){for(var b=a.words[c],o=i-1;o>=0;o--){var s=b>>o&1;f!==t[0]&&(f=this.sqr(f)),0!==s||0!==r?(r<<=1,r|=s,(4==++n||0===c&&0===o)&&(f=this.mul(f,t[r]),n=0,r=0)):n=0}i=26}return f},_.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},_.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},d.mont=function(e){return new I(e)},f(I,_),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},I.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var t=e.imul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),d=f;return f.cmp(this.m)>=0?d=f.isub(this.m):f.cmpn(0)<0&&(d=f.iadd(this.m)),d._forceRed(this)},I.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new d(0)._forceRed(this);var t=e.mul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),r=f;return f.cmp(this.m)>=0?r=f.isub(this.m):f.cmpn(0)<0&&(r=f.iadd(this.m)),r._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=t.nmd(e),this)},94148:(e,a,t)=>{"use strict";function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function f(e,a){for(var t=0;t1?t-1:0),f=1;f1?t-1:0),f=1;f1?t-1:0),f=1;f1?t-1:0),f=1;f{"use strict";function c(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);a&&(c=c.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),t.push.apply(t,c)}return t}function f(e){for(var a=1;ae.length)&&(t=e.length),e.substring(t-a.length,t)===a}var y="",x="",A="",v="",w={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function _(e){var a=Object.keys(e),t=Object.create(Object.getPrototypeOf(e));return a.forEach((function(a){t[a]=e[a]})),Object.defineProperty(t,"message",{value:e.message}),t}function I(e){return p(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var E=function(e,a){!function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(a&&a.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),a&&l(e,a)}(E,e);var t,c,r,b,o=(t=E,c=s(),function(){var e,a=u(t);if(c){var f=u(this).constructor;e=Reflect.construct(a,arguments,f)}else e=a.apply(this,arguments);return n(this,e)});function E(e){var a;if(function(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this,E),"object"!==h(e)||null===e)throw new g("options","Object",e);var t=e.message,c=e.operator,f=e.stackStartFn,d=e.actual,r=e.expected,b=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=t)a=o.call(this,String(t));else if(process.stderr&&process.stderr.isTTY&&(process.stderr&&process.stderr.getColorDepth&&1!==process.stderr.getColorDepth()?(y="",x="",v="",A=""):(y="",x="",v="",A="")),"object"===h(d)&&null!==d&&"object"===h(r)&&null!==r&&"stack"in d&&d instanceof Error&&"stack"in r&&r instanceof Error&&(d=_(d),r=_(r)),"deepStrictEqual"===c||"strictEqual"===c)a=o.call(this,function(e,a,t){var c="",f="",d=0,r="",n=!1,i=I(e),b=i.split("\n"),o=I(a).split("\n"),s=0,l="";if("strictEqual"===t&&"object"===h(e)&&"object"===h(a)&&null!==e&&null!==a&&(t="strictEqualObject"),1===b.length&&1===o.length&&b[0]!==o[0]){var u=b[0].length+o[0].length;if(u<=10){if(!("object"===h(e)&&null!==e||"object"===h(a)&&null!==a||0===e&&0===a))return"".concat(w[t],"\n\n")+"".concat(b[0]," !== ").concat(o[0],"\n")}else if("strictEqualObject"!==t&&u<(process.stderr&&process.stderr.isTTY?process.stderr.columns:80)){for(;b[0][s]===o[0][s];)s++;s>2&&(l="\n ".concat(function(e,a){if(a=Math.floor(a),0==e.length||0==a)return"";var t=e.length*a;for(a=Math.floor(Math.log(a)/Math.log(2));a;)e+=e,a--;return e+e.substring(0,t-e.length)}(" ",s),"^"),s=0)}}for(var p=b[b.length-1],g=o[o.length-1];p===g&&(s++<2?r="\n ".concat(p).concat(r):c=p,b.pop(),o.pop(),0!==b.length&&0!==o.length);)p=b[b.length-1],g=o[o.length-1];var _=Math.max(b.length,o.length);if(0===_){var E=i.split("\n");if(E.length>30)for(E[26]="".concat(y,"...").concat(v);E.length>27;)E.pop();return"".concat(w.notIdentical,"\n\n").concat(E.join("\n"),"\n")}s>3&&(r="\n".concat(y,"...").concat(v).concat(r),n=!0),""!==c&&(r="\n ".concat(c).concat(r),c="");var C=0,M=w[t]+"\n".concat(x,"+ actual").concat(v," ").concat(A,"- expected").concat(v),B=" ".concat(y,"...").concat(v," Lines skipped");for(s=0;s<_;s++){var k=s-d;if(b.length1&&s>2&&(k>4?(f+="\n".concat(y,"...").concat(v),n=!0):k>3&&(f+="\n ".concat(o[s-2]),C++),f+="\n ".concat(o[s-1]),C++),d=s,c+="\n".concat(A,"-").concat(v," ").concat(o[s]),C++;else if(o.length1&&s>2&&(k>4?(f+="\n".concat(y,"...").concat(v),n=!0):k>3&&(f+="\n ".concat(b[s-2]),C++),f+="\n ".concat(b[s-1]),C++),d=s,f+="\n".concat(x,"+").concat(v," ").concat(b[s]),C++;else{var L=o[s],S=b[s],T=S!==L&&(!m(S,",")||S.slice(0,-1)!==L);T&&m(L,",")&&L.slice(0,-1)===S&&(T=!1,S+=","),T?(k>1&&s>2&&(k>4?(f+="\n".concat(y,"...").concat(v),n=!0):k>3&&(f+="\n ".concat(b[s-2]),C++),f+="\n ".concat(b[s-1]),C++),d=s,f+="\n".concat(x,"+").concat(v," ").concat(S),c+="\n".concat(A,"-").concat(v," ").concat(L),C+=2):(f+=c,c="",1!==k&&0!==s||(f+="\n ".concat(S),C++))}if(C>20&&s<_-2)return"".concat(M).concat(B,"\n").concat(f,"\n").concat(y,"...").concat(v).concat(c,"\n")+"".concat(y,"...").concat(v)}return"".concat(M).concat(n?B:"","\n").concat(f).concat(c).concat(r).concat(l)}(d,r,c));else if("notDeepStrictEqual"===c||"notStrictEqual"===c){var s=w[c],l=I(d).split("\n");if("notStrictEqual"===c&&"object"===h(d)&&null!==d&&(s=w.notStrictEqualObject),l.length>30)for(l[26]="".concat(y,"...").concat(v);l.length>27;)l.pop();a=1===l.length?o.call(this,"".concat(s," ").concat(l[0])):o.call(this,"".concat(s,"\n\n").concat(l.join("\n"),"\n"))}else{var u=I(d),p="",C=w[c];"notDeepEqual"===c||"notEqual"===c?(u="".concat(w[c],"\n\n").concat(u)).length>1024&&(u="".concat(u.slice(0,1021),"...")):(p="".concat(I(r)),u.length>512&&(u="".concat(u.slice(0,509),"...")),p.length>512&&(p="".concat(p.slice(0,509),"...")),"deepEqual"===c||"equal"===c?u="".concat(C,"\n\n").concat(u,"\n\nshould equal\n\n"):p=" ".concat(c," ").concat(p)),a=o.call(this,"".concat(u).concat(p))}return Error.stackTraceLimit=b,a.generatedMessage=!t,Object.defineProperty(i(a),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),a.code="ERR_ASSERTION",a.actual=d,a.expected=r,a.operator=c,Error.captureStackTrace&&Error.captureStackTrace(i(a),f),a.stack,a.name="AssertionError",n(a)}return r=E,(b=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:a,value:function(e,a){return p(this,f(f({},a),{},{customInspect:!1,depth:0}))}}])&&d(r.prototype,b),Object.defineProperty(r,"prototype",{writable:!1}),E}(b(Error),p.custom);e.exports=E},69597:(e,a,t)=>{"use strict";function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function f(e,a){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,a){return e.__proto__=a,e},f(e,a)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}var r,n,i={};function b(e,a,t){t||(t=Error);var r=function(t){!function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(a&&a.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),a&&f(e,a)}(o,t);var r,n,i,b=(n=o,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=d(n);if(i){var t=d(this).constructor;e=Reflect.construct(a,arguments,t)}else e=a.apply(this,arguments);return function(e,a){if(a&&("object"===c(a)||"function"==typeof a))return a;if(void 0!==a)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function o(t,c,f){var d;return function(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this,o),d=b.call(this,function(e,t,c){return"string"==typeof a?a:a(e,t,c)}(t,c,f)),d.code=e,d}return r=o,Object.defineProperty(r,"prototype",{writable:!1}),r}(t);i[e]=r}function o(e,a){if(Array.isArray(e)){var t=e.length;return e=e.map((function(e){return String(e)})),t>2?"one of ".concat(a," ").concat(e.slice(0,t-1).join(", "),", or ")+e[t-1]:2===t?"one of ".concat(a," ").concat(e[0]," or ").concat(e[1]):"of ".concat(a," ").concat(e[0])}return"of ".concat(a," ").concat(String(e))}b("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),b("ERR_INVALID_ARG_TYPE",(function(e,a,f){var d,n,i,b,s;if(void 0===r&&(r=t(94148)),r("string"==typeof e,"'name' must be a string"),"string"==typeof a&&(n="not ",a.substr(0,4)===n)?(d="must not be",a=a.replace(/^not /,"")):d="must be",function(e,a,t){return(void 0===t||t>e.length)&&(t=e.length),e.substring(t-9,t)===a}(e," argument"))i="The ".concat(e," ").concat(d," ").concat(o(a,"type"));else{var l=("number"!=typeof s&&(s=0),s+1>(b=e).length||-1===b.indexOf(".",s)?"argument":"property");i='The "'.concat(e,'" ').concat(l," ").concat(d," ").concat(o(a,"type"))}return i+". Received type ".concat(c(f))}),TypeError),b("ERR_INVALID_ARG_VALUE",(function(e,a){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===n&&(n=t(40537));var f=n.inspect(a);return f.length>128&&(f="".concat(f.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(c,". Received ").concat(f)}),TypeError,RangeError),b("ERR_INVALID_RETURN_VALUE",(function(e,a,t){var f;return f=t&&t.constructor&&t.constructor.name?"instance of ".concat(t.constructor.name):"type ".concat(c(t)),"Expected ".concat(e,' to be returned from the "').concat(a,'"')+" function but got ".concat(f,".")}),TypeError),b("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,a=new Array(e),c=0;c0,"At least one arg needs to be specified");var f="The ",d=a.length;switch(a=a.map((function(e){return'"'.concat(e,'"')})),d){case 1:f+="".concat(a[0]," argument");break;case 2:f+="".concat(a[0]," and ").concat(a[1]," arguments");break;default:f+=a.slice(0,d-1).join(", "),f+=", and ".concat(a[d-1]," arguments")}return"".concat(f," must be specified")}),TypeError),e.exports.codes=i},82299:(e,a,t)=>{"use strict";function c(e,a){return function(e){if(Array.isArray(e))return e}(e)||function(e,a){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var c,f,d,r,n=[],i=!0,b=!1;try{if(d=(t=t.call(e)).next,0===a){if(Object(t)!==t)return;i=!1}else for(;!(i=(c=d.call(t)).done)&&(n.push(c.value),n.length!==a);i=!0);}catch(e){b=!0,f=e}finally{try{if(!i&&null!=t.return&&(r=t.return(),Object(r)!==r))return}finally{if(b)throw f}}return n}}(e,a)||function(e,a){if(e){if("string"==typeof e)return f(e,a);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?f(e,a):void 0}}(e,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,a){(null==a||a>e.length)&&(a=e.length);for(var t=0,c=new Array(a);t10)return!0;for(var a=0;a57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function N(e){return Object.keys(e).filter(T).concat(o(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function R(e,a){if(e===a)return 0;for(var t=e.length,c=a.length,f=0,d=Math.min(t,c);f{const c=t(36209),f=t(10943),d=t(51847),r=t(86679),n=t(65435),i=255===new Uint8Array(Uint16Array.of(255).buffer)[0];function b(e){switch(e){case"ascii":return c;case"base64":return f;case"hex":return d;case"utf8":case"utf-8":case void 0:return r;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n;default:throw new Error(`Unknown encoding: ${e}`)}}function o(e){return e instanceof Uint8Array}function s(e,a,t){return"string"==typeof e?function(e,a){const t=b(a),c=new Uint8Array(t.byteLength(e));return t.write(c,e,0,c.byteLength),c}(e,a):Array.isArray(e)?function(e){const a=new Uint8Array(e.length);return a.set(e),a}(e):ArrayBuffer.isView(e)?function(e){const a=new Uint8Array(e.byteLength);return a.set(e),a}(e):function(e,a,t){return new Uint8Array(e,a,t)}(e,a,t)}function l(e,a,t,c,f){if(0===e.byteLength)return-1;if("string"==typeof t?(c=t,t=0):void 0===t?t=f?0:e.length-1:t<0&&(t+=e.byteLength),t>=e.byteLength){if(f)return-1;t=e.byteLength-1}else if(t<0){if(!f)return-1;t=0}if("string"==typeof a)a=s(a,c);else if("number"==typeof a)return a&=255,f?e.indexOf(a,t):e.lastIndexOf(a,t);if(0===a.byteLength)return-1;if(f){let c=-1;for(let f=t;fe.byteLength&&(t=e.byteLength-a.byteLength);for(let c=t;c>=0;c--){let t=!0;for(let f=0;ff)return 1}return e.byteLength>a.byteLength?1:e.byteLengthe+a.byteLength),0));const t=new Uint8Array(a);let c=0;for(const a of e){if(c+a.byteLength>t.byteLength){const e=a.subarray(0,t.byteLength-c);return t.set(e,c),t}t.set(a,c),c+=a.byteLength}return t},copy:function(e,a,t=0,c=0,f=e.byteLength){if(f>0&&f=e.byteLength)throw new RangeError("sourceStart is out of range");if(f<0)throw new RangeError("sourceEnd is out of range");t>=a.byteLength&&(t=a.byteLength),f>e.byteLength&&(f=e.byteLength),a.byteLength-t=f||c<=t?"":(t<0&&(t=0),c>f&&(c=f),(0!==t||c{function a(e){return e.length}e.exports={byteLength:a,toString:function(e){const a=e.byteLength;let t="";for(let c=0;c{const a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=new Uint8Array(256);for(let e=0;e<64;e++)t[a.charCodeAt(e)]=e;function c(e){let a=e.length;return 61===e.charCodeAt(a-1)&&a--,a>1&&61===e.charCodeAt(a-1)&&a--,3*a>>>2}t[45]=62,t[95]=63,e.exports={byteLength:c,toString:function(e){const t=e.byteLength;let c="";for(let f=0;f>2]+a[(3&e[f])<<4|e[f+1]>>4]+a[(15&e[f+1])<<2|e[f+2]>>6]+a[63&e[f+2]];return t%3==2?c=c.substring(0,c.length-1)+"=":t%3==1&&(c=c.substring(0,c.length-2)+"=="),c},write:function(e,a,f=0,d=c(a)){const r=Math.min(d,e.byteLength-f);for(let c=0,f=0;f>4,e[f++]=(15&r)<<4|n>>2,e[f++]=(3&n)<<6|63&i}return r}}},51847:e=>{function a(e){return e.length>>>1}function t(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:void 0}e.exports={byteLength:a,toString:function(e){const a=e.byteLength;e=new DataView(e.buffer,e.byteOffset,a);let t="",c=0;for(let f=a-a%4;c{function a(e){return 2*e.length}e.exports={byteLength:a,toString:function(e){const a=e.byteLength;let t="";for(let c=0;c>8,r=f%256;e[c+2*a]=r,e[c+2*a+1]=d}return d}}},86679:e=>{function a(e){let a=0;for(let t=0,c=e.length;t=55296&&f<=56319&&t+1=56320&&c<=57343){a+=4,t++;continue}}a+=f<=127?1:f<=2047?2:3}return a}let t,c;if("undefined"!=typeof TextDecoder){const e=new TextDecoder;t=function(a){return e.decode(a)}}else t=function(e){const a=e.byteLength;let t="",c=0;for(;c0){let a=0;for(;a>c,c-=6;c>=0;)e[n++]=128|a>>c&63,c-=6;r+=a>=65536?2:1}return d};e.exports={byteLength:a,toString:t,write:c}},95364:(e,a,t)=>{"use strict";var c=t(92861).Buffer;e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var a=new Uint8Array(256),t=0;t>>0,o=new Uint8Array(r);t>>0,o[u]=s%256>>>0,s=s/256>>>0;if(0!==s)throw new Error("Non-zero carry");d=l,t++}for(var h=r-d;h!==r&&0===o[h];)h++;var p=c.allocUnsafe(f+(r-h));p.fill(0,0,f);for(var g=f;h!==r;)p[g++]=o[h++];return p}return{encode:function(a){if((Array.isArray(a)||a instanceof Uint8Array)&&(a=c.from(a)),!c.isBuffer(a))throw new TypeError("Expected Buffer");if(0===a.length)return"";for(var t=0,f=0,d=0,r=a.length;d!==r&&0===a[d];)d++,t++;for(var b=(r-d)*o+1>>>0,s=new Uint8Array(b);d!==r;){for(var l=a[d],u=0,h=b-1;(0!==l||u>>0,s[h]=l%n>>>0,l=l/n>>>0;if(0!==l)throw new Error("Non-zero carry");f=u,d++}for(var p=b-f;p!==b&&0===s[p];)p++;for(var g=i.repeat(t);p{"use strict";a.byteLength=function(e){var a=n(e),t=a[0],c=a[1];return 3*(t+c)/4-c},a.toByteArray=function(e){var a,t,d=n(e),r=d[0],i=d[1],b=new f(function(e,a,t){return 3*(a+t)/4-t}(0,r,i)),o=0,s=i>0?r-4:r;for(t=0;t>16&255,b[o++]=a>>8&255,b[o++]=255&a;return 2===i&&(a=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,b[o++]=255&a),1===i&&(a=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,b[o++]=a>>8&255,b[o++]=255&a),b},a.fromByteArray=function(e){for(var a,c=e.length,f=c%3,d=[],r=16383,n=0,b=c-f;nb?b:n+r));return 1===f?(a=e[c-1],d.push(t[a>>2]+t[a<<4&63]+"==")):2===f&&(a=(e[c-2]<<8)+e[c-1],d.push(t[a>>10]+t[a>>4&63]+t[a<<2&63]+"=")),d.join("")};for(var t=[],c=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0;r<64;++r)t[r]=d[r],c[d.charCodeAt(r)]=r;function n(e){var a=e.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");return-1===t&&(t=a),[t,t===a?0:4-t%4]}function i(e,a,c){for(var f,d,r=[],n=a;n>18&63]+t[d>>12&63]+t[d>>6&63]+t[63&d]);return r.join("")}c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},92096:(e,a,t)=>{var c;e=t.nmd(e);var f=function(e){"use strict";var a=1e7,t=9007199254740992,c=l(t),d="0123456789abcdefghijklmnopqrstuvwxyz",r="function"==typeof BigInt;function n(e,a,t,c){return void 0===e?n[0]:void 0===a||10==+a&&!t?Z(e):q(e,a,t,c)}function i(e,a){this.value=e,this.sign=a,this.isSmall=!1}function b(e){this.value=e,this.sign=e<0,this.isSmall=!0}function o(e){this.value=e}function s(e){return-t0?Math.floor(e):Math.ceil(e)}function m(e,t){var c,f,d=e.length,r=t.length,n=new Array(d),i=0,b=a;for(f=0;f=b?1:0,n[f]=c-i*b;for(;f0&&n.push(i),n}function y(e,a){return e.length>=a.length?m(e,a):m(a,e)}function x(e,t){var c,f,d=e.length,r=new Array(d),n=a;for(f=0;f0;)r[f++]=t%n,t=Math.floor(t/n);return r}function A(e,t){var c,f,d=e.length,r=t.length,n=new Array(d),i=0,b=a;for(c=0;c0;)r[f++]=i%n,i=Math.floor(i/n);return r}function I(e,a){for(var t=[];a-- >0;)t.push(0);return t.concat(e)}function E(e,a){var t=Math.max(e.length,a.length);if(t<=30)return w(e,a);t=Math.ceil(t/2);var c=e.slice(t),f=e.slice(0,t),d=a.slice(t),r=a.slice(0,t),n=E(f,r),i=E(c,d),b=E(y(f,c),y(r,d)),o=y(y(n,I(A(A(b,n),i),t)),I(i,2*t));return h(o),o}function C(e,t,c){return new i(e=0;--c)d=(r=d*b+e[c])-(f=g(r/t))*t,i[c]=0|f;return[i,0|d]}function k(e,t){var c,f=Z(t);if(r)return[new o(e.value/f.value),new o(e.value%f.value)];var d,s=e.value,m=f.value;if(0===m)throw new Error("Cannot divide by zero");if(e.isSmall)return f.isSmall?[new b(g(s/m)),new b(s%m)]:[n[0],e];if(f.isSmall){if(1===m)return[e,n[0]];if(-1==m)return[e.negate(),n[0]];var y=Math.abs(m);if(y=0;f--){for(c=l-1,y[f+s]!==g&&(c=Math.floor((y[f+s]*l+y[f+s-1])/g)),d=0,r=0,i=x.length,n=0;nb&&(d=(d+1)*l),c=Math.ceil(d/r);do{if(L(n=_(t,c),s)<=0)break;c--}while(c);o.push(c),s=A(s,n)}return o.reverse(),[u(o),u(s)]}(s,m),d=c[0];var w=e.sign!==f.sign,I=c[1],E=e.sign;return"number"==typeof d?(w&&(d=-d),d=new b(d)):d=new i(d,w),"number"==typeof I?(E&&(I=-I),I=new b(I)):I=new i(I,E),[d,I]}function L(e,a){if(e.length!==a.length)return e.length>a.length?1:-1;for(var t=e.length-1;t>=0;t--)if(e[t]!==a[t])return e[t]>a[t]?1:-1;return 0}function S(e){var a=e.abs();return!a.isUnit()&&(!!(a.equals(2)||a.equals(3)||a.equals(5))||!(a.isEven()||a.isDivisibleBy(3)||a.isDivisibleBy(5))&&(!!a.lesser(49)||void 0))}function T(e,a){for(var t,c,d,r=e.prev(),n=r,i=0;n.isEven();)n=n.divide(2),i++;e:for(c=0;c=0?c=A(e,a):(c=A(a,e),t=!t),"number"==typeof(c=u(c))?(t&&(c=-c),new b(c)):new i(c,t)}(t,c,this.sign)},i.prototype.minus=i.prototype.subtract,b.prototype.subtract=function(e){var a=Z(e),t=this.value;if(t<0!==a.sign)return this.add(a.negate());var c=a.value;return a.isSmall?new b(t-c):v(c,Math.abs(t),t>=0)},b.prototype.minus=b.prototype.subtract,o.prototype.subtract=function(e){return new o(this.value-Z(e).value)},o.prototype.minus=o.prototype.subtract,i.prototype.negate=function(){return new i(this.value,!this.sign)},b.prototype.negate=function(){var e=this.sign,a=new b(-this.value);return a.sign=!e,a},o.prototype.negate=function(){return new o(-this.value)},i.prototype.abs=function(){return new i(this.value,!1)},b.prototype.abs=function(){return new b(Math.abs(this.value))},o.prototype.abs=function(){return new o(this.value>=0?this.value:-this.value)},i.prototype.multiply=function(e){var t,c,f,d=Z(e),r=this.value,b=d.value,o=this.sign!==d.sign;if(d.isSmall){if(0===b)return n[0];if(1===b)return this;if(-1===b)return this.negate();if((t=Math.abs(b))0?E(r,b):w(r,b),o)},i.prototype.times=i.prototype.multiply,b.prototype._multiplyBySmall=function(e){return s(e.value*this.value)?new b(e.value*this.value):C(Math.abs(e.value),l(Math.abs(this.value)),this.sign!==e.sign)},i.prototype._multiplyBySmall=function(e){return 0===e.value?n[0]:1===e.value?this:-1===e.value?this.negate():C(Math.abs(e.value),this.value,this.sign!==e.sign)},b.prototype.multiply=function(e){return Z(e)._multiplyBySmall(this)},b.prototype.times=b.prototype.multiply,o.prototype.multiply=function(e){return new o(this.value*Z(e).value)},o.prototype.times=o.prototype.multiply,i.prototype.square=function(){return new i(M(this.value),!1)},b.prototype.square=function(){var e=this.value*this.value;return s(e)?new b(e):new i(M(l(Math.abs(this.value))),!1)},o.prototype.square=function(e){return new o(this.value*this.value)},i.prototype.divmod=function(e){var a=k(this,e);return{quotient:a[0],remainder:a[1]}},o.prototype.divmod=b.prototype.divmod=i.prototype.divmod,i.prototype.divide=function(e){return k(this,e)[0]},o.prototype.over=o.prototype.divide=function(e){return new o(this.value/Z(e).value)},b.prototype.over=b.prototype.divide=i.prototype.over=i.prototype.divide,i.prototype.mod=function(e){return k(this,e)[1]},o.prototype.mod=o.prototype.remainder=function(e){return new o(this.value%Z(e).value)},b.prototype.remainder=b.prototype.mod=i.prototype.remainder=i.prototype.mod,i.prototype.pow=function(e){var a,t,c,f=Z(e),d=this.value,r=f.value;if(0===r)return n[1];if(0===d)return n[0];if(1===d)return n[1];if(-1===d)return f.isEven()?n[1]:n[-1];if(f.sign)return n[0];if(!f.isSmall)throw new Error("The exponent "+f.toString()+" is too large.");if(this.isSmall&&s(a=Math.pow(d,r)))return new b(g(a));for(t=this,c=n[1];!0&r&&(c=c.times(t),--r),0!==r;)r/=2,t=t.square();return c},b.prototype.pow=i.prototype.pow,o.prototype.pow=function(e){var a=Z(e),t=this.value,c=a.value,f=BigInt(0),d=BigInt(1),r=BigInt(2);if(c===f)return n[1];if(t===f)return n[0];if(t===d)return n[1];if(t===BigInt(-1))return a.isEven()?n[1]:n[-1];if(a.isNegative())return new o(f);for(var i=this,b=n[1];(c&d)===d&&(b=b.times(i),--c),c!==f;)c/=r,i=i.square();return b},i.prototype.modPow=function(e,a){if(e=Z(e),(a=Z(a)).isZero())throw new Error("Cannot take modPow with modulus 0");var t=n[1],c=this.mod(a);for(e.isNegative()&&(e=e.multiply(n[-1]),c=c.modInv(a));e.isPositive();){if(c.isZero())return n[0];e.isOdd()&&(t=t.multiply(c).mod(a)),e=e.divide(2),c=c.square().mod(a)}return t},o.prototype.modPow=b.prototype.modPow=i.prototype.modPow,i.prototype.compareAbs=function(e){var a=Z(e),t=this.value,c=a.value;return a.isSmall?1:L(t,c)},b.prototype.compareAbs=function(e){var a=Z(e),t=Math.abs(this.value),c=a.value;return a.isSmall?t===(c=Math.abs(c))?0:t>c?1:-1:-1},o.prototype.compareAbs=function(e){var a=this.value,t=Z(e).value;return(a=a>=0?a:-a)===(t=t>=0?t:-t)?0:a>t?1:-1},i.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var a=Z(e),t=this.value,c=a.value;return this.sign!==a.sign?a.sign?1:-1:a.isSmall?this.sign?-1:1:L(t,c)*(this.sign?-1:1)},i.prototype.compareTo=i.prototype.compare,b.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var a=Z(e),t=this.value,c=a.value;return a.isSmall?t==c?0:t>c?1:-1:t<0!==a.sign?t<0?-1:1:t<0?1:-1},b.prototype.compareTo=b.prototype.compare,o.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var a=this.value,t=Z(e).value;return a===t?0:a>t?1:-1},o.prototype.compareTo=o.prototype.compare,i.prototype.equals=function(e){return 0===this.compare(e)},o.prototype.eq=o.prototype.equals=b.prototype.eq=b.prototype.equals=i.prototype.eq=i.prototype.equals,i.prototype.notEquals=function(e){return 0!==this.compare(e)},o.prototype.neq=o.prototype.notEquals=b.prototype.neq=b.prototype.notEquals=i.prototype.neq=i.prototype.notEquals,i.prototype.greater=function(e){return this.compare(e)>0},o.prototype.gt=o.prototype.greater=b.prototype.gt=b.prototype.greater=i.prototype.gt=i.prototype.greater,i.prototype.lesser=function(e){return this.compare(e)<0},o.prototype.lt=o.prototype.lesser=b.prototype.lt=b.prototype.lesser=i.prototype.lt=i.prototype.lesser,i.prototype.greaterOrEquals=function(e){return this.compare(e)>=0},o.prototype.geq=o.prototype.greaterOrEquals=b.prototype.geq=b.prototype.greaterOrEquals=i.prototype.geq=i.prototype.greaterOrEquals,i.prototype.lesserOrEquals=function(e){return this.compare(e)<=0},o.prototype.leq=o.prototype.lesserOrEquals=b.prototype.leq=b.prototype.lesserOrEquals=i.prototype.leq=i.prototype.lesserOrEquals,i.prototype.isEven=function(){return!(1&this.value[0])},b.prototype.isEven=function(){return!(1&this.value)},o.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)},i.prototype.isOdd=function(){return!(1&~this.value[0])},b.prototype.isOdd=function(){return!(1&~this.value)},o.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)},i.prototype.isPositive=function(){return!this.sign},b.prototype.isPositive=function(){return this.value>0},o.prototype.isPositive=b.prototype.isPositive,i.prototype.isNegative=function(){return this.sign},b.prototype.isNegative=function(){return this.value<0},o.prototype.isNegative=b.prototype.isNegative,i.prototype.isUnit=function(){return!1},b.prototype.isUnit=function(){return 1===Math.abs(this.value)},o.prototype.isUnit=function(){return this.abs().value===BigInt(1)},i.prototype.isZero=function(){return!1},b.prototype.isZero=function(){return 0===this.value},o.prototype.isZero=function(){return this.value===BigInt(0)},i.prototype.isDivisibleBy=function(e){var a=Z(e);return!a.isZero()&&(!!a.isUnit()||(0===a.compareAbs(2)?this.isEven():this.mod(a).isZero()))},o.prototype.isDivisibleBy=b.prototype.isDivisibleBy=i.prototype.isDivisibleBy,i.prototype.isPrime=function(a){var t=S(this);if(t!==e)return t;var c=this.abs(),d=c.bitLength();if(d<=64)return T(c,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var r=Math.log(2)*d.toJSNumber(),n=Math.ceil(!0===a?2*Math.pow(r,2):r),i=[],b=0;b-t?new b(e-1):new i(c,!0)},o.prototype.prev=function(){return new o(this.value-BigInt(1))};for(var N=[1];2*N[N.length-1]<=a;)N.push(2*N[N.length-1]);var R=N.length,P=N[R-1];function D(e){return Math.abs(e)<=a}function O(e,a,t){a=Z(a);for(var c=e.isNegative(),d=a.isNegative(),r=c?e.not():e,n=d?a.not():a,i=0,b=0,o=null,s=null,l=[];!r.isZero()||!n.isZero();)i=(o=k(r,P))[1].toJSNumber(),c&&(i=P-1-i),b=(s=k(n,P))[1].toJSNumber(),d&&(b=P-1-b),r=o[0],n=s[0],l.push(t(i,b));for(var u=0!==t(c?1:0,d?1:0)?f(-1):f(0),h=l.length-1;h>=0;h-=1)u=u.multiply(P).add(f(l[h]));return u}i.prototype.shiftLeft=function(e){var a=Z(e).toJSNumber();if(!D(a))throw new Error(String(a)+" is too large for shifting.");if(a<0)return this.shiftRight(-a);var t=this;if(t.isZero())return t;for(;a>=R;)t=t.multiply(P),a-=R-1;return t.multiply(N[a])},o.prototype.shiftLeft=b.prototype.shiftLeft=i.prototype.shiftLeft,i.prototype.shiftRight=function(e){var a,t=Z(e).toJSNumber();if(!D(t))throw new Error(String(t)+" is too large for shifting.");if(t<0)return this.shiftLeft(-t);for(var c=this;t>=R;){if(c.isZero()||c.isNegative()&&c.isUnit())return c;c=(a=k(c,P))[1].isNegative()?a[0].prev():a[0],t-=R-1}return(a=k(c,N[t]))[1].isNegative()?a[0].prev():a[0]},o.prototype.shiftRight=b.prototype.shiftRight=i.prototype.shiftRight,i.prototype.not=function(){return this.negate().prev()},o.prototype.not=b.prototype.not=i.prototype.not,i.prototype.and=function(e){return O(this,e,(function(e,a){return e&a}))},o.prototype.and=b.prototype.and=i.prototype.and,i.prototype.or=function(e){return O(this,e,(function(e,a){return e|a}))},o.prototype.or=b.prototype.or=i.prototype.or,i.prototype.xor=function(e){return O(this,e,(function(e,a){return e^a}))},o.prototype.xor=b.prototype.xor=i.prototype.xor;var F=1<<30;function Q(e){var t=e.value,c="number"==typeof t?t|F:"bigint"==typeof t?t|BigInt(F):t[0]+t[1]*a|1073758208;return c&-c}function U(e,a){if(a.compareTo(e)<=0){var t=U(e,a.square(a)),c=t.p,d=t.e,r=c.multiply(a);return r.compareTo(e)<=0?{p:r,e:2*d+1}:{p:c,e:2*d}}return{p:f(1),e:0}}function j(e,a){return e=Z(e),a=Z(a),e.greater(a)?e:a}function H(e,a){return e=Z(e),a=Z(a),e.lesser(a)?e:a}function $(e,a){if(e=Z(e).abs(),a=Z(a).abs(),e.equals(a))return e;if(e.isZero())return a;if(a.isZero())return e;for(var t,c,f=n[1];e.isEven()&&a.isEven();)t=H(Q(e),Q(a)),e=e.divide(t),a=a.divide(t),f=f.multiply(t);for(;e.isEven();)e=e.divide(Q(e));do{for(;a.isEven();)a=a.divide(Q(a));e.greater(a)&&(c=a,a=e,e=c),a=a.subtract(e)}while(!a.isZero());return f.isUnit()?e:e.multiply(f)}i.prototype.bitLength=function(){var e=this;return e.compareTo(f(0))<0&&(e=e.negate().subtract(f(1))),0===e.compareTo(f(0))?f(0):f(U(e,f(2)).e).add(f(1))},o.prototype.bitLength=b.prototype.bitLength=i.prototype.bitLength;var q=function(e,a,t,c){t=t||d,e=String(e),c||(e=e.toLowerCase(),t=t.toLowerCase());var f,r=e.length,n=Math.abs(a),i={};for(f=0;f=n){if("1"===s&&1===n)continue;throw new Error(s+" is not a valid digit in base "+a+".")}a=Z(a);var b=[],o="-"===e[0];for(f=o?1:0;f"!==e[f]&&f=0;c--)f=f.add(e[c].times(d)),d=d.times(a);return t?f.negate():f}function G(e,a){if((a=f(a)).isZero()){if(e.isZero())return{value:[0],isNegative:!1};throw new Error("Cannot convert nonzero numbers to base 0.")}if(a.equals(-1)){if(e.isZero())return{value:[0],isNegative:!1};if(e.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-e.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var t=Array.apply(null,Array(e.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);return t.unshift([1]),{value:[].concat.apply([],t),isNegative:!1}}var c=!1;if(e.isNegative()&&a.isPositive()&&(c=!0,e=e.abs()),a.isUnit())return e.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(e.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:c};for(var d,r=[],n=e;n.isNegative()||n.compareAbs(a)>=0;){d=n.divmod(a),n=d.quotient;var i=d.remainder;i.isNegative()&&(i=a.minus(i).abs(),n=n.next()),r.push(i.toJSNumber())}return r.push(n.toJSNumber()),{value:r.reverse(),isNegative:c}}function K(e,a,t){var c=G(e,a);return(c.isNegative?"-":"")+c.value.map((function(e){return function(e,a){return e<(a=a||d).length?a[e]:"<"+e+">"}(e,t)})).join("")}function V(e){if(s(+e)){var a=+e;if(a===g(a))return r?new o(BigInt(a)):new b(a);throw new Error("Invalid integer: "+e)}var t="-"===e[0];t&&(e=e.slice(1));var c=e.split(/e/i);if(c.length>2)throw new Error("Invalid integer: "+c.join("e"));if(2===c.length){var f=c[1];if("+"===f[0]&&(f=f.slice(1)),(f=+f)!==g(f)||!s(f))throw new Error("Invalid integer: "+f+" is not a valid exponent.");var d=c[0],n=d.indexOf(".");if(n>=0&&(f-=d.length-n-1,d=d.slice(0,n)+d.slice(n+1)),f<0)throw new Error("Cannot include negative exponent part for integers");e=d+=new Array(f+1).join("0")}if(!/^([0-9][0-9]*)$/.test(e))throw new Error("Invalid integer: "+e);if(r)return new o(BigInt(t?"-"+e:e));for(var l=[],u=e.length,p=u-7;u>0;)l.push(+e.slice(p,u)),(p-=7)<0&&(p=0),u-=7;return h(l),new i(l,t)}function Z(e){return"number"==typeof e?function(e){if(r)return new o(BigInt(e));if(s(e)){if(e!==g(e))throw new Error(e+" is not an integer.");return new b(e)}return V(e.toString())}(e):"string"==typeof e?V(e):"bigint"==typeof e?new o(e):e}i.prototype.toArray=function(e){return G(this,e)},b.prototype.toArray=function(e){return G(this,e)},o.prototype.toArray=function(e){return G(this,e)},i.prototype.toString=function(a,t){if(a===e&&(a=10),10!==a||t)return K(this,a,t);for(var c,f=this.value,d=f.length,r=String(f[--d]);--d>=0;)c=String(f[d]),r+="0000000".slice(c.length)+c;return(this.sign?"-":"")+r},b.prototype.toString=function(a,t){return a===e&&(a=10),10!=a||t?K(this,a,t):String(this.value)},o.prototype.toString=b.prototype.toString,o.prototype.toJSON=i.prototype.toJSON=b.prototype.toJSON=function(){return this.toString()},i.prototype.valueOf=function(){return parseInt(this.toString(),10)},i.prototype.toJSNumber=i.prototype.valueOf,b.prototype.valueOf=function(){return this.value},b.prototype.toJSNumber=b.prototype.valueOf,o.prototype.valueOf=o.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};for(var J=0;J<1e3;J++)n[J]=Z(J),J>0&&(n[-J]=Z(-J));return n.one=n[1],n.zero=n[0],n.minusOne=n[-1],n.max=j,n.min=H,n.gcd=$,n.lcm=function(e,a){return e=Z(e).abs(),a=Z(a).abs(),e.divide($(e,a)).multiply(a)},n.isInstance=function(e){return e instanceof i||e instanceof b||e instanceof o},n.randBetween=function(e,t,c){e=Z(e),t=Z(t);var f=c||Math.random,d=H(e,t),r=j(e,t).subtract(d).add(1);if(r.isSmall)return d.add(Math.floor(f()*r));for(var i=G(r,a).value,b=[],o=!0,s=0;s{e.exports=t(85702)(t(86989))},4315:(e,a,t)=>{var c=t(62045).hp;const f=t(28399).Transform;e.exports=class extends f{constructor(e,a){super(a),this._engine=e,this._finalized=!1}_transform(e,a,t){let c=null;try{this.update(e,a)}catch(e){c=e}t(c)}_flush(e){let a=null;try{this.push(this.digest())}catch(e){a=e}e(a)}update(e,a){if(!c.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return c.isBuffer(e)||(e=c.from(e,a)),this._engine.update(e),this}digest(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;let a=this._engine.digest();return void 0!==e&&(a=a.toString(e)),a}}},85702:(e,a,t)=>{const c=t(4315);e.exports=e=>(a,t)=>{const f=(a=>{switch("string"==typeof a?a.toLowerCase():a){case"blake224":return e.Blake224;case"blake256":return e.Blake256;case"blake384":return e.Blake384;case"blake512":return e.Blake512;default:throw new Error("Invald algorithm: "+a)}})(a);return new c(new f,t)}},34588:(e,a,t)=>{var c=t(62045).hp;class f{_lengthCarry(e){for(let a=0;a=a.length;){for(let c=this._blockOffset;c{var c=t(62045).hp;const f=t(23287),d=c.from([0]),r=c.from([128]);e.exports=class extends f{constructor(){super(),this._h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],this._zo=d,this._oo=r}digest(){this._padding();const e=c.alloc(28);for(let a=0;a<7;++a)e.writeUInt32BE(this._h[a],4*a);return e}}},23287:(e,a,t)=>{var c=t(62045).hp;const f=t(34588),d=c.from([1]),r=c.from([129]),n=(e,a)=>(e<<32-a|e>>>a)>>>0;function i(e,a,t,c,d,r,i,b){const o=f.sigma,s=f.u256;e[c]=e[c]+((a[o[t][b]]^s[o[t][b+1]])>>>0)+e[d]>>>0,e[i]=n(e[i]^e[c],16),e[r]=e[r]+e[i]>>>0,e[d]=n(e[d]^e[r],12),e[c]=e[c]+((a[o[t][b+1]]^s[o[t][b]])>>>0)+e[d]>>>0,e[i]=n(e[i]^e[c],8),e[r]=e[r]+e[i]>>>0,e[d]=n(e[d]^e[r],7)}e.exports=class extends f{constructor(){super(),this._h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this._s=[0,0,0,0],this._block=c.alloc(64),this._blockOffset=0,this._length=[0,0],this._nullt=!1,this._zo=d,this._oo=r}_compress(){const e=f.u256,a=new Array(16),t=new Array(16);let c;for(c=0;c<16;++c)t[c]=this._block.readUInt32BE(4*c);for(c=0;c<8;++c)a[c]=this._h[c]>>>0;for(c=8;c<12;++c)a[c]=(this._s[c-8]^e[c-8])>>>0;for(c=12;c<16;++c)a[c]=e[c-8];for(this._nullt||(a[12]=(a[12]^this._length[0])>>>0,a[13]=(a[13]^this._length[0])>>>0,a[14]=(a[14]^this._length[1])>>>0,a[15]=(a[15]^this._length[1])>>>0),c=0;c<14;++c)i(a,t,c,0,4,8,12,0),i(a,t,c,1,5,9,13,2),i(a,t,c,2,6,10,14,4),i(a,t,c,3,7,11,15,6),i(a,t,c,0,5,10,15,8),i(a,t,c,1,6,11,12,10),i(a,t,c,2,7,8,13,12),i(a,t,c,3,4,9,14,14);for(c=0;c<16;++c)this._h[c%8]=(this._h[c%8]^a[c])>>>0;for(c=0;c<8;++c)this._h[c]=(this._h[c]^this._s[c%4])>>>0}_padding(){let e=this._length[0]+8*this._blockOffset,a=this._length[1];e>=4294967296&&(e-=4294967296,a+=1);const t=c.alloc(8);t.writeUInt32BE(a,0),t.writeUInt32BE(e,4),55===this._blockOffset?(this._length[0]-=8,this.update(this._oo)):(this._blockOffset<55?(0===this._blockOffset&&(this._nullt=!0),this._length[0]-=8*(55-this._blockOffset),this.update(f.padding.slice(0,55-this._blockOffset))):(this._length[0]-=8*(64-this._blockOffset),this.update(f.padding.slice(0,64-this._blockOffset)),this._length[0]-=440,this.update(f.padding.slice(1,56)),this._nullt=!0),this.update(this._zo),this._length[0]-=8),this._length[0]-=64,this.update(t)}digest(){this._padding();const e=c.alloc(32);for(let a=0;a<8;++a)e.writeUInt32BE(this._h[a],4*a);return e}}},399:(e,a,t)=>{var c=t(62045).hp;const f=t(61070),d=c.from([0]),r=c.from([128]);e.exports=class extends f{constructor(){super(),this._h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428],this._zo=d,this._oo=r}digest(){this._padding();const e=c.alloc(48);for(let a=0;a<12;++a)e.writeUInt32BE(this._h[a],4*a);return e}}},61070:(e,a,t)=>{var c=t(62045).hp;const f=t(34588),d=c.from([1]),r=c.from([129]);function n(e,a,t,c){let f=e[2*a]^e[2*t],d=e[2*a+1]^e[2*t+1];c>=32&&(d^=f,f^=d,d^=f,c-=32),0===c?(e[2*a]=f>>>0,e[2*a+1]=d>>>0):(e[2*a]=(f>>>c|d<<32-c)>>>0,e[2*a+1]=(d>>>c|f<<32-c)>>>0)}function i(e,a,t,c,d,r,i,b){const o=f.sigma,s=f.u512;let l;l=e[2*c+1]+((a[2*o[t][b]+1]^s[2*o[t][b+1]+1])>>>0)+e[2*d+1],e[2*c]=e[2*c]+((a[2*o[t][b]]^s[2*o[t][b+1]])>>>0)+e[2*d]+~~(l/4294967296)>>>0,e[2*c+1]=l>>>0,n(e,i,c,32),l=e[2*r+1]+e[2*i+1],e[2*r]=e[2*r]+e[2*i]+~~(l/4294967296)>>>0,e[2*r+1]=l>>>0,n(e,d,r,25),l=e[2*c+1]+((a[2*o[t][b+1]+1]^s[2*o[t][b]+1])>>>0)+e[2*d+1],e[2*c]=e[2*c]+((a[2*o[t][b+1]]^s[2*o[t][b]])>>>0)+e[2*d]+~~(l/4294967296)>>>0,e[2*c+1]=l>>>0,n(e,i,c,16),l=e[2*r+1]+e[2*i+1],e[2*r]=e[2*r]+e[2*i]+~~(l/4294967296)>>>0,e[2*r+1]=l>>>0,n(e,d,r,11)}e.exports=class extends f{constructor(){super(),this._h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this._s=[0,0,0,0,0,0,0,0],this._block=c.alloc(128),this._blockOffset=0,this._length=[0,0,0,0],this._nullt=!1,this._zo=d,this._oo=r}_compress(){const e=f.u512,a=new Array(32),t=new Array(32);let c;for(c=0;c<32;++c)t[c]=this._block.readUInt32BE(4*c);for(c=0;c<16;++c)a[c]=this._h[c]>>>0;for(c=16;c<24;++c)a[c]=(this._s[c-16]^e[c-16])>>>0;for(c=24;c<32;++c)a[c]=e[c-16];for(this._nullt||(a[24]=(a[24]^this._length[1])>>>0,a[25]=(a[25]^this._length[0])>>>0,a[26]=(a[26]^this._length[1])>>>0,a[27]=(a[27]^this._length[0])>>>0,a[28]=(a[28]^this._length[3])>>>0,a[29]=(a[29]^this._length[2])>>>0,a[30]=(a[30]^this._length[3])>>>0,a[31]=(a[31]^this._length[2])>>>0),c=0;c<16;++c)i(a,t,c,0,4,8,12,0),i(a,t,c,1,5,9,13,2),i(a,t,c,2,6,10,14,4),i(a,t,c,3,7,11,15,6),i(a,t,c,0,5,10,15,8),i(a,t,c,1,6,11,12,10),i(a,t,c,2,7,8,13,12),i(a,t,c,3,4,9,14,14);for(c=0;c<16;++c)this._h[c%8*2]=(this._h[c%8*2]^a[2*c])>>>0,this._h[c%8*2+1]=(this._h[c%8*2+1]^a[2*c+1])>>>0;for(c=0;c<8;++c)this._h[2*c]=(this._h[2*c]^this._s[c%4*2])>>>0,this._h[2*c+1]=(this._h[2*c+1]^this._s[c%4*2+1])>>>0}_padding(){const e=this._length.slice();e[0]+=8*this._blockOffset,this._lengthCarry(e);const a=c.alloc(16);for(let t=0;t<4;++t)a.writeUInt32BE(e[3-t],4*t);111===this._blockOffset?(this._length[0]-=8,this.update(this._oo)):(this._blockOffset<111?(0===this._blockOffset&&(this._nullt=!0),this._length[0]-=8*(111-this._blockOffset),this.update(f.padding.slice(0,111-this._blockOffset))):(this._length[0]-=8*(128-this._blockOffset),this.update(f.padding.slice(0,128-this._blockOffset)),this._length[0]-=888,this.update(f.padding.slice(1,112)),this._nullt=!0),this.update(this._zo),this._length[0]-=8),this._length[0]-=128,this.update(a)}digest(){this._padding();const e=c.alloc(64);for(let a=0;a<16;++a)e.writeUInt32BE(this._h[a],4*a);return e}}},86989:(e,a,t)=>{e.exports={Blake224:t(48746),Blake256:t(23287),Blake384:t(399),Blake512:t(61070)}},91892:e=>{var a,t,c=(()=>{for(var e=new Uint8Array(128),a=0;a<64;a++)e[a<26?a+65:a<52?a+71:a<62?a-4:4*a-205]=a;return a=>{for(var t=a.length,c=new Uint8Array(3*(t-("="==a[t-1])-("="==a[t-2]))/4|0),f=0,d=0;f>4,c[d++]=n<<4|i>>2,c[d++]=i<<6|b}return c}})(),f=(a={"wasm-binary:./blake2b.wat"(e,a){a.exports=c("AGFzbQEAAAABEANgAn9/AGADf39/AGABfwADBQQAAQICBQUBAQroBwdNBQZtZW1vcnkCAAxibGFrZTJiX2luaXQAAA5ibGFrZTJiX3VwZGF0ZQABDWJsYWtlMmJfZmluYWwAAhBibGFrZTJiX2NvbXByZXNzAAMKvz8EwAIAIABCADcDACAAQgA3AwggAEIANwMQIABCADcDGCAAQgA3AyAgAEIANwMoIABCADcDMCAAQgA3AzggAEIANwNAIABCADcDSCAAQgA3A1AgAEIANwNYIABCADcDYCAAQgA3A2ggAEIANwNwIABCADcDeCAAQoiS853/zPmE6gBBACkDAIU3A4ABIABCu86qptjQ67O7f0EIKQMAhTcDiAEgAEKr8NP0r+68tzxBECkDAIU3A5ABIABC8e30+KWn/aelf0EYKQMAhTcDmAEgAELRhZrv+s+Uh9EAQSApAwCFNwOgASAAQp/Y+dnCkdqCm39BKCkDAIU3A6gBIABC6/qG2r+19sEfQTApAwCFNwOwASAAQvnC+JuRo7Pw2wBBOCkDAIU3A7gBIABCADcDwAEgAEIANwPIASAAQgA3A9ABC20BA38gAEHAAWohAyAAQcgBaiEEIAQpAwCnIQUCQANAIAEgAkYNASAFQYABRgRAIAMgAykDACAFrXw3AwBBACEFIAAQAwsgACAFaiABLQAAOgAAIAVBAWohBSABQQFqIQEMAAsLIAQgBa03AwALYQEDfyAAQcABaiEBIABByAFqIQIgASABKQMAIAIpAwB8NwMAIABCfzcD0AEgAikDAKchAwJAA0AgA0GAAUYNASAAIANqQQA6AAAgA0EBaiEDDAALCyACIAOtNwMAIAAQAwuqOwIgfgl/IABBgAFqISEgAEGIAWohIiAAQZABaiEjIABBmAFqISQgAEGgAWohJSAAQagBaiEmIABBsAFqIScgAEG4AWohKCAhKQMAIQEgIikDACECICMpAwAhAyAkKQMAIQQgJSkDACEFICYpAwAhBiAnKQMAIQcgKCkDACEIQoiS853/zPmE6gAhCUK7zqqm2NDrs7t/IQpCq/DT9K/uvLc8IQtC8e30+KWn/aelfyEMQtGFmu/6z5SH0QAhDUKf2PnZwpHagpt/IQ5C6/qG2r+19sEfIQ9C+cL4m5Gjs/DbACEQIAApAwAhESAAKQMIIRIgACkDECETIAApAxghFCAAKQMgIRUgACkDKCEWIAApAzAhFyAAKQM4IRggACkDQCEZIAApA0ghGiAAKQNQIRsgACkDWCEcIAApA2AhHSAAKQNoIR4gACkDcCEfIAApA3ghICANIAApA8ABhSENIA8gACkD0AGFIQ8gASAFIBF8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSASfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgE3x8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBR8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAVfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgFnx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBd8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAYfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgGXx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBp8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAbfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgHHx8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIB18fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAefHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgH3x8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFICB8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAffHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgG3x8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBV8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAZfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgGnx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHICB8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAefHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggF3x8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBJ8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAdfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgEXx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBN8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAcfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggGHx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBZ8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAUfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgHHx8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBl8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAdfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgEXx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBZ8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByATfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggIHx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIB58fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAbfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgH3x8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBR8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAXfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggGHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBJ8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAafHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFXx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBh8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAafHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgFHx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBJ8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAefHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgHXx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBx8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAffHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgE3x8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBd8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAWfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgG3x8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBV8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCARfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgIHx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBl8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAafHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgEXx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBZ8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAYfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgE3x8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBV8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAbfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggIHx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIB98fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiASfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgHHx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIB18fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAXfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggGXx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBR8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAefHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgE3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIB18fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAXfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgG3x8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBF8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAcfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggGXx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBR8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAVfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgHnx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBh8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAWfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggIHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIB98fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSASfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgGnx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIB18fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAWfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgEnx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGICB8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAffHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgHnx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBV8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAbfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgEXx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBh8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAXfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgFHx8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBp8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCATfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgGXx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBx8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAefHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgHHx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBh8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAffHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgHXx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBJ8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAUfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggGnx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBZ8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiARfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgIHx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBV8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAZfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggF3x8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBN8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAbfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgF3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFICB8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAffHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgGnx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBx8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAUfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggEXx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBl8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAdfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgE3x8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIB58fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAYfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggEnx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBV8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAbfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFnx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBt8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSATfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgGXx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBV8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAYfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgF3x8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBJ8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAWfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgIHx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBx8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAafHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgH3x8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBR8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAdfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgHnx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBF8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSARfHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgEnx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBN8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAUfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgFXx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBZ8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAXfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggGHx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBl8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAafHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgG3x8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBx8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAdfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggHnx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIB98fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAgfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgH3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBt8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAVfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgGXx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBp8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAgfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggHnx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBd8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiASfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgHXx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBF8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByATfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggHHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBh8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAWfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFHx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgISAhKQMAIAEgCYWFNwMAICIgIikDACACIAqFhTcDACAjICMpAwAgAyALhYU3AwAgJCAkKQMAIAQgDIWFNwMAICUgJSkDACAFIA2FhTcDACAmICYpAwAgBiAOhYU3AwAgJyAnKQMAIAcgD4WFNwMAICggKCkDACAIIBCFhTcDAAs=")}},function(){return t||(0,a[Object.keys(a)[0]])((t={exports:{}}).exports,t),t.exports})(),d=WebAssembly.compile(f);e.exports=async e=>(await WebAssembly.instantiate(await d,e)).exports},51685:(e,a,t)=>{var c=t(86889),f=t(35682),d=null,r="undefined"!=typeof WebAssembly&&t(91892)().then((e=>{d=e})),n=64,i=[];e.exports=p;var b=e.exports.BYTES_MIN=16,o=e.exports.BYTES_MAX=64,s=(e.exports.BYTES=32,e.exports.KEYBYTES_MIN=16),l=e.exports.KEYBYTES_MAX=64,u=(e.exports.KEYBYTES=32,e.exports.SALTBYTES=16),h=e.exports.PERSONALBYTES=16;function p(e,a,t,f,r){if(!(this instanceof p))return new p(e,a,t,f,r);if(!d)throw new Error("WASM not loaded. Wait for Blake2b.ready(cb)");e||(e=32),!0!==r&&(c(e>=b,"digestLength must be at least "+b+", was given "+e),c(e<=o,"digestLength must be at most "+o+", was given "+e),null!=a&&(c(a instanceof Uint8Array,"key must be Uint8Array or Buffer"),c(a.length>=s,"key must be at least "+s+", was given "+a.length),c(a.length<=l,"key must be at least "+l+", was given "+a.length)),null!=t&&(c(t instanceof Uint8Array,"salt must be Uint8Array or Buffer"),c(t.length===u,"salt must be exactly "+u+", was given "+t.length)),null!=f&&(c(f instanceof Uint8Array,"personal must be Uint8Array or Buffer"),c(f.length===h,"personal must be exactly "+h+", was given "+f.length))),i.length||(i.push(n),n+=216),this.digestLength=e,this.finalized=!1,this.pointer=i.pop(),this._memory=new Uint8Array(d.memory.buffer),this._memory.fill(0,0,64),this._memory[0]=this.digestLength,this._memory[1]=a?a.length:0,this._memory[2]=1,this._memory[3]=1,t&&this._memory.set(t,32),f&&this._memory.set(f,48),this.pointer+216>this._memory.length&&this._realloc(this.pointer+216),d.blake2b_init(this.pointer,this.digestLength),a&&(this.update(a),this._memory.fill(0,n,n+a.length),this._memory[this.pointer+200]=128)}function g(){}p.prototype._realloc=function(e){d.memory.grow(Math.max(0,Math.ceil(Math.abs(e-this._memory.length)/65536))),this._memory=new Uint8Array(d.memory.buffer)},p.prototype.update=function(e){return c(!1===this.finalized,"Hash instance finalized"),c(e instanceof Uint8Array,"input must be Uint8Array or Buffer"),n+e.length>this._memory.length&&this._realloc(n+e.length),this._memory.set(e,n),d.blake2b_update(this.pointer,n,n+e.length),this},p.prototype.digest=function(e){if(c(!1===this.finalized,"Hash instance finalized"),this.finalized=!0,i.push(this.pointer),d.blake2b_final(this.pointer),!e||"binary"===e)return this._memory.slice(this.pointer+128,this.pointer+128+this.digestLength);if("string"==typeof e)return f.toString(this._memory,e,this.pointer+128,this.pointer+128+this.digestLength);c(e instanceof Uint8Array&&e.length>=this.digestLength,"input must be Uint8Array or Buffer");for(var a=0;ae()),e):e(new Error("WebAssembly not supported"))},p.prototype.ready=p.ready,p.prototype.getPartialHash=function(){return this._memory.slice(this.pointer,this.pointer+216)},p.prototype.setPartialHash=function(e){this._memory.set(e,this.pointer)}},72206:(e,a,t)=>{var c=t(86889),f=t(51685);function d(e,a,t){var c=e[a]+e[t],f=e[a+1]+e[t+1];c>=4294967296&&f++,e[a]=c,e[a+1]=f}function r(e,a,t,c){var f=e[a]+t;t<0&&(f+=4294967296);var d=e[a+1]+c;f>=4294967296&&d++,e[a]=f,e[a+1]=d}function n(e,a){return e[a]^e[a+1]<<8^e[a+2]<<16^e[a+3]<<24}function i(e,a,t,c,f,n){var i=l[f],b=l[f+1],o=l[n],u=l[n+1];d(s,e,a),r(s,e,i,b);var h=s[c]^s[e],p=s[c+1]^s[e+1];s[c]=p,s[c+1]=h,d(s,t,c),h=s[a]^s[t],p=s[a+1]^s[t+1],s[a]=h>>>24^p<<8,s[a+1]=p>>>24^h<<8,d(s,e,a),r(s,e,o,u),h=s[c]^s[e],p=s[c+1]^s[e+1],s[c]=h>>>16^p<<16,s[c+1]=p>>>16^h<<16,d(s,t,c),h=s[a]^s[t],p=s[a+1]^s[t+1],s[a]=p>>>31^h<<1,s[a+1]=h>>>31^p<<1}var b=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),o=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map((function(e){return 2*e}))),s=new Uint32Array(32),l=new Uint32Array(32);function u(e,a){var t=0;for(t=0;t<16;t++)s[t]=e.h[t],s[t+16]=b[t];for(s[24]=s[24]^e.t,s[25]=s[25]^e.t/4294967296,a&&(s[28]=~s[28],s[29]=~s[29]),t=0;t<32;t++)l[t]=n(e.b,4*t);for(t=0;t<12;t++)i(0,8,16,24,o[16*t+0],o[16*t+1]),i(2,10,18,26,o[16*t+2],o[16*t+3]),i(4,12,20,28,o[16*t+4],o[16*t+5]),i(6,14,22,30,o[16*t+6],o[16*t+7]),i(0,10,20,30,o[16*t+8],o[16*t+9]),i(2,12,22,24,o[16*t+10],o[16*t+11]),i(4,14,16,26,o[16*t+12],o[16*t+13]),i(6,8,18,28,o[16*t+14],o[16*t+15]);for(t=0;t<16;t++)e.h[t]=e.h[t]^s[t]^s[t+16]}var h=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function p(e,a,t,c){h.fill(0),this.b=new Uint8Array(128),this.h=new Uint32Array(16),this.t=0,this.c=0,this.outlen=e,h[0]=e,a&&(h[1]=a.length),h[2]=1,h[3]=1,t&&h.set(t,32),c&&h.set(c,48);for(var f=0;f<16;f++)this.h[f]=b[f]^n(h,4*f);a&&(g(this,a),this.c=128)}function g(e,a){for(var t=0;t=this.outlen,"out must have at least outlen bytes of space"),function(e,a){for(e.t+=e.c;e.c<128;)e.b[e.c++]=0;u(e,!0);for(var t=0;t>2]>>8*(3&t)}(this,a),"hex"===e?function(e){for(var a="",t=0;t=y,"outlen must be at least "+y+", was given "+e),c(e<=x,"outlen must be at most "+x+", was given "+e),null!=a&&(c(a instanceof Uint8Array,"key must be Uint8Array or Buffer"),c(a.length>=A,"key must be at least "+A+", was given "+a.length),c(a.length<=v,"key must be at most "+v+", was given "+a.length)),null!=t&&(c(t instanceof Uint8Array,"salt must be Uint8Array or Buffer"),c(t.length===w,"salt must be exactly "+w+", was given "+t.length)),null!=f&&(c(f instanceof Uint8Array,"personal must be Uint8Array or Buffer"),c(f.length===_,"personal must be exactly "+_+", was given "+f.length))),new m(e,a,t,f)},e.exports.ready=function(e){f.ready((function(){e()}))},e.exports.WASM_SUPPORTED=f.SUPPORTED,e.exports.WASM_LOADED=!1;var y=e.exports.BYTES_MIN=16,x=e.exports.BYTES_MAX=64,A=(e.exports.BYTES=32,e.exports.KEYBYTES_MIN=16),v=e.exports.KEYBYTES_MAX=64,w=(e.exports.KEYBYTES=32,e.exports.SALTBYTES=16),_=e.exports.PERSONALBYTES=16;f.ready((function(a){a||(e.exports.WASM_LOADED=!0,e.exports=f)}))},39404:function(e,a,t){!function(e,a){"use strict";function c(e,a){if(!e)throw new Error(a||"Assertion failed")}function f(e,a){e.super_=a;var t=function(){};t.prototype=a.prototype,e.prototype=new t,e.prototype.constructor=e}function d(e,a,t){if(d.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==a&&"be"!==a||(t=a,a=10),this._init(e||0,a||10,t||"be"))}var r;"object"==typeof e?e.exports=d:a.BN=d,d.BN=d,d.wordSize=26;try{r="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:t(47790).Buffer}catch(e){}function n(e,a){var t=e.charCodeAt(a);return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:void c(!1,"Invalid character in "+e)}function i(e,a,t){var c=n(e,t);return t-1>=a&&(c|=n(e,t-1)<<4),c}function b(e,a,t,f){for(var d=0,r=0,n=Math.min(e.length,t),i=a;i=49?b-49+10:b>=17?b-17+10:b,c(b>=0&&r0?e:a},d.min=function(e,a){return e.cmp(a)<0?e:a},d.prototype._init=function(e,a,t){if("number"==typeof e)return this._initNumber(e,a,t);if("object"==typeof e)return this._initArray(e,a,t);"hex"===a&&(a=16),c(a===(0|a)&&a>=2&&a<=36);var f=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(f++,this.negative=1),f=0;f-=3)r=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[d]|=r<>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);else if("le"===t)for(f=0,d=0;f>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);return this._strip()},d.prototype._parseHex=function(e,a,t){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)f=i(e,a,c)<=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;else for(c=(e.length-a)%2==0?a+1:a;c=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;this._strip()},d.prototype._parseBase=function(e,a,t){this.words=[0],this.length=1;for(var c=0,f=1;f<=67108863;f*=a)c++;c--,f=f/a|0;for(var d=e.length-t,r=d%c,n=Math.min(d,d-r)+t,i=0,o=t;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},d.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{d.prototype[Symbol.for("nodejs.util.inspect.custom")]=s}catch(e){d.prototype.inspect=s}else d.prototype.inspect=s;function s(){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"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(e,a,t){t.negative=a.negative^e.negative;var c=e.length+a.length|0;t.length=c,c=c-1|0;var f=0|e.words[0],d=0|a.words[0],r=f*d,n=67108863&r,i=r/67108864|0;t.words[0]=n;for(var b=1;b>>26,s=67108863&i,l=Math.min(b,a.length-1),u=Math.max(0,b-e.length+1);u<=l;u++){var h=b-u|0;o+=(r=(f=0|e.words[h])*(d=0|a.words[u])+s)/67108864|0,s=67108863&r}t.words[b]=0|s,i=0|o}return 0!==i?t.words[b]=0|i:t.length--,t._strip()}d.prototype.toString=function(e,a){var t;if(a=0|a||1,16===(e=e||10)||"hex"===e){t="";for(var f=0,d=0,r=0;r>>24-f&16777215,(f+=2)>=26&&(f-=26,r--),t=0!==d||r!==this.length-1?l[6-i.length]+i+t:i+t}for(0!==d&&(t=d.toString(16)+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(e===(0|e)&&e>=2&&e<=36){var b=u[e],o=h[e];t="";var s=this.clone();for(s.negative=0;!s.isZero();){var p=s.modrn(o).toString(e);t=(s=s.idivn(o)).isZero()?p+t:l[b-p.length]+p+t}for(this.isZero()&&(t="0"+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}c(!1,"Base should be between 2 and 36")},d.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&c(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},d.prototype.toJSON=function(){return this.toString(16,2)},r&&(d.prototype.toBuffer=function(e,a){return this.toArrayLike(r,e,a)}),d.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},d.prototype.toArrayLike=function(e,a,t){this._strip();var f=this.byteLength(),d=t||Math.max(1,f);c(f<=d,"byte array longer than desired length"),c(d>0,"Requested array length <= 0");var r=function(e,a){return e.allocUnsafe?e.allocUnsafe(a):new e(a)}(e,d);return this["_toArrayLike"+("le"===a?"LE":"BE")](r,f),r},d.prototype._toArrayLikeLE=function(e,a){for(var t=0,c=0,f=0,d=0;f>8&255),t>16&255),6===d?(t>24&255),c=0,d=0):(c=r>>>24,d+=2)}if(t=0&&(e[t--]=r>>8&255),t>=0&&(e[t--]=r>>16&255),6===d?(t>=0&&(e[t--]=r>>24&255),c=0,d=0):(c=r>>>24,d+=2)}if(t>=0)for(e[t--]=c;t>=0;)e[t--]=0},Math.clz32?d.prototype._countBits=function(e){return 32-Math.clz32(e)}:d.prototype._countBits=function(e){var a=e,t=0;return a>=4096&&(t+=13,a>>>=13),a>=64&&(t+=7,a>>>=7),a>=8&&(t+=4,a>>>=4),a>=2&&(t+=2,a>>>=2),t+a},d.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,t=0;return 8191&a||(t+=13,a>>>=13),127&a||(t+=7,a>>>=7),15&a||(t+=4,a>>>=4),3&a||(t+=2,a>>>=2),1&a||t++,t},d.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},d.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},d.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},d.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var t=0;te.length?this.clone().iand(e):e.clone().iand(this)},d.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},d.prototype.iuxor=function(e){var a,t;this.length>e.length?(a=this,t=e):(a=e,t=this);for(var c=0;ce.length?this.clone().ixor(e):e.clone().ixor(this)},d.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},d.prototype.inotn=function(e){c("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),t=e%26;this._expand(a),t>0&&a--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-t),this._strip()},d.prototype.notn=function(e){return this.clone().inotn(e)},d.prototype.setn=function(e,a){c("number"==typeof e&&e>=0);var t=e/26|0,f=e%26;return this._expand(t+1),this.words[t]=a?this.words[t]|1<e.length?(t=this,c=e):(t=e,c=this);for(var f=0,d=0;d>>26;for(;0!==f&&d>>26;if(this.length=t.length,0!==f)this.words[this.length]=f,this.length++;else if(t!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},d.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var t,c,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(t=this,c=e):(t=e,c=this);for(var d=0,r=0;r>26,this.words[r]=67108863&a;for(;0!==d&&r>26,this.words[r]=67108863&a;if(0===d&&r>>13,u=0|r[1],h=8191&u,p=u>>>13,g=0|r[2],m=8191&g,y=g>>>13,x=0|r[3],A=8191&x,v=x>>>13,w=0|r[4],_=8191&w,I=w>>>13,E=0|r[5],C=8191&E,M=E>>>13,B=0|r[6],k=8191&B,L=B>>>13,S=0|r[7],T=8191&S,N=S>>>13,R=0|r[8],P=8191&R,D=R>>>13,O=0|r[9],F=8191&O,Q=O>>>13,U=0|n[0],j=8191&U,H=U>>>13,$=0|n[1],q=8191&$,z=$>>>13,G=0|n[2],K=8191&G,V=G>>>13,Z=0|n[3],J=8191&Z,W=Z>>>13,Y=0|n[4],X=8191&Y,ee=Y>>>13,ae=0|n[5],te=8191&ae,ce=ae>>>13,fe=0|n[6],de=8191&fe,re=fe>>>13,ne=0|n[7],ie=8191&ne,be=ne>>>13,oe=0|n[8],se=8191&oe,le=oe>>>13,ue=0|n[9],he=8191&ue,pe=ue>>>13;t.negative=e.negative^a.negative,t.length=19;var ge=(b+(c=Math.imul(s,j))|0)+((8191&(f=(f=Math.imul(s,H))+Math.imul(l,j)|0))<<13)|0;b=((d=Math.imul(l,H))+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,c=Math.imul(h,j),f=(f=Math.imul(h,H))+Math.imul(p,j)|0,d=Math.imul(p,H);var me=(b+(c=c+Math.imul(s,q)|0)|0)+((8191&(f=(f=f+Math.imul(s,z)|0)+Math.imul(l,q)|0))<<13)|0;b=((d=d+Math.imul(l,z)|0)+(f>>>13)|0)+(me>>>26)|0,me&=67108863,c=Math.imul(m,j),f=(f=Math.imul(m,H))+Math.imul(y,j)|0,d=Math.imul(y,H),c=c+Math.imul(h,q)|0,f=(f=f+Math.imul(h,z)|0)+Math.imul(p,q)|0,d=d+Math.imul(p,z)|0;var ye=(b+(c=c+Math.imul(s,K)|0)|0)+((8191&(f=(f=f+Math.imul(s,V)|0)+Math.imul(l,K)|0))<<13)|0;b=((d=d+Math.imul(l,V)|0)+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,c=Math.imul(A,j),f=(f=Math.imul(A,H))+Math.imul(v,j)|0,d=Math.imul(v,H),c=c+Math.imul(m,q)|0,f=(f=f+Math.imul(m,z)|0)+Math.imul(y,q)|0,d=d+Math.imul(y,z)|0,c=c+Math.imul(h,K)|0,f=(f=f+Math.imul(h,V)|0)+Math.imul(p,K)|0,d=d+Math.imul(p,V)|0;var xe=(b+(c=c+Math.imul(s,J)|0)|0)+((8191&(f=(f=f+Math.imul(s,W)|0)+Math.imul(l,J)|0))<<13)|0;b=((d=d+Math.imul(l,W)|0)+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,c=Math.imul(_,j),f=(f=Math.imul(_,H))+Math.imul(I,j)|0,d=Math.imul(I,H),c=c+Math.imul(A,q)|0,f=(f=f+Math.imul(A,z)|0)+Math.imul(v,q)|0,d=d+Math.imul(v,z)|0,c=c+Math.imul(m,K)|0,f=(f=f+Math.imul(m,V)|0)+Math.imul(y,K)|0,d=d+Math.imul(y,V)|0,c=c+Math.imul(h,J)|0,f=(f=f+Math.imul(h,W)|0)+Math.imul(p,J)|0,d=d+Math.imul(p,W)|0;var Ae=(b+(c=c+Math.imul(s,X)|0)|0)+((8191&(f=(f=f+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;b=((d=d+Math.imul(l,ee)|0)+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,c=Math.imul(C,j),f=(f=Math.imul(C,H))+Math.imul(M,j)|0,d=Math.imul(M,H),c=c+Math.imul(_,q)|0,f=(f=f+Math.imul(_,z)|0)+Math.imul(I,q)|0,d=d+Math.imul(I,z)|0,c=c+Math.imul(A,K)|0,f=(f=f+Math.imul(A,V)|0)+Math.imul(v,K)|0,d=d+Math.imul(v,V)|0,c=c+Math.imul(m,J)|0,f=(f=f+Math.imul(m,W)|0)+Math.imul(y,J)|0,d=d+Math.imul(y,W)|0,c=c+Math.imul(h,X)|0,f=(f=f+Math.imul(h,ee)|0)+Math.imul(p,X)|0,d=d+Math.imul(p,ee)|0;var ve=(b+(c=c+Math.imul(s,te)|0)|0)+((8191&(f=(f=f+Math.imul(s,ce)|0)+Math.imul(l,te)|0))<<13)|0;b=((d=d+Math.imul(l,ce)|0)+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,c=Math.imul(k,j),f=(f=Math.imul(k,H))+Math.imul(L,j)|0,d=Math.imul(L,H),c=c+Math.imul(C,q)|0,f=(f=f+Math.imul(C,z)|0)+Math.imul(M,q)|0,d=d+Math.imul(M,z)|0,c=c+Math.imul(_,K)|0,f=(f=f+Math.imul(_,V)|0)+Math.imul(I,K)|0,d=d+Math.imul(I,V)|0,c=c+Math.imul(A,J)|0,f=(f=f+Math.imul(A,W)|0)+Math.imul(v,J)|0,d=d+Math.imul(v,W)|0,c=c+Math.imul(m,X)|0,f=(f=f+Math.imul(m,ee)|0)+Math.imul(y,X)|0,d=d+Math.imul(y,ee)|0,c=c+Math.imul(h,te)|0,f=(f=f+Math.imul(h,ce)|0)+Math.imul(p,te)|0,d=d+Math.imul(p,ce)|0;var we=(b+(c=c+Math.imul(s,de)|0)|0)+((8191&(f=(f=f+Math.imul(s,re)|0)+Math.imul(l,de)|0))<<13)|0;b=((d=d+Math.imul(l,re)|0)+(f>>>13)|0)+(we>>>26)|0,we&=67108863,c=Math.imul(T,j),f=(f=Math.imul(T,H))+Math.imul(N,j)|0,d=Math.imul(N,H),c=c+Math.imul(k,q)|0,f=(f=f+Math.imul(k,z)|0)+Math.imul(L,q)|0,d=d+Math.imul(L,z)|0,c=c+Math.imul(C,K)|0,f=(f=f+Math.imul(C,V)|0)+Math.imul(M,K)|0,d=d+Math.imul(M,V)|0,c=c+Math.imul(_,J)|0,f=(f=f+Math.imul(_,W)|0)+Math.imul(I,J)|0,d=d+Math.imul(I,W)|0,c=c+Math.imul(A,X)|0,f=(f=f+Math.imul(A,ee)|0)+Math.imul(v,X)|0,d=d+Math.imul(v,ee)|0,c=c+Math.imul(m,te)|0,f=(f=f+Math.imul(m,ce)|0)+Math.imul(y,te)|0,d=d+Math.imul(y,ce)|0,c=c+Math.imul(h,de)|0,f=(f=f+Math.imul(h,re)|0)+Math.imul(p,de)|0,d=d+Math.imul(p,re)|0;var _e=(b+(c=c+Math.imul(s,ie)|0)|0)+((8191&(f=(f=f+Math.imul(s,be)|0)+Math.imul(l,ie)|0))<<13)|0;b=((d=d+Math.imul(l,be)|0)+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,c=Math.imul(P,j),f=(f=Math.imul(P,H))+Math.imul(D,j)|0,d=Math.imul(D,H),c=c+Math.imul(T,q)|0,f=(f=f+Math.imul(T,z)|0)+Math.imul(N,q)|0,d=d+Math.imul(N,z)|0,c=c+Math.imul(k,K)|0,f=(f=f+Math.imul(k,V)|0)+Math.imul(L,K)|0,d=d+Math.imul(L,V)|0,c=c+Math.imul(C,J)|0,f=(f=f+Math.imul(C,W)|0)+Math.imul(M,J)|0,d=d+Math.imul(M,W)|0,c=c+Math.imul(_,X)|0,f=(f=f+Math.imul(_,ee)|0)+Math.imul(I,X)|0,d=d+Math.imul(I,ee)|0,c=c+Math.imul(A,te)|0,f=(f=f+Math.imul(A,ce)|0)+Math.imul(v,te)|0,d=d+Math.imul(v,ce)|0,c=c+Math.imul(m,de)|0,f=(f=f+Math.imul(m,re)|0)+Math.imul(y,de)|0,d=d+Math.imul(y,re)|0,c=c+Math.imul(h,ie)|0,f=(f=f+Math.imul(h,be)|0)+Math.imul(p,ie)|0,d=d+Math.imul(p,be)|0;var Ie=(b+(c=c+Math.imul(s,se)|0)|0)+((8191&(f=(f=f+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;b=((d=d+Math.imul(l,le)|0)+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,c=Math.imul(F,j),f=(f=Math.imul(F,H))+Math.imul(Q,j)|0,d=Math.imul(Q,H),c=c+Math.imul(P,q)|0,f=(f=f+Math.imul(P,z)|0)+Math.imul(D,q)|0,d=d+Math.imul(D,z)|0,c=c+Math.imul(T,K)|0,f=(f=f+Math.imul(T,V)|0)+Math.imul(N,K)|0,d=d+Math.imul(N,V)|0,c=c+Math.imul(k,J)|0,f=(f=f+Math.imul(k,W)|0)+Math.imul(L,J)|0,d=d+Math.imul(L,W)|0,c=c+Math.imul(C,X)|0,f=(f=f+Math.imul(C,ee)|0)+Math.imul(M,X)|0,d=d+Math.imul(M,ee)|0,c=c+Math.imul(_,te)|0,f=(f=f+Math.imul(_,ce)|0)+Math.imul(I,te)|0,d=d+Math.imul(I,ce)|0,c=c+Math.imul(A,de)|0,f=(f=f+Math.imul(A,re)|0)+Math.imul(v,de)|0,d=d+Math.imul(v,re)|0,c=c+Math.imul(m,ie)|0,f=(f=f+Math.imul(m,be)|0)+Math.imul(y,ie)|0,d=d+Math.imul(y,be)|0,c=c+Math.imul(h,se)|0,f=(f=f+Math.imul(h,le)|0)+Math.imul(p,se)|0,d=d+Math.imul(p,le)|0;var Ee=(b+(c=c+Math.imul(s,he)|0)|0)+((8191&(f=(f=f+Math.imul(s,pe)|0)+Math.imul(l,he)|0))<<13)|0;b=((d=d+Math.imul(l,pe)|0)+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,c=Math.imul(F,q),f=(f=Math.imul(F,z))+Math.imul(Q,q)|0,d=Math.imul(Q,z),c=c+Math.imul(P,K)|0,f=(f=f+Math.imul(P,V)|0)+Math.imul(D,K)|0,d=d+Math.imul(D,V)|0,c=c+Math.imul(T,J)|0,f=(f=f+Math.imul(T,W)|0)+Math.imul(N,J)|0,d=d+Math.imul(N,W)|0,c=c+Math.imul(k,X)|0,f=(f=f+Math.imul(k,ee)|0)+Math.imul(L,X)|0,d=d+Math.imul(L,ee)|0,c=c+Math.imul(C,te)|0,f=(f=f+Math.imul(C,ce)|0)+Math.imul(M,te)|0,d=d+Math.imul(M,ce)|0,c=c+Math.imul(_,de)|0,f=(f=f+Math.imul(_,re)|0)+Math.imul(I,de)|0,d=d+Math.imul(I,re)|0,c=c+Math.imul(A,ie)|0,f=(f=f+Math.imul(A,be)|0)+Math.imul(v,ie)|0,d=d+Math.imul(v,be)|0,c=c+Math.imul(m,se)|0,f=(f=f+Math.imul(m,le)|0)+Math.imul(y,se)|0,d=d+Math.imul(y,le)|0;var Ce=(b+(c=c+Math.imul(h,he)|0)|0)+((8191&(f=(f=f+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;b=((d=d+Math.imul(p,pe)|0)+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c=Math.imul(F,K),f=(f=Math.imul(F,V))+Math.imul(Q,K)|0,d=Math.imul(Q,V),c=c+Math.imul(P,J)|0,f=(f=f+Math.imul(P,W)|0)+Math.imul(D,J)|0,d=d+Math.imul(D,W)|0,c=c+Math.imul(T,X)|0,f=(f=f+Math.imul(T,ee)|0)+Math.imul(N,X)|0,d=d+Math.imul(N,ee)|0,c=c+Math.imul(k,te)|0,f=(f=f+Math.imul(k,ce)|0)+Math.imul(L,te)|0,d=d+Math.imul(L,ce)|0,c=c+Math.imul(C,de)|0,f=(f=f+Math.imul(C,re)|0)+Math.imul(M,de)|0,d=d+Math.imul(M,re)|0,c=c+Math.imul(_,ie)|0,f=(f=f+Math.imul(_,be)|0)+Math.imul(I,ie)|0,d=d+Math.imul(I,be)|0,c=c+Math.imul(A,se)|0,f=(f=f+Math.imul(A,le)|0)+Math.imul(v,se)|0,d=d+Math.imul(v,le)|0;var Me=(b+(c=c+Math.imul(m,he)|0)|0)+((8191&(f=(f=f+Math.imul(m,pe)|0)+Math.imul(y,he)|0))<<13)|0;b=((d=d+Math.imul(y,pe)|0)+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,c=Math.imul(F,J),f=(f=Math.imul(F,W))+Math.imul(Q,J)|0,d=Math.imul(Q,W),c=c+Math.imul(P,X)|0,f=(f=f+Math.imul(P,ee)|0)+Math.imul(D,X)|0,d=d+Math.imul(D,ee)|0,c=c+Math.imul(T,te)|0,f=(f=f+Math.imul(T,ce)|0)+Math.imul(N,te)|0,d=d+Math.imul(N,ce)|0,c=c+Math.imul(k,de)|0,f=(f=f+Math.imul(k,re)|0)+Math.imul(L,de)|0,d=d+Math.imul(L,re)|0,c=c+Math.imul(C,ie)|0,f=(f=f+Math.imul(C,be)|0)+Math.imul(M,ie)|0,d=d+Math.imul(M,be)|0,c=c+Math.imul(_,se)|0,f=(f=f+Math.imul(_,le)|0)+Math.imul(I,se)|0,d=d+Math.imul(I,le)|0;var Be=(b+(c=c+Math.imul(A,he)|0)|0)+((8191&(f=(f=f+Math.imul(A,pe)|0)+Math.imul(v,he)|0))<<13)|0;b=((d=d+Math.imul(v,pe)|0)+(f>>>13)|0)+(Be>>>26)|0,Be&=67108863,c=Math.imul(F,X),f=(f=Math.imul(F,ee))+Math.imul(Q,X)|0,d=Math.imul(Q,ee),c=c+Math.imul(P,te)|0,f=(f=f+Math.imul(P,ce)|0)+Math.imul(D,te)|0,d=d+Math.imul(D,ce)|0,c=c+Math.imul(T,de)|0,f=(f=f+Math.imul(T,re)|0)+Math.imul(N,de)|0,d=d+Math.imul(N,re)|0,c=c+Math.imul(k,ie)|0,f=(f=f+Math.imul(k,be)|0)+Math.imul(L,ie)|0,d=d+Math.imul(L,be)|0,c=c+Math.imul(C,se)|0,f=(f=f+Math.imul(C,le)|0)+Math.imul(M,se)|0,d=d+Math.imul(M,le)|0;var ke=(b+(c=c+Math.imul(_,he)|0)|0)+((8191&(f=(f=f+Math.imul(_,pe)|0)+Math.imul(I,he)|0))<<13)|0;b=((d=d+Math.imul(I,pe)|0)+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,c=Math.imul(F,te),f=(f=Math.imul(F,ce))+Math.imul(Q,te)|0,d=Math.imul(Q,ce),c=c+Math.imul(P,de)|0,f=(f=f+Math.imul(P,re)|0)+Math.imul(D,de)|0,d=d+Math.imul(D,re)|0,c=c+Math.imul(T,ie)|0,f=(f=f+Math.imul(T,be)|0)+Math.imul(N,ie)|0,d=d+Math.imul(N,be)|0,c=c+Math.imul(k,se)|0,f=(f=f+Math.imul(k,le)|0)+Math.imul(L,se)|0,d=d+Math.imul(L,le)|0;var Le=(b+(c=c+Math.imul(C,he)|0)|0)+((8191&(f=(f=f+Math.imul(C,pe)|0)+Math.imul(M,he)|0))<<13)|0;b=((d=d+Math.imul(M,pe)|0)+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,c=Math.imul(F,de),f=(f=Math.imul(F,re))+Math.imul(Q,de)|0,d=Math.imul(Q,re),c=c+Math.imul(P,ie)|0,f=(f=f+Math.imul(P,be)|0)+Math.imul(D,ie)|0,d=d+Math.imul(D,be)|0,c=c+Math.imul(T,se)|0,f=(f=f+Math.imul(T,le)|0)+Math.imul(N,se)|0,d=d+Math.imul(N,le)|0;var Se=(b+(c=c+Math.imul(k,he)|0)|0)+((8191&(f=(f=f+Math.imul(k,pe)|0)+Math.imul(L,he)|0))<<13)|0;b=((d=d+Math.imul(L,pe)|0)+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,c=Math.imul(F,ie),f=(f=Math.imul(F,be))+Math.imul(Q,ie)|0,d=Math.imul(Q,be),c=c+Math.imul(P,se)|0,f=(f=f+Math.imul(P,le)|0)+Math.imul(D,se)|0,d=d+Math.imul(D,le)|0;var Te=(b+(c=c+Math.imul(T,he)|0)|0)+((8191&(f=(f=f+Math.imul(T,pe)|0)+Math.imul(N,he)|0))<<13)|0;b=((d=d+Math.imul(N,pe)|0)+(f>>>13)|0)+(Te>>>26)|0,Te&=67108863,c=Math.imul(F,se),f=(f=Math.imul(F,le))+Math.imul(Q,se)|0,d=Math.imul(Q,le);var Ne=(b+(c=c+Math.imul(P,he)|0)|0)+((8191&(f=(f=f+Math.imul(P,pe)|0)+Math.imul(D,he)|0))<<13)|0;b=((d=d+Math.imul(D,pe)|0)+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Re=(b+(c=Math.imul(F,he))|0)+((8191&(f=(f=Math.imul(F,pe))+Math.imul(Q,he)|0))<<13)|0;return b=((d=Math.imul(Q,pe))+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,i[0]=ge,i[1]=me,i[2]=ye,i[3]=xe,i[4]=Ae,i[5]=ve,i[6]=we,i[7]=_e,i[8]=Ie,i[9]=Ee,i[10]=Ce,i[11]=Me,i[12]=Be,i[13]=ke,i[14]=Le,i[15]=Se,i[16]=Te,i[17]=Ne,i[18]=Re,0!==b&&(i[19]=b,t.length++),t};function m(e,a,t){t.negative=a.negative^e.negative,t.length=e.length+a.length;for(var c=0,f=0,d=0;d>>26)|0)>>>26,r&=67108863}t.words[d]=n,c=r,r=f}return 0!==c?t.words[d]=c:t.length--,t._strip()}function y(e,a,t){return m(e,a,t)}function x(e,a){this.x=e,this.y=a}Math.imul||(g=p),d.prototype.mulTo=function(e,a){var t=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,a):t<63?p(this,e,a):t<1024?m(this,e,a):y(this,e,a)},x.prototype.makeRBT=function(e){for(var a=new Array(e),t=d.prototype._countBits(e)-1,c=0;c>=1;return c},x.prototype.permute=function(e,a,t,c,f,d){for(var r=0;r>>=1)f++;return 1<>>=13,t[2*r+1]=8191&d,d>>>=13;for(r=2*a;r>=26,t+=d/67108864|0,t+=r>>>26,this.words[f]=67108863&r}return 0!==t&&(this.words[f]=t,this.length++),a?this.ineg():this},d.prototype.muln=function(e){return this.clone().imuln(e)},d.prototype.sqr=function(){return this.mul(this)},d.prototype.isqr=function(){return this.imul(this.clone())},d.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),t=0;t>>f&1}return a}(e);if(0===a.length)return new d(1);for(var t=this,c=0;c=0);var a,t=e%26,f=(e-t)/26,d=67108863>>>26-t<<26-t;if(0!==t){var r=0;for(a=0;a>>26-t}r&&(this.words[a]=r,this.length++)}if(0!==f){for(a=this.length-1;a>=0;a--)this.words[a+f]=this.words[a];for(a=0;a=0),f=a?(a-a%26)/26:0;var d=e%26,r=Math.min((e-d)/26,this.length),n=67108863^67108863>>>d<r)for(this.length-=r,b=0;b=0&&(0!==o||b>=f);b--){var s=0|this.words[b];this.words[b]=o<<26-d|s>>>d,o=s&n}return i&&0!==o&&(i.words[i.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},d.prototype.ishrn=function(e,a,t){return c(0===this.negative),this.iushrn(e,a,t)},d.prototype.shln=function(e){return this.clone().ishln(e)},d.prototype.ushln=function(e){return this.clone().iushln(e)},d.prototype.shrn=function(e){return this.clone().ishrn(e)},d.prototype.ushrn=function(e){return this.clone().iushrn(e)},d.prototype.testn=function(e){c("number"==typeof e&&e>=0);var a=e%26,t=(e-a)/26,f=1<=0);var a=e%26,t=(e-a)/26;if(c(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==a&&t++,this.length=Math.min(t,this.length),0!==a){var f=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},d.prototype.isubn=function(e){if(c("number"==typeof e),c(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(i/67108864|0),this.words[f+t]=67108863&d}for(;f>26,this.words[f+t]=67108863&d;if(0===n)return this._strip();for(c(-1===n),n=0,f=0;f>26,this.words[f]=67108863&d;return this.negative=1,this._strip()},d.prototype._wordDiv=function(e,a){var t=(this.length,e.length),c=this.clone(),f=e,r=0|f.words[f.length-1];0!=(t=26-this._countBits(r))&&(f=f.ushln(t),c.iushln(t),r=0|f.words[f.length-1]);var n,i=c.length-f.length;if("mod"!==a){(n=new d(null)).length=i+1,n.words=new Array(n.length);for(var b=0;b=0;s--){var l=67108864*(0|c.words[f.length+s])+(0|c.words[f.length+s-1]);for(l=Math.min(l/r|0,67108863),c._ishlnsubmul(f,l,s);0!==c.negative;)l--,c.negative=0,c._ishlnsubmul(f,1,s),c.isZero()||(c.negative^=1);n&&(n.words[s]=l)}return n&&n._strip(),c._strip(),"div"!==a&&0!==t&&c.iushrn(t),{div:n||null,mod:c}},d.prototype.divmod=function(e,a,t){return c(!e.isZero()),this.isZero()?{div:new d(0),mod:new d(0)}:0!==this.negative&&0===e.negative?(n=this.neg().divmod(e,a),"mod"!==a&&(f=n.div.neg()),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.iadd(e)),{div:f,mod:r}):0===this.negative&&0!==e.negative?(n=this.divmod(e.neg(),a),"mod"!==a&&(f=n.div.neg()),{div:f,mod:n.mod}):this.negative&e.negative?(n=this.neg().divmod(e.neg(),a),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.isub(e)),{div:n.div,mod:r}):e.length>this.length||this.cmp(e)<0?{div:new d(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new d(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new d(this.modrn(e.words[0]))}:this._wordDiv(e,a);var f,r,n},d.prototype.div=function(e){return this.divmod(e,"div",!1).div},d.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},d.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},d.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var t=0!==a.div.negative?a.mod.isub(e):a.mod,c=e.ushrn(1),f=e.andln(1),d=t.cmp(c);return d<0||1===f&&0===d?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},d.prototype.modrn=function(e){var a=e<0;a&&(e=-e),c(e<=67108863);for(var t=(1<<26)%e,f=0,d=this.length-1;d>=0;d--)f=(t*f+(0|this.words[d]))%e;return a?-f:f},d.prototype.modn=function(e){return this.modrn(e)},d.prototype.idivn=function(e){var a=e<0;a&&(e=-e),c(e<=67108863);for(var t=0,f=this.length-1;f>=0;f--){var d=(0|this.words[f])+67108864*t;this.words[f]=d/e|0,t=d%e}return this._strip(),a?this.ineg():this},d.prototype.divn=function(e){return this.clone().idivn(e)},d.prototype.egcd=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f=new d(1),r=new d(0),n=new d(0),i=new d(1),b=0;a.isEven()&&t.isEven();)a.iushrn(1),t.iushrn(1),++b;for(var o=t.clone(),s=a.clone();!a.isZero();){for(var l=0,u=1;!(a.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(f.isOdd()||r.isOdd())&&(f.iadd(o),r.isub(s)),f.iushrn(1),r.iushrn(1);for(var h=0,p=1;!(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(o),i.isub(s)),n.iushrn(1),i.iushrn(1);a.cmp(t)>=0?(a.isub(t),f.isub(n),r.isub(i)):(t.isub(a),n.isub(f),i.isub(r))}return{a:n,b:i,gcd:t.iushln(b)}},d.prototype._invmp=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f,r=new d(1),n=new d(0),i=t.clone();a.cmpn(1)>0&&t.cmpn(1)>0;){for(var b=0,o=1;!(a.words[0]&o)&&b<26;++b,o<<=1);if(b>0)for(a.iushrn(b);b-- >0;)r.isOdd()&&r.iadd(i),r.iushrn(1);for(var s=0,l=1;!(t.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(t.iushrn(s);s-- >0;)n.isOdd()&&n.iadd(i),n.iushrn(1);a.cmp(t)>=0?(a.isub(t),r.isub(n)):(t.isub(a),n.isub(r))}return(f=0===a.cmpn(1)?r:n).cmpn(0)<0&&f.iadd(e),f},d.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),t=e.clone();a.negative=0,t.negative=0;for(var c=0;a.isEven()&&t.isEven();c++)a.iushrn(1),t.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;t.isEven();)t.iushrn(1);var f=a.cmp(t);if(f<0){var d=a;a=t,t=d}else if(0===f||0===t.cmpn(1))break;a.isub(t)}return t.iushln(c)},d.prototype.invm=function(e){return this.egcd(e).a.umod(e)},d.prototype.isEven=function(){return!(1&this.words[0])},d.prototype.isOdd=function(){return!(1&~this.words[0])},d.prototype.andln=function(e){return this.words[0]&e},d.prototype.bincn=function(e){c("number"==typeof e);var a=e%26,t=(e-a)/26,f=1<>>26,n&=67108863,this.words[r]=n}return 0!==d&&(this.words[r]=d,this.length++),this},d.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},d.prototype.cmpn=function(e){var a,t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this._strip(),this.length>1)a=1;else{t&&(e=-e),c(e<=67108863,"Number is too big");var f=0|this.words[0];a=f===e?0:fe.length)return 1;if(this.length=0;t--){var c=0|this.words[t],f=0|e.words[t];if(c!==f){cf&&(a=1);break}}return a},d.prototype.gtn=function(e){return 1===this.cmpn(e)},d.prototype.gt=function(e){return 1===this.cmp(e)},d.prototype.gten=function(e){return this.cmpn(e)>=0},d.prototype.gte=function(e){return this.cmp(e)>=0},d.prototype.ltn=function(e){return-1===this.cmpn(e)},d.prototype.lt=function(e){return-1===this.cmp(e)},d.prototype.lten=function(e){return this.cmpn(e)<=0},d.prototype.lte=function(e){return this.cmp(e)<=0},d.prototype.eqn=function(e){return 0===this.cmpn(e)},d.prototype.eq=function(e){return 0===this.cmp(e)},d.red=function(e){return new C(e)},d.prototype.toRed=function(e){return c(!this.red,"Already a number in reduction context"),c(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},d.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},d.prototype._forceRed=function(e){return this.red=e,this},d.prototype.forceRed=function(e){return c(!this.red,"Already a number in reduction context"),this._forceRed(e)},d.prototype.redAdd=function(e){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},d.prototype.redIAdd=function(e){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},d.prototype.redSub=function(e){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},d.prototype.redISub=function(e){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},d.prototype.redShl=function(e){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},d.prototype.redMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},d.prototype.redIMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},d.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},d.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},d.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},d.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},d.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},d.prototype.redPow=function(e){return c(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var A={k256:null,p224:null,p192:null,p25519:null};function v(e,a){this.name=e,this.p=new d(a,16),this.n=this.p.bitLength(),this.k=new d(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function I(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function C(e){if("string"==typeof e){var a=d._prime(e);this.m=a.p,this.prime=a}else c(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){C.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new d(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)}v.prototype._tmp=function(){var e=new d(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var a,t=e;do{this.split(t,this.tmp),a=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(a>this.n);var c=a0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},v.prototype.split=function(e,a){e.iushrn(this.n,0,a)},v.prototype.imulK=function(e){return e.imul(this.k)},f(w,v),w.prototype.split=function(e,a){for(var t=4194303,c=Math.min(e.length,9),f=0;f>>22,d=r}d>>>=22,e.words[f-10]=d,0===d&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,t=0;t>>=26,e.words[t]=f,a=c}return 0!==a&&(e.words[e.length++]=a),e},d._prime=function(e){if(A[e])return A[e];var a;if("k256"===e)a=new w;else if("p224"===e)a=new _;else if("p192"===e)a=new I;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new E}return A[e]=a,a},C.prototype._verify1=function(e){c(0===e.negative,"red works only with positives"),c(e.red,"red works only with red numbers")},C.prototype._verify2=function(e,a){c(!(e.negative|a.negative),"red works only with positives"),c(e.red&&e.red===a.red,"red works only with red numbers")},C.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(o(e,e.umod(this.m)._forceRed(this)),e)},C.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},C.prototype.add=function(e,a){this._verify2(e,a);var t=e.add(a);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},C.prototype.iadd=function(e,a){this._verify2(e,a);var t=e.iadd(a);return t.cmp(this.m)>=0&&t.isub(this.m),t},C.prototype.sub=function(e,a){this._verify2(e,a);var t=e.sub(a);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},C.prototype.isub=function(e,a){this._verify2(e,a);var t=e.isub(a);return t.cmpn(0)<0&&t.iadd(this.m),t},C.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},C.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},C.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},C.prototype.isqr=function(e){return this.imul(e,e.clone())},C.prototype.sqr=function(e){return this.mul(e,e)},C.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(c(a%2==1),3===a){var t=this.m.add(new d(1)).iushrn(2);return this.pow(e,t)}for(var f=this.m.subn(1),r=0;!f.isZero()&&0===f.andln(1);)r++,f.iushrn(1);c(!f.isZero());var n=new d(1).toRed(this),i=n.redNeg(),b=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new d(2*o*o).toRed(this);0!==this.pow(o,b).cmp(i);)o.redIAdd(i);for(var s=this.pow(o,f),l=this.pow(e,f.addn(1).iushrn(1)),u=this.pow(e,f),h=r;0!==u.cmp(n);){for(var p=u,g=0;0!==p.cmp(n);g++)p=p.redSqr();c(g=0;c--){for(var b=a.words[c],o=i-1;o>=0;o--){var s=b>>o&1;f!==t[0]&&(f=this.sqr(f)),0!==s||0!==r?(r<<=1,r|=s,(4==++n||0===c&&0===o)&&(f=this.mul(f,t[r]),n=0,r=0)):n=0}i=26}return f},C.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},C.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},d.mont=function(e){return new M(e)},f(M,C),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},M.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var t=e.imul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),d=f;return f.cmp(this.m)>=0?d=f.isub(this.m):f.cmpn(0)<0&&(d=f.iadd(this.m)),d._forceRed(this)},M.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new d(0)._forceRed(this);var t=e.mul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),r=f;return f.cmp(this.m)>=0?r=f.isub(this.m):f.cmpn(0)<0&&(r=f.iadd(this.m)),r._forceRed(this)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=t.nmd(e),this)},15037:(e,a,t)=>{var c;function f(e){this.rand=e}if(e.exports=function(e){return c||(c=new f(null)),c.generate(e)},e.exports.Rand=f,f.prototype.generate=function(e){return this._rand(e)},f.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var a=new Uint8Array(e),t=0;t{var c=t(92861).Buffer;function f(e){c.isBuffer(e)||(e=c.from(e));for(var a=e.length/4|0,t=new Array(a),f=0;f>>24]^o[h>>>16&255]^s[p>>>8&255]^l[255&g]^a[m++],r=b[h>>>24]^o[p>>>16&255]^s[g>>>8&255]^l[255&u]^a[m++],n=b[p>>>24]^o[g>>>16&255]^s[u>>>8&255]^l[255&h]^a[m++],i=b[g>>>24]^o[u>>>16&255]^s[h>>>8&255]^l[255&p]^a[m++],u=d,h=r,p=n,g=i;return d=(c[u>>>24]<<24|c[h>>>16&255]<<16|c[p>>>8&255]<<8|c[255&g])^a[m++],r=(c[h>>>24]<<24|c[p>>>16&255]<<16|c[g>>>8&255]<<8|c[255&u])^a[m++],n=(c[p>>>24]<<24|c[g>>>16&255]<<16|c[u>>>8&255]<<8|c[255&h])^a[m++],i=(c[g>>>24]<<24|c[u>>>16&255]<<16|c[h>>>8&255]<<8|c[255&p])^a[m++],[d>>>=0,r>>>=0,n>>>=0,i>>>=0]}var n=[0,1,2,4,8,16,32,64,128,27,54],i=function(){for(var e=new Array(256),a=0;a<256;a++)e[a]=a<128?a<<1:a<<1^283;for(var t=[],c=[],f=[[],[],[],[]],d=[[],[],[],[]],r=0,n=0,i=0;i<256;++i){var b=n^n<<1^n<<2^n<<3^n<<4;b=b>>>8^255&b^99,t[r]=b,c[b]=r;var o=e[r],s=e[o],l=e[s],u=257*e[b]^16843008*b;f[0][r]=u<<24|u>>>8,f[1][r]=u<<16|u>>>16,f[2][r]=u<<8|u>>>24,f[3][r]=u,u=16843009*l^65537*s^257*o^16843008*r,d[0][b]=u<<24|u>>>8,d[1][b]=u<<16|u>>>16,d[2][b]=u<<8|u>>>24,d[3][b]=u,0===r?r=n=1:(r=o^e[e[e[l^o]]],n^=e[e[n]])}return{SBOX:t,INV_SBOX:c,SUB_MIX:f,INV_SUB_MIX:d}}();function b(e){this._key=f(e),this._reset()}b.blockSize=16,b.keySize=32,b.prototype.blockSize=b.blockSize,b.prototype.keySize=b.keySize,b.prototype._reset=function(){for(var e=this._key,a=e.length,t=a+6,c=4*(t+1),f=[],d=0;d>>24,r=i.SBOX[r>>>24]<<24|i.SBOX[r>>>16&255]<<16|i.SBOX[r>>>8&255]<<8|i.SBOX[255&r],r^=n[d/a|0]<<24):a>6&&d%a==4&&(r=i.SBOX[r>>>24]<<24|i.SBOX[r>>>16&255]<<16|i.SBOX[r>>>8&255]<<8|i.SBOX[255&r]),f[d]=f[d-a]^r}for(var b=[],o=0;o>>24]]^i.INV_SUB_MIX[1][i.SBOX[l>>>16&255]]^i.INV_SUB_MIX[2][i.SBOX[l>>>8&255]]^i.INV_SUB_MIX[3][i.SBOX[255&l]]}this._nRounds=t,this._keySchedule=f,this._invKeySchedule=b},b.prototype.encryptBlockRaw=function(e){return r(e=f(e),this._keySchedule,i.SUB_MIX,i.SBOX,this._nRounds)},b.prototype.encryptBlock=function(e){var a=this.encryptBlockRaw(e),t=c.allocUnsafe(16);return t.writeUInt32BE(a[0],0),t.writeUInt32BE(a[1],4),t.writeUInt32BE(a[2],8),t.writeUInt32BE(a[3],12),t},b.prototype.decryptBlock=function(e){var a=(e=f(e))[1];e[1]=e[3],e[3]=a;var t=r(e,this._invKeySchedule,i.INV_SUB_MIX,i.INV_SBOX,this._nRounds),d=c.allocUnsafe(16);return d.writeUInt32BE(t[0],0),d.writeUInt32BE(t[3],4),d.writeUInt32BE(t[2],8),d.writeUInt32BE(t[1],12),d},b.prototype.scrub=function(){d(this._keySchedule),d(this._invKeySchedule),d(this._key)},e.exports.AES=b},92356:(e,a,t)=>{var c=t(50462),f=t(92861).Buffer,d=t(56168),r=t(56698),n=t(25892),i=t(30295),b=t(45122);function o(e,a,t,r){d.call(this);var i=f.alloc(4,0);this._cipher=new c.AES(a);var o=this._cipher.encryptBlock(i);this._ghash=new n(o),t=function(e,a,t){if(12===a.length)return e._finID=f.concat([a,f.from([0,0,0,1])]),f.concat([a,f.from([0,0,0,2])]);var c=new n(t),d=a.length,r=d%16;c.update(a),r&&(r=16-r,c.update(f.alloc(r,0))),c.update(f.alloc(8,0));var i=8*d,o=f.alloc(8);o.writeUIntBE(i,0,8),c.update(o),e._finID=c.state;var s=f.from(e._finID);return b(s),s}(this,t,o),this._prev=f.from(t),this._cache=f.allocUnsafe(0),this._secCache=f.allocUnsafe(0),this._decrypt=r,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}r(o,d),o.prototype._update=function(e){if(!this._called&&this._alen){var a=16-this._alen%16;a<16&&(a=f.alloc(a,0),this._ghash.update(a))}this._called=!0;var t=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(t),this._len+=e.length,t},o.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=i(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,a){var t=0;e.length!==a.length&&t++;for(var c=Math.min(e.length,a.length),f=0;f{var c=t(25799),f=t(36171),d=t(3219);a.createCipher=a.Cipher=c.createCipher,a.createCipheriv=a.Cipheriv=c.createCipheriv,a.createDecipher=a.Decipher=f.createDecipher,a.createDecipheriv=a.Decipheriv=f.createDecipheriv,a.listCiphers=a.getCiphers=function(){return Object.keys(d)}},36171:(e,a,t)=>{var c=t(92356),f=t(92861).Buffer,d=t(530),r=t(50650),n=t(56168),i=t(50462),b=t(68078);function o(e,a,t){n.call(this),this._cache=new s,this._last=void 0,this._cipher=new i.AES(a),this._prev=f.from(t),this._mode=e,this._autopadding=!0}function s(){this.cache=f.allocUnsafe(0)}function l(e,a,t){var n=d[e.toLowerCase()];if(!n)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=f.from(t)),"GCM"!==n.mode&&t.length!==n.iv)throw new TypeError("invalid iv length "+t.length);if("string"==typeof a&&(a=f.from(a)),a.length!==n.key/8)throw new TypeError("invalid key length "+a.length);return"stream"===n.type?new r(n.module,a,t,!0):"auth"===n.type?new c(n.module,a,t,!0):new o(n.module,a,t)}t(56698)(o,n),o.prototype._update=function(e){var a,t;this._cache.add(e);for(var c=[];a=this._cache.get(this._autopadding);)t=this._mode.decrypt(this,a),c.push(t);return f.concat(c)},o.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var a=e[15];if(a<1||a>16)throw new Error("unable to decrypt data");for(var t=-1;++t16)return a=this.cache.slice(0,16),this.cache=this.cache.slice(16),a}else if(this.cache.length>=16)return a=this.cache.slice(0,16),this.cache=this.cache.slice(16),a;return null},s.prototype.flush=function(){if(this.cache.length)return this.cache},a.createDecipher=function(e,a){var t=d[e.toLowerCase()];if(!t)throw new TypeError("invalid suite type");var c=b(a,!1,t.key,t.iv);return l(e,c.key,c.iv)},a.createDecipheriv=l},25799:(e,a,t)=>{var c=t(530),f=t(92356),d=t(92861).Buffer,r=t(50650),n=t(56168),i=t(50462),b=t(68078);function o(e,a,t){n.call(this),this._cache=new l,this._cipher=new i.AES(a),this._prev=d.from(t),this._mode=e,this._autopadding=!0}t(56698)(o,n),o.prototype._update=function(e){var a,t;this._cache.add(e);for(var c=[];a=this._cache.get();)t=this._mode.encrypt(this,a),c.push(t);return d.concat(c)};var s=d.alloc(16,16);function l(){this.cache=d.allocUnsafe(0)}function u(e,a,t){var n=c[e.toLowerCase()];if(!n)throw new TypeError("invalid suite type");if("string"==typeof a&&(a=d.from(a)),a.length!==n.key/8)throw new TypeError("invalid key length "+a.length);if("string"==typeof t&&(t=d.from(t)),"GCM"!==n.mode&&t.length!==n.iv)throw new TypeError("invalid iv length "+t.length);return"stream"===n.type?new r(n.module,a,t):"auth"===n.type?new f(n.module,a,t):new o(n.module,a,t)}o.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(s))throw this._cipher.scrub(),new Error("data not multiple of block length")},o.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},l.prototype.add=function(e){this.cache=d.concat([this.cache,e])},l.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},l.prototype.flush=function(){for(var e=16-this.cache.length,a=d.allocUnsafe(e),t=-1;++t{var c=t(92861).Buffer,f=c.alloc(16,0);function d(e){var a=c.allocUnsafe(16);return a.writeUInt32BE(e[0]>>>0,0),a.writeUInt32BE(e[1]>>>0,4),a.writeUInt32BE(e[2]>>>0,8),a.writeUInt32BE(e[3]>>>0,12),a}function r(e){this.h=e,this.state=c.alloc(16,0),this.cache=c.allocUnsafe(0)}r.prototype.ghash=function(e){for(var a=-1;++a0;a--)c[a]=c[a]>>>1|(1&c[a-1])<<31;c[0]=c[0]>>>1,t&&(c[0]=c[0]^225<<24)}this.state=d(f)},r.prototype.update=function(e){var a;for(this.cache=c.concat([this.cache,e]);this.cache.length>=16;)a=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(a)},r.prototype.final=function(e,a){return this.cache.length&&this.ghash(c.concat([this.cache,f],16)),this.ghash(d([0,e,0,a])),this.state},e.exports=r},45122:e=>{e.exports=function(e){for(var a,t=e.length;t--;){if(255!==(a=e.readUInt8(t))){a++,e.writeUInt8(a,t);break}e.writeUInt8(0,t)}}},92884:(e,a,t)=>{var c=t(30295);a.encrypt=function(e,a){var t=c(a,e._prev);return e._prev=e._cipher.encryptBlock(t),e._prev},a.decrypt=function(e,a){var t=e._prev;e._prev=a;var f=e._cipher.decryptBlock(a);return c(f,t)}},46383:(e,a,t)=>{var c=t(92861).Buffer,f=t(30295);function d(e,a,t){var d=a.length,r=f(a,e._cache);return e._cache=e._cache.slice(d),e._prev=c.concat([e._prev,t?a:r]),r}a.encrypt=function(e,a,t){for(var f,r=c.allocUnsafe(0);a.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=c.allocUnsafe(0)),!(e._cache.length<=a.length)){r=c.concat([r,d(e,a,t)]);break}f=e._cache.length,r=c.concat([r,d(e,a.slice(0,f),t)]),a=a.slice(f)}return r}},55264:(e,a,t)=>{var c=t(92861).Buffer;function f(e,a,t){for(var c,f,r=-1,n=0;++r<8;)c=a&1<<7-r?128:0,n+=(128&(f=e._cipher.encryptBlock(e._prev)[0]^c))>>r%8,e._prev=d(e._prev,t?c:f);return n}function d(e,a){var t=e.length,f=-1,d=c.allocUnsafe(e.length);for(e=c.concat([e,c.from([a])]);++f>7;return d}a.encrypt=function(e,a,t){for(var d=a.length,r=c.allocUnsafe(d),n=-1;++n{var c=t(92861).Buffer;function f(e,a,t){var f=e._cipher.encryptBlock(e._prev)[0]^a;return e._prev=c.concat([e._prev.slice(1),c.from([t?a:f])]),f}a.encrypt=function(e,a,t){for(var d=a.length,r=c.allocUnsafe(d),n=-1;++n{var c=t(30295),f=t(92861).Buffer,d=t(45122);function r(e){var a=e._cipher.encryptBlockRaw(e._prev);return d(e._prev),a}a.encrypt=function(e,a){var t=Math.ceil(a.length/16),d=e._cache.length;e._cache=f.concat([e._cache,f.allocUnsafe(16*t)]);for(var n=0;n{a.encrypt=function(e,a){return e._cipher.encryptBlock(a)},a.decrypt=function(e,a){return e._cipher.decryptBlock(a)}},530:(e,a,t)=>{var c={ECB:t(52632),CBC:t(92884),CFB:t(46383),CFB8:t(86975),CFB1:t(55264),OFB:t(46843),CTR:t(63053),GCM:t(63053)},f=t(3219);for(var d in f)f[d].module=c[f[d].mode];e.exports=f},46843:(e,a,t)=>{var c=t(62045).hp,f=t(30295);function d(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}a.encrypt=function(e,a){for(;e._cache.length{var c=t(50462),f=t(92861).Buffer,d=t(56168);function r(e,a,t,r){d.call(this),this._cipher=new c.AES(a),this._prev=f.from(t),this._cache=f.allocUnsafe(0),this._secCache=f.allocUnsafe(0),this._decrypt=r,this._mode=e}t(56698)(r,d),r.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},r.prototype._final=function(){this._cipher.scrub()},e.exports=r},30125:(e,a,t)=>{var c=t(84050),f=t(1241),d=t(530),r=t(32438),n=t(68078);function i(e,a,t){if(e=e.toLowerCase(),d[e])return f.createCipheriv(e,a,t);if(r[e])return new c({key:a,iv:t,mode:e});throw new TypeError("invalid suite type")}function b(e,a,t){if(e=e.toLowerCase(),d[e])return f.createDecipheriv(e,a,t);if(r[e])return new c({key:a,iv:t,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}a.createCipher=a.Cipher=function(e,a){var t,c;if(e=e.toLowerCase(),d[e])t=d[e].key,c=d[e].iv;else{if(!r[e])throw new TypeError("invalid suite type");t=8*r[e].key,c=r[e].iv}var f=n(a,!1,t,c);return i(e,f.key,f.iv)},a.createCipheriv=a.Cipheriv=i,a.createDecipher=a.Decipher=function(e,a){var t,c;if(e=e.toLowerCase(),d[e])t=d[e].key,c=d[e].iv;else{if(!r[e])throw new TypeError("invalid suite type");t=8*r[e].key,c=r[e].iv}var f=n(a,!1,t,c);return b(e,f.key,f.iv)},a.createDecipheriv=a.Decipheriv=b,a.listCiphers=a.getCiphers=function(){return Object.keys(r).concat(f.getCiphers())}},84050:(e,a,t)=>{var c=t(56168),f=t(29560),d=t(56698),r=t(92861).Buffer,n={"des-ede3-cbc":f.CBC.instantiate(f.EDE),"des-ede3":f.EDE,"des-ede-cbc":f.CBC.instantiate(f.EDE),"des-ede":f.EDE,"des-cbc":f.CBC.instantiate(f.DES),"des-ecb":f.DES};function i(e){c.call(this);var a,t=e.mode.toLowerCase(),f=n[t];a=e.decrypt?"decrypt":"encrypt";var d=e.key;r.isBuffer(d)||(d=r.from(d)),"des-ede"!==t&&"des-ede-cbc"!==t||(d=r.concat([d,d.slice(0,8)]));var i=e.iv;r.isBuffer(i)||(i=r.from(i)),this._des=f.create({key:d,iv:i,type:a})}n.des=n["des-cbc"],n.des3=n["des-ede3-cbc"],e.exports=i,d(i,c),i.prototype._update=function(e){return r.from(this._des.update(e))},i.prototype._final=function(){return r.from(this._des.final())}},32438:(e,a)=>{a["des-ecb"]={key:8,iv:0},a["des-cbc"]=a.des={key:8,iv:8},a["des-ede3-cbc"]=a.des3={key:24,iv:8},a["des-ede3"]={key:24,iv:0},a["des-ede-cbc"]={key:16,iv:8},a["des-ede"]={key:16,iv:0}},67332:(e,a,t)=>{var c=t(62045).hp,f=t(39404),d=t(53209);function r(e){var a,t=e.modulus.byteLength();do{a=new f(d(t))}while(a.cmp(e.modulus)>=0||!a.umod(e.prime1)||!a.umod(e.prime2));return a}function n(e,a){var t=function(e){var a=r(e);return{blinder:a.toRed(f.mont(e.modulus)).redPow(new f(e.publicExponent)).fromRed(),unblinder:a.invm(e.modulus)}}(a),d=a.modulus.byteLength(),n=new f(e).mul(t.blinder).umod(a.modulus),i=n.toRed(f.mont(a.prime1)),b=n.toRed(f.mont(a.prime2)),o=a.coefficient,s=a.prime1,l=a.prime2,u=i.redPow(a.exponent1).fromRed(),h=b.redPow(a.exponent2).fromRed(),p=u.isub(h).imul(o).umod(s).imul(l);return h.iadd(p).imul(t.unblinder).umod(a.modulus).toArrayLike(c,"be",d)}n.getr=r,e.exports=n},55715:(e,a,t)=>{"use strict";e.exports=t(62951)},20:(e,a,t)=>{"use strict";var c=t(92861).Buffer,f=t(47108),d=t(46737),r=t(56698),n=t(35359),i=t(74847),b=t(62951);function o(e){d.Writable.call(this);var a=b[e];if(!a)throw new Error("Unknown message digest");this._hashType=a.hash,this._hash=f(a.hash),this._tag=a.id,this._signType=a.sign}function s(e){d.Writable.call(this);var a=b[e];if(!a)throw new Error("Unknown message digest");this._hash=f(a.hash),this._tag=a.id,this._signType=a.sign}function l(e){return new o(e)}function u(e){return new s(e)}Object.keys(b).forEach((function(e){b[e].id=c.from(b[e].id,"hex"),b[e.toLowerCase()]=b[e]})),r(o,d.Writable),o.prototype._write=function(e,a,t){this._hash.update(e),t()},o.prototype.update=function(e,a){return this._hash.update("string"==typeof e?c.from(e,a):e),this},o.prototype.sign=function(e,a){this.end();var t=this._hash.digest(),c=n(t,e,this._hashType,this._signType,this._tag);return a?c.toString(a):c},r(s,d.Writable),s.prototype._write=function(e,a,t){this._hash.update(e),t()},s.prototype.update=function(e,a){return this._hash.update("string"==typeof e?c.from(e,a):e),this},s.prototype.verify=function(e,a,t){var f="string"==typeof a?c.from(a,t):a;this.end();var d=this._hash.digest();return i(f,d,e,this._signType,this._tag)},e.exports={Sign:l,Verify:u,createSign:l,createVerify:u}},35359:(e,a,t)=>{"use strict";var c=t(92861).Buffer,f=t(83507),d=t(67332),r=t(86729).ec,n=t(39404),i=t(78170),b=t(64589);function o(e,a,t,d){if((e=c.from(e.toArray())).length0&&t.ishrn(c),t}function l(e,a,t){var d,r;do{for(d=c.alloc(0);8*d.length{"use strict";var c=t(92861).Buffer,f=t(39404),d=t(86729).ec,r=t(78170),n=t(64589);function i(e,a){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(a)>=0)throw new Error("invalid sig")}e.exports=function(e,a,t,b,o){var s=r(t);if("ec"===s.type){if("ecdsa"!==b&&"ecdsa/rsa"!==b)throw new Error("wrong public key type");return function(e,a,t){var c=n[t.data.algorithm.curve.join(".")];if(!c)throw new Error("unknown curve "+t.data.algorithm.curve.join("."));var f=new d(c),r=t.data.subjectPrivateKey.data;return f.verify(a,e,r)}(e,a,s)}if("dsa"===s.type){if("dsa"!==b)throw new Error("wrong public key type");return function(e,a,t){var c=t.data.p,d=t.data.q,n=t.data.g,b=t.data.pub_key,o=r.signature.decode(e,"der"),s=o.s,l=o.r;i(s,d),i(l,d);var u=f.mont(c),h=s.invm(d);return 0===n.toRed(u).redPow(new f(a).mul(h).mod(d)).fromRed().mul(b.toRed(u).redPow(l.mul(h).mod(d)).fromRed()).mod(c).mod(d).cmp(l)}(e,a,s)}if("rsa"!==b&&"ecdsa/rsa"!==b)throw new Error("wrong public key type");a=c.concat([o,a]);for(var l=s.modulus.byteLength(),u=[1],h=0;a.length+u.length+2{var a={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==a.call(e)}},26248:(e,a,t)=>{"use strict";var c=t(33225),f=Object.keys||function(e){var a=[];for(var t in e)a.push(t);return a};e.exports=s;var d=Object.create(t(15622));d.inherits=t(56698);var r=t(30206),n=t(7314);d.inherits(s,r);for(var i=f(n.prototype),b=0;b{"use strict";e.exports=d;var c=t(81816),f=Object.create(t(15622));function d(e){if(!(this instanceof d))return new d(e);c.call(this,e)}f.inherits=t(56698),f.inherits(d,c),d.prototype._transform=function(e,a,t){t(null,e)}},30206:(e,a,t)=>{"use strict";var c=t(33225);e.exports=y;var f,d=t(32240);y.ReadableState=m,t(37007).EventEmitter;var r=function(e,a){return e.listeners(a).length},n=t(5567),i=t(24116).Buffer,b=(void 0!==t.g?t.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},o=Object.create(t(15622));o.inherits=t(56698);var s=t(92668),l=void 0;l=s&&s.debuglog?s.debuglog("stream"):function(){};var u,h=t(20672),p=t(36278);o.inherits(y,n);var g=["error","close","destroy","pause","resume"];function m(e,a){e=e||{};var c=a instanceof(f=f||t(26248));this.objectMode=!!e.objectMode,c&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var d=e.highWaterMark,r=e.readableHighWaterMark,n=this.objectMode?16:16384;this.highWaterMark=d||0===d?d:c&&(r||0===r)?r:n,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new h,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(u||(u=t(6427).I),this.decoder=new u(e.encoding),this.encoding=e.encoding)}function y(e){if(f=f||t(26248),!(this instanceof y))return new y(e);this._readableState=new m(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),n.call(this)}function x(e,a,t,c,f){var d,r=e._readableState;return null===a?(r.reading=!1,function(e,a){if(!a.ended){if(a.decoder){var t=a.decoder.end();t&&t.length&&(a.buffer.push(t),a.length+=a.objectMode?1:t.length)}a.ended=!0,_(e)}}(e,r)):(f||(d=function(e,a){var t,c;return c=a,i.isBuffer(c)||c instanceof b||"string"==typeof a||void 0===a||e.objectMode||(t=new TypeError("Invalid non-string/buffer chunk")),t}(r,a)),d?e.emit("error",d):r.objectMode||a&&a.length>0?("string"==typeof a||r.objectMode||Object.getPrototypeOf(a)===i.prototype||(a=function(e){return i.from(e)}(a)),c?r.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):A(e,r,a,!0):r.ended?e.emit("error",new Error("stream.push() after EOF")):(r.reading=!1,r.decoder&&!t?(a=r.decoder.write(a),r.objectMode||0!==a.length?A(e,r,a,!1):E(e,r)):A(e,r,a,!1))):c||(r.reading=!1)),function(e){return!e.ended&&(e.needReadable||e.lengtha.highWaterMark&&(a.highWaterMark=function(e){return e>=v?e=v:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=a.length?e:a.ended?a.length:(a.needReadable=!0,0))}function _(e){var a=e._readableState;a.needReadable=!1,a.emittedReadable||(l("emitReadable",a.flowing),a.emittedReadable=!0,a.sync?c.nextTick(I,e):I(e))}function I(e){l("emit readable"),e.emit("readable"),k(e)}function E(e,a){a.readingMore||(a.readingMore=!0,c.nextTick(C,e,a))}function C(e,a){for(var t=a.length;!a.reading&&!a.flowing&&!a.ended&&a.length=a.length?(t=a.decoder?a.buffer.join(""):1===a.buffer.length?a.buffer.head.data:a.buffer.concat(a.length),a.buffer.clear()):t=function(e,a,t){var c;return ed.length?d.length:e;if(r===d.length?f+=d:f+=d.slice(0,e),0==(e-=r)){r===d.length?(++c,t.next?a.head=t.next:a.head=a.tail=null):(a.head=t,t.data=d.slice(r));break}++c}return a.length-=c,f}(e,a):function(e,a){var t=i.allocUnsafe(e),c=a.head,f=1;for(c.data.copy(t),e-=c.data.length;c=c.next;){var d=c.data,r=e>d.length?d.length:e;if(d.copy(t,t.length-e,0,r),0==(e-=r)){r===d.length?(++f,c.next?a.head=c.next:a.head=a.tail=null):(a.head=c,c.data=d.slice(r));break}++f}return a.length-=f,t}(e,a),c}(e,a.buffer,a.decoder),t);var t}function S(e){var a=e._readableState;if(a.length>0)throw new Error('"endReadable()" called on non-empty stream');a.endEmitted||(a.ended=!0,c.nextTick(T,a,e))}function T(e,a){e.endEmitted||0!==e.length||(e.endEmitted=!0,a.readable=!1,a.emit("end"))}function N(e,a){for(var t=0,c=e.length;t=a.highWaterMark||a.ended))return l("read: emitReadable",a.length,a.ended),0===a.length&&a.ended?S(this):_(this),null;if(0===(e=w(e,a))&&a.ended)return 0===a.length&&S(this),null;var c,f=a.needReadable;return l("need readable",f),(0===a.length||a.length-e0?L(e,a):null)?(a.needReadable=!0,e=0):a.length-=e,0===a.length&&(a.ended||(a.needReadable=!0),t!==e&&a.ended&&S(this)),null!==c&&this.emit("data",c),c},y.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},y.prototype.pipe=function(e,a){var t=this,f=this._readableState;switch(f.pipesCount){case 0:f.pipes=e;break;case 1:f.pipes=[f.pipes,e];break;default:f.pipes.push(e)}f.pipesCount+=1,l("pipe count=%d opts=%j",f.pipesCount,a);var n=a&&!1===a.end||e===process.stdout||e===process.stderr?m:i;function i(){l("onend"),e.end()}f.endEmitted?c.nextTick(n):t.once("end",n),e.on("unpipe",(function a(c,d){l("onunpipe"),c===t&&d&&!1===d.hasUnpiped&&(d.hasUnpiped=!0,l("cleanup"),e.removeListener("close",p),e.removeListener("finish",g),e.removeListener("drain",b),e.removeListener("error",h),e.removeListener("unpipe",a),t.removeListener("end",i),t.removeListener("end",m),t.removeListener("data",u),o=!0,!f.awaitDrain||e._writableState&&!e._writableState.needDrain||b())}));var b=function(e){return function(){var a=e._readableState;l("pipeOnDrain",a.awaitDrain),a.awaitDrain&&a.awaitDrain--,0===a.awaitDrain&&r(e,"data")&&(a.flowing=!0,k(e))}}(t);e.on("drain",b);var o=!1,s=!1;function u(a){l("ondata"),s=!1,!1!==e.write(a)||s||((1===f.pipesCount&&f.pipes===e||f.pipesCount>1&&-1!==N(f.pipes,e))&&!o&&(l("false write response, pause",f.awaitDrain),f.awaitDrain++,s=!0),t.pause())}function h(a){l("onerror",a),m(),e.removeListener("error",h),0===r(e,"error")&&e.emit("error",a)}function p(){e.removeListener("finish",g),m()}function g(){l("onfinish"),e.removeListener("close",p),m()}function m(){l("unpipe"),t.unpipe(e)}return t.on("data",u),function(e,a,t){if("function"==typeof e.prependListener)return e.prependListener(a,t);e._events&&e._events[a]?d(e._events[a])?e._events[a].unshift(t):e._events[a]=[t,e._events[a]]:e.on(a,t)}(e,"error",h),e.once("close",p),e.once("finish",g),e.emit("pipe",t),f.flowing||(l("pipe resume"),t.resume()),e},y.prototype.unpipe=function(e){var a=this._readableState,t={hasUnpiped:!1};if(0===a.pipesCount)return this;if(1===a.pipesCount)return e&&e!==a.pipes||(e||(e=a.pipes),a.pipes=null,a.pipesCount=0,a.flowing=!1,e&&e.emit("unpipe",this,t)),this;if(!e){var c=a.pipes,f=a.pipesCount;a.pipes=null,a.pipesCount=0,a.flowing=!1;for(var d=0;d{"use strict";e.exports=r;var c=t(26248),f=Object.create(t(15622));function d(e,a){var t=this._transformState;t.transforming=!1;var c=t.writecb;if(!c)return this.emit("error",new Error("write callback called multiple times"));t.writechunk=null,t.writecb=null,null!=a&&this.push(a),c(e);var f=this._readableState;f.reading=!1,(f.needReadable||f.length{"use strict";var c=t(33225);function f(e){var a=this;this.next=null,this.entry=null,this.finish=function(){!function(e,a){var t=e.entry;for(e.entry=null;t;){var c=t.callback;a.pendingcb--,c(undefined),t=t.next}a.corkedRequestsFree.next=e}(a,e)}}e.exports=g;var d,r=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:c.nextTick;g.WritableState=p;var n=Object.create(t(15622));n.inherits=t(56698);var i,b={deprecate:t(94643)},o=t(5567),s=t(24116).Buffer,l=(void 0!==t.g?t.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},u=t(36278);function h(){}function p(e,a){d=d||t(26248),e=e||{};var n=a instanceof d;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,b=e.writableHighWaterMark,o=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(b||0===b)?b:o,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,a){var t=e._writableState,f=t.sync,d=t.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(t),a)!function(e,a,t,f,d){--a.pendingcb,t?(c.nextTick(d,f),c.nextTick(w,e,a),e._writableState.errorEmitted=!0,e.emit("error",f)):(d(f),e._writableState.errorEmitted=!0,e.emit("error",f),w(e,a))}(e,t,f,a,d);else{var n=A(t);n||t.corked||t.bufferProcessing||!t.bufferedRequest||x(e,t),f?r(y,e,t,n,d):y(e,t,n,d)}}(a,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new f(this)}function g(e){if(d=d||t(26248),!(i.call(g,this)||this instanceof d))return new g(e);this._writableState=new p(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),o.call(this)}function m(e,a,t,c,f,d,r){a.writelen=c,a.writecb=r,a.writing=!0,a.sync=!0,t?e._writev(f,a.onwrite):e._write(f,d,a.onwrite),a.sync=!1}function y(e,a,t,c){t||function(e,a){0===a.length&&a.needDrain&&(a.needDrain=!1,e.emit("drain"))}(e,a),a.pendingcb--,c(),w(e,a)}function x(e,a){a.bufferProcessing=!0;var t=a.bufferedRequest;if(e._writev&&t&&t.next){var c=a.bufferedRequestCount,d=new Array(c),r=a.corkedRequestsFree;r.entry=t;for(var n=0,i=!0;t;)d[n]=t,t.isBuf||(i=!1),t=t.next,n+=1;d.allBuffers=i,m(e,a,!0,a.length,d,"",r.finish),a.pendingcb++,a.lastBufferedRequest=null,r.next?(a.corkedRequestsFree=r.next,r.next=null):a.corkedRequestsFree=new f(a),a.bufferedRequestCount=0}else{for(;t;){var b=t.chunk,o=t.encoding,s=t.callback;if(m(e,a,!1,a.objectMode?1:b.length,b,o,s),t=t.next,a.bufferedRequestCount--,a.writing)break}null===t&&(a.lastBufferedRequest=null)}a.bufferedRequest=t,a.bufferProcessing=!1}function A(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function v(e,a){e._final((function(t){a.pendingcb--,t&&e.emit("error",t),a.prefinished=!0,e.emit("prefinish"),w(e,a)}))}function w(e,a){var t=A(a);return t&&(function(e,a){a.prefinished||a.finalCalled||("function"==typeof e._final?(a.pendingcb++,a.finalCalled=!0,c.nextTick(v,e,a)):(a.prefinished=!0,e.emit("prefinish")))}(e,a),0===a.pendingcb&&(a.finished=!0,e.emit("finish"))),t}n.inherits(g,o),p.prototype.getBuffer=function(){for(var e=this.bufferedRequest,a=[];e;)a.push(e),e=e.next;return a},function(){try{Object.defineProperty(p.prototype,"buffer",{get:b.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(i=Function.prototype[Symbol.hasInstance],Object.defineProperty(g,Symbol.hasInstance,{value:function(e){return!!i.call(this,e)||this===g&&e&&e._writableState instanceof p}})):i=function(e){return e instanceof this},g.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},g.prototype.write=function(e,a,t){var f,d=this._writableState,r=!1,n=!d.objectMode&&(f=e,s.isBuffer(f)||f instanceof l);return n&&!s.isBuffer(e)&&(e=function(e){return s.from(e)}(e)),"function"==typeof a&&(t=a,a=null),n?a="buffer":a||(a=d.defaultEncoding),"function"!=typeof t&&(t=h),d.ended?function(e,a){var t=new Error("write after end");e.emit("error",t),c.nextTick(a,t)}(this,t):(n||function(e,a,t,f){var d=!0,r=!1;return null===t?r=new TypeError("May not write null values to stream"):"string"==typeof t||void 0===t||a.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r&&(e.emit("error",r),c.nextTick(f,r),d=!1),d}(this,d,e,t))&&(d.pendingcb++,r=function(e,a,t,c,f,d){if(!t){var r=function(e,a,t){return e.objectMode||!1===e.decodeStrings||"string"!=typeof a||(a=s.from(a,t)),a}(a,c,f);c!==r&&(t=!0,f="buffer",c=r)}var n=a.objectMode?1:c.length;a.length+=n;var i=a.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(g.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),g.prototype._write=function(e,a,t){t(new Error("_write() is not implemented"))},g.prototype._writev=null,g.prototype.end=function(e,a,t){var f=this._writableState;"function"==typeof e?(t=e,e=null,a=null):"function"==typeof a&&(t=a,a=null),null!=e&&this.write(e,a),f.corked&&(f.corked=1,this.uncork()),f.ending||function(e,a,t){a.ending=!0,w(e,a),t&&(a.finished?c.nextTick(t):e.once("finish",t)),a.ended=!0,e.writable=!1}(this,f,t)},Object.defineProperty(g.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),g.prototype.destroy=u.destroy,g.prototype._undestroy=u.undestroy,g.prototype._destroy=function(e,a){this.end(),a(e)}},20672:(e,a,t)=>{"use strict";var c=t(24116).Buffer,f=t(21638);e.exports=function(){function e(){!function(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var a={data:e,next:null};this.length>0?this.tail.next=a:this.head=a,this.tail=a,++this.length},e.prototype.unshift=function(e){var a={data:e,next:this.head};0===this.length&&(this.tail=a),this.head=a,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var a=this.head,t=""+a.data;a=a.next;)t+=e+a.data;return t},e.prototype.concat=function(e){if(0===this.length)return c.alloc(0);for(var a,t,f=c.allocUnsafe(e>>>0),d=this.head,r=0;d;)a=f,t=r,d.data.copy(a,t),r+=d.data.length,d=d.next;return f},e}(),f&&f.inspect&&f.inspect.custom&&(e.exports.prototype[f.inspect.custom]=function(){var e=f.inspect({length:this.length});return this.constructor.name+" "+e})},36278:(e,a,t)=>{"use strict";var c=t(33225);function f(e,a){e.emit("error",a)}e.exports={destroy:function(e,a){var t=this,d=this._readableState&&this._readableState.destroyed,r=this._writableState&&this._writableState.destroyed;return d||r?(a?a(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,c.nextTick(f,this,e)):c.nextTick(f,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!a&&e?t._writableState?t._writableState.errorEmitted||(t._writableState.errorEmitted=!0,c.nextTick(f,t,e)):c.nextTick(f,t,e):a&&a(e)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},5567:(e,a,t)=>{e.exports=t(37007).EventEmitter},24116:(e,a,t)=>{var c=t(48287),f=c.Buffer;function d(e,a){for(var t in e)a[t]=e[t]}function r(e,a,t){return f(e,a,t)}f.from&&f.alloc&&f.allocUnsafe&&f.allocUnsafeSlow?e.exports=c:(d(c,a),a.Buffer=r),d(f,r),r.from=function(e,a,t){if("number"==typeof e)throw new TypeError("Argument must not be a number");return f(e,a,t)},r.alloc=function(e,a,t){if("number"!=typeof e)throw new TypeError("Argument must be a number");var c=f(e);return void 0!==a?"string"==typeof t?c.fill(a,t):c.fill(a):c.fill(0),c},r.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return f(e)},r.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return c.SlowBuffer(e)}},46737:(e,a,t)=>{(a=e.exports=t(30206)).Stream=a,a.Readable=a,a.Writable=t(7314),a.Duplex=t(26248),a.Transform=t(81816),a.PassThrough=t(75242)},6427:(e,a,t)=>{"use strict";var c=t(88393).Buffer,f=c.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function d(e){var a;switch(this.encoding=function(e){var a=function(e){if(!e)return"utf8";for(var a;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(a)return;e=(""+e).toLowerCase(),a=!0}}(e);if("string"!=typeof a&&(c.isEncoding===f||!f(e)))throw new Error("Unknown encoding: "+e);return a||e}(e),this.encoding){case"utf16le":this.text=i,this.end=b,a=4;break;case"utf8":this.fillLast=n,a=4;break;case"base64":this.text=o,this.end=s,a=3;break;default:return this.write=l,void(this.end=u)}this.lastNeed=0,this.lastTotal=0,this.lastChar=c.allocUnsafe(a)}function r(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function n(e){var a=this.lastTotal-this.lastNeed,t=function(e,a){if(128!=(192&a[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&a.length>1){if(128!=(192&a[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&a.length>2&&128!=(192&a[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==t?t:this.lastNeed<=e.length?(e.copy(this.lastChar,a,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,a,0,e.length),void(this.lastNeed-=e.length))}function i(e,a){if((e.length-a)%2==0){var t=e.toString("utf16le",a);if(t){var c=t.charCodeAt(t.length-1);if(c>=55296&&c<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",a,e.length-1)}function b(e){var a=e&&e.length?this.write(e):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return a+this.lastChar.toString("utf16le",0,t)}return a}function o(e,a){var t=(e.length-a)%3;return 0===t?e.toString("base64",a):(this.lastNeed=3-t,this.lastTotal=3,1===t?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",a,e.length-t))}function s(e){var a=e&&e.length?this.write(e):"";return this.lastNeed?a+this.lastChar.toString("base64",0,3-this.lastNeed):a}function l(e){return e.toString(this.encoding)}function u(e){return e&&e.length?this.write(e):""}a.I=d,d.prototype.write=function(e){if(0===e.length)return"";var a,t;if(this.lastNeed){if(void 0===(a=this.fillLast(e)))return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t=0?(f>0&&(e.lastNeed=f-1),f):--c=0?(f>0&&(e.lastNeed=f-2),f):--c=0?(f>0&&(2===f?f=0:e.lastNeed=f-3),f):0}(this,e,a);if(!this.lastNeed)return e.toString("utf8",a);this.lastTotal=t;var c=e.length-(t-this.lastNeed);return e.copy(this.lastChar,0,c),e.toString("utf8",a,c)},d.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},88393:(e,a,t)=>{var c=t(48287),f=c.Buffer;function d(e,a){for(var t in e)a[t]=e[t]}function r(e,a,t){return f(e,a,t)}f.from&&f.alloc&&f.allocUnsafe&&f.allocUnsafeSlow?e.exports=c:(d(c,a),a.Buffer=r),d(f,r),r.from=function(e,a,t){if("number"==typeof e)throw new TypeError("Argument must not be a number");return f(e,a,t)},r.alloc=function(e,a,t){if("number"!=typeof e)throw new TypeError("Argument must be a number");var c=f(e);return void 0!==a?"string"==typeof t?c.fill(a,t):c.fill(a):c.fill(0),c},r.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return f(e)},r.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return c.SlowBuffer(e)}},5974:(e,a,t)=>{"use strict";var c=t(62045).hp,f=t(94148),d=t(44442),r=t(58411),n=t(71447),i=t(19681);for(var b in i)a[b]=i[b];function o(e){if("number"!=typeof e||ea.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}a.NONE=0,a.DEFLATE=1,a.INFLATE=2,a.GZIP=3,a.GUNZIP=4,a.DEFLATERAW=5,a.INFLATERAW=6,a.UNZIP=7,o.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,f(this.init_done,"close before init"),f(this.mode<=a.UNZIP),this.mode===a.DEFLATE||this.mode===a.GZIP||this.mode===a.DEFLATERAW?r.deflateEnd(this.strm):this.mode!==a.INFLATE&&this.mode!==a.GUNZIP&&this.mode!==a.INFLATERAW&&this.mode!==a.UNZIP||n.inflateEnd(this.strm),this.mode=a.NONE,this.dictionary=null)},o.prototype.write=function(e,a,t,c,f,d,r){return this._write(!0,e,a,t,c,f,d,r)},o.prototype.writeSync=function(e,a,t,c,f,d,r){return this._write(!1,e,a,t,c,f,d,r)},o.prototype._write=function(e,t,d,r,n,i,b,o){if(f.equal(arguments.length,8),f(this.init_done,"write before init"),f(this.mode!==a.NONE,"already finalized"),f.equal(!1,this.write_in_progress,"write already in progress"),f.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,f.equal(!1,void 0===t,"must provide flush value"),this.write_in_progress=!0,t!==a.Z_NO_FLUSH&&t!==a.Z_PARTIAL_FLUSH&&t!==a.Z_SYNC_FLUSH&&t!==a.Z_FULL_FLUSH&&t!==a.Z_FINISH&&t!==a.Z_BLOCK)throw new Error("Invalid flush value");if(null==d&&(d=c.alloc(0),n=0,r=0),this.strm.avail_in=n,this.strm.input=d,this.strm.next_in=r,this.strm.avail_out=o,this.strm.output=i,this.strm.next_out=b,this.flush=t,!e)return this._process(),this._checkError()?this._afterSync():void 0;var s=this;return process.nextTick((function(){s._process(),s._after()})),this},o.prototype._afterSync=function(){var e=this.strm.avail_out,a=this.strm.avail_in;return this.write_in_progress=!1,[a,e]},o.prototype._process=function(){var e=null;switch(this.mode){case a.DEFLATE:case a.GZIP:case a.DEFLATERAW:this.err=r.deflate(this.strm,this.flush);break;case a.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===e)break;if(31!==this.strm.input[e]){this.mode=a.INFLATE;break}if(this.gzip_id_bytes_read=1,e++,1===this.strm.avail_in)break;case 1:if(null===e)break;139===this.strm.input[e]?(this.gzip_id_bytes_read=2,this.mode=a.GUNZIP):this.mode=a.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case a.INFLATE:case a.GUNZIP:case a.INFLATERAW:for(this.err=n.inflate(this.strm,this.flush),this.err===a.Z_NEED_DICT&&this.dictionary&&(this.err=n.inflateSetDictionary(this.strm,this.dictionary),this.err===a.Z_OK?this.err=n.inflate(this.strm,this.flush):this.err===a.Z_DATA_ERROR&&(this.err=a.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===a.GUNZIP&&this.err===a.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=n.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},o.prototype._checkError=function(){switch(this.err){case a.Z_OK:case a.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===a.Z_FINISH)return this._error("unexpected end of file"),!1;break;case a.Z_STREAM_END:break;case a.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},o.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,a=this.strm.avail_in;this.write_in_progress=!1,this.callback(a,e),this.pending_close&&this.close()}},o.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},o.prototype.init=function(e,t,c,d,r){f(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),f(e>=8&&e<=15,"invalid windowBits"),f(t>=-1&&t<=9,"invalid compression level"),f(c>=1&&c<=9,"invalid memlevel"),f(d===a.Z_FILTERED||d===a.Z_HUFFMAN_ONLY||d===a.Z_RLE||d===a.Z_FIXED||d===a.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(t,e,c,d,r),this._setDictionary()},o.prototype.params=function(){throw new Error("deflateParams Not supported")},o.prototype.reset=function(){this._reset(),this._setDictionary()},o.prototype._init=function(e,t,c,f,i){switch(this.level=e,this.windowBits=t,this.memLevel=c,this.strategy=f,this.flush=a.Z_NO_FLUSH,this.err=a.Z_OK,this.mode!==a.GZIP&&this.mode!==a.GUNZIP||(this.windowBits+=16),this.mode===a.UNZIP&&(this.windowBits+=32),this.mode!==a.DEFLATERAW&&this.mode!==a.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new d,this.mode){case a.DEFLATE:case a.GZIP:case a.DEFLATERAW:this.err=r.deflateInit2(this.strm,this.level,a.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case a.INFLATE:case a.GUNZIP:case a.INFLATERAW:case a.UNZIP:this.err=n.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==a.Z_OK&&this._error("Init error"),this.dictionary=i,this.write_in_progress=!1,this.init_done=!0},o.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=a.Z_OK,this.mode){case a.DEFLATE:case a.DEFLATERAW:this.err=r.deflateSetDictionary(this.strm,this.dictionary)}this.err!==a.Z_OK&&this._error("Failed to set dictionary")}},o.prototype._reset=function(){switch(this.err=a.Z_OK,this.mode){case a.DEFLATE:case a.DEFLATERAW:case a.GZIP:this.err=r.deflateReset(this.strm);break;case a.INFLATE:case a.INFLATERAW:case a.GUNZIP:this.err=n.inflateReset(this.strm)}this.err!==a.Z_OK&&this._error("Failed to reset stream")},a.Zlib=o},78559:(e,a,t)=>{"use strict";var c=t(48287).Buffer,f=t(88310).Transform,d=t(5974),r=t(40537),n=t(94148).ok,i=t(48287).kMaxLength,b="Cannot create final Buffer. It would be larger than 0x"+i.toString(16)+" bytes";d.Z_MIN_WINDOWBITS=8,d.Z_MAX_WINDOWBITS=15,d.Z_DEFAULT_WINDOWBITS=15,d.Z_MIN_CHUNK=64,d.Z_MAX_CHUNK=1/0,d.Z_DEFAULT_CHUNK=16384,d.Z_MIN_MEMLEVEL=1,d.Z_MAX_MEMLEVEL=9,d.Z_DEFAULT_MEMLEVEL=8,d.Z_MIN_LEVEL=-1,d.Z_MAX_LEVEL=9,d.Z_DEFAULT_LEVEL=d.Z_DEFAULT_COMPRESSION;for(var o=Object.keys(d),s=0;s=i?r=new RangeError(b):a=c.concat(f,d),f=[],e.close(),t(r,a)}e.on("error",(function(a){e.removeListener("end",n),e.removeListener("readable",r),t(a)})),e.on("end",n),e.end(a),r()}function y(e,a){if("string"==typeof a&&(a=c.from(a)),!c.isBuffer(a))throw new TypeError("Not a string or buffer");var t=e._finishFlushFlag;return e._processChunk(a,t)}function x(e){if(!(this instanceof x))return new x(e);M.call(this,e,d.DEFLATE)}function A(e){if(!(this instanceof A))return new A(e);M.call(this,e,d.INFLATE)}function v(e){if(!(this instanceof v))return new v(e);M.call(this,e,d.GZIP)}function w(e){if(!(this instanceof w))return new w(e);M.call(this,e,d.GUNZIP)}function _(e){if(!(this instanceof _))return new _(e);M.call(this,e,d.DEFLATERAW)}function I(e){if(!(this instanceof I))return new I(e);M.call(this,e,d.INFLATERAW)}function E(e){if(!(this instanceof E))return new E(e);M.call(this,e,d.UNZIP)}function C(e){return e===d.Z_NO_FLUSH||e===d.Z_PARTIAL_FLUSH||e===d.Z_SYNC_FLUSH||e===d.Z_FULL_FLUSH||e===d.Z_FINISH||e===d.Z_BLOCK}function M(e,t){var r=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||a.Z_DEFAULT_CHUNK,f.call(this,e),e.flush&&!C(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!C(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||d.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:d.Z_FINISH,e.chunkSize&&(e.chunkSizea.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsa.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levela.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevela.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=a.Z_FILTERED&&e.strategy!=a.Z_HUFFMAN_ONLY&&e.strategy!=a.Z_RLE&&e.strategy!=a.Z_FIXED&&e.strategy!=a.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!c.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new d.Zlib(t);var n=this;this._hadError=!1,this._handle.onerror=function(e,t){B(n),n._hadError=!0;var c=new Error(e);c.errno=t,c.code=a.codes[t],n.emit("error",c)};var i=a.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(i=e.level);var b=a.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(b=e.strategy),this._handle.init(e.windowBits||a.Z_DEFAULT_WINDOWBITS,i,e.memLevel||a.Z_DEFAULT_MEMLEVEL,b,e.dictionary),this._buffer=c.allocUnsafe(this._chunkSize),this._offset=0,this._level=i,this._strategy=b,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!r._handle},configurable:!0,enumerable:!0})}function B(e,a){a&&process.nextTick(a),e._handle&&(e._handle.close(),e._handle=null)}function k(e){e.emit("close")}Object.defineProperty(a,"codes",{enumerable:!0,value:Object.freeze(u),writable:!1}),a.Deflate=x,a.Inflate=A,a.Gzip=v,a.Gunzip=w,a.DeflateRaw=_,a.InflateRaw=I,a.Unzip=E,a.createDeflate=function(e){return new x(e)},a.createInflate=function(e){return new A(e)},a.createDeflateRaw=function(e){return new _(e)},a.createInflateRaw=function(e){return new I(e)},a.createGzip=function(e){return new v(e)},a.createGunzip=function(e){return new w(e)},a.createUnzip=function(e){return new E(e)},a.deflate=function(e,a,t){return"function"==typeof a&&(t=a,a={}),m(new x(a),e,t)},a.deflateSync=function(e,a){return y(new x(a),e)},a.gzip=function(e,a,t){return"function"==typeof a&&(t=a,a={}),m(new v(a),e,t)},a.gzipSync=function(e,a){return y(new v(a),e)},a.deflateRaw=function(e,a,t){return"function"==typeof a&&(t=a,a={}),m(new _(a),e,t)},a.deflateRawSync=function(e,a){return y(new _(a),e)},a.unzip=function(e,a,t){return"function"==typeof a&&(t=a,a={}),m(new E(a),e,t)},a.unzipSync=function(e,a){return y(new E(a),e)},a.inflate=function(e,a,t){return"function"==typeof a&&(t=a,a={}),m(new A(a),e,t)},a.inflateSync=function(e,a){return y(new A(a),e)},a.gunzip=function(e,a,t){return"function"==typeof a&&(t=a,a={}),m(new w(a),e,t)},a.gunzipSync=function(e,a){return y(new w(a),e)},a.inflateRaw=function(e,a,t){return"function"==typeof a&&(t=a,a={}),m(new I(a),e,t)},a.inflateRawSync=function(e,a){return y(new I(a),e)},r.inherits(M,f),M.prototype.params=function(e,t,c){if(ea.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=a.Z_FILTERED&&t!=a.Z_HUFFMAN_ONLY&&t!=a.Z_RLE&&t!=a.Z_FIXED&&t!=a.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var f=this;this.flush(d.Z_SYNC_FLUSH,(function(){n(f._handle,"zlib binding closed"),f._handle.params(e,t),f._hadError||(f._level=e,f._strategy=t,c&&c())}))}else process.nextTick(c)},M.prototype.reset=function(){return n(this._handle,"zlib binding closed"),this._handle.reset()},M.prototype._flush=function(e){this._transform(c.alloc(0),"",e)},M.prototype.flush=function(e,a){var t=this,f=this._writableState;("function"==typeof e||void 0===e&&!a)&&(a=e,e=d.Z_FULL_FLUSH),f.ended?a&&process.nextTick(a):f.ending?a&&this.once("end",a):f.needDrain?a&&this.once("drain",(function(){return t.flush(e,a)})):(this._flushFlag=e,this.write(c.alloc(0),"",a))},M.prototype.close=function(e){B(this,e),process.nextTick(k,this)},M.prototype._transform=function(e,a,t){var f,r=this._writableState,n=(r.ending||r.ended)&&(!e||r.length===e.length);return null===e||c.isBuffer(e)?this._handle?(n?f=this._finishFlushFlag:(f=this._flushFlag,e.length>=r.length&&(this._flushFlag=this._opts.flush||d.Z_NO_FLUSH)),void this._processChunk(e,f,t)):t(new Error("zlib binding closed")):t(new Error("invalid input"))},M.prototype._processChunk=function(e,a,t){var f=e&&e.length,d=this._chunkSize-this._offset,r=0,o=this,s="function"==typeof t;if(!s){var l,u=[],h=0;this.on("error",(function(e){l=e})),n(this._handle,"zlib binding closed");do{var p=this._handle.writeSync(a,e,r,f,this._buffer,this._offset,d)}while(!this._hadError&&y(p[0],p[1]));if(this._hadError)throw l;if(h>=i)throw B(this),new RangeError(b);var g=c.concat(u,h);return B(this),g}n(this._handle,"zlib binding closed");var m=this._handle.write(a,e,r,f,this._buffer,this._offset,d);function y(i,b){if(this&&(this.buffer=null,this.callback=null),!o._hadError){var l=d-b;if(n(l>=0,"have should not go down"),l>0){var p=o._buffer.slice(o._offset,o._offset+l);o._offset+=l,s?o.push(p):(u.push(p),h+=p.length)}if((0===b||o._offset>=o._chunkSize)&&(d=o._chunkSize,o._offset=0,o._buffer=c.allocUnsafe(o._chunkSize)),0===b){if(r+=f-i,f=i,!s)return!0;var g=o._handle.write(a,e,r,f,o._buffer,o._offset,o._chunkSize);return g.callback=y,void(g.buffer=e)}if(!s)return!1;t()}}m.buffer=e,m.callback=y},r.inherits(x,M),r.inherits(A,M),r.inherits(v,M),r.inherits(w,M),r.inherits(_,M),r.inherits(I,M),r.inherits(E,M)},30295:(e,a,t)=>{var c=t(62045).hp;e.exports=function(e,a){for(var t=Math.min(e.length,a.length),f=new c(t),d=0;d{"use strict";var c=t(67526),f=t(251),d="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;a.Buffer=i,a.SlowBuffer=function(e){return+e!=e&&(e=0),i.alloc(+e)},a.INSPECT_MAX_BYTES=50;var r=2147483647;function n(e){if(e>r)throw new RangeError('The value "'+e+'" is invalid for option "size"');var a=new Uint8Array(e);return Object.setPrototypeOf(a,i.prototype),a}function i(e,a,t){if("number"==typeof e){if("string"==typeof a)throw new TypeError('The "string" argument must be of type string. Received type number');return s(e)}return b(e,a,t)}function b(e,a,t){if("string"==typeof e)return function(e,a){if("string"==typeof a&&""!==a||(a="utf8"),!i.isEncoding(a))throw new TypeError("Unknown encoding: "+a);var t=0|p(e,a),c=n(t),f=c.write(e,a);return f!==t&&(c=c.slice(0,f)),c}(e,a);if(ArrayBuffer.isView(e))return function(e){if(j(e,Uint8Array)){var a=new Uint8Array(e);return u(a.buffer,a.byteOffset,a.byteLength)}return l(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(j(e,ArrayBuffer)||e&&j(e.buffer,ArrayBuffer))return u(e,a,t);if("undefined"!=typeof SharedArrayBuffer&&(j(e,SharedArrayBuffer)||e&&j(e.buffer,SharedArrayBuffer)))return u(e,a,t);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var c=e.valueOf&&e.valueOf();if(null!=c&&c!==e)return i.from(c,a,t);var f=function(e){if(i.isBuffer(e)){var a=0|h(e.length),t=n(a);return 0===t.length||e.copy(t,0,0,a),t}return void 0!==e.length?"number"!=typeof e.length||H(e.length)?n(0):l(e):"Buffer"===e.type&&Array.isArray(e.data)?l(e.data):void 0}(e);if(f)return f;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return i.from(e[Symbol.toPrimitive]("string"),a,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function o(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function s(e){return o(e),n(e<0?0:0|h(e))}function l(e){for(var a=e.length<0?0:0|h(e.length),t=n(a),c=0;c=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function p(e,a){if(i.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||j(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var t=e.length,c=arguments.length>2&&!0===arguments[2];if(!c&&0===t)return 0;for(var f=!1;;)switch(a){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return F(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*t;case"hex":return t>>>1;case"base64":return Q(e).length;default:if(f)return c?-1:F(e).length;a=(""+a).toLowerCase(),f=!0}}function g(e,a,t){var c=!1;if((void 0===a||a<0)&&(a=0),a>this.length)return"";if((void 0===t||t>this.length)&&(t=this.length),t<=0)return"";if((t>>>=0)<=(a>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return L(this,a,t);case"utf8":case"utf-8":return C(this,a,t);case"ascii":return B(this,a,t);case"latin1":case"binary":return k(this,a,t);case"base64":return E(this,a,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,a,t);default:if(c)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),c=!0}}function m(e,a,t){var c=e[a];e[a]=e[t],e[t]=c}function y(e,a,t,c,f){if(0===e.length)return-1;if("string"==typeof t?(c=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),H(t=+t)&&(t=f?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(f)return-1;t=e.length-1}else if(t<0){if(!f)return-1;t=0}if("string"==typeof a&&(a=i.from(a,c)),i.isBuffer(a))return 0===a.length?-1:x(e,a,t,c,f);if("number"==typeof a)return a&=255,"function"==typeof Uint8Array.prototype.indexOf?f?Uint8Array.prototype.indexOf.call(e,a,t):Uint8Array.prototype.lastIndexOf.call(e,a,t):x(e,[a],t,c,f);throw new TypeError("val must be string, number or Buffer")}function x(e,a,t,c,f){var d,r=1,n=e.length,i=a.length;if(void 0!==c&&("ucs2"===(c=String(c).toLowerCase())||"ucs-2"===c||"utf16le"===c||"utf-16le"===c)){if(e.length<2||a.length<2)return-1;r=2,n/=2,i/=2,t/=2}function b(e,a){return 1===r?e[a]:e.readUInt16BE(a*r)}if(f){var o=-1;for(d=t;dn&&(t=n-i),d=t;d>=0;d--){for(var s=!0,l=0;lf&&(c=f):c=f;var d=a.length;c>d/2&&(c=d/2);for(var r=0;r>8,f=t%256,d.push(f),d.push(c);return d}(a,e.length-t),e,t,c)}function E(e,a,t){return 0===a&&t===e.length?c.fromByteArray(e):c.fromByteArray(e.slice(a,t))}function C(e,a,t){t=Math.min(e.length,t);for(var c=[],f=a;f239?4:b>223?3:b>191?2:1;if(f+s<=t)switch(s){case 1:b<128&&(o=b);break;case 2:128==(192&(d=e[f+1]))&&(i=(31&b)<<6|63&d)>127&&(o=i);break;case 3:d=e[f+1],r=e[f+2],128==(192&d)&&128==(192&r)&&(i=(15&b)<<12|(63&d)<<6|63&r)>2047&&(i<55296||i>57343)&&(o=i);break;case 4:d=e[f+1],r=e[f+2],n=e[f+3],128==(192&d)&&128==(192&r)&&128==(192&n)&&(i=(15&b)<<18|(63&d)<<12|(63&r)<<6|63&n)>65535&&i<1114112&&(o=i)}null===o?(o=65533,s=1):o>65535&&(o-=65536,c.push(o>>>10&1023|55296),o=56320|1023&o),c.push(o),f+=s}return function(e){var a=e.length;if(a<=M)return String.fromCharCode.apply(String,e);for(var t="",c=0;cc.length?i.from(d).copy(c,f):Uint8Array.prototype.set.call(c,d,f);else{if(!i.isBuffer(d))throw new TypeError('"list" argument must be an Array of Buffers');d.copy(c,f)}f+=d.length}return c},i.byteLength=p,i.prototype._isBuffer=!0,i.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var a=0;at&&(e+=" ... "),""},d&&(i.prototype[d]=i.prototype.inspect),i.prototype.compare=function(e,a,t,c,f){if(j(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===a&&(a=0),void 0===t&&(t=e?e.length:0),void 0===c&&(c=0),void 0===f&&(f=this.length),a<0||t>e.length||c<0||f>this.length)throw new RangeError("out of range index");if(c>=f&&a>=t)return 0;if(c>=f)return-1;if(a>=t)return 1;if(this===e)return 0;for(var d=(f>>>=0)-(c>>>=0),r=(t>>>=0)-(a>>>=0),n=Math.min(d,r),b=this.slice(c,f),o=e.slice(a,t),s=0;s>>=0,isFinite(t)?(t>>>=0,void 0===c&&(c="utf8")):(c=t,t=void 0)}var f=this.length-a;if((void 0===t||t>f)&&(t=f),e.length>0&&(t<0||a<0)||a>this.length)throw new RangeError("Attempt to write outside buffer bounds");c||(c="utf8");for(var d=!1;;)switch(c){case"hex":return A(this,e,a,t);case"utf8":case"utf-8":return v(this,e,a,t);case"ascii":case"latin1":case"binary":return w(this,e,a,t);case"base64":return _(this,e,a,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,a,t);default:if(d)throw new TypeError("Unknown encoding: "+c);c=(""+c).toLowerCase(),d=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var M=4096;function B(e,a,t){var c="";t=Math.min(e.length,t);for(var f=a;fc)&&(t=c);for(var f="",d=a;dt)throw new RangeError("Trying to access beyond buffer length")}function N(e,a,t,c,f,d){if(!i.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(a>f||ae.length)throw new RangeError("Index out of range")}function R(e,a,t,c,f,d){if(t+c>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function P(e,a,t,c,d){return a=+a,t>>>=0,d||R(e,0,t,4),f.write(e,a,t,c,23,4),t+4}function D(e,a,t,c,d){return a=+a,t>>>=0,d||R(e,0,t,8),f.write(e,a,t,c,52,8),t+8}i.prototype.slice=function(e,a){var t=this.length;(e=~~e)<0?(e+=t)<0&&(e=0):e>t&&(e=t),(a=void 0===a?t:~~a)<0?(a+=t)<0&&(a=0):a>t&&(a=t),a>>=0,a>>>=0,t||T(e,a,this.length);for(var c=this[e],f=1,d=0;++d>>=0,a>>>=0,t||T(e,a,this.length);for(var c=this[e+--a],f=1;a>0&&(f*=256);)c+=this[e+--a]*f;return c},i.prototype.readUint8=i.prototype.readUInt8=function(e,a){return e>>>=0,a||T(e,1,this.length),this[e]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(e,a){return e>>>=0,a||T(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(e,a){return e>>>=0,a||T(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(e,a){return e>>>=0,a||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(e,a){return e>>>=0,a||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readIntLE=function(e,a,t){e>>>=0,a>>>=0,t||T(e,a,this.length);for(var c=this[e],f=1,d=0;++d=(f*=128)&&(c-=Math.pow(2,8*a)),c},i.prototype.readIntBE=function(e,a,t){e>>>=0,a>>>=0,t||T(e,a,this.length);for(var c=a,f=1,d=this[e+--c];c>0&&(f*=256);)d+=this[e+--c]*f;return d>=(f*=128)&&(d-=Math.pow(2,8*a)),d},i.prototype.readInt8=function(e,a){return e>>>=0,a||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,a){e>>>=0,a||T(e,2,this.length);var t=this[e]|this[e+1]<<8;return 32768&t?4294901760|t:t},i.prototype.readInt16BE=function(e,a){e>>>=0,a||T(e,2,this.length);var t=this[e+1]|this[e]<<8;return 32768&t?4294901760|t:t},i.prototype.readInt32LE=function(e,a){return e>>>=0,a||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,a){return e>>>=0,a||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readFloatLE=function(e,a){return e>>>=0,a||T(e,4,this.length),f.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,a){return e>>>=0,a||T(e,4,this.length),f.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,a){return e>>>=0,a||T(e,8,this.length),f.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,a){return e>>>=0,a||T(e,8,this.length),f.read(this,e,!1,52,8)},i.prototype.writeUintLE=i.prototype.writeUIntLE=function(e,a,t,c){e=+e,a>>>=0,t>>>=0,c||N(this,e,a,t,Math.pow(2,8*t)-1,0);var f=1,d=0;for(this[a]=255&e;++d>>=0,t>>>=0,c||N(this,e,a,t,Math.pow(2,8*t)-1,0);var f=t-1,d=1;for(this[a+f]=255&e;--f>=0&&(d*=256);)this[a+f]=e/d&255;return a+t},i.prototype.writeUint8=i.prototype.writeUInt8=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,1,255,0),this[a]=255&e,a+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,2,65535,0),this[a]=255&e,this[a+1]=e>>>8,a+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,2,65535,0),this[a]=e>>>8,this[a+1]=255&e,a+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,4,4294967295,0),this[a+3]=e>>>24,this[a+2]=e>>>16,this[a+1]=e>>>8,this[a]=255&e,a+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,4,4294967295,0),this[a]=e>>>24,this[a+1]=e>>>16,this[a+2]=e>>>8,this[a+3]=255&e,a+4},i.prototype.writeIntLE=function(e,a,t,c){if(e=+e,a>>>=0,!c){var f=Math.pow(2,8*t-1);N(this,e,a,t,f-1,-f)}var d=0,r=1,n=0;for(this[a]=255&e;++d>>=0,!c){var f=Math.pow(2,8*t-1);N(this,e,a,t,f-1,-f)}var d=t-1,r=1,n=0;for(this[a+d]=255&e;--d>=0&&(r*=256);)e<0&&0===n&&0!==this[a+d+1]&&(n=1),this[a+d]=(e/r|0)-n&255;return a+t},i.prototype.writeInt8=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,1,127,-128),e<0&&(e=255+e+1),this[a]=255&e,a+1},i.prototype.writeInt16LE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,2,32767,-32768),this[a]=255&e,this[a+1]=e>>>8,a+2},i.prototype.writeInt16BE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,2,32767,-32768),this[a]=e>>>8,this[a+1]=255&e,a+2},i.prototype.writeInt32LE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,4,2147483647,-2147483648),this[a]=255&e,this[a+1]=e>>>8,this[a+2]=e>>>16,this[a+3]=e>>>24,a+4},i.prototype.writeInt32BE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[a]=e>>>24,this[a+1]=e>>>16,this[a+2]=e>>>8,this[a+3]=255&e,a+4},i.prototype.writeFloatLE=function(e,a,t){return P(this,e,a,!0,t)},i.prototype.writeFloatBE=function(e,a,t){return P(this,e,a,!1,t)},i.prototype.writeDoubleLE=function(e,a,t){return D(this,e,a,!0,t)},i.prototype.writeDoubleBE=function(e,a,t){return D(this,e,a,!1,t)},i.prototype.copy=function(e,a,t,c){if(!i.isBuffer(e))throw new TypeError("argument should be a Buffer");if(t||(t=0),c||0===c||(c=this.length),a>=e.length&&(a=e.length),a||(a=0),c>0&&c=this.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("sourceEnd out of bounds");c>this.length&&(c=this.length),e.length-a>>=0,t=void 0===t?this.length:t>>>0,e||(e=0),"number"==typeof e)for(d=a;d55295&&t<57344){if(!f){if(t>56319){(a-=3)>-1&&d.push(239,191,189);continue}if(r+1===c){(a-=3)>-1&&d.push(239,191,189);continue}f=t;continue}if(t<56320){(a-=3)>-1&&d.push(239,191,189),f=t;continue}t=65536+(f-55296<<10|t-56320)}else f&&(a-=3)>-1&&d.push(239,191,189);if(f=null,t<128){if((a-=1)<0)break;d.push(t)}else if(t<2048){if((a-=2)<0)break;d.push(t>>6|192,63&t|128)}else if(t<65536){if((a-=3)<0)break;d.push(t>>12|224,t>>6&63|128,63&t|128)}else{if(!(t<1114112))throw new Error("Invalid code point");if((a-=4)<0)break;d.push(t>>18|240,t>>12&63|128,t>>6&63|128,63&t|128)}}return d}function Q(e){return c.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(O,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function U(e,a,t,c){for(var f=0;f=a.length||f>=e.length);++f)a[f+t]=e[f];return f}function j(e,a){return e instanceof a||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===a.name}function H(e){return e!=e}var $=function(){for(var e="0123456789abcdef",a=new Array(256),t=0;t<16;++t)for(var c=16*t,f=0;f<16;++f)a[c+f]=e[t]+e[f];return a}()},86866:e=>{e.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},38075:(e,a,t)=>{"use strict";var c=t(70453),f=t(10487),d=f(c("String.prototype.indexOf"));e.exports=function(e,a){var t=c(e,!!a);return"function"==typeof t&&d(e,".prototype.")>-1?f(t):t}},10487:(e,a,t)=>{"use strict";var c=t(66743),f=t(70453),d=t(96897),r=t(69675),n=f("%Function.prototype.apply%"),i=f("%Function.prototype.call%"),b=f("%Reflect.apply%",!0)||c.call(i,n),o=t(30655),s=f("%Math.max%");e.exports=function(e){if("function"!=typeof e)throw new r("a function is required");var a=b(c,i,arguments);return d(a,1+s(0,e.length-(arguments.length-1)),!0)};var l=function(){return b(c,n,arguments)};o?o(e.exports,"apply",{value:l}):e.exports.apply=l},90297:e=>{"use strict";const a=Object.freeze({identity:0,sha1:17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,blake3:30,"murmur3-128":34,"murmur3-32":35,"dbl-sha2-256":86,md4:212,md5:213,bmt:214,"sha2-256-trunc254-padded":4114,"ripemd-128":4178,"ripemd-160":4179,"ripemd-256":4180,"ripemd-320":4181,x11:4352,kangarootwelve:7425,"sm3-256":21325,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46e3,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"poseidon-bls12_381-a2-fc1":46081,"poseidon-bls12_381-a2-fc1-sc":46082});e.exports={names:a}},17684:(e,a,t)=>{"use strict";const c=t(91466),f=t(61203),{names:d}=t(90297),{toString:r}=t(27302),{fromString:n}=t(44117),{concat:i}=t(75007),b={};for(const e in d){const a=e;b[d[a]]=a}function o(e){if(!(e instanceof Uint8Array))throw new Error("multihash must be a Uint8Array");if(e.length<2)throw new Error("multihash too short. must be > 2 bytes.");const a=f.decode(e);if(!u(a))throw new Error(`multihash unknown function code: 0x${a.toString(16)}`);e=e.slice(f.decode.bytes);const t=f.decode(e);if(t<0)throw new Error(`multihash invalid length: ${t}`);if((e=e.slice(f.decode.bytes)).length!==t)throw new Error(`multihash length inconsistent: 0x${r(e,"base16")}`);return{code:a,name:b[a],length:t,digest:e}}function s(e){let a=e;if("string"==typeof e){if(void 0===d[e])throw new Error(`Unrecognized hash function named: ${e}`);a=d[e]}if("number"!=typeof a)throw new Error(`Hash function code should be a number. Got: ${a}`);if(void 0===b[a]&&!l(a))throw new Error(`Unrecognized function code: ${a}`);return a}function l(e){return e>0&&e<16}function u(e){return!!l(e)||!!b[e]}function h(e){o(e)}Object.freeze(b),e.exports={names:d,codes:b,toHexString:function(e){if(!(e instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return r(e,"base16")},fromHexString:function(e){return n(e,"base16")},toB58String:function(e){if(!(e instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return r(c.encode("base58btc",e)).slice(1)},fromB58String:function(e){const a=e instanceof Uint8Array?r(e):e;return c.decode("z"+a)},decode:o,encode:function(e,a,t){if(!e||void 0===a)throw new Error("multihash encode requires at least two args: digest, code");const c=s(a);if(!(e instanceof Uint8Array))throw new Error("digest should be a Uint8Array");if(null==t&&(t=e.length),t&&e.length!==t)throw new Error("digest length should be equal to specified length.");const d=f.encode(c),r=f.encode(t);return i([d,r,e],d.length+r.length+e.length)},coerceCode:s,isAppCode:l,validate:h,prefix:function(e){return h(e),e.subarray(0,2)},isValidCode:u}},64378:(e,a,t)=>{"use strict";const c=t(17684),f={checkCIDComponents:function(e){if(null==e)return"null values are not valid CIDs";if(0!==e.version&&1!==e.version)return"Invalid version, must be a number equal to 1 or 0";if("string"!=typeof e.codec)return"codec must be string";if(0===e.version){if("dag-pb"!==e.codec)return"codec must be 'dag-pb' for CIDv0";if("base58btc"!==e.multibaseName)return"multibaseName must be 'base58btc' for CIDv0"}if(!(e.multihash instanceof Uint8Array))return"multihash must be a Uint8Array";try{c.validate(e.multihash)}catch(e){let a=e.message;return a||(a="Multihash validation failed"),a}}};e.exports=f},26613:(e,a,t)=>{"use strict";const c=t(17684),f=t(91466),d=t(52021),r=t(64378),{concat:n}=t(75007),{toString:i}=t(27302),{equals:b}=t(18402),o=d.nameToCode,s=Object.keys(o).reduce(((e,a)=>(e[o[a]]=a,e)),{}),l=Symbol.for("@ipld/js-cid/CID");class u{constructor(e,a,t,r){if(this.version,this.codec,this.multihash,Object.defineProperty(this,l,{value:!0}),u.isCID(e)){const a=e;return this.version=a.version,this.codec=a.codec,this.multihash=a.multihash,void(this.multibaseName=a.multibaseName||(0===a.version?"base58btc":"base32"))}if("string"==typeof e){const a=f.isEncoded(e);if(a){const t=f.decode(e);this.version=parseInt(t[0].toString(),16),this.codec=d.getCodec(t.slice(1)),this.multihash=d.rmPrefix(t.slice(1)),this.multibaseName=a}else this.version=0,this.codec="dag-pb",this.multihash=c.fromB58String(e),this.multibaseName="base58btc";return u.validateCID(this),void Object.defineProperty(this,"string",{value:e})}if(e instanceof Uint8Array){const a=parseInt(e[0].toString(),16);if(1===a){const t=e;this.version=a,this.codec=d.getCodec(t.slice(1)),this.multihash=d.rmPrefix(t.slice(1)),this.multibaseName="base32"}else this.version=0,this.codec="dag-pb",this.multihash=e,this.multibaseName="base58btc";u.validateCID(this)}else this.version=e,"number"==typeof a&&(a=s[a]),this.codec=a,this.multihash=t,this.multibaseName=r||(0===e?"base58btc":"base32"),u.validateCID(this)}get bytes(){let e=this._bytes;if(!e){if(0===this.version)e=this.multihash;else{if(1!==this.version)throw new Error("unsupported version");{const a=d.getCodeVarint(this.codec);e=n([[1],a,this.multihash],1+a.byteLength+this.multihash.byteLength)}}Object.defineProperty(this,"_bytes",{value:e})}return e}get prefix(){const e=d.getCodeVarint(this.codec),a=c.prefix(this.multihash);return n([[this.version],e,a],1+e.byteLength+a.byteLength)}get code(){return o[this.codec]}toV0(){if("dag-pb"!==this.codec)throw new Error("Cannot convert a non dag-pb CID to CIDv0");const{name:e,length:a}=c.decode(this.multihash);if("sha2-256"!==e)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");if(32!==a)throw new Error("Cannot convert non 32 byte multihash CID to CIDv0");return new u(0,this.codec,this.multihash)}toV1(){return new u(1,this.codec,this.multihash,this.multibaseName)}toBaseEncodedString(e=this.multibaseName){if(this.string&&0!==this.string.length&&e===this.multibaseName)return this.string;let a;if(0===this.version){if("base58btc"!==e)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");a=c.toB58String(this.multihash)}else{if(1!==this.version)throw new Error("unsupported version");a=i(f.encode(e,this.bytes))}return e===this.multibaseName&&Object.defineProperty(this,"string",{value:a}),a}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}toString(e){return this.toBaseEncodedString(e)}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(e){return this.codec===e.codec&&this.version===e.version&&b(this.multihash,e.multihash)}static validateCID(e){const a=r.checkCIDComponents(e);if(a)throw new Error(a)}static isCID(e){return e instanceof u||Boolean(e&&e[l])}}u.codecs=o,e.exports=u},56168:(e,a,t)=>{var c=t(92861).Buffer,f=t(88310).Transform,d=t(83141).I;function r(e){f.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}t(56698)(r,f),r.prototype.update=function(e,a,t){"string"==typeof e&&(e=c.from(e,a));var f=this._update(e);return this.hashMode?this:(t&&(f=this._toString(f,t)),f)},r.prototype.setAutoPadding=function(){},r.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},r.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},r.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},r.prototype._transform=function(e,a,t){var c;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){c=e}finally{t(c)}},r.prototype._flush=function(e){var a;try{this.push(this.__final())}catch(e){a=e}e(a)},r.prototype._finalOrDigest=function(e){var a=this.__final()||c.alloc(0);return e&&(a=this._toString(a,e,!0)),a},r.prototype._toString=function(e,a,t){if(this._decoder||(this._decoder=new d(a),this._encoding=a),this._encoding!==a)throw new Error("can't switch encodings");var c=this._decoder.write(e);return t&&(c+=this._decoder.end()),c},e.exports=r},15622:(e,a,t)=>{function c(e){return Object.prototype.toString.call(e)}a.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===c(e)},a.isBoolean=function(e){return"boolean"==typeof e},a.isNull=function(e){return null===e},a.isNullOrUndefined=function(e){return null==e},a.isNumber=function(e){return"number"==typeof e},a.isString=function(e){return"string"==typeof e},a.isSymbol=function(e){return"symbol"==typeof e},a.isUndefined=function(e){return void 0===e},a.isRegExp=function(e){return"[object RegExp]"===c(e)},a.isObject=function(e){return"object"==typeof e&&null!==e},a.isDate=function(e){return"[object Date]"===c(e)},a.isError=function(e){return"[object Error]"===c(e)||e instanceof Error},a.isFunction=function(e){return"function"==typeof e},a.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},a.isBuffer=t(48287).Buffer.isBuffer},61324:(e,a,t)=>{var c=t(62045).hp,f=t(86729),d=t(92801);e.exports=function(e){return new n(e)};var r={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function n(e){this.curveType=r[e],this.curveType||(this.curveType={name:e}),this.curve=new f.ec(this.curveType.name),this.keys=void 0}function i(e,a,t){Array.isArray(e)||(e=e.toArray());var f=new c(e);if(t&&f.length=65&&t<=70?t-55:t>=97&&t<=102?t-87:t-48&15}function i(e,a,t){var c=n(e,t);return t-1>=a&&(c|=n(e,t-1)<<4),c}function b(e,a,t,c){for(var f=0,d=Math.min(e.length,t),r=a;r=49?n-49+10:n>=17?n-17+10:n}return f}d.isBN=function(e){return e instanceof d||null!==e&&"object"==typeof e&&e.constructor.wordSize===d.wordSize&&Array.isArray(e.words)},d.max=function(e,a){return e.cmp(a)>0?e:a},d.min=function(e,a){return e.cmp(a)<0?e:a},d.prototype._init=function(e,a,t){if("number"==typeof e)return this._initNumber(e,a,t);if("object"==typeof e)return this._initArray(e,a,t);"hex"===a&&(a=16),c(a===(0|a)&&a>=2&&a<=36);var f=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(f++,this.negative=1),f=0;f-=3)r=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[d]|=r<>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);else if("le"===t)for(f=0,d=0;f>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);return this.strip()},d.prototype._parseHex=function(e,a,t){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)f=i(e,a,c)<=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;else for(c=(e.length-a)%2==0?a+1:a;c=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;this.strip()},d.prototype._parseBase=function(e,a,t){this.words=[0],this.length=1;for(var c=0,f=1;f<=67108863;f*=a)c++;c--,f=f/a|0;for(var d=e.length-t,r=d%c,n=Math.min(d,d-r)+t,i=0,o=t;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},d.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},d.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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],l=[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 u(e,a,t){t.negative=a.negative^e.negative;var c=e.length+a.length|0;t.length=c,c=c-1|0;var f=0|e.words[0],d=0|a.words[0],r=f*d,n=67108863&r,i=r/67108864|0;t.words[0]=n;for(var b=1;b>>26,s=67108863&i,l=Math.min(b,a.length-1),u=Math.max(0,b-e.length+1);u<=l;u++){var h=b-u|0;o+=(r=(f=0|e.words[h])*(d=0|a.words[u])+s)/67108864|0,s=67108863&r}t.words[b]=0|s,i=0|o}return 0!==i?t.words[b]=0|i:t.length--,t.strip()}d.prototype.toString=function(e,a){var t;if(a=0|a||1,16===(e=e||10)||"hex"===e){t="";for(var f=0,d=0,r=0;r>>24-f&16777215)||r!==this.length-1?o[6-i.length]+i+t:i+t,(f+=2)>=26&&(f-=26,r--)}for(0!==d&&(t=d.toString(16)+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(e===(0|e)&&e>=2&&e<=36){var b=s[e],u=l[e];t="";var h=this.clone();for(h.negative=0;!h.isZero();){var p=h.modn(u).toString(e);t=(h=h.idivn(u)).isZero()?p+t:o[b-p.length]+p+t}for(this.isZero()&&(t="0"+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}c(!1,"Base should be between 2 and 36")},d.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&c(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},d.prototype.toJSON=function(){return this.toString(16)},d.prototype.toBuffer=function(e,a){return c(void 0!==r),this.toArrayLike(r,e,a)},d.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},d.prototype.toArrayLike=function(e,a,t){var f=this.byteLength(),d=t||Math.max(1,f);c(f<=d,"byte array longer than desired length"),c(d>0,"Requested array length <= 0"),this.strip();var r,n,i="le"===a,b=new e(d),o=this.clone();if(i){for(n=0;!o.isZero();n++)r=o.andln(255),o.iushrn(8),b[n]=r;for(;n=4096&&(t+=13,a>>>=13),a>=64&&(t+=7,a>>>=7),a>=8&&(t+=4,a>>>=4),a>=2&&(t+=2,a>>>=2),t+a},d.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,t=0;return 8191&a||(t+=13,a>>>=13),127&a||(t+=7,a>>>=7),15&a||(t+=4,a>>>=4),3&a||(t+=2,a>>>=2),1&a||t++,t},d.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},d.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},d.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},d.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var t=0;te.length?this.clone().iand(e):e.clone().iand(this)},d.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},d.prototype.iuxor=function(e){var a,t;this.length>e.length?(a=this,t=e):(a=e,t=this);for(var c=0;ce.length?this.clone().ixor(e):e.clone().ixor(this)},d.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},d.prototype.inotn=function(e){c("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),t=e%26;this._expand(a),t>0&&a--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-t),this.strip()},d.prototype.notn=function(e){return this.clone().inotn(e)},d.prototype.setn=function(e,a){c("number"==typeof e&&e>=0);var t=e/26|0,f=e%26;return this._expand(t+1),this.words[t]=a?this.words[t]|1<e.length?(t=this,c=e):(t=e,c=this);for(var f=0,d=0;d>>26;for(;0!==f&&d>>26;if(this.length=t.length,0!==f)this.words[this.length]=f,this.length++;else if(t!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},d.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var t,c,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(t=this,c=e):(t=e,c=this);for(var d=0,r=0;r>26,this.words[r]=67108863&a;for(;0!==d&&r>26,this.words[r]=67108863&a;if(0===d&&r>>13,u=0|r[1],h=8191&u,p=u>>>13,g=0|r[2],m=8191&g,y=g>>>13,x=0|r[3],A=8191&x,v=x>>>13,w=0|r[4],_=8191&w,I=w>>>13,E=0|r[5],C=8191&E,M=E>>>13,B=0|r[6],k=8191&B,L=B>>>13,S=0|r[7],T=8191&S,N=S>>>13,R=0|r[8],P=8191&R,D=R>>>13,O=0|r[9],F=8191&O,Q=O>>>13,U=0|n[0],j=8191&U,H=U>>>13,$=0|n[1],q=8191&$,z=$>>>13,G=0|n[2],K=8191&G,V=G>>>13,Z=0|n[3],J=8191&Z,W=Z>>>13,Y=0|n[4],X=8191&Y,ee=Y>>>13,ae=0|n[5],te=8191&ae,ce=ae>>>13,fe=0|n[6],de=8191&fe,re=fe>>>13,ne=0|n[7],ie=8191&ne,be=ne>>>13,oe=0|n[8],se=8191&oe,le=oe>>>13,ue=0|n[9],he=8191&ue,pe=ue>>>13;t.negative=e.negative^a.negative,t.length=19;var ge=(b+(c=Math.imul(s,j))|0)+((8191&(f=(f=Math.imul(s,H))+Math.imul(l,j)|0))<<13)|0;b=((d=Math.imul(l,H))+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,c=Math.imul(h,j),f=(f=Math.imul(h,H))+Math.imul(p,j)|0,d=Math.imul(p,H);var me=(b+(c=c+Math.imul(s,q)|0)|0)+((8191&(f=(f=f+Math.imul(s,z)|0)+Math.imul(l,q)|0))<<13)|0;b=((d=d+Math.imul(l,z)|0)+(f>>>13)|0)+(me>>>26)|0,me&=67108863,c=Math.imul(m,j),f=(f=Math.imul(m,H))+Math.imul(y,j)|0,d=Math.imul(y,H),c=c+Math.imul(h,q)|0,f=(f=f+Math.imul(h,z)|0)+Math.imul(p,q)|0,d=d+Math.imul(p,z)|0;var ye=(b+(c=c+Math.imul(s,K)|0)|0)+((8191&(f=(f=f+Math.imul(s,V)|0)+Math.imul(l,K)|0))<<13)|0;b=((d=d+Math.imul(l,V)|0)+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,c=Math.imul(A,j),f=(f=Math.imul(A,H))+Math.imul(v,j)|0,d=Math.imul(v,H),c=c+Math.imul(m,q)|0,f=(f=f+Math.imul(m,z)|0)+Math.imul(y,q)|0,d=d+Math.imul(y,z)|0,c=c+Math.imul(h,K)|0,f=(f=f+Math.imul(h,V)|0)+Math.imul(p,K)|0,d=d+Math.imul(p,V)|0;var xe=(b+(c=c+Math.imul(s,J)|0)|0)+((8191&(f=(f=f+Math.imul(s,W)|0)+Math.imul(l,J)|0))<<13)|0;b=((d=d+Math.imul(l,W)|0)+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,c=Math.imul(_,j),f=(f=Math.imul(_,H))+Math.imul(I,j)|0,d=Math.imul(I,H),c=c+Math.imul(A,q)|0,f=(f=f+Math.imul(A,z)|0)+Math.imul(v,q)|0,d=d+Math.imul(v,z)|0,c=c+Math.imul(m,K)|0,f=(f=f+Math.imul(m,V)|0)+Math.imul(y,K)|0,d=d+Math.imul(y,V)|0,c=c+Math.imul(h,J)|0,f=(f=f+Math.imul(h,W)|0)+Math.imul(p,J)|0,d=d+Math.imul(p,W)|0;var Ae=(b+(c=c+Math.imul(s,X)|0)|0)+((8191&(f=(f=f+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;b=((d=d+Math.imul(l,ee)|0)+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,c=Math.imul(C,j),f=(f=Math.imul(C,H))+Math.imul(M,j)|0,d=Math.imul(M,H),c=c+Math.imul(_,q)|0,f=(f=f+Math.imul(_,z)|0)+Math.imul(I,q)|0,d=d+Math.imul(I,z)|0,c=c+Math.imul(A,K)|0,f=(f=f+Math.imul(A,V)|0)+Math.imul(v,K)|0,d=d+Math.imul(v,V)|0,c=c+Math.imul(m,J)|0,f=(f=f+Math.imul(m,W)|0)+Math.imul(y,J)|0,d=d+Math.imul(y,W)|0,c=c+Math.imul(h,X)|0,f=(f=f+Math.imul(h,ee)|0)+Math.imul(p,X)|0,d=d+Math.imul(p,ee)|0;var ve=(b+(c=c+Math.imul(s,te)|0)|0)+((8191&(f=(f=f+Math.imul(s,ce)|0)+Math.imul(l,te)|0))<<13)|0;b=((d=d+Math.imul(l,ce)|0)+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,c=Math.imul(k,j),f=(f=Math.imul(k,H))+Math.imul(L,j)|0,d=Math.imul(L,H),c=c+Math.imul(C,q)|0,f=(f=f+Math.imul(C,z)|0)+Math.imul(M,q)|0,d=d+Math.imul(M,z)|0,c=c+Math.imul(_,K)|0,f=(f=f+Math.imul(_,V)|0)+Math.imul(I,K)|0,d=d+Math.imul(I,V)|0,c=c+Math.imul(A,J)|0,f=(f=f+Math.imul(A,W)|0)+Math.imul(v,J)|0,d=d+Math.imul(v,W)|0,c=c+Math.imul(m,X)|0,f=(f=f+Math.imul(m,ee)|0)+Math.imul(y,X)|0,d=d+Math.imul(y,ee)|0,c=c+Math.imul(h,te)|0,f=(f=f+Math.imul(h,ce)|0)+Math.imul(p,te)|0,d=d+Math.imul(p,ce)|0;var we=(b+(c=c+Math.imul(s,de)|0)|0)+((8191&(f=(f=f+Math.imul(s,re)|0)+Math.imul(l,de)|0))<<13)|0;b=((d=d+Math.imul(l,re)|0)+(f>>>13)|0)+(we>>>26)|0,we&=67108863,c=Math.imul(T,j),f=(f=Math.imul(T,H))+Math.imul(N,j)|0,d=Math.imul(N,H),c=c+Math.imul(k,q)|0,f=(f=f+Math.imul(k,z)|0)+Math.imul(L,q)|0,d=d+Math.imul(L,z)|0,c=c+Math.imul(C,K)|0,f=(f=f+Math.imul(C,V)|0)+Math.imul(M,K)|0,d=d+Math.imul(M,V)|0,c=c+Math.imul(_,J)|0,f=(f=f+Math.imul(_,W)|0)+Math.imul(I,J)|0,d=d+Math.imul(I,W)|0,c=c+Math.imul(A,X)|0,f=(f=f+Math.imul(A,ee)|0)+Math.imul(v,X)|0,d=d+Math.imul(v,ee)|0,c=c+Math.imul(m,te)|0,f=(f=f+Math.imul(m,ce)|0)+Math.imul(y,te)|0,d=d+Math.imul(y,ce)|0,c=c+Math.imul(h,de)|0,f=(f=f+Math.imul(h,re)|0)+Math.imul(p,de)|0,d=d+Math.imul(p,re)|0;var _e=(b+(c=c+Math.imul(s,ie)|0)|0)+((8191&(f=(f=f+Math.imul(s,be)|0)+Math.imul(l,ie)|0))<<13)|0;b=((d=d+Math.imul(l,be)|0)+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,c=Math.imul(P,j),f=(f=Math.imul(P,H))+Math.imul(D,j)|0,d=Math.imul(D,H),c=c+Math.imul(T,q)|0,f=(f=f+Math.imul(T,z)|0)+Math.imul(N,q)|0,d=d+Math.imul(N,z)|0,c=c+Math.imul(k,K)|0,f=(f=f+Math.imul(k,V)|0)+Math.imul(L,K)|0,d=d+Math.imul(L,V)|0,c=c+Math.imul(C,J)|0,f=(f=f+Math.imul(C,W)|0)+Math.imul(M,J)|0,d=d+Math.imul(M,W)|0,c=c+Math.imul(_,X)|0,f=(f=f+Math.imul(_,ee)|0)+Math.imul(I,X)|0,d=d+Math.imul(I,ee)|0,c=c+Math.imul(A,te)|0,f=(f=f+Math.imul(A,ce)|0)+Math.imul(v,te)|0,d=d+Math.imul(v,ce)|0,c=c+Math.imul(m,de)|0,f=(f=f+Math.imul(m,re)|0)+Math.imul(y,de)|0,d=d+Math.imul(y,re)|0,c=c+Math.imul(h,ie)|0,f=(f=f+Math.imul(h,be)|0)+Math.imul(p,ie)|0,d=d+Math.imul(p,be)|0;var Ie=(b+(c=c+Math.imul(s,se)|0)|0)+((8191&(f=(f=f+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;b=((d=d+Math.imul(l,le)|0)+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,c=Math.imul(F,j),f=(f=Math.imul(F,H))+Math.imul(Q,j)|0,d=Math.imul(Q,H),c=c+Math.imul(P,q)|0,f=(f=f+Math.imul(P,z)|0)+Math.imul(D,q)|0,d=d+Math.imul(D,z)|0,c=c+Math.imul(T,K)|0,f=(f=f+Math.imul(T,V)|0)+Math.imul(N,K)|0,d=d+Math.imul(N,V)|0,c=c+Math.imul(k,J)|0,f=(f=f+Math.imul(k,W)|0)+Math.imul(L,J)|0,d=d+Math.imul(L,W)|0,c=c+Math.imul(C,X)|0,f=(f=f+Math.imul(C,ee)|0)+Math.imul(M,X)|0,d=d+Math.imul(M,ee)|0,c=c+Math.imul(_,te)|0,f=(f=f+Math.imul(_,ce)|0)+Math.imul(I,te)|0,d=d+Math.imul(I,ce)|0,c=c+Math.imul(A,de)|0,f=(f=f+Math.imul(A,re)|0)+Math.imul(v,de)|0,d=d+Math.imul(v,re)|0,c=c+Math.imul(m,ie)|0,f=(f=f+Math.imul(m,be)|0)+Math.imul(y,ie)|0,d=d+Math.imul(y,be)|0,c=c+Math.imul(h,se)|0,f=(f=f+Math.imul(h,le)|0)+Math.imul(p,se)|0,d=d+Math.imul(p,le)|0;var Ee=(b+(c=c+Math.imul(s,he)|0)|0)+((8191&(f=(f=f+Math.imul(s,pe)|0)+Math.imul(l,he)|0))<<13)|0;b=((d=d+Math.imul(l,pe)|0)+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,c=Math.imul(F,q),f=(f=Math.imul(F,z))+Math.imul(Q,q)|0,d=Math.imul(Q,z),c=c+Math.imul(P,K)|0,f=(f=f+Math.imul(P,V)|0)+Math.imul(D,K)|0,d=d+Math.imul(D,V)|0,c=c+Math.imul(T,J)|0,f=(f=f+Math.imul(T,W)|0)+Math.imul(N,J)|0,d=d+Math.imul(N,W)|0,c=c+Math.imul(k,X)|0,f=(f=f+Math.imul(k,ee)|0)+Math.imul(L,X)|0,d=d+Math.imul(L,ee)|0,c=c+Math.imul(C,te)|0,f=(f=f+Math.imul(C,ce)|0)+Math.imul(M,te)|0,d=d+Math.imul(M,ce)|0,c=c+Math.imul(_,de)|0,f=(f=f+Math.imul(_,re)|0)+Math.imul(I,de)|0,d=d+Math.imul(I,re)|0,c=c+Math.imul(A,ie)|0,f=(f=f+Math.imul(A,be)|0)+Math.imul(v,ie)|0,d=d+Math.imul(v,be)|0,c=c+Math.imul(m,se)|0,f=(f=f+Math.imul(m,le)|0)+Math.imul(y,se)|0,d=d+Math.imul(y,le)|0;var Ce=(b+(c=c+Math.imul(h,he)|0)|0)+((8191&(f=(f=f+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;b=((d=d+Math.imul(p,pe)|0)+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c=Math.imul(F,K),f=(f=Math.imul(F,V))+Math.imul(Q,K)|0,d=Math.imul(Q,V),c=c+Math.imul(P,J)|0,f=(f=f+Math.imul(P,W)|0)+Math.imul(D,J)|0,d=d+Math.imul(D,W)|0,c=c+Math.imul(T,X)|0,f=(f=f+Math.imul(T,ee)|0)+Math.imul(N,X)|0,d=d+Math.imul(N,ee)|0,c=c+Math.imul(k,te)|0,f=(f=f+Math.imul(k,ce)|0)+Math.imul(L,te)|0,d=d+Math.imul(L,ce)|0,c=c+Math.imul(C,de)|0,f=(f=f+Math.imul(C,re)|0)+Math.imul(M,de)|0,d=d+Math.imul(M,re)|0,c=c+Math.imul(_,ie)|0,f=(f=f+Math.imul(_,be)|0)+Math.imul(I,ie)|0,d=d+Math.imul(I,be)|0,c=c+Math.imul(A,se)|0,f=(f=f+Math.imul(A,le)|0)+Math.imul(v,se)|0,d=d+Math.imul(v,le)|0;var Me=(b+(c=c+Math.imul(m,he)|0)|0)+((8191&(f=(f=f+Math.imul(m,pe)|0)+Math.imul(y,he)|0))<<13)|0;b=((d=d+Math.imul(y,pe)|0)+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,c=Math.imul(F,J),f=(f=Math.imul(F,W))+Math.imul(Q,J)|0,d=Math.imul(Q,W),c=c+Math.imul(P,X)|0,f=(f=f+Math.imul(P,ee)|0)+Math.imul(D,X)|0,d=d+Math.imul(D,ee)|0,c=c+Math.imul(T,te)|0,f=(f=f+Math.imul(T,ce)|0)+Math.imul(N,te)|0,d=d+Math.imul(N,ce)|0,c=c+Math.imul(k,de)|0,f=(f=f+Math.imul(k,re)|0)+Math.imul(L,de)|0,d=d+Math.imul(L,re)|0,c=c+Math.imul(C,ie)|0,f=(f=f+Math.imul(C,be)|0)+Math.imul(M,ie)|0,d=d+Math.imul(M,be)|0,c=c+Math.imul(_,se)|0,f=(f=f+Math.imul(_,le)|0)+Math.imul(I,se)|0,d=d+Math.imul(I,le)|0;var Be=(b+(c=c+Math.imul(A,he)|0)|0)+((8191&(f=(f=f+Math.imul(A,pe)|0)+Math.imul(v,he)|0))<<13)|0;b=((d=d+Math.imul(v,pe)|0)+(f>>>13)|0)+(Be>>>26)|0,Be&=67108863,c=Math.imul(F,X),f=(f=Math.imul(F,ee))+Math.imul(Q,X)|0,d=Math.imul(Q,ee),c=c+Math.imul(P,te)|0,f=(f=f+Math.imul(P,ce)|0)+Math.imul(D,te)|0,d=d+Math.imul(D,ce)|0,c=c+Math.imul(T,de)|0,f=(f=f+Math.imul(T,re)|0)+Math.imul(N,de)|0,d=d+Math.imul(N,re)|0,c=c+Math.imul(k,ie)|0,f=(f=f+Math.imul(k,be)|0)+Math.imul(L,ie)|0,d=d+Math.imul(L,be)|0,c=c+Math.imul(C,se)|0,f=(f=f+Math.imul(C,le)|0)+Math.imul(M,se)|0,d=d+Math.imul(M,le)|0;var ke=(b+(c=c+Math.imul(_,he)|0)|0)+((8191&(f=(f=f+Math.imul(_,pe)|0)+Math.imul(I,he)|0))<<13)|0;b=((d=d+Math.imul(I,pe)|0)+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,c=Math.imul(F,te),f=(f=Math.imul(F,ce))+Math.imul(Q,te)|0,d=Math.imul(Q,ce),c=c+Math.imul(P,de)|0,f=(f=f+Math.imul(P,re)|0)+Math.imul(D,de)|0,d=d+Math.imul(D,re)|0,c=c+Math.imul(T,ie)|0,f=(f=f+Math.imul(T,be)|0)+Math.imul(N,ie)|0,d=d+Math.imul(N,be)|0,c=c+Math.imul(k,se)|0,f=(f=f+Math.imul(k,le)|0)+Math.imul(L,se)|0,d=d+Math.imul(L,le)|0;var Le=(b+(c=c+Math.imul(C,he)|0)|0)+((8191&(f=(f=f+Math.imul(C,pe)|0)+Math.imul(M,he)|0))<<13)|0;b=((d=d+Math.imul(M,pe)|0)+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,c=Math.imul(F,de),f=(f=Math.imul(F,re))+Math.imul(Q,de)|0,d=Math.imul(Q,re),c=c+Math.imul(P,ie)|0,f=(f=f+Math.imul(P,be)|0)+Math.imul(D,ie)|0,d=d+Math.imul(D,be)|0,c=c+Math.imul(T,se)|0,f=(f=f+Math.imul(T,le)|0)+Math.imul(N,se)|0,d=d+Math.imul(N,le)|0;var Se=(b+(c=c+Math.imul(k,he)|0)|0)+((8191&(f=(f=f+Math.imul(k,pe)|0)+Math.imul(L,he)|0))<<13)|0;b=((d=d+Math.imul(L,pe)|0)+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,c=Math.imul(F,ie),f=(f=Math.imul(F,be))+Math.imul(Q,ie)|0,d=Math.imul(Q,be),c=c+Math.imul(P,se)|0,f=(f=f+Math.imul(P,le)|0)+Math.imul(D,se)|0,d=d+Math.imul(D,le)|0;var Te=(b+(c=c+Math.imul(T,he)|0)|0)+((8191&(f=(f=f+Math.imul(T,pe)|0)+Math.imul(N,he)|0))<<13)|0;b=((d=d+Math.imul(N,pe)|0)+(f>>>13)|0)+(Te>>>26)|0,Te&=67108863,c=Math.imul(F,se),f=(f=Math.imul(F,le))+Math.imul(Q,se)|0,d=Math.imul(Q,le);var Ne=(b+(c=c+Math.imul(P,he)|0)|0)+((8191&(f=(f=f+Math.imul(P,pe)|0)+Math.imul(D,he)|0))<<13)|0;b=((d=d+Math.imul(D,pe)|0)+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Re=(b+(c=Math.imul(F,he))|0)+((8191&(f=(f=Math.imul(F,pe))+Math.imul(Q,he)|0))<<13)|0;return b=((d=Math.imul(Q,pe))+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,i[0]=ge,i[1]=me,i[2]=ye,i[3]=xe,i[4]=Ae,i[5]=ve,i[6]=we,i[7]=_e,i[8]=Ie,i[9]=Ee,i[10]=Ce,i[11]=Me,i[12]=Be,i[13]=ke,i[14]=Le,i[15]=Se,i[16]=Te,i[17]=Ne,i[18]=Re,0!==b&&(i[19]=b,t.length++),t};function p(e,a,t){return(new g).mulp(e,a,t)}function g(e,a){this.x=e,this.y=a}Math.imul||(h=u),d.prototype.mulTo=function(e,a){var t,c=this.length+e.length;return t=10===this.length&&10===e.length?h(this,e,a):c<63?u(this,e,a):c<1024?function(e,a,t){t.negative=a.negative^e.negative,t.length=e.length+a.length;for(var c=0,f=0,d=0;d>>26)|0)>>>26,r&=67108863}t.words[d]=n,c=r,r=f}return 0!==c?t.words[d]=c:t.length--,t.strip()}(this,e,a):p(this,e,a),t},g.prototype.makeRBT=function(e){for(var a=new Array(e),t=d.prototype._countBits(e)-1,c=0;c>=1;return c},g.prototype.permute=function(e,a,t,c,f,d){for(var r=0;r>>=1)f++;return 1<>>=13,t[2*r+1]=8191&d,d>>>=13;for(r=2*a;r>=26,a+=f/67108864|0,a+=d>>>26,this.words[t]=67108863&d}return 0!==a&&(this.words[t]=a,this.length++),this},d.prototype.muln=function(e){return this.clone().imuln(e)},d.prototype.sqr=function(){return this.mul(this)},d.prototype.isqr=function(){return this.imul(this.clone())},d.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),t=0;t>>f}return a}(e);if(0===a.length)return new d(1);for(var t=this,c=0;c=0);var a,t=e%26,f=(e-t)/26,d=67108863>>>26-t<<26-t;if(0!==t){var r=0;for(a=0;a>>26-t}r&&(this.words[a]=r,this.length++)}if(0!==f){for(a=this.length-1;a>=0;a--)this.words[a+f]=this.words[a];for(a=0;a=0),f=a?(a-a%26)/26:0;var d=e%26,r=Math.min((e-d)/26,this.length),n=67108863^67108863>>>d<r)for(this.length-=r,b=0;b=0&&(0!==o||b>=f);b--){var s=0|this.words[b];this.words[b]=o<<26-d|s>>>d,o=s&n}return i&&0!==o&&(i.words[i.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},d.prototype.ishrn=function(e,a,t){return c(0===this.negative),this.iushrn(e,a,t)},d.prototype.shln=function(e){return this.clone().ishln(e)},d.prototype.ushln=function(e){return this.clone().iushln(e)},d.prototype.shrn=function(e){return this.clone().ishrn(e)},d.prototype.ushrn=function(e){return this.clone().iushrn(e)},d.prototype.testn=function(e){c("number"==typeof e&&e>=0);var a=e%26,t=(e-a)/26,f=1<=0);var a=e%26,t=(e-a)/26;if(c(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==a&&t++,this.length=Math.min(t,this.length),0!==a){var f=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},d.prototype.isubn=function(e){if(c("number"==typeof e),c(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(i/67108864|0),this.words[f+t]=67108863&d}for(;f>26,this.words[f+t]=67108863&d;if(0===n)return this.strip();for(c(-1===n),n=0,f=0;f>26,this.words[f]=67108863&d;return this.negative=1,this.strip()},d.prototype._wordDiv=function(e,a){var t=(this.length,e.length),c=this.clone(),f=e,r=0|f.words[f.length-1];0!=(t=26-this._countBits(r))&&(f=f.ushln(t),c.iushln(t),r=0|f.words[f.length-1]);var n,i=c.length-f.length;if("mod"!==a){(n=new d(null)).length=i+1,n.words=new Array(n.length);for(var b=0;b=0;s--){var l=67108864*(0|c.words[f.length+s])+(0|c.words[f.length+s-1]);for(l=Math.min(l/r|0,67108863),c._ishlnsubmul(f,l,s);0!==c.negative;)l--,c.negative=0,c._ishlnsubmul(f,1,s),c.isZero()||(c.negative^=1);n&&(n.words[s]=l)}return n&&n.strip(),c.strip(),"div"!==a&&0!==t&&c.iushrn(t),{div:n||null,mod:c}},d.prototype.divmod=function(e,a,t){return c(!e.isZero()),this.isZero()?{div:new d(0),mod:new d(0)}:0!==this.negative&&0===e.negative?(n=this.neg().divmod(e,a),"mod"!==a&&(f=n.div.neg()),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.iadd(e)),{div:f,mod:r}):0===this.negative&&0!==e.negative?(n=this.divmod(e.neg(),a),"mod"!==a&&(f=n.div.neg()),{div:f,mod:n.mod}):this.negative&e.negative?(n=this.neg().divmod(e.neg(),a),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.isub(e)),{div:n.div,mod:r}):e.length>this.length||this.cmp(e)<0?{div:new d(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new d(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new d(this.modn(e.words[0]))}:this._wordDiv(e,a);var f,r,n},d.prototype.div=function(e){return this.divmod(e,"div",!1).div},d.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},d.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},d.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var t=0!==a.div.negative?a.mod.isub(e):a.mod,c=e.ushrn(1),f=e.andln(1),d=t.cmp(c);return d<0||1===f&&0===d?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},d.prototype.modn=function(e){c(e<=67108863);for(var a=(1<<26)%e,t=0,f=this.length-1;f>=0;f--)t=(a*t+(0|this.words[f]))%e;return t},d.prototype.idivn=function(e){c(e<=67108863);for(var a=0,t=this.length-1;t>=0;t--){var f=(0|this.words[t])+67108864*a;this.words[t]=f/e|0,a=f%e}return this.strip()},d.prototype.divn=function(e){return this.clone().idivn(e)},d.prototype.egcd=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f=new d(1),r=new d(0),n=new d(0),i=new d(1),b=0;a.isEven()&&t.isEven();)a.iushrn(1),t.iushrn(1),++b;for(var o=t.clone(),s=a.clone();!a.isZero();){for(var l=0,u=1;!(a.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(f.isOdd()||r.isOdd())&&(f.iadd(o),r.isub(s)),f.iushrn(1),r.iushrn(1);for(var h=0,p=1;!(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(o),i.isub(s)),n.iushrn(1),i.iushrn(1);a.cmp(t)>=0?(a.isub(t),f.isub(n),r.isub(i)):(t.isub(a),n.isub(f),i.isub(r))}return{a:n,b:i,gcd:t.iushln(b)}},d.prototype._invmp=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f,r=new d(1),n=new d(0),i=t.clone();a.cmpn(1)>0&&t.cmpn(1)>0;){for(var b=0,o=1;!(a.words[0]&o)&&b<26;++b,o<<=1);if(b>0)for(a.iushrn(b);b-- >0;)r.isOdd()&&r.iadd(i),r.iushrn(1);for(var s=0,l=1;!(t.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(t.iushrn(s);s-- >0;)n.isOdd()&&n.iadd(i),n.iushrn(1);a.cmp(t)>=0?(a.isub(t),r.isub(n)):(t.isub(a),n.isub(r))}return(f=0===a.cmpn(1)?r:n).cmpn(0)<0&&f.iadd(e),f},d.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),t=e.clone();a.negative=0,t.negative=0;for(var c=0;a.isEven()&&t.isEven();c++)a.iushrn(1),t.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;t.isEven();)t.iushrn(1);var f=a.cmp(t);if(f<0){var d=a;a=t,t=d}else if(0===f||0===t.cmpn(1))break;a.isub(t)}return t.iushln(c)},d.prototype.invm=function(e){return this.egcd(e).a.umod(e)},d.prototype.isEven=function(){return!(1&this.words[0])},d.prototype.isOdd=function(){return!(1&~this.words[0])},d.prototype.andln=function(e){return this.words[0]&e},d.prototype.bincn=function(e){c("number"==typeof e);var a=e%26,t=(e-a)/26,f=1<>>26,n&=67108863,this.words[r]=n}return 0!==d&&(this.words[r]=d,this.length++),this},d.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},d.prototype.cmpn=function(e){var a,t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)a=1;else{t&&(e=-e),c(e<=67108863,"Number is too big");var f=0|this.words[0];a=f===e?0:fe.length)return 1;if(this.length=0;t--){var c=0|this.words[t],f=0|e.words[t];if(c!==f){cf&&(a=1);break}}return a},d.prototype.gtn=function(e){return 1===this.cmpn(e)},d.prototype.gt=function(e){return 1===this.cmp(e)},d.prototype.gten=function(e){return this.cmpn(e)>=0},d.prototype.gte=function(e){return this.cmp(e)>=0},d.prototype.ltn=function(e){return-1===this.cmpn(e)},d.prototype.lt=function(e){return-1===this.cmp(e)},d.prototype.lten=function(e){return this.cmpn(e)<=0},d.prototype.lte=function(e){return this.cmp(e)<=0},d.prototype.eqn=function(e){return 0===this.cmpn(e)},d.prototype.eq=function(e){return 0===this.cmp(e)},d.red=function(e){return new _(e)},d.prototype.toRed=function(e){return c(!this.red,"Already a number in reduction context"),c(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},d.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},d.prototype._forceRed=function(e){return this.red=e,this},d.prototype.forceRed=function(e){return c(!this.red,"Already a number in reduction context"),this._forceRed(e)},d.prototype.redAdd=function(e){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},d.prototype.redIAdd=function(e){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},d.prototype.redSub=function(e){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},d.prototype.redISub=function(e){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},d.prototype.redShl=function(e){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},d.prototype.redMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},d.prototype.redIMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},d.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},d.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},d.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},d.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},d.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},d.prototype.redPow=function(e){return c(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function y(e,a){this.name=e,this.p=new d(a,16),this.n=this.p.bitLength(),this.k=new d(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function x(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var a=d._prime(e);this.m=a.p,this.prime=a}else c(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new d(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var e=new d(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var a,t=e;do{this.split(t,this.tmp),a=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(a>this.n);var c=a0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},y.prototype.split=function(e,a){e.iushrn(this.n,0,a)},y.prototype.imulK=function(e){return e.imul(this.k)},f(x,y),x.prototype.split=function(e,a){for(var t=4194303,c=Math.min(e.length,9),f=0;f>>22,d=r}d>>>=22,e.words[f-10]=d,0===d&&e.length>10?e.length-=10:e.length-=9},x.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,t=0;t>>=26,e.words[t]=f,a=c}return 0!==a&&(e.words[e.length++]=a),e},d._prime=function(e){if(m[e])return m[e];var a;if("k256"===e)a=new x;else if("p224"===e)a=new A;else if("p192"===e)a=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new w}return m[e]=a,a},_.prototype._verify1=function(e){c(0===e.negative,"red works only with positives"),c(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,a){c(!(e.negative|a.negative),"red works only with positives"),c(e.red&&e.red===a.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,a){this._verify2(e,a);var t=e.add(a);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},_.prototype.iadd=function(e,a){this._verify2(e,a);var t=e.iadd(a);return t.cmp(this.m)>=0&&t.isub(this.m),t},_.prototype.sub=function(e,a){this._verify2(e,a);var t=e.sub(a);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},_.prototype.isub=function(e,a){this._verify2(e,a);var t=e.isub(a);return t.cmpn(0)<0&&t.iadd(this.m),t},_.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},_.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},_.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(c(a%2==1),3===a){var t=this.m.add(new d(1)).iushrn(2);return this.pow(e,t)}for(var f=this.m.subn(1),r=0;!f.isZero()&&0===f.andln(1);)r++,f.iushrn(1);c(!f.isZero());var n=new d(1).toRed(this),i=n.redNeg(),b=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new d(2*o*o).toRed(this);0!==this.pow(o,b).cmp(i);)o.redIAdd(i);for(var s=this.pow(o,f),l=this.pow(e,f.addn(1).iushrn(1)),u=this.pow(e,f),h=r;0!==u.cmp(n);){for(var p=u,g=0;0!==p.cmp(n);g++)p=p.redSqr();c(g=0;c--){for(var b=a.words[c],o=i-1;o>=0;o--){var s=b>>o&1;f!==t[0]&&(f=this.sqr(f)),0!==s||0!==r?(r<<=1,r|=s,(4==++n||0===c&&0===o)&&(f=this.mul(f,t[r]),n=0,r=0)):n=0}i=26}return f},_.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},_.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},d.mont=function(e){return new I(e)},f(I,_),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},I.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var t=e.imul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),d=f;return f.cmp(this.m)>=0?d=f.isub(this.m):f.cmpn(0)<0&&(d=f.iadd(this.m)),d._forceRed(this)},I.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new d(0)._forceRed(this);var t=e.mul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),r=f;return f.cmp(this.m)>=0?r=f.isub(this.m):f.cmpn(0)<0&&(r=f.iadd(this.m)),r._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=t.nmd(e),this)},47108:(e,a,t)=>{"use strict";var c=t(56698),f=t(88276),d=t(66011),r=t(62802),n=t(56168);function i(e){n.call(this,"digest"),this._hash=e}c(i,n),i.prototype._update=function(e){this._hash.update(e)},i.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new f:"rmd160"===e||"ripemd160"===e?new d:new i(r(e))}},20320:(e,a,t)=>{var c=t(88276);e.exports=function(e){return(new c).update(e).digest()}},83507:(e,a,t)=>{"use strict";var c=t(56698),f=t(41800),d=t(56168),r=t(92861).Buffer,n=t(20320),i=t(66011),b=t(62802),o=r.alloc(128);function s(e,a){d.call(this,"digest"),"string"==typeof a&&(a=r.from(a));var t="sha512"===e||"sha384"===e?128:64;this._alg=e,this._key=a,a.length>t?a=("rmd160"===e?new i:b(e)).update(a).digest():a.length{"use strict";var c=t(56698),f=t(92861).Buffer,d=t(56168),r=f.alloc(128),n=64;function i(e,a){d.call(this,"digest"),"string"==typeof a&&(a=f.from(a)),this._alg=e,this._key=a,a.length>n?a=e(a):a.length{var c="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==t.g&&t.g,f=function(){function e(){this.fetch=!1,this.DOMException=c.DOMException}return e.prototype=c,new e}();!function(e){!function(a){var t=void 0!==e&&e||"undefined"!=typeof self&&self||void 0!==t&&t,c="URLSearchParams"in t,f="Symbol"in t&&"iterator"in Symbol,d="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(e){return!1}}(),r="FormData"in t,n="ArrayBuffer"in t;if(n)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],b=ArrayBuffer.isView||function(e){return e&&i.indexOf(Object.prototype.toString.call(e))>-1};function o(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function s(e){return"string"!=typeof e&&(e=String(e)),e}function l(e){var a={next:function(){var a=e.shift();return{done:void 0===a,value:a}}};return f&&(a[Symbol.iterator]=function(){return a}),a}function u(e){this.map={},e instanceof u?e.forEach((function(e,a){this.append(a,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(a){this.append(a,e[a])}),this)}function h(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise((function(a,t){e.onload=function(){a(e.result)},e.onerror=function(){t(e.error)}}))}function g(e){var a=new FileReader,t=p(a);return a.readAsArrayBuffer(e),t}function m(e){if(e.slice)return e.slice(0);var a=new Uint8Array(e.byteLength);return a.set(new Uint8Array(e)),a.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(e){var a;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:d&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:r&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:c&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():n&&d&&(a=e)&&DataView.prototype.isPrototypeOf(a)?(this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):n&&(ArrayBuffer.prototype.isPrototypeOf(e)||b(e))?this._bodyArrayBuffer=m(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):c&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},d&&(this.blob=function(){var e=h(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?h(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)):this.blob().then(g)}),this.text=function(){var e,a,t,c=h(this);if(c)return c;if(this._bodyBlob)return e=this._bodyBlob,t=p(a=new FileReader),a.readAsText(e),t;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var a=new Uint8Array(e),t=new Array(a.length),c=0;c-1?c:t),this.mode=a.mode||this.mode||null,this.signal=a.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&f)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(f),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==a.cache&&"no-cache"!==a.cache)){var d=/([?&])_=[^&]*/;d.test(this.url)?this.url=this.url.replace(d,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function v(e){var a=new FormData;return e.trim().split("&").forEach((function(e){if(e){var t=e.split("="),c=t.shift().replace(/\+/g," "),f=t.join("=").replace(/\+/g," ");a.append(decodeURIComponent(c),decodeURIComponent(f))}})),a}function w(e,a){if(!(this instanceof w))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');a||(a={}),this.type="default",this.status=void 0===a.status?200:a.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===a.statusText?"":""+a.statusText,this.headers=new u(a.headers),this.url=a.url||"",this._initBody(e)}A.prototype.clone=function(){return new A(this,{body:this._bodyInit})},y.call(A.prototype),y.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},w.error=function(){var e=new w(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];w.redirect=function(e,a){if(-1===_.indexOf(a))throw new RangeError("Invalid status code");return new w(null,{status:a,headers:{location:e}})},a.DOMException=t.DOMException;try{new a.DOMException}catch(e){a.DOMException=function(e,a){this.message=e,this.name=a;var t=Error(e);this.stack=t.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function I(e,c){return new Promise((function(f,r){var i=new A(e,c);if(i.signal&&i.signal.aborted)return r(new a.DOMException("Aborted","AbortError"));var b=new XMLHttpRequest;function o(){b.abort()}b.onload=function(){var e,a,t={status:b.status,statusText:b.statusText,headers:(e=b.getAllResponseHeaders()||"",a=new u,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var t=e.split(":"),c=t.shift().trim();if(c){var f=t.join(":").trim();a.append(c,f)}})),a)};t.url="responseURL"in b?b.responseURL:t.headers.get("X-Request-URL");var c="response"in b?b.response:b.responseText;setTimeout((function(){f(new w(c,t))}),0)},b.onerror=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},b.ontimeout=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},b.onabort=function(){setTimeout((function(){r(new a.DOMException("Aborted","AbortError"))}),0)},b.open(i.method,function(e){try{return""===e&&t.location.href?t.location.href:e}catch(a){return e}}(i.url),!0),"include"===i.credentials?b.withCredentials=!0:"omit"===i.credentials&&(b.withCredentials=!1),"responseType"in b&&(d?b.responseType="blob":n&&i.headers.get("Content-Type")&&-1!==i.headers.get("Content-Type").indexOf("application/octet-stream")&&(b.responseType="arraybuffer")),!c||"object"!=typeof c.headers||c.headers instanceof u?i.headers.forEach((function(e,a){b.setRequestHeader(a,e)})):Object.getOwnPropertyNames(c.headers).forEach((function(e){b.setRequestHeader(e,s(c.headers[e]))})),i.signal&&(i.signal.addEventListener("abort",o),b.onreadystatechange=function(){4===b.readyState&&i.signal.removeEventListener("abort",o)}),b.send(void 0===i._bodyInit?null:i._bodyInit)}))}I.polyfill=!0,t.fetch||(t.fetch=I,t.Headers=u,t.Request=A,t.Response=w),a.Headers=u,a.Request=A,a.Response=w,a.fetch=I}({})}(f),f.fetch.ponyfill=!0,delete f.fetch.polyfill;var d=c.fetch?c:f;(a=d.fetch).default=d.fetch,a.fetch=d.fetch,a.Headers=d.Headers,a.Request=d.Request,a.Response=d.Response,e.exports=a},91565:(e,a,t)=>{"use strict";a.randomBytes=a.rng=a.pseudoRandomBytes=a.prng=t(53209),a.createHash=a.Hash=t(47108),a.createHmac=a.Hmac=t(83507);var c=t(55715),f=Object.keys(c),d=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(f);a.getHashes=function(){return d};var r=t(78396);a.pbkdf2=r.pbkdf2,a.pbkdf2Sync=r.pbkdf2Sync;var n=t(30125);a.Cipher=n.Cipher,a.createCipher=n.createCipher,a.Cipheriv=n.Cipheriv,a.createCipheriv=n.createCipheriv,a.Decipher=n.Decipher,a.createDecipher=n.createDecipher,a.Decipheriv=n.Decipheriv,a.createDecipheriv=n.createDecipheriv,a.getCiphers=n.getCiphers,a.listCiphers=n.listCiphers;var i=t(15380);a.DiffieHellmanGroup=i.DiffieHellmanGroup,a.createDiffieHellmanGroup=i.createDiffieHellmanGroup,a.getDiffieHellman=i.getDiffieHellman,a.createDiffieHellman=i.createDiffieHellman,a.DiffieHellman=i.DiffieHellman;var b=t(20);a.createSign=b.createSign,a.Sign=b.Sign,a.createVerify=b.createVerify,a.Verify=b.Verify,a.createECDH=t(61324);var o=t(97168);a.publicEncrypt=o.publicEncrypt,a.privateEncrypt=o.privateEncrypt,a.publicDecrypt=o.publicDecrypt,a.privateDecrypt=o.privateDecrypt;var s=t(76983);a.randomFill=s.randomFill,a.randomFillSync=s.randomFillSync,a.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},a.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},17833:(e,a,t)=>{a.formatArgs=function(a){if(a[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+a[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const t="color: "+this.color;a.splice(1,0,t,"color: inherit");let c=0,f=0;a[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(c++,"%c"===e&&(f=c))})),a.splice(f,0,t)},a.save=function(e){try{e?a.storage.setItem("debug",e):a.storage.removeItem("debug")}catch(e){}},a.load=function(){let e;try{e=a.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},a.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},a.storage=function(){try{return localStorage}catch(e){}}(),a.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),a.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],a.log=console.debug||console.log||(()=>{}),e.exports=t(40736)(a);const{formatters:c}=e.exports;c.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},40736:(e,a,t)=>{e.exports=function(e){function a(e){let t,f,d,r=null;function n(...e){if(!n.enabled)return;const c=n,f=Number(new Date),d=f-(t||f);c.diff=d,c.prev=t,c.curr=f,t=f,e[0]=a.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let r=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((t,f)=>{if("%%"===t)return"%";r++;const d=a.formatters[f];if("function"==typeof d){const a=e[r];t=d.call(c,a),e.splice(r,1),r--}return t})),a.formatArgs.call(c,e),(c.log||a.log).apply(c,e)}return n.namespace=e,n.useColors=a.useColors(),n.color=a.selectColor(e),n.extend=c,n.destroy=a.destroy,Object.defineProperty(n,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==r?r:(f!==a.namespaces&&(f=a.namespaces,d=a.enabled(e)),d),set:e=>{r=e}}),"function"==typeof a.init&&a.init(n),n}function c(e,t){const c=a(this.namespace+(void 0===t?":":t)+e);return c.log=this.log,c}function f(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return a.debug=a,a.default=a,a.coerce=function(e){return e instanceof Error?e.stack||e.message:e},a.disable=function(){const e=[...a.names.map(f),...a.skips.map(f).map((e=>"-"+e))].join(",");return a.enable(""),e},a.enable=function(e){let t;a.save(e),a.namespaces=e,a.names=[],a.skips=[];const c=("string"==typeof e?e:"").split(/[\s,]+/),f=c.length;for(t=0;t{a[t]=e[t]})),a.names=[],a.skips=[],a.formatters={},a.selectColor=function(e){let t=0;for(let a=0;a{"use strict";var c=t(30655),f=t(58068),d=t(69675),r=t(75795);e.exports=function(e,a,t){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new d("`obj` must be an object or a function`");if("string"!=typeof a&&"symbol"!=typeof a)throw new d("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new d("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new d("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new d("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new d("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,b=arguments.length>5?arguments[5]:null,o=arguments.length>6&&arguments[6],s=!!r&&r(e,a);if(c)c(e,a,{configurable:null===b&&s?s.configurable:!b,enumerable:null===n&&s?s.enumerable:!n,value:t,writable:null===i&&s?s.writable:!i});else{if(!o&&(n||i||b))throw new f("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[a]=t}}},38452:(e,a,t)=>{"use strict";var c=t(1189),f="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),d=Object.prototype.toString,r=Array.prototype.concat,n=t(30041),i=t(30592)(),b=function(e,a,t,c){if(a in e)if(!0===c){if(e[a]===t)return}else if("function"!=typeof(f=c)||"[object Function]"!==d.call(f)||!c())return;var f;i?n(e,a,t,!0):n(e,a,t)},o=function(e,a){var t=arguments.length>2?arguments[2]:{},d=c(a);f&&(d=r.call(d,Object.getOwnPropertySymbols(a)));for(var n=0;n{"use strict";a.utils=t(87626),a.Cipher=t(82808),a.DES=t(82211),a.CBC=t(3389),a.EDE=t(65279)},3389:(e,a,t)=>{"use strict";var c=t(43349),f=t(56698),d={};function r(e){c.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var a=0;a{"use strict";var c=t(43349);function f(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=!1!==e.padding}e.exports=f,f.prototype._init=function(){},f.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},f.prototype._buffer=function(e,a){for(var t=Math.min(this.buffer.length-this.bufferOff,e.length-a),c=0;c0;c--)a+=this._buffer(e,a),t+=this._flushBuffer(f,t);return a+=this._buffer(e,a),f},f.prototype.final=function(e){var a,t;return e&&(a=this.update(e)),t="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),a?a.concat(t):t},f.prototype._pad=function(e,a){if(0===a)return!1;for(;a{"use strict";var c=t(43349),f=t(56698),d=t(87626),r=t(82808);function n(){this.tmp=new Array(2),this.keys=null}function i(e){r.call(this,e);var a=new n;this._desState=a,this.deriveKeys(a,e.key)}f(i,r),e.exports=i,i.create=function(e){return new i(e)};var b=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];i.prototype.deriveKeys=function(e,a){e.keys=new Array(32),c.equal(a.length,this.blockSize,"Invalid key length");var t=d.readUInt32BE(a,0),f=d.readUInt32BE(a,4);d.pc1(t,f,e.tmp,0),t=e.tmp[0],f=e.tmp[1];for(var r=0;r>>1];t=d.r28shl(t,n),f=d.r28shl(f,n),d.pc2(t,f,e.keys,r)}},i.prototype._update=function(e,a,t,c){var f=this._desState,r=d.readUInt32BE(e,a),n=d.readUInt32BE(e,a+4);d.ip(r,n,f.tmp,0),r=f.tmp[0],n=f.tmp[1],"encrypt"===this.type?this._encrypt(f,r,n,f.tmp,0):this._decrypt(f,r,n,f.tmp,0),r=f.tmp[0],n=f.tmp[1],d.writeUInt32BE(t,r,c),d.writeUInt32BE(t,n,c+4)},i.prototype._pad=function(e,a){if(!1===this.padding)return!1;for(var t=e.length-a,c=a;c>>0,r=l}d.rip(n,r,c,f)},i.prototype._decrypt=function(e,a,t,c,f){for(var r=t,n=a,i=e.keys.length-2;i>=0;i-=2){var b=e.keys[i],o=e.keys[i+1];d.expand(r,e.tmp,0),b^=e.tmp[0],o^=e.tmp[1];var s=d.substitute(b,o),l=r;r=(n^d.permute(s))>>>0,n=l}d.rip(r,n,c,f)}},65279:(e,a,t)=>{"use strict";var c=t(43349),f=t(56698),d=t(82808),r=t(82211);function n(e,a){c.equal(a.length,24,"Invalid key length");var t=a.slice(0,8),f=a.slice(8,16),d=a.slice(16,24);this.ciphers="encrypt"===e?[r.create({type:"encrypt",key:t}),r.create({type:"decrypt",key:f}),r.create({type:"encrypt",key:d})]:[r.create({type:"decrypt",key:d}),r.create({type:"encrypt",key:f}),r.create({type:"decrypt",key:t})]}function i(e){d.call(this,e);var a=new n(this.type,this.options.key);this._edeState=a}f(i,d),e.exports=i,i.create=function(e){return new i(e)},i.prototype._update=function(e,a,t,c){var f=this._edeState;f.ciphers[0]._update(e,a,t,c),f.ciphers[1]._update(t,c,t,c),f.ciphers[2]._update(t,c,t,c)},i.prototype._pad=r.prototype._pad,i.prototype._unpad=r.prototype._unpad},87626:(e,a)=>{"use strict";a.readUInt32BE=function(e,a){return(e[0+a]<<24|e[1+a]<<16|e[2+a]<<8|e[3+a])>>>0},a.writeUInt32BE=function(e,a,t){e[0+t]=a>>>24,e[1+t]=a>>>16&255,e[2+t]=a>>>8&255,e[3+t]=255&a},a.ip=function(e,a,t,c){for(var f=0,d=0,r=6;r>=0;r-=2){for(var n=0;n<=24;n+=8)f<<=1,f|=a>>>n+r&1;for(n=0;n<=24;n+=8)f<<=1,f|=e>>>n+r&1}for(r=6;r>=0;r-=2){for(n=1;n<=25;n+=8)d<<=1,d|=a>>>n+r&1;for(n=1;n<=25;n+=8)d<<=1,d|=e>>>n+r&1}t[c+0]=f>>>0,t[c+1]=d>>>0},a.rip=function(e,a,t,c){for(var f=0,d=0,r=0;r<4;r++)for(var n=24;n>=0;n-=8)f<<=1,f|=a>>>n+r&1,f<<=1,f|=e>>>n+r&1;for(r=4;r<8;r++)for(n=24;n>=0;n-=8)d<<=1,d|=a>>>n+r&1,d<<=1,d|=e>>>n+r&1;t[c+0]=f>>>0,t[c+1]=d>>>0},a.pc1=function(e,a,t,c){for(var f=0,d=0,r=7;r>=5;r--){for(var n=0;n<=24;n+=8)f<<=1,f|=a>>n+r&1;for(n=0;n<=24;n+=8)f<<=1,f|=e>>n+r&1}for(n=0;n<=24;n+=8)f<<=1,f|=a>>n+r&1;for(r=1;r<=3;r++){for(n=0;n<=24;n+=8)d<<=1,d|=a>>n+r&1;for(n=0;n<=24;n+=8)d<<=1,d|=e>>n+r&1}for(n=0;n<=24;n+=8)d<<=1,d|=e>>n+r&1;t[c+0]=f>>>0,t[c+1]=d>>>0},a.r28shl=function(e,a){return e<>>28-a};var t=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];a.pc2=function(e,a,c,f){for(var d=0,r=0,n=t.length>>>1,i=0;i>>t[i]&1;for(i=n;i>>t[i]&1;c[f+0]=d>>>0,c[f+1]=r>>>0},a.expand=function(e,a,t){var c=0,f=0;c=(1&e)<<5|e>>>27;for(var d=23;d>=15;d-=4)c<<=6,c|=e>>>d&63;for(d=11;d>=3;d-=4)f|=e>>>d&63,f<<=6;f|=(31&e)<<1|e>>>31,a[t+0]=c>>>0,a[t+1]=f>>>0};var c=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];a.substitute=function(e,a){for(var t=0,f=0;f<4;f++)t<<=4,t|=c[64*f+(e>>>18-6*f&63)];for(f=0;f<4;f++)t<<=4,t|=c[256+64*f+(a>>>18-6*f&63)];return t>>>0};var f=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];a.permute=function(e){for(var a=0,t=0;t>>f[t]&1;return a>>>0},a.padSplit=function(e,a,t){for(var c=e.toString(2);c.length{var c=t(62045).hp,f=t(4934),d=t(23241),r=t(14910),n={binary:!0,hex:!0,base64:!0};a.DiffieHellmanGroup=a.createDiffieHellmanGroup=a.getDiffieHellman=function(e){var a=new c(d[e].prime,"hex"),t=new c(d[e].gen,"hex");return new r(a,t)},a.createDiffieHellman=a.DiffieHellman=function e(a,t,d,i){return c.isBuffer(t)||void 0===n[t]?e(a,"binary",t,d):(t=t||"binary",i=i||"binary",d=d||new c([2]),c.isBuffer(d)||(d=new c(d,i)),"number"==typeof a?new r(f(a,d),d,!0):(c.isBuffer(a)||(a=new c(a,t)),new r(a,d,!0)))}},14910:(e,a,t)=>{var c=t(62045).hp,f=t(66473),d=new(t(52244)),r=new f(24),n=new f(11),i=new f(10),b=new f(3),o=new f(7),s=t(4934),l=t(53209);function u(e,a){return a=a||"utf8",c.isBuffer(e)||(e=new c(e,a)),this._pub=new f(e),this}function h(e,a){return a=a||"utf8",c.isBuffer(e)||(e=new c(e,a)),this._priv=new f(e),this}e.exports=g;var p={};function g(e,a,t){this.setGenerator(a),this.__prime=new f(e),this._prime=f.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,t?(this.setPublicKey=u,this.setPrivateKey=h):this._primeCode=8}function m(e,a){var t=new c(e.toArray());return a?t.toString(a):t}Object.defineProperty(g.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,a){var t=a.toString("hex"),c=[t,e.toString(16)].join("_");if(c in p)return p[c];var f,l=0;if(e.isEven()||!s.simpleSieve||!s.fermatTest(e)||!d.test(e))return l+=1,l+="02"===t||"05"===t?8:4,p[c]=l,l;switch(d.test(e.shrn(1))||(l+=2),t){case"02":e.mod(r).cmp(n)&&(l+=8);break;case"05":(f=e.mod(i)).cmp(b)&&f.cmp(o)&&(l+=8);break;default:l+=4}return p[c]=l,l}(this.__prime,this.__gen)),this._primeCode}}),g.prototype.generateKeys=function(){return this._priv||(this._priv=new f(l(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},g.prototype.computeSecret=function(e){var a=(e=(e=new f(e)).toRed(this._prime)).redPow(this._priv).fromRed(),t=new c(a.toArray()),d=this.getPrime();if(t.length{var c=t(53209);e.exports=y,y.simpleSieve=g,y.fermatTest=m;var f=t(66473),d=new f(24),r=new(t(52244)),n=new f(1),i=new f(2),b=new f(5),o=(new f(16),new f(8),new f(10)),s=new f(3),l=(new f(7),new f(11)),u=new f(4),h=(new f(12),null);function p(){if(null!==h)return h;var e=[];e[0]=2;for(var a=1,t=3;t<1048576;t+=2){for(var c=Math.ceil(Math.sqrt(t)),f=0;fe;)t.ishrn(1);if(t.isEven()&&t.iadd(n),t.testn(1)||t.iadd(i),a.cmp(i)){if(!a.cmp(b))for(;t.mod(o).cmp(s);)t.iadd(u)}else for(;t.mod(d).cmp(l);)t.iadd(u);if(g(h=t.shrn(1))&&g(t)&&m(h)&&m(t)&&r.test(h)&&r.test(t))return t}}},66473:function(e,a,t){!function(e,a){"use strict";function c(e,a){if(!e)throw new Error(a||"Assertion failed")}function f(e,a){e.super_=a;var t=function(){};t.prototype=a.prototype,e.prototype=new t,e.prototype.constructor=e}function d(e,a,t){if(d.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==a&&"be"!==a||(t=a,a=10),this._init(e||0,a||10,t||"be"))}var r;"object"==typeof e?e.exports=d:a.BN=d,d.BN=d,d.wordSize=26;try{r="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:t(66089).Buffer}catch(e){}function n(e,a){var t=e.charCodeAt(a);return t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:t-48&15}function i(e,a,t){var c=n(e,t);return t-1>=a&&(c|=n(e,t-1)<<4),c}function b(e,a,t,c){for(var f=0,d=Math.min(e.length,t),r=a;r=49?n-49+10:n>=17?n-17+10:n}return f}d.isBN=function(e){return e instanceof d||null!==e&&"object"==typeof e&&e.constructor.wordSize===d.wordSize&&Array.isArray(e.words)},d.max=function(e,a){return e.cmp(a)>0?e:a},d.min=function(e,a){return e.cmp(a)<0?e:a},d.prototype._init=function(e,a,t){if("number"==typeof e)return this._initNumber(e,a,t);if("object"==typeof e)return this._initArray(e,a,t);"hex"===a&&(a=16),c(a===(0|a)&&a>=2&&a<=36);var f=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(f++,this.negative=1),f=0;f-=3)r=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[d]|=r<>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);else if("le"===t)for(f=0,d=0;f>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);return this.strip()},d.prototype._parseHex=function(e,a,t){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)f=i(e,a,c)<=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;else for(c=(e.length-a)%2==0?a+1:a;c=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;this.strip()},d.prototype._parseBase=function(e,a,t){this.words=[0],this.length=1;for(var c=0,f=1;f<=67108863;f*=a)c++;c--,f=f/a|0;for(var d=e.length-t,r=d%c,n=Math.min(d,d-r)+t,i=0,o=t;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},d.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},d.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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],l=[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 u(e,a,t){t.negative=a.negative^e.negative;var c=e.length+a.length|0;t.length=c,c=c-1|0;var f=0|e.words[0],d=0|a.words[0],r=f*d,n=67108863&r,i=r/67108864|0;t.words[0]=n;for(var b=1;b>>26,s=67108863&i,l=Math.min(b,a.length-1),u=Math.max(0,b-e.length+1);u<=l;u++){var h=b-u|0;o+=(r=(f=0|e.words[h])*(d=0|a.words[u])+s)/67108864|0,s=67108863&r}t.words[b]=0|s,i=0|o}return 0!==i?t.words[b]=0|i:t.length--,t.strip()}d.prototype.toString=function(e,a){var t;if(a=0|a||1,16===(e=e||10)||"hex"===e){t="";for(var f=0,d=0,r=0;r>>24-f&16777215)||r!==this.length-1?o[6-i.length]+i+t:i+t,(f+=2)>=26&&(f-=26,r--)}for(0!==d&&(t=d.toString(16)+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(e===(0|e)&&e>=2&&e<=36){var b=s[e],u=l[e];t="";var h=this.clone();for(h.negative=0;!h.isZero();){var p=h.modn(u).toString(e);t=(h=h.idivn(u)).isZero()?p+t:o[b-p.length]+p+t}for(this.isZero()&&(t="0"+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}c(!1,"Base should be between 2 and 36")},d.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&c(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},d.prototype.toJSON=function(){return this.toString(16)},d.prototype.toBuffer=function(e,a){return c(void 0!==r),this.toArrayLike(r,e,a)},d.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},d.prototype.toArrayLike=function(e,a,t){var f=this.byteLength(),d=t||Math.max(1,f);c(f<=d,"byte array longer than desired length"),c(d>0,"Requested array length <= 0"),this.strip();var r,n,i="le"===a,b=new e(d),o=this.clone();if(i){for(n=0;!o.isZero();n++)r=o.andln(255),o.iushrn(8),b[n]=r;for(;n=4096&&(t+=13,a>>>=13),a>=64&&(t+=7,a>>>=7),a>=8&&(t+=4,a>>>=4),a>=2&&(t+=2,a>>>=2),t+a},d.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,t=0;return 8191&a||(t+=13,a>>>=13),127&a||(t+=7,a>>>=7),15&a||(t+=4,a>>>=4),3&a||(t+=2,a>>>=2),1&a||t++,t},d.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},d.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},d.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},d.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var t=0;te.length?this.clone().iand(e):e.clone().iand(this)},d.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},d.prototype.iuxor=function(e){var a,t;this.length>e.length?(a=this,t=e):(a=e,t=this);for(var c=0;ce.length?this.clone().ixor(e):e.clone().ixor(this)},d.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},d.prototype.inotn=function(e){c("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),t=e%26;this._expand(a),t>0&&a--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-t),this.strip()},d.prototype.notn=function(e){return this.clone().inotn(e)},d.prototype.setn=function(e,a){c("number"==typeof e&&e>=0);var t=e/26|0,f=e%26;return this._expand(t+1),this.words[t]=a?this.words[t]|1<e.length?(t=this,c=e):(t=e,c=this);for(var f=0,d=0;d>>26;for(;0!==f&&d>>26;if(this.length=t.length,0!==f)this.words[this.length]=f,this.length++;else if(t!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},d.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var t,c,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(t=this,c=e):(t=e,c=this);for(var d=0,r=0;r>26,this.words[r]=67108863&a;for(;0!==d&&r>26,this.words[r]=67108863&a;if(0===d&&r>>13,u=0|r[1],h=8191&u,p=u>>>13,g=0|r[2],m=8191&g,y=g>>>13,x=0|r[3],A=8191&x,v=x>>>13,w=0|r[4],_=8191&w,I=w>>>13,E=0|r[5],C=8191&E,M=E>>>13,B=0|r[6],k=8191&B,L=B>>>13,S=0|r[7],T=8191&S,N=S>>>13,R=0|r[8],P=8191&R,D=R>>>13,O=0|r[9],F=8191&O,Q=O>>>13,U=0|n[0],j=8191&U,H=U>>>13,$=0|n[1],q=8191&$,z=$>>>13,G=0|n[2],K=8191&G,V=G>>>13,Z=0|n[3],J=8191&Z,W=Z>>>13,Y=0|n[4],X=8191&Y,ee=Y>>>13,ae=0|n[5],te=8191&ae,ce=ae>>>13,fe=0|n[6],de=8191&fe,re=fe>>>13,ne=0|n[7],ie=8191&ne,be=ne>>>13,oe=0|n[8],se=8191&oe,le=oe>>>13,ue=0|n[9],he=8191&ue,pe=ue>>>13;t.negative=e.negative^a.negative,t.length=19;var ge=(b+(c=Math.imul(s,j))|0)+((8191&(f=(f=Math.imul(s,H))+Math.imul(l,j)|0))<<13)|0;b=((d=Math.imul(l,H))+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,c=Math.imul(h,j),f=(f=Math.imul(h,H))+Math.imul(p,j)|0,d=Math.imul(p,H);var me=(b+(c=c+Math.imul(s,q)|0)|0)+((8191&(f=(f=f+Math.imul(s,z)|0)+Math.imul(l,q)|0))<<13)|0;b=((d=d+Math.imul(l,z)|0)+(f>>>13)|0)+(me>>>26)|0,me&=67108863,c=Math.imul(m,j),f=(f=Math.imul(m,H))+Math.imul(y,j)|0,d=Math.imul(y,H),c=c+Math.imul(h,q)|0,f=(f=f+Math.imul(h,z)|0)+Math.imul(p,q)|0,d=d+Math.imul(p,z)|0;var ye=(b+(c=c+Math.imul(s,K)|0)|0)+((8191&(f=(f=f+Math.imul(s,V)|0)+Math.imul(l,K)|0))<<13)|0;b=((d=d+Math.imul(l,V)|0)+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,c=Math.imul(A,j),f=(f=Math.imul(A,H))+Math.imul(v,j)|0,d=Math.imul(v,H),c=c+Math.imul(m,q)|0,f=(f=f+Math.imul(m,z)|0)+Math.imul(y,q)|0,d=d+Math.imul(y,z)|0,c=c+Math.imul(h,K)|0,f=(f=f+Math.imul(h,V)|0)+Math.imul(p,K)|0,d=d+Math.imul(p,V)|0;var xe=(b+(c=c+Math.imul(s,J)|0)|0)+((8191&(f=(f=f+Math.imul(s,W)|0)+Math.imul(l,J)|0))<<13)|0;b=((d=d+Math.imul(l,W)|0)+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,c=Math.imul(_,j),f=(f=Math.imul(_,H))+Math.imul(I,j)|0,d=Math.imul(I,H),c=c+Math.imul(A,q)|0,f=(f=f+Math.imul(A,z)|0)+Math.imul(v,q)|0,d=d+Math.imul(v,z)|0,c=c+Math.imul(m,K)|0,f=(f=f+Math.imul(m,V)|0)+Math.imul(y,K)|0,d=d+Math.imul(y,V)|0,c=c+Math.imul(h,J)|0,f=(f=f+Math.imul(h,W)|0)+Math.imul(p,J)|0,d=d+Math.imul(p,W)|0;var Ae=(b+(c=c+Math.imul(s,X)|0)|0)+((8191&(f=(f=f+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;b=((d=d+Math.imul(l,ee)|0)+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,c=Math.imul(C,j),f=(f=Math.imul(C,H))+Math.imul(M,j)|0,d=Math.imul(M,H),c=c+Math.imul(_,q)|0,f=(f=f+Math.imul(_,z)|0)+Math.imul(I,q)|0,d=d+Math.imul(I,z)|0,c=c+Math.imul(A,K)|0,f=(f=f+Math.imul(A,V)|0)+Math.imul(v,K)|0,d=d+Math.imul(v,V)|0,c=c+Math.imul(m,J)|0,f=(f=f+Math.imul(m,W)|0)+Math.imul(y,J)|0,d=d+Math.imul(y,W)|0,c=c+Math.imul(h,X)|0,f=(f=f+Math.imul(h,ee)|0)+Math.imul(p,X)|0,d=d+Math.imul(p,ee)|0;var ve=(b+(c=c+Math.imul(s,te)|0)|0)+((8191&(f=(f=f+Math.imul(s,ce)|0)+Math.imul(l,te)|0))<<13)|0;b=((d=d+Math.imul(l,ce)|0)+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,c=Math.imul(k,j),f=(f=Math.imul(k,H))+Math.imul(L,j)|0,d=Math.imul(L,H),c=c+Math.imul(C,q)|0,f=(f=f+Math.imul(C,z)|0)+Math.imul(M,q)|0,d=d+Math.imul(M,z)|0,c=c+Math.imul(_,K)|0,f=(f=f+Math.imul(_,V)|0)+Math.imul(I,K)|0,d=d+Math.imul(I,V)|0,c=c+Math.imul(A,J)|0,f=(f=f+Math.imul(A,W)|0)+Math.imul(v,J)|0,d=d+Math.imul(v,W)|0,c=c+Math.imul(m,X)|0,f=(f=f+Math.imul(m,ee)|0)+Math.imul(y,X)|0,d=d+Math.imul(y,ee)|0,c=c+Math.imul(h,te)|0,f=(f=f+Math.imul(h,ce)|0)+Math.imul(p,te)|0,d=d+Math.imul(p,ce)|0;var we=(b+(c=c+Math.imul(s,de)|0)|0)+((8191&(f=(f=f+Math.imul(s,re)|0)+Math.imul(l,de)|0))<<13)|0;b=((d=d+Math.imul(l,re)|0)+(f>>>13)|0)+(we>>>26)|0,we&=67108863,c=Math.imul(T,j),f=(f=Math.imul(T,H))+Math.imul(N,j)|0,d=Math.imul(N,H),c=c+Math.imul(k,q)|0,f=(f=f+Math.imul(k,z)|0)+Math.imul(L,q)|0,d=d+Math.imul(L,z)|0,c=c+Math.imul(C,K)|0,f=(f=f+Math.imul(C,V)|0)+Math.imul(M,K)|0,d=d+Math.imul(M,V)|0,c=c+Math.imul(_,J)|0,f=(f=f+Math.imul(_,W)|0)+Math.imul(I,J)|0,d=d+Math.imul(I,W)|0,c=c+Math.imul(A,X)|0,f=(f=f+Math.imul(A,ee)|0)+Math.imul(v,X)|0,d=d+Math.imul(v,ee)|0,c=c+Math.imul(m,te)|0,f=(f=f+Math.imul(m,ce)|0)+Math.imul(y,te)|0,d=d+Math.imul(y,ce)|0,c=c+Math.imul(h,de)|0,f=(f=f+Math.imul(h,re)|0)+Math.imul(p,de)|0,d=d+Math.imul(p,re)|0;var _e=(b+(c=c+Math.imul(s,ie)|0)|0)+((8191&(f=(f=f+Math.imul(s,be)|0)+Math.imul(l,ie)|0))<<13)|0;b=((d=d+Math.imul(l,be)|0)+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,c=Math.imul(P,j),f=(f=Math.imul(P,H))+Math.imul(D,j)|0,d=Math.imul(D,H),c=c+Math.imul(T,q)|0,f=(f=f+Math.imul(T,z)|0)+Math.imul(N,q)|0,d=d+Math.imul(N,z)|0,c=c+Math.imul(k,K)|0,f=(f=f+Math.imul(k,V)|0)+Math.imul(L,K)|0,d=d+Math.imul(L,V)|0,c=c+Math.imul(C,J)|0,f=(f=f+Math.imul(C,W)|0)+Math.imul(M,J)|0,d=d+Math.imul(M,W)|0,c=c+Math.imul(_,X)|0,f=(f=f+Math.imul(_,ee)|0)+Math.imul(I,X)|0,d=d+Math.imul(I,ee)|0,c=c+Math.imul(A,te)|0,f=(f=f+Math.imul(A,ce)|0)+Math.imul(v,te)|0,d=d+Math.imul(v,ce)|0,c=c+Math.imul(m,de)|0,f=(f=f+Math.imul(m,re)|0)+Math.imul(y,de)|0,d=d+Math.imul(y,re)|0,c=c+Math.imul(h,ie)|0,f=(f=f+Math.imul(h,be)|0)+Math.imul(p,ie)|0,d=d+Math.imul(p,be)|0;var Ie=(b+(c=c+Math.imul(s,se)|0)|0)+((8191&(f=(f=f+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;b=((d=d+Math.imul(l,le)|0)+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,c=Math.imul(F,j),f=(f=Math.imul(F,H))+Math.imul(Q,j)|0,d=Math.imul(Q,H),c=c+Math.imul(P,q)|0,f=(f=f+Math.imul(P,z)|0)+Math.imul(D,q)|0,d=d+Math.imul(D,z)|0,c=c+Math.imul(T,K)|0,f=(f=f+Math.imul(T,V)|0)+Math.imul(N,K)|0,d=d+Math.imul(N,V)|0,c=c+Math.imul(k,J)|0,f=(f=f+Math.imul(k,W)|0)+Math.imul(L,J)|0,d=d+Math.imul(L,W)|0,c=c+Math.imul(C,X)|0,f=(f=f+Math.imul(C,ee)|0)+Math.imul(M,X)|0,d=d+Math.imul(M,ee)|0,c=c+Math.imul(_,te)|0,f=(f=f+Math.imul(_,ce)|0)+Math.imul(I,te)|0,d=d+Math.imul(I,ce)|0,c=c+Math.imul(A,de)|0,f=(f=f+Math.imul(A,re)|0)+Math.imul(v,de)|0,d=d+Math.imul(v,re)|0,c=c+Math.imul(m,ie)|0,f=(f=f+Math.imul(m,be)|0)+Math.imul(y,ie)|0,d=d+Math.imul(y,be)|0,c=c+Math.imul(h,se)|0,f=(f=f+Math.imul(h,le)|0)+Math.imul(p,se)|0,d=d+Math.imul(p,le)|0;var Ee=(b+(c=c+Math.imul(s,he)|0)|0)+((8191&(f=(f=f+Math.imul(s,pe)|0)+Math.imul(l,he)|0))<<13)|0;b=((d=d+Math.imul(l,pe)|0)+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,c=Math.imul(F,q),f=(f=Math.imul(F,z))+Math.imul(Q,q)|0,d=Math.imul(Q,z),c=c+Math.imul(P,K)|0,f=(f=f+Math.imul(P,V)|0)+Math.imul(D,K)|0,d=d+Math.imul(D,V)|0,c=c+Math.imul(T,J)|0,f=(f=f+Math.imul(T,W)|0)+Math.imul(N,J)|0,d=d+Math.imul(N,W)|0,c=c+Math.imul(k,X)|0,f=(f=f+Math.imul(k,ee)|0)+Math.imul(L,X)|0,d=d+Math.imul(L,ee)|0,c=c+Math.imul(C,te)|0,f=(f=f+Math.imul(C,ce)|0)+Math.imul(M,te)|0,d=d+Math.imul(M,ce)|0,c=c+Math.imul(_,de)|0,f=(f=f+Math.imul(_,re)|0)+Math.imul(I,de)|0,d=d+Math.imul(I,re)|0,c=c+Math.imul(A,ie)|0,f=(f=f+Math.imul(A,be)|0)+Math.imul(v,ie)|0,d=d+Math.imul(v,be)|0,c=c+Math.imul(m,se)|0,f=(f=f+Math.imul(m,le)|0)+Math.imul(y,se)|0,d=d+Math.imul(y,le)|0;var Ce=(b+(c=c+Math.imul(h,he)|0)|0)+((8191&(f=(f=f+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;b=((d=d+Math.imul(p,pe)|0)+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c=Math.imul(F,K),f=(f=Math.imul(F,V))+Math.imul(Q,K)|0,d=Math.imul(Q,V),c=c+Math.imul(P,J)|0,f=(f=f+Math.imul(P,W)|0)+Math.imul(D,J)|0,d=d+Math.imul(D,W)|0,c=c+Math.imul(T,X)|0,f=(f=f+Math.imul(T,ee)|0)+Math.imul(N,X)|0,d=d+Math.imul(N,ee)|0,c=c+Math.imul(k,te)|0,f=(f=f+Math.imul(k,ce)|0)+Math.imul(L,te)|0,d=d+Math.imul(L,ce)|0,c=c+Math.imul(C,de)|0,f=(f=f+Math.imul(C,re)|0)+Math.imul(M,de)|0,d=d+Math.imul(M,re)|0,c=c+Math.imul(_,ie)|0,f=(f=f+Math.imul(_,be)|0)+Math.imul(I,ie)|0,d=d+Math.imul(I,be)|0,c=c+Math.imul(A,se)|0,f=(f=f+Math.imul(A,le)|0)+Math.imul(v,se)|0,d=d+Math.imul(v,le)|0;var Me=(b+(c=c+Math.imul(m,he)|0)|0)+((8191&(f=(f=f+Math.imul(m,pe)|0)+Math.imul(y,he)|0))<<13)|0;b=((d=d+Math.imul(y,pe)|0)+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,c=Math.imul(F,J),f=(f=Math.imul(F,W))+Math.imul(Q,J)|0,d=Math.imul(Q,W),c=c+Math.imul(P,X)|0,f=(f=f+Math.imul(P,ee)|0)+Math.imul(D,X)|0,d=d+Math.imul(D,ee)|0,c=c+Math.imul(T,te)|0,f=(f=f+Math.imul(T,ce)|0)+Math.imul(N,te)|0,d=d+Math.imul(N,ce)|0,c=c+Math.imul(k,de)|0,f=(f=f+Math.imul(k,re)|0)+Math.imul(L,de)|0,d=d+Math.imul(L,re)|0,c=c+Math.imul(C,ie)|0,f=(f=f+Math.imul(C,be)|0)+Math.imul(M,ie)|0,d=d+Math.imul(M,be)|0,c=c+Math.imul(_,se)|0,f=(f=f+Math.imul(_,le)|0)+Math.imul(I,se)|0,d=d+Math.imul(I,le)|0;var Be=(b+(c=c+Math.imul(A,he)|0)|0)+((8191&(f=(f=f+Math.imul(A,pe)|0)+Math.imul(v,he)|0))<<13)|0;b=((d=d+Math.imul(v,pe)|0)+(f>>>13)|0)+(Be>>>26)|0,Be&=67108863,c=Math.imul(F,X),f=(f=Math.imul(F,ee))+Math.imul(Q,X)|0,d=Math.imul(Q,ee),c=c+Math.imul(P,te)|0,f=(f=f+Math.imul(P,ce)|0)+Math.imul(D,te)|0,d=d+Math.imul(D,ce)|0,c=c+Math.imul(T,de)|0,f=(f=f+Math.imul(T,re)|0)+Math.imul(N,de)|0,d=d+Math.imul(N,re)|0,c=c+Math.imul(k,ie)|0,f=(f=f+Math.imul(k,be)|0)+Math.imul(L,ie)|0,d=d+Math.imul(L,be)|0,c=c+Math.imul(C,se)|0,f=(f=f+Math.imul(C,le)|0)+Math.imul(M,se)|0,d=d+Math.imul(M,le)|0;var ke=(b+(c=c+Math.imul(_,he)|0)|0)+((8191&(f=(f=f+Math.imul(_,pe)|0)+Math.imul(I,he)|0))<<13)|0;b=((d=d+Math.imul(I,pe)|0)+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,c=Math.imul(F,te),f=(f=Math.imul(F,ce))+Math.imul(Q,te)|0,d=Math.imul(Q,ce),c=c+Math.imul(P,de)|0,f=(f=f+Math.imul(P,re)|0)+Math.imul(D,de)|0,d=d+Math.imul(D,re)|0,c=c+Math.imul(T,ie)|0,f=(f=f+Math.imul(T,be)|0)+Math.imul(N,ie)|0,d=d+Math.imul(N,be)|0,c=c+Math.imul(k,se)|0,f=(f=f+Math.imul(k,le)|0)+Math.imul(L,se)|0,d=d+Math.imul(L,le)|0;var Le=(b+(c=c+Math.imul(C,he)|0)|0)+((8191&(f=(f=f+Math.imul(C,pe)|0)+Math.imul(M,he)|0))<<13)|0;b=((d=d+Math.imul(M,pe)|0)+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,c=Math.imul(F,de),f=(f=Math.imul(F,re))+Math.imul(Q,de)|0,d=Math.imul(Q,re),c=c+Math.imul(P,ie)|0,f=(f=f+Math.imul(P,be)|0)+Math.imul(D,ie)|0,d=d+Math.imul(D,be)|0,c=c+Math.imul(T,se)|0,f=(f=f+Math.imul(T,le)|0)+Math.imul(N,se)|0,d=d+Math.imul(N,le)|0;var Se=(b+(c=c+Math.imul(k,he)|0)|0)+((8191&(f=(f=f+Math.imul(k,pe)|0)+Math.imul(L,he)|0))<<13)|0;b=((d=d+Math.imul(L,pe)|0)+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,c=Math.imul(F,ie),f=(f=Math.imul(F,be))+Math.imul(Q,ie)|0,d=Math.imul(Q,be),c=c+Math.imul(P,se)|0,f=(f=f+Math.imul(P,le)|0)+Math.imul(D,se)|0,d=d+Math.imul(D,le)|0;var Te=(b+(c=c+Math.imul(T,he)|0)|0)+((8191&(f=(f=f+Math.imul(T,pe)|0)+Math.imul(N,he)|0))<<13)|0;b=((d=d+Math.imul(N,pe)|0)+(f>>>13)|0)+(Te>>>26)|0,Te&=67108863,c=Math.imul(F,se),f=(f=Math.imul(F,le))+Math.imul(Q,se)|0,d=Math.imul(Q,le);var Ne=(b+(c=c+Math.imul(P,he)|0)|0)+((8191&(f=(f=f+Math.imul(P,pe)|0)+Math.imul(D,he)|0))<<13)|0;b=((d=d+Math.imul(D,pe)|0)+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Re=(b+(c=Math.imul(F,he))|0)+((8191&(f=(f=Math.imul(F,pe))+Math.imul(Q,he)|0))<<13)|0;return b=((d=Math.imul(Q,pe))+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,i[0]=ge,i[1]=me,i[2]=ye,i[3]=xe,i[4]=Ae,i[5]=ve,i[6]=we,i[7]=_e,i[8]=Ie,i[9]=Ee,i[10]=Ce,i[11]=Me,i[12]=Be,i[13]=ke,i[14]=Le,i[15]=Se,i[16]=Te,i[17]=Ne,i[18]=Re,0!==b&&(i[19]=b,t.length++),t};function p(e,a,t){return(new g).mulp(e,a,t)}function g(e,a){this.x=e,this.y=a}Math.imul||(h=u),d.prototype.mulTo=function(e,a){var t,c=this.length+e.length;return t=10===this.length&&10===e.length?h(this,e,a):c<63?u(this,e,a):c<1024?function(e,a,t){t.negative=a.negative^e.negative,t.length=e.length+a.length;for(var c=0,f=0,d=0;d>>26)|0)>>>26,r&=67108863}t.words[d]=n,c=r,r=f}return 0!==c?t.words[d]=c:t.length--,t.strip()}(this,e,a):p(this,e,a),t},g.prototype.makeRBT=function(e){for(var a=new Array(e),t=d.prototype._countBits(e)-1,c=0;c>=1;return c},g.prototype.permute=function(e,a,t,c,f,d){for(var r=0;r>>=1)f++;return 1<>>=13,t[2*r+1]=8191&d,d>>>=13;for(r=2*a;r>=26,a+=f/67108864|0,a+=d>>>26,this.words[t]=67108863&d}return 0!==a&&(this.words[t]=a,this.length++),this},d.prototype.muln=function(e){return this.clone().imuln(e)},d.prototype.sqr=function(){return this.mul(this)},d.prototype.isqr=function(){return this.imul(this.clone())},d.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),t=0;t>>f}return a}(e);if(0===a.length)return new d(1);for(var t=this,c=0;c=0);var a,t=e%26,f=(e-t)/26,d=67108863>>>26-t<<26-t;if(0!==t){var r=0;for(a=0;a>>26-t}r&&(this.words[a]=r,this.length++)}if(0!==f){for(a=this.length-1;a>=0;a--)this.words[a+f]=this.words[a];for(a=0;a=0),f=a?(a-a%26)/26:0;var d=e%26,r=Math.min((e-d)/26,this.length),n=67108863^67108863>>>d<r)for(this.length-=r,b=0;b=0&&(0!==o||b>=f);b--){var s=0|this.words[b];this.words[b]=o<<26-d|s>>>d,o=s&n}return i&&0!==o&&(i.words[i.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},d.prototype.ishrn=function(e,a,t){return c(0===this.negative),this.iushrn(e,a,t)},d.prototype.shln=function(e){return this.clone().ishln(e)},d.prototype.ushln=function(e){return this.clone().iushln(e)},d.prototype.shrn=function(e){return this.clone().ishrn(e)},d.prototype.ushrn=function(e){return this.clone().iushrn(e)},d.prototype.testn=function(e){c("number"==typeof e&&e>=0);var a=e%26,t=(e-a)/26,f=1<=0);var a=e%26,t=(e-a)/26;if(c(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==a&&t++,this.length=Math.min(t,this.length),0!==a){var f=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},d.prototype.isubn=function(e){if(c("number"==typeof e),c(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(i/67108864|0),this.words[f+t]=67108863&d}for(;f>26,this.words[f+t]=67108863&d;if(0===n)return this.strip();for(c(-1===n),n=0,f=0;f>26,this.words[f]=67108863&d;return this.negative=1,this.strip()},d.prototype._wordDiv=function(e,a){var t=(this.length,e.length),c=this.clone(),f=e,r=0|f.words[f.length-1];0!=(t=26-this._countBits(r))&&(f=f.ushln(t),c.iushln(t),r=0|f.words[f.length-1]);var n,i=c.length-f.length;if("mod"!==a){(n=new d(null)).length=i+1,n.words=new Array(n.length);for(var b=0;b=0;s--){var l=67108864*(0|c.words[f.length+s])+(0|c.words[f.length+s-1]);for(l=Math.min(l/r|0,67108863),c._ishlnsubmul(f,l,s);0!==c.negative;)l--,c.negative=0,c._ishlnsubmul(f,1,s),c.isZero()||(c.negative^=1);n&&(n.words[s]=l)}return n&&n.strip(),c.strip(),"div"!==a&&0!==t&&c.iushrn(t),{div:n||null,mod:c}},d.prototype.divmod=function(e,a,t){return c(!e.isZero()),this.isZero()?{div:new d(0),mod:new d(0)}:0!==this.negative&&0===e.negative?(n=this.neg().divmod(e,a),"mod"!==a&&(f=n.div.neg()),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.iadd(e)),{div:f,mod:r}):0===this.negative&&0!==e.negative?(n=this.divmod(e.neg(),a),"mod"!==a&&(f=n.div.neg()),{div:f,mod:n.mod}):this.negative&e.negative?(n=this.neg().divmod(e.neg(),a),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.isub(e)),{div:n.div,mod:r}):e.length>this.length||this.cmp(e)<0?{div:new d(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new d(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new d(this.modn(e.words[0]))}:this._wordDiv(e,a);var f,r,n},d.prototype.div=function(e){return this.divmod(e,"div",!1).div},d.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},d.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},d.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var t=0!==a.div.negative?a.mod.isub(e):a.mod,c=e.ushrn(1),f=e.andln(1),d=t.cmp(c);return d<0||1===f&&0===d?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},d.prototype.modn=function(e){c(e<=67108863);for(var a=(1<<26)%e,t=0,f=this.length-1;f>=0;f--)t=(a*t+(0|this.words[f]))%e;return t},d.prototype.idivn=function(e){c(e<=67108863);for(var a=0,t=this.length-1;t>=0;t--){var f=(0|this.words[t])+67108864*a;this.words[t]=f/e|0,a=f%e}return this.strip()},d.prototype.divn=function(e){return this.clone().idivn(e)},d.prototype.egcd=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f=new d(1),r=new d(0),n=new d(0),i=new d(1),b=0;a.isEven()&&t.isEven();)a.iushrn(1),t.iushrn(1),++b;for(var o=t.clone(),s=a.clone();!a.isZero();){for(var l=0,u=1;!(a.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(f.isOdd()||r.isOdd())&&(f.iadd(o),r.isub(s)),f.iushrn(1),r.iushrn(1);for(var h=0,p=1;!(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(o),i.isub(s)),n.iushrn(1),i.iushrn(1);a.cmp(t)>=0?(a.isub(t),f.isub(n),r.isub(i)):(t.isub(a),n.isub(f),i.isub(r))}return{a:n,b:i,gcd:t.iushln(b)}},d.prototype._invmp=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f,r=new d(1),n=new d(0),i=t.clone();a.cmpn(1)>0&&t.cmpn(1)>0;){for(var b=0,o=1;!(a.words[0]&o)&&b<26;++b,o<<=1);if(b>0)for(a.iushrn(b);b-- >0;)r.isOdd()&&r.iadd(i),r.iushrn(1);for(var s=0,l=1;!(t.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(t.iushrn(s);s-- >0;)n.isOdd()&&n.iadd(i),n.iushrn(1);a.cmp(t)>=0?(a.isub(t),r.isub(n)):(t.isub(a),n.isub(r))}return(f=0===a.cmpn(1)?r:n).cmpn(0)<0&&f.iadd(e),f},d.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),t=e.clone();a.negative=0,t.negative=0;for(var c=0;a.isEven()&&t.isEven();c++)a.iushrn(1),t.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;t.isEven();)t.iushrn(1);var f=a.cmp(t);if(f<0){var d=a;a=t,t=d}else if(0===f||0===t.cmpn(1))break;a.isub(t)}return t.iushln(c)},d.prototype.invm=function(e){return this.egcd(e).a.umod(e)},d.prototype.isEven=function(){return!(1&this.words[0])},d.prototype.isOdd=function(){return!(1&~this.words[0])},d.prototype.andln=function(e){return this.words[0]&e},d.prototype.bincn=function(e){c("number"==typeof e);var a=e%26,t=(e-a)/26,f=1<>>26,n&=67108863,this.words[r]=n}return 0!==d&&(this.words[r]=d,this.length++),this},d.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},d.prototype.cmpn=function(e){var a,t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)a=1;else{t&&(e=-e),c(e<=67108863,"Number is too big");var f=0|this.words[0];a=f===e?0:fe.length)return 1;if(this.length=0;t--){var c=0|this.words[t],f=0|e.words[t];if(c!==f){cf&&(a=1);break}}return a},d.prototype.gtn=function(e){return 1===this.cmpn(e)},d.prototype.gt=function(e){return 1===this.cmp(e)},d.prototype.gten=function(e){return this.cmpn(e)>=0},d.prototype.gte=function(e){return this.cmp(e)>=0},d.prototype.ltn=function(e){return-1===this.cmpn(e)},d.prototype.lt=function(e){return-1===this.cmp(e)},d.prototype.lten=function(e){return this.cmpn(e)<=0},d.prototype.lte=function(e){return this.cmp(e)<=0},d.prototype.eqn=function(e){return 0===this.cmpn(e)},d.prototype.eq=function(e){return 0===this.cmp(e)},d.red=function(e){return new _(e)},d.prototype.toRed=function(e){return c(!this.red,"Already a number in reduction context"),c(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},d.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},d.prototype._forceRed=function(e){return this.red=e,this},d.prototype.forceRed=function(e){return c(!this.red,"Already a number in reduction context"),this._forceRed(e)},d.prototype.redAdd=function(e){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},d.prototype.redIAdd=function(e){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},d.prototype.redSub=function(e){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},d.prototype.redISub=function(e){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},d.prototype.redShl=function(e){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},d.prototype.redMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},d.prototype.redIMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},d.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},d.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},d.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},d.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},d.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},d.prototype.redPow=function(e){return c(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function y(e,a){this.name=e,this.p=new d(a,16),this.n=this.p.bitLength(),this.k=new d(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function x(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var a=d._prime(e);this.m=a.p,this.prime=a}else c(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new d(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var e=new d(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var a,t=e;do{this.split(t,this.tmp),a=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(a>this.n);var c=a0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},y.prototype.split=function(e,a){e.iushrn(this.n,0,a)},y.prototype.imulK=function(e){return e.imul(this.k)},f(x,y),x.prototype.split=function(e,a){for(var t=4194303,c=Math.min(e.length,9),f=0;f>>22,d=r}d>>>=22,e.words[f-10]=d,0===d&&e.length>10?e.length-=10:e.length-=9},x.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,t=0;t>>=26,e.words[t]=f,a=c}return 0!==a&&(e.words[e.length++]=a),e},d._prime=function(e){if(m[e])return m[e];var a;if("k256"===e)a=new x;else if("p224"===e)a=new A;else if("p192"===e)a=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new w}return m[e]=a,a},_.prototype._verify1=function(e){c(0===e.negative,"red works only with positives"),c(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,a){c(!(e.negative|a.negative),"red works only with positives"),c(e.red&&e.red===a.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,a){this._verify2(e,a);var t=e.add(a);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},_.prototype.iadd=function(e,a){this._verify2(e,a);var t=e.iadd(a);return t.cmp(this.m)>=0&&t.isub(this.m),t},_.prototype.sub=function(e,a){this._verify2(e,a);var t=e.sub(a);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},_.prototype.isub=function(e,a){this._verify2(e,a);var t=e.isub(a);return t.cmpn(0)<0&&t.iadd(this.m),t},_.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},_.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},_.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(c(a%2==1),3===a){var t=this.m.add(new d(1)).iushrn(2);return this.pow(e,t)}for(var f=this.m.subn(1),r=0;!f.isZero()&&0===f.andln(1);)r++,f.iushrn(1);c(!f.isZero());var n=new d(1).toRed(this),i=n.redNeg(),b=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new d(2*o*o).toRed(this);0!==this.pow(o,b).cmp(i);)o.redIAdd(i);for(var s=this.pow(o,f),l=this.pow(e,f.addn(1).iushrn(1)),u=this.pow(e,f),h=r;0!==u.cmp(n);){for(var p=u,g=0;0!==p.cmp(n);g++)p=p.redSqr();c(g=0;c--){for(var b=a.words[c],o=i-1;o>=0;o--){var s=b>>o&1;f!==t[0]&&(f=this.sqr(f)),0!==s||0!==r?(r<<=1,r|=s,(4==++n||0===c&&0===o)&&(f=this.mul(f,t[r]),n=0,r=0)):n=0}i=26}return f},_.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},_.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},d.mont=function(e){return new I(e)},f(I,_),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},I.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var t=e.imul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),d=f;return f.cmp(this.m)>=0?d=f.isub(this.m):f.cmpn(0)<0&&(d=f.iadd(this.m)),d._forceRed(this)},I.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new d(0)._forceRed(this);var t=e.mul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),r=f;return f.cmp(this.m)>=0?r=f.isub(this.m):f.cmpn(0)<0&&(r=f.iadd(this.m)),r._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=t.nmd(e),this)},86729:(e,a,t)=>{"use strict";var c=a;c.version=t(1636).rE,c.utils=t(47011),c.rand=t(15037),c.curve=t(894),c.curves=t(60480),c.ec=t(57447),c.eddsa=t(8650)},36677:(e,a,t)=>{"use strict";var c=t(28490),f=t(47011),d=f.getNAF,r=f.getJSF,n=f.assert;function i(e,a){this.type=e,this.p=new c(a.p,16),this.red=a.prime?c.red(a.prime):c.mont(this.p),this.zero=new c(0).toRed(this.red),this.one=new c(1).toRed(this.red),this.two=new c(2).toRed(this.red),this.n=a.n&&new c(a.n,16),this.g=a.g&&this.pointFromJSON(a.g,a.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 t=this.n&&this.p.div(this.n);!t||t.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function b(e,a){this.curve=e,this.type=a,this.precomputed=null}e.exports=i,i.prototype.point=function(){throw new Error("Not implemented")},i.prototype.validate=function(){throw new Error("Not implemented")},i.prototype._fixedNafMul=function(e,a){n(e.precomputed);var t=e._getDoubles(),c=d(a,1,this._bitLength),f=(1<=r;o--)i=(i<<1)+c[o];b.push(i)}for(var s=this.jpoint(null,null,null),l=this.jpoint(null,null,null),u=f;u>0;u--){for(r=0;r=0;b--){for(var o=0;b>=0&&0===r[b];b--)o++;if(b>=0&&o++,i=i.dblp(o),b<0)break;var s=r[b];n(0!==s),i="affine"===e.type?s>0?i.mixedAdd(f[s-1>>1]):i.mixedAdd(f[-s-1>>1].neg()):s>0?i.add(f[s-1>>1]):i.add(f[-s-1>>1].neg())}return"affine"===e.type?i.toP():i},i.prototype._wnafMulAdd=function(e,a,t,c,f){var n,i,b,o=this._wnafT1,s=this._wnafT2,l=this._wnafT3,u=0;for(n=0;n=1;n-=2){var p=n-1,g=n;if(1===o[p]&&1===o[g]){var m=[a[p],null,null,a[g]];0===a[p].y.cmp(a[g].y)?(m[1]=a[p].add(a[g]),m[2]=a[p].toJ().mixedAdd(a[g].neg())):0===a[p].y.cmp(a[g].y.redNeg())?(m[1]=a[p].toJ().mixedAdd(a[g]),m[2]=a[p].add(a[g].neg())):(m[1]=a[p].toJ().mixedAdd(a[g]),m[2]=a[p].toJ().mixedAdd(a[g].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],x=r(t[p],t[g]);for(u=Math.max(x[0].length,u),l[p]=new Array(u),l[g]=new Array(u),i=0;i=0;n--){for(var I=0;n>=0;){var E=!0;for(i=0;i=0&&I++,w=w.dblp(I),n<0)break;for(i=0;i0?b=s[i][C-1>>1]:C<0&&(b=s[i][-C-1>>1].neg()),w="affine"===b.type?w.mixedAdd(b):w.add(b))}}for(n=0;n=Math.ceil((e.bitLength()+1)/a.step)},b.prototype._getDoubles=function(e,a){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var t=[this],c=this,f=0;f{"use strict";var c=t(47011),f=t(28490),d=t(56698),r=t(36677),n=c.assert;function i(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,r.call(this,"edwards",e),this.a=new f(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new f(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new f(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),n(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function b(e,a,t,c,d){r.BasePoint.call(this,e,"projective"),null===a&&null===t&&null===c?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new f(a,16),this.y=new f(t,16),this.z=c?new f(c,16):this.curve.one,this.t=d&&new f(d,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}d(i,r),e.exports=i,i.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},i.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},i.prototype.jpoint=function(e,a,t,c){return this.point(e,a,t,c)},i.prototype.pointFromX=function(e,a){(e=new f(e,16)).red||(e=e.toRed(this.red));var t=e.redSqr(),c=this.c2.redSub(this.a.redMul(t)),d=this.one.redSub(this.c2.redMul(this.d).redMul(t)),r=c.redMul(d.redInvm()),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(a&&!i||!a&&i)&&(n=n.redNeg()),this.point(e,n)},i.prototype.pointFromY=function(e,a){(e=new f(e,16)).red||(e=e.toRed(this.red));var t=e.redSqr(),c=t.redSub(this.c2),d=t.redMul(this.d).redMul(this.c2).redSub(this.a),r=c.redMul(d.redInvm());if(0===r.cmp(this.zero)){if(a)throw new Error("invalid point");return this.point(this.zero,e)}var n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");return n.fromRed().isOdd()!==a&&(n=n.redNeg()),this.point(n,e)},i.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var a=e.x.redSqr(),t=e.y.redSqr(),c=a.redMul(this.a).redAdd(t),f=this.c2.redMul(this.one.redAdd(this.d.redMul(a).redMul(t)));return 0===c.cmp(f)},d(b,r.BasePoint),i.prototype.pointFromJSON=function(e){return b.fromJSON(this,e)},i.prototype.point=function(e,a,t,c){return new b(this,e,a,t,c)},b.fromJSON=function(e,a){return new b(e,a[0],a[1],a[2])},b.prototype.inspect=function(){return this.isInfinity()?"":""},b.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},b.prototype._extDbl=function(){var e=this.x.redSqr(),a=this.y.redSqr(),t=this.z.redSqr();t=t.redIAdd(t);var c=this.curve._mulA(e),f=this.x.redAdd(this.y).redSqr().redISub(e).redISub(a),d=c.redAdd(a),r=d.redSub(t),n=c.redSub(a),i=f.redMul(r),b=d.redMul(n),o=f.redMul(n),s=r.redMul(d);return this.curve.point(i,b,s,o)},b.prototype._projDbl=function(){var e,a,t,c,f,d,r=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),i=this.y.redSqr();if(this.curve.twisted){var b=(c=this.curve._mulA(n)).redAdd(i);this.zOne?(e=r.redSub(n).redSub(i).redMul(b.redSub(this.curve.two)),a=b.redMul(c.redSub(i)),t=b.redSqr().redSub(b).redSub(b)):(f=this.z.redSqr(),d=b.redSub(f).redISub(f),e=r.redSub(n).redISub(i).redMul(d),a=b.redMul(c.redSub(i)),t=b.redMul(d))}else c=n.redAdd(i),f=this.curve._mulC(this.z).redSqr(),d=c.redSub(f).redSub(f),e=this.curve._mulC(r.redISub(c)).redMul(d),a=this.curve._mulC(c).redMul(n.redISub(i)),t=c.redMul(d);return this.curve.point(e,a,t)},b.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},b.prototype._extAdd=function(e){var a=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),t=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),c=this.t.redMul(this.curve.dd).redMul(e.t),f=this.z.redMul(e.z.redAdd(e.z)),d=t.redSub(a),r=f.redSub(c),n=f.redAdd(c),i=t.redAdd(a),b=d.redMul(r),o=n.redMul(i),s=d.redMul(i),l=r.redMul(n);return this.curve.point(b,o,l,s)},b.prototype._projAdd=function(e){var a,t,c=this.z.redMul(e.z),f=c.redSqr(),d=this.x.redMul(e.x),r=this.y.redMul(e.y),n=this.curve.d.redMul(d).redMul(r),i=f.redSub(n),b=f.redAdd(n),o=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(d).redISub(r),s=c.redMul(i).redMul(o);return this.curve.twisted?(a=c.redMul(b).redMul(r.redSub(this.curve._mulA(d))),t=i.redMul(b)):(a=c.redMul(b).redMul(r.redSub(d)),t=this.curve._mulC(i).redMul(b)),this.curve.point(s,a,t)},b.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},b.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},b.prototype.mulAdd=function(e,a,t){return this.curve._wnafMulAdd(1,[this,a],[e,t],2,!1)},b.prototype.jmulAdd=function(e,a,t){return this.curve._wnafMulAdd(1,[this,a],[e,t],2,!0)},b.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},b.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},b.prototype.getX=function(){return this.normalize(),this.x.fromRed()},b.prototype.getY=function(){return this.normalize(),this.y.fromRed()},b.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},b.prototype.eqXToP=function(e){var a=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(a))return!0;for(var t=e.clone(),c=this.curve.redN.redMul(this.z);;){if(t.iadd(this.curve.n),t.cmp(this.curve.p)>=0)return!1;if(a.redIAdd(c),0===this.x.cmp(a))return!0}},b.prototype.toP=b.prototype.normalize,b.prototype.mixedAdd=b.prototype.add},894:(e,a,t)=>{"use strict";var c=a;c.base=t(36677),c.short=t(39188),c.mont=t(30370),c.edwards=t(31298)},30370:(e,a,t)=>{"use strict";var c=t(28490),f=t(56698),d=t(36677),r=t(47011);function n(e){d.call(this,"mont",e),this.a=new c(e.a,16).toRed(this.red),this.b=new c(e.b,16).toRed(this.red),this.i4=new c(4).toRed(this.red).redInvm(),this.two=new c(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function i(e,a,t){d.BasePoint.call(this,e,"projective"),null===a&&null===t?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new c(a,16),this.z=new c(t,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}f(n,d),e.exports=n,n.prototype.validate=function(e){var a=e.normalize().x,t=a.redSqr(),c=t.redMul(a).redAdd(t.redMul(this.a)).redAdd(a);return 0===c.redSqrt().redSqr().cmp(c)},f(i,d.BasePoint),n.prototype.decodePoint=function(e,a){return this.point(r.toArray(e,a),1)},n.prototype.point=function(e,a){return new i(this,e,a)},n.prototype.pointFromJSON=function(e){return i.fromJSON(this,e)},i.prototype.precompute=function(){},i.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},i.fromJSON=function(e,a){return new i(e,a[0],a[1]||e.one)},i.prototype.inspect=function(){return this.isInfinity()?"":""},i.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},i.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),a=this.x.redSub(this.z).redSqr(),t=e.redSub(a),c=e.redMul(a),f=t.redMul(a.redAdd(this.curve.a24.redMul(t)));return this.curve.point(c,f)},i.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.diffAdd=function(e,a){var t=this.x.redAdd(this.z),c=this.x.redSub(this.z),f=e.x.redAdd(e.z),d=e.x.redSub(e.z).redMul(t),r=f.redMul(c),n=a.z.redMul(d.redAdd(r).redSqr()),i=a.x.redMul(d.redISub(r).redSqr());return this.curve.point(n,i)},i.prototype.mul=function(e){for(var a=e.clone(),t=this,c=this.curve.point(null,null),f=[];0!==a.cmpn(0);a.iushrn(1))f.push(a.andln(1));for(var d=f.length-1;d>=0;d--)0===f[d]?(t=t.diffAdd(c,this),c=c.dbl()):(c=t.diffAdd(c,this),t=t.dbl());return c},i.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},i.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},i.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},39188:(e,a,t)=>{"use strict";var c=t(47011),f=t(28490),d=t(56698),r=t(36677),n=c.assert;function i(e){r.call(this,"short",e),this.a=new f(e.a,16).toRed(this.red),this.b=new f(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function b(e,a,t,c){r.BasePoint.call(this,e,"affine"),null===a&&null===t?(this.x=null,this.y=null,this.inf=!0):(this.x=new f(a,16),this.y=new f(t,16),c&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function o(e,a,t,c){r.BasePoint.call(this,e,"jacobian"),null===a&&null===t&&null===c?(this.x=this.curve.one,this.y=this.curve.one,this.z=new f(0)):(this.x=new f(a,16),this.y=new f(t,16),this.z=new f(c,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}d(i,r),e.exports=i,i.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var a,t;if(e.beta)a=new f(e.beta,16).toRed(this.red);else{var c=this._getEndoRoots(this.p);a=(a=c[0].cmp(c[1])<0?c[0]:c[1]).toRed(this.red)}if(e.lambda)t=new f(e.lambda,16);else{var d=this._getEndoRoots(this.n);0===this.g.mul(d[0]).x.cmp(this.g.x.redMul(a))?t=d[0]:(t=d[1],n(0===this.g.mul(t).x.cmp(this.g.x.redMul(a))))}return{beta:a,lambda:t,basis:e.basis?e.basis.map((function(e){return{a:new f(e.a,16),b:new f(e.b,16)}})):this._getEndoBasis(t)}}},i.prototype._getEndoRoots=function(e){var a=e===this.p?this.red:f.mont(e),t=new f(2).toRed(a).redInvm(),c=t.redNeg(),d=new f(3).toRed(a).redNeg().redSqrt().redMul(t);return[c.redAdd(d).fromRed(),c.redSub(d).fromRed()]},i.prototype._getEndoBasis=function(e){for(var a,t,c,d,r,n,i,b,o,s=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=e,u=this.n.clone(),h=new f(1),p=new f(0),g=new f(0),m=new f(1),y=0;0!==l.cmpn(0);){var x=u.div(l);b=u.sub(x.mul(l)),o=g.sub(x.mul(h));var A=m.sub(x.mul(p));if(!c&&b.cmp(s)<0)a=i.neg(),t=h,c=b.neg(),d=o;else if(c&&2==++y)break;i=b,u=l,l=b,g=h,h=o,m=p,p=A}r=b.neg(),n=o;var v=c.sqr().add(d.sqr());return r.sqr().add(n.sqr()).cmp(v)>=0&&(r=a,n=t),c.negative&&(c=c.neg(),d=d.neg()),r.negative&&(r=r.neg(),n=n.neg()),[{a:c,b:d},{a:r,b:n}]},i.prototype._endoSplit=function(e){var a=this.endo.basis,t=a[0],c=a[1],f=c.b.mul(e).divRound(this.n),d=t.b.neg().mul(e).divRound(this.n),r=f.mul(t.a),n=d.mul(c.a),i=f.mul(t.b),b=d.mul(c.b);return{k1:e.sub(r).sub(n),k2:i.add(b).neg()}},i.prototype.pointFromX=function(e,a){(e=new f(e,16)).red||(e=e.toRed(this.red));var t=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),c=t.redSqrt();if(0!==c.redSqr().redSub(t).cmp(this.zero))throw new Error("invalid point");var d=c.fromRed().isOdd();return(a&&!d||!a&&d)&&(c=c.redNeg()),this.point(e,c)},i.prototype.validate=function(e){if(e.inf)return!0;var a=e.x,t=e.y,c=this.a.redMul(a),f=a.redSqr().redMul(a).redIAdd(c).redIAdd(this.b);return 0===t.redSqr().redISub(f).cmpn(0)},i.prototype._endoWnafMulAdd=function(e,a,t){for(var c=this._endoWnafT1,f=this._endoWnafT2,d=0;d":""},b.prototype.isInfinity=function(){return this.inf},b.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var a=this.y.redSub(e.y);0!==a.cmpn(0)&&(a=a.redMul(this.x.redSub(e.x).redInvm()));var t=a.redSqr().redISub(this.x).redISub(e.x),c=a.redMul(this.x.redSub(t)).redISub(this.y);return this.curve.point(t,c)},b.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var a=this.curve.a,t=this.x.redSqr(),c=e.redInvm(),f=t.redAdd(t).redIAdd(t).redIAdd(a).redMul(c),d=f.redSqr().redISub(this.x.redAdd(this.x)),r=f.redMul(this.x.redSub(d)).redISub(this.y);return this.curve.point(d,r)},b.prototype.getX=function(){return this.x.fromRed()},b.prototype.getY=function(){return this.y.fromRed()},b.prototype.mul=function(e){return e=new f(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},b.prototype.mulAdd=function(e,a,t){var c=[this,a],f=[e,t];return this.curve.endo?this.curve._endoWnafMulAdd(c,f):this.curve._wnafMulAdd(1,c,f,2)},b.prototype.jmulAdd=function(e,a,t){var c=[this,a],f=[e,t];return this.curve.endo?this.curve._endoWnafMulAdd(c,f,!0):this.curve._wnafMulAdd(1,c,f,2,!0)},b.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},b.prototype.neg=function(e){if(this.inf)return this;var a=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var t=this.precomputed,c=function(e){return e.neg()};a.precomputed={naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(c)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(c)}}}return a},b.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},d(o,r.BasePoint),i.prototype.jpoint=function(e,a,t){return new o(this,e,a,t)},o.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),a=e.redSqr(),t=this.x.redMul(a),c=this.y.redMul(a).redMul(e);return this.curve.point(t,c)},o.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},o.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var a=e.z.redSqr(),t=this.z.redSqr(),c=this.x.redMul(a),f=e.x.redMul(t),d=this.y.redMul(a.redMul(e.z)),r=e.y.redMul(t.redMul(this.z)),n=c.redSub(f),i=d.redSub(r);if(0===n.cmpn(0))return 0!==i.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var b=n.redSqr(),o=b.redMul(n),s=c.redMul(b),l=i.redSqr().redIAdd(o).redISub(s).redISub(s),u=i.redMul(s.redISub(l)).redISub(d.redMul(o)),h=this.z.redMul(e.z).redMul(n);return this.curve.jpoint(l,u,h)},o.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var a=this.z.redSqr(),t=this.x,c=e.x.redMul(a),f=this.y,d=e.y.redMul(a).redMul(this.z),r=t.redSub(c),n=f.redSub(d);if(0===r.cmpn(0))return 0!==n.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var i=r.redSqr(),b=i.redMul(r),o=t.redMul(i),s=n.redSqr().redIAdd(b).redISub(o).redISub(o),l=n.redMul(o.redISub(s)).redISub(f.redMul(b)),u=this.z.redMul(r);return this.curve.jpoint(s,l,u)},o.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var a;if(this.curve.zeroA||this.curve.threeA){var t=this;for(a=0;a=0)return!1;if(t.redIAdd(f),0===this.x.cmp(t))return!0}},o.prototype.inspect=function(){return this.isInfinity()?"":""},o.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},60480:(e,a,t)=>{"use strict";var c,f=a,d=t(77952),r=t(894),n=t(47011).assert;function i(e){"short"===e.type?this.curve=new r.short(e):"edwards"===e.type?this.curve=new r.edwards(e):this.curve=new r.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function b(e,a){Object.defineProperty(f,e,{configurable:!0,enumerable:!0,get:function(){var t=new i(a);return Object.defineProperty(f,e,{configurable:!0,enumerable:!0,value:t}),t}})}f.PresetCurve=i,b("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:d.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),b("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:d.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),b("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:d.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),b("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:d.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"]}),b("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:d.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"]}),b("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:d.sha256,gRed:!1,g:["9"]}),b("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:d.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{c=t(74011)}catch(e){c=void 0}b("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:d.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})},57447:(e,a,t)=>{"use strict";var c=t(28490),f=t(32723),d=t(47011),r=t(60480),n=t(15037),i=d.assert,b=t(61200),o=t(28545);function s(e){if(!(this instanceof s))return new s(e);"string"==typeof e&&(i(Object.prototype.hasOwnProperty.call(r,e),"Unknown curve "+e),e=r[e]),e instanceof r.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=s,s.prototype.keyPair=function(e){return new b(this,e)},s.prototype.keyFromPrivate=function(e,a){return b.fromPrivate(this,e,a)},s.prototype.keyFromPublic=function(e,a){return b.fromPublic(this,e,a)},s.prototype.genKeyPair=function(e){e||(e={});for(var a=new f({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||n(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),t=this.n.byteLength(),d=this.n.sub(new c(2));;){var r=new c(a.generate(t));if(!(r.cmp(d)>0))return r.iaddn(1),this.keyFromPrivate(r)}},s.prototype._truncateToN=function(e,a){var t=8*e.byteLength()-this.n.bitLength();return t>0&&(e=e.ushrn(t)),!a&&e.cmp(this.n)>=0?e.sub(this.n):e},s.prototype.sign=function(e,a,t,d){"object"==typeof t&&(d=t,t=null),d||(d={}),a=this.keyFromPrivate(a,t),e=this._truncateToN(new c(e,16));for(var r=this.n.byteLength(),n=a.getPrivate().toArray("be",r),i=e.toArray("be",r),b=new f({hash:this.hash,entropy:n,nonce:i,pers:d.pers,persEnc:d.persEnc||"utf8"}),s=this.n.sub(new c(1)),l=0;;l++){var u=d.k?d.k(l):new c(b.generate(this.n.byteLength()));if(!((u=this._truncateToN(u,!0)).cmpn(1)<=0||u.cmp(s)>=0)){var h=this.g.mul(u);if(!h.isInfinity()){var p=h.getX(),g=p.umod(this.n);if(0!==g.cmpn(0)){var m=u.invm(this.n).mul(g.mul(a.getPrivate()).iadd(e));if(0!==(m=m.umod(this.n)).cmpn(0)){var y=(h.getY().isOdd()?1:0)|(0!==p.cmp(g)?2:0);return d.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),y^=1),new o({r:g,s:m,recoveryParam:y})}}}}}},s.prototype.verify=function(e,a,t,f){e=this._truncateToN(new c(e,16)),t=this.keyFromPublic(t,f);var d=(a=new o(a,"hex")).r,r=a.s;if(d.cmpn(1)<0||d.cmp(this.n)>=0)return!1;if(r.cmpn(1)<0||r.cmp(this.n)>=0)return!1;var n,i=r.invm(this.n),b=i.mul(e).umod(this.n),s=i.mul(d).umod(this.n);return this.curve._maxwellTrick?!(n=this.g.jmulAdd(b,t.getPublic(),s)).isInfinity()&&n.eqXToP(d):!(n=this.g.mulAdd(b,t.getPublic(),s)).isInfinity()&&0===n.getX().umod(this.n).cmp(d)},s.prototype.recoverPubKey=function(e,a,t,f){i((3&t)===t,"The recovery param is more than two bits"),a=new o(a,f);var d=this.n,r=new c(e),n=a.r,b=a.s,s=1&t,l=t>>1;if(n.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");n=l?this.curve.pointFromX(n.add(this.curve.n),s):this.curve.pointFromX(n,s);var u=a.r.invm(d),h=d.sub(r).mul(u).umod(d),p=b.mul(u).umod(d);return this.g.mulAdd(h,n,p)},s.prototype.getKeyRecoveryParam=function(e,a,t,c){if(null!==(a=new o(a,c)).recoveryParam)return a.recoveryParam;for(var f=0;f<4;f++){var d;try{d=this.recoverPubKey(e,a,f)}catch(e){continue}if(d.eq(t))return f}throw new Error("Unable to find valid recovery factor")}},61200:(e,a,t)=>{"use strict";var c=t(28490),f=t(47011).assert;function d(e,a){this.ec=e,this.priv=null,this.pub=null,a.priv&&this._importPrivate(a.priv,a.privEnc),a.pub&&this._importPublic(a.pub,a.pubEnc)}e.exports=d,d.fromPublic=function(e,a,t){return a instanceof d?a:new d(e,{pub:a,pubEnc:t})},d.fromPrivate=function(e,a,t){return a instanceof d?a:new d(e,{priv:a,privEnc:t})},d.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},d.prototype.getPublic=function(e,a){return"string"==typeof e&&(a=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),a?this.pub.encode(a,e):this.pub},d.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},d.prototype._importPrivate=function(e,a){this.priv=new c(e,a||16),this.priv=this.priv.umod(this.ec.curve.n)},d.prototype._importPublic=function(e,a){if(e.x||e.y)return"mont"===this.ec.curve.type?f(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||f(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,a)},d.prototype.derive=function(e){return e.validate()||f(e.validate(),"public point not validated"),e.mul(this.priv).getX()},d.prototype.sign=function(e,a,t){return this.ec.sign(e,this,a,t)},d.prototype.verify=function(e,a){return this.ec.verify(e,a,this)},d.prototype.inspect=function(){return""}},28545:(e,a,t)=>{"use strict";var c=t(28490),f=t(47011),d=f.assert;function r(e,a){if(e instanceof r)return e;this._importDER(e,a)||(d(e.r&&e.s,"Signature without r or s"),this.r=new c(e.r,16),this.s=new c(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function n(){this.place=0}function i(e,a){var t=e[a.place++];if(!(128&t))return t;var c=15&t;if(0===c||c>4)return!1;if(0===e[a.place])return!1;for(var f=0,d=0,r=a.place;d>>=0;return!(f<=127)&&(a.place=r,f)}function b(e){for(var a=0,t=e.length-1;!e[a]&&!(128&e[a+1])&&a>>3);for(e.push(128|t);--t;)e.push(a>>>(t<<3)&255);e.push(a)}}e.exports=r,r.prototype._importDER=function(e,a){e=f.toArray(e,a);var t=new n;if(48!==e[t.place++])return!1;var d=i(e,t);if(!1===d)return!1;if(d+t.place!==e.length)return!1;if(2!==e[t.place++])return!1;var r=i(e,t);if(!1===r)return!1;if(128&e[t.place])return!1;var b=e.slice(t.place,r+t.place);if(t.place+=r,2!==e[t.place++])return!1;var o=i(e,t);if(!1===o)return!1;if(e.length!==o+t.place)return!1;if(128&e[t.place])return!1;var s=e.slice(t.place,o+t.place);if(0===b[0]){if(!(128&b[1]))return!1;b=b.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new c(b),this.s=new c(s),this.recoveryParam=null,!0},r.prototype.toDER=function(e){var a=this.r.toArray(),t=this.s.toArray();for(128&a[0]&&(a=[0].concat(a)),128&t[0]&&(t=[0].concat(t)),a=b(a),t=b(t);!(t[0]||128&t[1]);)t=t.slice(1);var c=[2];o(c,a.length),(c=c.concat(a)).push(2),o(c,t.length);var d=c.concat(t),r=[48];return o(r,d.length),r=r.concat(d),f.encode(r,e)}},8650:(e,a,t)=>{"use strict";var c=t(77952),f=t(60480),d=t(47011),r=d.assert,n=d.parseBytes,i=t(46661),b=t(90220);function o(e){if(r("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof o))return new o(e);e=f[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=c.sha512}e.exports=o,o.prototype.sign=function(e,a){e=n(e);var t=this.keyFromSecret(a),c=this.hashInt(t.messagePrefix(),e),f=this.g.mul(c),d=this.encodePoint(f),r=this.hashInt(d,t.pubBytes(),e).mul(t.priv()),i=c.add(r).umod(this.curve.n);return this.makeSignature({R:f,S:i,Rencoded:d})},o.prototype.verify=function(e,a,t){if(e=n(e),(a=this.makeSignature(a)).S().gte(a.eddsa.curve.n)||a.S().isNeg())return!1;var c=this.keyFromPublic(t),f=this.hashInt(a.Rencoded(),c.pubBytes(),e),d=this.g.mul(a.S());return a.R().add(c.pub().mul(f)).eq(d)},o.prototype.hashInt=function(){for(var e=this.hash(),a=0;a{"use strict";var c=t(47011),f=c.assert,d=c.parseBytes,r=c.cachedProperty;function n(e,a){this.eddsa=e,this._secret=d(a.secret),e.isPoint(a.pub)?this._pub=a.pub:this._pubBytes=d(a.pub)}n.fromPublic=function(e,a){return a instanceof n?a:new n(e,{pub:a})},n.fromSecret=function(e,a){return a instanceof n?a:new n(e,{secret:a})},n.prototype.secret=function(){return this._secret},r(n,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),r(n,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),r(n,"privBytes",(function(){var e=this.eddsa,a=this.hash(),t=e.encodingLength-1,c=a.slice(0,e.encodingLength);return c[0]&=248,c[t]&=127,c[t]|=64,c})),r(n,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),r(n,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),r(n,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),n.prototype.sign=function(e){return f(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},n.prototype.verify=function(e,a){return this.eddsa.verify(e,a,this)},n.prototype.getSecret=function(e){return f(this._secret,"KeyPair is public only"),c.encode(this.secret(),e)},n.prototype.getPublic=function(e){return c.encode(this.pubBytes(),e)},e.exports=n},90220:(e,a,t)=>{"use strict";var c=t(28490),f=t(47011),d=f.assert,r=f.cachedProperty,n=f.parseBytes;function i(e,a){this.eddsa=e,"object"!=typeof a&&(a=n(a)),Array.isArray(a)&&(d(a.length===2*e.encodingLength,"Signature has invalid size"),a={R:a.slice(0,e.encodingLength),S:a.slice(e.encodingLength)}),d(a.R&&a.S,"Signature without R or S"),e.isPoint(a.R)&&(this._R=a.R),a.S instanceof c&&(this._S=a.S),this._Rencoded=Array.isArray(a.R)?a.R:a.Rencoded,this._Sencoded=Array.isArray(a.S)?a.S:a.Sencoded}r(i,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),r(i,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),r(i,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),r(i,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),i.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},i.prototype.toHex=function(){return f.encode(this.toBytes(),"hex").toUpperCase()},e.exports=i},74011:e=>{e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},47011:(e,a,t)=>{"use strict";var c=a,f=t(28490),d=t(43349),r=t(64367);c.assert=d,c.toArray=r.toArray,c.zero2=r.zero2,c.toHex=r.toHex,c.encode=r.encode,c.getNAF=function(e,a,t){var c,f=new Array(Math.max(e.bitLength(),t)+1);for(c=0;c(d>>1)-1?(d>>1)-i:i,r.isubn(n)):n=0,f[c]=n,r.iushrn(1)}return f},c.getJSF=function(e,a){var t=[[],[]];e=e.clone(),a=a.clone();for(var c,f=0,d=0;e.cmpn(-f)>0||a.cmpn(-d)>0;){var r,n,i=e.andln(3)+f&3,b=a.andln(3)+d&3;3===i&&(i=-1),3===b&&(b=-1),r=1&i?3!=(c=e.andln(7)+f&7)&&5!==c||2!==b?i:-i:0,t[0].push(r),n=1&b?3!=(c=a.andln(7)+d&7)&&5!==c||2!==i?b:-b:0,t[1].push(n),2*f===r+1&&(f=1-f),2*d===n+1&&(d=1-d),e.iushrn(1),a.iushrn(1)}return t},c.cachedProperty=function(e,a,t){var c="_"+a;e.prototype[a]=function(){return void 0!==this[c]?this[c]:this[c]=t.call(this)}},c.parseBytes=function(e){return"string"==typeof e?c.toArray(e,"hex"):e},c.intFromLE=function(e){return new f(e,"hex","le")}},28490:function(e,a,t){!function(e,a){"use strict";function c(e,a){if(!e)throw new Error(a||"Assertion failed")}function f(e,a){e.super_=a;var t=function(){};t.prototype=a.prototype,e.prototype=new t,e.prototype.constructor=e}function d(e,a,t){if(d.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==a&&"be"!==a||(t=a,a=10),this._init(e||0,a||10,t||"be"))}var r;"object"==typeof e?e.exports=d:a.BN=d,d.BN=d,d.wordSize=26;try{r="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:t(79368).Buffer}catch(e){}function n(e,a){var t=e.charCodeAt(a);return t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:t-48&15}function i(e,a,t){var c=n(e,t);return t-1>=a&&(c|=n(e,t-1)<<4),c}function b(e,a,t,c){for(var f=0,d=Math.min(e.length,t),r=a;r=49?n-49+10:n>=17?n-17+10:n}return f}d.isBN=function(e){return e instanceof d||null!==e&&"object"==typeof e&&e.constructor.wordSize===d.wordSize&&Array.isArray(e.words)},d.max=function(e,a){return e.cmp(a)>0?e:a},d.min=function(e,a){return e.cmp(a)<0?e:a},d.prototype._init=function(e,a,t){if("number"==typeof e)return this._initNumber(e,a,t);if("object"==typeof e)return this._initArray(e,a,t);"hex"===a&&(a=16),c(a===(0|a)&&a>=2&&a<=36);var f=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(f++,this.negative=1),f=0;f-=3)r=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[d]|=r<>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);else if("le"===t)for(f=0,d=0;f>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);return this.strip()},d.prototype._parseHex=function(e,a,t){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)f=i(e,a,c)<=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;else for(c=(e.length-a)%2==0?a+1:a;c=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;this.strip()},d.prototype._parseBase=function(e,a,t){this.words=[0],this.length=1;for(var c=0,f=1;f<=67108863;f*=a)c++;c--,f=f/a|0;for(var d=e.length-t,r=d%c,n=Math.min(d,d-r)+t,i=0,o=t;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},d.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},d.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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],l=[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 u(e,a,t){t.negative=a.negative^e.negative;var c=e.length+a.length|0;t.length=c,c=c-1|0;var f=0|e.words[0],d=0|a.words[0],r=f*d,n=67108863&r,i=r/67108864|0;t.words[0]=n;for(var b=1;b>>26,s=67108863&i,l=Math.min(b,a.length-1),u=Math.max(0,b-e.length+1);u<=l;u++){var h=b-u|0;o+=(r=(f=0|e.words[h])*(d=0|a.words[u])+s)/67108864|0,s=67108863&r}t.words[b]=0|s,i=0|o}return 0!==i?t.words[b]=0|i:t.length--,t.strip()}d.prototype.toString=function(e,a){var t;if(a=0|a||1,16===(e=e||10)||"hex"===e){t="";for(var f=0,d=0,r=0;r>>24-f&16777215)||r!==this.length-1?o[6-i.length]+i+t:i+t,(f+=2)>=26&&(f-=26,r--)}for(0!==d&&(t=d.toString(16)+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(e===(0|e)&&e>=2&&e<=36){var b=s[e],u=l[e];t="";var h=this.clone();for(h.negative=0;!h.isZero();){var p=h.modn(u).toString(e);t=(h=h.idivn(u)).isZero()?p+t:o[b-p.length]+p+t}for(this.isZero()&&(t="0"+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}c(!1,"Base should be between 2 and 36")},d.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&c(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},d.prototype.toJSON=function(){return this.toString(16)},d.prototype.toBuffer=function(e,a){return c(void 0!==r),this.toArrayLike(r,e,a)},d.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},d.prototype.toArrayLike=function(e,a,t){var f=this.byteLength(),d=t||Math.max(1,f);c(f<=d,"byte array longer than desired length"),c(d>0,"Requested array length <= 0"),this.strip();var r,n,i="le"===a,b=new e(d),o=this.clone();if(i){for(n=0;!o.isZero();n++)r=o.andln(255),o.iushrn(8),b[n]=r;for(;n=4096&&(t+=13,a>>>=13),a>=64&&(t+=7,a>>>=7),a>=8&&(t+=4,a>>>=4),a>=2&&(t+=2,a>>>=2),t+a},d.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,t=0;return 8191&a||(t+=13,a>>>=13),127&a||(t+=7,a>>>=7),15&a||(t+=4,a>>>=4),3&a||(t+=2,a>>>=2),1&a||t++,t},d.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},d.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},d.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},d.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var t=0;te.length?this.clone().iand(e):e.clone().iand(this)},d.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},d.prototype.iuxor=function(e){var a,t;this.length>e.length?(a=this,t=e):(a=e,t=this);for(var c=0;ce.length?this.clone().ixor(e):e.clone().ixor(this)},d.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},d.prototype.inotn=function(e){c("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),t=e%26;this._expand(a),t>0&&a--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-t),this.strip()},d.prototype.notn=function(e){return this.clone().inotn(e)},d.prototype.setn=function(e,a){c("number"==typeof e&&e>=0);var t=e/26|0,f=e%26;return this._expand(t+1),this.words[t]=a?this.words[t]|1<e.length?(t=this,c=e):(t=e,c=this);for(var f=0,d=0;d>>26;for(;0!==f&&d>>26;if(this.length=t.length,0!==f)this.words[this.length]=f,this.length++;else if(t!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},d.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var t,c,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(t=this,c=e):(t=e,c=this);for(var d=0,r=0;r>26,this.words[r]=67108863&a;for(;0!==d&&r>26,this.words[r]=67108863&a;if(0===d&&r>>13,u=0|r[1],h=8191&u,p=u>>>13,g=0|r[2],m=8191&g,y=g>>>13,x=0|r[3],A=8191&x,v=x>>>13,w=0|r[4],_=8191&w,I=w>>>13,E=0|r[5],C=8191&E,M=E>>>13,B=0|r[6],k=8191&B,L=B>>>13,S=0|r[7],T=8191&S,N=S>>>13,R=0|r[8],P=8191&R,D=R>>>13,O=0|r[9],F=8191&O,Q=O>>>13,U=0|n[0],j=8191&U,H=U>>>13,$=0|n[1],q=8191&$,z=$>>>13,G=0|n[2],K=8191&G,V=G>>>13,Z=0|n[3],J=8191&Z,W=Z>>>13,Y=0|n[4],X=8191&Y,ee=Y>>>13,ae=0|n[5],te=8191&ae,ce=ae>>>13,fe=0|n[6],de=8191&fe,re=fe>>>13,ne=0|n[7],ie=8191&ne,be=ne>>>13,oe=0|n[8],se=8191&oe,le=oe>>>13,ue=0|n[9],he=8191&ue,pe=ue>>>13;t.negative=e.negative^a.negative,t.length=19;var ge=(b+(c=Math.imul(s,j))|0)+((8191&(f=(f=Math.imul(s,H))+Math.imul(l,j)|0))<<13)|0;b=((d=Math.imul(l,H))+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,c=Math.imul(h,j),f=(f=Math.imul(h,H))+Math.imul(p,j)|0,d=Math.imul(p,H);var me=(b+(c=c+Math.imul(s,q)|0)|0)+((8191&(f=(f=f+Math.imul(s,z)|0)+Math.imul(l,q)|0))<<13)|0;b=((d=d+Math.imul(l,z)|0)+(f>>>13)|0)+(me>>>26)|0,me&=67108863,c=Math.imul(m,j),f=(f=Math.imul(m,H))+Math.imul(y,j)|0,d=Math.imul(y,H),c=c+Math.imul(h,q)|0,f=(f=f+Math.imul(h,z)|0)+Math.imul(p,q)|0,d=d+Math.imul(p,z)|0;var ye=(b+(c=c+Math.imul(s,K)|0)|0)+((8191&(f=(f=f+Math.imul(s,V)|0)+Math.imul(l,K)|0))<<13)|0;b=((d=d+Math.imul(l,V)|0)+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,c=Math.imul(A,j),f=(f=Math.imul(A,H))+Math.imul(v,j)|0,d=Math.imul(v,H),c=c+Math.imul(m,q)|0,f=(f=f+Math.imul(m,z)|0)+Math.imul(y,q)|0,d=d+Math.imul(y,z)|0,c=c+Math.imul(h,K)|0,f=(f=f+Math.imul(h,V)|0)+Math.imul(p,K)|0,d=d+Math.imul(p,V)|0;var xe=(b+(c=c+Math.imul(s,J)|0)|0)+((8191&(f=(f=f+Math.imul(s,W)|0)+Math.imul(l,J)|0))<<13)|0;b=((d=d+Math.imul(l,W)|0)+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,c=Math.imul(_,j),f=(f=Math.imul(_,H))+Math.imul(I,j)|0,d=Math.imul(I,H),c=c+Math.imul(A,q)|0,f=(f=f+Math.imul(A,z)|0)+Math.imul(v,q)|0,d=d+Math.imul(v,z)|0,c=c+Math.imul(m,K)|0,f=(f=f+Math.imul(m,V)|0)+Math.imul(y,K)|0,d=d+Math.imul(y,V)|0,c=c+Math.imul(h,J)|0,f=(f=f+Math.imul(h,W)|0)+Math.imul(p,J)|0,d=d+Math.imul(p,W)|0;var Ae=(b+(c=c+Math.imul(s,X)|0)|0)+((8191&(f=(f=f+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;b=((d=d+Math.imul(l,ee)|0)+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,c=Math.imul(C,j),f=(f=Math.imul(C,H))+Math.imul(M,j)|0,d=Math.imul(M,H),c=c+Math.imul(_,q)|0,f=(f=f+Math.imul(_,z)|0)+Math.imul(I,q)|0,d=d+Math.imul(I,z)|0,c=c+Math.imul(A,K)|0,f=(f=f+Math.imul(A,V)|0)+Math.imul(v,K)|0,d=d+Math.imul(v,V)|0,c=c+Math.imul(m,J)|0,f=(f=f+Math.imul(m,W)|0)+Math.imul(y,J)|0,d=d+Math.imul(y,W)|0,c=c+Math.imul(h,X)|0,f=(f=f+Math.imul(h,ee)|0)+Math.imul(p,X)|0,d=d+Math.imul(p,ee)|0;var ve=(b+(c=c+Math.imul(s,te)|0)|0)+((8191&(f=(f=f+Math.imul(s,ce)|0)+Math.imul(l,te)|0))<<13)|0;b=((d=d+Math.imul(l,ce)|0)+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,c=Math.imul(k,j),f=(f=Math.imul(k,H))+Math.imul(L,j)|0,d=Math.imul(L,H),c=c+Math.imul(C,q)|0,f=(f=f+Math.imul(C,z)|0)+Math.imul(M,q)|0,d=d+Math.imul(M,z)|0,c=c+Math.imul(_,K)|0,f=(f=f+Math.imul(_,V)|0)+Math.imul(I,K)|0,d=d+Math.imul(I,V)|0,c=c+Math.imul(A,J)|0,f=(f=f+Math.imul(A,W)|0)+Math.imul(v,J)|0,d=d+Math.imul(v,W)|0,c=c+Math.imul(m,X)|0,f=(f=f+Math.imul(m,ee)|0)+Math.imul(y,X)|0,d=d+Math.imul(y,ee)|0,c=c+Math.imul(h,te)|0,f=(f=f+Math.imul(h,ce)|0)+Math.imul(p,te)|0,d=d+Math.imul(p,ce)|0;var we=(b+(c=c+Math.imul(s,de)|0)|0)+((8191&(f=(f=f+Math.imul(s,re)|0)+Math.imul(l,de)|0))<<13)|0;b=((d=d+Math.imul(l,re)|0)+(f>>>13)|0)+(we>>>26)|0,we&=67108863,c=Math.imul(T,j),f=(f=Math.imul(T,H))+Math.imul(N,j)|0,d=Math.imul(N,H),c=c+Math.imul(k,q)|0,f=(f=f+Math.imul(k,z)|0)+Math.imul(L,q)|0,d=d+Math.imul(L,z)|0,c=c+Math.imul(C,K)|0,f=(f=f+Math.imul(C,V)|0)+Math.imul(M,K)|0,d=d+Math.imul(M,V)|0,c=c+Math.imul(_,J)|0,f=(f=f+Math.imul(_,W)|0)+Math.imul(I,J)|0,d=d+Math.imul(I,W)|0,c=c+Math.imul(A,X)|0,f=(f=f+Math.imul(A,ee)|0)+Math.imul(v,X)|0,d=d+Math.imul(v,ee)|0,c=c+Math.imul(m,te)|0,f=(f=f+Math.imul(m,ce)|0)+Math.imul(y,te)|0,d=d+Math.imul(y,ce)|0,c=c+Math.imul(h,de)|0,f=(f=f+Math.imul(h,re)|0)+Math.imul(p,de)|0,d=d+Math.imul(p,re)|0;var _e=(b+(c=c+Math.imul(s,ie)|0)|0)+((8191&(f=(f=f+Math.imul(s,be)|0)+Math.imul(l,ie)|0))<<13)|0;b=((d=d+Math.imul(l,be)|0)+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,c=Math.imul(P,j),f=(f=Math.imul(P,H))+Math.imul(D,j)|0,d=Math.imul(D,H),c=c+Math.imul(T,q)|0,f=(f=f+Math.imul(T,z)|0)+Math.imul(N,q)|0,d=d+Math.imul(N,z)|0,c=c+Math.imul(k,K)|0,f=(f=f+Math.imul(k,V)|0)+Math.imul(L,K)|0,d=d+Math.imul(L,V)|0,c=c+Math.imul(C,J)|0,f=(f=f+Math.imul(C,W)|0)+Math.imul(M,J)|0,d=d+Math.imul(M,W)|0,c=c+Math.imul(_,X)|0,f=(f=f+Math.imul(_,ee)|0)+Math.imul(I,X)|0,d=d+Math.imul(I,ee)|0,c=c+Math.imul(A,te)|0,f=(f=f+Math.imul(A,ce)|0)+Math.imul(v,te)|0,d=d+Math.imul(v,ce)|0,c=c+Math.imul(m,de)|0,f=(f=f+Math.imul(m,re)|0)+Math.imul(y,de)|0,d=d+Math.imul(y,re)|0,c=c+Math.imul(h,ie)|0,f=(f=f+Math.imul(h,be)|0)+Math.imul(p,ie)|0,d=d+Math.imul(p,be)|0;var Ie=(b+(c=c+Math.imul(s,se)|0)|0)+((8191&(f=(f=f+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;b=((d=d+Math.imul(l,le)|0)+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,c=Math.imul(F,j),f=(f=Math.imul(F,H))+Math.imul(Q,j)|0,d=Math.imul(Q,H),c=c+Math.imul(P,q)|0,f=(f=f+Math.imul(P,z)|0)+Math.imul(D,q)|0,d=d+Math.imul(D,z)|0,c=c+Math.imul(T,K)|0,f=(f=f+Math.imul(T,V)|0)+Math.imul(N,K)|0,d=d+Math.imul(N,V)|0,c=c+Math.imul(k,J)|0,f=(f=f+Math.imul(k,W)|0)+Math.imul(L,J)|0,d=d+Math.imul(L,W)|0,c=c+Math.imul(C,X)|0,f=(f=f+Math.imul(C,ee)|0)+Math.imul(M,X)|0,d=d+Math.imul(M,ee)|0,c=c+Math.imul(_,te)|0,f=(f=f+Math.imul(_,ce)|0)+Math.imul(I,te)|0,d=d+Math.imul(I,ce)|0,c=c+Math.imul(A,de)|0,f=(f=f+Math.imul(A,re)|0)+Math.imul(v,de)|0,d=d+Math.imul(v,re)|0,c=c+Math.imul(m,ie)|0,f=(f=f+Math.imul(m,be)|0)+Math.imul(y,ie)|0,d=d+Math.imul(y,be)|0,c=c+Math.imul(h,se)|0,f=(f=f+Math.imul(h,le)|0)+Math.imul(p,se)|0,d=d+Math.imul(p,le)|0;var Ee=(b+(c=c+Math.imul(s,he)|0)|0)+((8191&(f=(f=f+Math.imul(s,pe)|0)+Math.imul(l,he)|0))<<13)|0;b=((d=d+Math.imul(l,pe)|0)+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,c=Math.imul(F,q),f=(f=Math.imul(F,z))+Math.imul(Q,q)|0,d=Math.imul(Q,z),c=c+Math.imul(P,K)|0,f=(f=f+Math.imul(P,V)|0)+Math.imul(D,K)|0,d=d+Math.imul(D,V)|0,c=c+Math.imul(T,J)|0,f=(f=f+Math.imul(T,W)|0)+Math.imul(N,J)|0,d=d+Math.imul(N,W)|0,c=c+Math.imul(k,X)|0,f=(f=f+Math.imul(k,ee)|0)+Math.imul(L,X)|0,d=d+Math.imul(L,ee)|0,c=c+Math.imul(C,te)|0,f=(f=f+Math.imul(C,ce)|0)+Math.imul(M,te)|0,d=d+Math.imul(M,ce)|0,c=c+Math.imul(_,de)|0,f=(f=f+Math.imul(_,re)|0)+Math.imul(I,de)|0,d=d+Math.imul(I,re)|0,c=c+Math.imul(A,ie)|0,f=(f=f+Math.imul(A,be)|0)+Math.imul(v,ie)|0,d=d+Math.imul(v,be)|0,c=c+Math.imul(m,se)|0,f=(f=f+Math.imul(m,le)|0)+Math.imul(y,se)|0,d=d+Math.imul(y,le)|0;var Ce=(b+(c=c+Math.imul(h,he)|0)|0)+((8191&(f=(f=f+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;b=((d=d+Math.imul(p,pe)|0)+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c=Math.imul(F,K),f=(f=Math.imul(F,V))+Math.imul(Q,K)|0,d=Math.imul(Q,V),c=c+Math.imul(P,J)|0,f=(f=f+Math.imul(P,W)|0)+Math.imul(D,J)|0,d=d+Math.imul(D,W)|0,c=c+Math.imul(T,X)|0,f=(f=f+Math.imul(T,ee)|0)+Math.imul(N,X)|0,d=d+Math.imul(N,ee)|0,c=c+Math.imul(k,te)|0,f=(f=f+Math.imul(k,ce)|0)+Math.imul(L,te)|0,d=d+Math.imul(L,ce)|0,c=c+Math.imul(C,de)|0,f=(f=f+Math.imul(C,re)|0)+Math.imul(M,de)|0,d=d+Math.imul(M,re)|0,c=c+Math.imul(_,ie)|0,f=(f=f+Math.imul(_,be)|0)+Math.imul(I,ie)|0,d=d+Math.imul(I,be)|0,c=c+Math.imul(A,se)|0,f=(f=f+Math.imul(A,le)|0)+Math.imul(v,se)|0,d=d+Math.imul(v,le)|0;var Me=(b+(c=c+Math.imul(m,he)|0)|0)+((8191&(f=(f=f+Math.imul(m,pe)|0)+Math.imul(y,he)|0))<<13)|0;b=((d=d+Math.imul(y,pe)|0)+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,c=Math.imul(F,J),f=(f=Math.imul(F,W))+Math.imul(Q,J)|0,d=Math.imul(Q,W),c=c+Math.imul(P,X)|0,f=(f=f+Math.imul(P,ee)|0)+Math.imul(D,X)|0,d=d+Math.imul(D,ee)|0,c=c+Math.imul(T,te)|0,f=(f=f+Math.imul(T,ce)|0)+Math.imul(N,te)|0,d=d+Math.imul(N,ce)|0,c=c+Math.imul(k,de)|0,f=(f=f+Math.imul(k,re)|0)+Math.imul(L,de)|0,d=d+Math.imul(L,re)|0,c=c+Math.imul(C,ie)|0,f=(f=f+Math.imul(C,be)|0)+Math.imul(M,ie)|0,d=d+Math.imul(M,be)|0,c=c+Math.imul(_,se)|0,f=(f=f+Math.imul(_,le)|0)+Math.imul(I,se)|0,d=d+Math.imul(I,le)|0;var Be=(b+(c=c+Math.imul(A,he)|0)|0)+((8191&(f=(f=f+Math.imul(A,pe)|0)+Math.imul(v,he)|0))<<13)|0;b=((d=d+Math.imul(v,pe)|0)+(f>>>13)|0)+(Be>>>26)|0,Be&=67108863,c=Math.imul(F,X),f=(f=Math.imul(F,ee))+Math.imul(Q,X)|0,d=Math.imul(Q,ee),c=c+Math.imul(P,te)|0,f=(f=f+Math.imul(P,ce)|0)+Math.imul(D,te)|0,d=d+Math.imul(D,ce)|0,c=c+Math.imul(T,de)|0,f=(f=f+Math.imul(T,re)|0)+Math.imul(N,de)|0,d=d+Math.imul(N,re)|0,c=c+Math.imul(k,ie)|0,f=(f=f+Math.imul(k,be)|0)+Math.imul(L,ie)|0,d=d+Math.imul(L,be)|0,c=c+Math.imul(C,se)|0,f=(f=f+Math.imul(C,le)|0)+Math.imul(M,se)|0,d=d+Math.imul(M,le)|0;var ke=(b+(c=c+Math.imul(_,he)|0)|0)+((8191&(f=(f=f+Math.imul(_,pe)|0)+Math.imul(I,he)|0))<<13)|0;b=((d=d+Math.imul(I,pe)|0)+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,c=Math.imul(F,te),f=(f=Math.imul(F,ce))+Math.imul(Q,te)|0,d=Math.imul(Q,ce),c=c+Math.imul(P,de)|0,f=(f=f+Math.imul(P,re)|0)+Math.imul(D,de)|0,d=d+Math.imul(D,re)|0,c=c+Math.imul(T,ie)|0,f=(f=f+Math.imul(T,be)|0)+Math.imul(N,ie)|0,d=d+Math.imul(N,be)|0,c=c+Math.imul(k,se)|0,f=(f=f+Math.imul(k,le)|0)+Math.imul(L,se)|0,d=d+Math.imul(L,le)|0;var Le=(b+(c=c+Math.imul(C,he)|0)|0)+((8191&(f=(f=f+Math.imul(C,pe)|0)+Math.imul(M,he)|0))<<13)|0;b=((d=d+Math.imul(M,pe)|0)+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,c=Math.imul(F,de),f=(f=Math.imul(F,re))+Math.imul(Q,de)|0,d=Math.imul(Q,re),c=c+Math.imul(P,ie)|0,f=(f=f+Math.imul(P,be)|0)+Math.imul(D,ie)|0,d=d+Math.imul(D,be)|0,c=c+Math.imul(T,se)|0,f=(f=f+Math.imul(T,le)|0)+Math.imul(N,se)|0,d=d+Math.imul(N,le)|0;var Se=(b+(c=c+Math.imul(k,he)|0)|0)+((8191&(f=(f=f+Math.imul(k,pe)|0)+Math.imul(L,he)|0))<<13)|0;b=((d=d+Math.imul(L,pe)|0)+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,c=Math.imul(F,ie),f=(f=Math.imul(F,be))+Math.imul(Q,ie)|0,d=Math.imul(Q,be),c=c+Math.imul(P,se)|0,f=(f=f+Math.imul(P,le)|0)+Math.imul(D,se)|0,d=d+Math.imul(D,le)|0;var Te=(b+(c=c+Math.imul(T,he)|0)|0)+((8191&(f=(f=f+Math.imul(T,pe)|0)+Math.imul(N,he)|0))<<13)|0;b=((d=d+Math.imul(N,pe)|0)+(f>>>13)|0)+(Te>>>26)|0,Te&=67108863,c=Math.imul(F,se),f=(f=Math.imul(F,le))+Math.imul(Q,se)|0,d=Math.imul(Q,le);var Ne=(b+(c=c+Math.imul(P,he)|0)|0)+((8191&(f=(f=f+Math.imul(P,pe)|0)+Math.imul(D,he)|0))<<13)|0;b=((d=d+Math.imul(D,pe)|0)+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Re=(b+(c=Math.imul(F,he))|0)+((8191&(f=(f=Math.imul(F,pe))+Math.imul(Q,he)|0))<<13)|0;return b=((d=Math.imul(Q,pe))+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,i[0]=ge,i[1]=me,i[2]=ye,i[3]=xe,i[4]=Ae,i[5]=ve,i[6]=we,i[7]=_e,i[8]=Ie,i[9]=Ee,i[10]=Ce,i[11]=Me,i[12]=Be,i[13]=ke,i[14]=Le,i[15]=Se,i[16]=Te,i[17]=Ne,i[18]=Re,0!==b&&(i[19]=b,t.length++),t};function p(e,a,t){return(new g).mulp(e,a,t)}function g(e,a){this.x=e,this.y=a}Math.imul||(h=u),d.prototype.mulTo=function(e,a){var t,c=this.length+e.length;return t=10===this.length&&10===e.length?h(this,e,a):c<63?u(this,e,a):c<1024?function(e,a,t){t.negative=a.negative^e.negative,t.length=e.length+a.length;for(var c=0,f=0,d=0;d>>26)|0)>>>26,r&=67108863}t.words[d]=n,c=r,r=f}return 0!==c?t.words[d]=c:t.length--,t.strip()}(this,e,a):p(this,e,a),t},g.prototype.makeRBT=function(e){for(var a=new Array(e),t=d.prototype._countBits(e)-1,c=0;c>=1;return c},g.prototype.permute=function(e,a,t,c,f,d){for(var r=0;r>>=1)f++;return 1<>>=13,t[2*r+1]=8191&d,d>>>=13;for(r=2*a;r>=26,a+=f/67108864|0,a+=d>>>26,this.words[t]=67108863&d}return 0!==a&&(this.words[t]=a,this.length++),this},d.prototype.muln=function(e){return this.clone().imuln(e)},d.prototype.sqr=function(){return this.mul(this)},d.prototype.isqr=function(){return this.imul(this.clone())},d.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),t=0;t>>f}return a}(e);if(0===a.length)return new d(1);for(var t=this,c=0;c=0);var a,t=e%26,f=(e-t)/26,d=67108863>>>26-t<<26-t;if(0!==t){var r=0;for(a=0;a>>26-t}r&&(this.words[a]=r,this.length++)}if(0!==f){for(a=this.length-1;a>=0;a--)this.words[a+f]=this.words[a];for(a=0;a=0),f=a?(a-a%26)/26:0;var d=e%26,r=Math.min((e-d)/26,this.length),n=67108863^67108863>>>d<r)for(this.length-=r,b=0;b=0&&(0!==o||b>=f);b--){var s=0|this.words[b];this.words[b]=o<<26-d|s>>>d,o=s&n}return i&&0!==o&&(i.words[i.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},d.prototype.ishrn=function(e,a,t){return c(0===this.negative),this.iushrn(e,a,t)},d.prototype.shln=function(e){return this.clone().ishln(e)},d.prototype.ushln=function(e){return this.clone().iushln(e)},d.prototype.shrn=function(e){return this.clone().ishrn(e)},d.prototype.ushrn=function(e){return this.clone().iushrn(e)},d.prototype.testn=function(e){c("number"==typeof e&&e>=0);var a=e%26,t=(e-a)/26,f=1<=0);var a=e%26,t=(e-a)/26;if(c(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==a&&t++,this.length=Math.min(t,this.length),0!==a){var f=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},d.prototype.isubn=function(e){if(c("number"==typeof e),c(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(i/67108864|0),this.words[f+t]=67108863&d}for(;f>26,this.words[f+t]=67108863&d;if(0===n)return this.strip();for(c(-1===n),n=0,f=0;f>26,this.words[f]=67108863&d;return this.negative=1,this.strip()},d.prototype._wordDiv=function(e,a){var t=(this.length,e.length),c=this.clone(),f=e,r=0|f.words[f.length-1];0!=(t=26-this._countBits(r))&&(f=f.ushln(t),c.iushln(t),r=0|f.words[f.length-1]);var n,i=c.length-f.length;if("mod"!==a){(n=new d(null)).length=i+1,n.words=new Array(n.length);for(var b=0;b=0;s--){var l=67108864*(0|c.words[f.length+s])+(0|c.words[f.length+s-1]);for(l=Math.min(l/r|0,67108863),c._ishlnsubmul(f,l,s);0!==c.negative;)l--,c.negative=0,c._ishlnsubmul(f,1,s),c.isZero()||(c.negative^=1);n&&(n.words[s]=l)}return n&&n.strip(),c.strip(),"div"!==a&&0!==t&&c.iushrn(t),{div:n||null,mod:c}},d.prototype.divmod=function(e,a,t){return c(!e.isZero()),this.isZero()?{div:new d(0),mod:new d(0)}:0!==this.negative&&0===e.negative?(n=this.neg().divmod(e,a),"mod"!==a&&(f=n.div.neg()),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.iadd(e)),{div:f,mod:r}):0===this.negative&&0!==e.negative?(n=this.divmod(e.neg(),a),"mod"!==a&&(f=n.div.neg()),{div:f,mod:n.mod}):this.negative&e.negative?(n=this.neg().divmod(e.neg(),a),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.isub(e)),{div:n.div,mod:r}):e.length>this.length||this.cmp(e)<0?{div:new d(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new d(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new d(this.modn(e.words[0]))}:this._wordDiv(e,a);var f,r,n},d.prototype.div=function(e){return this.divmod(e,"div",!1).div},d.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},d.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},d.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var t=0!==a.div.negative?a.mod.isub(e):a.mod,c=e.ushrn(1),f=e.andln(1),d=t.cmp(c);return d<0||1===f&&0===d?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},d.prototype.modn=function(e){c(e<=67108863);for(var a=(1<<26)%e,t=0,f=this.length-1;f>=0;f--)t=(a*t+(0|this.words[f]))%e;return t},d.prototype.idivn=function(e){c(e<=67108863);for(var a=0,t=this.length-1;t>=0;t--){var f=(0|this.words[t])+67108864*a;this.words[t]=f/e|0,a=f%e}return this.strip()},d.prototype.divn=function(e){return this.clone().idivn(e)},d.prototype.egcd=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f=new d(1),r=new d(0),n=new d(0),i=new d(1),b=0;a.isEven()&&t.isEven();)a.iushrn(1),t.iushrn(1),++b;for(var o=t.clone(),s=a.clone();!a.isZero();){for(var l=0,u=1;!(a.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(f.isOdd()||r.isOdd())&&(f.iadd(o),r.isub(s)),f.iushrn(1),r.iushrn(1);for(var h=0,p=1;!(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(o),i.isub(s)),n.iushrn(1),i.iushrn(1);a.cmp(t)>=0?(a.isub(t),f.isub(n),r.isub(i)):(t.isub(a),n.isub(f),i.isub(r))}return{a:n,b:i,gcd:t.iushln(b)}},d.prototype._invmp=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f,r=new d(1),n=new d(0),i=t.clone();a.cmpn(1)>0&&t.cmpn(1)>0;){for(var b=0,o=1;!(a.words[0]&o)&&b<26;++b,o<<=1);if(b>0)for(a.iushrn(b);b-- >0;)r.isOdd()&&r.iadd(i),r.iushrn(1);for(var s=0,l=1;!(t.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(t.iushrn(s);s-- >0;)n.isOdd()&&n.iadd(i),n.iushrn(1);a.cmp(t)>=0?(a.isub(t),r.isub(n)):(t.isub(a),n.isub(r))}return(f=0===a.cmpn(1)?r:n).cmpn(0)<0&&f.iadd(e),f},d.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),t=e.clone();a.negative=0,t.negative=0;for(var c=0;a.isEven()&&t.isEven();c++)a.iushrn(1),t.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;t.isEven();)t.iushrn(1);var f=a.cmp(t);if(f<0){var d=a;a=t,t=d}else if(0===f||0===t.cmpn(1))break;a.isub(t)}return t.iushln(c)},d.prototype.invm=function(e){return this.egcd(e).a.umod(e)},d.prototype.isEven=function(){return!(1&this.words[0])},d.prototype.isOdd=function(){return!(1&~this.words[0])},d.prototype.andln=function(e){return this.words[0]&e},d.prototype.bincn=function(e){c("number"==typeof e);var a=e%26,t=(e-a)/26,f=1<>>26,n&=67108863,this.words[r]=n}return 0!==d&&(this.words[r]=d,this.length++),this},d.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},d.prototype.cmpn=function(e){var a,t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)a=1;else{t&&(e=-e),c(e<=67108863,"Number is too big");var f=0|this.words[0];a=f===e?0:fe.length)return 1;if(this.length=0;t--){var c=0|this.words[t],f=0|e.words[t];if(c!==f){cf&&(a=1);break}}return a},d.prototype.gtn=function(e){return 1===this.cmpn(e)},d.prototype.gt=function(e){return 1===this.cmp(e)},d.prototype.gten=function(e){return this.cmpn(e)>=0},d.prototype.gte=function(e){return this.cmp(e)>=0},d.prototype.ltn=function(e){return-1===this.cmpn(e)},d.prototype.lt=function(e){return-1===this.cmp(e)},d.prototype.lten=function(e){return this.cmpn(e)<=0},d.prototype.lte=function(e){return this.cmp(e)<=0},d.prototype.eqn=function(e){return 0===this.cmpn(e)},d.prototype.eq=function(e){return 0===this.cmp(e)},d.red=function(e){return new _(e)},d.prototype.toRed=function(e){return c(!this.red,"Already a number in reduction context"),c(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},d.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},d.prototype._forceRed=function(e){return this.red=e,this},d.prototype.forceRed=function(e){return c(!this.red,"Already a number in reduction context"),this._forceRed(e)},d.prototype.redAdd=function(e){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},d.prototype.redIAdd=function(e){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},d.prototype.redSub=function(e){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},d.prototype.redISub=function(e){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},d.prototype.redShl=function(e){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},d.prototype.redMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},d.prototype.redIMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},d.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},d.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},d.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},d.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},d.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},d.prototype.redPow=function(e){return c(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function y(e,a){this.name=e,this.p=new d(a,16),this.n=this.p.bitLength(),this.k=new d(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function x(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var a=d._prime(e);this.m=a.p,this.prime=a}else c(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new d(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var e=new d(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var a,t=e;do{this.split(t,this.tmp),a=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(a>this.n);var c=a0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},y.prototype.split=function(e,a){e.iushrn(this.n,0,a)},y.prototype.imulK=function(e){return e.imul(this.k)},f(x,y),x.prototype.split=function(e,a){for(var t=4194303,c=Math.min(e.length,9),f=0;f>>22,d=r}d>>>=22,e.words[f-10]=d,0===d&&e.length>10?e.length-=10:e.length-=9},x.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,t=0;t>>=26,e.words[t]=f,a=c}return 0!==a&&(e.words[e.length++]=a),e},d._prime=function(e){if(m[e])return m[e];var a;if("k256"===e)a=new x;else if("p224"===e)a=new A;else if("p192"===e)a=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new w}return m[e]=a,a},_.prototype._verify1=function(e){c(0===e.negative,"red works only with positives"),c(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,a){c(!(e.negative|a.negative),"red works only with positives"),c(e.red&&e.red===a.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,a){this._verify2(e,a);var t=e.add(a);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},_.prototype.iadd=function(e,a){this._verify2(e,a);var t=e.iadd(a);return t.cmp(this.m)>=0&&t.isub(this.m),t},_.prototype.sub=function(e,a){this._verify2(e,a);var t=e.sub(a);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},_.prototype.isub=function(e,a){this._verify2(e,a);var t=e.isub(a);return t.cmpn(0)<0&&t.iadd(this.m),t},_.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},_.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},_.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(c(a%2==1),3===a){var t=this.m.add(new d(1)).iushrn(2);return this.pow(e,t)}for(var f=this.m.subn(1),r=0;!f.isZero()&&0===f.andln(1);)r++,f.iushrn(1);c(!f.isZero());var n=new d(1).toRed(this),i=n.redNeg(),b=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new d(2*o*o).toRed(this);0!==this.pow(o,b).cmp(i);)o.redIAdd(i);for(var s=this.pow(o,f),l=this.pow(e,f.addn(1).iushrn(1)),u=this.pow(e,f),h=r;0!==u.cmp(n);){for(var p=u,g=0;0!==p.cmp(n);g++)p=p.redSqr();c(g=0;c--){for(var b=a.words[c],o=i-1;o>=0;o--){var s=b>>o&1;f!==t[0]&&(f=this.sqr(f)),0!==s||0!==r?(r<<=1,r|=s,(4==++n||0===c&&0===o)&&(f=this.mul(f,t[r]),n=0,r=0)):n=0}i=26}return f},_.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},_.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},d.mont=function(e){return new I(e)},f(I,_),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},I.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var t=e.imul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),d=f;return f.cmp(this.m)>=0?d=f.isub(this.m):f.cmpn(0)<0&&(d=f.iadd(this.m)),d._forceRed(this)},I.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new d(0)._forceRed(this);var t=e.mul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),r=f;return f.cmp(this.m)>=0?r=f.isub(this.m):f.cmpn(0)<0&&(r=f.iadd(this.m)),r._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=t.nmd(e),this)},30655:(e,a,t)=>{"use strict";var c=t(70453)("%Object.defineProperty%",!0)||!1;if(c)try{c({},"a",{value:1})}catch(e){c=!1}e.exports=c},41237:e=>{"use strict";e.exports=EvalError},69383:e=>{"use strict";e.exports=Error},79290:e=>{"use strict";e.exports=RangeError},79538:e=>{"use strict";e.exports=ReferenceError},58068:e=>{"use strict";e.exports=SyntaxError},69675:e=>{"use strict";e.exports=TypeError},35345:e=>{"use strict";e.exports=URIError},9723:(e,a,t)=>{"use strict";t.d(a,{AF:()=>s,B3:()=>o,JY:()=>l,QL:()=>b,vS:()=>i});var c=t(36212),f=t(57339),d=t(24359),r=t(43948),n=t(67418);async function i(e,a){let t,d=null;if(Array.isArray(a)){const d=function(a){if((0,c.Lo)(a,32))return a;const t=e.getEvent(a);return(0,f.MR)(t,"unknown fragment","name",a),t.topicHash};t=a.map((e=>null==e?null:Array.isArray(e)?e.map(d):d(e)))}else"*"===a?t=[null]:"string"==typeof a?(0,c.Lo)(a,32)?t=[a]:(d=e.getEvent(a),(0,f.MR)(d,"unknown fragment","event",a),t=[d.topicHash]):(r=a)&&"object"==typeof r&&"getTopicFilter"in r&&"function"==typeof r.getTopicFilter&&r.fragment?t=await a.getTopicFilter():"fragment"in a?(d=a.fragment,t=[d.topicHash]):(0,f.MR)(!1,"unknown event name","event",a);var r;return t=t.map((e=>{if(null==e)return null;if(Array.isArray(e)){const a=Array.from(new Set(e.map((e=>e.toLowerCase()))).values());return 1===a.length?a[0]:(a.sort(),a)}return e.toLowerCase()})),{fragment:d,tag:t.map((e=>null==e?"null":Array.isArray(e)?e.join("|"):e)).join("&"),topics:t}}async function b(e,a,t,c,n){null==c&&(c=0),null==n&&(n="latest");const{fragment:b,topics:o}=await i(a.interface,t),s={address:"*"===e?void 0:e,topics:o,fromBlock:c,toBlock:n},l=a.runner;return(0,f.vA)(l,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await l.getLogs(s)).map((e=>{let t=b;if(null==t)try{t=a.interface.getEvent(e.topics[0])}catch{}if(t)try{return new d.vu(e,a.interface,t)}catch(a){return new d.AA(e,a)}return new r.tG(e,l)}))}class o{provider;onProgress;concurrencySize;batchSize;shouldRetry;retryMax;retryOn;constructor({provider:e,onProgress:a,concurrencySize:t=10,batchSize:c=10,shouldRetry:f=!0,retryMax:d=5,retryOn:r=500}){this.provider=e,this.onProgress=a,this.concurrencySize=t,this.batchSize=c,this.shouldRetry=f,this.retryMax=d,this.retryOn=r}async getBlock(e){const a=await this.provider.getBlock(e);if(!a)throw new Error(`No block for ${e}`);return a}createBatchRequest(e){return e.map((async(e,a)=>(await(0,n.yy)(40*a),(async()=>{let a,t=0;for(;!this.shouldRetry&&0===t||this.shouldRetry&&tthis.getBlock(e))))}catch(e){t++,a=e,await(0,n.yy)(this.retryOn)}throw a})())))}async getBatchBlocks(e){let a=0;const t=[];for(const c of(0,n.iv)(e,this.concurrencySize*this.batchSize)){const f=(await Promise.all(this.createBatchRequest((0,n.iv)(c,this.batchSize)))).flat();t.push(...f),a+=c.length,"function"==typeof this.onProgress&&this.onProgress({percentage:a/e.length,currentIndex:a,totalIndex:e.length})}return t}}class s{provider;onProgress;concurrencySize;batchSize;shouldRetry;retryMax;retryOn;constructor({provider:e,onProgress:a,concurrencySize:t=10,batchSize:c=10,shouldRetry:f=!0,retryMax:d=5,retryOn:r=500}){this.provider=e,this.onProgress=a,this.concurrencySize=t,this.batchSize=c,this.shouldRetry=f,this.retryMax=d,this.retryOn=r}async getTransaction(e){const a=await this.provider.getTransaction(e);if(!a)throw new Error(`No transaction for ${e}`);return a}async getTransactionReceipt(e){const a=await this.provider.getTransactionReceipt(e);if(!a)throw new Error(`No transaction receipt for ${e}`);return a}createBatchRequest(e,a){return e.map((async(e,t)=>(await(0,n.yy)(40*t),(async()=>{let t,c=0;for(;!this.shouldRetry&&0===c||this.shouldRetry&&cthis.getTransactionReceipt(e)))):await Promise.all(e.map((e=>this.getTransaction(e))))}catch(e){c++,t=e,await(0,n.yy)(this.retryOn)}throw t})())))}async getBatchTransactions(e){let a=0;const t=[];for(const c of(0,n.iv)(e,this.concurrencySize*this.batchSize)){const f=(await Promise.all(this.createBatchRequest((0,n.iv)(c,this.batchSize)))).flat();t.push(...f),a+=c.length,"function"==typeof this.onProgress&&this.onProgress({percentage:a/e.length,currentIndex:a,totalIndex:e.length})}return t}async getBatchReceipt(e){let a=0;const t=[];for(const c of(0,n.iv)(e,this.concurrencySize*this.batchSize)){const f=(await Promise.all(this.createBatchRequest((0,n.iv)(c,this.batchSize),!0))).flat();t.push(...f),a+=c.length,"function"==typeof this.onProgress&&this.onProgress({percentage:a/e.length,currentIndex:a,totalIndex:e.length})}return t}}class l{provider;contract;address;onProgress;concurrencySize;blocksPerRequest;shouldRetry;retryMax;retryOn;constructor({provider:e,contract:a,address:t,onProgress:c,concurrencySize:f=10,blocksPerRequest:d=5e3,shouldRetry:r=!0,retryMax:n=5,retryOn:i=500}){this.provider=e,this.contract=a,this.address=t,this.onProgress=c,this.concurrencySize=f,this.blocksPerRequest=d,this.shouldRetry=r,this.retryMax=n,this.retryOn=i}async getPastEvents({fromBlock:e,toBlock:a,type:t}){let c,f=0;for(;!this.shouldRetry&&0===f||this.shouldRetry&&f(await(0,n.yy)(10*a),this.getPastEvents(e))))}async getBatchEvents({fromBlock:e,toBlock:a,type:t="*"}){a||(a=await this.provider.getBlockNumber());const c=[];for(let f=e;fa?a:f+this.blocksPerRequest-1;c.push({fromBlock:f,toBlock:e,type:t})}const f=[],d=(0,n.iv)(c,this.concurrencySize);let r=0;for(const e of d){r++;const a=(await Promise.all(this.createBatchRequest(e))).flat();f.push(...a),"function"==typeof this.onProgress&&this.onProgress({percentage:r/d.length,type:t,fromBlock:e[0].fromBlock,toBlock:e[e.length-1].toBlock,count:a.length})}return f}}},7240:(e,a,t)=>{"use strict";t.d(a,{Hr:()=>n,Ps:()=>r,dA:()=>i,qO:()=>b,wd:()=>d});var c=t(67418),f=t(85111);function d(e){const a=/tornado-(?\w+)-(?[\d.]+)-(?\d+)-0x(?[0-9a-fA-F]{124})/g.exec(e);if(!a)return;const{currency:t,amount:c,netId:f,noteHex:d}=a.groups;return{currency:t.toLowerCase(),amount:c,netId:Number(f),noteHex:"0x"+d,note:e}}function r(e){const a=/tornadoInvoice-(?\w+)-(?[\d.]+)-(?\d+)-0x(?[0-9a-fA-F]{64})/g.exec(e);if(!a)return;const{currency:t,amount:c,netId:f,commitmentHex:d}=a.groups;return{currency:t.toLowerCase(),amount:c,netId:Number(f),commitmentHex:"0x"+d,invoice:e}}async function n({nullifier:e,secret:a}){const t=new Uint8Array([...(0,c.EI)(e),...(0,c.EI)(a)]),d=(0,c.$W)((0,c.Ju)(t),62),r=BigInt(await(0,f.UB)(t)),n=(0,c.$W)(r),i=BigInt(await(0,f.UB)((0,c.EI)(e)));return{preimage:t,noteHex:d,commitment:r,commitmentHex:n,nullifierHash:i,nullifierHex:(0,c.$W)(i)}}class i{currency;amount;netId;nullifier;secret;note;noteHex;invoice;commitmentHex;nullifierHex;constructor({currency:e,amount:a,netId:t,nullifier:c,secret:f,note:d,noteHex:r,invoice:n,commitmentHex:i,nullifierHex:b}){this.currency=e,this.amount=a,this.netId=t,this.nullifier=c,this.secret=f,this.note=d,this.noteHex=r,this.invoice=n,this.commitmentHex=i,this.nullifierHex=b}toString(){return JSON.stringify({currency:this.currency,amount:this.amount,netId:this.netId,nullifier:this.nullifier,secret:this.secret,note:this.note,noteHex:this.noteHex,invoice:this.invoice,commitmentHex:this.commitmentHex,nullifierHex:this.nullifierHex},null,2)}static async createNote({currency:e,amount:a,netId:t,nullifier:f,secret:d}){f||(f=(0,c.ib)(31)),d||(d=(0,c.ib)(31));const r=await n({nullifier:f,secret:d});return new i({currency:e.toLowerCase(),amount:a,netId:t,note:`tornado-${e.toLowerCase()}-${a}-${t}-${r.noteHex}`,noteHex:r.noteHex,invoice:`tornadoInvoice-${e.toLowerCase()}-${a}-${t}-${r.commitmentHex}`,nullifier:f,secret:d,commitmentHex:r.commitmentHex,nullifierHex:r.nullifierHex})}static async parseNote(e){const a=d(e);if(!a)throw new Error("The note has invalid format");const{currency:t,amount:f,netId:r,note:b,noteHex:o}=a,s=(0,c.jm)(o),l=BigInt((0,c.ae)(s.slice(0,31)).toString()),u=BigInt((0,c.ae)(s.slice(31,62)).toString()),{noteHex:h,commitmentHex:p,nullifierHex:g}=await n({nullifier:l,secret:u});return new i({currency:t,amount:f,netId:r,note:b,noteHex:h,invoice:`tornadoInvoice-${t}-${f}-${r}-${p}`,nullifier:l,secret:u,commitmentHex:p,nullifierHex:g})}}class b{currency;amount;netId;commitmentHex;invoice;constructor(e){const a=r(e);if(!a)throw new Error("The invoice has invalid format");const{currency:t,amount:c,netId:f,invoice:d,commitmentHex:n}=a;this.currency=t,this.amount=c,this.netId=f,this.commitmentHex=n,this.invoice=d}toString(){return JSON.stringify({currency:this.currency,amount:this.amount,netId:this.netId,commitmentHex:this.commitmentHex,invoice:this.invoice},null,2)}}},33298:(e,a,t)=>{"use strict";t.d(a,{Ad:()=>b,Fr:()=>n,ol:()=>i});var c=t(51594),f=t(20415),d=t(30031),r=t(67418);function n({nonce:e,ephemPublicKey:a,ciphertext:t}){const c=(0,r.$W)((0,r.My)((0,r.Kp)(e)),24),f=(0,r.$W)((0,r.My)((0,r.Kp)(a)),32),d=(0,r.My)((0,r.Kp)(t)),n=(0,r.Id)((0,r.aT)(c),(0,r.aT)(f),(0,r.aT)(d));return(0,r.My)(n)}function i(e){const a=(0,r.aT)(e),t=(0,r.if)(a.slice(0,24)),c=(0,r.if)(a.slice(24,56)),f=(0,r.if)(a.slice(56));return{messageBuff:(0,r.My)(a),version:"x25519-xsalsa20-poly1305",nonce:t,ephemPublicKey:c,ciphertext:f}}class b{blockNumber;recoveryKey;recoveryAddress;recoveryPublicKey;constructor({blockNumber:e,recoveryKey:a}){a||(a=(0,r.G9)(32).slice(2)),this.blockNumber=e,this.recoveryKey=a,this.recoveryAddress=(0,f.K)("0x"+a),this.recoveryPublicKey=(0,c.getEncryptionPublicKey)(a)}static async getSignerPublicKey(e){if(e.privateKey){const a=e,t="0x"===a.privateKey.slice(0,2)?a.privateKey.slice(2):a.privateKey;return(0,c.getEncryptionPublicKey)(t)}const a=e.provider;return await a.send("eth_getEncryptionPublicKey",[e.address])}getEncryptedAccount(e){const a=(0,c.encrypt)({publicKey:e,data:this.recoveryKey,version:"x25519-xsalsa20-poly1305"});return{encryptedData:a,data:n(a)}}static async decryptSignerNoteAccounts(e,a){const t=e.address,f=[];for(const d of a)if(d.address===t)try{const a=i(d.encryptedAccount);let n;if(e.privateKey){const t=e,f="0x"===t.privateKey.slice(0,2)?t.privateKey.slice(2):t.privateKey;n=(0,c.decrypt)({encryptedData:a,privateKey:f})}else{const{version:c,nonce:f,ephemPublicKey:d,ciphertext:i}=a,b=(0,r.My)((new TextEncoder).encode(JSON.stringify({version:c,nonce:f,ephemPublicKey:d,ciphertext:i}))),o=e.provider;n=await o.send("eth_decrypt",[b,t])}f.push(new b({blockNumber:d.blockNumber,recoveryKey:n}))}catch{continue}return f}decryptNotes(e){const a=[];for(const t of e)try{const e=i(t.encryptedNote),[f,r]=(0,c.decrypt)({encryptedData:e,privateKey:this.recoveryKey}).split("-");a.push({blockNumber:t.blockNumber,address:(0,d.b)(f),noteHex:r})}catch{continue}return a}encryptNote({address:e,noteHex:a}){return n((0,c.encrypt)({publicKey:this.recoveryPublicKey,data:`${e}-${a}`,version:"x25519-xsalsa20-poly1305"}))}}},16795:(e,a,t)=>{"use strict";t.d(a,{A6:()=>l,Lr:()=>o,QP:()=>s,gH:()=>u,qX:()=>b});var c=t(15539),f=t(64563),d=t(97876),r=t(62463),n=t(67418),i=t(59499);function b(e){if(66!==e.length)return null;if(0!==e.indexOf("["))return null;if(65!==e.indexOf("]"))return null;const a=`0x${e.slice(1,65)}`;return(0,n.qv)(a)?a:null}function o(e){return e?b(e)||(0,c.S)((new TextEncoder).encode(e)):(0,n.My)(new Uint8Array(32).fill(0))}function s(e){const a=e.split("."),t=a.shift(),c=(0,f.kM)(a.join("."));return{label:t,labelhash:o(t),parentNode:c}}const l={[i.zr.MAINNET]:{ensRegistry:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",ensPublicResolver:"0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63",ensNameWrapper:"0xD4416b13d2b3a9aBae7AcD5D6C2BbDBE25686401"},[i.zr.SEPOLIA]:{ensRegistry:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",ensPublicResolver:"0x8FADE66B79cC9f707aB26799354482EB93a5B7dD",ensNameWrapper:"0x0635513f179D50A207757E05759CbD106d7dFcE8"}};class u{ENSRegistry;ENSResolver;ENSNameWrapper;provider;constructor(e){this.provider=e}async getContracts(){const{chainId:e}=await this.provider.getNetwork(),{ensRegistry:a,ensPublicResolver:t,ensNameWrapper:c}=l[Number(e)];this.ENSRegistry=r.S4.connect(a,this.provider),this.ENSResolver=r.BB.connect(t,this.provider),this.ENSNameWrapper=r.rZ.connect(c,this.provider)}async getOwner(e){return this.ENSRegistry||await this.getContracts(),this.ENSRegistry.owner((0,f.kM)(e))}async unwrap(e,a){this.ENSNameWrapper||await this.getContracts();const t=e.address,c=this.ENSNameWrapper.connect(e),{labelhash:f}=s(a);return c.unwrapETH2LD(f,t,t)}async setSubnodeRecord(e,a){this.ENSResolver||await this.getContracts();const t=this.ENSResolver,c=this.ENSRegistry.connect(e),f=e.address,{labelhash:d,parentNode:r}=s(a);return c.setSubnodeRecord(r,d,f,t.target,BigInt(0))}getResolver(e){return d.Pz.fromName(this.provider,e)}async getText(e,a){const t=await this.getResolver(e);return t?await t.getText(a)||"":t}async setText(e,a,t,c){return r.BB.connect((await this.getResolver(a))?.address,e).setText((0,f.kM)(a),t,c)}}},96221:(e,a,t)=>{"use strict";t.d(a,{GS:()=>x,O_:()=>A,uw:()=>g,JJ:()=>_,lG:()=>y,cE:()=>C,Do:()=>M,e0:()=>m,EU:()=>I,sf:()=>w});var c=t(30031),f=t(35273),d=t(36212),r=t(99770),n=t(64563),i=t(73622),b=t(13269);t(7040),t(88081),t(57339);const o=[{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"commitment",type:"bytes32"},{indexed:!1,internalType:"uint32",name:"leafIndex",type:"uint32"},{indexed:!1,internalType:"uint256",name:"timestamp",type:"uint256"}],name:"Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"bytes32",name:"nullifierHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"relayer",type:"address"},{indexed:!1,internalType:"uint256",name:"fee",type:"uint256"}],name:"Withdrawal",type:"event"},{inputs:[],name:"FIELD_SIZE",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"ROOT_HISTORY_SIZE",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[],name:"ZERO_VALUE",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"commitments",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"currentRootIndex",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[],name:"denomination",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"_commitment",type:"bytes32"}],name:"deposit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"filledSubtrees",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"getLastRoot",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IHasher",name:"_hasher",type:"address"},{internalType:"bytes32",name:"_left",type:"bytes32"},{internalType:"bytes32",name:"_right",type:"bytes32"}],name:"hashLeftRight",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"pure",type:"function"},{inputs:[],name:"hasher",outputs:[{internalType:"contract IHasher",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"_root",type:"bytes32"}],name:"isKnownRoot",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"_nullifierHash",type:"bytes32"}],name:"isSpent",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32[]",name:"_nullifierHashes",type:"bytes32[]"}],name:"isSpentArray",outputs:[{internalType:"bool[]",name:"spent",type:"bool[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"levels",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[],name:"nextIndex",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"nullifierHashes",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"roots",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"verifier",outputs:[{internalType:"contract IVerifier",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"_proof",type:"bytes"},{internalType:"bytes32",name:"_root",type:"bytes32"},{internalType:"bytes32",name:"_nullifierHash",type:"bytes32"},{internalType:"address payable",name:"_recipient",type:"address"},{internalType:"address payable",name:"_relayer",type:"address"},{internalType:"uint256",name:"_fee",type:"uint256"},{internalType:"uint256",name:"_refund",type:"uint256"}],name:"withdraw",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"zeros",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"}];class s{static abi=o;static createInterface(){return new i.KA(o)}static connect(e,a){return new b.NZ(e,o,a)}}var l=t(9723),u=t(68909),h=t(59499),p=t(57194);class g{netId;provider;contract;type;deployedBlock;batchEventsService;fetchDataOptions;tovarishClient;constructor({netId:e,provider:a,contract:t,type:c="",deployedBlock:f=0,fetchDataOptions:d,tovarishClient:r}){this.netId=e,this.provider=a,this.fetchDataOptions=d,this.contract=t,this.type=c,this.deployedBlock=f,this.batchEventsService=new l.JY({provider:a,contract:t,onProgress:this.updateEventProgress}),this.tovarishClient=r}getInstanceName(){return""}getType(){return this.type||""}getTovarishType(){return String(this.getType()||"").toLowerCase()}updateEventProgress({percentage:e,type:a,fromBlock:t,toBlock:c,count:f}){}updateBlockProgress({percentage:e,currentIndex:a,totalIndex:t}){}updateTransactionProgress({percentage:e,currentIndex:a,totalIndex:t}){}async formatEvents(e){return await new Promise((a=>a(e)))}async getEventsFromDB(){return{events:[],lastBlock:0}}async getEventsFromCache(){return{events:[],lastBlock:0,fromCache:!0}}async getSavedEvents(){let e=await this.getEventsFromDB();return e.lastBlock||(e=await this.getEventsFromCache()),e}async getEventsFromRpc({fromBlock:e,toBlock:a}){try{return a||(a=await this.provider.getBlockNumber()),e>=a?{events:[],lastBlock:a}:(this.updateEventProgress({percentage:0,type:this.getType()}),{events:await this.formatEvents(await this.batchEventsService.getBatchEvents({fromBlock:e,toBlock:a,type:this.getType()})),lastBlock:a})}catch(a){return console.log(a),{events:[],lastBlock:e}}}async getLatestEvents({fromBlock:e}){if(this.tovarishClient?.selectedRelayer){const{events:a,lastSyncBlock:t}=await this.tovarishClient.getEvents({type:this.getTovarishType(),fromBlock:e});return{events:a,lastBlock:t}}return await this.getEventsFromRpc({fromBlock:e})}async validateEvents({events:e,newEvents:a,lastBlock:t}){}async saveEvents({events:e,newEvents:a,lastBlock:t}){}async updateEvents(){const e=await this.getSavedEvents();let a=this.deployedBlock;e&&e.lastBlock&&(a=e.lastBlock+1);const t=await this.getLatestEvents({fromBlock:a}),c=new Set,f=[...e.events,...t.events].sort(((e,a)=>e.blockNumber===a.blockNumber?e.logIndex-a.logIndex:e.blockNumber-a.blockNumber)).filter((({transactionHash:e,logIndex:a})=>{const t=`${e}_${a}`,f=c.has(t);return c.add(t),!f})),d=t.lastBlock||f[f.length-1]?.blockNumber,r=await this.validateEvents({events:f,newEvents:t.events,lastBlock:d});return(e.fromCache||t.events.length)&&await this.saveEvents({events:f,newEvents:t.events,lastBlock:d}),{events:f,lastBlock:d,validateResult:r}}}class m extends g{amount;currency;optionalTree;merkleTreeService;batchTransactionService;batchBlockService;constructor(e){const{Tornado:a,amount:t,currency:c,provider:f,optionalTree:d,merkleTreeService:r}=e;super({...e,contract:a}),this.amount=t,this.currency=c,this.optionalTree=d,this.merkleTreeService=r,this.batchTransactionService=new l.AF({provider:f,onProgress:this.updateTransactionProgress}),this.batchBlockService=new l.B3({provider:f,onProgress:this.updateBlockProgress})}getInstanceName(){return`${this.getType().toLowerCase()}s_${this.netId}_${this.currency}_${this.amount}`}async formatEvents(e){if("Deposit"===this.getType()){const a=await this.batchTransactionService.getBatchTransactions([...new Set(e.map((({transactionHash:e})=>e)))]);return e.map((({blockNumber:e,index:t,transactionHash:c,args:f})=>{const{commitment:d,leafIndex:r,timestamp:n}=f;return{blockNumber:e,logIndex:t,transactionHash:c,commitment:d,leafIndex:Number(r),timestamp:Number(n),from:a.find((({hash:e})=>e===c))?.from||""}}))}{const a=await this.batchBlockService.getBatchBlocks([...new Set(e.map((({blockNumber:e})=>e)))]);return e.map((({blockNumber:e,index:t,transactionHash:f,args:d})=>{const{nullifierHash:r,to:n,fee:i}=d;return{blockNumber:e,logIndex:t,transactionHash:f,nullifierHash:String(r),to:(0,c.b)(n),fee:String(i),timestamp:a.find((({number:a})=>a===e))?.timestamp||0}}))}}async validateEvents({events:e,newEvents:a}){if(e.length&&"Deposit"===this.getType()){const t=e,c=t[t.length-1];if(c.leafIndex!==t.length-1){const e=`Deposit events invalid wants ${t.length-1} leafIndex have ${c.leafIndex}`;throw new Error(e)}if(this.merkleTreeService&&(!this.optionalTree||a.length))return await this.merkleTreeService.verifyTree(t)}}async getLatestEvents({fromBlock:e}){if(this.tovarishClient?.selectedRelayer){const{events:a,lastSyncBlock:t}=await this.tovarishClient.getEvents({type:this.getTovarishType(),currency:this.currency,amount:this.amount,fromBlock:e});return{events:a,lastBlock:t}}return await this.getEventsFromRpc({fromBlock:e})}}class y extends g{instances;optionalTree;merkleTreeService;batchTransactionService;batchBlockService;constructor(e){const{instances:a,provider:t,optionalTree:c,merkleTreeService:f}=e,d=f?.Tornado||s.connect(Object.keys(a)[0],t);super({...e,contract:d,type:"*"}),this.batchEventsService=new l.JY({provider:t,contract:d,address:Object.keys(a),onProgress:this.updateEventProgress}),this.instances=a,this.optionalTree=c,this.merkleTreeService=f,this.batchTransactionService=new l.AF({provider:t,onProgress:this.updateTransactionProgress}),this.batchBlockService=new l.B3({provider:t,onProgress:this.updateBlockProgress})}getInstanceName(){return`tornado_${this.netId}`}getTovarishType(){return"tornado"}async formatEvents(e){const a=await this.batchTransactionService.getBatchTransactions([...new Set(e.filter((({eventName:e})=>"Deposit"===e)).map((({transactionHash:e})=>e)))]),t=await this.batchBlockService.getBatchBlocks([...new Set(e.filter((({eventName:e})=>"Withdrawal"===e)).map((({blockNumber:e})=>e)))]);return e.map((({address:e,blockNumber:c,index:f,transactionHash:d,args:r,eventName:n})=>{const i={blockNumber:c,logIndex:f,transactionHash:d,event:n,instanceAddress:e};if("Deposit"===n){const{commitment:e,leafIndex:t,timestamp:c}=r;return{...i,commitment:e,leafIndex:Number(t),timestamp:Number(c),from:a.find((({hash:e})=>e===d))?.from||""}}if("Withdrawal"===n){const{nullifierHash:e,to:a,relayer:n,fee:b}=r;return{...i,logIndex:f,transactionHash:d,nullifierHash:String(e),to:a,relayerAddress:n,fee:String(b),timestamp:t.find((({number:e})=>e===c))?.timestamp||0}}})).filter((e=>e))}async validateEvents({events:e,newEvents:a}){const t=[...new Set(a.filter((({event:e})=>"Deposit"===e)).map((({instanceAddress:e})=>e)))];let c;const f=this.merkleTreeService?.Tornado?.target;f&&!t.includes(f)&&t.push(f);for(const a of t){const t=e.filter((({instanceAddress:e,event:t})=>e===a&&"Deposit"===t)),d=t[t.length-1];if(d.leafIndex!==t.length-1){const e=`Invalid deposit events for ${a} wants ${t.length-1} leafIndex have ${d.leafIndex}`;throw new Error(e)}f!==a||this.optionalTree||(c=await(this.merkleTreeService?.verifyTree(t)))}return c}async getEvents(e){const{events:a,validateResult:t,lastBlock:c}=await this.updateEvents(),{depositEvents:f,withdrawalEvents:d}=a.reduce(((a,t)=>(t.instanceAddress===e&&("Deposit"===t.event?a.depositEvents.push(t):"Withdrawal"===t.event&&a.withdrawalEvents.push(t)),a)),{});return{depositEvents:f,withdrawalEvents:d,tree:t,lastBlock:c}}}class x extends g{constructor(e){super({...e,contract:e.Echoer,type:"Echo"})}getInstanceName(){return`echo_${this.netId}`}async formatEvents(e){return e.map((({blockNumber:e,index:a,transactionHash:t,args:c})=>{const{who:f,data:d}=c;if(f&&d)return{blockNumber:e,logIndex:a,transactionHash:t,address:f,encryptedAccount:d}})).filter((e=>e))}}class A extends g{constructor(e){super({...e,contract:e.Router,type:"EncryptedNote"})}getInstanceName(){return`encrypted_notes_${this.netId}`}getTovarishType(){return"encrypted_notes"}async formatEvents(e){return e.map((({blockNumber:e,index:a,transactionHash:t,args:c})=>{const{encryptedNote:f}=c;if(f&&"0x"!==f)return{blockNumber:e,logIndex:a,transactionHash:t,encryptedNote:f}})).filter((e=>e))}}const v=f.y.defaultAbiCoder(),w={0:"Pending",1:"Active",2:"Defeated",3:"Timelocked",4:"AwaitingExecution",5:"Executed",6:"Expired"};class _ extends g{Governance;Aggregator;ReverseRecords;batchTransactionService;constructor(e){const{Governance:a,Aggregator:t,ReverseRecords:c,provider:f}=e;super({...e,contract:a,type:"*"}),this.Governance=a,this.Aggregator=t,this.ReverseRecords=c,this.batchTransactionService=new l.AF({provider:f,onProgress:this.updateTransactionProgress})}getInstanceName(){return`governance_${this.netId}`}getTovarishType(){return"governance"}async formatEvents(e){const a=[],t=[],c=[],f=[];if(e.forEach((({blockNumber:e,index:d,transactionHash:r,args:n,eventName:i})=>{const b={blockNumber:e,logIndex:d,transactionHash:r,event:i};if("ProposalCreated"===i){const{id:e,proposer:t,target:c,startTime:f,endTime:d,description:r}=n;a.push({...b,id:Number(e),proposer:t,target:c,startTime:Number(f),endTime:Number(d),description:r})}if("Voted"===i){const{proposalId:e,voter:a,support:c,votes:f}=n;t.push({...b,proposalId:Number(e),voter:a,support:c,votes:f,from:"",input:""})}if("Delegated"===i){const{account:e,to:a}=n;c.push({...b,account:e,delegateTo:a})}if("Undelegated"===i){const{account:e,from:a}=n;f.push({...b,account:e,delegateFrom:a})}})),t.length){this.updateTransactionProgress({percentage:0});const e=await this.batchTransactionService.getBatchTransactions([...new Set(t.map((({transactionHash:e})=>e)))]);t.forEach(((a,c)=>{let{data:f,from:d}=e.find((e=>e.hash===a.transactionHash));(!f||f.length>2048)&&(f=""),t[c].from=d,t[c].input=f}))}return[...a,...t,...c,...f]}async getAllProposals(){const{events:e}=await this.updateEvents(),a=e.filter((e=>"ProposalCreated"===e.event)),t=[...new Set(a.map((e=>[e.proposer])).flat())],[c,f,d]=await Promise.all([this.Governance.QUORUM_VOTES(),this.Aggregator.getAllProposals(this.Governance.target),this.ReverseRecords.getNames(t)]),r=t.reduce(((e,a,t)=>(d[t]&&(e[a]=d[t]),e)),{});return a.map(((e,a)=>{const{id:t,proposer:d,description:n}=e,i=f[a],{forVotes:b,againstVotes:o,executed:s,extended:l,state:u}=i,{title:h,description:p}=function(e,a){switch(e){case 1:return{title:a,description:"See: https://torn.community/t/proposal-1-enable-torn-transfers/38"};case 10:a=a.replace("\n","\\n\\n");break;case 11:a=a.replace('"description"',',"description"');break;case 13:a=a.replace(/\\\\n\\\\n(\s)?(\\n)?/g,"\\n");break;case 15:a=(a=a.replaceAll("'",'"')).replace('"description"',',"description"');break;case 16:a=a.replace("#16: ","");break;case 21:return{title:"Proposal #21: Restore Governance",description:""}}let t,c,f;try{({title:t,description:c}=JSON.parse(a))}catch{[t,...f]=a.split("\n",2),c=f.join("\n")}return{title:t,description:c}}(t,n),g=(Number(b+o)/Number(c)*100).toFixed(0)+"%";return{...e,title:h,proposerName:r[d]||void 0,description:p,forVotes:b,againstVotes:o,executed:s,extended:l,quorum:g,state:w[String(u)]}}))}async getVotes(e){const{events:a}=await this.getSavedEvents(),t=a.filter((a=>"Voted"===a.event&&a.proposalId===e)),c=[...new Set(t.map((e=>[e.from,e.voter])).flat())],f=await this.ReverseRecords.getNames(c),r=c.reduce(((e,a,t)=>(f[t]&&(e[a]=f[t]),e)),{});return t.map((e=>{const{from:a,voter:t}=e,{contact:c,message:f}=function(e,a){try{const t=4,c=v.decode(["address[]","uint256","bool"],(0,d.ZG)(a,t)),f=e.interface.encodeFunctionData("castDelegatedVote",c),r=(0,d.pO)(f),n=v.decode(["string"],(0,d.ZG)(a,r))[0],[i,b]=JSON.parse(n);return{contact:i,message:b}}catch{return{contact:"",message:""}}}(this.Governance,e.input);return{...e,contact:c,message:f,fromName:r[a]||void 0,voterName:r[t]||void 0}}))}async getDelegatedBalance(e){const{events:a}=await this.getSavedEvents(),t=a.filter((a=>"Delegated"===a.event&&a.delegateTo===e)).map((e=>e.account)),c=a.filter((a=>"Undelegated"===a.event&&a.delegateFrom===e)).map((e=>e.account)),f=[...c],d=t.filter((e=>{const a=f.indexOf(e);return-1===a||(f.splice(a,1),!1)})),[r,n]=await Promise.all([this.Aggregator.getGovernanceBalances(this.Governance.target,d),this.ReverseRecords.getNames(d)]),i=d.reduce(((e,a,t)=>(n[t]&&(e[a]=n[t]),e)),{});return{delegatedAccs:t,undelegatedAccs:c,uniq:d,uniqNames:i,balances:r,balance:r.reduce(((e,a)=>e+a),BigInt(0))}}}async function I(e,a){await Promise.all(a.filter((e=>e.tovarishHost)).map((async a=>{try{a.tovarishNetworks=await(0,u.Fd)(a.tovarishHost,{...e.fetchDataOptions,headers:{"Content-Type":"application/json"},timeout:3e4,maxRetry:e.fetchDataOptions?.torPort?2:0})}catch{a.tovarishNetworks=[]}})))}const E=[{ensName:"tornadowithdraw.eth",relayerAddress:"0x40c3d1656a26C9266f4A10fed0D87EFf79F54E64",hostnames:{},tovarishHost:"tornadowithdraw.com",tovarishNetworks:h.Af}];class C extends g{Aggregator;relayerEnsSubdomains;updateInterval;constructor(e){const{RelayerRegistry:a,Aggregator:t,relayerEnsSubdomains:c}=e;super({...e,contract:a,type:"*"}),this.Aggregator=t,this.relayerEnsSubdomains=c,this.updateInterval=86400}getInstanceName(){return`registry_${this.netId}`}getTovarishType(){return"registry"}async formatEvents(e){const a=[],t=[],c=[],f=[];return e.forEach((({blockNumber:e,index:d,transactionHash:n,args:i,eventName:b})=>{const o={blockNumber:e,logIndex:d,transactionHash:n,event:b};if("RelayerRegistered"===b){const{relayer:e,ensName:t,relayerAddress:c,stakedAmount:f}=i;a.push({...o,ensName:t,relayerAddress:c,ensHash:e,stakedAmount:(0,r.ck)(f)})}if("RelayerUnregistered"===b){const{relayer:e}=i;t.push({...o,relayerAddress:e})}if("WorkerRegistered"===b){const{relayer:e,worker:a}=i;c.push({...o,relayerAddress:e,workerAddress:a})}if("WorkerUnregistered"===b){const{relayer:e,worker:a}=i;f.push({...o,relayerAddress:e,workerAddress:a})}})),[...a,...t,...c,...f]}async getRelayersFromDB(){return{lastBlock:0,timestamp:0,relayers:[]}}async getRelayersFromCache(){return{lastBlock:0,timestamp:0,relayers:[],fromCache:!0}}async getSavedRelayers(){let e=await this.getRelayersFromDB();return e&&e.relayers.length||(e=await this.getRelayersFromCache()),e}async getLatestRelayers(){const{events:e,lastBlock:a}=await this.updateEvents(),t=e.filter((e=>"RelayerRegistered"===e.event)),c=Object.values(this.relayerEnsSubdomains),f=new Set,d=t.filter((({ensName:e})=>!f.has(e)&&(f.add(e),!0))),i=d.map((e=>(0,n.kM)(e.ensName))),[b,o]=await Promise.all([this.Aggregator.relayersData.staticCall(i,c.concat("tovarish-relayer")),this.provider.getBlock(a).then((e=>Number(e?.timestamp)))]),s=b.map((({owner:e,balance:a,records:t,isRegistered:c},f)=>{const{ensName:n,relayerAddress:i}=d[f];let b;const o=t.reduce(((e,a,c)=>{if(a){if(c===t.length-1)return b=a,e;e[Number(Object.keys(this.relayerEnsSubdomains)[c])]=a}return e}),{}),s=a>=p.pO;if(Object.keys(o).length&&c&&s)return{ensName:n,relayerAddress:e,registeredAddress:e!==i?i:void 0,isRegistered:c,stakeBalance:(0,r.ck)(a),hostnames:o,tovarishHost:b}})).filter((e=>e));await I(this,s);const l=[...E,...s];return{lastBlock:a,timestamp:o,relayers:[...l.filter((e=>e.tovarishHost)),...l.filter((e=>!e.tovarishHost))]}}async saveRelayers({lastBlock:e,timestamp:a,relayers:t}){}async updateRelayers(){let{lastBlock:e,timestamp:a,relayers:t,fromCache:c}=await this.getSavedRelayers(),f=c??!1;return(!t.length||a+this.updateIntervale)))]),t=await this.batchTransactionService.getBatchReceipt([...new Set(e.map((({transactionHash:e})=>e)))]),c=new Set(e.map((({args:e})=>e.relayer))),f=s.createInterface(),d=f.getEvent("Withdrawal").topicHash,r=t.map((e=>e.logs.map((t=>{if(t.topics[0]===d){const d=a.find((e=>e.number===t.blockNumber)),r=f.parseLog(t);if(r&&c.has(r.args.relayer))return{instanceAddress:t.address,gasFee:(e.cumulativeGasUsed*e.gasPrice).toString(),relayerFee:r.args.fee.toString(),timestamp:d?.timestamp||0}}})).filter((e=>e)))).flat();return r.length!==e.length&&console.log(`\nRevenueService: Mismatch on withdrawal logs (${r.length} ) and events logs (${e.length})\n`),e.map((({blockNumber:e,index:a,transactionHash:t,args:c},f)=>{const d={blockNumber:e,logIndex:a,transactionHash:t},{relayer:n,amountBurned:i}=c,{instanceAddress:b,gasFee:o,relayerFee:s,timestamp:l}=r[f];return{...d,relayerAddress:n,amountBurned:i.toString(),instanceAddress:b,gasFee:o,relayerFee:s,timestamp:l}}))}}},12591:(e,a,t)=>{"use strict";t.d(a,{$B:()=>l,Aq:()=>u,Fb:()=>n,Oz:()=>b,f8:()=>o,hD:()=>h,w8:()=>i,wV:()=>p,xc:()=>s});var c=t(18995),f=t(67418),d=t(68909),r=t(96221);async function n({idb:e,instanceName:a,events:t,lastBlock:c}){try{const f=t.map((e=>({eid:`${e.transactionHash}_${e.logIndex}`,...e})));await e.createMultipleTransactions({data:f,storeName:a}),await e.putItem({data:{blockNumber:c,name:a},storeName:"lastEvents"})}catch(e){console.log("Method saveDBEvents has error"),console.log(e)}}async function i({idb:e,instanceName:a}){try{const t=await e.getItem({storeName:"lastEvents",key:a});return t?.blockNumber?{events:(await e.getAll({storeName:a})).map((e=>(delete e.eid,e))),lastBlock:t.blockNumber}:{events:[],lastBlock:0}}catch(e){return console.log("Method loadDBEvents has error"),console.log(e),{events:[],lastBlock:0}}}async function b({staticUrl:e,instanceName:a,deployedBlock:t,zipDigest:f}){try{const d=`${a}.json`.toLowerCase(),r=await(0,c._6)({staticUrl:e,zipName:d,zipDigest:f});if(!Array.isArray(r)){const a=`Invalid events from ${e}/${d}`;throw new Error(a)}return{events:r,lastBlock:r[r.length-1]?.blockNumber||t,fromCache:!0}}catch(e){return console.log("Method loadRemoteEvents has error"),console.log(e),{events:[],lastBlock:t,fromCache:!0}}}class o extends r.e0{staticUrl;idb;zipDigest;constructor(e){super(e),this.staticUrl=e.staticUrl,this.idb=e.idb}async getEventsFromDB(){return await i({idb:this.idb,instanceName:this.getInstanceName()})}async getEventsFromCache(){return await b({staticUrl:this.staticUrl,instanceName:this.getInstanceName(),deployedBlock:this.deployedBlock,zipDigest:this.zipDigest})}async saveEvents({events:e,lastBlock:a}){await n({idb:this.idb,instanceName:this.getInstanceName(),events:e,lastBlock:a})}}class s extends r.GS{staticUrl;idb;zipDigest;constructor(e){super(e),this.staticUrl=e.staticUrl,this.idb=e.idb}async getEventsFromDB(){return await i({idb:this.idb,instanceName:this.getInstanceName()})}async getEventsFromCache(){return await b({staticUrl:this.staticUrl,instanceName:this.getInstanceName(),deployedBlock:this.deployedBlock,zipDigest:this.zipDigest})}async saveEvents({events:e,lastBlock:a}){await n({idb:this.idb,instanceName:this.getInstanceName(),events:e,lastBlock:a})}}class l extends r.O_{staticUrl;idb;zipDigest;constructor(e){super(e),this.staticUrl=e.staticUrl,this.idb=e.idb}async getEventsFromDB(){return await i({idb:this.idb,instanceName:this.getInstanceName()})}async getEventsFromCache(){return await b({staticUrl:this.staticUrl,instanceName:this.getInstanceName(),deployedBlock:this.deployedBlock,zipDigest:this.zipDigest})}async saveEvents({events:e,lastBlock:a}){await n({idb:this.idb,instanceName:this.getInstanceName(),events:e,lastBlock:a})}}class u extends r.JJ{staticUrl;idb;zipDigest;constructor(e){super(e),this.staticUrl=e.staticUrl,this.idb=e.idb}async getEventsFromDB(){return await i({idb:this.idb,instanceName:this.getInstanceName()})}async getEventsFromCache(){return await b({staticUrl:this.staticUrl,instanceName:this.getInstanceName(),deployedBlock:this.deployedBlock,zipDigest:this.zipDigest})}async saveEvents({events:e,lastBlock:a}){await n({idb:this.idb,instanceName:this.getInstanceName(),events:e,lastBlock:a})}}class h extends r.cE{staticUrl;idb;zipDigest;relayerJsonDigest;constructor(e){super(e),this.staticUrl=e.staticUrl,this.idb=e.idb}async getEventsFromDB(){return await i({idb:this.idb,instanceName:this.getInstanceName()})}async getEventsFromCache(){return await b({staticUrl:this.staticUrl,instanceName:this.getInstanceName(),deployedBlock:this.deployedBlock,zipDigest:this.zipDigest})}async saveEvents({events:e,lastBlock:a}){await n({idb:this.idb,instanceName:this.getInstanceName(),events:e,lastBlock:a})}async getRelayersFromDB(){try{const e=await this.idb.getAll({storeName:`relayers_${this.netId}`});return e?.length?e.slice(-1)[0]:{lastBlock:0,timestamp:0,relayers:[]}}catch(e){return console.log("Method getRelayersFromDB has error"),console.log(e),{lastBlock:0,timestamp:0,relayers:[]}}}async getRelayersFromCache(){const e=`${this.staticUrl}/relayers.json`;try{const a=await(0,d.Fd)(e,{method:"GET",returnResponse:!0}),t=new Uint8Array(await a.arrayBuffer());if(this.relayerJsonDigest){const a="sha384-"+(0,f.if)(await(0,f.br)(t));if(a!==this.relayerJsonDigest){const t=`Invalid digest hash for ${e}, wants ${this.relayerJsonDigest} has ${a}`;throw new Error(t)}}return JSON.parse((new TextDecoder).decode(t))}catch(e){return console.log("Method getRelayersFromCache has error"),console.log(e),{lastBlock:0,timestamp:0,relayers:[]}}}async saveRelayers(e){try{await this.idb.putItem({data:e,storeName:`relayers_${this.netId}`})}catch(e){console.log("Method saveRelayers has error"),console.log(e)}}}class p extends r.Do{staticUrl;idb;zipDigest;relayerJsonDigest;constructor(e){super(e),this.staticUrl=e.staticUrl,this.idb=e.idb}async getEventsFromDB(){return await i({idb:this.idb,instanceName:this.getInstanceName()})}async getEventsFromCache(){return await b({staticUrl:this.staticUrl,instanceName:this.getInstanceName(),deployedBlock:this.deployedBlock,zipDigest:this.zipDigest})}async saveEvents({events:e,lastBlock:a}){await n({idb:this.idb,instanceName:this.getInstanceName(),events:e,lastBlock:a})}}},94513:(e,a,t)=>{"use strict";t.r(a),t.d(a,{BaseEchoService:()=>d.GS,BaseEncryptedNotesService:()=>d.O_,BaseEventsService:()=>d.uw,BaseGovernanceService:()=>d.JJ,BaseMultiTornadoService:()=>d.lG,BaseRegistryService:()=>d.cE,BaseRevenueService:()=>d.Do,BaseTornadoService:()=>d.e0,DBEchoService:()=>r.xc,DBEncryptedNotesService:()=>r.$B,DBGovernanceService:()=>r.Aq,DBRegistryService:()=>r.hD,DBRevenueService:()=>r.wV,DBTornadoService:()=>r.f8,getTovarishNetworks:()=>d.EU,loadDBEvents:()=>r.w8,loadRemoteEvents:()=>r.Oz,proposalState:()=>d.sf,saveDBEvents:()=>r.Fb});var c=t(61060),f={};for(const e in c)"default"!==e&&(f[e]=()=>c[e]);t.d(a,f);var d=t(96221),r=t(12591)},61060:()=>{},37182:(e,a,t)=>{"use strict";t.d(a,{N:()=>d,o:()=>r});var c=t(99770),f=t(79453);function d(e,a,t=18){const c=BigInt(10**Number(t));return BigInt(e)*c/BigInt(a)}class r{provider;ovmGasPriceOracle;constructor(e,a){this.provider=e,a&&(this.ovmGasPriceOracle=a)}async gasPrice(){const[e,a,t]=await Promise.all([this.provider.getBlock("latest"),(async()=>{try{return BigInt(await this.provider.send("eth_gasPrice",[]))}catch{return(0,c.XS)("1","gwei")}})(),(async()=>{try{return BigInt(await this.provider.send("eth_maxPriorityFeePerGas",[]))}catch{return BigInt(0)}})()]);return e?.baseFeePerGas?e.baseFeePerGas*BigInt(15)/BigInt(10)+t:a}fetchL1OptimismFee(e){return this.ovmGasPriceOracle?(e||(e={type:0,gasLimit:1e6,nonce:1024,data:"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111",gasPrice:(0,c.XS)("1","gwei"),to:"0x1111111111111111111111111111111111111111"}),this.ovmGasPriceOracle.getL1Fee.staticCall(f.Z.from(e).unsignedSerialized)):new Promise((e=>e(BigInt(0))))}defaultEthRefund(e,a){return(e?BigInt(e):(0,c.XS)("30","gwei"))*BigInt(a||1e6)}calculateTokenAmount(e,a,t){return d(e,a,t)}calculateRelayerFee({gasPrice:e,gasLimit:a=6e5,l1Fee:t=0,denomination:c,ethRefund:f=BigInt(0),tokenPriceInWei:r,tokenDecimals:n=18,relayerFeePercent:i=.33,isEth:b=!0,premiumPercent:o=20}){const s=BigInt(e)*BigInt(a)+BigInt(t),l=BigInt(c)*BigInt(Math.floor(1e4*i))/BigInt(1e6);return b?(s+l)*BigInt(o?100+o:100)/BigInt(100):(d(s+BigInt(f),r,n)+l)*BigInt(o?100+o:100)/BigInt(100)}}},56079:(e,a,t)=>{"use strict";t.d(a,{Qx:()=>r,X:()=>i,dT:()=>d,x5:()=>n});var c=t(41442),f=t(59499);const d={[f.zr.MAINNET]:"0x391E7C679d29bD940d63be94AD22A25d25b5A604",[f.zr.BSC]:"0x391E7C679d29bD940d63be94AD22A25d25b5A604",[f.zr.POLYGON]:"0x391E7C679d29bD940d63be94AD22A25d25b5A604",[f.zr.OPTIMISM]:"0x391E7C679d29bD940d63be94AD22A25d25b5A604",[f.zr.ARBITRUM]:"0x391E7C679d29bD940d63be94AD22A25d25b5A604",[f.zr.GNOSIS]:"0x391E7C679d29bD940d63be94AD22A25d25b5A604",[f.zr.AVALANCHE]:"0x391E7C679d29bD940d63be94AD22A25d25b5A604"},r={[f.zr.MAINNET]:255,[f.zr.BSC]:14,[f.zr.POLYGON]:17,[f.zr.OPTIMISM]:55,[f.zr.ARBITRUM]:57,[f.zr.GNOSIS]:16,[f.zr.AVALANCHE]:15,[f.zr.SEPOLIA]:102};function n(e,a){let t="0x";if((0,c.PW)(e)){if(42!==e.length)return null;t+="02",t+=e.slice(2)}else t+="01";for(const e in a)t+=Number(a[e]).toString(16).padStart(4,"0");return t}function i(e){return{min:1/e,max:50/e,ethUsd:e}}},49540:(e,a,t)=>{"use strict";t.d(a,{B:()=>c,l:()=>f});const c="0x38600c600039612b1b6000f3606460006000377c01000000000000000000000000000000000000000000000000000000006000510463f47d33b5146200003557fe5b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000016004518160245181838180828009800909089082827f0fbe43c36a80e36d7c7c584d4f8f3759fb51f0d66065d8a227b688d12488c5d408839081808280098009098391089082827f9c48cd3e00a6195a253fc009e60f249456f802ff9baf6549210d201321efc1cc08839081808280098009098391089082827f27c0849dba2643077c13eb42ffb97663cdcecd669bf10f756be30bab71b86cf808839081808280098009098391089082827f2bf76744736132e5c68f7dfdd5b792681d415098554fd8280f00d11b172b80d208839081808280098009098391089082827f33133eb4a1a1ab45037c8bdf9adbb2999baf06f20a9c95180dc4ccdcbec5856808839081808280098009098391089082827f588bb66012356dbc9b059ef1d792b563d6c18624dddecc3fe4583fd3551e9b3008839081808280098009098391089082827f71bc3e244e1b92911fe7f53cf523e491fd6ff487d59337a1d92f92668c4f4c3608839081808280098009098391089082827fd1808e2b039fd010c489768f78d7499938ccc0858f3295151787cfe8b7e40be108839081808280098009098391089082827f76978af3ded437cf41b3faa40cd6bcfce94f27f4abcc3ed34be19abd2c4537d008839081808280098009098391089082827f0a9baee798a320b0ca5b1cf888386d1dc12c13b38e10225aa4e9f03069a099f508839081808280098009098391089082827fb79dbf6050a03b16c3ade8d77e11c767d2251af9cdbd6cdf9a8a0ee921b32c7908839081808280098009098391089082827fa74bbcf5067f067faec2cce4b98d130d7927456f5c5f6c00e0f5406a24eb8b1908839081808280098009098391089082827fab7ab080d4c4018bda6ecc8bd67468bc4619ba12f25b0da879a639c758c8855d08839081808280098009098391089082827fe6a5b797c2bba7e9a873b37f5c41adc47765e9be4a1f0e0650e6a24ad226876308839081808280098009098391089082827f6270ae87cf3d82cf9c0b5f428466c429d7b7cbe234cecff39969171af006016c08839081808280098009098391089082827f9951c9f6e76d636b52f7600d979ca9f3b643dfbe9551c83b31542830321b2a6608839081808280098009098391089082827f4119469e44229cc40c4ff555a2b6f6b39961088e741e3c20a3c9b47f130c555008839081808280098009098391089082827f5d795e02bbaf90ff1f384741e5f18f8b644a0080441315d0e5b3c8123452a0b008839081808280098009098391089082827f281e90a515e6409e9177b4f297f8049ce3d4c3659423c48b3fd64e83596ff10108839081808280098009098391089082827f424185c60a21e84970f7d32cacaa2725aa8a844caea7ed760d2b965af1bf3e7d08839081808280098009098391089082827fd96fcbc3960614ea887da609187a5dada2e1b829f23309a6375212cea1f25c0908839081808280098009098391089082827ffde84026d7c294300af18f7712fc3662f43387ae8cf7fdda1f9a810f4b24bcf208839081808280098009098391089082827f3a9d568575846aa6b8a890b3c237fd0447426db878e6e25333b8eb9b386195c108839081808280098009098391089082827f55a2aa32c84a4cae196dd4094b685dd11757470a3be094d98eea73f02452aa3608839081808280098009098391089082827fcbc9481380978d29ebc5b0a8d4481cd2ef654ee800907adb3d38dc2fd9265fab08839081808280098009098391089082827f24e53af71ef06bacb76d3294c11223911e9d177ff09b7009febc484add0beb7408839081808280098009098391089082827fdbd44e16108225766dac3e5fe7acbe9df519bbba97380e5e9437a90658f2139308839081808280098009098391089082827fc6f434863c79013bb2c202331e04bccea2251c1ff6f191dc2afa23e6f6d28e4e08839081808280098009098391089082827f3490eeb39a733c0e8062d87f981ae65a8fccf25c448f4455d27db3915351b06608839081808280098009098391089082827f30b89830ff7ade3558a5361a24869130ce1fcce97211602962e34859525dac4f08839081808280098009098391089082827f29bae21b579d080a75c1694da628d0ecfd83efc9c8468704f410300062f64ca908839081808280098009098391089082827fe326499de0476e719915dd1c661ef4550723d4aee9ee9af224edd208790fce4408839081808280098009098391089082827f8c45208b8baa6f473821415957088c0b7e72a465f460b09ece2d270aee2f184108839081808280098009098391089082827ffe2ad454f451348f26ce2cc7e7914aef3eb96e8f89a4619a1dc7d11f8401c35208839081808280098009098391089082827f0929db368ef2af2d29bca38845325b0b7a820a4889e44b5829bbe1ed47fd4d5208839081808280098009098391089082827f16531d424b0cbaf9abbf2d2acde698462ea4555bf32ccf1bbd26697e905066f608839081808280098009098391089082827ff5c30d247f045ff6d05cf0dd0a49c9823e7a24b0d751d3c721353b96f29d76f608839081808280098009098391089082827f6eb7a3614056c230c6f171370fdd9d1048bb00b2cdd1b2721d11bdda5023f48608839081808280098009098391089082827f0ee9c4621642a272f710908707557498d25a6fdd51866da5d9f0d205355a618908839081808280098009098391089082827f78ca1cb1c7f6c6894d1cf94f327b8763be173151b6b06f99dfc6a944bb5a72f008839081808280098009098391089082827f5d24d0b1b304d05311ce0f274b0d93746a4860ed5cdd8d4348de557ea7a5ee7a08839081808280098009098391089082827f77423dabd1a3cddc8691438fc5891e3fd49ac0f3e21aaf249791bfde1303d2f308839081808280098009098391089082827f0642e8800a48cc04c0168232c6f542396597a67cf395ad622d947e98bb68697a08839081808280098009098391089082827fc1e7d3cbbc4c35b7490647d8402e56d334336943bda91fe2d34ca9727c0e3df508839081808280098009098391089082827f8d6fb1730335204f38f85e408ac861e76f24349ab6ee0469c22e19350bb24fe108839081808280098009098391089082827f67d0faf5f0db32a1b60e13dc4914246b9edac7990fb4990b19aa86815586441a08839081808280098009098391089082827f2605b9b909ded1b04971eae979027c4e0de57f3b6a60d5ed58aba619c34749ce08839081808280098009098391089082827fd276890b2c205db85f000d1f5111ed8f177e279cae3e52862780f04e846228d008839081808280098009098391089082827f2ac5905f9450a21ef6905ed5951a91b3730e3a2e2d62b50bdeb810015d50376b08839081808280098009098391089082827f7a366839f0291ca54da674ac3f0e1e9aa8b687ba533926cb40268039e57b967a08839081808280098009098391089082827f67ab0f3466989c3dbbe209c37ec272ba83984ba6e445be6d472b63e3ca7270e308839081808280098009098391089082827f0e786007d0ce7e28a90e31d3263887d40c556dec88fcb8b56bc9e9c05ecc0c2908839081808280098009098391089082827f0b814ed99bd00eca389b0022663dbfddfbfa15e321c19abcf1eaf9556075fb6808839081808280098009098391089082827f65c0321ba26fcee4fdc35b4999b78ceb54dcaf9fec2e3bdea98e9f82925c093208839081808280098009098391089082827fab2d2a929601f9c3520e0b14aaa6ba9f1e79821a5b768919670a4ea970722bf408839081808280098009098391089082827fcdd2e0744d4af1a81918de69ec12128a5871367303ff83ed764771cbbdf6502308839081808280098009098391089082827f74527d0c0868f2ec628086b874fa66a7347d3d3b918d2e07a5f33e1067e8ac5808839081808280098009098391089082827f1c6bf6ac0314caead23e357bfcbbaa17d670672ae3a475f80934c716f10aca2508839081808280098009098391089082827f3c4007e286f8dc7efd5d0eeb0e95d7aa6589361d128a0cccb17b554c851a643208839081808280098009098391089082827fae468a86a5a7db7c763a053eb09ac1a02809ce095258c88101ee319e12b0697e08839081808280098009098391089082827f9333e3d052b7c77fcac1eb366f610f6f97852242b1317a87b80f3bbc5c8c2d1d08839081808280098009098391089082827f52ec1d675cf5353153f6b628414783ca6b7fc0fe01948ca206daad712296e39508839081808280098009098391089082827f13ceeeb301572b4991076750e11ea7e7fcbfee454d90dc1763989004a1894f9308839081808280098009098391089082827f8505737e7e94939a08d8cda10b6fbbbf879b2141ae7eabc30fcd22405135fe6408839081808280098009098391089082827f6127db7ac5200a212092b66ec2bfc63653f4dc8ac66c76008fef885258a258b508839081808280098009098391089082827f12692a7d808f44e31d628dbcfea377eb073fb918d7beb8136ea47f8cf094c88c08839081808280098009098391089082827f260e384b1268e3a347c91d6987fd280fa0a275541a7c5be34bf126af35c962e008839081808280098009098391089082827fd88c3b01966d90e713aee8d482ceaa6925311d2342e1a5aca4fcd2f44b6daddc08839081808280098009098391089082827fb87e868affd91b078a87fa75ac9332a6cf23587d94e20c3262db5e91f30bf04b08839081808280098009098391089082827fb5ba5f8acad1a950a3bbf2201055cd3ea27056c0c53f0c4c97f33cda8dbfe90908839081808280098009098391089082827f59ca814b49e00d7b3118c53a2986ded128584acd7428735e08ade6661c457f7508839081808280098009098391089082827f0fc4c0bea813a223fd510c07f7bbe337badd4bcf28649a0d378970c2a15b3aa508839081808280098009098391089082827f0053f1ea6dd60e7a6db09a00be77549ff3d4ee3737be7fb42052ae1321f667c308839081808280098009098391089082827feb937077bb10c8fe38716d4e38edc1f9e7b18c6414fef85fe7e9c5567baa4a0408839081808280098009098391089082827fbacb14c0f1508d828f7fd048d716b8044aec7f0fb48e85e717bf532db972520708839081808280098009098391089082827f4ca0abb8beb7cff572a0c1e6f58e080e1bb243d497a3e74538442a4555ad40be08839081808280098009098391089082827fda9eefd411e590d7e44592cce298af87b2c62aa3cc8bb137aa99ca8d4aa551b508839081808280098009098391089082827f153dae43cef763e7a2fc9846f09a2973b0ad9c35894c220699bcc2954501c6bd08839081808280098009098391089082827fd4ed2a09375813b4fb504c7a9ba13110bdd8549a47349db82c15a434c090e87b08839081808280098009098391089082827f0063a5c4c9c12dcf4bae72c69f3a225664469503d61d9eae5d9553bfb006095b08839081808280098009098391089082827fdc8a4d35ad28e59dd3713b45985cd3b70e37ccc2be42086f1ea078fe2dc9d82d08839081808280098009098391089082827f486ba219308f0c847b22fcb4449f8855192536c01b8057904e81c1c7814f483b08839081808280098009098391089082827f34d9604140a1ac9fdb204285b9fe1b303c281af2fc5fb362f6577282b423bcf308839081808280098009098391089082827fc1681959ec4bc3656911db2b2f56aa4db709c26f1a0a25c879286e37f437465d08839081808280098009098391089082827ffcd849f3b5f9e4368af75619fb27f2e335adbb9b44988f17c4d389fa751ad47a08839081808280098009098391089082827ff5f7fc22ad64c8e7c1e005110e13f4f1c6b1f8f8cc59000db0e3bb38f99554a508839081808280098009098391089082827fa9133b8a20fbae4633ec5f82cb47a38ae1877d12d1febb23982c7c808aa5317508839081808280098009098391089082827ff4827c5c7b61141cc31b75984bb3ed16ed579e5b72e32a1289b63ab55eaf8c1208839081808280098009098391089082827fcca361819ffefe3e50fe34c91a322c9405f4e5a168c1fc0a0a1883993e32c9f408839081808280098009098391089082827f6656088842bfc9e325a532784d3362cecfa86f9c7b208a6b499836ebe48ff15708839081808280098009098391089082827f00129c7cd00e42ed05a37dbceb80d47b65e1d750ef2148278a54723fdf42c4cc08839081808280098009098391089082827fa85b235631b786f85cd46f7768f6c71ae004ad267ae59bdf929ada149b19588808839081808280098009098391089082827f34df65a82686be09c5b237911abf237a9887c1a418f279ac79b446d7d311f5ea08839081808280098009098391089082827f815a850c3989df9ca6231e0bdd9916fc0e076f2c6c7f0f260a846d0179f9c32d08839081808280098009098391089082827f50fb0940848a67aee83d348421fadd79aefc7a2adabeec6e64904ebe1bf63e7d08839081808280098009098391089082827fbab63a16273599f8b66895461e62a19ff0d103693be771d93e3691bba89cdd8d08839081808280098009098391089082827f6931a091756e0bc709ebecfffba5038634c5b3d5d0c5876dd72aac67452db8a208839081808280098009098391089082827f55559b8bb79db8809c46ee627f1b5ce1d8e6d89bf94a9987a1407759d1ba896308839081808280098009098391089082827fa9a1a11b2979018cb155914d09f1df19b7ffec241e8b2487b6f6272a56a44a0a08839081808280098009098391089082827ff83293400e7bccea4bb86dcb0d5ca57fa2466e13a572d7d3531c6fa491cb0f1b08839081808280098009098391089082827fb7cb5742b6bc5339624d3568a33c21f31b877f8396972582028da999abf249f208839081808280098009098391089082827ff56efb400f8500b5c5bf811c65c86c7ed2e965f14f1a69bca436c0c60b79f46508839081808280098009098391089082827fd7c4427998d9c440f849dcd75b7157996eaad1b9a1d58cc2441931300e26eb2208839081808280098009098391089082827fca5ed18ad53e33fdc3ae8cf353ff3f6dd315f60060442b74f6b614b24ebd4cc308839081808280098009098391089082827f9ad3e9376c97b194a0fbf43e22a3616981d777365c765ead09a1d033fdf536b708839081808280098009098391089082827fc6daeff5769a06b26fe3b8fef30df07b1387373a7814cef364fe1d6059eaf54a08839081808280098009098391089082827fc20a78398345c6b8cf439643dab96223bf879c302648293eaf496fee5c978c6608839081808280098009098391089082827f589ca65b6cf0e90653c06dddc057dc61ba2839974569051c98b43e8618716efb08839081808280098009098391089082827f83064161f127d8c59fc73625957e21630dc6dc99e5443f6ce37ecd6bf28e69b708839081808280098009098391089082827f46d0ba662b50100b9a3af52052f68932feec1d12290b2033c4f49148893d8ba308839081808280098009098391089082827f18dd55b4a83a53f2ee578eb3e6d26f594824d44670fc3f4de80642344d15c09a08839081808280098009098391089082827f9fb5b594f48bc58b345ab90ded705920a7274b8e070eee8ce8cf90c72c3604b608839081808280098009098391089082827f1901d8f4f2c8449128e00663978f2050f2eb1cd6acb60d9d09c57c5d46ee54fe08839081808280098009098391089082827f5ec56789beab24ef7ee32f594d5fc561ec59dfeb93606dc7dcc6fe65133a7db408839081808280098009098391089082827f01c0b2cbe4fa9877a3d08eb67c510e8630da0a8beda94a6d9283e6f70d268bc508839081808280098009098391089082827f0b1d85acd9031a9107350eed946a25734e974799c5ba7cff13b15a5a623a25f008839081808280098009098391089082827f204497d1d359552905a2fe655f3d6f94926ea92d12cdaa6556ec26362f239f6408839081808280098009098391089082827fe075f7edc6631a8d7ffe33019f44fc91f286236d5a5f90f16de4791b72a2a5f008839081808280098009098391089082827f243f46e353354256ab8fe0ca4e9230dfc330bc163e602dfeaf307c1d1a7264b908839081808280098009098391089082827fd448ae5e09625fa1fcfd732fc9cd8f06e4c33b81f0a9240c83da56f41e9ecceb08839081808280098009098391089082827f2f312eef69a33d9fa753c08840275692a03432b3e6da67f9c59b9f9f4971cd5608839081808280098009098391089082827f5f333996af231bd5a293137da91801e191a6f24eb532ad1a7e6e9a2ad0efbc0008839081808280098009098391089082827fa8f771e0383a832dc8e2eaa8efabda300947acaf0684fabddf8b4abb0abd8a6208839081808280098009098391089082827f9ff0b3d7a4643596f651b70c1963cc4fa6c46018d78f05cb2c5f187e25df83a908839081808280098009098391089082827f9c373b704838325648273734dcdf962d7c156f431f70380ba4855832c4a238b808839081808280098009098391089082827fea2afa02604b8afeeb570f48a0e97a5e6bfe9613394b9a6b0026ecd6cec8c33a08839081808280098009098391089082827f68892258cd8eb43b71caa6d6837ec9959bfdfd72f25c9005ebaffc4011f8a7bf08839081808280098009098391089082827ff2824f561f6f82e3c1232836b0d268fa3b1b5489edd39a5fe1503bfc7ca91f4908839081808280098009098391089082827f164eda75fda2861f9d812f24e37ac938844fbe383c243b32b9f66ae2e76be71908839081808280098009098391089082827ff0a6fc431f5bf0dd1cca93b8b65b3f72c91f0693e2c74be9243b15abb31afcc008839081808280098009098391089082827fe68db66ba891ef0cd527f09ec6fff3ec0a269cf3d891a35ec13c902f70334b4f08839081808280098009098391089082827f3a44a5b102f7883a2b8630a3cae6e6db2e6e483bb7cfeb3492cbd91793ef598e08839081808280098009098391089082827f43939fe8ef789acb33cbf129ba8a3aa1bd61510a178022a05177c9c5a1c59bf108839081808280098009098391089082827f936fe3b66dfda1bc5a7aae241b4db442858bd720c1d579c0c869f273cd55d77408839081808280098009098391089082827f3490fcaa8ffa37f35dc67ae006e81352c7103945417b8e4b142afcaefa344b8508839081808280098009098391089082827fcae66096cff344caca53ffe0e58aafeb468bd174f00d8abc425b2099c088187408839081808280098009098391089082827fc7d05783a41bc14f3c9a45384b6d5e2547c5b6a224c8316910b208f2718a70ab08839081808280098009098391089082827f5ac6b9ba94040d5692b865b6677b60ef3201b5c2121699f70beb9f9b2528a02608839081808280098009098391089082827fa902a3d4d9ecbfb9b2c76fddf780554bf93cad97b244e805d3adb94e1816290008839081808280098009098391089082827fe9df91ffeeb086a4d26041c29dac6fca1d56a4d022fe34b38831267395b98d2708839081808280098009098391089082827f862646f851d91a8840ad9ee711f12ec13b3e8f980ff5ef5ee43ca4520d57def708839081808280098009098391089082827f30b7381c9725b9db07816baf8524943a79cea135807c84cce0833485c11e0c2e08839081808280098009098391089082827f96afc10c5cedaddbda99df79387397c9be74a5b50f3a0c04ccb68d4e0f3a989f08839081808280098009098391089082827f3543da80d10da251c548776fe907c4ef89993d62e0062ae5c0496fcb851c366108839081808280098009098391089082827fe5140fe26d8b008430fccd50a68e3e11c1163d63b6d8b7cc40bc6f3c1d0b1b0608839081808280098009098391089082827ffefdf1872e4475e8bbb0ef6fab7f561bff121314695c433bd4c29ec118060c9608839081808280098009098391089082827f6bb8c9f3d57b18e002df059db1e6a5d42ad566f153f18460774f68ac2650940008839081808280098009098391089082827f5415122d50b26f4fab5784004c56cf03f128f825ad2236f4b3d51f74737bd97308839081808280098009098391089082827f00e115c4a98efae6a3a5ecc873b0cef63ccd5b515710a3ab03ec52218f784dc908839081808280098009098391089082827fda7d525427bad87b88238657c21331245578bc76aa6240b7f972382537a202ab08839081808280098009098391089082827f83332e8b34505b83010270dc795290a2f515b8f89c163acecdf4799df04c62f808839081808280098009098391089082827fb09ecb6033d1a065f17a61066cd737d0c3c5873b51c3ab0a285e26939e62aa1808839081808280098009098391089082827f24e65c718938c2b937378e7435332174329730bde85a4185e37875824eb4985908839081808280098009098391089082827f68e41430ccd41cc5e92a9f9acd2e955c1385b9f5ed8d3f133d767429484a8eba08839081808280098009098391089082827fc038fe9d0125ab8be54545276f841274e414c596ed4c9eaa6919604603d1ffa908839081808280098009098391089082827f23248698612cd8e83234fcf5db9b6b225f4b0ba78d72ef13ea1edff5f0fb029808839081808280098009098391089082827fd2a9fa3d39c1ba91eefa666a1db71c6e0e4e3b707626b0197a4e59e7110cf0d408839081808280098009098391089082827fc28931ee7dfa02b62872e0d937ba3dc5c637118273a1f1f0c4fc880905c82efc08839081808280098009098391089082827f01cd399556445e3d7b201d6c5e56a5794e60be2cfd9a4643e7ead79bb4f60f7908839081808280098009098391089082827fac855cc58d5fbb0dff91a79683eb0e914c1b7d8d0a540d416838a89f83a8312f08839081808280098009098391089082827ff7798af7ccf36b836705849f7dd40328bf9346657255b431446ec75a6817181608839081808280098009098391089082827fe52a24c92d3f067bf551eeaf98c62ba525e84882d7adad835fad8de72986b2b108839081808280098009098391089082827fffc8682759a2bf1dd67c87a77c285467801f1c44fd78fa4eb5957a4832c9d72d08839081808280098009098391089082827f1482ac3e7e4f321627850d95a13942aea6d2923402b913046856ff7e8aaf9aff08839081808280098009098391089082827f17332b4c7aac2a07ccfe954de7ad22ccf6fcb4c5fa15c130ed22a40ae9398f4708839081808280098009098391089082827fd4be0546013f84a0d1e118b37589723b58e323983263616d1b036f8b3fdd858308839081808280098009098391089082827fa64ec737d31dddf939b184438ccdd3e1d3e667572857cd6c9c31a0d1d9b7b08508839081808280098009098391089082827f8ad12fbc74117cff4743d674539c86548c6758710a07a6abe3715e4b53526d3408839081808280098009098391089082827f15a16435a2300b27a337561401f06682ba85019aa0af61b264a1177d38b5c13c08839081808280098009098391089082827f22616f306e76352293a22ab6ee15509d9b108d4136b32fa7f9ed259793f392a108839081808280098009098391089082827f519727b25560caf00ce0d3f911bd4356f907160ab5186da10a629c7ccae1851e08839081808280098009098391089082827fcff39e77928ce9310118d50e29bc87e7f78b53ad51366359aa17f07902ae639208839081808280098009098391089082827f17dead3bfa1968c744118023dead77cdbee22c5b7c2414f5a6bdf82fd94cf3ad08839081808280098009098391089082827f2bef0f8b22a1cfb90100f4a552a9d02b772130123de8144a00c4d57497e1d7f408839081808280098009098391089082827fbf5188713fef90b31c35243f92cfa4331ab076e30e24b355c79b01f41d152a1108839081808280098009098391089082827f3baadd2fd92e3e12fb371be0578941dc0a108fbca0a7d81b88316fb94d6b4dfe08839081808280098009098391089082827fd4f955742e20a28d38611bf9fc4a478c97b673a7cd40d0113a58a1efe338d9aa08839081808280098009098391089082827f3c1c3fe9a5f7ccd54ad5a51a224b3f94775266d19c3733017e4920d7391ad64508839081808280098009098391089082827f6372df6148abeed66fda5461779a9651130c6c525df733852bcd929016768a7a08839081808280098009098391089082827f6d098e848fb853f95adb5a6364b5ab33c79fb08877f2cf3e0e160d9fcb3ebcc508839081808280098009098391089082827f48c5fc90f27431fabfe496dfba14bb0dba71141eb5472a365fd13023f4fe629608839081808280098009098391089082827fbb988dfc0c4dfe53999bd34840adcb63fdbf501ccd622ca2ddf5064ad8cdebf408839081808280098009098391089082827f25b068c942724c424ed5851c9575c22752c9bd25f91ebfa589de3d88ee7627f908839081808280098009098391089082827fed98a1931e361add218de11ff7879bd7114cda19c24ddbe15b3b0190ce01e1aa08839081808280098009098391089082827fc80b5a7d63f6c43542ad612023d3ffd6c684ce2eab837180addcb4decf51854408839081808280098009098391089082827fe2ef24bf47c5203118c6ff96657dd3c6fdff7212d5c798d826455de77b4b70cd08839081808280098009098391089082827f907da812fd5a8375587e4860f87691d0a8d61d454c507d09e5562e1a5d0fcc7608839081808280098009098391089082827fc459abbc62bc6070cacdff597e97990de56edc51cc6643afb0f6789fef1bad6308839081808280098009098391089082827f38d61f5e566855d70d36ef0f0f1fefcd7c829bdd60d95e0ef1fb5b98856280a408839081808280098009098391089082827f13218626665c420d3aa2b0fa49224a3dce8e08b8b56f8851bd9cb5e25cb3042d08839081808280098009098391089082827f6f685fb152dba21b4d02422e237e246df73d7d711ae6d7d33983bae0f873e31008839081808280098009098391089082827f5ade34719e2498dde70e4571c40474475a4af706a3cb82ac18a7fa44c22d1c4708839081808280098009098391089082827f8a0c3dc7a496adca059cb95d9b173812a00f3c4d435e0b9e8116e0c4b5f56acb08839081808280098009098391089082827f196bc98252f63169ed79073ee091a0e8ed0b5af51017da143940c00bdb86370908839081808280098009098391089082827fd979bf70695d93f8efb552a413701918afec9e12dfe213f4d0c27cfa68fad6c208839081808280098009098391089082827fb803072d02f54d237a3c6c4cc18eda6dce87a03c6819df54e4ed8aed6dc56d4608839081808280098009098391089082827f1efcda9d986cddcf431af4d59c6a7709d650885b7886cba70f0e7cd92b331cdc08839081808280098009098391089082827fd3ca5f7859b82ac50b63da06d43aa68a6b685f0a60397638bbea173b3f60419208839081808280098009098391089082827fa59d392c0667316ad37a06be2d51aabe9e79bdef0013bc109985648a14c7e41f08839081808280098009098391089082827fac2f5f0d2146791b396e2bed6cf15a20bc22cc4c8cf7dd4b3514ac00148dd0a708839081808280098009098391089082827f17a993a6af068d72bc36f0e814d29fef3f97d7a72aa963889b16a8457409861a08839081808280098009098391089082827f6f1bf99686550e0396f7f4e2df6fdaa090fbc272c8c76eb32a3c6791de5a07b508839081808280098009098391089082827f8234d705e1ecdc59cc6ed40749069d4b45e63deb49b5b7d7f527abd31c072b1b08839081808280098009098391089082827f6fe929a1fd6aacba5c4012c45dd727d2c816119567450003913d882cb97bc47e08839081808280098009098391089082827fad5371215f2aba49026b2e48739c11b4d8ffbb24dd4a6e41b9763862af96787a08839081808280098009098391089082827fd0e704566c49e1a11edc2c128b2e07f36dc0c755468268f8fe4c4859b9fa595b08839081808280098009098391089082827f263e1195090d00be1d8fb37de17ccf3b66d180645efa0d831865cfaa8797769e08839081808280098009098391089082827fe65c090eebde2cfa7f9c92cf75641c7683fb8e81f4a48f5b7a9c7eb26a85029f08839081808280098009098391089082827fa18971781c6855f6a9752912780bb9b719c14a677a4c6393d62d6e046b97a2ac08839081808280098009098391089082827ff6fc1ef1bca8bec055cc66edecc5dc99030fe78311a3f21d8cd624df4f89e62508839081808280098009098391089082827f824e4e2838501516d3296542cb47a59a1ca4326e947c9c874d88dccc8e37b99a08839081808280098009098391089082827f3cd5a9e7353a50e454c9c1381b556b543897cc89153c3e3749f2021d8237226308839081808280098009098391089082827fb4bcedbd54d0c917a315cc7ca785e3c5995abbeeb3deb3ebaf02c7a9bf6cc83f08839081808280098009098391089082827f1f7476211105b3039cef009c51155ae93526c53a74973ecfce40754b3df1052108839081808280098009098391089082827f58aefbd978440c94b4b9fbd36e00e6e36caeacf82b0da0a6161d34c541a5a6e308839081808280098009098391089082827fc22cd6d61be780a33c77677bc6ba40307b597ed981db57cb485313eec2a5a49708839081808280098009098391089082827fd9ffc4fe0dc5f835c8dcdc1e60b8f0b1637f32a809175371b94a057272b0748d08839081808280098009098391089082827ff6a5268541bc4c64ad0ade8f55dda3492604857a71c923662a214dd7e9c20c1008839081808280098009098391089082826000088390818082800980090983910860205260005260406000f3";function f(e){return e.sendTransaction({data:c})}},83968:(e,a,t)=>{"use strict";t.d(a,{Fl:()=>C,mc:()=>M,W7:()=>B});const c=(e,a)=>a.some((a=>e instanceof a));let f,d;const r=new WeakMap,n=new WeakMap,i=new WeakMap;let b={get(e,a,t){if(e instanceof IDBTransaction){if("done"===a)return r.get(e);if("store"===a)return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return l(e[a])},set:(e,a,t)=>(e[a]=t,!0),has:(e,a)=>e instanceof IDBTransaction&&("done"===a||"store"===a)||a in e};function o(e){b=e(b)}function s(e){return"function"==typeof e?(a=e,(d||(d=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(a)?function(...e){return a.apply(u(this),e),l(this.request)}:function(...e){return l(a.apply(u(this),e))}):(e instanceof IDBTransaction&&function(e){if(r.has(e))return;const a=new Promise(((a,t)=>{const c=()=>{e.removeEventListener("complete",f),e.removeEventListener("error",d),e.removeEventListener("abort",d)},f=()=>{a(),c()},d=()=>{t(e.error||new DOMException("AbortError","AbortError")),c()};e.addEventListener("complete",f),e.addEventListener("error",d),e.addEventListener("abort",d)}));r.set(e,a)}(e),c(e,f||(f=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,b):e);var a}function l(e){if(e instanceof IDBRequest)return function(e){const a=new Promise(((a,t)=>{const c=()=>{e.removeEventListener("success",f),e.removeEventListener("error",d)},f=()=>{a(l(e.result)),c()},d=()=>{t(e.error),c()};e.addEventListener("success",f),e.addEventListener("error",d)}));return i.set(a,e),a}(e);if(n.has(e))return n.get(e);const a=s(e);return a!==e&&(n.set(e,a),i.set(a,e)),a}const u=e=>i.get(e),h=["get","getKey","getAll","getAllKeys","count"],p=["put","add","delete","clear"],g=new Map;function m(e,a){if(!(e instanceof IDBDatabase)||a in e||"string"!=typeof a)return;if(g.get(a))return g.get(a);const t=a.replace(/FromIndex$/,""),c=a!==t,f=p.includes(t);if(!(t in(c?IDBIndex:IDBObjectStore).prototype)||!f&&!h.includes(t))return;const d=async function(e,...a){const d=this.transaction(e,f?"readwrite":"readonly");let r=d.store;return c&&(r=r.index(a.shift())),(await Promise.all([r[t](...a),f&&d.done]))[0]};return g.set(a,d),d}o((e=>({...e,get:(a,t,c)=>m(a,t)||e.get(a,t,c),has:(a,t)=>!!m(a,t)||e.has(a,t)})));const y=["continue","continuePrimaryKey","advance"],x={},A=new WeakMap,v=new WeakMap,w={get(e,a){if(!y.includes(a))return e[a];let t=x[a];return t||(t=x[a]=function(...e){A.set(this,v.get(this)[a](...e))}),t}};async function*_(...e){let a=this;if(a instanceof IDBCursor||(a=await a.openCursor(...e)),!a)return;const t=new Proxy(a,w);for(v.set(t,a),i.set(t,u(a));a;)yield t,a=await(A.get(t)||a.continue()),A.delete(t)}function I(e,a){return a===Symbol.asyncIterator&&c(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===a&&c(e,[IDBIndex,IDBObjectStore])}o((e=>({...e,get:(a,t,c)=>I(a,t)?_:e.get(a,t,c),has:(a,t)=>I(a,t)||e.has(a,t)})));var E=t(59499);const C="A mutation operation was attempted on a database that did not allow mutations.";class M{dbExists;isBlocked;options;dbName;dbVersion;db;constructor({dbName:e,stores:a}){this.dbExists=!1,this.isBlocked=!1,this.options={upgrade(e){Object.values(e.objectStoreNames).forEach((a=>{e.deleteObjectStore(a)})),[{name:"keyval"},...a||[]].forEach((({name:a,keyPath:t,indexes:c})=>{const f=e.createObjectStore(a,{keyPath:t,autoIncrement:!0});Array.isArray(c)&&c.forEach((({name:e,unique:a=!1})=>{f.createIndex(e,e,{unique:a})}))}))}},this.dbName=e,this.dbVersion=35}async initDB(){try{if(this.dbExists||this.isBlocked)return;this.db=await function(e,a,{blocked:t,upgrade:c,blocking:f,terminated:d}={}){const r=indexedDB.open(e,a),n=l(r);return c&&r.addEventListener("upgradeneeded",(e=>{c(l(r.result),e.oldVersion,e.newVersion,l(r.transaction),e)})),t&&r.addEventListener("blocked",(e=>t(e.oldVersion,e.newVersion,e))),n.then((e=>{d&&e.addEventListener("close",(()=>d())),f&&e.addEventListener("versionchange",(e=>f(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),n}(this.dbName,this.dbVersion,this.options),this.db.addEventListener("onupgradeneeded",(async()=>{await this._removeExist()})),this.dbExists=!0}catch(e){if(e.message.includes(C))return console.log("This browser does not support IndexedDB!"),void(this.isBlocked=!0);if(e.message.includes("less than the existing version"))return console.log(`Upgrading DB ${this.dbName} to ${this.dbVersion}`),void await this._removeExist();console.error(`Method initDB has error: ${e.message}`)}}async _removeExist(){await function(e,{blocked:a}={}){const t=indexedDB.deleteDatabase(e);return a&&t.addEventListener("blocked",(e=>a(e.oldVersion,e))),l(t).then((()=>{}))}(this.dbName),this.dbExists=!1,await this.initDB()}async getFromIndex({storeName:e,indexName:a,key:t}){if(await this.initDB(),this.db)try{return await this.db.getFromIndex(e,a,t)}catch(e){throw new Error(`Method getFromIndex has error: ${e.message}`)}}async getAllFromIndex({storeName:e,indexName:a,key:t,count:c}){if(await this.initDB(),!this.db)return[];try{return await this.db.getAllFromIndex(e,a,t,c)}catch(e){throw new Error(`Method getAllFromIndex has error: ${e.message}`)}}async getItem({storeName:e,key:a}){if(await this.initDB(),this.db)try{const t=this.db.transaction(e).objectStore(e);return await t.get(a)}catch(e){throw new Error(`Method getItem has error: ${e.message}`)}}async addItem({storeName:e,data:a,key:t=""}){if(await this.initDB(),this.db)try{const c=this.db.transaction(e,"readwrite");await c.objectStore(e).get(t)||await c.objectStore(e).add(a)}catch(e){throw new Error(`Method addItem has error: ${e.message}`)}}async putItem({storeName:e,data:a,key:t}){if(await this.initDB(),this.db)try{const c=this.db.transaction(e,"readwrite");await c.objectStore(e).put(a,t)}catch(e){throw new Error(`Method putItem has error: ${e.message}`)}}async deleteItem({storeName:e,key:a}){if(await this.initDB(),this.db)try{const t=this.db.transaction(e,"readwrite");await t.objectStore(e).delete(a)}catch(e){throw new Error(`Method deleteItem has error: ${e.message}`)}}async getAll({storeName:e}){if(await this.initDB(),!this.db)return[];try{const a=this.db.transaction(e,"readonly");return await a.objectStore(e).getAll()}catch(e){throw new Error(`Method getAll has error: ${e.message}`)}}getValue(e){return this.getItem({storeName:"keyval",key:e})}setValue(e,a){return this.putItem({storeName:"keyval",key:e,data:a})}delValue(e){return this.deleteItem({storeName:"keyval",key:e})}async clearStore({storeName:e,mode:a="readwrite"}){if(await this.initDB(),this.db)try{const t=this.db.transaction(e,a);await t.objectStore(e).clear()}catch(e){throw new Error(`Method clearStore has error: ${e.message}`)}}async createTransactions({storeName:e,data:a,mode:t="readwrite"}){if(await this.initDB(),this.db)try{const c=this.db.transaction(e,t);await c.objectStore(e).add(a),await c.done}catch(e){throw new Error(`Method createTransactions has error: ${e.message}`)}}async createMultipleTransactions({storeName:e,data:a,index:t,mode:c="readwrite"}){if(await this.initDB(),this.db)try{const f=this.db.transaction(e,c);for(const e of a)e&&await f.store.put({...e,...t})}catch(e){throw new Error(`Method createMultipleTransactions has error: ${e.message}`)}}}async function B(e){if(!e){const e=new M({dbName:"tornado-core"});return await e.initDB(),e}const a=[{name:"blockNumber",unique:!1},{name:"transactionHash",unique:!1}],t=[{name:`echo_${e}`,keyPath:"eid",indexes:[...a,{name:"address",unique:!1}]},{name:`encrypted_notes_${e}`,keyPath:"eid",indexes:a},{name:"lastEvents",keyPath:"name",indexes:[{name:"name",unique:!1}]}],c=(0,E.zj)(e),{tokens:f,nativeCurrency:d,registryContract:r,governanceContract:n}=c,i=[...t];r&&(i.push({name:`registry_${e}`,keyPath:"ensName",indexes:[...a,{name:"event",unique:!1}]}),i.push({name:`relayers_${e}`,keyPath:"timestamp",indexes:[{name:"timestamp",unique:!0}]}),i.push({name:`revenue_${e}`,keyPath:"timestamp",indexes:[{name:"timestamp",unique:!0}]})),n&&i.push({name:`governance_${e}`,keyPath:"eid",indexes:[...a,{name:"event",unique:!1}]}),Object.entries(f).forEach((([t,{instanceAddress:c}])=>{Object.keys(c).forEach((c=>{d===t&&i.push({name:`stringify_bloom_${e}_${t}_${c}`,keyPath:"hashBloom",indexes:[]},{name:`stringify_tree_${e}_${t}_${c}`,keyPath:"hashTree",indexes:[]}),i.push({name:`deposits_${e}_${t}_${c}`,keyPath:"leafIndex",indexes:[...a,{name:"commitment",unique:!0}]},{name:`withdrawals_${e}_${t}_${c}`,keyPath:"eid",indexes:[...a,{name:"nullifierHash",unique:!0}]})}))}));const b=new M({dbName:`tornado_core_${e}`,stores:i});return await b.initDB(),b}},57390:(e,a,t)=>{"use strict";t.d(a,{W:()=>f});var c=t(68909);async function f(e){return await(0,c.Fd)(e,{method:"GET",timeout:3e4})}},5217:(e,a,t)=>{"use strict";t.d(a,{s:()=>n});var c=t(47882),f=t(41217),d=t(67418),r=t(22901);class n{currency;amount;netId;Tornado;commitmentHex;instanceName;merkleTreeHeight;emptyElement;merkleWorkerPath;constructor({netId:e,amount:a,currency:t,Tornado:c,commitmentHex:f,merkleTreeHeight:d=20,emptyElement:r="21663839004416932945382355908790599225266501822907911457504978515578255421292",merkleWorkerPath:n}){const i=`${e}_${t}_${a}`;this.currency=t,this.amount=a,this.netId=Number(e),this.Tornado=c,this.instanceName=i,this.commitmentHex=f,this.merkleTreeHeight=d,this.emptyElement=r,this.merkleWorkerPath=n}async createTree(e){const{hash:a}=await r.f.getHash();if(this.merkleWorkerPath){console.log("Using merkleWorker\n");try{if(d.Ll){const t=new Promise(((a,t)=>{const f=new c.Worker(this.merkleWorkerPath,{workerData:{merkleTreeHeight:this.merkleTreeHeight,elements:e,zeroElement:this.emptyElement}});f.on("message",a),f.on("error",t),f.on("exit",(e=>{0!==e&&t(new Error(`Worker stopped with exit code ${e}`))}))}));return f.MerkleTree.deserialize(JSON.parse(await t),a)}{const t=new Promise(((a,t)=>{const c=new Worker(this.merkleWorkerPath);c.onmessage=e=>{a(e.data)},c.onerror=e=>{t(e)},c.postMessage({merkleTreeHeight:this.merkleTreeHeight,elements:e,zeroElement:this.emptyElement})}));return f.MerkleTree.deserialize(JSON.parse(await t),a)}}catch(e){console.log("merkleWorker failed, falling back to synchronous merkle tree"),console.log(e)}}return new f.MerkleTree(this.merkleTreeHeight,e,{zeroElement:this.emptyElement,hashFunction:a})}async createPartialTree({edge:e,elements:a}){const{hash:t}=await r.f.getHash();if(this.merkleWorkerPath){console.log("Using merkleWorker\n");try{if(d.Ll){const d=new Promise(((t,f)=>{const d=new c.Worker(this.merkleWorkerPath,{workerData:{merkleTreeHeight:this.merkleTreeHeight,edge:e,elements:a,zeroElement:this.emptyElement}});d.on("message",t),d.on("error",f),d.on("exit",(e=>{0!==e&&f(new Error(`Worker stopped with exit code ${e}`))}))}));return f.PartialMerkleTree.deserialize(JSON.parse(await d),t)}{const c=new Promise(((t,c)=>{const f=new Worker(this.merkleWorkerPath);f.onmessage=e=>{t(e.data)},f.onerror=e=>{c(e)},f.postMessage({merkleTreeHeight:this.merkleTreeHeight,edge:e,elements:a,zeroElement:this.emptyElement})}));return f.PartialMerkleTree.deserialize(JSON.parse(await c),t)}}catch(e){console.log("merkleWorker failed, falling back to synchronous merkle tree"),console.log(e)}}return new f.PartialMerkleTree(this.merkleTreeHeight,e,a,{zeroElement:this.emptyElement,hashFunction:t})}async verifyTree(e){console.log(`\nCreating deposit tree for ${this.netId} ${this.amount} ${this.currency.toUpperCase()} would take a while\n`);const a=Date.now(),t=await this.createTree(e.map((({commitment:e})=>e)));if(!await this.Tornado.isKnownRoot((0,d.$W)(BigInt(t.root)))){const e=`Deposit Event ${this.netId} ${this.amount} ${this.currency} is invalid`;throw new Error(e)}return console.log(`\nCreated ${this.netId} ${this.amount} ${this.currency.toUpperCase()} tree in ${Date.now()-a}ms\n`),t}}},22901:(e,a,t)=>{"use strict";t.d(a,{f:()=>d,p:()=>f});var c=t(90294);class f{sponge;hash;mimcPromise;constructor(){this.mimcPromise=this.initMimc()}async initMimc(){this.sponge=await(0,c.HI)(),this.hash=(e,a)=>this.sponge?.F.toString(this.sponge?.multiHash([BigInt(e),BigInt(a)]))}async getHash(){return await this.mimcPromise,{sponge:this.sponge,hash:this.hash}}}const d=new f},48486:(e,a,t)=>{"use strict";async function c(e,a){const t=a.map((e=>({target:e.contract?.target||e.address,callData:(e.contract?.interface||e.interface).encodeFunctionData(e.name,e.params),allowFailure:e.allowFailure??!1})));return(await e.aggregate3.staticCall(t)).map(((e,t)=>{const c=a[t].contract?.interface||a[t].interface,[f,d]=e,r=f&&d&&"0x"!==d?c.decodeFunctionResult(a[t].name,d):null;return r?1===r.length?r[0]:r:null}))}t.d(a,{C:()=>c})},59499:(e,a,t)=>{"use strict";t.d(a,{AE:()=>n,Af:()=>d,RY:()=>i,Zh:()=>l,cX:()=>r,h9:()=>o,o2:()=>u,oY:()=>s,sX:()=>h,sb:()=>f,zj:()=>b,zr:()=>c});var c=(e=>(e[e.MAINNET=1]="MAINNET",e[e.BSC=56]="BSC",e[e.POLYGON=137]="POLYGON",e[e.OPTIMISM=10]="OPTIMISM",e[e.ARBITRUM=42161]="ARBITRUM",e[e.GNOSIS=100]="GNOSIS",e[e.AVALANCHE=43114]="AVALANCHE",e[e.SEPOLIA=11155111]="SEPOLIA",e))(c||{});const f={1:{rpcCallRetryAttempt:15,gasPrices:{instant:80,fast:50,standard:25,low:8},nativeCurrency:"eth",currencyName:"ETH",explorerUrl:"https://etherscan.io",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Ethereum Mainnet",deployedBlock:9116966,rpcUrls:{mevblockerRPC:{name:"MEV Blocker",url:"https://rpc.mevblocker.io"},keydonix:{name:"Horswap ( Keydonix )",url:"https://ethereum.keydonix.com/v1/mainnet"},SecureRpc:{name:"SecureRpc",url:"https://api.securerpc.com/v1"},stackup:{name:"Stackup",url:"https://public.stackup.sh/api/v1/node/ethereum-mainnet"},oneRpc:{name:"1RPC",url:"https://1rpc.io/eth"}},stablecoin:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0xd90e2f925DA726b50C4Ed8D0Fb90Ad053324F31b",echoContract:"0x9B27DD5Bb15d42DC224FCD0B7caEbBe16161Df42",offchainOracleContract:"0x00000000000D6FFc74A8feb35aF5827bf57f6786",tornContract:"0x77777FeDdddFfC19Ff86DB637967013e6C6A116C",governanceContract:"0x5efda50f22d34F262c29268506C5Fa42cB56A1Ce",stakingRewardsContract:"0x5B3f656C80E8ddb9ec01Dd9018815576E9238c29",registryContract:"0x58E8dCC13BE9780fC42E8723D8EaD4CF46943dF2",aggregatorContract:"0xE8F47A78A6D52D317D0D2FFFac56739fE14D1b49",reverseRecordsContract:"0x3671aE578E63FdF66ad4F3E12CC0c0d71Ac7510C",tornadoSubgraph:"tornadocash/mainnet-tornado-subgraph",registrySubgraph:"tornadocash/tornado-relayer-registry",governanceSubgraph:"tornadocash/tornado-governance",subgraphs:{},tokens:{eth:{instanceAddress:{.1:"0x12D66f87A04A9E220743712cE6d9bB1B5616B8Fc",1:"0x47CE0C6eD5B0Ce3d3A51fdb1C52DC66a7c3c2936",10:"0x910Cbd523D972eb0a6f4cAe4618aD62622b39DbF",100:"0xA160cdAB225685dA1d56aa342Ad8841c3b53f291"},symbol:"ETH",decimals:18},dai:{instanceAddress:{100:"0xD4B88Df4D29F5CedD6857912842cff3b20C8Cfa3",1e3:"0xFD8610d20aA15b7B2E3Be39B396a1bC3516c7144",1e4:"0x07687e702b410Fa43f4cB4Af7FA097918ffD2730",1e5:"0x23773E65ed146A459791799d01336DB287f25334"},tokenAddress:"0x6B175474E89094C44Da98b954EedeAC495271d0F",tokenGasLimit:7e4,symbol:"DAI",decimals:18,gasLimit:7e5},cdai:{instanceAddress:{5e3:"0x22aaA7720ddd5388A3c0A3333430953C68f1849b",5e4:"0x03893a7c7463AE47D46bc7f091665f1893656003",5e5:"0x2717c5e28cf931547B621a5dddb772Ab6A35B701",5e6:"0xD21be7248e0197Ee08E0c20D4a96DEBdaC3D20Af"},tokenAddress:"0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643",tokenGasLimit:2e5,symbol:"cDAI",decimals:8,gasLimit:7e5},usdc:{instanceAddress:{100:"0xd96f2B1c14Db8458374d9Aca76E26c3D18364307",1e3:"0x4736dCf1b7A3d580672CcE6E7c65cd5cc9cFBa9D"},tokenAddress:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",tokenGasLimit:7e4,symbol:"USDC",decimals:6,gasLimit:7e5},usdt:{instanceAddress:{100:"0x169AD27A470D064DEDE56a2D3ff727986b15D52B",1e3:"0x0836222F2B2B24A3F36f98668Ed8F0B38D1a872f"},tokenAddress:"0xdAC17F958D2ee523a2206206994597C13D831ec7",tokenGasLimit:7e4,symbol:"USDT",decimals:6,gasLimit:7e5},wbtc:{instanceAddress:{.1:"0x178169B423a011fff22B9e3F3abeA13414dDD0F1",1:"0x610B717796ad172B316836AC95a2ffad065CeaB4",10:"0xbB93e510BbCD0B7beb5A853875f9eC60275CF498"},tokenAddress:"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",tokenGasLimit:7e4,symbol:"WBTC",decimals:8,gasLimit:7e5}},disabledTokens:["cdai","usdt","usdc"],relayerEnsSubdomain:"mainnet-tornado",pollInterval:15,constants:{GOVERNANCE_BLOCK:11474695,NOTE_ACCOUNT_BLOCK:11842486,ENCRYPTED_NOTES_BLOCK:12143762,REGISTRY_BLOCK:14173129,MINING_BLOCK_TIME:15}},56:{rpcCallRetryAttempt:15,gasPrices:{instant:5,fast:5,standard:5,low:5},nativeCurrency:"bnb",currencyName:"BNB",explorerUrl:"https://bscscan.com",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Binance Smart Chain",deployedBlock:8158799,stablecoin:"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0x0D5550d52428E7e3175bfc9550207e4ad3859b17",echoContract:"0xa75BF2815618872f155b7C4B0C81bF990f5245E4",offchainOracleContract:"0x00000000000D6FFc74A8feb35aF5827bf57f6786",tornadoSubgraph:"tornadocash/bsc-tornado-subgraph",subgraphs:{},rpcUrls:{bnbchain:{name:"BNB Chain",url:"https://bsc-dataseed.bnbchain.org"},ninicoin:{name:"BNB Chain 2",url:"https://bsc-dataseed1.ninicoin.io"},nodereal:{name:"NodeReal",url:"https://binance.nodereal.io"},stackup:{name:"Stackup",url:"https://public.stackup.sh/api/v1/node/bsc-mainnet"},oneRpc:{name:"1RPC",url:"https://1rpc.io/bnb"}},tokens:{bnb:{instanceAddress:{.1:"0x84443CFd09A48AF6eF360C6976C5392aC5023a1F",1:"0xd47438C816c9E7f2E2888E060936a499Af9582b3",10:"0x330bdFADE01eE9bF63C209Ee33102DD334618e0a",100:"0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD"},symbol:"BNB",decimals:18}},relayerEnsSubdomain:"bsc-tornado",pollInterval:10,constants:{NOTE_ACCOUNT_BLOCK:8159269,ENCRYPTED_NOTES_BLOCK:8159269}},137:{rpcCallRetryAttempt:15,gasPrices:{instant:100,fast:75,standard:50,low:30},nativeCurrency:"matic",currencyName:"MATIC",explorerUrl:"https://polygonscan.com",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Polygon (Matic) Network",deployedBlock:16257962,stablecoin:"0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0x0D5550d52428E7e3175bfc9550207e4ad3859b17",echoContract:"0xa75BF2815618872f155b7C4B0C81bF990f5245E4",offchainOracleContract:"0x00000000000D6FFc74A8feb35aF5827bf57f6786",tornadoSubgraph:"tornadocash/matic-tornado-subgraph",subgraphs:{},rpcUrls:{oneRpc:{name:"1RPC",url:"https://1rpc.io/matic"},stackup:{name:"Stackup",url:"https://public.stackup.sh/api/v1/node/polygon-mainnet"}},tokens:{matic:{instanceAddress:{100:"0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD",1e3:"0xdf231d99Ff8b6c6CBF4E9B9a945CBAcEF9339178",1e4:"0xaf4c0B70B2Ea9FB7487C7CbB37aDa259579fe040",1e5:"0xa5C2254e4253490C54cef0a4347fddb8f75A4998"},symbol:"MATIC",decimals:18}},relayerEnsSubdomain:"polygon-tornado",pollInterval:10,constants:{NOTE_ACCOUNT_BLOCK:16257996,ENCRYPTED_NOTES_BLOCK:16257996}},10:{rpcCallRetryAttempt:15,gasPrices:{instant:.001,fast:.001,standard:.001,low:.001},nativeCurrency:"eth",currencyName:"ETH",explorerUrl:"https://optimistic.etherscan.io",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Optimism",deployedBlock:2243689,stablecoin:"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0x0D5550d52428E7e3175bfc9550207e4ad3859b17",echoContract:"0xa75BF2815618872f155b7C4B0C81bF990f5245E4",offchainOracleContract:"0x00000000000D6FFc74A8feb35aF5827bf57f6786",ovmGasPriceOracleContract:"0x420000000000000000000000000000000000000F",tornadoSubgraph:"tornadocash/optimism-tornado-subgraph",subgraphs:{},rpcUrls:{oneRpc:{name:"1RPC",url:"https://1rpc.io/op"},stackup:{name:"Stackup",url:"https://public.stackup.sh/api/v1/node/optimism-mainnet"}},tokens:{eth:{instanceAddress:{.1:"0x84443CFd09A48AF6eF360C6976C5392aC5023a1F",1:"0xd47438C816c9E7f2E2888E060936a499Af9582b3",10:"0x330bdFADE01eE9bF63C209Ee33102DD334618e0a",100:"0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD"},symbol:"ETH",decimals:18}},relayerEnsSubdomain:"optimism-tornado",pollInterval:15,constants:{NOTE_ACCOUNT_BLOCK:2243694,ENCRYPTED_NOTES_BLOCK:2243694}},42161:{rpcCallRetryAttempt:15,gasPrices:{instant:4,fast:3,standard:2.52,low:2.29},nativeCurrency:"eth",currencyName:"ETH",explorerUrl:"https://arbiscan.io",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Arbitrum One",deployedBlock:3430648,stablecoin:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0x0D5550d52428E7e3175bfc9550207e4ad3859b17",echoContract:"0xa75BF2815618872f155b7C4B0C81bF990f5245E4",offchainOracleContract:"0x00000000000D6FFc74A8feb35aF5827bf57f6786",tornadoSubgraph:"tornadocash/arbitrum-tornado-subgraph",subgraphs:{},rpcUrls:{Arbitrum:{name:"Arbitrum",url:"https://arb1.arbitrum.io/rpc"},stackup:{name:"Stackup",url:"https://public.stackup.sh/api/v1/node/arbitrum-one"},oneRpc:{name:"1RPC",url:"https://1rpc.io/arb"}},tokens:{eth:{instanceAddress:{.1:"0x84443CFd09A48AF6eF360C6976C5392aC5023a1F",1:"0xd47438C816c9E7f2E2888E060936a499Af9582b3",10:"0x330bdFADE01eE9bF63C209Ee33102DD334618e0a",100:"0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD"},symbol:"ETH",decimals:18}},relayerEnsSubdomain:"arbitrum-tornado",pollInterval:15,constants:{NOTE_ACCOUNT_BLOCK:3430605,ENCRYPTED_NOTES_BLOCK:3430605}},100:{rpcCallRetryAttempt:15,gasPrices:{instant:6,fast:5,standard:4,low:1},nativeCurrency:"xdai",currencyName:"xDAI",explorerUrl:"https://gnosisscan.io",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Gnosis Chain",deployedBlock:17754561,stablecoin:"0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83",multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0x0D5550d52428E7e3175bfc9550207e4ad3859b17",echoContract:"0xa75BF2815618872f155b7C4B0C81bF990f5245E4",offchainOracleContract:"0x00000000000D6FFc74A8feb35aF5827bf57f6786",tornadoSubgraph:"tornadocash/xdai-tornado-subgraph",subgraphs:{},rpcUrls:{gnosis:{name:"Gnosis",url:"https://rpc.gnosischain.com"},oneRpc:{name:"1RPC",url:"https://1rpc.io/gnosis"}},tokens:{xdai:{instanceAddress:{100:"0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD",1e3:"0xdf231d99Ff8b6c6CBF4E9B9a945CBAcEF9339178",1e4:"0xaf4c0B70B2Ea9FB7487C7CbB37aDa259579fe040",1e5:"0xa5C2254e4253490C54cef0a4347fddb8f75A4998"},symbol:"xDAI",decimals:18}},relayerEnsSubdomain:"gnosis-tornado",pollInterval:15,constants:{NOTE_ACCOUNT_BLOCK:17754564,ENCRYPTED_NOTES_BLOCK:17754564}},43114:{rpcCallRetryAttempt:15,gasPrices:{instant:225,fast:35,standard:25,low:25},nativeCurrency:"avax",currencyName:"AVAX",explorerUrl:"https://snowtrace.io",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Avalanche Mainnet",deployedBlock:4429818,stablecoin:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0x0D5550d52428E7e3175bfc9550207e4ad3859b17",echoContract:"0xa75BF2815618872f155b7C4B0C81bF990f5245E4",offchainOracleContract:"0x00000000000D6FFc74A8feb35aF5827bf57f6786",tornadoSubgraph:"tornadocash/avalanche-tornado-subgraph",subgraphs:{},rpcUrls:{oneRpc:{name:"1RPC",url:"https://1rpc.io/avax/c"},stackup:{name:"Stackup",url:"https://public.stackup.sh/api/v1/node/avalanche-mainnet"}},tokens:{avax:{instanceAddress:{10:"0x330bdFADE01eE9bF63C209Ee33102DD334618e0a",100:"0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD",500:"0xaf8d1839c3c67cf571aa74B5c12398d4901147B3"},symbol:"AVAX",decimals:18}},relayerEnsSubdomain:"avalanche-tornado",pollInterval:10,constants:{NOTE_ACCOUNT_BLOCK:4429813,ENCRYPTED_NOTES_BLOCK:4429813}},11155111:{rpcCallRetryAttempt:15,gasPrices:{instant:2,fast:2,standard:2,low:2},nativeCurrency:"eth",currencyName:"SepoliaETH",explorerUrl:"https://sepolia.etherscan.io",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Ethereum Sepolia",deployedBlock:5594395,stablecoin:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0x1572AFE6949fdF51Cb3E0856216670ae9Ee160Ee",echoContract:"0xcDD1fc3F5ac2782D83449d3AbE80D6b7B273B0e5",offchainOracleContract:"0x1f89EAF03E5b260Bc6D4Ae3c3334b1B750F3e127",tornContract:"0x3AE6667167C0f44394106E197904519D808323cA",governanceContract:"0xe5324cD7602eeb387418e594B87aCADee08aeCAD",stakingRewardsContract:"0x6d0018890751Efd31feb8166711B16732E2b496b",registryContract:"0x1428e5d2356b13778A13108b10c440C83011dfB8",aggregatorContract:"0x4088712AC9fad39ea133cdb9130E465d235e9642",reverseRecordsContract:"0xEc29700C0283e5Be64AcdFe8077d6cC95dE23C23",tornadoSubgraph:"tornadocash/sepolia-tornado-subgraph",subgraphs:{},rpcUrls:{sepolia:{name:"Sepolia RPC",url:"https://rpc.sepolia.org"},stackup:{name:"Stackup",url:"https://public.stackup.sh/api/v1/node/ethereum-sepolia"},oneRpc:{name:"1RPC",url:"https://1rpc.io/sepolia"},ethpandaops:{name:"ethpandaops",url:"https://rpc.sepolia.ethpandaops.io"}},tokens:{eth:{instanceAddress:{.1:"0x8C4A04d872a6C1BE37964A21ba3a138525dFF50b",1:"0x8cc930096B4Df705A007c4A039BDFA1320Ed2508",10:"0x8D10d506D29Fc62ABb8A290B99F66dB27Fc43585",100:"0x44c5C92ed73dB43888210264f0C8b36Fd68D8379"},symbol:"ETH",decimals:18},dai:{instanceAddress:{100:"0x6921fd1a97441dd603a997ED6DDF388658daf754",1e3:"0x50a637770F5d161999420F7d70d888DE47207145",1e4:"0xecD649870407cD43923A816Cc6334a5bdf113621",1e5:"0x73B4BD04bF83206B6e979BE2507098F92EDf4F90"},tokenAddress:"0xFF34B3d4Aee8ddCd6F9AFFFB6Fe49bD371b8a357",tokenGasLimit:7e4,symbol:"DAI",decimals:18,gasLimit:7e5}},relayerEnsSubdomain:"sepolia-tornado",pollInterval:15,constants:{GOVERNANCE_BLOCK:5594395,NOTE_ACCOUNT_BLOCK:5594395,ENCRYPTED_NOTES_BLOCK:5594395,REGISTRY_BLOCK:5594395,MINING_BLOCK_TIME:15}}},d=Object.values(c).filter((e=>"number"==typeof e));let r={};function n(e){d.push(...Object.keys(e).map((e=>Number(e))).filter((e=>!d.includes(e)))),r={...r,...e}}function i(){const e={...f,...r};return d.reduce(((a,t)=>(a[t]=e[t],a)),{})}function b(e){const a=i()[e];if(!a)throw new Error(`No config found for network ${e}!`);return a}function o(e){const{tokens:a,disabledTokens:t}=e;return Object.keys(a).filter((e=>!t?.includes(e)))}function s(e){const{tokens:a,disabledTokens:t}=e;return Object.entries(a).reduce(((e,[a,c])=>(t?.includes(a)||(e[a]=c),e)),{})}function l(e,a){const{tokens:t,disabledTokens:c}=e;for(const[e,{instanceAddress:f,tokenAddress:d,symbol:r,decimals:n}]of Object.entries(t))if(!c?.includes(e))for(const[t,c]of Object.entries(f))if(c===a)return{amount:t,currency:e,symbol:r,decimals:n,tokenAddress:d}}function u(){const e=i();return d.reduce(((a,t)=>(a[t]=e[t].relayerEnsSubdomain,a)),{})}function h(e,a){return Object.entries(a.tokens).reduce(((a,[t,{instanceAddress:c}])=>(Object.entries(c).forEach((([c,f])=>{a[f]={currency:t,amount:c,netId:e}})),a)),{})}},85111:(e,a,t)=>{"use strict";t.d(a,{Hr:()=>f,NO:()=>d,UB:()=>r});var c=t(90294);class f{pedersenHash;babyJub;pedersenPromise;constructor(){this.pedersenPromise=this.initPedersen()}async initPedersen(){this.pedersenHash=await(0,c.vu)(),this.babyJub=this.pedersenHash.babyJub}async unpackPoint(e){return await this.pedersenPromise,this.babyJub?.unpackPoint(this.pedersenHash?.hash(e))}toStringBuffer(e){return this.babyJub?.F.toString(e)}}const d=new f;async function r(e){const[a]=await d.unpackPoint(e);return d.toStringBuffer(a)}},1180:(e,a,t)=>{"use strict";t.d(a,{Sl:()=>_,KM:()=>w,sx:()=>v,id:()=>A,CS:()=>x});var c=t(20260);BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),BigInt("1000000000000000000");const f=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");BigInt("0x8000000000000000000000000000000000000000000000000000000000000000"),BigInt(-1),BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var d=t(30031),r=t(15539),n=t(36212),i=t(87303),b=t(57339),o=t(27033);const s=new RegExp("^bytes([0-9]+)$"),l=new RegExp("^(u?int)([0-9]*)$"),u=new RegExp("^(.*)\\[([0-9]*)\\]$");function h(e,a,t){switch(e){case"address":return t?(0,n.q5)((0,n.nx)(a,32)):(0,n.q5)((0,d.b)(a));case"string":return(0,i.YW)(a);case"bytes":return(0,n.q5)(a);case"bool":return a=a?"0x01":"0x00",t?(0,n.q5)((0,n.nx)(a,32)):(0,n.q5)(a)}let c=e.match(l);if(c){let f="int"===c[1],d=parseInt(c[2]||"256");return(0,b.MR)((!c[2]||c[2]===String(d))&&d%8==0&&0!==d&&d<=256,"invalid number type","type",e),t&&(d=256),f&&(a=(0,o.JJ)(a,d)),(0,n.q5)((0,n.nx)((0,o.c4)(a),d/8))}if(c=e.match(s),c){const f=parseInt(c[1]);return(0,b.MR)(String(f)===c[1]&&0!==f&&f<=32,"invalid bytes type","type",e),(0,b.MR)((0,n.pO)(a)===f,`invalid value for ${e}`,"value",a),t?(0,n.q5)((0,n.X_)(a,32)):a}if(c=e.match(u),c&&Array.isArray(a)){const t=c[1],f=parseInt(c[2]||String(a.length));(0,b.MR)(f===a.length,`invalid array length for ${e}`,"value",a);const d=[];return a.forEach((function(e){d.push(h(t,e,!0))})),(0,n.q5)((0,n.xW)(d))}(0,b.MR)(!1,"invalid type","type",e)}function p(e,a){(0,b.MR)(e.length===a.length,"wrong number of values; expected ${ types.length }","values",a);const t=[];return e.forEach((function(e,c){t.push(h(e,a[c]))})),(0,n.c$)((0,n.xW)(t))}function g(e,a){return(0,r.S)(p(e,a))}var m=t(82314),y=t(67418);const x="0x000000000022D473030F116dDEE9F6B43aC78BA3";async function A({Token:e,signer:a,spender:t,value:d,nonce:r,deadline:n}){const i=a||e.runner,b=i.provider,[o,s,{chainId:l}]=await Promise.all([e.name(),e.nonces(i.address),b.getNetwork()]),u={name:o,version:"1",chainId:l,verifyingContract:e.target};return c.t.from(await i.signTypedData(u,{Permit:[{name:"owner",type:"address"},{name:"spender",type:"address"},{name:"value",type:"uint256"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]},{owner:i.address,spender:t,value:d,nonce:r||s,deadline:n||f}))}async function v({PermitTornado:e,Token:a,signer:t,denomination:c,commitments:f,nonce:d}){const r=BigInt(f.length)*c,n=g(["bytes32[]"],[f]);return await A({Token:a,signer:t,spender:e.target,value:r,nonce:d,deadline:BigInt(n)})}async function w({Token:e,signer:a,spender:t,value:d,nonce:r,deadline:n,witness:i}){const b=a||e.runner,o=b.provider,s={name:"Permit2",chainId:(await o.getNetwork()).chainId,verifyingContract:x},l=i?{PermitWitnessTransferFrom:[{name:"permitted",type:"TokenPermissions"},{name:"spender",type:"address"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"},{name:"witness",type:i.witnessTypeName}],TokenPermissions:[{name:"token",type:"address"},{name:"amount",type:"uint256"}],...i.witnessType}:{PermitTransferFrom:[{name:"permitted",type:"TokenPermissions"},{name:"spender",type:"address"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}],TokenPermissions:[{name:"token",type:"address"},{name:"amount",type:"uint256"}]},u={permitted:{token:e.target,amount:d},spender:t,nonce:r||(0,y.ib)(16),deadline:n||f};return i&&(u.witness=i.witness),{domain:s,types:l,values:u,hash:new m.z(l).hash(u),signature:c.t.from(await b.signTypedData(s,l,u))}}async function _({PermitTornado:e,Token:a,signer:t,denomination:c,commitments:f,nonce:d,deadline:r}){const n=BigInt(f.length)*c,i=g(["bytes32[]"],[f]);return await w({Token:a,signer:t,spender:e.target,value:n,nonce:d,deadline:r,witness:{witnessTypeName:"PermitCommitments",witnessType:{PermitCommitments:[{name:"instance",type:"address"},{name:"commitmentsHash",type:"bytes32"}]},witness:{instance:e.target,commitmentsHash:i}}})}},34525:(e,a,t)=>{"use strict";t.d(a,{T:()=>r});var c=t(99770),f=t(62463),d=t(48486);class r{oracle;multicall;provider;fallbackPrice;constructor(e,a,t){this.provider=e,this.multicall=a,this.oracle=t,this.fallbackPrice=(0,c.g5)("0.0001")}buildCalls(e){return e.map((({tokenAddress:e})=>({contract:this.oracle,name:"getRateToEth",params:[e,!0],allowFailure:!0})))}buildStable(e){const a=f.Xc.connect(e,this.provider);return[{contract:a,name:"decimals"},{contract:this.oracle,name:"getRateToEth",params:[a.target,!0],allowFailure:!0}]}async fetchPrice(e,a){if(!this.oracle)return new Promise((e=>e(this.fallbackPrice)));try{return await this.oracle.getRateToEth(e,!0)*BigInt(10**a)/BigInt(10**18)}catch(a){return console.log(`Failed to fetch oracle price for ${e}, will use fallback price ${this.fallbackPrice}`),console.log(a),this.fallbackPrice}}async fetchPrices(e){return this.oracle?(await(0,d.C)(this.multicall,this.buildCalls(e))).map(((a,t)=>(a||(a=this.fallbackPrice),a*BigInt(10**e[t].decimals)/BigInt(10**18)))):new Promise((a=>a(e.map((()=>this.fallbackPrice)))))}async fetchEthUSD(e){if(!this.oracle)return new Promise((e=>e(10**18/Number(this.fallbackPrice))));const[a,t]=await(0,d.C)(this.multicall,this.buildStable(e)),f=(t||this.fallbackPrice)*BigInt(10n**a)/BigInt(10**18);return 1/Number((0,c.ck)(f))}}},68909:(e,a,t)=>{"use strict";t.d(a,{D2:()=>pc,Vr:()=>hc,Gd:()=>uc,nA:()=>lc,mJ:()=>dc,Fd:()=>nc,uY:()=>ic,WU:()=>rc,sO:()=>bc,MF:()=>oc,zr:()=>sc});var c=t(74945),f=t.n(c),d=t(26976),r=t(35273),n=t(30031),i=t(41442),b=t(82314),o=t(8177),s=t(88081),l=t(57339),u=t(87303),h=t(36212),p=t(27033),g=t(98982),m=t(13269),y=t(64563),x=t(79453),A=t(99381),v=t(97876),w=t(7040),_=t(20260);const I=BigInt(0);function E(e,a){return function(t){return null==t?a:e(t)}}function C(e,a){return t=>{if(a&&null==t)return null;if(!Array.isArray(t))throw new Error("not an array");return t.map((a=>e(a)))}}function M(e,a){return t=>{const c={};for(const f in e){let d=f;if(a&&f in a&&!(d in t))for(const e of a[f])if(e in t){d=e;break}try{const a=e[f](t[d]);void 0!==a&&(c[f]=a)}catch(e){const a=e instanceof Error?e.message:"not-an-error";(0,l.vA)(!1,`invalid value for value.${f} (${a})`,"BAD_DATA",{value:t})}}return c}}function B(e){return(0,l.MR)((0,h.Lo)(e,!0),"invalid data","value",e),e}function k(e){return(0,l.MR)((0,h.Lo)(e,32),"invalid hash","value",e),e}const L=M({address:n.b,blockHash:k,blockNumber:p.WZ,data:B,index:p.WZ,removed:E((function(e){switch(e){case!0:case"true":return!0;case!1:case"false":return!1}(0,l.MR)(!1,`invalid boolean; ${JSON.stringify(e)}`,"value",e)}),!1),topics:C(k),transactionHash:k,transactionIndex:p.WZ},{index:["logIndex"]}),S=M({hash:E(k),parentHash:k,parentBeaconBlockRoot:E(k,null),number:p.WZ,timestamp:p.WZ,nonce:E(B),difficulty:p.Ab,gasLimit:p.Ab,gasUsed:p.Ab,stateRoot:E(k,null),receiptsRoot:E(k,null),blobGasUsed:E(p.Ab,null),excessBlobGas:E(p.Ab,null),miner:E(n.b),prevRandao:E(k,null),extraData:B,baseFeePerGas:E(p.Ab)},{prevRandao:["mixHash"]}),T=M({transactionIndex:p.WZ,blockNumber:p.WZ,transactionHash:k,address:n.b,topics:C(k),data:B,index:p.WZ,blockHash:k},{index:["logIndex"]}),N=M({to:E(n.b,null),from:E(n.b,null),contractAddress:E(n.b,null),index:p.WZ,root:E(h.c$),gasUsed:p.Ab,blobGasUsed:E(p.Ab,null),logsBloom:E(B),blockHash:k,hash:k,logs:C((function(e){return T(e)})),blockNumber:p.WZ,cumulativeGasUsed:p.Ab,effectiveGasPrice:E(p.Ab),blobGasPrice:E(p.Ab,null),status:E(p.WZ),type:E(p.WZ,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function R(e){e.to&&(0,p.Ab)(e.to)===I&&(e.to="0x0000000000000000000000000000000000000000");const a=M({hash:k,index:E(p.WZ,void 0),type:e=>"0x"===e||null==e?0:(0,p.WZ)(e),accessList:E(o.$,null),blobVersionedHashes:E(C(k,!0),null),blockHash:E(k,null),blockNumber:E(p.WZ,null),transactionIndex:E(p.WZ,null),from:n.b,gasPrice:E(p.Ab),maxPriorityFeePerGas:E(p.Ab),maxFeePerGas:E(p.Ab),maxFeePerBlobGas:E(p.Ab,null),gasLimit:p.Ab,to:E(n.b,null),value:p.Ab,nonce:p.WZ,data:B,creates:E(n.b,null),chainId:E(p.Ab,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(e);if(null==a.to&&null==a.creates&&(a.creates=(0,w.t)(a)),1!==e.type&&2!==e.type||null!=e.accessList||(a.accessList=[]),e.signature?a.signature=_.t.from(e.signature):a.signature=_.t.from(e),null==a.chainId){const e=a.signature.legacyChainId;null!=e&&(a.chainId=e)}return a.blockHash&&(0,p.Ab)(a.blockHash)===I&&(a.blockHash=null),a}class P{name;constructor(e){(0,s.n)(this,{name:e})}clone(){return new P(this.name)}}class D extends P{effectiveBlock;txBase;txCreate;txDataZero;txDataNonzero;txAccessListStorageKey;txAccessListAddress;constructor(e,a){null==e&&(e=0),super(`org.ethers.network.plugins.GasCost#${e||0}`);const t={effectiveBlock:e};function c(e,c){let f=(a||{})[e];null==f&&(f=c),(0,l.MR)("number"==typeof f,`invalud value for ${e}`,"costs",a),t[e]=f}c("txBase",21e3),c("txCreate",32e3),c("txDataZero",4),c("txDataNonzero",16),c("txAccessListStorageKey",1900),c("txAccessListAddress",2400),(0,s.n)(this,t)}clone(){return new D(this.effectiveBlock,this)}}class O extends P{address;targetNetwork;constructor(e,a){super("org.ethers.plugins.network.Ens"),(0,s.n)(this,{address:e||"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",targetNetwork:null==a?1:a})}clone(){return new O(this.address,this.targetNetwork)}}class F extends P{#e;#a;get url(){return this.#e}get processFunc(){return this.#a}constructor(e,a){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"),this.#e=e,this.#a=a}clone(){return this}}const Q=new Map;class U{#t;#c;#f;constructor(e,a){this.#t=e,this.#c=(0,p.Ab)(a),this.#f=new Map}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return this.#t}set name(e){this.#t=e}get chainId(){return this.#c}set chainId(e){this.#c=(0,p.Ab)(e,"chainId")}matches(e){if(null==e)return!1;if("string"==typeof e){try{return this.chainId===(0,p.Ab)(e)}catch(e){}return this.name===e}if("number"==typeof e||"bigint"==typeof e){try{return this.chainId===(0,p.Ab)(e)}catch(e){}return!1}if("object"==typeof e){if(null!=e.chainId){try{return this.chainId===(0,p.Ab)(e.chainId)}catch(e){}return!1}return null!=e.name&&this.name===e.name}return!1}get plugins(){return Array.from(this.#f.values())}attachPlugin(e){if(this.#f.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#f.set(e.name,e.clone()),this}getPlugin(e){return this.#f.get(e)||null}getPlugins(e){return this.plugins.filter((a=>a.name.split("#")[0]===e))}clone(){const e=new U(this.name,this.chainId);return this.plugins.forEach((a=>{e.attachPlugin(a.clone())})),e}computeIntrinsicGas(e){const a=this.getPlugin("org.ethers.plugins.network.GasCost")||new D;let t=a.txBase;if(null==e.to&&(t+=a.txCreate),e.data)for(let c=2;c{c.attachPlugin(e)})),c};U.register(e,c),U.register(a,c),t.altNames&&t.altNames.forEach((e=>{U.register(e,c)}))}$||($=!0,e("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),e("ropsten",3,{ensNetwork:3}),e("rinkeby",4,{ensNetwork:4}),e("goerli",5,{ensNetwork:5}),e("kovan",42,{ensNetwork:42}),e("sepolia",11155111,{ensNetwork:11155111}),e("holesky",17e3,{ensNetwork:17e3}),e("classic",61,{}),e("classicKotti",6,{}),e("arbitrum",42161,{ensNetwork:1}),e("arbitrum-goerli",421613,{}),e("arbitrum-sepolia",421614,{}),e("base",8453,{ensNetwork:1}),e("base-goerli",84531,{}),e("base-sepolia",84532,{}),e("bnb",56,{ensNetwork:1}),e("bnbt",97,{}),e("linea",59144,{ensNetwork:1}),e("linea-goerli",59140,{}),e("linea-sepolia",59141,{}),e("matic",137,{ensNetwork:1,plugins:[H("https://gasstation.polygon.technology/v2")]}),e("matic-amoy",80002,{}),e("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[H("https://gasstation-testnet.polygon.technology/v2")]}),e("optimism",10,{ensNetwork:1,plugins:[]}),e("optimism-goerli",420,{}),e("optimism-sepolia",11155420,{}),e("xdai",100,{ensNetwork:1}))}(),null==e)return U.from("mainnet");if("number"==typeof e&&(e=BigInt(e)),"string"==typeof e||"bigint"==typeof e){const a=Q.get(e);if(a)return a();if("bigint"==typeof e)return new U("unknown",e);(0,l.MR)(!1,"unknown network","network",e)}if("function"==typeof e.clone)return e.clone();if("object"==typeof e){(0,l.MR)("string"==typeof e.name&&"number"==typeof e.chainId,"invalid network object name or chainId","network",e);const a=new U(e.name,e.chainId);return(e.ensAddress||null!=e.ensNetwork)&&a.attachPlugin(new O(e.ensAddress,e.ensNetwork)),a}(0,l.MR)(!1,"invalid network","network",e)}static register(e,a){"number"==typeof e&&(e=BigInt(e));const t=Q.get(e);t&&(0,l.MR)(!1,`conflicting network for ${JSON.stringify(t.name)}`,"nameOrChainId",e),Q.set(e,a)}}function j(e,a){const t=String(e);if(!t.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${e}`);const c=t.split(".");if(1===c.length&&c.push(""),2!==c.length)throw new Error(`invalid gwei value: ${e}`);for(;c[1].length9){let e=BigInt(c[1].substring(0,9));c[1].substring(9).match(/^0+$/)||e++,c[1]=e.toString()}return BigInt(c[0]+c[1])}function H(e){return new F(e,(async(e,a,t)=>{let c;t.setHeader("User-Agent","ethers");try{const[a,f]=await Promise.all([t.send(),e()]);c=a;const d=c.bodyJson.standard;return{gasPrice:f.gasPrice,maxFeePerGas:j(d.maxFee,9),maxPriorityFeePerGas:j(d.maxPriorityFee,9)}}catch(e){(0,l.vA)(!1,`error encountered with polygon gas station (${JSON.stringify(t.url)})`,"SERVER_ERROR",{request:t,response:c,error:e})}}))}let $=!1;var q=t(43948);function z(e){return JSON.parse(JSON.stringify(e))}class G{#d;#r;#n;#i;constructor(e){this.#d=e,this.#r=null,this.#n=4e3,this.#i=-2}get pollingInterval(){return this.#n}set pollingInterval(e){this.#n=e}async#b(){try{const e=await this.#d.getBlockNumber();if(-2===this.#i)return void(this.#i=e);if(e!==this.#i){for(let a=this.#i+1;a<=e;a++){if(null==this.#r)return;await this.#d.emit("block",a)}this.#i=e}}catch(e){}null!=this.#r&&(this.#r=this.#d._setTimeout(this.#b.bind(this),this.#n))}start(){this.#r||(this.#r=this.#d._setTimeout(this.#b.bind(this),this.#n),this.#b())}stop(){this.#r&&(this.#d._clearTimeout(this.#r),this.#r=null)}pause(e){this.stop(),e&&(this.#i=-2)}resume(){this.start()}}class K{#d;#b;#o;constructor(e){this.#d=e,this.#o=!1,this.#b=e=>{this._poll(e,this.#d)}}async _poll(e,a){throw new Error("sub-classes must override this")}start(){this.#o||(this.#o=!0,this.#b(-2),this.#d.on("block",this.#b))}stop(){this.#o&&(this.#o=!1,this.#d.off("block",this.#b))}pause(e){this.stop()}resume(){this.start()}}class V extends K{#s;#l;constructor(e,a){super(e),this.#s=a,this.#l=-2}pause(e){e&&(this.#l=-2),super.pause(e)}async _poll(e,a){const t=await a.getBlock(this.#s);null!=t&&(-2===this.#l?this.#l=t.number:t.number>this.#l&&(a.emit(this.#s,t.number),this.#l=t.number))}}class Z extends K{#u;constructor(e,a){super(e),this.#u=z(a)}async _poll(e,a){throw new Error("@TODO")}}class J extends K{#h;constructor(e,a){super(e),this.#h=a}async _poll(e,a){const t=await a.getTransactionReceipt(this.#h);t&&a.emit(this.#h,t)}}class W{#d;#u;#r;#o;#i;constructor(e,a){this.#d=e,this.#u=z(a),this.#r=this.#b.bind(this),this.#o=!1,this.#i=-2}async#b(e){if(-2===this.#i)return;const a=z(this.#u);a.fromBlock=this.#i+1,a.toBlock=e;const t=await this.#d.getLogs(a);if(0!==t.length)for(const e of t)this.#d.emit(this.#u,e),this.#i=e.blockNumber;else this.#i{this.#i=e})),this.#d.on("block",this.#r))}stop(){this.#o&&(this.#o=!1,this.#d.off("block",this.#r))}pause(e){this.stop(),e&&(this.#i=-2)}resume(){this.start()}}const Y=BigInt(2);function X(e){return e&&"function"==typeof e.then}function ee(e,a){return e+":"+JSON.stringify(a,((e,a)=>{if(null==a)return"null";if("bigint"==typeof a)return`bigint:${a.toString()}`;if("string"==typeof a)return a.toLowerCase();if("object"==typeof a&&!Array.isArray(a)){const e=Object.keys(a);return e.sort(),e.reduce(((e,t)=>(e[t]=a[t],e)),{})}return a}))}class ae{name;constructor(e){(0,s.n)(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function te(e){return(e=Array.from(new Set(e).values())).sort(),e}async function ce(e,a){if(null==e)throw new Error("invalid event");if(Array.isArray(e)&&(e={topics:e}),"string"==typeof e)switch(e){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:e,tag:e}}if((0,h.Lo)(e,32)){const a=e.toLowerCase();return{type:"transaction",tag:ee("tx",{hash:a}),hash:a}}if(e.orphan){const a=e;return{type:"orphan",tag:ee("orphan",a),filter:(t=a,JSON.parse(JSON.stringify(t)))}}var t;if(e.address||e.topics){const t=e,c={topics:(t.topics||[]).map((e=>null==e?null:Array.isArray(e)?te(e.map((e=>e.toLowerCase()))):e.toLowerCase()))};if(t.address){const e=[],f=[],d=t=>{(0,h.Lo)(t)?e.push(t):f.push((async()=>{e.push(await(0,i.tG)(t,a))})())};Array.isArray(t.address)?t.address.forEach(d):d(t.address),f.length&&await Promise.all(f),c.address=te(e.map((e=>e.toLowerCase())))}return{filter:c,tag:ee("event",c),type:"event"}}(0,l.MR)(!1,"unknown ProviderEvent","event",e)}function fe(){return(new Date).getTime()}const de={cacheTimeout:250,pollingInterval:4e3};class re{#p;#f;#g;#m;#y;#x;#A;#v;#w;#_;#I;#E;constructor(e,a){if(this.#E=Object.assign({},de,a||{}),"any"===e)this.#x=!0,this.#y=null;else if(e){const a=U.from(e);this.#x=!1,this.#y=Promise.resolve(a),setTimeout((()=>{this.emit("network",a,null)}),0)}else this.#x=!1,this.#y=null;this.#v=-1,this.#A=new Map,this.#p=new Map,this.#f=new Map,this.#g=null,this.#m=!1,this.#w=1,this.#_=new Map,this.#I=!1}get pollingInterval(){return this.#E.pollingInterval}get provider(){return this}get plugins(){return Array.from(this.#f.values())}attachPlugin(e){if(this.#f.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#f.set(e.name,e.connect(this)),this}getPlugin(e){return this.#f.get(e)||null}get disableCcipRead(){return this.#I}set disableCcipRead(e){this.#I=!!e}async#C(e){const a=this.#E.cacheTimeout;if(a<0)return await this._perform(e);const t=ee(e.method,e);let c=this.#A.get(t);return c||(c=this._perform(e),this.#A.set(t,c),setTimeout((()=>{this.#A.get(t)===c&&this.#A.delete(t)}),a)),await c}async ccipReadFetch(e,a,t){if(this.disableCcipRead||0===t.length||null==e.to)return null;const c=e.to.toLowerCase(),f=a.toLowerCase(),r=[];for(let a=0;a=500,`response not found during CCIP fetch: ${s}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:n,errorMessage:s}}),r.push(s)}(0,l.vA)(!1,`error encountered during CCIP fetch: ${r.map((e=>JSON.stringify(e))).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:t,errorMessages:r}})}_wrapBlock(e,a){return new q.eB(function(e){const a=S(e);return a.transactions=e.transactions.map((e=>"string"==typeof e?e:R(e))),a}(e),this)}_wrapLog(e,a){return new q.tG(function(e){return L(e)}(e),this)}_wrapTransactionReceipt(e,a){return new q.z5(function(e){return N(e)}(e),this)}_wrapTransactionResponse(e,a){return new q.uI(R(e),this)}_detectNetwork(){(0,l.vA)(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){(0,l.vA)(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=(0,p.WZ)(await this.#C({method:"getBlockNumber"}),"%response");return this.#v>=0&&(this.#v=e),e}_getAddress(e){return(0,i.tG)(e,this)}_getBlockTag(e){if(null==e)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}return(0,h.Lo)(e)?(0,h.Lo)(e,32)?e:(0,p.nD)(e):("bigint"==typeof e&&(e=(0,p.WZ)(e,"blockTag")),"number"==typeof e?e>=0?(0,p.nD)(e):this.#v>=0?(0,p.nD)(this.#v+e):this.getBlockNumber().then((a=>(0,p.nD)(a+e))):void(0,l.MR)(!1,"invalid blockTag","blockTag",e))}_getFilter(e){const a=(e.topics||[]).map((e=>null==e?null:Array.isArray(e)?te(e.map((e=>e.toLowerCase()))):e.toLowerCase())),t="blockHash"in e?e.blockHash:void 0,c=(e,c,f)=>{let d;switch(e.length){case 0:break;case 1:d=e[0];break;default:e.sort(),d=e}if(t&&(null!=c||null!=f))throw new Error("invalid filter");const r={};return d&&(r.address=d),a.length&&(r.topics=a),c&&(r.fromBlock=c),f&&(r.toBlock=f),t&&(r.blockHash=t),r};let f,d,r=[];if(e.address)if(Array.isArray(e.address))for(const a of e.address)r.push(this._getAddress(a));else r.push(this._getAddress(e.address));return"fromBlock"in e&&(f=this._getBlockTag(e.fromBlock)),"toBlock"in e&&(d=this._getBlockTag(e.toBlock)),r.filter((e=>"string"!=typeof e)).length||null!=f&&"string"!=typeof f||null!=d&&"string"!=typeof d?Promise.all([Promise.all(r),f,d]).then((e=>c(e[0],e[1],e[2]))):c(r,f,d)}_getTransactionRequest(e){const a=(0,q.VS)(e),t=[];if(["to","from"].forEach((e=>{if(null==a[e])return;const c=(0,i.tG)(a[e],this);X(c)?t.push(async function(){a[e]=await c}()):a[e]=c})),null!=a.blockTag){const e=this._getBlockTag(a.blockTag);X(e)?t.push(async function(){a.blockTag=await e}()):a.blockTag=e}return t.length?async function(){return await Promise.all(t),a}():a}async getNetwork(){if(null==this.#y){const e=(async()=>{try{const e=await this._detectNetwork();return this.emit("network",e,null),e}catch(a){throw this.#y===e&&(this.#y=null),a}})();return this.#y=e,(await e).clone()}const e=this.#y,[a,t]=await Promise.all([e,this._detectNetwork()]);return a.chainId!==t.chainId&&(this.#x?(this.emit("network",t,a),this.#y===e&&(this.#y=Promise.resolve(t))):(0,l.vA)(!1,`network changed: ${a.chainId} => ${t.chainId} `,"NETWORK_ERROR",{event:"changed"})),a.clone()}async getFeeData(){const e=await this.getNetwork(),a=async()=>{const{_block:a,gasPrice:t,priorityFee:c}=await(0,s.k)({_block:this.#M("latest",!1),gasPrice:(async()=>{try{const e=await this.#C({method:"getGasPrice"});return(0,p.Ab)(e,"%response")}catch(e){}return null})(),priorityFee:(async()=>{try{const e=await this.#C({method:"getPriorityFee"});return(0,p.Ab)(e,"%response")}catch(e){}return null})()});let f=null,d=null;const r=this._wrapBlock(a,e);return r&&r.baseFeePerGas&&(d=null!=c?c:BigInt("1000000000"),f=r.baseFeePerGas*Y+d),new q.J9(t,f,d)},t=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(t){const e=new d.ui(t.url),c=await t.processFunc(a,this,e);return new q.J9(c.gasPrice,c.maxFeePerGas,c.maxPriorityFeePerGas)}return await a()}async estimateGas(e){let a=this._getTransactionRequest(e);return X(a)&&(a=await a),(0,p.Ab)(await this.#C({method:"estimateGas",transaction:a}),"%response")}async#B(e,a,t){(0,l.vA)(t<10,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:a,enableCcipRead:!0})});const c=(0,q.VS)(e);try{return(0,h.c$)(await this._perform({method:"call",transaction:c,blockTag:a}))}catch(e){if(!this.disableCcipRead&&(0,l.E)(e)&&e.data&&t>=0&&"latest"===a&&null!=c.to&&"0x556f1830"===(0,h.ZG)(e.data,0,4)){const f=e.data,d=await(0,i.tG)(c.to,this);let r;try{r=function(e){const a={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};(0,l.vA)((0,h.pO)(e)>=160,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const t=(0,h.ZG)(e,0,32);(0,l.vA)((0,h.ZG)(t,0,12)===(0,h.ZG)(ue,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),a.sender=(0,h.ZG)(t,12);try{const t=[],c=(0,p.WZ)((0,h.ZG)(e,32,64)),f=(0,p.WZ)((0,h.ZG)(e,c,c+32)),d=(0,h.ZG)(e,c+32);for(let e=0;ea[e])),a}((0,h.ZG)(e.data,4))}catch(e){(0,l.vA)(!1,e.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:c,info:{data:f}})}(0,l.vA)(r.sender.toLowerCase()===d.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:f,reason:"OffchainLookup",transaction:c,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:r.errorArgs}});const n=await this.ccipReadFetch(c,r.calldata,r.urls);(0,l.vA)(null!=n,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:c,info:{data:e.data,errorArgs:r.errorArgs}});const b={to:d,data:(0,h.xW)([r.selector,le([n,r.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:b});try{const e=await this.#B(b,a,t+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},b),result:e}),e}catch(e){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},b),error:e}),e}}throw e}}async#k(e){const{value:a}=await(0,s.k)({network:this.getNetwork(),value:e});return a}async call(e){const{tx:a,blockTag:t}=await(0,s.k)({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await this.#k(this.#B(a,t,e.enableCcipRead?0:-1))}async#L(e,a,t){let c=this._getAddress(a),f=this._getBlockTag(t);return"string"==typeof c&&"string"==typeof f||([c,f]=await Promise.all([c,f])),await this.#k(this.#C(Object.assign(e,{address:c,blockTag:f})))}async getBalance(e,a){return(0,p.Ab)(await this.#L({method:"getBalance"},e,a),"%response")}async getTransactionCount(e,a){return(0,p.WZ)(await this.#L({method:"getTransactionCount"},e,a),"%response")}async getCode(e,a){return(0,h.c$)(await this.#L({method:"getCode"},e,a))}async getStorage(e,a,t){const c=(0,p.Ab)(a,"position");return(0,h.c$)(await this.#L({method:"getStorage",position:c},e,t))}async broadcastTransaction(e){const{blockNumber:a,hash:t,network:c}=await(0,s.k)({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),f=x.Z.from(e);if(f.hash!==t)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(f,c).replaceableTransaction(a)}async#M(e,a){if((0,h.Lo)(e,32))return await this.#C({method:"getBlock",blockHash:e,includeTransactions:a});let t=this._getBlockTag(e);return"string"!=typeof t&&(t=await t),await this.#C({method:"getBlock",blockTag:t,includeTransactions:a})}async getBlock(e,a){const{network:t,params:c}=await(0,s.k)({network:this.getNetwork(),params:this.#M(e,!!a)});return null==c?null:this._wrapBlock(c,t)}async getTransaction(e){const{network:a,params:t}=await(0,s.k)({network:this.getNetwork(),params:this.#C({method:"getTransaction",hash:e})});return null==t?null:this._wrapTransactionResponse(t,a)}async getTransactionReceipt(e){const{network:a,params:t}=await(0,s.k)({network:this.getNetwork(),params:this.#C({method:"getTransactionReceipt",hash:e})});if(null==t)return null;if(null==t.gasPrice&&null==t.effectiveGasPrice){const a=await this.#C({method:"getTransaction",hash:e});if(null==a)throw new Error("report this; could not find tx or effectiveGasPrice");t.effectiveGasPrice=a.gasPrice}return this._wrapTransactionReceipt(t,a)}async getTransactionResult(e){const{result:a}=await(0,s.k)({network:this.getNetwork(),result:this.#C({method:"getTransactionResult",hash:e})});return null==a?null:(0,h.c$)(a)}async getLogs(e){let a=this._getFilter(e);X(a)&&(a=await a);const{network:t,params:c}=await(0,s.k)({network:this.getNetwork(),params:this.#C({method:"getLogs",filter:a})});return c.map((e=>this._wrapLog(e,t)))}_getProvider(e){(0,l.vA)(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await v.Pz.fromName(this,e)}async getAvatar(e){const a=await this.getResolver(e);return a?await a.getAvatar():null}async resolveName(e){const a=await this.getResolver(e);return a?await a.getAddress():null}async lookupAddress(e){e=(0,n.b)(e);const a=(0,y.kM)(e.substring(2).toLowerCase()+".addr.reverse");try{const t=await v.Pz.getEnsAddress(this),c=new m.NZ(t,["function resolver(bytes32) view returns (address)"],this),f=await c.resolver(a);if(null==f||f===g.j)return null;const d=new m.NZ(f,["function name(bytes32) view returns (string)"],this),r=await d.name(a);return await this.resolveName(r)!==e?null:r}catch(e){if((0,l.bJ)(e,"BAD_DATA")&&"0x"===e.value)return null;if((0,l.bJ)(e,"CALL_EXCEPTION"))return null;throw e}return null}async waitForTransaction(e,a,t){const c=null!=a?a:1;return 0===c?this.getTransactionReceipt(e):new Promise((async(a,f)=>{let d=null;const r=async t=>{try{const f=await this.getTransactionReceipt(e);if(null!=f&&t-f.blockNumber+1>=c)return a(f),void(d&&(clearTimeout(d),d=null))}catch(e){console.log("EEE",e)}this.once("block",r)};null!=t&&(d=setTimeout((()=>{null!=d&&(d=null,this.off("block",r),f((0,l.xz)("timeout","TIMEOUT",{reason:"timeout"})))}),t)),r(await this.getBlockNumber())}))}async waitForBlock(e){(0,l.vA)(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const a=this.#_.get(e);a&&(a.timer&&clearTimeout(a.timer),this.#_.delete(e))}_setTimeout(e,a){null==a&&(a=0);const t=this.#w++,c=()=>{this.#_.delete(t),e()};if(this.paused)this.#_.set(t,{timer:null,func:c,time:a});else{const e=setTimeout(c,a);this.#_.set(t,{timer:e,func:c,time:fe()})}return t}_forEachSubscriber(e){for(const a of this.#p.values())e(a.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new ae(e.type);case"block":{const e=new G(this);return e.pollingInterval=this.pollingInterval,e}case"safe":case"finalized":return new V(this,e.type);case"event":return new W(this,e.filter);case"transaction":return new J(this,e.hash);case"orphan":return new Z(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,a){for(const t of this.#p.values())if(t.subscriber===e){t.started&&t.subscriber.stop(),t.subscriber=a,t.started&&a.start(),null!=this.#g&&a.pause(this.#g);break}}async#S(e,a){let t=await ce(e,this);return"event"===t.type&&a&&a.length>0&&!0===a[0].removed&&(t=await ce({orphan:"drop-log",log:a[0]},this)),this.#p.get(t.tag)||null}async#T(e){const a=await ce(e,this),t=a.tag;let c=this.#p.get(t);return c||(c={subscriber:this._getSubscriber(a),tag:t,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},this.#p.set(t,c)),c}async on(e,a){const t=await this.#T(e);return t.listeners.push({listener:a,once:!1}),t.started||(t.subscriber.start(),t.started=!0,null!=this.#g&&t.subscriber.pause(this.#g)),this}async once(e,a){const t=await this.#T(e);return t.listeners.push({listener:a,once:!0}),t.started||(t.subscriber.start(),t.started=!0,null!=this.#g&&t.subscriber.pause(this.#g)),this}async emit(e,...a){const t=await this.#S(e,a);if(!t||0===t.listeners.length)return!1;const c=t.listeners.length;return t.listeners=t.listeners.filter((({listener:t,once:c})=>{const f=new A.z(this,c?null:t,e);try{t.call(this,...a,f)}catch(e){}return!c})),0===t.listeners.length&&(t.started&&t.subscriber.stop(),this.#p.delete(t.tag)),c>0}async listenerCount(e){if(e){const a=await this.#S(e);return a?a.listeners.length:0}let a=0;for(const{listeners:e}of this.#p.values())a+=e.length;return a}async listeners(e){if(e){const a=await this.#S(e);return a?a.listeners.map((({listener:e})=>e)):[]}let a=[];for(const{listeners:e}of this.#p.values())a=a.concat(e.map((({listener:e})=>e)));return a}async off(e,a){const t=await this.#S(e);if(!t)return this;if(a){const e=t.listeners.map((({listener:e})=>e)).indexOf(a);e>=0&&t.listeners.splice(e,1)}return a&&0!==t.listeners.length||(t.started&&t.subscriber.stop(),this.#p.delete(t.tag)),this}async removeAllListeners(e){if(e){const{tag:a,started:t,subscriber:c}=await this.#T(e);t&&c.stop(),this.#p.delete(a)}else for(const[e,{started:a,subscriber:t}]of this.#p)a&&t.stop(),this.#p.delete(e);return this}async addListener(e,a){return await this.on(e,a)}async removeListener(e,a){return this.off(e,a)}get destroyed(){return this.#m}destroy(){this.removeAllListeners();for(const e of this.#_.keys())this._clearTimeout(e);this.#m=!0}get paused(){return null!=this.#g}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(this.#v=-1,null!=this.#g){if(this.#g==!!e)return;(0,l.vA)(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber((a=>a.pause(e))),this.#g=!!e;for(const e of this.#_.values())e.timer&&clearTimeout(e.timer),e.time=fe()-e.time}resume(){if(null!=this.#g){this._forEachSubscriber((e=>e.resume())),this.#g=null;for(const e of this.#_.values()){let a=e.time;a<0&&(a=0),e.time=fe(),setTimeout(e.func,a)}}}}function ne(e,a){try{const t=ie(e,a);if(t)return(0,u._v)(t)}catch(e){}return null}function ie(e,a){if("0x"===e)return null;try{const t=(0,p.WZ)((0,h.ZG)(e,a,a+32)),c=(0,p.WZ)((0,h.ZG)(e,t,t+32));return(0,h.ZG)(e,t+32,t+32+c)}catch(e){}return null}function be(e){const a=(0,p.c4)(e);if(a.length>32)throw new Error("internal; should not happen");const t=new Uint8Array(32);return t.set(a,32-a.length),t}function oe(e){if(e.length%32==0)return e;const a=new Uint8Array(32*Math.ceil(e.length/32));return a.set(e),a}const se=new Uint8Array([]);function le(e){const a=[];let t=0;for(let c=0;c((0,l.MR)(e.toLowerCase()===a.toLowerCase(),"transaction from mismatch","tx.from",a),e)))}else t.from=e.getAddress();return await(0,s.k)(t)}class ge{provider;constructor(e){(0,s.n)(this,{provider:e||null})}async getNonce(e){return he(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await pe(this,e)}async populateTransaction(e){const a=he(this,"populateTransaction"),t=await pe(this,e);null==t.nonce&&(t.nonce=await this.getNonce("pending")),null==t.gasLimit&&(t.gasLimit=await this.estimateGas(t));const c=await this.provider.getNetwork();if(null!=t.chainId){const a=(0,p.Ab)(t.chainId);(0,l.MR)(a===c.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else t.chainId=c.chainId;const f=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!f?0!==t.type&&1!==t.type||!f||(0,l.MR)(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e):(0,l.MR)(!1,"eip-1559 transaction do not support gasPrice","tx",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type){const e=await a.getFeeData();(0,l.vA)(null!=e.gasPrice,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice)}else{const e=await a.getFeeData();if(null==t.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(t.type=2,null!=t.gasPrice){const e=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=e,t.maxPriorityFeePerGas=e}else null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?((0,l.vA)(!f,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):(0,l.vA)(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else 2!==t.type&&3!==t.type||(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else t.type=2;return await(0,s.k)(t)}async estimateGas(e){return he(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return he(this,"call").call(await this.populateCall(e))}async resolveName(e){const a=he(this,"resolveName");return await a.resolveName(e)}async sendTransaction(e){const a=he(this,"sendTransaction"),t=await this.populateTransaction(e);delete t.from;const c=x.Z.from(t);return await a.broadcastTransaction(await this.signTransaction(c))}}class me extends ge{address;constructor(e,a){super(a),(0,s.n)(this,{address:e})}async getAddress(){return this.address}connect(e){return new me(this.address,e)}#N(e,a){(0,l.vA)(!1,`VoidSigner cannot sign ${e}`,"UNSUPPORTED_OPERATION",{operation:a})}async signTransaction(e){this.#N("transactions","signTransaction")}async signMessage(e){this.#N("messages","signMessage")}async signTypedData(e,a,t){this.#N("typed-data","signTypedData")}}class ye{#d;#R;#r;#o;#P;#D;constructor(e){this.#d=e,this.#R=null,this.#r=this.#b.bind(this),this.#o=!1,this.#P=null,this.#D=!1}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,a){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}async#b(e){try{null==this.#R&&(this.#R=this._subscribe(this.#d));let e=null;try{e=await this.#R}catch(e){if(!(0,l.bJ)(e,"UNSUPPORTED_OPERATION")||"eth_newFilter"!==e.operation)throw e}if(null==e)return this.#R=null,void this.#d._recoverSubscriber(this,this._recover(this.#d));const a=await this.#d.getNetwork();if(this.#P||(this.#P=a),this.#P.chainId!==a.chainId)throw new Error("chaid changed");if(this.#D)return;const t=await this.#d.send("eth_getFilterChanges",[e]);await this._emitResults(this.#d,t)}catch(e){console.log("@TODO",e)}this.#d.once("block",this.#r)}#O(){const e=this.#R;e&&(this.#R=null,e.then((e=>{this.#d.destroyed||this.#d.send("eth_uninstallFilter",[e])})))}start(){this.#o||(this.#o=!0,this.#b(-2))}stop(){this.#o&&(this.#o=!1,this.#D=!0,this.#O(),this.#d.off("block",this.#r))}pause(e){e&&this.#O(),this.#d.off("block",this.#r)}resume(){this.start()}}class xe extends ye{#F;constructor(e,a){var t;super(e),this.#F=(t=a,JSON.parse(JSON.stringify(t)))}_recover(e){return new W(e,this.#F)}async _subscribe(e){return await e.send("eth_newFilter",[this.#F])}async _emitResults(e,a){for(const t of a)e.emit(this.#F,e._wrapLog(t,e._network))}}class Ae extends ye{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,a){for(const t of a)e.emit("pending",t)}}const ve="bigint,boolean,function,number,string,symbol".split(/,/g);function we(e){if(null==e||ve.indexOf(typeof e)>=0)return e;if("function"==typeof e.getAddress)return e;if(Array.isArray(e))return e.map(we);if("object"==typeof e)return Object.keys(e).reduce(((a,t)=>(a[t]=e[t],a)),{});throw new Error(`should not happen: ${e} (${typeof e})`)}function _e(e){return new Promise((a=>{setTimeout(a,e)}))}function Ie(e){return e?e.toLowerCase():e}function Ee(e){return e&&"number"==typeof e.pollingInterval}const Ce={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class Me extends ge{address;constructor(e,a){super(e),a=(0,n.b)(a),(0,s.n)(this,{address:a})}connect(e){(0,l.vA)(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(e){return await this.populateCall(e)}async sendUncheckedTransaction(e){const a=we(e),t=[];if(a.from){const c=a.from;t.push((async()=>{const t=await(0,i.tG)(c,this.provider);(0,l.MR)(null!=t&&t.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),a.from=t})())}else a.from=this.address;if(null==a.gasLimit&&t.push((async()=>{a.gasLimit=await this.provider.estimateGas({...a,from:this.address})})()),null!=a.to){const e=a.to;t.push((async()=>{a.to=await(0,i.tG)(e,this.provider)})())}t.length&&await Promise.all(t);const c=this.provider.getRpcTransaction(a);return this.provider.send("eth_sendTransaction",[c])}async sendTransaction(e){const a=await this.provider.getBlockNumber(),t=await this.sendUncheckedTransaction(e);return await new Promise(((e,c)=>{const f=[1e3,100];let d=0;const r=async()=>{try{const c=await this.provider.getTransaction(t);if(null!=c)return void e(c.replaceableTransaction(a))}catch(e){if((0,l.bJ)(e,"CANCELLED")||(0,l.bJ)(e,"BAD_DATA")||(0,l.bJ)(e,"NETWORK_ERROR")||(0,l.bJ)(e,"UNSUPPORTED_OPERATION"))return null==e.info&&(e.info={}),e.info.sendTransactionHash=t,void c(e);if((0,l.bJ)(e,"INVALID_ARGUMENT")&&(d++,null==e.info&&(e.info={}),e.info.sendTransactionHash=t,d>10))return void c(e);this.provider.emit("error",(0,l.xz)("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:e}))}this.provider._setTimeout((()=>{r()}),f.pop()||4e3)};r()}))}async signTransaction(e){const a=we(e);if(a.from){const t=await(0,i.tG)(a.from,this.provider);(0,l.MR)(null!=t&&t.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),a.from=t}else a.from=this.address;const t=this.provider.getRpcTransaction(a);return await this.provider.send("eth_signTransaction",[t])}async signMessage(e){const a="string"==typeof e?(0,u.YW)(e):e;return await this.provider.send("personal_sign",[(0,h.c$)(a),this.address.toLowerCase()])}async signTypedData(e,a,t){const c=we(t),f=await b.z.resolveNames(e,a,c,(async e=>{const a=await(0,i.tG)(e);return(0,l.MR)(null!=a,"TypedData does not support null address","value",e),a}));return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(b.z.getPayload(f.domain,a,f.value))])}async unlock(e){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),e,null])}async _legacySignMessage(e){const a="string"==typeof e?(0,u.YW)(e):e;return await this.provider.send("eth_sign",[this.address.toLowerCase(),(0,h.c$)(a)])}}class Be extends re{#E;#Q;#U;#j;#H;#P;#$;#q(){if(this.#j)return;const e=1===this._getOption("batchMaxCount")?0:this._getOption("batchStallTime");this.#j=setTimeout((()=>{this.#j=null;const e=this.#U;for(this.#U=[];e.length;){const a=[e.shift()];for(;e.length&&a.length!==this.#E.batchMaxCount;)if(a.push(e.shift()),JSON.stringify(a.map((e=>e.payload))).length>this.#E.batchMaxSize){e.unshift(a.pop());break}(async()=>{const e=1===a.length?a[0].payload:a.map((e=>e.payload));this.emit("debug",{action:"sendRpcPayload",payload:e});try{const t=await this._send(e);this.emit("debug",{action:"receiveRpcResult",result:t});for(const{resolve:e,reject:c,payload:f}of a){if(this.destroyed){c((0,l.xz)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:f.method}));continue}const a=t.filter((e=>e.id===f.id))[0];if(null!=a)"error"in a?c(this.getRpcError(f,a)):e(a.result);else{const e=(0,l.xz)("missing response for request","BAD_DATA",{value:t,info:{payload:f}});this.emit("error",e),c(e)}}}catch(e){this.emit("debug",{action:"receiveRpcError",error:e});for(const{reject:t}of a)t(e)}})()}}),e)}constructor(e,a){super(e,a),this.#Q=1,this.#E=Object.assign({},Ce,a||{}),this.#U=[],this.#j=null,this.#P=null,this.#$=null;{let e=null;const a=new Promise((a=>{e=a}));this.#H={promise:a,resolve:e}}const t=this._getOption("staticNetwork");"boolean"==typeof t?((0,l.MR)(!t||"any"!==e,"staticNetwork cannot be used on special network 'any'","options",a),t&&null!=e&&(this.#P=U.from(e))):t&&((0,l.MR)(null==e||t.matches(e),"staticNetwork MUST match network object","options",a),this.#P=t)}_getOption(e){return this.#E[e]}get _network(){return(0,l.vA)(this.#P,"network is not available yet","NETWORK_ERROR"),this.#P}async _perform(e){if("call"===e.method||"estimateGas"===e.method){let a=e.transaction;if(a&&null!=a.type&&(0,p.Ab)(a.type)&&null==a.maxFeePerGas&&null==a.maxPriorityFeePerGas){const t=await this.getFeeData();null==t.maxFeePerGas&&null==t.maxPriorityFeePerGas&&(e=Object.assign({},e,{transaction:Object.assign({},a,{type:void 0})}))}}const a=this.getRpcRequest(e);return null!=a?await this.send(a.method,a.args):super._perform(e)}async _detectNetwork(){const e=this._getOption("staticNetwork");if(e){if(!0!==e)return e;if(this.#P)return this.#P}return this.#$?await this.#$:this.ready?(this.#$=(async()=>{try{const e=U.from((0,p.Ab)(await this.send("eth_chainId",[])));return this.#$=null,e}catch(e){throw this.#$=null,e}})(),await this.#$):(this.#$=(async()=>{const e={id:this.#Q++,method:"eth_chainId",params:[],jsonrpc:"2.0"};let a;this.emit("debug",{action:"sendRpcPayload",payload:e});try{a=(await this._send(e))[0],this.#$=null}catch(e){throw this.#$=null,this.emit("debug",{action:"receiveRpcError",error:e}),e}if(this.emit("debug",{action:"receiveRpcResult",result:a}),"result"in a)return U.from((0,p.Ab)(a.result));throw this.getRpcError(e,a)})(),await this.#$)}_start(){null!=this.#H&&null!=this.#H.resolve&&(this.#H.resolve(),this.#H=null,(async()=>{for(;null==this.#P&&!this.destroyed;)try{this.#P=await this._detectNetwork()}catch(e){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",(0,l.xz)("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:e}})),await _e(1e3)}this.#q()})())}async _waitUntilReady(){if(null!=this.#H)return await this.#H.promise}_getSubscriber(e){return"pending"===e.type?new Ae(this):"event"===e.type?this._getOption("polling")?new W(this,e.filter):new xe(this,e.filter):"orphan"===e.type&&"drop-log"===e.filter.orphan?new ae("orphan"):super._getSubscriber(e)}get ready(){return null==this.#H}getRpcTransaction(e){const a={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((t=>{if(null==e[t])return;let c=t;"gasLimit"===t&&(c="gas"),a[c]=(0,p.nD)((0,p.Ab)(e[t],`tx.${t}`))})),["from","to","data"].forEach((t=>{null!=e[t]&&(a[t]=(0,h.c$)(e[t]))})),e.accessList&&(a.accessList=(0,o.$)(e.accessList)),e.blobVersionedHashes&&(a.blobVersionedHashes=e.blobVersionedHashes.map((e=>e.toLowerCase()))),a}getRpcRequest(e){switch(e.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[Ie(e.address),e.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[Ie(e.address),e.blockTag]};case"getCode":return{method:"eth_getCode",args:[Ie(e.address),e.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[Ie(e.address),"0x"+e.position.toString(16),e.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[e.signedTransaction]};case"getBlock":if("blockTag"in e)return{method:"eth_getBlockByNumber",args:[e.blockTag,!!e.includeTransactions]};if("blockHash"in e)return{method:"eth_getBlockByHash",args:[e.blockHash,!!e.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[e.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[e.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(e.transaction),e.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(e.transaction)]};case"getLogs":return e.filter&&null!=e.filter.address&&(Array.isArray(e.filter.address)?e.filter.address=e.filter.address.map(Ie):e.filter.address=Ie(e.filter.address)),{method:"eth_getLogs",args:[e.filter]}}return null}getRpcError(e,a){const{method:t}=e,{error:c}=a;if("eth_estimateGas"===t&&c.message){const a=c.message;if(!a.match(/revert/i)&&a.match(/insufficient funds/i))return(0,l.xz)("insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.params[0],info:{payload:e,error:c}})}if("eth_call"===t||"eth_estimateGas"===t){const a=Se(c),f=r.y.getBuiltinCallException("eth_call"===t?"call":"estimateGas",e.params[0],a?a.data:null);return f.info={error:c,payload:e},f}const f=JSON.stringify(function(e){const a=[];return Te(e,a),a}(c));if("string"==typeof c.message&&c.message.match(/user denied|ethers-user-denied/i)){const a={eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"};return(0,l.xz)("user rejected action","ACTION_REJECTED",{action:a[t]||"unknown",reason:"rejected",info:{payload:e,error:c}})}if("eth_sendRawTransaction"===t||"eth_sendTransaction"===t){const a=e.params[0];if(f.match(/insufficient funds|base fee exceeds gas limit/i))return(0,l.xz)("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:a,info:{error:c}});if(f.match(/nonce/i)&&f.match(/too low/i))return(0,l.xz)("nonce has already been used","NONCE_EXPIRED",{transaction:a,info:{error:c}});if(f.match(/replacement transaction/i)&&f.match(/underpriced/i))return(0,l.xz)("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:a,info:{error:c}});if(f.match(/only replay-protected/i))return(0,l.xz)("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:t,info:{transaction:a,info:{error:c}}})}let d=!!f.match(/the method .* does not exist/i);return d||c&&c.details&&c.details.startsWith("Unauthorized method:")&&(d=!0),d?(0,l.xz)("unsupported operation","UNSUPPORTED_OPERATION",{operation:e.method,info:{error:c,payload:e}}):(0,l.xz)("could not coalesce error","UNKNOWN_ERROR",{error:c,payload:e})}send(e,a){if(this.destroyed)return Promise.reject((0,l.xz)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e}));const t=this.#Q++,c=new Promise(((c,f)=>{this.#U.push({resolve:c,reject:f,payload:{method:e,params:a,id:t,jsonrpc:"2.0"}})}));return this.#q(),c}async getSigner(e){null==e&&(e=0);const a=this.send("eth_accounts",[]);if("number"==typeof e){const t=await a;if(e>=t.length)throw new Error("no such account");return new Me(this,t[e])}const{accounts:t}=await(0,s.k)({network:this.getNetwork(),accounts:a});e=(0,n.b)(e);for(const a of t)if((0,n.b)(a)===e)return new Me(this,e);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map((e=>new Me(this,e)))}destroy(){this.#j&&(clearTimeout(this.#j),this.#j=null);for(const{payload:e,reject:a}of this.#U)a((0,l.xz)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e.method}));this.#U=[],super.destroy()}}class ke extends Be{#z;constructor(e,a){super(e,a);let t=this._getOption("pollingInterval");null==t&&(t=Ce.pollingInterval),this.#z=t}_getSubscriber(e){const a=super._getSubscriber(e);return Ee(a)&&(a.pollingInterval=this.#z),a}get pollingInterval(){return this.#z}set pollingInterval(e){if(!Number.isInteger(e)||e<0)throw new Error("invalid interval");this.#z=e,this._forEachSubscriber((e=>{Ee(e)&&(e.pollingInterval=this.#z)}))}}class Le extends ke{#G;constructor(e,a,t){null==e&&(e="http://localhost:8545"),super(a,t),this.#G="string"==typeof e?new d.ui(e):e.clone()}_getConnection(){return this.#G.clone()}async send(e,a){return await this._start(),await super.send(e,a)}async _send(e){const a=this._getConnection();a.body=JSON.stringify(e),a.setHeader("content-type","application/json");const t=await a.send();t.assertOk();let c=t.bodyJson;return Array.isArray(c)||(c=[c]),c}}function Se(e){if(null==e)return null;if("string"==typeof e.message&&e.message.match(/revert/i)&&(0,h.Lo)(e.data))return{message:e.message,data:e.data};if("object"==typeof e){for(const a in e){const t=Se(e[a]);if(t)return t}return null}if("string"==typeof e)try{return Se(JSON.parse(e))}catch(e){}return null}function Te(e,a){if(null!=e){if("string"==typeof e.message&&a.push(e.message),"object"==typeof e)for(const t in e)Te(e[t],a);if("string"==typeof e)try{return Te(JSON.parse(e),a)}catch(e){}}}var Ne=t(15496),Re=t(15539);var Pe=t(20415);class De extends ge{address;#K;constructor(e,a){super(a),(0,l.MR)(e&&"function"==typeof e.sign,"invalid private key","privateKey","[ REDACTED ]"),this.#K=e;const t=(0,Pe.K)(this.signingKey.publicKey);(0,s.n)(this,{address:t})}get signingKey(){return this.#K}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(e){return new De(this.#K,e)}async signTransaction(e){e=(0,q.VS)(e);const{to:a,from:t}=await(0,s.k)({to:e.to?(0,i.tG)(e.to,this.provider):void 0,from:e.from?(0,i.tG)(e.from,this.provider):void 0});null!=a&&(e.to=a),null!=t&&(e.from=t),null!=e.from&&((0,l.MR)((0,n.b)(e.from)===this.address,"transaction from address mismatch","tx.from",e.from),delete e.from);const c=x.Z.from(e);return c.signature=this.signingKey.sign(c.unsignedHash),c.serialized}async signMessage(e){return this.signMessageSync(e)}signMessageSync(e){return this.signingKey.sign(function(e){return"string"==typeof e&&(e=(0,u.YW)(e)),(0,Re.S)((0,h.xW)([(0,u.YW)("Ethereum Signed Message:\n"),(0,u.YW)(String(e.length)),e]))}(e)).serialized}async signTypedData(e,a,t){const c=await b.z.resolveNames(e,a,t,(async e=>{(0,l.vA)(null!=this.provider,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:e}});const a=await this.provider.resolveName(e);return(0,l.vA)(null!=a,"unconfigured ENS name","UNCONFIGURED_NAME",{value:e}),a}));return this.signingKey.sign(b.z.hash(c.domain,a,c.value)).serialized}}var Oe=t(68650),Fe=t(8180);let Qe=!1;const Ue=function(e,a,t){return(0,Fe.Gz)(e,a).update(t).digest()};let je=Ue;function He(e,a,t){const c=(0,h.q5)(a,"key"),f=(0,h.q5)(t,"data");return(0,h.c$)(je(e,c,f))}He._=Ue,He.lock=function(){Qe=!0},He.register=function(e){if(Qe)throw new Error("computeHmac is locked");je=e},Object.freeze(He);var $e=t(37171),qe=t(10750);const ze=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Ge=Uint8Array.from({length:16},((e,a)=>a));let Ke=[Ge],Ve=[Ge.map((e=>(9*e+5)%16))];for(let e=0;e<4;e++)for(let a of[Ke,Ve])a.push(a[e].map((e=>ze[e])));const Ze=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map((e=>new Uint8Array(e))),Je=Ke.map(((e,a)=>e.map((e=>Ze[a][e])))),We=Ve.map(((e,a)=>e.map((e=>Ze[a][e])))),Ye=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),Xe=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),ea=(e,a)=>e<>>32-a;function aa(e,a,t,c){return 0===e?a^t^c:1===e?a&t|~a&c:2===e?(a|~t)^c:3===e?a&c|t&~c:a^(t|~c)}const ta=new Uint32Array(16);class ca extends $e.D{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:a,h2:t,h3:c,h4:f}=this;return[e,a,t,c,f]}set(e,a,t,c,f){this.h0=0|e,this.h1=0|a,this.h2=0|t,this.h3=0|c,this.h4=0|f}process(e,a){for(let t=0;t<16;t++,a+=4)ta[t]=e.getUint32(a,!0);let t=0|this.h0,c=t,f=0|this.h1,d=f,r=0|this.h2,n=r,i=0|this.h3,b=i,o=0|this.h4,s=o;for(let e=0;e<5;e++){const a=4-e,l=Ye[e],u=Xe[e],h=Ke[e],p=Ve[e],g=Je[e],m=We[e];for(let a=0;a<16;a++){const c=ea(t+aa(e,f,r,i)+ta[h[a]]+l,g[a])+o|0;t=o,o=i,i=0|ea(r,10),r=f,f=c}for(let e=0;e<16;e++){const t=ea(c+aa(a,d,n,b)+ta[p[e]]+u,m[e])+s|0;c=s,s=b,b=0|ea(n,10),n=d,d=t}}this.set(this.h1+r+b|0,this.h2+i+s|0,this.h3+o+c|0,this.h4+t+d|0,this.h0+f+n|0)}roundClean(){ta.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const fa=(0,qe.ld)((()=>new ca));let da=!1;const ra=function(e){return fa(e)};let na=ra;function ia(e){const a=(0,h.q5)(e,"data");return(0,h.c$)(na(a))}ia._=ra,ia.lock=function(){da=!0},ia.register=function(e){if(da)throw new TypeError("ripemd160 is locked");na=e},Object.freeze(ia);let ba=!1;const oa=function(e){return new Uint8Array((0,Fe.po)(e))};let sa=oa;function la(e){return sa(e)}la._=oa,la.lock=function(){ba=!0},la.register=function(e){if(ba)throw new Error("randomBytes is locked");sa=e},Object.freeze(la);var ua=t(14132),ha=t(38264);const pa=/^[a-z]*$/i;function ga(e,a){let t=97;return e.reduce(((e,c)=>(c===a?t++:c.match(pa)?e.push(String.fromCharCode(t)+c):(t=97,e.push(c)),e)),[])}class ma{locale;constructor(e){(0,s.n)(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(" ")}}class ya extends ma{#V;#Z;constructor(e,a,t){super(e),this.#V=a,this.#Z=t,this.#J=null}get _data(){return this.#V}_decodeWords(){return e=this.#V,(0,l.MR)("0"===e[0],"unsupported auwl data","data",e),function(e,a){for(let t=28;t>=0;t--)e=e.split(" !#$%&'()*+,-./<=>?@[]^_`{|}~"[t]).join(a.substring(2*t,2*t+2));const t=[],c=e.replace(/(:|([0-9])|([A-Z][a-z]*))/g,((e,a,c,f)=>{if(c)for(let e=parseInt(c);e>=0;e--)t.push(";");else t.push(a.toLowerCase());return""}));if(c)throw new Error(`leftovers: ${JSON.stringify(c)}`);return ga(ga(t,";"),":")}(e.substring(59),e.substring(1,59));var e}#J;#W(){if(null==this.#J){const e=this._decodeWords();if((0,ha.id)(e.join("\n")+"\n")!==this.#Z)throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);this.#J=e}return this.#J}getWord(e){const a=this.#W();return(0,l.MR)(e>=0&&eurAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-EgSe0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-PM&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryFN Noc|PutQuirySSue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurEAyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO","0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60")}static wordlist(){return null==xa&&(xa=new Aa),xa}}let va=!1;const wa=function(e,a,t,c,f){return(0,Fe.T_)(e,a,t,c,f)};let _a=wa;function Ia(e,a,t,c,f){const d=(0,h.q5)(e,"password"),r=(0,h.q5)(a,"salt");return(0,h.c$)(_a(d,r,t,c,f))}function Ea(e){return(1<=12&&t.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const c=new Uint8Array(Math.ceil(11*t.length/8));let f=0;for(let e=0;e=0,`invalid mnemonic word at index ${e}`,"mnemonic","[ REDACTED ]");for(let e=0;e<11;e++)d&1<<10-e&&(c[f>>3]|=1<<7-f%8),f++}const d=32*t.length/3,r=Ea(t.length/3),n=(0,h.q5)((0,Oe.s)(c.slice(0,d/8)))[0]&r;return(0,l.MR)(n===(c[c.length-1]&r),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),(0,h.c$)(c.slice(0,d/8))}function Ma(e,a){(0,l.MR)(e.length%4==0&&e.length>=16&&e.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),null==a&&(a=Aa.wordlist());const t=[0];let c=11;for(let a=0;a8?(t[t.length-1]<<=8,t[t.length-1]|=e[a],c-=8):(t[t.length-1]<<=c,t[t.length-1]|=e[a]>>8-c,t.push(e[a]&(1<<8-c)-1&255),c+=3);const f=e.length/4,d=parseInt((0,Oe.s)(e).substring(2,4),16)&Ea(f);return t[t.length-1]<<=f,t[t.length-1]|=d>>8-f,a.join(t.map((e=>a.getWord(e))))}Ia._=wa,Ia.lock=function(){va=!0},Ia.register=function(e){if(va)throw new Error("pbkdf2 is locked");_a=e},Object.freeze(Ia);const Ba={};class ka{phrase;password;wordlist;entropy;constructor(e,a,t,c,f){null==c&&(c=""),null==f&&(f=Aa.wordlist()),(0,l.gk)(e,Ba,"Mnemonic"),(0,s.n)(this,{phrase:t,password:c,wordlist:f,entropy:a})}computeSeed(){const e=(0,u.YW)("mnemonic"+this.password,"NFKD");return Ia((0,u.YW)(this.phrase,"NFKD"),e,2048,64,"sha512")}static fromPhrase(e,a,t){const c=Ca(e,t);return e=Ma((0,h.q5)(c),t),new ka(Ba,c,e,a,t)}static fromEntropy(e,a,t){const c=(0,h.q5)(e,"entropy"),f=Ma(c,t);return new ka(Ba,(0,h.c$)(c),f,a,t)}static entropyToPhrase(e,a){return Ma((0,h.q5)(e,"entropy"),a)}static phraseToEntropy(e,a){return Ca(e,a)}static isValidMnemonic(e,a){try{return Ca(e,a),!0}catch(e){}return!1}}var La,Sa,Ta,Na=function(e,a,t,c){if("a"===t&&!c)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof a?e!==a||!c:!a.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?c:"a"===t?c.call(e):c?c.value:a.get(e)},Ra=function(e,a,t,c,f){if("m"===c)throw new TypeError("Private method is not writable");if("a"===c&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof a?e!==a||!f:!a.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===c?f.call(e,t):f?f.value=t:a.set(e,t),t};const Pa={16:10,24:12,32:14},Da=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],Oa=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],Fa=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],Qa=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],Ua=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],ja=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],Ha=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],$a=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],qa=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],za=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],Ga=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],Ka=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],Va=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],Za=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],Ja=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function Wa(e){const a=[];for(let t=0;t>2,Na(this,Ta,"f")[d][e%4]=f[e],Na(this,Sa,"f")[a-d][e%4]=f[e];let r,n=0,i=c;for(;i>16&255]<<24^Oa[r>>8&255]<<16^Oa[255&r]<<8^Oa[r>>24&255]^Da[n]<<24,n+=1,8!=c)for(let e=1;e>8&255]<<8^Oa[r>>16&255]<<16^Oa[r>>24&255]<<24;for(let e=c/2+1;e>2,d=i%4,Na(this,Ta,"f")[e][d]=f[b],Na(this,Sa,"f")[a-e][d]=f[b++],i++}for(let e=1;e>24&255]^Va[r>>16&255]^Za[r>>8&255]^Ja[255&r]}encrypt(e){if(16!=e.length)throw new TypeError("invalid plaintext size (must be 16 bytes)");const a=Na(this,Ta,"f").length-1,t=[0,0,0,0];let c=Wa(e);for(let e=0;e<4;e++)c[e]^=Na(this,Ta,"f")[0][e];for(let e=1;e>24&255]^Ua[c[(a+1)%4]>>16&255]^ja[c[(a+2)%4]>>8&255]^Ha[255&c[(a+3)%4]]^Na(this,Ta,"f")[e][a];c=t.slice()}const f=new Uint8Array(16);let d=0;for(let e=0;e<4;e++)d=Na(this,Ta,"f")[a][e],f[4*e]=255&(Oa[c[e]>>24&255]^d>>24),f[4*e+1]=255&(Oa[c[(e+1)%4]>>16&255]^d>>16),f[4*e+2]=255&(Oa[c[(e+2)%4]>>8&255]^d>>8),f[4*e+3]=255&(Oa[255&c[(e+3)%4]]^d);return f}decrypt(e){if(16!=e.length)throw new TypeError("invalid ciphertext size (must be 16 bytes)");const a=Na(this,Sa,"f").length-1,t=[0,0,0,0];let c=Wa(e);for(let e=0;e<4;e++)c[e]^=Na(this,Sa,"f")[0][e];for(let e=1;e>24&255]^qa[c[(a+3)%4]>>16&255]^za[c[(a+2)%4]>>8&255]^Ga[255&c[(a+1)%4]]^Na(this,Sa,"f")[e][a];c=t.slice()}const f=new Uint8Array(16);let d=0;for(let e=0;e<4;e++)d=Na(this,Sa,"f")[a][e],f[4*e]=255&(Fa[c[e]>>24&255]^d>>24),f[4*e+1]=255&(Fa[c[(e+3)%4]>>16&255]^d>>16),f[4*e+2]=255&(Fa[c[(e+2)%4]>>8&255]^d>>8),f[4*e+3]=255&(Fa[255&c[(e+1)%4]]^d);return f}}La=new WeakMap,Sa=new WeakMap,Ta=new WeakMap;class Xa{constructor(e,a,t){if(t&&!(this instanceof t))throw new Error(`${e} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new Ya(a)},name:{enumerable:!0,value:e}})}}var et,at,tt=function(e,a,t,c,f){if("m"===c)throw new TypeError("Private method is not writable");if("a"===c&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof a?e!==a||!f:!a.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===c?f.call(e,t):f?f.value=t:a.set(e,t),t},ct=function(e,a,t,c){if("a"===t&&!c)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof a?e!==a||!c:!a.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?c:"a"===t?c.call(e):c?c.value:a.get(e)};class ft extends Xa{constructor(e,a){if(super("ECC",e,ft),et.set(this,void 0),at.set(this,void 0),a){if(a.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");tt(this,et,new Uint8Array(a),"f")}else tt(this,et,new Uint8Array(16),"f");tt(this,at,this.iv,"f")}get iv(){return new Uint8Array(ct(this,et,"f"))}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const a=new Uint8Array(e.length);for(let t=0;tNumber.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let a=15;a>=0;--a)bt(this,nt,"f")[a]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(16!==e.length)throw new TypeError("invalid counter initial Uint8Array value length");bt(this,nt,"f").set(e)}increment(){for(let e=15;e>=0;e--){if(255!==bt(this,nt,"f")[e]){bt(this,nt,"f")[e]++;break}bt(this,nt,"f")[e]=0}}encrypt(e){var a,t;const c=new Uint8Array(e);for(let e=0;ee<>>32-a;function pt(e,a,t,c,f,d){let r=e[a++]^t[c++],n=e[a++]^t[c++],i=e[a++]^t[c++],b=e[a++]^t[c++],o=e[a++]^t[c++],s=e[a++]^t[c++],l=e[a++]^t[c++],u=e[a++]^t[c++],h=e[a++]^t[c++],p=e[a++]^t[c++],g=e[a++]^t[c++],m=e[a++]^t[c++],y=e[a++]^t[c++],x=e[a++]^t[c++],A=e[a++]^t[c++],v=e[a++]^t[c++],w=r,_=n,I=i,E=b,C=o,M=s,B=l,k=u,L=h,S=p,T=g,N=m,R=y,P=x,D=A,O=v;for(let e=0;e<8;e+=2)C^=ht(w+R|0,7),L^=ht(C+w|0,9),R^=ht(L+C|0,13),w^=ht(R+L|0,18),S^=ht(M+_|0,7),P^=ht(S+M|0,9),_^=ht(P+S|0,13),M^=ht(_+P|0,18),D^=ht(T+B|0,7),I^=ht(D+T|0,9),B^=ht(I+D|0,13),T^=ht(B+I|0,18),E^=ht(O+N|0,7),k^=ht(E+O|0,9),N^=ht(k+E|0,13),O^=ht(N+k|0,18),_^=ht(w+E|0,7),I^=ht(_+w|0,9),E^=ht(I+_|0,13),w^=ht(E+I|0,18),B^=ht(M+C|0,7),k^=ht(B+M|0,9),C^=ht(k+B|0,13),M^=ht(C+k|0,18),N^=ht(T+S|0,7),L^=ht(N+T|0,9),S^=ht(L+N|0,13),T^=ht(S+L|0,18),R^=ht(O+D|0,7),P^=ht(R+O|0,9),D^=ht(P+R|0,13),O^=ht(D+P|0,18);f[d++]=r+w|0,f[d++]=n+_|0,f[d++]=i+I|0,f[d++]=b+E|0,f[d++]=o+C|0,f[d++]=s+M|0,f[d++]=l+B|0,f[d++]=u+k|0,f[d++]=h+L|0,f[d++]=p+S|0,f[d++]=g+T|0,f[d++]=m+N|0,f[d++]=y+R|0,f[d++]=x+P|0,f[d++]=A+D|0,f[d++]=v+O|0}function gt(e,a,t,c,f){let d=c+0,r=c+16*f;for(let c=0;c<16;c++)t[r+c]=e[a+16*(2*f-1)+c];for(let c=0;c0&&(r+=16),pt(t,d,e,a+=16,t,r)}function mt(e,a,t){const c=(0,qe.tY)({dkLen:32,asyncTick:10,maxmem:1073742848},t),{N:f,r:d,p:r,dkLen:n,asyncTick:i,maxmem:b,onProgress:o}=c;if((0,st.ai)(f),(0,st.ai)(d),(0,st.ai)(r),(0,st.ai)(n),(0,st.ai)(i),(0,st.ai)(b),void 0!==o&&"function"!=typeof o)throw new Error("progressCb should be function");const s=128*d,l=s/4;if(f<=1||f&f-1||f>=2**(s/8)||f>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(r<0||r>137438953440/s)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(n<0||n>137438953440)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const u=s*(f+r);if(u>b)throw new Error(`Scrypt: parameters too large, ${u} (128 * r * (N + p)) > ${b} (maxmem)`);const h=(0,ut.A)(lt.s,e,a,{c:1,dkLen:s*r}),p=(0,qe.DH)(h),g=(0,qe.DH)(new Uint8Array(s*f)),m=(0,qe.DH)(new Uint8Array(s));let y=()=>{};if(o){const e=2*f*r,a=Math.max(Math.floor(e/1e4),1);let t=0;y=()=>{t++,!o||t%a&&t!==e||o(t/e)}}return{N:f,r:d,p:r,dkLen:n,blockSize32:l,V:g,B32:p,B:h,tmp:m,blockMixCb:y,asyncTick:i}}function yt(e,a,t,c,f){const d=(0,ut.A)(lt.s,e,t,{c:1,dkLen:a});return t.fill(0),c.fill(0),f.fill(0),d}let xt=!1,At=!1;const vt=async function(e,a,t,c,f,d,r){return await async function(e,a,t){const{N:c,r:f,p:d,dkLen:r,blockSize32:n,V:i,B32:b,B:o,tmp:s,blockMixCb:l,asyncTick:u}=mt(e,a,t);for(let e=0;e{gt(i,t,i,t+=n,f),l()})),gt(i,(c-1)*n,b,a,f),l(),await(0,qe.$h)(c,u,(()=>{const e=b[a+n-16]%c;for(let t=0;t0&&!(c&c-1),"invalid kdf.N","kdf.N",c),(0,l.MR)(f>0&&d>0,"invalid kdf","kdf",a);const r=St(e,"crypto.kdfparams.dklen:int!");return(0,l.MR)(32===r,"invalid kdf.dklen","kdf.dflen",r),{name:"scrypt",salt:t,N:c,r:f,p:d,dkLen:64}}if("pbkdf2"===a.toLowerCase()){const a=St(e,"crypto.kdfparams.salt:data!"),t=St(e,"crypto.kdfparams.prf:string!"),c=t.split("-").pop();(0,l.MR)("sha256"===c||"sha512"===c,"invalid kdf.pdf","kdf.pdf",t);const f=St(e,"crypto.kdfparams.c:int!"),d=St(e,"crypto.kdfparams.dklen:int!");return(0,l.MR)(32===d,"invalid kdf.dklen","kdf.dklen",d),{name:"pbkdf2",salt:a,count:f,dkLen:d,algorithm:c}}}(0,l.MR)(!1,"unsupported key-derivation function","kdf",a)}function Ot(e){return new Promise((a=>{setTimeout((()=>{a()}),e)}))}function Ft(e){const a=null!=e.salt?(0,h.q5)(e.salt,"options.salt"):la(32);let t=1<<17,c=8,f=1;return e.scrypt&&(e.scrypt.N&&(t=e.scrypt.N),e.scrypt.r&&(c=e.scrypt.r),e.scrypt.p&&(f=e.scrypt.p)),(0,l.MR)("number"==typeof t&&t>0&&Number.isSafeInteger(t)&&(BigInt(t)&BigInt(t-1))===BigInt(0),"invalid scrypt N parameter","options.N",t),(0,l.MR)("number"==typeof c&&c>0&&Number.isSafeInteger(c),"invalid scrypt r parameter","options.r",c),(0,l.MR)("number"==typeof f&&f>0&&Number.isSafeInteger(f),"invalid scrypt p parameter","options.p",f),{name:"scrypt",dkLen:32,salt:a,N:t,r:c,p:f}}function Qt(e,a,t,c){const f=(0,h.q5)(t.privateKey,"privateKey"),d=null!=c.iv?(0,h.q5)(c.iv,"options.iv"):la(16);(0,l.MR)(16===d.length,"invalid options.iv length","options.iv",c.iv);const r=null!=c.uuid?(0,h.q5)(c.uuid,"options.uuid"):la(16);(0,l.MR)(16===r.length,"invalid options.uuid length","options.uuid",c.iv);const n=e.slice(0,16),i=e.slice(16,32),b=new ot(n,d),o=(0,h.q5)(b.encrypt(f)),s=(0,Re.S)((0,h.xW)([i,o])),u={address:t.address.substring(2).toLowerCase(),id:Mt(r),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,h.c$)(d).substring(2)},ciphertext:(0,h.c$)(o).substring(2),kdf:"scrypt",kdfparams:{salt:(0,h.c$)(a.salt).substring(2),n:a.N,dklen:32,p:a.p,r:a.r},mac:s.substring(2)}};if(t.mnemonic){const a=null!=c.client?c.client:`ethers/${Tt.r}`,f=t.mnemonic.path||Nt,d=t.mnemonic.locale||"en",r=e.slice(32,64),n=(0,h.q5)(t.mnemonic.entropy,"account.mnemonic.entropy"),i=la(16),b=new ot(r,i),o=(0,h.q5)(b.encrypt(n)),s=new Date,l="UTC--"+s.getUTCFullYear()+"-"+kt(s.getUTCMonth()+1,2)+"-"+kt(s.getUTCDate(),2)+"T"+kt(s.getUTCHours(),2)+"-"+kt(s.getUTCMinutes(),2)+"-"+kt(s.getUTCSeconds(),2)+".0Z--"+u.address;u["x-ethers"]={client:a,gethFilename:l,path:f,locale:d,mnemonicCounter:(0,h.c$)(i).substring(2),mnemonicCiphertext:(0,h.c$)(o).substring(2),version:"0.1"}}return JSON.stringify(u)}function Ut(e,a,t){null==t&&(t={});const c=Lt(a),f=Ft(t),d=Ct(c,f.salt,f.N,f.r,f.p,64);return Qt((0,h.q5)(d),f,e,t)}async function jt(e,a,t){null==t&&(t={});const c=Lt(a),f=Ft(t),d=await Et(c,f.salt,f.N,f.r,f.p,64,t.progressCallback);return Qt((0,h.q5)(d),f,e,t)}const Ht="m/44'/60'/0'/0/0",$t=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),qt=2147483648,zt=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");function Gt(e,a){let t="";for(;e;)t="0123456789abcdef"[e%16]+t,e=Math.trunc(e/16);for(;t.length<2*a;)t="0"+t;return"0x"+t}function Kt(e){const a=(0,h.q5)(e),t=(0,h.ZG)((0,Oe.s)((0,Oe.s)(a)),0,4),c=(0,h.xW)([a,t]);return(0,ua.R)(c)}const Vt={};function Zt(e,a,t,c){const f=new Uint8Array(37);e&qt?((0,l.vA)(null!=c,"cannot derive child of neutered node","UNSUPPORTED_OPERATION",{operation:"deriveChild"}),f.set((0,h.q5)(c),1)):f.set((0,h.q5)(t));for(let a=24;a>=0;a-=8)f[33+(a>>3)]=e>>24-a&255;const d=(0,h.q5)(He("sha512",a,f));return{IL:d.slice(0,32),IR:d.slice(32)}}function Jt(e,a){const t=a.split("/");(0,l.MR)(t.length>0,"invalid path","path",a),"m"===t[0]&&((0,l.MR)(0===e.depth,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${e.depth}`,"path",a),t.shift());let c=e;for(let e=0;e=16&&t.length<=64,"invalid seed","seed","[REDACTED]");const c=(0,h.q5)(He("sha512",$t,t)),f=new Ne.h((0,h.c$)(c.slice(0,32)));return new Wt(Vt,f,"0x00000000",(0,h.c$)(c.slice(32)),"m",0,0,a,null)}static fromExtendedKey(e){const a=(0,p.c4)((0,ua.H)(e));(0,l.MR)(82===a.length||Kt(a.slice(0,78))===e,"invalid extended key","extendedKey","[ REDACTED ]");const t=a[4],c=(0,h.c$)(a.slice(5,9)),f=parseInt((0,h.c$)(a.slice(9,13)).substring(2),16),d=(0,h.c$)(a.slice(13,45)),r=a.slice(45,78);switch((0,h.c$)(a.slice(0,4))){case"0x0488b21e":case"0x043587cf":{const e=(0,h.c$)(r);return new Yt(Vt,(0,Pe.K)(e),e,c,d,null,f,t,null)}case"0x0488ade4":case"0x04358394 ":if(0!==r[0])break;return new Wt(Vt,new Ne.h(r.slice(1)),c,d,null,f,t,null,null)}(0,l.MR)(!1,"invalid extended key prefix","extendedKey","[ REDACTED ]")}static createRandom(e,a,t){null==e&&(e=""),null==a&&(a=Ht),null==t&&(t=Aa.wordlist());const c=ka.fromEntropy(la(16),e,t);return Wt.#X(c.computeSeed(),c).derivePath(a)}static fromMnemonic(e,a){return a||(a=Ht),Wt.#X(e.computeSeed(),e).derivePath(a)}static fromPhrase(e,a,t,c){null==a&&(a=""),null==t&&(t=Ht),null==c&&(c=Aa.wordlist());const f=ka.fromPhrase(e,a,c);return Wt.#X(f.computeSeed(),f).derivePath(t)}static fromSeed(e){return Wt.#X(e,null)}}class Yt extends me{publicKey;fingerprint;parentFingerprint;chainCode;path;index;depth;constructor(e,a,t,c,f,d,r,n,i){super(a,i),(0,l.gk)(e,Vt,"HDNodeVoidWallet"),(0,s.n)(this,{publicKey:t});const b=(0,h.ZG)(ia((0,Oe.s)(t)),0,4);(0,s.n)(this,{publicKey:t,fingerprint:b,parentFingerprint:c,chainCode:f,path:d,index:r,depth:n})}connect(e){return new Yt(Vt,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,e)}get extendedKey(){return(0,l.vA)(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),Kt((0,h.xW)(["0x0488B21E",Gt(this.depth,1),this.parentFingerprint,Gt(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return null!=this.path}deriveChild(e){const a=(0,p.WZ)(e,"index");(0,l.MR)(a<=4294967295,"invalid index","index",a);let t=this.path;t&&(t+="/"+(2147483647&a),a&qt&&(t+="'"));const{IR:c,IL:f}=Zt(a,this.chainCode,this.publicKey,null),d=Ne.h.addPoints(f,this.publicKey,!0),r=(0,Pe.K)(d);return new Yt(Vt,r,d,this.fingerprint,(0,h.c$)(c),t,a,this.depth+1,this.provider)}derivePath(e){return Jt(this,e)}}function Xt(e){try{if(JSON.parse(e).encseed)return!0}catch(e){}return!1}function ec(e,a){const t=JSON.parse(e),c=Lt(a),f=(0,n.b)(St(t,"ethaddr:string!")),d=Bt(St(t,"encseed:string!"));(0,l.MR)(d&&d.length%16==0,"invalid encseed","json",e);const r=(0,h.q5)(Ia(c,c,2e3,32,"sha256")).slice(0,16),i=d.slice(0,16),b=d.slice(16),o=new ft(r,i),s=function(e){if(e.length<16)throw new TypeError("PKCS#7 invalid length");const a=e[e.length-1];if(a>16)throw new TypeError("PKCS#7 padding byte out of range");const t=e.length-a;for(let c=0;c{setTimeout((()=>{a()}),e)}))}class tc extends De{constructor(e,a){"string"!=typeof e||e.startsWith("0x")||(e="0x"+e),super("string"==typeof e?new Ne.h(e):e,a)}connect(e){return new tc(this.signingKey,e)}async encrypt(e,a){const t={address:this.address,privateKey:this.privateKey};return await jt(t,e,{progressCallback:a})}encryptSync(e){return Ut({address:this.address,privateKey:this.privateKey},e)}static#ee(e){if((0,l.MR)(e,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in e&&e.mnemonic&&"en"===e.mnemonic.locale){const a=ka.fromEntropy(e.mnemonic.entropy),t=Wt.fromMnemonic(a,e.mnemonic.path);if(t.address===e.address&&t.privateKey===e.privateKey)return t;console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const a=new tc(e.privateKey);return(0,l.MR)(a.address===e.address,"address/privateKey mismatch","json","[ REDACTED ]"),a}static async fromEncryptedJson(e,a,t){let c=null;return Rt(e)?c=await async function(e,a,t){const c=JSON.parse(e),f=Lt(a),d=Dt(c);if("pbkdf2"===d.name){t&&(t(0),await Ot(0));const{salt:e,count:a,dkLen:r,algorithm:n}=d,i=Ia(f,e,a,r,n);return t&&(t(1),await Ot(0)),Pt(c,i)}(0,l.vA)("scrypt"===d.name,"cannot be reached","UNKNOWN_ERROR",{params:d});const{salt:r,N:n,r:i,p:b,dkLen:o}=d;return Pt(c,await Et(f,r,n,i,b,o,t))}(e,a,t):Xt(e)&&(t&&(t(0),await ac(0)),c=ec(e,a),t&&(t(1),await ac(0))),tc.#ee(c)}static fromEncryptedJsonSync(e,a){let t=null;return Rt(e)?t=function(e,a){const t=JSON.parse(e),c=Lt(a),f=Dt(t);if("pbkdf2"===f.name){const{salt:e,count:a,dkLen:d,algorithm:r}=f;return Pt(t,Ia(c,e,a,d,r))}(0,l.vA)("scrypt"===f.name,"cannot be reached","UNKNOWN_ERROR",{params:f});const{salt:d,N:r,r:n,p:i,dkLen:b}=f;return Pt(t,Ct(c,d,r,n,i,b))}(e,a):Xt(e)?t=ec(e,a):(0,l.MR)(!1,"invalid JSON wallet","json","[ REDACTED ]"),tc.#ee(t)}static createRandom(e){const a=Wt.createRandom();return e?a.connect(e):a}static fromPhrase(e,a){const t=Wt.fromPhrase(e);return a?t.connect(a):t}}class cc extends ke{#ae;constructor(e,a,t){const c=Object.assign({},null!=t?t:{},{batchMaxCount:1});(0,l.MR)(e&&e.request,"invalid EIP-1193 provider","ethereum",e),super(a,c),this.#ae=async(a,t)=>{const c={method:a,params:t};this.emit("debug",{action:"sendEip1193Request",payload:c});try{const a=await e.request(c);return this.emit("debug",{action:"receiveEip1193Result",result:a}),a}catch(e){const a=new Error(e.message);throw a.code=e.code,a.data=e.data,a.payload=c,this.emit("debug",{action:"receiveEip1193Error",error:a}),a}}}async send(e,a){return await this._start(),await super.send(e,a)}async _send(e){(0,l.MR)(!Array.isArray(e),"EIP-1193 does not support batch request","payload",e);try{const a=await this.#ae(e.method,e.params||[]);return[{id:e.id,result:a}]}catch(a){return[{id:e.id,error:{code:a.code,data:a.data,message:a.message}}]}}getRpcError(e,a){switch((a=JSON.parse(JSON.stringify(a))).error.code||-1){case 4001:a.error.message=`ethers-user-denied: ${a.error.message}`;break;case 4200:a.error.message=`ethers-unsupported: ${a.error.message}`}return super.getRpcError(e,a)}async hasSigner(e){null==e&&(e=0);const a=await this.send("eth_accounts",[]);return"number"==typeof e?a.length>e:(e=e.toLowerCase(),0!==a.filter((a=>a.toLowerCase()===e)).length)}async getSigner(e){if(null==e&&(e=0),!await this.hasSigner(e))try{await this.#ae("eth_requestAccounts",[])}catch(e){const a=e.payload;throw this.getRpcError(a,{id:a.id,error:e})}return await super.getSigner(e)}}var fc=t(67418);const dc="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0";function rc({fetchUrl:e,proxyUrl:a,torPort:c,retry:f}){const{HttpProxyAgent:d}=t(60513),{HttpsProxyAgent:r}=t(2378),{SocksProxyAgent:n}=t(60290);if(c)return new n(`socks5h://tor${f}@127.0.0.1:${c}`);if(!a)return;const i=e.includes("https://");return a.includes("socks://")||a.includes("socks4://")||a.includes("socks5://")?new n(a):a.includes("http://")||a.includes("https://")?i?new r(a):new d(a):void 0}async function nc(e,a={}){const t=a.maxRetry??3,c=a.retryOn??500,d=a.userAgent??dc,r=globalThis.useGlobalFetch?globalThis.fetch:f();let n,i=0;for(a.method||(a.body?a.method="POST":a.method="GET"),a.headers||(a.headers={}),fc.Ll&&!a.headers["User-Agent"]&&(a.headers["User-Agent"]=d);i{e.abort()}),a.timeout),a.cancelSignal){if(a.cancelSignal.cancelled)throw new Error("request cancelled before sending");a.cancelSignal.addListener((()=>{e.abort()}))}}!a.agent&&fc.Ll&&(a.proxy||a.torPort)&&(a.agent=rc({fetchUrl:e,proxyUrl:a.proxy,torPort:a.torPort,retry:i})),a.debug&&"function"==typeof a.debug&&a.debug("request",{url:e,retry:i,errorObject:n,options:a});try{const t=await r(e,{method:a.method,headers:a.headers,body:a.body,redirect:a.redirect,signal:a.signal,agent:a.agent});if(a.debug&&"function"==typeof a.debug&&a.debug("response",t),!t.ok){const a=`Request to ${e} failed with error code ${t.status}:\n`+await t.text();throw new Error(a)}if(a.returnResponse)return t;const c=t.headers.get("content-type");return c?.includes("application/json")?await t.json():c?.includes("text")?await t.text():t}catch(e){t&&clearTimeout(t),n=e,i++,await(0,fc.yy)(c)}finally{t&&clearTimeout(t)}}throw a.debug&&"function"==typeof a.debug&&a.debug("error",n),n}const ic=(e={})=>async(a,t)=>{const c={...e,method:a.method||"POST",headers:a.headers,body:a.body||void 0,timeout:e.timeout||a.timeout,cancelSignal:t,returnResponse:!0},f=await nc(a.url,c),d={};f.headers.forEach(((e,a)=>{d[a.toLowerCase()]=e}));const r=await f.arrayBuffer(),n=null==r?null:new Uint8Array(r);return{statusCode:f.status,statusMessage:f.statusText,headers:d,body:n}};async function bc(e,a){const t=new d.ui(e);t.getUrlFunc=ic(a);const c=await new Le(t).getNetwork(),f=Number(c.chainId);if(a?.netId&&a.netId!==f){const t=`Wrong network for ${e}, wants ${a.netId} got ${f}`;throw new Error(t)}return new Le(t,c,{staticNetwork:c,pollingInterval:a?.pollingInterval||1e3})}function oc(e,a,t,c){const{networkName:f,reverseRecordsContract:r,pollInterval:n}=t,i=Boolean(r),b=new d.ui(a);b.getUrlFunc=ic(c);const o=new U(f,e);return i&&o.attachPlugin(new O(null,Number(e))),o.attachPlugin(new D),new Le(b,o,{staticNetwork:o,pollingInterval:c?.pollingInterval||1e3*n})}const sc=async(e,a)=>{const t=e.provider;if(a.from){if(a.from!==e.address){const t=`populateTransaction: signer mismatch for tx, wants ${a.from} have ${e.address}`;throw new Error(t)}}else a.from=e.address;const[c,f]=await Promise.all([a.maxFeePerGas||a.gasPrice?void 0:t.getFeeData(),a.nonce?void 0:t.getTransactionCount(e.address,"pending")]);if(c&&(c.maxFeePerGas?(a.type||(a.type=2),a.maxFeePerGas=c.maxFeePerGas*(BigInt(1e4)+BigInt(e.gasPriceBump))/BigInt(1e4),a.maxPriorityFeePerGas=c.maxPriorityFeePerGas,delete a.gasPrice):c.gasPrice&&(a.type||(a.type=0),a.gasPrice=c.gasPrice,delete a.maxFeePerGas,delete a.maxPriorityFeePerGas)),f&&(a.nonce=f),!a.gasLimit)try{const c=await t.estimateGas(a);a.gasLimit=c===BigInt(21e3)?c:c*(BigInt(1e4)+BigInt(e.gasLimitBump))/BigInt(1e4)}catch(t){if(!e.gasFailover)throw t;console.log("populateTransaction: warning gas estimation failed falling back to 3M gas"),a.gasLimit=BigInt("3000000")}return a};class lc extends tc{nonce;gasPriceBump;gasLimitBump;gasFailover;bumpNonce;constructor(e,a,{gasPriceBump:t,gasLimitBump:c,gasFailover:f,bumpNonce:d}={}){super(e,a),this.gasPriceBump=t??0,this.gasLimitBump=c??3e3,this.gasFailover=f??!1,this.bumpNonce=d??!1}static fromMnemonic(e,a,t=0,c){const f=`m/44'/60'/0'/0/${t}`,{privateKey:d}=Wt.fromPhrase(e,void 0,f);return new lc(d,a,c)}async populateTransaction(e){const a=await sc(this,e);return this.nonce=Number(a.nonce),super.populateTransaction(a)}}class uc extends me{nonce;gasPriceBump;gasLimitBump;gasFailover;bumpNonce;constructor(e,a,{gasPriceBump:t,gasLimitBump:c,gasFailover:f,bumpNonce:d}={}){super(e,a),this.gasPriceBump=t??0,this.gasLimitBump=c??3e3,this.gasFailover=f??!1,this.bumpNonce=d??!1}async populateTransaction(e){const a=await sc(this,e);return this.nonce=Number(a.nonce),super.populateTransaction(a)}}class hc extends Me{nonce;gasPriceBump;gasLimitBump;gasFailover;bumpNonce;constructor(e,a,{gasPriceBump:t,gasLimitBump:c,gasFailover:f,bumpNonce:d}={}){super(e,a),this.gasPriceBump=t??0,this.gasLimitBump=c??3e3,this.gasFailover=f??!1,this.bumpNonce=d??!1}async sendUncheckedTransaction(e){return super.sendUncheckedTransaction(await sc(this,e))}}class pc extends cc{options;constructor(e,a,t){super(e,a),this.options=t}async getSigner(e){const a=(await super.getSigner(e)).address;return this.options?.netId&&this.options?.connectWallet&&Number(await super.send("net_version",[]))!==this.options?.netId&&await this.options.connectWallet(this.options?.netId),this.options?.handleNetworkChanges&&window?.ethereum?.on("chainChanged",this.options.handleNetworkChanges),this.options?.handleAccountChanges&&window?.ethereum?.on("accountsChanged",this.options.handleAccountChanges),this.options?.handleAccountDisconnect&&window?.ethereum?.on("disconnect",this.options.handleAccountDisconnect),new hc(this,a,this.options)}}},57194:(e,a,t)=>{"use strict";t.d(a,{KN:()=>o,OR:()=>g,Ss:()=>b,XF:()=>h,c$:()=>u,pO:()=>s,sN:()=>p,zy:()=>l});var c=t(99770),f=t(30031),d=t(67418),r=t(59499),n=t(68909),i=t(59511);const b=.1,o=.9,s=(0,c.g5)("500");function l({stakeBalance:e,tornadoServiceFee:a}){if(a=o)return BigInt(0);const t=1-1/(o-b)**2*(a-b)**2;return BigInt(Math.floor(Number(e||"0")*t))}function u(e,a){for(let t=0;tObject.values(e))).flat().map((e=>(0,f.b)(e)))}function p(e){const a=e.map((e=>l(e))),t=a.reduce(((e,a)=>e+a),BigInt("0"));return e[u(a,BigInt(Math.floor(Number(t)*Math.random())))]}class g{netId;config;selectedRelayer;fetchDataOptions;tovarish;constructor({netId:e,config:a,fetchDataOptions:t}){this.netId=e,this.config=a,this.fetchDataOptions=t,this.tovarish=!1}async askRelayerStatus({hostname:e,url:a,relayerAddress:t}){!a&&e?a=`https://${e.endsWith("/")?e:e+"/"}`:a&&!a.endsWith("/")?a+="/":a="";const c=await(0,n.Fd)(`${a}status`,{...this.fetchDataOptions,headers:{"Content-Type":"application/json, application/x-www-form-urlencoded"},timeout:3e4,maxRetry:this.fetchDataOptions?.torPort?2:0});if(!i.SS.compile((0,i.c_)(this.netId,this.config,this.tovarish))(c))throw new Error("Invalid status schema");const f={...c,url:a};if(f.currentQueue>5)throw new Error("Withdrawal queue is overloaded");if(f.netId!==this.netId)throw new Error("This relayer serves a different network");if(t&&this.netId===r.zr.MAINNET&&f.rewardAccount!==t)throw new Error("The Relayer reward address must match registered address");return f}async filterRelayer(e){const a=e.hostnames[this.netId],{ensName:t,relayerAddress:c}=e;if(a)try{const d=await this.askRelayerStatus({hostname:a,relayerAddress:c});return{netId:d.netId,url:d.url,hostname:a,ensName:t,relayerAddress:c,rewardAccount:(0,f.b)(d.rewardAccount),instances:h(d.instances),stakeBalance:e.stakeBalance,gasPrice:d.gasPrices?.fast,ethPrices:d.ethPrices,currentQueue:d.currentQueue,tornadoServiceFee:d.tornadoServiceFee}}catch(e){return{hostname:a,relayerAddress:c,errorMessage:e.message,hasError:!0}}}async getValidRelayers(e){const a=[];return{validRelayers:(await Promise.all(e.map((e=>this.filterRelayer(e))))).filter((e=>!(!e||e.hasError&&(a.push(e),1)))),invalidRelayers:a}}pickWeightedRandomRelayer(e){return p(e)}async tornadoWithdraw({contract:e,proof:a,args:t},c){const{url:f}=this.selectedRelayer,r=await(0,n.Fd)(`${f}v1/tornadoWithdraw`,{...this.fetchDataOptions,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({contract:e,proof:a,args:t})}),{id:b,error:o}=r;if(o)throw new Error(o);if(!i.SS.compile(i.Yq)(r))throw new Error(`${f}v1/tornadoWithdraw has an invalid job response`);let s;"function"==typeof c&&c(r);const l=`${f}v1/jobs/${b}`;for(console.log(`Job submitted: ${l}\n`);!s||!["FAILED","CONFIRMED"].includes(s);){const e=await(0,n.Fd)(l,{...this.fetchDataOptions,method:"GET",headers:{"Content-Type":"application/json"}});if(e.error)throw new Error(o);if(!i.SS.compile(i.Us)(e))throw new Error(`${l} has an invalid job response`);const{status:a,txHash:t,confirmations:f,failedReason:r}=e;if(s!==a){if("FAILED"===a)throw new Error(`Job ${a}: ${l} failed reason: ${r}`);"SENT"===a?console.log(`Job ${a}: ${l}, txhash: ${t}\n`):"MINED"===a||"CONFIRMED"===a?console.log(`Job ${a}: ${l}, txhash: ${t}, confirmations: ${f}\n`):console.log(`Job ${a}: ${l}\n`),s=a,"function"==typeof c&&c(e)}await(0,d.yy)(3e3)}}}},59511:(e,a,t)=>{"use strict";t.d(a,{SC:()=>n,SS:()=>r,iL:()=>i,i1:()=>s,yF:()=>o,CI:()=>m,ME:()=>A,XW:()=>v,ZC:()=>w,c_:()=>E,FR:()=>h,Yq:()=>M,Us:()=>C,Y6:()=>b,cl:()=>p,Fz:()=>g,U7:()=>x,$j:()=>y});var c=t(63282),f=t.n(c),d=t(41442);const r=new(f())({allErrors:!0});r.addKeyword({keyword:"BN",validate:(e,a)=>{try{return BigInt(a),!0}catch{return!1}},errors:!0}),r.addKeyword({keyword:"isAddress",validate:(e,a)=>{try{return(0,d.PW)(a)}catch{return!1}},errors:!0});const n={type:"string",pattern:"^0x[a-fA-F0-9]{40}$",isAddress:!0},i={type:"string",BN:!0},b={type:"string",pattern:"^0x[a-fA-F0-9]{512}$"},o={type:"string",pattern:"^0x[a-fA-F0-9]{64}$"},s={...o,BN:!0},l={blockNumber:{type:"number"},logIndex:{type:"number"},transactionHash:o},u=Object.keys(l),h={type:"array",items:{anyOf:[{type:"object",properties:{...l,event:{type:"string"},id:{type:"number"},proposer:n,target:n,startTime:{type:"number"},endTime:{type:"number"},description:{type:"string"}},required:[...u,"event","id","proposer","target","startTime","endTime","description"],additionalProperties:!1},{type:"object",properties:{...l,event:{type:"string"},proposalId:{type:"number"},voter:n,support:{type:"boolean"},votes:{type:"string"},from:n,input:{type:"string"}},required:[...u,"event","proposalId","voter","support","votes","from","input"],additionalProperties:!1},{type:"object",properties:{...l,event:{type:"string"},account:n,delegateTo:n},required:[...u,"account","delegateTo"],additionalProperties:!1},{type:"object",properties:{...l,event:{type:"string"},account:n,delegateFrom:n},required:[...u,"account","delegateFrom"],additionalProperties:!1}]}},p={type:"array",items:{anyOf:[{type:"object",properties:{...l,event:{type:"string"},ensName:{type:"string"},relayerAddress:n,ensHash:{type:"string"},stakedAmount:{type:"string"}},required:[...u,"event","ensName","relayerAddress","ensHash","stakedAmount"],additionalProperties:!1},{type:"object",properties:{...l,event:{type:"string"},relayerAddress:n},required:[...u,"event","relayerAddress"],additionalProperties:!1},{type:"object",properties:{...l,event:{type:"string"},relayerAddress:n,workerAddress:n},required:[...u,"event","relayerAddress","workerAddress"],additionalProperties:!1}]}},g={type:"array",items:{type:"object",properties:{...l,relayerAddress:n,amountBurned:i,instanceAddress:n,gasFee:i,relayerFee:i,timestamp:{type:"number"}},required:[...u,"relayerAddress","amountBurned","instanceAddress","gasFee","relayerFee","timestamp"],additionalProperties:!1}},m={type:"array",items:{type:"object",properties:{...l,commitment:o,leafIndex:{type:"number"},timestamp:{type:"number"},from:n},required:[...u,"commitment","leafIndex","timestamp","from"],additionalProperties:!1}},y={type:"array",items:{type:"object",properties:{...l,nullifierHash:o,to:n,fee:i,timestamp:{type:"number"}},required:[...u,"nullifierHash","to","fee","timestamp"],additionalProperties:!1}},x={type:"array",items:{anyOf:[{type:"object",properties:{...l,event:{type:"string"},instanceAddress:{type:"string"},commitment:o,leafIndex:{type:"number"},timestamp:{type:"number"},from:n},required:[...u,"event","instanceAddress","commitment","leafIndex","timestamp","from"],additionalProperties:!1},{type:"object",properties:{...l,event:{type:"string"},instanceAddress:{type:"string"},nullifierHash:o,to:n,relayerAddress:n,fee:i,timestamp:{type:"number"}},required:[...u,"event","instanceAddress","nullifierHash","to","relayerAddress","fee","timestamp"],additionalProperties:!1}]}},A={type:"array",items:{type:"object",properties:{...l,address:n,encryptedAccount:{type:"string"}},required:[...u,"address","encryptedAccount"],additionalProperties:!1}},v={type:"array",items:{type:"object",properties:{...l,encryptedNote:{type:"string"}},required:[...u,"encryptedNote"],additionalProperties:!1}};function w(e){if("tornado"===e)return r.compile(x);if("deposit"===e)return r.compile(m);if("withdrawal"===e)return r.compile(y);if("governance"===e)return r.compile(h);if("registry"===e)return r.compile(p);if("revenue"===e)return r.compile(g);if("echo"===e)return r.compile(A);if("encrypted_notes"===e)return r.compile(v);throw new Error("Unsupported event type for schema validation")}var _=t(59499);const I={type:"object",properties:{rewardAccount:n,gasPrices:{type:"object",properties:{fast:{type:"number"},additionalProperties:{type:"number"}},required:["fast"]},netId:{type:"integer"},tornadoServiceFee:{type:"number",maximum:20,minimum:0},latestBlock:{type:"number"},latestBalance:i,version:{type:"string"},health:{type:"object",properties:{status:{const:"true"},error:{type:"string"}},required:["status"]},syncStatus:{type:"object",properties:{events:{type:"boolean"},tokenPrice:{type:"boolean"},gasPrice:{type:"boolean"}},required:["events","tokenPrice","gasPrice"]},onSyncEvents:{type:"boolean"},currentQueue:{type:"number"}},required:["rewardAccount","instances","netId","tornadoServiceFee","version","health","currentQueue"]};function E(e,a,t){const{tokens:c,optionalTokens:f,disabledTokens:d,nativeCurrency:r}=a,b=JSON.parse(JSON.stringify(I)),o=Object.keys(c).reduce(((e,a)=>{const{instanceAddress:t,tokenAddress:r,symbol:i,decimals:b,optionalInstances:o=[]}=c[a],s=Object.keys(t),l={type:"object",properties:{instanceAddress:{type:"object",properties:s.reduce(((e,a)=>(e[a]=n,e)),{}),required:s.filter((e=>!o.includes(e)))},decimals:{enum:[b]}},required:["instanceAddress","decimals"].concat(r?["tokenAddress"]:[],i?["symbol"]:[])};return r&&(l.properties.tokenAddress=n),i&&(l.properties.symbol={enum:[i]}),e.properties[a]=l,f?.includes(a)||d?.includes(a)||e.required.push(a),e}),{type:"object",properties:{},required:[]});b.properties.instances=o;const s=Object.keys(c).filter((e=>e!==r&&!a.optionalTokens?.includes(e)&&!a.disabledTokens?.includes(e)));if(e===_.zr.MAINNET&&s.push("torn"),s.length){const e={type:"object",properties:s.reduce(((e,a)=>(e[a]=i,e)),{}),required:s};b.properties.ethPrices=e,b.required.push("ethPrices")}return t&&b.required.push("gasPrices","latestBlock","latestBalance","syncStatus","onSyncEvents"),b}const C={type:"object",properties:{error:{type:"string"},id:{type:"string"},type:{type:"string"},status:{type:"string"},contract:{type:"string"},proof:{type:"string"},args:{type:"array",items:{type:"string"}},txHash:{type:"string"},confirmations:{type:"number"},failedReason:{type:"string"}},required:["id","status"]},M={...C,required:["id"]}},7393:(e,a,t)=>{"use strict";t.d(a,{H:()=>n});var c=t(98982),f=t(62463),d=t(67418),r=t(48486);async function n({provider:e,Multicall:a,currencyName:t,userAddress:n,tokenAddresses:i=[]}){const b=i.map((a=>{const t=f.Xc.connect(a,e);return[{contract:t,name:"balanceOf",params:[n]},{contract:t,name:"name"},{contract:t,name:"symbol"},{contract:t,name:"decimals"}]})).flat(),o=await(0,r.C)(a,[{contract:a,name:"getEthBalance",params:[n]},...b.length?b:[]]),s=o[0],l=(o.slice(1).length?(0,d.iv)(o.slice(1),b.length/i.length):[]).map(((e,a)=>{const[t,c,f,d]=e;return{address:i[a],name:c,symbol:f,decimals:Number(d),balance:t}}));return[{address:c.j,name:t,symbol:t,decimals:18,balance:s},...l]}},96838:(e,a,t)=>{"use strict";t.d(a,{E:()=>b,o:()=>i});var c=t(30031),f=t(57194),d=t(68909),r=t(59511),n=t(59499);const i=5e3;class b extends f.OR{constructor(e){super(e),this.tovarish=!0}async askRelayerStatus({hostname:e,url:a,relayerAddress:t}){const c=await super.askRelayerStatus({hostname:e,url:a,relayerAddress:t});if(!c.version.includes("tovarish"))throw new Error("Not a tovarish relayer!");return c}async askAllStatus({hostname:e,url:a,relayerAddress:t}){!a&&e?a=`https://${e.endsWith("/")?e:e+"/"}`:a&&!a.endsWith("/")?a+="/":a="";const c=await(0,d.Fd)(`${a}status`,{...this.fetchDataOptions,headers:{"Content-Type":"application/json, application/x-www-form-urlencoded"},timeout:3e4,maxRetry:this.fetchDataOptions?.torPort?2:0});if(!Array.isArray(c))return[];const f=[];for(const e of c){const c=e.netId,d=(0,n.zj)(c);if(!r.SS.compile((0,r.c_)(e.netId,d,this.tovarish)))continue;const i={...e,url:`${a}${c}/`};if(i.currentQueue>5)throw new Error("Withdrawal queue is overloaded");if(!n.Af.includes(i.netId))throw new Error("This relayer serves a different network");if(t&&i.netId===n.zr.MAINNET&&i.rewardAccount!==t)throw new Error("The Relayer reward address must match registered address");if(!i.version.includes("tovarish"))throw new Error("Not a tovarish relayer!");f.push(i)}return f}async filterRelayer(e){const{ensName:a,relayerAddress:t,tovarishHost:d,tovarishNetworks:r}=e;if(!d||!r?.includes(this.netId))return;const n=`${d}/${this.netId}`;try{const d=await this.askRelayerStatus({hostname:n,relayerAddress:t});return{netId:d.netId,url:d.url,hostname:n,ensName:a,relayerAddress:t,rewardAccount:(0,c.b)(d.rewardAccount),instances:(0,f.XF)(d.instances),stakeBalance:e.stakeBalance,gasPrice:d.gasPrices?.fast,ethPrices:d.ethPrices,currentQueue:d.currentQueue,tornadoServiceFee:d.tornadoServiceFee,latestBlock:Number(d.latestBlock),latestBalance:d.latestBalance,version:d.version,events:d.events,syncStatus:d.syncStatus}}catch(e){return{hostname:n,relayerAddress:t,errorMessage:e.message,hasError:!0}}}async getValidRelayers(e){const a=[];return{validRelayers:(await Promise.all(e.map((e=>this.filterRelayer(e))))).filter((e=>!(!e||e.hasError&&(a.push(e),1)))),invalidRelayers:a}}async getTovarishRelayers(e){const a=[],t=[];return await Promise.all(e.filter((e=>e.tovarishHost&&e.tovarishNetworks?.length)).map((async e=>{const{ensName:d,relayerAddress:r,tovarishHost:n}=e;try{const t=await this.askAllStatus({hostname:n,relayerAddress:r});for(const i of t)a.push({netId:i.netId,url:i.url,hostname:n,ensName:d,relayerAddress:r,rewardAccount:(0,c.b)(i.rewardAccount),instances:(0,f.XF)(i.instances),stakeBalance:e.stakeBalance,gasPrice:i.gasPrices?.fast,ethPrices:i.ethPrices,currentQueue:i.currentQueue,tornadoServiceFee:i.tornadoServiceFee,latestBlock:Number(i.latestBlock),latestBalance:i.latestBalance,version:i.version,events:i.events,syncStatus:i.syncStatus})}catch(e){t.push({hostname:n,relayerAddress:r,errorMessage:e.message,hasError:!0})}}))),{validRelayers:a,invalidRelayers:t}}async getEvents({type:e,currency:a,amount:t,fromBlock:c,recent:f}){const n=`${this.selectedRelayer?.url}events`,b=(0,r.ZC)(e);try{const r=[];let o=c;for(;;){let{events:s,lastSyncBlock:l}=await(0,d.Fd)(n,{...this.fetchDataOptions,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:e,currency:a,amount:t,fromBlock:c,recent:f})});if(!b(s)){const a=`Schema validation failed for ${e} events`;throw new Error(a)}if(f)return{events:s,lastSyncBlock:l};if(o=l,!Array.isArray(s)||!s.length)break;s=s.sort(((e,a)=>e.blockNumber===a.blockNumber?e.logIndex-a.logIndex:e.blockNumber-a.blockNumber));const[u]=s.slice(-1);if(s.lengthe.blockNumber!==u.blockNumber)),c=Number(u.blockNumber),r.push(...s)}return{events:r,lastSyncBlock:o}}catch(e){return console.log("Error from TovarishClient events endpoint"),console.log(e),{events:[],lastSyncBlock:c}}}}},62463:(e,a,t)=>{"use strict";t.d(a,{rZ:()=>b,S4:()=>s,BB:()=>u,p2:()=>n,Xc:()=>p,Q2:()=>m,Hk:()=>x,Ld:()=>v,Rp:()=>_,XB:()=>c});var c={};t.r(c),t.d(c,{ENSNameWrapper__factory:()=>b,ENSRegistry__factory:()=>s,ENSResolver__factory:()=>u,ENS__factory:()=>n,ERC20__factory:()=>p,Multicall__factory:()=>m,OffchainOracle__factory:()=>x,OvmGasPriceOracle__factory:()=>v,ReverseRecords__factory:()=>_});var f=t(73622),d=t(13269);const r=[{constant:!0,inputs:[{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"pure",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"key",type:"string"},{internalType:"string",name:"value",type:"string"}],name:"setText",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"interfaceImplementer",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"contentTypes",type:"uint256"}],name:"ABI",outputs:[{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"x",type:"bytes32"},{internalType:"bytes32",name:"y",type:"bytes32"}],name:"setPubkey",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes",name:"hash",type:"bytes"}],name:"setContenthash",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"addr",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"target",type:"address"},{internalType:"bool",name:"isAuthorised",type:"bool"}],name:"setAuthorisation",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"key",type:"string"}],name:"text",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"contentType",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"setABI",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"name",type:"string"}],name:"setName",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"coinType",type:"uint256"},{internalType:"bytes",name:"a",type:"bytes"}],name:"setAddr",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"contenthash",outputs:[{internalType:"bytes",name:"",type:"bytes"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"pubkey",outputs:[{internalType:"bytes32",name:"x",type:"bytes32"},{internalType:"bytes32",name:"y",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"a",type:"address"}],name:"setAddr",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes4",name:"interfaceID",type:"bytes4"},{internalType:"address",name:"implementer",type:"address"}],name:"setInterface",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"coinType",type:"uint256"}],name:"addr",outputs:[{internalType:"bytes",name:"",type:"bytes"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"authorisations",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{inputs:[{internalType:"contract ENS",name:"_ens",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"target",type:"address"},{indexed:!1,internalType:"bool",name:"isAuthorised",type:"bool"}],name:"AuthorisationChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"string",name:"indexedKey",type:"string"},{indexed:!1,internalType:"string",name:"key",type:"string"}],name:"TextChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"x",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"y",type:"bytes32"}],name:"PubkeyChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"string",name:"name",type:"string"}],name:"NameChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"bytes4",name:"interfaceID",type:"bytes4"},{indexed:!1,internalType:"address",name:"implementer",type:"address"}],name:"InterfaceChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"hash",type:"bytes"}],name:"ContenthashChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"a",type:"address"}],name:"AddrChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"coinType",type:"uint256"},{indexed:!1,internalType:"bytes",name:"newAddress",type:"bytes"}],name:"AddressChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"uint256",name:"contentType",type:"uint256"}],name:"ABIChanged",type:"event"}];class n{static abi=r;static createInterface(){return new f.KA(r)}static connect(e,a){return new d.NZ(e,r,a)}}const i=[{inputs:[{internalType:"contract ENS",name:"_ens",type:"address"},{internalType:"contract IBaseRegistrar",name:"_registrar",type:"address"},{internalType:"contract IMetadataService",name:"_metadataService",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"CannotUpgrade",type:"error"},{inputs:[],name:"IncompatibleParent",type:"error"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"IncorrectTargetOwner",type:"error"},{inputs:[],name:"IncorrectTokenType",type:"error"},{inputs:[{internalType:"bytes32",name:"labelHash",type:"bytes32"},{internalType:"bytes32",name:"expectedLabelhash",type:"bytes32"}],name:"LabelMismatch",type:"error"},{inputs:[{internalType:"string",name:"label",type:"string"}],name:"LabelTooLong",type:"error"},{inputs:[],name:"LabelTooShort",type:"error"},{inputs:[],name:"NameIsNotWrapped",type:"error"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"OperationProhibited",type:"error"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"addr",type:"address"}],name:"Unauthorised",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"controller",type:"address"},{indexed:!1,internalType:"bool",name:"active",type:"bool"}],name:"ControllerChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"uint64",name:"expiry",type:"uint64"}],name:"ExpiryExtended",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"uint32",name:"fuses",type:"uint32"}],name:"FusesSet",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"owner",type:"address"}],name:"NameUnwrapped",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"name",type:"bytes"},{indexed:!1,internalType:"address",name:"owner",type:"address"},{indexed:!1,internalType:"uint32",name:"fuses",type:"uint32"},{indexed:!1,internalType:"uint64",name:"expiry",type:"uint64"}],name:"NameWrapped",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256[]",name:"ids",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"}],name:"TransferBatch",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"TransferSingle",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"value",type:"string"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"URI",type:"event"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"_tokens",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint32",name:"fuseMask",type:"uint32"}],name:"allFusesBurned",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"accounts",type:"address[]"},{internalType:"uint256[]",name:"ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"addr",type:"address"}],name:"canExtendSubnames",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"addr",type:"address"}],name:"canModifyName",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"controllers",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"ens",outputs:[{internalType:"contract ENS",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"parentNode",type:"bytes32"},{internalType:"bytes32",name:"labelhash",type:"bytes32"},{internalType:"uint64",name:"expiry",type:"uint64"}],name:"extendExpiry",outputs:[{internalType:"uint64",name:"",type:"uint64"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"operator",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"getData",outputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint32",name:"fuses",type:"uint32"},{internalType:"uint64",name:"expiry",type:"uint64"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"parentNode",type:"bytes32"},{internalType:"bytes32",name:"labelhash",type:"bytes32"}],name:"isWrapped",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"isWrapped",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"metadataService",outputs:[{internalType:"contract IMetadataService",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"names",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"onERC721Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"owner",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_token",type:"address"},{internalType:"address",name:"_to",type:"address"},{internalType:"uint256",name:"_amount",type:"uint256"}],name:"recoverFunds",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"label",type:"string"},{internalType:"address",name:"wrappedOwner",type:"address"},{internalType:"uint256",name:"duration",type:"uint256"},{internalType:"address",name:"resolver",type:"address"},{internalType:"uint16",name:"ownerControlledFuses",type:"uint16"}],name:"registerAndWrapETH2LD",outputs:[{internalType:"uint256",name:"registrarExpiry",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"registrar",outputs:[{internalType:"contract IBaseRegistrar",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"duration",type:"uint256"}],name:"renew",outputs:[{internalType:"uint256",name:"expires",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"parentNode",type:"bytes32"},{internalType:"bytes32",name:"labelhash",type:"bytes32"},{internalType:"uint32",name:"fuses",type:"uint32"},{internalType:"uint64",name:"expiry",type:"uint64"}],name:"setChildFuses",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"controller",type:"address"},{internalType:"bool",name:"active",type:"bool"}],name:"setController",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint16",name:"ownerControlledFuses",type:"uint16"}],name:"setFuses",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IMetadataService",name:"_metadataService",type:"address"}],name:"setMetadataService",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"resolver",type:"address"},{internalType:"uint64",name:"ttl",type:"uint64"}],name:"setRecord",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"resolver",type:"address"}],name:"setResolver",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"parentNode",type:"bytes32"},{internalType:"string",name:"label",type:"string"},{internalType:"address",name:"owner",type:"address"},{internalType:"uint32",name:"fuses",type:"uint32"},{internalType:"uint64",name:"expiry",type:"uint64"}],name:"setSubnodeOwner",outputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"parentNode",type:"bytes32"},{internalType:"string",name:"label",type:"string"},{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"resolver",type:"address"},{internalType:"uint64",name:"ttl",type:"uint64"},{internalType:"uint32",name:"fuses",type:"uint32"},{internalType:"uint64",name:"expiry",type:"uint64"}],name:"setSubnodeRecord",outputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint64",name:"ttl",type:"uint64"}],name:"setTTL",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract INameWrapperUpgrade",name:"_upgradeAddress",type:"address"}],name:"setUpgradeContract",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"parentNode",type:"bytes32"},{internalType:"bytes32",name:"labelhash",type:"bytes32"},{internalType:"address",name:"controller",type:"address"}],name:"unwrap",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"labelhash",type:"bytes32"},{internalType:"address",name:"registrant",type:"address"},{internalType:"address",name:"controller",type:"address"}],name:"unwrapETH2LD",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"name",type:"bytes"},{internalType:"bytes",name:"extraData",type:"bytes"}],name:"upgrade",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"upgradeContract",outputs:[{internalType:"contract INameWrapperUpgrade",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"uri",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"name",type:"bytes"},{internalType:"address",name:"wrappedOwner",type:"address"},{internalType:"address",name:"resolver",type:"address"}],name:"wrap",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"label",type:"string"},{internalType:"address",name:"wrappedOwner",type:"address"},{internalType:"uint16",name:"ownerControlledFuses",type:"uint16"},{internalType:"address",name:"resolver",type:"address"}],name:"wrapETH2LD",outputs:[{internalType:"uint64",name:"expiry",type:"uint64"}],stateMutability:"nonpayable",type:"function"}];class b{static abi=i;static createInterface(){return new f.KA(i)}static connect(e,a){return new d.NZ(e,i,a)}}const o=[{inputs:[{internalType:"contract ENS",name:"_old",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"label",type:"bytes32"},{indexed:!1,internalType:"address",name:"owner",type:"address"}],name:"NewOwner",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"resolver",type:"address"}],name:"NewResolver",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"uint64",name:"ttl",type:"uint64"}],name:"NewTTL",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"owner",type:"address"}],name:"Transfer",type:"event"},{constant:!0,inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"old",outputs:[{internalType:"contract ENS",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"recordExists",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"resolver",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"owner",type:"address"}],name:"setOwner",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"resolver",type:"address"},{internalType:"uint64",name:"ttl",type:"uint64"}],name:"setRecord",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"resolver",type:"address"}],name:"setResolver",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"label",type:"bytes32"},{internalType:"address",name:"owner",type:"address"}],name:"setSubnodeOwner",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"label",type:"bytes32"},{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"resolver",type:"address"},{internalType:"uint64",name:"ttl",type:"uint64"}],name:"setSubnodeRecord",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint64",name:"ttl",type:"uint64"}],name:"setTTL",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"ttl",outputs:[{internalType:"uint64",name:"",type:"uint64"}],payable:!1,stateMutability:"view",type:"function"}];class s{static abi=o;static createInterface(){return new f.KA(o)}static connect(e,a){return new d.NZ(e,o,a)}}const l=[{inputs:[{internalType:"contract ENS",name:"_ens",type:"address"},{internalType:"contract INameWrapper",name:"wrapperAddress",type:"address"},{internalType:"address",name:"_trustedETHController",type:"address"},{internalType:"address",name:"_trustedReverseRegistrar",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"uint256",name:"contentType",type:"uint256"}],name:"ABIChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"a",type:"address"}],name:"AddrChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"coinType",type:"uint256"},{indexed:!1,internalType:"bytes",name:"newAddress",type:"bytes"}],name:"AddressChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"address",name:"delegate",type:"address"},{indexed:!0,internalType:"bool",name:"approved",type:"bool"}],name:"Approved",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"hash",type:"bytes"}],name:"ContenthashChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"name",type:"bytes"},{indexed:!1,internalType:"uint16",name:"resource",type:"uint16"},{indexed:!1,internalType:"bytes",name:"record",type:"bytes"}],name:"DNSRecordChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"name",type:"bytes"},{indexed:!1,internalType:"uint16",name:"resource",type:"uint16"}],name:"DNSRecordDeleted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"lastzonehash",type:"bytes"},{indexed:!1,internalType:"bytes",name:"zonehash",type:"bytes"}],name:"DNSZonehashChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"bytes4",name:"interfaceID",type:"bytes4"},{indexed:!1,internalType:"address",name:"implementer",type:"address"}],name:"InterfaceChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"string",name:"name",type:"string"}],name:"NameChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"x",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"y",type:"bytes32"}],name:"PubkeyChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"string",name:"indexedKey",type:"string"},{indexed:!1,internalType:"string",name:"key",type:"string"},{indexed:!1,internalType:"string",name:"value",type:"string"}],name:"TextChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"uint64",name:"newVersion",type:"uint64"}],name:"VersionChanged",type:"event"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"contentTypes",type:"uint256"}],name:"ABI",outputs:[{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"addr",outputs:[{internalType:"address payable",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"coinType",type:"uint256"}],name:"addr",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"delegate",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"clearRecords",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"contenthash",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"},{internalType:"uint16",name:"resource",type:"uint16"}],name:"dnsRecord",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"}],name:"hasDNSRecords",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"interfaceImplementer",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"delegate",type:"address"}],name:"isApprovedFor",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicall",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"nodehash",type:"bytes32"},{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicallWithNodeCheck",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"pubkey",outputs:[{internalType:"bytes32",name:"x",type:"bytes32"},{internalType:"bytes32",name:"y",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"recordVersions",outputs:[{internalType:"uint64",name:"",type:"uint64"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"contentType",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"setABI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"coinType",type:"uint256"},{internalType:"bytes",name:"a",type:"bytes"}],name:"setAddr",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"a",type:"address"}],name:"setAddr",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes",name:"hash",type:"bytes"}],name:"setContenthash",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes",name:"data",type:"bytes"}],name:"setDNSRecords",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes4",name:"interfaceID",type:"bytes4"},{internalType:"address",name:"implementer",type:"address"}],name:"setInterface",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"newName",type:"string"}],name:"setName",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"x",type:"bytes32"},{internalType:"bytes32",name:"y",type:"bytes32"}],name:"setPubkey",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"key",type:"string"},{internalType:"string",name:"value",type:"string"}],name:"setText",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes",name:"hash",type:"bytes"}],name:"setZonehash",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"key",type:"string"}],name:"text",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"zonehash",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"}];class u{static abi=l;static createInterface(){return new f.KA(l)}static connect(e,a){return new d.NZ(e,l,a)}}const h=[{constant:!0,inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"_totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"who",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{constant:!0,inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"}];class p{static abi=h;static createInterface(){return new f.KA(h)}static connect(e,a){return new d.NZ(e,h,a)}}const g=[{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call[]",name:"calls",type:"tuple[]"}],name:"aggregate",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"},{internalType:"bytes[]",name:"returnData",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bool",name:"allowFailure",type:"bool"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call3[]",name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bool",name:"allowFailure",type:"bool"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call3Value[]",name:"calls",type:"tuple[]"}],name:"aggregate3Value",outputs:[{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call[]",name:"calls",type:"tuple[]"}],name:"blockAndAggregate",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"},{internalType:"bytes32",name:"blockHash",type:"bytes32"},{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[],name:"getBasefee",outputs:[{internalType:"uint256",name:"basefee",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"getBlockHash",outputs:[{internalType:"bytes32",name:"blockHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"getBlockNumber",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getChainId",outputs:[{internalType:"uint256",name:"chainid",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockCoinbase",outputs:[{internalType:"address",name:"coinbase",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockDifficulty",outputs:[{internalType:"uint256",name:"difficulty",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockGasLimit",outputs:[{internalType:"uint256",name:"gaslimit",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"addr",type:"address"}],name:"getEthBalance",outputs:[{internalType:"uint256",name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getLastBlockHash",outputs:[{internalType:"bytes32",name:"blockHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bool",name:"requireSuccess",type:"bool"},{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call[]",name:"calls",type:"tuple[]"}],name:"tryAggregate",outputs:[{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bool",name:"requireSuccess",type:"bool"},{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call[]",name:"calls",type:"tuple[]"}],name:"tryBlockAndAggregate",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"},{internalType:"bytes32",name:"blockHash",type:"bytes32"},{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"}];class m{static abi=g;static createInterface(){return new f.KA(g)}static connect(e,a){return new d.NZ(e,g,a)}}const y=[{inputs:[{internalType:"contract MultiWrapper",name:"_multiWrapper",type:"address"},{internalType:"contract IOracle[]",name:"existingOracles",type:"address[]"},{internalType:"enum OffchainOracle.OracleType[]",name:"oracleTypes",type:"uint8[]"},{internalType:"contract IERC20[]",name:"existingConnectors",type:"address[]"},{internalType:"contract IERC20",name:"wBase",type:"address"},{internalType:"address",name:"owner",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"ArraysLengthMismatch",type:"error"},{inputs:[],name:"ConnectorAlreadyAdded",type:"error"},{inputs:[],name:"InvalidOracleTokenKind",type:"error"},{inputs:[],name:"OracleAlreadyAdded",type:"error"},{inputs:[],name:"SameTokens",type:"error"},{inputs:[],name:"TooBigThreshold",type:"error"},{inputs:[],name:"UnknownConnector",type:"error"},{inputs:[],name:"UnknownOracle",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"contract IERC20",name:"connector",type:"address"}],name:"ConnectorAdded",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"contract IERC20",name:"connector",type:"address"}],name:"ConnectorRemoved",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"contract MultiWrapper",name:"multiWrapper",type:"address"}],name:"MultiWrapperUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"contract IOracle",name:"oracle",type:"address"},{indexed:!1,internalType:"enum OffchainOracle.OracleType",name:"oracleType",type:"uint8"}],name:"OracleAdded",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"contract IOracle",name:"oracle",type:"address"},{indexed:!1,internalType:"enum OffchainOracle.OracleType",name:"oracleType",type:"uint8"}],name:"OracleRemoved",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{inputs:[{internalType:"contract IERC20",name:"connector",type:"address"}],name:"addConnector",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IOracle",name:"oracle",type:"address"},{internalType:"enum OffchainOracle.OracleType",name:"oracleKind",type:"uint8"}],name:"addOracle",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"connectors",outputs:[{internalType:"contract IERC20[]",name:"allConnectors",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC20",name:"srcToken",type:"address"},{internalType:"contract IERC20",name:"dstToken",type:"address"},{internalType:"bool",name:"useWrappers",type:"bool"}],name:"getRate",outputs:[{internalType:"uint256",name:"weightedRate",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC20",name:"srcToken",type:"address"},{internalType:"bool",name:"useSrcWrappers",type:"bool"}],name:"getRateToEth",outputs:[{internalType:"uint256",name:"weightedRate",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC20",name:"srcToken",type:"address"},{internalType:"bool",name:"useSrcWrappers",type:"bool"},{internalType:"contract IERC20[]",name:"customConnectors",type:"address[]"},{internalType:"uint256",name:"thresholdFilter",type:"uint256"}],name:"getRateToEthWithCustomConnectors",outputs:[{internalType:"uint256",name:"weightedRate",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC20",name:"srcToken",type:"address"},{internalType:"bool",name:"useSrcWrappers",type:"bool"},{internalType:"uint256",name:"thresholdFilter",type:"uint256"}],name:"getRateToEthWithThreshold",outputs:[{internalType:"uint256",name:"weightedRate",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC20",name:"srcToken",type:"address"},{internalType:"contract IERC20",name:"dstToken",type:"address"},{internalType:"bool",name:"useWrappers",type:"bool"},{internalType:"contract IERC20[]",name:"customConnectors",type:"address[]"},{internalType:"uint256",name:"thresholdFilter",type:"uint256"}],name:"getRateWithCustomConnectors",outputs:[{internalType:"uint256",name:"weightedRate",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC20",name:"srcToken",type:"address"},{internalType:"contract IERC20",name:"dstToken",type:"address"},{internalType:"bool",name:"useWrappers",type:"bool"},{internalType:"uint256",name:"thresholdFilter",type:"uint256"}],name:"getRateWithThreshold",outputs:[{internalType:"uint256",name:"weightedRate",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"multiWrapper",outputs:[{internalType:"contract MultiWrapper",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"oracles",outputs:[{internalType:"contract IOracle[]",name:"allOracles",type:"address[]"},{internalType:"enum OffchainOracle.OracleType[]",name:"oracleTypes",type:"uint8[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC20",name:"connector",type:"address"}],name:"removeConnector",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IOracle",name:"oracle",type:"address"},{internalType:"enum OffchainOracle.OracleType",name:"oracleKind",type:"uint8"}],name:"removeOracle",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract MultiWrapper",name:"_multiWrapper",type:"address"}],name:"setMultiWrapper",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}];class x{static abi=y;static createInterface(){return new f.KA(y)}static connect(e,a){return new d.NZ(e,y,a)}}const A=[{inputs:[{internalType:"address",name:"_owner",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"DecimalsUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"GasPriceUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"L1BaseFeeUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"OverheadUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"ScalarUpdated",type:"event"},{inputs:[],name:"decimals",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"gasPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"_data",type:"bytes"}],name:"getL1Fee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"_data",type:"bytes"}],name:"getL1GasUsed",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"l1BaseFee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"overhead",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"scalar",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_decimals",type:"uint256"}],name:"setDecimals",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_gasPrice",type:"uint256"}],name:"setGasPrice",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_baseFee",type:"uint256"}],name:"setL1BaseFee",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_overhead",type:"uint256"}],name:"setOverhead",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_scalar",type:"uint256"}],name:"setScalar",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}];class v{static abi=A;static createInterface(){return new f.KA(A)}static connect(e,a){return new d.NZ(e,A,a)}}const w=[{inputs:[{internalType:"contract ENS",name:"_ens",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{internalType:"address[]",name:"addresses",type:"address[]"}],name:"getNames",outputs:[{internalType:"string[]",name:"r",type:"string[]"}],stateMutability:"view",type:"function"}];class _{static abi=w;static createInterface(){return new f.KA(w)}static connect(e,a){return new d.NZ(e,w,a)}}},67418:(e,a,t)=>{"use strict";t.d(a,{$W:()=>w,EI:()=>v,Eg:()=>k,Et:()=>i,G9:()=>E,Id:()=>l,Ju:()=>y,Kp:()=>p,Ll:()=>n,My:()=>g,aT:()=>m,ae:()=>A,br:()=>B,gn:()=>C,ib:()=>I,if:()=>h,iv:()=>b,jm:()=>x,lY:()=>u,qv:()=>L,sY:()=>_,uU:()=>M,vd:()=>S,wv:()=>s,yp:()=>T,yy:()=>o});var c=t(91565),f=t(39404),d=t.n(f),r=t(81810);BigInt.prototype.toJSON=function(){return this.toString()};const n=!process.browser&&void 0===globalThis.window,i=n?c.webcrypto:globalThis.crypto,b=(e,a)=>[...Array(Math.ceil(e.length/a))].map(((t,c)=>e.slice(a*c,a+a*c)));function o(e){return new Promise((a=>setTimeout(a,e)))}function s(e,a){try{const t=new URL(e);return!a||!a.length||a.map((e=>e.toLowerCase())).includes(t.protocol)}catch{return!1}}function l(...e){const a=e.reduce(((e,a)=>e+a.length),0),t=new Uint8Array(a);return e.forEach(((e,a,c)=>{const f=c.slice(0,a).reduce(((e,a)=>e+a.length),0);t.set(e,f)})),t}function u(e){return new Uint8Array(e.buffer)}function h(e){return btoa(e.reduce(((e,a)=>e+String.fromCharCode(a)),""))}function p(e){return Uint8Array.from(atob(e),(e=>e.charCodeAt(0)))}function g(e){return"0x"+Array.from(e).map((e=>e.toString(16).padStart(2,"0"))).join("")}function m(e){return"0x"===e.slice(0,2)&&(e=e.slice(2)),e.length%2!=0&&(e="0"+e),Uint8Array.from(e.match(/.{1,2}/g).map((e=>parseInt(e,16))))}function y(e){return BigInt(g(e))}function x(e){let a="bigint"==typeof e?e.toString(16):e;return"0x"===a.slice(0,2)&&(a=a.slice(2)),a.length%2!=0&&(a="0"+a),Uint8Array.from(a.match(/.{1,2}/g).map((e=>parseInt(e,16))))}function A(e){return new(d())(e,16,"le")}function v(e){return Uint8Array.from(new(d())(e).toArray("le",31))}function w(e,a=32){return"0x"+BigInt(e).toString(16).padStart(2*a,"0")}function _(e,a=32){return"0x"+(e=e.replace("0x","")).padStart(2*a,"0")}function I(e=31){return y(i.getRandomValues(new Uint8Array(e)))}function E(e=32){return g(i.getRandomValues(new Uint8Array(e)))}function C(e,a){return"bigint"==typeof a?a.toString():a}function M(e,a=10){return e.length<2*a?e:`${e.substring(0,a)}...${e.substring(e.length-a)}`}async function B(e,a="SHA-384"){return new Uint8Array(await i.subtle.digest(a,e))}function k(e,a=3){const t=[{value:1,symbol:""},{value:1e3,symbol:"K"},{value:1e6,symbol:"M"},{value:1e9,symbol:"G"},{value:1e12,symbol:"T"},{value:1e15,symbol:"P"},{value:1e18,symbol:"E"}].slice().reverse().find((a=>Number(e)>=a.value));return t?(Number(e)/t.value).toFixed(a).replace(/\.0+$|(?<=\.[0-9]*[1-9])0+$/,"").concat(t.symbol):"0"}function L(e){return/^0x[0-9a-fA-F]*$/.test(e)}function S(e){return r.fromIpfs(e)}function T(e){return r.decode(e)}},26746:(e,a,t)=>{"use strict";t.d(a,{O:()=>i,i:()=>b});var c=t(84276),f=t(36336),d=t.n(f),r=t(67418);let n;async function i(){n||(n=await d()({wasmInitialMemory:2e3}))}async function b(e,a,t){n||await i();const f={root:e.root,nullifierHash:BigInt(e.nullifierHex).toString(),recipient:BigInt(e.recipient),relayer:BigInt(e.relayer),fee:e.fee,refund:e.refund,nullifier:e.nullifier,secret:e.secret,pathElements:e.pathElements,pathIndices:e.pathIndices};console.log("Start generating SNARK proof",f),console.time("SNARK proof time");const d=await c.genWitnessAndProve(await n,f,a,t),b=c.toSolidityInput(d).proof;return console.timeEnd("SNARK proof time"),{proof:b,args:[(0,r.$W)(e.root,32),(0,r.$W)(e.nullifierHex,32),e.recipient,e.relayer,(0,r.$W)(e.fee,32),(0,r.$W)(e.refund,32)]}}},18995:(e,a,t)=>{"use strict";t.d(a,{_6:()=>Ee,fY:()=>Ie,a8:()=>_e});var c={},f=Uint8Array,d=Uint16Array,r=Int32Array,n=new f([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new f([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),b=new f([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=function(e,a){for(var t=new d(31),c=0;c<31;++c)t[c]=a+=1<>1|(21845&y)<<1;x=(61680&(x=(52428&x)>>2|(13107&x)<<2))>>4|(3855&x)<<4,m[y]=((65280&x)>>8|(255&x)<<8)>>1}var A=function(e,a,t){for(var c=e.length,f=0,r=new d(a);f>b]=o}else for(n=new d(c),f=0;f>15-e[f]);return n},v=new f(288);for(y=0;y<144;++y)v[y]=8;for(y=144;y<256;++y)v[y]=9;for(y=256;y<280;++y)v[y]=7;for(y=280;y<288;++y)v[y]=8;var w=new f(32);for(y=0;y<32;++y)w[y]=5;var _=A(v,9,0),I=A(v,9,1),E=A(w,5,0),C=A(w,5,1),M=function(e){for(var a=e[0],t=1;ta&&(a=e[t]);return a},B=function(e,a,t){var c=a/8|0;return(e[c]|e[c+1]<<8)>>(7&a)&t},k=function(e,a){var t=a/8|0;return(e[t]|e[t+1]<<8|e[t+2]<<16)>>(7&a)},L=function(e){return(e+7)/8|0},S=function(e,a,t){return(null==a||a<0)&&(a=0),(null==t||t>e.length)&&(t=e.length),new f(e.subarray(a,t))},T=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],N=function(e,a,t){var c=new Error(a||T[e]);if(c.code=e,Error.captureStackTrace&&Error.captureStackTrace(c,N),!t)throw c;return c},R=function(e,a,t,c){var d=e.length,r=c?c.length:0;if(!d||a.f&&!a.l)return t||new f(0);var o=!t,s=o||2!=a.i,u=a.i;o&&(t=new f(3*d));var h=function(e){var a=t.length;if(e>a){var c=new f(Math.max(2*a,e));c.set(t),t=c}},g=a.f||0,m=a.p||0,y=a.b||0,x=a.l,v=a.d,w=a.m,_=a.n,E=8*d;do{if(!x){g=B(e,m,1);var T=B(e,m+1,3);if(m+=3,!T){var R=e[(z=L(m)+4)-4]|e[z-3]<<8,P=z+R;if(P>d){u&&N(0);break}s&&h(y+R),t.set(e.subarray(z,P),y),a.b=y+=R,a.p=m=8*P,a.f=g;continue}if(1==T)x=I,v=C,w=9,_=5;else if(2==T){var D=B(e,m,31)+257,O=B(e,m+10,15)+4,F=D+B(e,m+5,31)+1;m+=14;for(var Q=new f(F),U=new f(19),j=0;j>4)<16)Q[j++]=z;else{var K=0,V=0;for(16==z?(V=3+B(e,m,3),m+=2,K=Q[j-1]):17==z?(V=3+B(e,m,7),m+=3):18==z&&(V=11+B(e,m,127),m+=7);V--;)Q[j++]=K}}var Z=Q.subarray(0,D),J=Q.subarray(D);w=M(Z),_=M(J),x=A(Z,w,1),v=A(J,_,1)}else N(1);if(m>E){u&&N(0);break}}s&&h(y+131072);for(var W=(1<>4;if((m+=15&K)>E){u&&N(0);break}if(K||N(2),ee<256)t[y++]=ee;else{if(256==ee){X=m,x=null;break}var ae=ee-254;if(ee>264){var te=n[j=ee-257];ae=B(e,m,(1<>4;if(ce||N(3),m+=15&ce,J=p[fe],fe>3&&(te=i[fe],J+=k(e,m)&(1<E){u&&N(0);break}s&&h(y+131072);var de=y+ae;if(y>8},D=function(e,a,t){t<<=7&a;var c=a/8|0;e[c]|=t,e[c+1]|=t>>8,e[c+2]|=t>>16},O=function(e,a){for(var t=[],c=0;ch&&(h=n[c].s);var p=new d(h+1),g=F(t[l-1],p,0);if(g>a){c=0;var m=0,y=g-a,x=1<a))break;m+=x-(1<>=y;m>0;){var v=n[c].s;p[v]=0&&m;--c){var w=n[c].s;p[w]==a&&(--p[w],++m)}g=a}return{t:new f(p),l:g}},F=function(e,a,t){return-1==e.s?Math.max(F(e.l,a,t+1),F(e.r,a,t+1)):a[e.s]=t},Q=function(e){for(var a=e.length;a&&!e[--a];);for(var t=new d(++a),c=0,f=e[0],r=1,n=function(e){t[c++]=e},i=1;i<=a;++i)if(e[i]==f&&i!=a)++r;else{if(!f&&r>2){for(;r>138;r-=138)n(32754);r>2&&(n(r>10?r-11<<5|28690:r-3<<5|12305),r=0)}else if(r>3){for(n(f),--r;r>6;r-=6)n(8304);r>2&&(n(r-3<<5|8208),r=0)}for(;r--;)n(f);r=1,f=e[i]}return{c:t.subarray(0,c),n:a}},U=function(e,a){for(var t=0,c=0;c>8,e[f+2]=255^e[f],e[f+3]=255^e[f+1];for(var d=0;d4&&!F[b[$-1]];--$);var q,z,G,K,V=u+5<<3,Z=U(f,v)+U(r,w)+o,J=U(f,g)+U(r,x)+o+14+3*$+U(T,F)+2*T[16]+3*T[17]+7*T[18];if(l>=0&&V<=Z&&V<=J)return j(a,h,e.subarray(l,l+u));if(P(a,h,1+(J15&&(P(a,h,ee[N]>>5&127),h+=ee[N]>>12)}}}else q=_,z=v,G=E,K=w;for(N=0;N255){D(a,h,q[257+(ae=te>>18&31)]),h+=z[ae+257],ae>7&&(P(a,h,te>>23&31),h+=n[ae]);var ce=31&te;D(a,h,G[ce]),h+=K[ce],ce>3&&(D(a,h,te>>5&8191),h+=i[ce])}else D(a,h,q[te]),h+=z[te]}return D(a,h,q[256]),h+z[256]},$=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),q=new f(0),z=function(e,a,t,c,b,o){var s=o.z||e.length,l=new f(c+s+5*(1+Math.ceil(s/7e3))+b),h=l.subarray(c,l.length-b),p=o.l,m=7&(o.r||0);if(a){m&&(h[0]=o.r>>3);for(var y=$[a-1],x=y>>13,A=8191&y,v=(1<7e3||P>24576)&&(q>423||!p)){m=H(e,h,0,M,B,k,N,P,O,R-O,m),P=T=N=0,O=R;for(var z=0;z<286;++z)B[z]=0;for(z=0;z<30;++z)k[z]=0}var G=2,K=0,V=A,Z=Q-U&32767;if(q>2&&F==C(R-Z))for(var J=Math.min(x,q)-1,W=Math.min(32767,R),Y=Math.min(258,q);Z<=W&&--V&&Q!=U;){if(e[R+G]==e[R+G-Z]){for(var X=0;XG){if(G=X,K=Z,X>J)break;var ee=Math.min(Z,X-2),ae=0;for(z=0;zae&&(ae=ce,U=te)}}}Z+=(Q=U)-(U=w[Q])&32767}if(K){M[P++]=268435456|u[G]<<18|g[K];var fe=31&u[G],de=31&g[K];N+=n[fe]+i[de],++B[257+fe],++k[de],D=R+G,++T}else M[P++]=e[R],++B[e[R]]}}for(R=Math.max(R,D);R=s&&(h[m/8|0]=p,re=s),m=j(h,m+1,e.subarray(R,re))}o.i=s}return S(l,0,c+L(m)+b)},G=function(){for(var e=new Int32Array(256),a=0;a<256;++a){for(var t=a,c=9;--c;)t=(1&t&&-306674912)^t>>>1;e[a]=t}return e}(),K=function(){var e=-1;return{p:function(a){for(var t=e,c=0;c>>8;e=t},d:function(){return~e}}},V=function(e,a,t,c,d){if(!d&&(d={l:1},a.dictionary)){var r=a.dictionary.subarray(-32768),n=new f(r.length+e.length);n.set(r),n.set(e,r.length),e=n,d.w=r.length}return z(e,null==a.level?6:a.level,null==a.mem?d.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+a.mem,t,c,d)},Z=function(e,a){var t={};for(var c in e)t[c]=e[c];for(var c in a)t[c]=a[c];return t},J=function(e,a,t){for(var c=e(),f=e.toString(),d=f.slice(f.indexOf("[")+1,f.lastIndexOf("]")).replace(/\s+/g,"").split(","),r=0;r>>0},de=function(e,a){return fe(e,a)+4294967296*fe(e,a+4)},re=function(e,a,t){for(;t;++a)e[a]=t,t>>>=8};function ne(e,a){return V(e,a||{},0,0)}function ie(e,a){return R(e,{i:2},a&&a.out,a&&a.dictionary)}var be=function(e,a,t,c){for(var d in e){var r=e[d],n=a+d,i=c;Array.isArray(r)&&(i=Z(c,r[1]),r=r[0]),r instanceof f?t[n]=[r,i]:(t[n+="/"]=[new f(0),i],be(r,n,t,c))}},oe="undefined"!=typeof TextEncoder&&new TextEncoder,se="undefined"!=typeof TextDecoder&&new TextDecoder;try{se.decode(q,{stream:!0})}catch(e){}function le(e,a){if(a){for(var t=new f(e.length),c=0;c>1)),n=0,i=function(e){r[n++]=e};for(c=0;cr.length){var b=new f(n+8+(d-c<<1));b.set(r),r=b}var o=e.charCodeAt(c);o<128||a?i(o):o<2048?(i(192|o>>6),i(128|63&o)):o>55295&&o<57344?(i(240|(o=65536+(1047552&o)|1023&e.charCodeAt(++c))>>18),i(128|o>>12&63),i(128|o>>6&63),i(128|63&o)):(i(224|o>>12),i(128|o>>6&63),i(128|63&o))}return S(r,0,n)}function ue(e,a){if(a){for(var t="",c=0;c127)+(c>223)+(c>239);if(t+f>e.length)return{s:a,r:S(e,t-1)};f?3==f?(c=((15&c)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,a+=String.fromCharCode(55296|c>>10,56320|1023&c)):a+=1&f?String.fromCharCode((31&c)<<6|63&e[t++]):String.fromCharCode((15&c)<<12|(63&e[t++])<<6|63&e[t++]):a+=String.fromCharCode(c)}}(e),d=f.s;return(t=f.r).length&&N(8),d}var he=function(e,a){return a+30+ce(e,a+26)+ce(e,a+28)},pe=function(e,a,t){var c=ce(e,a+28),f=ue(e.subarray(a+46,a+46+c),!(2048&ce(e,a+8))),d=a+46+c,r=fe(e,a+20),n=t&&4294967295==r?ge(e,d):[r,fe(e,a+24),fe(e,a+42)],i=n[0],b=n[1],o=n[2];return[ce(e,a+10),i,b,f,d+ce(e,a+30)+ce(e,a+32),o]},ge=function(e,a){for(;1!=ce(e,a);a+=4+ce(e,a+2));return[de(e,a+12),de(e,a+4),de(e,a+20)]},me=function(e){var a=0;if(e)for(var t in e){var c=e[t].length;c>65535&&N(9),a+=c+4}return a},ye=function(e,a,t,c,f,d,r,n){var i=c.length,b=t.extra,o=n&&n.length,s=me(b);re(e,a,null!=r?33639248:67324752),a+=4,null!=r&&(e[a++]=20,e[a++]=t.os),e[a]=20,a+=2,e[a++]=t.flag<<1|(d<0&&8),e[a++]=f&&8,e[a++]=255&t.compression,e[a++]=t.compression>>8;var l=new Date(null==t.mtime?Date.now():t.mtime),u=l.getFullYear()-1980;if((u<0||u>119)&&N(10),re(e,a,u<<25|l.getMonth()+1<<21|l.getDate()<<16|l.getHours()<<11|l.getMinutes()<<5|l.getSeconds()>>1),a+=4,-1!=d&&(re(e,a,t.crc),re(e,a+4,d<0?-d-2:d),re(e,a+8,t.size)),re(e,a+12,i),re(e,a+14,s),a+=16,null!=r&&(re(e,a,o),re(e,a+6,t.attrs),re(e,a+10,r),a+=14),e.set(c,a),a+=i,s)for(var h in b){var p=b[h],g=p.length;re(e,a,+h),re(e,a+2,g),e.set(p,a+4),a+=4+g}return o&&(e.set(n,a),a+=o),a},xe=function(e,a,t,c,f){re(e,a,101010256),re(e,a+8,t),re(e,a+10,t),re(e,a+12,c),re(e,a+16,f)};var Ae="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(e){e()},ve=t(68909),we=t(67418);function _e(e,a){return new Promise(((t,c)=>{!function(e,a,t){t||(t=a,a={}),"function"!=typeof t&&N(7);var c={};be(e,"",c,a);var d=Object.keys(c),r=d.length,n=0,i=0,b=r,o=new Array(r),s=[],l=function(){for(var e=0;e65535&&I(N(11,0,1),null),_)if(g<16e4)try{I(null,ne(f,b))}catch(e){I(e,null)}else s.push(function(e,a,t){return t||(t=a,a={}),"function"!=typeof t&&N(7),te(e,a,[X],(function(e){return ee(ne(e.data[0],e.data[1]))}),0,t)}(f,b,I));else I(null,f)},g=0;g{e?c(e):t(a)}))}))}function Ie(e){return new Promise(((a,t)=>{!function(e,a,t){t||(t=a,a={}),"function"!=typeof t&&N(7);var c=[],d=function(){for(var e=0;e65558)return n(N(13,0,1),null),d;var b=ce(e,i+8);if(b){var o=b,s=fe(e,i+16),l=4294967295==s||65535==o;if(l){var u=fe(e,i-12);(l=101075792==fe(e,u))&&(o=b=fe(e,u+32),s=fe(e,u+48))}for(var h=a&&a.filter,p=function(a){var t=pe(e,s,l),i=t[0],o=t[1],u=t[2],p=t[3],g=t[4],m=t[5],y=he(e,m);s=g;var x=function(e,a){e?(d(),n(e,null)):(a&&(r[p]=a),--b||n(null,r))};if(!h||h({name:p,size:o,originalSize:u,compression:i}))if(i)if(8==i){var A=e.subarray(y,y+o);if(u<524288||o>.8*u)try{x(null,ie(A,{out:new f(u)}))}catch(e){x(e,null)}else c.push(function(e,a,t){return t||(t=a,a={}),"function"!=typeof t&&N(7),te(e,a,[Y],(function(e){return ee(ie(e.data[0],ae(e.data[1])))}),1,t)}(A,{size:u},x))}else x(N(14,"unknown compression type "+i,1),null);else x(null,S(e,y,y+o));else x(null,null)},g=0;g{e?t(e):a(c)}))}))}async function Ee({staticUrl:e="",zipName:a,zipDigest:t,parseJson:c=!0}){const f=`${e}/${a}.zip`,d=await(0,ve.Fd)(f,{method:"GET",returnResponse:!0}),r=new Uint8Array(await d.arrayBuffer());if(t){const e="sha384-"+(0,we.if)(await(0,we.br)(r));if(t!==e)throw new Error(`Invalid digest hash for file ${f}, wants ${t} has ${e}`)}const{[a]:n}=await Ie(r);return console.log(`Downloaded ${f}${t?` ( Digest: ${t} )`:""}`),c?JSON.parse((new TextDecoder).decode(n)):n}},32019:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.keccak512=a.keccak384=a.keccak256=a.keccak224=void 0;const c=t(32955),f=t(82672);a.keccak224=(0,f.wrapHash)(c.keccak_224),a.keccak256=(()=>{const e=(0,f.wrapHash)(c.keccak_256);return e.create=c.keccak_256.create,e})(),a.keccak384=(0,f.wrapHash)(c.keccak_384),a.keccak512=(0,f.wrapHash)(c.keccak_512)},40714:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.getHash=r,a.createCurve=function(e,a){const t=a=>(0,d.weierstrass)({...e,...r(a)});return Object.freeze({...t(a),create:t})};const c=t(39615),f=t(99175),d=t(20489);function r(e){return{hash:e,hmac:(a,...t)=>(0,c.hmac)(e,a,(0,f.concatBytes)(...t)),randomBytes:f.randomBytes}}},59206:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.wNAF=function(e,a){const t=(e,a)=>{const t=a.negate();return e?t:a},c=e=>({windows:Math.ceil(a/e)+1,windowSize:2**(e-1)});return{constTimeNegate:t,unsafeLadder(a,t){let c=e.ZERO,f=a;for(;t>d;)t&r&&(c=c.add(f)),f=f.double(),t>>=r;return c},precomputeWindow(e,a){const{windows:t,windowSize:f}=c(a),d=[];let r=e,n=r;for(let e=0;e>=u,c>i&&(c-=l,d+=r);const n=a,h=a+Math.abs(c)-1,p=e%2!=0,g=c<0;0===c?o=o.add(t(p,f[n])):b=b.add(t(g,f[h]))}return{p:b,f:o}},wNAFCached(e,a,t,c){const f=e._WINDOW_SIZE||1;let d=a.get(e);return d||(d=this.precomputeWindow(e,f),1!==f&&a.set(e,c(d))),this.wNAF(f,d,t)}}},a.validateBasic=function(e){return(0,c.validateField)(e.Fp),(0,f.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,c.nLength)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})};const c=t(89015),f=t(19372),d=BigInt(0),r=BigInt(1)},81761:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.expand_message_xmd=b,a.expand_message_xof=o,a.hash_to_field=s,a.isogenyMap=function(e,a){const t=a.map((e=>Array.from(e).reverse()));return(a,c)=>{const[f,d,r,n]=t.map((t=>t.reduce(((t,c)=>e.add(e.mul(t,a),c)))));return a=e.div(f,d),c=e.mul(c,e.div(r,n)),{x:a,y:c}}},a.createHasher=function(e,a,t){if("function"!=typeof a)throw new Error("mapToCurve() must be defined");return{hashToCurve(c,f){const d=s(c,2,{...t,DST:t.DST,...f}),r=e.fromAffine(a(d[0])),n=e.fromAffine(a(d[1])),i=r.add(n).clearCofactor();return i.assertValidity(),i},encodeToCurve(c,f){const d=s(c,1,{...t,DST:t.encodeDST,...f}),r=e.fromAffine(a(d[0])).clearCofactor();return r.assertValidity(),r},mapToCurve(t){if(!Array.isArray(t))throw new Error("mapToCurve: expected array of bigints");for(const e of t)if("bigint"!=typeof e)throw new Error(`mapToCurve: expected array of bigints, got ${e} in array`);const c=e.fromAffine(a(t)).clearCofactor();return c.assertValidity(),c}}};const c=t(89015),f=t(19372),d=f.bytesToNumberBE;function r(e,a){if(e<0||e>=1<<8*a)throw new Error(`bad I2OSP call: value=${e} length=${a}`);const t=Array.from({length:a}).fill(0);for(let c=a-1;c>=0;c--)t[c]=255&e,e>>>=8;return new Uint8Array(t)}function n(e,a){const t=new Uint8Array(e.length);for(let c=0;c255&&(a=c((0,f.concatBytes)((0,f.utf8ToBytes)("H2C-OVERSIZE-DST-"),a)));const{outputLen:d,blockLen:b}=c,o=Math.ceil(t/d);if(o>255)throw new Error("Invalid xmd length");const s=(0,f.concatBytes)(a,r(a.length,1)),l=r(0,b),u=r(t,2),h=new Array(o),p=c((0,f.concatBytes)(l,e,u,r(0,1),s));h[0]=c((0,f.concatBytes)(p,r(1,1),s));for(let e=1;e<=o;e++){const a=[n(p,h[e-1]),r(e+1,1),s];h[e]=c((0,f.concatBytes)(...a))}return(0,f.concatBytes)(...h).slice(0,t)}function o(e,a,t,c,d){if((0,f.abytes)(e),(0,f.abytes)(a),i(t),a.length>255){const e=Math.ceil(2*c/8);a=d.create({dkLen:e}).update((0,f.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(a).digest()}if(t>65535||a.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return d.create({dkLen:t}).update(e).update(r(t,2)).update(a).update(r(a.length,1)).digest()}function s(e,a,t){(0,f.validateObject)(t,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:r,k:n,m:s,hash:l,expand:u,DST:h}=t;(0,f.abytes)(e),i(a);const p="string"==typeof h?(0,f.utf8ToBytes)(h):h,g=r.toString(2).length,m=Math.ceil((g+n)/8),y=a*s*m;let x;if("xmd"===u)x=b(e,p,y,l);else if("xof"===u)x=o(e,p,y,n,l);else{if("_internal_pass"!==u)throw new Error('expand must be "xmd" or "xof"');x=e}const A=new Array(a);for(let e=0;e{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.isNegativeLE=void 0,a.mod=s,a.pow=l,a.pow2=function(e,a,t){let c=e;for(;a-- >f;)c*=c,c%=t;return c},a.invert=u,a.tonelliShanks=h,a.FpSqrt=p,a.validateField=function(e){const a=g.reduce(((e,a)=>(e[a]="function",e)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,c.validateObject)(e,a)},a.FpPow=m,a.FpInvertBatch=y,a.FpDiv=function(e,a,t){return e.mul(a,"bigint"==typeof t?u(t,e.ORDER):e.inv(t))},a.FpIsSquare=function(e){const a=(e.ORDER-d)/r;return t=>{const c=e.pow(t,a);return e.eql(c,e.ZERO)||e.eql(c,e.ONE)}},a.nLength=x,a.Field=function(e,a,t=!1,r={}){if(e<=f)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:n,nByteLength:i}=x(e,a);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");const b=p(e),o=Object.freeze({ORDER:e,BITS:n,BYTES:i,MASK:(0,c.bitMask)(n),ZERO:f,ONE:d,create:a=>s(a,e),isValid:a=>{if("bigint"!=typeof a)throw new Error("Invalid field element: expected bigint, got "+typeof a);return f<=a&&ae===f,isOdd:e=>(e&d)===d,neg:a=>s(-a,e),eql:(e,a)=>e===a,sqr:a=>s(a*a,e),add:(a,t)=>s(a+t,e),sub:(a,t)=>s(a-t,e),mul:(a,t)=>s(a*t,e),pow:(e,a)=>m(o,e,a),div:(a,t)=>s(a*u(t,e),e),sqrN:e=>e*e,addN:(e,a)=>e+a,subN:(e,a)=>e-a,mulN:(e,a)=>e*a,inv:a=>u(a,e),sqrt:r.sqrt||(e=>b(o,e)),invertBatch:e=>y(o,e),cmov:(e,a,t)=>t?a:e,toBytes:e=>t?(0,c.numberToBytesLE)(e,i):(0,c.numberToBytesBE)(e,i),fromBytes:e=>{if(e.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${e.length}`);return t?(0,c.bytesToNumberLE)(e):(0,c.bytesToNumberBE)(e)}});return Object.freeze(o)},a.FpSqrtOdd=function(e,a){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const t=e.sqrt(a);return e.isOdd(t)?t:e.neg(t)},a.FpSqrtEven=function(e,a){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const t=e.sqrt(a);return e.isOdd(t)?e.neg(t):t},a.hashToPrivateScalar=function(e,a,t=!1){const f=(e=(0,c.ensureBytes)("privateHash",e)).length,r=x(a).nByteLength+8;if(r<24||f1024)throw new Error(`hashToPrivateScalar: expected ${r}-1024 bytes of input, got ${f}`);return s(t?(0,c.bytesToNumberLE)(e):(0,c.bytesToNumberBE)(e),a-d)+d},a.getFieldBytesLength=A,a.getMinHashLength=v,a.mapHashToField=function(e,a,t=!1){const f=e.length,r=A(a),n=v(a);if(f<16||f1024)throw new Error(`expected ${n}-1024 bytes of input, got ${f}`);const i=s(t?(0,c.bytesToNumberBE)(e):(0,c.bytesToNumberLE)(e),a-d)+d;return t?(0,c.numberToBytesLE)(i,r):(0,c.numberToBytesBE)(i,r)};const c=t(19372),f=BigInt(0),d=BigInt(1),r=BigInt(2),n=BigInt(3),i=BigInt(4),b=BigInt(5),o=BigInt(8);function s(e,a){const t=e%a;return t>=f?t:a+t}function l(e,a,t){if(t<=f||a 0");if(t===d)return f;let c=d;for(;a>f;)a&d&&(c=c*e%t),e=e*e%t,a>>=d;return c}function u(e,a){if(e===f||a<=f)throw new Error(`invert: expected positive integers, got n=${e} mod=${a}`);let t=s(e,a),c=a,r=f,n=d,i=d,b=f;for(;t!==f;){const e=c/t,a=c%t,f=r-i*e,d=n-b*e;c=t,t=a,r=i,n=b,i=f,b=d}if(c!==d)throw new Error("invert: does not exist");return s(r,a)}function h(e){const a=(e-d)/r;let t,c,n;for(t=e-d,c=0;t%r===f;t/=r,c++);for(n=r;n(s(e,a)&d)===d;const g=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function m(e,a,t){if(t 0");if(t===f)return e.ONE;if(t===d)return a;let c=e.ONE,r=a;for(;t>f;)t&d&&(c=e.mul(c,r)),r=e.sqr(r),t>>=d;return c}function y(e,a){const t=new Array(a.length),c=a.reduce(((a,c,f)=>e.is0(c)?a:(t[f]=a,e.mul(a,c))),e.ONE),f=e.inv(c);return a.reduceRight(((a,c,f)=>e.is0(c)?a:(t[f]=e.mul(a,t[f]),e.mul(a,c))),f),t}function x(e,a){const t=void 0!==a?a:e.toString(2).length;return{nBitLength:t,nByteLength:Math.ceil(t/8)}}function A(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const a=e.toString(2).length;return Math.ceil(a/8)}function v(e){const a=A(e);return a+Math.ceil(a/2)}},19372:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.bitMask=void 0,a.isBytes=d,a.abytes=r,a.bytesToHex=i,a.numberToHexUnpadded=b,a.hexToNumber=o,a.hexToBytes=u,a.bytesToNumberBE=function(e){return o(i(e))},a.bytesToNumberLE=function(e){return r(e),o(i(Uint8Array.from(e).reverse()))},a.numberToBytesBE=h,a.numberToBytesLE=function(e,a){return h(e,a).reverse()},a.numberToVarBytesBE=function(e){return u(b(e))},a.ensureBytes=function(e,a,t){let c;if("string"==typeof a)try{c=u(a)}catch(t){throw new Error(`${e} must be valid hex string, got "${a}". Cause: ${t}`)}else{if(!d(a))throw new Error(`${e} must be hex string or Uint8Array`);c=Uint8Array.from(a)}const f=c.length;if("number"==typeof t&&f!==t)throw new Error(`${e} expected ${t} bytes, got ${f}`);return c},a.concatBytes=p,a.equalBytes=function(e,a){if(e.length!==a.length)return!1;let t=0;for(let c=0;ct;e>>=c,a+=1);return a},a.bitGet=function(e,a){return e>>BigInt(a)&c},a.bitSet=function(e,a,f){return e|(f?c:t)<{c.fill(1),f.fill(0),d=0},n=(...e)=>t(f,c,...e),i=(e=g())=>{f=n(m([0]),e),c=n(),0!==e.length&&(f=n(m([1]),e),c=n())},b=()=>{if(d++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const t=[];for(;e{let t;for(r(),i(e);!(t=a(b()));)i();return r(),t}},a.validateObject=function(e,a,t={}){const c=(a,t,c)=>{const f=y[t];if("function"!=typeof f)throw new Error(`Invalid validator "${t}", expected function`);const d=e[a];if(!(c&&void 0===d||f(d,e)))throw new Error(`Invalid param ${String(a)}=${d} (${typeof d}), expected ${t}`)};for(const[e,t]of Object.entries(a))c(e,t,!1);for(const[e,a]of Object.entries(t))c(e,a,!0);return e};const t=BigInt(0),c=BigInt(1),f=BigInt(2);function d(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function r(e){if(!d(e))throw new Error("Uint8Array expected")}const n=Array.from({length:256},((e,a)=>a.toString(16).padStart(2,"0")));function i(e){r(e);let a="";for(let t=0;t=s._0&&e<=s._9?e-s._0:e>=s._A&&e<=s._F?e-(s._A-10):e>=s._a&&e<=s._f?e-(s._a-10):void 0}function u(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const a=e.length,t=a/2;if(a%2)throw new Error("padded hex string expected, got unpadded hex of length "+a);const c=new Uint8Array(t);for(let a=0,f=0;a(f<new Uint8Array(e),m=e=>Uint8Array.from(e),y={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||d(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,a)=>a.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)}},20489:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.DER=void 0,a.weierstrassPoints=h,a.weierstrass=function(e){const t=function(e){const a=(0,c.validateBasic)(e);return d.validateObject(a,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...a})}(e),{Fp:n,n:i}=t,s=n.BYTES+1,l=2*n.BYTES+1;function u(e){return f.mod(e,i)}function p(e){return f.invert(e,i)}const{ProjectivePoint:g,normPrivateKeyToScalar:m,weierstrassEquation:y,isWithinCurveOrder:x}=h({...t,toBytes(e,a,t){const c=a.toAffine(),f=n.toBytes(c.x),r=d.concatBytes;return t?r(Uint8Array.from([a.hasEvenY()?2:3]),f):r(Uint8Array.from([4]),f,n.toBytes(c.y))},fromBytes(e){const a=e.length,t=e[0],c=e.subarray(1);if(a!==s||2!==t&&3!==t){if(a===l&&4===t)return{x:n.fromBytes(c.subarray(0,n.BYTES)),y:n.fromBytes(c.subarray(n.BYTES,2*n.BYTES))};throw new Error(`Point of length ${a} was invalid. Expected ${s} compressed bytes or ${l} uncompressed bytes`)}{const e=d.bytesToNumberBE(c);if(!(b<(f=e)&&fd.bytesToHex(d.numberToBytesBE(e,t.nByteLength));function v(e){return e>i>>o}const w=(e,a,t)=>d.bytesToNumberBE(e.slice(a,t));class _{constructor(e,a,t){this.r=e,this.s=a,this.recovery=t,this.assertValidity()}static fromCompact(e){const a=t.nByteLength;return e=(0,r.ensureBytes)("compactSignature",e,2*a),new _(w(e,0,a),w(e,a,2*a))}static fromDER(e){const{r:t,s:c}=a.DER.toSig((0,r.ensureBytes)("DER",e));return new _(t,c)}assertValidity(){if(!x(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!x(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new _(this.r,this.s,e)}recoverPublicKey(e){const{r:a,s:c,recovery:f}=this,d=M((0,r.ensureBytes)("msgHash",e));if(null==f||![0,1,2,3].includes(f))throw new Error("recovery id invalid");const i=2===f||3===f?a+t.n:a;if(i>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const b=1&f?"03":"02",o=g.fromHex(b+A(i)),s=p(i),l=u(-d*s),h=u(c*s),m=g.BASE.multiplyAndAddUnsafe(o,l,h);if(!m)throw new Error("point at infinify");return m.assertValidity(),m}hasHighS(){return v(this.s)}normalizeS(){return this.hasHighS()?new _(this.r,u(-this.s),this.recovery):this}toDERRawBytes(){return d.hexToBytes(this.toDERHex())}toDERHex(){return a.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return d.hexToBytes(this.toCompactHex())}toCompactHex(){return A(this.r)+A(this.s)}}const I={isValidPrivateKey(e){try{return m(e),!0}catch(e){return!1}},normPrivateKeyToScalar:m,randomPrivateKey:()=>{const e=f.getMinHashLength(t.n);return f.mapHashToField(t.randomBytes(e),t.n)},precompute:(e=8,a=g.BASE)=>(a._setWindowSize(e),a.multiply(BigInt(3)),a)};function E(e){const a=d.isBytes(e),t="string"==typeof e,c=(a||t)&&e.length;return a?c===s||c===l:t?c===2*s||c===2*l:e instanceof g}const C=t.bits2int||function(e){const a=d.bytesToNumberBE(e),c=8*e.length-t.nBitLength;return c>0?a>>BigInt(c):a},M=t.bits2int_modN||function(e){return u(C(e))},B=d.bitMask(t.nBitLength);function k(e){if("bigint"!=typeof e)throw new Error("bigint expected");if(!(b<=e&&ee in c)))throw new Error("sign() legacy options not supported");const{hash:f,randomBytes:i}=t;let{lowS:s,prehash:l,extraEntropy:h}=c;null==s&&(s=!0),e=(0,r.ensureBytes)("msgHash",e),l&&(e=(0,r.ensureBytes)("prehashed msgHash",f(e)));const y=M(e),A=m(a),w=[k(A),k(y)];if(null!=h&&!1!==h){const e=!0===h?i(n.BYTES):h;w.push((0,r.ensureBytes)("extraEntropy",e))}const I=d.concatBytes(...w),E=y;return{seed:I,k2sig:function(e){const a=C(e);if(!x(a))return;const t=p(a),c=g.BASE.multiply(a).toAffine(),f=u(c.x);if(f===b)return;const d=u(t*u(E+f*A));if(d===b)return;let r=(c.x===f?0:2)|Number(c.y&o),n=d;return s&&v(d)&&(n=function(e){return v(e)?u(-e):e}(d),r^=1),new _(f,n,r)}}}(e,a,c),s=t;return d.createHmacDrbg(s.hash.outputLen,s.nByteLength,s.hmac)(f,i)},verify:function(e,c,f,n=S){const i=e;if(c=(0,r.ensureBytes)("msgHash",c),f=(0,r.ensureBytes)("publicKey",f),"strict"in n)throw new Error("options.strict was renamed to lowS");const{lowS:b,prehash:o}=n;let s,l;try{if("string"==typeof i||d.isBytes(i))try{s=_.fromDER(i)}catch(e){if(!(e instanceof a.DER.Err))throw e;s=_.fromCompact(i)}else{if("object"!=typeof i||"bigint"!=typeof i.r||"bigint"!=typeof i.s)throw new Error("PARSE");{const{r:e,s:a}=i;s=new _(e,a)}}l=g.fromHex(f)}catch(e){if("PARSE"===e.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(b&&s.hasHighS())return!1;o&&(c=t.hash(c));const{r:h,s:m}=s,y=M(c),x=p(m),A=u(y*x),v=u(h*x),w=g.BASE.multiplyAndAddUnsafe(l,A,v)?.toAffine();return!!w&&u(w.x)===h},ProjectivePoint:g,Signature:_,utils:I}},a.SWUFpSqrtRatio=p,a.mapToCurveSimpleSWU=function(e,a){if(f.validateField(e),!e.isValid(a.A)||!e.isValid(a.B)||!e.isValid(a.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const t=p(e,a.Z);if(!e.isOdd)throw new Error("Fp.isOdd is not implemented!");return c=>{let f,d,r,n,i,b,o,s;f=e.sqr(c),f=e.mul(f,a.Z),d=e.sqr(f),d=e.add(d,f),r=e.add(d,e.ONE),r=e.mul(r,a.B),n=e.cmov(a.Z,e.neg(d),!e.eql(d,e.ZERO)),n=e.mul(n,a.A),d=e.sqr(r),b=e.sqr(n),i=e.mul(b,a.A),d=e.add(d,i),d=e.mul(d,r),b=e.mul(b,n),i=e.mul(b,a.B),d=e.add(d,i),o=e.mul(f,r);const{isValid:l,value:u}=t(d,b);s=e.mul(f,c),s=e.mul(s,u),o=e.cmov(o,r,l),s=e.cmov(s,u,l);const h=e.isOdd(c)===e.isOdd(s);return s=e.cmov(e.neg(s),s,h),o=e.div(o,n),{x:o,y:s}}};const c=t(59206),f=t(89015),d=t(19372),r=t(19372),{bytesToNumberBE:n,hexToBytes:i}=d;a.DER={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(e){const{Err:t}=a.DER;if(e.length<2||2!==e[0])throw new t("Invalid signature integer tag");const c=e[1],f=e.subarray(2,c+2);if(!c||f.length!==c)throw new t("Invalid signature integer: wrong length");if(128&f[0])throw new t("Invalid signature integer: negative");if(0===f[0]&&!(128&f[1]))throw new t("Invalid signature integer: unnecessary leading zero");return{d:n(f),l:e.subarray(c+2)}},toSig(e){const{Err:t}=a.DER,c="string"==typeof e?i(e):e;d.abytes(c);let f=c.length;if(f<2||48!=c[0])throw new t("Invalid signature tag");if(c[1]!==f-2)throw new t("Invalid signature: incorrect length");const{d:r,l:n}=a.DER._parseInt(c.subarray(2)),{d:b,l:o}=a.DER._parseInt(n);if(o.length)throw new t("Invalid signature: left bytes after parsing");return{r,s:b}},hexFromSig(e){const a=e=>8&Number.parseInt(e[0],16)?"00"+e:e,t=e=>{const a=e.toString(16);return 1&a.length?`0${a}`:a},c=a(t(e.s)),f=a(t(e.r)),d=c.length/2,r=f.length/2,n=t(d),i=t(r);return`30${t(r+d+4)}02${i}${f}02${n}${c}`}};const b=BigInt(0),o=BigInt(1),s=BigInt(2),l=BigInt(3),u=BigInt(4);function h(e){const a=function(e){const a=(0,c.validateBasic)(e);d.validateObject(a,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:t,Fp:f,a:r}=a;if(t){if(!f.eql(r,f.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof t||"bigint"!=typeof t.beta||"function"!=typeof t.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...a})}(e),{Fp:t}=a,n=a.toBytes||((e,a,c)=>{const f=a.toAffine();return d.concatBytes(Uint8Array.from([4]),t.toBytes(f.x),t.toBytes(f.y))}),i=a.fromBytes||(e=>{const a=e.subarray(1);return{x:t.fromBytes(a.subarray(0,t.BYTES)),y:t.fromBytes(a.subarray(t.BYTES,2*t.BYTES))}});function s(e){const{a:c,b:f}=a,d=t.sqr(e),r=t.mul(d,e);return t.add(t.add(r,t.mul(e,c)),f)}if(!t.eql(t.sqr(a.Gy),s(a.Gx)))throw new Error("bad generator point: equation left != right");function u(e){return"bigint"==typeof e&&bt.eql(e,t.ZERO);return f(a)&&f(c)?y.ZERO:new y(a,c,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const a=t.invertBatch(e.map((e=>e.pz)));return e.map(((e,t)=>e.toAffine(a[t]))).map(y.fromAffine)}static fromHex(e){const a=y.fromAffine(i((0,r.ensureBytes)("pointHex",e)));return a.assertValidity(),a}static fromPrivateKey(e){return y.BASE.multiply(p(e))}_setWindowSize(e){this._WINDOW_SIZE=e,g.delete(this)}assertValidity(){if(this.is0()){if(a.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:e,y:c}=this.toAffine();if(!t.isValid(e)||!t.isValid(c))throw new Error("bad point: x or y not FE");const f=t.sqr(c),d=s(e);if(!t.eql(f,d))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:e}=this.toAffine();if(t.isOdd)return!t.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){m(e);const{px:a,py:c,pz:f}=this,{px:d,py:r,pz:n}=e,i=t.eql(t.mul(a,n),t.mul(d,f)),b=t.eql(t.mul(c,n),t.mul(r,f));return i&&b}negate(){return new y(this.px,t.neg(this.py),this.pz)}double(){const{a:e,b:c}=a,f=t.mul(c,l),{px:d,py:r,pz:n}=this;let i=t.ZERO,b=t.ZERO,o=t.ZERO,s=t.mul(d,d),u=t.mul(r,r),h=t.mul(n,n),p=t.mul(d,r);return p=t.add(p,p),o=t.mul(d,n),o=t.add(o,o),i=t.mul(e,o),b=t.mul(f,h),b=t.add(i,b),i=t.sub(u,b),b=t.add(u,b),b=t.mul(i,b),i=t.mul(p,i),o=t.mul(f,o),h=t.mul(e,h),p=t.sub(s,h),p=t.mul(e,p),p=t.add(p,o),o=t.add(s,s),s=t.add(o,s),s=t.add(s,h),s=t.mul(s,p),b=t.add(b,s),h=t.mul(r,n),h=t.add(h,h),s=t.mul(h,p),i=t.sub(i,s),o=t.mul(h,u),o=t.add(o,o),o=t.add(o,o),new y(i,b,o)}add(e){m(e);const{px:c,py:f,pz:d}=this,{px:r,py:n,pz:i}=e;let b=t.ZERO,o=t.ZERO,s=t.ZERO;const u=a.a,h=t.mul(a.b,l);let p=t.mul(c,r),g=t.mul(f,n),x=t.mul(d,i),A=t.add(c,f),v=t.add(r,n);A=t.mul(A,v),v=t.add(p,g),A=t.sub(A,v),v=t.add(c,d);let w=t.add(r,i);return v=t.mul(v,w),w=t.add(p,x),v=t.sub(v,w),w=t.add(f,d),b=t.add(n,i),w=t.mul(w,b),b=t.add(g,x),w=t.sub(w,b),s=t.mul(u,v),b=t.mul(h,x),s=t.add(b,s),b=t.sub(g,s),s=t.add(g,s),o=t.mul(b,s),g=t.add(p,p),g=t.add(g,p),x=t.mul(u,x),v=t.mul(h,v),g=t.add(g,x),x=t.sub(p,x),x=t.mul(u,x),v=t.add(v,x),p=t.mul(g,v),o=t.add(o,p),p=t.mul(w,v),b=t.mul(A,b),b=t.sub(b,p),p=t.mul(A,g),s=t.mul(w,s),s=t.add(s,p),new y(b,o,s)}subtract(e){return this.add(e.negate())}is0(){return this.equals(y.ZERO)}wNAF(e){return A.wNAFCached(this,g,e,(e=>{const a=t.invertBatch(e.map((e=>e.pz)));return e.map(((e,t)=>e.toAffine(a[t]))).map(y.fromAffine)}))}multiplyUnsafe(e){const c=y.ZERO;if(e===b)return c;if(h(e),e===o)return this;const{endo:f}=a;if(!f)return A.unsafeLadder(this,e);let{k1neg:d,k1:r,k2neg:n,k2:i}=f.splitScalar(e),s=c,l=c,u=this;for(;r>b||i>b;)r&o&&(s=s.add(u)),i&o&&(l=l.add(u)),u=u.double(),r>>=o,i>>=o;return d&&(s=s.negate()),n&&(l=l.negate()),l=new y(t.mul(l.px,f.beta),l.py,l.pz),s.add(l)}multiply(e){h(e);let c,f,d=e;const{endo:r}=a;if(r){const{k1neg:e,k1:a,k2neg:n,k2:i}=r.splitScalar(d);let{p:b,f:o}=this.wNAF(a),{p:s,f:l}=this.wNAF(i);b=A.constTimeNegate(e,b),s=A.constTimeNegate(n,s),s=new y(t.mul(s.px,r.beta),s.py,s.pz),c=b.add(s),f=o.add(l)}else{const{p:e,f:a}=this.wNAF(d);c=e,f=a}return y.normalizeZ([c,f])[0]}multiplyAndAddUnsafe(e,a,t){const c=y.BASE,f=(e,a)=>a!==b&&a!==o&&e.equals(c)?e.multiply(a):e.multiplyUnsafe(a),d=f(this,a).add(f(e,t));return d.is0()?void 0:d}toAffine(e){const{px:a,py:c,pz:f}=this,d=this.is0();null==e&&(e=d?t.ONE:t.inv(f));const r=t.mul(a,e),n=t.mul(c,e),i=t.mul(f,e);if(d)return{x:t.ZERO,y:t.ZERO};if(!t.eql(i,t.ONE))throw new Error("invZ was invalid");return{x:r,y:n}}isTorsionFree(){const{h:e,isTorsionFree:t}=a;if(e===o)return!0;if(t)return t(y,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:t}=a;return e===o?this:t?t(y,this):this.multiplyUnsafe(a.h)}toRawBytes(e=!0){return this.assertValidity(),n(y,this,e)}toHex(e=!0){return d.bytesToHex(this.toRawBytes(e))}}y.BASE=new y(a.Gx,a.Gy,t.ONE),y.ZERO=new y(t.ZERO,t.ONE,t.ZERO);const x=a.nBitLength,A=(0,c.wNAF)(y,a.endo?Math.ceil(x/2):x);return{CURVE:a,ProjectivePoint:y,normPrivateKeyToScalar:p,weierstrassEquation:s,isWithinCurveOrder:u}}function p(e,a){const t=e.ORDER;let c=b;for(let e=t-o;e%s===b;e/=s)c+=o;const f=c,d=s<{let c=g,d=e.pow(t,h),r=e.sqr(d);r=e.mul(r,t);let n=e.mul(a,r);n=e.pow(n,i),n=e.mul(n,d),d=e.mul(n,t),r=e.mul(n,a);let b=e.mul(r,d);n=e.pow(b,p);let l=e.eql(n,e.ONE);d=e.mul(r,m),n=e.mul(b,c),r=e.cmov(d,r,l),b=e.cmov(n,b,l);for(let a=f;a>o;a--){let t=a-s;t=s<{let d=e.sqr(f);const r=e.mul(a,f);d=e.mul(d,r);let n=e.pow(d,t);n=e.mul(n,r);const i=e.mul(n,c),b=e.mul(e.sqr(n),f),o=e.eql(b,a);return{isValid:o,value:e.cmov(i,n,o)}}}return y}},67694:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.encodeToCurve=a.hashToCurve=a.schnorr=a.secp256k1=void 0;const c=t(22623),f=t(99175),d=t(40714),r=t(81761),n=t(89015),i=t(19372),b=t(20489),o=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),s=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),l=BigInt(1),u=BigInt(2),h=(e,a)=>(e+a/u)/a;function p(e){const a=o,t=BigInt(3),c=BigInt(6),f=BigInt(11),d=BigInt(22),r=BigInt(23),i=BigInt(44),b=BigInt(88),s=e*e*e%a,l=s*s*e%a,h=(0,n.pow2)(l,t,a)*l%a,p=(0,n.pow2)(h,t,a)*l%a,m=(0,n.pow2)(p,u,a)*s%a,y=(0,n.pow2)(m,f,a)*m%a,x=(0,n.pow2)(y,d,a)*y%a,A=(0,n.pow2)(x,i,a)*x%a,v=(0,n.pow2)(A,b,a)*A%a,w=(0,n.pow2)(v,i,a)*x%a,_=(0,n.pow2)(w,t,a)*l%a,I=(0,n.pow2)(_,r,a)*y%a,E=(0,n.pow2)(I,c,a)*s%a,C=(0,n.pow2)(E,u,a);if(!g.eql(g.sqr(C),e))throw new Error("Cannot find square root");return C}const g=(0,n.Field)(o,void 0,void 0,{sqrt:p});a.secp256k1=(0,d.createCurve)({a:BigInt(0),b:BigInt(7),Fp:g,n:s,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const a=s,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),c=-l*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),f=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),d=t,r=BigInt("0x100000000000000000000000000000000"),i=h(d*e,a),b=h(-c*e,a);let o=(0,n.mod)(e-i*t-b*f,a),u=(0,n.mod)(-i*c-b*d,a);const p=o>r,g=u>r;if(p&&(o=a-o),g&&(u=a-u),o>r||u>r)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:p,k1:o,k2neg:g,k2:u}}}},c.sha256);const m=BigInt(0),y=e=>"bigint"==typeof e&&me.charCodeAt(0))));t=(0,i.concatBytes)(a,a),x[e]=t}return(0,c.sha256)((0,i.concatBytes)(t,...a))}const v=e=>e.toRawBytes(!0).slice(1),w=e=>(0,i.numberToBytesBE)(e,32),_=e=>(0,n.mod)(e,o),I=e=>(0,n.mod)(e,s),E=a.secp256k1.ProjectivePoint;function C(e){let t=a.secp256k1.utils.normPrivateKeyToScalar(e),c=E.fromPrivateKey(t);return{scalar:c.hasEvenY()?t:I(-t),bytes:v(c)}}function M(e){if(!y(e))throw new Error("bad x: need 0 < x < p");const a=_(e*e);let t=p(_(a*e+BigInt(7)));t%u!==m&&(t=_(-t));const c=new E(e,t,l);return c.assertValidity(),c}function B(...e){return I((0,i.bytesToNumberBE)(A("BIP0340/challenge",...e)))}function k(e,a,t){const c=(0,i.ensureBytes)("signature",e,64),f=(0,i.ensureBytes)("message",a),d=(0,i.ensureBytes)("publicKey",t,32);try{const e=M((0,i.bytesToNumberBE)(d)),a=(0,i.bytesToNumberBE)(c.subarray(0,32));if(!y(a))return!1;const t=(0,i.bytesToNumberBE)(c.subarray(32,64));if(!("bigint"==typeof(o=t)&&m(0,r.isogenyMap)(g,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map((e=>e.map((e=>BigInt(e)))))))(),S=(()=>(0,b.mapToCurveSimpleSWU)(g,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:g.create(BigInt("-11"))}))(),T=(()=>(0,r.createHasher)(a.secp256k1.ProjectivePoint,(e=>{const{x:a,y:t}=S(g.create(e[0]));return L(a,t)}),{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:g.ORDER,m:1,k:128,expand:"xmd",hash:c.sha256}))();a.hashToCurve=T.hashToCurve,a.encodeToCurve=T.encodeToCurve},26513:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.secp256k1=void 0;var c=t(67694);Object.defineProperty(a,"secp256k1",{enumerable:!0,get:function(){return c.secp256k1}})},82672:function(e,a,t){"use strict";e=t.nmd(e);var c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0}),a.crypto=a.utf8ToBytes=a.createView=a.concatBytes=a.toHex=a.bytesToHex=a.assertBytes=a.assertBool=void 0,a.bytesToUtf8=function(e){if(!(e instanceof Uint8Array))throw new TypeError("bytesToUtf8 expected Uint8Array, got "+typeof e);return(new TextDecoder).decode(e)},a.hexToBytes=function(e){const a=e.startsWith("0x")?e.substring(2):e;return(0,d.hexToBytes)(a)},a.equalsBytes=function(e,a){if(e.length!==a.length)return!1;for(let t=0;t(f.default.bytes(a),e(a))};const f=c(t(67557)),d=t(99175),r=f.default.bool;a.assertBool=r;const n=f.default.bytes;a.assertBytes=n;var i=t(99175);Object.defineProperty(a,"bytesToHex",{enumerable:!0,get:function(){return i.bytesToHex}}),Object.defineProperty(a,"toHex",{enumerable:!0,get:function(){return i.bytesToHex}}),Object.defineProperty(a,"concatBytes",{enumerable:!0,get:function(){return i.concatBytes}}),Object.defineProperty(a,"createView",{enumerable:!0,get:function(){return i.createView}}),Object.defineProperty(a,"utf8ToBytes",{enumerable:!0,get:function(){return i.utf8ToBytes}}),a.crypto=(()=>{const a="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,t="function"==typeof e.require&&e.require.bind(e);return{node:t&&!a?t("crypto"):void 0,web:a}})()},37007:e=>{"use strict";var a,t="object"==typeof Reflect?Reflect:null,c=t&&"function"==typeof t.apply?t.apply:function(e,a,t){return Function.prototype.apply.call(e,a,t)};a=t&&"function"==typeof t.ownKeys?t.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var f=Number.isNaN||function(e){return e!=e};function d(){d.init.call(this)}e.exports=d,e.exports.once=function(e,a){return new Promise((function(t,c){function f(t){e.removeListener(a,d),c(t)}function d(){"function"==typeof e.removeListener&&e.removeListener("error",f),t([].slice.call(arguments))}p(e,a,d,{once:!0}),"error"!==a&&function(e,a){"function"==typeof e.on&&p(e,"error",a,{once:!0})}(e,f)}))},d.EventEmitter=d,d.prototype._events=void 0,d.prototype._eventsCount=0,d.prototype._maxListeners=void 0;var r=10;function n(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function i(e){return void 0===e._maxListeners?d.defaultMaxListeners:e._maxListeners}function b(e,a,t,c){var f,d,r,b;if(n(t),void 0===(d=e._events)?(d=e._events=Object.create(null),e._eventsCount=0):(void 0!==d.newListener&&(e.emit("newListener",a,t.listener?t.listener:t),d=e._events),r=d[a]),void 0===r)r=d[a]=t,++e._eventsCount;else if("function"==typeof r?r=d[a]=c?[t,r]:[r,t]:c?r.unshift(t):r.push(t),(f=i(e))>0&&r.length>f&&!r.warned){r.warned=!0;var o=new Error("Possible EventEmitter memory leak detected. "+r.length+" "+String(a)+" listeners added. Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning",o.emitter=e,o.type=a,o.count=r.length,b=o,console&&console.warn&&console.warn(b)}return e}function o(){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 s(e,a,t){var c={fired:!1,wrapFn:void 0,target:e,type:a,listener:t},f=o.bind(c);return f.listener=t,c.wrapFn=f,f}function l(e,a,t){var c=e._events;if(void 0===c)return[];var f=c[a];return void 0===f?[]:"function"==typeof f?t?[f.listener||f]:[f]:t?function(e){for(var a=new Array(e.length),t=0;t0&&(r=a[0]),r instanceof Error)throw r;var n=new Error("Unhandled error."+(r?" ("+r.message+")":""));throw n.context=r,n}var i=d[e];if(void 0===i)return!1;if("function"==typeof i)c(i,this,a);else{var b=i.length,o=h(i,b);for(t=0;t=0;d--)if(t[d]===a||t[d].listener===a){r=t[d].listener,f=d;break}if(f<0)return this;0===f?t.shift():function(e,a){for(;a+1=0;c--)this.removeListener(e,a[c]);return this},d.prototype.listeners=function(e){return l(this,e,!0)},d.prototype.rawListeners=function(e){return l(this,e,!1)},d.listenerCount=function(e,a){return"function"==typeof e.listenerCount?e.listenerCount(a):u.call(e,a)},d.prototype.listenerCount=u,d.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]}},68078:(e,a,t)=>{var c=t(92861).Buffer,f=t(88276);e.exports=function(e,a,t,d){if(c.isBuffer(e)||(e=c.from(e,"binary")),a&&(c.isBuffer(a)||(a=c.from(a,"binary")),8!==a.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var r=t/8,n=c.alloc(r),i=c.alloc(d||0),b=c.alloc(0);r>0||d>0;){var o=new f;o.update(b),o.update(e),a&&o.update(a),b=o.digest();var s=0;if(r>0){var l=n.length-r;s=Math.min(r,b.length),b.copy(n,l,0,s),r-=s}if(s0){var u=i.length-d,h=Math.min(d,b.length-s);b.copy(i,u,s,s+h),d-=h}}return b.fill(0),{key:n,iv:i}}},32017:e=>{"use strict";e.exports=function e(a,t){if(a===t)return!0;if(a&&t&&"object"==typeof a&&"object"==typeof t){if(a.constructor!==t.constructor)return!1;var c,f,d;if(Array.isArray(a)){if((c=a.length)!=t.length)return!1;for(f=c;0!=f--;)if(!e(a[f],t[f]))return!1;return!0}if(a.constructor===RegExp)return a.source===t.source&&a.flags===t.flags;if(a.valueOf!==Object.prototype.valueOf)return a.valueOf()===t.valueOf();if(a.toString!==Object.prototype.toString)return a.toString()===t.toString();if((c=(d=Object.keys(a)).length)!==Object.keys(t).length)return!1;for(f=c;0!=f--;)if(!Object.prototype.hasOwnProperty.call(t,d[f]))return!1;for(f=c;0!=f--;){var r=d[f];if(!e(a[r],t[r]))return!1}return!0}return a!=a&&t!=t}},82682:(e,a,t)=>{"use strict";var c=t(69600),f=Object.prototype.toString,d=Object.prototype.hasOwnProperty;e.exports=function(e,a,t){if(!c(a))throw new TypeError("iterator must be a function");var r;arguments.length>=3&&(r=t),"[object Array]"===f.call(e)?function(e,a,t){for(var c=0,f=e.length;c{"use strict";var a=Object.prototype.toString,t=Math.max,c=function(e,a){for(var t=[],c=0;c{"use strict";var c=t(89353);e.exports=Function.prototype.bind||c},70453:(e,a,t)=>{"use strict";var c,f=t(69383),d=t(41237),r=t(79290),n=t(79538),i=t(58068),b=t(69675),o=t(35345),s=Function,l=function(e){try{return s('"use strict"; return ('+e+").constructor;")()}catch(e){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(e){u=null}var h=function(){throw new b},p=u?function(){try{return h}catch(e){try{return u(arguments,"callee").get}catch(e){return h}}}():h,g=t(64039)(),m=t(80024)(),y=Object.getPrototypeOf||(m?function(e){return e.__proto__}:null),x={},A="undefined"!=typeof Uint8Array&&y?y(Uint8Array):c,v={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?c:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?c:ArrayBuffer,"%ArrayIteratorPrototype%":g&&y?y([][Symbol.iterator]()):c,"%AsyncFromSyncIteratorPrototype%":c,"%AsyncFunction%":x,"%AsyncGenerator%":x,"%AsyncGeneratorFunction%":x,"%AsyncIteratorPrototype%":x,"%Atomics%":"undefined"==typeof Atomics?c:Atomics,"%BigInt%":"undefined"==typeof BigInt?c:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?c:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?c:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?c:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":f,"%eval%":eval,"%EvalError%":d,"%Float32Array%":"undefined"==typeof Float32Array?c:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?c:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?c:FinalizationRegistry,"%Function%":s,"%GeneratorFunction%":x,"%Int8Array%":"undefined"==typeof Int8Array?c:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?c:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?c:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&y?y(y([][Symbol.iterator]())):c,"%JSON%":"object"==typeof JSON?JSON:c,"%Map%":"undefined"==typeof Map?c:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&y?y((new Map)[Symbol.iterator]()):c,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?c:Promise,"%Proxy%":"undefined"==typeof Proxy?c:Proxy,"%RangeError%":r,"%ReferenceError%":n,"%Reflect%":"undefined"==typeof Reflect?c:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?c:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&y?y((new Set)[Symbol.iterator]()):c,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?c:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&y?y(""[Symbol.iterator]()):c,"%Symbol%":g?Symbol:c,"%SyntaxError%":i,"%ThrowTypeError%":p,"%TypedArray%":A,"%TypeError%":b,"%Uint8Array%":"undefined"==typeof Uint8Array?c:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?c:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?c:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?c:Uint32Array,"%URIError%":o,"%WeakMap%":"undefined"==typeof WeakMap?c:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?c:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?c:WeakSet};if(y)try{null.error}catch(e){var w=y(y(e));v["%Error.prototype%"]=w}var _=function e(a){var t;if("%AsyncFunction%"===a)t=l("async function () {}");else if("%GeneratorFunction%"===a)t=l("function* () {}");else if("%AsyncGeneratorFunction%"===a)t=l("async function* () {}");else if("%AsyncGenerator%"===a){var c=e("%AsyncGeneratorFunction%");c&&(t=c.prototype)}else if("%AsyncIteratorPrototype%"===a){var f=e("%AsyncGenerator%");f&&y&&(t=y(f.prototype))}return v[a]=t,t},I={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},E=t(66743),C=t(9957),M=E.call(Function.call,Array.prototype.concat),B=E.call(Function.apply,Array.prototype.splice),k=E.call(Function.call,String.prototype.replace),L=E.call(Function.call,String.prototype.slice),S=E.call(Function.call,RegExp.prototype.exec),T=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,N=/\\(\\)?/g,R=function(e,a){var t,c=e;if(C(I,c)&&(c="%"+(t=I[c])[0]+"%"),C(v,c)){var f=v[c];if(f===x&&(f=_(c)),void 0===f&&!a)throw new b("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:t,name:c,value:f}}throw new i("intrinsic "+e+" does not exist!")};e.exports=function(e,a){if("string"!=typeof e||0===e.length)throw new b("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof a)throw new b('"allowMissing" argument must be a boolean');if(null===S(/^%?[^%]*%?$/,e))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var t=function(e){var a=L(e,0,1),t=L(e,-1);if("%"===a&&"%"!==t)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===t&&"%"!==a)throw new i("invalid intrinsic syntax, expected opening `%`");var c=[];return k(e,T,(function(e,a,t,f){c[c.length]=t?k(f,N,"$1"):a||e})),c}(e),c=t.length>0?t[0]:"",f=R("%"+c+"%",a),d=f.name,r=f.value,n=!1,o=f.alias;o&&(c=o[0],B(t,M([0,1],o)));for(var s=1,l=!0;s=t.length){var m=u(r,h);r=(l=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:r[h]}else l=C(r,h),r=r[h];l&&!n&&(v[d]=r)}}return r}},75795:(e,a,t)=>{"use strict";var c=t(70453)("%Object.getOwnPropertyDescriptor%",!0);if(c)try{c([],"length")}catch(e){c=null}e.exports=c},30592:(e,a,t)=>{"use strict";var c=t(30655),f=function(){return!!c};f.hasArrayLengthDefineBug=function(){if(!c)return null;try{return 1!==c([],"length",{value:1}).length}catch(e){return!0}},e.exports=f},80024:e=>{"use strict";var a={__proto__:null,foo:{}},t=Object;e.exports=function(){return{__proto__:a}.foo===a.foo&&!(a instanceof t)}},64039:(e,a,t)=>{"use strict";var c="undefined"!=typeof Symbol&&Symbol,f=t(41333);e.exports=function(){return"function"==typeof c&&"function"==typeof Symbol&&"symbol"==typeof c("foo")&&"symbol"==typeof Symbol("bar")&&f()}},41333:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},a=Symbol("test"),t=Object(a);if("string"==typeof a)return!1;if("[object Symbol]"!==Object.prototype.toString.call(a))return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;for(a in e[a]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var c=Object.getOwnPropertySymbols(e);if(1!==c.length||c[0]!==a)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,a))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var f=Object.getOwnPropertyDescriptor(e,a);if(42!==f.value||!0!==f.enumerable)return!1}return!0}},49092:(e,a,t)=>{"use strict";var c=t(41333);e.exports=function(){return c()&&!!Symbol.toStringTag}},77952:(e,a,t)=>{var c=a;c.utils=t(67426),c.common=t(66166),c.sha=t(46229),c.ripemd=t(46784),c.hmac=t(28948),c.sha1=c.sha.sha1,c.sha256=c.sha.sha256,c.sha224=c.sha.sha224,c.sha384=c.sha.sha384,c.sha512=c.sha.sha512,c.ripemd160=c.ripemd.ripemd160},66166:(e,a,t)=>{"use strict";var c=t(67426),f=t(43349);function d(){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}a.BlockHash=d,d.prototype.update=function(e,a){if(e=c.toArray(e,a),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var t=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-t,e.length),0===this.pending.length&&(this.pending=null),e=c.join32(e,0,e.length-t,this.endian);for(var f=0;f>>24&255,c[f++]=e>>>16&255,c[f++]=e>>>8&255,c[f++]=255&e}else for(c[f++]=255&e,c[f++]=e>>>8&255,c[f++]=e>>>16&255,c[f++]=e>>>24&255,c[f++]=0,c[f++]=0,c[f++]=0,c[f++]=0,d=8;d{"use strict";var c=t(67426),f=t(43349);function d(e,a,t){if(!(this instanceof d))return new d(e,a,t);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(c.toArray(a,t))}e.exports=d,d.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),f(e.length<=this.blockSize);for(var a=e.length;a{"use strict";var c=t(67426),f=t(66166),d=c.rotl32,r=c.sum32,n=c.sum32_3,i=c.sum32_4,b=f.BlockHash;function o(){if(!(this instanceof o))return new o;b.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function s(e,a,t,c){return e<=15?a^t^c:e<=31?a&t|~a&c:e<=47?(a|~t)^c:e<=63?a&c|t&~c:a^(t|~c)}function l(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function u(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}c.inherits(o,b),a.ripemd160=o,o.blockSize=512,o.outSize=160,o.hmacStrength=192,o.padLength=64,o.prototype._update=function(e,a){for(var t=this.h[0],c=this.h[1],f=this.h[2],b=this.h[3],o=this.h[4],y=t,x=c,A=f,v=b,w=o,_=0;_<80;_++){var I=r(d(i(t,s(_,c,f,b),e[h[_]+a],l(_)),g[_]),o);t=o,o=b,b=d(f,10),f=c,c=I,I=r(d(i(y,s(79-_,x,A,v),e[p[_]+a],u(_)),m[_]),w),y=w,w=v,v=d(A,10),A=x,x=I}I=n(this.h[1],f,v),this.h[1]=n(this.h[2],b,w),this.h[2]=n(this.h[3],o,y),this.h[3]=n(this.h[4],t,x),this.h[4]=n(this.h[0],c,A),this.h[0]=I},o.prototype._digest=function(e){return"hex"===e?c.toHex32(this.h,"little"):c.split32(this.h,"little")};var h=[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],p=[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],g=[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],m=[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]},46229:(e,a,t)=>{"use strict";a.sha1=t(43917),a.sha224=t(47714),a.sha256=t(2287),a.sha384=t(21911),a.sha512=t(57766)},43917:(e,a,t)=>{"use strict";var c=t(67426),f=t(66166),d=t(66225),r=c.rotl32,n=c.sum32,i=c.sum32_5,b=d.ft_1,o=f.BlockHash,s=[1518500249,1859775393,2400959708,3395469782];function l(){if(!(this instanceof l))return new l;o.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}c.inherits(l,o),e.exports=l,l.blockSize=512,l.outSize=160,l.hmacStrength=80,l.padLength=64,l.prototype._update=function(e,a){for(var t=this.W,c=0;c<16;c++)t[c]=e[a+c];for(;c{"use strict";var c=t(67426),f=t(2287);function d(){if(!(this instanceof d))return new d;f.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}c.inherits(d,f),e.exports=d,d.blockSize=512,d.outSize=224,d.hmacStrength=192,d.padLength=64,d.prototype._digest=function(e){return"hex"===e?c.toHex32(this.h.slice(0,7),"big"):c.split32(this.h.slice(0,7),"big")}},2287:(e,a,t)=>{"use strict";var c=t(67426),f=t(66166),d=t(66225),r=t(43349),n=c.sum32,i=c.sum32_4,b=c.sum32_5,o=d.ch32,s=d.maj32,l=d.s0_256,u=d.s1_256,h=d.g0_256,p=d.g1_256,g=f.BlockHash,m=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function y(){if(!(this instanceof y))return new y;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}c.inherits(y,g),e.exports=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(e,a){for(var t=this.W,c=0;c<16;c++)t[c]=e[a+c];for(;c{"use strict";var c=t(67426),f=t(57766);function d(){if(!(this instanceof d))return new d;f.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}c.inherits(d,f),e.exports=d,d.blockSize=1024,d.outSize=384,d.hmacStrength=192,d.padLength=128,d.prototype._digest=function(e){return"hex"===e?c.toHex32(this.h.slice(0,12),"big"):c.split32(this.h.slice(0,12),"big")}},57766:(e,a,t)=>{"use strict";var c=t(67426),f=t(66166),d=t(43349),r=c.rotr64_hi,n=c.rotr64_lo,i=c.shr64_hi,b=c.shr64_lo,o=c.sum64,s=c.sum64_hi,l=c.sum64_lo,u=c.sum64_4_hi,h=c.sum64_4_lo,p=c.sum64_5_hi,g=c.sum64_5_lo,m=f.BlockHash,y=[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 x(){if(!(this instanceof x))return new x;m.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=y,this.W=new Array(160)}function A(e,a,t,c,f){var d=e&t^~e&f;return d<0&&(d+=4294967296),d}function v(e,a,t,c,f,d){var r=a&c^~a&d;return r<0&&(r+=4294967296),r}function w(e,a,t,c,f){var d=e&t^e&f^t&f;return d<0&&(d+=4294967296),d}function _(e,a,t,c,f,d){var r=a&c^a&d^c&d;return r<0&&(r+=4294967296),r}function I(e,a){var t=r(e,a,28)^r(a,e,2)^r(a,e,7);return t<0&&(t+=4294967296),t}function E(e,a){var t=n(e,a,28)^n(a,e,2)^n(a,e,7);return t<0&&(t+=4294967296),t}function C(e,a){var t=n(e,a,14)^n(e,a,18)^n(a,e,9);return t<0&&(t+=4294967296),t}function M(e,a){var t=r(e,a,1)^r(e,a,8)^i(e,a,7);return t<0&&(t+=4294967296),t}function B(e,a){var t=n(e,a,1)^n(e,a,8)^b(e,a,7);return t<0&&(t+=4294967296),t}function k(e,a){var t=n(e,a,19)^n(a,e,29)^b(e,a,6);return t<0&&(t+=4294967296),t}c.inherits(x,m),e.exports=x,x.blockSize=1024,x.outSize=512,x.hmacStrength=192,x.padLength=128,x.prototype._prepareBlock=function(e,a){for(var t=this.W,c=0;c<32;c++)t[c]=e[a+c];for(;c{"use strict";var c=t(67426).rotr32;function f(e,a,t){return e&a^~e&t}function d(e,a,t){return e&a^e&t^a&t}function r(e,a,t){return e^a^t}a.ft_1=function(e,a,t,c){return 0===e?f(a,t,c):1===e||3===e?r(a,t,c):2===e?d(a,t,c):void 0},a.ch32=f,a.maj32=d,a.p32=r,a.s0_256=function(e){return c(e,2)^c(e,13)^c(e,22)},a.s1_256=function(e){return c(e,6)^c(e,11)^c(e,25)},a.g0_256=function(e){return c(e,7)^c(e,18)^e>>>3},a.g1_256=function(e){return c(e,17)^c(e,19)^e>>>10}},67426:(e,a,t)=>{"use strict";var c=t(43349),f=t(56698);function d(e,a){return 55296==(64512&e.charCodeAt(a))&&!(a<0||a+1>=e.length)&&56320==(64512&e.charCodeAt(a+1))}function r(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function n(e){return 1===e.length?"0"+e:e}function i(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}a.inherits=f,a.toArray=function(e,a){if(Array.isArray(e))return e.slice();if(!e)return[];var t=[];if("string"==typeof e)if(a){if("hex"===a)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),f=0;f>6|192,t[c++]=63&r|128):d(e,f)?(r=65536+((1023&r)<<10)+(1023&e.charCodeAt(++f)),t[c++]=r>>18|240,t[c++]=r>>12&63|128,t[c++]=r>>6&63|128,t[c++]=63&r|128):(t[c++]=r>>12|224,t[c++]=r>>6&63|128,t[c++]=63&r|128)}else for(f=0;f>>0}return r},a.split32=function(e,a){for(var t=new Array(4*e.length),c=0,f=0;c>>24,t[f+1]=d>>>16&255,t[f+2]=d>>>8&255,t[f+3]=255&d):(t[f+3]=d>>>24,t[f+2]=d>>>16&255,t[f+1]=d>>>8&255,t[f]=255&d)}return t},a.rotr32=function(e,a){return e>>>a|e<<32-a},a.rotl32=function(e,a){return e<>>32-a},a.sum32=function(e,a){return e+a>>>0},a.sum32_3=function(e,a,t){return e+a+t>>>0},a.sum32_4=function(e,a,t,c){return e+a+t+c>>>0},a.sum32_5=function(e,a,t,c,f){return e+a+t+c+f>>>0},a.sum64=function(e,a,t,c){var f=e[a],d=c+e[a+1]>>>0,r=(d>>0,e[a+1]=d},a.sum64_hi=function(e,a,t,c){return(a+c>>>0>>0},a.sum64_lo=function(e,a,t,c){return a+c>>>0},a.sum64_4_hi=function(e,a,t,c,f,d,r,n){var i=0,b=a;return i+=(b=b+c>>>0)>>0)>>0)>>0},a.sum64_4_lo=function(e,a,t,c,f,d,r,n){return a+c+d+n>>>0},a.sum64_5_hi=function(e,a,t,c,f,d,r,n,i,b){var o=0,s=a;return o+=(s=s+c>>>0)>>0)>>0)>>0)>>0},a.sum64_5_lo=function(e,a,t,c,f,d,r,n,i,b){return a+c+d+n+b>>>0},a.rotr64_hi=function(e,a,t){return(a<<32-t|e>>>t)>>>0},a.rotr64_lo=function(e,a,t){return(e<<32-t|a>>>t)>>>0},a.shr64_hi=function(e,a,t){return e>>>t},a.shr64_lo=function(e,a,t){return(e<<32-t|a>>>t)>>>0}},9957:(e,a,t)=>{"use strict";var c=Function.prototype.call,f=Object.prototype.hasOwnProperty,d=t(66743);e.exports=d.call(c,f)},32723:(e,a,t)=>{"use strict";var c=t(77952),f=t(64367),d=t(43349);function r(e){if(!(this instanceof r))return new r(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 a=f.toArray(e.entropy,e.entropyEnc||"hex"),t=f.toArray(e.nonce,e.nonceEnc||"hex"),c=f.toArray(e.pers,e.persEnc||"hex");d(a.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(a,t,c)}e.exports=r,r.prototype._init=function(e,a,t){var c=e.concat(a).concat(t);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var f=0;f=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(t||[])),this._reseed=1},r.prototype.generate=function(e,a,t,c){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof a&&(c=t,t=a,a=null),t&&(t=f.toArray(t,c||"hex"),this._update(t));for(var d=[];d.length{var c=t(11568),f=t(23276),d=e.exports;for(var r in c)c.hasOwnProperty(r)&&(d[r]=c[r]);function n(e){if("string"==typeof e&&(e=f.parse(e)),e.protocol||(e.protocol="https:"),"https:"!==e.protocol)throw new Error('Protocol "'+e.protocol+'" not supported. Expected "https:"');return e}d.request=function(e,a){return e=n(e),c.request.call(this,e,a)},d.get=function(e,a){return e=n(e),c.get.call(this,e,a)}},251:(e,a)=>{a.read=function(e,a,t,c,f){var d,r,n=8*f-c-1,i=(1<>1,o=-7,s=t?f-1:0,l=t?-1:1,u=e[a+s];for(s+=l,d=u&(1<<-o)-1,u>>=-o,o+=n;o>0;d=256*d+e[a+s],s+=l,o-=8);for(r=d&(1<<-o)-1,d>>=-o,o+=c;o>0;r=256*r+e[a+s],s+=l,o-=8);if(0===d)d=1-b;else{if(d===i)return r?NaN:1/0*(u?-1:1);r+=Math.pow(2,c),d-=b}return(u?-1:1)*r*Math.pow(2,d-c)},a.write=function(e,a,t,c,f,d){var r,n,i,b=8*d-f-1,o=(1<>1,l=23===f?Math.pow(2,-24)-Math.pow(2,-77):0,u=c?0:d-1,h=c?1:-1,p=a<0||0===a&&1/a<0?1:0;for(a=Math.abs(a),isNaN(a)||a===1/0?(n=isNaN(a)?1:0,r=o):(r=Math.floor(Math.log(a)/Math.LN2),a*(i=Math.pow(2,-r))<1&&(r--,i*=2),(a+=r+s>=1?l/i:l*Math.pow(2,1-s))*i>=2&&(r++,i/=2),r+s>=o?(n=0,r=o):r+s>=1?(n=(a*i-1)*Math.pow(2,f),r+=s):(n=a*Math.pow(2,s-1)*Math.pow(2,f),r=0));f>=8;e[t+u]=255&n,u+=h,n/=256,f-=8);for(r=r<0;e[t+u]=255&r,u+=h,r/=256,b-=8);e[t+u-h]|=128*p}},56698:e=>{"function"==typeof Object.create?e.exports=function(e,a){a&&(e.super_=a,e.prototype=Object.create(a.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,a){if(a){e.super_=a;var t=function(){};t.prototype=a.prototype,e.prototype=new t,e.prototype.constructor=e}}},47244:(e,a,t)=>{"use strict";var c=t(49092)(),f=t(38075)("Object.prototype.toString"),d=function(e){return!(c&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===f(e)},r=function(e){return!!d(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==f(e)&&"[object Function]"===f(e.callee)},n=function(){return d(arguments)}();d.isLegacyArguments=r,e.exports=n?d:r},69600:e=>{"use strict";var a,t,c=Function.prototype.toString,f="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof f&&"function"==typeof Object.defineProperty)try{a=Object.defineProperty({},"length",{get:function(){throw t}}),t={},f((function(){throw 42}),null,a)}catch(e){e!==t&&(f=null)}else f=null;var d=/^\s*class\b/,r=function(e){try{var a=c.call(e);return d.test(a)}catch(e){return!1}},n=function(e){try{return!r(e)&&(c.call(e),!0)}catch(e){return!1}},i=Object.prototype.toString,b="function"==typeof Symbol&&!!Symbol.toStringTag,o=!(0 in[,]),s=function(){return!1};if("object"==typeof document){var l=document.all;i.call(l)===i.call(document.all)&&(s=function(e){if((o||!e)&&(void 0===e||"object"==typeof e))try{var a=i.call(e);return("[object HTMLAllCollection]"===a||"[object HTML document.all class]"===a||"[object HTMLCollection]"===a||"[object Object]"===a)&&null==e("")}catch(e){}return!1})}e.exports=f?function(e){if(s(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{f(e,null,a)}catch(e){if(e!==t)return!1}return!r(e)&&n(e)}:function(e){if(s(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(b)return n(e);if(r(e))return!1;var a=i.call(e);return!("[object Function]"!==a&&"[object GeneratorFunction]"!==a&&!/^\[object HTML/.test(a))&&n(e)}},48184:(e,a,t)=>{"use strict";var c,f=Object.prototype.toString,d=Function.prototype.toString,r=/^\s*(?:function)?\*/,n=t(49092)(),i=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(r.test(d.call(e)))return!0;if(!n)return"[object GeneratorFunction]"===f.call(e);if(!i)return!1;if(void 0===c){var a=function(){if(!n)return!1;try{return Function("return function*() {}")()}catch(e){}}();c=!!a&&i(a)}return i(e)===c}},13003:e=>{"use strict";e.exports=function(e){return e!=e}},24133:(e,a,t)=>{"use strict";var c=t(10487),f=t(38452),d=t(13003),r=t(76642),n=t(92464),i=c(r(),Number);f(i,{getPolyfill:r,implementation:d,shim:n}),e.exports=i},76642:(e,a,t)=>{"use strict";var c=t(13003);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:c}},92464:(e,a,t)=>{"use strict";var c=t(38452),f=t(76642);e.exports=function(){var e=f();return c(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},35680:(e,a,t)=>{"use strict";var c=t(25767);e.exports=function(e){return!!c(e)}},8127:function(e,a,t){var c=t(62045).hp;"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t.g&&t.g,e.exports=function(){"use strict";var e,a="3.7.7",t=a,f="function"==typeof c,d="function"==typeof TextDecoder?new TextDecoder:void 0,r="function"==typeof TextEncoder?new TextEncoder:void 0,n=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),i=(e={},n.forEach((function(a,t){return e[a]=t})),e),b=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,o=String.fromCharCode.bind(String),s="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):function(e){return new Uint8Array(Array.prototype.slice.call(e,0))},l=function(e){return e.replace(/=/g,"").replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"}))},u=function(e){return e.replace(/[^A-Za-z0-9\+\/]/g,"")},h=function(e){for(var a,t,c,f,d="",r=e.length%3,i=0;i255||(c=e.charCodeAt(i++))>255||(f=e.charCodeAt(i++))>255)throw new TypeError("invalid character found");d+=n[(a=t<<16|c<<8|f)>>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]}return r?d.slice(0,r-3)+"===".substring(r):d},p="function"==typeof btoa?function(e){return btoa(e)}:f?function(e){return c.from(e,"binary").toString("base64")}:h,g=f?function(e){return c.from(e).toString("base64")}:function(e){for(var a=[],t=0,c=e.length;t>>6)+o(128|63&a):o(224|a>>>12&15)+o(128|a>>>6&63)+o(128|63&a);var a=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return o(240|a>>>18&7)+o(128|a>>>12&63)+o(128|a>>>6&63)+o(128|63&a)},x=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,A=function(e){return e.replace(x,y)},v=f?function(e){return c.from(e,"utf8").toString("base64")}:r?function(e){return g(r.encode(e))}:function(e){return p(A(e))},w=function(e,a){return void 0===a&&(a=!1),a?l(v(e)):v(e)},_=function(e){return w(e,!0)},I=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,E=function(e){switch(e.length){case 4:var a=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return o(55296+(a>>>10))+o(56320+(1023&a));case 3:return o((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return o((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},C=function(e){return e.replace(I,E)},M=function(e){if(e=e.replace(/\s+/g,""),!b.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));for(var a,t,c,f="",d=0;d>16&255):64===c?o(a>>16&255,a>>8&255):o(a>>16&255,a>>8&255,255&a);return f},B="function"==typeof atob?function(e){return atob(u(e))}:f?function(e){return c.from(e,"base64").toString("binary")}:M,k=f?function(e){return s(c.from(e,"base64"))}:function(e){return s(B(e).split("").map((function(e){return e.charCodeAt(0)})))},L=function(e){return k(T(e))},S=f?function(e){return c.from(e,"base64").toString("utf8")}:d?function(e){return d.decode(k(e))}:function(e){return C(B(e))},T=function(e){return u(e.replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})))},N=function(e){return S(T(e))},R=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}},P=function(){var e=function(e,a){return Object.defineProperty(String.prototype,e,R(a))};e("fromBase64",(function(){return N(this)})),e("toBase64",(function(e){return w(this,e)})),e("toBase64URI",(function(){return w(this,!0)})),e("toBase64URL",(function(){return w(this,!0)})),e("toUint8Array",(function(){return L(this)}))},D=function(){var e=function(e,a){return Object.defineProperty(Uint8Array.prototype,e,R(a))};e("toBase64",(function(e){return m(this,e)})),e("toBase64URI",(function(){return m(this,!0)})),e("toBase64URL",(function(){return m(this,!0)}))},O={version:a,VERSION:t,atob:B,atobPolyfill:M,btoa:p,btoaPolyfill:h,fromBase64:N,toBase64:w,encode:w,encodeURI:_,encodeURL:_,utob:A,btou:C,decode:N,isValid:function(e){if("string"!=typeof e)return!1;var a=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(a)||!/[^\s0-9a-zA-Z\-_]/.test(a)},fromUint8Array:m,toUint8Array:L,extendString:P,extendUint8Array:D,extendBuiltins:function(){P(),D()},Base64:{}};return Object.keys(O).forEach((function(e){return O.Base64[e]=O[e]})),O}()},31176:(e,a,t)=>{var c;!function(){"use strict";var f="input is invalid type",d="object"==typeof window,r=d?window:{};r.JS_SHA3_NO_WINDOW&&(d=!1);var n=!d&&"object"==typeof self;!r.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?r=t.g:n&&(r=self);var i=!r.JS_SHA3_NO_COMMON_JS&&e.exports,b=t.amdO,o=!r.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,s="0123456789abcdef".split(""),l=[4,1024,262144,67108864],u=[0,8,16,24],h=[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],p=[224,256,384,512],g=[128,256],m=["hex","buffer","arrayBuffer","array","digest"],y={128:168,256:136};!r.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!o||!r.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var x=function(e,a,t){return function(c){return new R(e,a,e).update(c)[t]()}},A=function(e,a,t){return function(c,f){return new R(e,a,f).update(c)[t]()}},v=function(e,a,t){return function(a,c,f,d){return C["cshake"+e].update(a,c,f,d)[t]()}},w=function(e,a,t){return function(a,c,f,d){return C["kmac"+e].update(a,c,f,d)[t]()}},_=function(e,a,t,c){for(var f=0;f>5,this.byteCount=this.blockCount<<2,this.outputBlocks=t>>5,this.extraBytes=(31&t)>>3;for(var c=0;c<50;++c)this.s[c]=0}function P(e,a,t){R.call(this,e,a,t)}R.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var a,t=typeof e;if("string"!==t){if("object"!==t)throw new Error(f);if(null===e)throw new Error(f);if(o&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||o&&ArrayBuffer.isView(e)))throw new Error(f);a=!0}for(var c,d,r=this.blocks,n=this.byteCount,i=e.length,b=this.blockCount,s=0,l=this.s;s>2]|=e[s]<>2]|=d<>2]|=(192|d>>6)<>2]|=(128|63&d)<=57344?(r[c>>2]|=(224|d>>12)<>2]|=(128|d>>6&63)<>2]|=(128|63&d)<>2]|=(240|d>>18)<>2]|=(128|d>>12&63)<>2]|=(128|d>>6&63)<>2]|=(128|63&d)<=n){for(this.start=c-n,this.block=r[b],c=0;c>=8);t>0;)f.unshift(t),t=255&(e>>=8),++c;return a?f.push(c):f.unshift(c),this.update(f),f.length},R.prototype.encodeString=function(e){var a,t=typeof e;if("string"!==t){if("object"!==t)throw new Error(f);if(null===e)throw new Error(f);if(o&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||o&&ArrayBuffer.isView(e)))throw new Error(f);a=!0}var c=0,d=e.length;if(a)c=d;else for(var r=0;r=57344?c+=3:(n=65536+((1023&n)<<10|1023&e.charCodeAt(++r)),c+=4)}return c+=this.encode(8*c),this.update(e),c},R.prototype.bytepad=function(e,a){for(var t=this.encode(a),c=0;c>2]|=this.padding[3&a],this.lastByteIndex===this.byteCount)for(e[0]=e[t],a=1;a>4&15]+s[15&e]+s[e>>12&15]+s[e>>8&15]+s[e>>20&15]+s[e>>16&15]+s[e>>28&15]+s[e>>24&15];r%a==0&&(D(t),d=0)}return f&&(e=t[d],n+=s[e>>4&15]+s[15&e],f>1&&(n+=s[e>>12&15]+s[e>>8&15]),f>2&&(n+=s[e>>20&15]+s[e>>16&15])),n},R.prototype.arrayBuffer=function(){this.finalize();var e,a=this.blockCount,t=this.s,c=this.outputBlocks,f=this.extraBytes,d=0,r=0,n=this.outputBits>>3;e=f?new ArrayBuffer(c+1<<2):new ArrayBuffer(n);for(var i=new Uint32Array(e);r>8&255,i[e+2]=a>>16&255,i[e+3]=a>>24&255;n%t==0&&D(c)}return d&&(e=n<<2,a=c[r],i[e]=255&a,d>1&&(i[e+1]=a>>8&255),d>2&&(i[e+2]=a>>16&255)),i},P.prototype=new R,P.prototype.finalize=function(){return this.encode(this.outputBits,!0),R.prototype.finalize.call(this)};var D=function(e){var a,t,c,f,d,r,n,i,b,o,s,l,u,p,g,m,y,x,A,v,w,_,I,E,C,M,B,k,L,S,T,N,R,P,D,O,F,Q,U,j,H,$,q,z,G,K,V,Z,J,W,Y,X,ee,ae,te,ce,fe,de,re,ne,ie,be,oe;for(c=0;c<48;c+=2)f=e[0]^e[10]^e[20]^e[30]^e[40],d=e[1]^e[11]^e[21]^e[31]^e[41],r=e[2]^e[12]^e[22]^e[32]^e[42],n=e[3]^e[13]^e[23]^e[33]^e[43],i=e[4]^e[14]^e[24]^e[34]^e[44],b=e[5]^e[15]^e[25]^e[35]^e[45],o=e[6]^e[16]^e[26]^e[36]^e[46],s=e[7]^e[17]^e[27]^e[37]^e[47],a=(l=e[8]^e[18]^e[28]^e[38]^e[48])^(r<<1|n>>>31),t=(u=e[9]^e[19]^e[29]^e[39]^e[49])^(n<<1|r>>>31),e[0]^=a,e[1]^=t,e[10]^=a,e[11]^=t,e[20]^=a,e[21]^=t,e[30]^=a,e[31]^=t,e[40]^=a,e[41]^=t,a=f^(i<<1|b>>>31),t=d^(b<<1|i>>>31),e[2]^=a,e[3]^=t,e[12]^=a,e[13]^=t,e[22]^=a,e[23]^=t,e[32]^=a,e[33]^=t,e[42]^=a,e[43]^=t,a=r^(o<<1|s>>>31),t=n^(s<<1|o>>>31),e[4]^=a,e[5]^=t,e[14]^=a,e[15]^=t,e[24]^=a,e[25]^=t,e[34]^=a,e[35]^=t,e[44]^=a,e[45]^=t,a=i^(l<<1|u>>>31),t=b^(u<<1|l>>>31),e[6]^=a,e[7]^=t,e[16]^=a,e[17]^=t,e[26]^=a,e[27]^=t,e[36]^=a,e[37]^=t,e[46]^=a,e[47]^=t,a=o^(f<<1|d>>>31),t=s^(d<<1|f>>>31),e[8]^=a,e[9]^=t,e[18]^=a,e[19]^=t,e[28]^=a,e[29]^=t,e[38]^=a,e[39]^=t,e[48]^=a,e[49]^=t,p=e[0],g=e[1],K=e[11]<<4|e[10]>>>28,V=e[10]<<4|e[11]>>>28,k=e[20]<<3|e[21]>>>29,L=e[21]<<3|e[20]>>>29,ne=e[31]<<9|e[30]>>>23,ie=e[30]<<9|e[31]>>>23,$=e[40]<<18|e[41]>>>14,q=e[41]<<18|e[40]>>>14,P=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,m=e[13]<<12|e[12]>>>20,y=e[12]<<12|e[13]>>>20,Z=e[22]<<10|e[23]>>>22,J=e[23]<<10|e[22]>>>22,S=e[33]<<13|e[32]>>>19,T=e[32]<<13|e[33]>>>19,be=e[42]<<2|e[43]>>>30,oe=e[43]<<2|e[42]>>>30,ae=e[5]<<30|e[4]>>>2,te=e[4]<<30|e[5]>>>2,O=e[14]<<6|e[15]>>>26,F=e[15]<<6|e[14]>>>26,x=e[25]<<11|e[24]>>>21,A=e[24]<<11|e[25]>>>21,W=e[34]<<15|e[35]>>>17,Y=e[35]<<15|e[34]>>>17,N=e[45]<<29|e[44]>>>3,R=e[44]<<29|e[45]>>>3,E=e[6]<<28|e[7]>>>4,C=e[7]<<28|e[6]>>>4,ce=e[17]<<23|e[16]>>>9,fe=e[16]<<23|e[17]>>>9,Q=e[26]<<25|e[27]>>>7,U=e[27]<<25|e[26]>>>7,v=e[36]<<21|e[37]>>>11,w=e[37]<<21|e[36]>>>11,X=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,z=e[8]<<27|e[9]>>>5,G=e[9]<<27|e[8]>>>5,M=e[18]<<20|e[19]>>>12,B=e[19]<<20|e[18]>>>12,de=e[29]<<7|e[28]>>>25,re=e[28]<<7|e[29]>>>25,j=e[38]<<8|e[39]>>>24,H=e[39]<<8|e[38]>>>24,_=e[48]<<14|e[49]>>>18,I=e[49]<<14|e[48]>>>18,e[0]=p^~m&x,e[1]=g^~y&A,e[10]=E^~M&k,e[11]=C^~B&L,e[20]=P^~O&Q,e[21]=D^~F&U,e[30]=z^~K&Z,e[31]=G^~V&J,e[40]=ae^~ce&de,e[41]=te^~fe&re,e[2]=m^~x&v,e[3]=y^~A&w,e[12]=M^~k&S,e[13]=B^~L&T,e[22]=O^~Q&j,e[23]=F^~U&H,e[32]=K^~Z&W,e[33]=V^~J&Y,e[42]=ce^~de&ne,e[43]=fe^~re&ie,e[4]=x^~v&_,e[5]=A^~w&I,e[14]=k^~S&N,e[15]=L^~T&R,e[24]=Q^~j&$,e[25]=U^~H&q,e[34]=Z^~W&X,e[35]=J^~Y&ee,e[44]=de^~ne&be,e[45]=re^~ie&oe,e[6]=v^~_&p,e[7]=w^~I&g,e[16]=S^~N&E,e[17]=T^~R&C,e[26]=j^~$&P,e[27]=H^~q&D,e[36]=W^~X&z,e[37]=Y^~ee&G,e[46]=ne^~be&ae,e[47]=ie^~oe&te,e[8]=_^~p&m,e[9]=I^~g&y,e[18]=N^~E&M,e[19]=R^~C&B,e[28]=$^~P&O,e[29]=q^~D&F,e[38]=X^~z&K,e[39]=ee^~G&V,e[48]=be^~ae&ce,e[49]=oe^~te&fe,e[0]^=h[c],e[1]^=h[c+1]};if(i)e.exports=C;else{for(B=0;B{"use strict";var a=e.exports=function(e,a,c){"function"==typeof a&&(c=a,a={}),t(a,"function"==typeof(c=a.cb||c)?c:c.pre||function(){},c.post||function(){},e,"",e)};function t(e,c,f,d,r,n,i,b,o,s){if(d&&"object"==typeof d&&!Array.isArray(d)){for(var l in c(d,r,n,i,b,o,s),d){var u=d[l];if(Array.isArray(u)){if(l in a.arrayKeywords)for(var h=0;h{"use strict";var c=t(56698),f=t(73726),d=t(92861).Buffer,r=new Array(16);function n(){f.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function i(e,a){return e<>>32-a}function b(e,a,t,c,f,d,r){return i(e+(a&t|~a&c)+f+d|0,r)+a|0}function o(e,a,t,c,f,d,r){return i(e+(a&c|t&~c)+f+d|0,r)+a|0}function s(e,a,t,c,f,d,r){return i(e+(a^t^c)+f+d|0,r)+a|0}function l(e,a,t,c,f,d,r){return i(e+(t^(a|~c))+f+d|0,r)+a|0}c(n,f),n.prototype._update=function(){for(var e=r,a=0;a<16;++a)e[a]=this._block.readInt32LE(4*a);var t=this._a,c=this._b,f=this._c,d=this._d;t=b(t,c,f,d,e[0],3614090360,7),d=b(d,t,c,f,e[1],3905402710,12),f=b(f,d,t,c,e[2],606105819,17),c=b(c,f,d,t,e[3],3250441966,22),t=b(t,c,f,d,e[4],4118548399,7),d=b(d,t,c,f,e[5],1200080426,12),f=b(f,d,t,c,e[6],2821735955,17),c=b(c,f,d,t,e[7],4249261313,22),t=b(t,c,f,d,e[8],1770035416,7),d=b(d,t,c,f,e[9],2336552879,12),f=b(f,d,t,c,e[10],4294925233,17),c=b(c,f,d,t,e[11],2304563134,22),t=b(t,c,f,d,e[12],1804603682,7),d=b(d,t,c,f,e[13],4254626195,12),f=b(f,d,t,c,e[14],2792965006,17),t=o(t,c=b(c,f,d,t,e[15],1236535329,22),f,d,e[1],4129170786,5),d=o(d,t,c,f,e[6],3225465664,9),f=o(f,d,t,c,e[11],643717713,14),c=o(c,f,d,t,e[0],3921069994,20),t=o(t,c,f,d,e[5],3593408605,5),d=o(d,t,c,f,e[10],38016083,9),f=o(f,d,t,c,e[15],3634488961,14),c=o(c,f,d,t,e[4],3889429448,20),t=o(t,c,f,d,e[9],568446438,5),d=o(d,t,c,f,e[14],3275163606,9),f=o(f,d,t,c,e[3],4107603335,14),c=o(c,f,d,t,e[8],1163531501,20),t=o(t,c,f,d,e[13],2850285829,5),d=o(d,t,c,f,e[2],4243563512,9),f=o(f,d,t,c,e[7],1735328473,14),t=s(t,c=o(c,f,d,t,e[12],2368359562,20),f,d,e[5],4294588738,4),d=s(d,t,c,f,e[8],2272392833,11),f=s(f,d,t,c,e[11],1839030562,16),c=s(c,f,d,t,e[14],4259657740,23),t=s(t,c,f,d,e[1],2763975236,4),d=s(d,t,c,f,e[4],1272893353,11),f=s(f,d,t,c,e[7],4139469664,16),c=s(c,f,d,t,e[10],3200236656,23),t=s(t,c,f,d,e[13],681279174,4),d=s(d,t,c,f,e[0],3936430074,11),f=s(f,d,t,c,e[3],3572445317,16),c=s(c,f,d,t,e[6],76029189,23),t=s(t,c,f,d,e[9],3654602809,4),d=s(d,t,c,f,e[12],3873151461,11),f=s(f,d,t,c,e[15],530742520,16),t=l(t,c=s(c,f,d,t,e[2],3299628645,23),f,d,e[0],4096336452,6),d=l(d,t,c,f,e[7],1126891415,10),f=l(f,d,t,c,e[14],2878612391,15),c=l(c,f,d,t,e[5],4237533241,21),t=l(t,c,f,d,e[12],1700485571,6),d=l(d,t,c,f,e[3],2399980690,10),f=l(f,d,t,c,e[10],4293915773,15),c=l(c,f,d,t,e[1],2240044497,21),t=l(t,c,f,d,e[8],1873313359,6),d=l(d,t,c,f,e[15],4264355552,10),f=l(f,d,t,c,e[6],2734768916,15),c=l(c,f,d,t,e[13],1309151649,21),t=l(t,c,f,d,e[4],4149444226,6),d=l(d,t,c,f,e[11],3174756917,10),f=l(f,d,t,c,e[2],718787259,15),c=l(c,f,d,t,e[9],3951481745,21),this._a=this._a+t|0,this._b=this._b+c|0,this._c=this._c+f|0,this._d=this._d+d|0},n.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=d.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=n},73726:(e,a,t)=>{"use strict";var c=t(92861).Buffer,f=t(28399).Transform;function d(e){f.call(this),this._block=c.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}t(56698)(d,f),d.prototype._transform=function(e,a,t){var c=null;try{this.update(e,a)}catch(e){c=e}t(c)},d.prototype._flush=function(e){var a=null;try{this.push(this.digest())}catch(e){a=e}e(a)},d.prototype.update=function(e,a){if(function(e){if(!c.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer")}(e),this._finalized)throw new Error("Digest already called");c.isBuffer(e)||(e=c.from(e,a));for(var t=this._block,f=0;this._blockOffset+e.length-f>=this._blockSize;){for(var d=this._blockOffset;d0;++r)this._length[r]+=n,(n=this._length[r]/4294967296|0)>0&&(this._length[r]-=4294967296*n);return this},d.prototype._update=function(){throw new Error("_update is not implemented")},d.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var a=this._digest();void 0!==e&&(a=a.toString(e)),this._block.fill(0),this._blockOffset=0;for(var t=0;t<4;++t)this._length[t]=0;return a},d.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=d},6215:(e,a,t)=>{"use strict";var c=t(62045).hp;Object.defineProperty(a,"__esModule",{value:!0}),a.InvalidStatusCodeError=a.InvalidCertError=void 0;const f=Object.freeze({redirect:!0,expectStatusCode:200,headers:{},full:!1,keepAlive:!0,cors:!1,referrer:!1,sslAllowSelfSigned:!1,_redirectCount:0});class d extends Error{constructor(e,a){super(e),this.fingerprint256=a}}a.InvalidCertError=d;class r extends Error{constructor(e){super(`Request Failed. Status Code: ${e}`),this.statusCode=e}}function n(e,a){if(!a||"text"===a||"json"===a)try{let t=new TextDecoder("utf8",{fatal:!0}).decode(e);if("text"===a)return t;try{return JSON.parse(t)}catch(e){if("json"===a)throw e;return t}}catch(e){if("text"===a||"json"===a)throw e}return e}a.InvalidStatusCodeError=r;let i={};function b(e,a){let o={...f,...a};const s=t(11568),l=t(11083),u=t(78559),{promisify:h}=t(40537),{resolve:p}=t(59676),g=!!/^https/.test(e);let m={method:o.method||"GET",headers:{"Accept-Encoding":"gzip, deflate, br"}};const y=e=>e.replace(/:| /g,"").toLowerCase();if(o.keepAlive){const e={keepAlive:!0,keepAliveMsecs:3e4,maxFreeSockets:1024,maxCachedSessions:1024},a=[g,g&&o.sslPinnedCertificates?.map((e=>y(e))).sort()].join();m.agent=i[a]||(i[a]=new(g?l:s).Agent(e))}return"json"===o.type&&(m.headers["Content-Type"]="application/json"),o.data&&(o.method||(m.method="POST"),m.body="json"===o.type?JSON.stringify(o.data):o.data),m.headers={...m.headers,...o.headers},o.sslAllowSelfSigned&&(m.rejectUnauthorized=!1),new Promise(((a,t)=>{const f=async a=>{if(a&&"DEPTH_ZERO_SELF_SIGNED_CERT"===a.code)try{await b(e,{...o,sslAllowSelfSigned:!0,sslPinnedCertificates:[]})}catch(e){e&&e.fingerprint256&&(a=new d(`Self-signed SSL certificate: ${e.fingerprint256}`,e.fingerprint256))}t(a)},i=(g?l:s).request(e,m,(d=>{d.on("error",f),(async()=>{try{a(await(async a=>{const t=a.statusCode;if(o.redirect&&300<=t&&t<400&&a.headers.location){if(10==o._redirectCount)throw new Error("Request failed. Too much redirects.");return o._redirectCount+=1,await b(p(e,a.headers.location),o)}if(o.expectStatusCode&&t!==o.expectStatusCode)throw a.resume(),new r(t);let f=[];for await(const e of a)f.push(e);let d=c.concat(f);const i=a.headers["content-encoding"];"br"===i&&(d=await h(u.brotliDecompress)(d)),"gzip"!==i&&"deflate"!==i||(d=await h(u.unzip)(d));const s=n(d,o.type);return o.full?{headers:a.headers,status:t,body:s}:s})(d))}catch(e){t(e)}})()}));i.on("error",f);const x=o.sslPinnedCertificates?.map((e=>y(e))),A=e=>{const a=y(e.getPeerCertificate()?.fingerprint256||"");if((a||!e.isSessionReused())&&!x.includes(a))return i.emit("error",new d(`Invalid SSL certificate: ${a} Expected: ${x}`,a)),i.abort()};o.sslPinnedCertificates&&i.on("socket",(e=>{e.listeners("secureConnect").map((e=>(e.name||"").replace("bound ",""))).includes("mfetchSecureConnect")||e.on("secureConnect",A.bind(null,e))})),o.keepAlive&&i.setNoDelay(!0),m.body&&i.write(m.body),i.end()}))}const o=new Set(["Accept","Accept-Language","Content-Language","Content-Type"].map((e=>e.toLowerCase()))),s=new Set(["Accept-Charset","Accept-Encoding","Access-Control-Request-Headers","Access-Control-Request-Method","Connection","Content-Length","Cookie","Cookie2","Date","DNT","Expect","Host","Keep-Alive","Origin","Referer","TE","Trailer","Transfer-Encoding","Upgrade","Via"].map((e=>e.toLowerCase())));async function l(e,a){let t={...f,...a};const c=new Headers;"json"===t.type&&c.set("Content-Type","application/json");let d=new URL(e);if(d.username){const e=btoa(`${d.username}:${d.password}`);c.set("Authorization",`Basic ${e}`),d.username="",d.password=""}e=""+d;for(let e in t.headers){const a=e.toLowerCase();(o.has(a)||t.cors&&!s.has(a))&&c.set(e,t.headers[e])}let i={headers:c,redirect:t.redirect?"follow":"manual"};t.referrer||(i.referrerPolicy="no-referrer"),t.cors&&(i.mode="cors"),t.data&&(t.method||(i.method="POST"),i.body="json"===t.type?JSON.stringify(t.data):t.data);const b=await fetch(e,i);if(t.expectStatusCode&&b.status!==t.expectStatusCode)throw new r(b.status);const l=n(new Uint8Array(await b.arrayBuffer()),t.type);return t.full?{headers:Object.fromEntries(b.headers.entries()),status:b.status,body:l}:l}const u=!!("object"==typeof process&&process.versions&&process.versions.node&&process.versions.v8);a.default=function(e,a){return(u?b:l)(e,a)}},52244:(e,a,t)=>{var c=t(61158),f=t(15037);function d(e){this.rand=e||new f.Rand}e.exports=d,d.create=function(e){return new d(e)},d.prototype._randbelow=function(e){var a=e.bitLength(),t=Math.ceil(a/8);do{var f=new c(this.rand.generate(t))}while(f.cmp(e)>=0);return f},d.prototype._randrange=function(e,a){var t=a.sub(e);return e.add(this._randbelow(t))},d.prototype.test=function(e,a,t){var f=e.bitLength(),d=c.mont(e),r=new c(1).toRed(d);a||(a=Math.max(1,f/48|0));for(var n=e.subn(1),i=0;!n.testn(i);i++);for(var b=e.shrn(i),o=n.toRed(d);a>0;a--){var s=this._randrange(new c(2),n);t&&t(s);var l=s.toRed(d).redPow(b);if(0!==l.cmp(r)&&0!==l.cmp(o)){for(var u=1;u0;a--){var o=this._randrange(new c(2),r),s=e.gcd(o);if(0!==s.cmpn(1))return s;var l=o.toRed(f).redPow(i);if(0!==l.cmp(d)&&0!==l.cmp(b)){for(var u=1;u=65&&t<=70?t-55:t>=97&&t<=102?t-87:t-48&15}function i(e,a,t){var c=n(e,t);return t-1>=a&&(c|=n(e,t-1)<<4),c}function b(e,a,t,c){for(var f=0,d=Math.min(e.length,t),r=a;r=49?n-49+10:n>=17?n-17+10:n}return f}d.isBN=function(e){return e instanceof d||null!==e&&"object"==typeof e&&e.constructor.wordSize===d.wordSize&&Array.isArray(e.words)},d.max=function(e,a){return e.cmp(a)>0?e:a},d.min=function(e,a){return e.cmp(a)<0?e:a},d.prototype._init=function(e,a,t){if("number"==typeof e)return this._initNumber(e,a,t);if("object"==typeof e)return this._initArray(e,a,t);"hex"===a&&(a=16),c(a===(0|a)&&a>=2&&a<=36);var f=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(f++,this.negative=1),f=0;f-=3)r=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[d]|=r<>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);else if("le"===t)for(f=0,d=0;f>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);return this.strip()},d.prototype._parseHex=function(e,a,t){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)f=i(e,a,c)<=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;else for(c=(e.length-a)%2==0?a+1:a;c=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;this.strip()},d.prototype._parseBase=function(e,a,t){this.words=[0],this.length=1;for(var c=0,f=1;f<=67108863;f*=a)c++;c--,f=f/a|0;for(var d=e.length-t,r=d%c,n=Math.min(d,d-r)+t,i=0,o=t;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},d.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},d.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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],l=[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 u(e,a,t){t.negative=a.negative^e.negative;var c=e.length+a.length|0;t.length=c,c=c-1|0;var f=0|e.words[0],d=0|a.words[0],r=f*d,n=67108863&r,i=r/67108864|0;t.words[0]=n;for(var b=1;b>>26,s=67108863&i,l=Math.min(b,a.length-1),u=Math.max(0,b-e.length+1);u<=l;u++){var h=b-u|0;o+=(r=(f=0|e.words[h])*(d=0|a.words[u])+s)/67108864|0,s=67108863&r}t.words[b]=0|s,i=0|o}return 0!==i?t.words[b]=0|i:t.length--,t.strip()}d.prototype.toString=function(e,a){var t;if(a=0|a||1,16===(e=e||10)||"hex"===e){t="";for(var f=0,d=0,r=0;r>>24-f&16777215)||r!==this.length-1?o[6-i.length]+i+t:i+t,(f+=2)>=26&&(f-=26,r--)}for(0!==d&&(t=d.toString(16)+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(e===(0|e)&&e>=2&&e<=36){var b=s[e],u=l[e];t="";var h=this.clone();for(h.negative=0;!h.isZero();){var p=h.modn(u).toString(e);t=(h=h.idivn(u)).isZero()?p+t:o[b-p.length]+p+t}for(this.isZero()&&(t="0"+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}c(!1,"Base should be between 2 and 36")},d.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&c(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},d.prototype.toJSON=function(){return this.toString(16)},d.prototype.toBuffer=function(e,a){return c(void 0!==r),this.toArrayLike(r,e,a)},d.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},d.prototype.toArrayLike=function(e,a,t){var f=this.byteLength(),d=t||Math.max(1,f);c(f<=d,"byte array longer than desired length"),c(d>0,"Requested array length <= 0"),this.strip();var r,n,i="le"===a,b=new e(d),o=this.clone();if(i){for(n=0;!o.isZero();n++)r=o.andln(255),o.iushrn(8),b[n]=r;for(;n=4096&&(t+=13,a>>>=13),a>=64&&(t+=7,a>>>=7),a>=8&&(t+=4,a>>>=4),a>=2&&(t+=2,a>>>=2),t+a},d.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,t=0;return 8191&a||(t+=13,a>>>=13),127&a||(t+=7,a>>>=7),15&a||(t+=4,a>>>=4),3&a||(t+=2,a>>>=2),1&a||t++,t},d.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},d.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},d.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},d.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var t=0;te.length?this.clone().iand(e):e.clone().iand(this)},d.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},d.prototype.iuxor=function(e){var a,t;this.length>e.length?(a=this,t=e):(a=e,t=this);for(var c=0;ce.length?this.clone().ixor(e):e.clone().ixor(this)},d.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},d.prototype.inotn=function(e){c("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),t=e%26;this._expand(a),t>0&&a--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-t),this.strip()},d.prototype.notn=function(e){return this.clone().inotn(e)},d.prototype.setn=function(e,a){c("number"==typeof e&&e>=0);var t=e/26|0,f=e%26;return this._expand(t+1),this.words[t]=a?this.words[t]|1<e.length?(t=this,c=e):(t=e,c=this);for(var f=0,d=0;d>>26;for(;0!==f&&d>>26;if(this.length=t.length,0!==f)this.words[this.length]=f,this.length++;else if(t!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},d.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var t,c,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(t=this,c=e):(t=e,c=this);for(var d=0,r=0;r>26,this.words[r]=67108863&a;for(;0!==d&&r>26,this.words[r]=67108863&a;if(0===d&&r>>13,u=0|r[1],h=8191&u,p=u>>>13,g=0|r[2],m=8191&g,y=g>>>13,x=0|r[3],A=8191&x,v=x>>>13,w=0|r[4],_=8191&w,I=w>>>13,E=0|r[5],C=8191&E,M=E>>>13,B=0|r[6],k=8191&B,L=B>>>13,S=0|r[7],T=8191&S,N=S>>>13,R=0|r[8],P=8191&R,D=R>>>13,O=0|r[9],F=8191&O,Q=O>>>13,U=0|n[0],j=8191&U,H=U>>>13,$=0|n[1],q=8191&$,z=$>>>13,G=0|n[2],K=8191&G,V=G>>>13,Z=0|n[3],J=8191&Z,W=Z>>>13,Y=0|n[4],X=8191&Y,ee=Y>>>13,ae=0|n[5],te=8191&ae,ce=ae>>>13,fe=0|n[6],de=8191&fe,re=fe>>>13,ne=0|n[7],ie=8191&ne,be=ne>>>13,oe=0|n[8],se=8191&oe,le=oe>>>13,ue=0|n[9],he=8191&ue,pe=ue>>>13;t.negative=e.negative^a.negative,t.length=19;var ge=(b+(c=Math.imul(s,j))|0)+((8191&(f=(f=Math.imul(s,H))+Math.imul(l,j)|0))<<13)|0;b=((d=Math.imul(l,H))+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,c=Math.imul(h,j),f=(f=Math.imul(h,H))+Math.imul(p,j)|0,d=Math.imul(p,H);var me=(b+(c=c+Math.imul(s,q)|0)|0)+((8191&(f=(f=f+Math.imul(s,z)|0)+Math.imul(l,q)|0))<<13)|0;b=((d=d+Math.imul(l,z)|0)+(f>>>13)|0)+(me>>>26)|0,me&=67108863,c=Math.imul(m,j),f=(f=Math.imul(m,H))+Math.imul(y,j)|0,d=Math.imul(y,H),c=c+Math.imul(h,q)|0,f=(f=f+Math.imul(h,z)|0)+Math.imul(p,q)|0,d=d+Math.imul(p,z)|0;var ye=(b+(c=c+Math.imul(s,K)|0)|0)+((8191&(f=(f=f+Math.imul(s,V)|0)+Math.imul(l,K)|0))<<13)|0;b=((d=d+Math.imul(l,V)|0)+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,c=Math.imul(A,j),f=(f=Math.imul(A,H))+Math.imul(v,j)|0,d=Math.imul(v,H),c=c+Math.imul(m,q)|0,f=(f=f+Math.imul(m,z)|0)+Math.imul(y,q)|0,d=d+Math.imul(y,z)|0,c=c+Math.imul(h,K)|0,f=(f=f+Math.imul(h,V)|0)+Math.imul(p,K)|0,d=d+Math.imul(p,V)|0;var xe=(b+(c=c+Math.imul(s,J)|0)|0)+((8191&(f=(f=f+Math.imul(s,W)|0)+Math.imul(l,J)|0))<<13)|0;b=((d=d+Math.imul(l,W)|0)+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,c=Math.imul(_,j),f=(f=Math.imul(_,H))+Math.imul(I,j)|0,d=Math.imul(I,H),c=c+Math.imul(A,q)|0,f=(f=f+Math.imul(A,z)|0)+Math.imul(v,q)|0,d=d+Math.imul(v,z)|0,c=c+Math.imul(m,K)|0,f=(f=f+Math.imul(m,V)|0)+Math.imul(y,K)|0,d=d+Math.imul(y,V)|0,c=c+Math.imul(h,J)|0,f=(f=f+Math.imul(h,W)|0)+Math.imul(p,J)|0,d=d+Math.imul(p,W)|0;var Ae=(b+(c=c+Math.imul(s,X)|0)|0)+((8191&(f=(f=f+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;b=((d=d+Math.imul(l,ee)|0)+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,c=Math.imul(C,j),f=(f=Math.imul(C,H))+Math.imul(M,j)|0,d=Math.imul(M,H),c=c+Math.imul(_,q)|0,f=(f=f+Math.imul(_,z)|0)+Math.imul(I,q)|0,d=d+Math.imul(I,z)|0,c=c+Math.imul(A,K)|0,f=(f=f+Math.imul(A,V)|0)+Math.imul(v,K)|0,d=d+Math.imul(v,V)|0,c=c+Math.imul(m,J)|0,f=(f=f+Math.imul(m,W)|0)+Math.imul(y,J)|0,d=d+Math.imul(y,W)|0,c=c+Math.imul(h,X)|0,f=(f=f+Math.imul(h,ee)|0)+Math.imul(p,X)|0,d=d+Math.imul(p,ee)|0;var ve=(b+(c=c+Math.imul(s,te)|0)|0)+((8191&(f=(f=f+Math.imul(s,ce)|0)+Math.imul(l,te)|0))<<13)|0;b=((d=d+Math.imul(l,ce)|0)+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,c=Math.imul(k,j),f=(f=Math.imul(k,H))+Math.imul(L,j)|0,d=Math.imul(L,H),c=c+Math.imul(C,q)|0,f=(f=f+Math.imul(C,z)|0)+Math.imul(M,q)|0,d=d+Math.imul(M,z)|0,c=c+Math.imul(_,K)|0,f=(f=f+Math.imul(_,V)|0)+Math.imul(I,K)|0,d=d+Math.imul(I,V)|0,c=c+Math.imul(A,J)|0,f=(f=f+Math.imul(A,W)|0)+Math.imul(v,J)|0,d=d+Math.imul(v,W)|0,c=c+Math.imul(m,X)|0,f=(f=f+Math.imul(m,ee)|0)+Math.imul(y,X)|0,d=d+Math.imul(y,ee)|0,c=c+Math.imul(h,te)|0,f=(f=f+Math.imul(h,ce)|0)+Math.imul(p,te)|0,d=d+Math.imul(p,ce)|0;var we=(b+(c=c+Math.imul(s,de)|0)|0)+((8191&(f=(f=f+Math.imul(s,re)|0)+Math.imul(l,de)|0))<<13)|0;b=((d=d+Math.imul(l,re)|0)+(f>>>13)|0)+(we>>>26)|0,we&=67108863,c=Math.imul(T,j),f=(f=Math.imul(T,H))+Math.imul(N,j)|0,d=Math.imul(N,H),c=c+Math.imul(k,q)|0,f=(f=f+Math.imul(k,z)|0)+Math.imul(L,q)|0,d=d+Math.imul(L,z)|0,c=c+Math.imul(C,K)|0,f=(f=f+Math.imul(C,V)|0)+Math.imul(M,K)|0,d=d+Math.imul(M,V)|0,c=c+Math.imul(_,J)|0,f=(f=f+Math.imul(_,W)|0)+Math.imul(I,J)|0,d=d+Math.imul(I,W)|0,c=c+Math.imul(A,X)|0,f=(f=f+Math.imul(A,ee)|0)+Math.imul(v,X)|0,d=d+Math.imul(v,ee)|0,c=c+Math.imul(m,te)|0,f=(f=f+Math.imul(m,ce)|0)+Math.imul(y,te)|0,d=d+Math.imul(y,ce)|0,c=c+Math.imul(h,de)|0,f=(f=f+Math.imul(h,re)|0)+Math.imul(p,de)|0,d=d+Math.imul(p,re)|0;var _e=(b+(c=c+Math.imul(s,ie)|0)|0)+((8191&(f=(f=f+Math.imul(s,be)|0)+Math.imul(l,ie)|0))<<13)|0;b=((d=d+Math.imul(l,be)|0)+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,c=Math.imul(P,j),f=(f=Math.imul(P,H))+Math.imul(D,j)|0,d=Math.imul(D,H),c=c+Math.imul(T,q)|0,f=(f=f+Math.imul(T,z)|0)+Math.imul(N,q)|0,d=d+Math.imul(N,z)|0,c=c+Math.imul(k,K)|0,f=(f=f+Math.imul(k,V)|0)+Math.imul(L,K)|0,d=d+Math.imul(L,V)|0,c=c+Math.imul(C,J)|0,f=(f=f+Math.imul(C,W)|0)+Math.imul(M,J)|0,d=d+Math.imul(M,W)|0,c=c+Math.imul(_,X)|0,f=(f=f+Math.imul(_,ee)|0)+Math.imul(I,X)|0,d=d+Math.imul(I,ee)|0,c=c+Math.imul(A,te)|0,f=(f=f+Math.imul(A,ce)|0)+Math.imul(v,te)|0,d=d+Math.imul(v,ce)|0,c=c+Math.imul(m,de)|0,f=(f=f+Math.imul(m,re)|0)+Math.imul(y,de)|0,d=d+Math.imul(y,re)|0,c=c+Math.imul(h,ie)|0,f=(f=f+Math.imul(h,be)|0)+Math.imul(p,ie)|0,d=d+Math.imul(p,be)|0;var Ie=(b+(c=c+Math.imul(s,se)|0)|0)+((8191&(f=(f=f+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;b=((d=d+Math.imul(l,le)|0)+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,c=Math.imul(F,j),f=(f=Math.imul(F,H))+Math.imul(Q,j)|0,d=Math.imul(Q,H),c=c+Math.imul(P,q)|0,f=(f=f+Math.imul(P,z)|0)+Math.imul(D,q)|0,d=d+Math.imul(D,z)|0,c=c+Math.imul(T,K)|0,f=(f=f+Math.imul(T,V)|0)+Math.imul(N,K)|0,d=d+Math.imul(N,V)|0,c=c+Math.imul(k,J)|0,f=(f=f+Math.imul(k,W)|0)+Math.imul(L,J)|0,d=d+Math.imul(L,W)|0,c=c+Math.imul(C,X)|0,f=(f=f+Math.imul(C,ee)|0)+Math.imul(M,X)|0,d=d+Math.imul(M,ee)|0,c=c+Math.imul(_,te)|0,f=(f=f+Math.imul(_,ce)|0)+Math.imul(I,te)|0,d=d+Math.imul(I,ce)|0,c=c+Math.imul(A,de)|0,f=(f=f+Math.imul(A,re)|0)+Math.imul(v,de)|0,d=d+Math.imul(v,re)|0,c=c+Math.imul(m,ie)|0,f=(f=f+Math.imul(m,be)|0)+Math.imul(y,ie)|0,d=d+Math.imul(y,be)|0,c=c+Math.imul(h,se)|0,f=(f=f+Math.imul(h,le)|0)+Math.imul(p,se)|0,d=d+Math.imul(p,le)|0;var Ee=(b+(c=c+Math.imul(s,he)|0)|0)+((8191&(f=(f=f+Math.imul(s,pe)|0)+Math.imul(l,he)|0))<<13)|0;b=((d=d+Math.imul(l,pe)|0)+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,c=Math.imul(F,q),f=(f=Math.imul(F,z))+Math.imul(Q,q)|0,d=Math.imul(Q,z),c=c+Math.imul(P,K)|0,f=(f=f+Math.imul(P,V)|0)+Math.imul(D,K)|0,d=d+Math.imul(D,V)|0,c=c+Math.imul(T,J)|0,f=(f=f+Math.imul(T,W)|0)+Math.imul(N,J)|0,d=d+Math.imul(N,W)|0,c=c+Math.imul(k,X)|0,f=(f=f+Math.imul(k,ee)|0)+Math.imul(L,X)|0,d=d+Math.imul(L,ee)|0,c=c+Math.imul(C,te)|0,f=(f=f+Math.imul(C,ce)|0)+Math.imul(M,te)|0,d=d+Math.imul(M,ce)|0,c=c+Math.imul(_,de)|0,f=(f=f+Math.imul(_,re)|0)+Math.imul(I,de)|0,d=d+Math.imul(I,re)|0,c=c+Math.imul(A,ie)|0,f=(f=f+Math.imul(A,be)|0)+Math.imul(v,ie)|0,d=d+Math.imul(v,be)|0,c=c+Math.imul(m,se)|0,f=(f=f+Math.imul(m,le)|0)+Math.imul(y,se)|0,d=d+Math.imul(y,le)|0;var Ce=(b+(c=c+Math.imul(h,he)|0)|0)+((8191&(f=(f=f+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;b=((d=d+Math.imul(p,pe)|0)+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c=Math.imul(F,K),f=(f=Math.imul(F,V))+Math.imul(Q,K)|0,d=Math.imul(Q,V),c=c+Math.imul(P,J)|0,f=(f=f+Math.imul(P,W)|0)+Math.imul(D,J)|0,d=d+Math.imul(D,W)|0,c=c+Math.imul(T,X)|0,f=(f=f+Math.imul(T,ee)|0)+Math.imul(N,X)|0,d=d+Math.imul(N,ee)|0,c=c+Math.imul(k,te)|0,f=(f=f+Math.imul(k,ce)|0)+Math.imul(L,te)|0,d=d+Math.imul(L,ce)|0,c=c+Math.imul(C,de)|0,f=(f=f+Math.imul(C,re)|0)+Math.imul(M,de)|0,d=d+Math.imul(M,re)|0,c=c+Math.imul(_,ie)|0,f=(f=f+Math.imul(_,be)|0)+Math.imul(I,ie)|0,d=d+Math.imul(I,be)|0,c=c+Math.imul(A,se)|0,f=(f=f+Math.imul(A,le)|0)+Math.imul(v,se)|0,d=d+Math.imul(v,le)|0;var Me=(b+(c=c+Math.imul(m,he)|0)|0)+((8191&(f=(f=f+Math.imul(m,pe)|0)+Math.imul(y,he)|0))<<13)|0;b=((d=d+Math.imul(y,pe)|0)+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,c=Math.imul(F,J),f=(f=Math.imul(F,W))+Math.imul(Q,J)|0,d=Math.imul(Q,W),c=c+Math.imul(P,X)|0,f=(f=f+Math.imul(P,ee)|0)+Math.imul(D,X)|0,d=d+Math.imul(D,ee)|0,c=c+Math.imul(T,te)|0,f=(f=f+Math.imul(T,ce)|0)+Math.imul(N,te)|0,d=d+Math.imul(N,ce)|0,c=c+Math.imul(k,de)|0,f=(f=f+Math.imul(k,re)|0)+Math.imul(L,de)|0,d=d+Math.imul(L,re)|0,c=c+Math.imul(C,ie)|0,f=(f=f+Math.imul(C,be)|0)+Math.imul(M,ie)|0,d=d+Math.imul(M,be)|0,c=c+Math.imul(_,se)|0,f=(f=f+Math.imul(_,le)|0)+Math.imul(I,se)|0,d=d+Math.imul(I,le)|0;var Be=(b+(c=c+Math.imul(A,he)|0)|0)+((8191&(f=(f=f+Math.imul(A,pe)|0)+Math.imul(v,he)|0))<<13)|0;b=((d=d+Math.imul(v,pe)|0)+(f>>>13)|0)+(Be>>>26)|0,Be&=67108863,c=Math.imul(F,X),f=(f=Math.imul(F,ee))+Math.imul(Q,X)|0,d=Math.imul(Q,ee),c=c+Math.imul(P,te)|0,f=(f=f+Math.imul(P,ce)|0)+Math.imul(D,te)|0,d=d+Math.imul(D,ce)|0,c=c+Math.imul(T,de)|0,f=(f=f+Math.imul(T,re)|0)+Math.imul(N,de)|0,d=d+Math.imul(N,re)|0,c=c+Math.imul(k,ie)|0,f=(f=f+Math.imul(k,be)|0)+Math.imul(L,ie)|0,d=d+Math.imul(L,be)|0,c=c+Math.imul(C,se)|0,f=(f=f+Math.imul(C,le)|0)+Math.imul(M,se)|0,d=d+Math.imul(M,le)|0;var ke=(b+(c=c+Math.imul(_,he)|0)|0)+((8191&(f=(f=f+Math.imul(_,pe)|0)+Math.imul(I,he)|0))<<13)|0;b=((d=d+Math.imul(I,pe)|0)+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,c=Math.imul(F,te),f=(f=Math.imul(F,ce))+Math.imul(Q,te)|0,d=Math.imul(Q,ce),c=c+Math.imul(P,de)|0,f=(f=f+Math.imul(P,re)|0)+Math.imul(D,de)|0,d=d+Math.imul(D,re)|0,c=c+Math.imul(T,ie)|0,f=(f=f+Math.imul(T,be)|0)+Math.imul(N,ie)|0,d=d+Math.imul(N,be)|0,c=c+Math.imul(k,se)|0,f=(f=f+Math.imul(k,le)|0)+Math.imul(L,se)|0,d=d+Math.imul(L,le)|0;var Le=(b+(c=c+Math.imul(C,he)|0)|0)+((8191&(f=(f=f+Math.imul(C,pe)|0)+Math.imul(M,he)|0))<<13)|0;b=((d=d+Math.imul(M,pe)|0)+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,c=Math.imul(F,de),f=(f=Math.imul(F,re))+Math.imul(Q,de)|0,d=Math.imul(Q,re),c=c+Math.imul(P,ie)|0,f=(f=f+Math.imul(P,be)|0)+Math.imul(D,ie)|0,d=d+Math.imul(D,be)|0,c=c+Math.imul(T,se)|0,f=(f=f+Math.imul(T,le)|0)+Math.imul(N,se)|0,d=d+Math.imul(N,le)|0;var Se=(b+(c=c+Math.imul(k,he)|0)|0)+((8191&(f=(f=f+Math.imul(k,pe)|0)+Math.imul(L,he)|0))<<13)|0;b=((d=d+Math.imul(L,pe)|0)+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,c=Math.imul(F,ie),f=(f=Math.imul(F,be))+Math.imul(Q,ie)|0,d=Math.imul(Q,be),c=c+Math.imul(P,se)|0,f=(f=f+Math.imul(P,le)|0)+Math.imul(D,se)|0,d=d+Math.imul(D,le)|0;var Te=(b+(c=c+Math.imul(T,he)|0)|0)+((8191&(f=(f=f+Math.imul(T,pe)|0)+Math.imul(N,he)|0))<<13)|0;b=((d=d+Math.imul(N,pe)|0)+(f>>>13)|0)+(Te>>>26)|0,Te&=67108863,c=Math.imul(F,se),f=(f=Math.imul(F,le))+Math.imul(Q,se)|0,d=Math.imul(Q,le);var Ne=(b+(c=c+Math.imul(P,he)|0)|0)+((8191&(f=(f=f+Math.imul(P,pe)|0)+Math.imul(D,he)|0))<<13)|0;b=((d=d+Math.imul(D,pe)|0)+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Re=(b+(c=Math.imul(F,he))|0)+((8191&(f=(f=Math.imul(F,pe))+Math.imul(Q,he)|0))<<13)|0;return b=((d=Math.imul(Q,pe))+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,i[0]=ge,i[1]=me,i[2]=ye,i[3]=xe,i[4]=Ae,i[5]=ve,i[6]=we,i[7]=_e,i[8]=Ie,i[9]=Ee,i[10]=Ce,i[11]=Me,i[12]=Be,i[13]=ke,i[14]=Le,i[15]=Se,i[16]=Te,i[17]=Ne,i[18]=Re,0!==b&&(i[19]=b,t.length++),t};function p(e,a,t){return(new g).mulp(e,a,t)}function g(e,a){this.x=e,this.y=a}Math.imul||(h=u),d.prototype.mulTo=function(e,a){var t,c=this.length+e.length;return t=10===this.length&&10===e.length?h(this,e,a):c<63?u(this,e,a):c<1024?function(e,a,t){t.negative=a.negative^e.negative,t.length=e.length+a.length;for(var c=0,f=0,d=0;d>>26)|0)>>>26,r&=67108863}t.words[d]=n,c=r,r=f}return 0!==c?t.words[d]=c:t.length--,t.strip()}(this,e,a):p(this,e,a),t},g.prototype.makeRBT=function(e){for(var a=new Array(e),t=d.prototype._countBits(e)-1,c=0;c>=1;return c},g.prototype.permute=function(e,a,t,c,f,d){for(var r=0;r>>=1)f++;return 1<>>=13,t[2*r+1]=8191&d,d>>>=13;for(r=2*a;r>=26,a+=f/67108864|0,a+=d>>>26,this.words[t]=67108863&d}return 0!==a&&(this.words[t]=a,this.length++),this},d.prototype.muln=function(e){return this.clone().imuln(e)},d.prototype.sqr=function(){return this.mul(this)},d.prototype.isqr=function(){return this.imul(this.clone())},d.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),t=0;t>>f}return a}(e);if(0===a.length)return new d(1);for(var t=this,c=0;c=0);var a,t=e%26,f=(e-t)/26,d=67108863>>>26-t<<26-t;if(0!==t){var r=0;for(a=0;a>>26-t}r&&(this.words[a]=r,this.length++)}if(0!==f){for(a=this.length-1;a>=0;a--)this.words[a+f]=this.words[a];for(a=0;a=0),f=a?(a-a%26)/26:0;var d=e%26,r=Math.min((e-d)/26,this.length),n=67108863^67108863>>>d<r)for(this.length-=r,b=0;b=0&&(0!==o||b>=f);b--){var s=0|this.words[b];this.words[b]=o<<26-d|s>>>d,o=s&n}return i&&0!==o&&(i.words[i.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},d.prototype.ishrn=function(e,a,t){return c(0===this.negative),this.iushrn(e,a,t)},d.prototype.shln=function(e){return this.clone().ishln(e)},d.prototype.ushln=function(e){return this.clone().iushln(e)},d.prototype.shrn=function(e){return this.clone().ishrn(e)},d.prototype.ushrn=function(e){return this.clone().iushrn(e)},d.prototype.testn=function(e){c("number"==typeof e&&e>=0);var a=e%26,t=(e-a)/26,f=1<=0);var a=e%26,t=(e-a)/26;if(c(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==a&&t++,this.length=Math.min(t,this.length),0!==a){var f=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},d.prototype.isubn=function(e){if(c("number"==typeof e),c(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(i/67108864|0),this.words[f+t]=67108863&d}for(;f>26,this.words[f+t]=67108863&d;if(0===n)return this.strip();for(c(-1===n),n=0,f=0;f>26,this.words[f]=67108863&d;return this.negative=1,this.strip()},d.prototype._wordDiv=function(e,a){var t=(this.length,e.length),c=this.clone(),f=e,r=0|f.words[f.length-1];0!=(t=26-this._countBits(r))&&(f=f.ushln(t),c.iushln(t),r=0|f.words[f.length-1]);var n,i=c.length-f.length;if("mod"!==a){(n=new d(null)).length=i+1,n.words=new Array(n.length);for(var b=0;b=0;s--){var l=67108864*(0|c.words[f.length+s])+(0|c.words[f.length+s-1]);for(l=Math.min(l/r|0,67108863),c._ishlnsubmul(f,l,s);0!==c.negative;)l--,c.negative=0,c._ishlnsubmul(f,1,s),c.isZero()||(c.negative^=1);n&&(n.words[s]=l)}return n&&n.strip(),c.strip(),"div"!==a&&0!==t&&c.iushrn(t),{div:n||null,mod:c}},d.prototype.divmod=function(e,a,t){return c(!e.isZero()),this.isZero()?{div:new d(0),mod:new d(0)}:0!==this.negative&&0===e.negative?(n=this.neg().divmod(e,a),"mod"!==a&&(f=n.div.neg()),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.iadd(e)),{div:f,mod:r}):0===this.negative&&0!==e.negative?(n=this.divmod(e.neg(),a),"mod"!==a&&(f=n.div.neg()),{div:f,mod:n.mod}):this.negative&e.negative?(n=this.neg().divmod(e.neg(),a),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.isub(e)),{div:n.div,mod:r}):e.length>this.length||this.cmp(e)<0?{div:new d(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new d(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new d(this.modn(e.words[0]))}:this._wordDiv(e,a);var f,r,n},d.prototype.div=function(e){return this.divmod(e,"div",!1).div},d.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},d.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},d.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var t=0!==a.div.negative?a.mod.isub(e):a.mod,c=e.ushrn(1),f=e.andln(1),d=t.cmp(c);return d<0||1===f&&0===d?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},d.prototype.modn=function(e){c(e<=67108863);for(var a=(1<<26)%e,t=0,f=this.length-1;f>=0;f--)t=(a*t+(0|this.words[f]))%e;return t},d.prototype.idivn=function(e){c(e<=67108863);for(var a=0,t=this.length-1;t>=0;t--){var f=(0|this.words[t])+67108864*a;this.words[t]=f/e|0,a=f%e}return this.strip()},d.prototype.divn=function(e){return this.clone().idivn(e)},d.prototype.egcd=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f=new d(1),r=new d(0),n=new d(0),i=new d(1),b=0;a.isEven()&&t.isEven();)a.iushrn(1),t.iushrn(1),++b;for(var o=t.clone(),s=a.clone();!a.isZero();){for(var l=0,u=1;!(a.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(f.isOdd()||r.isOdd())&&(f.iadd(o),r.isub(s)),f.iushrn(1),r.iushrn(1);for(var h=0,p=1;!(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(o),i.isub(s)),n.iushrn(1),i.iushrn(1);a.cmp(t)>=0?(a.isub(t),f.isub(n),r.isub(i)):(t.isub(a),n.isub(f),i.isub(r))}return{a:n,b:i,gcd:t.iushln(b)}},d.prototype._invmp=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f,r=new d(1),n=new d(0),i=t.clone();a.cmpn(1)>0&&t.cmpn(1)>0;){for(var b=0,o=1;!(a.words[0]&o)&&b<26;++b,o<<=1);if(b>0)for(a.iushrn(b);b-- >0;)r.isOdd()&&r.iadd(i),r.iushrn(1);for(var s=0,l=1;!(t.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(t.iushrn(s);s-- >0;)n.isOdd()&&n.iadd(i),n.iushrn(1);a.cmp(t)>=0?(a.isub(t),r.isub(n)):(t.isub(a),n.isub(r))}return(f=0===a.cmpn(1)?r:n).cmpn(0)<0&&f.iadd(e),f},d.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),t=e.clone();a.negative=0,t.negative=0;for(var c=0;a.isEven()&&t.isEven();c++)a.iushrn(1),t.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;t.isEven();)t.iushrn(1);var f=a.cmp(t);if(f<0){var d=a;a=t,t=d}else if(0===f||0===t.cmpn(1))break;a.isub(t)}return t.iushln(c)},d.prototype.invm=function(e){return this.egcd(e).a.umod(e)},d.prototype.isEven=function(){return!(1&this.words[0])},d.prototype.isOdd=function(){return!(1&~this.words[0])},d.prototype.andln=function(e){return this.words[0]&e},d.prototype.bincn=function(e){c("number"==typeof e);var a=e%26,t=(e-a)/26,f=1<>>26,n&=67108863,this.words[r]=n}return 0!==d&&(this.words[r]=d,this.length++),this},d.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},d.prototype.cmpn=function(e){var a,t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)a=1;else{t&&(e=-e),c(e<=67108863,"Number is too big");var f=0|this.words[0];a=f===e?0:fe.length)return 1;if(this.length=0;t--){var c=0|this.words[t],f=0|e.words[t];if(c!==f){cf&&(a=1);break}}return a},d.prototype.gtn=function(e){return 1===this.cmpn(e)},d.prototype.gt=function(e){return 1===this.cmp(e)},d.prototype.gten=function(e){return this.cmpn(e)>=0},d.prototype.gte=function(e){return this.cmp(e)>=0},d.prototype.ltn=function(e){return-1===this.cmpn(e)},d.prototype.lt=function(e){return-1===this.cmp(e)},d.prototype.lten=function(e){return this.cmpn(e)<=0},d.prototype.lte=function(e){return this.cmp(e)<=0},d.prototype.eqn=function(e){return 0===this.cmpn(e)},d.prototype.eq=function(e){return 0===this.cmp(e)},d.red=function(e){return new _(e)},d.prototype.toRed=function(e){return c(!this.red,"Already a number in reduction context"),c(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},d.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},d.prototype._forceRed=function(e){return this.red=e,this},d.prototype.forceRed=function(e){return c(!this.red,"Already a number in reduction context"),this._forceRed(e)},d.prototype.redAdd=function(e){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},d.prototype.redIAdd=function(e){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},d.prototype.redSub=function(e){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},d.prototype.redISub=function(e){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},d.prototype.redShl=function(e){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},d.prototype.redMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},d.prototype.redIMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},d.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},d.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},d.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},d.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},d.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},d.prototype.redPow=function(e){return c(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function y(e,a){this.name=e,this.p=new d(a,16),this.n=this.p.bitLength(),this.k=new d(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function x(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var a=d._prime(e);this.m=a.p,this.prime=a}else c(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new d(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var e=new d(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var a,t=e;do{this.split(t,this.tmp),a=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(a>this.n);var c=a0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},y.prototype.split=function(e,a){e.iushrn(this.n,0,a)},y.prototype.imulK=function(e){return e.imul(this.k)},f(x,y),x.prototype.split=function(e,a){for(var t=4194303,c=Math.min(e.length,9),f=0;f>>22,d=r}d>>>=22,e.words[f-10]=d,0===d&&e.length>10?e.length-=10:e.length-=9},x.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,t=0;t>>=26,e.words[t]=f,a=c}return 0!==a&&(e.words[e.length++]=a),e},d._prime=function(e){if(m[e])return m[e];var a;if("k256"===e)a=new x;else if("p224"===e)a=new A;else if("p192"===e)a=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new w}return m[e]=a,a},_.prototype._verify1=function(e){c(0===e.negative,"red works only with positives"),c(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,a){c(!(e.negative|a.negative),"red works only with positives"),c(e.red&&e.red===a.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,a){this._verify2(e,a);var t=e.add(a);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},_.prototype.iadd=function(e,a){this._verify2(e,a);var t=e.iadd(a);return t.cmp(this.m)>=0&&t.isub(this.m),t},_.prototype.sub=function(e,a){this._verify2(e,a);var t=e.sub(a);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},_.prototype.isub=function(e,a){this._verify2(e,a);var t=e.isub(a);return t.cmpn(0)<0&&t.iadd(this.m),t},_.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},_.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},_.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(c(a%2==1),3===a){var t=this.m.add(new d(1)).iushrn(2);return this.pow(e,t)}for(var f=this.m.subn(1),r=0;!f.isZero()&&0===f.andln(1);)r++,f.iushrn(1);c(!f.isZero());var n=new d(1).toRed(this),i=n.redNeg(),b=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new d(2*o*o).toRed(this);0!==this.pow(o,b).cmp(i);)o.redIAdd(i);for(var s=this.pow(o,f),l=this.pow(e,f.addn(1).iushrn(1)),u=this.pow(e,f),h=r;0!==u.cmp(n);){for(var p=u,g=0;0!==p.cmp(n);g++)p=p.redSqr();c(g=0;c--){for(var b=a.words[c],o=i-1;o>=0;o--){var s=b>>o&1;f!==t[0]&&(f=this.sqr(f)),0!==s||0!==r?(r<<=1,r|=s,(4==++n||0===c&&0===o)&&(f=this.mul(f,t[r]),n=0,r=0)):n=0}i=26}return f},_.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},_.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},d.mont=function(e){return new I(e)},f(I,_),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},I.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var t=e.imul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),d=f;return f.cmp(this.m)>=0?d=f.isub(this.m):f.cmpn(0)<0&&(d=f.iadd(this.m)),d._forceRed(this)},I.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new d(0)._forceRed(this);var t=e.mul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),r=f;return f.cmp(this.m)>=0?r=f.isub(this.m):f.cmpn(0)<0&&(r=f.iadd(this.m)),r._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=t.nmd(e),this)},43349:e=>{function a(e,a){if(!e)throw new Error(a||"Assertion failed")}e.exports=a,a.equal=function(e,a,t){if(e!=a)throw new Error(t||"Assertion failed: "+e+" != "+a)}},64367:(e,a)=>{"use strict";var t=a;function c(e){return 1===e.length?"0"+e:e}function f(e){for(var a="",t=0;t>8,r=255&f;d?t.push(d,r):t.push(r)}return t},t.zero2=c,t.toHex=f,t.encode=function(e,a){return"hex"===a?f(e):e}},6585:e=>{var a=1e3,t=60*a,c=60*t,f=24*c,d=7*f;function r(e,a,t,c){var f=a>=1.5*t;return Math.round(e/t)+" "+c+(f?"s":"")}e.exports=function(e,n){n=n||{};var i,b,o=typeof e;if("string"===o&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(r){var n=parseFloat(r[1]);switch((r[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*n;case"weeks":case"week":case"w":return n*d;case"days":case"day":case"d":return n*f;case"hours":case"hour":case"hrs":case"hr":case"h":return n*c;case"minutes":case"minute":case"mins":case"min":case"m":return n*t;case"seconds":case"second":case"secs":case"sec":case"s":return n*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}(e);if("number"===o&&isFinite(e))return n.long?(i=e,(b=Math.abs(i))>=f?r(i,b,f,"day"):b>=c?r(i,b,c,"hour"):b>=t?r(i,b,t,"minute"):b>=a?r(i,b,a,"second"):i+" ms"):function(e){var d=Math.abs(e);return d>=f?Math.round(e/f)+"d":d>=c?Math.round(e/c)+"h":d>=t?Math.round(e/t)+"m":d>=a?Math.round(e/a)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},18633:(e,a,t)=>{"use strict";const{encodeText:c}=t(24084);e.exports=class{constructor(e,a,t,f){this.name=e,this.code=a,this.codeBuf=c(this.code),this.alphabet=f,this.codec=t(f)}encode(e){return this.codec.encode(e)}decode(e){for(const a of e)if(this.alphabet&&this.alphabet.indexOf(a)<0)throw new Error(`invalid character '${a}' in '${e}'`);return this.codec.decode(e)}}},67579:(e,a,t)=>{"use strict";const c=t(25084),f=t(18633),{rfc4648:d}=t(99417),{decodeText:r,encodeText:n}=t(24084),i=[["identity","\0",()=>({encode:r,decode:n}),""],["base2","0",d(1),"01"],["base8","7",d(3),"01234567"],["base10","9",c,"0123456789"],["base16","f",d(4),"0123456789abcdef"],["base16upper","F",d(4),"0123456789ABCDEF"],["base32hex","v",d(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",d(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",d(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",d(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",d(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",d(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",d(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",d(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",d(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",c,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",c,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",c,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",c,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",d(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",d(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",d(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",d(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],b=i.reduce(((e,a)=>(e[a[0]]=new f(a[0],a[1],a[2],a[3]),e)),{}),o=i.reduce(((e,a)=>(e[a[1]]=b[a[0]],e)),{});e.exports={names:b,codes:o}},91466:(e,a,t)=>{"use strict";const c=t(67579),{encodeText:f,decodeText:d,concat:r}=t(24084);function n(e){if(Object.prototype.hasOwnProperty.call(c.names,e))return c.names[e];if(Object.prototype.hasOwnProperty.call(c.codes,e))return c.codes[e];throw new Error(`Unsupported encoding: ${e}`)}(a=e.exports=function(e,a){if(!a)throw new Error("requires an encoded Uint8Array");const{name:t,codeBuf:c}=n(e);return function(e,a){n(e).decode(d(a))}(t,a),r([c,a],c.length+a.length)}).encode=function(e,a){const t=n(e),c=f(t.encode(a));return r([t.codeBuf,c],t.codeBuf.length+c.length)},a.decode=function(e){e instanceof Uint8Array&&(e=d(e));const a=e[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(a)&&(e=e.toLowerCase()),n(e[0]).decode(e.substring(1))},a.isEncoded=function(e){if(e instanceof Uint8Array&&(e=d(e)),"[object String]"!==Object.prototype.toString.call(e))return!1;try{return n(e[0]).name}catch(e){return!1}},a.encoding=n,a.encodingFromData=function(e){return e instanceof Uint8Array&&(e=d(e)),n(e[0])};const i=Object.freeze(c.names),b=Object.freeze(c.codes);a.names=i,a.codes=b},99417:e=>{"use strict";e.exports={rfc4648:e=>a=>({encode:t=>((e,a,t)=>{const c="="===a[a.length-1],f=(1<t;)r-=t,d+=a[f&n>>r];if(r&&(d+=a[f&n<((e,a,t)=>{const c={};for(let e=0;e=8&&(r-=8,d[i++]=255&n>>r)}if(r>=t||255&n<<8-r)throw new SyntaxError("Unexpected end of data");return d})(t,a,e)})}},24084:e=>{"use strict";const a=new TextDecoder,t=new TextEncoder;e.exports={decodeText:e=>a.decode(e),encodeText:e=>t.encode(e),concat:function(e,a){const t=new Uint8Array(a);let c=0;for(const a of e)t.set(a,c),c+=a.length;return t}}},35194:e=>{e.exports=function e(c,f){var d,r=0,n=0,i=f=f||0,b=c.length;do{if(i>=b||n>49)throw e.bytes=0,new RangeError("Could not decode varint");d=c[i++],r+=n<28?(d&t)<=a);return e.bytes=i-f,r};var a=128,t=127},25134:e=>{e.exports=function e(f,d,r){if(Number.MAX_SAFE_INTEGER&&f>Number.MAX_SAFE_INTEGER)throw e.bytes=0,new RangeError("Could not encode varint");d=d||[];for(var n=r=r||0;f>=c;)d[r++]=255&f|a,f/=128;for(;f&t;)d[r++]=255&f|a,f>>>=7;return d[r]=0|f,e.bytes=r-n+1,d};var a=128,t=-128,c=Math.pow(2,31)},20038:(e,a,t)=>{e.exports={encode:t(25134),decode:t(35194),encodingLength:t(36516)}},36516:e=>{var a=Math.pow(2,7),t=Math.pow(2,14),c=Math.pow(2,21),f=Math.pow(2,28),d=Math.pow(2,35),r=Math.pow(2,42),n=Math.pow(2,49),i=Math.pow(2,56),b=Math.pow(2,63);e.exports=function(e){return e{"use strict";const a=Object.freeze({identity:0,cidv1:1,cidv2:2,cidv3:3,ip4:4,tcp:6,sha1:17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,blake3:30,dccp:33,"murmur3-128":34,"murmur3-32":35,ip6:41,ip6zone:42,path:47,multicodec:48,multihash:49,multiaddr:50,multibase:51,dns:53,dns4:54,dns6:55,dnsaddr:56,protobuf:80,cbor:81,raw:85,"dbl-sha2-256":86,rlp:96,bencode:99,"dag-pb":112,"dag-cbor":113,"libp2p-key":114,"git-raw":120,"torrent-info":123,"torrent-file":124,"leofcoin-block":129,"leofcoin-tx":130,"leofcoin-pr":131,sctp:132,"dag-jose":133,"dag-cose":134,"eth-block":144,"eth-block-list":145,"eth-tx-trie":146,"eth-tx":147,"eth-tx-receipt-trie":148,"eth-tx-receipt":149,"eth-state-trie":150,"eth-account-snapshot":151,"eth-storage-trie":152,"eth-receipt-log-trie":153,"eth-reciept-log":154,"bitcoin-block":176,"bitcoin-tx":177,"bitcoin-witness-commitment":178,"zcash-block":192,"zcash-tx":193,"caip-50":202,streamid:206,"stellar-block":208,"stellar-tx":209,md4:212,md5:213,bmt:214,"decred-block":224,"decred-tx":225,"ipld-ns":226,"ipfs-ns":227,"swarm-ns":228,"ipns-ns":229,zeronet:230,"secp256k1-pub":231,"bls12_381-g1-pub":234,"bls12_381-g2-pub":235,"x25519-pub":236,"ed25519-pub":237,"bls12_381-g1g2-pub":238,"dash-block":240,"dash-tx":241,"swarm-manifest":250,"swarm-feed":251,udp:273,"p2p-webrtc-star":275,"p2p-webrtc-direct":276,"p2p-stardust":277,"p2p-circuit":290,"dag-json":297,udt:301,utp:302,unix:400,thread:406,p2p:421,ipfs:421,https:443,onion:444,onion3:445,garlic64:446,garlic32:447,tls:448,noise:454,quic:460,ws:477,wss:478,"p2p-websocket-star":479,http:480,"swhid-1-snp":496,json:512,messagepack:513,"libp2p-peer-record":769,"libp2p-relay-rsvp":770,"car-index-sorted":1024,"sha2-256-trunc254-padded":4114,"ripemd-128":4178,"ripemd-160":4179,"ripemd-256":4180,"ripemd-320":4181,x11:4352,"p256-pub":4608,"p384-pub":4609,"p521-pub":4610,"ed448-pub":4611,"x448-pub":4612,"ed25519-priv":4864,"secp256k1-priv":4865,"x25519-priv":4866,kangarootwelve:7425,"sm3-256":21325,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46e3,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"poseidon-bls12_381-a2-fc1":46081,"poseidon-bls12_381-a2-fc1-sc":46082,"zeroxcert-imprint-256":52753,"fil-commitment-unsealed":61697,"fil-commitment-sealed":61698,"holochain-adr-v0":8417572,"holochain-adr-v1":8483108,"holochain-key-v0":9728292,"holochain-key-v1":9793828,"holochain-sig-v0":10645796,"holochain-sig-v1":10711332,"skynet-ns":11639056,"arweave-ns":11704592});e.exports={baseTable:a}},52021:(e,a,t)=>{"use strict";const c=t(20038),{concat:f}=t(75007),d=t(82693),{nameToVarint:r,constantToCode:n,nameToCode:i,codeToName:b}=t(90482);function o(e){const a=c.decode(e),t=b[a];if(void 0===t)throw new Error(`Code "${a}" not found`);return t}function s(e){return b[e]}function l(e){const a=i[e];if(void 0===a)throw new Error(`Codec "${e}" not found`);return a}function u(e){return c.decode(e)}function h(e){const a=r[e];if(void 0===a)throw new Error(`Codec "${e}" not found`);return a}function p(e){return d.varintEncode(e)}e.exports={addPrefix:function(e,a){let t;if(e instanceof Uint8Array)t=d.varintUint8ArrayEncode(e);else{if(!r[e])throw new Error("multicodec not recognized");t=r[e]}return f([t,a],t.length+a.length)},rmPrefix:function(e){return c.decode(e),e.slice(c.decode.bytes)},getNameFromData:o,getNameFromCode:s,getCodeFromName:l,getCodeFromData:u,getVarintFromName:h,getVarintFromCode:p,getCodec:function(e){return o(e)},getName:function(e){return s(e)},getNumber:function(e){return l(e)},getCode:function(e){return u(e)},getCodeVarint:function(e){return h(e)},getVarint:function(e){return Array.from(p(e))},...n,nameToVarint:r,nameToCode:i,codeToName:b}},90482:(e,a,t)=>{"use strict";const{baseTable:c}=t(15661),f=t(82693).varintEncode,d={},r={},n={};for(const e in c){const a=e,t=c[a];d[a]=f(t),r[a.toUpperCase().replace(/-/g,"_")]=t,n[t]||(n[t]=a)}Object.freeze(d),Object.freeze(r),Object.freeze(n);const i=Object.freeze(c);e.exports={nameToVarint:d,constantToCode:r,nameToCode:i,codeToName:n}},82693:(e,a,t)=>{"use strict";const c=t(20038),{toString:f}=t(27302),{fromString:d}=t(44117);function r(e){return parseInt(f(e,"base16"),16)}e.exports={numberToUint8Array:function(e){let a=e.toString(16);return a.length%2==1&&(a="0"+a),d(a,"base16")},uint8ArrayToNumber:r,varintUint8ArrayEncode:function(e){return Uint8Array.from(c.encode(r(e)))},varintEncode:function(e){return Uint8Array.from(c.encode(e))}}},76994:(e,a,t)=>{"use strict";const{Buffer:c}=t(48287);e.exports=class{constructor(e,a,t,f){this.name=e,this.code=a,this.codeBuf=c.from(this.code),this.alphabet=f,this.engine=t(f)}encode(e){return this.engine.encode(e)}decode(e){for(const a of e)if(this.alphabet&&this.alphabet.indexOf(a)<0)throw new Error(`invalid character '${a}' in '${e}'`);return this.engine.decode(e)}}},46082:(e,a,t)=>{"use strict";const c=t(95364),f=t(76994),d=t(15920),{decodeText:r,encodeText:n}=t(40639),i=[["identity","\0",()=>({encode:r,decode:n}),""],["base2","0",d(1),"01"],["base8","7",d(3),"01234567"],["base10","9",c,"0123456789"],["base16","f",d(4),"0123456789abcdef"],["base16upper","F",d(4),"0123456789ABCDEF"],["base32hex","v",d(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",d(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",d(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",d(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",d(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",d(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",d(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",d(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",d(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",c,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",c,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",c,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",c,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",d(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",d(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",d(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",d(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],b=i.reduce(((e,a)=>(e[a[0]]=new f(a[0],a[1],a[2],a[3]),e)),{}),o=i.reduce(((e,a)=>(e[a[1]]=b[a[0]],e)),{});e.exports={names:b,codes:o}},42879:(e,a,t)=>{"use strict";const{Buffer:c}=t(48287),f=t(46082),{decodeText:d,asBuffer:r}=t(40639);function n(e){if(f.names[e])return f.names[e];if(f.codes[e])return f.codes[e];throw new Error(`Unsupported encoding: ${e}`)}(a=e.exports=function(e,a){if(!a)throw new Error("requires an encoded buffer");const{name:t,codeBuf:f}=n(e);!function(e,a){n(e).decode(d(a))}(t,a);const r=c.alloc(f.length+a.length);return r.set(f,0),r.set(a,f.length),r}).encode=function(e,a){const t=n(e);return c.concat([t.codeBuf,c.from(t.encode(a))])},a.decode=function(e){ArrayBuffer.isView(e)&&(e=d(e));const a=e[0];["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(a)&&(e=e.toLowerCase());const t=n(e[0]);return r(t.decode(e.substring(1)))},a.isEncoded=function(e){if(e instanceof Uint8Array&&(e=d(e)),"[object String]"!==Object.prototype.toString.call(e))return!1;try{return n(e[0]).name}catch(e){return!1}},a.encoding=n,a.encodingFromData=function(e){return e instanceof Uint8Array&&(e=d(e)),n(e[0])},a.names=Object.freeze(f.names),a.codes=Object.freeze(f.codes)},15920:e=>{"use strict";e.exports=e=>a=>({encode:t=>((e,a,t)=>{const c="="===a[a.length-1],f=(1<t;)r-=t,d+=a[f&n>>r];if(r&&(d+=a[f&n<((e,a,t)=>{const c={};for(let e=0;e=8&&(r-=8,d[i++]=255&n>>r)}if(r>=t||255&n<<8-r)throw new SyntaxError("Unexpected end of data");return d})(t,a,e)})},40639:(e,a,t)=>{"use strict";const{Buffer:c}=t(48287),{TextEncoder:f,TextDecoder:d}=t(67019),r=new d,n=new f;e.exports={decodeText:e=>r.decode(e),encodeText:e=>n.encode(e),asBuffer:({buffer:e,byteLength:a,byteOffset:t})=>c.from(e,t,a)}},53702:e=>{"use strict";const a=Object.freeze({identity:0,sha1:17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,blake3:30,"murmur3-128":34,"murmur3-32":35,"dbl-sha2-256":86,md4:212,md5:213,bmt:214,"sha2-256-trunc254-padded":4114,"ripemd-128":4178,"ripemd-160":4179,"ripemd-256":4180,"ripemd-320":4181,x11:4352,"sm3-256":21325,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46e3,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"poseidon-bls12_381-a2-fc1":46081,"poseidon-bls12_381-a2-fc1-sc":46082});e.exports={names:a}},14243:(e,a,t)=>{"use strict";const{Buffer:c}=t(48287),f=t(42879),d=t(61203),{names:r}=t(53702),{TextDecoder:n}=t(67019),i=new n,b={};for(const e in r)b[r[e]]=e;function o(e){a.decode(e)}a.names=r,a.codes=Object.freeze(b),a.toHexString=function(e){if(!(e instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return(c.isBuffer(e)?e:c.from(e.buffer,e.byteOffset,e.byteLength)).toString("hex")},a.fromHexString=function(e){return c.from(e,"hex")},a.toB58String=function(e){if(!(e instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return i.decode(f.encode("base58btc",e)).slice(1)},a.fromB58String=function(e){const a=e instanceof Uint8Array?i.decode(e):e;return f.decode("z"+a)},a.decode=function(e){if(!(e instanceof Uint8Array))throw new Error("multihash must be a Uint8Array");let t=c.isBuffer(e)?e:c.from(e.buffer,e.byteOffset,e.byteLength);if(t.length<2)throw new Error("multihash too short. must be > 2 bytes.");const f=d.decode(t);if(!a.isValidCode(f))throw new Error(`multihash unknown function code: 0x${f.toString(16)}`);t=t.slice(d.decode.bytes);const r=d.decode(t);if(r<0)throw new Error(`multihash invalid length: ${r}`);if(t=t.slice(d.decode.bytes),t.length!==r)throw new Error(`multihash length inconsistent: 0x${t.toString("hex")}`);return{code:f,name:b[f],length:r,digest:t}},a.encode=function(e,t,f){if(!e||void 0===t)throw new Error("multihash encode requires at least two args: digest, code");const r=a.coerceCode(t);if(!(e instanceof Uint8Array))throw new Error("digest should be a Uint8Array");if(null==f&&(f=e.length),f&&e.length!==f)throw new Error("digest length should be equal to specified length.");const n=d.encode(r),i=d.encode(f),b=c.alloc(n.length+i.length+e.length);return b.set(n,0),b.set(i,n.length),b.set(e,n.length+i.length),b},a.coerceCode=function(e){let t=e;if("string"==typeof e){if(void 0===r[e])throw new Error(`Unrecognized hash function named: ${e}`);t=r[e]}if("number"!=typeof t)throw new Error(`Hash function code should be a number. Got: ${t}`);if(void 0===b[t]&&!a.isAppCode(t))throw new Error(`Unrecognized function code: ${t}`);return t},a.isAppCode=function(e){return e>0&&e<16},a.isValidCode=function(e){return!!a.isAppCode(e)||!!b[e]},a.validate=o,a.prefix=function(e){return o(e),c.from(e.buffer,e.byteOffset,2)}},86889:e=>{e.exports=function e(t,c){if(!t){var f=new a(c);throw Error.captureStackTrace&&Error.captureStackTrace(f,e),f}};class a extends Error{}a.prototype.name="AssertionError"},62045:(e,a,t)=>{"use strict";const c=t(67526),f=t(251),d="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;a.hp=i,a.IS=50;const r=2147483647;function n(e){if(e>r)throw new RangeError('The value "'+e+'" is invalid for option "size"');const a=new Uint8Array(e);return Object.setPrototypeOf(a,i.prototype),a}function i(e,a,t){if("number"==typeof e){if("string"==typeof a)throw new TypeError('The "string" argument must be of type string. Received type number');return s(e)}return b(e,a,t)}function b(e,a,t){if("string"==typeof e)return function(e,a){if("string"==typeof a&&""!==a||(a="utf8"),!i.isEncoding(a))throw new TypeError("Unknown encoding: "+a);const t=0|p(e,a);let c=n(t);const f=c.write(e,a);return f!==t&&(c=c.slice(0,f)),c}(e,a);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){const a=new Uint8Array(e);return u(a.buffer,a.byteOffset,a.byteLength)}return l(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return u(e,a,t);if("undefined"!=typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return u(e,a,t);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const c=e.valueOf&&e.valueOf();if(null!=c&&c!==e)return i.from(c,a,t);const f=function(e){if(i.isBuffer(e)){const a=0|h(e.length),t=n(a);return 0===t.length||e.copy(t,0,0,a),t}return void 0!==e.length?"number"!=typeof e.length||J(e.length)?n(0):l(e):"Buffer"===e.type&&Array.isArray(e.data)?l(e.data):void 0}(e);if(f)return f;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return i.from(e[Symbol.toPrimitive]("string"),a,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function o(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function s(e){return o(e),n(e<0?0:0|h(e))}function l(e){const a=e.length<0?0:0|h(e.length),t=n(a);for(let c=0;c=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function p(e,a){if(i.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const t=e.length,c=arguments.length>2&&!0===arguments[2];if(!c&&0===t)return 0;let f=!1;for(;;)switch(a){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*t;case"hex":return t>>>1;case"base64":return K(e).length;default:if(f)return c?-1:G(e).length;a=(""+a).toLowerCase(),f=!0}}function g(e,a,t){let c=!1;if((void 0===a||a<0)&&(a=0),a>this.length)return"";if((void 0===t||t>this.length)&&(t=this.length),t<=0)return"";if((t>>>=0)<=(a>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return L(this,a,t);case"utf8":case"utf-8":return C(this,a,t);case"ascii":return B(this,a,t);case"latin1":case"binary":return k(this,a,t);case"base64":return E(this,a,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,a,t);default:if(c)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),c=!0}}function m(e,a,t){const c=e[a];e[a]=e[t],e[t]=c}function y(e,a,t,c,f){if(0===e.length)return-1;if("string"==typeof t?(c=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),J(t=+t)&&(t=f?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(f)return-1;t=e.length-1}else if(t<0){if(!f)return-1;t=0}if("string"==typeof a&&(a=i.from(a,c)),i.isBuffer(a))return 0===a.length?-1:x(e,a,t,c,f);if("number"==typeof a)return a&=255,"function"==typeof Uint8Array.prototype.indexOf?f?Uint8Array.prototype.indexOf.call(e,a,t):Uint8Array.prototype.lastIndexOf.call(e,a,t):x(e,[a],t,c,f);throw new TypeError("val must be string, number or Buffer")}function x(e,a,t,c,f){let d,r=1,n=e.length,i=a.length;if(void 0!==c&&("ucs2"===(c=String(c).toLowerCase())||"ucs-2"===c||"utf16le"===c||"utf-16le"===c)){if(e.length<2||a.length<2)return-1;r=2,n/=2,i/=2,t/=2}function b(e,a){return 1===r?e[a]:e.readUInt16BE(a*r)}if(f){let c=-1;for(d=t;dn&&(t=n-i),d=t;d>=0;d--){let t=!0;for(let c=0;cf&&(c=f):c=f;const d=a.length;let r;for(c>d/2&&(c=d/2),r=0;r>8,f=t%256,d.push(f),d.push(c);return d}(a,e.length-t),e,t,c)}function E(e,a,t){return 0===a&&t===e.length?c.fromByteArray(e):c.fromByteArray(e.slice(a,t))}function C(e,a,t){t=Math.min(e.length,t);const c=[];let f=a;for(;f239?4:a>223?3:a>191?2:1;if(f+r<=t){let t,c,n,i;switch(r){case 1:a<128&&(d=a);break;case 2:t=e[f+1],128==(192&t)&&(i=(31&a)<<6|63&t,i>127&&(d=i));break;case 3:t=e[f+1],c=e[f+2],128==(192&t)&&128==(192&c)&&(i=(15&a)<<12|(63&t)<<6|63&c,i>2047&&(i<55296||i>57343)&&(d=i));break;case 4:t=e[f+1],c=e[f+2],n=e[f+3],128==(192&t)&&128==(192&c)&&128==(192&n)&&(i=(15&a)<<18|(63&t)<<12|(63&c)<<6|63&n,i>65535&&i<1114112&&(d=i))}}null===d?(d=65533,r=1):d>65535&&(d-=65536,c.push(d>>>10&1023|55296),d=56320|1023&d),c.push(d),f+=r}return function(e){const a=e.length;if(a<=M)return String.fromCharCode.apply(String,e);let t="",c=0;for(;cc.length?(i.isBuffer(a)||(a=i.from(a)),a.copy(c,f)):Uint8Array.prototype.set.call(c,a,f);else{if(!i.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(c,f)}f+=a.length}return c},i.byteLength=p,i.prototype._isBuffer=!0,i.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let a=0;at&&(e+=" ... "),""},d&&(i.prototype[d]=i.prototype.inspect),i.prototype.compare=function(e,a,t,c,f){if(Z(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===a&&(a=0),void 0===t&&(t=e?e.length:0),void 0===c&&(c=0),void 0===f&&(f=this.length),a<0||t>e.length||c<0||f>this.length)throw new RangeError("out of range index");if(c>=f&&a>=t)return 0;if(c>=f)return-1;if(a>=t)return 1;if(this===e)return 0;let d=(f>>>=0)-(c>>>=0),r=(t>>>=0)-(a>>>=0);const n=Math.min(d,r),b=this.slice(c,f),o=e.slice(a,t);for(let e=0;e>>=0,isFinite(t)?(t>>>=0,void 0===c&&(c="utf8")):(c=t,t=void 0)}const f=this.length-a;if((void 0===t||t>f)&&(t=f),e.length>0&&(t<0||a<0)||a>this.length)throw new RangeError("Attempt to write outside buffer bounds");c||(c="utf8");let d=!1;for(;;)switch(c){case"hex":return A(this,e,a,t);case"utf8":case"utf-8":return v(this,e,a,t);case"ascii":case"latin1":case"binary":return w(this,e,a,t);case"base64":return _(this,e,a,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,a,t);default:if(d)throw new TypeError("Unknown encoding: "+c);c=(""+c).toLowerCase(),d=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const M=4096;function B(e,a,t){let c="";t=Math.min(e.length,t);for(let f=a;fc)&&(t=c);let f="";for(let c=a;ct)throw new RangeError("Trying to access beyond buffer length")}function N(e,a,t,c,f,d){if(!i.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(a>f||ae.length)throw new RangeError("Index out of range")}function R(e,a,t,c,f){H(a,c,f,e,t,7);let d=Number(a&BigInt(4294967295));e[t++]=d,d>>=8,e[t++]=d,d>>=8,e[t++]=d,d>>=8,e[t++]=d;let r=Number(a>>BigInt(32)&BigInt(4294967295));return e[t++]=r,r>>=8,e[t++]=r,r>>=8,e[t++]=r,r>>=8,e[t++]=r,t}function P(e,a,t,c,f){H(a,c,f,e,t,7);let d=Number(a&BigInt(4294967295));e[t+7]=d,d>>=8,e[t+6]=d,d>>=8,e[t+5]=d,d>>=8,e[t+4]=d;let r=Number(a>>BigInt(32)&BigInt(4294967295));return e[t+3]=r,r>>=8,e[t+2]=r,r>>=8,e[t+1]=r,r>>=8,e[t]=r,t+8}function D(e,a,t,c,f,d){if(t+c>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function O(e,a,t,c,d){return a=+a,t>>>=0,d||D(e,0,t,4),f.write(e,a,t,c,23,4),t+4}function F(e,a,t,c,d){return a=+a,t>>>=0,d||D(e,0,t,8),f.write(e,a,t,c,52,8),t+8}i.prototype.slice=function(e,a){const t=this.length;(e=~~e)<0?(e+=t)<0&&(e=0):e>t&&(e=t),(a=void 0===a?t:~~a)<0?(a+=t)<0&&(a=0):a>t&&(a=t),a>>=0,a>>>=0,t||T(e,a,this.length);let c=this[e],f=1,d=0;for(;++d>>=0,a>>>=0,t||T(e,a,this.length);let c=this[e+--a],f=1;for(;a>0&&(f*=256);)c+=this[e+--a]*f;return c},i.prototype.readUint8=i.prototype.readUInt8=function(e,a){return e>>>=0,a||T(e,1,this.length),this[e]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(e,a){return e>>>=0,a||T(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(e,a){return e>>>=0,a||T(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(e,a){return e>>>=0,a||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(e,a){return e>>>=0,a||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readBigUInt64LE=Y((function(e){$(e>>>=0,"offset");const a=this[e],t=this[e+7];void 0!==a&&void 0!==t||q(e,this.length-8);const c=a+256*this[++e]+65536*this[++e]+this[++e]*2**24,f=this[++e]+256*this[++e]+65536*this[++e]+t*2**24;return BigInt(c)+(BigInt(f)<>>=0,"offset");const a=this[e],t=this[e+7];void 0!==a&&void 0!==t||q(e,this.length-8);const c=a*2**24+65536*this[++e]+256*this[++e]+this[++e],f=this[++e]*2**24+65536*this[++e]+256*this[++e]+t;return(BigInt(c)<>>=0,a>>>=0,t||T(e,a,this.length);let c=this[e],f=1,d=0;for(;++d=f&&(c-=Math.pow(2,8*a)),c},i.prototype.readIntBE=function(e,a,t){e>>>=0,a>>>=0,t||T(e,a,this.length);let c=a,f=1,d=this[e+--c];for(;c>0&&(f*=256);)d+=this[e+--c]*f;return f*=128,d>=f&&(d-=Math.pow(2,8*a)),d},i.prototype.readInt8=function(e,a){return e>>>=0,a||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,a){e>>>=0,a||T(e,2,this.length);const t=this[e]|this[e+1]<<8;return 32768&t?4294901760|t:t},i.prototype.readInt16BE=function(e,a){e>>>=0,a||T(e,2,this.length);const t=this[e+1]|this[e]<<8;return 32768&t?4294901760|t:t},i.prototype.readInt32LE=function(e,a){return e>>>=0,a||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,a){return e>>>=0,a||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readBigInt64LE=Y((function(e){$(e>>>=0,"offset");const a=this[e],t=this[e+7];void 0!==a&&void 0!==t||q(e,this.length-8);const c=this[e+4]+256*this[e+5]+65536*this[e+6]+(t<<24);return(BigInt(c)<>>=0,"offset");const a=this[e],t=this[e+7];void 0!==a&&void 0!==t||q(e,this.length-8);const c=(a<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(c)<>>=0,a||T(e,4,this.length),f.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,a){return e>>>=0,a||T(e,4,this.length),f.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,a){return e>>>=0,a||T(e,8,this.length),f.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,a){return e>>>=0,a||T(e,8,this.length),f.read(this,e,!1,52,8)},i.prototype.writeUintLE=i.prototype.writeUIntLE=function(e,a,t,c){e=+e,a>>>=0,t>>>=0,c||N(this,e,a,t,Math.pow(2,8*t)-1,0);let f=1,d=0;for(this[a]=255&e;++d>>=0,t>>>=0,c||N(this,e,a,t,Math.pow(2,8*t)-1,0);let f=t-1,d=1;for(this[a+f]=255&e;--f>=0&&(d*=256);)this[a+f]=e/d&255;return a+t},i.prototype.writeUint8=i.prototype.writeUInt8=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,1,255,0),this[a]=255&e,a+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,2,65535,0),this[a]=255&e,this[a+1]=e>>>8,a+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,2,65535,0),this[a]=e>>>8,this[a+1]=255&e,a+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,4,4294967295,0),this[a+3]=e>>>24,this[a+2]=e>>>16,this[a+1]=e>>>8,this[a]=255&e,a+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,4,4294967295,0),this[a]=e>>>24,this[a+1]=e>>>16,this[a+2]=e>>>8,this[a+3]=255&e,a+4},i.prototype.writeBigUInt64LE=Y((function(e,a=0){return R(this,e,a,BigInt(0),BigInt("0xffffffffffffffff"))})),i.prototype.writeBigUInt64BE=Y((function(e,a=0){return P(this,e,a,BigInt(0),BigInt("0xffffffffffffffff"))})),i.prototype.writeIntLE=function(e,a,t,c){if(e=+e,a>>>=0,!c){const c=Math.pow(2,8*t-1);N(this,e,a,t,c-1,-c)}let f=0,d=1,r=0;for(this[a]=255&e;++f>>=0,!c){const c=Math.pow(2,8*t-1);N(this,e,a,t,c-1,-c)}let f=t-1,d=1,r=0;for(this[a+f]=255&e;--f>=0&&(d*=256);)e<0&&0===r&&0!==this[a+f+1]&&(r=1),this[a+f]=(e/d|0)-r&255;return a+t},i.prototype.writeInt8=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,1,127,-128),e<0&&(e=255+e+1),this[a]=255&e,a+1},i.prototype.writeInt16LE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,2,32767,-32768),this[a]=255&e,this[a+1]=e>>>8,a+2},i.prototype.writeInt16BE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,2,32767,-32768),this[a]=e>>>8,this[a+1]=255&e,a+2},i.prototype.writeInt32LE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,4,2147483647,-2147483648),this[a]=255&e,this[a+1]=e>>>8,this[a+2]=e>>>16,this[a+3]=e>>>24,a+4},i.prototype.writeInt32BE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[a]=e>>>24,this[a+1]=e>>>16,this[a+2]=e>>>8,this[a+3]=255&e,a+4},i.prototype.writeBigInt64LE=Y((function(e,a=0){return R(this,e,a,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),i.prototype.writeBigInt64BE=Y((function(e,a=0){return P(this,e,a,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),i.prototype.writeFloatLE=function(e,a,t){return O(this,e,a,!0,t)},i.prototype.writeFloatBE=function(e,a,t){return O(this,e,a,!1,t)},i.prototype.writeDoubleLE=function(e,a,t){return F(this,e,a,!0,t)},i.prototype.writeDoubleBE=function(e,a,t){return F(this,e,a,!1,t)},i.prototype.copy=function(e,a,t,c){if(!i.isBuffer(e))throw new TypeError("argument should be a Buffer");if(t||(t=0),c||0===c||(c=this.length),a>=e.length&&(a=e.length),a||(a=0),c>0&&c=this.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("sourceEnd out of bounds");c>this.length&&(c=this.length),e.length-a>>=0,t=void 0===t?this.length:t>>>0,e||(e=0),"number"==typeof e)for(f=a;f=c+4;t-=3)a=`_${e.slice(t-3,t)}${a}`;return`${e.slice(0,t)}${a}`}function H(e,a,t,c,f,d){if(e>t||e3?0===a||a===BigInt(0)?`>= 0${c} and < 2${c} ** ${8*(d+1)}${c}`:`>= -(2${c} ** ${8*(d+1)-1}${c}) and < 2 ** ${8*(d+1)-1}${c}`:`>= ${a}${c} and <= ${t}${c}`,new Q.ERR_OUT_OF_RANGE("value",f,e)}!function(e,a,t){$(a,"offset"),void 0!==e[a]&&void 0!==e[a+t]||q(a,e.length-(t+1))}(c,f,d)}function $(e,a){if("number"!=typeof e)throw new Q.ERR_INVALID_ARG_TYPE(a,"number",e)}function q(e,a,t){if(Math.floor(e)!==e)throw $(e,t),new Q.ERR_OUT_OF_RANGE(t||"offset","an integer",e);if(a<0)throw new Q.ERR_BUFFER_OUT_OF_BOUNDS;throw new Q.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${a}`,e)}U("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),U("ERR_INVALID_ARG_TYPE",(function(e,a){return`The "${e}" argument must be of type number. Received type ${typeof a}`}),TypeError),U("ERR_OUT_OF_RANGE",(function(e,a,t){let c=`The value of "${e}" is out of range.`,f=t;return Number.isInteger(t)&&Math.abs(t)>2**32?f=j(String(t)):"bigint"==typeof t&&(f=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(f=j(f)),f+="n"),c+=` It must be ${a}. Received ${f}`,c}),RangeError);const z=/[^+/0-9A-Za-z-_]/g;function G(e,a){let t;a=a||1/0;const c=e.length;let f=null;const d=[];for(let r=0;r55295&&t<57344){if(!f){if(t>56319){(a-=3)>-1&&d.push(239,191,189);continue}if(r+1===c){(a-=3)>-1&&d.push(239,191,189);continue}f=t;continue}if(t<56320){(a-=3)>-1&&d.push(239,191,189),f=t;continue}t=65536+(f-55296<<10|t-56320)}else f&&(a-=3)>-1&&d.push(239,191,189);if(f=null,t<128){if((a-=1)<0)break;d.push(t)}else if(t<2048){if((a-=2)<0)break;d.push(t>>6|192,63&t|128)}else if(t<65536){if((a-=3)<0)break;d.push(t>>12|224,t>>6&63|128,63&t|128)}else{if(!(t<1114112))throw new Error("Invalid code point");if((a-=4)<0)break;d.push(t>>18|240,t>>12&63|128,t>>6&63|128,63&t|128)}}return d}function K(e){return c.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,a,t,c){let f;for(f=0;f=a.length||f>=e.length);++f)a[f+t]=e[f];return f}function Z(e,a){return e instanceof a||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===a.name}function J(e){return e!=e}const W=function(){const e="0123456789abcdef",a=new Array(256);for(let t=0;t<16;++t){const c=16*t;for(let f=0;f<16;++f)a[c+f]=e[t]+e[f]}return a}();function Y(e){return"undefined"==typeof BigInt?X:e}function X(){throw new Error("BigInt not supported")}},89211:e=>{"use strict";var a=function(e){return e!=e};e.exports=function(e,t){return 0===e&&0===t?1/e==1/t:e===t||!(!a(e)||!a(t))}},37653:(e,a,t)=>{"use strict";var c=t(38452),f=t(10487),d=t(89211),r=t(9394),n=t(36576),i=f(r(),Object);c(i,{getPolyfill:r,implementation:d,shim:n}),e.exports=i},9394:(e,a,t)=>{"use strict";var c=t(89211);e.exports=function(){return"function"==typeof Object.is?Object.is:c}},36576:(e,a,t)=>{"use strict";var c=t(9394),f=t(38452);e.exports=function(){var e=c();return f(Object,{is:e},{is:function(){return Object.is!==e}}),e}},28875:(e,a,t)=>{"use strict";var c;if(!Object.keys){var f=Object.prototype.hasOwnProperty,d=Object.prototype.toString,r=t(1093),n=Object.prototype.propertyIsEnumerable,i=!n.call({toString:null},"toString"),b=n.call((function(){}),"prototype"),o=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],s=function(e){var a=e.constructor;return a&&a.prototype===e},l={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},u=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!l["$"+e]&&f.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{s(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();c=function(e){var a=null!==e&&"object"==typeof e,t="[object Function]"===d.call(e),c=r(e),n=a&&"[object String]"===d.call(e),l=[];if(!a&&!t&&!c)throw new TypeError("Object.keys called on a non-object");var h=b&&t;if(n&&e.length>0&&!f.call(e,0))for(var p=0;p0)for(var g=0;g{"use strict";var c=Array.prototype.slice,f=t(1093),d=Object.keys,r=d?function(e){return d(e)}:t(28875),n=Object.keys;r.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return f(e)?n(c.call(e)):n(e)})}else Object.keys=r;return Object.keys||r},e.exports=r},1093:e=>{"use strict";var a=Object.prototype.toString;e.exports=function(e){var t=a.call(e),c="[object Arguments]"===t;return c||(c="[object Array]"!==t&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===a.call(e.callee)),c}},38403:(e,a,t)=>{"use strict";var c=t(1189),f=t(41333)(),d=t(38075),r=Object,n=d("Array.prototype.push"),i=d("Object.prototype.propertyIsEnumerable"),b=f?Object.getOwnPropertySymbols:null;e.exports=function(e,a){if(null==e)throw new TypeError("target must be an object");var t=r(e);if(1===arguments.length)return t;for(var d=1;d{"use strict";var c=t(38403);e.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",a=e.split(""),t={},c=0;c{"use strict";var t="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function c(e,a){return Object.prototype.hasOwnProperty.call(e,a)}a.assign=function(e){for(var a=Array.prototype.slice.call(arguments,1);a.length;){var t=a.shift();if(t){if("object"!=typeof t)throw new TypeError(t+"must be non-object");for(var f in t)c(t,f)&&(e[f]=t[f])}}return e},a.shrinkBuf=function(e,a){return e.length===a?e:e.subarray?e.subarray(0,a):(e.length=a,e)};var f={arraySet:function(e,a,t,c,f){if(a.subarray&&e.subarray)e.set(a.subarray(t,t+c),f);else for(var d=0;d{"use strict";e.exports=function(e,a,t,c){for(var f=65535&e,d=e>>>16&65535,r=0;0!==t;){t-=r=t>2e3?2e3:t;do{d=d+(f=f+a[c++]|0)|0}while(--r);f%=65521,d%=65521}return f|d<<16}},19681:e=>{"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},14823:e=>{"use strict";var a=function(){for(var e,a=[],t=0;t<256;t++){e=t;for(var c=0;c<8;c++)e=1&e?3988292384^e>>>1:e>>>1;a[t]=e}return a}();e.exports=function(e,t,c,f){var d=a,r=f+c;e^=-1;for(var n=f;n>>8^d[255&(e^t[n])];return~e}},58411:(e,a,t)=>{"use strict";var c,f=t(9805),d=t(23665),r=t(53269),n=t(14823),i=t(54674),b=-2,o=258,s=262,l=103,u=113,h=666;function p(e,a){return e.msg=i[a],a}function g(e){return(e<<1)-(e>4?9:0)}function m(e){for(var a=e.length;--a>=0;)e[a]=0}function y(e){var a=e.state,t=a.pending;t>e.avail_out&&(t=e.avail_out),0!==t&&(f.arraySet(e.output,a.pending_buf,a.pending_out,t,e.next_out),e.next_out+=t,a.pending_out+=t,e.total_out+=t,e.avail_out-=t,a.pending-=t,0===a.pending&&(a.pending_out=0))}function x(e,a){d._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,a),e.block_start=e.strstart,y(e.strm)}function A(e,a){e.pending_buf[e.pending++]=a}function v(e,a){e.pending_buf[e.pending++]=a>>>8&255,e.pending_buf[e.pending++]=255&a}function w(e,a){var t,c,f=e.max_chain_length,d=e.strstart,r=e.prev_length,n=e.nice_match,i=e.strstart>e.w_size-s?e.strstart-(e.w_size-s):0,b=e.window,l=e.w_mask,u=e.prev,h=e.strstart+o,p=b[d+r-1],g=b[d+r];e.prev_length>=e.good_match&&(f>>=2),n>e.lookahead&&(n=e.lookahead);do{if(b[(t=a)+r]===g&&b[t+r-1]===p&&b[t]===b[d]&&b[++t]===b[d+1]){d+=2,t++;do{}while(b[++d]===b[++t]&&b[++d]===b[++t]&&b[++d]===b[++t]&&b[++d]===b[++t]&&b[++d]===b[++t]&&b[++d]===b[++t]&&b[++d]===b[++t]&&b[++d]===b[++t]&&dr){if(e.match_start=a,r=c,c>=n)break;p=b[d+r-1],g=b[d+r]}}}while((a=u[a&l])>i&&0!=--f);return r<=e.lookahead?r:e.lookahead}function _(e){var a,t,c,d,i,b,o,l,u,h,p=e.w_size;do{if(d=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-s)){f.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,a=t=e.hash_size;do{c=e.head[--a],e.head[a]=c>=p?c-p:0}while(--t);a=t=p;do{c=e.prev[--a],e.prev[a]=c>=p?c-p:0}while(--t);d+=p}if(0===e.strm.avail_in)break;if(b=e.strm,o=e.window,l=e.strstart+e.lookahead,u=d,h=void 0,(h=b.avail_in)>u&&(h=u),t=0===h?0:(b.avail_in-=h,f.arraySet(o,b.input,b.next_in,h,l),1===b.state.wrap?b.adler=r(b.adler,o,h,l):2===b.state.wrap&&(b.adler=n(b.adler,o,h,l)),b.next_in+=h,b.total_in+=h,h),e.lookahead+=t,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<=3)if(c=d._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){f=e.strstart+e.lookahead-3,c=d._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=f&&(e.ins_h=(e.ins_h<15&&(n=2,c-=16),d<1||d>9||8!==t||c<8||c>15||a<0||a>9||r<0||r>4)return p(e,b);8===c&&(c=9);var i=new M;return e.state=i,i.strm=e,i.wrap=n,i.gzhead=null,i.w_bits=c,i.w_size=1<e.pending_buf_size-5&&(t=e.pending_buf_size-5);;){if(e.lookahead<=1){if(_(e),0===e.lookahead&&0===a)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var c=e.block_start+t;if((0===e.strstart||e.strstart>=c)&&(e.lookahead=e.strstart-c,e.strstart=c,x(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-s&&(x(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===a?(x(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(x(e,!1),e.strm.avail_out),1)})),new C(4,4,8,4,I),new C(4,5,16,8,I),new C(4,6,32,32,I),new C(4,4,16,16,E),new C(8,16,32,32,E),new C(8,16,128,128,E),new C(8,32,128,256,E),new C(32,128,258,1024,E),new C(32,258,258,4096,E)],a.deflateInit=function(e,a){return L(e,a,8,15,8,0)},a.deflateInit2=L,a.deflateReset=k,a.deflateResetKeep=B,a.deflateSetHeader=function(e,a){return e&&e.state?2!==e.state.wrap?b:(e.state.gzhead=a,0):b},a.deflate=function(e,a){var t,f,r,i;if(!e||!e.state||a>5||a<0)return e?p(e,b):b;if(f=e.state,!e.output||!e.input&&0!==e.avail_in||f.status===h&&4!==a)return p(e,0===e.avail_out?-5:b);if(f.strm=e,t=f.last_flush,f.last_flush=a,42===f.status)if(2===f.wrap)e.adler=0,A(f,31),A(f,139),A(f,8),f.gzhead?(A(f,(f.gzhead.text?1:0)+(f.gzhead.hcrc?2:0)+(f.gzhead.extra?4:0)+(f.gzhead.name?8:0)+(f.gzhead.comment?16:0)),A(f,255&f.gzhead.time),A(f,f.gzhead.time>>8&255),A(f,f.gzhead.time>>16&255),A(f,f.gzhead.time>>24&255),A(f,9===f.level?2:f.strategy>=2||f.level<2?4:0),A(f,255&f.gzhead.os),f.gzhead.extra&&f.gzhead.extra.length&&(A(f,255&f.gzhead.extra.length),A(f,f.gzhead.extra.length>>8&255)),f.gzhead.hcrc&&(e.adler=n(e.adler,f.pending_buf,f.pending,0)),f.gzindex=0,f.status=69):(A(f,0),A(f,0),A(f,0),A(f,0),A(f,0),A(f,9===f.level?2:f.strategy>=2||f.level<2?4:0),A(f,3),f.status=u);else{var s=8+(f.w_bits-8<<4)<<8;s|=(f.strategy>=2||f.level<2?0:f.level<6?1:6===f.level?2:3)<<6,0!==f.strstart&&(s|=32),s+=31-s%31,f.status=u,v(f,s),0!==f.strstart&&(v(f,e.adler>>>16),v(f,65535&e.adler)),e.adler=1}if(69===f.status)if(f.gzhead.extra){for(r=f.pending;f.gzindex<(65535&f.gzhead.extra.length)&&(f.pending!==f.pending_buf_size||(f.gzhead.hcrc&&f.pending>r&&(e.adler=n(e.adler,f.pending_buf,f.pending-r,r)),y(e),r=f.pending,f.pending!==f.pending_buf_size));)A(f,255&f.gzhead.extra[f.gzindex]),f.gzindex++;f.gzhead.hcrc&&f.pending>r&&(e.adler=n(e.adler,f.pending_buf,f.pending-r,r)),f.gzindex===f.gzhead.extra.length&&(f.gzindex=0,f.status=73)}else f.status=73;if(73===f.status)if(f.gzhead.name){r=f.pending;do{if(f.pending===f.pending_buf_size&&(f.gzhead.hcrc&&f.pending>r&&(e.adler=n(e.adler,f.pending_buf,f.pending-r,r)),y(e),r=f.pending,f.pending===f.pending_buf_size)){i=1;break}i=f.gzindexr&&(e.adler=n(e.adler,f.pending_buf,f.pending-r,r)),0===i&&(f.gzindex=0,f.status=91)}else f.status=91;if(91===f.status)if(f.gzhead.comment){r=f.pending;do{if(f.pending===f.pending_buf_size&&(f.gzhead.hcrc&&f.pending>r&&(e.adler=n(e.adler,f.pending_buf,f.pending-r,r)),y(e),r=f.pending,f.pending===f.pending_buf_size)){i=1;break}i=f.gzindexr&&(e.adler=n(e.adler,f.pending_buf,f.pending-r,r)),0===i&&(f.status=l)}else f.status=l;if(f.status===l&&(f.gzhead.hcrc?(f.pending+2>f.pending_buf_size&&y(e),f.pending+2<=f.pending_buf_size&&(A(f,255&e.adler),A(f,e.adler>>8&255),e.adler=0,f.status=u)):f.status=u),0!==f.pending){if(y(e),0===e.avail_out)return f.last_flush=-1,0}else if(0===e.avail_in&&g(a)<=g(t)&&4!==a)return p(e,-5);if(f.status===h&&0!==e.avail_in)return p(e,-5);if(0!==e.avail_in||0!==f.lookahead||0!==a&&f.status!==h){var w=2===f.strategy?function(e,a){for(var t;;){if(0===e.lookahead&&(_(e),0===e.lookahead)){if(0===a)return 1;break}if(e.match_length=0,t=d._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,t&&(x(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===a?(x(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(x(e,!1),0===e.strm.avail_out)?1:2}(f,a):3===f.strategy?function(e,a){for(var t,c,f,r,n=e.window;;){if(e.lookahead<=o){if(_(e),e.lookahead<=o&&0===a)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(c=n[f=e.strstart-1])===n[++f]&&c===n[++f]&&c===n[++f]){r=e.strstart+o;do{}while(c===n[++f]&&c===n[++f]&&c===n[++f]&&c===n[++f]&&c===n[++f]&&c===n[++f]&&c===n[++f]&&c===n[++f]&&fe.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(t=d._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(t=d._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),t&&(x(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===a?(x(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(x(e,!1),0===e.strm.avail_out)?1:2}(f,a):c[f.level].func(f,a);if(3!==w&&4!==w||(f.status=h),1===w||3===w)return 0===e.avail_out&&(f.last_flush=-1),0;if(2===w&&(1===a?d._tr_align(f):5!==a&&(d._tr_stored_block(f,0,0,!1),3===a&&(m(f.head),0===f.lookahead&&(f.strstart=0,f.block_start=0,f.insert=0))),y(e),0===e.avail_out))return f.last_flush=-1,0}return 4!==a?0:f.wrap<=0?1:(2===f.wrap?(A(f,255&e.adler),A(f,e.adler>>8&255),A(f,e.adler>>16&255),A(f,e.adler>>24&255),A(f,255&e.total_in),A(f,e.total_in>>8&255),A(f,e.total_in>>16&255),A(f,e.total_in>>24&255)):(v(f,e.adler>>>16),v(f,65535&e.adler)),y(e),f.wrap>0&&(f.wrap=-f.wrap),0!==f.pending?0:1)},a.deflateEnd=function(e){var a;return e&&e.state?42!==(a=e.state.status)&&69!==a&&73!==a&&91!==a&&a!==l&&a!==u&&a!==h?p(e,b):(e.state=null,a===u?p(e,-3):0):b},a.deflateSetDictionary=function(e,a){var t,c,d,n,i,o,s,l,u=a.length;if(!e||!e.state)return b;if(2===(n=(t=e.state).wrap)||1===n&&42!==t.status||t.lookahead)return b;for(1===n&&(e.adler=r(e.adler,a,u,0)),t.wrap=0,u>=t.w_size&&(0===n&&(m(t.head),t.strstart=0,t.block_start=0,t.insert=0),l=new f.Buf8(t.w_size),f.arraySet(l,a,u-t.w_size,t.w_size,0),a=l,u=t.w_size),i=e.avail_in,o=e.next_in,s=e.input,e.avail_in=u,e.next_in=0,e.input=a,_(t);t.lookahead>=3;){c=t.strstart,d=t.lookahead-2;do{t.ins_h=(t.ins_h<{"use strict";e.exports=function(e,a){var t,c,f,d,r,n,i,b,o,s,l,u,h,p,g,m,y,x,A,v,w,_,I,E,C;t=e.state,c=e.next_in,E=e.input,f=c+(e.avail_in-5),d=e.next_out,C=e.output,r=d-(a-e.avail_out),n=d+(e.avail_out-257),i=t.dmax,b=t.wsize,o=t.whave,s=t.wnext,l=t.window,u=t.hold,h=t.bits,p=t.lencode,g=t.distcode,m=(1<>>=A=x>>>24,h-=A,0==(A=x>>>16&255))C[d++]=65535&x;else{if(!(16&A)){if(64&A){if(32&A){t.mode=12;break e}e.msg="invalid literal/length code",t.mode=30;break e}x=p[(65535&x)+(u&(1<>>=A,h-=A),h<15&&(u+=E[c++]<>>=A=x>>>24,h-=A,16&(A=x>>>16&255)){if(w=65535&x,h<(A&=15)&&(u+=E[c++]<i){e.msg="invalid distance too far back",t.mode=30;break e}if(u>>>=A,h-=A,w>(A=d-r)){if((A=w-A)>o&&t.sane){e.msg="invalid distance too far back",t.mode=30;break e}if(_=0,I=l,0===s){if(_+=b-A,A2;)C[d++]=I[_++],C[d++]=I[_++],C[d++]=I[_++],v-=3;v&&(C[d++]=I[_++],v>1&&(C[d++]=I[_++]))}else{_=d-w;do{C[d++]=C[_++],C[d++]=C[_++],C[d++]=C[_++],v-=3}while(v>2);v&&(C[d++]=C[_++],v>1&&(C[d++]=C[_++]))}break}if(64&A){e.msg="invalid distance code",t.mode=30;break e}x=g[(65535&x)+(u&(1<>3,u&=(1<<(h-=v<<3))-1,e.next_in=c,e.next_out=d,e.avail_in=c{"use strict";var c=t(9805),f=t(53269),d=t(14823),r=t(47293),n=t(21998),i=-2,b=12,o=30;function s(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function l(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new c.Buf16(320),this.work=new c.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function u(e){var a;return e&&e.state?(a=e.state,e.total_in=e.total_out=a.total=0,e.msg="",a.wrap&&(e.adler=1&a.wrap),a.mode=1,a.last=0,a.havedict=0,a.dmax=32768,a.head=null,a.hold=0,a.bits=0,a.lencode=a.lendyn=new c.Buf32(852),a.distcode=a.distdyn=new c.Buf32(592),a.sane=1,a.back=-1,0):i}function h(e){var a;return e&&e.state?((a=e.state).wsize=0,a.whave=0,a.wnext=0,u(e)):i}function p(e,a){var t,c;return e&&e.state?(c=e.state,a<0?(t=0,a=-a):(t=1+(a>>4),a<48&&(a&=15)),a&&(a<8||a>15)?i:(null!==c.window&&c.wbits!==a&&(c.window=null),c.wrap=t,c.wbits=a,h(e))):i}function g(e,a){var t,c;return e?(c=new l,e.state=c,c.window=null,0!==(t=p(e,a))&&(e.state=null),t):i}var m,y,x=!0;function A(e){if(x){var a;for(m=new c.Buf32(512),y=new c.Buf32(32),a=0;a<144;)e.lens[a++]=8;for(;a<256;)e.lens[a++]=9;for(;a<280;)e.lens[a++]=7;for(;a<288;)e.lens[a++]=8;for(n(1,e.lens,0,288,m,0,e.work,{bits:9}),a=0;a<32;)e.lens[a++]=5;n(2,e.lens,0,32,y,0,e.work,{bits:5}),x=!1}e.lencode=m,e.lenbits=9,e.distcode=y,e.distbits=5}function v(e,a,t,f){var d,r=e.state;return null===r.window&&(r.wsize=1<=r.wsize?(c.arraySet(r.window,a,t-r.wsize,r.wsize,0),r.wnext=0,r.whave=r.wsize):((d=r.wsize-r.wnext)>f&&(d=f),c.arraySet(r.window,a,t-f,d,r.wnext),(f-=d)?(c.arraySet(r.window,a,t-f,f,0),r.wnext=f,r.whave=r.wsize):(r.wnext+=d,r.wnext===r.wsize&&(r.wnext=0),r.whave>>8&255,t.check=d(t.check,F,2,0),y=0,x=0,t.mode=2;break}if(t.flags=0,t.head&&(t.head.done=!1),!(1&t.wrap)||(((255&y)<<8)+(y>>8))%31){e.msg="incorrect header check",t.mode=o;break}if(8!=(15&y)){e.msg="unknown compression method",t.mode=o;break}if(x-=4,N=8+(15&(y>>>=4)),0===t.wbits)t.wbits=N;else if(N>t.wbits){e.msg="invalid window size",t.mode=o;break}t.dmax=1<>8&1),512&t.flags&&(F[0]=255&y,F[1]=y>>>8&255,t.check=d(t.check,F,2,0)),y=0,x=0,t.mode=3;case 3:for(;x<32;){if(0===g)break e;g--,y+=l[h++]<>>8&255,F[2]=y>>>16&255,F[3]=y>>>24&255,t.check=d(t.check,F,4,0)),y=0,x=0,t.mode=4;case 4:for(;x<16;){if(0===g)break e;g--,y+=l[h++]<>8),512&t.flags&&(F[0]=255&y,F[1]=y>>>8&255,t.check=d(t.check,F,2,0)),y=0,x=0,t.mode=5;case 5:if(1024&t.flags){for(;x<16;){if(0===g)break e;g--,y+=l[h++]<>>8&255,t.check=d(t.check,F,2,0)),y=0,x=0}else t.head&&(t.head.extra=null);t.mode=6;case 6:if(1024&t.flags&&((I=t.length)>g&&(I=g),I&&(t.head&&(N=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Array(t.head.extra_len)),c.arraySet(t.head.extra,l,h,I,N)),512&t.flags&&(t.check=d(t.check,l,I,h)),g-=I,h+=I,t.length-=I),t.length))break e;t.length=0,t.mode=7;case 7:if(2048&t.flags){if(0===g)break e;I=0;do{N=l[h+I++],t.head&&N&&t.length<65536&&(t.head.name+=String.fromCharCode(N))}while(N&&I>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=b;break;case 10:for(;x<32;){if(0===g)break e;g--,y+=l[h++]<>>=7&x,x-=7&x,t.mode=27;break}for(;x<3;){if(0===g)break e;g--,y+=l[h++]<>>=1)){case 0:t.mode=14;break;case 1:if(A(t),t.mode=20,6===a){y>>>=2,x-=2;break e}break;case 2:t.mode=17;break;case 3:e.msg="invalid block type",t.mode=o}y>>>=2,x-=2;break;case 14:for(y>>>=7&x,x-=7&x;x<32;){if(0===g)break e;g--,y+=l[h++]<>>16^65535)){e.msg="invalid stored block lengths",t.mode=o;break}if(t.length=65535&y,y=0,x=0,t.mode=15,6===a)break e;case 15:t.mode=16;case 16:if(I=t.length){if(I>g&&(I=g),I>m&&(I=m),0===I)break e;c.arraySet(u,l,h,I,p),g-=I,h+=I,m-=I,p+=I,t.length-=I;break}t.mode=b;break;case 17:for(;x<14;){if(0===g)break e;g--,y+=l[h++]<>>=5,x-=5,t.ndist=1+(31&y),y>>>=5,x-=5,t.ncode=4+(15&y),y>>>=4,x-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=o;break}t.have=0,t.mode=18;case 18:for(;t.have>>=3,x-=3}for(;t.have<19;)t.lens[Q[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,P={bits:t.lenbits},R=n(0,t.lens,0,19,t.lencode,0,t.work,P),t.lenbits=P.bits,R){e.msg="invalid code lengths set",t.mode=o;break}t.have=0,t.mode=19;case 19:for(;t.have>>16&255,k=65535&O,!((M=O>>>24)<=x);){if(0===g)break e;g--,y+=l[h++]<>>=M,x-=M,t.lens[t.have++]=k;else{if(16===k){for(D=M+2;x>>=M,x-=M,0===t.have){e.msg="invalid bit length repeat",t.mode=o;break}N=t.lens[t.have-1],I=3+(3&y),y>>>=2,x-=2}else if(17===k){for(D=M+3;x>>=M)),y>>>=3,x-=3}else{for(D=M+7;x>>=M)),y>>>=7,x-=7}if(t.have+I>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=o;break}for(;I--;)t.lens[t.have++]=N}}if(t.mode===o)break;if(0===t.lens[256]){e.msg="invalid code -- missing end-of-block",t.mode=o;break}if(t.lenbits=9,P={bits:t.lenbits},R=n(1,t.lens,0,t.nlen,t.lencode,0,t.work,P),t.lenbits=P.bits,R){e.msg="invalid literal/lengths set",t.mode=o;break}if(t.distbits=6,t.distcode=t.distdyn,P={bits:t.distbits},R=n(2,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,P),t.distbits=P.bits,R){e.msg="invalid distances set",t.mode=o;break}if(t.mode=20,6===a)break e;case 20:t.mode=21;case 21:if(g>=6&&m>=258){e.next_out=p,e.avail_out=m,e.next_in=h,e.avail_in=g,t.hold=y,t.bits=x,r(e,_),p=e.next_out,u=e.output,m=e.avail_out,h=e.next_in,l=e.input,g=e.avail_in,y=t.hold,x=t.bits,t.mode===b&&(t.back=-1);break}for(t.back=0;B=(O=t.lencode[y&(1<>>16&255,k=65535&O,!((M=O>>>24)<=x);){if(0===g)break e;g--,y+=l[h++]<>L)])>>>16&255,k=65535&O,!(L+(M=O>>>24)<=x);){if(0===g)break e;g--,y+=l[h++]<>>=L,x-=L,t.back+=L}if(y>>>=M,x-=M,t.back+=M,t.length=k,0===B){t.mode=26;break}if(32&B){t.back=-1,t.mode=b;break}if(64&B){e.msg="invalid literal/length code",t.mode=o;break}t.extra=15&B,t.mode=22;case 22:if(t.extra){for(D=t.extra;x>>=t.extra,x-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=23;case 23:for(;B=(O=t.distcode[y&(1<>>16&255,k=65535&O,!((M=O>>>24)<=x);){if(0===g)break e;g--,y+=l[h++]<>L)])>>>16&255,k=65535&O,!(L+(M=O>>>24)<=x);){if(0===g)break e;g--,y+=l[h++]<>>=L,x-=L,t.back+=L}if(y>>>=M,x-=M,t.back+=M,64&B){e.msg="invalid distance code",t.mode=o;break}t.offset=k,t.extra=15&B,t.mode=24;case 24:if(t.extra){for(D=t.extra;x>>=t.extra,x-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=o;break}t.mode=25;case 25:if(0===m)break e;if(I=_-m,t.offset>I){if((I=t.offset-I)>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=o;break}I>t.wnext?(I-=t.wnext,E=t.wsize-I):E=t.wnext-I,I>t.length&&(I=t.length),C=t.window}else C=u,E=p-t.offset,I=t.length;I>m&&(I=m),m-=I,t.length-=I;do{u[p++]=C[E++]}while(--I);0===t.length&&(t.mode=21);break;case 26:if(0===m)break e;u[p++]=t.length,m--,t.mode=21;break;case 27:if(t.wrap){for(;x<32;){if(0===g)break e;g--,y|=l[h++]<{"use strict";var c=t(9805),f=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],d=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],r=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],n=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(e,a,t,i,b,o,s,l){var u,h,p,g,m,y,x,A,v,w=l.bits,_=0,I=0,E=0,C=0,M=0,B=0,k=0,L=0,S=0,T=0,N=null,R=0,P=new c.Buf16(16),D=new c.Buf16(16),O=null,F=0;for(_=0;_<=15;_++)P[_]=0;for(I=0;I=1&&0===P[C];C--);if(M>C&&(M=C),0===C)return b[o++]=20971520,b[o++]=20971520,l.bits=1,0;for(E=1;E0&&(0===e||1!==C))return-1;for(D[1]=0,_=1;_<15;_++)D[_+1]=D[_]+P[_];for(I=0;I852||2===e&&S>592)return 1;for(;;){x=_-k,s[I]y?(A=O[F+s[I]],v=N[R+s[I]]):(A=96,v=0),u=1<<_-k,E=h=1<>k)+(h-=u)]=x<<24|A<<16|v}while(0!==h);for(u=1<<_-1;T&u;)u>>=1;if(0!==u?(T&=u-1,T+=u):T=0,I++,0==--P[_]){if(_===C)break;_=a[t+s[I]]}if(_>M&&(T&g)!==p){for(0===k&&(k=M),m+=E,L=1<<(B=_-k);B+k852||2===e&&S>592)return 1;b[p=T&g]=M<<24|B<<16|m-o}}return 0!==T&&(b[m+T]=_-k<<24|64<<16),l.bits=M,0}},54674:e=>{"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},23665:(e,a,t)=>{"use strict";var c=t(9805);function f(e){for(var a=e.length;--a>=0;)e[a]=0}var d=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],r=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],i=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],b=new Array(576);f(b);var o=new Array(60);f(o);var s=new Array(512);f(s);var l=new Array(256);f(l);var u=new Array(29);f(u);var h,p,g,m=new Array(30);function y(e,a,t,c,f){this.static_tree=e,this.extra_bits=a,this.extra_base=t,this.elems=c,this.max_length=f,this.has_stree=e&&e.length}function x(e,a){this.dyn_tree=e,this.max_code=0,this.stat_desc=a}function A(e){return e<256?s[e]:s[256+(e>>>7)]}function v(e,a){e.pending_buf[e.pending++]=255&a,e.pending_buf[e.pending++]=a>>>8&255}function w(e,a,t){e.bi_valid>16-t?(e.bi_buf|=a<>16-e.bi_valid,e.bi_valid+=t-16):(e.bi_buf|=a<>>=1,t<<=1}while(--a>0);return t>>>1}function E(e,a,t){var c,f,d=new Array(16),r=0;for(c=1;c<=15;c++)d[c]=r=r+t[c-1]<<1;for(f=0;f<=a;f++){var n=e[2*f+1];0!==n&&(e[2*f]=I(d[n]++,n))}}function C(e){var a;for(a=0;a<286;a++)e.dyn_ltree[2*a]=0;for(a=0;a<30;a++)e.dyn_dtree[2*a]=0;for(a=0;a<19;a++)e.bl_tree[2*a]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function M(e){e.bi_valid>8?v(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function B(e,a,t,c){var f=2*a,d=2*t;return e[f]>1;t>=1;t--)k(e,d,t);f=i;do{t=e.heap[1],e.heap[1]=e.heap[e.heap_len--],k(e,d,1),c=e.heap[1],e.heap[--e.heap_max]=t,e.heap[--e.heap_max]=c,d[2*f]=d[2*t]+d[2*c],e.depth[f]=(e.depth[t]>=e.depth[c]?e.depth[t]:e.depth[c])+1,d[2*t+1]=d[2*c+1]=f,e.heap[1]=f++,k(e,d,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,a){var t,c,f,d,r,n,i=a.dyn_tree,b=a.max_code,o=a.stat_desc.static_tree,s=a.stat_desc.has_stree,l=a.stat_desc.extra_bits,u=a.stat_desc.extra_base,h=a.stat_desc.max_length,p=0;for(d=0;d<=15;d++)e.bl_count[d]=0;for(i[2*e.heap[e.heap_max]+1]=0,t=e.heap_max+1;t<573;t++)(d=i[2*i[2*(c=e.heap[t])+1]+1]+1)>h&&(d=h,p++),i[2*c+1]=d,c>b||(e.bl_count[d]++,r=0,c>=u&&(r=l[c-u]),n=i[2*c],e.opt_len+=n*(d+r),s&&(e.static_len+=n*(o[2*c+1]+r)));if(0!==p){do{for(d=h-1;0===e.bl_count[d];)d--;e.bl_count[d]--,e.bl_count[d+1]+=2,e.bl_count[h]--,p-=2}while(p>0);for(d=h;0!==d;d--)for(c=e.bl_count[d];0!==c;)(f=e.heap[--t])>b||(i[2*f+1]!==d&&(e.opt_len+=(d-i[2*f+1])*i[2*f],i[2*f+1]=d),c--)}}(e,a),E(d,b,e.bl_count)}function T(e,a,t){var c,f,d=-1,r=a[1],n=0,i=7,b=4;for(0===r&&(i=138,b=3),a[2*(t+1)+1]=65535,c=0;c<=t;c++)f=r,r=a[2*(c+1)+1],++n>=7;c<30;c++)for(m[c]=f<<7,e=0;e<1<0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var a,t=4093624447;for(a=0;a<=31;a++,t>>>=1)if(1&t&&0!==e.dyn_ltree[2*a])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(a=32;a<256;a++)if(0!==e.dyn_ltree[2*a])return 1;return 0}(e)),S(e,e.l_desc),S(e,e.d_desc),r=function(e){var a;for(T(e,e.dyn_ltree,e.l_desc.max_code),T(e,e.dyn_dtree,e.d_desc.max_code),S(e,e.bl_desc),a=18;a>=3&&0===e.bl_tree[2*i[a]+1];a--);return e.opt_len+=3*(a+1)+5+5+4,a}(e),f=e.opt_len+3+7>>>3,(d=e.static_len+3+7>>>3)<=f&&(f=d)):f=d=t+5,t+4<=f&&-1!==a?P(e,a,t,c):4===e.strategy||d===f?(w(e,2+(c?1:0),3),L(e,b,o)):(w(e,4+(c?1:0),3),function(e,a,t,c){var f;for(w(e,a-257,5),w(e,t-1,5),w(e,c-4,4),f=0;f>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&a,e.pending_buf[e.l_buf+e.last_lit]=255&t,e.last_lit++,0===a?e.dyn_ltree[2*t]++:(e.matches++,a--,e.dyn_ltree[2*(l[t]+256+1)]++,e.dyn_dtree[2*A(a)]++),e.last_lit===e.lit_bufsize-1},a._tr_align=function(e){w(e,2,3),_(e,256,b),function(e){16===e.bi_valid?(v(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},44442:e=>{"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},21137:(e,a,t)=>{"use strict";var c=t(87568);a.certificate=t(36413);var f=c.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));a.RSAPrivateKey=f;var d=c.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));a.RSAPublicKey=d;var r=c.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),n=c.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(r),this.key("subjectPublicKey").bitstr())}));a.PublicKey=n;var i=c.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(r),this.key("subjectPrivateKey").octstr())}));a.PrivateKey=i;var b=c.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));a.EncryptedPrivateKey=b;var o=c.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));a.DSAPrivateKey=o,a.DSAparam=c.define("DSAparam",(function(){this.int()}));var s=c.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})})),l=c.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(s),this.key("publicKey").optional().explicit(1).bitstr())}));a.ECPrivateKey=l,a.signature=c.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},36413:(e,a,t)=>{"use strict";var c=t(87568),f=c.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),d=c.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),r=c.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),n=c.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(r),this.key("subjectPublicKey").bitstr())})),i=c.define("RelativeDistinguishedName",(function(){this.setof(d)})),b=c.define("RDNSequence",(function(){this.seqof(i)})),o=c.define("Name",(function(){this.choice({rdnSequence:this.use(b)})})),s=c.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(f),this.key("notAfter").use(f))})),l=c.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),u=c.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(r),this.key("issuer").use(o),this.key("validity").use(s),this.key("subject").use(o),this.key("subjectPublicKeyInfo").use(n),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(l).optional())})),h=c.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(u),this.key("signatureAlgorithm").use(r),this.key("signatureValue").bitstr())}));e.exports=h},24101:(e,a,t)=>{"use strict";var c=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,f=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,d=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,r=t(68078),n=t(1241),i=t(92861).Buffer;e.exports=function(e,a){var t,b=e.toString(),o=b.match(c);if(o){var s="aes"+o[1],l=i.from(o[2],"hex"),u=i.from(o[3].replace(/[\r\n]/g,""),"base64"),h=r(a,l.slice(0,8),parseInt(o[1],10)).key,p=[],g=n.createDecipheriv(s,h,l);p.push(g.update(u)),p.push(g.final()),t=i.concat(p)}else{var m=b.match(d);t=i.from(m[2].replace(/[\r\n]/g,""),"base64")}return{tag:b.match(f)[1],data:t}}},78170:(e,a,t)=>{"use strict";var c=t(21137),f=t(15579),d=t(24101),r=t(1241),n=t(78396),i=t(92861).Buffer;function b(e){var a;"object"!=typeof e||i.isBuffer(e)||(a=e.passphrase,e=e.key),"string"==typeof e&&(e=i.from(e));var t,b,o=d(e,a),s=o.tag,l=o.data;switch(s){case"CERTIFICATE":b=c.certificate.decode(l,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(b||(b=c.PublicKey.decode(l,"der")),t=b.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return c.RSAPublicKey.decode(b.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return b.subjectPrivateKey=b.subjectPublicKey,{type:"ec",data:b};case"1.2.840.10040.4.1":return b.algorithm.params.pub_key=c.DSAparam.decode(b.subjectPublicKey.data,"der"),{type:"dsa",data:b.algorithm.params};default:throw new Error("unknown key id "+t)}case"ENCRYPTED PRIVATE KEY":l=function(e,a){var t=e.algorithm.decrypt.kde.kdeparams.salt,c=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),d=f[e.algorithm.decrypt.cipher.algo.join(".")],b=e.algorithm.decrypt.cipher.iv,o=e.subjectPrivateKey,s=parseInt(d.split("-")[1],10)/8,l=n.pbkdf2Sync(a,t,c,s,"sha1"),u=r.createDecipheriv(d,l,b),h=[];return h.push(u.update(o)),h.push(u.final()),i.concat(h)}(l=c.EncryptedPrivateKey.decode(l,"der"),a);case"PRIVATE KEY":switch(t=(b=c.PrivateKey.decode(l,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return c.RSAPrivateKey.decode(b.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:b.algorithm.curve,privateKey:c.ECPrivateKey.decode(b.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return b.algorithm.params.priv_key=c.DSAparam.decode(b.subjectPrivateKey,"der"),{type:"dsa",params:b.algorithm.params};default:throw new Error("unknown key id "+t)}case"RSA PUBLIC KEY":return c.RSAPublicKey.decode(l,"der");case"RSA PRIVATE KEY":return c.RSAPrivateKey.decode(l,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:c.DSAPrivateKey.decode(l,"der")};case"EC PRIVATE KEY":return{curve:(l=c.ECPrivateKey.decode(l,"der")).parameters.value,privateKey:l.privateKey};default:throw new Error("unknown key type "+s)}}b.signature=c.signature,e.exports=b},78396:(e,a,t)=>{a.pbkdf2=t(43832),a.pbkdf2Sync=t(21352)},43832:(e,a,t)=>{var c,f,d=t(92861).Buffer,r=t(64196),n=t(2455),i=t(21352),b=t(93382),o=t.g.crypto&&t.g.crypto.subtle,s={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},l=[];function u(){return f||(f=t.g.process&&t.g.process.nextTick?t.g.process.nextTick:t.g.queueMicrotask?t.g.queueMicrotask:t.g.setImmediate?t.g.setImmediate:t.g.setTimeout)}function h(e,a,t,c,f){return o.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then((function(e){return o.deriveBits({name:"PBKDF2",salt:a,iterations:t,hash:{name:f}},e,c<<3)})).then((function(e){return d.from(e)}))}e.exports=function(e,a,f,p,g,m){"function"==typeof g&&(m=g,g=void 0);var y=s[(g=g||"sha1").toLowerCase()];if(y&&"function"==typeof t.g.Promise){if(r(f,p),e=b(e,n,"Password"),a=b(a,n,"Salt"),"function"!=typeof m)throw new Error("No callback provided to pbkdf2");!function(e,a){e.then((function(e){u()((function(){a(null,e)}))}),(function(e){u()((function(){a(e)}))}))}(function(e){if(t.g.process&&!t.g.process.browser)return Promise.resolve(!1);if(!o||!o.importKey||!o.deriveBits)return Promise.resolve(!1);if(void 0!==l[e])return l[e];var a=h(c=c||d.alloc(8),c,10,128,e).then((function(){return!0})).catch((function(){return!1}));return l[e]=a,a}(y).then((function(t){return t?h(e,a,f,p,y):i(e,a,f,p,g)})),m)}else u()((function(){var t;try{t=i(e,a,f,p,g)}catch(e){return m(e)}m(null,t)}))}},2455:(e,a,t)=>{var c;c=t.g.process&&t.g.process.browser?"utf-8":t.g.process&&t.g.process.version?parseInt(process.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary":"utf-8",e.exports=c},64196:e=>{var a=Math.pow(2,30)-1;e.exports=function(e,t){if("number"!=typeof e)throw new TypeError("Iterations not a number");if(e<0)throw new TypeError("Bad iterations");if("number"!=typeof t)throw new TypeError("Key length not a number");if(t<0||t>a||t!=t)throw new TypeError("Bad key length")}},21352:(e,a,t)=>{var c=t(20320),f=t(66011),d=t(62802),r=t(92861).Buffer,n=t(64196),i=t(2455),b=t(93382),o=r.alloc(128),s={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function l(e,a,t){var n=function(e){return"rmd160"===e||"ripemd160"===e?function(e){return(new f).update(e).digest()}:"md5"===e?c:function(a){return d(e).update(a).digest()}}(e),i="sha512"===e||"sha384"===e?128:64;a.length>i?a=n(a):a.length{var c=t(92861).Buffer;e.exports=function(e,a,t){if(c.isBuffer(e))return e;if("string"==typeof e)return c.from(e,a);if(ArrayBuffer.isView(e))return c.from(e.buffer);throw new TypeError(t+" must be a string, a Buffer, a typed array or a DataView")}},71843:(e,a,t)=>{"use strict";const{ErrorWithCause:c}=t(75832),{findCauseByReference:f,getErrorCause:d,messageWithCauses:r,stackWithCauses:n}=t(94306);e.exports={ErrorWithCause:c,findCauseByReference:f,getErrorCause:d,stackWithCauses:n,messageWithCauses:r}},75832:e=>{"use strict";class a extends Error{constructor(e,{cause:t}={}){super(e),this.name=a.name,t&&(this.cause=t),this.message=e}}e.exports={ErrorWithCause:a}},94306:e=>{"use strict";const a=e=>{if(e&&"object"==typeof e&&"cause"in e){if("function"==typeof e.cause){const a=e.cause();return a instanceof Error?a:void 0}return e.cause instanceof Error?e.cause:void 0}},t=(e,c)=>{if(!(e instanceof Error))return"";const f=e.stack||"";if(c.has(e))return f+"\ncauses have become circular...";const d=a(e);return d?(c.add(e),f+"\ncaused by: "+t(d,c)):f},c=(e,t,f)=>{if(!(e instanceof Error))return"";const d=f?"":e.message||"";if(t.has(e))return d+": ...";const r=a(e);if(r){t.add(e);const a="cause"in e&&"function"==typeof e.cause;return d+(a?"":": ")+c(r,t,a)}return d};e.exports={findCauseByReference:(e,t)=>{if(!e||!t)return;if(!(e instanceof Error))return;if(!(t.prototype instanceof Error)&&t!==Error)return;const c=new Set;let f=e;for(;f&&!c.has(f);){if(c.add(f),f instanceof t)return f;f=a(f)}},getErrorCause:a,stackWithCauses:e=>t(e,new Set),messageWithCauses:e=>c(e,new Set)}},76578:e=>{"use strict";e.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},33225:e=>{"use strict";"undefined"==typeof process||!process.version||0===process.version.indexOf("v0.")||0===process.version.indexOf("v1.")&&0!==process.version.indexOf("v1.8.")?e.exports={nextTick:function(e,a,t,c){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var f,d,r=arguments.length;switch(r){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick((function(){e.call(null,a)}));case 3:return process.nextTick((function(){e.call(null,a,t)}));case 4:return process.nextTick((function(){e.call(null,a,t,c)}));default:for(f=new Array(r-1),d=0;d{a.publicEncrypt=t(28902),a.privateDecrypt=t(77362),a.privateEncrypt=function(e,t){return a.publicEncrypt(e,t,!0)},a.publicDecrypt=function(e,t){return a.privateDecrypt(e,t,!0)}},48206:(e,a,t)=>{var c=t(47108),f=t(92861).Buffer;function d(e){var a=f.allocUnsafe(4);return a.writeUInt32BE(e,0),a}e.exports=function(e,a){for(var t,r=f.alloc(0),n=0;r.length=65&&t<=70?t-55:t>=97&&t<=102?t-87:t-48&15}function i(e,a,t){var c=n(e,t);return t-1>=a&&(c|=n(e,t-1)<<4),c}function b(e,a,t,c){for(var f=0,d=Math.min(e.length,t),r=a;r=49?n-49+10:n>=17?n-17+10:n}return f}d.isBN=function(e){return e instanceof d||null!==e&&"object"==typeof e&&e.constructor.wordSize===d.wordSize&&Array.isArray(e.words)},d.max=function(e,a){return e.cmp(a)>0?e:a},d.min=function(e,a){return e.cmp(a)<0?e:a},d.prototype._init=function(e,a,t){if("number"==typeof e)return this._initNumber(e,a,t);if("object"==typeof e)return this._initArray(e,a,t);"hex"===a&&(a=16),c(a===(0|a)&&a>=2&&a<=36);var f=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(f++,this.negative=1),f=0;f-=3)r=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[d]|=r<>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);else if("le"===t)for(f=0,d=0;f>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);return this.strip()},d.prototype._parseHex=function(e,a,t){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)f=i(e,a,c)<=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;else for(c=(e.length-a)%2==0?a+1:a;c=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;this.strip()},d.prototype._parseBase=function(e,a,t){this.words=[0],this.length=1;for(var c=0,f=1;f<=67108863;f*=a)c++;c--,f=f/a|0;for(var d=e.length-t,r=d%c,n=Math.min(d,d-r)+t,i=0,o=t;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},d.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},d.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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],l=[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 u(e,a,t){t.negative=a.negative^e.negative;var c=e.length+a.length|0;t.length=c,c=c-1|0;var f=0|e.words[0],d=0|a.words[0],r=f*d,n=67108863&r,i=r/67108864|0;t.words[0]=n;for(var b=1;b>>26,s=67108863&i,l=Math.min(b,a.length-1),u=Math.max(0,b-e.length+1);u<=l;u++){var h=b-u|0;o+=(r=(f=0|e.words[h])*(d=0|a.words[u])+s)/67108864|0,s=67108863&r}t.words[b]=0|s,i=0|o}return 0!==i?t.words[b]=0|i:t.length--,t.strip()}d.prototype.toString=function(e,a){var t;if(a=0|a||1,16===(e=e||10)||"hex"===e){t="";for(var f=0,d=0,r=0;r>>24-f&16777215)||r!==this.length-1?o[6-i.length]+i+t:i+t,(f+=2)>=26&&(f-=26,r--)}for(0!==d&&(t=d.toString(16)+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(e===(0|e)&&e>=2&&e<=36){var b=s[e],u=l[e];t="";var h=this.clone();for(h.negative=0;!h.isZero();){var p=h.modn(u).toString(e);t=(h=h.idivn(u)).isZero()?p+t:o[b-p.length]+p+t}for(this.isZero()&&(t="0"+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}c(!1,"Base should be between 2 and 36")},d.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&c(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},d.prototype.toJSON=function(){return this.toString(16)},d.prototype.toBuffer=function(e,a){return c(void 0!==r),this.toArrayLike(r,e,a)},d.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},d.prototype.toArrayLike=function(e,a,t){var f=this.byteLength(),d=t||Math.max(1,f);c(f<=d,"byte array longer than desired length"),c(d>0,"Requested array length <= 0"),this.strip();var r,n,i="le"===a,b=new e(d),o=this.clone();if(i){for(n=0;!o.isZero();n++)r=o.andln(255),o.iushrn(8),b[n]=r;for(;n=4096&&(t+=13,a>>>=13),a>=64&&(t+=7,a>>>=7),a>=8&&(t+=4,a>>>=4),a>=2&&(t+=2,a>>>=2),t+a},d.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,t=0;return 8191&a||(t+=13,a>>>=13),127&a||(t+=7,a>>>=7),15&a||(t+=4,a>>>=4),3&a||(t+=2,a>>>=2),1&a||t++,t},d.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},d.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},d.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},d.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var t=0;te.length?this.clone().iand(e):e.clone().iand(this)},d.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},d.prototype.iuxor=function(e){var a,t;this.length>e.length?(a=this,t=e):(a=e,t=this);for(var c=0;ce.length?this.clone().ixor(e):e.clone().ixor(this)},d.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},d.prototype.inotn=function(e){c("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),t=e%26;this._expand(a),t>0&&a--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-t),this.strip()},d.prototype.notn=function(e){return this.clone().inotn(e)},d.prototype.setn=function(e,a){c("number"==typeof e&&e>=0);var t=e/26|0,f=e%26;return this._expand(t+1),this.words[t]=a?this.words[t]|1<e.length?(t=this,c=e):(t=e,c=this);for(var f=0,d=0;d>>26;for(;0!==f&&d>>26;if(this.length=t.length,0!==f)this.words[this.length]=f,this.length++;else if(t!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},d.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var t,c,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(t=this,c=e):(t=e,c=this);for(var d=0,r=0;r>26,this.words[r]=67108863&a;for(;0!==d&&r>26,this.words[r]=67108863&a;if(0===d&&r>>13,u=0|r[1],h=8191&u,p=u>>>13,g=0|r[2],m=8191&g,y=g>>>13,x=0|r[3],A=8191&x,v=x>>>13,w=0|r[4],_=8191&w,I=w>>>13,E=0|r[5],C=8191&E,M=E>>>13,B=0|r[6],k=8191&B,L=B>>>13,S=0|r[7],T=8191&S,N=S>>>13,R=0|r[8],P=8191&R,D=R>>>13,O=0|r[9],F=8191&O,Q=O>>>13,U=0|n[0],j=8191&U,H=U>>>13,$=0|n[1],q=8191&$,z=$>>>13,G=0|n[2],K=8191&G,V=G>>>13,Z=0|n[3],J=8191&Z,W=Z>>>13,Y=0|n[4],X=8191&Y,ee=Y>>>13,ae=0|n[5],te=8191&ae,ce=ae>>>13,fe=0|n[6],de=8191&fe,re=fe>>>13,ne=0|n[7],ie=8191&ne,be=ne>>>13,oe=0|n[8],se=8191&oe,le=oe>>>13,ue=0|n[9],he=8191&ue,pe=ue>>>13;t.negative=e.negative^a.negative,t.length=19;var ge=(b+(c=Math.imul(s,j))|0)+((8191&(f=(f=Math.imul(s,H))+Math.imul(l,j)|0))<<13)|0;b=((d=Math.imul(l,H))+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,c=Math.imul(h,j),f=(f=Math.imul(h,H))+Math.imul(p,j)|0,d=Math.imul(p,H);var me=(b+(c=c+Math.imul(s,q)|0)|0)+((8191&(f=(f=f+Math.imul(s,z)|0)+Math.imul(l,q)|0))<<13)|0;b=((d=d+Math.imul(l,z)|0)+(f>>>13)|0)+(me>>>26)|0,me&=67108863,c=Math.imul(m,j),f=(f=Math.imul(m,H))+Math.imul(y,j)|0,d=Math.imul(y,H),c=c+Math.imul(h,q)|0,f=(f=f+Math.imul(h,z)|0)+Math.imul(p,q)|0,d=d+Math.imul(p,z)|0;var ye=(b+(c=c+Math.imul(s,K)|0)|0)+((8191&(f=(f=f+Math.imul(s,V)|0)+Math.imul(l,K)|0))<<13)|0;b=((d=d+Math.imul(l,V)|0)+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,c=Math.imul(A,j),f=(f=Math.imul(A,H))+Math.imul(v,j)|0,d=Math.imul(v,H),c=c+Math.imul(m,q)|0,f=(f=f+Math.imul(m,z)|0)+Math.imul(y,q)|0,d=d+Math.imul(y,z)|0,c=c+Math.imul(h,K)|0,f=(f=f+Math.imul(h,V)|0)+Math.imul(p,K)|0,d=d+Math.imul(p,V)|0;var xe=(b+(c=c+Math.imul(s,J)|0)|0)+((8191&(f=(f=f+Math.imul(s,W)|0)+Math.imul(l,J)|0))<<13)|0;b=((d=d+Math.imul(l,W)|0)+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,c=Math.imul(_,j),f=(f=Math.imul(_,H))+Math.imul(I,j)|0,d=Math.imul(I,H),c=c+Math.imul(A,q)|0,f=(f=f+Math.imul(A,z)|0)+Math.imul(v,q)|0,d=d+Math.imul(v,z)|0,c=c+Math.imul(m,K)|0,f=(f=f+Math.imul(m,V)|0)+Math.imul(y,K)|0,d=d+Math.imul(y,V)|0,c=c+Math.imul(h,J)|0,f=(f=f+Math.imul(h,W)|0)+Math.imul(p,J)|0,d=d+Math.imul(p,W)|0;var Ae=(b+(c=c+Math.imul(s,X)|0)|0)+((8191&(f=(f=f+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;b=((d=d+Math.imul(l,ee)|0)+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,c=Math.imul(C,j),f=(f=Math.imul(C,H))+Math.imul(M,j)|0,d=Math.imul(M,H),c=c+Math.imul(_,q)|0,f=(f=f+Math.imul(_,z)|0)+Math.imul(I,q)|0,d=d+Math.imul(I,z)|0,c=c+Math.imul(A,K)|0,f=(f=f+Math.imul(A,V)|0)+Math.imul(v,K)|0,d=d+Math.imul(v,V)|0,c=c+Math.imul(m,J)|0,f=(f=f+Math.imul(m,W)|0)+Math.imul(y,J)|0,d=d+Math.imul(y,W)|0,c=c+Math.imul(h,X)|0,f=(f=f+Math.imul(h,ee)|0)+Math.imul(p,X)|0,d=d+Math.imul(p,ee)|0;var ve=(b+(c=c+Math.imul(s,te)|0)|0)+((8191&(f=(f=f+Math.imul(s,ce)|0)+Math.imul(l,te)|0))<<13)|0;b=((d=d+Math.imul(l,ce)|0)+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,c=Math.imul(k,j),f=(f=Math.imul(k,H))+Math.imul(L,j)|0,d=Math.imul(L,H),c=c+Math.imul(C,q)|0,f=(f=f+Math.imul(C,z)|0)+Math.imul(M,q)|0,d=d+Math.imul(M,z)|0,c=c+Math.imul(_,K)|0,f=(f=f+Math.imul(_,V)|0)+Math.imul(I,K)|0,d=d+Math.imul(I,V)|0,c=c+Math.imul(A,J)|0,f=(f=f+Math.imul(A,W)|0)+Math.imul(v,J)|0,d=d+Math.imul(v,W)|0,c=c+Math.imul(m,X)|0,f=(f=f+Math.imul(m,ee)|0)+Math.imul(y,X)|0,d=d+Math.imul(y,ee)|0,c=c+Math.imul(h,te)|0,f=(f=f+Math.imul(h,ce)|0)+Math.imul(p,te)|0,d=d+Math.imul(p,ce)|0;var we=(b+(c=c+Math.imul(s,de)|0)|0)+((8191&(f=(f=f+Math.imul(s,re)|0)+Math.imul(l,de)|0))<<13)|0;b=((d=d+Math.imul(l,re)|0)+(f>>>13)|0)+(we>>>26)|0,we&=67108863,c=Math.imul(T,j),f=(f=Math.imul(T,H))+Math.imul(N,j)|0,d=Math.imul(N,H),c=c+Math.imul(k,q)|0,f=(f=f+Math.imul(k,z)|0)+Math.imul(L,q)|0,d=d+Math.imul(L,z)|0,c=c+Math.imul(C,K)|0,f=(f=f+Math.imul(C,V)|0)+Math.imul(M,K)|0,d=d+Math.imul(M,V)|0,c=c+Math.imul(_,J)|0,f=(f=f+Math.imul(_,W)|0)+Math.imul(I,J)|0,d=d+Math.imul(I,W)|0,c=c+Math.imul(A,X)|0,f=(f=f+Math.imul(A,ee)|0)+Math.imul(v,X)|0,d=d+Math.imul(v,ee)|0,c=c+Math.imul(m,te)|0,f=(f=f+Math.imul(m,ce)|0)+Math.imul(y,te)|0,d=d+Math.imul(y,ce)|0,c=c+Math.imul(h,de)|0,f=(f=f+Math.imul(h,re)|0)+Math.imul(p,de)|0,d=d+Math.imul(p,re)|0;var _e=(b+(c=c+Math.imul(s,ie)|0)|0)+((8191&(f=(f=f+Math.imul(s,be)|0)+Math.imul(l,ie)|0))<<13)|0;b=((d=d+Math.imul(l,be)|0)+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,c=Math.imul(P,j),f=(f=Math.imul(P,H))+Math.imul(D,j)|0,d=Math.imul(D,H),c=c+Math.imul(T,q)|0,f=(f=f+Math.imul(T,z)|0)+Math.imul(N,q)|0,d=d+Math.imul(N,z)|0,c=c+Math.imul(k,K)|0,f=(f=f+Math.imul(k,V)|0)+Math.imul(L,K)|0,d=d+Math.imul(L,V)|0,c=c+Math.imul(C,J)|0,f=(f=f+Math.imul(C,W)|0)+Math.imul(M,J)|0,d=d+Math.imul(M,W)|0,c=c+Math.imul(_,X)|0,f=(f=f+Math.imul(_,ee)|0)+Math.imul(I,X)|0,d=d+Math.imul(I,ee)|0,c=c+Math.imul(A,te)|0,f=(f=f+Math.imul(A,ce)|0)+Math.imul(v,te)|0,d=d+Math.imul(v,ce)|0,c=c+Math.imul(m,de)|0,f=(f=f+Math.imul(m,re)|0)+Math.imul(y,de)|0,d=d+Math.imul(y,re)|0,c=c+Math.imul(h,ie)|0,f=(f=f+Math.imul(h,be)|0)+Math.imul(p,ie)|0,d=d+Math.imul(p,be)|0;var Ie=(b+(c=c+Math.imul(s,se)|0)|0)+((8191&(f=(f=f+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;b=((d=d+Math.imul(l,le)|0)+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,c=Math.imul(F,j),f=(f=Math.imul(F,H))+Math.imul(Q,j)|0,d=Math.imul(Q,H),c=c+Math.imul(P,q)|0,f=(f=f+Math.imul(P,z)|0)+Math.imul(D,q)|0,d=d+Math.imul(D,z)|0,c=c+Math.imul(T,K)|0,f=(f=f+Math.imul(T,V)|0)+Math.imul(N,K)|0,d=d+Math.imul(N,V)|0,c=c+Math.imul(k,J)|0,f=(f=f+Math.imul(k,W)|0)+Math.imul(L,J)|0,d=d+Math.imul(L,W)|0,c=c+Math.imul(C,X)|0,f=(f=f+Math.imul(C,ee)|0)+Math.imul(M,X)|0,d=d+Math.imul(M,ee)|0,c=c+Math.imul(_,te)|0,f=(f=f+Math.imul(_,ce)|0)+Math.imul(I,te)|0,d=d+Math.imul(I,ce)|0,c=c+Math.imul(A,de)|0,f=(f=f+Math.imul(A,re)|0)+Math.imul(v,de)|0,d=d+Math.imul(v,re)|0,c=c+Math.imul(m,ie)|0,f=(f=f+Math.imul(m,be)|0)+Math.imul(y,ie)|0,d=d+Math.imul(y,be)|0,c=c+Math.imul(h,se)|0,f=(f=f+Math.imul(h,le)|0)+Math.imul(p,se)|0,d=d+Math.imul(p,le)|0;var Ee=(b+(c=c+Math.imul(s,he)|0)|0)+((8191&(f=(f=f+Math.imul(s,pe)|0)+Math.imul(l,he)|0))<<13)|0;b=((d=d+Math.imul(l,pe)|0)+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,c=Math.imul(F,q),f=(f=Math.imul(F,z))+Math.imul(Q,q)|0,d=Math.imul(Q,z),c=c+Math.imul(P,K)|0,f=(f=f+Math.imul(P,V)|0)+Math.imul(D,K)|0,d=d+Math.imul(D,V)|0,c=c+Math.imul(T,J)|0,f=(f=f+Math.imul(T,W)|0)+Math.imul(N,J)|0,d=d+Math.imul(N,W)|0,c=c+Math.imul(k,X)|0,f=(f=f+Math.imul(k,ee)|0)+Math.imul(L,X)|0,d=d+Math.imul(L,ee)|0,c=c+Math.imul(C,te)|0,f=(f=f+Math.imul(C,ce)|0)+Math.imul(M,te)|0,d=d+Math.imul(M,ce)|0,c=c+Math.imul(_,de)|0,f=(f=f+Math.imul(_,re)|0)+Math.imul(I,de)|0,d=d+Math.imul(I,re)|0,c=c+Math.imul(A,ie)|0,f=(f=f+Math.imul(A,be)|0)+Math.imul(v,ie)|0,d=d+Math.imul(v,be)|0,c=c+Math.imul(m,se)|0,f=(f=f+Math.imul(m,le)|0)+Math.imul(y,se)|0,d=d+Math.imul(y,le)|0;var Ce=(b+(c=c+Math.imul(h,he)|0)|0)+((8191&(f=(f=f+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;b=((d=d+Math.imul(p,pe)|0)+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c=Math.imul(F,K),f=(f=Math.imul(F,V))+Math.imul(Q,K)|0,d=Math.imul(Q,V),c=c+Math.imul(P,J)|0,f=(f=f+Math.imul(P,W)|0)+Math.imul(D,J)|0,d=d+Math.imul(D,W)|0,c=c+Math.imul(T,X)|0,f=(f=f+Math.imul(T,ee)|0)+Math.imul(N,X)|0,d=d+Math.imul(N,ee)|0,c=c+Math.imul(k,te)|0,f=(f=f+Math.imul(k,ce)|0)+Math.imul(L,te)|0,d=d+Math.imul(L,ce)|0,c=c+Math.imul(C,de)|0,f=(f=f+Math.imul(C,re)|0)+Math.imul(M,de)|0,d=d+Math.imul(M,re)|0,c=c+Math.imul(_,ie)|0,f=(f=f+Math.imul(_,be)|0)+Math.imul(I,ie)|0,d=d+Math.imul(I,be)|0,c=c+Math.imul(A,se)|0,f=(f=f+Math.imul(A,le)|0)+Math.imul(v,se)|0,d=d+Math.imul(v,le)|0;var Me=(b+(c=c+Math.imul(m,he)|0)|0)+((8191&(f=(f=f+Math.imul(m,pe)|0)+Math.imul(y,he)|0))<<13)|0;b=((d=d+Math.imul(y,pe)|0)+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,c=Math.imul(F,J),f=(f=Math.imul(F,W))+Math.imul(Q,J)|0,d=Math.imul(Q,W),c=c+Math.imul(P,X)|0,f=(f=f+Math.imul(P,ee)|0)+Math.imul(D,X)|0,d=d+Math.imul(D,ee)|0,c=c+Math.imul(T,te)|0,f=(f=f+Math.imul(T,ce)|0)+Math.imul(N,te)|0,d=d+Math.imul(N,ce)|0,c=c+Math.imul(k,de)|0,f=(f=f+Math.imul(k,re)|0)+Math.imul(L,de)|0,d=d+Math.imul(L,re)|0,c=c+Math.imul(C,ie)|0,f=(f=f+Math.imul(C,be)|0)+Math.imul(M,ie)|0,d=d+Math.imul(M,be)|0,c=c+Math.imul(_,se)|0,f=(f=f+Math.imul(_,le)|0)+Math.imul(I,se)|0,d=d+Math.imul(I,le)|0;var Be=(b+(c=c+Math.imul(A,he)|0)|0)+((8191&(f=(f=f+Math.imul(A,pe)|0)+Math.imul(v,he)|0))<<13)|0;b=((d=d+Math.imul(v,pe)|0)+(f>>>13)|0)+(Be>>>26)|0,Be&=67108863,c=Math.imul(F,X),f=(f=Math.imul(F,ee))+Math.imul(Q,X)|0,d=Math.imul(Q,ee),c=c+Math.imul(P,te)|0,f=(f=f+Math.imul(P,ce)|0)+Math.imul(D,te)|0,d=d+Math.imul(D,ce)|0,c=c+Math.imul(T,de)|0,f=(f=f+Math.imul(T,re)|0)+Math.imul(N,de)|0,d=d+Math.imul(N,re)|0,c=c+Math.imul(k,ie)|0,f=(f=f+Math.imul(k,be)|0)+Math.imul(L,ie)|0,d=d+Math.imul(L,be)|0,c=c+Math.imul(C,se)|0,f=(f=f+Math.imul(C,le)|0)+Math.imul(M,se)|0,d=d+Math.imul(M,le)|0;var ke=(b+(c=c+Math.imul(_,he)|0)|0)+((8191&(f=(f=f+Math.imul(_,pe)|0)+Math.imul(I,he)|0))<<13)|0;b=((d=d+Math.imul(I,pe)|0)+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,c=Math.imul(F,te),f=(f=Math.imul(F,ce))+Math.imul(Q,te)|0,d=Math.imul(Q,ce),c=c+Math.imul(P,de)|0,f=(f=f+Math.imul(P,re)|0)+Math.imul(D,de)|0,d=d+Math.imul(D,re)|0,c=c+Math.imul(T,ie)|0,f=(f=f+Math.imul(T,be)|0)+Math.imul(N,ie)|0,d=d+Math.imul(N,be)|0,c=c+Math.imul(k,se)|0,f=(f=f+Math.imul(k,le)|0)+Math.imul(L,se)|0,d=d+Math.imul(L,le)|0;var Le=(b+(c=c+Math.imul(C,he)|0)|0)+((8191&(f=(f=f+Math.imul(C,pe)|0)+Math.imul(M,he)|0))<<13)|0;b=((d=d+Math.imul(M,pe)|0)+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,c=Math.imul(F,de),f=(f=Math.imul(F,re))+Math.imul(Q,de)|0,d=Math.imul(Q,re),c=c+Math.imul(P,ie)|0,f=(f=f+Math.imul(P,be)|0)+Math.imul(D,ie)|0,d=d+Math.imul(D,be)|0,c=c+Math.imul(T,se)|0,f=(f=f+Math.imul(T,le)|0)+Math.imul(N,se)|0,d=d+Math.imul(N,le)|0;var Se=(b+(c=c+Math.imul(k,he)|0)|0)+((8191&(f=(f=f+Math.imul(k,pe)|0)+Math.imul(L,he)|0))<<13)|0;b=((d=d+Math.imul(L,pe)|0)+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,c=Math.imul(F,ie),f=(f=Math.imul(F,be))+Math.imul(Q,ie)|0,d=Math.imul(Q,be),c=c+Math.imul(P,se)|0,f=(f=f+Math.imul(P,le)|0)+Math.imul(D,se)|0,d=d+Math.imul(D,le)|0;var Te=(b+(c=c+Math.imul(T,he)|0)|0)+((8191&(f=(f=f+Math.imul(T,pe)|0)+Math.imul(N,he)|0))<<13)|0;b=((d=d+Math.imul(N,pe)|0)+(f>>>13)|0)+(Te>>>26)|0,Te&=67108863,c=Math.imul(F,se),f=(f=Math.imul(F,le))+Math.imul(Q,se)|0,d=Math.imul(Q,le);var Ne=(b+(c=c+Math.imul(P,he)|0)|0)+((8191&(f=(f=f+Math.imul(P,pe)|0)+Math.imul(D,he)|0))<<13)|0;b=((d=d+Math.imul(D,pe)|0)+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Re=(b+(c=Math.imul(F,he))|0)+((8191&(f=(f=Math.imul(F,pe))+Math.imul(Q,he)|0))<<13)|0;return b=((d=Math.imul(Q,pe))+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,i[0]=ge,i[1]=me,i[2]=ye,i[3]=xe,i[4]=Ae,i[5]=ve,i[6]=we,i[7]=_e,i[8]=Ie,i[9]=Ee,i[10]=Ce,i[11]=Me,i[12]=Be,i[13]=ke,i[14]=Le,i[15]=Se,i[16]=Te,i[17]=Ne,i[18]=Re,0!==b&&(i[19]=b,t.length++),t};function p(e,a,t){return(new g).mulp(e,a,t)}function g(e,a){this.x=e,this.y=a}Math.imul||(h=u),d.prototype.mulTo=function(e,a){var t,c=this.length+e.length;return t=10===this.length&&10===e.length?h(this,e,a):c<63?u(this,e,a):c<1024?function(e,a,t){t.negative=a.negative^e.negative,t.length=e.length+a.length;for(var c=0,f=0,d=0;d>>26)|0)>>>26,r&=67108863}t.words[d]=n,c=r,r=f}return 0!==c?t.words[d]=c:t.length--,t.strip()}(this,e,a):p(this,e,a),t},g.prototype.makeRBT=function(e){for(var a=new Array(e),t=d.prototype._countBits(e)-1,c=0;c>=1;return c},g.prototype.permute=function(e,a,t,c,f,d){for(var r=0;r>>=1)f++;return 1<>>=13,t[2*r+1]=8191&d,d>>>=13;for(r=2*a;r>=26,a+=f/67108864|0,a+=d>>>26,this.words[t]=67108863&d}return 0!==a&&(this.words[t]=a,this.length++),this},d.prototype.muln=function(e){return this.clone().imuln(e)},d.prototype.sqr=function(){return this.mul(this)},d.prototype.isqr=function(){return this.imul(this.clone())},d.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),t=0;t>>f}return a}(e);if(0===a.length)return new d(1);for(var t=this,c=0;c=0);var a,t=e%26,f=(e-t)/26,d=67108863>>>26-t<<26-t;if(0!==t){var r=0;for(a=0;a>>26-t}r&&(this.words[a]=r,this.length++)}if(0!==f){for(a=this.length-1;a>=0;a--)this.words[a+f]=this.words[a];for(a=0;a=0),f=a?(a-a%26)/26:0;var d=e%26,r=Math.min((e-d)/26,this.length),n=67108863^67108863>>>d<r)for(this.length-=r,b=0;b=0&&(0!==o||b>=f);b--){var s=0|this.words[b];this.words[b]=o<<26-d|s>>>d,o=s&n}return i&&0!==o&&(i.words[i.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},d.prototype.ishrn=function(e,a,t){return c(0===this.negative),this.iushrn(e,a,t)},d.prototype.shln=function(e){return this.clone().ishln(e)},d.prototype.ushln=function(e){return this.clone().iushln(e)},d.prototype.shrn=function(e){return this.clone().ishrn(e)},d.prototype.ushrn=function(e){return this.clone().iushrn(e)},d.prototype.testn=function(e){c("number"==typeof e&&e>=0);var a=e%26,t=(e-a)/26,f=1<=0);var a=e%26,t=(e-a)/26;if(c(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==a&&t++,this.length=Math.min(t,this.length),0!==a){var f=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},d.prototype.isubn=function(e){if(c("number"==typeof e),c(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(i/67108864|0),this.words[f+t]=67108863&d}for(;f>26,this.words[f+t]=67108863&d;if(0===n)return this.strip();for(c(-1===n),n=0,f=0;f>26,this.words[f]=67108863&d;return this.negative=1,this.strip()},d.prototype._wordDiv=function(e,a){var t=(this.length,e.length),c=this.clone(),f=e,r=0|f.words[f.length-1];0!=(t=26-this._countBits(r))&&(f=f.ushln(t),c.iushln(t),r=0|f.words[f.length-1]);var n,i=c.length-f.length;if("mod"!==a){(n=new d(null)).length=i+1,n.words=new Array(n.length);for(var b=0;b=0;s--){var l=67108864*(0|c.words[f.length+s])+(0|c.words[f.length+s-1]);for(l=Math.min(l/r|0,67108863),c._ishlnsubmul(f,l,s);0!==c.negative;)l--,c.negative=0,c._ishlnsubmul(f,1,s),c.isZero()||(c.negative^=1);n&&(n.words[s]=l)}return n&&n.strip(),c.strip(),"div"!==a&&0!==t&&c.iushrn(t),{div:n||null,mod:c}},d.prototype.divmod=function(e,a,t){return c(!e.isZero()),this.isZero()?{div:new d(0),mod:new d(0)}:0!==this.negative&&0===e.negative?(n=this.neg().divmod(e,a),"mod"!==a&&(f=n.div.neg()),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.iadd(e)),{div:f,mod:r}):0===this.negative&&0!==e.negative?(n=this.divmod(e.neg(),a),"mod"!==a&&(f=n.div.neg()),{div:f,mod:n.mod}):this.negative&e.negative?(n=this.neg().divmod(e.neg(),a),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.isub(e)),{div:n.div,mod:r}):e.length>this.length||this.cmp(e)<0?{div:new d(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new d(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new d(this.modn(e.words[0]))}:this._wordDiv(e,a);var f,r,n},d.prototype.div=function(e){return this.divmod(e,"div",!1).div},d.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},d.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},d.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var t=0!==a.div.negative?a.mod.isub(e):a.mod,c=e.ushrn(1),f=e.andln(1),d=t.cmp(c);return d<0||1===f&&0===d?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},d.prototype.modn=function(e){c(e<=67108863);for(var a=(1<<26)%e,t=0,f=this.length-1;f>=0;f--)t=(a*t+(0|this.words[f]))%e;return t},d.prototype.idivn=function(e){c(e<=67108863);for(var a=0,t=this.length-1;t>=0;t--){var f=(0|this.words[t])+67108864*a;this.words[t]=f/e|0,a=f%e}return this.strip()},d.prototype.divn=function(e){return this.clone().idivn(e)},d.prototype.egcd=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f=new d(1),r=new d(0),n=new d(0),i=new d(1),b=0;a.isEven()&&t.isEven();)a.iushrn(1),t.iushrn(1),++b;for(var o=t.clone(),s=a.clone();!a.isZero();){for(var l=0,u=1;!(a.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(f.isOdd()||r.isOdd())&&(f.iadd(o),r.isub(s)),f.iushrn(1),r.iushrn(1);for(var h=0,p=1;!(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(o),i.isub(s)),n.iushrn(1),i.iushrn(1);a.cmp(t)>=0?(a.isub(t),f.isub(n),r.isub(i)):(t.isub(a),n.isub(f),i.isub(r))}return{a:n,b:i,gcd:t.iushln(b)}},d.prototype._invmp=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f,r=new d(1),n=new d(0),i=t.clone();a.cmpn(1)>0&&t.cmpn(1)>0;){for(var b=0,o=1;!(a.words[0]&o)&&b<26;++b,o<<=1);if(b>0)for(a.iushrn(b);b-- >0;)r.isOdd()&&r.iadd(i),r.iushrn(1);for(var s=0,l=1;!(t.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(t.iushrn(s);s-- >0;)n.isOdd()&&n.iadd(i),n.iushrn(1);a.cmp(t)>=0?(a.isub(t),r.isub(n)):(t.isub(a),n.isub(r))}return(f=0===a.cmpn(1)?r:n).cmpn(0)<0&&f.iadd(e),f},d.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),t=e.clone();a.negative=0,t.negative=0;for(var c=0;a.isEven()&&t.isEven();c++)a.iushrn(1),t.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;t.isEven();)t.iushrn(1);var f=a.cmp(t);if(f<0){var d=a;a=t,t=d}else if(0===f||0===t.cmpn(1))break;a.isub(t)}return t.iushln(c)},d.prototype.invm=function(e){return this.egcd(e).a.umod(e)},d.prototype.isEven=function(){return!(1&this.words[0])},d.prototype.isOdd=function(){return!(1&~this.words[0])},d.prototype.andln=function(e){return this.words[0]&e},d.prototype.bincn=function(e){c("number"==typeof e);var a=e%26,t=(e-a)/26,f=1<>>26,n&=67108863,this.words[r]=n}return 0!==d&&(this.words[r]=d,this.length++),this},d.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},d.prototype.cmpn=function(e){var a,t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)a=1;else{t&&(e=-e),c(e<=67108863,"Number is too big");var f=0|this.words[0];a=f===e?0:fe.length)return 1;if(this.length=0;t--){var c=0|this.words[t],f=0|e.words[t];if(c!==f){cf&&(a=1);break}}return a},d.prototype.gtn=function(e){return 1===this.cmpn(e)},d.prototype.gt=function(e){return 1===this.cmp(e)},d.prototype.gten=function(e){return this.cmpn(e)>=0},d.prototype.gte=function(e){return this.cmp(e)>=0},d.prototype.ltn=function(e){return-1===this.cmpn(e)},d.prototype.lt=function(e){return-1===this.cmp(e)},d.prototype.lten=function(e){return this.cmpn(e)<=0},d.prototype.lte=function(e){return this.cmp(e)<=0},d.prototype.eqn=function(e){return 0===this.cmpn(e)},d.prototype.eq=function(e){return 0===this.cmp(e)},d.red=function(e){return new _(e)},d.prototype.toRed=function(e){return c(!this.red,"Already a number in reduction context"),c(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},d.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},d.prototype._forceRed=function(e){return this.red=e,this},d.prototype.forceRed=function(e){return c(!this.red,"Already a number in reduction context"),this._forceRed(e)},d.prototype.redAdd=function(e){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},d.prototype.redIAdd=function(e){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},d.prototype.redSub=function(e){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},d.prototype.redISub=function(e){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},d.prototype.redShl=function(e){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},d.prototype.redMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},d.prototype.redIMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},d.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},d.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},d.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},d.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},d.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},d.prototype.redPow=function(e){return c(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function y(e,a){this.name=e,this.p=new d(a,16),this.n=this.p.bitLength(),this.k=new d(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function x(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var a=d._prime(e);this.m=a.p,this.prime=a}else c(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new d(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var e=new d(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var a,t=e;do{this.split(t,this.tmp),a=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(a>this.n);var c=a0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},y.prototype.split=function(e,a){e.iushrn(this.n,0,a)},y.prototype.imulK=function(e){return e.imul(this.k)},f(x,y),x.prototype.split=function(e,a){for(var t=4194303,c=Math.min(e.length,9),f=0;f>>22,d=r}d>>>=22,e.words[f-10]=d,0===d&&e.length>10?e.length-=10:e.length-=9},x.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,t=0;t>>=26,e.words[t]=f,a=c}return 0!==a&&(e.words[e.length++]=a),e},d._prime=function(e){if(m[e])return m[e];var a;if("k256"===e)a=new x;else if("p224"===e)a=new A;else if("p192"===e)a=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new w}return m[e]=a,a},_.prototype._verify1=function(e){c(0===e.negative,"red works only with positives"),c(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,a){c(!(e.negative|a.negative),"red works only with positives"),c(e.red&&e.red===a.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,a){this._verify2(e,a);var t=e.add(a);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},_.prototype.iadd=function(e,a){this._verify2(e,a);var t=e.iadd(a);return t.cmp(this.m)>=0&&t.isub(this.m),t},_.prototype.sub=function(e,a){this._verify2(e,a);var t=e.sub(a);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},_.prototype.isub=function(e,a){this._verify2(e,a);var t=e.isub(a);return t.cmpn(0)<0&&t.iadd(this.m),t},_.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},_.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},_.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(c(a%2==1),3===a){var t=this.m.add(new d(1)).iushrn(2);return this.pow(e,t)}for(var f=this.m.subn(1),r=0;!f.isZero()&&0===f.andln(1);)r++,f.iushrn(1);c(!f.isZero());var n=new d(1).toRed(this),i=n.redNeg(),b=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new d(2*o*o).toRed(this);0!==this.pow(o,b).cmp(i);)o.redIAdd(i);for(var s=this.pow(o,f),l=this.pow(e,f.addn(1).iushrn(1)),u=this.pow(e,f),h=r;0!==u.cmp(n);){for(var p=u,g=0;0!==p.cmp(n);g++)p=p.redSqr();c(g=0;c--){for(var b=a.words[c],o=i-1;o>=0;o--){var s=b>>o&1;f!==t[0]&&(f=this.sqr(f)),0!==s||0!==r?(r<<=1,r|=s,(4==++n||0===c&&0===o)&&(f=this.mul(f,t[r]),n=0,r=0)):n=0}i=26}return f},_.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},_.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},d.mont=function(e){return new I(e)},f(I,_),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},I.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var t=e.imul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),d=f;return f.cmp(this.m)>=0?d=f.isub(this.m):f.cmpn(0)<0&&(d=f.iadd(this.m)),d._forceRed(this)},I.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new d(0)._forceRed(this);var t=e.mul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),r=f;return f.cmp(this.m)>=0?r=f.isub(this.m):f.cmpn(0)<0&&(r=f.iadd(this.m)),r._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=t.nmd(e),this)},77362:(e,a,t)=>{var c=t(78170),f=t(48206),d=t(52061),r=t(82509),n=t(67332),i=t(47108),b=t(99247),o=t(92861).Buffer;e.exports=function(e,a,t){var s;s=e.padding?e.padding:t?1:4;var l,u=c(e),h=u.modulus.byteLength();if(a.length>h||new r(a).cmp(u.modulus)>=0)throw new Error("decryption error");l=t?b(new r(a),u):n(a,u);var p=o.alloc(h-l.length);if(l=o.concat([p,l],h),4===s)return function(e,a){var t=e.modulus.byteLength(),c=i("sha1").update(o.alloc(0)).digest(),r=c.length;if(0!==a[0])throw new Error("decryption error");var n=a.slice(1,r+1),b=a.slice(r+1),s=d(n,f(b,r)),l=d(b,f(s,t-r-1));if(function(e,a){e=o.from(e),a=o.from(a);var t=0,c=e.length;e.length!==a.length&&(t++,c=Math.min(e.length,a.length));for(var f=-1;++f=a.length){d++;break}var r=a.slice(2,f-1);if(("0002"!==c.toString("hex")&&!t||"0001"!==c.toString("hex")&&t)&&d++,r.length<8&&d++,d)throw new Error("decryption error");return a.slice(f)}(0,l,t);if(3===s)return l;throw new Error("unknown padding")}},28902:(e,a,t)=>{var c=t(78170),f=t(53209),d=t(47108),r=t(48206),n=t(52061),i=t(82509),b=t(99247),o=t(67332),s=t(92861).Buffer;e.exports=function(e,a,t){var l;l=e.padding?e.padding:t?1:4;var u,h=c(e);if(4===l)u=function(e,a){var t=e.modulus.byteLength(),c=a.length,b=d("sha1").update(s.alloc(0)).digest(),o=b.length,l=2*o;if(c>t-l-2)throw new Error("message too long");var u=s.alloc(t-c-l-2),h=t-o-1,p=f(o),g=n(s.concat([b,u,s.alloc(1,1),a],h),r(p,h)),m=n(p,r(g,o));return new i(s.concat([s.alloc(1),m,g],t))}(h,a);else if(1===l)u=function(e,a,t){var c,d=a.length,r=e.modulus.byteLength();if(d>r-11)throw new Error("message too long");return c=t?s.alloc(r-d-3,255):function(e){for(var a,t=s.allocUnsafe(e),c=0,d=f(2*e),r=0;c=0)throw new Error("data too long for modulus")}return t?o(u,h):b(u,h)}},99247:(e,a,t)=>{var c=t(82509),f=t(92861).Buffer;e.exports=function(e,a){return f.from(e.toRed(c.mont(a.modulus)).redPow(new c(a.publicExponent)).fromRed().toArray())}},52061:e=>{e.exports=function(e,a){for(var t=e.length,c=-1;++c{"use strict";var c=65536,f=t(92861).Buffer,d=t.g.crypto||t.g.msCrypto;d&&d.getRandomValues?e.exports=function(e,a){if(e>4294967295)throw new RangeError("requested too many random bytes");var t=f.allocUnsafe(e);if(e>0)if(e>c)for(var r=0;r{"use strict";function c(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var f=t(92861),d=t(53209),r=f.Buffer,n=f.kMaxLength,i=t.g.crypto||t.g.msCrypto,b=Math.pow(2,32)-1;function o(e,a){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>b||e<0)throw new TypeError("offset must be a uint32");if(e>n||e>a)throw new RangeError("offset out of range")}function s(e,a,t){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>b||e<0)throw new TypeError("size must be a uint32");if(e+a>t||e>n)throw new RangeError("buffer too small")}function l(e,a,t,c){if(process.browser){var f=e.buffer,r=new Uint8Array(f,a,t);return i.getRandomValues(r),c?void process.nextTick((function(){c(null,e)})):e}if(!c)return d(t).copy(e,a),e;d(t,(function(t,f){if(t)return c(t);f.copy(e,a),c(null,e)}))}i&&i.getRandomValues||!process.browser?(a.randomFill=function(e,a,c,f){if(!(r.isBuffer(e)||e instanceof t.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof a)f=a,a=0,c=e.length;else if("function"==typeof c)f=c,c=e.length-a;else if("function"!=typeof f)throw new TypeError('"cb" argument must be a function');return o(a,e.length),s(c,a,e.length),l(e,a,c,f)},a.randomFillSync=function(e,a,c){if(void 0===a&&(a=0),!(r.isBuffer(e)||e instanceof t.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return o(a,e.length),void 0===c&&(c=e.length-a),s(c,a,e.length),l(e,a,c)}):(a.randomFill=c,a.randomFillSync=c)},86048:e=>{"use strict";var a={};function t(e,t,c){c||(c=Error);var f=function(e){var a,c;function f(a,c,f){return e.call(this,function(e,a,c){return"string"==typeof t?t:t(e,a,c)}(a,c,f))||this}return c=e,(a=f).prototype=Object.create(c.prototype),a.prototype.constructor=a,a.__proto__=c,f}(c);f.prototype.name=c.name,f.prototype.code=e,a[e]=f}function c(e,a){if(Array.isArray(e)){var t=e.length;return e=e.map((function(e){return String(e)})),t>2?"one of ".concat(a," ").concat(e.slice(0,t-1).join(", "),", or ")+e[t-1]:2===t?"one of ".concat(a," ").concat(e[0]," or ").concat(e[1]):"of ".concat(a," ").concat(e[0])}return"of ".concat(a," ").concat(String(e))}t("ERR_INVALID_OPT_VALUE",(function(e,a){return'The value "'+a+'" is invalid for option "'+e+'"'}),TypeError),t("ERR_INVALID_ARG_TYPE",(function(e,a,t){var f,d,r,n,i;if("string"==typeof a&&(d="not ",a.substr(0,4)===d)?(f="must not be",a=a.replace(/^not /,"")):f="must be",function(e,a,t){return(void 0===t||t>e.length)&&(t=e.length),e.substring(t-9,t)===a}(e," argument"))r="The ".concat(e," ").concat(f," ").concat(c(a,"type"));else{var b=("number"!=typeof i&&(i=0),i+1>(n=e).length||-1===n.indexOf(".",i)?"argument":"property");r='The "'.concat(e,'" ').concat(b," ").concat(f," ").concat(c(a,"type"))}return r+". Received type ".concat(typeof t)}),TypeError),t("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),t("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),t("ERR_STREAM_PREMATURE_CLOSE","Premature close"),t("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),t("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),t("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),t("ERR_STREAM_WRITE_AFTER_END","write after end"),t("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),t("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),t("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=a},25382:(e,a,t)=>{"use strict";var c=Object.keys||function(e){var a=[];for(var t in e)a.push(t);return a};e.exports=b;var f=t(45412),d=t(16708);t(56698)(b,f);for(var r=c(d.prototype),n=0;n{"use strict";e.exports=f;var c=t(74610);function f(e){if(!(this instanceof f))return new f(e);c.call(this,e)}t(56698)(f,c),f.prototype._transform=function(e,a,t){t(null,e)}},45412:(e,a,t)=>{"use strict";var c;e.exports=I,I.ReadableState=_,t(37007).EventEmitter;var f,d=function(e,a){return e.listeners(a).length},r=t(40345),n=t(48287).Buffer,i=(void 0!==t.g?t.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},b=t(79838);f=b&&b.debuglog?b.debuglog("stream"):function(){};var o,s,l,u=t(80345),h=t(75896),p=t(65291).getHighWaterMark,g=t(86048).F,m=g.ERR_INVALID_ARG_TYPE,y=g.ERR_STREAM_PUSH_AFTER_EOF,x=g.ERR_METHOD_NOT_IMPLEMENTED,A=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;t(56698)(I,r);var v=h.errorOrDestroy,w=["error","close","destroy","pause","resume"];function _(e,a,f){c=c||t(25382),e=e||{},"boolean"!=typeof f&&(f=a instanceof c),this.objectMode=!!e.objectMode,f&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=p(this,e,"readableHighWaterMark",f),this.buffer=new u,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(o||(o=t(83141).I),this.decoder=new o(e.encoding),this.encoding=e.encoding)}function I(e){if(c=c||t(25382),!(this instanceof I))return new I(e);var a=this instanceof c;this._readableState=new _(e,this,a),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),r.call(this)}function E(e,a,t,c,d){f("readableAddChunk",a);var r,b=e._readableState;if(null===a)b.reading=!1,function(e,a){if(f("onEofChunk"),!a.ended){if(a.decoder){var t=a.decoder.end();t&&t.length&&(a.buffer.push(t),a.length+=a.objectMode?1:t.length)}a.ended=!0,a.sync?k(e):(a.needReadable=!1,a.emittedReadable||(a.emittedReadable=!0,L(e)))}}(e,b);else if(d||(r=function(e,a){var t,c;return c=a,n.isBuffer(c)||c instanceof i||"string"==typeof a||void 0===a||e.objectMode||(t=new m("chunk",["string","Buffer","Uint8Array"],a)),t}(b,a)),r)v(e,r);else if(b.objectMode||a&&a.length>0)if("string"==typeof a||b.objectMode||Object.getPrototypeOf(a)===n.prototype||(a=function(e){return n.from(e)}(a)),c)b.endEmitted?v(e,new A):C(e,b,a,!0);else if(b.ended)v(e,new y);else{if(b.destroyed)return!1;b.reading=!1,b.decoder&&!t?(a=b.decoder.write(a),b.objectMode||0!==a.length?C(e,b,a,!1):S(e,b)):C(e,b,a,!1)}else c||(b.reading=!1,S(e,b));return!b.ended&&(b.lengtha.highWaterMark&&(a.highWaterMark=function(e){return e>=M?e=M:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=a.length?e:a.ended?a.length:(a.needReadable=!0,0))}function k(e){var a=e._readableState;f("emitReadable",a.needReadable,a.emittedReadable),a.needReadable=!1,a.emittedReadable||(f("emitReadable",a.flowing),a.emittedReadable=!0,process.nextTick(L,e))}function L(e){var a=e._readableState;f("emitReadable_",a.destroyed,a.length,a.ended),a.destroyed||!a.length&&!a.ended||(e.emit("readable"),a.emittedReadable=!1),a.needReadable=!a.flowing&&!a.ended&&a.length<=a.highWaterMark,D(e)}function S(e,a){a.readingMore||(a.readingMore=!0,process.nextTick(T,e,a))}function T(e,a){for(;!a.reading&&!a.ended&&(a.length0,a.resumeScheduled&&!a.paused?a.flowing=!0:e.listenerCount("data")>0&&e.resume()}function R(e){f("readable nexttick read 0"),e.read(0)}function P(e,a){f("resume",a.reading),a.reading||e.read(0),a.resumeScheduled=!1,e.emit("resume"),D(e),a.flowing&&!a.reading&&e.read(0)}function D(e){var a=e._readableState;for(f("flow",a.flowing);a.flowing&&null!==e.read(););}function O(e,a){return 0===a.length?null:(a.objectMode?t=a.buffer.shift():!e||e>=a.length?(t=a.decoder?a.buffer.join(""):1===a.buffer.length?a.buffer.first():a.buffer.concat(a.length),a.buffer.clear()):t=a.buffer.consume(e,a.decoder),t);var t}function F(e){var a=e._readableState;f("endReadable",a.endEmitted),a.endEmitted||(a.ended=!0,process.nextTick(Q,a,e))}function Q(e,a){if(f("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,a.readable=!1,a.emit("end"),e.autoDestroy)){var t=a._writableState;(!t||t.autoDestroy&&t.finished)&&a.destroy()}}function U(e,a){for(var t=0,c=e.length;t=a.highWaterMark:a.length>0)||a.ended))return f("read: emitReadable",a.length,a.ended),0===a.length&&a.ended?F(this):k(this),null;if(0===(e=B(e,a))&&a.ended)return 0===a.length&&F(this),null;var c,d=a.needReadable;return f("need readable",d),(0===a.length||a.length-e0?O(e,a):null)?(a.needReadable=a.length<=a.highWaterMark,e=0):(a.length-=e,a.awaitDrain=0),0===a.length&&(a.ended||(a.needReadable=!0),t!==e&&a.ended&&F(this)),null!==c&&this.emit("data",c),c},I.prototype._read=function(e){v(this,new x("_read()"))},I.prototype.pipe=function(e,a){var t=this,c=this._readableState;switch(c.pipesCount){case 0:c.pipes=e;break;case 1:c.pipes=[c.pipes,e];break;default:c.pipes.push(e)}c.pipesCount+=1,f("pipe count=%d opts=%j",c.pipesCount,a);var r=a&&!1===a.end||e===process.stdout||e===process.stderr?h:n;function n(){f("onend"),e.end()}c.endEmitted?process.nextTick(r):t.once("end",r),e.on("unpipe",(function a(d,r){f("onunpipe"),d===t&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,f("cleanup"),e.removeListener("close",l),e.removeListener("finish",u),e.removeListener("drain",i),e.removeListener("error",s),e.removeListener("unpipe",a),t.removeListener("end",n),t.removeListener("end",h),t.removeListener("data",o),b=!0,!c.awaitDrain||e._writableState&&!e._writableState.needDrain||i())}));var i=function(e){return function(){var a=e._readableState;f("pipeOnDrain",a.awaitDrain),a.awaitDrain&&a.awaitDrain--,0===a.awaitDrain&&d(e,"data")&&(a.flowing=!0,D(e))}}(t);e.on("drain",i);var b=!1;function o(a){f("ondata");var d=e.write(a);f("dest.write",d),!1===d&&((1===c.pipesCount&&c.pipes===e||c.pipesCount>1&&-1!==U(c.pipes,e))&&!b&&(f("false write response, pause",c.awaitDrain),c.awaitDrain++),t.pause())}function s(a){f("onerror",a),h(),e.removeListener("error",s),0===d(e,"error")&&v(e,a)}function l(){e.removeListener("finish",u),h()}function u(){f("onfinish"),e.removeListener("close",l),h()}function h(){f("unpipe"),t.unpipe(e)}return t.on("data",o),function(e,a,t){if("function"==typeof e.prependListener)return e.prependListener(a,t);e._events&&e._events[a]?Array.isArray(e._events[a])?e._events[a].unshift(t):e._events[a]=[t,e._events[a]]:e.on(a,t)}(e,"error",s),e.once("close",l),e.once("finish",u),e.emit("pipe",t),c.flowing||(f("pipe resume"),t.resume()),e},I.prototype.unpipe=function(e){var a=this._readableState,t={hasUnpiped:!1};if(0===a.pipesCount)return this;if(1===a.pipesCount)return e&&e!==a.pipes||(e||(e=a.pipes),a.pipes=null,a.pipesCount=0,a.flowing=!1,e&&e.emit("unpipe",this,t)),this;if(!e){var c=a.pipes,f=a.pipesCount;a.pipes=null,a.pipesCount=0,a.flowing=!1;for(var d=0;d0,!1!==c.flowing&&this.resume()):"readable"===e&&(c.endEmitted||c.readableListening||(c.readableListening=c.needReadable=!0,c.flowing=!1,c.emittedReadable=!1,f("on readable",c.length,c.reading),c.length?k(this):c.reading||process.nextTick(R,this))),t},I.prototype.addListener=I.prototype.on,I.prototype.removeListener=function(e,a){var t=r.prototype.removeListener.call(this,e,a);return"readable"===e&&process.nextTick(N,this),t},I.prototype.removeAllListeners=function(e){var a=r.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(N,this),a},I.prototype.resume=function(){var e=this._readableState;return e.flowing||(f("resume"),e.flowing=!e.readableListening,function(e,a){a.resumeScheduled||(a.resumeScheduled=!0,process.nextTick(P,e,a))}(this,e)),e.paused=!1,this},I.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},I.prototype.wrap=function(e){var a=this,t=this._readableState,c=!1;for(var d in e.on("end",(function(){if(f("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&a.push(e)}a.push(null)})),e.on("data",(function(d){f("wrapped data"),t.decoder&&(d=t.decoder.write(d)),t.objectMode&&null==d||(t.objectMode||d&&d.length)&&(a.push(d)||(c=!0,e.pause()))})),e)void 0===this[d]&&"function"==typeof e[d]&&(this[d]=function(a){return function(){return e[a].apply(e,arguments)}}(d));for(var r=0;r{"use strict";e.exports=o;var c=t(86048).F,f=c.ERR_METHOD_NOT_IMPLEMENTED,d=c.ERR_MULTIPLE_CALLBACK,r=c.ERR_TRANSFORM_ALREADY_TRANSFORMING,n=c.ERR_TRANSFORM_WITH_LENGTH_0,i=t(25382);function b(e,a){var t=this._transformState;t.transforming=!1;var c=t.writecb;if(null===c)return this.emit("error",new d);t.writechunk=null,t.writecb=null,null!=a&&this.push(a),c(e);var f=this._readableState;f.reading=!1,(f.needReadable||f.length{"use strict";function c(e){var a=this;this.next=null,this.entry=null,this.finish=function(){!function(e,a){var t=e.entry;for(e.entry=null;t;){var c=t.callback;a.pendingcb--,c(undefined),t=t.next}a.corkedRequestsFree.next=e}(a,e)}}var f;e.exports=I,I.WritableState=_;var d,r={deprecate:t(94643)},n=t(40345),i=t(48287).Buffer,b=(void 0!==t.g?t.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},o=t(75896),s=t(65291).getHighWaterMark,l=t(86048).F,u=l.ERR_INVALID_ARG_TYPE,h=l.ERR_METHOD_NOT_IMPLEMENTED,p=l.ERR_MULTIPLE_CALLBACK,g=l.ERR_STREAM_CANNOT_PIPE,m=l.ERR_STREAM_DESTROYED,y=l.ERR_STREAM_NULL_VALUES,x=l.ERR_STREAM_WRITE_AFTER_END,A=l.ERR_UNKNOWN_ENCODING,v=o.errorOrDestroy;function w(){}function _(e,a,d){f=f||t(25382),e=e||{},"boolean"!=typeof d&&(d=a instanceof f),this.objectMode=!!e.objectMode,d&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=s(this,e,"writableHighWaterMark",d),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var r=!1===e.decodeStrings;this.decodeStrings=!r,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,a){var t=e._writableState,c=t.sync,f=t.writecb;if("function"!=typeof f)throw new p;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(t),a)!function(e,a,t,c,f){--a.pendingcb,t?(process.nextTick(f,c),process.nextTick(L,e,a),e._writableState.errorEmitted=!0,v(e,c)):(f(c),e._writableState.errorEmitted=!0,v(e,c),L(e,a))}(e,t,c,a,f);else{var d=B(t)||e.destroyed;d||t.corked||t.bufferProcessing||!t.bufferedRequest||M(e,t),c?process.nextTick(C,e,t,d,f):C(e,t,d,f)}}(a,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new c(this)}function I(e){var a=this instanceof(f=f||t(25382));if(!a&&!d.call(I,this))return new I(e);this._writableState=new _(e,this,a),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),n.call(this)}function E(e,a,t,c,f,d,r){a.writelen=c,a.writecb=r,a.writing=!0,a.sync=!0,a.destroyed?a.onwrite(new m("write")):t?e._writev(f,a.onwrite):e._write(f,d,a.onwrite),a.sync=!1}function C(e,a,t,c){t||function(e,a){0===a.length&&a.needDrain&&(a.needDrain=!1,e.emit("drain"))}(e,a),a.pendingcb--,c(),L(e,a)}function M(e,a){a.bufferProcessing=!0;var t=a.bufferedRequest;if(e._writev&&t&&t.next){var f=a.bufferedRequestCount,d=new Array(f),r=a.corkedRequestsFree;r.entry=t;for(var n=0,i=!0;t;)d[n]=t,t.isBuf||(i=!1),t=t.next,n+=1;d.allBuffers=i,E(e,a,!0,a.length,d,"",r.finish),a.pendingcb++,a.lastBufferedRequest=null,r.next?(a.corkedRequestsFree=r.next,r.next=null):a.corkedRequestsFree=new c(a),a.bufferedRequestCount=0}else{for(;t;){var b=t.chunk,o=t.encoding,s=t.callback;if(E(e,a,!1,a.objectMode?1:b.length,b,o,s),t=t.next,a.bufferedRequestCount--,a.writing)break}null===t&&(a.lastBufferedRequest=null)}a.bufferedRequest=t,a.bufferProcessing=!1}function B(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function k(e,a){e._final((function(t){a.pendingcb--,t&&v(e,t),a.prefinished=!0,e.emit("prefinish"),L(e,a)}))}function L(e,a){var t=B(a);if(t&&(function(e,a){a.prefinished||a.finalCalled||("function"!=typeof e._final||a.destroyed?(a.prefinished=!0,e.emit("prefinish")):(a.pendingcb++,a.finalCalled=!0,process.nextTick(k,e,a)))}(e,a),0===a.pendingcb&&(a.finished=!0,e.emit("finish"),a.autoDestroy))){var c=e._readableState;(!c||c.autoDestroy&&c.endEmitted)&&e.destroy()}return t}t(56698)(I,n),_.prototype.getBuffer=function(){for(var e=this.bufferedRequest,a=[];e;)a.push(e),e=e.next;return a},function(){try{Object.defineProperty(_.prototype,"buffer",{get:r.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(I,Symbol.hasInstance,{value:function(e){return!!d.call(this,e)||this===I&&e&&e._writableState instanceof _}})):d=function(e){return e instanceof this},I.prototype.pipe=function(){v(this,new g)},I.prototype.write=function(e,a,t){var c,f=this._writableState,d=!1,r=!f.objectMode&&(c=e,i.isBuffer(c)||c instanceof b);return r&&!i.isBuffer(e)&&(e=function(e){return i.from(e)}(e)),"function"==typeof a&&(t=a,a=null),r?a="buffer":a||(a=f.defaultEncoding),"function"!=typeof t&&(t=w),f.ending?function(e,a){var t=new x;v(e,t),process.nextTick(a,t)}(this,t):(r||function(e,a,t,c){var f;return null===t?f=new y:"string"==typeof t||a.objectMode||(f=new u("chunk",["string","Buffer"],t)),!f||(v(e,f),process.nextTick(c,f),!1)}(this,f,e,t))&&(f.pendingcb++,d=function(e,a,t,c,f,d){if(!t){var r=function(e,a,t){return e.objectMode||!1===e.decodeStrings||"string"!=typeof a||(a=i.from(a,t)),a}(a,c,f);c!==r&&(t=!0,f="buffer",c=r)}var n=a.objectMode?1:c.length;a.length+=n;var b=a.length-1))throw new A(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(I.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(I.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),I.prototype._write=function(e,a,t){t(new h("_write()"))},I.prototype._writev=null,I.prototype.end=function(e,a,t){var c=this._writableState;return"function"==typeof e?(t=e,e=null,a=null):"function"==typeof a&&(t=a,a=null),null!=e&&this.write(e,a),c.corked&&(c.corked=1,this.uncork()),c.ending||function(e,a,t){a.ending=!0,L(e,a),t&&(a.finished?process.nextTick(t):e.once("finish",t)),a.ended=!0,e.writable=!1}(this,c,t),this},Object.defineProperty(I.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),I.prototype.destroy=o.destroy,I.prototype._undestroy=o.undestroy,I.prototype._destroy=function(e,a){a(e)}},2955:(e,a,t)=>{"use strict";var c;function f(e,a,t){return(a=function(e){var a=function(e){if("object"!=typeof e||null===e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var t=a.call(e,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof a?a:String(a)}(a))in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}var d=t(86238),r=Symbol("lastResolve"),n=Symbol("lastReject"),i=Symbol("error"),b=Symbol("ended"),o=Symbol("lastPromise"),s=Symbol("handlePromise"),l=Symbol("stream");function u(e,a){return{value:e,done:a}}function h(e){var a=e[r];if(null!==a){var t=e[l].read();null!==t&&(e[o]=null,e[r]=null,e[n]=null,a(u(t,!1)))}}function p(e){process.nextTick(h,e)}var g=Object.getPrototypeOf((function(){})),m=Object.setPrototypeOf((f(c={get stream(){return this[l]},next:function(){var e=this,a=this[i];if(null!==a)return Promise.reject(a);if(this[b])return Promise.resolve(u(void 0,!0));if(this[l].destroyed)return new Promise((function(a,t){process.nextTick((function(){e[i]?t(e[i]):a(u(void 0,!0))}))}));var t,c=this[o];if(c)t=new Promise(function(e,a){return function(t,c){e.then((function(){a[b]?t(u(void 0,!0)):a[s](t,c)}),c)}}(c,this));else{var f=this[l].read();if(null!==f)return Promise.resolve(u(f,!1));t=new Promise(this[s])}return this[o]=t,t}},Symbol.asyncIterator,(function(){return this})),f(c,"return",(function(){var e=this;return new Promise((function(a,t){e[l].destroy(null,(function(e){e?t(e):a(u(void 0,!0))}))}))})),c),g);e.exports=function(e){var a,t=Object.create(m,(f(a={},l,{value:e,writable:!0}),f(a,r,{value:null,writable:!0}),f(a,n,{value:null,writable:!0}),f(a,i,{value:null,writable:!0}),f(a,b,{value:e._readableState.endEmitted,writable:!0}),f(a,s,{value:function(e,a){var c=t[l].read();c?(t[o]=null,t[r]=null,t[n]=null,e(u(c,!1))):(t[r]=e,t[n]=a)},writable:!0}),a));return t[o]=null,d(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var a=t[n];return null!==a&&(t[o]=null,t[r]=null,t[n]=null,a(e)),void(t[i]=e)}var c=t[r];null!==c&&(t[o]=null,t[r]=null,t[n]=null,c(u(void 0,!0))),t[b]=!0})),e.on("readable",p.bind(null,t)),t}},80345:(e,a,t)=>{"use strict";function c(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);a&&(c=c.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),t.push.apply(t,c)}return t}function f(e){for(var a=1;a0?this.tail.next=a:this.head=a,this.tail=a,++this.length}},{key:"unshift",value:function(e){var a={data:e,next:this.head};0===this.length&&(this.tail=a),this.head=a,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var a=this.head,t=""+a.data;a=a.next;)t+=e+a.data;return t}},{key:"concat",value:function(e){if(0===this.length)return i.alloc(0);for(var a,t,c,f=i.allocUnsafe(e>>>0),d=this.head,r=0;d;)a=d.data,t=f,c=r,i.prototype.copy.call(a,t,c),r+=d.data.length,d=d.next;return f}},{key:"consume",value:function(e,a){var t;return ef.length?f.length:e;if(d===f.length?c+=f:c+=f.slice(0,e),0==(e-=d)){d===f.length?(++t,a.next?this.head=a.next:this.head=this.tail=null):(this.head=a,a.data=f.slice(d));break}++t}return this.length-=t,c}},{key:"_getBuffer",value:function(e){var a=i.allocUnsafe(e),t=this.head,c=1;for(t.data.copy(a),e-=t.data.length;t=t.next;){var f=t.data,d=e>f.length?f.length:e;if(f.copy(a,a.length-e,0,d),0==(e-=d)){d===f.length?(++c,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=f.slice(d));break}++c}return this.length-=c,a}},{key:o,value:function(e,a){return b(this,f(f({},a),{},{depth:0,customInspect:!1}))}}])&&r(a.prototype,t),Object.defineProperty(a,"prototype",{writable:!1}),e}()},75896:e=>{"use strict";function a(e,a){c(e,a),t(e)}function t(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function c(e,a){e.emit("error",a)}e.exports={destroy:function(e,f){var d=this,r=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return r||n?(f?f(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(c,this,e)):process.nextTick(c,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!f&&e?d._writableState?d._writableState.errorEmitted?process.nextTick(t,d):(d._writableState.errorEmitted=!0,process.nextTick(a,d,e)):process.nextTick(a,d,e):f?(process.nextTick(t,d),f(e)):process.nextTick(t,d)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,a){var t=e._readableState,c=e._writableState;t&&t.autoDestroy||c&&c.autoDestroy?e.destroy(a):e.emit("error",a)}}},86238:(e,a,t)=>{"use strict";var c=t(86048).F.ERR_STREAM_PREMATURE_CLOSE;function f(){}e.exports=function e(a,t,d){if("function"==typeof t)return e(a,null,t);t||(t={}),d=function(e){var a=!1;return function(){if(!a){a=!0;for(var t=arguments.length,c=new Array(t),f=0;f{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},57758:(e,a,t)=>{"use strict";var c,f=t(86048).F,d=f.ERR_MISSING_ARGS,r=f.ERR_STREAM_DESTROYED;function n(e){if(e)throw e}function i(e){e()}function b(e,a){return e.pipe(a)}e.exports=function(){for(var e=arguments.length,a=new Array(e),f=0;f0,(function(e){o||(o=e),e&&l.forEach(i),d||(l.forEach(i),s(o))}))}));return a.reduce(b)}},65291:(e,a,t)=>{"use strict";var c=t(86048).F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,a,t,f){var d=function(e,a,t){return null!=e.highWaterMark?e.highWaterMark:a?e[t]:null}(a,f,t);if(null!=d){if(!isFinite(d)||Math.floor(d)!==d||d<0)throw new c(f?t:"highWaterMark",d);return Math.floor(d)}return e.objectMode?16:16384}}},40345:(e,a,t)=>{e.exports=t(37007).EventEmitter},28399:(e,a,t)=>{(a=e.exports=t(45412)).Stream=a,a.Readable=a,a.Writable=t(16708),a.Duplex=t(25382),a.Transform=t(74610),a.PassThrough=t(63600),a.finished=t(86238),a.pipeline=t(57758)},66011:(e,a,t)=>{"use strict";var c=t(48287).Buffer,f=t(56698),d=t(51147),r=new Array(16),n=[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],i=[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],b=[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],o=[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],s=[0,1518500249,1859775393,2400959708,2840853838],l=[1352829926,1548603684,1836072691,2053994217,0];function u(){d.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function h(e,a){return e<>>32-a}function p(e,a,t,c,f,d,r,n){return h(e+(a^t^c)+d+r|0,n)+f|0}function g(e,a,t,c,f,d,r,n){return h(e+(a&t|~a&c)+d+r|0,n)+f|0}function m(e,a,t,c,f,d,r,n){return h(e+((a|~t)^c)+d+r|0,n)+f|0}function y(e,a,t,c,f,d,r,n){return h(e+(a&c|t&~c)+d+r|0,n)+f|0}function x(e,a,t,c,f,d,r,n){return h(e+(a^(t|~c))+d+r|0,n)+f|0}f(u,d),u.prototype._update=function(){for(var e=r,a=0;a<16;++a)e[a]=this._block.readInt32LE(4*a);for(var t=0|this._a,c=0|this._b,f=0|this._c,d=0|this._d,u=0|this._e,A=0|this._a,v=0|this._b,w=0|this._c,_=0|this._d,I=0|this._e,E=0;E<80;E+=1){var C,M;E<16?(C=p(t,c,f,d,u,e[n[E]],s[0],b[E]),M=x(A,v,w,_,I,e[i[E]],l[0],o[E])):E<32?(C=g(t,c,f,d,u,e[n[E]],s[1],b[E]),M=y(A,v,w,_,I,e[i[E]],l[1],o[E])):E<48?(C=m(t,c,f,d,u,e[n[E]],s[2],b[E]),M=m(A,v,w,_,I,e[i[E]],l[2],o[E])):E<64?(C=y(t,c,f,d,u,e[n[E]],s[3],b[E]),M=g(A,v,w,_,I,e[i[E]],l[3],o[E])):(C=x(t,c,f,d,u,e[n[E]],s[4],b[E]),M=p(A,v,w,_,I,e[i[E]],l[4],o[E])),t=u,u=d,d=h(f,10),f=c,c=C,A=I,I=_,_=h(w,10),w=v,v=M}var B=this._b+f+_|0;this._b=this._c+d+I|0,this._c=this._d+u+A|0,this._d=this._e+t+v|0,this._e=this._a+c+w|0,this._a=B},u.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=c.alloc?c.alloc(20):new c(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=u},51147:(e,a,t)=>{"use strict";var c=t(92861).Buffer,f=t(28399).Transform;function d(e){f.call(this),this._block=c.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}t(56698)(d,f),d.prototype._transform=function(e,a,t){var c=null;try{this.update(e,a)}catch(e){c=e}t(c)},d.prototype._flush=function(e){var a=null;try{this.push(this.digest())}catch(e){a=e}e(a)},d.prototype.update=function(e,a){if(function(e){if(!c.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer")}(e),this._finalized)throw new Error("Digest already called");c.isBuffer(e)||(e=c.from(e,a));for(var t=this._block,f=0;this._blockOffset+e.length-f>=this._blockSize;){for(var d=this._blockOffset;d0;++r)this._length[r]+=n,(n=this._length[r]/4294967296|0)>0&&(this._length[r]-=4294967296*n);return this},d.prototype._update=function(){throw new Error("_update is not implemented")},d.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var a=this._digest();void 0!==e&&(a=a.toString(e)),this._block.fill(0),this._blockOffset=0;for(var t=0;t<4;++t)this._length[t]=0;return a},d.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=d},92861:(e,a,t)=>{var c=t(48287),f=c.Buffer;function d(e,a){for(var t in e)a[t]=e[t]}function r(e,a,t){return f(e,a,t)}f.from&&f.alloc&&f.allocUnsafe&&f.allocUnsafeSlow?e.exports=c:(d(c,a),a.Buffer=r),r.prototype=Object.create(f.prototype),d(f,r),r.from=function(e,a,t){if("number"==typeof e)throw new TypeError("Argument must not be a number");return f(e,a,t)},r.alloc=function(e,a,t){if("number"!=typeof e)throw new TypeError("Argument must be a number");var c=f(e);return void 0!==a?"string"==typeof t?c.fill(a,t):c.fill(a):c.fill(0),c},r.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return f(e)},r.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return c.SlowBuffer(e)}},96897:(e,a,t)=>{"use strict";var c=t(70453),f=t(30041),d=t(30592)(),r=t(75795),n=t(69675),i=c("%Math.floor%");e.exports=function(e,a){if("function"!=typeof e)throw new n("`fn` is not a function");if("number"!=typeof a||a<0||a>4294967295||i(a)!==a)throw new n("`length` must be a positive 32-bit integer");var t=arguments.length>2&&!!arguments[2],c=!0,b=!0;if("length"in e&&r){var o=r(e,"length");o&&!o.configurable&&(c=!1),o&&!o.writable&&(b=!1)}return(c||b||!t)&&(d?f(e,"length",a,!0,!0):f(e,"length",a)),e}},90392:(e,a,t)=>{var c=t(92861).Buffer;function f(e,a){this._block=c.alloc(e),this._finalSize=a,this._blockSize=e,this._len=0}f.prototype.update=function(e,a){"string"==typeof e&&(a=a||"utf8",e=c.from(e,a));for(var t=this._block,f=this._blockSize,d=e.length,r=this._len,n=0;n=this._finalSize&&(this._update(this._block),this._block.fill(0));var t=8*this._len;if(t<=4294967295)this._block.writeUInt32BE(t,this._blockSize-4);else{var c=(4294967295&t)>>>0,f=(t-c)/4294967296;this._block.writeUInt32BE(f,this._blockSize-8),this._block.writeUInt32BE(c,this._blockSize-4)}this._update(this._block);var d=this._hash();return e?d.toString(e):d},f.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=f},62802:(e,a,t)=>{var c=e.exports=function(e){e=e.toLowerCase();var a=c[e];if(!a)throw new Error(e+" is not supported (we accept pull requests)");return new a};c.sha=t(27816),c.sha1=t(63737),c.sha224=t(26710),c.sha256=t(24107),c.sha384=t(32827),c.sha512=t(82890)},27816:(e,a,t)=>{var c=t(56698),f=t(90392),d=t(92861).Buffer,r=[1518500249,1859775393,-1894007588,-899497514],n=new Array(80);function i(){this.init(),this._w=n,f.call(this,64,56)}function b(e){return e<<30|e>>>2}function o(e,a,t,c){return 0===e?a&t|~a&c:2===e?a&t|a&c|t&c:a^t^c}c(i,f),i.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},i.prototype._update=function(e){for(var a,t=this._w,c=0|this._a,f=0|this._b,d=0|this._c,n=0|this._d,i=0|this._e,s=0;s<16;++s)t[s]=e.readInt32BE(4*s);for(;s<80;++s)t[s]=t[s-3]^t[s-8]^t[s-14]^t[s-16];for(var l=0;l<80;++l){var u=~~(l/20),h=0|((a=c)<<5|a>>>27)+o(u,f,d,n)+i+t[l]+r[u];i=n,n=d,d=b(f),f=c,c=h}this._a=c+this._a|0,this._b=f+this._b|0,this._c=d+this._c|0,this._d=n+this._d|0,this._e=i+this._e|0},i.prototype._hash=function(){var e=d.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=i},63737:(e,a,t)=>{var c=t(56698),f=t(90392),d=t(92861).Buffer,r=[1518500249,1859775393,-1894007588,-899497514],n=new Array(80);function i(){this.init(),this._w=n,f.call(this,64,56)}function b(e){return e<<5|e>>>27}function o(e){return e<<30|e>>>2}function s(e,a,t,c){return 0===e?a&t|~a&c:2===e?a&t|a&c|t&c:a^t^c}c(i,f),i.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},i.prototype._update=function(e){for(var a,t=this._w,c=0|this._a,f=0|this._b,d=0|this._c,n=0|this._d,i=0|this._e,l=0;l<16;++l)t[l]=e.readInt32BE(4*l);for(;l<80;++l)t[l]=(a=t[l-3]^t[l-8]^t[l-14]^t[l-16])<<1|a>>>31;for(var u=0;u<80;++u){var h=~~(u/20),p=b(c)+s(h,f,d,n)+i+t[u]+r[h]|0;i=n,n=d,d=o(f),f=c,c=p}this._a=c+this._a|0,this._b=f+this._b|0,this._c=d+this._c|0,this._d=n+this._d|0,this._e=i+this._e|0},i.prototype._hash=function(){var e=d.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=i},26710:(e,a,t)=>{var c=t(56698),f=t(24107),d=t(90392),r=t(92861).Buffer,n=new Array(64);function i(){this.init(),this._w=n,d.call(this,64,56)}c(i,f),i.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},i.prototype._hash=function(){var e=r.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=i},24107:(e,a,t)=>{var c=t(56698),f=t(90392),d=t(92861).Buffer,r=[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],n=new Array(64);function i(){this.init(),this._w=n,f.call(this,64,56)}function b(e,a,t){return t^e&(a^t)}function o(e,a,t){return e&a|t&(e|a)}function s(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function l(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function u(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}c(i,f),i.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},i.prototype._update=function(e){for(var a,t=this._w,c=0|this._a,f=0|this._b,d=0|this._c,n=0|this._d,i=0|this._e,h=0|this._f,p=0|this._g,g=0|this._h,m=0;m<16;++m)t[m]=e.readInt32BE(4*m);for(;m<64;++m)t[m]=0|(((a=t[m-2])>>>17|a<<15)^(a>>>19|a<<13)^a>>>10)+t[m-7]+u(t[m-15])+t[m-16];for(var y=0;y<64;++y){var x=g+l(i)+b(i,h,p)+r[y]+t[y]|0,A=s(c)+o(c,f,d)|0;g=p,p=h,h=i,i=n+x|0,n=d,d=f,f=c,c=x+A|0}this._a=c+this._a|0,this._b=f+this._b|0,this._c=d+this._c|0,this._d=n+this._d|0,this._e=i+this._e|0,this._f=h+this._f|0,this._g=p+this._g|0,this._h=g+this._h|0},i.prototype._hash=function(){var e=d.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=i},32827:(e,a,t)=>{var c=t(56698),f=t(82890),d=t(90392),r=t(92861).Buffer,n=new Array(160);function i(){this.init(),this._w=n,d.call(this,128,112)}c(i,f),i.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},i.prototype._hash=function(){var e=r.allocUnsafe(48);function a(a,t,c){e.writeInt32BE(a,c),e.writeInt32BE(t,c+4)}return a(this._ah,this._al,0),a(this._bh,this._bl,8),a(this._ch,this._cl,16),a(this._dh,this._dl,24),a(this._eh,this._el,32),a(this._fh,this._fl,40),e},e.exports=i},82890:(e,a,t)=>{var c=t(56698),f=t(90392),d=t(92861).Buffer,r=[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],n=new Array(160);function i(){this.init(),this._w=n,f.call(this,128,112)}function b(e,a,t){return t^e&(a^t)}function o(e,a,t){return e&a|t&(e|a)}function s(e,a){return(e>>>28|a<<4)^(a>>>2|e<<30)^(a>>>7|e<<25)}function l(e,a){return(e>>>14|a<<18)^(e>>>18|a<<14)^(a>>>9|e<<23)}function u(e,a){return(e>>>1|a<<31)^(e>>>8|a<<24)^e>>>7}function h(e,a){return(e>>>1|a<<31)^(e>>>8|a<<24)^(e>>>7|a<<25)}function p(e,a){return(e>>>19|a<<13)^(a>>>29|e<<3)^e>>>6}function g(e,a){return(e>>>19|a<<13)^(a>>>29|e<<3)^(e>>>6|a<<26)}function m(e,a){return e>>>0>>0?1:0}c(i,f),i.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},i.prototype._update=function(e){for(var a=this._w,t=0|this._ah,c=0|this._bh,f=0|this._ch,d=0|this._dh,n=0|this._eh,i=0|this._fh,y=0|this._gh,x=0|this._hh,A=0|this._al,v=0|this._bl,w=0|this._cl,_=0|this._dl,I=0|this._el,E=0|this._fl,C=0|this._gl,M=0|this._hl,B=0;B<32;B+=2)a[B]=e.readInt32BE(4*B),a[B+1]=e.readInt32BE(4*B+4);for(;B<160;B+=2){var k=a[B-30],L=a[B-30+1],S=u(k,L),T=h(L,k),N=p(k=a[B-4],L=a[B-4+1]),R=g(L,k),P=a[B-14],D=a[B-14+1],O=a[B-32],F=a[B-32+1],Q=T+D|0,U=S+P+m(Q,T)|0;U=(U=U+N+m(Q=Q+R|0,R)|0)+O+m(Q=Q+F|0,F)|0,a[B]=U,a[B+1]=Q}for(var j=0;j<160;j+=2){U=a[j],Q=a[j+1];var H=o(t,c,f),$=o(A,v,w),q=s(t,A),z=s(A,t),G=l(n,I),K=l(I,n),V=r[j],Z=r[j+1],J=b(n,i,y),W=b(I,E,C),Y=M+K|0,X=x+G+m(Y,M)|0;X=(X=(X=X+J+m(Y=Y+W|0,W)|0)+V+m(Y=Y+Z|0,Z)|0)+U+m(Y=Y+Q|0,Q)|0;var ee=z+$|0,ae=q+H+m(ee,z)|0;x=y,M=C,y=i,C=E,i=n,E=I,n=d+X+m(I=_+Y|0,_)|0,d=f,_=w,f=c,w=v,c=t,v=A,t=X+ae+m(A=Y+ee|0,Y)|0}this._al=this._al+A|0,this._bl=this._bl+v|0,this._cl=this._cl+w|0,this._dl=this._dl+_|0,this._el=this._el+I|0,this._fl=this._fl+E|0,this._gl=this._gl+C|0,this._hl=this._hl+M|0,this._ah=this._ah+t+m(this._al,A)|0,this._bh=this._bh+c+m(this._bl,v)|0,this._ch=this._ch+f+m(this._cl,w)|0,this._dh=this._dh+d+m(this._dl,_)|0,this._eh=this._eh+n+m(this._el,I)|0,this._fh=this._fh+i+m(this._fl,E)|0,this._gh=this._gh+y+m(this._gl,C)|0,this._hh=this._hh+x+m(this._hl,M)|0},i.prototype._hash=function(){var e=d.allocUnsafe(64);function a(a,t,c){e.writeInt32BE(a,c),e.writeInt32BE(t,c+4)}return a(this._ah,this._al,0),a(this._bh,this._bl,8),a(this._ch,this._cl,16),a(this._dh,this._dl,24),a(this._eh,this._el,32),a(this._fh,this._fl,40),a(this._gh,this._gl,48),a(this._hh,this._hl,56),e},e.exports=i},88310:(e,a,t)=>{e.exports=f;var c=t(37007).EventEmitter;function f(){c.call(this)}t(56698)(f,c),f.Readable=t(45412),f.Writable=t(16708),f.Duplex=t(25382),f.Transform=t(74610),f.PassThrough=t(63600),f.finished=t(86238),f.pipeline=t(57758),f.Stream=f,f.prototype.pipe=function(e,a){var t=this;function f(a){e.writable&&!1===e.write(a)&&t.pause&&t.pause()}function d(){t.readable&&t.resume&&t.resume()}t.on("data",f),e.on("drain",d),e._isStdio||a&&!1===a.end||(t.on("end",n),t.on("close",i));var r=!1;function n(){r||(r=!0,e.end())}function i(){r||(r=!0,"function"==typeof e.destroy&&e.destroy())}function b(e){if(o(),0===c.listenerCount(this,"error"))throw e}function o(){t.removeListener("data",f),e.removeListener("drain",d),t.removeListener("end",n),t.removeListener("close",i),t.removeListener("error",b),e.removeListener("error",b),t.removeListener("end",o),t.removeListener("close",o),e.removeListener("close",o)}return t.on("error",b),e.on("error",b),t.on("end",o),t.on("close",o),e.on("close",o),e.emit("pipe",t),e}},11568:(e,a,t)=>{var c=t(55537),f=t(6917),d=t(57510),r=t(86866),n=t(59817),i=a;i.request=function(e,a){e="string"==typeof e?n.parse(e):d(e);var f=-1===t.g.location.protocol.search(/^https?:$/)?"http:":"",r=e.protocol||f,i=e.hostname||e.host,b=e.port,o=e.path||"/";i&&-1!==i.indexOf(":")&&(i="["+i+"]"),e.url=(i?r+"//"+i:"")+(b?":"+b:"")+o,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var s=new c(e);return a&&s.on("response",a),s},i.get=function(e,a){var t=i.request(e,a);return t.end(),t},i.ClientRequest=c,i.IncomingMessage=f.IncomingMessage,i.Agent=function(){},i.Agent.defaultMaxSockets=4,i.globalAgent=new i.Agent,i.STATUS_CODES=r,i.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]},6688:(e,a,t)=>{var c;function f(){if(void 0!==c)return c;if(t.g.XMLHttpRequest){c=new t.g.XMLHttpRequest;try{c.open("GET",t.g.XDomainRequest?"/":"https://example.com")}catch(e){c=null}}else c=null;return c}function d(e){var a=f();if(!a)return!1;try{return a.responseType=e,a.responseType===e}catch(e){}return!1}function r(e){return"function"==typeof e}a.fetch=r(t.g.fetch)&&r(t.g.ReadableStream),a.writableStream=r(t.g.WritableStream),a.abortController=r(t.g.AbortController),a.arraybuffer=a.fetch||d("arraybuffer"),a.msstream=!a.fetch&&d("ms-stream"),a.mozchunkedarraybuffer=!a.fetch&&d("moz-chunked-arraybuffer"),a.overrideMimeType=a.fetch||!!f()&&r(f().overrideMimeType),c=null},55537:(e,a,t)=>{var c=t(62045).hp,f=t(6688),d=t(56698),r=t(6917),n=t(28399),i=r.IncomingMessage,b=r.readyStates,o=e.exports=function(e){var a,t=this;n.Writable.call(t),t._opts=e,t._body=[],t._headers={},e.auth&&t.setHeader("Authorization","Basic "+c.from(e.auth).toString("base64")),Object.keys(e.headers).forEach((function(a){t.setHeader(a,e.headers[a])}));var d=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!f.abortController)d=!1,a=!0;else if("prefer-streaming"===e.mode)a=!1;else if("allow-wrong-content-type"===e.mode)a=!f.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");a=!0}t._mode=function(e,a){return f.fetch&&a?"fetch":f.mozchunkedarraybuffer?"moz-chunked-arraybuffer":f.msstream?"ms-stream":f.arraybuffer&&e?"arraybuffer":"text"}(a,d),t._fetchTimer=null,t._socketTimeout=null,t._socketTimer=null,t.on("finish",(function(){t._onFinish()}))};d(o,n.Writable),o.prototype.setHeader=function(e,a){var t=e.toLowerCase();-1===s.indexOf(t)&&(this._headers[t]={name:e,value:a})},o.prototype.getHeader=function(e){var a=this._headers[e.toLowerCase()];return a?a.value:null},o.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},o.prototype._onFinish=function(){var e=this;if(!e._destroyed){var a=e._opts;"timeout"in a&&0!==a.timeout&&e.setTimeout(a.timeout);var c=e._headers,d=null;"GET"!==a.method&&"HEAD"!==a.method&&(d=new Blob(e._body,{type:(c["content-type"]||{}).value||""}));var r=[];if(Object.keys(c).forEach((function(e){var a=c[e].name,t=c[e].value;Array.isArray(t)?t.forEach((function(e){r.push([a,e])})):r.push([a,t])})),"fetch"===e._mode){var n=null;if(f.abortController){var i=new AbortController;n=i.signal,e._fetchAbortController=i,"requestTimeout"in a&&0!==a.requestTimeout&&(e._fetchTimer=t.g.setTimeout((function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()}),a.requestTimeout))}t.g.fetch(e._opts.url,{method:e._opts.method,headers:r,body:d||void 0,mode:"cors",credentials:a.withCredentials?"include":"same-origin",signal:n}).then((function(a){e._fetchResponse=a,e._resetTimers(!1),e._connect()}),(function(a){e._resetTimers(!0),e._destroyed||e.emit("error",a)}))}else{var o=e._xhr=new t.g.XMLHttpRequest;try{o.open(e._opts.method,e._opts.url,!0)}catch(a){return void process.nextTick((function(){e.emit("error",a)}))}"responseType"in o&&(o.responseType=e._mode),"withCredentials"in o&&(o.withCredentials=!!a.withCredentials),"text"===e._mode&&"overrideMimeType"in o&&o.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in a&&(o.timeout=a.requestTimeout,o.ontimeout=function(){e.emit("requestTimeout")}),r.forEach((function(e){o.setRequestHeader(e[0],e[1])})),e._response=null,o.onreadystatechange=function(){switch(o.readyState){case b.LOADING:case b.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(o.onprogress=function(){e._onXHRProgress()}),o.onerror=function(){e._destroyed||(e._resetTimers(!0),e.emit("error",new Error("XHR error")))};try{o.send(d)}catch(a){return void process.nextTick((function(){e.emit("error",a)}))}}}},o.prototype._onXHRProgress=function(){var e=this;e._resetTimers(!1),function(e){try{var a=e.status;return null!==a&&0!==a}catch(e){return!1}}(e._xhr)&&!e._destroyed&&(e._response||e._connect(),e._response._onXHRProgress(e._resetTimers.bind(e)))},o.prototype._connect=function(){var e=this;e._destroyed||(e._response=new i(e._xhr,e._fetchResponse,e._mode,e._resetTimers.bind(e)),e._response.on("error",(function(a){e.emit("error",a)})),e.emit("response",e._response))},o.prototype._write=function(e,a,t){this._body.push(e),t()},o.prototype._resetTimers=function(e){var a=this;t.g.clearTimeout(a._socketTimer),a._socketTimer=null,e?(t.g.clearTimeout(a._fetchTimer),a._fetchTimer=null):a._socketTimeout&&(a._socketTimer=t.g.setTimeout((function(){a.emit("timeout")}),a._socketTimeout))},o.prototype.abort=o.prototype.destroy=function(e){var a=this;a._destroyed=!0,a._resetTimers(!0),a._response&&(a._response._destroyed=!0),a._xhr?a._xhr.abort():a._fetchAbortController&&a._fetchAbortController.abort(),e&&a.emit("error",e)},o.prototype.end=function(e,a,t){"function"==typeof e&&(t=e,e=void 0),n.Writable.prototype.end.call(this,e,a,t)},o.prototype.setTimeout=function(e,a){var t=this;a&&t.once("timeout",a),t._socketTimeout=e,t._resetTimers(!1)},o.prototype.flushHeaders=function(){},o.prototype.setNoDelay=function(){},o.prototype.setSocketKeepAlive=function(){};var s=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]},6917:(e,a,t)=>{var c=t(62045).hp,f=t(6688),d=t(56698),r=t(28399),n=a.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},i=a.IncomingMessage=function(e,a,t,d){var n=this;if(r.Readable.call(n),n._mode=t,n.headers={},n.rawHeaders=[],n.trailers={},n.rawTrailers=[],n.on("end",(function(){process.nextTick((function(){n.emit("close")}))})),"fetch"===t){if(n._fetchResponse=a,n.url=a.url,n.statusCode=a.status,n.statusMessage=a.statusText,a.headers.forEach((function(e,a){n.headers[a.toLowerCase()]=e,n.rawHeaders.push(a,e)})),f.writableStream){var i=new WritableStream({write:function(e){return d(!1),new Promise((function(a,t){n._destroyed?t():n.push(c.from(e))?a():n._resumeFetch=a}))},close:function(){d(!0),n._destroyed||n.push(null)},abort:function(e){d(!0),n._destroyed||n.emit("error",e)}});try{return void a.body.pipeTo(i).catch((function(e){d(!0),n._destroyed||n.emit("error",e)}))}catch(e){}}var b=a.body.getReader();!function e(){b.read().then((function(a){n._destroyed||(d(a.done),a.done?n.push(null):(n.push(c.from(a.value)),e()))})).catch((function(e){d(!0),n._destroyed||n.emit("error",e)}))}()}else if(n._xhr=e,n._pos=0,n.url=e.responseURL,n.statusCode=e.status,n.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach((function(e){var a=e.match(/^([^:]+):\s*(.*)/);if(a){var t=a[1].toLowerCase();"set-cookie"===t?(void 0===n.headers[t]&&(n.headers[t]=[]),n.headers[t].push(a[2])):void 0!==n.headers[t]?n.headers[t]+=", "+a[2]:n.headers[t]=a[2],n.rawHeaders.push(a[1],a[2])}})),n._charset="x-user-defined",!f.overrideMimeType){var o=n.rawHeaders["mime-type"];if(o){var s=o.match(/;\s*charset=([^;])(;|$)/);s&&(n._charset=s[1].toLowerCase())}n._charset||(n._charset="utf-8")}};d(i,r.Readable),i.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},i.prototype._onXHRProgress=function(e){var a=this,f=a._xhr,d=null;switch(a._mode){case"text":if((d=f.responseText).length>a._pos){var r=d.substr(a._pos);if("x-user-defined"===a._charset){for(var i=c.alloc(r.length),b=0;ba._pos&&(a.push(c.from(new Uint8Array(o.result.slice(a._pos)))),a._pos=o.result.byteLength)},o.onload=function(){e(!0),a.push(null)},o.readAsArrayBuffer(d)}a._xhr.readyState===n.DONE&&"ms-stream"!==a._mode&&(e(!0),a.push(null))}},83141:(e,a,t)=>{"use strict";var c=t(92861).Buffer,f=c.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function d(e){var a;switch(this.encoding=function(e){var a=function(e){if(!e)return"utf8";for(var a;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(a)return;e=(""+e).toLowerCase(),a=!0}}(e);if("string"!=typeof a&&(c.isEncoding===f||!f(e)))throw new Error("Unknown encoding: "+e);return a||e}(e),this.encoding){case"utf16le":this.text=i,this.end=b,a=4;break;case"utf8":this.fillLast=n,a=4;break;case"base64":this.text=o,this.end=s,a=3;break;default:return this.write=l,void(this.end=u)}this.lastNeed=0,this.lastTotal=0,this.lastChar=c.allocUnsafe(a)}function r(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function n(e){var a=this.lastTotal-this.lastNeed,t=function(e,a){if(128!=(192&a[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&a.length>1){if(128!=(192&a[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&a.length>2&&128!=(192&a[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==t?t:this.lastNeed<=e.length?(e.copy(this.lastChar,a,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,a,0,e.length),void(this.lastNeed-=e.length))}function i(e,a){if((e.length-a)%2==0){var t=e.toString("utf16le",a);if(t){var c=t.charCodeAt(t.length-1);if(c>=55296&&c<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",a,e.length-1)}function b(e){var a=e&&e.length?this.write(e):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return a+this.lastChar.toString("utf16le",0,t)}return a}function o(e,a){var t=(e.length-a)%3;return 0===t?e.toString("base64",a):(this.lastNeed=3-t,this.lastTotal=3,1===t?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",a,e.length-t))}function s(e){var a=e&&e.length?this.write(e):"";return this.lastNeed?a+this.lastChar.toString("base64",0,3-this.lastNeed):a}function l(e){return e.toString(this.encoding)}function u(e){return e&&e.length?this.write(e):""}a.I=d,d.prototype.write=function(e){if(0===e.length)return"";var a,t;if(this.lastNeed){if(void 0===(a=this.fillLast(e)))return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t=0?(f>0&&(e.lastNeed=f-1),f):--c=0?(f>0&&(e.lastNeed=f-2),f):--c=0?(f>0&&(2===f?f=0:e.lastNeed=f-3),f):0}(this,e,a);if(!this.lastNeed)return e.toString("utf8",a);this.lastTotal=t;var c=e.length-(t-this.lastNeed);return e.copy(this.lastChar,0,c),e.toString("utf8",a,c)},d.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},88947:(e,a,t)=>{!function(e){"use strict";var a=function(e){var a,t=new Float64Array(16);if(e)for(a=0;a>24&255,e[a+1]=t>>16&255,e[a+2]=t>>8&255,e[a+3]=255&t,e[a+4]=c>>24&255,e[a+5]=c>>16&255,e[a+6]=c>>8&255,e[a+7]=255&c}function p(e,a,t,c,f){var d,r=0;for(d=0;d>>8)-1}function g(e,a,t,c){return p(e,a,t,c,16)}function m(e,a,t,c){return p(e,a,t,c,32)}function y(e,a,t,c){!function(e,a,t,c){for(var f,d=255&c[0]|(255&c[1])<<8|(255&c[2])<<16|(255&c[3])<<24,r=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,n=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,i=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,b=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,o=255&c[4]|(255&c[5])<<8|(255&c[6])<<16|(255&c[7])<<24,s=255&a[0]|(255&a[1])<<8|(255&a[2])<<16|(255&a[3])<<24,l=255&a[4]|(255&a[5])<<8|(255&a[6])<<16|(255&a[7])<<24,u=255&a[8]|(255&a[9])<<8|(255&a[10])<<16|(255&a[11])<<24,h=255&a[12]|(255&a[13])<<8|(255&a[14])<<16|(255&a[15])<<24,p=255&c[8]|(255&c[9])<<8|(255&c[10])<<16|(255&c[11])<<24,g=255&t[16]|(255&t[17])<<8|(255&t[18])<<16|(255&t[19])<<24,m=255&t[20]|(255&t[21])<<8|(255&t[22])<<16|(255&t[23])<<24,y=255&t[24]|(255&t[25])<<8|(255&t[26])<<16|(255&t[27])<<24,x=255&t[28]|(255&t[29])<<8|(255&t[30])<<16|(255&t[31])<<24,A=255&c[12]|(255&c[13])<<8|(255&c[14])<<16|(255&c[15])<<24,v=d,w=r,_=n,I=i,E=b,C=o,M=s,B=l,k=u,L=h,S=p,T=g,N=m,R=y,P=x,D=A,O=0;O<20;O+=2)v^=(f=(N^=(f=(k^=(f=(E^=(f=v+N|0)<<7|f>>>25)+v|0)<<9|f>>>23)+E|0)<<13|f>>>19)+k|0)<<18|f>>>14,C^=(f=(w^=(f=(R^=(f=(L^=(f=C+w|0)<<7|f>>>25)+C|0)<<9|f>>>23)+L|0)<<13|f>>>19)+R|0)<<18|f>>>14,S^=(f=(M^=(f=(_^=(f=(P^=(f=S+M|0)<<7|f>>>25)+S|0)<<9|f>>>23)+P|0)<<13|f>>>19)+_|0)<<18|f>>>14,D^=(f=(T^=(f=(B^=(f=(I^=(f=D+T|0)<<7|f>>>25)+D|0)<<9|f>>>23)+I|0)<<13|f>>>19)+B|0)<<18|f>>>14,v^=(f=(I^=(f=(_^=(f=(w^=(f=v+I|0)<<7|f>>>25)+v|0)<<9|f>>>23)+w|0)<<13|f>>>19)+_|0)<<18|f>>>14,C^=(f=(E^=(f=(B^=(f=(M^=(f=C+E|0)<<7|f>>>25)+C|0)<<9|f>>>23)+M|0)<<13|f>>>19)+B|0)<<18|f>>>14,S^=(f=(L^=(f=(k^=(f=(T^=(f=S+L|0)<<7|f>>>25)+S|0)<<9|f>>>23)+T|0)<<13|f>>>19)+k|0)<<18|f>>>14,D^=(f=(P^=(f=(R^=(f=(N^=(f=D+P|0)<<7|f>>>25)+D|0)<<9|f>>>23)+N|0)<<13|f>>>19)+R|0)<<18|f>>>14;v=v+d|0,w=w+r|0,_=_+n|0,I=I+i|0,E=E+b|0,C=C+o|0,M=M+s|0,B=B+l|0,k=k+u|0,L=L+h|0,S=S+p|0,T=T+g|0,N=N+m|0,R=R+y|0,P=P+x|0,D=D+A|0,e[0]=v>>>0&255,e[1]=v>>>8&255,e[2]=v>>>16&255,e[3]=v>>>24&255,e[4]=w>>>0&255,e[5]=w>>>8&255,e[6]=w>>>16&255,e[7]=w>>>24&255,e[8]=_>>>0&255,e[9]=_>>>8&255,e[10]=_>>>16&255,e[11]=_>>>24&255,e[12]=I>>>0&255,e[13]=I>>>8&255,e[14]=I>>>16&255,e[15]=I>>>24&255,e[16]=E>>>0&255,e[17]=E>>>8&255,e[18]=E>>>16&255,e[19]=E>>>24&255,e[20]=C>>>0&255,e[21]=C>>>8&255,e[22]=C>>>16&255,e[23]=C>>>24&255,e[24]=M>>>0&255,e[25]=M>>>8&255,e[26]=M>>>16&255,e[27]=M>>>24&255,e[28]=B>>>0&255,e[29]=B>>>8&255,e[30]=B>>>16&255,e[31]=B>>>24&255,e[32]=k>>>0&255,e[33]=k>>>8&255,e[34]=k>>>16&255,e[35]=k>>>24&255,e[36]=L>>>0&255,e[37]=L>>>8&255,e[38]=L>>>16&255,e[39]=L>>>24&255,e[40]=S>>>0&255,e[41]=S>>>8&255,e[42]=S>>>16&255,e[43]=S>>>24&255,e[44]=T>>>0&255,e[45]=T>>>8&255,e[46]=T>>>16&255,e[47]=T>>>24&255,e[48]=N>>>0&255,e[49]=N>>>8&255,e[50]=N>>>16&255,e[51]=N>>>24&255,e[52]=R>>>0&255,e[53]=R>>>8&255,e[54]=R>>>16&255,e[55]=R>>>24&255,e[56]=P>>>0&255,e[57]=P>>>8&255,e[58]=P>>>16&255,e[59]=P>>>24&255,e[60]=D>>>0&255,e[61]=D>>>8&255,e[62]=D>>>16&255,e[63]=D>>>24&255}(e,a,t,c)}function x(e,a,t,c){!function(e,a,t,c){for(var f,d=255&c[0]|(255&c[1])<<8|(255&c[2])<<16|(255&c[3])<<24,r=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,n=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,i=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,b=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,o=255&c[4]|(255&c[5])<<8|(255&c[6])<<16|(255&c[7])<<24,s=255&a[0]|(255&a[1])<<8|(255&a[2])<<16|(255&a[3])<<24,l=255&a[4]|(255&a[5])<<8|(255&a[6])<<16|(255&a[7])<<24,u=255&a[8]|(255&a[9])<<8|(255&a[10])<<16|(255&a[11])<<24,h=255&a[12]|(255&a[13])<<8|(255&a[14])<<16|(255&a[15])<<24,p=255&c[8]|(255&c[9])<<8|(255&c[10])<<16|(255&c[11])<<24,g=255&t[16]|(255&t[17])<<8|(255&t[18])<<16|(255&t[19])<<24,m=255&t[20]|(255&t[21])<<8|(255&t[22])<<16|(255&t[23])<<24,y=255&t[24]|(255&t[25])<<8|(255&t[26])<<16|(255&t[27])<<24,x=255&t[28]|(255&t[29])<<8|(255&t[30])<<16|(255&t[31])<<24,A=255&c[12]|(255&c[13])<<8|(255&c[14])<<16|(255&c[15])<<24,v=0;v<20;v+=2)d^=(f=(m^=(f=(u^=(f=(b^=(f=d+m|0)<<7|f>>>25)+d|0)<<9|f>>>23)+b|0)<<13|f>>>19)+u|0)<<18|f>>>14,o^=(f=(r^=(f=(y^=(f=(h^=(f=o+r|0)<<7|f>>>25)+o|0)<<9|f>>>23)+h|0)<<13|f>>>19)+y|0)<<18|f>>>14,p^=(f=(s^=(f=(n^=(f=(x^=(f=p+s|0)<<7|f>>>25)+p|0)<<9|f>>>23)+x|0)<<13|f>>>19)+n|0)<<18|f>>>14,A^=(f=(g^=(f=(l^=(f=(i^=(f=A+g|0)<<7|f>>>25)+A|0)<<9|f>>>23)+i|0)<<13|f>>>19)+l|0)<<18|f>>>14,d^=(f=(i^=(f=(n^=(f=(r^=(f=d+i|0)<<7|f>>>25)+d|0)<<9|f>>>23)+r|0)<<13|f>>>19)+n|0)<<18|f>>>14,o^=(f=(b^=(f=(l^=(f=(s^=(f=o+b|0)<<7|f>>>25)+o|0)<<9|f>>>23)+s|0)<<13|f>>>19)+l|0)<<18|f>>>14,p^=(f=(h^=(f=(u^=(f=(g^=(f=p+h|0)<<7|f>>>25)+p|0)<<9|f>>>23)+g|0)<<13|f>>>19)+u|0)<<18|f>>>14,A^=(f=(x^=(f=(y^=(f=(m^=(f=A+x|0)<<7|f>>>25)+A|0)<<9|f>>>23)+m|0)<<13|f>>>19)+y|0)<<18|f>>>14;e[0]=d>>>0&255,e[1]=d>>>8&255,e[2]=d>>>16&255,e[3]=d>>>24&255,e[4]=o>>>0&255,e[5]=o>>>8&255,e[6]=o>>>16&255,e[7]=o>>>24&255,e[8]=p>>>0&255,e[9]=p>>>8&255,e[10]=p>>>16&255,e[11]=p>>>24&255,e[12]=A>>>0&255,e[13]=A>>>8&255,e[14]=A>>>16&255,e[15]=A>>>24&255,e[16]=s>>>0&255,e[17]=s>>>8&255,e[18]=s>>>16&255,e[19]=s>>>24&255,e[20]=l>>>0&255,e[21]=l>>>8&255,e[22]=l>>>16&255,e[23]=l>>>24&255,e[24]=u>>>0&255,e[25]=u>>>8&255,e[26]=u>>>16&255,e[27]=u>>>24&255,e[28]=h>>>0&255,e[29]=h>>>8&255,e[30]=h>>>16&255,e[31]=h>>>24&255}(e,a,t,c)}var A=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function v(e,a,t,c,f,d,r){var n,i,b=new Uint8Array(16),o=new Uint8Array(64);for(i=0;i<16;i++)b[i]=0;for(i=0;i<8;i++)b[i]=d[i];for(;f>=64;){for(y(o,b,r,A),i=0;i<64;i++)e[a+i]=t[c+i]^o[i];for(n=1,i=8;i<16;i++)n=n+(255&b[i])|0,b[i]=255&n,n>>>=8;f-=64,a+=64,c+=64}if(f>0)for(y(o,b,r,A),i=0;i=64;){for(y(i,n,f,A),r=0;r<64;r++)e[a+r]=i[r];for(d=1,r=8;r<16;r++)d=d+(255&n[r])|0,n[r]=255&d,d>>>=8;t-=64,a+=64}if(t>0)for(y(i,n,f,A),r=0;r>>13|t<<3),c=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(t>>>10|c<<6),f=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(c>>>7|f<<9),d=255&e[8]|(255&e[9])<<8,this.r[4]=255&(f>>>4|d<<12),this.r[5]=d>>>1&8190,r=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(d>>>14|r<<2),n=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(r>>>11|n<<5),i=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(n>>>8|i<<8),this.r[9]=i>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function C(e,a,t,c,f,d){var r=new E(d);return r.update(t,c,f),r.finish(e,a),0}function M(e,a,t,c,f,d){var r=new Uint8Array(16);return C(r,0,t,c,f,d),g(e,a,r,0)}function B(e,a,t,c,f){var d;if(t<32)return-1;for(I(e,0,a,0,t,c,f),C(e,16,e,32,t-32,e),d=0;d<16;d++)e[d]=0;return 0}function k(e,a,t,c,f){var d,r=new Uint8Array(32);if(t<32)return-1;if(_(r,0,32,c,f),0!==M(a,16,a,32,t-32,r))return-1;for(I(e,0,a,0,t,c,f),d=0;d<32;d++)e[d]=0;return 0}function L(e,a){var t;for(t=0;t<16;t++)e[t]=0|a[t]}function S(e){var a,t,c=1;for(a=0;a<16;a++)t=e[a]+c+65535,c=Math.floor(t/65536),e[a]=t-65536*c;e[0]+=c-1+37*(c-1)}function T(e,a,t){for(var c,f=~(t-1),d=0;d<16;d++)c=f&(e[d]^a[d]),e[d]^=c,a[d]^=c}function N(e,t){var c,f,d,r=a(),n=a();for(c=0;c<16;c++)n[c]=t[c];for(S(n),S(n),S(n),f=0;f<2;f++){for(r[0]=n[0]-65517,c=1;c<15;c++)r[c]=n[c]-65535-(r[c-1]>>16&1),r[c-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1),d=r[15]>>16&1,r[14]&=65535,T(n,r,1-d)}for(c=0;c<16;c++)e[2*c]=255&n[c],e[2*c+1]=n[c]>>8}function R(e,a){var t=new Uint8Array(32),c=new Uint8Array(32);return N(t,e),N(c,a),m(t,0,c,0)}function P(e){var a=new Uint8Array(32);return N(a,e),1&a[0]}function D(e,a){var t;for(t=0;t<16;t++)e[t]=a[2*t]+(a[2*t+1]<<8);e[15]&=32767}function O(e,a,t){for(var c=0;c<16;c++)e[c]=a[c]+t[c]}function F(e,a,t){for(var c=0;c<16;c++)e[c]=a[c]-t[c]}function Q(e,a,t){var c,f,d=0,r=0,n=0,i=0,b=0,o=0,s=0,l=0,u=0,h=0,p=0,g=0,m=0,y=0,x=0,A=0,v=0,w=0,_=0,I=0,E=0,C=0,M=0,B=0,k=0,L=0,S=0,T=0,N=0,R=0,P=0,D=t[0],O=t[1],F=t[2],Q=t[3],U=t[4],j=t[5],H=t[6],$=t[7],q=t[8],z=t[9],G=t[10],K=t[11],V=t[12],Z=t[13],J=t[14],W=t[15];d+=(c=a[0])*D,r+=c*O,n+=c*F,i+=c*Q,b+=c*U,o+=c*j,s+=c*H,l+=c*$,u+=c*q,h+=c*z,p+=c*G,g+=c*K,m+=c*V,y+=c*Z,x+=c*J,A+=c*W,r+=(c=a[1])*D,n+=c*O,i+=c*F,b+=c*Q,o+=c*U,s+=c*j,l+=c*H,u+=c*$,h+=c*q,p+=c*z,g+=c*G,m+=c*K,y+=c*V,x+=c*Z,A+=c*J,v+=c*W,n+=(c=a[2])*D,i+=c*O,b+=c*F,o+=c*Q,s+=c*U,l+=c*j,u+=c*H,h+=c*$,p+=c*q,g+=c*z,m+=c*G,y+=c*K,x+=c*V,A+=c*Z,v+=c*J,w+=c*W,i+=(c=a[3])*D,b+=c*O,o+=c*F,s+=c*Q,l+=c*U,u+=c*j,h+=c*H,p+=c*$,g+=c*q,m+=c*z,y+=c*G,x+=c*K,A+=c*V,v+=c*Z,w+=c*J,_+=c*W,b+=(c=a[4])*D,o+=c*O,s+=c*F,l+=c*Q,u+=c*U,h+=c*j,p+=c*H,g+=c*$,m+=c*q,y+=c*z,x+=c*G,A+=c*K,v+=c*V,w+=c*Z,_+=c*J,I+=c*W,o+=(c=a[5])*D,s+=c*O,l+=c*F,u+=c*Q,h+=c*U,p+=c*j,g+=c*H,m+=c*$,y+=c*q,x+=c*z,A+=c*G,v+=c*K,w+=c*V,_+=c*Z,I+=c*J,E+=c*W,s+=(c=a[6])*D,l+=c*O,u+=c*F,h+=c*Q,p+=c*U,g+=c*j,m+=c*H,y+=c*$,x+=c*q,A+=c*z,v+=c*G,w+=c*K,_+=c*V,I+=c*Z,E+=c*J,C+=c*W,l+=(c=a[7])*D,u+=c*O,h+=c*F,p+=c*Q,g+=c*U,m+=c*j,y+=c*H,x+=c*$,A+=c*q,v+=c*z,w+=c*G,_+=c*K,I+=c*V,E+=c*Z,C+=c*J,M+=c*W,u+=(c=a[8])*D,h+=c*O,p+=c*F,g+=c*Q,m+=c*U,y+=c*j,x+=c*H,A+=c*$,v+=c*q,w+=c*z,_+=c*G,I+=c*K,E+=c*V,C+=c*Z,M+=c*J,B+=c*W,h+=(c=a[9])*D,p+=c*O,g+=c*F,m+=c*Q,y+=c*U,x+=c*j,A+=c*H,v+=c*$,w+=c*q,_+=c*z,I+=c*G,E+=c*K,C+=c*V,M+=c*Z,B+=c*J,k+=c*W,p+=(c=a[10])*D,g+=c*O,m+=c*F,y+=c*Q,x+=c*U,A+=c*j,v+=c*H,w+=c*$,_+=c*q,I+=c*z,E+=c*G,C+=c*K,M+=c*V,B+=c*Z,k+=c*J,L+=c*W,g+=(c=a[11])*D,m+=c*O,y+=c*F,x+=c*Q,A+=c*U,v+=c*j,w+=c*H,_+=c*$,I+=c*q,E+=c*z,C+=c*G,M+=c*K,B+=c*V,k+=c*Z,L+=c*J,S+=c*W,m+=(c=a[12])*D,y+=c*O,x+=c*F,A+=c*Q,v+=c*U,w+=c*j,_+=c*H,I+=c*$,E+=c*q,C+=c*z,M+=c*G,B+=c*K,k+=c*V,L+=c*Z,S+=c*J,T+=c*W,y+=(c=a[13])*D,x+=c*O,A+=c*F,v+=c*Q,w+=c*U,_+=c*j,I+=c*H,E+=c*$,C+=c*q,M+=c*z,B+=c*G,k+=c*K,L+=c*V,S+=c*Z,T+=c*J,N+=c*W,x+=(c=a[14])*D,A+=c*O,v+=c*F,w+=c*Q,_+=c*U,I+=c*j,E+=c*H,C+=c*$,M+=c*q,B+=c*z,k+=c*G,L+=c*K,S+=c*V,T+=c*Z,N+=c*J,R+=c*W,A+=(c=a[15])*D,r+=38*(w+=c*F),n+=38*(_+=c*Q),i+=38*(I+=c*U),b+=38*(E+=c*j),o+=38*(C+=c*H),s+=38*(M+=c*$),l+=38*(B+=c*q),u+=38*(k+=c*z),h+=38*(L+=c*G),p+=38*(S+=c*K),g+=38*(T+=c*V),m+=38*(N+=c*Z),y+=38*(R+=c*J),x+=38*(P+=c*W),d=(c=(d+=38*(v+=c*O))+(f=1)+65535)-65536*(f=Math.floor(c/65536)),r=(c=r+f+65535)-65536*(f=Math.floor(c/65536)),n=(c=n+f+65535)-65536*(f=Math.floor(c/65536)),i=(c=i+f+65535)-65536*(f=Math.floor(c/65536)),b=(c=b+f+65535)-65536*(f=Math.floor(c/65536)),o=(c=o+f+65535)-65536*(f=Math.floor(c/65536)),s=(c=s+f+65535)-65536*(f=Math.floor(c/65536)),l=(c=l+f+65535)-65536*(f=Math.floor(c/65536)),u=(c=u+f+65535)-65536*(f=Math.floor(c/65536)),h=(c=h+f+65535)-65536*(f=Math.floor(c/65536)),p=(c=p+f+65535)-65536*(f=Math.floor(c/65536)),g=(c=g+f+65535)-65536*(f=Math.floor(c/65536)),m=(c=m+f+65535)-65536*(f=Math.floor(c/65536)),y=(c=y+f+65535)-65536*(f=Math.floor(c/65536)),x=(c=x+f+65535)-65536*(f=Math.floor(c/65536)),A=(c=A+f+65535)-65536*(f=Math.floor(c/65536)),d=(c=(d+=f-1+37*(f-1))+(f=1)+65535)-65536*(f=Math.floor(c/65536)),r=(c=r+f+65535)-65536*(f=Math.floor(c/65536)),n=(c=n+f+65535)-65536*(f=Math.floor(c/65536)),i=(c=i+f+65535)-65536*(f=Math.floor(c/65536)),b=(c=b+f+65535)-65536*(f=Math.floor(c/65536)),o=(c=o+f+65535)-65536*(f=Math.floor(c/65536)),s=(c=s+f+65535)-65536*(f=Math.floor(c/65536)),l=(c=l+f+65535)-65536*(f=Math.floor(c/65536)),u=(c=u+f+65535)-65536*(f=Math.floor(c/65536)),h=(c=h+f+65535)-65536*(f=Math.floor(c/65536)),p=(c=p+f+65535)-65536*(f=Math.floor(c/65536)),g=(c=g+f+65535)-65536*(f=Math.floor(c/65536)),m=(c=m+f+65535)-65536*(f=Math.floor(c/65536)),y=(c=y+f+65535)-65536*(f=Math.floor(c/65536)),x=(c=x+f+65535)-65536*(f=Math.floor(c/65536)),A=(c=A+f+65535)-65536*(f=Math.floor(c/65536)),d+=f-1+37*(f-1),e[0]=d,e[1]=r,e[2]=n,e[3]=i,e[4]=b,e[5]=o,e[6]=s,e[7]=l,e[8]=u,e[9]=h,e[10]=p,e[11]=g,e[12]=m,e[13]=y,e[14]=x,e[15]=A}function U(e,a){Q(e,a,a)}function j(e,t){var c,f=a();for(c=0;c<16;c++)f[c]=t[c];for(c=253;c>=0;c--)U(f,f),2!==c&&4!==c&&Q(f,f,t);for(c=0;c<16;c++)e[c]=f[c]}function H(e,t){var c,f=a();for(c=0;c<16;c++)f[c]=t[c];for(c=250;c>=0;c--)U(f,f),1!==c&&Q(f,f,t);for(c=0;c<16;c++)e[c]=f[c]}function $(e,t,c){var f,d,r=new Uint8Array(32),n=new Float64Array(80),b=a(),o=a(),s=a(),l=a(),u=a(),h=a();for(d=0;d<31;d++)r[d]=t[d];for(r[31]=127&t[31]|64,r[0]&=248,D(n,c),d=0;d<16;d++)o[d]=n[d],l[d]=b[d]=s[d]=0;for(b[0]=l[0]=1,d=254;d>=0;--d)T(b,o,f=r[d>>>3]>>>(7&d)&1),T(s,l,f),O(u,b,s),F(b,b,s),O(s,o,l),F(o,o,l),U(l,u),U(h,b),Q(b,s,b),Q(s,o,u),O(u,b,s),F(b,b,s),U(o,b),F(s,l,h),Q(b,s,i),O(b,b,l),Q(s,s,b),Q(b,l,h),Q(l,o,n),U(o,u),T(b,o,f),T(s,l,f);for(d=0;d<16;d++)n[d+16]=b[d],n[d+32]=s[d],n[d+48]=o[d],n[d+64]=l[d];var p=n.subarray(32),g=n.subarray(16);return j(p,p),Q(g,g,p),N(e,g),0}function q(e,a){return $(e,a,d)}function z(e,a){return c(a,32),q(e,a)}function G(e,a,t){var c=new Uint8Array(32);return $(c,t,a),x(e,f,c,A)}E.prototype.blocks=function(e,a,t){for(var c,f,d,r,n,i,b,o,s,l,u,h,p,g,m,y,x,A,v,w=this.fin?0:2048,_=this.h[0],I=this.h[1],E=this.h[2],C=this.h[3],M=this.h[4],B=this.h[5],k=this.h[6],L=this.h[7],S=this.h[8],T=this.h[9],N=this.r[0],R=this.r[1],P=this.r[2],D=this.r[3],O=this.r[4],F=this.r[5],Q=this.r[6],U=this.r[7],j=this.r[8],H=this.r[9];t>=16;)l=s=0,l+=(_+=8191&(c=255&e[a+0]|(255&e[a+1])<<8))*N,l+=(I+=8191&(c>>>13|(f=255&e[a+2]|(255&e[a+3])<<8)<<3))*(5*H),l+=(E+=8191&(f>>>10|(d=255&e[a+4]|(255&e[a+5])<<8)<<6))*(5*j),l+=(C+=8191&(d>>>7|(r=255&e[a+6]|(255&e[a+7])<<8)<<9))*(5*U),s=(l+=(M+=8191&(r>>>4|(n=255&e[a+8]|(255&e[a+9])<<8)<<12))*(5*Q))>>>13,l&=8191,l+=(B+=n>>>1&8191)*(5*F),l+=(k+=8191&(n>>>14|(i=255&e[a+10]|(255&e[a+11])<<8)<<2))*(5*O),l+=(L+=8191&(i>>>11|(b=255&e[a+12]|(255&e[a+13])<<8)<<5))*(5*D),l+=(S+=8191&(b>>>8|(o=255&e[a+14]|(255&e[a+15])<<8)<<8))*(5*P),u=s+=(l+=(T+=o>>>5|w)*(5*R))>>>13,u+=_*R,u+=I*N,u+=E*(5*H),u+=C*(5*j),s=(u+=M*(5*U))>>>13,u&=8191,u+=B*(5*Q),u+=k*(5*F),u+=L*(5*O),u+=S*(5*D),s+=(u+=T*(5*P))>>>13,u&=8191,h=s,h+=_*P,h+=I*R,h+=E*N,h+=C*(5*H),s=(h+=M*(5*j))>>>13,h&=8191,h+=B*(5*U),h+=k*(5*Q),h+=L*(5*F),h+=S*(5*O),p=s+=(h+=T*(5*D))>>>13,p+=_*D,p+=I*P,p+=E*R,p+=C*N,s=(p+=M*(5*H))>>>13,p&=8191,p+=B*(5*j),p+=k*(5*U),p+=L*(5*Q),p+=S*(5*F),g=s+=(p+=T*(5*O))>>>13,g+=_*O,g+=I*D,g+=E*P,g+=C*R,s=(g+=M*N)>>>13,g&=8191,g+=B*(5*H),g+=k*(5*j),g+=L*(5*U),g+=S*(5*Q),m=s+=(g+=T*(5*F))>>>13,m+=_*F,m+=I*O,m+=E*D,m+=C*P,s=(m+=M*R)>>>13,m&=8191,m+=B*N,m+=k*(5*H),m+=L*(5*j),m+=S*(5*U),y=s+=(m+=T*(5*Q))>>>13,y+=_*Q,y+=I*F,y+=E*O,y+=C*D,s=(y+=M*P)>>>13,y&=8191,y+=B*R,y+=k*N,y+=L*(5*H),y+=S*(5*j),x=s+=(y+=T*(5*U))>>>13,x+=_*U,x+=I*Q,x+=E*F,x+=C*O,s=(x+=M*D)>>>13,x&=8191,x+=B*P,x+=k*R,x+=L*N,x+=S*(5*H),A=s+=(x+=T*(5*j))>>>13,A+=_*j,A+=I*U,A+=E*Q,A+=C*F,s=(A+=M*O)>>>13,A&=8191,A+=B*D,A+=k*P,A+=L*R,A+=S*N,v=s+=(A+=T*(5*H))>>>13,v+=_*H,v+=I*j,v+=E*U,v+=C*Q,s=(v+=M*F)>>>13,v&=8191,v+=B*O,v+=k*D,v+=L*P,v+=S*R,_=l=8191&(s=(s=((s+=(v+=T*N)>>>13)<<2)+s|0)+(l&=8191)|0),I=u+=s>>>=13,E=h&=8191,C=p&=8191,M=g&=8191,B=m&=8191,k=y&=8191,L=x&=8191,S=A&=8191,T=v&=8191,a+=16,t-=16;this.h[0]=_,this.h[1]=I,this.h[2]=E,this.h[3]=C,this.h[4]=M,this.h[5]=B,this.h[6]=k,this.h[7]=L,this.h[8]=S,this.h[9]=T},E.prototype.finish=function(e,a){var t,c,f,d,r=new Uint16Array(10);if(this.leftover){for(d=this.leftover,this.buffer[d++]=1;d<16;d++)this.buffer[d]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(t=this.h[1]>>>13,this.h[1]&=8191,d=2;d<10;d++)this.h[d]+=t,t=this.h[d]>>>13,this.h[d]&=8191;for(this.h[0]+=5*t,t=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=t,t=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=t,r[0]=this.h[0]+5,t=r[0]>>>13,r[0]&=8191,d=1;d<10;d++)r[d]=this.h[d]+t,t=r[d]>>>13,r[d]&=8191;for(r[9]-=8192,c=(1^t)-1,d=0;d<10;d++)r[d]&=c;for(c=~c,d=0;d<10;d++)this.h[d]=this.h[d]&c|r[d];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),f=this.h[0]+this.pad[0],this.h[0]=65535&f,d=1;d<8;d++)f=(this.h[d]+this.pad[d]|0)+(f>>>16)|0,this.h[d]=65535&f;e[a+0]=this.h[0]>>>0&255,e[a+1]=this.h[0]>>>8&255,e[a+2]=this.h[1]>>>0&255,e[a+3]=this.h[1]>>>8&255,e[a+4]=this.h[2]>>>0&255,e[a+5]=this.h[2]>>>8&255,e[a+6]=this.h[3]>>>0&255,e[a+7]=this.h[3]>>>8&255,e[a+8]=this.h[4]>>>0&255,e[a+9]=this.h[4]>>>8&255,e[a+10]=this.h[5]>>>0&255,e[a+11]=this.h[5]>>>8&255,e[a+12]=this.h[6]>>>0&255,e[a+13]=this.h[6]>>>8&255,e[a+14]=this.h[7]>>>0&255,e[a+15]=this.h[7]>>>8&255},E.prototype.update=function(e,a,t){var c,f;if(this.leftover){for((f=16-this.leftover)>t&&(f=t),c=0;c=16&&(f=t-t%16,this.blocks(e,a,f),a+=f,t-=f),t){for(c=0;c=128;){for(w=0;w<16;w++)_=8*w+V,L[w]=t[_+0]<<24|t[_+1]<<16|t[_+2]<<8|t[_+3],S[w]=t[_+4]<<24|t[_+5]<<16|t[_+6]<<8|t[_+7];for(w=0;w<80;w++)if(f=T,d=N,r=R,n=P,i=D,b=O,o=F,l=U,u=j,h=H,p=$,g=q,m=z,y=G,C=65535&(E=K),M=E>>>16,B=65535&(I=Q),k=I>>>16,C+=65535&(E=(q>>>14|D<<18)^(q>>>18|D<<14)^(D>>>9|q<<23)),M+=E>>>16,B+=65535&(I=(D>>>14|q<<18)^(D>>>18|q<<14)^(q>>>9|D<<23)),k+=I>>>16,C+=65535&(E=q&z^~q&G),M+=E>>>16,B+=65535&(I=D&O^~D&F),k+=I>>>16,C+=65535&(E=Z[2*w+1]),M+=E>>>16,B+=65535&(I=Z[2*w]),k+=I>>>16,I=L[w%16],M+=(E=S[w%16])>>>16,B+=65535&I,k+=I>>>16,B+=(M+=(C+=65535&E)>>>16)>>>16,C=65535&(E=v=65535&C|M<<16),M=E>>>16,B=65535&(I=A=65535&B|(k+=B>>>16)<<16),k=I>>>16,C+=65535&(E=(U>>>28|T<<4)^(T>>>2|U<<30)^(T>>>7|U<<25)),M+=E>>>16,B+=65535&(I=(T>>>28|U<<4)^(U>>>2|T<<30)^(U>>>7|T<<25)),k+=I>>>16,M+=(E=U&j^U&H^j&H)>>>16,B+=65535&(I=T&N^T&R^N&R),k+=I>>>16,s=65535&(B+=(M+=(C+=65535&E)>>>16)>>>16)|(k+=B>>>16)<<16,x=65535&C|M<<16,C=65535&(E=p),M=E>>>16,B=65535&(I=n),k=I>>>16,M+=(E=v)>>>16,B+=65535&(I=A),k+=I>>>16,N=f,R=d,P=r,D=n=65535&(B+=(M+=(C+=65535&E)>>>16)>>>16)|(k+=B>>>16)<<16,O=i,F=b,Q=o,T=s,j=l,H=u,$=h,q=p=65535&C|M<<16,z=g,G=m,K=y,U=x,w%16==15)for(_=0;_<16;_++)I=L[_],C=65535&(E=S[_]),M=E>>>16,B=65535&I,k=I>>>16,I=L[(_+9)%16],C+=65535&(E=S[(_+9)%16]),M+=E>>>16,B+=65535&I,k+=I>>>16,A=L[(_+1)%16],C+=65535&(E=((v=S[(_+1)%16])>>>1|A<<31)^(v>>>8|A<<24)^(v>>>7|A<<25)),M+=E>>>16,B+=65535&(I=(A>>>1|v<<31)^(A>>>8|v<<24)^A>>>7),k+=I>>>16,A=L[(_+14)%16],M+=(E=((v=S[(_+14)%16])>>>19|A<<13)^(A>>>29|v<<3)^(v>>>6|A<<26))>>>16,B+=65535&(I=(A>>>19|v<<13)^(v>>>29|A<<3)^A>>>6),k+=I>>>16,k+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,L[_]=65535&B|k<<16,S[_]=65535&C|M<<16;C=65535&(E=U),M=E>>>16,B=65535&(I=T),k=I>>>16,I=e[0],M+=(E=a[0])>>>16,B+=65535&I,k+=I>>>16,k+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[0]=T=65535&B|k<<16,a[0]=U=65535&C|M<<16,C=65535&(E=j),M=E>>>16,B=65535&(I=N),k=I>>>16,I=e[1],M+=(E=a[1])>>>16,B+=65535&I,k+=I>>>16,k+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[1]=N=65535&B|k<<16,a[1]=j=65535&C|M<<16,C=65535&(E=H),M=E>>>16,B=65535&(I=R),k=I>>>16,I=e[2],M+=(E=a[2])>>>16,B+=65535&I,k+=I>>>16,k+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[2]=R=65535&B|k<<16,a[2]=H=65535&C|M<<16,C=65535&(E=$),M=E>>>16,B=65535&(I=P),k=I>>>16,I=e[3],M+=(E=a[3])>>>16,B+=65535&I,k+=I>>>16,k+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[3]=P=65535&B|k<<16,a[3]=$=65535&C|M<<16,C=65535&(E=q),M=E>>>16,B=65535&(I=D),k=I>>>16,I=e[4],M+=(E=a[4])>>>16,B+=65535&I,k+=I>>>16,k+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[4]=D=65535&B|k<<16,a[4]=q=65535&C|M<<16,C=65535&(E=z),M=E>>>16,B=65535&(I=O),k=I>>>16,I=e[5],M+=(E=a[5])>>>16,B+=65535&I,k+=I>>>16,k+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[5]=O=65535&B|k<<16,a[5]=z=65535&C|M<<16,C=65535&(E=G),M=E>>>16,B=65535&(I=F),k=I>>>16,I=e[6],M+=(E=a[6])>>>16,B+=65535&I,k+=I>>>16,k+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[6]=F=65535&B|k<<16,a[6]=G=65535&C|M<<16,C=65535&(E=K),M=E>>>16,B=65535&(I=Q),k=I>>>16,I=e[7],M+=(E=a[7])>>>16,B+=65535&I,k+=I>>>16,k+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[7]=Q=65535&B|k<<16,a[7]=K=65535&C|M<<16,V+=128,c-=128}return c}function W(e,a,t){var c,f=new Int32Array(8),d=new Int32Array(8),r=new Uint8Array(256),n=t;for(f[0]=1779033703,f[1]=3144134277,f[2]=1013904242,f[3]=2773480762,f[4]=1359893119,f[5]=2600822924,f[6]=528734635,f[7]=1541459225,d[0]=4089235720,d[1]=2227873595,d[2]=4271175723,d[3]=1595750129,d[4]=2917565137,d[5]=725511199,d[6]=4215389547,d[7]=327033209,J(f,d,a,t),t%=128,c=0;c=0;--f)X(e,a,c=t[f/8|0]>>(7&f)&1),Y(a,e),Y(e,e),X(e,a,c)}function te(e,t){var c=[a(),a(),a(),a()];L(c[0],s),L(c[1],l),L(c[2],n),Q(c[3],s,l),ae(e,c,t)}function ce(e,t,f){var d,r=new Uint8Array(64),n=[a(),a(),a(),a()];for(f||c(t,32),W(r,t,32),r[0]&=248,r[31]&=127,r[31]|=64,te(n,r),ee(e,n),d=0;d<32;d++)t[d+32]=e[d];return 0}var fe=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 de(e,a){var t,c,f,d;for(c=63;c>=32;--c){for(t=0,f=c-32,d=c-12;f>4)*fe[f],t=a[f]>>8,a[f]&=255;for(f=0;f<32;f++)a[f]-=t*fe[f];for(c=0;c<32;c++)a[c+1]+=a[c]>>8,e[c]=255&a[c]}function re(e){var a,t=new Float64Array(64);for(a=0;a<64;a++)t[a]=e[a];for(a=0;a<64;a++)e[a]=0;de(e,t)}function ne(e,t,c,f){var d,r,n=new Uint8Array(64),i=new Uint8Array(64),b=new Uint8Array(64),o=new Float64Array(64),s=[a(),a(),a(),a()];W(n,f,32),n[0]&=248,n[31]&=127,n[31]|=64;var l=c+64;for(d=0;d>7&&F(e[0],r,e[0]),Q(e[3],e[0],e[1]),0)}(l,f))return-1;for(d=0;d=0},e.sign.keyPair=function(){var e=new Uint8Array(oe),a=new Uint8Array(se);return ce(e,a),{publicKey:e,secretKey:a}},e.sign.keyPair.fromSecretKey=function(e){if(ue(e),e.length!==se)throw new Error("bad secret key size");for(var a=new Uint8Array(oe),t=0;t{function c(e){try{if(!t.g.localStorage)return!1}catch(e){return!1}var a=t.g.localStorage[e];return null!=a&&"true"===String(a).toLowerCase()}e.exports=function(e,a){if(c("noDeprecation"))return e;var t=!1;return function(){if(!t){if(c("throwDeprecation"))throw new Error(a);c("traceDeprecation")?console.trace(a):console.warn(a),t=!0}return e.apply(this,arguments)}}},81135:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},49032:(e,a,t)=>{"use strict";var c=t(47244),f=t(48184),d=t(25767),r=t(35680);function n(e){return e.call.bind(e)}var i="undefined"!=typeof BigInt,b="undefined"!=typeof Symbol,o=n(Object.prototype.toString),s=n(Number.prototype.valueOf),l=n(String.prototype.valueOf),u=n(Boolean.prototype.valueOf);if(i)var h=n(BigInt.prototype.valueOf);if(b)var p=n(Symbol.prototype.valueOf);function g(e,a){if("object"!=typeof e)return!1;try{return a(e),!0}catch(e){return!1}}function m(e){return"[object Map]"===o(e)}function y(e){return"[object Set]"===o(e)}function x(e){return"[object WeakMap]"===o(e)}function A(e){return"[object WeakSet]"===o(e)}function v(e){return"[object ArrayBuffer]"===o(e)}function w(e){return"undefined"!=typeof ArrayBuffer&&(v.working?v(e):e instanceof ArrayBuffer)}function _(e){return"[object DataView]"===o(e)}function I(e){return"undefined"!=typeof DataView&&(_.working?_(e):e instanceof DataView)}a.isArgumentsObject=c,a.isGeneratorFunction=f,a.isTypedArray=r,a.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},a.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):r(e)||I(e)},a.isUint8Array=function(e){return"Uint8Array"===d(e)},a.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===d(e)},a.isUint16Array=function(e){return"Uint16Array"===d(e)},a.isUint32Array=function(e){return"Uint32Array"===d(e)},a.isInt8Array=function(e){return"Int8Array"===d(e)},a.isInt16Array=function(e){return"Int16Array"===d(e)},a.isInt32Array=function(e){return"Int32Array"===d(e)},a.isFloat32Array=function(e){return"Float32Array"===d(e)},a.isFloat64Array=function(e){return"Float64Array"===d(e)},a.isBigInt64Array=function(e){return"BigInt64Array"===d(e)},a.isBigUint64Array=function(e){return"BigUint64Array"===d(e)},m.working="undefined"!=typeof Map&&m(new Map),a.isMap=function(e){return"undefined"!=typeof Map&&(m.working?m(e):e instanceof Map)},y.working="undefined"!=typeof Set&&y(new Set),a.isSet=function(e){return"undefined"!=typeof Set&&(y.working?y(e):e instanceof Set)},x.working="undefined"!=typeof WeakMap&&x(new WeakMap),a.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(x.working?x(e):e instanceof WeakMap)},A.working="undefined"!=typeof WeakSet&&A(new WeakSet),a.isWeakSet=function(e){return A(e)},v.working="undefined"!=typeof ArrayBuffer&&v(new ArrayBuffer),a.isArrayBuffer=w,_.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&_(new DataView(new ArrayBuffer(1),0,1)),a.isDataView=I;var E="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function C(e){return"[object SharedArrayBuffer]"===o(e)}function M(e){return void 0!==E&&(void 0===C.working&&(C.working=C(new E)),C.working?C(e):e instanceof E)}function B(e){return g(e,s)}function k(e){return g(e,l)}function L(e){return g(e,u)}function S(e){return i&&g(e,h)}function T(e){return b&&g(e,p)}a.isSharedArrayBuffer=M,a.isAsyncFunction=function(e){return"[object AsyncFunction]"===o(e)},a.isMapIterator=function(e){return"[object Map Iterator]"===o(e)},a.isSetIterator=function(e){return"[object Set Iterator]"===o(e)},a.isGeneratorObject=function(e){return"[object Generator]"===o(e)},a.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===o(e)},a.isNumberObject=B,a.isStringObject=k,a.isBooleanObject=L,a.isBigIntObject=S,a.isSymbolObject=T,a.isBoxedPrimitive=function(e){return B(e)||k(e)||L(e)||S(e)||T(e)},a.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(w(e)||M(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(a,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},40537:(e,a,t)=>{var c=Object.getOwnPropertyDescriptors||function(e){for(var a=Object.keys(e),t={},c=0;c=d)return e;switch(e){case"%s":return String(c[t++]);case"%d":return Number(c[t++]);case"%j":try{return JSON.stringify(c[t++])}catch(e){return"[Circular]"}default:return e}})),n=c[t];t=3&&(c.depth=arguments[2]),arguments.length>=4&&(c.colors=arguments[3]),p(t)?c.showHidden=t:t&&a._extend(c,t),x(c.showHidden)&&(c.showHidden=!1),x(c.depth)&&(c.depth=2),x(c.colors)&&(c.colors=!1),x(c.customInspect)&&(c.customInspect=!0),c.colors&&(c.stylize=b),s(c,e,c.depth)}function b(e,a){var t=i.styles[a];return t?"["+i.colors[t][0]+"m"+e+"["+i.colors[t][1]+"m":e}function o(e,a){return e}function s(e,t,c){if(e.customInspect&&t&&I(t.inspect)&&t.inspect!==a.inspect&&(!t.constructor||t.constructor.prototype!==t)){var f=t.inspect(c,e);return y(f)||(f=s(e,f,c)),f}var d=function(e,a){if(x(a))return e.stylize("undefined","undefined");if(y(a)){var t="'"+JSON.stringify(a).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(t,"string")}return m(a)?e.stylize(""+a,"number"):p(a)?e.stylize(""+a,"boolean"):g(a)?e.stylize("null","null"):void 0}(e,t);if(d)return d;var r=Object.keys(t),n=function(e){var a={};return e.forEach((function(e,t){a[e]=!0})),a}(r);if(e.showHidden&&(r=Object.getOwnPropertyNames(t)),_(t)&&(r.indexOf("message")>=0||r.indexOf("description")>=0))return l(t);if(0===r.length){if(I(t)){var i=t.name?": "+t.name:"";return e.stylize("[Function"+i+"]","special")}if(A(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(w(t))return e.stylize(Date.prototype.toString.call(t),"date");if(_(t))return l(t)}var b,o="",v=!1,E=["{","}"];return h(t)&&(v=!0,E=["[","]"]),I(t)&&(o=" [Function"+(t.name?": "+t.name:"")+"]"),A(t)&&(o=" "+RegExp.prototype.toString.call(t)),w(t)&&(o=" "+Date.prototype.toUTCString.call(t)),_(t)&&(o=" "+l(t)),0!==r.length||v&&0!=t.length?c<0?A(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),b=v?function(e,a,t,c,f){for(var d=[],r=0,n=a.length;r60?t[0]+(""===a?"":a+"\n ")+" "+e.join(",\n ")+" "+t[1]:t[0]+a+" "+e.join(", ")+" "+t[1]}(b,o,E)):E[0]+o+E[1]}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function u(e,a,t,c,f,d){var r,n,i;if((i=Object.getOwnPropertyDescriptor(a,f)||{value:a[f]}).get?n=i.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):i.set&&(n=e.stylize("[Setter]","special")),B(c,f)||(r="["+f+"]"),n||(e.seen.indexOf(i.value)<0?(n=g(t)?s(e,i.value,null):s(e,i.value,t-1)).indexOf("\n")>-1&&(n=d?n.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+n.split("\n").map((function(e){return" "+e})).join("\n")):n=e.stylize("[Circular]","special")),x(r)){if(d&&f.match(/^\d+$/))return n;(r=JSON.stringify(""+f)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(r=r.slice(1,-1),r=e.stylize(r,"name")):(r=r.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),r=e.stylize(r,"string"))}return r+": "+n}function h(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function g(e){return null===e}function m(e){return"number"==typeof e}function y(e){return"string"==typeof e}function x(e){return void 0===e}function A(e){return v(e)&&"[object RegExp]"===E(e)}function v(e){return"object"==typeof e&&null!==e}function w(e){return v(e)&&"[object Date]"===E(e)}function _(e){return v(e)&&("[object Error]"===E(e)||e instanceof Error)}function I(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function C(e){return e<10?"0"+e.toString(10):e.toString(10)}a.debuglog=function(e){if(e=e.toUpperCase(),!d[e])if(r.test(e)){var t=process.pid;d[e]=function(){var c=a.format.apply(a,arguments);console.error("%s %d: %s",e,t,c)}}else d[e]=function(){};return d[e]},a.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},a.types=t(49032),a.isArray=h,a.isBoolean=p,a.isNull=g,a.isNullOrUndefined=function(e){return null==e},a.isNumber=m,a.isString=y,a.isSymbol=function(e){return"symbol"==typeof e},a.isUndefined=x,a.isRegExp=A,a.types.isRegExp=A,a.isObject=v,a.isDate=w,a.types.isDate=w,a.isError=_,a.types.isNativeError=_,a.isFunction=I,a.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},a.isBuffer=t(81135);var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function B(e,a){return Object.prototype.hasOwnProperty.call(e,a)}a.log=function(){var e,t;console.log("%s - %s",(t=[C((e=new Date).getHours()),C(e.getMinutes()),C(e.getSeconds())].join(":"),[e.getDate(),M[e.getMonth()],t].join(" ")),a.format.apply(a,arguments))},a.inherits=t(56698),a._extend=function(e,a){if(!a||!v(a))return e;for(var t=Object.keys(a),c=t.length;c--;)e[t[c]]=a[t[c]];return e};var k="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function L(e,a){if(!e){var t=new Error("Promise was rejected with a falsy value");t.reason=e,e=t}return a(e)}a.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(k&&e[k]){var a;if("function"!=typeof(a=e[k]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(a,k,{value:a,enumerable:!1,writable:!1,configurable:!0}),a}function a(){for(var a,t,c=new Promise((function(e,c){a=e,t=c})),f=[],d=0;d{e.exports=function e(c,f){var d,r=0,n=0,i=f=f||0,b=c.length;do{if(i>=b)throw e.bytes=0,new RangeError("Could not decode varint");d=c[i++],r+=n<28?(d&t)<=a);return e.bytes=i-f,r};var a=128,t=127},81877:e=>{e.exports=function e(f,d,r){d=d||[];for(var n=r=r||0;f>=c;)d[r++]=255&f|a,f/=128;for(;f&t;)d[r++]=255&f|a,f>>>=7;return d[r]=0|f,e.bytes=r-n+1,d};var a=128,t=-128,c=Math.pow(2,31)},61203:(e,a,t)=>{e.exports={encode:t(81877),decode:t(26797),encodingLength:t(37867)}},37867:e=>{var a=Math.pow(2,7),t=Math.pow(2,14),c=Math.pow(2,21),f=Math.pow(2,28),d=Math.pow(2,35),r=Math.pow(2,42),n=Math.pow(2,49),i=Math.pow(2,56),b=Math.pow(2,63);e.exports=function(e){return e{var indexOf=function(e,a){if(e.indexOf)return e.indexOf(a);for(var t=0;t{"use strict";a.TextEncoder="undefined"!=typeof TextEncoder?TextEncoder:t(40537).TextEncoder,a.TextDecoder="undefined"!=typeof TextDecoder?TextDecoder:t(40537).TextDecoder},25767:(e,a,t)=>{"use strict";var c=t(82682),f=t(39209),d=t(10487),r=t(38075),n=t(75795),i=r("Object.prototype.toString"),b=t(49092)(),o="undefined"==typeof globalThis?t.g:globalThis,s=f(),l=r("String.prototype.slice"),u=Object.getPrototypeOf,h=r("Array.prototype.indexOf",!0)||function(e,a){for(var t=0;t-1?a:"Object"===a&&function(e){var a=!1;return c(p,(function(t,c){if(!a)try{t(e),a=l(c,1)}catch(e){}})),a}(e)}return n?function(e){var a=!1;return c(p,(function(t,c){if(!a)try{"$"+t(e)===c&&(a=l(c,1))}catch(e){}})),a}(e):null}},57510:e=>{e.exports=function(){for(var e={},t=0;t{},78982:()=>{},47790:()=>{},73776:()=>{},21638:()=>{},92668:()=>{},77965:()=>{},66089:()=>{},79368:()=>{},23276:()=>{},59676:()=>{},64688:()=>{},51069:()=>{},15340:()=>{},79838:()=>{},59817:()=>{},71281:()=>{},60513:()=>{},2378:()=>{},60290:()=>{},47882:()=>{},27754:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.StructError=void 0;class t extends TypeError{constructor(e,a){let t;const{message:c,explanation:f,...d}=e,{path:r}=e,n=0===r.length?c:`At path: ${r.join(".")} -- ${c}`;super(f??n),null!=f&&(this.cause=n),Object.assign(this,d),this.name=this.constructor.name,this.failures=()=>t??(t=[e,...a()])}}a.StructError=t},35620:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),f(t(27754),a),f(t(99067),a),f(t(91704),a),f(t(50401),a),f(t(67792),a),f(t(65991),a)},99067:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.validate=a.is=a.mask=a.create=a.assert=a.Struct=void 0;const c=t(27754),f=t(70639);function d(e,a,t){const c=b(e,a,{message:t});if(c[0])throw c[0]}function r(e,a,t){const c=b(e,a,{coerce:!0,message:t});if(c[0])throw c[0];return c[1]}function n(e,a,t){const c=b(e,a,{coerce:!0,mask:!0,message:t});if(c[0])throw c[0];return c[1]}function i(e,a){return!b(e,a)[0]}function b(e,a,t={}){const d=(0,f.run)(e,a,t),r=(0,f.shiftIterator)(d);return r[0]?[new c.StructError(r[0],(function*(){for(const e of d)e[0]&&(yield e[0])})),void 0]:[void 0,r[1]]}a.Struct=class{constructor(e){const{type:a,schema:t,validator:c,refiner:d,coercer:r=e=>e,entries:n=function*(){}}=e;this.type=a,this.schema=t,this.entries=n,this.coercer=r,this.validator=c?(e,a)=>{const t=c(e,a);return(0,f.toFailures)(t,a,this,e)}:()=>[],this.refiner=d?(e,a)=>{const t=d(e,a);return(0,f.toFailures)(t,a,this,e)}:()=>[]}assert(e,a){return d(e,this,a)}create(e,a){return r(e,this,a)}is(e){return i(e,this)}mask(e,a){return n(e,this,a)}validate(e,a={}){return b(e,this,a)}},a.assert=d,a.create=r,a.mask=n,a.is=i,a.validate=b},91704:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.trimmed=a.defaulted=a.coerce=void 0;const c=t(99067),f=t(70639),d=t(67792);function r(e,a,t){return new c.Struct({...e,coercer:(f,d)=>(0,c.is)(f,a)?e.coercer(t(f,d),d):e.coercer(f,d)})}a.coerce=r,a.defaulted=function(e,a,t={}){return r(e,(0,d.unknown)(),(e=>{const c="function"==typeof a?a():a;if(void 0===e)return c;if(!t.strict&&(0,f.isPlainObject)(e)&&(0,f.isPlainObject)(c)){const a={...e};let t=!1;for(const e in c)void 0===a[e]&&(a[e]=c[e],t=!0);if(t)return a}return e}))},a.trimmed=function(e){return r(e,(0,d.string)(),(e=>e.trim()))}},50401:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.refine=a.size=a.pattern=a.nonempty=a.min=a.max=a.empty=void 0;const c=t(99067),f=t(70639);function d(e){return e instanceof Map||e instanceof Set?e.size:e.length}function r(e,a,t){return new c.Struct({...e,*refiner(c,d){yield*e.refiner(c,d);const r=t(c,d),n=(0,f.toFailures)(r,d,e,c);for(const e of n)yield{...e,refinement:a}}})}a.empty=function(e){return r(e,"empty",(a=>{const t=d(a);return 0===t||`Expected an empty ${e.type} but received one with a size of \`${t}\``}))},a.max=function(e,a,t={}){const{exclusive:c}=t;return r(e,"max",(t=>c?tc?t>a:t>=a||`Expected a ${e.type} greater than ${c?"":"or equal to "}${a} but received \`${t}\``))},a.nonempty=function(e){return r(e,"nonempty",(a=>d(a)>0||`Expected a nonempty ${e.type} but received an empty one`))},a.pattern=function(e,a){return r(e,"pattern",(t=>a.test(t)||`Expected a ${e.type} matching \`/${a.source}/\` but received "${t}"`))},a.size=function(e,a,t=a){const c=`Expected a ${e.type}`,f=a===t?`of \`${a}\``:`between \`${a}\` and \`${t}\``;return r(e,"size",(e=>{if("number"==typeof e||e instanceof Date)return a<=e&&e<=t||`${c} ${f} but received \`${e}\``;if(e instanceof Map||e instanceof Set){const{size:d}=e;return a<=d&&d<=t||`${c} with a size ${f} but received one with a size of \`${d}\``}const{length:d}=e;return a<=d&&d<=t||`${c} with a length ${f} but received one with a length of \`${d}\``}))},a.refine=r},67792:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.unknown=a.union=a.type=a.tuple=a.string=a.set=a.regexp=a.record=a.optional=a.object=a.number=a.nullable=a.never=a.map=a.literal=a.intersection=a.integer=a.instance=a.func=a.enums=a.date=a.boolean=a.bigint=a.array=a.any=void 0;const c=t(99067),f=t(70639),d=t(65991);function r(){return(0,d.define)("never",(()=>!1))}a.any=function(){return(0,d.define)("any",(()=>!0))},a.array=function(e){return new c.Struct({type:"array",schema:e,*entries(a){if(e&&Array.isArray(a))for(const[t,c]of a.entries())yield[t,c,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||`Expected an array value, but received: ${(0,f.print)(e)}`})},a.bigint=function(){return(0,d.define)("bigint",(e=>"bigint"==typeof e))},a.boolean=function(){return(0,d.define)("boolean",(e=>"boolean"==typeof e))},a.date=function(){return(0,d.define)("date",(e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${(0,f.print)(e)}`))},a.enums=function(e){const a={},t=e.map((e=>(0,f.print)(e))).join();for(const t of e)a[t]=t;return new c.Struct({type:"enums",schema:a,validator:a=>e.includes(a)||`Expected one of \`${t}\`, but received: ${(0,f.print)(a)}`})},a.func=function(){return(0,d.define)("func",(e=>"function"==typeof e||`Expected a function, but received: ${(0,f.print)(e)}`))},a.instance=function(e){return(0,d.define)("instance",(a=>a instanceof e||`Expected a \`${e.name}\` instance, but received: ${(0,f.print)(a)}`))},a.integer=function(){return(0,d.define)("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${(0,f.print)(e)}`))},a.intersection=function(e){return new c.Struct({type:"intersection",schema:null,*entries(a,t){for(const{entries:c}of e)yield*c(a,t)},*validator(a,t){for(const{validator:c}of e)yield*c(a,t)},*refiner(a,t){for(const{refiner:c}of e)yield*c(a,t)}})},a.literal=function(e){const a=(0,f.print)(e),t=typeof e;return new c.Struct({type:"literal",schema:"string"===t||"number"===t||"boolean"===t?e:null,validator:t=>t===e||`Expected the literal \`${a}\`, but received: ${(0,f.print)(t)}`})},a.map=function(e,a){return new c.Struct({type:"map",schema:null,*entries(t){if(e&&a&&t instanceof Map)for(const[c,f]of t.entries())yield[c,c,e],yield[c,f,a]},coercer:e=>e instanceof Map?new Map(e):e,validator:e=>e instanceof Map||`Expected a \`Map\` object, but received: ${(0,f.print)(e)}`})},a.never=r,a.nullable=function(e){return new c.Struct({...e,validator:(a,t)=>null===a||e.validator(a,t),refiner:(a,t)=>null===a||e.refiner(a,t)})},a.number=function(){return(0,d.define)("number",(e=>"number"==typeof e&&!isNaN(e)||`Expected a number, but received: ${(0,f.print)(e)}`))},a.object=function(e){const a=e?Object.keys(e):[],t=r();return new c.Struct({type:"object",schema:e??null,*entries(c){if(e&&(0,f.isObject)(c)){const f=new Set(Object.keys(c));for(const t of a)f.delete(t),yield[t,c[t],e[t]];for(const e of f)yield[e,c[e],t]}},validator:e=>(0,f.isObject)(e)||`Expected an object, but received: ${(0,f.print)(e)}`,coercer:e=>(0,f.isObject)(e)?{...e}:e})},a.optional=function(e){return new c.Struct({...e,validator:(a,t)=>void 0===a||e.validator(a,t),refiner:(a,t)=>void 0===a||e.refiner(a,t)})},a.record=function(e,a){return new c.Struct({type:"record",schema:null,*entries(t){if((0,f.isObject)(t))for(const c in t){const f=t[c];yield[c,c,e],yield[c,f,a]}},validator:e=>(0,f.isObject)(e)||`Expected an object, but received: ${(0,f.print)(e)}`})},a.regexp=function(){return(0,d.define)("regexp",(e=>e instanceof RegExp))},a.set=function(e){return new c.Struct({type:"set",schema:null,*entries(a){if(e&&a instanceof Set)for(const t of a)yield[t,t,e]},coercer:e=>e instanceof Set?new Set(e):e,validator:e=>e instanceof Set||`Expected a \`Set\` object, but received: ${(0,f.print)(e)}`})},a.string=function(){return(0,d.define)("string",(e=>"string"==typeof e||`Expected a string, but received: ${(0,f.print)(e)}`))},a.tuple=function(e){const a=r();return new c.Struct({type:"tuple",schema:null,*entries(t){if(Array.isArray(t)){const c=Math.max(e.length,t.length);for(let f=0;fArray.isArray(e)||`Expected an array, but received: ${(0,f.print)(e)}`})},a.type=function(e){const a=Object.keys(e);return new c.Struct({type:"type",schema:e,*entries(t){if((0,f.isObject)(t))for(const c of a)yield[c,t[c],e[c]]},validator:e=>(0,f.isObject)(e)||`Expected an object, but received: ${(0,f.print)(e)}`,coercer:e=>(0,f.isObject)(e)?{...e}:e})},a.union=function(e){const a=e.map((e=>e.type)).join(" | ");return new c.Struct({type:"union",schema:null,coercer(a){for(const t of e){const[e,c]=t.validate(a,{coerce:!0});if(!e)return c}return a},validator(t,c){const d=[];for(const a of e){const[...e]=(0,f.run)(t,a,c),[r]=e;if(!r?.[0])return[];for(const[a]of e)a&&d.push(a)}return[`Expected the value to satisfy a union of \`${a}\`, but received: ${(0,f.print)(t)}`,...d]}})},a.unknown=function(){return(0,d.define)("unknown",(()=>!0))}},65991:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.pick=a.partial=a.omit=a.lazy=a.dynamic=a.deprecated=a.define=a.assign=void 0;const c=t(99067),f=t(67792);a.assign=function(...e){const a="type"===e[0]?.type,t=e.map((({schema:e})=>e)),c=Object.assign({},...t);return a?(0,f.type)(c):(0,f.object)(c)},a.define=function(e,a){return new c.Struct({type:e,schema:null,validator:a})},a.deprecated=function(e,a){return new c.Struct({...e,refiner:(a,t)=>void 0===a||e.refiner(a,t),validator:(t,c)=>void 0===t||(a(t,c),e.validator(t,c))})},a.dynamic=function(e){return new c.Struct({type:"dynamic",schema:null,*entries(a,t){const c=e(a,t);yield*c.entries(a,t)},validator:(a,t)=>e(a,t).validator(a,t),coercer:(a,t)=>e(a,t).coercer(a,t),refiner:(a,t)=>e(a,t).refiner(a,t)})},a.lazy=function(e){let a;return new c.Struct({type:"lazy",schema:null,*entries(t,c){a??(a=e()),yield*a.entries(t,c)},validator:(t,c)=>(a??(a=e()),a.validator(t,c)),coercer:(t,c)=>(a??(a=e()),a.coercer(t,c)),refiner:(t,c)=>(a??(a=e()),a.refiner(t,c))})},a.omit=function(e,a){const{schema:t}=e,c={...t};for(const e of a)delete c[e];return"type"===e.type?(0,f.type)(c):(0,f.object)(c)},a.partial=function(e){const a=e instanceof c.Struct,t=a?{...e.schema}:{...e};for(const e in t)t[e]=(0,f.optional)(t[e]);return a&&"type"===e.type?(0,f.type)(t):(0,f.object)(t)},a.pick=function(e,a){const{schema:t}=e,c={};for(const e of a)c[e]=t[e];return"type"===e.type?(0,f.type)(c):(0,f.object)(c)}},70639:(e,a)=>{"use strict";function t(e){return"object"==typeof e&&null!==e}function c(e){return"symbol"==typeof e?e.toString():"string"==typeof e?JSON.stringify(e):`${e}`}function f(e,a,t,f){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:d,branch:r}=a,{type:n}=t,{refinement:i,message:b=`Expected a value of type \`${n}\`${i?` with refinement \`${i}\``:""}, but received: \`${c(f)}\``}=e;return{value:f,type:n,refinement:i,key:d[d.length-1],path:d,branch:r,...e,message:b}}Object.defineProperty(a,"__esModule",{value:!0}),a.run=a.toFailures=a.toFailure=a.shiftIterator=a.print=a.isPlainObject=a.isObject=void 0,a.isObject=t,a.isPlainObject=function(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;const a=Object.getPrototypeOf(e);return null===a||a===Object.prototype},a.print=c,a.shiftIterator=function(e){const{done:a,value:t}=e.next();return a?void 0:t},a.toFailure=f,a.toFailures=function*(e,a,c,d){(function(e){return t(e)&&"function"==typeof e[Symbol.iterator]})(e)||(e=[e]);for(const t of e){const e=f(t,a,c,d);e&&(yield e)}},a.run=function*e(a,c,f={}){const{path:d=[],branch:r=[a],coerce:n=!1,mask:i=!1}=f,b={path:d,branch:r};if(n&&(a=c.coercer(a,b),i&&"type"!==c.type&&t(c.schema)&&t(a)&&!Array.isArray(a)))for(const e in a)void 0===c.schema[e]&&delete a[e];let o="valid";for(const e of c.validator(a,b))e.explanation=f.message,o="not_valid",yield[e,void 0];for(let[s,l,u]of c.entries(a,b)){const c=e(l,u,{path:void 0===s?d:[...d,s],branch:void 0===s?r:[...r,l],coerce:n,mask:i,message:f.message});for(const e of c)e[0]?(o=null===e[0].refinement||void 0===e[0].refinement?"not_valid":"not_refined",yield[e[0],void 0]):n&&(l=e[1],void 0===s?a=l:a instanceof Map?a.set(s,l):a instanceof Set?a.add(l):t(a)&&(void 0!==l||s in a)&&(a[s]=l))}if("not_valid"!==o)for(const e of c.refiner(a,b))e.explanation=f.message,o="not_refined",yield[e,void 0];"valid"===o&&(yield[void 0,a])}},22011:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.assertExhaustive=a.assertStruct=a.assert=a.AssertionError=void 0;const c=t(35620),f=t(75940);function d(e,a){return t=e,Boolean("string"==typeof t?.prototype?.constructor?.name)?new e({message:a}):e({message:a});var t}class r extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}a.AssertionError=r,a.assert=function(e,a="Assertion failed.",t=r){if(!e){if(a instanceof Error)throw a;throw d(t,a)}},a.assertStruct=function(e,a,t="Assertion failed",n=r){try{(0,c.assert)(e,a)}catch(e){throw d(n,`${t}: ${function(e){return(0,f.getErrorMessage)(e).replace(/\.$/u,"")}(e)}.`)}},a.assertExhaustive=function(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}},20472:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.base64=void 0;const c=t(35620),f=t(22011);a.base64=(e,a={})=>{const t=a.paddingRequired??!1,d=a.characterSet??"base64";let r,n;return"base64"===d?r=String.raw`[A-Za-z0-9+\/]`:((0,f.assert)("base64url"===d),r=String.raw`[-_A-Za-z0-9]`),n=t?new RegExp(`^(?:${r}{4})*(?:${r}{3}=|${r}{2}==)?$`,"u"):new RegExp(`^(?:${r}{4})*(?:${r}{2,3}|${r}{3}=|${r}{2}==)?$`,"u"),(0,c.pattern)(e,n)}},77862:(e,a,t)=>{"use strict";var c=t(62045).hp;Object.defineProperty(a,"__esModule",{value:!0}),a.createDataView=a.concatBytes=a.valueToBytes=a.base64ToBytes=a.stringToBytes=a.numberToBytes=a.signedBigIntToBytes=a.bigIntToBytes=a.hexToBytes=a.bytesToBase64=a.bytesToString=a.bytesToNumber=a.bytesToSignedBigInt=a.bytesToBigInt=a.bytesToHex=a.assertIsBytes=a.isBytes=void 0;const f=t(63203),d=t(22011),r=t(93976),n=function(){const e=[];return()=>{if(0===e.length)for(let a=0;a<256;a++)e.push(a.toString(16).padStart(2,"0"));return e}}();function i(e){return e instanceof Uint8Array}function b(e){(0,d.assert)(i(e),"Value must be a Uint8Array.")}function o(e){if(b(e),0===e.length)return"0x";const a=n(),t=new Array(e.length);for(let c=0;c=BigInt(0),"Value must be a non-negative bigint."),l(e.toString(16))}function h(e){return(0,d.assert)("number"==typeof e,"Value must be a number."),(0,d.assert)(e>=0,"Value must be a non-negative number."),(0,d.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead."),l(e.toString(16))}function p(e){return(0,d.assert)("string"==typeof e,"Value must be a string."),(new TextEncoder).encode(e)}function g(e){if("bigint"==typeof e)return u(e);if("number"==typeof e)return h(e);if("string"==typeof e)return e.startsWith("0x")?l(e):p(e);if(i(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}a.isBytes=i,a.assertIsBytes=b,a.bytesToHex=o,a.bytesToBigInt=s,a.bytesToSignedBigInt=function(e){b(e);let a=BigInt(0);for(const t of e)a=(a<0,"Byte length must be greater than 0."),(0,d.assert)(function(e,a){(0,d.assert)(a>0);const t=e>>BigInt(31);return!((~e&t)+(e&~t)>>BigInt(8*a-1))}(e,a),"Byte length is too small to represent the given value.");let t=e;const c=new Uint8Array(a);for(let e=0;e>=BigInt(8);return c.reverse()},a.numberToBytes=h,a.stringToBytes=p,a.base64ToBytes=function(e){return(0,d.assert)("string"==typeof e,"Value must be a string."),f.base64.decode(e)},a.valueToBytes=g,a.concatBytes=function(e){const a=new Array(e.length);let t=0;for(let c=0;c{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.toCaipChainId=a.parseCaipAccountId=a.parseCaipChainId=a.isCaipAccountAddress=a.isCaipAccountId=a.isCaipReference=a.isCaipNamespace=a.isCaipChainId=a.KnownCaipNamespace=a.CaipAccountAddressStruct=a.CaipAccountIdStruct=a.CaipReferenceStruct=a.CaipNamespaceStruct=a.CaipChainIdStruct=a.CAIP_ACCOUNT_ADDRESS_REGEX=a.CAIP_ACCOUNT_ID_REGEX=a.CAIP_REFERENCE_REGEX=a.CAIP_NAMESPACE_REGEX=a.CAIP_CHAIN_ID_REGEX=void 0;const c=t(35620);function f(e){return(0,c.is)(e,a.CaipNamespaceStruct)}function d(e){return(0,c.is)(e,a.CaipReferenceStruct)}var r;a.CAIP_CHAIN_ID_REGEX=/^(?[-a-z0-9]{3,8}):(?[-_a-zA-Z0-9]{1,32})$/u,a.CAIP_NAMESPACE_REGEX=/^[-a-z0-9]{3,8}$/u,a.CAIP_REFERENCE_REGEX=/^[-_a-zA-Z0-9]{1,32}$/u,a.CAIP_ACCOUNT_ID_REGEX=/^(?(?[-a-z0-9]{3,8}):(?[-_a-zA-Z0-9]{1,32})):(?[-.%a-zA-Z0-9]{1,128})$/u,a.CAIP_ACCOUNT_ADDRESS_REGEX=/^[-.%a-zA-Z0-9]{1,128}$/u,a.CaipChainIdStruct=(0,c.pattern)((0,c.string)(),a.CAIP_CHAIN_ID_REGEX),a.CaipNamespaceStruct=(0,c.pattern)((0,c.string)(),a.CAIP_NAMESPACE_REGEX),a.CaipReferenceStruct=(0,c.pattern)((0,c.string)(),a.CAIP_REFERENCE_REGEX),a.CaipAccountIdStruct=(0,c.pattern)((0,c.string)(),a.CAIP_ACCOUNT_ID_REGEX),a.CaipAccountAddressStruct=(0,c.pattern)((0,c.string)(),a.CAIP_ACCOUNT_ADDRESS_REGEX),(r=a.KnownCaipNamespace||(a.KnownCaipNamespace={})).Eip155="eip155",r.Wallet="wallet",a.isCaipChainId=function(e){return(0,c.is)(e,a.CaipChainIdStruct)},a.isCaipNamespace=f,a.isCaipReference=d,a.isCaipAccountId=function(e){return(0,c.is)(e,a.CaipAccountIdStruct)},a.isCaipAccountAddress=function(e){return(0,c.is)(e,a.CaipAccountAddressStruct)},a.parseCaipChainId=function(e){const t=a.CAIP_CHAIN_ID_REGEX.exec(e);if(!t?.groups)throw new Error("Invalid CAIP chain ID.");return{namespace:t.groups.namespace,reference:t.groups.reference}},a.parseCaipAccountId=function(e){const t=a.CAIP_ACCOUNT_ID_REGEX.exec(e);if(!t?.groups)throw new Error("Invalid CAIP account ID.");return{address:t.groups.accountAddress,chainId:t.groups.chainId,chain:{namespace:t.groups.namespace,reference:t.groups.reference}}},a.toCaipChainId=function(e,t){if(!f(e))throw new Error(`Invalid "namespace", must match: ${a.CAIP_NAMESPACE_REGEX.toString()}`);if(!d(t))throw new Error(`Invalid "reference", must match: ${a.CAIP_REFERENCE_REGEX.toString()}`);return`${e}:${t}`}},98860:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.ChecksumStruct=void 0;const c=t(35620),f=t(20472);a.ChecksumStruct=(0,c.size)((0,f.base64)((0,c.string)(),{paddingRequired:!0}),44,44)},65211:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.createHex=a.createBytes=a.createBigInt=a.createNumber=void 0;const c=t(35620),f=t(22011),d=t(77862),r=t(93976),n=(0,c.union)([(0,c.number)(),(0,c.bigint)(),(0,c.string)(),r.StrictHexStruct]),i=(0,c.coerce)((0,c.number)(),n,Number),b=(0,c.coerce)((0,c.bigint)(),n,BigInt),o=((0,c.union)([r.StrictHexStruct,(0,c.instance)(Uint8Array)]),(0,c.coerce)((0,c.instance)(Uint8Array),(0,c.union)([r.StrictHexStruct]),d.hexToBytes)),s=(0,c.coerce)(r.StrictHexStruct,(0,c.instance)(Uint8Array),d.bytesToHex);a.createNumber=function(e){try{const a=(0,c.create)(e,i);return(0,f.assert)(Number.isFinite(a),`Expected a number-like value, got "${e}".`),a}catch(a){if(a instanceof c.StructError)throw new Error(`Expected a number-like value, got "${e}".`);throw a}},a.createBigInt=function(e){try{return(0,c.create)(e,b)}catch(e){if(e instanceof c.StructError)throw new Error(`Expected a number-like value, got "${String(e.value)}".`);throw e}},a.createBytes=function(e){if("string"==typeof e&&"0x"===e.toLowerCase())return new Uint8Array;try{return(0,c.create)(e,o)}catch(e){if(e instanceof c.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}},a.createHex=function(e){if(e instanceof Uint8Array&&0===e.length||"string"==typeof e&&"0x"===e.toLowerCase())return"0x";try{return(0,c.create)(e,s)}catch(e){if(e instanceof c.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}}},44180:function(e,a){"use strict";var t,c,f=this&&this.__classPrivateFieldGet||function(e,a,t,c){if("a"===t&&!c)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof a?e!==a||!c:!a.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?c:"a"===t?c.call(e):c?c.value:a.get(e)},d=this&&this.__classPrivateFieldSet||function(e,a,t,c,f){if("m"===c)throw new TypeError("Private method is not writable");if("a"===c&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof a?e!==a||!f:!a.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===c?f.call(e,t):f?f.value=t:a.set(e,t),t};Object.defineProperty(a,"__esModule",{value:!0}),a.FrozenSet=a.FrozenMap=void 0;class r{get size(){return f(this,t,"f").size}[(t=new WeakMap,Symbol.iterator)](){return f(this,t,"f")[Symbol.iterator]()}constructor(e){t.set(this,void 0),d(this,t,new Map(e),"f"),Object.freeze(this)}entries(){return f(this,t,"f").entries()}forEach(e,a){return f(this,t,"f").forEach(((t,c,f)=>e.call(a,t,c,this)))}get(e){return f(this,t,"f").get(e)}has(e){return f(this,t,"f").has(e)}keys(){return f(this,t,"f").keys()}values(){return f(this,t,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map((([e,a])=>`${String(e)} => ${String(a)}`)).join(", ")} `:""}}`}}a.FrozenMap=r;class n{get size(){return f(this,c,"f").size}[(c=new WeakMap,Symbol.iterator)](){return f(this,c,"f")[Symbol.iterator]()}constructor(e){c.set(this,void 0),d(this,c,new Set(e),"f"),Object.freeze(this)}entries(){return f(this,c,"f").entries()}forEach(e,a){return f(this,c,"f").forEach(((t,c,f)=>e.call(a,t,c,this)))}has(e){return f(this,c,"f").has(e)}keys(){return f(this,c,"f").keys()}values(){return f(this,c,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map((e=>String(e))).join(", ")} `:""}}`}}a.FrozenSet=n,Object.freeze(r),Object.freeze(r.prototype),Object.freeze(n),Object.freeze(n.prototype)},91630:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0})},75940:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.wrapError=a.getErrorMessage=a.isErrorWithStack=a.isErrorWithMessage=a.isErrorWithCode=void 0;const c=t(71843),f=t(33745);function d(e){return"object"==typeof e&&null!==e&&"code"in e}function r(e){return"object"==typeof e&&null!==e&&"message"in e}a.isErrorWithCode=d,a.isErrorWithMessage=r,a.isErrorWithStack=function(e){return"object"==typeof e&&null!==e&&"stack"in e},a.getErrorMessage=function(e){return r(e)&&"string"==typeof e.message?e.message:(0,f.isNullOrUndefined)(e)?"":String(e)},a.wrapError=function(e,a){if((t=e)instanceof Error||(0,f.isObject)(t)&&"Error"===t.constructor.name){let t;return t=2===Error.length?new Error(a,{cause:e}):new c.ErrorWithCause(a,{cause:e}),d(e)&&(t.code=e.code),t}var t;return a.length>0?new Error(`${String(e)}: ${a}`):new Error(String(e))}},93976:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.remove0x=a.add0x=a.isValidChecksumAddress=a.getChecksumAddress=a.isValidHexAddress=a.assertIsStrictHexString=a.assertIsHexString=a.isStrictHexString=a.isHexString=a.HexChecksumAddressStruct=a.HexAddressStruct=a.StrictHexStruct=a.HexStruct=void 0;const c=t(35620),f=t(2214),d=t(22011),r=t(77862);function n(e){return(0,c.is)(e,a.HexStruct)}function i(e){return(0,c.is)(e,a.StrictHexStruct)}function b(e){(0,d.assert)((0,c.is)(e,a.HexChecksumAddressStruct),"Invalid hex address.");const t=s(e.toLowerCase()),n=s((0,r.bytesToHex)((0,f.keccak_256)(t)));return`0x${t.split("").map(((e,a)=>{const t=n[a];return(0,d.assert)((0,c.is)(t,(0,c.string)()),"Hash shorter than address."),parseInt(t,16)>7?e.toUpperCase():e})).join("")}`}function o(e){return!!(0,c.is)(e,a.HexChecksumAddressStruct)&&b(e)===e}function s(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}a.HexStruct=(0,c.pattern)((0,c.string)(),/^(?:0x)?[0-9a-f]+$/iu),a.StrictHexStruct=(0,c.pattern)((0,c.string)(),/^0x[0-9a-f]+$/iu),a.HexAddressStruct=(0,c.pattern)((0,c.string)(),/^0x[0-9a-f]{40}$/u),a.HexChecksumAddressStruct=(0,c.pattern)((0,c.string)(),/^0x[0-9a-fA-F]{40}$/u),a.isHexString=n,a.isStrictHexString=i,a.assertIsHexString=function(e){(0,d.assert)(n(e),"Value must be a hexadecimal string.")},a.assertIsStrictHexString=function(e){(0,d.assert)(i(e),'Value must be a hexadecimal string, starting with "0x".')},a.isValidHexAddress=function(e){return(0,c.is)(e,a.HexAddressStruct)||o(e)},a.getChecksumAddress=b,a.isValidChecksumAddress=o,a.add0x=function(e){return e.startsWith("0x")?e:e.startsWith("0X")?`0x${e.substring(2)}`:`0x${e}`},a.remove0x=s},52367:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),f(t(22011),a),f(t(20472),a),f(t(77862),a),f(t(87690),a),f(t(98860),a),f(t(65211),a),f(t(44180),a),f(t(91630),a),f(t(75940),a),f(t(93976),a),f(t(60087),a),f(t(24956),a),f(t(98912),a),f(t(33745),a),f(t(5770),a),f(t(3028),a),f(t(2812),a),f(t(32954),a),f(t(16871),a),f(t(49266),a)},60087:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.getJsonRpcIdValidator=a.assertIsJsonRpcError=a.isJsonRpcError=a.assertIsJsonRpcFailure=a.isJsonRpcFailure=a.assertIsJsonRpcSuccess=a.isJsonRpcSuccess=a.assertIsJsonRpcResponse=a.isJsonRpcResponse=a.assertIsPendingJsonRpcResponse=a.isPendingJsonRpcResponse=a.JsonRpcResponseStruct=a.JsonRpcFailureStruct=a.JsonRpcSuccessStruct=a.PendingJsonRpcResponseStruct=a.assertIsJsonRpcRequest=a.isJsonRpcRequest=a.assertIsJsonRpcNotification=a.isJsonRpcNotification=a.JsonRpcNotificationStruct=a.JsonRpcRequestStruct=a.JsonRpcParamsStruct=a.JsonRpcErrorStruct=a.JsonRpcIdStruct=a.JsonRpcVersionStruct=a.jsonrpc2=a.getJsonSize=a.getSafeJson=a.isValidJson=a.JsonStruct=a.UnsafeJsonStruct=a.exactOptional=a.object=void 0;const c=t(35620),f=t(22011),d=t(33745);function r({path:e,branch:a}){const t=e[e.length-1];return(0,d.hasProperty)(a[a.length-2],t)}function n(e){return new c.Struct({...e,type:`optional ${e.type}`,validator:(a,t)=>!r(t)||e.validator(a,t),refiner:(a,t)=>!r(t)||e.refiner(a,t)})}function i(e){return(0,c.create)(e,a.JsonStruct)}a.object=e=>(0,c.object)(e),a.exactOptional=n,a.UnsafeJsonStruct=(0,c.union)([(0,c.literal)(null),(0,c.boolean)(),(0,c.define)("finite number",(e=>(0,c.is)(e,(0,c.number)())&&Number.isFinite(e))),(0,c.string)(),(0,c.array)((0,c.lazy)((()=>a.UnsafeJsonStruct))),(0,c.record)((0,c.string)(),(0,c.lazy)((()=>a.UnsafeJsonStruct)))]),a.JsonStruct=(0,c.coerce)(a.UnsafeJsonStruct,(0,c.any)(),(e=>((0,f.assertStruct)(e,a.UnsafeJsonStruct),JSON.parse(JSON.stringify(e,((e,a)=>{if("__proto__"!==e&&"constructor"!==e)return a})))))),a.isValidJson=function(e){try{return i(e),!0}catch{return!1}},a.getSafeJson=i,a.getJsonSize=function(e){(0,f.assertStruct)(e,a.JsonStruct,"Invalid JSON value");const t=JSON.stringify(e);return(new TextEncoder).encode(t).byteLength},a.jsonrpc2="2.0",a.JsonRpcVersionStruct=(0,c.literal)(a.jsonrpc2),a.JsonRpcIdStruct=(0,c.nullable)((0,c.union)([(0,c.number)(),(0,c.string)()])),a.JsonRpcErrorStruct=(0,a.object)({code:(0,c.integer)(),message:(0,c.string)(),data:n(a.JsonStruct),stack:n((0,c.string)())}),a.JsonRpcParamsStruct=(0,c.union)([(0,c.record)((0,c.string)(),a.JsonStruct),(0,c.array)(a.JsonStruct)]),a.JsonRpcRequestStruct=(0,a.object)({id:a.JsonRpcIdStruct,jsonrpc:a.JsonRpcVersionStruct,method:(0,c.string)(),params:n(a.JsonRpcParamsStruct)}),a.JsonRpcNotificationStruct=(0,a.object)({jsonrpc:a.JsonRpcVersionStruct,method:(0,c.string)(),params:n(a.JsonRpcParamsStruct)}),a.isJsonRpcNotification=function(e){return(0,c.is)(e,a.JsonRpcNotificationStruct)},a.assertIsJsonRpcNotification=function(e,t){(0,f.assertStruct)(e,a.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",t)},a.isJsonRpcRequest=function(e){return(0,c.is)(e,a.JsonRpcRequestStruct)},a.assertIsJsonRpcRequest=function(e,t){(0,f.assertStruct)(e,a.JsonRpcRequestStruct,"Invalid JSON-RPC request",t)},a.PendingJsonRpcResponseStruct=(0,c.object)({id:a.JsonRpcIdStruct,jsonrpc:a.JsonRpcVersionStruct,result:(0,c.optional)((0,c.unknown)()),error:(0,c.optional)(a.JsonRpcErrorStruct)}),a.JsonRpcSuccessStruct=(0,a.object)({id:a.JsonRpcIdStruct,jsonrpc:a.JsonRpcVersionStruct,result:a.JsonStruct}),a.JsonRpcFailureStruct=(0,a.object)({id:a.JsonRpcIdStruct,jsonrpc:a.JsonRpcVersionStruct,error:a.JsonRpcErrorStruct}),a.JsonRpcResponseStruct=(0,c.union)([a.JsonRpcSuccessStruct,a.JsonRpcFailureStruct]),a.isPendingJsonRpcResponse=function(e){return(0,c.is)(e,a.PendingJsonRpcResponseStruct)},a.assertIsPendingJsonRpcResponse=function(e,t){(0,f.assertStruct)(e,a.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",t)},a.isJsonRpcResponse=function(e){return(0,c.is)(e,a.JsonRpcResponseStruct)},a.assertIsJsonRpcResponse=function(e,t){(0,f.assertStruct)(e,a.JsonRpcResponseStruct,"Invalid JSON-RPC response",t)},a.isJsonRpcSuccess=function(e){return(0,c.is)(e,a.JsonRpcSuccessStruct)},a.assertIsJsonRpcSuccess=function(e,t){(0,f.assertStruct)(e,a.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",t)},a.isJsonRpcFailure=function(e){return(0,c.is)(e,a.JsonRpcFailureStruct)},a.assertIsJsonRpcFailure=function(e,t){(0,f.assertStruct)(e,a.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",t)},a.isJsonRpcError=function(e){return(0,c.is)(e,a.JsonRpcErrorStruct)},a.assertIsJsonRpcError=function(e,t){(0,f.assertStruct)(e,a.JsonRpcErrorStruct,"Invalid JSON-RPC error",t)},a.getJsonRpcIdValidator=function(e){const{permitEmptyString:a,permitFractions:t,permitNull:c}={permitEmptyString:!0,permitFractions:!1,permitNull:!0,...e};return e=>Boolean("number"==typeof e&&(t||Number.isInteger(e))||"string"==typeof e&&(a||e.length>0)||c&&null===e)}},24956:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0})},98912:function(e,a,t){"use strict";var c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0}),a.createModuleLogger=a.createProjectLogger=void 0;const f=(0,c(t(17833)).default)("metamask");a.createProjectLogger=function(e){return f.extend(e)},a.createModuleLogger=function(e,a){return e.extend(a)}},33745:(e,a)=>{"use strict";function t(e){return e.charCodeAt(0)<=127}var c;Object.defineProperty(a,"__esModule",{value:!0}),a.calculateNumberSize=a.calculateStringSize=a.isASCII=a.isPlainObject=a.ESCAPE_CHARACTERS_REGEXP=a.JsonSize=a.getKnownPropertyNames=a.hasProperty=a.isObject=a.isNullOrUndefined=a.isNonEmptyArray=void 0,a.isNonEmptyArray=function(e){return Array.isArray(e)&&e.length>0},a.isNullOrUndefined=function(e){return null==e},a.isObject=function(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)},a.hasProperty=(e,a)=>Object.hasOwnProperty.call(e,a),a.getKnownPropertyNames=function(e){return Object.getOwnPropertyNames(e)},(c=a.JsonSize||(a.JsonSize={}))[c.Null=4]="Null",c[c.Comma=1]="Comma",c[c.Wrapper=1]="Wrapper",c[c.True=4]="True",c[c.False=5]="False",c[c.Quote=1]="Quote",c[c.Colon=1]="Colon",c[c.Date=24]="Date",a.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu,a.isPlainObject=function(e){if("object"!=typeof e||null===e)return!1;try{let a=e;for(;null!==Object.getPrototypeOf(a);)a=Object.getPrototypeOf(a);return Object.getPrototypeOf(e)===a}catch(e){return!1}},a.isASCII=t,a.calculateStringSize=function(e){return e.split("").reduce(((e,a)=>t(a)?e+1:e+2),0)+(e.match(a.ESCAPE_CHARACTERS_REGEXP)??[]).length},a.calculateNumberSize=function(e){return e.toString().length}},5770:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.hexToBigInt=a.hexToNumber=a.bigIntToHex=a.numberToHex=void 0;const c=t(22011),f=t(93976);a.numberToHex=e=>((0,c.assert)("number"==typeof e,"Value must be a number."),(0,c.assert)(e>=0,"Value must be a non-negative number."),(0,c.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,f.add0x)(e.toString(16))),a.bigIntToHex=e=>((0,c.assert)("bigint"==typeof e,"Value must be a bigint."),(0,c.assert)(e>=0,"Value must be a non-negative bigint."),(0,f.add0x)(e.toString(16))),a.hexToNumber=e=>{(0,f.assertIsHexString)(e);const a=parseInt(e,16);return(0,c.assert)(Number.isSafeInteger(a),"Value is not a safe integer. Use `hexToBigInt` instead."),a},a.hexToBigInt=e=>((0,f.assertIsHexString)(e),BigInt((0,f.add0x)(e)))},3028:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0})},2812:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.createDeferredPromise=void 0,a.createDeferredPromise=function({suppressUnhandledRejection:e=!1}={}){let a,t;const c=new Promise(((e,c)=>{a=e,t=c}));return e&&c.catch((e=>{})),{promise:c,resolve:a,reject:t}}},32954:(e,a)=>{"use strict";var t;Object.defineProperty(a,"__esModule",{value:!0}),a.timeSince=a.inMilliseconds=a.Duration=void 0,(t=a.Duration||(a.Duration={}))[t.Millisecond=1]="Millisecond",t[t.Second=1e3]="Second",t[t.Minute=6e4]="Minute",t[t.Hour=36e5]="Hour",t[t.Day=864e5]="Day",t[t.Week=6048e5]="Week",t[t.Year=31536e6]="Year";const c=(e,a)=>{if(!(e=>Number.isInteger(e)&&e>=0)(e))throw new Error(`"${a}" must be a non-negative integer. Received: "${e}".`)};a.inMilliseconds=function(e,a){return c(e,"count"),e*a},a.timeSince=function(e){return c(e,"timestamp"),Date.now()-e}},16871:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0})},49266:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.satisfiesVersionRange=a.gtRange=a.gtVersion=a.assertIsSemVerRange=a.assertIsSemVerVersion=a.isValidSemVerRange=a.isValidSemVerVersion=a.VersionRangeStruct=a.VersionStruct=void 0;const c=t(35620),f=t(56864),d=t(22011);a.VersionStruct=(0,c.refine)((0,c.string)(),"Version",(e=>null!==(0,f.valid)(e)||`Expected SemVer version, got "${e}"`)),a.VersionRangeStruct=(0,c.refine)((0,c.string)(),"Version range",(e=>null!==(0,f.validRange)(e)||`Expected SemVer range, got "${e}"`)),a.isValidSemVerVersion=function(e){return(0,c.is)(e,a.VersionStruct)},a.isValidSemVerRange=function(e){return(0,c.is)(e,a.VersionRangeStruct)},a.assertIsSemVerVersion=function(e){(0,d.assertStruct)(e,a.VersionStruct)},a.assertIsSemVerRange=function(e){(0,d.assertStruct)(e,a.VersionRangeStruct)},a.gtVersion=function(e,a){return(0,f.gt)(e,a)},a.gtRange=function(e,a){return(0,f.gtr)(e,a)},a.satisfiesVersionRange=function(e,a){return(0,f.satisfies)(e,a,{includePrerelease:!0})}},39209:(e,a,t)=>{"use strict";var c=t(76578),f="undefined"==typeof globalThis?t.g:globalThis;e.exports=function(){for(var e=[],a=0;a{"use strict";const{normalizeIPv6:c,normalizeIPv4:f,removeDotSegments:d,recomposeAuthority:r,normalizeComponentEncoding:n}=t(34834),i=t(343);function b(e,a,t,c){const f={};return c||(e=u(o(e,t),t),a=u(o(a,t),t)),!(t=t||{}).tolerant&&a.scheme?(f.scheme=a.scheme,f.userinfo=a.userinfo,f.host=a.host,f.port=a.port,f.path=d(a.path||""),f.query=a.query):(void 0!==a.userinfo||void 0!==a.host||void 0!==a.port?(f.userinfo=a.userinfo,f.host=a.host,f.port=a.port,f.path=d(a.path||""),f.query=a.query):(a.path?("/"===a.path.charAt(0)?f.path=d(a.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?f.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+a.path:f.path=a.path:f.path="/"+a.path,f.path=d(f.path)),f.query=a.query):(f.path=e.path,void 0!==a.query?f.query=a.query:f.query=e.query),f.userinfo=e.userinfo,f.host=e.host,f.port=e.port),f.scheme=e.scheme),f.fragment=a.fragment,f}function o(e,a){const t={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},c=Object.assign({},a),f=[],n=i[(c.scheme||t.scheme||"").toLowerCase()];n&&n.serialize&&n.serialize(t,c),void 0!==t.path&&(c.skipEscape?t.path=unescape(t.path):(t.path=escape(t.path),void 0!==t.scheme&&(t.path=t.path.split("%3A").join(":")))),"suffix"!==c.reference&&t.scheme&&(f.push(t.scheme),f.push(":"));const b=r(t,c);if(void 0!==b&&("suffix"!==c.reference&&f.push("//"),f.push(b),t.path&&"/"!==t.path.charAt(0)&&f.push("/")),void 0!==t.path){let e=t.path;c.absolutePath||n&&n.absolutePath||(e=d(e)),void 0===b&&(e=e.replace(/^\/\//u,"/%2F")),f.push(e)}return void 0!==t.query&&(f.push("?"),f.push(t.query)),void 0!==t.fragment&&(f.push("#"),f.push(t.fragment)),f.join("")}const s=Array.from({length:127},((e,a)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(a)))),l=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function u(e,a){const t=Object.assign({},a),d={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},r=-1!==e.indexOf("%");let n=!1;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);const b=e.match(l);if(b){if(d.scheme=b[1],d.userinfo=b[3],d.host=b[4],d.port=parseInt(b[5],10),d.path=b[6]||"",d.query=b[7],d.fragment=b[8],isNaN(d.port)&&(d.port=b[5]),d.host){const e=f(d.host);if(!1===e.isIPV4){const a=c(e.host,{isIPV4:!1});d.host=a.host.toLowerCase(),n=a.isIPV6}else d.host=e.host,n=!0}void 0!==d.scheme||void 0!==d.userinfo||void 0!==d.host||void 0!==d.port||d.path||void 0!==d.query?void 0===d.scheme?d.reference="relative":void 0===d.fragment?d.reference="absolute":d.reference="uri":d.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==d.reference&&(d.error=d.error||"URI is not a "+t.reference+" reference.");const e=i[(t.scheme||d.scheme||"").toLowerCase()];if(!(t.unicodeSupport||e&&e.unicodeSupport)&&d.host&&(t.domainHost||e&&e.domainHost)&&!1===n&&function(e){let a=0;for(let t=0,c=e.length;t126||s[a])return!0;return!1}(d.host))try{d.host=URL.domainToASCII(d.host.toLowerCase())}catch(e){d.error=d.error||"Host's domain name can not be converted to ASCII: "+e}(!e||e&&!e.skipNormalize)&&(r&&void 0!==d.scheme&&(d.scheme=unescape(d.scheme)),r&&void 0!==d.userinfo&&(d.userinfo=unescape(d.userinfo)),r&&void 0!==d.host&&(d.host=unescape(d.host)),void 0!==d.path&&d.path.length&&(d.path=escape(unescape(d.path))),void 0!==d.fragment&&d.fragment.length&&(d.fragment=encodeURI(decodeURIComponent(d.fragment)))),e&&e.parse&&e.parse(d,t)}else d.error=d.error||"URI can not be parsed.";return d}const h={SCHEMES:i,normalize:function(e,a){return"string"==typeof e?e=o(u(e,a),a):"object"==typeof e&&(e=u(o(e,a),a)),e},resolve:function(e,a,t){const c=Object.assign({scheme:"null"},t);return o(b(u(e,c),u(a,c),c,!0),{...c,skipEscape:!0})},resolveComponents:b,equal:function(e,a,t){return"string"==typeof e?(e=unescape(e),e=o(n(u(e,t),!0),{...t,skipEscape:!0})):"object"==typeof e&&(e=o(n(e,!0),{...t,skipEscape:!0})),"string"==typeof a?(a=unescape(a),a=o(n(u(a,t),!0),{...t,skipEscape:!0})):"object"==typeof a&&(a=o(n(a,!0),{...t,skipEscape:!0})),e.toLowerCase()===a.toLowerCase()},serialize:o,parse:u};e.exports=h,e.exports.default=h,e.exports.fastUri=h},343:e=>{"use strict";const a=/^[\da-f]{8}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{12}$/iu,t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function c(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}function f(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function d(e){const a="https"===String(e.scheme).toLowerCase();return e.port!==(a?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}const r={scheme:"http",domainHost:!0,parse:f,serialize:d},n={scheme:"ws",domainHost:!0,parse:function(e){return e.secure=c(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e},serialize:function(e){if(e.port!==(c(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[a,t]=e.resourceName.split("?");e.path=a&&"/"!==a?a:void 0,e.query=t,e.resourceName=void 0}return e.fragment=void 0,e}},i={http:r,https:{scheme:"https",domainHost:r.domainHost,parse:f,serialize:d},ws:n,wss:{scheme:"wss",domainHost:n.domainHost,parse:n.parse,serialize:n.serialize},urn:{scheme:"urn",parse:function(e,a){if(!e.path)return e.error="URN can not be parsed",e;const c=e.path.match(t);if(c){const t=a.scheme||e.scheme||"urn";e.nid=c[1].toLowerCase(),e.nss=c[2];const f=`${t}:${a.nid||e.nid}`,d=i[f];e.path=void 0,d&&(e=d.parse(e,a))}else e.error=e.error||"URN can not be parsed.";return e},serialize:function(e,a){const t=a.scheme||e.scheme||"urn",c=e.nid.toLowerCase(),f=`${t}:${a.nid||c}`,d=i[f];d&&(e=d.serialize(e,a));const r=e,n=e.nss;return r.path=`${c||a.nid}:${n}`,a.skipEscape=!0,r},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(e,t){const c=e;return c.uuid=c.nss,c.nss=void 0,t.tolerant||c.uuid&&a.test(c.uuid)||(c.error=c.error||"UUID is not valid."),c},serialize:function(e){const a=e;return a.nss=(e.uuid||"").toLowerCase(),a},skipNormalize:!0}};e.exports=i},64914:e=>{"use strict";e.exports={HEX:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15}}},34834:(e,a,t)=>{"use strict";const{HEX:c}=t(64914);function f(e){if(i(e,".")<3)return{host:e,isIPV4:!1};const a=e.match(/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/u)||[],[t]=a;return t?{host:n(t,"."),isIPV4:!0}:{host:e,isIPV4:!1}}function d(e,a=!1){let t="",f=!0;for(const a of e){if(void 0===c[a])return;"0"!==a&&!0===f&&(f=!1),f||(t+=a)}return a&&0===t.length&&(t="0"),t}function r(e,a={}){if(i(e,":")<2)return{host:e,isIPV6:!1};const t=function(e){let a=0;const t={error:!1,address:"",zone:""},c=[],f=[];let r=!1,n=!1,i=!1;function b(){if(f.length){if(!1===r){const e=d(f);if(void 0===e)return t.error=!0,!1;c.push(e)}f.length=0}return!0}for(let d=0;d7){t.error=!0;break}d-1>=0&&":"===e[d-1]&&(n=!0)}}return f.length&&(r?t.zone=f.join(""):i?c.push(f.join("")):c.push(d(f))),t.address=c.join(""),t}(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,a=t.address;return t.zone&&(e+="%"+t.zone,a+="%25"+t.zone),{host:e,escapedHost:a,isIPV6:!0}}}function n(e,a){let t="",c=!0;const f=e.length;for(let d=0;d{"use strict";t.d(a,{HI:()=>Bt,vu:()=>ct});const c=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];function f(e,a){return a&&10!=a?16==a?"0x"==e.slice(0,2)?BigInt(e):BigInt("0x"+e):void 0:BigInt(e)}const d=f;function r(e){const a=e.toString(16);return 4*(a.length-1)+c[parseInt(a[0],16)]}function n(e){return BigInt(e)>BigInt(a)}const o=i,s=b;function l(e){return(BigInt(e)&BigInt(1))==BigInt(1)}function u(e){if(e>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("Number too big");return Number(e)}function h(e,a){return BigInt(e)+BigInt(a)}function p(e,a){return BigInt(e)-BigInt(a)}function g(e){return-BigInt(e)}function m(e,a){return BigInt(e)*BigInt(a)}function y(e,a){return BigInt(e)%BigInt(a)}function x(e,a){return BigInt(e)>BigInt(a)}function A(e,a){return BigInt(e)>=BigInt(a)}function v(e,a){return BigInt(e)&BigInt(a)}function w(e,a,t,c){const f="0000000"+t.toString(16),d=new Uint32Array(e.buffer,e.byteOffset+a,c/4),r=1+(4*(f.length-7)-1>>5);for(let e=0;ed[d.length-a-1]=e.toString(16).padStart(8,"0"))),f(d.join(""),16)}function I(e,a){return e.toString(a)}function E(e){const a=new Uint8Array(Math.floor((r(e)-1)/8)+1);return w(a,0,e,a.byteLength),a}const C=d(0),M=d(1);var B=Object.freeze({__proto__:null,abs:function(e){return BigInt(e)>=0?BigInt(e):-BigInt(e)},add:h,band:v,bitLength:r,bits:function(e){let a=BigInt(e);const t=[];for(;a;)a&BigInt(1)?t.push(1):t.push(0),a>>=BigInt(1);return t},bor:function(e,a){return BigInt(e)|BigInt(a)},bxor:function(e,a){return BigInt(e)^BigInt(a)},div:function(e,a){return BigInt(e)/BigInt(a)},e:d,eq:function(e,a){return BigInt(e)==BigInt(a)},exp:function(e,a){return BigInt(e)**BigInt(a)},fromArray:function(e,a){let t=BigInt(0);a=BigInt(a);for(let c=0;c>=BigInt(1)}return t},neg:g,neq:function(e,a){return BigInt(e)!=BigInt(a)},one:M,pow:function(e,a){return BigInt(e)**BigInt(a)},shiftLeft:i,shiftRight:b,shl:o,shr:s,square:function(e){return BigInt(e)*BigInt(e)},sub:p,toArray:function(e,a){const t=[];let c=BigInt(e);for(a=BigInt(a);c;)t.unshift(Number(c%a)),c/=a;return t},toLEBuff:E,toNumber:u,toRprBE:function(e,a,t,c){const f="0000000"+t.toString(16),d=new DataView(e.buffer,e.byteOffset+a,c),r=1+(4*(f.length-7)-1>>5);for(let e=0;e>=1;return t}function S(e,a,t,c,f){e[a]=e[a]+e[t]>>>0,e[f]=(e[f]^e[a])>>>0,e[f]=(e[f]<<16|e[f]>>>16&65535)>>>0,e[c]=e[c]+e[f]>>>0,e[t]=(e[t]^e[c])>>>0,e[t]=(e[t]<<12|e[t]>>>20&4095)>>>0,e[a]=e[a]+e[t]>>>0,e[f]=(e[f]^e[a])>>>0,e[f]=(e[f]<<8|e[f]>>>24&255)>>>0,e[c]=e[c]+e[f]>>>0,e[t]=(e[t]^e[c])>>>0,e[t]=(e[t]<<7|e[t]>>>25&127)>>>0}class T{constructor(e){e=e||[0,0,0,0,0,0,0,0],this.state=[1634760805,857760878,2036477234,1797285236,e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],0,0,0,0],this.idx=16,this.buff=new Array(16)}nextU32(){return 16==this.idx&&this.update(),this.buff[this.idx++]}nextU64(){return h(m(this.nextU32(),4294967296),this.nextU32())}nextBool(){return!(1&~this.nextU32())}update(){for(let e=0;e<16;e++)this.buff[e]=this.state[e];for(let a=0;a<10;a++)S(e=this.buff,0,4,8,12),S(e,1,5,9,13),S(e,2,6,10,14),S(e,3,7,11,15),S(e,0,5,10,15),S(e,1,6,11,12),S(e,2,7,8,13),S(e,3,4,9,14);var e;for(let e=0;e<16;e++)this.buff[e]=this.buff[e]+this.state[e]>>>0;this.idx=0,this.state[12]=this.state[12]+1>>>0,0==this.state[12]&&(this.state[13]=this.state[13]+1>>>0,0==this.state[13]&&(this.state[14]=this.state[14]+1>>>0,0==this.state[14]&&(this.state[15]=this.state[15]+1>>>0)))}}let N=null;function R(){return N||(N=new T(function(){const e=function(e){let a=new Uint8Array(e);if(void 0!==globalThis.crypto)globalThis.crypto.getRandomValues(a);else for(let t=0;t>>0;return a}(32),a=new Uint32Array(e.buffer),t=[];for(let e=0;e<8;e++)t.push(a[e]);return t}()),N)}function P(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var D={bigInt2BytesLE:function(e,a){const t=Array(a);let c=BigInt(e);for(let e=0;e>=8n;return t},bigInt2U32LE:function(e,a){const t=Array(a);let c=BigInt(e);for(let e=0;e>=32n;return t},isOcamNum:function(e){return!!Array.isArray(e)&&3==e.length&&"number"==typeof e[0]&&"number"==typeof e[1]&&!!Array.isArray(e[2])}},O=function(e,a,t,c,f,d,r){const n=e.addFunction(a);n.addParam("base","i32"),n.addParam("scalar","i32"),n.addParam("scalarLength","i32"),n.addParam("r","i32"),n.addLocal("i","i32"),n.addLocal("b","i32");const i=n.getCodeBuilder(),b=i.i32_const(e.alloc(t));n.addCode(i.if(i.i32_eqz(i.getLocal("scalarLength")),[...i.call(r,i.getLocal("r")),...i.ret([])])),n.addCode(i.call(d,i.getLocal("base"),b)),n.addCode(i.call(r,i.getLocal("r"))),n.addCode(i.setLocal("i",i.getLocal("scalarLength"))),n.addCode(i.block(i.loop(i.setLocal("i",i.i32_sub(i.getLocal("i"),i.i32_const(1))),i.setLocal("b",i.i32_load8_u(i.i32_add(i.getLocal("scalar"),i.getLocal("i")))),...function(){const e=[];for(let a=0;a<8;a++)e.push(...i.call(f,i.getLocal("r"),i.getLocal("r")),...i.if(i.i32_ge_u(i.getLocal("b"),i.i32_const(128>>a)),[...i.setLocal("b",i.i32_sub(i.getLocal("b"),i.i32_const(128>>a))),...i.call(c,i.getLocal("r"),b,i.getLocal("r"))]));return e}(),i.br_if(1,i.i32_eqz(i.getLocal("i"))),i.br(0))))},F=function(e,a){const t=8*e.modules[a].n64,c=e.addFunction(a+"_batchInverse");c.addParam("pIn","i32"),c.addParam("inStep","i32"),c.addParam("n","i32"),c.addParam("pOut","i32"),c.addParam("outStep","i32"),c.addLocal("itAux","i32"),c.addLocal("itIn","i32"),c.addLocal("itOut","i32"),c.addLocal("i","i32");const f=c.getCodeBuilder(),d=f.i32_const(e.alloc(t));c.addCode(f.setLocal("itAux",f.i32_load(f.i32_const(0))),f.i32_store(f.i32_const(0),f.i32_add(f.getLocal("itAux"),f.i32_mul(f.i32_add(f.getLocal("n"),f.i32_const(1)),f.i32_const(t))))),c.addCode(f.call(a+"_one",f.getLocal("itAux")),f.setLocal("itIn",f.getLocal("pIn")),f.setLocal("itAux",f.i32_add(f.getLocal("itAux"),f.i32_const(t))),f.setLocal("i",f.i32_const(0)),f.block(f.loop(f.br_if(1,f.i32_eq(f.getLocal("i"),f.getLocal("n"))),f.if(f.call(a+"_isZero",f.getLocal("itIn")),f.call(a+"_copy",f.i32_sub(f.getLocal("itAux"),f.i32_const(t)),f.getLocal("itAux")),f.call(a+"_mul",f.getLocal("itIn"),f.i32_sub(f.getLocal("itAux"),f.i32_const(t)),f.getLocal("itAux"))),f.setLocal("itIn",f.i32_add(f.getLocal("itIn"),f.getLocal("inStep"))),f.setLocal("itAux",f.i32_add(f.getLocal("itAux"),f.i32_const(t))),f.setLocal("i",f.i32_add(f.getLocal("i"),f.i32_const(1))),f.br(0))),f.setLocal("itIn",f.i32_sub(f.getLocal("itIn"),f.getLocal("inStep"))),f.setLocal("itAux",f.i32_sub(f.getLocal("itAux"),f.i32_const(t))),f.setLocal("itOut",f.i32_add(f.getLocal("pOut"),f.i32_mul(f.i32_sub(f.getLocal("n"),f.i32_const(1)),f.getLocal("outStep")))),f.call(a+"_inverse",f.getLocal("itAux"),f.getLocal("itAux")),f.block(f.loop(f.br_if(1,f.i32_eqz(f.getLocal("i"))),f.if(f.call(a+"_isZero",f.getLocal("itIn")),[...f.call(a+"_copy",f.getLocal("itAux"),f.i32_sub(f.getLocal("itAux"),f.i32_const(t))),...f.call(a+"_zero",f.getLocal("itOut"))],[...f.call(a+"_copy",f.i32_sub(f.getLocal("itAux"),f.i32_const(t)),d),...f.call(a+"_mul",f.getLocal("itAux"),f.getLocal("itIn"),f.i32_sub(f.getLocal("itAux"),f.i32_const(t))),...f.call(a+"_mul",f.getLocal("itAux"),d,f.getLocal("itOut"))]),f.setLocal("itIn",f.i32_sub(f.getLocal("itIn"),f.getLocal("inStep"))),f.setLocal("itOut",f.i32_sub(f.getLocal("itOut"),f.getLocal("outStep"))),f.setLocal("itAux",f.i32_sub(f.getLocal("itAux"),f.i32_const(t))),f.setLocal("i",f.i32_sub(f.getLocal("i"),f.i32_const(1))),f.br(0)))),c.addCode(f.i32_store(f.i32_const(0),f.getLocal("itAux")))},Q=function(e,a,t,c,f,d){void 0===d&&(d=ca?1:-1}function H(e){return e*e}function $(e){return e%2n!==0n}function q(e){return e%2n===0n}function z(e){return e<0n}function G(e){return e>0n}function K(e){return z(e)?e.toString(2).length-1:e.toString(2).length}function V(e){return e<0n?-e:e}function Z(e){return 1n===V(e)}function J(e,a){for(var t,c,f,d=0n,r=1n,n=a,i=V(e);0n!==i;)t=n/i,c=d,f=n,d=r,n=i,r=c-t*r,i=f-t*i;if(!Z(n))throw new Error(e.toString()+" and "+a.toString()+" are not co-prime");return-1===j(d,0n)&&(d+=a),z(e)?-d:d}function W(e,a,t){if(0n===t)throw new Error("Cannot take modPow with modulus 0");var c=1n,f=e%t;for(z(a)&&(a*=-1n,f=J(f,t));G(a);){if(0n===f)return 0n;$(a)&&(c=c*f%t),a/=2n,f=H(f)%t}return c}function Y(e,a){return 0n!==a&&(!!Z(a)||(0===function(e,a){return(e=e>=0n?e:-e)===(a=a>=0n?a:-a)?0:e>a?1:-1}(a,2n)?q(e):e%a===0n))}function X(e,a){for(var t,c,f,d=function(e){return e-1n}(e),r=d,n=0;q(r);)r/=2n,n++;e:for(c=0;c>1&&c>1,e>>1)))),a.addCode(t.setLocal(i,t.i64_add(t.getLocal(i),t.i64_shr_u(t.getLocal(n),t.i64_const(32)))))),e>0&&(a.addCode(t.setLocal(n,t.i64_add(t.i64_and(t.getLocal(n),t.i64_const(4294967295)),t.i64_and(t.getLocal(b),t.i64_const(4294967295))))),a.addCode(t.setLocal(i,t.i64_add(t.i64_add(t.getLocal(i),t.i64_shr_u(t.getLocal(n),t.i64_const(32))),t.getLocal(o))))),a.addCode(t.i64_store32(t.getLocal("r"),4*e,t.getLocal(n))),a.addCode(t.setLocal(b,t.getLocal(i)),t.setLocal(o,t.i64_shr_u(t.getLocal(b),t.i64_const(32))))}a.addCode(t.i64_store32(t.getLocal("r"),4*f*2-4,t.getLocal(b)))}(),function(){const a=e.addFunction(c+"_squareOld");a.addParam("x","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.call(c+"_mul",t.getLocal("x"),t.getLocal("x"),t.getLocal("r")))}(),function(){!function(){const a=e.addFunction(c+"__mul1");a.addParam("px","i32"),a.addParam("y","i64"),a.addParam("pr","i32"),a.addLocal("c","i64");const t=a.getCodeBuilder();a.addCode(t.setLocal("c",t.i64_mul(t.i64_load32_u(t.getLocal("px"),0,0),t.getLocal("y")))),a.addCode(t.i64_store32(t.getLocal("pr"),0,0,t.getLocal("c")));for(let e=1;e>1n,g=e.alloc(n,ee.bigInt2BytesLE(p,n)),m=p+1n,y=e.alloc(n,ee.bigInt2BytesLE(m,n));e.modules[i]={pq:o,pR2:s,n64:d,q:f,pOne:l,pZero:u,pePlusOne:y};let x=2n;if(ie(f))for(;ne(x,p,f)!==h;)x+=1n;let A=0,v=h;for(;!be(v)&&0n!==v;)A++,v>>=1n;const w=e.alloc(n,ee.bigInt2BytesLE(v,n)),_=ne(x,v,f),I=e.alloc(ee.bigInt2BytesLE((_<>1n,C=e.alloc(n,ee.bigInt2BytesLE(E,n));return e.exportFunction(b+"_copy",i+"_copy"),e.exportFunction(b+"_zero",i+"_zero"),e.exportFunction(b+"_isZero",i+"_isZero"),e.exportFunction(b+"_eq",i+"_eq"),function(){const a=e.addFunction(i+"_isOne");a.addParam("x","i32"),a.setReturnType("i32");const t=a.getCodeBuilder();a.addCode(t.ret(t.call(b+"_eq",t.getLocal("x"),t.i32_const(l))))}(),function(){const a=e.addFunction(i+"_add");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.if(t.call(b+"_add",t.getLocal("x"),t.getLocal("y"),t.getLocal("r")),t.drop(t.call(b+"_sub",t.getLocal("r"),t.i32_const(o),t.getLocal("r"))),t.if(t.call(b+"_gte",t.getLocal("r"),t.i32_const(o)),t.drop(t.call(b+"_sub",t.getLocal("r"),t.i32_const(o),t.getLocal("r"))))))}(),function(){const a=e.addFunction(i+"_sub");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.if(t.call(b+"_sub",t.getLocal("x"),t.getLocal("y"),t.getLocal("r")),t.drop(t.call(b+"_add",t.getLocal("r"),t.i32_const(o),t.getLocal("r")))))}(),function(){const a=e.addFunction(i+"_neg");a.addParam("x","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.call(i+"_sub",t.i32_const(u),t.getLocal("x"),t.getLocal("r")))}(),function(){const a=e.alloc(r*r*8),t=e.addFunction(i+"_mReduct");t.addParam("t","i32"),t.addParam("r","i32"),t.addLocal("np32","i64"),t.addLocal("c","i64"),t.addLocal("m","i64");const c=t.getCodeBuilder(),d=Number(0x100000000n-re(f,0x100000000n));t.addCode(c.setLocal("np32",c.i64_const(d)));for(let e=0;e=r&&a.addCode(t.i64_store32(t.getLocal("r"),4*(e-r),t.getLocal(h))),[h,p]=[p,h],a.addCode(t.setLocal(p,t.i64_shr_u(t.getLocal(h),t.i64_const(32))))}a.addCode(t.i64_store32(t.getLocal("r"),4*r-4,t.getLocal(h))),a.addCode(t.if(t.i32_wrap_i64(t.getLocal(p)),t.drop(t.call(b+"_sub",t.getLocal("r"),t.i32_const(o),t.getLocal("r"))),t.if(t.call(b+"_gte",t.getLocal("r"),t.i32_const(o)),t.drop(t.call(b+"_sub",t.getLocal("r"),t.i32_const(o),t.getLocal("r"))))))}(),function(){const a=e.addFunction(i+"_square");a.addParam("x","i32"),a.addParam("r","i32"),a.addLocal("c0","i64"),a.addLocal("c1","i64"),a.addLocal("c0_old","i64"),a.addLocal("c1_old","i64"),a.addLocal("np32","i64");for(let e=0;e>1&&c>1,e>>1)))),a.addCode(t.setLocal(h,t.i64_add(t.getLocal(h),t.i64_shr_u(t.getLocal(u),t.i64_const(32)))))),e>0&&(a.addCode(t.setLocal(u,t.i64_add(t.i64_and(t.getLocal(u),t.i64_const(4294967295)),t.i64_and(t.getLocal(p),t.i64_const(4294967295))))),a.addCode(t.setLocal(h,t.i64_add(t.i64_add(t.getLocal(h),t.i64_shr_u(t.getLocal(u),t.i64_const(32))),t.getLocal(g)))));for(let c=Math.max(1,e-r+1);c<=e&&c=r&&a.addCode(t.i64_store32(t.getLocal("r"),4*(e-r),t.getLocal(u))),a.addCode(t.setLocal(p,t.getLocal(h)),t.setLocal(g,t.i64_shr_u(t.getLocal(p),t.i64_const(32))))}a.addCode(t.i64_store32(t.getLocal("r"),4*r-4,t.getLocal(p))),a.addCode(t.if(t.i32_wrap_i64(t.getLocal(g)),t.drop(t.call(b+"_sub",t.getLocal("r"),t.i32_const(o),t.getLocal("r"))),t.if(t.call(b+"_gte",t.getLocal("r"),t.i32_const(o)),t.drop(t.call(b+"_sub",t.getLocal("r"),t.i32_const(o),t.getLocal("r"))))))}(),function(){const a=e.addFunction(i+"_squareOld");a.addParam("x","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.call(i+"_mul",t.getLocal("x"),t.getLocal("x"),t.getLocal("r")))}(),function(){const a=e.addFunction(i+"_toMontgomery");a.addParam("x","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.call(i+"_mul",t.getLocal("x"),t.i32_const(s),t.getLocal("r")))}(),function(){const a=e.alloc(2*n),t=e.addFunction(i+"_fromMontgomery");t.addParam("x","i32"),t.addParam("r","i32");const c=t.getCodeBuilder();t.addCode(c.call(b+"_copy",c.getLocal("x"),c.i32_const(a))),t.addCode(c.call(b+"_zero",c.i32_const(a+n))),t.addCode(c.call(i+"_mReduct",c.i32_const(a),c.getLocal("r")))}(),function(){const a=e.addFunction(i+"_isNegative");a.addParam("x","i32"),a.setReturnType("i32");const t=a.getCodeBuilder(),c=t.i32_const(e.alloc(n));a.addCode(t.call(i+"_fromMontgomery",t.getLocal("x"),c),t.call(b+"_gte",c,t.i32_const(y)))}(),function(){const a=e.addFunction(i+"_sign");a.addParam("x","i32"),a.setReturnType("i32");const t=a.getCodeBuilder(),c=t.i32_const(e.alloc(n));a.addCode(t.if(t.call(b+"_isZero",t.getLocal("x")),t.ret(t.i32_const(0))),t.call(i+"_fromMontgomery",t.getLocal("x"),c),t.if(t.call(b+"_gte",c,t.i32_const(y)),t.ret(t.i32_const(-1))),t.ret(t.i32_const(1)))}(),function(){const a=e.addFunction(i+"_inverse");a.addParam("x","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.call(i+"_fromMontgomery",t.getLocal("x"),t.getLocal("r"))),a.addCode(t.call(b+"_inverseMod",t.getLocal("r"),t.i32_const(o),t.getLocal("r"))),a.addCode(t.call(i+"_toMontgomery",t.getLocal("r"),t.getLocal("r")))}(),function(){const a=e.addFunction(i+"_one");a.addParam("pr","i32");const t=a.getCodeBuilder();a.addCode(t.call(b+"_copy",t.i32_const(l),t.getLocal("pr")))}(),function(){const a=e.addFunction(i+"_load");a.addParam("scalar","i32"),a.addParam("scalarLen","i32"),a.addParam("r","i32"),a.addLocal("p","i32"),a.addLocal("l","i32"),a.addLocal("i","i32"),a.addLocal("j","i32");const t=a.getCodeBuilder(),c=t.i32_const(e.alloc(n)),f=e.alloc(n),d=t.i32_const(f);a.addCode(t.call(b+"_zero",t.getLocal("r")),t.setLocal("i",t.i32_const(n)),t.setLocal("p",t.getLocal("scalar")),t.block(t.loop(t.br_if(1,t.i32_gt_u(t.getLocal("i"),t.getLocal("scalarLen"))),t.if(t.i32_eq(t.getLocal("i"),t.i32_const(n)),t.call(i+"_one",c),t.call(i+"_mul",c,t.i32_const(s),c)),t.call(i+"_mul",t.getLocal("p"),c,d),t.call(i+"_add",t.getLocal("r"),d,t.getLocal("r")),t.setLocal("p",t.i32_add(t.getLocal("p"),t.i32_const(n))),t.setLocal("i",t.i32_add(t.getLocal("i"),t.i32_const(n))),t.br(0))),t.setLocal("l",t.i32_rem_u(t.getLocal("scalarLen"),t.i32_const(n))),t.if(t.i32_eqz(t.getLocal("l")),t.ret([])),t.call(b+"_zero",d),t.setLocal("j",t.i32_const(0)),t.block(t.loop(t.br_if(1,t.i32_eq(t.getLocal("j"),t.getLocal("l"))),t.i32_store8(t.getLocal("j"),f,t.i32_load8_u(t.getLocal("p"))),t.setLocal("p",t.i32_add(t.getLocal("p"),t.i32_const(1))),t.setLocal("j",t.i32_add(t.getLocal("j"),t.i32_const(1))),t.br(0))),t.if(t.i32_eq(t.getLocal("i"),t.i32_const(n)),t.call(i+"_one",c),t.call(i+"_mul",c,t.i32_const(s),c)),t.call(i+"_mul",d,c,d),t.call(i+"_add",t.getLocal("r"),d,t.getLocal("r")))}(),function(){const a=e.addFunction(i+"_timesScalar");a.addParam("x","i32"),a.addParam("scalar","i32"),a.addParam("scalarLen","i32"),a.addParam("r","i32");const t=a.getCodeBuilder(),c=t.i32_const(e.alloc(n));a.addCode(t.call(i+"_load",t.getLocal("scalar"),t.getLocal("scalarLen"),c),t.call(i+"_toMontgomery",c,c),t.call(i+"_mul",t.getLocal("x"),c,t.getLocal("r")))}(),te(e,i),ce(e,i+"_batchToMontgomery",i+"_toMontgomery",n,n),ce(e,i+"_batchFromMontgomery",i+"_fromMontgomery",n,n),ce(e,i+"_batchNeg",i+"_neg",n,n),fe(e,i+"_batchAdd",i+"_add",n,n),fe(e,i+"_batchSub",i+"_sub",n,n),fe(e,i+"_batchMul",i+"_mul",n,n),e.exportFunction(i+"_add"),e.exportFunction(i+"_sub"),e.exportFunction(i+"_neg"),e.exportFunction(i+"_isNegative"),e.exportFunction(i+"_isOne"),e.exportFunction(i+"_sign"),e.exportFunction(i+"_mReduct"),e.exportFunction(i+"_mul"),e.exportFunction(i+"_square"),e.exportFunction(i+"_squareOld"),e.exportFunction(i+"_fromMontgomery"),e.exportFunction(i+"_toMontgomery"),e.exportFunction(i+"_inverse"),e.exportFunction(i+"_one"),e.exportFunction(i+"_load"),e.exportFunction(i+"_timesScalar"),ae(e,i+"_exp",n,i+"_mul",i+"_square",b+"_copy",i+"_one"),e.exportFunction(i+"_exp"),e.exportFunction(i+"_batchInverse"),ie(f)&&(function(){const a=e.addFunction(i+"_sqrt");a.addParam("n","i32"),a.addParam("r","i32"),a.addLocal("m","i32"),a.addLocal("i","i32"),a.addLocal("j","i32");const t=a.getCodeBuilder(),c=t.i32_const(l),f=t.i32_const(e.alloc(n)),d=t.i32_const(e.alloc(n)),r=t.i32_const(e.alloc(n)),b=t.i32_const(e.alloc(n)),o=t.i32_const(e.alloc(n));a.addCode(t.if(t.call(i+"_isZero",t.getLocal("n")),t.ret(t.call(i+"_zero",t.getLocal("r")))),t.setLocal("m",t.i32_const(A)),t.call(i+"_copy",t.i32_const(I),f),t.call(i+"_exp",t.getLocal("n"),t.i32_const(w),t.i32_const(n),d),t.call(i+"_exp",t.getLocal("n"),t.i32_const(C),t.i32_const(n),r),t.block(t.loop(t.br_if(1,t.call(i+"_eq",d,c)),t.call(i+"_square",d,b),t.setLocal("i",t.i32_const(1)),t.block(t.loop(t.br_if(1,t.call(i+"_eq",b,c)),t.call(i+"_square",b,b),t.setLocal("i",t.i32_add(t.getLocal("i"),t.i32_const(1))),t.br(0))),t.call(i+"_copy",f,o),t.setLocal("j",t.i32_sub(t.i32_sub(t.getLocal("m"),t.getLocal("i")),t.i32_const(1))),t.block(t.loop(t.br_if(1,t.i32_eqz(t.getLocal("j"))),t.call(i+"_square",o,o),t.setLocal("j",t.i32_sub(t.getLocal("j"),t.i32_const(1))),t.br(0))),t.setLocal("m",t.getLocal("i")),t.call(i+"_square",o,f),t.call(i+"_mul",d,f,d),t.call(i+"_mul",r,o,r),t.br(0))),t.if(t.call(i+"_isNegative",r),t.call(i+"_neg",r,t.getLocal("r")),t.call(i+"_copy",r,t.getLocal("r"))))}(),function(){const a=e.addFunction(i+"_isSquare");a.addParam("n","i32"),a.setReturnType("i32");const t=a.getCodeBuilder(),c=t.i32_const(l),f=t.i32_const(e.alloc(n));a.addCode(t.if(t.call(i+"_isZero",t.getLocal("n")),t.ret(t.i32_const(1))),t.call(i+"_exp",t.getLocal("n"),t.i32_const(g),t.i32_const(n),f),t.call(i+"_eq",f,c))}(),e.exportFunction(i+"_sqrt"),e.exportFunction(i+"_isSquare")),e.exportFunction(i+"_batchToMontgomery"),e.exportFunction(i+"_batchFromMontgomery"),i};const le=se,{bitLength:ue}=U;var he=function(e,a,t,c,f){const d=BigInt(a),r=Math.floor((ue(d-1n)-1)/64)+1,n=8*r,i=t||"f1";if(e.modules[i])return i;e.modules[i]={n64:r};const b=f||"int",o=le(e,d,c,b),s=e.modules[o].pR2,l=e.modules[o].pq,u=e.modules[o].pePlusOne;return function(){const a=e.alloc(n),t=e.addFunction(i+"_mul");t.addParam("x","i32"),t.addParam("y","i32"),t.addParam("r","i32");const c=t.getCodeBuilder();t.addCode(c.call(o+"_mul",c.getLocal("x"),c.getLocal("y"),c.i32_const(a))),t.addCode(c.call(o+"_mul",c.i32_const(a),c.i32_const(s),c.getLocal("r")))}(),function(){const a=e.addFunction(i+"_square");a.addParam("x","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.call(i+"_mul",t.getLocal("x"),t.getLocal("x"),t.getLocal("r")))}(),function(){const a=e.addFunction(i+"_inverse");a.addParam("x","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.call(b+"_inverseMod",t.getLocal("x"),t.i32_const(l),t.getLocal("r")))}(),function(){const a=e.addFunction(i+"_isNegative");a.addParam("x","i32"),a.setReturnType("i32");const t=a.getCodeBuilder();a.addCode(t.call(b+"_gte",t.getLocal("x"),t.i32_const(u)))}(),e.exportFunction(o+"_add",i+"_add"),e.exportFunction(o+"_sub",i+"_sub"),e.exportFunction(o+"_neg",i+"_neg"),e.exportFunction(i+"_mul"),e.exportFunction(i+"_square"),e.exportFunction(i+"_inverse"),e.exportFunction(i+"_isNegative"),e.exportFunction(o+"_copy",i+"_copy"),e.exportFunction(o+"_zero",i+"_zero"),e.exportFunction(o+"_one",i+"_one"),e.exportFunction(o+"_isZero",i+"_isZero"),e.exportFunction(o+"_eq",i+"_eq"),i};const pe=O,ge=F,me=D;var ye=function(e,a,t,c){if(e.modules[t])return t;const f=8*e.modules[c].n64,d=e.modules[c].q;return e.modules[t]={n64:2*e.modules[c].n64},function(){const a=e.addFunction(t+"_isZero");a.addParam("x","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f));a.addCode(d.i32_and(d.call(c+"_isZero",r),d.call(c+"_isZero",n)))}(),function(){const a=e.addFunction(t+"_isOne");a.addParam("x","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f));a.addCode(d.ret(d.i32_and(d.call(c+"_isOne",r),d.call(c+"_isZero",n))))}(),function(){const a=e.addFunction(t+"_zero");a.addParam("x","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f));a.addCode(d.call(c+"_zero",r),d.call(c+"_zero",n))}(),function(){const a=e.addFunction(t+"_one");a.addParam("x","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f));a.addCode(d.call(c+"_one",r),d.call(c+"_zero",n))}(),function(){const a=e.addFunction(t+"_copy");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("r"),b=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_copy",r,i),d.call(c+"_copy",n,b))}(),function(){const d=e.addFunction(t+"_mul");d.addParam("x","i32"),d.addParam("y","i32"),d.addParam("r","i32");const r=d.getCodeBuilder(),n=r.getLocal("x"),i=r.i32_add(r.getLocal("x"),r.i32_const(f)),b=r.getLocal("y"),o=r.i32_add(r.getLocal("y"),r.i32_const(f)),s=r.getLocal("r"),l=r.i32_add(r.getLocal("r"),r.i32_const(f)),u=r.i32_const(e.alloc(f)),h=r.i32_const(e.alloc(f)),p=r.i32_const(e.alloc(f)),g=r.i32_const(e.alloc(f));d.addCode(r.call(c+"_mul",n,b,u),r.call(c+"_mul",i,o,h),r.call(c+"_add",n,i,p),r.call(c+"_add",b,o,g),r.call(c+"_mul",p,g,p),r.call(a,h,s),r.call(c+"_add",u,s,s),r.call(c+"_add",u,h,l),r.call(c+"_sub",p,l,l))}(),function(){const a=e.addFunction(t+"_mul1");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("y"),b=d.getLocal("r"),o=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_mul",r,i,b),d.call(c+"_mul",n,i,o))}(),function(){const d=e.addFunction(t+"_square");d.addParam("x","i32"),d.addParam("r","i32");const r=d.getCodeBuilder(),n=r.getLocal("x"),i=r.i32_add(r.getLocal("x"),r.i32_const(f)),b=r.getLocal("r"),o=r.i32_add(r.getLocal("r"),r.i32_const(f)),s=r.i32_const(e.alloc(f)),l=r.i32_const(e.alloc(f)),u=r.i32_const(e.alloc(f)),h=r.i32_const(e.alloc(f));d.addCode(r.call(c+"_mul",n,i,s),r.call(c+"_add",n,i,l),r.call(a,i,u),r.call(c+"_add",n,u,u),r.call(a,s,h),r.call(c+"_add",h,s,h),r.call(c+"_mul",l,u,b),r.call(c+"_sub",b,h,b),r.call(c+"_add",s,s,o))}(),function(){const a=e.addFunction(t+"_add");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("y"),b=d.i32_add(d.getLocal("y"),d.i32_const(f)),o=d.getLocal("r"),s=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_add",r,i,o),d.call(c+"_add",n,b,s))}(),function(){const a=e.addFunction(t+"_sub");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("y"),b=d.i32_add(d.getLocal("y"),d.i32_const(f)),o=d.getLocal("r"),s=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_sub",r,i,o),d.call(c+"_sub",n,b,s))}(),function(){const a=e.addFunction(t+"_neg");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("r"),b=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_neg",r,i),d.call(c+"_neg",n,b))}(),function(){const a=e.addFunction(t+"_conjugate");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("r"),b=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_copy",r,i),d.call(c+"_neg",n,b))}(),function(){const a=e.addFunction(t+"_toMontgomery");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("r"),b=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_toMontgomery",r,i),d.call(c+"_toMontgomery",n,b))}(),function(){const a=e.addFunction(t+"_fromMontgomery");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("r"),b=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_fromMontgomery",r,i),d.call(c+"_fromMontgomery",n,b))}(),function(){const a=e.addFunction(t+"_eq");a.addParam("x","i32"),a.addParam("y","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("y"),b=d.i32_add(d.getLocal("y"),d.i32_const(f));a.addCode(d.i32_and(d.call(c+"_eq",r,i),d.call(c+"_eq",n,b)))}(),function(){const d=e.addFunction(t+"_inverse");d.addParam("x","i32"),d.addParam("r","i32");const r=d.getCodeBuilder(),n=r.getLocal("x"),i=r.i32_add(r.getLocal("x"),r.i32_const(f)),b=r.getLocal("r"),o=r.i32_add(r.getLocal("r"),r.i32_const(f)),s=r.i32_const(e.alloc(f)),l=r.i32_const(e.alloc(f)),u=r.i32_const(e.alloc(f)),h=r.i32_const(e.alloc(f));d.addCode(r.call(c+"_square",n,s),r.call(c+"_square",i,l),r.call(a,l,u),r.call(c+"_sub",s,u,u),r.call(c+"_inverse",u,h),r.call(c+"_mul",n,h,b),r.call(c+"_mul",i,h,o),r.call(c+"_neg",o,o))}(),function(){const a=e.addFunction(t+"_timesScalar");a.addParam("x","i32"),a.addParam("scalar","i32"),a.addParam("scalarLen","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("r"),b=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_timesScalar",r,d.getLocal("scalar"),d.getLocal("scalarLen"),i),d.call(c+"_timesScalar",n,d.getLocal("scalar"),d.getLocal("scalarLen"),b))}(),function(){const a=e.addFunction(t+"_sign");a.addParam("x","i32"),a.addLocal("s","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f));a.addCode(d.setLocal("s",d.call(c+"_sign",n)),d.if(d.getLocal("s"),d.ret(d.getLocal("s"))),d.ret(d.call(c+"_sign",r)))}(),function(){const a=e.addFunction(t+"_isNegative");a.addParam("x","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f));a.addCode(d.if(d.call(c+"_isZero",n),d.ret(d.call(c+"_isNegative",r))),d.ret(d.call(c+"_isNegative",n)))}(),e.exportFunction(t+"_isZero"),e.exportFunction(t+"_isOne"),e.exportFunction(t+"_zero"),e.exportFunction(t+"_one"),e.exportFunction(t+"_copy"),e.exportFunction(t+"_mul"),e.exportFunction(t+"_mul1"),e.exportFunction(t+"_square"),e.exportFunction(t+"_add"),e.exportFunction(t+"_sub"),e.exportFunction(t+"_neg"),e.exportFunction(t+"_sign"),e.exportFunction(t+"_conjugate"),e.exportFunction(t+"_fromMontgomery"),e.exportFunction(t+"_toMontgomery"),e.exportFunction(t+"_eq"),e.exportFunction(t+"_inverse"),ge(e,t),pe(e,t+"_exp",2*f,t+"_mul",t+"_square",t+"_copy",t+"_one"),function(){const a=e.addFunction(t+"_sqrt");a.addParam("a","i32"),a.addParam("pr","i32");const r=a.getCodeBuilder(),n=r.i32_const(e.alloc(me.bigInt2BytesLE((BigInt(d||0)-3n)/4n,f))),i=r.i32_const(e.alloc(me.bigInt2BytesLE((BigInt(d||0)-1n)/2n,f))),b=r.getLocal("a"),o=r.i32_const(e.alloc(2*f)),s=r.i32_const(e.alloc(2*f)),l=r.i32_const(e.alloc(2*f)),u=e.alloc(2*f),h=r.i32_const(u),p=r.i32_const(u),g=r.i32_const(u+f),m=r.i32_const(e.alloc(2*f)),y=r.i32_const(e.alloc(2*f));a.addCode(r.call(t+"_one",h),r.call(t+"_neg",h,h),r.call(t+"_exp",b,n,r.i32_const(f),o),r.call(t+"_square",o,s),r.call(t+"_mul",b,s,s),r.call(t+"_conjugate",s,l),r.call(t+"_mul",l,s,l),r.if(r.call(t+"_eq",l,h),r.unreachable()),r.call(t+"_mul",o,b,m),r.if(r.call(t+"_eq",s,h),[...r.call(c+"_zero",p),...r.call(c+"_one",g),...r.call(t+"_mul",h,m,r.getLocal("pr"))],[...r.call(t+"_one",y),...r.call(t+"_add",y,s,y),...r.call(t+"_exp",y,i,r.i32_const(f),y),...r.call(t+"_mul",y,m,r.getLocal("pr"))]))}(),function(){const a=e.addFunction(t+"_isSquare");a.addParam("a","i32"),a.setReturnType("i32");const c=a.getCodeBuilder(),r=c.i32_const(e.alloc(me.bigInt2BytesLE((BigInt(d||0)-3n)/4n,f))),n=c.getLocal("a"),i=c.i32_const(e.alloc(2*f)),b=c.i32_const(e.alloc(2*f)),o=c.i32_const(e.alloc(2*f)),s=e.alloc(2*f),l=c.i32_const(s);a.addCode(c.call(t+"_one",l),c.call(t+"_neg",l,l),c.call(t+"_exp",n,r,c.i32_const(f),i),c.call(t+"_square",i,b),c.call(t+"_mul",n,b,b),c.call(t+"_conjugate",b,o),c.call(t+"_mul",o,b,o),c.if(c.call(t+"_eq",o,l),c.ret(c.i32_const(0))),c.ret(c.i32_const(1)))}(),e.exportFunction(t+"_exp"),e.exportFunction(t+"_timesScalar"),e.exportFunction(t+"_batchInverse"),e.exportFunction(t+"_sqrt"),e.exportFunction(t+"_isSquare"),e.exportFunction(t+"_isNegative"),t};const xe=O,Ae=F;var ve=function(e,a,t,c){if(e.modules[t])return t;const f=8*e.modules[c].n64;return e.modules[t]={n64:3*e.modules[c].n64},function(){const a=e.addFunction(t+"_isZero");a.addParam("x","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f));a.addCode(d.i32_and(d.i32_and(d.call(c+"_isZero",r),d.call(c+"_isZero",n)),d.call(c+"_isZero",i)))}(),function(){const a=e.addFunction(t+"_isOne");a.addParam("x","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f));a.addCode(d.ret(d.i32_and(d.i32_and(d.call(c+"_isOne",r),d.call(c+"_isZero",n)),d.call(c+"_isZero",i))))}(),function(){const a=e.addFunction(t+"_zero");a.addParam("x","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f));a.addCode(d.call(c+"_zero",r),d.call(c+"_zero",n),d.call(c+"_zero",i))}(),function(){const a=e.addFunction(t+"_one");a.addParam("x","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f));a.addCode(d.call(c+"_one",r),d.call(c+"_zero",n),d.call(c+"_zero",i))}(),function(){const a=e.addFunction(t+"_copy");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("r"),o=d.i32_add(d.getLocal("r"),d.i32_const(f)),s=d.i32_add(d.getLocal("r"),d.i32_const(2*f));a.addCode(d.call(c+"_copy",r,b),d.call(c+"_copy",n,o),d.call(c+"_copy",i,s))}(),function(){const d=e.addFunction(t+"_mul");d.addParam("x","i32"),d.addParam("y","i32"),d.addParam("r","i32");const r=d.getCodeBuilder(),n=r.getLocal("x"),i=r.i32_add(r.getLocal("x"),r.i32_const(f)),b=r.i32_add(r.getLocal("x"),r.i32_const(2*f)),o=r.getLocal("y"),s=r.i32_add(r.getLocal("y"),r.i32_const(f)),l=r.i32_add(r.getLocal("y"),r.i32_const(2*f)),u=r.getLocal("r"),h=r.i32_add(r.getLocal("r"),r.i32_const(f)),p=r.i32_add(r.getLocal("r"),r.i32_const(2*f)),g=r.i32_const(e.alloc(f)),m=r.i32_const(e.alloc(f)),y=r.i32_const(e.alloc(f)),x=r.i32_const(e.alloc(f)),A=r.i32_const(e.alloc(f)),v=r.i32_const(e.alloc(f)),w=r.i32_const(e.alloc(f)),_=r.i32_const(e.alloc(f)),I=r.i32_const(e.alloc(f)),E=r.i32_const(e.alloc(f)),C=r.i32_const(e.alloc(f)),M=r.i32_const(e.alloc(f)),B=r.i32_const(e.alloc(f));d.addCode(r.call(c+"_mul",n,o,g),r.call(c+"_mul",i,s,m),r.call(c+"_mul",b,l,y),r.call(c+"_add",n,i,x),r.call(c+"_add",o,s,A),r.call(c+"_add",n,b,v),r.call(c+"_add",o,l,w),r.call(c+"_add",i,b,_),r.call(c+"_add",s,l,I),r.call(c+"_add",g,m,E),r.call(c+"_add",g,y,C),r.call(c+"_add",m,y,M),r.call(c+"_mul",_,I,u),r.call(c+"_sub",u,M,u),r.call(a,u,u),r.call(c+"_add",g,u,u),r.call(c+"_mul",x,A,h),r.call(c+"_sub",h,E,h),r.call(a,y,B),r.call(c+"_add",h,B,h),r.call(c+"_mul",v,w,p),r.call(c+"_sub",p,C,p),r.call(c+"_add",p,m,p))}(),function(){const d=e.addFunction(t+"_square");d.addParam("x","i32"),d.addParam("r","i32");const r=d.getCodeBuilder(),n=r.getLocal("x"),i=r.i32_add(r.getLocal("x"),r.i32_const(f)),b=r.i32_add(r.getLocal("x"),r.i32_const(2*f)),o=r.getLocal("r"),s=r.i32_add(r.getLocal("r"),r.i32_const(f)),l=r.i32_add(r.getLocal("r"),r.i32_const(2*f)),u=r.i32_const(e.alloc(f)),h=r.i32_const(e.alloc(f)),p=r.i32_const(e.alloc(f)),g=r.i32_const(e.alloc(f)),m=r.i32_const(e.alloc(f)),y=r.i32_const(e.alloc(f)),x=r.i32_const(e.alloc(f));d.addCode(r.call(c+"_square",n,u),r.call(c+"_mul",n,i,h),r.call(c+"_add",h,h,p),r.call(c+"_sub",n,i,g),r.call(c+"_add",g,b,g),r.call(c+"_square",g,g),r.call(c+"_mul",i,b,m),r.call(c+"_add",m,m,y),r.call(c+"_square",b,x),r.call(a,y,o),r.call(c+"_add",u,o,o),r.call(a,x,s),r.call(c+"_add",p,s,s),r.call(c+"_add",u,x,l),r.call(c+"_sub",y,l,l),r.call(c+"_add",g,l,l),r.call(c+"_add",p,l,l))}(),function(){const a=e.addFunction(t+"_add");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("y"),o=d.i32_add(d.getLocal("y"),d.i32_const(f)),s=d.i32_add(d.getLocal("y"),d.i32_const(2*f)),l=d.getLocal("r"),u=d.i32_add(d.getLocal("r"),d.i32_const(f)),h=d.i32_add(d.getLocal("r"),d.i32_const(2*f));a.addCode(d.call(c+"_add",r,b,l),d.call(c+"_add",n,o,u),d.call(c+"_add",i,s,h))}(),function(){const a=e.addFunction(t+"_sub");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("y"),o=d.i32_add(d.getLocal("y"),d.i32_const(f)),s=d.i32_add(d.getLocal("y"),d.i32_const(2*f)),l=d.getLocal("r"),u=d.i32_add(d.getLocal("r"),d.i32_const(f)),h=d.i32_add(d.getLocal("r"),d.i32_const(2*f));a.addCode(d.call(c+"_sub",r,b,l),d.call(c+"_sub",n,o,u),d.call(c+"_sub",i,s,h))}(),function(){const a=e.addFunction(t+"_neg");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("r"),o=d.i32_add(d.getLocal("r"),d.i32_const(f)),s=d.i32_add(d.getLocal("r"),d.i32_const(2*f));a.addCode(d.call(c+"_neg",r,b),d.call(c+"_neg",n,o),d.call(c+"_neg",i,s))}(),function(){const a=e.addFunction(t+"_sign");a.addParam("x","i32"),a.addLocal("s","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f));a.addCode(d.setLocal("s",d.call(c+"_sign",i)),d.if(d.getLocal("s"),d.ret(d.getLocal("s"))),d.setLocal("s",d.call(c+"_sign",n)),d.if(d.getLocal("s"),d.ret(d.getLocal("s"))),d.ret(d.call(c+"_sign",r)))}(),function(){const a=e.addFunction(t+"_toMontgomery");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("r"),o=d.i32_add(d.getLocal("r"),d.i32_const(f)),s=d.i32_add(d.getLocal("r"),d.i32_const(2*f));a.addCode(d.call(c+"_toMontgomery",r,b),d.call(c+"_toMontgomery",n,o),d.call(c+"_toMontgomery",i,s))}(),function(){const a=e.addFunction(t+"_fromMontgomery");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("r"),o=d.i32_add(d.getLocal("r"),d.i32_const(f)),s=d.i32_add(d.getLocal("r"),d.i32_const(2*f));a.addCode(d.call(c+"_fromMontgomery",r,b),d.call(c+"_fromMontgomery",n,o),d.call(c+"_fromMontgomery",i,s))}(),function(){const a=e.addFunction(t+"_eq");a.addParam("x","i32"),a.addParam("y","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("y"),o=d.i32_add(d.getLocal("y"),d.i32_const(f)),s=d.i32_add(d.getLocal("y"),d.i32_const(2*f));a.addCode(d.i32_and(d.i32_and(d.call(c+"_eq",r,b),d.call(c+"_eq",n,o)),d.call(c+"_eq",i,s)))}(),function(){const d=e.addFunction(t+"_inverse");d.addParam("x","i32"),d.addParam("r","i32");const r=d.getCodeBuilder(),n=r.getLocal("x"),i=r.i32_add(r.getLocal("x"),r.i32_const(f)),b=r.i32_add(r.getLocal("x"),r.i32_const(2*f)),o=r.getLocal("r"),s=r.i32_add(r.getLocal("r"),r.i32_const(f)),l=r.i32_add(r.getLocal("r"),r.i32_const(2*f)),u=r.i32_const(e.alloc(f)),h=r.i32_const(e.alloc(f)),p=r.i32_const(e.alloc(f)),g=r.i32_const(e.alloc(f)),m=r.i32_const(e.alloc(f)),y=r.i32_const(e.alloc(f)),x=r.i32_const(e.alloc(f)),A=r.i32_const(e.alloc(f)),v=r.i32_const(e.alloc(f)),w=r.i32_const(e.alloc(f)),_=r.i32_const(e.alloc(f));d.addCode(r.call(c+"_square",n,u),r.call(c+"_square",i,h),r.call(c+"_square",b,p),r.call(c+"_mul",n,i,g),r.call(c+"_mul",n,b,m),r.call(c+"_mul",i,b,y),r.call(a,y,x),r.call(c+"_sub",u,x,x),r.call(a,p,A),r.call(c+"_sub",A,g,A),r.call(c+"_sub",h,m,v),r.call(c+"_mul",b,A,w),r.call(c+"_mul",i,v,_),r.call(c+"_add",w,_,w),r.call(a,w,w),r.call(c+"_mul",n,x,_),r.call(c+"_add",_,w,w),r.call(c+"_inverse",w,w),r.call(c+"_mul",w,x,o),r.call(c+"_mul",w,A,s),r.call(c+"_mul",w,v,l))}(),function(){const a=e.addFunction(t+"_timesScalar");a.addParam("x","i32"),a.addParam("scalar","i32"),a.addParam("scalarLen","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("r"),o=d.i32_add(d.getLocal("r"),d.i32_const(f)),s=d.i32_add(d.getLocal("r"),d.i32_const(2*f));a.addCode(d.call(c+"_timesScalar",r,d.getLocal("scalar"),d.getLocal("scalarLen"),b),d.call(c+"_timesScalar",n,d.getLocal("scalar"),d.getLocal("scalarLen"),o),d.call(c+"_timesScalar",i,d.getLocal("scalar"),d.getLocal("scalarLen"),s))}(),function(){const a=e.addFunction(t+"_isNegative");a.addParam("x","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f));a.addCode(d.if(d.call(c+"_isZero",i),d.if(d.call(c+"_isZero",n),d.ret(d.call(c+"_isNegative",r)),d.ret(d.call(c+"_isNegative",n)))),d.ret(d.call(c+"_isNegative",i)))}(),e.exportFunction(t+"_isZero"),e.exportFunction(t+"_isOne"),e.exportFunction(t+"_zero"),e.exportFunction(t+"_one"),e.exportFunction(t+"_copy"),e.exportFunction(t+"_mul"),e.exportFunction(t+"_square"),e.exportFunction(t+"_add"),e.exportFunction(t+"_sub"),e.exportFunction(t+"_neg"),e.exportFunction(t+"_sign"),e.exportFunction(t+"_fromMontgomery"),e.exportFunction(t+"_toMontgomery"),e.exportFunction(t+"_eq"),e.exportFunction(t+"_inverse"),Ae(e,t),xe(e,t+"_exp",3*f,t+"_mul",t+"_square",t+"_copy",t+"_one"),e.exportFunction(t+"_exp"),e.exportFunction(t+"_timesScalar"),e.exportFunction(t+"_batchInverse"),e.exportFunction(t+"_isNegative"),t};const we=function(e,a,t,c,f,d,r,n){const i=e.addFunction(a);i.addParam("base","i32"),i.addParam("scalar","i32"),i.addParam("scalarLength","i32"),i.addParam("r","i32"),i.addLocal("old0","i32"),i.addLocal("nbits","i32"),i.addLocal("i","i32"),i.addLocal("last","i32"),i.addLocal("cur","i32"),i.addLocal("carry","i32"),i.addLocal("p","i32");const b=i.getCodeBuilder(),o=b.i32_const(e.alloc(t));function s(e){return b.i32_and(b.i32_shr_u(b.i32_load(b.i32_add(b.getLocal("scalar"),b.i32_and(b.i32_shr_u(e,b.i32_const(3)),b.i32_const(4294967292)))),b.i32_and(e,b.i32_const(31))),b.i32_const(1))}function l(e){return[...b.i32_store8(b.getLocal("p"),b.i32_const(e)),...b.setLocal("p",b.i32_add(b.getLocal("p"),b.i32_const(1)))]}i.addCode(b.if(b.i32_eqz(b.getLocal("scalarLength")),[...b.call(n,b.getLocal("r")),...b.ret([])]),b.setLocal("nbits",b.i32_shl(b.getLocal("scalarLength"),b.i32_const(3))),b.setLocal("old0",b.i32_load(b.i32_const(0))),b.setLocal("p",b.getLocal("old0")),b.i32_store(b.i32_const(0),b.i32_and(b.i32_add(b.i32_add(b.getLocal("old0"),b.i32_const(32)),b.getLocal("nbits")),b.i32_const(4294967288))),b.setLocal("i",b.i32_const(1)),b.setLocal("last",s(b.i32_const(0))),b.setLocal("carry",b.i32_const(0)),b.block(b.loop(b.br_if(1,b.i32_eq(b.getLocal("i"),b.getLocal("nbits"))),b.setLocal("cur",s(b.getLocal("i"))),b.if(b.getLocal("last"),b.if(b.getLocal("cur"),b.if(b.getLocal("carry"),[...b.setLocal("last",b.i32_const(0)),...b.setLocal("carry",b.i32_const(1)),...l(1)],[...b.setLocal("last",b.i32_const(0)),...b.setLocal("carry",b.i32_const(1)),...l(255)]),b.if(b.getLocal("carry"),[...b.setLocal("last",b.i32_const(0)),...b.setLocal("carry",b.i32_const(1)),...l(255)],[...b.setLocal("last",b.i32_const(0)),...b.setLocal("carry",b.i32_const(0)),...l(1)])),b.if(b.getLocal("cur"),b.if(b.getLocal("carry"),[...b.setLocal("last",b.i32_const(0)),...b.setLocal("carry",b.i32_const(1)),...l(0)],[...b.setLocal("last",b.i32_const(1)),...b.setLocal("carry",b.i32_const(0)),...l(0)]),b.if(b.getLocal("carry"),[...b.setLocal("last",b.i32_const(1)),...b.setLocal("carry",b.i32_const(0)),...l(0)],[...b.setLocal("last",b.i32_const(0)),...b.setLocal("carry",b.i32_const(0)),...l(0)]))),b.setLocal("i",b.i32_add(b.getLocal("i"),b.i32_const(1))),b.br(0))),b.if(b.getLocal("last"),b.if(b.getLocal("carry"),[...l(255),...l(0),...l(1)],[...l(1)]),b.if(b.getLocal("carry"),[...l(0),...l(1)])),b.setLocal("p",b.i32_sub(b.getLocal("p"),b.i32_const(1))),b.call(r,b.getLocal("base"),o),b.call(n,b.getLocal("r")),b.block(b.loop(b.call(f,b.getLocal("r"),b.getLocal("r")),b.setLocal("cur",b.i32_load8_u(b.getLocal("p"))),b.if(b.getLocal("cur"),b.if(b.i32_eq(b.getLocal("cur"),b.i32_const(1)),b.call(c,b.getLocal("r"),o,b.getLocal("r")),b.call(d,b.getLocal("r"),o,b.getLocal("r")))),b.br_if(1,b.i32_eq(b.getLocal("old0"),b.getLocal("p"))),b.setLocal("p",b.i32_sub(b.getLocal("p"),b.i32_const(1))),b.br(0))),b.i32_store(b.i32_const(0),b.getLocal("old0")))},_e=Q,Ie=function(e,a,t,c,f){const d=8*e.modules[a].n64;!function(){const a=e.addFunction(t+"_getChunk");a.addParam("pScalar","i32"),a.addParam("scalarSize","i32"),a.addParam("startBit","i32"),a.addParam("chunkSize","i32"),a.addLocal("bitsToEnd","i32"),a.addLocal("mask","i32"),a.setReturnType("i32");const c=a.getCodeBuilder();a.addCode(c.setLocal("bitsToEnd",c.i32_sub(c.i32_mul(c.getLocal("scalarSize"),c.i32_const(8)),c.getLocal("startBit"))),c.if(c.i32_gt_s(c.getLocal("chunkSize"),c.getLocal("bitsToEnd")),c.setLocal("mask",c.i32_sub(c.i32_shl(c.i32_const(1),c.getLocal("bitsToEnd")),c.i32_const(1))),c.setLocal("mask",c.i32_sub(c.i32_shl(c.i32_const(1),c.getLocal("chunkSize")),c.i32_const(1)))),c.i32_and(c.i32_shr_u(c.i32_load(c.i32_add(c.getLocal("pScalar"),c.i32_shr_u(c.getLocal("startBit"),c.i32_const(3))),0,0),c.i32_and(c.getLocal("startBit"),c.i32_const(7))),c.getLocal("mask")))}(),function(){const c=e.addFunction(t+"_reduceTable");c.addParam("pTable","i32"),c.addParam("p","i32"),c.addLocal("half","i32"),c.addLocal("it1","i32"),c.addLocal("it2","i32"),c.addLocal("pAcc","i32");const f=c.getCodeBuilder();c.addCode(f.if(f.i32_eq(f.getLocal("p"),f.i32_const(1)),f.ret([])),f.setLocal("half",f.i32_shl(f.i32_const(1),f.i32_sub(f.getLocal("p"),f.i32_const(1)))),f.setLocal("it1",f.getLocal("pTable")),f.setLocal("it2",f.i32_add(f.getLocal("pTable"),f.i32_mul(f.getLocal("half"),f.i32_const(d)))),f.setLocal("pAcc",f.i32_sub(f.getLocal("it2"),f.i32_const(d))),f.block(f.loop(f.br_if(1,f.i32_eq(f.getLocal("it1"),f.getLocal("pAcc"))),f.call(a+"_add",f.getLocal("it1"),f.getLocal("it2"),f.getLocal("it1")),f.call(a+"_add",f.getLocal("pAcc"),f.getLocal("it2"),f.getLocal("pAcc")),f.setLocal("it1",f.i32_add(f.getLocal("it1"),f.i32_const(d))),f.setLocal("it2",f.i32_add(f.getLocal("it2"),f.i32_const(d))),f.br(0))),f.call(t+"_reduceTable",f.getLocal("pTable"),f.i32_sub(f.getLocal("p"),f.i32_const(1))),f.setLocal("p",f.i32_sub(f.getLocal("p"),f.i32_const(1))),f.block(f.loop(f.br_if(1,f.i32_eqz(f.getLocal("p"))),f.call(a+"_double",f.getLocal("pAcc"),f.getLocal("pAcc")),f.setLocal("p",f.i32_sub(f.getLocal("p"),f.i32_const(1))),f.br(0))),f.call(a+"_add",f.getLocal("pTable"),f.getLocal("pAcc"),f.getLocal("pTable")))}(),function(){const r=e.addFunction(t+"_chunk");r.addParam("pBases","i32"),r.addParam("pScalars","i32"),r.addParam("scalarSize","i32"),r.addParam("n","i32"),r.addParam("startBit","i32"),r.addParam("chunkSize","i32"),r.addParam("pr","i32"),r.addLocal("nChunks","i32"),r.addLocal("itScalar","i32"),r.addLocal("endScalar","i32"),r.addLocal("itBase","i32"),r.addLocal("i","i32"),r.addLocal("j","i32"),r.addLocal("nTable","i32"),r.addLocal("pTable","i32"),r.addLocal("idx","i32"),r.addLocal("pIdxTable","i32");const n=r.getCodeBuilder();r.addCode(n.if(n.i32_eqz(n.getLocal("n")),[...n.call(a+"_zero",n.getLocal("pr")),...n.ret([])]),n.setLocal("nTable",n.i32_shl(n.i32_const(1),n.getLocal("chunkSize"))),n.setLocal("pTable",n.i32_load(n.i32_const(0))),n.i32_store(n.i32_const(0),n.i32_add(n.getLocal("pTable"),n.i32_mul(n.getLocal("nTable"),n.i32_const(d)))),n.setLocal("j",n.i32_const(0)),n.block(n.loop(n.br_if(1,n.i32_eq(n.getLocal("j"),n.getLocal("nTable"))),n.call(a+"_zero",n.i32_add(n.getLocal("pTable"),n.i32_mul(n.getLocal("j"),n.i32_const(d)))),n.setLocal("j",n.i32_add(n.getLocal("j"),n.i32_const(1))),n.br(0))),n.setLocal("itBase",n.getLocal("pBases")),n.setLocal("itScalar",n.getLocal("pScalars")),n.setLocal("endScalar",n.i32_add(n.getLocal("pScalars"),n.i32_mul(n.getLocal("n"),n.getLocal("scalarSize")))),n.block(n.loop(n.br_if(1,n.i32_eq(n.getLocal("itScalar"),n.getLocal("endScalar"))),n.setLocal("idx",n.call(t+"_getChunk",n.getLocal("itScalar"),n.getLocal("scalarSize"),n.getLocal("startBit"),n.getLocal("chunkSize"))),n.if(n.getLocal("idx"),[...n.setLocal("pIdxTable",n.i32_add(n.getLocal("pTable"),n.i32_mul(n.i32_sub(n.getLocal("idx"),n.i32_const(1)),n.i32_const(d)))),...n.call(c,n.getLocal("pIdxTable"),n.getLocal("itBase"),n.getLocal("pIdxTable"))]),n.setLocal("itScalar",n.i32_add(n.getLocal("itScalar"),n.getLocal("scalarSize"))),n.setLocal("itBase",n.i32_add(n.getLocal("itBase"),n.i32_const(f))),n.br(0))),n.call(t+"_reduceTable",n.getLocal("pTable"),n.getLocal("chunkSize")),n.call(a+"_copy",n.getLocal("pTable"),n.getLocal("pr")),n.i32_store(n.i32_const(0),n.getLocal("pTable")))}(),function(){const c=e.addFunction(t);c.addParam("pBases","i32"),c.addParam("pScalars","i32"),c.addParam("scalarSize","i32"),c.addParam("n","i32"),c.addParam("pr","i32"),c.addLocal("chunkSize","i32"),c.addLocal("nChunks","i32"),c.addLocal("itScalar","i32"),c.addLocal("endScalar","i32"),c.addLocal("itBase","i32"),c.addLocal("itBit","i32"),c.addLocal("i","i32"),c.addLocal("j","i32"),c.addLocal("nTable","i32"),c.addLocal("pTable","i32"),c.addLocal("idx","i32"),c.addLocal("pIdxTable","i32");const f=c.getCodeBuilder(),r=f.i32_const(e.alloc(d)),n=e.alloc([17,17,17,17,17,17,17,17,17,17,16,16,15,14,13,13,12,11,10,9,8,7,7,6,5,4,3,2,1,1,1,1]);c.addCode(f.call(a+"_zero",f.getLocal("pr")),f.if(f.i32_eqz(f.getLocal("n")),f.ret([])),f.setLocal("chunkSize",f.i32_load8_u(f.i32_clz(f.getLocal("n")),n)),f.setLocal("nChunks",f.i32_add(f.i32_div_u(f.i32_sub(f.i32_shl(f.getLocal("scalarSize"),f.i32_const(3)),f.i32_const(1)),f.getLocal("chunkSize")),f.i32_const(1))),f.setLocal("itBit",f.i32_mul(f.i32_sub(f.getLocal("nChunks"),f.i32_const(1)),f.getLocal("chunkSize"))),f.block(f.loop(f.br_if(1,f.i32_lt_s(f.getLocal("itBit"),f.i32_const(0))),f.if(f.i32_eqz(f.call(a+"_isZero",f.getLocal("pr"))),[...f.setLocal("j",f.i32_const(0)),...f.block(f.loop(f.br_if(1,f.i32_eq(f.getLocal("j"),f.getLocal("chunkSize"))),f.call(a+"_double",f.getLocal("pr"),f.getLocal("pr")),f.setLocal("j",f.i32_add(f.getLocal("j"),f.i32_const(1))),f.br(0)))]),f.call(t+"_chunk",f.getLocal("pBases"),f.getLocal("pScalars"),f.getLocal("scalarSize"),f.getLocal("n"),f.getLocal("itBit"),f.getLocal("chunkSize"),r),f.call(a+"_add",f.getLocal("pr"),r,f.getLocal("pr")),f.setLocal("itBit",f.i32_sub(f.getLocal("itBit"),f.getLocal("chunkSize"))),f.br(0))))}(),e.exportFunction(t),e.exportFunction(t+"_chunk")};var Ee=function(e,a,t,c){const f=e.modules[t].n64,d=8*f;return e.modules[a]||(e.modules[a]={n64:3*f},function(){const c=e.addFunction(a+"_isZeroAffine");c.addParam("p1","i32"),c.setReturnType("i32");const f=c.getCodeBuilder();c.addCode(f.i32_and(f.call(t+"_isZero",f.getLocal("p1")),f.call(t+"_isZero",f.i32_add(f.getLocal("p1"),f.i32_const(d)))))}(),function(){const c=e.addFunction(a+"_isZero");c.addParam("p1","i32"),c.setReturnType("i32");const f=c.getCodeBuilder();c.addCode(f.call(t+"_isZero",f.i32_add(f.getLocal("p1"),f.i32_const(2*d))))}(),function(){const c=e.addFunction(a+"_zeroAffine");c.addParam("pr","i32");const f=c.getCodeBuilder();c.addCode(f.call(t+"_zero",f.getLocal("pr"))),c.addCode(f.call(t+"_zero",f.i32_add(f.getLocal("pr"),f.i32_const(d))))}(),function(){const c=e.addFunction(a+"_zero");c.addParam("pr","i32");const f=c.getCodeBuilder();c.addCode(f.call(t+"_zero",f.getLocal("pr"))),c.addCode(f.call(t+"_one",f.i32_add(f.getLocal("pr"),f.i32_const(d)))),c.addCode(f.call(t+"_zero",f.i32_add(f.getLocal("pr"),f.i32_const(2*d))))}(),function(){const t=e.addFunction(a+"_copyAffine");t.addParam("ps","i32"),t.addParam("pd","i32");const c=t.getCodeBuilder();for(let e=0;e<2*f;e++)t.addCode(c.i64_store(c.getLocal("pd"),8*e,c.i64_load(c.getLocal("ps"),8*e)))}(),function(){const t=e.addFunction(a+"_copy");t.addParam("ps","i32"),t.addParam("pd","i32");const c=t.getCodeBuilder();for(let e=0;e<3*f;e++)t.addCode(c.i64_store(c.getLocal("pd"),8*e,c.i64_load(c.getLocal("ps"),8*e)))}(),function(){const c=e.addFunction(a+"_toJacobian");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d)),i=f.getLocal("pr"),b=f.i32_add(f.getLocal("pr"),f.i32_const(d)),o=f.i32_add(f.getLocal("pr"),f.i32_const(2*d));c.addCode(f.if(f.call(a+"_isZeroAffine",f.getLocal("p1")),f.call(a+"_zero",f.getLocal("pr")),[...f.call(t+"_one",o),...f.call(t+"_copy",n,b),...f.call(t+"_copy",r,i)]))}(),function(){const c=e.addFunction(a+"_eqAffine");c.addParam("p1","i32"),c.addParam("p2","i32"),c.setReturnType("i32"),c.addLocal("z1","i32");const f=c.getCodeBuilder();c.addCode(f.ret(f.i32_and(f.call(t+"_eq",f.getLocal("p1"),f.getLocal("p2")),f.call(t+"_eq",f.i32_add(f.getLocal("p1"),f.i32_const(d)),f.i32_add(f.getLocal("p2"),f.i32_const(d))))))}(),function(){const c=e.addFunction(a+"_eqMixed");c.addParam("p1","i32"),c.addParam("p2","i32"),c.setReturnType("i32"),c.addLocal("z1","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d));c.addCode(f.setLocal("z1",f.i32_add(f.getLocal("p1"),f.i32_const(2*d))));const i=f.getLocal("z1"),b=f.getLocal("p2"),o=f.i32_add(f.getLocal("p2"),f.i32_const(d)),s=f.i32_const(e.alloc(d)),l=f.i32_const(e.alloc(d)),u=f.i32_const(e.alloc(d)),h=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZero",f.getLocal("p1")),f.ret(f.call(a+"_isZeroAffine",f.getLocal("p2")))),f.if(f.call(a+"_isZeroAffine",f.getLocal("p2")),f.ret(f.i32_const(0))),f.if(f.call(t+"_isOne",i),f.ret(f.call(a+"_eqAffine",f.getLocal("p1"),f.getLocal("p2")))),f.call(t+"_square",i,s),f.call(t+"_mul",b,s,l),f.call(t+"_mul",i,s,u),f.call(t+"_mul",o,u,h),f.if(f.call(t+"_eq",r,l),f.if(f.call(t+"_eq",n,h),f.ret(f.i32_const(1)))),f.ret(f.i32_const(0)))}(),function(){const c=e.addFunction(a+"_eq");c.addParam("p1","i32"),c.addParam("p2","i32"),c.setReturnType("i32"),c.addLocal("z1","i32"),c.addLocal("z2","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d));c.addCode(f.setLocal("z1",f.i32_add(f.getLocal("p1"),f.i32_const(2*d))));const i=f.getLocal("z1"),b=f.getLocal("p2"),o=f.i32_add(f.getLocal("p2"),f.i32_const(d));c.addCode(f.setLocal("z2",f.i32_add(f.getLocal("p2"),f.i32_const(2*d))));const s=f.getLocal("z2"),l=f.i32_const(e.alloc(d)),u=f.i32_const(e.alloc(d)),h=f.i32_const(e.alloc(d)),p=f.i32_const(e.alloc(d)),g=f.i32_const(e.alloc(d)),m=f.i32_const(e.alloc(d)),y=f.i32_const(e.alloc(d)),x=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZero",f.getLocal("p1")),f.ret(f.call(a+"_isZero",f.getLocal("p2")))),f.if(f.call(a+"_isZero",f.getLocal("p2")),f.ret(f.i32_const(0))),f.if(f.call(t+"_isOne",i),f.ret(f.call(a+"_eqMixed",f.getLocal("p2"),f.getLocal("p1")))),f.if(f.call(t+"_isOne",s),f.ret(f.call(a+"_eqMixed",f.getLocal("p1"),f.getLocal("p2")))),f.call(t+"_square",i,l),f.call(t+"_square",s,u),f.call(t+"_mul",r,u,h),f.call(t+"_mul",b,l,p),f.call(t+"_mul",i,l,g),f.call(t+"_mul",s,u,m),f.call(t+"_mul",n,m,y),f.call(t+"_mul",o,g,x),f.if(f.call(t+"_eq",h,p),f.if(f.call(t+"_eq",y,x),f.ret(f.i32_const(1)))),f.ret(f.i32_const(0)))}(),function(){const c=e.addFunction(a+"_doubleAffine");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d)),i=f.getLocal("pr"),b=f.i32_add(f.getLocal("pr"),f.i32_const(d)),o=f.i32_add(f.getLocal("pr"),f.i32_const(2*d)),s=f.i32_const(e.alloc(d)),l=f.i32_const(e.alloc(d)),u=f.i32_const(e.alloc(d)),h=f.i32_const(e.alloc(d)),p=f.i32_const(e.alloc(d)),g=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZeroAffine",f.getLocal("p1")),[...f.call(a+"_toJacobian",f.getLocal("p1"),f.getLocal("pr")),...f.ret([])]),f.call(t+"_square",r,s),f.call(t+"_square",n,l),f.call(t+"_square",l,u),f.call(t+"_add",r,l,h),f.call(t+"_square",h,h),f.call(t+"_sub",h,s,h),f.call(t+"_sub",h,u,h),f.call(t+"_add",h,h,h),f.call(t+"_add",s,s,p),f.call(t+"_add",p,s,p),f.call(t+"_add",n,n,o),f.call(t+"_square",p,i),f.call(t+"_sub",i,h,i),f.call(t+"_sub",i,h,i),f.call(t+"_add",u,u,g),f.call(t+"_add",g,g,g),f.call(t+"_add",g,g,g),f.call(t+"_sub",h,i,b),f.call(t+"_mul",b,p,b),f.call(t+"_sub",b,g,b))}(),function(){const c=e.addFunction(a+"_double");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d)),i=f.i32_add(f.getLocal("p1"),f.i32_const(2*d)),b=f.getLocal("pr"),o=f.i32_add(f.getLocal("pr"),f.i32_const(d)),s=f.i32_add(f.getLocal("pr"),f.i32_const(2*d)),l=f.i32_const(e.alloc(d)),u=f.i32_const(e.alloc(d)),h=f.i32_const(e.alloc(d)),p=f.i32_const(e.alloc(d)),g=f.i32_const(e.alloc(d)),m=f.i32_const(e.alloc(d)),y=f.i32_const(e.alloc(d)),x=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZero",f.getLocal("p1")),[...f.call(a+"_copy",f.getLocal("p1"),f.getLocal("pr")),...f.ret([])]),f.if(f.call(t+"_isOne",i),[...f.ret(f.call(a+"_doubleAffine",f.getLocal("p1"),f.getLocal("pr"))),...f.ret([])]),f.call(t+"_square",r,l),f.call(t+"_square",n,u),f.call(t+"_square",u,h),f.call(t+"_add",r,u,p),f.call(t+"_square",p,p),f.call(t+"_sub",p,l,p),f.call(t+"_sub",p,h,p),f.call(t+"_add",p,p,p),f.call(t+"_add",l,l,g),f.call(t+"_add",g,l,g),f.call(t+"_square",g,m),f.call(t+"_mul",n,i,y),f.call(t+"_add",p,p,b),f.call(t+"_sub",m,b,b),f.call(t+"_add",h,h,x),f.call(t+"_add",x,x,x),f.call(t+"_add",x,x,x),f.call(t+"_sub",p,b,o),f.call(t+"_mul",o,g,o),f.call(t+"_sub",o,x,o),f.call(t+"_add",y,y,s))}(),function(){const c=e.addFunction(a+"_addAffine");c.addParam("p1","i32"),c.addParam("p2","i32"),c.addParam("pr","i32"),c.addLocal("z1","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d));c.addCode(f.setLocal("z1",f.i32_add(f.getLocal("p1"),f.i32_const(2*d))));const i=f.getLocal("p2"),b=f.i32_add(f.getLocal("p2"),f.i32_const(d)),o=f.getLocal("pr"),s=f.i32_add(f.getLocal("pr"),f.i32_const(d)),l=f.i32_add(f.getLocal("pr"),f.i32_const(2*d)),u=f.i32_const(e.alloc(d)),h=f.i32_const(e.alloc(d)),p=f.i32_const(e.alloc(d)),g=f.i32_const(e.alloc(d)),m=f.i32_const(e.alloc(d)),y=f.i32_const(e.alloc(d)),x=f.i32_const(e.alloc(d)),A=f.i32_const(e.alloc(d)),v=f.i32_const(e.alloc(d)),w=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZeroAffine",f.getLocal("p1")),[...f.call(a+"_copyAffine",f.getLocal("p2"),f.getLocal("pr")),...f.call(t+"_one",f.i32_add(f.getLocal("pr"),f.i32_const(2*d))),...f.ret([])]),f.if(f.call(a+"_isZeroAffine",f.getLocal("p2")),[...f.call(a+"_copyAffine",f.getLocal("p1"),f.getLocal("pr")),...f.call(t+"_one",f.i32_add(f.getLocal("pr"),f.i32_const(2*d))),...f.ret([])]),f.if(f.call(t+"_eq",r,i),f.if(f.call(t+"_eq",n,b),[...f.call(a+"_doubleAffine",f.getLocal("p2"),f.getLocal("pr")),...f.ret([])])),f.call(t+"_sub",i,r,u),f.call(t+"_sub",b,n,p),f.call(t+"_square",u,h),f.call(t+"_add",h,h,g),f.call(t+"_add",g,g,g),f.call(t+"_mul",u,g,m),f.call(t+"_add",p,p,y),f.call(t+"_mul",r,g,A),f.call(t+"_square",y,x),f.call(t+"_add",A,A,v),f.call(t+"_sub",x,m,o),f.call(t+"_sub",o,v,o),f.call(t+"_mul",n,m,w),f.call(t+"_add",w,w,w),f.call(t+"_sub",A,o,s),f.call(t+"_mul",s,y,s),f.call(t+"_sub",s,w,s),f.call(t+"_add",u,u,l))}(),function(){const c=e.addFunction(a+"_addMixed");c.addParam("p1","i32"),c.addParam("p2","i32"),c.addParam("pr","i32"),c.addLocal("z1","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d));c.addCode(f.setLocal("z1",f.i32_add(f.getLocal("p1"),f.i32_const(2*d))));const i=f.getLocal("z1"),b=f.getLocal("p2"),o=f.i32_add(f.getLocal("p2"),f.i32_const(d)),s=f.getLocal("pr"),l=f.i32_add(f.getLocal("pr"),f.i32_const(d)),u=f.i32_add(f.getLocal("pr"),f.i32_const(2*d)),h=f.i32_const(e.alloc(d)),p=f.i32_const(e.alloc(d)),g=f.i32_const(e.alloc(d)),m=f.i32_const(e.alloc(d)),y=f.i32_const(e.alloc(d)),x=f.i32_const(e.alloc(d)),A=f.i32_const(e.alloc(d)),v=f.i32_const(e.alloc(d)),w=f.i32_const(e.alloc(d)),_=f.i32_const(e.alloc(d)),I=f.i32_const(e.alloc(d)),E=f.i32_const(e.alloc(d)),C=f.i32_const(e.alloc(d)),M=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZero",f.getLocal("p1")),[...f.call(a+"_copyAffine",f.getLocal("p2"),f.getLocal("pr")),...f.call(t+"_one",f.i32_add(f.getLocal("pr"),f.i32_const(2*d))),...f.ret([])]),f.if(f.call(a+"_isZeroAffine",f.getLocal("p2")),[...f.call(a+"_copy",f.getLocal("p1"),f.getLocal("pr")),...f.ret([])]),f.if(f.call(t+"_isOne",i),[...f.call(a+"_addAffine",r,b,s),...f.ret([])]),f.call(t+"_square",i,h),f.call(t+"_mul",b,h,p),f.call(t+"_mul",i,h,g),f.call(t+"_mul",o,g,m),f.if(f.call(t+"_eq",r,p),f.if(f.call(t+"_eq",n,m),[...f.call(a+"_doubleAffine",f.getLocal("p2"),f.getLocal("pr")),...f.ret([])])),f.call(t+"_sub",p,r,y),f.call(t+"_sub",m,n,A),f.call(t+"_square",y,x),f.call(t+"_add",x,x,v),f.call(t+"_add",v,v,v),f.call(t+"_mul",y,v,w),f.call(t+"_add",A,A,_),f.call(t+"_mul",r,v,E),f.call(t+"_square",_,I),f.call(t+"_add",E,E,C),f.call(t+"_sub",I,w,s),f.call(t+"_sub",s,C,s),f.call(t+"_mul",n,w,M),f.call(t+"_add",M,M,M),f.call(t+"_sub",E,s,l),f.call(t+"_mul",l,_,l),f.call(t+"_sub",l,M,l),f.call(t+"_add",i,y,u),f.call(t+"_square",u,u),f.call(t+"_sub",u,h,u),f.call(t+"_sub",u,x,u))}(),function(){const c=e.addFunction(a+"_add");c.addParam("p1","i32"),c.addParam("p2","i32"),c.addParam("pr","i32"),c.addLocal("z1","i32"),c.addLocal("z2","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d));c.addCode(f.setLocal("z1",f.i32_add(f.getLocal("p1"),f.i32_const(2*d))));const i=f.getLocal("z1"),b=f.getLocal("p2"),o=f.i32_add(f.getLocal("p2"),f.i32_const(d));c.addCode(f.setLocal("z2",f.i32_add(f.getLocal("p2"),f.i32_const(2*d))));const s=f.getLocal("z2"),l=f.getLocal("pr"),u=f.i32_add(f.getLocal("pr"),f.i32_const(d)),h=f.i32_add(f.getLocal("pr"),f.i32_const(2*d)),p=f.i32_const(e.alloc(d)),g=f.i32_const(e.alloc(d)),m=f.i32_const(e.alloc(d)),y=f.i32_const(e.alloc(d)),x=f.i32_const(e.alloc(d)),A=f.i32_const(e.alloc(d)),v=f.i32_const(e.alloc(d)),w=f.i32_const(e.alloc(d)),_=f.i32_const(e.alloc(d)),I=f.i32_const(e.alloc(d)),E=f.i32_const(e.alloc(d)),C=f.i32_const(e.alloc(d)),M=f.i32_const(e.alloc(d)),B=f.i32_const(e.alloc(d)),k=f.i32_const(e.alloc(d)),L=f.i32_const(e.alloc(d)),S=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZero",f.getLocal("p1")),[...f.call(a+"_copy",f.getLocal("p2"),f.getLocal("pr")),...f.ret([])]),f.if(f.call(a+"_isZero",f.getLocal("p2")),[...f.call(a+"_copy",f.getLocal("p1"),f.getLocal("pr")),...f.ret([])]),f.if(f.call(t+"_isOne",i),[...f.call(a+"_addMixed",b,r,l),...f.ret([])]),f.if(f.call(t+"_isOne",s),[...f.call(a+"_addMixed",r,b,l),...f.ret([])]),f.call(t+"_square",i,p),f.call(t+"_square",s,g),f.call(t+"_mul",r,g,m),f.call(t+"_mul",b,p,y),f.call(t+"_mul",i,p,x),f.call(t+"_mul",s,g,A),f.call(t+"_mul",n,A,v),f.call(t+"_mul",o,x,w),f.if(f.call(t+"_eq",m,y),f.if(f.call(t+"_eq",v,w),[...f.call(a+"_double",f.getLocal("p1"),f.getLocal("pr")),...f.ret([])])),f.call(t+"_sub",y,m,_),f.call(t+"_sub",w,v,I),f.call(t+"_add",_,_,E),f.call(t+"_square",E,E),f.call(t+"_mul",_,E,C),f.call(t+"_add",I,I,M),f.call(t+"_mul",m,E,k),f.call(t+"_square",M,B),f.call(t+"_add",k,k,L),f.call(t+"_sub",B,C,l),f.call(t+"_sub",l,L,l),f.call(t+"_mul",v,C,S),f.call(t+"_add",S,S,S),f.call(t+"_sub",k,l,u),f.call(t+"_mul",u,M,u),f.call(t+"_sub",u,S,u),f.call(t+"_add",i,s,h),f.call(t+"_square",h,h),f.call(t+"_sub",h,p,h),f.call(t+"_sub",h,g,h),f.call(t+"_mul",h,_,h))}(),function(){const c=e.addFunction(a+"_negAffine");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d)),i=f.getLocal("pr"),b=f.i32_add(f.getLocal("pr"),f.i32_const(d));c.addCode(f.call(t+"_copy",r,i),f.call(t+"_neg",n,b))}(),function(){const c=e.addFunction(a+"_neg");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d)),i=f.i32_add(f.getLocal("p1"),f.i32_const(2*d)),b=f.getLocal("pr"),o=f.i32_add(f.getLocal("pr"),f.i32_const(d)),s=f.i32_add(f.getLocal("pr"),f.i32_const(2*d));c.addCode(f.call(t+"_copy",r,b),f.call(t+"_neg",n,o),f.call(t+"_copy",i,s))}(),function(){const t=e.addFunction(a+"_subAffine");t.addParam("p1","i32"),t.addParam("p2","i32"),t.addParam("pr","i32");const c=t.getCodeBuilder(),f=c.i32_const(e.alloc(3*d));t.addCode(c.call(a+"_negAffine",c.getLocal("p2"),f),c.call(a+"_addAffine",c.getLocal("p1"),f,c.getLocal("pr")))}(),function(){const t=e.addFunction(a+"_subMixed");t.addParam("p1","i32"),t.addParam("p2","i32"),t.addParam("pr","i32");const c=t.getCodeBuilder(),f=c.i32_const(e.alloc(3*d));t.addCode(c.call(a+"_negAffine",c.getLocal("p2"),f),c.call(a+"_addMixed",c.getLocal("p1"),f,c.getLocal("pr")))}(),function(){const t=e.addFunction(a+"_sub");t.addParam("p1","i32"),t.addParam("p2","i32"),t.addParam("pr","i32");const c=t.getCodeBuilder(),f=c.i32_const(e.alloc(3*d));t.addCode(c.call(a+"_neg",c.getLocal("p2"),f),c.call(a+"_add",c.getLocal("p1"),f,c.getLocal("pr")))}(),function(){const c=e.addFunction(a+"_fromMontgomeryAffine");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder();c.addCode(f.call(t+"_fromMontgomery",f.getLocal("p1"),f.getLocal("pr")));for(let e=1;e<2;e++)c.addCode(f.call(t+"_fromMontgomery",f.i32_add(f.getLocal("p1"),f.i32_const(e*d)),f.i32_add(f.getLocal("pr"),f.i32_const(e*d))))}(),function(){const c=e.addFunction(a+"_fromMontgomery");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder();c.addCode(f.call(t+"_fromMontgomery",f.getLocal("p1"),f.getLocal("pr")));for(let e=1;e<3;e++)c.addCode(f.call(t+"_fromMontgomery",f.i32_add(f.getLocal("p1"),f.i32_const(e*d)),f.i32_add(f.getLocal("pr"),f.i32_const(e*d))))}(),function(){const c=e.addFunction(a+"_toMontgomeryAffine");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder();c.addCode(f.call(t+"_toMontgomery",f.getLocal("p1"),f.getLocal("pr")));for(let e=1;e<2;e++)c.addCode(f.call(t+"_toMontgomery",f.i32_add(f.getLocal("p1"),f.i32_const(e*d)),f.i32_add(f.getLocal("pr"),f.i32_const(e*d))))}(),function(){const c=e.addFunction(a+"_toMontgomery");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder();c.addCode(f.call(t+"_toMontgomery",f.getLocal("p1"),f.getLocal("pr")));for(let e=1;e<3;e++)c.addCode(f.call(t+"_toMontgomery",f.i32_add(f.getLocal("p1"),f.i32_const(e*d)),f.i32_add(f.getLocal("pr"),f.i32_const(e*d))))}(),function(){const c=e.addFunction(a+"_toAffine");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d)),i=f.i32_add(f.getLocal("p1"),f.i32_const(2*d)),b=f.getLocal("pr"),o=f.i32_add(f.getLocal("pr"),f.i32_const(d)),s=f.i32_const(e.alloc(d)),l=f.i32_const(e.alloc(d)),u=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZero",f.getLocal("p1")),[...f.call(t+"_zero",b),...f.call(t+"_zero",o)],[...f.call(t+"_inverse",i,s),...f.call(t+"_square",s,l),...f.call(t+"_mul",s,l,u),...f.call(t+"_mul",r,l,b),...f.call(t+"_mul",n,u,o)]))}(),function(){const f=e.addFunction(a+"_inCurveAffine");f.addParam("pIn","i32"),f.setReturnType("i32");const r=f.getCodeBuilder(),n=r.getLocal("pIn"),i=r.i32_add(r.getLocal("pIn"),r.i32_const(d)),b=r.i32_const(e.alloc(d)),o=r.i32_const(e.alloc(d));f.addCode(r.call(t+"_square",i,b),r.call(t+"_square",n,o),r.call(t+"_mul",n,o,o),r.call(t+"_add",o,r.i32_const(c),o),r.ret(r.call(t+"_eq",b,o)))}(),function(){const t=e.addFunction(a+"_inCurve");t.addParam("pIn","i32"),t.setReturnType("i32");const c=t.getCodeBuilder(),f=c.i32_const(e.alloc(2*d));t.addCode(c.call(a+"_toAffine",c.getLocal("pIn"),f),c.ret(c.call(a+"_inCurveAffine",f)))}(),function(){const c=e.addFunction(a+"_batchToAffine");c.addParam("pIn","i32"),c.addParam("n","i32"),c.addParam("pOut","i32"),c.addLocal("pAux","i32"),c.addLocal("itIn","i32"),c.addLocal("itAux","i32"),c.addLocal("itOut","i32"),c.addLocal("i","i32");const f=c.getCodeBuilder(),r=f.i32_const(e.alloc(d));c.addCode(f.setLocal("pAux",f.i32_load(f.i32_const(0))),f.i32_store(f.i32_const(0),f.i32_add(f.getLocal("pAux"),f.i32_mul(f.getLocal("n"),f.i32_const(d)))),f.call(t+"_batchInverse",f.i32_add(f.getLocal("pIn"),f.i32_const(2*d)),f.i32_const(3*d),f.getLocal("n"),f.getLocal("pAux"),f.i32_const(d)),f.setLocal("itIn",f.getLocal("pIn")),f.setLocal("itAux",f.getLocal("pAux")),f.setLocal("itOut",f.getLocal("pOut")),f.setLocal("i",f.i32_const(0)),f.block(f.loop(f.br_if(1,f.i32_eq(f.getLocal("i"),f.getLocal("n"))),f.if(f.call(t+"_isZero",f.getLocal("itAux")),[...f.call(t+"_zero",f.getLocal("itOut")),...f.call(t+"_zero",f.i32_add(f.getLocal("itOut"),f.i32_const(d)))],[...f.call(t+"_mul",f.getLocal("itAux"),f.i32_add(f.getLocal("itIn"),f.i32_const(d)),r),...f.call(t+"_square",f.getLocal("itAux"),f.getLocal("itAux")),...f.call(t+"_mul",f.getLocal("itAux"),f.getLocal("itIn"),f.getLocal("itOut")),...f.call(t+"_mul",f.getLocal("itAux"),r,f.i32_add(f.getLocal("itOut"),f.i32_const(d)))]),f.setLocal("itIn",f.i32_add(f.getLocal("itIn"),f.i32_const(3*d))),f.setLocal("itOut",f.i32_add(f.getLocal("itOut"),f.i32_const(2*d))),f.setLocal("itAux",f.i32_add(f.getLocal("itAux"),f.i32_const(d))),f.setLocal("i",f.i32_add(f.getLocal("i"),f.i32_const(1))),f.br(0))),f.i32_store(f.i32_const(0),f.getLocal("pAux")))}(),function(){const c=e.addFunction(a+"_normalize");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d)),i=f.i32_add(f.getLocal("p1"),f.i32_const(2*d)),b=f.getLocal("pr"),o=f.i32_add(f.getLocal("pr"),f.i32_const(d)),s=f.i32_add(f.getLocal("pr"),f.i32_const(2*d)),l=f.i32_const(e.alloc(d)),u=f.i32_const(e.alloc(d)),h=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZero",f.getLocal("p1")),f.call(a+"_zero",f.getLocal("pr")),[...f.call(t+"_inverse",i,l),...f.call(t+"_square",l,u),...f.call(t+"_mul",l,u,h),...f.call(t+"_mul",r,u,b),...f.call(t+"_mul",n,h,o),...f.call(t+"_one",s)]))}(),function(){const t=e.addFunction(a+"__reverseBytes");t.addParam("pIn","i32"),t.addParam("n","i32"),t.addParam("pOut","i32"),t.addLocal("itOut","i32"),t.addLocal("itIn","i32");const c=t.getCodeBuilder();t.addCode(c.setLocal("itOut",c.i32_sub(c.i32_add(c.getLocal("pOut"),c.getLocal("n")),c.i32_const(1))),c.setLocal("itIn",c.getLocal("pIn")),c.block(c.loop(c.br_if(1,c.i32_lt_s(c.getLocal("itOut"),c.getLocal("pOut"))),c.i32_store8(c.getLocal("itOut"),c.i32_load8_u(c.getLocal("itIn"))),c.setLocal("itOut",c.i32_sub(c.getLocal("itOut"),c.i32_const(1))),c.setLocal("itIn",c.i32_add(c.getLocal("itIn"),c.i32_const(1))),c.br(0))))}(),function(){const t=e.addFunction(a+"_LEMtoU");t.addParam("pIn","i32"),t.addParam("pOut","i32");const c=t.getCodeBuilder(),f=e.alloc(2*d),r=c.i32_const(f),n=c.i32_const(f),i=c.i32_const(f+d);t.addCode(c.if(c.call(a+"_isZeroAffine",c.getLocal("pIn")),[...c.call(a+"_zeroAffine",c.getLocal("pOut")),...c.ret([])]),c.call(a+"_fromMontgomeryAffine",c.getLocal("pIn"),r),c.call(a+"__reverseBytes",n,c.i32_const(d),c.getLocal("pOut")),c.call(a+"__reverseBytes",i,c.i32_const(d),c.i32_add(c.getLocal("pOut"),c.i32_const(d))))}(),function(){const c=e.addFunction(a+"_LEMtoC");c.addParam("pIn","i32"),c.addParam("pOut","i32");const f=c.getCodeBuilder(),r=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZeroAffine",f.getLocal("pIn")),[...f.call(t+"_zero",f.getLocal("pOut")),...f.i32_store8(f.getLocal("pOut"),f.i32_const(64)),...f.ret([])]),f.call(t+"_fromMontgomery",f.getLocal("pIn"),r),f.call(a+"__reverseBytes",r,f.i32_const(d),f.getLocal("pOut")),f.if(f.i32_eq(f.call(t+"_sign",f.i32_add(f.getLocal("pIn"),f.i32_const(d))),f.i32_const(-1)),f.i32_store8(f.getLocal("pOut"),f.i32_or(f.i32_load8_u(f.getLocal("pOut")),f.i32_const(128)))))}(),function(){const t=e.addFunction(a+"_UtoLEM");t.addParam("pIn","i32"),t.addParam("pOut","i32");const c=t.getCodeBuilder(),f=e.alloc(2*d),r=c.i32_const(f),n=c.i32_const(f),i=c.i32_const(f+d);t.addCode(c.if(c.i32_and(c.i32_load8_u(c.getLocal("pIn")),c.i32_const(64)),[...c.call(a+"_zeroAffine",c.getLocal("pOut")),...c.ret([])]),c.call(a+"__reverseBytes",c.getLocal("pIn"),c.i32_const(d),n),c.call(a+"__reverseBytes",c.i32_add(c.getLocal("pIn"),c.i32_const(d)),c.i32_const(d),i),c.call(a+"_toMontgomeryAffine",r,c.getLocal("pOut")))}(),function(){const f=e.addFunction(a+"_CtoLEM");f.addParam("pIn","i32"),f.addParam("pOut","i32"),f.addLocal("firstByte","i32"),f.addLocal("greatest","i32");const r=f.getCodeBuilder(),n=e.alloc(2*d),i=r.i32_const(n),b=r.i32_const(n+d);f.addCode(r.setLocal("firstByte",r.i32_load8_u(r.getLocal("pIn"))),r.if(r.i32_and(r.getLocal("firstByte"),r.i32_const(64)),[...r.call(a+"_zeroAffine",r.getLocal("pOut")),...r.ret([])]),r.setLocal("greatest",r.i32_and(r.getLocal("firstByte"),r.i32_const(128))),r.call(t+"_copy",r.getLocal("pIn"),b),r.i32_store8(b,r.i32_and(r.getLocal("firstByte"),r.i32_const(63))),r.call(a+"__reverseBytes",b,r.i32_const(d),i),r.call(t+"_toMontgomery",i,r.getLocal("pOut")),r.call(t+"_square",r.getLocal("pOut"),b),r.call(t+"_mul",r.getLocal("pOut"),b,b),r.call(t+"_add",b,r.i32_const(c),b),r.call(t+"_sqrt",b,b),r.call(t+"_neg",b,i),r.if(r.i32_eq(r.call(t+"_sign",b),r.i32_const(-1)),r.if(r.getLocal("greatest"),r.call(t+"_copy",b,r.i32_add(r.getLocal("pOut"),r.i32_const(d))),r.call(t+"_neg",b,r.i32_add(r.getLocal("pOut"),r.i32_const(d)))),r.if(r.getLocal("greatest"),r.call(t+"_neg",b,r.i32_add(r.getLocal("pOut"),r.i32_const(d))),r.call(t+"_copy",b,r.i32_add(r.getLocal("pOut"),r.i32_const(d))))))}(),_e(e,a+"_batchLEMtoU",a+"_LEMtoU",2*d,2*d),_e(e,a+"_batchLEMtoC",a+"_LEMtoC",2*d,d),_e(e,a+"_batchUtoLEM",a+"_UtoLEM",2*d,2*d),_e(e,a+"_batchCtoLEM",a+"_CtoLEM",d,2*d,!0),_e(e,a+"_batchToJacobian",a+"_toJacobian",2*d,3*d,!0),Ie(e,a,a+"_multiexp",a+"_add",3*d),Ie(e,a,a+"_multiexpAffine",a+"_addMixed",2*d),we(e,a+"_timesScalar",3*d,a+"_add",a+"_double",a+"_sub",a+"_copy",a+"_zero"),we(e,a+"_timesScalarAffine",2*d,a+"_addMixed",a+"_double",a+"_subMixed",a+"_copyAffine",a+"_zero"),e.exportFunction(a+"_isZero"),e.exportFunction(a+"_isZeroAffine"),e.exportFunction(a+"_eq"),e.exportFunction(a+"_eqMixed"),e.exportFunction(a+"_eqAffine"),e.exportFunction(a+"_copy"),e.exportFunction(a+"_copyAffine"),e.exportFunction(a+"_zero"),e.exportFunction(a+"_zeroAffine"),e.exportFunction(a+"_double"),e.exportFunction(a+"_doubleAffine"),e.exportFunction(a+"_add"),e.exportFunction(a+"_addMixed"),e.exportFunction(a+"_addAffine"),e.exportFunction(a+"_neg"),e.exportFunction(a+"_negAffine"),e.exportFunction(a+"_sub"),e.exportFunction(a+"_subMixed"),e.exportFunction(a+"_subAffine"),e.exportFunction(a+"_fromMontgomery"),e.exportFunction(a+"_fromMontgomeryAffine"),e.exportFunction(a+"_toMontgomery"),e.exportFunction(a+"_toMontgomeryAffine"),e.exportFunction(a+"_timesScalar"),e.exportFunction(a+"_timesScalarAffine"),e.exportFunction(a+"_normalize"),e.exportFunction(a+"_LEMtoU"),e.exportFunction(a+"_LEMtoC"),e.exportFunction(a+"_UtoLEM"),e.exportFunction(a+"_CtoLEM"),e.exportFunction(a+"_batchLEMtoU"),e.exportFunction(a+"_batchLEMtoC"),e.exportFunction(a+"_batchUtoLEM"),e.exportFunction(a+"_batchCtoLEM"),e.exportFunction(a+"_toAffine"),e.exportFunction(a+"_toJacobian"),e.exportFunction(a+"_batchToAffine"),e.exportFunction(a+"_batchToJacobian"),e.exportFunction(a+"_inCurve"),e.exportFunction(a+"_inCurveAffine")),a};const{isOdd:Ce,modInv:Me,modPow:Be}=U,ke=D;var Le=function(e,a,t,c,f){const d=8*e.modules[c].n64,r=8*e.modules[t].n64,n=e.modules[c].q;let i=n-1n,b=0;for(;!Ce(i);)b++,i>>=1n;let o=2n;for(;1n===Be(o,n>>1n,n);)o+=1n;const s=new Array(b+1);s[b]=Be(o,i,n);let l=b-1;for(;l>=0;)s[l]=Be(s[l+1],2n,n),l--;const u=[],h=(1n<>t);return a}const E=Array(256);for(let e=0;e<256;e++)E[e]=I(e);const C=e.alloc(E);!function(){const t=e.addFunction(a+"__rev");t.addParam("x","i32"),t.addParam("bits","i32"),t.setReturnType("i32");const c=t.getCodeBuilder();t.addCode(c.i32_rotl(c.i32_add(c.i32_add(c.i32_shl(c.i32_load8_u(c.i32_and(c.getLocal("x"),c.i32_const(255)),C,0),c.i32_const(24)),c.i32_shl(c.i32_load8_u(c.i32_and(c.i32_shr_u(c.getLocal("x"),c.i32_const(8)),c.i32_const(255)),C,0),c.i32_const(16))),c.i32_add(c.i32_shl(c.i32_load8_u(c.i32_and(c.i32_shr_u(c.getLocal("x"),c.i32_const(16)),c.i32_const(255)),C,0),c.i32_const(8)),c.i32_load8_u(c.i32_and(c.i32_shr_u(c.getLocal("x"),c.i32_const(24)),c.i32_const(255)),C,0))),c.getLocal("bits")))}(),function(){const c=e.addFunction(a+"__reversePermutation");c.addParam("px","i32"),c.addParam("bits","i32"),c.addLocal("n","i32"),c.addLocal("i","i32"),c.addLocal("ri","i32"),c.addLocal("idx1","i32"),c.addLocal("idx2","i32");const f=c.getCodeBuilder(),d=f.i32_const(e.alloc(r));c.addCode(f.setLocal("n",f.i32_shl(f.i32_const(1),f.getLocal("bits"))),f.setLocal("i",f.i32_const(0)),f.block(f.loop(f.br_if(1,f.i32_eq(f.getLocal("i"),f.getLocal("n"))),f.setLocal("idx1",f.i32_add(f.getLocal("px"),f.i32_mul(f.getLocal("i"),f.i32_const(r)))),f.setLocal("ri",f.call(a+"__rev",f.getLocal("i"),f.getLocal("bits"))),f.setLocal("idx2",f.i32_add(f.getLocal("px"),f.i32_mul(f.getLocal("ri"),f.i32_const(r)))),f.if(f.i32_lt_u(f.getLocal("i"),f.getLocal("ri")),[...f.call(t+"_copy",f.getLocal("idx1"),d),...f.call(t+"_copy",f.getLocal("idx2"),f.getLocal("idx1")),...f.call(t+"_copy",d,f.getLocal("idx2"))]),f.setLocal("i",f.i32_add(f.getLocal("i"),f.i32_const(1))),f.br(0))))}(),function(){const d=e.addFunction(a+"__fftFinal");d.addParam("px","i32"),d.addParam("bits","i32"),d.addParam("reverse","i32"),d.addParam("mulFactor","i32"),d.addLocal("n","i32"),d.addLocal("ndiv2","i32"),d.addLocal("pInv2","i32"),d.addLocal("i","i32"),d.addLocal("mask","i32"),d.addLocal("idx1","i32"),d.addLocal("idx2","i32");const n=d.getCodeBuilder(),i=n.i32_const(e.alloc(r));d.addCode(n.if(n.i32_and(n.i32_eqz(n.getLocal("reverse")),n.call(c+"_isOne",n.getLocal("mulFactor"))),n.ret([])),n.setLocal("n",n.i32_shl(n.i32_const(1),n.getLocal("bits"))),n.setLocal("mask",n.i32_sub(n.getLocal("n"),n.i32_const(1))),n.setLocal("i",n.i32_const(1)),n.setLocal("ndiv2",n.i32_shr_u(n.getLocal("n"),n.i32_const(1))),n.block(n.loop(n.br_if(1,n.i32_ge_u(n.getLocal("i"),n.getLocal("ndiv2"))),n.setLocal("idx1",n.i32_add(n.getLocal("px"),n.i32_mul(n.getLocal("i"),n.i32_const(r)))),n.setLocal("idx2",n.i32_add(n.getLocal("px"),n.i32_mul(n.i32_sub(n.getLocal("n"),n.getLocal("i")),n.i32_const(r)))),n.if(n.getLocal("reverse"),n.if(n.call(c+"_isOne",n.getLocal("mulFactor")),[...n.call(t+"_copy",n.getLocal("idx1"),i),...n.call(t+"_copy",n.getLocal("idx2"),n.getLocal("idx1")),...n.call(t+"_copy",i,n.getLocal("idx2"))],[...n.call(t+"_copy",n.getLocal("idx1"),i),...n.call(f,n.getLocal("idx2"),n.getLocal("mulFactor"),n.getLocal("idx1")),...n.call(f,i,n.getLocal("mulFactor"),n.getLocal("idx2"))]),n.if(n.call(c+"_isOne",n.getLocal("mulFactor")),[],[...n.call(f,n.getLocal("idx1"),n.getLocal("mulFactor"),n.getLocal("idx1")),...n.call(f,n.getLocal("idx2"),n.getLocal("mulFactor"),n.getLocal("idx2"))])),n.setLocal("i",n.i32_add(n.getLocal("i"),n.i32_const(1))),n.br(0))),n.if(n.call(c+"_isOne",n.getLocal("mulFactor")),[],[...n.call(f,n.getLocal("px"),n.getLocal("mulFactor"),n.getLocal("px")),...n.setLocal("idx2",n.i32_add(n.getLocal("px"),n.i32_mul(n.getLocal("ndiv2"),n.i32_const(r)))),...n.call(f,n.getLocal("idx2"),n.getLocal("mulFactor"),n.getLocal("idx2"))]))}(),function(){const n=e.addFunction(a+"_rawfft");n.addParam("px","i32"),n.addParam("bits","i32"),n.addParam("reverse","i32"),n.addParam("mulFactor","i32"),n.addLocal("s","i32"),n.addLocal("k","i32"),n.addLocal("j","i32"),n.addLocal("m","i32"),n.addLocal("mdiv2","i32"),n.addLocal("n","i32"),n.addLocal("pwm","i32"),n.addLocal("idx1","i32"),n.addLocal("idx2","i32");const i=n.getCodeBuilder(),b=i.i32_const(e.alloc(d)),o=i.i32_const(e.alloc(r)),s=i.i32_const(e.alloc(r));n.addCode(i.call(a+"__reversePermutation",i.getLocal("px"),i.getLocal("bits")),i.setLocal("n",i.i32_shl(i.i32_const(1),i.getLocal("bits"))),i.setLocal("s",i.i32_const(1)),i.block(i.loop(i.br_if(1,i.i32_gt_u(i.getLocal("s"),i.getLocal("bits"))),i.setLocal("m",i.i32_shl(i.i32_const(1),i.getLocal("s"))),i.setLocal("pwm",i.i32_add(i.i32_const(p),i.i32_mul(i.getLocal("s"),i.i32_const(d)))),i.setLocal("k",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_ge_u(i.getLocal("k"),i.getLocal("n"))),i.call(c+"_one",b),i.setLocal("mdiv2",i.i32_shr_u(i.getLocal("m"),i.i32_const(1))),i.setLocal("j",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_ge_u(i.getLocal("j"),i.getLocal("mdiv2"))),i.setLocal("idx1",i.i32_add(i.getLocal("px"),i.i32_mul(i.i32_add(i.getLocal("k"),i.getLocal("j")),i.i32_const(r)))),i.setLocal("idx2",i.i32_add(i.getLocal("idx1"),i.i32_mul(i.getLocal("mdiv2"),i.i32_const(r)))),i.call(f,i.getLocal("idx2"),b,o),i.call(t+"_copy",i.getLocal("idx1"),s),i.call(t+"_add",s,o,i.getLocal("idx1")),i.call(t+"_sub",s,o,i.getLocal("idx2")),i.call(c+"_mul",b,i.getLocal("pwm"),b),i.setLocal("j",i.i32_add(i.getLocal("j"),i.i32_const(1))),i.br(0))),i.setLocal("k",i.i32_add(i.getLocal("k"),i.getLocal("m"))),i.br(0))),i.setLocal("s",i.i32_add(i.getLocal("s"),i.i32_const(1))),i.br(0))),i.call(a+"__fftFinal",i.getLocal("px"),i.getLocal("bits"),i.getLocal("reverse"),i.getLocal("mulFactor")))}(),function(){const t=e.addFunction(a+"__log2");t.addParam("n","i32"),t.setReturnType("i32"),t.addLocal("bits","i32"),t.addLocal("aux","i32");const c=t.getCodeBuilder();t.addCode(c.setLocal("aux",c.i32_shr_u(c.getLocal("n"),c.i32_const(1)))),t.addCode(c.setLocal("bits",c.i32_const(0))),t.addCode(c.block(c.loop(c.br_if(1,c.i32_eqz(c.getLocal("aux"))),c.setLocal("aux",c.i32_shr_u(c.getLocal("aux"),c.i32_const(1))),c.setLocal("bits",c.i32_add(c.getLocal("bits"),c.i32_const(1))),c.br(0)))),t.addCode(c.if(c.i32_ne(c.getLocal("n"),c.i32_shl(c.i32_const(1),c.getLocal("bits"))),c.unreachable())),t.addCode(c.if(c.i32_gt_u(c.getLocal("bits"),c.i32_const(b)),c.unreachable())),t.addCode(c.getLocal("bits"))}(),function(){const t=e.addFunction(a+"_fft");t.addParam("px","i32"),t.addParam("n","i32"),t.addLocal("bits","i32");const f=t.getCodeBuilder(),r=f.i32_const(e.alloc(d));t.addCode(f.setLocal("bits",f.call(a+"__log2",f.getLocal("n"))),f.call(c+"_one",r),f.call(a+"_rawfft",f.getLocal("px"),f.getLocal("bits"),f.i32_const(0),r))}(),function(){const t=e.addFunction(a+"_ifft");t.addParam("px","i32"),t.addParam("n","i32"),t.addLocal("bits","i32"),t.addLocal("pInv2","i32");const c=t.getCodeBuilder();t.addCode(c.setLocal("bits",c.call(a+"__log2",c.getLocal("n"))),c.setLocal("pInv2",c.i32_add(c.i32_const(y),c.i32_mul(c.getLocal("bits"),c.i32_const(d)))),c.call(a+"_rawfft",c.getLocal("px"),c.getLocal("bits"),c.i32_const(1),c.getLocal("pInv2")))}(),function(){const n=e.addFunction(a+"_fftJoin");n.addParam("pBuff1","i32"),n.addParam("pBuff2","i32"),n.addParam("n","i32"),n.addParam("first","i32"),n.addParam("inc","i32"),n.addLocal("idx1","i32"),n.addLocal("idx2","i32"),n.addLocal("i","i32");const i=n.getCodeBuilder(),b=i.i32_const(e.alloc(d)),o=i.i32_const(e.alloc(r)),s=i.i32_const(e.alloc(r));n.addCode(i.call(c+"_copy",i.getLocal("first"),b),i.setLocal("i",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("i"),i.getLocal("n"))),i.setLocal("idx1",i.i32_add(i.getLocal("pBuff1"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.setLocal("idx2",i.i32_add(i.getLocal("pBuff2"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.call(f,i.getLocal("idx2"),b,o),i.call(t+"_copy",i.getLocal("idx1"),s),i.call(t+"_add",s,o,i.getLocal("idx1")),i.call(t+"_sub",s,o,i.getLocal("idx2")),i.call(c+"_mul",b,i.getLocal("inc"),b),i.setLocal("i",i.i32_add(i.getLocal("i"),i.i32_const(1))),i.br(0))))}(),function(){const n=e.addFunction(a+"_fftJoinExt");n.addParam("pBuff1","i32"),n.addParam("pBuff2","i32"),n.addParam("n","i32"),n.addParam("first","i32"),n.addParam("inc","i32"),n.addParam("totalBits","i32"),n.addLocal("idx1","i32"),n.addLocal("idx2","i32"),n.addLocal("i","i32"),n.addLocal("pShiftToM","i32");const i=n.getCodeBuilder(),b=i.i32_const(e.alloc(d)),o=i.i32_const(e.alloc(r));n.addCode(i.setLocal("pShiftToM",i.i32_add(i.i32_const(w),i.i32_mul(i.getLocal("totalBits"),i.i32_const(d)))),i.call(c+"_copy",i.getLocal("first"),b),i.setLocal("i",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("i"),i.getLocal("n"))),i.setLocal("idx1",i.i32_add(i.getLocal("pBuff1"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.setLocal("idx2",i.i32_add(i.getLocal("pBuff2"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.call(t+"_add",i.getLocal("idx1"),i.getLocal("idx2"),o),i.call(f,i.getLocal("idx2"),i.getLocal("pShiftToM"),i.getLocal("idx2")),i.call(t+"_add",i.getLocal("idx1"),i.getLocal("idx2"),i.getLocal("idx2")),i.call(f,i.getLocal("idx2"),b,i.getLocal("idx2")),i.call(t+"_copy",o,i.getLocal("idx1")),i.call(c+"_mul",b,i.getLocal("inc"),b),i.setLocal("i",i.i32_add(i.getLocal("i"),i.i32_const(1))),i.br(0))))}(),function(){const n=e.addFunction(a+"_fftJoinExtInv");n.addParam("pBuff1","i32"),n.addParam("pBuff2","i32"),n.addParam("n","i32"),n.addParam("first","i32"),n.addParam("inc","i32"),n.addParam("totalBits","i32"),n.addLocal("idx1","i32"),n.addLocal("idx2","i32"),n.addLocal("i","i32"),n.addLocal("pShiftToM","i32"),n.addLocal("pSConst","i32");const i=n.getCodeBuilder(),b=i.i32_const(e.alloc(d)),o=i.i32_const(e.alloc(r));n.addCode(i.setLocal("pShiftToM",i.i32_add(i.i32_const(w),i.i32_mul(i.getLocal("totalBits"),i.i32_const(d)))),i.setLocal("pSConst",i.i32_add(i.i32_const(_),i.i32_mul(i.getLocal("totalBits"),i.i32_const(d)))),i.call(c+"_copy",i.getLocal("first"),b),i.setLocal("i",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("i"),i.getLocal("n"))),i.setLocal("idx1",i.i32_add(i.getLocal("pBuff1"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.setLocal("idx2",i.i32_add(i.getLocal("pBuff2"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.call(f,i.getLocal("idx2"),b,o),i.call(t+"_sub",i.getLocal("idx1"),o,i.getLocal("idx2")),i.call(f,i.getLocal("idx2"),i.getLocal("pSConst"),i.getLocal("idx2")),i.call(f,i.getLocal("idx1"),i.getLocal("pShiftToM"),i.getLocal("idx1")),i.call(t+"_sub",o,i.getLocal("idx1"),i.getLocal("idx1")),i.call(f,i.getLocal("idx1"),i.getLocal("pSConst"),i.getLocal("idx1")),i.call(c+"_mul",b,i.getLocal("inc"),b),i.setLocal("i",i.i32_add(i.getLocal("i"),i.i32_const(1))),i.br(0))))}(),function(){const n=e.addFunction(a+"_fftMix");n.addParam("pBuff","i32"),n.addParam("n","i32"),n.addParam("exp","i32"),n.addLocal("nGroups","i32"),n.addLocal("nPerGroup","i32"),n.addLocal("nPerGroupDiv2","i32"),n.addLocal("pairOffset","i32"),n.addLocal("idx1","i32"),n.addLocal("idx2","i32"),n.addLocal("i","i32"),n.addLocal("j","i32"),n.addLocal("pwm","i32");const i=n.getCodeBuilder(),b=i.i32_const(e.alloc(d)),o=i.i32_const(e.alloc(r)),s=i.i32_const(e.alloc(r));n.addCode(i.setLocal("nPerGroup",i.i32_shl(i.i32_const(1),i.getLocal("exp"))),i.setLocal("nPerGroupDiv2",i.i32_shr_u(i.getLocal("nPerGroup"),i.i32_const(1))),i.setLocal("nGroups",i.i32_shr_u(i.getLocal("n"),i.getLocal("exp"))),i.setLocal("pairOffset",i.i32_mul(i.getLocal("nPerGroupDiv2"),i.i32_const(r))),i.setLocal("pwm",i.i32_add(i.i32_const(p),i.i32_mul(i.getLocal("exp"),i.i32_const(d)))),i.setLocal("i",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("i"),i.getLocal("nGroups"))),i.call(c+"_one",b),i.setLocal("j",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("j"),i.getLocal("nPerGroupDiv2"))),i.setLocal("idx1",i.i32_add(i.getLocal("pBuff"),i.i32_mul(i.i32_add(i.i32_mul(i.getLocal("i"),i.getLocal("nPerGroup")),i.getLocal("j")),i.i32_const(r)))),i.setLocal("idx2",i.i32_add(i.getLocal("idx1"),i.getLocal("pairOffset"))),i.call(f,i.getLocal("idx2"),b,o),i.call(t+"_copy",i.getLocal("idx1"),s),i.call(t+"_add",s,o,i.getLocal("idx1")),i.call(t+"_sub",s,o,i.getLocal("idx2")),i.call(c+"_mul",b,i.getLocal("pwm"),b),i.setLocal("j",i.i32_add(i.getLocal("j"),i.i32_const(1))),i.br(0))),i.setLocal("i",i.i32_add(i.getLocal("i"),i.i32_const(1))),i.br(0))))}(),function(){const c=e.addFunction(a+"_fftFinal");c.addParam("pBuff","i32"),c.addParam("n","i32"),c.addParam("factor","i32"),c.addLocal("idx1","i32"),c.addLocal("idx2","i32"),c.addLocal("i","i32"),c.addLocal("ndiv2","i32");const d=c.getCodeBuilder(),n=d.i32_const(e.alloc(r));c.addCode(d.setLocal("ndiv2",d.i32_shr_u(d.getLocal("n"),d.i32_const(1))),d.if(d.i32_and(d.getLocal("n"),d.i32_const(1)),d.call(f,d.i32_add(d.getLocal("pBuff"),d.i32_mul(d.getLocal("ndiv2"),d.i32_const(r))),d.getLocal("factor"),d.i32_add(d.getLocal("pBuff"),d.i32_mul(d.getLocal("ndiv2"),d.i32_const(r))))),d.setLocal("i",d.i32_const(0)),d.block(d.loop(d.br_if(1,d.i32_ge_u(d.getLocal("i"),d.getLocal("ndiv2"))),d.setLocal("idx1",d.i32_add(d.getLocal("pBuff"),d.i32_mul(d.getLocal("i"),d.i32_const(r)))),d.setLocal("idx2",d.i32_add(d.getLocal("pBuff"),d.i32_mul(d.i32_sub(d.i32_sub(d.getLocal("n"),d.i32_const(1)),d.getLocal("i")),d.i32_const(r)))),d.call(f,d.getLocal("idx2"),d.getLocal("factor"),n),d.call(f,d.getLocal("idx1"),d.getLocal("factor"),d.getLocal("idx2")),d.call(t+"_copy",n,d.getLocal("idx1")),d.setLocal("i",d.i32_add(d.getLocal("i"),d.i32_const(1))),d.br(0))))}(),function(){const n=e.addFunction(a+"_prepareLagrangeEvaluation");n.addParam("pBuff1","i32"),n.addParam("pBuff2","i32"),n.addParam("n","i32"),n.addParam("first","i32"),n.addParam("inc","i32"),n.addParam("totalBits","i32"),n.addLocal("idx1","i32"),n.addLocal("idx2","i32"),n.addLocal("i","i32"),n.addLocal("pShiftToM","i32"),n.addLocal("pSConst","i32");const i=n.getCodeBuilder(),b=i.i32_const(e.alloc(d)),o=i.i32_const(e.alloc(r));n.addCode(i.setLocal("pShiftToM",i.i32_add(i.i32_const(w),i.i32_mul(i.getLocal("totalBits"),i.i32_const(d)))),i.setLocal("pSConst",i.i32_add(i.i32_const(_),i.i32_mul(i.getLocal("totalBits"),i.i32_const(d)))),i.call(c+"_copy",i.getLocal("first"),b),i.setLocal("i",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("i"),i.getLocal("n"))),i.setLocal("idx1",i.i32_add(i.getLocal("pBuff1"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.setLocal("idx2",i.i32_add(i.getLocal("pBuff2"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.call(f,i.getLocal("idx1"),i.getLocal("pShiftToM"),o),i.call(t+"_sub",i.getLocal("idx2"),o,o),i.call(t+"_sub",i.getLocal("idx1"),i.getLocal("idx2"),i.getLocal("idx2")),i.call(f,o,i.getLocal("pSConst"),i.getLocal("idx1")),i.call(f,i.getLocal("idx2"),b,i.getLocal("idx2")),i.call(c+"_mul",b,i.getLocal("inc"),b),i.setLocal("i",i.i32_add(i.getLocal("i"),i.i32_const(1))),i.br(0))))}(),e.exportFunction(a+"_fft"),e.exportFunction(a+"_ifft"),e.exportFunction(a+"_rawfft"),e.exportFunction(a+"_fftJoin"),e.exportFunction(a+"_fftJoinExt"),e.exportFunction(a+"_fftJoinExtInv"),e.exportFunction(a+"_fftMix"),e.exportFunction(a+"_fftFinal"),e.exportFunction(a+"_prepareLagrangeEvaluation")},Se=function(e,a,t){const c=8*e.modules[t].n64;return function(){const f=e.addFunction(a+"_zero");f.addParam("px","i32"),f.addParam("n","i32"),f.addLocal("lastp","i32"),f.addLocal("p","i32");const d=f.getCodeBuilder();f.addCode(d.setLocal("p",d.getLocal("px")),d.setLocal("lastp",d.i32_add(d.getLocal("px"),d.i32_mul(d.getLocal("n"),d.i32_const(c)))),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("p"),d.getLocal("lastp"))),d.call(t+"_zero",d.getLocal("p")),d.setLocal("p",d.i32_add(d.getLocal("p"),d.i32_const(c))),d.br(0))))}(),function(){const f=e.addFunction(a+"_constructLC");f.addParam("ppolynomials","i32"),f.addParam("psignals","i32"),f.addParam("nSignals","i32"),f.addParam("pres","i32"),f.addLocal("i","i32"),f.addLocal("j","i32"),f.addLocal("pp","i32"),f.addLocal("ps","i32"),f.addLocal("pd","i32"),f.addLocal("ncoefs","i32");const d=f.getCodeBuilder(),r=d.i32_const(e.alloc(c));f.addCode(d.setLocal("i",d.i32_const(0)),d.setLocal("pp",d.getLocal("ppolynomials")),d.setLocal("ps",d.getLocal("psignals")),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("i"),d.getLocal("nSignals"))),d.setLocal("ncoefs",d.i32_load(d.getLocal("pp"))),d.setLocal("pp",d.i32_add(d.getLocal("pp"),d.i32_const(4))),d.setLocal("j",d.i32_const(0)),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("j"),d.getLocal("ncoefs"))),d.setLocal("pd",d.i32_add(d.getLocal("pres"),d.i32_mul(d.i32_load(d.getLocal("pp")),d.i32_const(c)))),d.setLocal("pp",d.i32_add(d.getLocal("pp"),d.i32_const(4))),d.call(t+"_mul",d.getLocal("ps"),d.getLocal("pp"),r),d.call(t+"_add",r,d.getLocal("pd"),d.getLocal("pd")),d.setLocal("pp",d.i32_add(d.getLocal("pp"),d.i32_const(c))),d.setLocal("j",d.i32_add(d.getLocal("j"),d.i32_const(1))),d.br(0))),d.setLocal("ps",d.i32_add(d.getLocal("ps"),d.i32_const(c))),d.setLocal("i",d.i32_add(d.getLocal("i"),d.i32_const(1))),d.br(0))))}(),e.exportFunction(a+"_zero"),e.exportFunction(a+"_constructLC"),a},Te=function(e,a,t){const c=8*e.modules[t].n64;return function(){const f=e.addFunction(a+"_buildABC");f.addParam("pCoefs","i32"),f.addParam("nCoefs","i32"),f.addParam("pWitness","i32"),f.addParam("pA","i32"),f.addParam("pB","i32"),f.addParam("pC","i32"),f.addParam("offsetOut","i32"),f.addParam("nOut","i32"),f.addParam("offsetWitness","i32"),f.addParam("nWitness","i32"),f.addLocal("it","i32"),f.addLocal("ita","i32"),f.addLocal("itb","i32"),f.addLocal("last","i32"),f.addLocal("m","i32"),f.addLocal("c","i32"),f.addLocal("s","i32"),f.addLocal("pOut","i32");const d=f.getCodeBuilder(),r=d.i32_const(e.alloc(c));f.addCode(d.setLocal("ita",d.getLocal("pA")),d.setLocal("itb",d.getLocal("pB")),d.setLocal("last",d.i32_add(d.getLocal("pA"),d.i32_mul(d.getLocal("nOut"),d.i32_const(c)))),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("ita"),d.getLocal("last"))),d.call(t+"_zero",d.getLocal("ita")),d.call(t+"_zero",d.getLocal("itb")),d.setLocal("ita",d.i32_add(d.getLocal("ita"),d.i32_const(c))),d.setLocal("itb",d.i32_add(d.getLocal("itb"),d.i32_const(c))),d.br(0))),d.setLocal("it",d.getLocal("pCoefs")),d.setLocal("last",d.i32_add(d.getLocal("pCoefs"),d.i32_mul(d.getLocal("nCoefs"),d.i32_const(c+12)))),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("it"),d.getLocal("last"))),d.setLocal("s",d.i32_load(d.getLocal("it"),8)),d.if(d.i32_or(d.i32_lt_u(d.getLocal("s"),d.getLocal("offsetWitness")),d.i32_ge_u(d.getLocal("s"),d.i32_add(d.getLocal("offsetWitness"),d.getLocal("nWitness")))),[...d.setLocal("it",d.i32_add(d.getLocal("it"),d.i32_const(c+12))),...d.br(1)]),d.setLocal("m",d.i32_load(d.getLocal("it"))),d.if(d.i32_eq(d.getLocal("m"),d.i32_const(0)),d.setLocal("pOut",d.getLocal("pA")),d.if(d.i32_eq(d.getLocal("m"),d.i32_const(1)),d.setLocal("pOut",d.getLocal("pB")),[...d.setLocal("it",d.i32_add(d.getLocal("it"),d.i32_const(c+12))),...d.br(1)])),d.setLocal("c",d.i32_load(d.getLocal("it"),4)),d.if(d.i32_or(d.i32_lt_u(d.getLocal("c"),d.getLocal("offsetOut")),d.i32_ge_u(d.getLocal("c"),d.i32_add(d.getLocal("offsetOut"),d.getLocal("nOut")))),[...d.setLocal("it",d.i32_add(d.getLocal("it"),d.i32_const(c+12))),...d.br(1)]),d.setLocal("pOut",d.i32_add(d.getLocal("pOut"),d.i32_mul(d.i32_sub(d.getLocal("c"),d.getLocal("offsetOut")),d.i32_const(c)))),d.call(t+"_mul",d.i32_add(d.getLocal("pWitness"),d.i32_mul(d.i32_sub(d.getLocal("s"),d.getLocal("offsetWitness")),d.i32_const(c))),d.i32_add(d.getLocal("it"),d.i32_const(12)),r),d.call(t+"_add",d.getLocal("pOut"),r,d.getLocal("pOut")),d.setLocal("it",d.i32_add(d.getLocal("it"),d.i32_const(c+12))),d.br(0))),d.setLocal("ita",d.getLocal("pA")),d.setLocal("itb",d.getLocal("pB")),d.setLocal("it",d.getLocal("pC")),d.setLocal("last",d.i32_add(d.getLocal("pA"),d.i32_mul(d.getLocal("nOut"),d.i32_const(c)))),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("ita"),d.getLocal("last"))),d.call(t+"_mul",d.getLocal("ita"),d.getLocal("itb"),d.getLocal("it")),d.setLocal("ita",d.i32_add(d.getLocal("ita"),d.i32_const(c))),d.setLocal("itb",d.i32_add(d.getLocal("itb"),d.i32_const(c))),d.setLocal("it",d.i32_add(d.getLocal("it"),d.i32_const(c))),d.br(0))))}(),function(){const f=e.addFunction(a+"_joinABC");f.addParam("pA","i32"),f.addParam("pB","i32"),f.addParam("pC","i32"),f.addParam("n","i32"),f.addParam("pP","i32"),f.addLocal("ita","i32"),f.addLocal("itb","i32"),f.addLocal("itc","i32"),f.addLocal("itp","i32"),f.addLocal("last","i32");const d=f.getCodeBuilder(),r=d.i32_const(e.alloc(c));f.addCode(d.setLocal("ita",d.getLocal("pA")),d.setLocal("itb",d.getLocal("pB")),d.setLocal("itc",d.getLocal("pC")),d.setLocal("itp",d.getLocal("pP")),d.setLocal("last",d.i32_add(d.getLocal("pA"),d.i32_mul(d.getLocal("n"),d.i32_const(c)))),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("ita"),d.getLocal("last"))),d.call(t+"_mul",d.getLocal("ita"),d.getLocal("itb"),r),d.call(t+"_sub",r,d.getLocal("itc"),d.getLocal("itp")),d.setLocal("ita",d.i32_add(d.getLocal("ita"),d.i32_const(c))),d.setLocal("itb",d.i32_add(d.getLocal("itb"),d.i32_const(c))),d.setLocal("itc",d.i32_add(d.getLocal("itc"),d.i32_const(c))),d.setLocal("itp",d.i32_add(d.getLocal("itp"),d.i32_const(c))),d.br(0))))}(),function(){const f=e.addFunction(a+"_batchAdd");f.addParam("pa","i32"),f.addParam("pb","i32"),f.addParam("n","i32"),f.addParam("pr","i32"),f.addLocal("ita","i32"),f.addLocal("itb","i32"),f.addLocal("itr","i32"),f.addLocal("last","i32");const d=f.getCodeBuilder();f.addCode(d.setLocal("ita",d.getLocal("pa")),d.setLocal("itb",d.getLocal("pb")),d.setLocal("itr",d.getLocal("pr")),d.setLocal("last",d.i32_add(d.getLocal("pa"),d.i32_mul(d.getLocal("n"),d.i32_const(c)))),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("ita"),d.getLocal("last"))),d.call(t+"_add",d.getLocal("ita"),d.getLocal("itb"),d.getLocal("itr")),d.setLocal("ita",d.i32_add(d.getLocal("ita"),d.i32_const(c))),d.setLocal("itb",d.i32_add(d.getLocal("itb"),d.i32_const(c))),d.setLocal("itr",d.i32_add(d.getLocal("itr"),d.i32_const(c))),d.br(0))))}(),e.exportFunction(a+"_buildABC"),e.exportFunction(a+"_joinABC"),e.exportFunction(a+"_batchAdd"),a},Ne=function(e,a,t,c,f,d,r,n){const i=e.addFunction(a);i.addParam("pIn","i32"),i.addParam("n","i32"),i.addParam("pFirst","i32"),i.addParam("pInc","i32"),i.addParam("pOut","i32"),i.addLocal("pOldFree","i32"),i.addLocal("i","i32"),i.addLocal("pFrom","i32"),i.addLocal("pTo","i32");const b=i.getCodeBuilder(),o=b.i32_const(e.alloc(r));i.addCode(b.setLocal("pFrom",b.getLocal("pIn")),b.setLocal("pTo",b.getLocal("pOut"))),i.addCode(b.call(c+"_copy",b.getLocal("pFirst"),o)),i.addCode(b.setLocal("i",b.i32_const(0)),b.block(b.loop(b.br_if(1,b.i32_eq(b.getLocal("i"),b.getLocal("n"))),b.call(n,b.getLocal("pFrom"),o,b.getLocal("pTo")),b.setLocal("pFrom",b.i32_add(b.getLocal("pFrom"),b.i32_const(f))),b.setLocal("pTo",b.i32_add(b.getLocal("pTo"),b.i32_const(d))),b.call(c+"_mul",o,b.getLocal("pInc"),o),b.setLocal("i",b.i32_add(b.getLocal("i"),b.i32_const(1))),b.br(0)))),e.exportFunction(a)};const Re=D,Pe=se,De=he,Oe=ye,Fe=ve,Qe=Ee,Ue=Le,je=Se,He=Te,$e=Ne,{bitLength:qe,modInv:ze,isOdd:Ge,isNegative:Ke}=U,Ve=D,Ze=se,Je=he,We=ye,Ye=ve,Xe=Ee,ea=Le,aa=Se,ta=Te,ca=Ne,{bitLength:fa,isOdd:da,isNegative:ra}=U;var na=function(e,a){const t=a||"bn128";if(e.modules[t])return t;const c=21888242871839275222246405745257275088696311157297823662689037894645226208583n,f=21888242871839275222246405745257275088548364400416034343698204186575808495617n,d=Math.floor((qe(c-1n)-1)/64)+1,r=8*d,n=r,i=r,b=2*i,o=12*i,s=e.alloc(Re.bigInt2BytesLE(f,n)),l=Pe(e,c,"f1m");De(e,f,"fr","frm");const u=e.alloc(Re.bigInt2BytesLE(x(3n),i)),h=Qe(e,"g1m","f1m",u);Ue(e,"frm","frm","frm","frm_mul"),je(e,"pol","frm"),He(e,"qap","frm");const p=Oe(e,"f1m_neg","f2m","f1m"),g=e.alloc([...Re.bigInt2BytesLE(x(19485874751759354771024239261021720505790618469301721065564631296452457478373n),i),...Re.bigInt2BytesLE(x(266929791119991161246907387137283842545076965332900288569378510910307636690n),i)]),m=Qe(e,"g2m","f2m",g);function y(a,t){const c=e.addFunction(a);c.addParam("pG","i32"),c.addParam("pFr","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),d=f.i32_const(e.alloc(r));c.addCode(f.call("frm_fromMontgomery",f.getLocal("pFr"),d),f.call(t,f.getLocal("pG"),d,f.i32_const(r),f.getLocal("pr"))),e.exportFunction(a)}function x(e){return BigInt(e)*(1n<0n;)Ge(e)?a.push(1):a.push(0),e>>=1n;return a}(),D=e.alloc(P),O=3*b,F=P.length-1,Q=P.reduce(((e,a)=>e+(0!=a?1:0)),0),U=6*r,j=3*r*2+(Q+F+1)*O;function H(a){const f=[[[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n]],[[1n,0n],[8376118865763821496583973867626364092589906065868298776909617916018768340080n,16469823323077808223889137241176536799009286646108169935659301613961712198316n],[21888242871839275220042445260109153167277707414472061641714758635765020556617n,0n],[11697423496358154304825782922584725312912383441159505038794027105778954184319n,303847389135065887422783454877609941456349188919719272345083954437860409601n],[21888242871839275220042445260109153167277707414472061641714758635765020556616n,0n],[3321304630594332808241809054958361220322477375291206261884409189760185844239n,5722266937896532885780051958958348231143373700109372999374820235121374419868n],[21888242871839275222246405745257275088696311157297823662689037894645226208582n,0n],[13512124006075453725662431877630910996106405091429524885779419978626457868503n,5418419548761466998357268504080738289687024511189653727029736280683514010267n],[2203960485148121921418603742825762020974279258880205651966n,0n],[10190819375481120917420622822672549775783927716138318623895010788866272024264n,21584395482704209334823622290379665147239961968378104390343953940207365798982n],[2203960485148121921418603742825762020974279258880205651967n,0n],[18566938241244942414004596690298913868373833782006617400804628704885040364344n,16165975933942742336466353786298926857552937457188450663314217659523851788715n]]],d=[[[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n]],[[1n,0n],[21575463638280843010398324269430826099269044274347216827212613867836435027261n,10307601595873709700152284273816112264069230130616436755625194854815875713954n],[21888242871839275220042445260109153167277707414472061641714758635765020556616n,0n],[3772000881919853776433695186713858239009073593817195771773381919316419345261n,2236595495967245188281701248203181795121068902605861227855261137820944008926n],[2203960485148121921418603742825762020974279258880205651966n,0n],[18429021223477853657660792034369865839114504446431234726392080002137598044644n,9344045779998320333812420223237981029506012124075525679208581902008406485703n]],[[1n,0n],[2581911344467009335267311115468803099551665605076196740867805258568234346338n,19937756971775647987995932169929341994314640652964949448313374472400716661030n],[2203960485148121921418603742825762020974279258880205651966n,0n],[5324479202449903542726783395506214481928257762400643279780343368557297135718n,16208900380737693084919495127334387981393726419856888799917914180988844123039n],[21888242871839275220042445260109153167277707414472061641714758635765020556616n,0n],[13981852324922362344252311234282257507216387789820983642040889267519694726527n,7629828391165209371577384193250820201684255241773809077146787135900891633097n]]],r=e.addFunction(t+"__frobeniusMap"+a);r.addParam("x","i32"),r.addParam("r","i32");const n=r.getCodeBuilder();for(let t=0;t<6;t++){const c=0==t?n.getLocal("x"):n.i32_add(n.getLocal("x"),n.i32_const(t*b)),s=c,u=n.i32_add(n.getLocal("x"),n.i32_const(t*b+i)),h=0==t?n.getLocal("r"):n.i32_add(n.getLocal("r"),n.i32_const(t*b)),g=h,m=n.i32_add(n.getLocal("r"),n.i32_const(t*b+i)),y=o(f[Math.floor(t/3)][a%12],d[t%3][a%6]),A=e.alloc([...Re.bigInt2BytesLE(x(y[0]),32),...Re.bigInt2BytesLE(x(y[1]),32)]);a%2==1?r.addCode(n.call(l+"_copy",s,g),n.call(l+"_neg",u,m),n.call(p+"_mul",h,n.i32_const(A),h)):r.addCode(n.call(p+"_mul",c,n.i32_const(A),h))}function o(e,a){const t=BigInt(e[0]),f=BigInt(e[1]),d=BigInt(a[0]),r=BigInt(a[1]),n=[(t*d-f*r)%c,(t*r+f*d)%c];return Ke(n[0])&&(n[0]=n[0]+c),n}}function $(){!function(){const a=e.addFunction(t+"__cyclotomicSquare");a.addParam("x","i32"),a.addParam("r","i32");const c=a.getCodeBuilder(),f=c.getLocal("x"),d=c.i32_add(c.getLocal("x"),c.i32_const(b)),r=c.i32_add(c.getLocal("x"),c.i32_const(2*b)),n=c.i32_add(c.getLocal("x"),c.i32_const(3*b)),i=c.i32_add(c.getLocal("x"),c.i32_const(4*b)),o=c.i32_add(c.getLocal("x"),c.i32_const(5*b)),s=c.getLocal("r"),l=c.i32_add(c.getLocal("r"),c.i32_const(b)),u=c.i32_add(c.getLocal("r"),c.i32_const(2*b)),h=c.i32_add(c.getLocal("r"),c.i32_const(3*b)),g=c.i32_add(c.getLocal("r"),c.i32_const(4*b)),m=c.i32_add(c.getLocal("r"),c.i32_const(5*b)),y=c.i32_const(e.alloc(b)),x=c.i32_const(e.alloc(b)),A=c.i32_const(e.alloc(b)),v=c.i32_const(e.alloc(b)),w=c.i32_const(e.alloc(b)),_=c.i32_const(e.alloc(b)),I=c.i32_const(e.alloc(b)),E=c.i32_const(e.alloc(b));a.addCode(c.call(p+"_mul",f,i,I),c.call(p+"_mul",i,c.i32_const(k),y),c.call(p+"_add",f,y,y),c.call(p+"_add",f,i,E),c.call(p+"_mul",E,y,y),c.call(p+"_mul",c.i32_const(k),I,E),c.call(p+"_add",I,E,E),c.call(p+"_sub",y,E,y),c.call(p+"_add",I,I,x),c.call(p+"_mul",n,r,I),c.call(p+"_mul",r,c.i32_const(k),A),c.call(p+"_add",n,A,A),c.call(p+"_add",n,r,E),c.call(p+"_mul",E,A,A),c.call(p+"_mul",c.i32_const(k),I,E),c.call(p+"_add",I,E,E),c.call(p+"_sub",A,E,A),c.call(p+"_add",I,I,v),c.call(p+"_mul",d,o,I),c.call(p+"_mul",o,c.i32_const(k),w),c.call(p+"_add",d,w,w),c.call(p+"_add",d,o,E),c.call(p+"_mul",E,w,w),c.call(p+"_mul",c.i32_const(k),I,E),c.call(p+"_add",I,E,E),c.call(p+"_sub",w,E,w),c.call(p+"_add",I,I,_),c.call(p+"_sub",y,f,s),c.call(p+"_add",s,s,s),c.call(p+"_add",y,s,s),c.call(p+"_add",x,i,g),c.call(p+"_add",g,g,g),c.call(p+"_add",x,g,g),c.call(p+"_mul",_,c.i32_const(S),E),c.call(p+"_add",E,n,h),c.call(p+"_add",h,h,h),c.call(p+"_add",E,h,h),c.call(p+"_sub",w,r,u),c.call(p+"_add",u,u,u),c.call(p+"_add",w,u,u),c.call(p+"_sub",A,d,l),c.call(p+"_add",l,l,l),c.call(p+"_add",A,l,l),c.call(p+"_add",v,o,m),c.call(p+"_add",m,m,m),c.call(p+"_add",v,m,m))}(),function(a,c){const f=function(e){let a=e;const t=[];for(;a>0n;){if(Ge(a)){const e=2-Number(a%4n);t.push(e),a-=BigInt(e)}else t.push(0);a>>=1n}return t}(a).map((e=>-1==e?255:e)),d=e.alloc(f),r=e.addFunction(t+"__cyclotomicExp_"+c);r.addParam("x","i32"),r.addParam("r","i32"),r.addLocal("bit","i32"),r.addLocal("i","i32");const n=r.getCodeBuilder(),i=n.getLocal("x"),b=n.getLocal("r"),s=n.i32_const(e.alloc(o));r.addCode(n.call(R+"_conjugate",i,s),n.call(R+"_one",b),n.if(n.teeLocal("bit",n.i32_load8_s(n.i32_const(f.length-1),d)),n.if(n.i32_eq(n.getLocal("bit"),n.i32_const(1)),n.call(R+"_mul",b,i,b),n.call(R+"_mul",b,s,b))),n.setLocal("i",n.i32_const(f.length-2)),n.block(n.loop(n.call(t+"__cyclotomicSquare",b,b),n.if(n.teeLocal("bit",n.i32_load8_s(n.getLocal("i"),d)),n.if(n.i32_eq(n.getLocal("bit"),n.i32_const(1)),n.call(R+"_mul",b,i,b),n.call(R+"_mul",b,s,b))),n.br_if(1,n.i32_eqz(n.getLocal("i"))),n.setLocal("i",n.i32_sub(n.getLocal("i"),n.i32_const(1))),n.br(0))))}(4965661367192848881n,"w0");const a=e.addFunction(t+"__finalExponentiationLastChunk");a.addParam("x","i32"),a.addParam("r","i32");const c=a.getCodeBuilder(),f=c.getLocal("x"),d=c.getLocal("r"),r=c.i32_const(e.alloc(o)),n=c.i32_const(e.alloc(o)),i=c.i32_const(e.alloc(o)),s=c.i32_const(e.alloc(o)),l=c.i32_const(e.alloc(o)),u=c.i32_const(e.alloc(o)),h=c.i32_const(e.alloc(o)),g=c.i32_const(e.alloc(o)),m=c.i32_const(e.alloc(o)),y=c.i32_const(e.alloc(o)),x=c.i32_const(e.alloc(o)),A=c.i32_const(e.alloc(o)),v=c.i32_const(e.alloc(o)),w=c.i32_const(e.alloc(o)),_=c.i32_const(e.alloc(o)),I=c.i32_const(e.alloc(o)),E=c.i32_const(e.alloc(o)),C=c.i32_const(e.alloc(o)),M=c.i32_const(e.alloc(o)),B=c.i32_const(e.alloc(o)),L=c.i32_const(e.alloc(o));a.addCode(c.call(t+"__cyclotomicExp_w0",f,r),c.call(R+"_conjugate",r,r),c.call(t+"__cyclotomicSquare",r,n),c.call(t+"__cyclotomicSquare",n,i),c.call(R+"_mul",i,n,s),c.call(t+"__cyclotomicExp_w0",s,l),c.call(R+"_conjugate",l,l),c.call(t+"__cyclotomicSquare",l,u),c.call(t+"__cyclotomicExp_w0",u,h),c.call(R+"_conjugate",h,h),c.call(R+"_conjugate",s,g),c.call(R+"_conjugate",h,m),c.call(R+"_mul",m,l,y),c.call(R+"_mul",y,g,x),c.call(R+"_mul",x,n,A),c.call(R+"_mul",x,l,v),c.call(R+"_mul",v,f,w),c.call(t+"__frobeniusMap1",A,_),c.call(R+"_mul",_,w,I),c.call(t+"__frobeniusMap2",x,E),c.call(R+"_mul",E,I,C),c.call(R+"_conjugate",f,M),c.call(R+"_mul",M,A,B),c.call(t+"__frobeniusMap3",B,L),c.call(R+"_mul",L,C,d))}e.modules[t]={n64:d,pG1gen:v,pG1zero:_,pG1b:u,pG2gen:E,pG2zero:M,pG2b:g,pq:e.modules.f1m.pq,pr:s,pOneT:B,prePSize:U,preQSize:j,r:f.toString(),q:c.toString()};const q=e.alloc(U),z=e.alloc(j);function G(a){const c=e.addFunction(t+"_pairingEq"+a);for(let e=0;e0n;)da(e)?a.push(1):a.push(0),e>>=1n;return a}(),P=e.alloc(R),D=3*i,O=R.length-1,F=R.reduce(((e,a)=>e+(0!=a?1:0)),0),Q=6*r,U=3*r*2+(F+O+1)*D,j=15132376222941642752n;function H(a){const t=[[[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n]],[[1n,0n],[3850754370037169011952147076051364057158807420970682438676050522613628423219637725072182697113062777891589506424760n,151655185184498381465642749684540099398075398968325446656007613510403227271200139370504932015952886146304766135027n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620351n,0n],[2973677408986561043442465346520108879172042883009249989176415018091420807192182638567116318576472649347015917690530n,1028732146235106349975324479215795277384839936929757896155643118032610843298655225875571310552543014690878354869257n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350n,0n],[3125332594171059424908108096204648978570118281977575435832422631601824034463382777937621250592425535493320683825557n,877076961050607968509681729531255177986764537961432449499635504522207616027455086505066378536590128544573588734230n],[4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559786n,0n],[151655185184498381465642749684540099398075398968325446656007613510403227271200139370504932015952886146304766135027n,3850754370037169011952147076051364057158807420970682438676050522613628423219637725072182697113062777891589506424760n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n,0n],[1028732146235106349975324479215795277384839936929757896155643118032610843298655225875571310552543014690878354869257n,2973677408986561043442465346520108879172042883009249989176415018091420807192182638567116318576472649347015917690530n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939437n,0n],[877076961050607968509681729531255177986764537961432449499635504522207616027455086505066378536590128544573588734230n,3125332594171059424908108096204648978570118281977575435832422631601824034463382777937621250592425535493320683825557n]]],f=[[[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n]],[[1n,0n],[0n,4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350n,0n],[0n,1n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n,0n],[0n,793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350n]],[[1n,0n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939437n,0n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n,0n],[4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559786n,0n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350n,0n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620351n,0n]]],d=e.addFunction(N+"_frobeniusMap"+a);d.addParam("x","i32"),d.addParam("r","i32");const b=d.getCodeBuilder();for(let c=0;c<6;c++){const s=0==c?b.getLocal("x"):b.i32_add(b.getLocal("x"),b.i32_const(c*i)),l=s,u=b.i32_add(b.getLocal("x"),b.i32_const(c*i+n)),p=0==c?b.getLocal("r"):b.i32_add(b.getLocal("r"),b.i32_const(c*i)),g=p,y=b.i32_add(b.getLocal("r"),b.i32_const(c*i+n)),x=o(t[Math.floor(c/3)][a%12],f[c%3][a%6]),A=e.alloc([...Ve.bigInt2BytesLE(v(x[0]),r),...Ve.bigInt2BytesLE(v(x[1]),r)]);a%2==1?d.addCode(b.call(h+"_copy",l,g),b.call(h+"_neg",u,y),b.call(m+"_mul",p,b.i32_const(A),p)):d.addCode(b.call(m+"_mul",s,b.i32_const(A),p))}function o(e,a){const t=e[0],f=e[1],d=a[0],r=a[1],n=[(t*d-f*r)%c,(t*r+f*d)%c];return ra(n[0])&&(n[0]=n[0]+c),n}}e.modules[t]={n64q:d,n64r:o,n8q:r,n8r:s,pG1gen:_,pG1zero:E,pG1b:p,pG2gen:M,pG2zero:k,pG2b:y,pq:e.modules.f1m.pq,pr:u,pOneT:L,r:f,q:c,prePSize:Q,preQSize:U},function(){const a=e.addFunction(T+"_mul1");a.addParam("pA","i32"),a.addParam("pC1","i32"),a.addParam("pR","i32");const t=a.getCodeBuilder(),c=t.getLocal("pA"),f=t.i32_add(t.getLocal("pA"),t.i32_const(2*n)),d=t.i32_add(t.getLocal("pA"),t.i32_const(4*n)),r=t.getLocal("pC1"),i=t.getLocal("pR"),b=t.i32_add(t.getLocal("pR"),t.i32_const(2*n)),o=t.i32_add(t.getLocal("pR"),t.i32_const(4*n)),s=t.i32_const(e.alloc(2*n)),l=t.i32_const(e.alloc(2*n));a.addCode(t.call(m+"_add",c,f,s),t.call(m+"_add",f,d,l),t.call(m+"_mul",f,r,o),t.call(m+"_mul",l,r,i),t.call(m+"_sub",i,o,i),t.call(m+"_mulNR",i,i),t.call(m+"_mul",s,r,b),t.call(m+"_sub",b,o,b))}(),function(){const a=e.addFunction(T+"_mul01");a.addParam("pA","i32"),a.addParam("pC0","i32"),a.addParam("pC1","i32"),a.addParam("pR","i32");const t=a.getCodeBuilder(),c=t.getLocal("pA"),f=t.i32_add(t.getLocal("pA"),t.i32_const(2*n)),d=t.i32_add(t.getLocal("pA"),t.i32_const(4*n)),r=t.getLocal("pC0"),i=t.getLocal("pC1"),b=t.getLocal("pR"),o=t.i32_add(t.getLocal("pR"),t.i32_const(2*n)),s=t.i32_add(t.getLocal("pR"),t.i32_const(4*n)),l=t.i32_const(e.alloc(2*n)),u=t.i32_const(e.alloc(2*n)),h=t.i32_const(e.alloc(2*n)),p=t.i32_const(e.alloc(2*n));a.addCode(t.call(m+"_mul",c,r,l),t.call(m+"_mul",f,i,u),t.call(m+"_add",c,f,h),t.call(m+"_add",c,d,p),t.call(m+"_add",f,d,b),t.call(m+"_mul",b,i,b),t.call(m+"_sub",b,u,b),t.call(m+"_mulNR",b,b),t.call(m+"_add",b,l,b),t.call(m+"_add",r,i,o),t.call(m+"_mul",o,h,o),t.call(m+"_sub",o,l,o),t.call(m+"_sub",o,u,o),t.call(m+"_mul",p,r,s),t.call(m+"_sub",s,l,s),t.call(m+"_add",s,u,s))}(),function(){const a=e.addFunction(N+"_mul014");a.addParam("pA","i32"),a.addParam("pC0","i32"),a.addParam("pC1","i32"),a.addParam("pC4","i32"),a.addParam("pR","i32");const t=a.getCodeBuilder(),c=t.getLocal("pA"),f=t.i32_add(t.getLocal("pA"),t.i32_const(6*n)),d=t.getLocal("pC0"),r=t.getLocal("pC1"),i=t.getLocal("pC4"),b=t.i32_const(e.alloc(6*n)),o=t.i32_const(e.alloc(6*n)),s=t.i32_const(e.alloc(2*n)),l=t.getLocal("pR"),u=t.i32_add(t.getLocal("pR"),t.i32_const(6*n));a.addCode(t.call(T+"_mul01",c,d,r,b),t.call(T+"_mul1",f,i,o),t.call(m+"_add",r,i,s),t.call(T+"_add",f,c,u),t.call(T+"_mul01",u,d,s,u),t.call(T+"_sub",u,b,u),t.call(T+"_sub",u,o,u),t.call(T+"_copy",o,l),t.call(T+"_mulNR",l,l),t.call(T+"_add",l,b,l))}(),function(){const a=e.addFunction(t+"_ell");a.addParam("pP","i32"),a.addParam("pCoefs","i32"),a.addParam("pF","i32");const c=a.getCodeBuilder(),f=c.getLocal("pP"),d=c.i32_add(c.getLocal("pP"),c.i32_const(r)),i=c.getLocal("pF"),b=c.getLocal("pCoefs"),o=c.i32_add(c.getLocal("pCoefs"),c.i32_const(n)),s=c.i32_add(c.getLocal("pCoefs"),c.i32_const(2*n)),l=c.i32_add(c.getLocal("pCoefs"),c.i32_const(3*n)),u=c.i32_add(c.getLocal("pCoefs"),c.i32_const(4*n)),p=e.alloc(2*n),g=c.i32_const(p),m=c.i32_const(p),y=c.i32_const(p+n),x=e.alloc(2*n),A=c.i32_const(x),v=c.i32_const(x),w=c.i32_const(x+n);a.addCode(c.call(h+"_mul",b,d,m),c.call(h+"_mul",o,d,y),c.call(h+"_mul",s,f,v),c.call(h+"_mul",l,f,w),c.call(N+"_mul014",i,u,A,g,i))}();const $=e.alloc(Q),q=e.alloc(U);function z(a){const c=e.addFunction(t+"_pairingEq"+a);for(let e=0;e0n;){if(da(a)){const e=2-Number(a%4n);t.push(e),a-=BigInt(e)}else t.push(0);a>>=1n}return t}(a).map((e=>-1==e?255:e)),r=e.alloc(d),n=e.addFunction(t+"__cyclotomicExp_"+f);n.addParam("x","i32"),n.addParam("r","i32"),n.addLocal("bit","i32"),n.addLocal("i","i32");const i=n.getCodeBuilder(),o=i.getLocal("x"),s=i.getLocal("r"),l=i.i32_const(e.alloc(b));n.addCode(i.call(N+"_conjugate",o,l),i.call(N+"_one",s),i.if(i.teeLocal("bit",i.i32_load8_s(i.i32_const(d.length-1),r)),i.if(i.i32_eq(i.getLocal("bit"),i.i32_const(1)),i.call(N+"_mul",s,o,s),i.call(N+"_mul",s,l,s))),i.setLocal("i",i.i32_const(d.length-2)),i.block(i.loop(i.call(t+"__cyclotomicSquare",s,s),i.if(i.teeLocal("bit",i.i32_load8_s(i.getLocal("i"),r)),i.if(i.i32_eq(i.getLocal("bit"),i.i32_const(1)),i.call(N+"_mul",s,o,s),i.call(N+"_mul",s,l,s))),i.br_if(1,i.i32_eqz(i.getLocal("i"))),i.setLocal("i",i.i32_sub(i.getLocal("i"),i.i32_const(1))),i.br(0)))),c&&n.addCode(i.call(N+"_conjugate",s,s))}(j,!0,"w0");const a=e.addFunction(t+"_finalExponentiation");a.addParam("x","i32"),a.addParam("r","i32");const c=a.getCodeBuilder(),f=c.getLocal("x"),d=c.getLocal("r"),r=c.i32_const(e.alloc(b)),n=c.i32_const(e.alloc(b)),o=c.i32_const(e.alloc(b)),s=c.i32_const(e.alloc(b)),l=c.i32_const(e.alloc(b)),u=c.i32_const(e.alloc(b)),h=c.i32_const(e.alloc(b));a.addCode(c.call(N+"_frobeniusMap6",f,r),c.call(N+"_inverse",f,n),c.call(N+"_mul",r,n,o),c.call(N+"_copy",o,n),c.call(N+"_frobeniusMap2",o,o),c.call(N+"_mul",o,n,o),c.call(t+"__cyclotomicSquare",o,n),c.call(N+"_conjugate",n,n),c.call(t+"__cyclotomicExp_w0",o,s),c.call(t+"__cyclotomicSquare",s,l),c.call(N+"_mul",n,s,u),c.call(t+"__cyclotomicExp_w0",u,n),c.call(t+"__cyclotomicExp_w0",n,r),c.call(t+"__cyclotomicExp_w0",r,h),c.call(N+"_mul",h,l,h),c.call(t+"__cyclotomicExp_w0",h,l),c.call(N+"_conjugate",u,u),c.call(N+"_mul",l,u,l),c.call(N+"_mul",l,o,l),c.call(N+"_conjugate",o,u),c.call(N+"_mul",n,o,n),c.call(N+"_frobeniusMap3",n,n),c.call(N+"_mul",h,u,h),c.call(N+"_frobeniusMap1",h,h),c.call(N+"_mul",s,r,s),c.call(N+"_frobeniusMap2",s,s),c.call(N+"_mul",s,n,s),c.call(N+"_mul",s,h,s),c.call(N+"_mul",s,l,d))}();for(let a=1;a<=5;a++)z(a),e.exportFunction(t+"_pairingEq"+a);!function(){const a=e.addFunction(t+"_pairing");a.addParam("p","i32"),a.addParam("q","i32"),a.addParam("r","i32");const c=a.getCodeBuilder(),f=c.i32_const(e.alloc(b));a.addCode(c.call(t+"_prepareG1",c.getLocal("p"),c.i32_const($))),a.addCode(c.call(t+"_prepareG2",c.getLocal("q"),c.i32_const(q))),a.addCode(c.call(t+"_millerLoop",c.i32_const($),c.i32_const(q),f)),a.addCode(c.call(t+"_finalExponentiation",f,c.getLocal("r")))}(),e.exportFunction(t+"_pairing"),e.exportFunction(t+"_prepareG1"),e.exportFunction(t+"_prepareG2"),e.exportFunction(t+"_millerLoop"),e.exportFunction(t+"_finalExponentiation"),e.exportFunction(t+"_finalExponentiationOld"),e.exportFunction(t+"__cyclotomicSquare"),e.exportFunction(t+"__cyclotomicExp_w0"),e.exportFunction(T+"_mul1"),e.exportFunction(T+"_mul01"),e.exportFunction(N+"_mul014"),e.exportFunction(g+"_inGroupAffine"),e.exportFunction(g+"_inGroup"),e.exportFunction(x+"_inGroupAffine"),e.exportFunction(x+"_inGroup")};function ba(e,a){let t=e;void 0===a&&0==(a=Math.floor((r(e)-1)/8)+1)&&(a=1);const c=new Uint8Array(a),f=new DataView(c.buffer);let d=0;for(;d>=BigInt(32)):d+2<=a?(f.setUint16(d,Number(t&BigInt(65535)),!0),d+=2,t>>=BigInt(16)):(f.setUint8(d,Number(t&BigInt(255)),!0),d+=1,t>>=BigInt(8));if(t)throw new Error("Number does not fit in this length");return c}const oa=[];for(let e=0;e<256;e++)oa[e]=sa(e,8);function sa(e,a){let t=0,c=e;for(let e=0;e>=1;return t}function la(e,a){return(oa[e>>>24]|oa[e>>>16&255]<<8|oa[e>>>8&255]<<16|oa[255&e]<<24)>>>32-a}function ua(e){return(4294901760&e?(e&=4294901760,16):0)|(4278255360&e?(e&=4278255360,8):0)|(4042322160&e?(e&=4042322160,4):0)|(3435973836&e?(e&=3435973836,2):0)|!!(2863311530&e)}function ha(e,a){const t=e.byteLength/a,c=ua(t);if(t!=1<t){const c=e.slice(f*a,(f+1)*a);e.set(e.slice(t*a,(t+1)*a),f*a),e.set(c,t*a)}}}function pa(e,a){const t=new Uint8Array(a*e.length);for(let c=0;c0;)t>=4?(t-=4,a+=BigInt(f.getUint32(t))<=2?(t-=2,a+=BigInt(f.getUint16(t))<0;)d-4>=0?(d-=4,f.setUint32(d,Number(t&BigInt(4294967295))),t>>=BigInt(32)):d-2>=0?(d-=2,f.setUint16(d,Number(t&BigInt(65535))),t>>=BigInt(16)):(d-=1,f.setUint8(d,Number(t&BigInt(255))),t>>=BigInt(8));if(t)throw new Error("Number does not fit in this length");return c},bitReverse:la,buffReverseBits:ha,buffer2array:ga,leBuff2int:function(e){let a=BigInt(0),t=0;const c=new DataView(e.buffer,e.byteOffset,e.byteLength);for(;t{t[c]=e(a[c])})),t}return a},stringifyFElements:function e(a,t){if("bigint"==typeof t||void 0!==t.eq)return t.toString(10);if(t instanceof Uint8Array)return a.toString(a.e(t));if(Array.isArray(t))return t.map(e.bind(this,a));if("object"==typeof t){const c={};return Object.keys(t).forEach((f=>{c[f]=e(a,t[f])})),c}return t},unstringifyBigInts:function e(a){if("string"==typeof a&&/^[0-9]+$/.test(a))return BigInt(a);if("string"==typeof a&&/^0x[0-9a-fA-F]+$/.test(a))return BigInt(a);if(Array.isArray(a))return a.map(e);if("object"==typeof a){if(null===a)return null;const t={};return Object.keys(a).forEach((c=>{t[c]=e(a[c])})),t}return a},unstringifyFElements:function e(a,t){if("string"==typeof t&&/^[0-9]+$/.test(t))return a.e(t);if("string"==typeof t&&/^0x[0-9a-fA-F]+$/.test(t))return a.e(t);if(Array.isArray(t))return t.map(e.bind(this,a));if("object"==typeof t){if(null===t)return null;const c={};return Object.keys(t).forEach((f=>{c[f]=e(a,t[f])})),c}return t}});const ya=1<<30;class xa{constructor(e){this.buffers=[],this.byteLength=e;for(let a=0;a0;){const e=r+n>ya?ya-r:n,a=new Uint8Array(this.buffers[d].buffer,this.buffers[d].byteOffset+r,e);if(e==t)return a.slice();f||(f=t<=ya?new Uint8Array(t):new xa(t)),f.set(a,t-n),n-=e,d++,r=0}return f}set(e,a){void 0===a&&(a=0);const t=e.byteLength;if(0==t)return;const c=Math.floor(a/ya);if(c==Math.floor((a+t-1)/ya))return e instanceof xa&&1==e.buffers.length?this.buffers[c].set(e.buffers[0],a%ya):this.buffers[c].set(e,a%ya);let f=c,d=a%ya,r=t;for(;r>0;){const a=d+r>ya?ya-d:r,c=e.slice(t-r,t-r+a);new Uint8Array(this.buffers[f].buffer,this.buffers[f].byteOffset+d,a).set(c),r-=a,f++,d=0}}}function Aa(e,a,t,c){return async function(f){const d=Math.floor(f.byteLength/t);if(d*t!==f.byteLength)throw new Error("Invalid buffer size");const r=Math.floor(d/e.concurrency),n=[];for(let i=0;i=0;e--)this.w[e]=this.square(this.w[e+1]);if(!this.eq(this.w[0],this.one))throw new Error("Error calculating roots of unity");this.batchToMontgomery=Aa(e,a+"_batchToMontgomery",this.n8,this.n8),this.batchFromMontgomery=Aa(e,a+"_batchFromMontgomery",this.n8,this.n8)}op2(e,a,t){return this.tm.setBuff(this.pOp1,a),this.tm.setBuff(this.pOp2,t),this.tm.instance.exports[this.prefix+e](this.pOp1,this.pOp2,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}op2Bool(e,a,t){return this.tm.setBuff(this.pOp1,a),this.tm.setBuff(this.pOp2,t),!!this.tm.instance.exports[this.prefix+e](this.pOp1,this.pOp2)}op1(e,a){return this.tm.setBuff(this.pOp1,a),this.tm.instance.exports[this.prefix+e](this.pOp1,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}op1Bool(e,a){return this.tm.setBuff(this.pOp1,a),!!this.tm.instance.exports[this.prefix+e](this.pOp1,this.pOp3)}add(e,a){return this.op2("_add",e,a)}eq(e,a){return this.op2Bool("_eq",e,a)}isZero(e){return this.op1Bool("_isZero",e)}sub(e,a){return this.op2("_sub",e,a)}neg(e){return this.op1("_neg",e)}inv(e){return this.op1("_inverse",e)}toMontgomery(e){return this.op1("_toMontgomery",e)}fromMontgomery(e){return this.op1("_fromMontgomery",e)}mul(e,a){return this.op2("_mul",e,a)}div(e,a){return this.tm.setBuff(this.pOp1,e),this.tm.setBuff(this.pOp2,a),this.tm.instance.exports[this.prefix+"_inverse"](this.pOp2,this.pOp2),this.tm.instance.exports[this.prefix+"_mul"](this.pOp1,this.pOp2,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}square(e){return this.op1("_square",e)}isSquare(e){return this.op1Bool("_isSquare",e)}sqrt(e){return this.op1("_sqrt",e)}exp(e,a){return a instanceof Uint8Array||(a=E(d(a))),this.tm.setBuff(this.pOp1,e),this.tm.setBuff(this.pOp2,a),this.tm.instance.exports[this.prefix+"_exp"](this.pOp1,this.pOp2,a.byteLength,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}isNegative(e){return this.op1Bool("_isNegative",e)}e(e,a){if(e instanceof Uint8Array)return e;let t=d(e,a);n(t)?(t=g(t),x(t,this.p)&&(t=y(t,this.p)),t=p(this.p,t)):x(t,this.p)&&(t=y(t,this.p));const c=ba(t,this.n8);return this.toMontgomery(c)}toString(e,a){return I(_(this.fromMontgomery(e),0),a)}fromRng(e){let a;const t=new Uint8Array(this.n8);do{a=C;for(let t=0;t{this.reject=a,this.resolve=e}))}}const Ba="data:application/javascript;base64,"+globalThis.btoa('(function thread(self) {\n const MAXMEM = 32767;\n let instance;\n let memory;\n\n if (self) {\n self.onmessage = function(e) {\n let data;\n if (e.data) {\n data = e.data;\n } else {\n data = e;\n }\n\n if (data[0].cmd == "INIT") {\n init(data[0]).then(function() {\n self.postMessage(data.result);\n });\n } else if (data[0].cmd == "TERMINATE") {\n self.close();\n } else {\n const res = runTask(data);\n self.postMessage(res);\n }\n };\n }\n\n async function init(data) {\n const code = new Uint8Array(data.code);\n const wasmModule = await WebAssembly.compile(code);\n memory = new WebAssembly.Memory({initial:data.init, maximum: MAXMEM});\n\n instance = await WebAssembly.instantiate(wasmModule, {\n env: {\n "memory": memory\n }\n });\n }\n\n\n\n function alloc(length) {\n const u32 = new Uint32Array(memory.buffer, 0, 1);\n while (u32[0] & 3) u32[0]++; // Return always aligned pointers\n const res = u32[0];\n u32[0] += length;\n if (u32[0] + length > memory.buffer.byteLength) {\n const currentPages = memory.buffer.byteLength / 0x10000;\n let requiredPages = Math.floor((u32[0] + length) / 0x10000)+1;\n if (requiredPages>MAXMEM) requiredPages=MAXMEM;\n memory.grow(requiredPages-currentPages);\n }\n return res;\n }\n\n function allocBuffer(buffer) {\n const p = alloc(buffer.byteLength);\n setBuffer(p, buffer);\n return p;\n }\n\n function getBuffer(pointer, length) {\n const u8 = new Uint8Array(memory.buffer);\n return new Uint8Array(u8.buffer, u8.byteOffset + pointer, length);\n }\n\n function setBuffer(pointer, buffer) {\n const u8 = new Uint8Array(memory.buffer);\n u8.set(new Uint8Array(buffer), pointer);\n }\n\n function runTask(task) {\n if (task[0].cmd == "INIT") {\n return init(task[0]);\n }\n const ctx = {\n vars: [],\n out: []\n };\n const u32a = new Uint32Array(memory.buffer, 0, 1);\n const oldAlloc = u32a[0];\n for (let i=0; i0;e++)if(0==this.working[e]){const a=this.actionQueue.shift();this.postAction(e,a.data,a.transfers,a.deferred)}}queueAction(e,a){const t=new Ma;if(this.singleThread){const a=this.taskManager(e);t.resolve(a)}else this.actionQueue.push({data:e,transfers:a,deferred:t}),this.processWorks();return t.promise}resetMemory(){this.u32[0]=this.initalPFree}allocBuff(e){const a=this.alloc(e.byteLength);return this.setBuff(a,e),a}getBuff(e,a){return this.u8.slice(e,e+a)}setBuff(e,a){this.u8.set(new Uint8Array(a),e)}alloc(e){for(;3&this.u32[0];)this.u32[0]++;const a=this.u32[0];return this.u32[0]+=e,a}async terminate(){for(let e=0;esetTimeout(e,200)))}}function La(e,a){const t=e[a],c=e.Fr,f=e.tm;e[a].batchApplyKey=async function(e,d,r,n,i){let b,o,s,l,u;if(n=n||"affine",i=i||"affine","G1"==a)"jacobian"==n?(s=3*t.F.n8,b="g1m_batchApplyKey"):(s=2*t.F.n8,b="g1m_batchApplyKeyMixed"),l=3*t.F.n8,"jacobian"==i?u=3*t.F.n8:(o="g1m_batchToAffine",u=2*t.F.n8);else if("G2"==a)"jacobian"==n?(s=3*t.F.n8,b="g2m_batchApplyKey"):(s=2*t.F.n8,b="g2m_batchApplyKeyMixed"),l=3*t.F.n8,"jacobian"==i?u=3*t.F.n8:(o="g2m_batchToAffine",u=2*t.F.n8);else{if("Fr"!=a)throw new Error("Invalid group: "+a);b="frm_batchApplyKey",s=t.n8,l=t.n8,u=t.n8}const h=Math.floor(e.byteLength/s),p=Math.floor(h/f.concurrency),g=[];r=c.e(r);let m=c.e(d);for(let a=0;a=0;e--){if(!t.isZero(p))for(let e=0;eb&&(p=b),p<1024&&(p=1024);const g=[];for(let a=0;a(n&&n.debug(`Multiexp end: ${i}: ${a}/${s}`),e))))}const m=await Promise.all(g);let y=t.zero;for(let e=m.length-1;e>=0;e--)y=t.add(y,m[e]);return y}t.multiExp=async function(e,a,t,c){return await d(e,a,"jacobian",t,c)},t.multiExpAffine=async function(e,a,t,c){return await d(e,a,"affine",t,c)}}function Na(e,a){const t=e[a],c=e.Fr,f=t.tm;async function d(e,n,i,b,o,s){let l,u,h,p,g,m,y,x;i=i||"affine",b=b||"affine","G1"==a?("affine"==i?(l=2*t.F.n8,p="g1m_batchToJacobian"):l=3*t.F.n8,u=3*t.F.n8,n&&(x="g1m_fftFinal"),y="g1m_fftJoin",m="g1m_fftMix","affine"==b?(h=2*t.F.n8,g="g1m_batchToAffine"):h=3*t.F.n8):"G2"==a?("affine"==i?(l=2*t.F.n8,p="g2m_batchToJacobian"):l=3*t.F.n8,u=3*t.F.n8,n&&(x="g2m_fftFinal"),y="g2m_fftJoin",m="g2m_fftMix","affine"==b?(h=2*t.F.n8,g="g2m_batchToAffine"):h=3*t.F.n8):"Fr"==a&&(l=t.n8,u=t.n8,h=t.n8,n&&(x="frm_fftFinal"),m="frm_fftMix",y="frm_fftJoin");let A=!1;Array.isArray(e)?(e=pa(e,l),A=!0):e=e.slice(0,e.byteLength);const v=e.byteLength/l,w=ua(v);if(1<1<<28?new xa(2*s[0].byteLength):new Uint8Array(2*s[0].byteLength),l.set(s[0]),l.set(s[1],s[0].byteLength),l}(e,i,b,o,s):await async function(e,a,t,f,n){let i,b;i=e.slice(0,e.byteLength/2),b=e.slice(e.byteLength/2,e.byteLength);const o=[];[i,b]=await r(i,b,"fftJoinExt",c.one,c.shift,a,"jacobian",f,n),o.push(d(i,!1,"jacobian",t,f,n)),o.push(d(b,!1,"jacobian",t,f,n));const s=await Promise.all(o);let l;return l=s[0].byteLength>1<<28?new xa(2*s[0].byteLength):new Uint8Array(2*s[0].byteLength),l.set(s[0]),l.set(s[1],s[0].byteLength),l}(e,i,b,o,s),A?ga(a,h):a}let _,I,E;n&&(_=c.inv(c.e(v))),ha(e,l);let C=Math.min(16384,v),M=v/C;for(;M=16;)M*=2,C/=2;const B=ua(C),k=[];for(let a=0;a(o&&o.debug(`${s}: fft ${w} mix end: ${a}/${M}`),e))))}E=await Promise.all(k);for(let e=0;e(o&&o.debug(`${s}: fft ${w} join ${e}/${w} ${r+1}/${a} ${n}/${t/2}`),c))))}const r=await Promise.all(d);for(let e=0;e0;a--)I.set(E[a],e),e+=C*h,delete E[a];I.set(E[0].slice(0,(C-1)*h),e),delete E[0]}else for(let e=0;e65536&&(A=65536);const v=[];for(let a=0;a(s&&s.debug(`${l}: fftJoinExt End: ${a}/${x}`),e))))}const w=await Promise.all(v);let _,I;x*g>1<<28?(_=new xa(x*g),I=new xa(x*g)):(_=new Uint8Array(x*g),I=new Uint8Array(x*g));let E=0;for(let e=0;ec.s+1)throw i&&i.error("lagrangeEvaluations input too big"),new Error("lagrangeEvaluations input too big");let u=e.slice(0,e.byteLength/2),h=e.slice(e.byteLength/2,e.byteLength);const p=c.exp(c.shift,s/2),g=c.inv(c.sub(c.one,p));[u,h]=await r(u,h,"prepareLagrangeEvaluation",g,c.shiftInv,f,"jacobian",i,b+" prep");const m=[];let y;return m.push(d(u,!0,"jacobian",n,i,b+" t0")),m.push(d(h,!0,"jacobian",n,i,b+" t1")),[u,h]=await Promise.all(m),y=u.byteLength>1<<28?new xa(2*u.byteLength):new Uint8Array(2*u.byteLength),y.set(u),y.set(h,u.byteLength),y},t.fftMix=async function(e){const d=3*t.F.n8;let r,n;if("G1"==a)r="g1m_fftMix",n="g1m_fftJoin";else if("G2"==a)r="g2m_fftMix",n="g2m_fftJoin";else{if("Fr"!=a)throw new Error("Invalid group");r="frm_fftMix",n="frm_fftJoin"}const i=Math.floor(e.byteLength/d),b=ua(i);let o=1<=0;e--)u.set(l[e][0],h),h+=l[e][0].byteLength;return u}}async function Ra(e){const a=await async function(e,a){const t=new ka;t.memory=new WebAssembly.Memory({initial:Ca}),t.u8=new Uint8Array(t.memory.buffer),t.u32=new Uint32Array(t.memory.buffer);const c=await WebAssembly.compile(e.code);if(t.instance=await WebAssembly.instantiate(c,{env:{memory:t.memory}}),t.singleThread=a,t.initalPFree=t.u32[0],t.pq=e.pq,t.pr=e.pr,t.pG1gen=e.pG1gen,t.pG1zero=e.pG1zero,t.pG2gen=e.pG2gen,t.pG2zero=e.pG2zero,t.pOneT=e.pOneT,a)t.code=e.code,t.taskManager=function(){const e=32767;let a,t;async function c(c){const f=new Uint8Array(c.code),d=await WebAssembly.compile(f);t=new WebAssembly.Memory({initial:c.init,maximum:e}),a=await WebAssembly.instantiate(d,{env:{memory:t}})}function f(a){const c=new Uint32Array(t.buffer,0,1);for(;3&c[0];)c[0]++;const f=c[0];if(c[0]+=a,c[0]+a>t.buffer.byteLength){const f=t.buffer.byteLength/65536;let d=Math.floor((c[0]+a)/65536)+1;d>e&&(d=e),t.grow(d-f)}return f}function d(e){const a=f(e.byteLength);return n(a,e),a}function r(e,a){const c=new Uint8Array(t.buffer);return new Uint8Array(c.buffer,c.byteOffset+e,a)}function n(e,a){new Uint8Array(t.buffer).set(new Uint8Array(a),e)}function i(e){if("INIT"==e[0].cmd)return c(e[0]);const i={vars:[],out:[]},b=new Uint32Array(t.buffer,0,1)[0];for(let t=0;t64&&(a=64),t.concurrency=a;for(let e=0;e>8n&0xFFn)),a.push(Number(t>>16n&0xFFn)),a.push(Number(t>>24n&0xFFn)),a}function Qa(e){const a=function(e){for(var a=[],t=0;t>6,128|63&c):c<55296||c>=57344?a.push(224|c>>12,128|c>>6&63,128|63&c):(t++,c=65536+((1023&c)<<10|1023&e.charCodeAt(t)),a.push(240|c>>18,128|c>>12&63,128|c>>6&63,128|63&c))}return a}(e);return[...qa(a.length),...a]}function Ua(e){const a=[];let t=Pa(e);if(Da(t))throw new Error("Number cannot be negative");for(;!Oa(t);)a.push(Number(0x7Fn&t)),t>>=7n;0==a.length&&a.push(0);for(let e=0;e0xFFFFFFFFn)throw new Error("Number too big");if(a>0x7FFFFFFFn&&(a-=0x100000000n),a<-2147483648n)throw new Error("Number too small");return ja(a)}function $a(e){let a=Pa(e);if(a>0xFFFFFFFFFFFFFFFFn)throw new Error("Number too big");if(a>0x7FFFFFFFFFFFFFFFn&&(a-=0x10000000000000000n),a<-9223372036854775808n)throw new Error("Number too small");return ja(a)}function qa(e){let a=Pa(e);if(a>0xFFFFFFFFn)throw new Error("Number too big");return Ua(a)}function za(e){return Array.from(e,(function(e){return("0"+(255&e).toString(16)).slice(-2)})).join("")}class Ga{constructor(e){this.func=e,this.functionName=e.functionName,this.module=e.module}setLocal(e,a){const t=this.func.localIdxByName[e];if(void 0===t)throw new Error(`Local Variable not defined: Function: ${this.functionName} local: ${e} `);return[...a,33,...qa(t)]}teeLocal(e,a){const t=this.func.localIdxByName[e];if(void 0===t)throw new Error(`Local Variable not defined: Function: ${this.functionName} local: ${e} `);return[...a,34,...qa(t)]}getLocal(e){const a=this.func.localIdxByName[e];if(void 0===a)throw new Error(`Local Variable not defined: Function: ${this.functionName} local: ${e} `);return[32,...qa(a)]}i64_load8_s(e,a,t){return[...e,48,void 0===t?0:t,...qa(a||0)]}i64_load8_u(e,a,t){return[...e,49,void 0===t?0:t,...qa(a||0)]}i64_load16_s(e,a,t){return[...e,50,void 0===t?1:t,...qa(a||0)]}i64_load16_u(e,a,t){return[...e,51,void 0===t?1:t,...qa(a||0)]}i64_load32_s(e,a,t){return[...e,52,void 0===t?2:t,...qa(a||0)]}i64_load32_u(e,a,t){return[...e,53,void 0===t?2:t,...qa(a||0)]}i64_load(e,a,t){return[...e,41,void 0===t?3:t,...qa(a||0)]}i64_store(e,a,t,c){let f,d,r;return Array.isArray(a)?(f=0,d=3,r=a):Array.isArray(t)?(f=a,d=3,r=t):Array.isArray(c)&&(f=a,d=t,r=c),[...e,...r,55,d,...qa(f)]}i64_store32(e,a,t,c){let f,d,r;return Array.isArray(a)?(f=0,d=2,r=a):Array.isArray(t)?(f=a,d=2,r=t):Array.isArray(c)&&(f=a,d=t,r=c),[...e,...r,62,d,...qa(f)]}i64_store16(e,a,t,c){let f,d,r;return Array.isArray(a)?(f=0,d=1,r=a):Array.isArray(t)?(f=a,d=1,r=t):Array.isArray(c)&&(f=a,d=t,r=c),[...e,...r,61,d,...qa(f)]}i64_store8(e,a,t,c){let f,d,r;return Array.isArray(a)?(f=0,d=0,r=a):Array.isArray(t)?(f=a,d=0,r=t):Array.isArray(c)&&(f=a,d=t,r=c),[...e,...r,60,d,...qa(f)]}i32_load8_s(e,a,t){return[...e,44,void 0===t?0:t,...qa(a||0)]}i32_load8_u(e,a,t){return[...e,45,void 0===t?0:t,...qa(a||0)]}i32_load16_s(e,a,t){return[...e,46,void 0===t?1:t,...qa(a||0)]}i32_load16_u(e,a,t){return[...e,47,void 0===t?1:t,...qa(a||0)]}i32_load(e,a,t){return[...e,40,void 0===t?2:t,...qa(a||0)]}i32_store(e,a,t,c){let f,d,r;return Array.isArray(a)?(f=0,d=2,r=a):Array.isArray(t)?(f=a,d=2,r=t):Array.isArray(c)&&(f=a,d=t,r=c),[...e,...r,54,d,...qa(f)]}i32_store16(e,a,t,c){let f,d,r;return Array.isArray(a)?(f=0,d=1,r=a):Array.isArray(t)?(f=a,d=1,r=t):Array.isArray(c)&&(f=a,d=t,r=c),[...e,...r,59,d,...qa(f)]}i32_store8(e,a,t,c){let f,d,r;return Array.isArray(a)?(f=0,d=0,r=a):Array.isArray(t)?(f=a,d=0,r=t):Array.isArray(c)&&(f=a,d=t,r=c),[...e,...r,58,d,...qa(f)]}call(e,...a){const t=this.module.functionIdxByName[e];if(void 0===t)throw new Error(`Function not defined: Function: ${e}`);return[...[].concat(...a),16,...qa(t)]}call_indirect(e,...a){return[...[].concat(...a),...e,17,0,0]}if(e,a,t){return t?[...e,4,64,...a,5,...t,11]:[...e,4,64,...a,11]}block(e){return[2,64,...e,11]}loop(...e){return[3,64,...[].concat(...e),11]}br_if(e,a){return[...a,13,...qa(e)]}br(e){return[12,...qa(e)]}ret(e){return[...e,15]}drop(e){return[...e,26]}i64_const(e){return[66,...$a(e)]}i32_const(e){return[65,...Ha(e)]}i64_eqz(e){return[...e,80]}i64_eq(e,a){return[...e,...a,81]}i64_ne(e,a){return[...e,...a,82]}i64_lt_s(e,a){return[...e,...a,83]}i64_lt_u(e,a){return[...e,...a,84]}i64_gt_s(e,a){return[...e,...a,85]}i64_gt_u(e,a){return[...e,...a,86]}i64_le_s(e,a){return[...e,...a,87]}i64_le_u(e,a){return[...e,...a,88]}i64_ge_s(e,a){return[...e,...a,89]}i64_ge_u(e,a){return[...e,...a,90]}i64_add(e,a){return[...e,...a,124]}i64_sub(e,a){return[...e,...a,125]}i64_mul(e,a){return[...e,...a,126]}i64_div_s(e,a){return[...e,...a,127]}i64_div_u(e,a){return[...e,...a,128]}i64_rem_s(e,a){return[...e,...a,129]}i64_rem_u(e,a){return[...e,...a,130]}i64_and(e,a){return[...e,...a,131]}i64_or(e,a){return[...e,...a,132]}i64_xor(e,a){return[...e,...a,133]}i64_shl(e,a){return[...e,...a,134]}i64_shr_s(e,a){return[...e,...a,135]}i64_shr_u(e,a){return[...e,...a,136]}i64_extend_i32_s(e){return[...e,172]}i64_extend_i32_u(e){return[...e,173]}i64_clz(e){return[...e,121]}i64_ctz(e){return[...e,122]}i32_eqz(e){return[...e,69]}i32_eq(e,a){return[...e,...a,70]}i32_ne(e,a){return[...e,...a,71]}i32_lt_s(e,a){return[...e,...a,72]}i32_lt_u(e,a){return[...e,...a,73]}i32_gt_s(e,a){return[...e,...a,74]}i32_gt_u(e,a){return[...e,...a,75]}i32_le_s(e,a){return[...e,...a,76]}i32_le_u(e,a){return[...e,...a,77]}i32_ge_s(e,a){return[...e,...a,78]}i32_ge_u(e,a){return[...e,...a,79]}i32_add(e,a){return[...e,...a,106]}i32_sub(e,a){return[...e,...a,107]}i32_mul(e,a){return[...e,...a,108]}i32_div_s(e,a){return[...e,...a,109]}i32_div_u(e,a){return[...e,...a,110]}i32_rem_s(e,a){return[...e,...a,111]}i32_rem_u(e,a){return[...e,...a,112]}i32_and(e,a){return[...e,...a,113]}i32_or(e,a){return[...e,...a,114]}i32_xor(e,a){return[...e,...a,115]}i32_shl(e,a){return[...e,...a,116]}i32_shr_s(e,a){return[...e,...a,117]}i32_shr_u(e,a){return[...e,...a,118]}i32_rotl(e,a){return[...e,...a,119]}i32_rotr(e,a){return[...e,...a,120]}i32_wrap_i64(e){return[...e,167]}i32_clz(e){return[...e,103]}i32_ctz(e){return[...e,104]}unreachable(){return[0]}current_memory(){return[63,0]}comment(){return[]}}const Ka={i32:127,i64:126,f32:125,f64:124,anyfunc:112,func:96,emptyblock:64};class Va{constructor(e,a,t,c,f){if("import"==t)this.fnType="import",this.moduleName=c,this.fieldName=f;else{if("internal"!=t)throw new Error("Invalid function fnType: "+t);this.fnType="internal"}this.module=e,this.fnName=a,this.params=[],this.locals=[],this.localIdxByName={},this.code=[],this.returnType=null,this.nextLocal=0}addParam(e,a){if(this.localIdxByName[e])throw new Error(`param already exists. Function: ${this.fnName}, Param: ${e} `);const t=this.nextLocal++;this.localIdxByName[e]=t,this.params.push({type:a})}addLocal(e,a,t){const c=t||1;if(this.localIdxByName[e])throw new Error(`local already exists. Function: ${this.fnName}, Param: ${e} `);const f=this.nextLocal++;this.localIdxByName[e]=f,this.locals.push({type:a,length:c})}setReturnType(e){if(this.returnType)throw new Error(`returnType already defined. Function: ${this.fnName}`);this.returnType=e}getSignature(){return[96,...qa(this.params.length),...this.params.map((e=>Ka[e.type])),...this.returnType?[1,Ka[this.returnType]]:[0]]}getBody(){const e=this.locals.map((e=>[...qa(e.length),Ka[e.type]])),a=[...qa(this.locals.length),...[].concat(...e),...this.code,11];return[...qa(a.length),...a]}addCode(...e){this.code.push(...[].concat(...e))}getCodeBuilder(){return new Ga(this)}}class Za{constructor(){this.functions=[],this.functionIdxByName={},this.nImportFunctions=0,this.nInternalFunctions=0,this.memory={pagesSize:1,moduleName:"env",fieldName:"memory"},this.free=8,this.datas=[],this.modules={},this.exports=[],this.functionsTable=[]}build(){return this._setSignatures(),new Uint8Array([...Fa(1836278016),...Fa(1),...this._buildType(),...this._buildImport(),...this._buildFunctionDeclarations(),...this._buildFunctionsTable(),...this._buildExports(),...this._buildElements(),...this._buildCode(),...this._buildData()])}addFunction(e){if(void 0!==this.functionIdxByName[e])throw new Error(`Function already defined: ${e}`);const a=this.functions.length;return this.functionIdxByName[e]=a,this.functions.push(new Va(this,e,"internal")),this.nInternalFunctions++,this.functions[a]}addIimportFunction(e,a,t){if(void 0!==this.functionIdxByName[e])throw new Error(`Function already defined: ${e}`);if(this.functions.length>0&&"internal"==this.functions[this.functions.length-1].type)throw new Error(`Import functions must be declared before internal: ${e}`);let c=t||e;const f=this.functions.length;return this.functionIdxByName[e]=f,this.functions.push(new Va(this,e,"import",a,c)),this.nImportFunctions++,this.functions[f]}setMemory(e,a,t){this.memory={pagesSize:e,moduleName:a||"env",fieldName:t||"memory"}}exportFunction(e,a){const t=a||e;if(void 0===this.functionIdxByName[e])throw new Error(`Function not defined: ${e}`);const c=this.functionIdxByName[e];t!=e&&(this.functionIdxByName[t]=c),this.exports.push({exportName:t,idx:c})}addFunctionToTable(e){const a=this.functionIdxByName[e];this.functionsTable.push(a)}addData(e,a){this.datas.push({offset:e,bytes:a})}alloc(e,a){let t,c;(Array.isArray(e)||ArrayBuffer.isView(e))&&void 0===a?(t=e.length,c=e):(t=e,c=a),t=1+(t-1>>3)<<3;const f=this.free;return this.free+=t,c&&this.addData(f,c),f}allocString(e){const a=(new globalThis.TextEncoder).encode(e);return this.alloc([...a,0])}_setSignatures(){this.signatures=[];const e={};if(this.functionsTable.length>0){const a=this.functions[this.functionsTable[0]].getSignature();e["s_"+za(a)]=0,this.signatures.push(a)}for(let a=0;a=0)c=await async function(e,a){if(!e&&globalThis.curve_bn128)return globalThis.curve_bn128;const t=new Za;t.setMemory(25),na(t),a&&a(t);const c={};c.code=t.build(),c.pq=t.modules.f1m.pq,c.pr=t.modules.frm.pq,c.pG1gen=t.modules.bn128.pG1gen,c.pG1zero=t.modules.bn128.pG1zero,c.pG1b=t.modules.bn128.pG1b,c.pG2gen=t.modules.bn128.pG2gen,c.pG2zero=t.modules.bn128.pG2zero,c.pG2b=t.modules.bn128.pG2b,c.pOneT=t.modules.bn128.pOneT,c.prePSize=t.modules.bn128.prePSize,c.preQSize=t.modules.bn128.preQSize,c.n8q=32,c.n8r=32,c.q=t.modules.bn128.q,c.r=t.modules.bn128.r;const f={name:"bn128",wasm:c,q:d("21888242871839275222246405745257275088696311157297823662689037894645226208583"),r:d("21888242871839275222246405745257275088548364400416034343698204186575808495617"),n8q:32,n8r:32,cofactorG2:d("30644e72e131a029b85045b68181585e06ceecda572a2489345f2299c0f9fa8d",16),singleThread:!!e},r=await Ra(f);return r.terminate=async function(){f.singleThread||(globalThis.curve_bn128=null,await this.tm.terminate())},e||(globalThis.curve_bn128=r),r}(a,t);else{if(!(["BLS12381"].indexOf(f)>=0))throw new Error(`Curve not supported: ${e}`);c=await async function(e,a){if(!e&&globalThis.curve_bls12381)return globalThis.curve_bls12381;const t=new Za;t.setMemory(25),ia(t),a&&a(t);const c={};c.code=t.build(),c.pq=t.modules.f1m.pq,c.pr=t.modules.frm.pq,c.pG1gen=t.modules.bls12381.pG1gen,c.pG1zero=t.modules.bls12381.pG1zero,c.pG1b=t.modules.bls12381.pG1b,c.pG2gen=t.modules.bls12381.pG2gen,c.pG2zero=t.modules.bls12381.pG2zero,c.pG2b=t.modules.bls12381.pG2b,c.pOneT=t.modules.bls12381.pOneT,c.prePSize=t.modules.bls12381.prePSize,c.preQSize=t.modules.bls12381.preQSize,c.n8q=48,c.n8r=32,c.q=t.modules.bls12381.q,c.r=t.modules.bls12381.r;const f={name:"bls12381",wasm:c,q:d("1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab",16),r:d("73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001",16),n8q:48,n8r:32,cofactorG1:d("0x396c8c005555e1568c00aaab0000aaab",16),cofactorG2:d("0x5d543a95414e7f1091d50792876a202cd91de4547085abaa68a205b2e5a7ddfa628f1cb4d9e82ef21537e293a6691ae1616ec6e786f0c70cf1c38e31c7238e5",16),singleThread:!!e},r=await Ra(f);return r.terminate=async function(){f.singleThread||(globalThis.curve_bls12381=null,await this.tm.terminate())},e||(globalThis.curve_bls12381=r),r}(a,t)}return c}globalThis.curve_bn128=null,globalThis.curve_bls12381=null,d("73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001",16),d("21888242871839275222246405745257275088548364400416034343698204186575808495617"),d("1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab",16),d("21888242871839275222246405745257275088696311157297823662689037894645226208583");const Wa=B,Ya=ma;class Xa{constructor(e){this.F=e,this.p=Wa.fromString("21888242871839275222246405745257275088548364400416034343698204186575808495617"),this.pm1d2=Wa.div(Wa.sub(this.p,Wa.e(1)),Wa.e(2)),this.Generator=[e.e("995203441582195749578291179787384436505546430278305826713579947235728471134"),e.e("5472060717959818805561601436314318772137091100104008585924551046643952123905")],this.Base8=[e.e("5299619240641551281634865583518297030282874472190772894086521144482721001553"),e.e("16950150798460657717958625567821834550301663161624707787222815936182638968203")],this.order=Wa.fromString("21888242871839275222246405745257275088614511777268538073601725287587578984328"),this.subOrder=Wa.shiftRight(this.order,3),this.A=e.e("168700"),this.D=e.e("168696")}addPoint(e,a){const t=this.F,c=[],f=t.mul(e[0],a[1]),d=t.mul(e[1],a[0]),r=t.mul(t.sub(e[1],t.mul(this.A,e[0])),t.add(a[0],a[1])),n=t.mul(f,d),i=t.mul(this.D,n);return c[0]=t.div(t.add(f,d),t.add(t.one,i)),c[1]=t.div(t.add(r,t.sub(t.mul(this.A,f),d)),t.sub(t.one,i)),c}mulPointEscalar(e,a){const t=this.F;let c=[t.e("0"),t.e("1")],f=a,d=e;for(;!Wa.isZero(f);)Wa.isOdd(f)&&(c=this.addPoint(c,d)),d=this.addPoint(d,d),f=Wa.shiftRight(f,1);return c}inSubgroup(e){const a=this.F;if(!this.inCurve(e))return!1;const t=this.mulPointEscalar(e,this.subOrder);return a.isZero(t[0])&&a.eq(t[1],a.one)}inCurve(e){const a=this.F,t=a.square(e[0]),c=a.square(e[1]);return!!a.eq(a.add(a.mul(this.A,t),c),a.add(a.one,a.mul(a.mul(t,c),this.D)))}packPoint(e){const a=this.F,t=new Uint8Array(32);a.toRprLE(t,0,e[1]);const c=a.toObject(e[0]);return Wa.gt(c,this.pm1d2)&&(t[31]=128|t[31]),t}unpackPoint(e){const a=this.F;let t=!1;const c=new Array(2);if(128&e[31]&&(t=!0,e[31]=127&e[31]),c[1]=a.fromRprLE(e,0),Wa.gt(a.toObject(c[1]),this.p))return null;const f=a.square(c[1]),d=a.div(a.sub(a.one,f),a.sub(this.A,a.mul(this.D,f))),r=a.exp(d,a.half);if(!a.eq(a.one,r))return null;let n=a.sqrt(d);return null==n?null:(t&&(n=a.neg(n)),c[0]=n,c)}}var et=t(72206),at=t(60654),tt=t(62045).hp;async function ct(){const e=await async function(){const e=await Ja("bn128",!0);return new Xa(e.Fr)}();return new ft(e)}class ft{constructor(e){this.babyJub=e,this.bases=[]}baseHash(e,a){return"blake"==e?at("blake256").update(a).digest():"blake2b"==e?tt.from(et(32).update(tt.from(a)).digest()):void 0}hash(e,a){(a=a||{}).baseHash=a.baseHash||"blake";const t=this.babyJub,c=this.buffer2bits(e),f=Math.floor((c.length-1)/200)+1;let d=[t.F.zero,t.F.one];for(let e=0;e>1,a[8*t+2]=(4&c)>>2,a[8*t+3]=(8&c)>>3,a[8*t+4]=(16&c)>>4,a[8*t+5]=(32&c)>>5,a[8*t+6]=(64&c)>>6,a[8*t+7]=(128&c)>>7}return a}}var dt=t(31176),rt=t.n(dt);let nt=!1,it=!1;const bt={debug:1,default:2,info:2,warning:3,error:4,off:5};let ot=bt.default,st=null;const lt=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((a=>{try{if("test"!=="test".normalize(a))throw new Error("bad normalize")}catch(t){e.push(a)}})),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}();var ut,ht;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(ut||(ut={})),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"}(ht||(ht={}));const pt="0123456789abcdef";class gt{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,a){const t=e.toLowerCase();null==bt[t]&&this.throwArgumentError("invalid log level name","logLevel",e),ot>bt[t]||console.log.apply(console,a)}debug(...e){this._log(gt.levels.DEBUG,e)}info(...e){this._log(gt.levels.INFO,e)}warn(...e){this._log(gt.levels.WARNING,e)}makeError(e,a,t){if(it)return this.makeError("censored error",a,{});a||(a=gt.errors.UNKNOWN_ERROR),t||(t={});const c=[];Object.keys(t).forEach((e=>{const a=t[e];try{if(a instanceof Uint8Array){let t="";for(let e=0;e>4],t+=pt[15&a[e]];c.push(e+"=Uint8Array(0x"+t+")")}else c.push(e+"="+JSON.stringify(a))}catch(a){c.push(e+"="+JSON.stringify(t[e].toString()))}})),c.push(`code=${a}`),c.push(`version=${this.version}`);const f=e;let d="";switch(a){case ht.NUMERIC_FAULT:{d="NUMERIC_FAULT";const a=e;switch(a){case"overflow":case"underflow":case"division-by-zero":d+="-"+a;break;case"negative-power":case"negative-width":d+="-unsupported";break;case"unbound-bitwise-result":d+="-unbound-result"}break}case ht.CALL_EXCEPTION:case ht.INSUFFICIENT_FUNDS:case ht.MISSING_NEW:case ht.NONCE_EXPIRED:case ht.REPLACEMENT_UNDERPRICED:case ht.TRANSACTION_REPLACED:case ht.UNPREDICTABLE_GAS_LIMIT:d=a}d&&(e+=" [ See: https://links.ethers.org/v5-errors-"+d+" ]"),c.length&&(e+=" ("+c.join(", ")+")");const r=new Error(e);return r.reason=f,r.code=a,Object.keys(t).forEach((function(e){r[e]=t[e]})),r}throwError(e,a,t){throw this.makeError(e,a,t)}throwArgumentError(e,a,t){return this.throwError(e,gt.errors.INVALID_ARGUMENT,{argument:a,value:t})}assert(e,a,t,c){e||this.throwError(a,t,c)}assertArgument(e,a,t,c){e||this.throwArgumentError(a,t,c)}checkNormalize(e){null==e&&(e="platform missing String.prototype.normalize"),lt&&this.throwError("platform missing String.prototype.normalize",gt.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:lt})}checkSafeUint53(e,a){"number"==typeof e&&(null==a&&(a="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(a,gt.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(a,gt.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,a,t){t=t?": "+t:"",ea&&this.throwError("too many arguments"+t,gt.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:a})}checkNew(e,a){e!==Object&&null!=e||this.throwError("missing new",gt.errors.MISSING_NEW,{name:a.name})}checkAbstract(e,a){e===a?this.throwError("cannot instantiate abstract class "+JSON.stringify(a.name)+" directly; use a sub-class",gt.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",gt.errors.MISSING_NEW,{name:a.name})}static globalLogger(){return st||(st=new gt("logger/5.7.0")),st}static setCensorship(e,a){if(!e&&a&&this.globalLogger().throwError("cannot permanently disable censorship",gt.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),nt){if(!e)return;this.globalLogger().throwError("error censorship permanent",gt.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}it=!!e,nt=!!a}static setLogLevel(e){const a=bt[e.toLowerCase()];null!=a?ot=a:gt.globalLogger().warn("invalid log level - "+e)}static from(e){return new gt(e)}}gt.errors=ht,gt.levels=ut;const mt=new gt("bytes/5.7.0");function yt(e){return e.slice||(e.slice=function(){const a=Array.prototype.slice.call(arguments);return yt(new Uint8Array(Array.prototype.slice.apply(e,a)))}),e}function xt(e){return"number"==typeof e&&e==e&&e%1==0}function At(e,a){if(a||(a={}),"number"==typeof e){mt.checkSafeUint53(e,"invalid arrayify value");const a=[];for(;e;)a.unshift(255&e),e=parseInt(String(e/256));return 0===a.length&&a.push(0),yt(new Uint8Array(a))}if(a.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),function(e){return!!e.toHexString}(e)&&(e=e.toHexString()),function(e,a){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||a&&e.length!==2+2*a)}(e)){let t=e.substring(2);t.length%2&&("left"===a.hexPad?t="0"+t:"right"===a.hexPad?t+="0":mt.throwArgumentError("hex data is odd-length","value",e));const c=[];for(let e=0;e=256)return!1}return!0}(e)?yt(new Uint8Array(e)):mt.throwArgumentError("invalid arrayify value","value",e)}function vt(e){return"0x"+rt().keccak_256(At(e))}const wt=new gt("strings/5.7.0");var _t,It;function Et(e,a,t,c,f){if(e===It.BAD_PREFIX||e===It.UNEXPECTED_CONTINUE){let e=0;for(let c=a+1;c>6==2;c++)e++;return e}return e===It.OVERRUN?t.length-a-1:0}function Ct(e,a=_t.current){a!=_t.current&&(wt.checkNormalize(),e=e.normalize(a));let t=[];for(let a=0;a>6|192),t.push(63&c|128);else if(55296==(64512&c)){a++;const f=e.charCodeAt(a);if(a>=e.length||56320!=(64512&f))throw new Error("invalid utf-8 string");const d=65536+((1023&c)<<10)+(1023&f);t.push(d>>18|240),t.push(d>>12&63|128),t.push(d>>6&63|128),t.push(63&d|128)}else t.push(c>>12|224),t.push(c>>6&63|128),t.push(63&c|128)}return At(t)}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(_t||(_t={})),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"}(It||(It={})),Object.freeze({error:function(e,a,t,c,f){return wt.throwArgumentError(`invalid codepoint at offset ${a}; ${e}`,"bytes",t)},ignore:Et,replace:function(e,a,t,c,f){return e===It.OVERLONG?(c.push(f),0):(c.push(65533),Et(e,a,t))}});const Mt="mimcsponge";async function Bt(){const e=await Ja("bn128",!0);return new kt(e.Fr)}class kt{constructor(e){this.F=e,this.cts=this.getConstants(Mt,220)}getIV(e){const a=this.F;void 0===e&&(e=Mt);const t=vt(Ct(e+"_iv"));return Wa.e(t).mod(a.p)}getConstants(e,a){const t=this.F;void 0===e&&(e=Mt),void 0===a&&(a=220);const c=new Array(a);let f=vt(Ct(Mt));for(let e=1;e{"use strict";t.d(a,{r:()=>c});const c="6.13.4"},35273:(e,a,t)=>{"use strict";t.d(a,{y:()=>R});var c=t(57339),f=t(21228),d=t(30031),r=t(27033),n=t(19353);class i extends f.Ue{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,a){let t=n.V.dereference(a,"string");try{t=(0,d.b)(t)}catch(e){return this._throwError(e.message,a)}return e.writeValue(t)}decode(e){return(0,d.b)((0,r.up)(e.readValue(),20))}}var b=t(88081);class o extends f.Ue{coder;constructor(e){super(e.name,e.type,"_",e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,a){return this.coder.encode(e,a)}decode(e){return this.coder.decode(e)}}function s(e,a,t){let d=[];if(Array.isArray(t))d=t;else if(t&&"object"==typeof t){let e={};d=a.map((a=>{const f=a.localName;return(0,c.vA)(f,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:a},value:t}),(0,c.vA)(!e[f],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:a},value:t}),e[f]=!0,t[f]}))}else(0,c.MR)(!1,"invalid tuple value","tuple",t);(0,c.MR)(a.length===d.length,"types/value length mismatch","tuple",t);let r=new f.AU,n=new f.AU,i=[];a.forEach(((e,a)=>{let t=d[a];if(e.dynamic){let a=n.length;e.encode(n,t);let c=r.writeUpdatableValue();i.push((e=>{c(e+a)}))}else e.encode(r,t)})),i.forEach((e=>{e(r.length)}));let b=e.appendWriter(r);return b+=e.appendWriter(n),b}function l(e,a){let t=[],d=[],r=e.subReader(0);return a.forEach((a=>{let f=null;if(a.dynamic){let t=e.readIndex(),d=r.subReader(t);try{f=a.decode(d)}catch(e){if((0,c.bJ)(e,"BUFFER_OVERRUN"))throw e;f=e,f.baseType=a.name,f.name=a.localName,f.type=a.type}}else try{f=a.decode(e)}catch(e){if((0,c.bJ)(e,"BUFFER_OVERRUN"))throw e;f=e,f.baseType=a.name,f.name=a.localName,f.type=a.type}if(null==f)throw new Error("investigate");t.push(f),d.push(a.localName||null)})),f.Q7.fromItems(t,d)}class u extends f.Ue{coder;length;constructor(e,a,t){super("array",e.type+"["+(a>=0?a:"")+"]",t,-1===a||e.dynamic),(0,b.n)(this,{coder:e,length:a})}defaultValue(){const e=this.coder.defaultValue(),a=[];for(let t=0;te||t<-(e+w))&&this._throwError("value out-of-bounds",a),t=(0,r.JJ)(t,8*f.Yx)}else(t(0,r.dK)(c,8*this.size))&&this._throwError("value out-of-bounds",a);return e.writeValue(t)}decode(e){let a=(0,r.dK)(e.readValue(),8*this.size);return this.signed&&(a=(0,r.ST)(a,8*this.size)),a}}var E=t(87303);class C extends g{constructor(e){super("string",e)}defaultValue(){return""}encode(e,a){return super.encode(e,(0,E.YW)(n.V.dereference(a,"string")))}decode(e){return(0,E._v)(super.decode(e))}}class M extends f.Ue{coders;constructor(e,a){let t=!1;const c=[];e.forEach((e=>{e.dynamic&&(t=!0),c.push(e.type)})),super("tuple","tuple("+c.join(",")+")",a,t),(0,b.n)(this,{coders:Object.freeze(e.slice())})}defaultValue(){const e=[];this.coders.forEach((a=>{e.push(a.defaultValue())}));const a=this.coders.reduce(((e,a)=>{const t=a.localName;return t&&(e[t]||(e[t]=0),e[t]++),e}),{});return this.coders.forEach(((t,c)=>{let f=t.localName;f&&1===a[f]&&("length"===f&&(f="_length"),null==e[f]&&(e[f]=e[c]))})),Object.freeze(e)}encode(e,a){const t=n.V.dereference(a,"tuple");return s(e,this.coders,t)}decode(e){return l(e,this.coders)}}var B=t(76124);const k=new Map;k.set(0,"GENERIC_PANIC"),k.set(1,"ASSERT_FALSE"),k.set(17,"OVERFLOW"),k.set(18,"DIVIDE_BY_ZERO"),k.set(33,"ENUM_RANGE_ERROR"),k.set(34,"BAD_STORAGE_DATA"),k.set(49,"STACK_UNDERFLOW"),k.set(50,"ARRAY_RANGE_ERROR"),k.set(65,"OUT_OF_MEMORY"),k.set(81,"UNINITIALIZED_FUNCTION_CALL");const L=new RegExp(/^bytes([0-9]*)$/),S=new RegExp(/^(u?int)([0-9]*)$/);let T=null,N=1024;class R{#te(e){if(e.isArray())return new u(this.#te(e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new M(e.components.map((e=>this.#te(e))),e.name);switch(e.baseType){case"address":return new i(e.name);case"bool":return new h(e.name);case"string":return new C(e.name);case"bytes":return new m(e.name);case"":return new A(e.name)}let a=e.type.match(S);if(a){let t=parseInt(a[2]||"256");return(0,c.MR)(0!==t&&t<=256&&t%8==0,"invalid "+a[1]+" bit length","param",e),new I(t/8,"int"===a[1],e.name)}if(a=e.type.match(L),a){let t=parseInt(a[1]);return(0,c.MR)(0!==t&&t<=32,"invalid bytes length","param",e),new y(t,e.name)}(0,c.MR)(!1,"invalid type","type",e.type)}getDefaultValue(e){const a=e.map((e=>this.#te(B.aX.from(e))));return new M(a,"_").defaultValue()}encode(e,a){(0,c.dd)(a.length,e.length,"types/values length mismatch");const t=e.map((e=>this.#te(B.aX.from(e)))),d=new M(t,"_"),r=new f.AU;return d.encode(r,a),r.data}decode(e,a,t){const c=e.map((e=>this.#te(B.aX.from(e))));return new M(c,"_").decode(new f.mP(a,t,N))}static _setDefaultMaxInflation(e){(0,c.MR)("number"==typeof e&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),N=e}static defaultAbiCoder(){return null==T&&(T=new R),T}static getBuiltinCallException(e,a,t){return function(e,a,t,f){let r="missing revert data",n=null,i=null;if(t){r="execution reverted";const e=(0,p.q5)(t);if(t=(0,p.c$)(t),0===e.length)r+=" (no data present; likely require(false) occurred",n="require(false)";else if(e.length%32!=4)r+=" (could not decode reason; invalid data length)";else if("0x08c379a0"===(0,p.c$)(e.slice(0,4)))try{n=f.decode(["string"],e.slice(4))[0],i={signature:"Error(string)",name:"Error",args:[n]},r+=`: ${JSON.stringify(n)}`}catch(e){r+=" (could not decode reason; invalid string data)"}else if("0x4e487b71"===(0,p.c$)(e.slice(0,4)))try{const a=Number(f.decode(["uint256"],e.slice(4))[0]);i={signature:"Panic(uint256)",name:"Panic",args:[a]},n=`Panic due to ${k.get(a)||"UNKNOWN"}(${a})`,r+=`: ${n}`}catch(e){r+=" (could not decode panic code)"}else r+=" (unknown custom error)"}const b={to:a.to?(0,d.b)(a.to):null,data:a.data||"0x"};return a.from&&(b.from=(0,d.b)(a.from)),(0,c.xz)(r,"CALL_EXCEPTION",{action:e,data:t,reason:n,transaction:b,invocation:null,revert:i})}(e,a,t,R.defaultAbiCoder())}}},21228:(e,a,t)=>{"use strict";t.d(a,{AU:()=>x,Q7:()=>g,Ue:()=>y,Yx:()=>n,mP:()=>A});var c=t(27033),f=t(57339),d=t(36212),r=t(88081);const n=32,i=new Uint8Array(n),b=["then"],o={},s=new WeakMap;function l(e){return s.get(e)}function u(e,a){s.set(e,a)}function h(e,a){const t=new Error(`deferred error during ABI decoding triggered accessing ${e}`);throw t.error=a,t}function p(e,a,t){return e.indexOf(null)>=0?a.map(((e,a)=>e instanceof g?p(l(e),e,t):e)):e.reduce(((e,c,f)=>{let d=a.getValue(c);return c in e||(t&&d instanceof g&&(d=p(l(d),d,t)),e[c]=d),e}),{})}class g extends Array{#ce;constructor(...e){const a=e[0];let t=e[1],f=(e[2]||[]).slice(),d=!0;a!==o&&(t=e,f=[],d=!1),super(t.length),t.forEach(((e,a)=>{this[a]=e}));const r=f.reduce(((e,a)=>("string"==typeof a&&e.set(a,(e.get(a)||0)+1),e)),new Map);if(u(this,Object.freeze(t.map(((e,a)=>{const t=f[a];return null!=t&&1===r.get(t)?t:null})))),this.#ce=[],null==this.#ce&&this.#ce,!d)return;Object.freeze(this);const n=new Proxy(this,{get:(e,a,t)=>{if("string"==typeof a){if(a.match(/^[0-9]+$/)){const t=(0,c.WZ)(a,"%index");if(t<0||t>=this.length)throw new RangeError("out of result range");const f=e[t];return f instanceof Error&&h(`index ${t}`,f),f}if(b.indexOf(a)>=0)return Reflect.get(e,a,t);const f=e[a];if(f instanceof Function)return function(...a){return f.apply(this===t?e:this,a)};if(!(a in e))return e.getValue.apply(this===t?e:this,[a])}return Reflect.get(e,a,t)}});return u(n,l(this)),n}toArray(e){const a=[];return this.forEach(((t,c)=>{t instanceof Error&&h(`index ${c}`,t),e&&t instanceof g&&(t=t.toArray(e)),a.push(t)})),a}toObject(e){const a=l(this);return a.reduce(((t,c,d)=>((0,f.vA)(null!=c,`value at index ${d} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),p(a,this,e))),{})}slice(e,a){null==e&&(e=0),e<0&&(e+=this.length)<0&&(e=0),null==a&&(a=this.length),a<0&&(a+=this.length)<0&&(a=0),a>this.length&&(a=this.length);const t=l(this),c=[],f=[];for(let d=e;d{this.#V[e]=m(a)}}}class A{allowLoose;#V;#re;#ne;#ie;#be;constructor(e,a,t){(0,r.n)(this,{allowLoose:!!a}),this.#V=(0,d.Lm)(e),this.#ne=0,this.#ie=null,this.#be=null!=t?t:1024,this.#re=0}get data(){return(0,d.c$)(this.#V)}get dataLength(){return this.#V.length}get consumed(){return this.#re}get bytes(){return new Uint8Array(this.#V)}#oe(e){if(this.#ie)return this.#ie.#oe(e);this.#ne+=e,(0,f.vA)(this.#be<1||this.#ne<=this.#be*this.dataLength,`compressed ABI data exceeds inflation ratio of ${this.#be} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:(0,d.Lm)(this.#V),offset:this.#re,length:e,info:{bytesRead:this.#ne,dataLength:this.dataLength}})}#se(e,a,t){let c=Math.ceil(a/n)*n;return this.#re+c>this.#V.length&&(this.allowLoose&&t&&this.#re+a<=this.#V.length?c=a:(0,f.vA)(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:(0,d.Lm)(this.#V),length:this.#V.length,offset:this.#re+c})),this.#V.slice(this.#re,this.#re+c)}subReader(e){const a=new A(this.#V.slice(this.#re+e),this.allowLoose,this.#be);return a.#ie=this,a}readBytes(e,a){let t=this.#se(0,e,!!a);return this.#oe(e),this.#re+=t.length,t.slice(0,e)}readValue(){return(0,c.Dg)(this.readBytes(n))}readIndex(){return(0,c.Ro)(this.readBytes(n))}}},76124:(e,a,t)=>{"use strict";t.d(a,{FK:()=>$,Pw:()=>V,Zp:()=>K,aX:()=>H,bp:()=>G,hc:()=>J});var c=t(27033),f=t(57339),d=t(88081),r=t(38264);function n(e){const a=new Set;return e.forEach((e=>a.add(e))),Object.freeze(a)}const i=n("external public payable override".split(" ")),b="constant external internal payable private public pure view override",o=n(b.split(" ")),s="constructor error event fallback function receive struct",l=n(s.split(" ")),u="calldata memory storage payable indexed",h=n(u.split(" ")),p=n([s,u,"tuple returns",b].join(" ").split(" ")),g={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},m=new RegExp("^(\\s*)"),y=new RegExp("^([0-9]+)"),x=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),A=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),v=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");class w{#re;#le;get offset(){return this.#re}get length(){return this.#le.length-this.#re}constructor(e){this.#re=0,this.#le=e.slice()}clone(){return new w(this.#le)}reset(){this.#re=0}#ue(e=0,a=0){return new w(this.#le.slice(e,a).map((a=>Object.freeze(Object.assign({},a,{match:a.match-e,linkBack:a.linkBack-e,linkNext:a.linkNext-e})))))}popKeyword(e){const a=this.peek();if("KEYWORD"!==a.type||!e.has(a.text))throw new Error(`expected keyword ${a.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const a=this.peek();throw new Error(`expected ${e}; got ${a.type} ${JSON.stringify(a.text)}`)}return this.pop().text}popParen(){const e=this.peek();if("OPEN_PAREN"!==e.type)throw new Error("bad start");const a=this.#ue(this.#re+1,e.match+1);return this.#re=e.match+1,a}popParams(){const e=this.peek();if("OPEN_PAREN"!==e.type)throw new Error("bad start");const a=[];for(;this.#re=this.#le.length)throw new Error("out-of-bounds");return this.#le[this.#re]}peekKeyword(e){const a=this.peekType("KEYWORD");return null!=a&&e.has(a)?a:null}peekType(e){if(0===this.length)return null;const a=this.peek();return a.type===e?a.text:null}pop(){const e=this.peek();return this.#re++,e}toString(){const e=[];for(let a=this.#re;a`}}function _(e){const a=[],t=a=>{const t=r0&&"NUMBER"===a[a.length-1].type){const t=a.pop().text;e=t+e,a[a.length-1].value=(0,c.WZ)(t)}if(0===a.length||"BRACKET"!==a[a.length-1].type)throw new Error("missing opening bracket");a[a.length-1].text+=e}}else if(i=n.match(x),i){if(b.text=i[1],r+=b.text.length,p.has(b.text)){b.type="KEYWORD";continue}if(b.text.match(v)){b.type="TYPE";continue}b.type="ID"}else{if(i=n.match(y),!i)throw new Error(`unexpected token ${JSON.stringify(n[0])} at position ${r}`);b.text=i[1],b.type="NUMBER",r+=b.text.length}}return new w(a.map((e=>Object.freeze(e))))}function I(e,a){let t=[];for(const c in a.keys())e.has(c)&&t.push(c);if(t.length>1)throw new Error(`conflicting types: ${t.join(", ")}`)}function E(e,a){if(a.peekKeyword(l)){const t=a.pop().text;if(t!==e)throw new Error(`expected ${e}, got ${t}`)}return a.popType("ID")}function C(e,a){const t=new Set;for(;;){const c=e.peekType("KEYWORD");if(null==c||a&&!a.has(c))break;if(e.pop(),t.has(c))throw new Error(`duplicate keywords: ${JSON.stringify(c)}`);t.add(c)}return Object.freeze(t)}function M(e){let a=C(e,o);return I(a,n("constant payable nonpayable".split(" "))),I(a,n("pure view payable nonpayable".split(" "))),a.has("view")?"view":a.has("pure")?"pure":a.has("payable")?"payable":a.has("nonpayable")?"nonpayable":a.has("constant")?"view":"nonpayable"}function B(e,a){return e.popParams().map((e=>H.from(e,a)))}function k(e){if(e.peekType("AT")){if(e.pop(),e.peekType("NUMBER"))return(0,c.Ab)(e.pop().text);throw new Error("invalid gas")}return null}function L(e){if(e.length)throw new Error(`unexpected tokens at offset ${e.offset}: ${e.toString()}`)}const S=new RegExp(/^(.*)\[([0-9]*)\]$/);function T(e){const a=e.match(v);if((0,f.MR)(a,"invalid type","type",e),"uint"===e)return"uint256";if("int"===e)return"int256";if(a[2]){const t=parseInt(a[2]);(0,f.MR)(0!==t&&t<=32,"invalid bytes length","type",e)}else if(a[3]){const t=parseInt(a[3]);(0,f.MR)(0!==t&&t<=256&&t%8==0,"invalid numeric width","type",e)}return e}const N={},R=Symbol.for("_ethers_internal"),P="_ParamTypeInternal",D="_ErrorInternal",O="_EventInternal",F="_ConstructorInternal",Q="_FallbackInternal",U="_FunctionInternal",j="_StructInternal";class H{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(e,a,t,c,r,n,i,b){if((0,f.gk)(e,N,"ParamType"),Object.defineProperty(this,R,{value:P}),n&&(n=Object.freeze(n.slice())),"array"===c){if(null==i||null==b)throw new Error("")}else if(null!=i||null!=b)throw new Error("");if("tuple"===c){if(null==n)throw new Error("")}else if(null!=n)throw new Error("");(0,d.n)(this,{name:a,type:t,baseType:c,indexed:r,components:n,arrayLength:i,arrayChildren:b})}format(e){if(null==e&&(e="sighash"),"json"===e){const a=this.name||"";if(this.isArray()){const e=JSON.parse(this.arrayChildren.format("json"));return e.name=a,e.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(e)}const t={type:"tuple"===this.baseType?"tuple":this.type,name:a};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.isTuple()&&(t.components=this.components.map((a=>JSON.parse(a.format(e))))),JSON.stringify(t)}let a="";return this.isArray()?(a+=this.arrayChildren.format(e),a+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?a+="("+this.components.map((a=>a.format(e))).join("full"===e?", ":",")+")":a+=this.type,"sighash"!==e&&(!0===this.indexed&&(a+=" indexed"),"full"===e&&this.name&&(a+=" "+this.name)),a}isArray(){return"array"===this.baseType}isTuple(){return"tuple"===this.baseType}isIndexable(){return null!=this.indexed}walk(e,a){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(-1!==this.arrayLength&&e.length!==this.arrayLength)throw new Error("array is wrong length");const t=this;return e.map((e=>t.arrayChildren.walk(e,a)))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const t=this;return e.map(((e,c)=>t.components[c].walk(e,a)))}return a(this.type,e)}#he(e,a,t,c){if(this.isArray()){if(!Array.isArray(a))throw new Error("invalid array value");if(-1!==this.arrayLength&&a.length!==this.arrayLength)throw new Error("array is wrong length");const f=this.arrayChildren,d=a.slice();return d.forEach(((a,c)=>{f.#he(e,a,t,(e=>{d[c]=e}))})),void c(d)}if(this.isTuple()){const f=this.components;let d;if(Array.isArray(a))d=a.slice();else{if(null==a||"object"!=typeof a)throw new Error("invalid tuple value");d=f.map((e=>{if(!e.name)throw new Error("cannot use object value with unnamed components");if(!(e.name in a))throw new Error(`missing value for component ${e.name}`);return a[e.name]}))}if(d.length!==this.components.length)throw new Error("array is wrong length");return d.forEach(((a,c)=>{f[c].#he(e,a,t,(e=>{d[c]=e}))})),void c(d)}const f=t(this.type,a);f.then?e.push(async function(){c(await f)}()):c(f)}async walkAsync(e,a){const t=[],c=[e];return this.#he(t,e,a,(e=>{c[0]=e})),t.length&&await Promise.all(t),c[0]}static from(e,a){if(H.isParamType(e))return e;if("string"==typeof e)try{return H.from(_(e),a)}catch(a){(0,f.MR)(!1,"invalid param type","obj",e)}else if(e instanceof w){let t="",c="",f=null;C(e,n(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(c="tuple",f=e.popParams().map((e=>H.from(e))),t=`tuple(${f.map((e=>e.format())).join(",")})`):(t=T(e.popType("TYPE")),c=t);let d=null,r=null;for(;e.length&&e.peekType("BRACKET");){const a=e.pop();d=new H(N,"",t,c,null,f,r,d),r=a.value,t+=a.text,c="array",f=null}let i=null;if(C(e,h).has("indexed")){if(!a)throw new Error("");i=!0}const b=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new H(N,b,t,c,i,f,r,d)}const t=e.name;(0,f.MR)(!t||"string"==typeof t&&t.match(A),"invalid name","obj.name",t);let c=e.indexed;null!=c&&((0,f.MR)(a,"parameter cannot be indexed","obj.indexed",e.indexed),c=!!c);let d=e.type,r=d.match(S);if(r){const a=parseInt(r[2]||"-1"),f=H.from({type:r[1],components:e.components});return new H(N,t||"",d,"array",c,null,a,f)}if("tuple"===d||d.startsWith("tuple(")||d.startsWith("(")){const a=null!=e.components?e.components.map((e=>H.from(e))):null;return new H(N,t||"",d,"tuple",c,a,null,null)}return d=T(e.type),new H(N,t||"",d,d,c,null,null,null)}static isParamType(e){return e&&e[R]===P}}class ${type;inputs;constructor(e,a,t){(0,f.gk)(e,N,"Fragment"),t=Object.freeze(t.slice()),(0,d.n)(this,{type:a,inputs:t})}static from(e){if("string"==typeof e){try{$.from(JSON.parse(e))}catch(e){}return $.from(_(e))}if(e instanceof w)switch(e.peekKeyword(l)){case"constructor":return V.from(e);case"error":return G.from(e);case"event":return K.from(e);case"fallback":case"receive":return Z.from(e);case"function":return J.from(e);case"struct":return W.from(e)}else if("object"==typeof e){switch(e.type){case"constructor":return V.from(e);case"error":return G.from(e);case"event":return K.from(e);case"fallback":case"receive":return Z.from(e);case"function":return J.from(e);case"struct":return W.from(e)}(0,f.vA)(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}(0,f.MR)(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return V.isFragment(e)}static isError(e){return G.isFragment(e)}static isEvent(e){return K.isFragment(e)}static isFunction(e){return J.isFragment(e)}static isStruct(e){return W.isFragment(e)}}class q extends ${name;constructor(e,a,t,c){super(e,a,c),(0,f.MR)("string"==typeof t&&t.match(A),"invalid identifier","name",t),c=Object.freeze(c.slice()),(0,d.n)(this,{name:t})}}function z(e,a){return"("+a.map((a=>a.format(e))).join("full"===e?", ":",")+")"}class G extends q{constructor(e,a,t){super(e,"error",a,t),Object.defineProperty(this,R,{value:D})}get selector(){return(0,r.id)(this.format("sighash")).substring(0,10)}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((a=>JSON.parse(a.format(e))))});const a=[];return"sighash"!==e&&a.push("error"),a.push(this.name+z(e,this.inputs)),a.join(" ")}static from(e){if(G.isFragment(e))return e;if("string"==typeof e)return G.from(_(e));if(e instanceof w){const a=E("error",e),t=B(e);return L(e),new G(N,a,t)}return new G(N,e.name,e.inputs?e.inputs.map(H.from):[])}static isFragment(e){return e&&e[R]===D}}class K extends q{anonymous;constructor(e,a,t,c){super(e,"event",a,t),Object.defineProperty(this,R,{value:O}),(0,d.n)(this,{anonymous:c})}get topicHash(){return(0,r.id)(this.format("sighash"))}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((a=>JSON.parse(a.format(e))))});const a=[];return"sighash"!==e&&a.push("event"),a.push(this.name+z(e,this.inputs)),"sighash"!==e&&this.anonymous&&a.push("anonymous"),a.join(" ")}static getTopicHash(e,a){return a=(a||[]).map((e=>H.from(e))),new K(N,e,a,!1).topicHash}static from(e){if(K.isFragment(e))return e;if("string"==typeof e)try{return K.from(_(e))}catch(a){(0,f.MR)(!1,"invalid event fragment","obj",e)}else if(e instanceof w){const a=E("event",e),t=B(e,!0),c=!!C(e,n(["anonymous"])).has("anonymous");return L(e),new K(N,a,t,c)}return new K(N,e.name,e.inputs?e.inputs.map((e=>H.from(e,!0))):[],!!e.anonymous)}static isFragment(e){return e&&e[R]===O}}class V extends ${payable;gas;constructor(e,a,t,c,f){super(e,a,t),Object.defineProperty(this,R,{value:F}),(0,d.n)(this,{payable:c,gas:f})}format(e){if((0,f.vA)(null!=e&&"sighash"!==e,"cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),"json"===e)return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map((a=>JSON.parse(a.format(e))))});const a=[`constructor${z(e,this.inputs)}`];return this.payable&&a.push("payable"),null!=this.gas&&a.push(`@${this.gas.toString()}`),a.join(" ")}static from(e){if(V.isFragment(e))return e;if("string"==typeof e)try{return V.from(_(e))}catch(a){(0,f.MR)(!1,"invalid constuctor fragment","obj",e)}else if(e instanceof w){C(e,n(["constructor"]));const a=B(e),t=!!C(e,i).has("payable"),c=k(e);return L(e),new V(N,"constructor",a,t,c)}return new V(N,"constructor",e.inputs?e.inputs.map(H.from):[],!!e.payable,null!=e.gas?e.gas:null)}static isFragment(e){return e&&e[R]===F}}class Z extends ${payable;constructor(e,a,t){super(e,"fallback",a),Object.defineProperty(this,R,{value:Q}),(0,d.n)(this,{payable:t})}format(e){const a=0===this.inputs.length?"receive":"fallback";if("json"===e){const e=this.payable?"payable":"nonpayable";return JSON.stringify({type:a,stateMutability:e})}return`${a}()${this.payable?" payable":""}`}static from(e){if(Z.isFragment(e))return e;if("string"==typeof e)try{return Z.from(_(e))}catch(a){(0,f.MR)(!1,"invalid fallback fragment","obj",e)}else if(e instanceof w){const a=e.toString(),t=e.peekKeyword(n(["fallback","receive"]));if((0,f.MR)(t,"type must be fallback or receive","obj",a),"receive"===e.popKeyword(n(["fallback","receive"]))){const a=B(e);return(0,f.MR)(0===a.length,"receive cannot have arguments","obj.inputs",a),C(e,n(["payable"])),L(e),new Z(N,[],!0)}let c=B(e);c.length?(0,f.MR)(1===c.length&&"bytes"===c[0].type,"invalid fallback inputs","obj.inputs",c.map((e=>e.format("minimal"))).join(", ")):c=[H.from("bytes")];const d=M(e);if((0,f.MR)("nonpayable"===d||"payable"===d,"fallback cannot be constants","obj.stateMutability",d),C(e,n(["returns"])).has("returns")){const a=B(e);(0,f.MR)(1===a.length&&"bytes"===a[0].type,"invalid fallback outputs","obj.outputs",a.map((e=>e.format("minimal"))).join(", "))}return L(e),new Z(N,c,"payable"===d)}if("receive"===e.type)return new Z(N,[],!0);if("fallback"===e.type){const a=[H.from("bytes")],t="payable"===e.stateMutability;return new Z(N,a,t)}(0,f.MR)(!1,"invalid fallback description","obj",e)}static isFragment(e){return e&&e[R]===Q}}class J extends q{constant;outputs;stateMutability;payable;gas;constructor(e,a,t,c,f,r){super(e,"function",a,c),Object.defineProperty(this,R,{value:U}),f=Object.freeze(f.slice());const n="view"===t||"pure"===t,i="payable"===t;(0,d.n)(this,{constant:n,gas:r,outputs:f,payable:i,stateMutability:t})}get selector(){return(0,r.id)(this.format("sighash")).substring(0,10)}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map((a=>JSON.parse(a.format(e)))),outputs:this.outputs.map((a=>JSON.parse(a.format(e))))});const a=[];return"sighash"!==e&&a.push("function"),a.push(this.name+z(e,this.inputs)),"sighash"!==e&&("nonpayable"!==this.stateMutability&&a.push(this.stateMutability),this.outputs&&this.outputs.length&&(a.push("returns"),a.push(z(e,this.outputs))),null!=this.gas&&a.push(`@${this.gas.toString()}`)),a.join(" ")}static getSelector(e,a){return a=(a||[]).map((e=>H.from(e))),new J(N,e,"view",a,[],null).selector}static from(e){if(J.isFragment(e))return e;if("string"==typeof e)try{return J.from(_(e))}catch(a){(0,f.MR)(!1,"invalid function fragment","obj",e)}else if(e instanceof w){const a=E("function",e),t=B(e),c=M(e);let f=[];C(e,n(["returns"])).has("returns")&&(f=B(e));const d=k(e);return L(e),new J(N,a,c,t,f,d)}let a=e.stateMutability;return null==a&&(a="payable","boolean"==typeof e.constant?(a="view",e.constant||(a="payable","boolean"!=typeof e.payable||e.payable||(a="nonpayable"))):"boolean"!=typeof e.payable||e.payable||(a="nonpayable")),new J(N,e.name,a,e.inputs?e.inputs.map(H.from):[],e.outputs?e.outputs.map(H.from):[],null!=e.gas?e.gas:null)}static isFragment(e){return e&&e[R]===U}}class W extends q{constructor(e,a,t){super(e,"struct",a,t),Object.defineProperty(this,R,{value:j})}format(){throw new Error("@TODO")}static from(e){if("string"==typeof e)try{return W.from(_(e))}catch(a){(0,f.MR)(!1,"invalid struct fragment","obj",e)}else if(e instanceof w){const a=E("struct",e),t=B(e);return L(e),new W(N,a,t)}return new W(N,e.name,e.inputs?e.inputs.map(H.from):[])}static isFragment(e){return e&&e[R]===j}}},73622:(e,a,t)=>{"use strict";t.d(a,{KA:()=>x});var c=t(15539),f=t(38264),d=t(88081),r=t(57339),n=t(36212),i=t(27033),b=t(35273),o=t(21228),s=t(76124),l=t(19353);class u{fragment;name;signature;topic;args;constructor(e,a,t){const c=e.name,f=e.format();(0,d.n)(this,{fragment:e,name:c,signature:f,topic:a,args:t})}}class h{fragment;name;args;signature;selector;value;constructor(e,a,t,c){const f=e.name,r=e.format();(0,d.n)(this,{fragment:e,name:f,args:t,signature:r,selector:a,value:c})}}class p{fragment;name;args;signature;selector;constructor(e,a,t){const c=e.name,f=e.format();(0,d.n)(this,{fragment:e,name:c,args:t,signature:f,selector:a})}}class g{hash;_isIndexed;static isIndexed(e){return!(!e||!e._isIndexed)}constructor(e){(0,d.n)(this,{hash:e,_isIndexed:!0})}}const m={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},y={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:e=>`reverted with reason string ${JSON.stringify(e)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:e=>{let a="unknown panic code";return e>=0&&e<=255&&m[e.toString()]&&(a=m[e.toString()]),`reverted with panic code 0x${e.toString(16)} (${a})`}}};class x{fragments;deploy;fallback;receive;#pe;#ge;#me;#ye;constructor(e){let a=[];a="string"==typeof e?JSON.parse(e):e,this.#me=new Map,this.#pe=new Map,this.#ge=new Map;const t=[];for(const e of a)try{t.push(s.FK.from(e))}catch(a){console.log(`[Warning] Invalid Fragment ${JSON.stringify(e)}:`,a.message)}(0,d.n)(this,{fragments:Object.freeze(t)});let c=null,f=!1;this.#ye=this.getAbiCoder(),this.fragments.forEach(((e,a)=>{let t;switch(e.type){case"constructor":return this.deploy?void console.log("duplicate definition - constructor"):void(0,d.n)(this,{deploy:e});case"fallback":return void(0===e.inputs.length?f=!0:((0,r.MR)(!c||e.payable!==c.payable,"conflicting fallback fragments",`fragments[${a}]`,e),c=e,f=c.payable));case"function":t=this.#me;break;case"event":t=this.#ge;break;case"error":t=this.#pe;break;default:return}const n=e.format();t.has(n)||t.set(n,e)})),this.deploy||(0,d.n)(this,{deploy:s.Pw.from("constructor()")}),(0,d.n)(this,{fallback:c,receive:f})}format(e){const a=e?"minimal":"full";return this.fragments.map((e=>e.format(a)))}formatJson(){const e=this.fragments.map((e=>e.format("json")));return JSON.stringify(e.map((e=>JSON.parse(e))))}getAbiCoder(){return b.y.defaultAbiCoder()}#xe(e,a,t){if((0,n.Lo)(e)){const a=e.toLowerCase();for(const e of this.#me.values())if(a===e.selector)return e;return null}if(-1===e.indexOf("(")){const c=[];for(const[a,t]of this.#me)a.split("(")[0]===e&&c.push(t);if(a){const e=a.length>0?a[a.length-1]:null;let t=a.length,f=!0;l.V.isTyped(e)&&"overrides"===e.type&&(f=!1,t--);for(let e=c.length-1;e>=0;e--){const a=c[e].inputs.length;a===t||f&&a===t-1||c.splice(e,1)}for(let e=c.length-1;e>=0;e--){const t=c[e].inputs;for(let f=0;f=t.length){if("overrides"===a[f].type)continue;c.splice(e,1);break}if(a[f].type!==t[f].baseType){c.splice(e,1);break}}}}if(1===c.length&&a&&a.length!==c[0].inputs.length){const e=a[a.length-1];(null==e||Array.isArray(e)||"object"!=typeof e)&&c.splice(0,1)}if(0===c.length)return null;if(c.length>1&&t){const a=c.map((e=>JSON.stringify(e.format()))).join(", ");(0,r.MR)(!1,`ambiguous function description (i.e. matches ${a})`,"key",e)}return c[0]}return this.#me.get(s.hc.from(e).format())||null}getFunctionName(e){const a=this.#xe(e,null,!1);return(0,r.MR)(a,"no matching function","key",e),a.name}hasFunction(e){return!!this.#xe(e,null,!1)}getFunction(e,a){return this.#xe(e,a||null,!0)}forEachFunction(e){const a=Array.from(this.#me.keys());a.sort(((e,a)=>e.localeCompare(a)));for(let t=0;t=0;e--)c[e].inputs.length=0;e--){const t=c[e].inputs;for(let f=0;f1&&t){const a=c.map((e=>JSON.stringify(e.format()))).join(", ");(0,r.MR)(!1,`ambiguous event description (i.e. matches ${a})`,"key",e)}return c[0]}return this.#ge.get(s.Zp.from(e).format())||null}getEventName(e){const a=this.#Ae(e,null,!1);return(0,r.MR)(a,"no matching event","key",e),a.name}hasEvent(e){return!!this.#Ae(e,null,!1)}getEvent(e,a){return this.#Ae(e,a||null,!0)}forEachEvent(e){const a=Array.from(this.#ge.keys());a.sort(((e,a)=>e.localeCompare(a)));for(let t=0;t1){const t=a.map((e=>JSON.stringify(e.format()))).join(", ");(0,r.MR)(!1,`ambiguous error description (i.e. ${t})`,"name",e)}return a[0]}if("Error(string)"===(e=s.bp.from(e).format()))return s.bp.from("error Error(string)");if("Panic(uint256)"===e)return s.bp.from("error Panic(uint256)");return this.#pe.get(e)||null}forEachError(e){const a=Array.from(this.#pe.keys());a.sort(((e,a)=>e.localeCompare(a)));for(let t=0;t"string"===e.type?(0,f.id)(a):"bytes"===e.type?(0,c.S)((0,n.c$)(a)):("bool"===e.type&&"boolean"==typeof a?a=a?"0x01":"0x00":e.type.match(/^u?int/)?a=(0,i.up)(a):e.type.match(/^bytes/)?a=(0,n.X_)(a,32):"address"===e.type&&this.#ye.encode(["address"],[a]),(0,n.nx)((0,n.c$)(a),32));for(a.forEach(((a,c)=>{const f=e.inputs[c];f.indexed?null==a?t.push(null):"array"===f.baseType||"tuple"===f.baseType?(0,r.MR)(!1,"filtering with tuples or arrays not supported","contract."+f.name,a):Array.isArray(a)?t.push(a.map((e=>d(f,e)))):t.push(d(f,a)):(0,r.MR)(null==a,"cannot filter non-indexed parameters; must be null","contract."+f.name,a)}));t.length&&null===t[t.length-1];)t.pop();return t}encodeEventLog(e,a){if("string"==typeof e){const a=this.getEvent(e);(0,r.MR)(a,"unknown event","eventFragment",e),e=a}const t=[],d=[],n=[];return e.anonymous||t.push(e.topicHash),(0,r.MR)(a.length===e.inputs.length,"event arguments/values mismatch","values",a),e.inputs.forEach(((e,r)=>{const i=a[r];if(e.indexed)if("string"===e.type)t.push((0,f.id)(i));else if("bytes"===e.type)t.push((0,c.S)(i));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");t.push(this.#ye.encode([e.type],[i]))}else d.push(e),n.push(i)})),{data:this.#ye.encode(d,n),topics:t}}decodeEventLog(e,a,t){if("string"==typeof e){const a=this.getEvent(e);(0,r.MR)(a,"unknown event","eventFragment",e),e=a}if(null!=t&&!e.anonymous){const a=e.topicHash;(0,r.MR)((0,n.Lo)(t[0],32)&&t[0].toLowerCase()===a,"fragment/topic mismatch","topics[0]",t[0]),t=t.slice(1)}const c=[],f=[],d=[];e.inputs.forEach(((e,a)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(c.push(s.aX.from({type:"bytes32",name:e.name})),d.push(!0)):(c.push(e),d.push(!1)):(f.push(e),d.push(!1))}));const i=null!=t?this.#ye.decode(c,(0,n.xW)(t)):null,b=this.#ye.decode(f,a,!0),l=[],u=[];let h=0,p=0;return e.inputs.forEach(((e,a)=>{let t=null;if(e.indexed)if(null==i)t=new g(null);else if(d[a])t=new g(i[p++]);else try{t=i[p++]}catch(e){t=e}else try{t=b[h++]}catch(e){t=e}l.push(t),u.push(e.name||null)})),o.Q7.fromItems(l,u)}parseTransaction(e){const a=(0,n.q5)(e.data,"tx.data"),t=(0,i.Ab)(null!=e.value?e.value:0,"tx.value"),c=this.getFunction((0,n.c$)(a.slice(0,4)));if(!c)return null;const f=this.#ye.decode(c.inputs,a.slice(4));return new h(c,c.selector,f,t)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const a=this.getEvent(e.topics[0]);return!a||a.anonymous?null:new u(a,a.topicHash,this.decodeEventLog(a,e.data,e.topics))}parseError(e){const a=(0,n.c$)(e),t=this.getError((0,n.ZG)(a,0,4));if(!t)return null;const c=this.#ye.decode(t.inputs,(0,n.ZG)(a,4));return new p(t,t.selector,c)}static from(e){return e instanceof x?e:"string"==typeof e?new x(JSON.parse(e)):"function"==typeof e.formatJson?new x(e.formatJson()):"function"==typeof e.format?new x(e.format("json")):new x(e)}}},19353:(e,a,t)=>{"use strict";t.d(a,{V:()=>b});var c=t(57339),f=t(88081);const d={};function r(e,a){let t=!1;return a<0&&(t=!0,a*=-1),new b(d,`${t?"":"u"}int${a}`,e,{signed:t,width:a})}function n(e,a){return new b(d,`bytes${a||""}`,e,{size:a})}const i=Symbol.for("_ethers_typed");class b{type;value;#E;_typedSymbol;constructor(e,a,t,r){null==r&&(r=null),(0,c.gk)(d,e,"Typed"),(0,f.n)(this,{_typedSymbol:i,type:a,value:t}),this.#E=r,this.format()}format(){if("array"===this.type)throw new Error("");if("dynamicArray"===this.type)throw new Error("");return"tuple"===this.type?`tuple(${this.value.map((e=>e.format())).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return"string"===this.type}get tupleName(){if("tuple"!==this.type)throw TypeError("not a tuple");return this.#E}get arrayLength(){if("array"!==this.type)throw TypeError("not an array");return!0===this.#E?-1:!1===this.#E?this.value.length:null}static from(e,a){return new b(d,e,a)}static uint8(e){return r(e,8)}static uint16(e){return r(e,16)}static uint24(e){return r(e,24)}static uint32(e){return r(e,32)}static uint40(e){return r(e,40)}static uint48(e){return r(e,48)}static uint56(e){return r(e,56)}static uint64(e){return r(e,64)}static uint72(e){return r(e,72)}static uint80(e){return r(e,80)}static uint88(e){return r(e,88)}static uint96(e){return r(e,96)}static uint104(e){return r(e,104)}static uint112(e){return r(e,112)}static uint120(e){return r(e,120)}static uint128(e){return r(e,128)}static uint136(e){return r(e,136)}static uint144(e){return r(e,144)}static uint152(e){return r(e,152)}static uint160(e){return r(e,160)}static uint168(e){return r(e,168)}static uint176(e){return r(e,176)}static uint184(e){return r(e,184)}static uint192(e){return r(e,192)}static uint200(e){return r(e,200)}static uint208(e){return r(e,208)}static uint216(e){return r(e,216)}static uint224(e){return r(e,224)}static uint232(e){return r(e,232)}static uint240(e){return r(e,240)}static uint248(e){return r(e,248)}static uint256(e){return r(e,256)}static uint(e){return r(e,256)}static int8(e){return r(e,-8)}static int16(e){return r(e,-16)}static int24(e){return r(e,-24)}static int32(e){return r(e,-32)}static int40(e){return r(e,-40)}static int48(e){return r(e,-48)}static int56(e){return r(e,-56)}static int64(e){return r(e,-64)}static int72(e){return r(e,-72)}static int80(e){return r(e,-80)}static int88(e){return r(e,-88)}static int96(e){return r(e,-96)}static int104(e){return r(e,-104)}static int112(e){return r(e,-112)}static int120(e){return r(e,-120)}static int128(e){return r(e,-128)}static int136(e){return r(e,-136)}static int144(e){return r(e,-144)}static int152(e){return r(e,-152)}static int160(e){return r(e,-160)}static int168(e){return r(e,-168)}static int176(e){return r(e,-176)}static int184(e){return r(e,-184)}static int192(e){return r(e,-192)}static int200(e){return r(e,-200)}static int208(e){return r(e,-208)}static int216(e){return r(e,-216)}static int224(e){return r(e,-224)}static int232(e){return r(e,-232)}static int240(e){return r(e,-240)}static int248(e){return r(e,-248)}static int256(e){return r(e,-256)}static int(e){return r(e,-256)}static bytes1(e){return n(e,1)}static bytes2(e){return n(e,2)}static bytes3(e){return n(e,3)}static bytes4(e){return n(e,4)}static bytes5(e){return n(e,5)}static bytes6(e){return n(e,6)}static bytes7(e){return n(e,7)}static bytes8(e){return n(e,8)}static bytes9(e){return n(e,9)}static bytes10(e){return n(e,10)}static bytes11(e){return n(e,11)}static bytes12(e){return n(e,12)}static bytes13(e){return n(e,13)}static bytes14(e){return n(e,14)}static bytes15(e){return n(e,15)}static bytes16(e){return n(e,16)}static bytes17(e){return n(e,17)}static bytes18(e){return n(e,18)}static bytes19(e){return n(e,19)}static bytes20(e){return n(e,20)}static bytes21(e){return n(e,21)}static bytes22(e){return n(e,22)}static bytes23(e){return n(e,23)}static bytes24(e){return n(e,24)}static bytes25(e){return n(e,25)}static bytes26(e){return n(e,26)}static bytes27(e){return n(e,27)}static bytes28(e){return n(e,28)}static bytes29(e){return n(e,29)}static bytes30(e){return n(e,30)}static bytes31(e){return n(e,31)}static bytes32(e){return n(e,32)}static address(e){return new b(d,"address",e)}static bool(e){return new b(d,"bool",!!e)}static bytes(e){return new b(d,"bytes",e)}static string(e){return new b(d,"string",e)}static array(e,a){throw new Error("not implemented yet")}static tuple(e,a){throw new Error("not implemented yet")}static overrides(e){return new b(d,"overrides",Object.assign({},e))}static isTyped(e){return e&&"object"==typeof e&&"_typedSymbol"in e&&e._typedSymbol===i}static dereference(e,a){if(b.isTyped(e)){if(e.type!==a)throw new Error(`invalid type: expecetd ${a}, got ${e.type}`);return e.value}return e}}},30031:(e,a,t)=>{"use strict";t.d(a,{b:()=>l});var c=t(15539),f=t(36212),d=t(57339);const r=BigInt(0),n=BigInt(36);function i(e){const a=(e=e.toLowerCase()).substring(2).split(""),t=new Uint8Array(40);for(let e=0;e<40;e++)t[e]=a[e].charCodeAt(0);const d=(0,f.q5)((0,c.S)(t));for(let e=0;e<40;e+=2)d[e>>1]>>4>=8&&(a[e]=a[e].toUpperCase()),(15&d[e>>1])>=8&&(a[e+1]=a[e+1].toUpperCase());return"0x"+a.join("")}const b={};for(let e=0;e<10;e++)b[String(e)]=String(e);for(let e=0;e<26;e++)b[String.fromCharCode(65+e)]=String(10+e);const o=15;const s=function(){const e={};for(let a=0;a<36;a++)e["0123456789abcdefghijklmnopqrstuvwxyz"[a]]=BigInt(a);return e}();function l(e){if((0,d.MR)("string"==typeof e,"invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/)){e.startsWith("0x")||(e="0x"+e);const a=i(e);return(0,d.MR)(!e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||a===e,"bad address checksum","address",e),a}if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){(0,d.MR)(e.substring(2,4)===function(e){let a=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>b[e])).join("");for(;a.length>=o;){let e=a.substring(0,o);a=parseInt(e,10)%97+a.substring(e.length)}let t=String(98-parseInt(a,10)%97);for(;t.length<2;)t="0"+t;return t}(e),"bad icap checksum","address",e);let a=function(e){e=e.toLowerCase();let a=r;for(let t=0;t{"use strict";t.d(a,{$C:()=>d,PW:()=>r,tG:()=>i});var c=t(57339),f=t(30031);function d(e){return e&&"function"==typeof e.getAddress}function r(e){try{return(0,f.b)(e),!0}catch(e){}return!1}async function n(e,a){const t=await a;return null!=t&&"0x0000000000000000000000000000000000000000"!==t||((0,c.vA)("string"!=typeof e,"unconfigured name","UNCONFIGURED_NAME",{value:e}),(0,c.MR)(!1,"invalid AddressLike value; did not resolve to a value address","target",e)),(0,f.b)(t)}function i(e,a){return"string"==typeof e?e.match(/^0x[0-9a-f]{40}$/i)?(0,f.b)(e):((0,c.vA)(null!=a,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),n(e,a.resolveName(e))):d(e)?n(e,e.getAddress()):e&&"function"==typeof e.then?n(e,e):void(0,c.MR)(!1,"unsupported addressable value","target",e)}},7040:(e,a,t)=>{"use strict";t.d(a,{t:()=>i});var c=t(15539),f=t(27033),d=t(36212),r=t(65735),n=t(30031);function i(e){const a=(0,n.b)(e.from);let t=(0,f.Ab)(e.nonce,"tx.nonce").toString(16);return t="0"===t?"0x":t.length%2?"0x0"+t:"0x"+t,(0,n.b)((0,d.ZG)((0,c.S)((0,r.R)([a,t])),12))}},98982:(e,a,t)=>{"use strict";t.d(a,{j:()=>c});const c="0x0000000000000000000000000000000000000000"},13269:(e,a,t)=>{"use strict";t.d(a,{FC:()=>v,NZ:()=>R,Uq:()=>N,yN:()=>w});var c=t(19353),f=t(73622),d=t(41442),r=t(43948),n=t(88081),i=t(57339),b=t(27033),o=t(36212),s=t(24359);const l=BigInt(0);function u(e){return e&&"function"==typeof e.call}function h(e){return e&&"function"==typeof e.estimateGas}function p(e){return e&&"function"==typeof e.resolveName}function g(e){return e&&"function"==typeof e.sendTransaction}function m(e){if(null!=e){if(p(e))return e;if(e.provider)return e.provider}}class y{#u;fragment;constructor(e,a,t){if((0,n.n)(this,{fragment:a}),a.inputs.lengthnull==t[a]?null:e.walkAsync(t[a],((e,a)=>"address"===e?Array.isArray(a)?Promise.all(a.map((e=>(0,d.tG)(e,f)))):(0,d.tG)(a,f):a)))));return e.interface.encodeFilterTopics(a,c)}()}getTopicFilter(){return this.#u}}function x(e,a){return null==e?null:"function"==typeof e[a]?e:e.provider&&"function"==typeof e.provider[a]?e.provider:null}function A(e){return null==e?null:e.provider||null}async function v(e,a){const t=c.V.dereference(e,"overrides");(0,i.MR)("object"==typeof t,"invalid overrides parameter","overrides",e);const f=(0,r.VS)(t);return(0,i.MR)(null==f.to||(a||[]).indexOf("to")>=0,"cannot override to","overrides.to",f.to),(0,i.MR)(null==f.data||(a||[]).indexOf("data")>=0,"cannot override data","overrides.data",f.data),f.from&&(f.from=f.from),f}async function w(e,a,t){const f=x(e,"resolveName"),r=p(f)?f:null;return await Promise.all(a.map(((e,a)=>e.walkAsync(t[a],((e,a)=>(a=c.V.dereference(a,e),"address"===e?(0,d.tG)(a,r):a))))))}function _(e){const a=async function(a){const t=await v(a,["data"]);t.to=await e.getAddress(),t.from&&(t.from=await(0,d.tG)(t.from,m(e.runner)));const c=e.interface,f=(0,b.Ab)(t.value||l,"overrides.value")===l,r="0x"===(t.data||"0x");!c.fallback||c.fallback.payable||!c.receive||r||f||(0,i.MR)(!1,"cannot send data to receive or send value to non-payable fallback","overrides",a),(0,i.MR)(c.fallback||r,"cannot send data to receive-only contract","overrides.data",t.data);const n=c.receive||c.fallback&&c.fallback.payable;return(0,i.MR)(n||f,"cannot send value to non-payable fallback","overrides.value",t.value),(0,i.MR)(c.fallback||r,"cannot send data to receive-only contract","overrides.data",t.data),t},t=async function(t){const c=e.runner;(0,i.vA)(g(c),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const f=await c.sendTransaction(await a(t)),d=A(e.runner);return new s.Cn(e.interface,d,f)},c=async e=>await t(e);return(0,n.n)(c,{_contract:e,estimateGas:async function(t){const c=x(e.runner,"estimateGas");return(0,i.vA)(h(c),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await c.estimateGas(await a(t))},populateTransaction:a,send:t,staticCall:async function(t){const c=x(e.runner,"call");(0,i.vA)(u(c),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const f=await a(t);try{return await c.call(f)}catch(a){if((0,i.E)(a)&&a.data)throw e.interface.makeError(a.data,f);throw a}}}),c}const I=Symbol.for("_ethersInternal_contract"),E=new WeakMap;function C(e){return E.get(e[I])}async function M(e,a){let t,c=null;if(Array.isArray(a)){const c=function(a){if((0,o.Lo)(a,32))return a;const t=e.interface.getEvent(a);return(0,i.MR)(t,"unknown fragment","name",a),t.topicHash};t=a.map((e=>null==e?null:Array.isArray(e)?e.map(c):c(e)))}else"*"===a?t=[null]:"string"==typeof a?(0,o.Lo)(a,32)?t=[a]:(c=e.interface.getEvent(a),(0,i.MR)(c,"unknown fragment","event",a),t=[c.topicHash]):(f=a)&&"object"==typeof f&&"getTopicFilter"in f&&"function"==typeof f.getTopicFilter&&f.fragment?t=await a.getTopicFilter():"fragment"in a?(c=a.fragment,t=[c.topicHash]):(0,i.MR)(!1,"unknown event name","event",a);var f;return t=t.map((e=>{if(null==e)return null;if(Array.isArray(e)){const a=Array.from(new Set(e.map((e=>e.toLowerCase()))).values());return 1===a.length?a[0]:(a.sort(),a)}return e.toLowerCase()})),{fragment:c,tag:t.map((e=>null==e?"null":Array.isArray(e)?e.join("|"):e)).join("&"),topics:t}}async function B(e,a){const{subs:t}=C(e);return t.get((await M(e,a)).tag)||null}async function k(e,a,t){const c=A(e.runner);(0,i.vA)(c,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:a});const{fragment:f,tag:d,topics:r}=await M(e,t),{addr:n,subs:b}=C(e);let o=b.get(d);if(!o){const a={address:n||e,topics:r},i=a=>{let c=f;if(null==c)try{c=e.interface.getEvent(a.topics[0])}catch(e){}if(c){const d=c,r=f?e.interface.decodeEventLog(f,a.data,a.topics):[];S(e,t,r,(c=>new s.HZ(e,c,t,d,a)))}else S(e,t,[],(c=>new s._k(e,c,t,a)))};let l=[];o={tag:d,listeners:[],start:()=>{l.length||l.push(c.on(a,i))},stop:async()=>{if(0==l.length)return;let e=l;l=[],await Promise.all(e),c.off(a,i)}},b.set(d,o)}return o}let L=Promise.resolve();async function S(e,a,t,c){try{await L}catch(e){}const f=async function(e,a,t,c){await L;const f=await B(e,a);if(!f)return!1;const d=f.listeners.length;return f.listeners=f.listeners.filter((({listener:a,once:f})=>{const d=Array.from(t);c&&d.push(c(f?null:a));try{a.call(e,...d)}catch(e){}return!f})),0===f.listeners.length&&(f.stop(),C(e).subs.delete(f.tag)),d>0}(e,a,t,c);return L=f,await f}const T=["then"];class N{target;interface;runner;filters;[I];fallback;constructor(e,a,t,c){(0,i.MR)("string"==typeof e||(0,d.$C)(e),"invalid value for Contract target","target",e),null==t&&(t=null);const r=f.KA.from(a);let b;(0,n.n)(this,{target:e,runner:t,interface:r}),Object.defineProperty(this,I,{value:{}});let l=null,u=null;if(c){const e=A(t);u=new s.Cn(this.interface,e,c)}let h=new Map;if("string"==typeof e)if((0,o.Lo)(e))l=e,b=Promise.resolve(e);else{const a=x(t,"resolveName");if(!p(a))throw(0,i.xz)("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});b=a.resolveName(e).then((a=>{if(null==a)throw(0,i.xz)("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return C(this).addr=a,a}))}else b=e.getAddress().then((e=>{if(null==e)throw new Error("TODO");return C(this).addr=e,e}));var g;g={addrPromise:b,addr:l,deployTx:u,subs:h},E.set(this[I],g);const m=new Proxy({},{get:(e,a,t)=>{if("symbol"==typeof a||T.indexOf(a)>=0)return Reflect.get(e,a,t);try{return this.getEvent(a)}catch(e){if(!(0,i.bJ)(e,"INVALID_ARGUMENT")||"key"!==e.argument)throw e}},has:(e,a)=>T.indexOf(a)>=0?Reflect.has(e,a):Reflect.has(e,a)||this.interface.hasEvent(String(a))});return(0,n.n)(this,{filters:m}),(0,n.n)(this,{fallback:r.receive||r.fallback?_(this):null}),new Proxy(this,{get:(e,a,t)=>{if("symbol"==typeof a||a in e||T.indexOf(a)>=0)return Reflect.get(e,a,t);try{return e.getFunction(a)}catch(e){if(!(0,i.bJ)(e,"INVALID_ARGUMENT")||"key"!==e.argument)throw e}},has:(e,a)=>"symbol"==typeof a||a in e||T.indexOf(a)>=0?Reflect.has(e,a):e.interface.hasFunction(a)})}connect(e){return new N(this.target,this.interface,e)}attach(e){return new N(e,this.interface,this.runner)}async getAddress(){return await C(this).addrPromise}async getDeployedCode(){const e=A(this.runner);(0,i.vA)(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const a=await e.getCode(await this.getAddress());return"0x"===a?null:a}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(null!=await this.getDeployedCode())return this;const a=A(this.runner);return(0,i.vA)(null!=a,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise(((e,t)=>{const c=async()=>{try{if(null!=await this.getDeployedCode())return e(this);a.once("block",c)}catch(e){t(e)}};c()}))}deploymentTransaction(){return C(this).deployTx}getFunction(e){"string"!=typeof e&&(e=e.format());const a=function(e,a){const t=function(...t){const c=e.interface.getFunction(a,t);return(0,i.vA)(c,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:a,args:t}}),c},c=async function(...a){const c=t(...a);let f={};if(c.inputs.length+1===a.length&&(f=await v(a.pop()),f.from&&(f.from=await(0,d.tG)(f.from,m(e.runner)))),c.inputs.length!==a.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const r=await w(e.runner,c.inputs,a);return Object.assign({},f,await(0,n.k)({to:e.getAddress(),data:e.interface.encodeFunctionData(c,r)}))},f=async function(...e){const a=await b(...e);return 1===a.length?a[0]:a},r=async function(...a){const t=e.runner;(0,i.vA)(g(t),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const f=await t.sendTransaction(await c(...a)),d=A(e.runner);return new s.Cn(e.interface,d,f)},b=async function(...a){const f=x(e.runner,"call");(0,i.vA)(u(f),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const d=await c(...a);let r="0x";try{r=await f.call(d)}catch(a){if((0,i.E)(a)&&a.data)throw e.interface.makeError(a.data,d);throw a}const n=t(...a);return e.interface.decodeFunctionResult(n,r)},o=async(...e)=>t(...e).constant?await f(...e):await r(...e);return(0,n.n)(o,{name:e.interface.getFunctionName(a),_contract:e,_key:a,getFragment:t,estimateGas:async function(...a){const t=x(e.runner,"estimateGas");return(0,i.vA)(h(t),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await t.estimateGas(await c(...a))},populateTransaction:c,send:r,staticCall:f,staticCallResult:b}),Object.defineProperty(o,"fragment",{configurable:!1,enumerable:!0,get:()=>{const t=e.interface.getFunction(a);return(0,i.vA)(t,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:a}}),t}}),o}(this,e);return a}getEvent(e){return"string"!=typeof e&&(e=e.format()),function(e,a){const t=function(...t){const c=e.interface.getEvent(a,t);return(0,i.vA)(c,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:a,args:t}}),c},c=function(...a){return new y(e,t(...a),a)};return(0,n.n)(c,{name:e.interface.getEventName(a),_contract:e,_key:a,getFragment:t}),Object.defineProperty(c,"fragment",{configurable:!1,enumerable:!0,get:()=>{const t=e.interface.getEvent(a);return(0,i.vA)(t,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:a}}),t}}),c}(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,a,t){null==a&&(a=0),null==t&&(t="latest");const{addr:c,addrPromise:f}=C(this),d=c||await f,{fragment:n,topics:b}=await M(this,e),o={address:d,topics:b,fromBlock:a,toBlock:t},l=A(this.runner);return(0,i.vA)(l,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await l.getLogs(o)).map((e=>{let a=n;if(null==a)try{a=this.interface.getEvent(e.topics[0])}catch(e){}if(a)try{return new s.vu(e,this.interface,a)}catch(a){return new s.AA(e,a)}return new r.tG(e,l)}))}async on(e,a){const t=await k(this,"on",e);return t.listeners.push({listener:a,once:!1}),t.start(),this}async once(e,a){const t=await k(this,"once",e);return t.listeners.push({listener:a,once:!0}),t.start(),this}async emit(e,...a){return await S(this,e,a,null)}async listenerCount(e){if(e){const a=await B(this,e);return a?a.listeners.length:0}const{subs:a}=C(this);let t=0;for(const{listeners:e}of a.values())t+=e.length;return t}async listeners(e){if(e){const a=await B(this,e);return a?a.listeners.map((({listener:e})=>e)):[]}const{subs:a}=C(this);let t=[];for(const{listeners:e}of a.values())t=t.concat(e.map((({listener:e})=>e)));return t}async off(e,a){const t=await B(this,e);if(!t)return this;if(a){const e=t.listeners.map((({listener:e})=>e)).indexOf(a);e>=0&&t.listeners.splice(e,1)}return null!=a&&0!==t.listeners.length||(t.stop(),C(this).subs.delete(t.tag)),this}async removeAllListeners(e){if(e){const a=await B(this,e);if(!a)return this;a.stop(),C(this).subs.delete(a.tag)}else{const{subs:e}=C(this);for(const{tag:a,stop:t}of e.values())t(),e.delete(a)}return this}async addListener(e,a){return await this.on(e,a)}async removeListener(e,a){return await this.off(e,a)}static buildClass(e){return class extends N{constructor(a,t=null){super(a,e,t)}}}static from(e,a,t){return null==t&&(t=null),new this(e,a,t)}}class R extends(function(){return N}()){}},24359:(e,a,t)=>{"use strict";t.d(a,{AA:()=>n,Cn:()=>b,HZ:()=>s,_k:()=>o,vu:()=>r});var c=t(43948),f=t(88081),d=t(99381);class r extends c.tG{interface;fragment;args;constructor(e,a,t){super(e,e.provider);const c=a.decodeEventLog(t,e.data,e.topics);(0,f.n)(this,{args:c,fragment:t,interface:a})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class n extends c.tG{error;constructor(e,a){super(e,e.provider),(0,f.n)(this,{error:a})}}class i extends c.z5{#ve;constructor(e,a,t){super(t,a),this.#ve=e}get logs(){return super.logs.map((e=>{const a=e.topics.length?this.#ve.getEvent(e.topics[0]):null;if(a)try{return new r(e,this.#ve,a)}catch(a){return new n(e,a)}return e}))}}class b extends c.uI{#ve;constructor(e,a,t){super(t,a),this.#ve=e}async wait(e,a){const t=await super.wait(e,a);return null==t?null:new i(this.#ve,this.provider,t)}}class o extends d.z{log;constructor(e,a,t,c){super(e,a,t),(0,f.n)(this,{log:c})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class s extends o{constructor(e,a,t,c,d){super(e,a,t,new r(d,e.interface,c));const n=e.interface.decodeEventLog(c,this.log.data,this.log.topics);(0,f.n)(this,{args:n,fragment:c})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}},8180:(e,a,t)=>{"use strict";t.d(a,{n1:()=>y,Gz:()=>x,T_:()=>A,po:()=>v});var c=t(4655),f=t(84877),d=t(3439),r=t(37171),n=t(86558),i=t(10750);const[b,o]=(()=>n.Ay.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((e=>BigInt(e)))))(),s=new Uint32Array(80),l=new Uint32Array(80);class u extends r.D{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:a,Bh:t,Bl:c,Ch:f,Cl:d,Dh:r,Dl:n,Eh:i,El:b,Fh:o,Fl:s,Gh:l,Gl:u,Hh:h,Hl:p}=this;return[e,a,t,c,f,d,r,n,i,b,o,s,l,u,h,p]}set(e,a,t,c,f,d,r,n,i,b,o,s,l,u,h,p){this.Ah=0|e,this.Al=0|a,this.Bh=0|t,this.Bl=0|c,this.Ch=0|f,this.Cl=0|d,this.Dh=0|r,this.Dl=0|n,this.Eh=0|i,this.El=0|b,this.Fh=0|o,this.Fl=0|s,this.Gh=0|l,this.Gl=0|u,this.Hh=0|h,this.Hl=0|p}process(e,a){for(let t=0;t<16;t++,a+=4)s[t]=e.getUint32(a),l[t]=e.getUint32(a+=4);for(let e=16;e<80;e++){const a=0|s[e-15],t=0|l[e-15],c=n.Ay.rotrSH(a,t,1)^n.Ay.rotrSH(a,t,8)^n.Ay.shrSH(a,t,7),f=n.Ay.rotrSL(a,t,1)^n.Ay.rotrSL(a,t,8)^n.Ay.shrSL(a,t,7),d=0|s[e-2],r=0|l[e-2],i=n.Ay.rotrSH(d,r,19)^n.Ay.rotrBH(d,r,61)^n.Ay.shrSH(d,r,6),b=n.Ay.rotrSL(d,r,19)^n.Ay.rotrBL(d,r,61)^n.Ay.shrSL(d,r,6),o=n.Ay.add4L(f,b,l[e-7],l[e-16]),u=n.Ay.add4H(o,c,i,s[e-7],s[e-16]);s[e]=0|u,l[e]=0|o}let{Ah:t,Al:c,Bh:f,Bl:d,Ch:r,Cl:i,Dh:u,Dl:h,Eh:p,El:g,Fh:m,Fl:y,Gh:x,Gl:A,Hh:v,Hl:w}=this;for(let e=0;e<80;e++){const a=n.Ay.rotrSH(p,g,14)^n.Ay.rotrSH(p,g,18)^n.Ay.rotrBH(p,g,41),_=n.Ay.rotrSL(p,g,14)^n.Ay.rotrSL(p,g,18)^n.Ay.rotrBL(p,g,41),I=p&m^~p&x,E=g&y^~g&A,C=n.Ay.add5L(w,_,E,o[e],l[e]),M=n.Ay.add5H(C,v,a,I,b[e],s[e]),B=0|C,k=n.Ay.rotrSH(t,c,28)^n.Ay.rotrBH(t,c,34)^n.Ay.rotrBH(t,c,39),L=n.Ay.rotrSL(t,c,28)^n.Ay.rotrBL(t,c,34)^n.Ay.rotrBL(t,c,39),S=t&f^t&r^f&r,T=c&d^c&i^d&i;v=0|x,w=0|A,x=0|m,A=0|y,m=0|p,y=0|g,({h:p,l:g}=n.Ay.add(0|u,0|h,0|M,0|B)),u=0|r,h=0|i,r=0|f,i=0|d,f=0|t,d=0|c;const N=n.Ay.add3L(B,L,T);t=n.Ay.add3H(N,M,k,S),c=0|N}({h:t,l:c}=n.Ay.add(0|this.Ah,0|this.Al,0|t,0|c)),({h:f,l:d}=n.Ay.add(0|this.Bh,0|this.Bl,0|f,0|d)),({h:r,l:i}=n.Ay.add(0|this.Ch,0|this.Cl,0|r,0|i)),({h:u,l:h}=n.Ay.add(0|this.Dh,0|this.Dl,0|u,0|h)),({h:p,l:g}=n.Ay.add(0|this.Eh,0|this.El,0|p,0|g)),({h:m,l:y}=n.Ay.add(0|this.Fh,0|this.Fl,0|m,0|y)),({h:x,l:A}=n.Ay.add(0|this.Gh,0|this.Gl,0|x,0|A)),({h:v,l:w}=n.Ay.add(0|this.Hh,0|this.Hl,0|v,0|w)),this.set(t,c,f,d,r,i,u,h,p,g,m,y,x,A,v,w)}roundClean(){s.fill(0),l.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const h=(0,i.ld)((()=>new u));var p=t(57339);const g=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}(),m=g.crypto||g.msCrypto;function y(e){switch(e){case"sha256":return d.s.create();case"sha512":return h.create()}(0,p.MR)(!1,"invalid hashing algorithm name","algorithm",e)}function x(e,a){const t={sha256:d.s,sha512:h}[e];return(0,p.MR)(null!=t,"invalid hmac algorithm","algorithm",e),c.w.create(t,a)}function A(e,a,t,c,r){const n={sha256:d.s,sha512:h}[r];return(0,p.MR)(null!=n,"invalid pbkdf2 algorithm","algorithm",r),(0,f.A)(n,e,a,{c:t,dkLen:c})}function v(e){(0,p.vA)(null!=m,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),(0,p.MR)(Number.isInteger(e)&&e>0&&e<=1024,"invalid length","length",e);const a=new Uint8Array(e);return m.getRandomValues(a),a}},15539:(e,a,t)=>{"use strict";t.d(a,{S:()=>E});var c=t(27125),f=t(86558),d=t(10750);const[r,n,i]=[[],[],[]],b=BigInt(0),o=BigInt(1),s=BigInt(2),l=BigInt(7),u=BigInt(256),h=BigInt(113);for(let e=0,a=o,t=1,c=0;e<24;e++){[t,c]=[c,(2*t+3*c)%5],r.push(2*(5*c+t)),n.push((e+1)*(e+2)/2%64);let f=b;for(let e=0;e<7;e++)a=(a<>l)*h)%u,a&s&&(f^=o<<(o<t>32?(0,f.WM)(e,a,t):(0,f.P5)(e,a,t),y=(e,a,t)=>t>32?(0,f.im)(e,a,t):(0,f.B4)(e,a,t);class x extends d.Vw{constructor(e,a,t,f=!1,r=24){if(super(),this.blockLen=e,this.suffix=a,this.outputLen=t,this.enableXOF=f,this.rounds=r,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,c.ai)(t),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,d.DH)(this.state)}keccak(){!function(e,a=24){const t=new Uint32Array(10);for(let c=24-a;c<24;c++){for(let a=0;a<10;a++)t[a]=e[a]^e[a+10]^e[a+20]^e[a+30]^e[a+40];for(let a=0;a<10;a+=2){const c=(a+8)%10,f=(a+2)%10,d=t[f],r=t[f+1],n=m(d,r,1)^t[c],i=y(d,r,1)^t[c+1];for(let t=0;t<50;t+=10)e[a+t]^=n,e[a+t+1]^=i}let a=e[2],f=e[3];for(let t=0;t<24;t++){const c=n[t],d=m(a,f,c),i=y(a,f,c),b=r[t];a=e[b],f=e[b+1],e[b]=d,e[b+1]=i}for(let a=0;a<50;a+=10){for(let c=0;c<10;c++)t[c]=e[a+c];for(let c=0;c<10;c++)e[a+c]^=~t[(c+2)%10]&t[(c+4)%10]}e[0]^=p[c],e[1]^=g[c]}t.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){(0,c.t2)(this);const{blockLen:a,state:t}=this,f=(e=(0,d.ZJ)(e)).length;for(let c=0;c=t&&this.keccak();const d=Math.min(t-this.posOut,f-c);e.set(a.subarray(this.posOut,this.posOut+d),c),this.posOut+=d,c+=d}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,c.ai)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,c.CG)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:a,suffix:t,outputLen:c,rounds:f,enableXOF:d}=this;return e||(e=new x(a,t,c,d,f)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=f,e.suffix=t,e.outputLen=c,e.enableXOF=d,e.destroyed=this.destroyed,e}}const A=((e,a,t)=>(0,d.ld)((()=>new x(a,e,t))))(1,136,32);var v=t(36212);let w=!1;const _=function(e){return A(e)};let I=_;function E(e){const a=(0,v.q5)(e,"data");return(0,v.c$)(I(a))}E._=_,E.lock=function(){w=!0},E.register=function(e){if(w)throw new TypeError("keccak256 is locked");I=e},Object.freeze(E)},68650:(e,a,t)=>{"use strict";t.d(a,{s:()=>s});var c=t(8180),f=t(36212);const d=function(e){return(0,c.n1)("sha256").update(e).digest()},r=function(e){return(0,c.n1)("sha512").update(e).digest()};let n=d,i=r,b=!1,o=!1;function s(e){const a=(0,f.q5)(e,"data");return(0,f.c$)(n(a))}function l(e){const a=(0,f.q5)(e,"data");return(0,f.c$)(i(a))}s._=d,s.lock=function(){b=!0},s.register=function(e){if(b)throw new Error("sha256 is locked");n=e},Object.freeze(s),l._=r,l.lock=function(){o=!0},l.register=function(e){if(o)throw new Error("sha512 is locked");i=e},Object.freeze(s)},20260:(e,a,t)=>{"use strict";t.d(a,{t:()=>p});const c="0x0000000000000000000000000000000000000000000000000000000000000000";var f=t(36212),d=t(27033),r=t(57339);const n=BigInt(0),i=BigInt(1),b=BigInt(2),o=BigInt(27),s=BigInt(28),l=BigInt(35),u={};function h(e){return(0,f.nx)((0,d.c4)(e),32)}class p{#we;#_e;#Ie;#Ee;get r(){return this.#we}set r(e){(0,r.MR)(32===(0,f.pO)(e),"invalid r","value",e),this.#we=(0,f.c$)(e)}get s(){return this.#_e}set s(e){(0,r.MR)(32===(0,f.pO)(e),"invalid s","value",e);const a=(0,f.c$)(e);(0,r.MR)(parseInt(a.substring(0,3))<8,"non-canonical s","value",a),this.#_e=a}get v(){return this.#Ie}set v(e){const a=(0,d.WZ)(e,"value");(0,r.MR)(27===a||28===a,"invalid v","v",e),this.#Ie=a}get networkV(){return this.#Ee}get legacyChainId(){const e=this.networkV;return null==e?null:p.getChainId(e)}get yParity(){return 27===this.v?0:1}get yParityAndS(){const e=(0,f.q5)(this.s);return this.yParity&&(e[0]|=128),(0,f.c$)(e)}get compactSerialized(){return(0,f.xW)([this.r,this.yParityAndS])}get serialized(){return(0,f.xW)([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(e,a,t,c){(0,r.gk)(e,u,"Signature"),this.#we=a,this.#_e=t,this.#Ie=c,this.#Ee=null}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new p(u,this.r,this.s,this.v);return this.networkV&&(e.#Ee=this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:null!=e?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const a=(0,d.Ab)(e,"v");return a==o||a==s?n:((0,r.MR)(a>=l,"invalid EIP-155 v","v",e),(a-l)/b)}static getChainIdV(e,a){return(0,d.Ab)(e)*b+BigInt(35+a-27)}static getNormalizedV(e){const a=(0,d.Ab)(e);return a===n||a===o?27:a===i||a===s?28:((0,r.MR)(a>=l,"invalid v","v",e),a&i?27:28)}static from(e){function a(a,t){(0,r.MR)(a,t,"signature",e)}if(null==e)return new p(u,c,c,27);if("string"==typeof e){const t=(0,f.q5)(e,"signature");if(64===t.length){const e=(0,f.c$)(t.slice(0,32)),a=t.slice(32,64),c=128&a[0]?28:27;return a[0]&=127,new p(u,e,(0,f.c$)(a),c)}if(65===t.length){const e=(0,f.c$)(t.slice(0,32)),c=t.slice(32,64);a(!(128&c[0]),"non-canonical s");const d=p.getNormalizedV(t[64]);return new p(u,e,(0,f.c$)(c),d)}a(!1,"invalid raw signature length")}if(e instanceof p)return e.clone();const t=e.r;a(null!=t,"missing r");const n=h(t),i=function(e,t){if(null!=e)return h(e);if(null!=t){a((0,f.Lo)(t,32),"invalid yParityAndS");const e=(0,f.q5)(t);return e[0]&=127,(0,f.c$)(e)}a(!1,"missing s")}(e.s,e.yParityAndS);a(!(128&(0,f.q5)(i)[0]),"non-canonical s");const{networkV:b,v:o}=function(e,t,c){if(null!=e){const a=(0,d.Ab)(e);return{networkV:a>=l?a:void 0,v:p.getNormalizedV(a)}}if(null!=t)return a((0,f.Lo)(t,32),"invalid yParityAndS"),{v:128&(0,f.q5)(t)[0]?28:27};if(null!=c){switch((0,d.WZ)(c,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}a(!1,"invalid yParity")}a(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),s=new p(u,n,i,o);return b&&(s.#Ee=b),a(null==e.yParity||(0,d.WZ)(e.yParity,"sig.yParity")===s.yParity,"yParity mismatch"),a(null==e.yParityAndS||e.yParityAndS===s.yParityAndS,"yParityAndS mismatch"),s}}},15496:(e,a,t)=>{"use strict";t.d(a,{h:()=>be});var c={};t.r(c),t.d(c,{OG:()=>y,My:()=>b,Ph:()=>l,lX:()=>u,Id:()=>m,fg:()=>v,qj:()=>g,aT:()=>s,lq:()=>h,z:()=>p,Q5:()=>_});var f=t(3439);BigInt(0);const d=BigInt(1),r=BigInt(2),n=e=>e instanceof Uint8Array,i=Array.from({length:256},((e,a)=>a.toString(16).padStart(2,"0")));function b(e){if(!n(e))throw new Error("Uint8Array expected");let a="";for(let t=0;te+a.length),0));let t=0;return e.forEach((e=>{if(!n(e))throw new Error("Uint8Array expected");a.set(e,t),t+=e.length})),a}const y=e=>(r<new Uint8Array(e),A=e=>Uint8Array.from(e);function v(e,a,t){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof a||a<2)throw new Error("qByteLen must be a number");if("function"!=typeof t)throw new Error("hmacFn must be a function");let c=x(e),f=x(e),d=0;const r=()=>{c.fill(1),f.fill(0),d=0},n=(...e)=>t(f,c,...e),i=(e=x())=>{f=n(A([0]),e),c=n(),0!==e.length&&(f=n(A([1]),e),c=n())},b=()=>{if(d++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const t=[];for(;e{let t;for(r(),i(e);!(t=a(b()));)i();return r(),t}}const w={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,a)=>a.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function _(e,a,t={}){const c=(a,t,c)=>{const f=w[t];if("function"!=typeof f)throw new Error(`Invalid validator "${t}", expected function`);const d=e[a];if(!(c&&void 0===d||f(d,e)))throw new Error(`Invalid param ${String(a)}=${d} (${typeof d}), expected ${t}`)};for(const[e,t]of Object.entries(a))c(e,t,!1);for(const[e,a]of Object.entries(t))c(e,a,!0);return e}const I=BigInt(0),E=BigInt(1),C=BigInt(2),M=BigInt(3),B=BigInt(4),k=BigInt(5),L=BigInt(8);function S(e,a){const t=e%a;return t>=I?t:a+t}function T(e,a,t){if(t<=I||a 0");if(t===E)return I;let c=E;for(;a>I;)a&E&&(c=c*e%t),e=e*e%t,a>>=E;return c}function N(e,a,t){let c=e;for(;a-- >I;)c*=c,c%=t;return c}function R(e,a){if(e===I||a<=I)throw new Error(`invert: expected positive integers, got n=${e} mod=${a}`);let t=S(e,a),c=a,f=I,d=E,r=E,n=I;for(;t!==I;){const e=c/t,a=c%t,i=f-r*e,b=d-n*e;c=t,t=a,f=r,d=n,r=i,n=b}if(c!==E)throw new Error("invert: does not exist");return S(f,a)}BigInt(9),BigInt(16);const P=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function D(e,a){const t=void 0!==a?a:e.toString(2).length;return{nBitLength:t,nByteLength:Math.ceil(t/8)}}function O(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const a=e.toString(2).length;return Math.ceil(a/8)}function F(e){const a=O(e);return a+Math.ceil(a/2)}var Q=t(4655),U=t(10750);const j=BigInt(0),H=BigInt(1);function $(e){return _(e.Fp,P.reduce(((e,a)=>(e[a]="function",e)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"})),_(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...D(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const{Ph:q,aT:z}=c,G={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(e){const{Err:a}=G;if(e.length<2||2!==e[0])throw new a("Invalid signature integer tag");const t=e[1],c=e.subarray(2,t+2);if(!t||c.length!==t)throw new a("Invalid signature integer: wrong length");if(128&c[0])throw new a("Invalid signature integer: negative");if(0===c[0]&&!(128&c[1]))throw new a("Invalid signature integer: unnecessary leading zero");return{d:q(c),l:e.subarray(t+2)}},toSig(e){const{Err:a}=G,t="string"==typeof e?z(e):e;if(!(t instanceof Uint8Array))throw new Error("ui8a expected");let c=t.length;if(c<2||48!=t[0])throw new a("Invalid signature tag");if(t[1]!==c-2)throw new a("Invalid signature: incorrect length");const{d:f,l:d}=G._parseInt(t.subarray(2)),{d:r,l:n}=G._parseInt(d);if(n.length)throw new a("Invalid signature: left bytes after parsing");return{r:f,s:r}},hexFromSig(e){const a=e=>8&Number.parseInt(e[0],16)?"00"+e:e,t=e=>{const a=e.toString(16);return 1&a.length?`0${a}`:a},c=a(t(e.s)),f=a(t(e.r)),d=c.length/2,r=f.length/2,n=t(d),i=t(r);return`30${t(r+d+4)}02${i}${f}02${n}${c}`}},K=BigInt(0),V=BigInt(1),Z=(BigInt(2),BigInt(3));function J(e){const a=function(e){const a=$(e);return _(a,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...a})}(e),{Fp:t,n:c}=a,f=t.BYTES+1,d=2*t.BYTES+1;function r(e){return S(e,c)}function n(e){return R(e,c)}const{ProjectivePoint:i,normPrivateKeyToScalar:o,weierstrassEquation:x,isWithinCurveOrder:A}=function(e){const a=function(e){const a=$(e);_(a,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:t,Fp:c,a:f}=a;if(t){if(!c.eql(f,c.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof t||"bigint"!=typeof t.beta||"function"!=typeof t.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...a})}(e),{Fp:t}=a,c=a.toBytes||((e,a,c)=>{const f=a.toAffine();return m(Uint8Array.from([4]),t.toBytes(f.x),t.toBytes(f.y))}),f=a.fromBytes||(e=>{const a=e.subarray(1);return{x:t.fromBytes(a.subarray(0,t.BYTES)),y:t.fromBytes(a.subarray(t.BYTES,2*t.BYTES))}});function d(e){const{a:c,b:f}=a,d=t.sqr(e),r=t.mul(d,e);return t.add(t.add(r,t.mul(e,c)),f)}if(!t.eql(t.sqr(a.Gy),d(a.Gx)))throw new Error("bad generator point: equation left != right");function r(e){return"bigint"==typeof e&&Kt.eql(e,t.ZERO);return f(a)&&f(c)?u.ZERO:new u(a,c,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const a=t.invertBatch(e.map((e=>e.pz)));return e.map(((e,t)=>e.toAffine(a[t]))).map(u.fromAffine)}static fromHex(e){const a=u.fromAffine(f(g("pointHex",e)));return a.assertValidity(),a}static fromPrivateKey(e){return u.BASE.multiply(i(e))}_setWindowSize(e){this._WINDOW_SIZE=e,o.delete(this)}assertValidity(){if(this.is0()){if(a.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:e,y:c}=this.toAffine();if(!t.isValid(e)||!t.isValid(c))throw new Error("bad point: x or y not FE");const f=t.sqr(c),r=d(e);if(!t.eql(f,r))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:e}=this.toAffine();if(t.isOdd)return!t.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){s(e);const{px:a,py:c,pz:f}=this,{px:d,py:r,pz:n}=e,i=t.eql(t.mul(a,n),t.mul(d,f)),b=t.eql(t.mul(c,n),t.mul(r,f));return i&&b}negate(){return new u(this.px,t.neg(this.py),this.pz)}double(){const{a:e,b:c}=a,f=t.mul(c,Z),{px:d,py:r,pz:n}=this;let i=t.ZERO,b=t.ZERO,o=t.ZERO,s=t.mul(d,d),l=t.mul(r,r),h=t.mul(n,n),p=t.mul(d,r);return p=t.add(p,p),o=t.mul(d,n),o=t.add(o,o),i=t.mul(e,o),b=t.mul(f,h),b=t.add(i,b),i=t.sub(l,b),b=t.add(l,b),b=t.mul(i,b),i=t.mul(p,i),o=t.mul(f,o),h=t.mul(e,h),p=t.sub(s,h),p=t.mul(e,p),p=t.add(p,o),o=t.add(s,s),s=t.add(o,s),s=t.add(s,h),s=t.mul(s,p),b=t.add(b,s),h=t.mul(r,n),h=t.add(h,h),s=t.mul(h,p),i=t.sub(i,s),o=t.mul(h,l),o=t.add(o,o),o=t.add(o,o),new u(i,b,o)}add(e){s(e);const{px:c,py:f,pz:d}=this,{px:r,py:n,pz:i}=e;let b=t.ZERO,o=t.ZERO,l=t.ZERO;const h=a.a,p=t.mul(a.b,Z);let g=t.mul(c,r),m=t.mul(f,n),y=t.mul(d,i),x=t.add(c,f),A=t.add(r,n);x=t.mul(x,A),A=t.add(g,m),x=t.sub(x,A),A=t.add(c,d);let v=t.add(r,i);return A=t.mul(A,v),v=t.add(g,y),A=t.sub(A,v),v=t.add(f,d),b=t.add(n,i),v=t.mul(v,b),b=t.add(m,y),v=t.sub(v,b),l=t.mul(h,A),b=t.mul(p,y),l=t.add(b,l),b=t.sub(m,l),l=t.add(m,l),o=t.mul(b,l),m=t.add(g,g),m=t.add(m,g),y=t.mul(h,y),A=t.mul(p,A),m=t.add(m,y),y=t.sub(g,y),y=t.mul(h,y),A=t.add(A,y),g=t.mul(m,A),o=t.add(o,g),g=t.mul(v,A),b=t.mul(x,b),b=t.sub(b,g),g=t.mul(x,m),l=t.mul(v,l),l=t.add(l,g),new u(b,o,l)}subtract(e){return this.add(e.negate())}is0(){return this.equals(u.ZERO)}wNAF(e){return p.wNAFCached(this,o,e,(e=>{const a=t.invertBatch(e.map((e=>e.pz)));return e.map(((e,t)=>e.toAffine(a[t]))).map(u.fromAffine)}))}multiplyUnsafe(e){const c=u.ZERO;if(e===K)return c;if(n(e),e===V)return this;const{endo:f}=a;if(!f)return p.unsafeLadder(this,e);let{k1neg:d,k1:r,k2neg:i,k2:b}=f.splitScalar(e),o=c,s=c,l=this;for(;r>K||b>K;)r&V&&(o=o.add(l)),b&V&&(s=s.add(l)),l=l.double(),r>>=V,b>>=V;return d&&(o=o.negate()),i&&(s=s.negate()),s=new u(t.mul(s.px,f.beta),s.py,s.pz),o.add(s)}multiply(e){n(e);let c,f,d=e;const{endo:r}=a;if(r){const{k1neg:e,k1:a,k2neg:n,k2:i}=r.splitScalar(d);let{p:b,f:o}=this.wNAF(a),{p:s,f:l}=this.wNAF(i);b=p.constTimeNegate(e,b),s=p.constTimeNegate(n,s),s=new u(t.mul(s.px,r.beta),s.py,s.pz),c=b.add(s),f=o.add(l)}else{const{p:e,f:a}=this.wNAF(d);c=e,f=a}return u.normalizeZ([c,f])[0]}multiplyAndAddUnsafe(e,a,t){const c=u.BASE,f=(e,a)=>a!==K&&a!==V&&e.equals(c)?e.multiply(a):e.multiplyUnsafe(a),d=f(this,a).add(f(e,t));return d.is0()?void 0:d}toAffine(e){const{px:a,py:c,pz:f}=this,d=this.is0();null==e&&(e=d?t.ONE:t.inv(f));const r=t.mul(a,e),n=t.mul(c,e),i=t.mul(f,e);if(d)return{x:t.ZERO,y:t.ZERO};if(!t.eql(i,t.ONE))throw new Error("invZ was invalid");return{x:r,y:n}}isTorsionFree(){const{h:e,isTorsionFree:t}=a;if(e===V)return!0;if(t)return t(u,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:t}=a;return e===V?this:t?t(u,this):this.multiplyUnsafe(a.h)}toRawBytes(e=!0){return this.assertValidity(),c(u,this,e)}toHex(e=!0){return b(this.toRawBytes(e))}}u.BASE=new u(a.Gx,a.Gy,t.ONE),u.ZERO=new u(t.ZERO,t.ONE,t.ZERO);const h=a.nBitLength,p=function(e,a){const t=(e,a)=>{const t=a.negate();return e?t:a},c=e=>({windows:Math.ceil(a/e)+1,windowSize:2**(e-1)});return{constTimeNegate:t,unsafeLadder(a,t){let c=e.ZERO,f=a;for(;t>j;)t&H&&(c=c.add(f)),f=f.double(),t>>=H;return c},precomputeWindow(e,a){const{windows:t,windowSize:f}=c(a),d=[];let r=e,n=r;for(let e=0;e>=l,c>n&&(c-=s,d+=H);const r=a,u=a+Math.abs(c)-1,h=e%2!=0,p=c<0;0===c?b=b.add(t(h,f[r])):i=i.add(t(p,f[u]))}return{p:i,f:b}},wNAFCached(e,a,t,c){const f=e._WINDOW_SIZE||1;let d=a.get(e);return d||(d=this.precomputeWindow(e,f),1!==f&&a.set(e,c(d))),this.wNAF(f,d,t)}}}(u,a.endo?Math.ceil(h/2):h);return{CURVE:a,ProjectivePoint:u,normPrivateKeyToScalar:i,weierstrassEquation:d,isWithinCurveOrder:r}}({...a,toBytes(e,a,c){const f=a.toAffine(),d=t.toBytes(f.x),r=m;return c?r(Uint8Array.from([a.hasEvenY()?2:3]),d):r(Uint8Array.from([4]),d,t.toBytes(f.y))},fromBytes(e){const a=e.length,c=e[0],r=e.subarray(1);if(a!==f||2!==c&&3!==c){if(a===d&&4===c)return{x:t.fromBytes(r.subarray(0,t.BYTES)),y:t.fromBytes(r.subarray(t.BYTES,2*t.BYTES))};throw new Error(`Point of length ${a} was invalid. Expected ${f} compressed bytes or ${d} uncompressed bytes`)}{const e=l(r);if(!(K<(n=e)&&nb(h(e,a.nByteLength));function I(e){return e>c>>V}const C=(e,a,t)=>l(e.slice(a,t));class M{constructor(e,a,t){this.r=e,this.s=a,this.recovery=t,this.assertValidity()}static fromCompact(e){const t=a.nByteLength;return e=g("compactSignature",e,2*t),new M(C(e,0,t),C(e,t,2*t))}static fromDER(e){const{r:a,s:t}=G.toSig(g("DER",e));return new M(a,t)}assertValidity(){if(!A(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!A(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new M(this.r,this.s,e)}recoverPublicKey(e){const{r:c,s:f,recovery:d}=this,b=T(g("msgHash",e));if(null==d||![0,1,2,3].includes(d))throw new Error("recovery id invalid");const o=2===d||3===d?c+a.n:c;if(o>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");const s=1&d?"03":"02",l=i.fromHex(s+w(o)),u=n(o),h=r(-b*u),p=r(f*u),m=i.BASE.multiplyAndAddUnsafe(l,h,p);if(!m)throw new Error("point at infinify");return m.assertValidity(),m}hasHighS(){return I(this.s)}normalizeS(){return this.hasHighS()?new M(this.r,r(-this.s),this.recovery):this}toDERRawBytes(){return s(this.toDERHex())}toDERHex(){return G.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return s(this.toCompactHex())}toCompactHex(){return w(this.r)+w(this.s)}}const B={isValidPrivateKey(e){try{return o(e),!0}catch(e){return!1}},normPrivateKeyToScalar:o,randomPrivateKey:()=>{const e=F(a.n);return function(e,a,t=!1){const c=e.length,f=O(a),d=F(a);if(c<16||c1024)throw new Error(`expected ${d}-1024 bytes of input, got ${c}`);const r=S(t?l(e):u(e),a-E)+E;return t?p(r,f):h(r,f)}(a.randomBytes(e),a.n)},precompute:(e=8,a=i.BASE)=>(a._setWindowSize(e),a.multiply(BigInt(3)),a)};function k(e){const a=e instanceof Uint8Array,t="string"==typeof e,c=(a||t)&&e.length;return a?c===f||c===d:t?c===2*f||c===2*d:e instanceof i}const L=a.bits2int||function(e){const t=l(e),c=8*e.length-a.nBitLength;return c>0?t>>BigInt(c):t},T=a.bits2int_modN||function(e){return r(L(e))},N=y(a.nBitLength);function P(e){if("bigint"!=typeof e)throw new Error("bigint expected");if(!(K<=e&&ee in f)))throw new Error("sign() legacy options not supported");const{hash:d,randomBytes:b}=a;let{lowS:s,prehash:l,extraEntropy:u}=f;null==s&&(s=!0),e=g("msgHash",e),l&&(e=g("prehashed msgHash",d(e)));const h=T(e),p=o(c),y=[P(p),P(h)];if(null!=u){const e=!0===u?b(t.BYTES):u;y.push(g("extraEntropy",e))}const x=m(...y),v=h;return{seed:x,k2sig:function(e){const a=L(e);if(!A(a))return;const t=n(a),c=i.BASE.multiply(a).toAffine(),f=r(c.x);if(f===K)return;const d=r(t*r(v+f*p));if(d===K)return;let b=(c.x===f?0:2)|Number(c.y&V),o=d;return s&&I(d)&&(o=function(e){return I(e)?r(-e):e}(d),b^=1),new M(f,o,b)}}}(e,c,f),s=a;return v(s.hash.outputLen,s.nByteLength,s.hmac)(d,b)},verify:function(e,t,c,f=Q){const d=e;if(t=g("msgHash",t),c=g("publicKey",c),"strict"in f)throw new Error("options.strict was renamed to lowS");const{lowS:b,prehash:o}=f;let s,l;try{if("string"==typeof d||d instanceof Uint8Array)try{s=M.fromDER(d)}catch(e){if(!(e instanceof G.Err))throw e;s=M.fromCompact(d)}else{if("object"!=typeof d||"bigint"!=typeof d.r||"bigint"!=typeof d.s)throw new Error("PARSE");{const{r:e,s:a}=d;s=new M(e,a)}}l=i.fromHex(c)}catch(e){if("PARSE"===e.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(b&&s.hasHighS())return!1;o&&(t=a.hash(t));const{r:u,s:h}=s,p=T(t),m=n(h),y=r(p*m),x=r(u*m),A=i.BASE.multiplyAndAddUnsafe(l,y,x)?.toAffine();return!!A&&r(A.x)===u},ProjectivePoint:i,Signature:M,utils:B}}function W(e){return{hash:e,hmac:(a,...t)=>(0,Q.w)(e,a,(0,U.Id)(...t)),randomBytes:U.po}}BigInt(4);const Y=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),X=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),ee=BigInt(1),ae=BigInt(2),te=(e,a)=>(e+a/ae)/a;const ce=function(e,a,t=!1,c={}){if(e<=I)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:f,nByteLength:d}=D(e,a);if(d>2048)throw new Error("Field lengths over 2048 bytes are not supported");const r=function(e){if(e%B===M){const a=(e+E)/B;return function(e,t){const c=e.pow(t,a);if(!e.eql(e.sqr(c),t))throw new Error("Cannot find square root");return c}}if(e%L===k){const a=(e-k)/L;return function(e,t){const c=e.mul(t,C),f=e.pow(c,a),d=e.mul(t,f),r=e.mul(e.mul(d,C),f),n=e.mul(d,e.sub(r,e.ONE));if(!e.eql(e.sqr(n),t))throw new Error("Cannot find square root");return n}}return function(e){const a=(e-E)/C;let t,c,f;for(t=e-E,c=0;t%C===I;t/=C,c++);for(f=C;fS(a,e),isValid:a=>{if("bigint"!=typeof a)throw new Error("Invalid field element: expected bigint, got "+typeof a);return I<=a&&ae===I,isOdd:e=>(e&E)===E,neg:a=>S(-a,e),eql:(e,a)=>e===a,sqr:a=>S(a*a,e),add:(a,t)=>S(a+t,e),sub:(a,t)=>S(a-t,e),mul:(a,t)=>S(a*t,e),pow:(e,a)=>function(e,a,t){if(t 0");if(t===I)return e.ONE;if(t===E)return a;let c=e.ONE,f=a;for(;t>I;)t&E&&(c=e.mul(c,f)),f=e.sqr(f),t>>=E;return c}(n,e,a),div:(a,t)=>S(a*R(t,e),e),sqrN:e=>e*e,addN:(e,a)=>e+a,subN:(e,a)=>e-a,mulN:(e,a)=>e*a,inv:a=>R(a,e),sqrt:c.sqrt||(e=>r(n,e)),invertBatch:e=>function(e,a){const t=new Array(a.length),c=a.reduce(((a,c,f)=>e.is0(c)?a:(t[f]=a,e.mul(a,c))),e.ONE),f=e.inv(c);return a.reduceRight(((a,c,f)=>e.is0(c)?a:(t[f]=e.mul(a,t[f]),e.mul(a,c))),f),t}(n,e),cmov:(e,a,t)=>t?a:e,toBytes:e=>t?p(e,d):h(e,d),fromBytes:e=>{if(e.length!==d)throw new Error(`Fp.fromBytes: expected ${d}, got ${e.length}`);return t?u(e):l(e)}});return Object.freeze(n)}(Y,void 0,void 0,{sqrt:function(e){const a=Y,t=BigInt(3),c=BigInt(6),f=BigInt(11),d=BigInt(22),r=BigInt(23),n=BigInt(44),i=BigInt(88),b=e*e*e%a,o=b*b*e%a,s=N(o,t,a)*o%a,l=N(s,t,a)*o%a,u=N(l,ae,a)*b%a,h=N(u,f,a)*u%a,p=N(h,d,a)*h%a,g=N(p,n,a)*p%a,m=N(g,i,a)*g%a,y=N(m,n,a)*p%a,x=N(y,t,a)*o%a,A=N(x,r,a)*h%a,v=N(A,c,a)*b%a,w=N(v,ae,a);if(!ce.eql(ce.sqr(w),e))throw new Error("Cannot find square root");return w}}),fe=function(e,a){const t=a=>J({...e,...W(a)});return Object.freeze({...t(a),create:t})}({a:BigInt(0),b:BigInt(7),Fp:ce,n:X,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const a=X,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),c=-ee*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),f=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),d=t,r=BigInt("0x100000000000000000000000000000000"),n=te(d*e,a),i=te(-c*e,a);let b=S(e-n*t-i*f,a),o=S(-n*c-i*d,a);const s=b>r,l=o>r;if(s&&(b=a-b),l&&(o=a-o),b>r||o>r)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:s,k1:b,k2neg:l,k2:o}}}},f.s);BigInt(0),fe.ProjectivePoint;var de=t(57339),re=t(36212),ne=t(27033),ie=t(20260);class be{#Ce;constructor(e){(0,de.MR)(32===(0,re.pO)(e),"invalid private key","privateKey","[REDACTED]"),this.#Ce=(0,re.c$)(e)}get privateKey(){return this.#Ce}get publicKey(){return be.computePublicKey(this.#Ce)}get compressedPublicKey(){return be.computePublicKey(this.#Ce,!0)}sign(e){(0,de.MR)(32===(0,re.pO)(e),"invalid digest length","digest",e);const a=fe.sign((0,re.Lm)(e),(0,re.Lm)(this.#Ce),{lowS:!0});return ie.t.from({r:(0,ne.up)(a.r,32),s:(0,ne.up)(a.s,32),v:a.recovery?28:27})}computeSharedSecret(e){const a=be.computePublicKey(e);return(0,re.c$)(fe.getSharedSecret((0,re.Lm)(this.#Ce),(0,re.q5)(a),!1))}static computePublicKey(e,a){let t=(0,re.q5)(e,"key");if(32===t.length){const e=fe.getPublicKey(t,!!a);return(0,re.c$)(e)}if(64===t.length){const e=new Uint8Array(65);e[0]=4,e.set(t,1),t=e}const c=fe.ProjectivePoint.fromHex(t);return(0,re.c$)(c.toRawBytes(a))}static recoverPublicKey(e,a){(0,de.MR)(32===(0,re.pO)(e),"invalid digest length","digest",e);const t=ie.t.from(a);let c=fe.Signature.fromCompact((0,re.Lm)((0,re.xW)([t.r,t.s])));c=c.addRecoveryBit(t.yParity);const f=c.recoverPublicKey((0,re.Lm)(e));return(0,de.MR)(null!=f,"invalid signautre for digest","signature",a),"0x"+f.toHex(!1)}static addPoints(e,a,t){const c=fe.ProjectivePoint.fromHex(be.computePublicKey(e).substring(2)),f=fe.ProjectivePoint.fromHex(be.computePublicKey(a).substring(2));return"0x"+c.add(f).toHex(!!t)}}},38264:(e,a,t)=>{"use strict";t.d(a,{id:()=>d});var c=t(15539),f=t(87303);function d(e){return(0,c.S)((0,f.YW)(e))}},64563:(e,a,t)=>{"use strict";t.d(a,{Wh:()=>Ee,kM:()=>Ie});var c=t(15539),f=t(57339),d=t(87303),r=t(36212),n="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const i=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),b=4;function o(e){return function(e){let a=0;return()=>e[a++]}(function(e){let a=0;function t(){return e[a++]<<8|e[a++]}let c=t(),f=1,d=[0,1];for(let e=1;e>--i&1}const s=2**31,l=s>>>1,u=l>>1,h=s-1;let p=0;for(let e=0;e<31;e++)p=p<<1|o();let g=[],m=0,y=s;for(;;){let e=Math.floor(((p-m+1)*f-1)/y),a=0,t=c;for(;t-a>1;){let c=a+t>>>1;e>>1|o(),r=r<<1^l,n=(n^l)<<1|l|1;m=r,y=1+n-r}let x=c-4;return g.map((a=>{switch(a-x){case 3:return x+65792+(e[n++]<<16|e[n++]<<8|e[n++]);case 2:return x+256+(e[n++]<<8|e[n++]);case 1:return x+e[n++];default:return a-1}}))}(function(e){let a=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach(((e,t)=>a[e.charCodeAt(0)]=t));let t=e.length,c=new Uint8Array(6*t>>3);for(let f=0,d=0,r=0,n=0;f=8&&(c[d++]=n>>(r-=8));return c}(e)))}function s(e){return 1&e?~e>>1:e>>1}function l(e,a){let t=Array(e);for(let c=0,f=0;c{let a=u(e);if(a.length)return a}))}function p(e){let a=[];for(;;){let t=e();if(0==t)break;a.push(y(t,e))}for(;;){let t=e()-1;if(t<0)break;a.push(x(t,e))}return a.flat()}function g(e){let a=[];for(;;){let t=e(a.length);if(!t)break;a.push(t)}return a}function m(e,a,t){let c=Array(e).fill().map((()=>[]));for(let f=0;fc[a].push(e)));return c}function y(e,a){let t=1+a(),c=a(),f=g(a);return m(f.length,1+e,a).flatMap(((e,a)=>{let[d,...r]=e;return Array(f[a]).fill().map(((e,a)=>{let f=a*c;return[d+a*t,r.map((e=>e+f))]}))}))}function x(e,a){return m(1+a(),1+e,a).map((e=>[e[0],e.slice(1)]))}function A(e){return`{${function(e){return e.toString(16).toUpperCase().padStart(2,"0")}(e)}}`}function v(e){let a=e.length;if(a<4096)return String.fromCodePoint(...e);let t=[];for(let c=0;c>24&255}function P(e){return 16777215&e}let D,O,F,Q;function U(e){return e>=I&&e=E&&e=C&&aM&&ae.map((e=>[e,a+1<<24]))))),O=new Set(u(e)),F=new Map,Q=new Map;for(let[a,t]of p(e)){if(!O.has(a)&&2==t.length){let[e,c]=t,f=Q.get(e);f||(f=new Map,Q.set(e,f)),f.set(c,a)}F.set(a,t.reverse())}}();let a=[],t=[],c=!1;function f(e){let t=D.get(e);t&&(c=!0,e|=t),a.push(e)}for(let c of e)for(;;){if(c<128)a.push(c);else if(U(c)){let e=c-I,a=e%k/B|0,t=e%B;f(E+(e/k|0)),f(C+a),t>0&&f(M+t)}else{let e=F.get(c);e?t.push(...e):f(c)}if(!t.length)break;c=t.pop()}if(c&&a.length>1){let e=R(a[0]);for(let t=1;t0&&f>=e)0==e?(a.push(c,...t),t.length=0,c=r):t.push(r),f=e;else{let d=j(c,r);d>=0?c=d:0==f&&0==e?(a.push(c),c=r):(t.push(r),f=e)}}return c>=0&&a.push(c,...t),a}(H(e))}const z=45,G=".",K=65039,V=1,Z=e=>Array.from(e);function J(e,a){return e.P.has(a)||e.Q.has(a)}class W extends Array{get is_emoji(){return!0}}let Y,X,ee,ae,te,ce,fe,de,re,ne,ie,be;function oe(){if(Y)return;let e=o(n);const a=()=>u(e),t=()=>new Set(a()),c=(e,a)=>a.forEach((a=>e.add(a)));Y=new Map(p(e)),X=t(),ee=a(),ae=new Set(a().map((e=>ee[e]))),ee=new Set(ee),te=t(),ce=t();let f=h(e),d=e();const r=()=>{let e=new Set;return a().forEach((a=>c(e,f[a]))),c(e,a()),e};fe=g((a=>{let t=g(e).map((e=>e+96));if(t.length){let c=a>=d;return t[0]-=32,t=v(t),c&&(t=`Restricted[${t}]`),{N:t,P:r(),Q:r(),M:!e(),R:c}}})),de=t(),re=new Map;let i=a().concat(Z(de)).sort(((e,a)=>e-a));i.forEach(((a,t)=>{let c=e(),f=i[t]=c?i[t-c]:{V:[],M:new Map};f.V.push(a),de.has(a)||re.set(a,f)}));for(let{V:e,M:a}of new Set(re.values())){let t=[];for(let a of e){let e=fe.filter((e=>J(e,a))),f=t.find((({G:a})=>e.some((e=>a.has(e)))));f||(f={G:new Set,V:[]},t.push(f)),f.V.push(a),c(f.G,e)}let f=t.flatMap((e=>Z(e.G)));for(let{G:e,V:c}of t){let t=new Set(f.filter((a=>!e.has(a))));for(let e of c)a.set(e,t)}}ne=new Set;let b=new Set;const s=e=>ne.has(e)?b.add(e):ne.add(e);for(let e of fe){for(let a of e.P)s(a);for(let a of e.Q)s(a)}for(let e of ne)re.has(e)||b.has(e)||re.set(e,V);c(ne,$(ne)),ie=function(e){let a=[],t=u(e);return function e({S:t,B:c},f,d){if(!(4&t&&d===f[f.length-1])){2&t&&(d=f[f.length-1]),1&t&&a.push(f);for(let a of c)for(let t of a.Q)e(a,[...f,t],d)}}(function a(c){return{S:e(),B:g((()=>{let c=u(e).map((e=>t[e]));if(c.length)return a(c)})),Q:c}}([]),[]),a}(e).map((e=>W.from(e))).sort(w),be=new Map;for(let e of ie){let a=[be];for(let t of e){let e=a.map((e=>{let a=e.get(t);return a||(a=new Map,e.set(t,a)),a}));t===K?a.push(...e):a=e}for(let t of a)t.V=e}}function se(e){return(he(e)?"":`${le(ue([e]))} `)+A(e)}function le(e){return`"${e}"‎`}function ue(e,a=1/0,t=A){let c=[];var f;f=e[0],oe(),ee.has(f)&&c.push("◌"),e.length>a&&(a>>=1,e=[...e.slice(0,a),8230,...e.slice(-a)]);let d=0,r=e.length;for(let a=0;a{let f=function(e){let a=[];for(let t=0,c=e.length;t0;)if(95!==e[--a])throw new Error("underscore allowed only at start")}(n),!(d.emoji=r>1||c[0].is_emoji)&&n.every((e=>e<128)))!function(e){if(e.length>=4&&e[2]==z&&e[3]==z)throw new Error(`invalid label extension: "${v(e.slice(0,4))}"`)}(n),e="ASCII";else{let a=c.flatMap((e=>e.is_emoji?[]:e));if(a.length){if(ee.has(n[0]))throw ye("leading combining mark");for(let e=1;eJ(e,t)));if(!e.length)throw fe.some((e=>J(e,t)))?me(a[0],t):ge(t);if(a=e,1==e.length)break}return a}(t);!function(e,a){for(let t of a)if(!J(e,t))throw me(e,t);if(e.M){let e=$(a);for(let a=1,t=e.length;ab)throw new Error(`excessive non-spacing marks: ${le(ue(e.slice(a-1,c)))} (${c-a}/${b})`);a=c}}}(f,a),function(e,a){let t,c=[];for(let e of a){let a=re.get(e);if(a===V)return;if(a){let c=a.M.get(e);if(t=t?t.filter((e=>c.has(e))):Z(c),!t.length)return}else c.push(e)}if(t)for(let a of t)if(c.every((e=>J(a,e))))throw new Error(`whole-script confusable: ${e.N}/${a.N}`)}(f,t),e=f.N}else e="Emoji"}d.type=e}catch(e){d.error=e}return d}))}function ge(e){return new Error(`disallowed character: ${se(e)}`)}function me(e,a){let t=se(a),c=fe.find((e=>e.P.has(a)));return c&&(t=`${c.N} ${t}`),new Error(`illegal mixture: ${e.N} + ${t}`)}function ye(e){return new Error(`illegal placement: ${e}`)}function xe(e){return e.filter((e=>e!=K))}function Ae(e,a){let t,c=be,f=e.length;for(;f&&(c=c.get(e[--f]),c);){let{V:d}=c;d&&(t=d,a&&a.push(...e.slice(f).reverse()),e.length=f)}return t}const ve=new Uint8Array(32);function we(e){return(0,f.MR)(0!==e.length,"invalid ENS name; empty component","comp",e),e}function _e(e){const a=(0,d.YW)(function(e){try{if(0===e.length)throw new Error("empty label");return function(e){return function(e){return e.map((({input:a,error:t,output:c})=>{if(t){let c=t.message;throw new Error(1==e.length?c:`Invalid label ${le(ue(a,63))}: ${c}`)}return v(c)})).join(G)}(pe(e,q,xe))}(e)}catch(a){(0,f.MR)(!1,`invalid ENS name (${a.message})`,"name",e)}}(e)),t=[];if(0===e.length)return t;let c=0;for(let e=0;e{(0,f.MR)(a.length<=t,`label ${JSON.stringify(e)} exceeds ${t} bytes`,"name",e);const c=new Uint8Array(a.length+1);return c.set(a,1),c[0]=c.length-1,c}))))+"00"}ve.fill(0)},82314:(e,a,t)=>{"use strict";t.d(a,{z:()=>I});var c=t(30031),f=t(15539),d=t(36212),r=t(27033),n=t(57339),i=t(88081),b=t(38264);const o=new Uint8Array(32);o.fill(0);const s=BigInt(-1),l=BigInt(0),u=BigInt(1),h=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),p=(0,r.up)(u,32),g=(0,r.up)(l,32),m={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},y=["name","version","chainId","verifyingContract","salt"];function x(e){return function(a){return(0,n.MR)("string"==typeof a,`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,a),a}}const A={name:x("name"),version:x("version"),chainId:function(e){const a=(0,r.Ab)(e,"domain.chainId");return(0,n.MR)(a>=0,"invalid chain ID","domain.chainId",e),Number.isSafeInteger(a)?Number(a):(0,r.nD)(a)},verifyingContract:function(e){try{return(0,c.b)(e).toLowerCase()}catch(e){}(0,n.MR)(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){const a=(0,d.q5)(e,"domain.salt");return(0,n.MR)(32===a.length,'invalid domain value "salt"',"domain.salt",e),(0,d.c$)(a)}};function v(e){{const a=e.match(/^(u?)int(\d+)$/);if(a){const t=""===a[1],c=parseInt(a[2]);(0,n.MR)(c%8==0&&0!==c&&c<=256&&a[2]===String(c),"invalid numeric width","type",e);const f=(0,r.dK)(h,t?c-1:c),d=t?(f+u)*s:l;return function(a){const c=(0,r.Ab)(a,"value");return(0,n.MR)(c>=d&&c<=f,`value out-of-bounds for ${e}`,"value",c),(0,r.up)(t?(0,r.JJ)(c,256):c,32)}}}{const a=e.match(/^bytes(\d+)$/);if(a){const t=parseInt(a[1]);return(0,n.MR)(0!==t&&t<=32&&a[1]===String(t),"invalid bytes width","type",e),function(a){const c=(0,d.q5)(a);return(0,n.MR)(c.length===t,`invalid length for ${e}`,"value",a),function(e){const a=(0,d.q5)(e),t=a.length%32;return t?(0,d.xW)([a,o.slice(t)]):(0,d.c$)(a)}(a)}}}switch(e){case"address":return function(e){return(0,d.nx)((0,c.b)(e),32)};case"bool":return function(e){return e?p:g};case"bytes":return function(e){return(0,f.S)(e)};case"string":return function(e){return(0,b.id)(e)}}return null}function w(e,a){return`${e}(${a.map((({name:e,type:a})=>a+" "+e)).join(",")})`}function _(e){const a=e.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return a?{base:a[1],index:a[2]+a[4],array:{base:a[1],prefix:a[1]+a[2],count:a[5]?parseInt(a[5]):-1}}:{base:e}}class I{primaryType;#Me;get types(){return JSON.parse(this.#Me)}#Be;#ke;constructor(e){this.#Be=new Map,this.#ke=new Map;const a=new Map,t=new Map,c=new Map,f={};Object.keys(e).forEach((d=>{f[d]=e[d].map((({name:a,type:t})=>{let{base:c,index:f}=_(t);return"int"!==c||e.int||(c="int256"),"uint"!==c||e.uint||(c="uint256"),{name:a,type:c+(f||"")}})),a.set(d,new Set),t.set(d,[]),c.set(d,new Set)})),this.#Me=JSON.stringify(f);for(const c in f){const d=new Set;for(const r of f[c]){(0,n.MR)(!d.has(r.name),`duplicate variable name ${JSON.stringify(r.name)} in ${JSON.stringify(c)}`,"types",e),d.add(r.name);const f=_(r.type).base;(0,n.MR)(f!==c,`circular type reference to ${JSON.stringify(f)}`,"types",e),v(f)||((0,n.MR)(t.has(f),`unknown type ${JSON.stringify(f)}`,"types",e),t.get(f).push(c),a.get(c).add(f))}}const d=Array.from(t.keys()).filter((e=>0===t.get(e).length));(0,n.MR)(0!==d.length,"missing primary type","types",e),(0,n.MR)(1===d.length,`ambiguous primary types or unused types: ${d.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),(0,i.n)(this,{primaryType:d[0]}),function f(d,r){(0,n.MR)(!r.has(d),`circular type reference to ${JSON.stringify(d)}`,"types",e),r.add(d);for(const e of a.get(d))if(t.has(e)){f(e,r);for(const a of r)c.get(a).add(e)}r.delete(d)}(this.primaryType,new Set);for(const[e,a]of c){const t=Array.from(a);t.sort(),this.#Be.set(e,w(e,f[e])+t.map((e=>w(e,f[e]))).join(""))}}getEncoder(e){let a=this.#ke.get(e);return a||(a=this.#Le(e),this.#ke.set(e,a)),a}#Le(e){{const a=v(e);if(a)return a}const a=_(e).array;if(a){const e=a.prefix,t=this.getEncoder(e);return c=>{(0,n.MR)(-1===a.count||a.count===c.length,`array length mismatch; expected length ${a.count}`,"value",c);let r=c.map(t);return this.#Be.has(e)&&(r=r.map(f.S)),(0,f.S)((0,d.xW)(r))}}const t=this.types[e];if(t){const a=(0,b.id)(this.#Be.get(e));return e=>{const c=t.map((({name:a,type:t})=>{const c=this.getEncoder(t)(e[a]);return this.#Be.has(t)?(0,f.S)(c):c}));return c.unshift(a),(0,d.xW)(c)}}(0,n.MR)(!1,`unknown type: ${e}`,"type",e)}encodeType(e){const a=this.#Be.get(e);return(0,n.MR)(a,`unknown type: ${JSON.stringify(e)}`,"name",e),a}encodeData(e,a){return this.getEncoder(e)(a)}hashStruct(e,a){return(0,f.S)(this.encodeData(e,a))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,a,t){if(v(e))return t(e,a);const c=_(e).array;if(c)return(0,n.MR)(-1===c.count||c.count===a.length,`array length mismatch; expected length ${c.count}`,"value",a),a.map((e=>this._visit(c.prefix,e,t)));const f=this.types[e];if(f)return f.reduce(((e,{name:c,type:f})=>(e[c]=this._visit(f,a[c],t),e)),{});(0,n.MR)(!1,`unknown type: ${e}`,"type",e)}visit(e,a){return this._visit(this.primaryType,e,a)}static from(e){return new I(e)}static getPrimaryType(e){return I.from(e).primaryType}static hashStruct(e,a,t){return I.from(a).hashStruct(e,t)}static hashDomain(e){const a=[];for(const t in e){if(null==e[t])continue;const c=m[t];(0,n.MR)(c,`invalid typed-data domain key: ${JSON.stringify(t)}`,"domain",e),a.push({name:t,type:c})}return a.sort(((e,a)=>y.indexOf(e.name)-y.indexOf(a.name))),I.hashStruct("EIP712Domain",{EIP712Domain:a},e)}static encode(e,a,t){return(0,d.xW)(["0x1901",I.hashDomain(e),I.from(a).hash(t)])}static hash(e,a,t){return(0,f.S)(I.encode(e,a,t))}static async resolveNames(e,a,t,c){e=Object.assign({},e);for(const a in e)null==e[a]&&delete e[a];const f={};e.verifyingContract&&!(0,d.Lo)(e.verifyingContract,20)&&(f[e.verifyingContract]="0x");const r=I.from(a);r.visit(t,((e,a)=>("address"!==e||(0,d.Lo)(a,20)||(f[a]="0x"),a)));for(const e in f)f[e]=await c(e);return e.verifyingContract&&f[e.verifyingContract]&&(e.verifyingContract=f[e.verifyingContract]),{domain:e,value:t=r.visit(t,((e,a)=>"address"===e&&f[a]?f[a]:a))}}static getPayload(e,a,t){I.hashDomain(e);const c={},f=[];y.forEach((a=>{const t=e[a];null!=t&&(c[a]=A[a](t),f.push({name:a,type:m[a]}))}));const i=I.from(a);a=i.types;const b=Object.assign({},a);return(0,n.MR)(null==b.EIP712Domain,"types must not contain EIP712Domain type","types.EIP712Domain",a),b.EIP712Domain=f,i.encode(t),{types:b,domain:c,primaryType:i.primaryType,message:i.visit(t,((e,a)=>{if(e.match(/^bytes(\d*)/))return(0,d.c$)((0,d.q5)(a));if(e.match(/^u?int/))return(0,r.Ab)(a).toString();switch(e){case"address":return a.toLowerCase();case"bool":return!!a;case"string":return(0,n.MR)("string"==typeof a,"invalid string","value",a),a}(0,n.MR)(!1,"unsupported type","type",e)}))}}}},97876:(e,a,t)=>{"use strict";t.d(a,{Pz:()=>m});var c=t(30031),f=t(98982),d=t(13269),r=t(64563),n=t(57339),i=t(88081),b=t(36212),o=t(14132),s=t(27033),l=t(26976);function u(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):(0,n.MR)(!1,"unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}class h{name;constructor(e){(0,i.n)(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,a){throw new Error("unsupported coin")}async decodeAddress(e,a){throw new Error("unsupported coin")}}const p=new RegExp("^(ipfs)://(.*)$","i"),g=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),p,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];class m{provider;address;name;#Se;#Te;constructor(e,a,t){(0,i.n)(this,{provider:e,address:a,name:t}),this.#Se=null,this.#Te=new d.NZ(a,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e)}async supportsWildcard(){return null==this.#Se&&(this.#Se=(async()=>{try{return await this.#Te.supportsInterface("0x9061b923")}catch(e){if((0,n.bJ)(e,"CALL_EXCEPTION"))return!1;throw this.#Se=null,e}})()),await this.#Se}async#Ne(e,a){a=(a||[]).slice();const t=this.#Te.interface;a.unshift((0,r.kM)(this.name));let c=null;await this.supportsWildcard()&&(c=t.getFunction(e),(0,n.vA)(c,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),a=[(0,r.Wh)(this.name,255),t.encodeFunctionData(c,a)],e="resolve(bytes,bytes)"),a.push({enableCcipRead:!0});try{const f=await this.#Te[e](...a);return c?t.decodeFunctionResult(c,f)[0]:f}catch(e){if(!(0,n.bJ)(e,"CALL_EXCEPTION"))throw e}return null}async getAddress(e){if(null==e&&(e=60),60===e)try{const e=await this.#Ne("addr(bytes32)");return null==e||e===f.j?null:e}catch(e){if((0,n.bJ)(e,"CALL_EXCEPTION"))return null;throw e}if(e>=0&&e<2147483648){let a=e+2147483648;const t=await this.#Ne("addr(bytes32,uint)",[a]);if((0,b.Lo)(t,20))return(0,c.b)(t)}let a=null;for(const t of this.provider.plugins)if(t instanceof h&&t.supportsCoinType(e)){a=t;break}if(null==a)return null;const t=await this.#Ne("addr(bytes32,uint)",[e]);if(null==t||"0x"===t)return null;const d=await a.decodeAddress(e,t);if(null!=d)return d;(0,n.vA)(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:t}})}async getText(e){const a=await this.#Ne("text(bytes32,string)",[e]);return null==a||"0x"===a?null:a}async getContentHash(){const e=await this.#Ne("contenthash(bytes32)");if(null==e||"0x"===e)return null;const a=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(a){const e="e3010170"===a[1]?"ipfs":"ipns",t=parseInt(a[4],16);if(a[5].length===2*t)return`${e}://${(0,o.R)("0x"+a[2])}`}const t=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(t&&64===t[1].length)return`bzz://${t[1]}`;(0,n.vA)(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const a=await this.getText("avatar");if(null==a)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:a});for(let t=0;t{"use strict";t.d(a,{J9:()=>s,VS:()=>l,eB:()=>u,tG:()=>h,uI:()=>g,z5:()=>p});var c=t(88081),f=t(36212),d=t(27033),r=t(57339),n=t(8177);const i=BigInt(0);function b(e){return null==e?null:e}function o(e){return null==e?null:e.toString()}class s{gasPrice;maxFeePerGas;maxPriorityFeePerGas;constructor(e,a,t){(0,c.n)(this,{gasPrice:b(e),maxFeePerGas:b(a),maxPriorityFeePerGas:b(t)})}toJSON(){const{gasPrice:e,maxFeePerGas:a,maxPriorityFeePerGas:t}=this;return{_type:"FeeData",gasPrice:o(e),maxFeePerGas:o(a),maxPriorityFeePerGas:o(t)}}}function l(e){const a={};e.to&&(a.to=e.to),e.from&&(a.from=e.from),e.data&&(a.data=(0,f.c$)(e.data));const t="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const c of t)c in e&&null!=e[c]&&(a[c]=(0,d.Ab)(e[c],`request.${c}`));const c="type,nonce".split(/,/);for(const t of c)t in e&&null!=e[t]&&(a[t]=(0,d.WZ)(e[t],`request.${t}`));return e.accessList&&(a.accessList=(0,n.$)(e.accessList)),"blockTag"in e&&(a.blockTag=e.blockTag),"enableCcipRead"in e&&(a.enableCcipRead=!!e.enableCcipRead),"customData"in e&&(a.customData=e.customData),"blobVersionedHashes"in e&&e.blobVersionedHashes&&(a.blobVersionedHashes=e.blobVersionedHashes.slice()),"kzg"in e&&(a.kzg=e.kzg),"blobs"in e&&e.blobs&&(a.blobs=e.blobs.map((e=>(0,f.f)(e)?(0,f.c$)(e):Object.assign({},e)))),a}class u{provider;number;hash;timestamp;parentHash;parentBeaconBlockRoot;nonce;difficulty;gasLimit;gasUsed;stateRoot;receiptsRoot;blobGasUsed;excessBlobGas;miner;prevRandao;extraData;baseFeePerGas;#Pe;constructor(e,a){this.#Pe=e.transactions.map((e=>"string"!=typeof e?new g(e,a):e)),(0,c.n)(this,{provider:a,hash:b(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:b(e.prevRandao),extraData:e.extraData,baseFeePerGas:b(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return this.#Pe.map((e=>"string"==typeof e?e:e.hash))}get prefetchedTransactions(){const e=this.#Pe.slice();return 0===e.length?[]:((0,r.vA)("object"==typeof e[0],"transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:a,extraData:t,gasLimit:c,gasUsed:f,hash:d,miner:r,prevRandao:n,nonce:i,number:b,parentHash:s,parentBeaconBlockRoot:l,stateRoot:u,receiptsRoot:h,timestamp:p,transactions:g}=this;return{_type:"Block",baseFeePerGas:o(e),difficulty:o(a),extraData:t,gasLimit:o(c),gasUsed:o(f),blobGasUsed:o(this.blobGasUsed),excessBlobGas:o(this.excessBlobGas),hash:d,miner:r,prevRandao:n,nonce:i,number:b,parentHash:s,timestamp:p,parentBeaconBlockRoot:l,stateRoot:u,receiptsRoot:h,transactions:g}}[Symbol.iterator](){let e=0;const a=this.transactions;return{next:()=>enew h(e,a))));let t=i;null!=e.effectiveGasPrice?t=e.effectiveGasPrice:null!=e.gasPrice&&(t=e.gasPrice),(0,c.n)(this,{provider:a,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:t,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return this.#De}toJSON(){const{to:e,from:a,contractAddress:t,hash:c,index:f,blockHash:d,blockNumber:r,logsBloom:n,logs:i,status:b,root:s}=this;return{_type:"TransactionReceipt",blockHash:d,blockNumber:r,contractAddress:t,cumulativeGasUsed:o(this.cumulativeGasUsed),from:a,gasPrice:o(this.gasPrice),blobGasUsed:o(this.blobGasUsed),blobGasPrice:o(this.blobGasPrice),gasUsed:o(this.gasUsed),hash:c,index:f,logs:i,logsBloom:n,root:s,status:b,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e{if(b)return null;const{blockNumber:e,nonce:a}=await(0,c.k)({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(a{if(null==e||0!==e.status)return e;(0,r.vA)(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:e.to,from:e.from,data:""},receipt:e})},l=await this.provider.getTransactionReceipt(this.hash);if(0===t)return s(l);if(l){if(await l.confirmations()>=t)return s(l)}else if(await o(),0===t)return null;const u=new Promise(((e,a)=>{const c=[],n=()=>{c.forEach((e=>e()))};if(c.push((()=>{b=!0})),f>0){const e=setTimeout((()=>{n(),a((0,r.xz)("wait for transaction timeout","TIMEOUT"))}),f);c.push((()=>{clearTimeout(e)}))}const i=async c=>{if(await c.confirmations()>=t){n();try{e(s(c))}catch(e){a(e)}}};if(c.push((()=>{this.provider.off(this.hash,i)})),this.provider.on(this.hash,i),d>=0){const e=async()=>{try{await o()}catch(e){if((0,r.bJ)(e,"TRANSACTION_REPLACED"))return n(),void a(e)}b||this.provider.once("block",e)};c.push((()=>{this.provider.off("block",e)})),this.provider.once("block",e)}}));return await u}isMined(){return null!=this.blockHash}isLegacy(){return 0===this.type}isBerlin(){return 1===this.type}isLondon(){return 2===this.type}isCancun(){return 3===this.type}removedEvent(){return(0,r.vA)(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),y(this)}reorderedEvent(e){return(0,r.vA)(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),(0,r.vA)(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),m(this,e)}replaceableTransaction(e){(0,r.MR)(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const a=new g(this,this.provider);return a.#Oe=e,a}}function m(e,a){return{orphan:"reorder-transaction",tx:e,other:a}}function y(e){return{orphan:"drop-transaction",tx:e}}},8177:(e,a,t)=>{"use strict";t.d(a,{$:()=>n});var c=t(30031),f=t(57339),d=t(36212);function r(e,a){return{address:(0,c.b)(e),storageKeys:a.map(((e,a)=>((0,f.MR)((0,d.Lo)(e,32),"invalid slot",`storageKeys[${a}]`,e),e.toLowerCase())))}}function n(e){if(Array.isArray(e))return e.map(((a,t)=>Array.isArray(a)?((0,f.MR)(2===a.length,"invalid slot set",`value[${t}]`,a),r(a[0],a[1])):((0,f.MR)(null!=a&&"object"==typeof a,"invalid address-slot set","value",e),r(a.address,a.storageKeys))));(0,f.MR)(null!=e&&"object"==typeof e,"invalid access list","value",e);const a=Object.keys(e).map((a=>{const t=e[a].reduce(((e,a)=>(e[a]=!0,e)),{});return r(a,Object.keys(t).sort())}));return a.sort(((e,a)=>e.address.localeCompare(a.address))),a}},20415:(e,a,t)=>{"use strict";t.d(a,{K:()=>r,x:()=>n});var c=t(30031),f=t(15496),d=t(15539);function r(e){let a;return a="string"==typeof e?f.h.computePublicKey(e,!1):e.publicKey,(0,c.b)((0,d.S)("0x"+a.substring(4)).substring(26))}function n(e,a){return r(f.h.recoverPublicKey(e,a))}},79453:(e,a,t)=>{"use strict";t.d(a,{Z:()=>D});var c=t(30031),f=t(98982),d=t(68650),r=t(20260),n=t(15539),i=t(15496),b=t(57339),o=t(27033),s=t(36212);function l(e){let a=e.toString(16);for(;a.length<2;)a="0"+a;return"0x"+a}function u(e,a,t){let c=0;for(let f=0;f{(0,b.vA)(a<=e.length,"data short segment too short","BUFFER_OVERRUN",{buffer:e,length:e.length,offset:a})};if(e[a]>=248){const c=e[a]-247;t(a+1+c);const f=u(e,a+1,c);return t(a+1+c+f),h(e,a,a+1+c,c+f)}if(e[a]>=192){const c=e[a]-192;return t(a+1+c),h(e,a,a+1,c)}if(e[a]>=184){const c=e[a]-183;t(a+1+c);const f=u(e,a+1,c);return t(a+1+c+f),{consumed:1+c+f,result:(0,s.c$)(e.slice(a+1+c,a+1+c+f))}}if(e[a]>=128){const c=e[a]-128;return t(a+1+c),{consumed:1+c,result:(0,s.c$)(e.slice(a+1,a+1+c))}}return{consumed:1,result:l(e[a])}}function g(e){const a=(0,s.q5)(e,"data"),t=p(a,0);return(0,b.MR)(t.consumed===a.length,"unexpected junk after rlp payload","data",e),t.result}var m=t(65735),y=t(8177),x=t(20415);const A=BigInt(0),v=BigInt(2),w=BigInt(27),_=BigInt(28),I=BigInt(35),E=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),C=131072;function M(e,a){let t=e.toString(16);for(;t.length<2;)t="0"+t;return t+=(0,d.s)(a).substring(4),"0x"+t}function B(e){return"0x"===e?null:(0,c.b)(e)}function k(e,a){try{return(0,y.$)(e)}catch(t){(0,b.MR)(!1,t.message,a,e)}}function L(e,a){return"0x"===e?0:(0,o.WZ)(e,a)}function S(e,a){if("0x"===e)return A;const t=(0,o.Ab)(e,a);return(0,b.MR)(t<=E,"value exceeds uint size",a,t),t}function T(e,a){const t=(0,o.Ab)(e,"value"),c=(0,o.c4)(t);return(0,b.MR)(c.length<=32,"value too large",`tx.${a}`,t),c}function N(e){return(0,y.$)(e).map((e=>[e.address,e.storageKeys]))}function R(e,a){(0,b.MR)(Array.isArray(e),`invalid ${a}`,"value",e);for(let a=0;aObject.assign({},e)))}set blobs(e){if(null==e)return void(this.#We=null);const a=[],t=[];for(let c=0;ce.data)),t.map((e=>e.commitment)),t.map((e=>e.proof))])]):(0,s.xW)(["0x03",(0,m.R)(c)])}(this,t,a?this.blobs:null)}(0,b.vA)(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get serialized(){return this.#Ye(!0,!0)}get unsignedSerialized(){return this.#Ye(!1,!1)}inferType(){const e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){const e=null!=this.gasPrice,a=null!=this.maxFeePerGas||null!=this.maxPriorityFeePerGas,t=null!=this.accessList,c=null!=this.#Ve||this.#Ze;null!=this.maxFeePerGas&&null!=this.maxPriorityFeePerGas&&(0,b.vA)(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),(0,b.vA)(!a||0!==this.type&&1!==this.type,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),(0,b.vA)(0!==this.type||!t,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const f=[];return null!=this.type?f.push(this.type):a?f.push(2):e?(f.push(1),t||f.push(0)):t?(f.push(1),f.push(2)):(c&&this.to||(f.push(0),f.push(1),f.push(2)),f.push(3)),f.sort(),f}isLegacy(){return 0===this.type}isBerlin(){return 1===this.type}isLondon(){return 2===this.type}isCancun(){return 3===this.type}clone(){return D.from(this)}toJSON(){const e=e=>null==e?null:e.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(null==e)return new D;if("string"==typeof e){const a=(0,s.q5)(e);if(a[0]>=127)return D.from(function(e){const a=g(e);(0,b.MR)(Array.isArray(a)&&(9===a.length||6===a.length),"invalid field count for legacy transaction","data",e);const t={type:0,nonce:L(a[0],"nonce"),gasPrice:S(a[1],"gasPrice"),gasLimit:S(a[2],"gasLimit"),to:B(a[3]),value:S(a[4],"value"),data:(0,s.c$)(a[5]),chainId:A};if(6===a.length)return t;const c=S(a[6],"v"),f=S(a[7],"r"),d=S(a[8],"s");if(f===A&&d===A)t.chainId=c;else{let e=(c-I)/v;e{"use strict";t.d(a,{H:()=>l,R:()=>s});var c=t(36212),f=t(57339),d=t(27033);const r="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";let n=null;function i(e){if(null==n){n={};for(let e=0;e{"use strict";t.d(a,{Lm:()=>r,Lo:()=>n,X_:()=>g,ZG:()=>u,c$:()=>o,f:()=>i,nx:()=>p,pO:()=>l,q5:()=>d,xW:()=>s});var c=t(57339);function f(e,a,t){if(e instanceof Uint8Array)return t?new Uint8Array(e):e;if("string"==typeof e&&e.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const a=new Uint8Array((e.length-2)/2);let t=2;for(let c=0;c>4]+b[15&c]}return t}function s(e){return"0x"+e.map((e=>o(e).substring(2))).join("")}function l(e){return n(e,!0)?(e.length-2)/2:d(e).length}function u(e,a,t){const f=d(e);return null!=t&&t>f.length&&(0,c.vA)(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:f,length:f.length,offset:t}),o(f.slice(null==a?0:a,null==t?f.length:t))}function h(e,a,t){const f=d(e);(0,c.vA)(a>=f.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(f),length:a,offset:a+1});const r=new Uint8Array(a);return r.fill(0),t?r.set(f,a-f.length):r.set(f,0),o(r)}function p(e,a){return h(e,a,!0)}function g(e,a){return h(e,a,!1)}},57339:(e,a,t)=>{"use strict";t.d(a,{E:()=>n,MR:()=>o,SP:()=>u,bJ:()=>r,dd:()=>s,gk:()=>h,vA:()=>b,xz:()=>i});var c=t(99529),f=t(88081);function d(e){if(null==e)return"null";if(Array.isArray(e))return"[ "+e.map(d).join(", ")+" ]";if(e instanceof Uint8Array){const a="0123456789abcdef";let t="0x";for(let c=0;c>4],t+=a[15&e[c]];return t}if("object"==typeof e&&"function"==typeof e.toJSON)return d(e.toJSON());switch(typeof e){case"boolean":case"symbol":case"number":return e.toString();case"bigint":return BigInt(e).toString();case"string":return JSON.stringify(e);case"object":{const a=Object.keys(e);return a.sort(),"{ "+a.map((a=>`${d(a)}: ${d(e[a])}`)).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function r(e,a){return e&&e.code===a}function n(e){return r(e,"CALL_EXCEPTION")}function i(e,a,t){let r,n=e;{const f=[];if(t){if("message"in t||"code"in t||"name"in t)throw new Error(`value will overwrite populated values: ${d(t)}`);for(const e in t){if("shortMessage"===e)continue;const a=t[e];f.push(e+"="+d(a))}}f.push(`code=${a}`),f.push(`version=${c.r}`),f.length&&(e+=" ("+f.join(", ")+")")}switch(a){case"INVALID_ARGUMENT":r=new TypeError(e);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":r=new RangeError(e);break;default:r=new Error(e)}return(0,f.n)(r,{code:a}),t&&Object.assign(r,t),null==r.shortMessage&&(0,f.n)(r,{shortMessage:n}),r}function b(e,a,t,c){if(!e)throw i(a,t,c)}function o(e,a,t,c){b(e,a,"INVALID_ARGUMENT",{argument:t,value:c})}function s(e,a,t){null==t&&(t=""),t&&(t=": "+t),b(e>=a,"missing arguemnt"+t,"MISSING_ARGUMENT",{count:e,expectedCount:a}),b(e<=a,"too many arguments"+t,"UNEXPECTED_ARGUMENT",{count:e,expectedCount:a})}const l=["NFD","NFC","NFKD","NFKC"].reduce(((e,a)=>{try{if("test"!=="test".normalize(a))throw new Error("bad");if("NFD"===a){if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken")}e.push(a)}catch(e){}return e}),[]);function u(e){b(l.indexOf(e)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:e}})}function h(e,a,t){if(null==t&&(t=""),e!==a){let e=t,a="new";t&&(e+=".",a+=" "+t),b(!1,`private constructor; use ${e}from* methods`,"UNSUPPORTED_OPERATION",{operation:a})}}},99381:(e,a,t)=>{"use strict";t.d(a,{z:()=>f});var c=t(88081);class f{filter;emitter;#Xe;constructor(e,a,t){this.#Xe=a,(0,c.n)(this,{emitter:e,filter:t})}async removeListener(){null!=this.#Xe&&await this.emitter.off(this.filter,this.#Xe)}}},26976:(e,a,t)=>{"use strict";t.d(a,{ui:()=>y});var c=t(36212),f=t(57339),d=t(88081),r=t(87303);function n(e){return async function(e,a){(0,f.vA)(null==a||!a.cancelled,"request cancelled before sending","CANCELLED");const t=e.url.split(":")[0].toLowerCase();(0,f.vA)("http"===t||"https"===t,`unsupported protocol ${t}`,"UNSUPPORTED_OPERATION",{info:{protocol:t},operation:"request"}),(0,f.vA)("https"===t||!e.credentials||e.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let c=null;const d=new AbortController,r=setTimeout((()=>{c=(0,f.xz)("request timeout","TIMEOUT"),d.abort()}),e.timeout);a&&a.addListener((()=>{c=(0,f.xz)("request cancelled","CANCELLED"),d.abort()}));const n={method:e.method,headers:new Headers(Array.from(e)),body:e.body||void 0,signal:d.signal};let i;try{i=await fetch(e.url,n)}catch(e){if(clearTimeout(r),c)throw c;throw e}clearTimeout(r);const b={};i.headers.forEach(((e,a)=>{b[a.toLowerCase()]=e}));const o=await i.arrayBuffer(),s=null==o?null:new Uint8Array(o);return{statusCode:i.status,statusMessage:i.statusText,headers:b,body:s}}}n();let i=n();const b=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),o=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let s=!1;async function l(e,a){try{const a=e.match(b);if(!a)throw new Error("invalid data");return new x(200,"OK",{"content-type":a[1]||"text/plain"},a[2]?function(e){e=atob(e);const a=new Uint8Array(e.length);for(let t=0;tString.fromCharCode(parseInt(a,16)))))))}catch(a){return new x(599,"BAD REQUEST (invalid data: URI)",{},null,new y(e))}var t}function u(e){return async function(a,t){try{const t=a.match(o);if(!t)throw new Error("invalid link");return new y(`${e}${t[2]}`)}catch(e){return new x(599,"BAD REQUEST (invalid IPFS URI)",{},null,new y(a))}}}const h={data:l,ipfs:u("https://gateway.ipfs.io/ipfs/")},p=new WeakMap;class g{#ea;#aa;constructor(e){this.#ea=[],this.#aa=!1,p.set(e,(()=>{if(!this.#aa){this.#aa=!0;for(const e of this.#ea)setTimeout((()=>{e()}),0);this.#ea=[]}}))}addListener(e){(0,f.vA)(!this.#aa,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),this.#ea.push(e)}get cancelled(){return this.#aa}checkSignal(){(0,f.vA)(!this.cancelled,"cancelled","CANCELLED",{})}}function m(e){if(null==e)throw new Error("missing signal; should not happen");return e.checkSignal(),e}class y{#ta;#ca;#fa;#da;#ra;#e;#na;#ia;#ba;#oa;#sa;#la;#ua;#ha;#pa;get url(){return this.#e}set url(e){this.#e=String(e)}get body(){return null==this.#na?null:new Uint8Array(this.#na)}set body(e){if(null==e)this.#na=void 0,this.#ia=void 0;else if("string"==typeof e)this.#na=(0,r.YW)(e),this.#ia="text/plain";else if(e instanceof Uint8Array)this.#na=e,this.#ia="application/octet-stream";else{if("object"!=typeof e)throw new Error("invalid body");this.#na=(0,r.YW)(JSON.stringify(e)),this.#ia="application/json"}}hasBody(){return null!=this.#na}get method(){return this.#da?this.#da:this.hasBody()?"POST":"GET"}set method(e){null==e&&(e=""),this.#da=String(e).toUpperCase()}get headers(){const e=Object.assign({},this.#fa);return this.#ba&&(e.authorization=`Basic ${function(e){const a=(0,c.q5)(e);let t="";for(let e=0;e{if(t=0,"timeout must be non-zero","timeout",e),this.#ra=e}get preflightFunc(){return this.#oa||null}set preflightFunc(e){this.#oa=e}get processFunc(){return this.#sa||null}set processFunc(e){this.#sa=e}get retryFunc(){return this.#la||null}set retryFunc(e){this.#la=e}get getUrlFunc(){return this.#pa||i}set getUrlFunc(e){this.#pa=e}constructor(e){this.#e=String(e),this.#ta=!1,this.#ca=!0,this.#fa={},this.#da="",this.#ra=3e5,this.#ha={slotInterval:250,maxAttempts:12},this.#pa=null}toString(){return``}setThrottleParams(e){null!=e.slotInterval&&(this.#ha.slotInterval=e.slotInterval),null!=e.maxAttempts&&(this.#ha.maxAttempts=e.maxAttempts)}async#ga(e,a,t,c,d){if(e>=this.#ha.maxAttempts)return d.makeServerError("exceeded maximum retry limit");(0,f.vA)(A()<=a,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:c}),t>0&&await function(e){return new Promise((a=>setTimeout(a,e)))}(t);let r=this.clone();const n=(r.url.split(":")[0]||"").toLowerCase();if(n in h){const e=await h[n](r.url,m(c.#ua));if(e instanceof x){let a=e;if(this.processFunc){m(c.#ua);try{a=await this.processFunc(r,a)}catch(e){null!=e.throttle&&"number"==typeof e.stall||a.makeServerError("error in post-processing function",e).assertOk()}}return a}r=e}this.preflightFunc&&(r=await this.preflightFunc(r));const i=await this.getUrlFunc(r,m(c.#ua));let b=new x(i.statusCode,i.statusMessage,i.headers,i.body,c);if(301===b.statusCode||302===b.statusCode){try{const t=b.headers.location||"";return r.redirect(t).#ga(e+1,a,0,c,b)}catch(e){}return b}if(429===b.statusCode&&(null==this.retryFunc||await this.retryFunc(r,b,e))){const t=b.headers["retry-after"];let f=this.#ha.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return"string"==typeof t&&t.match(/^[1-9][0-9]*$/)&&(f=parseInt(t)),r.clone().#ga(e+1,a,f,c,b)}if(this.processFunc){m(c.#ua);try{b=await this.processFunc(r,b)}catch(t){null!=t.throttle&&"number"==typeof t.stall||b.makeServerError("error in post-processing function",t).assertOk();let f=this.#ha.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return t.stall>=0&&(f=t.stall),r.clone().#ga(e+1,a,f,c,b)}}return b}send(){return(0,f.vA)(null==this.#ua,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),this.#ua=new g(this),this.#ga(0,A()+this.timeout,0,this,new x(0,"",{},null,this))}cancel(){(0,f.vA)(null!=this.#ua,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=p.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const a=this.url.split(":")[0].toLowerCase(),t=e.split(":")[0].toLowerCase();(0,f.vA)("GET"===this.method&&("https"!==a||"http"!==t)&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const c=new y(e);return c.method="GET",c.allowGzip=this.allowGzip,c.timeout=this.timeout,c.#fa=Object.assign({},this.#fa),this.#na&&(c.#na=new Uint8Array(this.#na)),c.#ia=this.#ia,c}clone(){const e=new y(this.url);return e.#da=this.#da,this.#na&&(e.#na=this.#na),e.#ia=this.#ia,e.#fa=Object.assign({},this.#fa),e.#ba=this.#ba,this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),e.#oa=this.#oa,e.#sa=this.#sa,e.#la=this.#la,e.#ha=Object.assign({},this.#ha),e.#pa=this.#pa,e}static lockConfig(){s=!0}static getGateway(e){return h[e.toLowerCase()]||null}static registerGateway(e,a){if("http"===(e=e.toLowerCase())||"https"===e)throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(s)throw new Error("gateways locked");h[e]=a}static registerGetUrl(e){if(s)throw new Error("gateways locked");i=e}static createGetUrlFunc(e){return n()}static createDataGateway(){return l}static createIpfsGatewayFunc(e){return u(e)}}class x{#ma;#ya;#fa;#na;#ae;#xa;toString(){return``}get statusCode(){return this.#ma}get statusMessage(){return this.#ya}get headers(){return Object.assign({},this.#fa)}get body(){return null==this.#na?null:new Uint8Array(this.#na)}get bodyText(){try{return null==this.#na?"":(0,r._v)(this.#na)}catch(e){(0,f.vA)(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch(e){(0,f.vA)(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,a=Object.keys(e);let t=0;return{next:()=>{if(t(e[a.toLowerCase()]=String(t[a]),e)),{}),this.#na=null==c?null:new Uint8Array(c),this.#ae=f||null,this.#xa={message:""}}makeServerError(e,a){let t;t=e?`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${e})`:`CLIENT ESCALATED SERVER ERROR (${e=`${this.statusCode} ${this.statusMessage}`})`;const c=new x(599,t,this.headers,this.body,this.#ae||void 0);return c.#xa={message:e,error:a},c}throwThrottleError(e,a){null==a?a=-1:(0,f.MR)(Number.isInteger(a)&&a>=0,"invalid stall timeout","stall",a);const t=new Error(e||"throttling requests");throw(0,d.n)(t,{stall:a,throttle:!0}),t}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return null!=this.#na}get request(){return this.#ae}ok(){return""===this.#xa.message&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:a}=this.#xa;""===e&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let t=null;this.request&&(t=this.request.url);let c=null;try{this.#na&&(c=(0,r._v)(this.#na))}catch(e){}(0,f.vA)(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:a,info:{requestUrl:t,responseBody:c,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}}function A(){return(new Date).getTime()}},27033:(e,a,t)=>{"use strict";t.d(a,{Ab:()=>s,Dg:()=>h,JJ:()=>b,Ro:()=>g,ST:()=>i,WZ:()=>p,c4:()=>y,dK:()=>o,nD:()=>x,up:()=>m});var c=t(36212),f=t(57339);const d=BigInt(0),r=BigInt(1),n=9007199254740991;function i(e,a){const t=l(e,"value"),c=BigInt(p(a,"width"));return(0,f.vA)(t>>c===d,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:e}),t>>c-r?-((~t&(r<=-n&&e<=n,"overflow",a||"value",e),BigInt(e);case"string":try{if(""===e)throw new Error("empty string");return"-"===e[0]&&"-"!==e[1]?-BigInt(e.substring(1)):BigInt(e)}catch(t){(0,f.MR)(!1,`invalid BigNumberish string: ${t.message}`,a||"value",e)}}(0,f.MR)(!1,"invalid BigNumberish value",a||"value",e)}function l(e,a){const t=s(e,a);return(0,f.vA)(t>=d,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:e}),t}const u="0123456789abcdef";function h(e){if(e instanceof Uint8Array){let a="0x0";for(const t of e)a+=u[t>>4],a+=u[15&t];return BigInt(a)}return s(e)}function p(e,a){switch(typeof e){case"bigint":return(0,f.MR)(e>=-n&&e<=n,"overflow",a||"value",e),Number(e);case"number":return(0,f.MR)(Number.isInteger(e),"underflow",a||"value",e),(0,f.MR)(e>=-n&&e<=n,"overflow",a||"value",e),e;case"string":try{if(""===e)throw new Error("empty string");return p(BigInt(e),a)}catch(t){(0,f.MR)(!1,`invalid numeric string: ${t.message}`,a||"value",e)}}(0,f.MR)(!1,"invalid numeric value",a||"value",e)}function g(e){return p(h(e))}function m(e,a){let t=l(e,"value").toString(16);if(null==a)t.length%2&&(t="0"+t);else{const c=p(a,"width");for((0,f.vA)(2*c>=t.length,`value exceeds width (${c} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:e});t.length<2*c;)t="0"+t}return"0x"+t}function y(e){const a=l(e,"value");if(a===d)return new Uint8Array([]);let t=a.toString(16);t.length%2&&(t="0"+t);const c=new Uint8Array(t.length/2);for(let e=0;e{"use strict";function c(e,a,t){const c=a.split("|").map((e=>e.trim()));for(let t=0;tPromise.resolve(e[a]))))).reduce(((e,t,c)=>(e[a[c]]=t,e)),{})}function d(e,a,t){for(let f in a){let d=a[f];const r=t?t[f]:null;r&&c(d,r,f),Object.defineProperty(e,f,{enumerable:!0,value:d,writable:!1})}}t.d(a,{k:()=>f,n:()=>d})},65735:(e,a,t)=>{"use strict";t.d(a,{R:()=>n});var c=t(36212);function f(e){const a=[];for(;e;)a.unshift(255&e),e>>=8;return a}function d(e){if(Array.isArray(e)){let a=[];if(e.forEach((function(e){a=a.concat(d(e))})),a.length<=55)return a.unshift(192+a.length),a;const t=f(a.length);return t.unshift(247+t.length),t.concat(a)}const a=Array.prototype.slice.call((0,c.q5)(e,"object"));if(1===a.length&&a[0]<=127)return a;if(a.length<=55)return a.unshift(128+a.length),a;const t=f(a.length);return t.unshift(183+t.length),t.concat(a)}const r="0123456789abcdef";function n(e){let a="0x";for(const t of d(e))a+=r[t>>4],a+=r[15&t];return a}},99770:(e,a,t)=>{"use strict";t.d(a,{ck:()=>x,g5:()=>A,XS:()=>y});var c=t(57339),f=t(36212),d=t(27033),r=t(88081);const n=BigInt(-1),i=BigInt(0),b=BigInt(1),o=BigInt(5),s={};let l="0000";for(;l.length<80;)l+=l;function u(e){let a=l;for(;a.length=-a&&ei?(0,d.ST)((0,d.dK)(e,f),f):-(0,d.ST)((0,d.dK)(-e,f),f)}else{const a=b<=0&&enull==d[e]?t:((0,c.MR)(typeof d[e]===a,"invalid fixed format ("+e+" not "+a+")","format."+e,d[e]),d[e]);a=r("signed","boolean",a),t=r("width","number",t),f=r("decimals","number",f)}return(0,c.MR)(t%8==0,"invalid FixedNumber width (not byte aligned)","format.width",t),(0,c.MR)(f<=80,"invalid FixedNumber decimals (too large)","format.decimals",f),{signed:a,width:t,decimals:f,name:(a?"":"u")+"fixed"+String(t)+"x"+String(f)}}class g{format;#Aa;#va;#wa;_value;constructor(e,a,t){(0,c.gk)(e,s,"FixedNumber"),this.#va=a,this.#Aa=t;const f=function(e,a){let t="";e0?t*=u(c):c<0&&(a*=u(-c)),at?1:0}eq(e){return 0===this.cmp(e)}lt(e){return this.cmp(e)<0}lte(e){return this.cmp(e)<=0}gt(e){return this.cmp(e)>0}gte(e){return this.cmp(e)>=0}floor(){let e=this.#va;return this.#vai&&(e+=this.#wa-b),e=this.#va/this.#wa*this.#wa,this.#Ia(e,"ceiling")}round(e){if(null==e&&(e=0),e>=this.decimals)return this;const a=this.decimals-e,t=o*u(a-1);let c=this.value+t;const f=u(a);return c=c/f*f,h(c,this.#Aa,"round"),new g(s,c,this.#Aa)}isZero(){return this.#va===i}isNegative(){return this.#va0){const a=u(b);(0,c.vA)(n%a===i,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:e}),n/=a}else b<0&&(n*=u(-b));return h(n,r,"fromValue"),new g(s,n,r)}static fromString(e,a){const t=e.match(/^(-?)([0-9]*)\.?([0-9]*)$/);(0,c.MR)(t&&t[2].length+t[3].length>0,"invalid FixedNumber string value","value",e);const f=p(a);let d=t[2]||"0",r=t[3]||"";for(;r.length=0,"invalid unit","unit",a),t=3*e}else null!=a&&(t=(0,d.WZ)(a,"unit"));return g.fromString(e,{decimals:t,width:512}).value}function x(e){return function(e){let a=18;return a=(0,d.WZ)(18,"unit"),g.fromValue(e,a,{decimals:a,width:512}).toString()}(e)}function A(e){return y(e,18)}},87303:(e,a,t)=>{"use strict";t.d(a,{YW:()=>n,_v:()=>i});var c=t(36212),f=t(57339);function d(e,a,t,c,f){if("BAD_PREFIX"===e||"UNEXPECTED_CONTINUE"===e){let e=0;for(let c=a+1;c>6==2;c++)e++;return e}return"OVERRUN"===e?t.length-a-1:0}const r=Object.freeze({error:function(e,a,t,c,d){(0,f.MR)(!1,`invalid codepoint at offset ${a}; ${e}`,"bytes",t)},ignore:d,replace:function(e,a,t,c,r){return"OVERLONG"===e?((0,f.MR)("number"==typeof r,"invalid bad code point for replacement","badCodepoint",r),c.push(r),0):(c.push(65533),d(e,a,t))}});function n(e,a){(0,f.MR)("string"==typeof e,"invalid string value","str",e),null!=a&&((0,f.SP)(a),e=e.normalize(a));let t=[];for(let a=0;a>6|192),t.push(63&c|128);else if(55296==(64512&c)){a++;const d=e.charCodeAt(a);(0,f.MR)(a>18|240),t.push(r>>12&63|128),t.push(r>>6&63|128),t.push(63&r|128)}else t.push(c>>12|224),t.push(c>>6&63|128),t.push(63&c|128)}return new Uint8Array(t)}function i(e,a){return function(e,a){null==a&&(a=r.error);const t=(0,c.q5)(e,"bytes"),f=[];let d=0;for(;d>7)){f.push(e);continue}let c=null,r=null;if(192==(224&e))c=1,r=127;else if(224==(240&e))c=2,r=2047;else{if(240!=(248&e)){d+=a(128==(192&e)?"UNEXPECTED_CONTINUE":"BAD_PREFIX",d-1,t,f);continue}c=3,r=65535}if(d-1+c>=t.length){d+=a("OVERRUN",d-1,t,f);continue}let n=e&(1<<8-c-1)-1;for(let e=0;e1114111?d+=a("OUT_OF_RANGE",d-1-c,t,f,n):n>=55296&&n<=57343?d+=a("UTF16_SURROGATE",d-1-c,t,f,n):n<=r?d+=a("OVERLONG",d-1-c,t,f,n):f.push(n))}return f}(e,a).map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}},27125:(e,a,t)=>{"use strict";function c(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function f(e,...a){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(a.length>0&&!a.includes(e.length))throw new Error(`Expected Uint8Array of length ${a}, not of length=${e.length}`)}function d(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");c(e.outputLen),c(e.blockLen)}function r(e,a=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(a&&e.finished)throw new Error("Hash#digest() has already been called")}function n(e,a){f(e);const t=a.outputLen;if(e.lengthn,ai:()=>c,ee:()=>f,t2:()=>r,tW:()=>d})},37171:(e,a,t)=>{"use strict";t.d(a,{D:()=>d});var c=t(27125),f=t(10750);class d extends f.Vw{constructor(e,a,t,c){super(),this.blockLen=e,this.outputLen=a,this.padOffset=t,this.isLE=c,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,f.O8)(this.buffer)}update(e){(0,c.t2)(this);const{view:a,buffer:t,blockLen:d}=this,r=(e=(0,f.ZJ)(e)).length;for(let c=0;cd-n&&(this.process(t,0),n=0);for(let e=n;e>f&d),n=Number(t&d),i=c?4:0,b=c?0:4;e.setUint32(a+i,r,c),e.setUint32(a+b,n,c)}(t,d-8,BigInt(8*this.length),r),this.process(t,0);const i=(0,f.O8)(e),b=this.outputLen;if(b%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const o=b/4,s=this.get();if(o>s.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e{"use strict";t.d(a,{Ay:()=>s,B4:()=>i,P5:()=>n,WM:()=>b,im:()=>o,lD:()=>r});const c=BigInt(2**32-1),f=BigInt(32);function d(e,a=!1){return a?{h:Number(e&c),l:Number(e>>f&c)}:{h:0|Number(e>>f&c),l:0|Number(e&c)}}function r(e,a=!1){let t=new Uint32Array(e.length),c=new Uint32Array(e.length);for(let f=0;fe<>>32-t,i=(e,a,t)=>a<>>32-t,b=(e,a,t)=>a<>>64-t,o=(e,a,t)=>e<>>64-t,s={fromBig:d,split:r,toBig:(e,a)=>BigInt(e>>>0)<>>0),shrSH:(e,a,t)=>e>>>t,shrSL:(e,a,t)=>e<<32-t|a>>>t,rotrSH:(e,a,t)=>e>>>t|a<<32-t,rotrSL:(e,a,t)=>e<<32-t|a>>>t,rotrBH:(e,a,t)=>e<<64-t|a>>>t-32,rotrBL:(e,a,t)=>e>>>t-32|a<<64-t,rotr32H:(e,a)=>a,rotr32L:(e,a)=>e,rotlSH:n,rotlSL:i,rotlBH:b,rotlBL:o,add:function(e,a,t,c){const f=(a>>>0)+(c>>>0);return{h:e+t+(f/2**32|0)|0,l:0|f}},add3L:(e,a,t)=>(e>>>0)+(a>>>0)+(t>>>0),add3H:(e,a,t,c)=>a+t+c+(e/2**32|0)|0,add4L:(e,a,t,c)=>(e>>>0)+(a>>>0)+(t>>>0)+(c>>>0),add4H:(e,a,t,c,f)=>a+t+c+f+(e/2**32|0)|0,add5H:(e,a,t,c,f,d)=>a+t+c+f+d+(e/2**32|0)|0,add5L:(e,a,t,c,f)=>(e>>>0)+(a>>>0)+(t>>>0)+(c>>>0)+(f>>>0)}},4655:(e,a,t)=>{"use strict";t.d(a,{w:()=>r});var c=t(27125),f=t(10750);class d extends f.Vw{constructor(e,a){super(),this.finished=!1,this.destroyed=!1,(0,c.tW)(e);const t=(0,f.ZJ)(a);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const d=this.blockLen,r=new Uint8Array(d);r.set(t.length>d?e.create().update(t).digest():t);for(let e=0;enew d(e,a).update(t).digest();r.create=(e,a)=>new d(e,a)},84877:(e,a,t)=>{"use strict";t.d(a,{A:()=>r});var c=t(27125),f=t(4655),d=t(10750);function r(e,a,t,r){const{c:n,dkLen:i,DK:b,PRF:o,PRFSalt:s}=function(e,a,t,r){(0,c.tW)(e);const n=(0,d.tY)({dkLen:32,asyncTick:10},r),{c:i,dkLen:b,asyncTick:o}=n;if((0,c.ai)(i),(0,c.ai)(b),(0,c.ai)(o),i<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const s=(0,d.ZJ)(a),l=(0,d.ZJ)(t),u=new Uint8Array(b),h=f.w.create(e,s),p=h._cloneInto().update(l);return{c:i,dkLen:b,asyncTick:o,DK:u,PRF:h,PRFSalt:p}}(e,a,t,r);let l;const u=new Uint8Array(4),h=(0,d.O8)(u),p=new Uint8Array(o.outputLen);for(let e=1,a=0;a{"use strict";t.d(a,{s:()=>o});var c=t(37171),f=t(10750);const d=(e,a,t)=>e&a^e&t^a&t,r=new Uint32Array([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]),n=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),i=new Uint32Array(64);class b extends c.D{constructor(){super(64,32,8,!1),this.A=0|n[0],this.B=0|n[1],this.C=0|n[2],this.D=0|n[3],this.E=0|n[4],this.F=0|n[5],this.G=0|n[6],this.H=0|n[7]}get(){const{A:e,B:a,C:t,D:c,E:f,F:d,G:r,H:n}=this;return[e,a,t,c,f,d,r,n]}set(e,a,t,c,f,d,r,n){this.A=0|e,this.B=0|a,this.C=0|t,this.D=0|c,this.E=0|f,this.F=0|d,this.G=0|r,this.H=0|n}process(e,a){for(let t=0;t<16;t++,a+=4)i[t]=e.getUint32(a,!1);for(let e=16;e<64;e++){const a=i[e-15],t=i[e-2],c=(0,f.Ow)(a,7)^(0,f.Ow)(a,18)^a>>>3,d=(0,f.Ow)(t,17)^(0,f.Ow)(t,19)^t>>>10;i[e]=d+i[e-7]+c+i[e-16]|0}let{A:t,B:c,C:n,D:b,E:o,F:s,G:l,H:u}=this;for(let e=0;e<64;e++){const a=u+((0,f.Ow)(o,6)^(0,f.Ow)(o,11)^(0,f.Ow)(o,25))+((h=o)&s^~h&l)+r[e]+i[e]|0,p=((0,f.Ow)(t,2)^(0,f.Ow)(t,13)^(0,f.Ow)(t,22))+d(t,c,n)|0;u=l,l=s,s=o,o=b+a|0,b=n,n=c,c=t,t=a+p|0}var h;t=t+this.A|0,c=c+this.B|0,n=n+this.C|0,b=b+this.D|0,o=o+this.E|0,s=s+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(t,c,n,b,o,s,l,u)}roundClean(){i.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const o=(0,f.ld)((()=>new b))},10750:(e,a,t)=>{"use strict";t.d(a,{Vw:()=>l,$h:()=>b,tY:()=>h,Id:()=>s,O8:()=>r,po:()=>g,Ow:()=>n,ZJ:()=>o,DH:()=>d,ld:()=>p});const c="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,f=e=>e instanceof Uint8Array,d=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),r=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),n=(e,a)=>e<<32-a|e>>>a;if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");const i=async()=>{};async function b(e,a,t){let c=Date.now();for(let f=0;f=0&&ee+a.length),0));let t=0;return e.forEach((e=>{if(!f(e))throw new Error("Uint8Array expected");a.set(e,t),t+=e.length})),a}class l{clone(){return this._cloneInto()}}const u={}.toString;function h(e,a){if(void 0!==a&&"[object Object]"!==u.call(a))throw new Error("Options should be object or undefined");return Object.assign(e,a)}function p(e){const a=a=>e().update(o(a)).digest(),t=e();return a.outputLen=t.outputLen,a.blockLen=t.blockLen,a.create=()=>e(),a}function g(e=32){if(c&&"function"==typeof c.getRandomValues)return c.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}},45238:(e,a,t)=>{"use strict";t.d(a,{K:()=>f});var c=t(75930);function f(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?(0,c.o)(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}},75007:(e,a,t)=>{"use strict";t.r(a),t.d(a,{concat:()=>d});var c=t(45238),f=t(75930);function d(e,a){a||(a=e.reduce(((e,a)=>e+a.length),0));const t=(0,c.K)(a);let d=0;for(const a of e)t.set(a,d),d+=a.length;return(0,f.o)(t)}},18402:(e,a,t)=>{"use strict";function c(e,a){if(e===a)return!0;if(e.byteLength!==a.byteLength)return!1;for(let t=0;tc})},44117:(e,a,t)=>{"use strict";t.r(a),t.d(a,{fromString:()=>d});var c=t(50040),f=t(75930);function d(e,a="utf8"){const t=c.A[a];if(!t)throw new Error(`Unsupported encoding "${a}"`);return"utf8"!==a&&"utf-8"!==a||null==globalThis.Buffer||null==globalThis.Buffer.from?t.decoder.decode(`${t.prefix}${e}`):(0,f.o)(globalThis.Buffer.from(e,"utf-8"))}},27302:(e,a,t)=>{"use strict";t.r(a),t.d(a,{toString:()=>f});var c=t(50040);function f(e,a="utf8"){const t=c.A[a];if(!t)throw new Error(`Unsupported encoding "${a}"`);return"utf8"!==a&&"utf-8"!==a||null==globalThis.Buffer||null==globalThis.Buffer.from?t.encoder.encode(e).substring(1):globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8")}},75930:(e,a,t)=>{"use strict";function c(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}t.d(a,{o:()=>c})},50040:(e,a,t)=>{"use strict";t.d(a,{A:()=>Ue});var c={};t.r(c),t.d(c,{identity:()=>M});var f={};t.r(f),t.d(f,{base2:()=>B});var d={};t.r(d),t.d(d,{base8:()=>k});var r={};t.r(r),t.d(r,{base10:()=>L});var n={};t.r(n),t.d(n,{base16:()=>S,base16upper:()=>T});var i={};t.r(i),t.d(i,{base32:()=>N,base32hex:()=>O,base32hexpad:()=>Q,base32hexpadupper:()=>U,base32hexupper:()=>F,base32pad:()=>P,base32padupper:()=>D,base32upper:()=>R,base32z:()=>j});var b={};t.r(b),t.d(b,{base36:()=>H,base36upper:()=>$});var o={};t.r(o),t.d(o,{base58btc:()=>q,base58flickr:()=>z});var s={};t.r(s),t.d(s,{base64:()=>G,base64pad:()=>K,base64url:()=>V,base64urlpad:()=>Z});var l={};t.r(l),t.d(l,{base256emoji:()=>X});var u={};t.r(u),t.d(u,{sha256:()=>ve,sha512:()=>we});var h={};t.r(h),t.d(h,{identity:()=>Ie});var p={};t.r(p),t.d(p,{code:()=>Ce,decode:()=>Be,encode:()=>Me,name:()=>Ee});var g={};t.r(g),t.d(g,{code:()=>Te,decode:()=>Re,encode:()=>Ne,name:()=>Se});const m=function(e,a){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),c=0;c>>0,r=new Uint8Array(d);e[a];){var o=t[e.charCodeAt(a)];if(255===o)return;for(var s=0,l=d-1;(0!==o||s>>0,r[l]=o%256>>>0,o=o/256>>>0;if(0!==o)throw new Error("Non-zero carry");f=s,a++}if(" "!==e[a]){for(var u=d-f;u!==d&&0===r[u];)u++;for(var h=new Uint8Array(c+(d-u)),p=c;u!==d;)h[p++]=r[u++];return h}}}return{encode:function(a){if(a instanceof Uint8Array||(ArrayBuffer.isView(a)?a=new Uint8Array(a.buffer,a.byteOffset,a.byteLength):Array.isArray(a)&&(a=Uint8Array.from(a))),!(a instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===a.length)return"";for(var t=0,c=0,f=0,d=a.length;f!==d&&0===a[f];)f++,t++;for(var r=(d-f)*o+1>>>0,b=new Uint8Array(r);f!==d;){for(var s=a[f],l=0,u=r-1;(0!==s||l>>0,b[u]=s%n>>>0,s=s/n>>>0;if(0!==s)throw new Error("Non-zero carry");c=l,f++}for(var h=r-c;h!==r&&0===b[h];)h++;for(var p=i.repeat(t);h{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")});class x{constructor(e,a,t){this.name=e,this.prefix=a,this.baseEncode=t}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class A{constructor(e,a,t){if(this.name=e,this.prefix=a,void 0===a.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=a.codePointAt(0),this.baseDecode=t}decode(e){if("string"==typeof e){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))}throw Error("Can only multibase decode strings")}or(e){return w(this,e)}}class v{constructor(e){this.decoders=e}or(e){return w(this,e)}decode(e){const a=e[0],t=this.decoders[a];if(t)return t.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const w=(e,a)=>new v({...e.decoders||{[e.prefix]:e},...a.decoders||{[a.prefix]:a}});class _{constructor(e,a,t,c){this.name=e,this.prefix=a,this.baseEncode=t,this.baseDecode=c,this.encoder=new x(e,a,t),this.decoder=new A(e,a,c)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const I=({name:e,prefix:a,encode:t,decode:c})=>new _(e,a,t,c),E=({prefix:e,name:a,alphabet:t})=>{const{encode:c,decode:f}=m(t,a);return I({prefix:e,name:a,encode:c,decode:e=>y(f(e))})},C=({name:e,prefix:a,bitsPerChar:t,alphabet:c})=>I({prefix:a,name:e,encode:e=>((e,a,t)=>{const c="="===a[a.length-1],f=(1<t;)r-=t,d+=a[f&n>>r];if(r&&(d+=a[f&n<((e,a,t,c)=>{const f={};for(let e=0;e=8&&(n-=8,r[b++]=255&i>>n)}if(n>=t||255&i<<8-n)throw new SyntaxError("Unexpected end of data");return r})(a,c,t,e)}),M=I({prefix:"\0",name:"identity",encode:e=>{return a=e,(new TextDecoder).decode(a);var a},decode:e=>(e=>(new TextEncoder).encode(e))(e)}),B=C({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),k=C({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),L=E({prefix:"9",name:"base10",alphabet:"0123456789"}),S=C({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),T=C({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),N=C({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),R=C({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),P=C({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),D=C({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),O=C({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),F=C({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Q=C({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),U=C({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),j=C({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),H=E({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),$=E({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),q=E({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),z=E({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),G=C({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),K=C({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),V=C({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Z=C({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),J=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),W=J.reduce(((e,a,t)=>(e[t]=a,e)),[]),Y=J.reduce(((e,a,t)=>(e[a.codePointAt(0)]=t,e)),[]),X=I({prefix:"🚀",name:"base256emoji",encode:function(e){return e.reduce(((e,a)=>e+W[a]),"")},decode:function(e){const a=[];for(const t of e){const e=Y[t.codePointAt(0)];if(void 0===e)throw new Error(`Non-base256emoji character: ${t}`);a.push(e)}return new Uint8Array(a)}});var ee=128,ae=-128,te=Math.pow(2,31),ce=Math.pow(2,7),fe=Math.pow(2,14),de=Math.pow(2,21),re=Math.pow(2,28),ne=Math.pow(2,35),ie=Math.pow(2,42),be=Math.pow(2,49),oe=Math.pow(2,56),se=Math.pow(2,63);const le=function e(a,t,c){t=t||[];for(var f=c=c||0;a>=te;)t[c++]=255&a|ee,a/=128;for(;a&ae;)t[c++]=255&a|ee,a>>>=7;return t[c]=0|a,e.bytes=c-f+1,t},ue=function(e){return e(le(e,a,t),a),pe=e=>ue(e),ge=(e,a)=>{const t=a.byteLength,c=pe(e),f=c+pe(t),d=new Uint8Array(f+t);return he(e,d,0),he(t,d,c),d.set(a,f),new me(e,t,a,d)};class me{constructor(e,a,t,c){this.code=e,this.size=a,this.digest=t,this.bytes=c}}const ye=({name:e,code:a,encode:t})=>new xe(e,a,t);class xe{constructor(e,a,t){this.name=e,this.code=a,this.encode=t}digest(e){if(e instanceof Uint8Array){const a=this.encode(e);return a instanceof Uint8Array?ge(this.code,a):a.then((e=>ge(this.code,e)))}throw Error("Unknown type, must be binary type")}}const Ae=e=>async a=>new Uint8Array(await crypto.subtle.digest(e,a)),ve=ye({name:"sha2-256",code:18,encode:Ae("SHA-256")}),we=ye({name:"sha2-512",code:19,encode:Ae("SHA-512")}),_e=y,Ie={code:0,name:"identity",encode:_e,digest:e=>ge(0,_e(e))},Ee="raw",Ce=85,Me=e=>y(e),Be=e=>y(e),ke=new TextEncoder,Le=new TextDecoder,Se="json",Te=512,Ne=e=>ke.encode(JSON.stringify(e)),Re=e=>JSON.parse(Le.decode(e));Symbol.toStringTag,Symbol.for("nodejs.util.inspect.custom"),Symbol.for("@ipld/js-cid/CID");const Pe={...c,...f,...d,...r,...n,...i,...b,...o,...s,...l};var De=t(45238);function Oe(e,a,t,c){return{name:e,prefix:a,encoder:{name:e,prefix:a,encode:t},decoder:{decode:c}}}const Fe=Oe("utf8","u",(e=>"u"+new TextDecoder("utf8").decode(e)),(e=>(new TextEncoder).encode(e.substring(1)))),Qe=Oe("ascii","a",(e=>{let a="a";for(let t=0;t{e=e.substring(1);const a=(0,De.K)(e.length);for(let t=0;t{"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},72079:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},3219:e=>{"use strict";e.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},62951:e=>{"use strict";e.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')},64589:e=>{"use strict";e.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},23241:e=>{"use strict";e.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},1636:e=>{"use strict";e.exports={rE:"6.5.7"}},15579:e=>{"use strict";e.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')}},__webpack_module_cache__={};function __webpack_require__(e){var a=__webpack_module_cache__[e];if(void 0!==a)return a.exports;var t=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(t.exports,t,t.exports,__webpack_require__),t.loaded=!0,t.exports}__webpack_require__.amdO={},__webpack_require__.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(a,{a}),a},__webpack_require__.d=(e,a)=>{for(var t in a)__webpack_require__.o(a,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{BatchBlockService:()=>f.B3,BatchEventsService:()=>f.JY,BatchTransactionService:()=>f.AF,Deposit:()=>d.dA,ENSNameWrapper__factory:()=>c.rZ,ENSRegistry__factory:()=>c.S4,ENSResolver__factory:()=>c.BB,ENSUtils:()=>n.gH,ENS__factory:()=>c.p2,ERC20__factory:()=>c.Xc,EnsContracts:()=>n.A6,INDEX_DB_ERROR:()=>s.Fl,IndexedDB:()=>s.mc,Invoice:()=>d.qO,MAX_FEE:()=>v.KN,MAX_TOVARISH_EVENTS:()=>_.o,MIN_FEE:()=>v.Ss,MIN_STAKE_BALANCE:()=>v.pO,MerkleTreeService:()=>u.s,Mimc:()=>h.p,Multicall__factory:()=>c.Q2,NetId:()=>g.zr,NoteAccount:()=>r.Ad,OffchainOracle__factory:()=>c.Hk,OvmGasPriceOracle__factory:()=>c.Ld,Pedersen:()=>m.Hr,RelayerClient:()=>v.OR,ReverseRecords__factory:()=>c.Rp,TokenPriceOracle:()=>x.T,TornadoBrowserProvider:()=>A.D2,TornadoFeeOracle:()=>i.o,TornadoRpcSigner:()=>A.Vr,TornadoVoidSigner:()=>A.Gd,TornadoWallet:()=>A.nA,TovarishClient:()=>_.E,addNetwork:()=>g.AE,addressSchemaType:()=>t.SC,ajv:()=>t.SS,base64ToBytes:()=>I.Kp,bigIntReplacer:()=>I.gn,bnSchemaType:()=>t.iL,bnToBytes:()=>I.jm,buffPedersenHash:()=>m.UB,bufferToBytes:()=>I.lY,bytes32BNSchemaType:()=>t.i1,bytes32SchemaType:()=>t.yF,bytesToBN:()=>I.Ju,bytesToBase64:()=>I.if,bytesToHex:()=>I.My,calculateScore:()=>v.zy,calculateSnarkProof:()=>E.i,chunk:()=>I.iv,concatBytes:()=>I.Id,convertETHToTokenAmount:()=>i.N,createDeposit:()=>d.Hr,crypto:()=>I.Et,customConfig:()=>g.cX,defaultConfig:()=>g.sb,defaultUserAgent:()=>A.mJ,deployHasher:()=>o.l,depositsEventsSchema:()=>t.CI,digest:()=>I.br,downloadZip:()=>C._6,echoEventsSchema:()=>t.ME,enabledChains:()=>g.Af,encodedLabelToLabelhash:()=>n.qX,encryptedNotesSchema:()=>t.XW,factories:()=>c.XB,fetchData:()=>A.Fd,fetchGetUrlFunc:()=>A.uY,fetchIp:()=>l.W,fromContentHash:()=>I.yp,gasZipID:()=>b.Qx,gasZipInbounds:()=>b.dT,gasZipInput:()=>b.x5,gasZipMinMax:()=>b.X,getActiveTokenInstances:()=>g.oY,getActiveTokens:()=>g.h9,getConfig:()=>g.zj,getEventsSchemaValidator:()=>t.ZC,getHttpAgent:()=>A.WU,getIndexedDB:()=>s.W7,getInstanceByAddress:()=>g.Zh,getMultiInstances:()=>g.sX,getNetworkConfig:()=>g.RY,getPermit2CommitmentsSignature:()=>y.Sl,getPermit2Signature:()=>y.KM,getPermitCommitmentsSignature:()=>y.sx,getPermitSignature:()=>y.id,getProvider:()=>A.sO,getProviderWithNetId:()=>A.MF,getRelayerEnsSubdomains:()=>g.o2,getStatusSchema:()=>t.c_,getSubInfo:()=>f.vS,getSupportedInstances:()=>v.XF,getTokenBalances:()=>w.H,getWeightRandom:()=>v.c$,governanceEventsSchema:()=>t.FR,hasherBytecode:()=>o.B,hexToBytes:()=>I.aT,initGroth16:()=>E.O,isHex:()=>I.qv,isNode:()=>I.Ll,jobRequestSchema:()=>t.Yq,jobsSchema:()=>t.Us,labelhash:()=>n.Lr,leBuff2Int:()=>I.ae,leInt2Buff:()=>I.EI,makeLabelNodeAndParent:()=>n.QP,mimc:()=>h.f,multiQueryFilter:()=>f.QL,multicall:()=>p.C,numberFormatter:()=>I.Eg,packEncryptedMessage:()=>r.Fr,parseInvoice:()=>d.Ps,parseNote:()=>d.wd,pedersen:()=>m.NO,permit2Address:()=>y.CS,pickWeightedRandomRelayer:()=>v.sN,populateTransaction:()=>A.zr,proofSchemaType:()=>t.Y6,rBigInt:()=>I.ib,rHex:()=>I.G9,relayerRegistryEventsSchema:()=>t.cl,sleep:()=>I.yy,stakeBurnedEventsSchema:()=>t.Fz,substring:()=>I.uU,toContentHash:()=>I.vd,toFixedHex:()=>I.$W,toFixedLength:()=>I.sY,tornadoEventsSchema:()=>t.U7,unpackEncryptedMessage:()=>r.ol,unzipAsync:()=>C.fY,validateUrl:()=>I.wv,withdrawalsEventsSchema:()=>t.$j,zipAsync:()=>C.a8});var e=__webpack_require__(94513),a={};for(const t in e)"default"!==t&&(a[t]=()=>e[t]);__webpack_require__.d(__webpack_exports__,a);var t=__webpack_require__(59511),c=__webpack_require__(62463),f=__webpack_require__(9723),d=__webpack_require__(7240),r=__webpack_require__(33298),n=__webpack_require__(16795),i=__webpack_require__(37182),b=__webpack_require__(56079),o=__webpack_require__(49540),s=__webpack_require__(83968),l=__webpack_require__(57390),u=__webpack_require__(5217),h=__webpack_require__(22901),p=__webpack_require__(48486),g=__webpack_require__(59499),m=__webpack_require__(85111),y=__webpack_require__(1180),x=__webpack_require__(34525),A=__webpack_require__(68909),v=__webpack_require__(57194),w=__webpack_require__(7393),_=__webpack_require__(96838),I=__webpack_require__(67418),E=__webpack_require__(26746),C=__webpack_require__(18995)})(),__webpack_exports__})())); \ No newline at end of file + deps: ${t}}`};const r={keyword:"dependencies",type:"object",schemaType:"object",error:a.error,code(e){const[a,t]=function({schema:e}){const a={},t={};for(const c in e)"__proto__"!==c&&((Array.isArray(e[c])?a:t)[c]=e[c]);return[a,t]}(e);n(e,a),i(e,t)}};function n(e,a=e.schema){const{gen:t,data:f,it:r}=e;if(0===Object.keys(a).length)return;const n=t.let("missing");for(const i in a){const b=a[i];if(0===b.length)continue;const o=(0,d.propertyInData)(t,f,i,r.opts.ownProperties);e.setParams({property:i,depsCount:b.length,deps:b.join(", ")}),r.allErrors?t.if(o,(()=>{for(const a of b)(0,d.checkReportMissingProp)(e,a)})):(t.if(c._`${o} && (${(0,d.checkMissingProp)(e,b,n)})`),(0,d.reportMissingProp)(e,n),t.else())}}function i(e,a=e.schema){const{gen:t,data:c,keyword:r,it:n}=e,i=t.name("valid");for(const b in a)(0,f.alwaysValidSchema)(n,a[b])||(t.if((0,d.propertyInData)(t,c,b,n.opts.ownProperties),(()=>{const a=e.subschema({keyword:r,schemaProp:b},i);e.mergeValidEvaluated(a,i)}),(()=>t.var(i,!0))),e.ok(i))}a.validatePropertyDeps=n,a.validateSchemaDeps=i,a.default=r},1239:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>c.str`must match "${e.ifClause}" schema`,params:({params:e})=>c._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:a,parentSchema:t,it:d}=e;void 0===t.then&&void 0===t.else&&(0,f.checkStrictMode)(d,'"if" without "then" and "else" is ignored');const n=r(d,"then"),i=r(d,"else");if(!n&&!i)return;const b=a.let("valid",!0),o=a.name("_valid");if(function(){const a=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},o);e.mergeEvaluated(a)}(),e.reset(),n&&i){const t=a.let("ifClause");e.setParams({ifClause:t}),a.if(o,s("then",t),s("else",t))}else n?a.if(o,s("then")):a.if((0,c.not)(o),s("else"));function s(t,f){return()=>{const d=e.subschema({keyword:t},o);a.assign(b,o),e.mergeValidEvaluated(d,b),f?a.assign(f,c._`${t}`):e.setParams({ifClause:t})}}e.pass(b,(()=>e.error(!0)))}};function r(e,a){const t=e.schema[a];return void 0!==t&&!(0,f.alwaysValidSchema)(e,t)}a.default=d},56378:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(15457),f=t(65354),d=t(20494),r=t(93966),n=t(12661),i=t(83025),b=t(19713),o=t(38660),s=t(40117),l=t(45333),u=t(57923),h=t(16505),p=t(96163),g=t(15844),m=t(1239),x=t(14426);a.default=function(e=!1){const a=[u.default,h.default,p.default,g.default,m.default,x.default,b.default,o.default,i.default,s.default,l.default];return e?a.push(f.default,r.default):a.push(c.default,d.default),a.push(n.default),a}},20494:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.validateTuple=void 0;const c=t(99029),f=t(94227),d=t(15765),r={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:a,it:t}=e;if(Array.isArray(a))return n(e,"additionalItems",a);t.items=!0,(0,f.alwaysValidSchema)(t,a)||e.ok((0,d.validateArray)(e))}};function n(e,a,t=e.schema){const{gen:d,parentSchema:r,data:n,keyword:i,it:b}=e;!function(e){const{opts:c,errSchemaPath:d}=b,r=t.length,n=r===e.minItems&&(r===e.maxItems||!1===e[a]);if(c.strictTuples&&!n){const e=`"${i}" is ${r}-tuple, but minItems or maxItems/${a} are not specified or different at path "${d}"`;(0,f.checkStrictMode)(b,e,c.strictTuples)}}(r),b.opts.unevaluated&&t.length&&!0!==b.items&&(b.items=f.mergeEvaluated.items(d,t.length,b.items));const o=d.name("valid"),s=d.const("len",c._`${n}.length`);t.forEach(((a,t)=>{(0,f.alwaysValidSchema)(b,a)||(d.if(c._`${s} > ${t}`,(()=>e.subschema({keyword:i,schemaProp:t,dataProp:t},o))),e.ok(o))}))}a.validateTuple=n,a.default=r},93966:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d=t(15765),r=t(15457),n={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>c.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>c._`{limit: ${e}}`},code(e){const{schema:a,parentSchema:t,it:c}=e,{prefixItems:n}=t;c.items=!0,(0,f.alwaysValidSchema)(c,a)||(n?(0,r.validateAdditionalItems)(e,n):e.ok((0,d.validateArray)(e)))}};a.default=n},57923:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(94227),f={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:a,schema:t,it:f}=e;if((0,c.alwaysValidSchema)(f,t))return void e.fail();const d=a.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},d),e.failResult(d,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};a.default=f},96163:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>c._`{passingSchemas: ${e.passing}}`},code(e){const{gen:a,schema:t,parentSchema:d,it:r}=e;if(!Array.isArray(t))throw new Error("ajv implementation error");if(r.opts.discriminator&&d.discriminator)return;const n=t,i=a.let("valid",!1),b=a.let("passing",null),o=a.name("_valid");e.setParams({passing:b}),a.block((function(){n.forEach(((t,d)=>{let n;(0,f.alwaysValidSchema)(r,t)?a.var(o,!0):n=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},o),d>0&&a.if(c._`${o} && ${i}`).assign(i,!1).assign(b,c._`[${b}, ${d}]`).else(),a.if(o,(()=>{a.assign(i,!0),a.assign(b,d),n&&e.mergeEvaluated(n,c.Name)}))}))})),e.result(i,(()=>e.reset()),(()=>e.error(!0)))}};a.default=d},45333:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(15765),f=t(99029),d=t(94227),r=t(94227),n={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:a,schema:t,data:n,parentSchema:i,it:b}=e,{opts:o}=b,s=(0,c.allSchemaProperties)(t),l=s.filter((e=>(0,d.alwaysValidSchema)(b,t[e])));if(0===s.length||l.length===s.length&&(!b.opts.unevaluated||!0===b.props))return;const u=o.strictSchema&&!o.allowMatchingProperties&&i.properties,h=a.name("valid");!0===b.props||b.props instanceof f.Name||(b.props=(0,r.evaluatedPropsToName)(a,b.props));const{props:p}=b;function g(e){for(const a in u)new RegExp(e).test(a)&&(0,d.checkStrictMode)(b,`property ${a} matches pattern ${e} (use allowMatchingProperties)`)}function m(t){a.forIn("key",n,(d=>{a.if(f._`${(0,c.usePattern)(e,t)}.test(${d})`,(()=>{const c=l.includes(t);c||e.subschema({keyword:"patternProperties",schemaProp:t,dataProp:d,dataPropType:r.Type.Str},h),b.opts.unevaluated&&!0!==p?a.assign(f._`${p}[${d}]`,!0):c||b.allErrors||a.if((0,f.not)(h),(()=>a.break()))}))}))}!function(){for(const e of s)u&&g(e),b.allErrors?m(e):(a.var(h,!0),m(e),a.if(h))}()}};a.default=n},65354:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(20494),f={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,c.validateTuple)(e,"items")};a.default=f},40117:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(62586),f=t(15765),d=t(94227),r=t(38660),n={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:a,schema:t,parentSchema:n,data:i,it:b}=e;"all"===b.opts.removeAdditional&&void 0===n.additionalProperties&&r.default.code(new c.KeywordCxt(b,r.default,"additionalProperties"));const o=(0,f.allSchemaProperties)(t);for(const e of o)b.definedProperties.add(e);b.opts.unevaluated&&o.length&&!0!==b.props&&(b.props=d.mergeEvaluated.props(a,(0,d.toHash)(o),b.props));const s=o.filter((e=>!(0,d.alwaysValidSchema)(b,t[e])));if(0===s.length)return;const l=a.name("valid");for(const t of s)u(t)?h(t):(a.if((0,f.propertyInData)(a,i,t,b.opts.ownProperties)),h(t),b.allErrors||a.else().var(l,!0),a.endIf()),e.it.definedProperties.add(t),e.ok(l);function u(e){return b.opts.useDefaults&&!b.compositeRule&&void 0!==t[e].default}function h(a){e.subschema({keyword:"properties",schemaProp:a,dataProp:a},l)}}};a.default=n},19713:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>c._`{propertyName: ${e.propertyName}}`},code(e){const{gen:a,schema:t,data:d,it:r}=e;if((0,f.alwaysValidSchema)(r,t))return;const n=a.name("valid");a.forIn("key",d,(t=>{e.setParams({propertyName:t}),e.subschema({keyword:"propertyNames",data:t,dataTypes:["string"],propertyName:t,compositeRule:!0},n),a.if((0,c.not)(n),(()=>{e.error(!0),r.allErrors||a.break()}))})),e.ok(n)}};a.default=d},14426:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(94227),f={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:a,it:t}){void 0===a.if&&(0,c.checkStrictMode)(t,`"${e}" without "if" is ignored`)}};a.default=f},15765:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.validateUnion=a.validateArray=a.usePattern=a.callValidateCode=a.schemaProperties=a.allSchemaProperties=a.noPropertyInData=a.propertyInData=a.isOwnProperty=a.hasPropFunc=a.reportMissingProp=a.checkMissingProp=a.checkReportMissingProp=void 0;const c=t(99029),f=t(94227),d=t(42023),r=t(94227);function n(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:c._`Object.prototype.hasOwnProperty`})}function i(e,a,t){return c._`${n(e)}.call(${a}, ${t})`}function b(e,a,t,f){const d=c._`${a}${(0,c.getProperty)(t)} === undefined`;return f?(0,c.or)(d,(0,c.not)(i(e,a,t))):d}function o(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}a.checkReportMissingProp=function(e,a){const{gen:t,data:f,it:d}=e;t.if(b(t,f,a,d.opts.ownProperties),(()=>{e.setParams({missingProperty:c._`${a}`},!0),e.error()}))},a.checkMissingProp=function({gen:e,data:a,it:{opts:t}},f,d){return(0,c.or)(...f.map((f=>(0,c.and)(b(e,a,f,t.ownProperties),c._`${d} = ${f}`))))},a.reportMissingProp=function(e,a){e.setParams({missingProperty:a},!0),e.error()},a.hasPropFunc=n,a.isOwnProperty=i,a.propertyInData=function(e,a,t,f){const d=c._`${a}${(0,c.getProperty)(t)} !== undefined`;return f?c._`${d} && ${i(e,a,t)}`:d},a.noPropertyInData=b,a.allSchemaProperties=o,a.schemaProperties=function(e,a){return o(a).filter((t=>!(0,f.alwaysValidSchema)(e,a[t])))},a.callValidateCode=function({schemaCode:e,data:a,it:{gen:t,topSchemaRef:f,schemaPath:r,errorPath:n},it:i},b,o,s){const l=s?c._`${e}, ${a}, ${f}${r}`:a,u=[[d.default.instancePath,(0,c.strConcat)(d.default.instancePath,n)],[d.default.parentData,i.parentData],[d.default.parentDataProperty,i.parentDataProperty],[d.default.rootData,d.default.rootData]];i.opts.dynamicRef&&u.push([d.default.dynamicAnchors,d.default.dynamicAnchors]);const h=c._`${l}, ${t.object(...u)}`;return o!==c.nil?c._`${b}.call(${o}, ${h})`:c._`${b}(${h})`};const s=c._`new RegExp`;a.usePattern=function({gen:e,it:{opts:a}},t){const f=a.unicodeRegExp?"u":"",{regExp:d}=a.code,n=d(t,f);return e.scopeValue("pattern",{key:n.toString(),ref:n,code:c._`${"new RegExp"===d.code?s:(0,r.useFunc)(e,d)}(${t}, ${f})`})},a.validateArray=function(e){const{gen:a,data:t,keyword:d,it:r}=e,n=a.name("valid");if(r.allErrors){const e=a.let("valid",!0);return i((()=>a.assign(e,!1))),e}return a.var(n,!0),i((()=>a.break())),n;function i(r){const i=a.const("len",c._`${t}.length`);a.forRange("i",0,i,(t=>{e.subschema({keyword:d,dataProp:t,dataPropType:f.Type.Num},n),a.if((0,c.not)(n),r)}))}},a.validateUnion=function(e){const{gen:a,schema:t,keyword:d,it:r}=e;if(!Array.isArray(t))throw new Error("ajv implementation error");if(t.some((e=>(0,f.alwaysValidSchema)(r,e)))&&!r.opts.unevaluated)return;const n=a.let("valid",!1),i=a.name("_valid");a.block((()=>t.forEach(((t,f)=>{const r=e.subschema({keyword:d,schemaProp:f,compositeRule:!0},i);a.assign(n,c._`${n} || ${i}`),e.mergeValidEvaluated(r,i)||a.if((0,c.not)(n))})))),e.result(n,(()=>e.reset()),(()=>e.error(!0)))}},83463:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const t={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};a.default=t},72128:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(83463),f=t(13693),d=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",c.default,f.default];a.default=d},13693:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.callRef=a.getValidate=void 0;const c=t(34551),f=t(15765),d=t(99029),r=t(42023),n=t(73835),i=t(94227),b={keyword:"$ref",schemaType:"string",code(e){const{gen:a,schema:t,it:f}=e,{baseId:r,schemaEnv:i,validateName:b,opts:l,self:u}=f,{root:h}=i;if(("#"===t||"#/"===t)&&r===h.baseId)return function(){if(i===h)return s(e,b,i,i.$async);const t=a.scopeValue("root",{ref:h});return s(e,d._`${t}.validate`,h,h.$async)}();const p=n.resolveRef.call(u,h,r,t);if(void 0===p)throw new c.default(f.opts.uriResolver,r,t);return p instanceof n.SchemaEnv?function(a){const t=o(e,a);s(e,t,a,a.$async)}(p):function(c){const f=a.scopeValue("schema",!0===l.code.source?{ref:c,code:(0,d.stringify)(c)}:{ref:c}),r=a.name("valid"),n=e.subschema({schema:c,dataTypes:[],schemaPath:d.nil,topSchemaRef:f,errSchemaPath:t},r);e.mergeEvaluated(n),e.ok(r)}(p)}};function o(e,a){const{gen:t}=e;return a.validate?t.scopeValue("validate",{ref:a.validate}):d._`${t.scopeValue("wrapper",{ref:a})}.validate`}function s(e,a,t,c){const{gen:n,it:b}=e,{allErrors:o,schemaEnv:s,opts:l}=b,u=l.passContext?r.default.this:d.nil;function h(e){const a=d._`${e}.errors`;n.assign(r.default.vErrors,d._`${r.default.vErrors} === null ? ${a} : ${r.default.vErrors}.concat(${a})`),n.assign(r.default.errors,d._`${r.default.vErrors}.length`)}function p(e){var a;if(!b.opts.unevaluated)return;const c=null===(a=null==t?void 0:t.validate)||void 0===a?void 0:a.evaluated;if(!0!==b.props)if(c&&!c.dynamicProps)void 0!==c.props&&(b.props=i.mergeEvaluated.props(n,c.props,b.props));else{const a=n.var("props",d._`${e}.evaluated.props`);b.props=i.mergeEvaluated.props(n,a,b.props,d.Name)}if(!0!==b.items)if(c&&!c.dynamicItems)void 0!==c.items&&(b.items=i.mergeEvaluated.items(n,c.items,b.items));else{const a=n.var("items",d._`${e}.evaluated.items`);b.items=i.mergeEvaluated.items(n,a,b.items,d.Name)}}c?function(){if(!s.$async)throw new Error("async schema referenced by sync schema");const t=n.let("valid");n.try((()=>{n.code(d._`await ${(0,f.callValidateCode)(e,a,u)}`),p(a),o||n.assign(t,!0)}),(e=>{n.if(d._`!(${e} instanceof ${b.ValidationError})`,(()=>n.throw(e))),h(e),o||n.assign(t,!1)})),e.ok(t)}():e.result((0,f.callValidateCode)(e,a,u),(()=>p(a)),(()=>h(a)))}a.getValidate=o,a.callRef=s,a.default=b},36653:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(97652),d=t(73835),r=t(34551),n=t(94227),i={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:a}})=>e===f.DiscrError.Tag?`tag "${a}" must be string`:`value of tag "${a}" must be in oneOf`,params:({params:{discrError:e,tag:a,tagName:t}})=>c._`{error: ${e}, tag: ${t}, tagValue: ${a}}`},code(e){const{gen:a,data:t,schema:i,parentSchema:b,it:o}=e,{oneOf:s}=b;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");const l=i.propertyName;if("string"!=typeof l)throw new Error("discriminator: requires propertyName");if(i.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");const u=a.let("valid",!1),h=a.const("tag",c._`${t}${(0,c.getProperty)(l)}`);function p(t){const f=a.name("valid"),d=e.subschema({keyword:"oneOf",schemaProp:t},f);return e.mergeEvaluated(d,c.Name),f}a.if(c._`typeof ${h} == "string"`,(()=>function(){const t=function(){var e;const a={},t=f(b);let c=!0;for(let a=0;ae.error(!1,{discrError:f.DiscrError.Tag,tag:h,tagName:l}))),e.ok(u)}};a.default=i},97652:(e,a)=>{"use strict";var t;Object.defineProperty(a,"__esModule",{value:!0}),a.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(t||(a.DiscrError=t={}))},86144:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(72128),f=t(67060),d=t(56378),r=t(97532),n=t(69857),i=[c.default,f.default,(0,d.default)(),r.default,n.metadataVocabulary,n.contentVocabulary];a.default=i},94737:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>c.str`must match format "${e}"`,params:({schemaCode:e})=>c._`{format: ${e}}`},code(e,a){const{gen:t,data:f,$data:d,schema:r,schemaCode:n,it:i}=e,{opts:b,errSchemaPath:o,schemaEnv:s,self:l}=i;b.validateFormats&&(d?function(){const d=t.scopeValue("formats",{ref:l.formats,code:b.code.formats}),r=t.const("fDef",c._`${d}[${n}]`),i=t.let("fType"),o=t.let("format");t.if(c._`typeof ${r} == "object" && !(${r} instanceof RegExp)`,(()=>t.assign(i,c._`${r}.type || "string"`).assign(o,c._`${r}.validate`)),(()=>t.assign(i,c._`"string"`).assign(o,r))),e.fail$data((0,c.or)(!1===b.strictSchema?c.nil:c._`${n} && !${o}`,function(){const e=s.$async?c._`(${r}.async ? await ${o}(${f}) : ${o}(${f}))`:c._`${o}(${f})`,t=c._`(typeof ${o} == "function" ? ${e} : ${o}.test(${f}))`;return c._`${o} && ${o} !== true && ${i} === ${a} && !${t}`}()))}():function(){const d=l.formats[r];if(!d)return void function(){if(!1!==b.strictSchema)throw new Error(e());function e(){return`unknown format "${r}" ignored in schema at path "${o}"`}l.logger.warn(e())}();if(!0===d)return;const[n,i,u]=function(e){const a=e instanceof RegExp?(0,c.regexpCode)(e):b.code.formats?c._`${b.code.formats}${(0,c.getProperty)(r)}`:void 0,f=t.scopeValue("formats",{key:r,ref:e,code:a});return"object"!=typeof e||e instanceof RegExp?["string",e,f]:[e.type||"string",e.validate,c._`${f}.validate`]}(d);n===a&&e.pass(function(){if("object"==typeof d&&!(d instanceof RegExp)&&d.async){if(!s.$async)throw new Error("async format in sync schema");return c._`await ${u}(${f})`}return"function"==typeof i?c._`${u}(${f})`:c._`${u}.test(${f})`}())}())}};a.default=f},97532:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=[t(94737).default];a.default=c},69857:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.contentVocabulary=a.metadataVocabulary=void 0,a.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],a.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},27935:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d=t(76250),r={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>c._`{allowedValue: ${e}}`},code(e){const{gen:a,data:t,$data:r,schemaCode:n,schema:i}=e;r||i&&"object"==typeof i?e.fail$data(c._`!${(0,f.useFunc)(a,d.default)}(${t}, ${n})`):e.fail(c._`${i} !== ${t}`)}};a.default=r},28643:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d=t(76250),r={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>c._`{allowedValues: ${e}}`},code(e){const{gen:a,data:t,$data:r,schema:n,schemaCode:i,it:b}=e;if(!r&&0===n.length)throw new Error("enum must have non-empty array");const o=n.length>=b.opts.loopEnum;let s;const l=()=>null!=s?s:s=(0,f.useFunc)(a,d.default);let u;if(o||r)u=a.let("valid"),e.block$data(u,(function(){a.assign(u,!1),a.forOf("v",i,(e=>a.if(c._`${l()}(${t}, ${e})`,(()=>a.assign(u,!0).break()))))}));else{if(!Array.isArray(n))throw new Error("ajv implementation error");const e=a.const("vSchema",i);u=(0,c.or)(...n.map(((a,f)=>function(e,a){const f=n[a];return"object"==typeof f&&null!==f?c._`${l()}(${t}, ${e}[${a}])`:c._`${t} === ${f}`}(e,f))))}e.pass(u)}};a.default=r},67060:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(75882),f=t(63439),d=t(77307),r=t(90422),n=t(34486),i=t(34003),b=t(61163),o=t(60617),s=t(27935),l=t(28643),u=[c.default,f.default,d.default,r.default,n.default,i.default,b.default,o.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},s.default,l.default];a.default=u},61163:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:a}){const t="maxItems"===e?"more":"fewer";return c.str`must NOT have ${t} than ${a} items`},params:({schemaCode:e})=>c._`{limit: ${e}}`},code(e){const{keyword:a,data:t,schemaCode:f}=e,d="maxItems"===a?c.operators.GT:c.operators.LT;e.fail$data(c._`${t}.length ${d} ${f}`)}};a.default=f},77307:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d=t(53853),r={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:a}){const t="maxLength"===e?"more":"fewer";return c.str`must NOT have ${t} than ${a} characters`},params:({schemaCode:e})=>c._`{limit: ${e}}`},code(e){const{keyword:a,data:t,schemaCode:r,it:n}=e,i="maxLength"===a?c.operators.GT:c.operators.LT,b=!1===n.opts.unicode?c._`${t}.length`:c._`${(0,f.useFunc)(e.gen,d.default)}(${t})`;e.fail$data(c._`${b} ${i} ${r}`)}};a.default=r},75882:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=c.operators,d={maximum:{okStr:"<=",ok:f.LTE,fail:f.GT},minimum:{okStr:">=",ok:f.GTE,fail:f.LT},exclusiveMaximum:{okStr:"<",ok:f.LT,fail:f.GTE},exclusiveMinimum:{okStr:">",ok:f.GT,fail:f.LTE}},r={message:({keyword:e,schemaCode:a})=>c.str`must be ${d[e].okStr} ${a}`,params:({keyword:e,schemaCode:a})=>c._`{comparison: ${d[e].okStr}, limit: ${a}}`},n={keyword:Object.keys(d),type:"number",schemaType:"number",$data:!0,error:r,code(e){const{keyword:a,data:t,schemaCode:f}=e;e.fail$data(c._`${t} ${d[a].fail} ${f} || isNaN(${t})`)}};a.default=n},34486:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:a}){const t="maxProperties"===e?"more":"fewer";return c.str`must NOT have ${t} than ${a} properties`},params:({schemaCode:e})=>c._`{limit: ${e}}`},code(e){const{keyword:a,data:t,schemaCode:f}=e,d="maxProperties"===a?c.operators.GT:c.operators.LT;e.fail$data(c._`Object.keys(${t}).length ${d} ${f}`)}};a.default=f},63439:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>c.str`must be multiple of ${e}`,params:({schemaCode:e})=>c._`{multipleOf: ${e}}`},code(e){const{gen:a,data:t,schemaCode:f,it:d}=e,r=d.opts.multipleOfPrecision,n=a.let("res"),i=r?c._`Math.abs(Math.round(${n}) - ${n}) > 1e-${r}`:c._`${n} !== parseInt(${n})`;e.fail$data(c._`(${f} === 0 || (${n} = ${t}/${f}, ${i}))`)}};a.default=f},90422:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(15765),f=t(99029),d={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>f.str`must match pattern "${e}"`,params:({schemaCode:e})=>f._`{pattern: ${e}}`},code(e){const{data:a,$data:t,schema:d,schemaCode:r,it:n}=e,i=n.opts.unicodeRegExp?"u":"",b=t?f._`(new RegExp(${r}, ${i}))`:(0,c.usePattern)(e,d);e.fail$data(f._`!${b}.test(${a})`)}};a.default=d},34003:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(15765),f=t(99029),d=t(94227),r={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>f.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>f._`{missingProperty: ${e}}`},code(e){const{gen:a,schema:t,schemaCode:r,data:n,$data:i,it:b}=e,{opts:o}=b;if(!i&&0===t.length)return;const s=t.length>=o.loopRequired;if(b.allErrors?function(){if(s||i)e.block$data(f.nil,l);else for(const a of t)(0,c.checkReportMissingProp)(e,a)}():function(){const d=a.let("missing");if(s||i){const t=a.let("valid",!0);e.block$data(t,(()=>function(t,d){e.setParams({missingProperty:t}),a.forOf(t,r,(()=>{a.assign(d,(0,c.propertyInData)(a,n,t,o.ownProperties)),a.if((0,f.not)(d),(()=>{e.error(),a.break()}))}),f.nil)}(d,t))),e.ok(t)}else a.if((0,c.checkMissingProp)(e,t,d)),(0,c.reportMissingProp)(e,d),a.else()}(),o.strictRequired){const a=e.parentSchema.properties,{definedProperties:c}=e.it;for(const e of t)if(void 0===(null==a?void 0:a[e])&&!c.has(e)){const a=`required property "${e}" is not defined at "${b.schemaEnv.baseId+b.errSchemaPath}" (strictRequired)`;(0,d.checkStrictMode)(b,a,b.opts.strictRequired)}}function l(){a.forOf("prop",r,(t=>{e.setParams({missingProperty:t}),a.if((0,c.noPropertyInData)(a,n,t,o.ownProperties),(()=>e.error()))}))}}};a.default=r},60617:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(10208),f=t(99029),d=t(94227),r=t(76250),n={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:a}})=>f.str`must NOT have duplicate items (items ## ${a} and ${e} are identical)`,params:({params:{i:e,j:a}})=>f._`{i: ${e}, j: ${a}}`},code(e){const{gen:a,data:t,$data:n,schema:i,parentSchema:b,schemaCode:o,it:s}=e;if(!n&&!i)return;const l=a.let("valid"),u=b.items?(0,c.getSchemaTypes)(b.items):[];function h(d,r){const n=a.name("item"),i=(0,c.checkDataTypes)(u,n,s.opts.strictNumbers,c.DataType.Wrong),b=a.const("indices",f._`{}`);a.for(f._`;${d}--;`,(()=>{a.let(n,f._`${t}[${d}]`),a.if(i,f._`continue`),u.length>1&&a.if(f._`typeof ${n} == "string"`,f._`${n} += "_"`),a.if(f._`typeof ${b}[${n}] == "number"`,(()=>{a.assign(r,f._`${b}[${n}]`),e.error(),a.assign(l,!1).break()})).code(f._`${b}[${n}] = ${d}`)}))}function p(c,n){const i=(0,d.useFunc)(a,r.default),b=a.name("outer");a.label(b).for(f._`;${c}--;`,(()=>a.for(f._`${n} = ${c}; ${n}--;`,(()=>a.if(f._`${i}(${t}[${c}], ${t}[${n}])`,(()=>{e.error(),a.assign(l,!1).break(b)}))))))}e.block$data(l,(function(){const c=a.let("i",f._`${t}.length`),d=a.let("j");e.setParams({i:c,j:d}),a.assign(l,!0),a.if(f._`${c} > 1`,(()=>(u.length>0&&!u.some((e=>"object"===e||"array"===e))?h:p)(c,d)))}),f._`${o} === false`),e.ok(l)}};a.default=n},87568:(e,a,t)=>{var c=a;c.bignum=t(72344),c.define=t(47363).define,c.base=t(9673),c.constants=t(22153),c.decoders=t(22853),c.encoders=t(24669)},47363:(e,a,t)=>{var c=t(87568),f=t(56698);function d(e,a){this.name=e,this.body=a,this.decoders={},this.encoders={}}a.define=function(e,a){return new d(e,a)},d.prototype._createNamed=function(e){var a;try{a=t(68961).runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(e){a=function(e){this._initNamed(e)}}return f(a,e),a.prototype._initNamed=function(a){e.call(this,a)},new a(this)},d.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(c.decoders[e])),this.decoders[e]},d.prototype.decode=function(e,a,t){return this._getDecoder(a).decode(e,t)},d.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(c.encoders[e])),this.encoders[e]},d.prototype.encode=function(e,a,t){return this._getEncoder(a).encode(e,t)}},47227:(e,a,t)=>{var c=t(56698),f=t(9673).Reporter,d=t(48287).Buffer;function r(e,a){f.call(this,a),d.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function n(e,a){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return e instanceof n||(e=new n(e,a)),this.length+=e.length,e}),this);else if("number"==typeof e){if(!(0<=e&&e<=255))return a.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=d.byteLength(e);else{if(!d.isBuffer(e))return a.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}c(r,f),a.t=r,r.prototype.save=function(){return{offset:this.offset,reporter:f.prototype.save.call(this)}},r.prototype.restore=function(e){var a=new r(this.base);return a.offset=e.offset,a.length=this.offset,this.offset=e.offset,f.prototype.restore.call(this,e.reporter),a},r.prototype.isEmpty=function(){return this.offset===this.length},r.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},r.prototype.skip=function(e,a){if(!(this.offset+e<=this.length))return this.error(a||"DecoderBuffer overrun");var t=new r(this.base);return t._reporterState=this._reporterState,t.offset=this.offset,t.length=this.offset+e,this.offset+=e,t},r.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},a.d=n,n.prototype.join=function(e,a){return e||(e=new d(this.length)),a||(a=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(t){t.join(e,a),a+=t.length})):("number"==typeof this.value?e[a]=this.value:"string"==typeof this.value?e.write(this.value,a):d.isBuffer(this.value)&&this.value.copy(e,a),a+=this.length)),e}},9673:(e,a,t)=>{var c=a;c.Reporter=t(89220).a,c.DecoderBuffer=t(47227).t,c.EncoderBuffer=t(47227).d,c.Node=t(90993)},90993:(e,a,t)=>{var c=t(9673).Reporter,f=t(9673).EncoderBuffer,d=t(9673).DecoderBuffer,r=t(43349),n=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],i=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(n);function b(e,a){var t={};this._baseState=t,t.enc=e,t.parent=a||null,t.children=null,t.tag=null,t.args=null,t.reverseArgs=null,t.choice=null,t.optional=!1,t.any=!1,t.obj=!1,t.use=null,t.useDecoder=null,t.key=null,t.default=null,t.explicit=null,t.implicit=null,t.contains=null,t.parent||(t.children=[],this._wrap())}e.exports=b;var o=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];b.prototype.clone=function(){var e=this._baseState,a={};o.forEach((function(t){a[t]=e[t]}));var t=new this.constructor(a.parent);return t._baseState=a,t},b.prototype._wrap=function(){var e=this._baseState;i.forEach((function(a){this[a]=function(){var t=new this.constructor(this);return e.children.push(t),t[a].apply(t,arguments)}}),this)},b.prototype._init=function(e){var a=this._baseState;r(null===a.parent),e.call(this),a.children=a.children.filter((function(e){return e._baseState.parent===this}),this),r.equal(a.children.length,1,"Root node can have only one child")},b.prototype._useArgs=function(e){var a=this._baseState,t=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==t.length&&(r(null===a.children),a.children=t,t.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(r(null===a.args),a.args=e,a.reverseArgs=e.map((function(e){if("object"!=typeof e||e.constructor!==Object)return e;var a={};return Object.keys(e).forEach((function(t){t==(0|t)&&(t|=0);var c=e[t];a[c]=t})),a})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){b.prototype[e]=function(){var a=this._baseState;throw new Error(e+" not implemented for encoding: "+a.enc)}})),n.forEach((function(e){b.prototype[e]=function(){var a=this._baseState,t=Array.prototype.slice.call(arguments);return r(null===a.tag),a.tag=e,this._useArgs(t),this}})),b.prototype.use=function(e){r(e);var a=this._baseState;return r(null===a.use),a.use=e,this},b.prototype.optional=function(){return this._baseState.optional=!0,this},b.prototype.def=function(e){var a=this._baseState;return r(null===a.default),a.default=e,a.optional=!0,this},b.prototype.explicit=function(e){var a=this._baseState;return r(null===a.explicit&&null===a.implicit),a.explicit=e,this},b.prototype.implicit=function(e){var a=this._baseState;return r(null===a.explicit&&null===a.implicit),a.implicit=e,this},b.prototype.obj=function(){var e=this._baseState,a=Array.prototype.slice.call(arguments);return e.obj=!0,0!==a.length&&this._useArgs(a),this},b.prototype.key=function(e){var a=this._baseState;return r(null===a.key),a.key=e,this},b.prototype.any=function(){return this._baseState.any=!0,this},b.prototype.choice=function(e){var a=this._baseState;return r(null===a.choice),a.choice=e,this._useArgs(Object.keys(e).map((function(a){return e[a]}))),this},b.prototype.contains=function(e){var a=this._baseState;return r(null===a.use),a.contains=e,this},b.prototype._decode=function(e,a){var t=this._baseState;if(null===t.parent)return e.wrapResult(t.children[0]._decode(e,a));var c,f=t.default,r=!0,n=null;if(null!==t.key&&(n=e.enterKey(t.key)),t.optional){var i=null;if(null!==t.explicit?i=t.explicit:null!==t.implicit?i=t.implicit:null!==t.tag&&(i=t.tag),null!==i||t.any){if(r=this._peekTag(e,i,t.any),e.isError(r))return r}else{var b=e.save();try{null===t.choice?this._decodeGeneric(t.tag,e,a):this._decodeChoice(e,a),r=!0}catch(e){r=!1}e.restore(b)}}if(t.obj&&r&&(c=e.enterObject()),r){if(null!==t.explicit){var o=this._decodeTag(e,t.explicit);if(e.isError(o))return o;e=o}var s=e.offset;if(null===t.use&&null===t.choice){t.any&&(b=e.save());var l=this._decodeTag(e,null!==t.implicit?t.implicit:t.tag,t.any);if(e.isError(l))return l;t.any?f=e.raw(b):e=l}if(a&&a.track&&null!==t.tag&&a.track(e.path(),s,e.length,"tagged"),a&&a.track&&null!==t.tag&&a.track(e.path(),e.offset,e.length,"content"),t.any||(f=null===t.choice?this._decodeGeneric(t.tag,e,a):this._decodeChoice(e,a)),e.isError(f))return f;if(t.any||null!==t.choice||null===t.children||t.children.forEach((function(t){t._decode(e,a)})),t.contains&&("octstr"===t.tag||"bitstr"===t.tag)){var u=new d(f);f=this._getUse(t.contains,e._reporterState.obj)._decode(u,a)}}return t.obj&&r&&(f=e.leaveObject(c)),null===t.key||null===f&&!0!==r?null!==n&&e.exitKey(n):e.leaveKey(n,t.key,f),f},b.prototype._decodeGeneric=function(e,a,t){var c=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(a,e,c.args[0],t):/str$/.test(e)?this._decodeStr(a,e,t):"objid"===e&&c.args?this._decodeObjid(a,c.args[0],c.args[1],t):"objid"===e?this._decodeObjid(a,null,null,t):"gentime"===e||"utctime"===e?this._decodeTime(a,e,t):"null_"===e?this._decodeNull(a,t):"bool"===e?this._decodeBool(a,t):"objDesc"===e?this._decodeStr(a,e,t):"int"===e||"enum"===e?this._decodeInt(a,c.args&&c.args[0],t):null!==c.use?this._getUse(c.use,a._reporterState.obj)._decode(a,t):a.error("unknown tag: "+e)},b.prototype._getUse=function(e,a){var t=this._baseState;return t.useDecoder=this._use(e,a),r(null===t.useDecoder._baseState.parent),t.useDecoder=t.useDecoder._baseState.children[0],t.implicit!==t.useDecoder._baseState.implicit&&(t.useDecoder=t.useDecoder.clone(),t.useDecoder._baseState.implicit=t.implicit),t.useDecoder},b.prototype._decodeChoice=function(e,a){var t=this._baseState,c=null,f=!1;return Object.keys(t.choice).some((function(d){var r=e.save(),n=t.choice[d];try{var i=n._decode(e,a);if(e.isError(i))return!1;c={type:d,value:i},f=!0}catch(a){return e.restore(r),!1}return!0}),this),f?c:e.error("Choice not matched")},b.prototype._createEncoderBuffer=function(e){return new f(e,this.reporter)},b.prototype._encode=function(e,a,t){var c=this._baseState;if(null===c.default||c.default!==e){var f=this._encodeValue(e,a,t);if(void 0!==f&&!this._skipDefault(f,a,t))return f}},b.prototype._encodeValue=function(e,a,t){var f=this._baseState;if(null===f.parent)return f.children[0]._encode(e,a||new c);var d=null;if(this.reporter=a,f.optional&&void 0===e){if(null===f.default)return;e=f.default}var r=null,n=!1;if(f.any)d=this._createEncoderBuffer(e);else if(f.choice)d=this._encodeChoice(e,a);else if(f.contains)r=this._getUse(f.contains,t)._encode(e,a),n=!0;else if(f.children)r=f.children.map((function(t){if("null_"===t._baseState.tag)return t._encode(null,a,e);if(null===t._baseState.key)return a.error("Child should have a key");var c=a.enterKey(t._baseState.key);if("object"!=typeof e)return a.error("Child expected, but input is not object");var f=t._encode(e[t._baseState.key],a,e);return a.leaveKey(c),f}),this).filter((function(e){return e})),r=this._createEncoderBuffer(r);else if("seqof"===f.tag||"setof"===f.tag){if(!f.args||1!==f.args.length)return a.error("Too many args for : "+f.tag);if(!Array.isArray(e))return a.error("seqof/setof, but data is not Array");var i=this.clone();i._baseState.implicit=null,r=this._createEncoderBuffer(e.map((function(t){var c=this._baseState;return this._getUse(c.args[0],e)._encode(t,a)}),i))}else null!==f.use?d=this._getUse(f.use,t)._encode(e,a):(r=this._encodePrimitive(f.tag,e),n=!0);if(!f.any&&null===f.choice){var b=null!==f.implicit?f.implicit:f.tag,o=null===f.implicit?"universal":"context";null===b?null===f.use&&a.error("Tag could be omitted only for .use()"):null===f.use&&(d=this._encodeComposite(b,n,o,r))}return null!==f.explicit&&(d=this._encodeComposite(f.explicit,!1,"context",d)),d},b.prototype._encodeChoice=function(e,a){var t=this._baseState,c=t.choice[e.type];return c||r(!1,e.type+" not found in "+JSON.stringify(Object.keys(t.choice))),c._encode(e.value,a)},b.prototype._encodePrimitive=function(e,a){var t=this._baseState;if(/str$/.test(e))return this._encodeStr(a,e);if("objid"===e&&t.args)return this._encodeObjid(a,t.reverseArgs[0],t.args[1]);if("objid"===e)return this._encodeObjid(a,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(a,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(a,t.args&&t.reverseArgs[0]);if("bool"===e)return this._encodeBool(a);if("objDesc"===e)return this._encodeStr(a,e);throw new Error("Unsupported tag: "+e)},b.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},b.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e)}},89220:(e,a,t)=>{var c=t(56698);function f(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function d(e,a){this.path=e,this.rethrow(a)}a.a=f,f.prototype.isError=function(e){return e instanceof d},f.prototype.save=function(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},f.prototype.restore=function(e){var a=this._reporterState;a.obj=e.obj,a.path=a.path.slice(0,e.pathLen)},f.prototype.enterKey=function(e){return this._reporterState.path.push(e)},f.prototype.exitKey=function(e){var a=this._reporterState;a.path=a.path.slice(0,e-1)},f.prototype.leaveKey=function(e,a,t){var c=this._reporterState;this.exitKey(e),null!==c.obj&&(c.obj[a]=t)},f.prototype.path=function(){return this._reporterState.path.join("/")},f.prototype.enterObject=function(){var e=this._reporterState,a=e.obj;return e.obj={},a},f.prototype.leaveObject=function(e){var a=this._reporterState,t=a.obj;return a.obj=e,t},f.prototype.error=function(e){var a,t=this._reporterState,c=e instanceof d;if(a=c?e:new d(t.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!t.options.partial)throw a;return c||t.errors.push(a),a},f.prototype.wrapResult=function(e){var a=this._reporterState;return a.options.partial?{result:this.isError(e)?null:e,errors:a.errors}:e},c(d,Error),d.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,d),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},74598:(e,a,t)=>{var c=t(22153);a.tagClass={0:"universal",1:"application",2:"context",3:"private"},a.tagClassByName=c._reverse(a.tagClass),a.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},a.tagByName=c._reverse(a.tag)},22153:(e,a,t)=>{var c=a;c._reverse=function(e){var a={};return Object.keys(e).forEach((function(t){(0|t)==t&&(t|=0);var c=e[t];a[c]=t})),a},c.der=t(74598)},62010:(e,a,t)=>{var c=t(56698),f=t(87568),d=f.base,r=f.bignum,n=f.constants.der;function i(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new b,this.tree._init(e.body)}function b(e){d.Node.call(this,"der",e)}function o(e,a){var t=e.readUInt8(a);if(e.isError(t))return t;var c=n.tagClass[t>>6],f=!(32&t);if(31&~t)t&=31;else{var d=t;for(t=0;!(128&~d);){if(d=e.readUInt8(a),e.isError(d))return d;t<<=7,t|=127&d}}return{cls:c,primitive:f,tag:t,tagStr:n.tag[t]}}function s(e,a,t){var c=e.readUInt8(t);if(e.isError(c))return c;if(!a&&128===c)return null;if(!(128&c))return c;var f=127&c;if(f>4)return e.error("length octect is too long");c=0;for(var d=0;d{var c=a;c.der=t(62010),c.pem=t(58903)},58903:(e,a,t)=>{var c=t(56698),f=t(48287).Buffer,d=t(62010);function r(e){d.call(this,e),this.enc="pem"}c(r,d),e.exports=r,r.prototype.decode=function(e,a){for(var t=e.toString().split(/[\r\n]+/g),c=a.label.toUpperCase(),r=/^-----(BEGIN|END) ([^-]+)-----$/,n=-1,i=-1,b=0;b{var c=t(56698),f=t(48287).Buffer,d=t(87568),r=d.base,n=d.constants.der;function i(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new b,this.tree._init(e.body)}function b(e){r.Node.call(this,"der",e)}function o(e){return e<10?"0"+e:e}e.exports=i,i.prototype.encode=function(e,a){return this.tree._encode(e,a).join()},c(b,r.Node),b.prototype._encodeComposite=function(e,a,t,c){var d,r=function(e,a,t,c){var f;if("seqof"===e?e="seq":"setof"===e&&(e="set"),n.tagByName.hasOwnProperty(e))f=n.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return c.error("Unknown tag: "+e);f=e}return f>=31?c.error("Multi-octet tag encoding unsupported"):(a||(f|=32),f|=n.tagClassByName[t||"universal"]<<6)}(e,a,t,this.reporter);if(c.length<128)return(d=new f(2))[0]=r,d[1]=c.length,this._createEncoderBuffer([d,c]);for(var i=1,b=c.length;b>=256;b>>=8)i++;(d=new f(2+i))[0]=r,d[1]=128|i,b=1+i;for(var o=c.length;o>0;b--,o>>=8)d[b]=255&o;return this._createEncoderBuffer([d,c])},b.prototype._encodeStr=function(e,a){if("bitstr"===a)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===a){for(var t=new f(2*e.length),c=0;c=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}var d=0;for(c=0;c=128;r>>=7)d++}var n=new f(d),i=n.length-1;for(c=e.length-1;c>=0;c--)for(r=e[c],n[i--]=127&r;(r>>=7)>0;)n[i--]=128|127&r;return this._createEncoderBuffer(n)},b.prototype._encodeTime=function(e,a){var t,c=new Date(e);return"gentime"===a?t=[o(c.getFullYear()),o(c.getUTCMonth()+1),o(c.getUTCDate()),o(c.getUTCHours()),o(c.getUTCMinutes()),o(c.getUTCSeconds()),"Z"].join(""):"utctime"===a?t=[o(c.getFullYear()%100),o(c.getUTCMonth()+1),o(c.getUTCDate()),o(c.getUTCHours()),o(c.getUTCMinutes()),o(c.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+a+" time is not supported yet"),this._encodeStr(t,"octstr")},b.prototype._encodeNull=function(){return this._createEncoderBuffer("")},b.prototype._encodeInt=function(e,a){if("string"==typeof e){if(!a)return this.reporter.error("String int or enum given, but no values map");if(!a.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=a[e]}if("number"!=typeof e&&!f.isBuffer(e)){var t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=new f(t)}if(f.isBuffer(e)){var c=e.length;0===e.length&&c++;var d=new f(c);return e.copy(d),0===e.length&&(d[0]=0),this._createEncoderBuffer(d)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);c=1;for(var r=e;r>=256;r>>=8)c++;for(r=(d=new Array(c)).length-1;r>=0;r--)d[r]=255&e,e>>=8;return 128&d[0]&&d.unshift(0),this._createEncoderBuffer(new f(d))},b.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},b.prototype._use=function(e,a){return"function"==typeof e&&(e=e(a)),e._getEncoder("der").tree},b.prototype._skipDefault=function(e,a,t){var c,f=this._baseState;if(null===f.default)return!1;var d=e.join();if(void 0===f.defaultBuffer&&(f.defaultBuffer=this._encodeValue(f.default,a,t).join()),d.length!==f.defaultBuffer.length)return!1;for(c=0;c{var c=a;c.der=t(70082),c.pem=t(90735)},90735:(e,a,t)=>{var c=t(56698),f=t(70082);function d(e){f.call(this,e),this.enc="pem"}c(d,f),e.exports=d,d.prototype.encode=function(e,a){for(var t=f.prototype.encode.call(this,e).toString("base64"),c=["-----BEGIN "+a.label+"-----"],d=0;d=65&&t<=70?t-55:t>=97&&t<=102?t-87:t-48&15}function i(e,a,t){var c=n(e,t);return t-1>=a&&(c|=n(e,t-1)<<4),c}function b(e,a,t,c){for(var f=0,d=Math.min(e.length,t),r=a;r=49?n-49+10:n>=17?n-17+10:n}return f}d.isBN=function(e){return e instanceof d||null!==e&&"object"==typeof e&&e.constructor.wordSize===d.wordSize&&Array.isArray(e.words)},d.max=function(e,a){return e.cmp(a)>0?e:a},d.min=function(e,a){return e.cmp(a)<0?e:a},d.prototype._init=function(e,a,t){if("number"==typeof e)return this._initNumber(e,a,t);if("object"==typeof e)return this._initArray(e,a,t);"hex"===a&&(a=16),c(a===(0|a)&&a>=2&&a<=36);var f=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(f++,this.negative=1),f=0;f-=3)r=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[d]|=r<>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);else if("le"===t)for(f=0,d=0;f>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);return this.strip()},d.prototype._parseHex=function(e,a,t){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)f=i(e,a,c)<=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;else for(c=(e.length-a)%2==0?a+1:a;c=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;this.strip()},d.prototype._parseBase=function(e,a,t){this.words=[0],this.length=1;for(var c=0,f=1;f<=67108863;f*=a)c++;c--,f=f/a|0;for(var d=e.length-t,r=d%c,n=Math.min(d,d-r)+t,i=0,o=t;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},d.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},d.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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],l=[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 u(e,a,t){t.negative=a.negative^e.negative;var c=e.length+a.length|0;t.length=c,c=c-1|0;var f=0|e.words[0],d=0|a.words[0],r=f*d,n=67108863&r,i=r/67108864|0;t.words[0]=n;for(var b=1;b>>26,s=67108863&i,l=Math.min(b,a.length-1),u=Math.max(0,b-e.length+1);u<=l;u++){var h=b-u|0;o+=(r=(f=0|e.words[h])*(d=0|a.words[u])+s)/67108864|0,s=67108863&r}t.words[b]=0|s,i=0|o}return 0!==i?t.words[b]=0|i:t.length--,t.strip()}d.prototype.toString=function(e,a){var t;if(a=0|a||1,16===(e=e||10)||"hex"===e){t="";for(var f=0,d=0,r=0;r>>24-f&16777215)||r!==this.length-1?o[6-i.length]+i+t:i+t,(f+=2)>=26&&(f-=26,r--)}for(0!==d&&(t=d.toString(16)+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(e===(0|e)&&e>=2&&e<=36){var b=s[e],u=l[e];t="";var h=this.clone();for(h.negative=0;!h.isZero();){var p=h.modn(u).toString(e);t=(h=h.idivn(u)).isZero()?p+t:o[b-p.length]+p+t}for(this.isZero()&&(t="0"+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}c(!1,"Base should be between 2 and 36")},d.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&c(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},d.prototype.toJSON=function(){return this.toString(16)},d.prototype.toBuffer=function(e,a){return c(void 0!==r),this.toArrayLike(r,e,a)},d.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},d.prototype.toArrayLike=function(e,a,t){var f=this.byteLength(),d=t||Math.max(1,f);c(f<=d,"byte array longer than desired length"),c(d>0,"Requested array length <= 0"),this.strip();var r,n,i="le"===a,b=new e(d),o=this.clone();if(i){for(n=0;!o.isZero();n++)r=o.andln(255),o.iushrn(8),b[n]=r;for(;n=4096&&(t+=13,a>>>=13),a>=64&&(t+=7,a>>>=7),a>=8&&(t+=4,a>>>=4),a>=2&&(t+=2,a>>>=2),t+a},d.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,t=0;return 8191&a||(t+=13,a>>>=13),127&a||(t+=7,a>>>=7),15&a||(t+=4,a>>>=4),3&a||(t+=2,a>>>=2),1&a||t++,t},d.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},d.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},d.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},d.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var t=0;te.length?this.clone().iand(e):e.clone().iand(this)},d.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},d.prototype.iuxor=function(e){var a,t;this.length>e.length?(a=this,t=e):(a=e,t=this);for(var c=0;ce.length?this.clone().ixor(e):e.clone().ixor(this)},d.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},d.prototype.inotn=function(e){c("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),t=e%26;this._expand(a),t>0&&a--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-t),this.strip()},d.prototype.notn=function(e){return this.clone().inotn(e)},d.prototype.setn=function(e,a){c("number"==typeof e&&e>=0);var t=e/26|0,f=e%26;return this._expand(t+1),this.words[t]=a?this.words[t]|1<e.length?(t=this,c=e):(t=e,c=this);for(var f=0,d=0;d>>26;for(;0!==f&&d>>26;if(this.length=t.length,0!==f)this.words[this.length]=f,this.length++;else if(t!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},d.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var t,c,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(t=this,c=e):(t=e,c=this);for(var d=0,r=0;r>26,this.words[r]=67108863&a;for(;0!==d&&r>26,this.words[r]=67108863&a;if(0===d&&r>>13,u=0|r[1],h=8191&u,p=u>>>13,g=0|r[2],m=8191&g,x=g>>>13,y=0|r[3],A=8191&y,v=y>>>13,w=0|r[4],_=8191&w,I=w>>>13,E=0|r[5],C=8191&E,M=E>>>13,B=0|r[6],k=8191&B,L=B>>>13,S=0|r[7],T=8191&S,N=S>>>13,R=0|r[8],P=8191&R,D=R>>>13,O=0|r[9],F=8191&O,Q=O>>>13,U=0|n[0],j=8191&U,H=U>>>13,q=0|n[1],$=8191&q,z=q>>>13,G=0|n[2],K=8191&G,V=G>>>13,Z=0|n[3],J=8191&Z,W=Z>>>13,Y=0|n[4],X=8191&Y,ee=Y>>>13,ae=0|n[5],te=8191&ae,ce=ae>>>13,fe=0|n[6],de=8191&fe,re=fe>>>13,ne=0|n[7],ie=8191&ne,be=ne>>>13,oe=0|n[8],se=8191&oe,le=oe>>>13,ue=0|n[9],he=8191&ue,pe=ue>>>13;t.negative=e.negative^a.negative,t.length=19;var ge=(b+(c=Math.imul(s,j))|0)+((8191&(f=(f=Math.imul(s,H))+Math.imul(l,j)|0))<<13)|0;b=((d=Math.imul(l,H))+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,c=Math.imul(h,j),f=(f=Math.imul(h,H))+Math.imul(p,j)|0,d=Math.imul(p,H);var me=(b+(c=c+Math.imul(s,$)|0)|0)+((8191&(f=(f=f+Math.imul(s,z)|0)+Math.imul(l,$)|0))<<13)|0;b=((d=d+Math.imul(l,z)|0)+(f>>>13)|0)+(me>>>26)|0,me&=67108863,c=Math.imul(m,j),f=(f=Math.imul(m,H))+Math.imul(x,j)|0,d=Math.imul(x,H),c=c+Math.imul(h,$)|0,f=(f=f+Math.imul(h,z)|0)+Math.imul(p,$)|0,d=d+Math.imul(p,z)|0;var xe=(b+(c=c+Math.imul(s,K)|0)|0)+((8191&(f=(f=f+Math.imul(s,V)|0)+Math.imul(l,K)|0))<<13)|0;b=((d=d+Math.imul(l,V)|0)+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,c=Math.imul(A,j),f=(f=Math.imul(A,H))+Math.imul(v,j)|0,d=Math.imul(v,H),c=c+Math.imul(m,$)|0,f=(f=f+Math.imul(m,z)|0)+Math.imul(x,$)|0,d=d+Math.imul(x,z)|0,c=c+Math.imul(h,K)|0,f=(f=f+Math.imul(h,V)|0)+Math.imul(p,K)|0,d=d+Math.imul(p,V)|0;var ye=(b+(c=c+Math.imul(s,J)|0)|0)+((8191&(f=(f=f+Math.imul(s,W)|0)+Math.imul(l,J)|0))<<13)|0;b=((d=d+Math.imul(l,W)|0)+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,c=Math.imul(_,j),f=(f=Math.imul(_,H))+Math.imul(I,j)|0,d=Math.imul(I,H),c=c+Math.imul(A,$)|0,f=(f=f+Math.imul(A,z)|0)+Math.imul(v,$)|0,d=d+Math.imul(v,z)|0,c=c+Math.imul(m,K)|0,f=(f=f+Math.imul(m,V)|0)+Math.imul(x,K)|0,d=d+Math.imul(x,V)|0,c=c+Math.imul(h,J)|0,f=(f=f+Math.imul(h,W)|0)+Math.imul(p,J)|0,d=d+Math.imul(p,W)|0;var Ae=(b+(c=c+Math.imul(s,X)|0)|0)+((8191&(f=(f=f+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;b=((d=d+Math.imul(l,ee)|0)+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,c=Math.imul(C,j),f=(f=Math.imul(C,H))+Math.imul(M,j)|0,d=Math.imul(M,H),c=c+Math.imul(_,$)|0,f=(f=f+Math.imul(_,z)|0)+Math.imul(I,$)|0,d=d+Math.imul(I,z)|0,c=c+Math.imul(A,K)|0,f=(f=f+Math.imul(A,V)|0)+Math.imul(v,K)|0,d=d+Math.imul(v,V)|0,c=c+Math.imul(m,J)|0,f=(f=f+Math.imul(m,W)|0)+Math.imul(x,J)|0,d=d+Math.imul(x,W)|0,c=c+Math.imul(h,X)|0,f=(f=f+Math.imul(h,ee)|0)+Math.imul(p,X)|0,d=d+Math.imul(p,ee)|0;var ve=(b+(c=c+Math.imul(s,te)|0)|0)+((8191&(f=(f=f+Math.imul(s,ce)|0)+Math.imul(l,te)|0))<<13)|0;b=((d=d+Math.imul(l,ce)|0)+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,c=Math.imul(k,j),f=(f=Math.imul(k,H))+Math.imul(L,j)|0,d=Math.imul(L,H),c=c+Math.imul(C,$)|0,f=(f=f+Math.imul(C,z)|0)+Math.imul(M,$)|0,d=d+Math.imul(M,z)|0,c=c+Math.imul(_,K)|0,f=(f=f+Math.imul(_,V)|0)+Math.imul(I,K)|0,d=d+Math.imul(I,V)|0,c=c+Math.imul(A,J)|0,f=(f=f+Math.imul(A,W)|0)+Math.imul(v,J)|0,d=d+Math.imul(v,W)|0,c=c+Math.imul(m,X)|0,f=(f=f+Math.imul(m,ee)|0)+Math.imul(x,X)|0,d=d+Math.imul(x,ee)|0,c=c+Math.imul(h,te)|0,f=(f=f+Math.imul(h,ce)|0)+Math.imul(p,te)|0,d=d+Math.imul(p,ce)|0;var we=(b+(c=c+Math.imul(s,de)|0)|0)+((8191&(f=(f=f+Math.imul(s,re)|0)+Math.imul(l,de)|0))<<13)|0;b=((d=d+Math.imul(l,re)|0)+(f>>>13)|0)+(we>>>26)|0,we&=67108863,c=Math.imul(T,j),f=(f=Math.imul(T,H))+Math.imul(N,j)|0,d=Math.imul(N,H),c=c+Math.imul(k,$)|0,f=(f=f+Math.imul(k,z)|0)+Math.imul(L,$)|0,d=d+Math.imul(L,z)|0,c=c+Math.imul(C,K)|0,f=(f=f+Math.imul(C,V)|0)+Math.imul(M,K)|0,d=d+Math.imul(M,V)|0,c=c+Math.imul(_,J)|0,f=(f=f+Math.imul(_,W)|0)+Math.imul(I,J)|0,d=d+Math.imul(I,W)|0,c=c+Math.imul(A,X)|0,f=(f=f+Math.imul(A,ee)|0)+Math.imul(v,X)|0,d=d+Math.imul(v,ee)|0,c=c+Math.imul(m,te)|0,f=(f=f+Math.imul(m,ce)|0)+Math.imul(x,te)|0,d=d+Math.imul(x,ce)|0,c=c+Math.imul(h,de)|0,f=(f=f+Math.imul(h,re)|0)+Math.imul(p,de)|0,d=d+Math.imul(p,re)|0;var _e=(b+(c=c+Math.imul(s,ie)|0)|0)+((8191&(f=(f=f+Math.imul(s,be)|0)+Math.imul(l,ie)|0))<<13)|0;b=((d=d+Math.imul(l,be)|0)+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,c=Math.imul(P,j),f=(f=Math.imul(P,H))+Math.imul(D,j)|0,d=Math.imul(D,H),c=c+Math.imul(T,$)|0,f=(f=f+Math.imul(T,z)|0)+Math.imul(N,$)|0,d=d+Math.imul(N,z)|0,c=c+Math.imul(k,K)|0,f=(f=f+Math.imul(k,V)|0)+Math.imul(L,K)|0,d=d+Math.imul(L,V)|0,c=c+Math.imul(C,J)|0,f=(f=f+Math.imul(C,W)|0)+Math.imul(M,J)|0,d=d+Math.imul(M,W)|0,c=c+Math.imul(_,X)|0,f=(f=f+Math.imul(_,ee)|0)+Math.imul(I,X)|0,d=d+Math.imul(I,ee)|0,c=c+Math.imul(A,te)|0,f=(f=f+Math.imul(A,ce)|0)+Math.imul(v,te)|0,d=d+Math.imul(v,ce)|0,c=c+Math.imul(m,de)|0,f=(f=f+Math.imul(m,re)|0)+Math.imul(x,de)|0,d=d+Math.imul(x,re)|0,c=c+Math.imul(h,ie)|0,f=(f=f+Math.imul(h,be)|0)+Math.imul(p,ie)|0,d=d+Math.imul(p,be)|0;var Ie=(b+(c=c+Math.imul(s,se)|0)|0)+((8191&(f=(f=f+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;b=((d=d+Math.imul(l,le)|0)+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,c=Math.imul(F,j),f=(f=Math.imul(F,H))+Math.imul(Q,j)|0,d=Math.imul(Q,H),c=c+Math.imul(P,$)|0,f=(f=f+Math.imul(P,z)|0)+Math.imul(D,$)|0,d=d+Math.imul(D,z)|0,c=c+Math.imul(T,K)|0,f=(f=f+Math.imul(T,V)|0)+Math.imul(N,K)|0,d=d+Math.imul(N,V)|0,c=c+Math.imul(k,J)|0,f=(f=f+Math.imul(k,W)|0)+Math.imul(L,J)|0,d=d+Math.imul(L,W)|0,c=c+Math.imul(C,X)|0,f=(f=f+Math.imul(C,ee)|0)+Math.imul(M,X)|0,d=d+Math.imul(M,ee)|0,c=c+Math.imul(_,te)|0,f=(f=f+Math.imul(_,ce)|0)+Math.imul(I,te)|0,d=d+Math.imul(I,ce)|0,c=c+Math.imul(A,de)|0,f=(f=f+Math.imul(A,re)|0)+Math.imul(v,de)|0,d=d+Math.imul(v,re)|0,c=c+Math.imul(m,ie)|0,f=(f=f+Math.imul(m,be)|0)+Math.imul(x,ie)|0,d=d+Math.imul(x,be)|0,c=c+Math.imul(h,se)|0,f=(f=f+Math.imul(h,le)|0)+Math.imul(p,se)|0,d=d+Math.imul(p,le)|0;var Ee=(b+(c=c+Math.imul(s,he)|0)|0)+((8191&(f=(f=f+Math.imul(s,pe)|0)+Math.imul(l,he)|0))<<13)|0;b=((d=d+Math.imul(l,pe)|0)+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,c=Math.imul(F,$),f=(f=Math.imul(F,z))+Math.imul(Q,$)|0,d=Math.imul(Q,z),c=c+Math.imul(P,K)|0,f=(f=f+Math.imul(P,V)|0)+Math.imul(D,K)|0,d=d+Math.imul(D,V)|0,c=c+Math.imul(T,J)|0,f=(f=f+Math.imul(T,W)|0)+Math.imul(N,J)|0,d=d+Math.imul(N,W)|0,c=c+Math.imul(k,X)|0,f=(f=f+Math.imul(k,ee)|0)+Math.imul(L,X)|0,d=d+Math.imul(L,ee)|0,c=c+Math.imul(C,te)|0,f=(f=f+Math.imul(C,ce)|0)+Math.imul(M,te)|0,d=d+Math.imul(M,ce)|0,c=c+Math.imul(_,de)|0,f=(f=f+Math.imul(_,re)|0)+Math.imul(I,de)|0,d=d+Math.imul(I,re)|0,c=c+Math.imul(A,ie)|0,f=(f=f+Math.imul(A,be)|0)+Math.imul(v,ie)|0,d=d+Math.imul(v,be)|0,c=c+Math.imul(m,se)|0,f=(f=f+Math.imul(m,le)|0)+Math.imul(x,se)|0,d=d+Math.imul(x,le)|0;var Ce=(b+(c=c+Math.imul(h,he)|0)|0)+((8191&(f=(f=f+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;b=((d=d+Math.imul(p,pe)|0)+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c=Math.imul(F,K),f=(f=Math.imul(F,V))+Math.imul(Q,K)|0,d=Math.imul(Q,V),c=c+Math.imul(P,J)|0,f=(f=f+Math.imul(P,W)|0)+Math.imul(D,J)|0,d=d+Math.imul(D,W)|0,c=c+Math.imul(T,X)|0,f=(f=f+Math.imul(T,ee)|0)+Math.imul(N,X)|0,d=d+Math.imul(N,ee)|0,c=c+Math.imul(k,te)|0,f=(f=f+Math.imul(k,ce)|0)+Math.imul(L,te)|0,d=d+Math.imul(L,ce)|0,c=c+Math.imul(C,de)|0,f=(f=f+Math.imul(C,re)|0)+Math.imul(M,de)|0,d=d+Math.imul(M,re)|0,c=c+Math.imul(_,ie)|0,f=(f=f+Math.imul(_,be)|0)+Math.imul(I,ie)|0,d=d+Math.imul(I,be)|0,c=c+Math.imul(A,se)|0,f=(f=f+Math.imul(A,le)|0)+Math.imul(v,se)|0,d=d+Math.imul(v,le)|0;var Me=(b+(c=c+Math.imul(m,he)|0)|0)+((8191&(f=(f=f+Math.imul(m,pe)|0)+Math.imul(x,he)|0))<<13)|0;b=((d=d+Math.imul(x,pe)|0)+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,c=Math.imul(F,J),f=(f=Math.imul(F,W))+Math.imul(Q,J)|0,d=Math.imul(Q,W),c=c+Math.imul(P,X)|0,f=(f=f+Math.imul(P,ee)|0)+Math.imul(D,X)|0,d=d+Math.imul(D,ee)|0,c=c+Math.imul(T,te)|0,f=(f=f+Math.imul(T,ce)|0)+Math.imul(N,te)|0,d=d+Math.imul(N,ce)|0,c=c+Math.imul(k,de)|0,f=(f=f+Math.imul(k,re)|0)+Math.imul(L,de)|0,d=d+Math.imul(L,re)|0,c=c+Math.imul(C,ie)|0,f=(f=f+Math.imul(C,be)|0)+Math.imul(M,ie)|0,d=d+Math.imul(M,be)|0,c=c+Math.imul(_,se)|0,f=(f=f+Math.imul(_,le)|0)+Math.imul(I,se)|0,d=d+Math.imul(I,le)|0;var Be=(b+(c=c+Math.imul(A,he)|0)|0)+((8191&(f=(f=f+Math.imul(A,pe)|0)+Math.imul(v,he)|0))<<13)|0;b=((d=d+Math.imul(v,pe)|0)+(f>>>13)|0)+(Be>>>26)|0,Be&=67108863,c=Math.imul(F,X),f=(f=Math.imul(F,ee))+Math.imul(Q,X)|0,d=Math.imul(Q,ee),c=c+Math.imul(P,te)|0,f=(f=f+Math.imul(P,ce)|0)+Math.imul(D,te)|0,d=d+Math.imul(D,ce)|0,c=c+Math.imul(T,de)|0,f=(f=f+Math.imul(T,re)|0)+Math.imul(N,de)|0,d=d+Math.imul(N,re)|0,c=c+Math.imul(k,ie)|0,f=(f=f+Math.imul(k,be)|0)+Math.imul(L,ie)|0,d=d+Math.imul(L,be)|0,c=c+Math.imul(C,se)|0,f=(f=f+Math.imul(C,le)|0)+Math.imul(M,se)|0,d=d+Math.imul(M,le)|0;var ke=(b+(c=c+Math.imul(_,he)|0)|0)+((8191&(f=(f=f+Math.imul(_,pe)|0)+Math.imul(I,he)|0))<<13)|0;b=((d=d+Math.imul(I,pe)|0)+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,c=Math.imul(F,te),f=(f=Math.imul(F,ce))+Math.imul(Q,te)|0,d=Math.imul(Q,ce),c=c+Math.imul(P,de)|0,f=(f=f+Math.imul(P,re)|0)+Math.imul(D,de)|0,d=d+Math.imul(D,re)|0,c=c+Math.imul(T,ie)|0,f=(f=f+Math.imul(T,be)|0)+Math.imul(N,ie)|0,d=d+Math.imul(N,be)|0,c=c+Math.imul(k,se)|0,f=(f=f+Math.imul(k,le)|0)+Math.imul(L,se)|0,d=d+Math.imul(L,le)|0;var Le=(b+(c=c+Math.imul(C,he)|0)|0)+((8191&(f=(f=f+Math.imul(C,pe)|0)+Math.imul(M,he)|0))<<13)|0;b=((d=d+Math.imul(M,pe)|0)+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,c=Math.imul(F,de),f=(f=Math.imul(F,re))+Math.imul(Q,de)|0,d=Math.imul(Q,re),c=c+Math.imul(P,ie)|0,f=(f=f+Math.imul(P,be)|0)+Math.imul(D,ie)|0,d=d+Math.imul(D,be)|0,c=c+Math.imul(T,se)|0,f=(f=f+Math.imul(T,le)|0)+Math.imul(N,se)|0,d=d+Math.imul(N,le)|0;var Se=(b+(c=c+Math.imul(k,he)|0)|0)+((8191&(f=(f=f+Math.imul(k,pe)|0)+Math.imul(L,he)|0))<<13)|0;b=((d=d+Math.imul(L,pe)|0)+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,c=Math.imul(F,ie),f=(f=Math.imul(F,be))+Math.imul(Q,ie)|0,d=Math.imul(Q,be),c=c+Math.imul(P,se)|0,f=(f=f+Math.imul(P,le)|0)+Math.imul(D,se)|0,d=d+Math.imul(D,le)|0;var Te=(b+(c=c+Math.imul(T,he)|0)|0)+((8191&(f=(f=f+Math.imul(T,pe)|0)+Math.imul(N,he)|0))<<13)|0;b=((d=d+Math.imul(N,pe)|0)+(f>>>13)|0)+(Te>>>26)|0,Te&=67108863,c=Math.imul(F,se),f=(f=Math.imul(F,le))+Math.imul(Q,se)|0,d=Math.imul(Q,le);var Ne=(b+(c=c+Math.imul(P,he)|0)|0)+((8191&(f=(f=f+Math.imul(P,pe)|0)+Math.imul(D,he)|0))<<13)|0;b=((d=d+Math.imul(D,pe)|0)+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Re=(b+(c=Math.imul(F,he))|0)+((8191&(f=(f=Math.imul(F,pe))+Math.imul(Q,he)|0))<<13)|0;return b=((d=Math.imul(Q,pe))+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,i[0]=ge,i[1]=me,i[2]=xe,i[3]=ye,i[4]=Ae,i[5]=ve,i[6]=we,i[7]=_e,i[8]=Ie,i[9]=Ee,i[10]=Ce,i[11]=Me,i[12]=Be,i[13]=ke,i[14]=Le,i[15]=Se,i[16]=Te,i[17]=Ne,i[18]=Re,0!==b&&(i[19]=b,t.length++),t};function p(e,a,t){return(new g).mulp(e,a,t)}function g(e,a){this.x=e,this.y=a}Math.imul||(h=u),d.prototype.mulTo=function(e,a){var t,c=this.length+e.length;return t=10===this.length&&10===e.length?h(this,e,a):c<63?u(this,e,a):c<1024?function(e,a,t){t.negative=a.negative^e.negative,t.length=e.length+a.length;for(var c=0,f=0,d=0;d>>26)|0)>>>26,r&=67108863}t.words[d]=n,c=r,r=f}return 0!==c?t.words[d]=c:t.length--,t.strip()}(this,e,a):p(this,e,a),t},g.prototype.makeRBT=function(e){for(var a=new Array(e),t=d.prototype._countBits(e)-1,c=0;c>=1;return c},g.prototype.permute=function(e,a,t,c,f,d){for(var r=0;r>>=1)f++;return 1<>>=13,t[2*r+1]=8191&d,d>>>=13;for(r=2*a;r>=26,a+=f/67108864|0,a+=d>>>26,this.words[t]=67108863&d}return 0!==a&&(this.words[t]=a,this.length++),this},d.prototype.muln=function(e){return this.clone().imuln(e)},d.prototype.sqr=function(){return this.mul(this)},d.prototype.isqr=function(){return this.imul(this.clone())},d.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),t=0;t>>f}return a}(e);if(0===a.length)return new d(1);for(var t=this,c=0;c=0);var a,t=e%26,f=(e-t)/26,d=67108863>>>26-t<<26-t;if(0!==t){var r=0;for(a=0;a>>26-t}r&&(this.words[a]=r,this.length++)}if(0!==f){for(a=this.length-1;a>=0;a--)this.words[a+f]=this.words[a];for(a=0;a=0),f=a?(a-a%26)/26:0;var d=e%26,r=Math.min((e-d)/26,this.length),n=67108863^67108863>>>d<r)for(this.length-=r,b=0;b=0&&(0!==o||b>=f);b--){var s=0|this.words[b];this.words[b]=o<<26-d|s>>>d,o=s&n}return i&&0!==o&&(i.words[i.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},d.prototype.ishrn=function(e,a,t){return c(0===this.negative),this.iushrn(e,a,t)},d.prototype.shln=function(e){return this.clone().ishln(e)},d.prototype.ushln=function(e){return this.clone().iushln(e)},d.prototype.shrn=function(e){return this.clone().ishrn(e)},d.prototype.ushrn=function(e){return this.clone().iushrn(e)},d.prototype.testn=function(e){c("number"==typeof e&&e>=0);var a=e%26,t=(e-a)/26,f=1<=0);var a=e%26,t=(e-a)/26;if(c(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==a&&t++,this.length=Math.min(t,this.length),0!==a){var f=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},d.prototype.isubn=function(e){if(c("number"==typeof e),c(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(i/67108864|0),this.words[f+t]=67108863&d}for(;f>26,this.words[f+t]=67108863&d;if(0===n)return this.strip();for(c(-1===n),n=0,f=0;f>26,this.words[f]=67108863&d;return this.negative=1,this.strip()},d.prototype._wordDiv=function(e,a){var t=(this.length,e.length),c=this.clone(),f=e,r=0|f.words[f.length-1];0!=(t=26-this._countBits(r))&&(f=f.ushln(t),c.iushln(t),r=0|f.words[f.length-1]);var n,i=c.length-f.length;if("mod"!==a){(n=new d(null)).length=i+1,n.words=new Array(n.length);for(var b=0;b=0;s--){var l=67108864*(0|c.words[f.length+s])+(0|c.words[f.length+s-1]);for(l=Math.min(l/r|0,67108863),c._ishlnsubmul(f,l,s);0!==c.negative;)l--,c.negative=0,c._ishlnsubmul(f,1,s),c.isZero()||(c.negative^=1);n&&(n.words[s]=l)}return n&&n.strip(),c.strip(),"div"!==a&&0!==t&&c.iushrn(t),{div:n||null,mod:c}},d.prototype.divmod=function(e,a,t){return c(!e.isZero()),this.isZero()?{div:new d(0),mod:new d(0)}:0!==this.negative&&0===e.negative?(n=this.neg().divmod(e,a),"mod"!==a&&(f=n.div.neg()),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.iadd(e)),{div:f,mod:r}):0===this.negative&&0!==e.negative?(n=this.divmod(e.neg(),a),"mod"!==a&&(f=n.div.neg()),{div:f,mod:n.mod}):this.negative&e.negative?(n=this.neg().divmod(e.neg(),a),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.isub(e)),{div:n.div,mod:r}):e.length>this.length||this.cmp(e)<0?{div:new d(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new d(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new d(this.modn(e.words[0]))}:this._wordDiv(e,a);var f,r,n},d.prototype.div=function(e){return this.divmod(e,"div",!1).div},d.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},d.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},d.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var t=0!==a.div.negative?a.mod.isub(e):a.mod,c=e.ushrn(1),f=e.andln(1),d=t.cmp(c);return d<0||1===f&&0===d?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},d.prototype.modn=function(e){c(e<=67108863);for(var a=(1<<26)%e,t=0,f=this.length-1;f>=0;f--)t=(a*t+(0|this.words[f]))%e;return t},d.prototype.idivn=function(e){c(e<=67108863);for(var a=0,t=this.length-1;t>=0;t--){var f=(0|this.words[t])+67108864*a;this.words[t]=f/e|0,a=f%e}return this.strip()},d.prototype.divn=function(e){return this.clone().idivn(e)},d.prototype.egcd=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f=new d(1),r=new d(0),n=new d(0),i=new d(1),b=0;a.isEven()&&t.isEven();)a.iushrn(1),t.iushrn(1),++b;for(var o=t.clone(),s=a.clone();!a.isZero();){for(var l=0,u=1;!(a.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(f.isOdd()||r.isOdd())&&(f.iadd(o),r.isub(s)),f.iushrn(1),r.iushrn(1);for(var h=0,p=1;!(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(o),i.isub(s)),n.iushrn(1),i.iushrn(1);a.cmp(t)>=0?(a.isub(t),f.isub(n),r.isub(i)):(t.isub(a),n.isub(f),i.isub(r))}return{a:n,b:i,gcd:t.iushln(b)}},d.prototype._invmp=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f,r=new d(1),n=new d(0),i=t.clone();a.cmpn(1)>0&&t.cmpn(1)>0;){for(var b=0,o=1;!(a.words[0]&o)&&b<26;++b,o<<=1);if(b>0)for(a.iushrn(b);b-- >0;)r.isOdd()&&r.iadd(i),r.iushrn(1);for(var s=0,l=1;!(t.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(t.iushrn(s);s-- >0;)n.isOdd()&&n.iadd(i),n.iushrn(1);a.cmp(t)>=0?(a.isub(t),r.isub(n)):(t.isub(a),n.isub(r))}return(f=0===a.cmpn(1)?r:n).cmpn(0)<0&&f.iadd(e),f},d.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),t=e.clone();a.negative=0,t.negative=0;for(var c=0;a.isEven()&&t.isEven();c++)a.iushrn(1),t.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;t.isEven();)t.iushrn(1);var f=a.cmp(t);if(f<0){var d=a;a=t,t=d}else if(0===f||0===t.cmpn(1))break;a.isub(t)}return t.iushln(c)},d.prototype.invm=function(e){return this.egcd(e).a.umod(e)},d.prototype.isEven=function(){return!(1&this.words[0])},d.prototype.isOdd=function(){return!(1&~this.words[0])},d.prototype.andln=function(e){return this.words[0]&e},d.prototype.bincn=function(e){c("number"==typeof e);var a=e%26,t=(e-a)/26,f=1<>>26,n&=67108863,this.words[r]=n}return 0!==d&&(this.words[r]=d,this.length++),this},d.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},d.prototype.cmpn=function(e){var a,t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)a=1;else{t&&(e=-e),c(e<=67108863,"Number is too big");var f=0|this.words[0];a=f===e?0:fe.length)return 1;if(this.length=0;t--){var c=0|this.words[t],f=0|e.words[t];if(c!==f){cf&&(a=1);break}}return a},d.prototype.gtn=function(e){return 1===this.cmpn(e)},d.prototype.gt=function(e){return 1===this.cmp(e)},d.prototype.gten=function(e){return this.cmpn(e)>=0},d.prototype.gte=function(e){return this.cmp(e)>=0},d.prototype.ltn=function(e){return-1===this.cmpn(e)},d.prototype.lt=function(e){return-1===this.cmp(e)},d.prototype.lten=function(e){return this.cmpn(e)<=0},d.prototype.lte=function(e){return this.cmp(e)<=0},d.prototype.eqn=function(e){return 0===this.cmpn(e)},d.prototype.eq=function(e){return 0===this.cmp(e)},d.red=function(e){return new _(e)},d.prototype.toRed=function(e){return c(!this.red,"Already a number in reduction context"),c(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},d.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},d.prototype._forceRed=function(e){return this.red=e,this},d.prototype.forceRed=function(e){return c(!this.red,"Already a number in reduction context"),this._forceRed(e)},d.prototype.redAdd=function(e){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},d.prototype.redIAdd=function(e){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},d.prototype.redSub=function(e){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},d.prototype.redISub=function(e){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},d.prototype.redShl=function(e){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},d.prototype.redMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},d.prototype.redIMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},d.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},d.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},d.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},d.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},d.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},d.prototype.redPow=function(e){return c(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function x(e,a){this.name=e,this.p=new d(a,16),this.n=this.p.bitLength(),this.k=new d(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var a=d._prime(e);this.m=a.p,this.prime=a}else c(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new d(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)}x.prototype._tmp=function(){var e=new d(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var a,t=e;do{this.split(t,this.tmp),a=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(a>this.n);var c=a0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},x.prototype.split=function(e,a){e.iushrn(this.n,0,a)},x.prototype.imulK=function(e){return e.imul(this.k)},f(y,x),y.prototype.split=function(e,a){for(var t=4194303,c=Math.min(e.length,9),f=0;f>>22,d=r}d>>>=22,e.words[f-10]=d,0===d&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,t=0;t>>=26,e.words[t]=f,a=c}return 0!==a&&(e.words[e.length++]=a),e},d._prime=function(e){if(m[e])return m[e];var a;if("k256"===e)a=new y;else if("p224"===e)a=new A;else if("p192"===e)a=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new w}return m[e]=a,a},_.prototype._verify1=function(e){c(0===e.negative,"red works only with positives"),c(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,a){c(!(e.negative|a.negative),"red works only with positives"),c(e.red&&e.red===a.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,a){this._verify2(e,a);var t=e.add(a);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},_.prototype.iadd=function(e,a){this._verify2(e,a);var t=e.iadd(a);return t.cmp(this.m)>=0&&t.isub(this.m),t},_.prototype.sub=function(e,a){this._verify2(e,a);var t=e.sub(a);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},_.prototype.isub=function(e,a){this._verify2(e,a);var t=e.isub(a);return t.cmpn(0)<0&&t.iadd(this.m),t},_.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},_.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},_.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(c(a%2==1),3===a){var t=this.m.add(new d(1)).iushrn(2);return this.pow(e,t)}for(var f=this.m.subn(1),r=0;!f.isZero()&&0===f.andln(1);)r++,f.iushrn(1);c(!f.isZero());var n=new d(1).toRed(this),i=n.redNeg(),b=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new d(2*o*o).toRed(this);0!==this.pow(o,b).cmp(i);)o.redIAdd(i);for(var s=this.pow(o,f),l=this.pow(e,f.addn(1).iushrn(1)),u=this.pow(e,f),h=r;0!==u.cmp(n);){for(var p=u,g=0;0!==p.cmp(n);g++)p=p.redSqr();c(g=0;c--){for(var b=a.words[c],o=i-1;o>=0;o--){var s=b>>o&1;f!==t[0]&&(f=this.sqr(f)),0!==s||0!==r?(r<<=1,r|=s,(4==++n||0===c&&0===o)&&(f=this.mul(f,t[r]),n=0,r=0)):n=0}i=26}return f},_.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},_.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},d.mont=function(e){return new I(e)},f(I,_),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},I.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var t=e.imul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),d=f;return f.cmp(this.m)>=0?d=f.isub(this.m):f.cmpn(0)<0&&(d=f.iadd(this.m)),d._forceRed(this)},I.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new d(0)._forceRed(this);var t=e.mul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),r=f;return f.cmp(this.m)>=0?r=f.isub(this.m):f.cmpn(0)<0&&(r=f.iadd(this.m)),r._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=t.nmd(e),this)},94148:(e,a,t)=>{"use strict";function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function f(e,a){for(var t=0;t1?t-1:0),f=1;f1?t-1:0),f=1;f1?t-1:0),f=1;f1?t-1:0),f=1;f{"use strict";function c(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);a&&(c=c.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),t.push.apply(t,c)}return t}function f(e){for(var a=1;ae.length)&&(t=e.length),e.substring(t-a.length,t)===a}var x="",y="",A="",v="",w={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function _(e){var a=Object.keys(e),t=Object.create(Object.getPrototypeOf(e));return a.forEach((function(a){t[a]=e[a]})),Object.defineProperty(t,"message",{value:e.message}),t}function I(e){return p(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var E=function(e,a){!function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(a&&a.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),a&&l(e,a)}(E,e);var t,c,r,b,o=(t=E,c=s(),function(){var e,a=u(t);if(c){var f=u(this).constructor;e=Reflect.construct(a,arguments,f)}else e=a.apply(this,arguments);return n(this,e)});function E(e){var a;if(function(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this,E),"object"!==h(e)||null===e)throw new g("options","Object",e);var t=e.message,c=e.operator,f=e.stackStartFn,d=e.actual,r=e.expected,b=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=t)a=o.call(this,String(t));else if(process.stderr&&process.stderr.isTTY&&(process.stderr&&process.stderr.getColorDepth&&1!==process.stderr.getColorDepth()?(x="",y="",v="",A=""):(x="",y="",v="",A="")),"object"===h(d)&&null!==d&&"object"===h(r)&&null!==r&&"stack"in d&&d instanceof Error&&"stack"in r&&r instanceof Error&&(d=_(d),r=_(r)),"deepStrictEqual"===c||"strictEqual"===c)a=o.call(this,function(e,a,t){var c="",f="",d=0,r="",n=!1,i=I(e),b=i.split("\n"),o=I(a).split("\n"),s=0,l="";if("strictEqual"===t&&"object"===h(e)&&"object"===h(a)&&null!==e&&null!==a&&(t="strictEqualObject"),1===b.length&&1===o.length&&b[0]!==o[0]){var u=b[0].length+o[0].length;if(u<=10){if(!("object"===h(e)&&null!==e||"object"===h(a)&&null!==a||0===e&&0===a))return"".concat(w[t],"\n\n")+"".concat(b[0]," !== ").concat(o[0],"\n")}else if("strictEqualObject"!==t&&u<(process.stderr&&process.stderr.isTTY?process.stderr.columns:80)){for(;b[0][s]===o[0][s];)s++;s>2&&(l="\n ".concat(function(e,a){if(a=Math.floor(a),0==e.length||0==a)return"";var t=e.length*a;for(a=Math.floor(Math.log(a)/Math.log(2));a;)e+=e,a--;return e+e.substring(0,t-e.length)}(" ",s),"^"),s=0)}}for(var p=b[b.length-1],g=o[o.length-1];p===g&&(s++<2?r="\n ".concat(p).concat(r):c=p,b.pop(),o.pop(),0!==b.length&&0!==o.length);)p=b[b.length-1],g=o[o.length-1];var _=Math.max(b.length,o.length);if(0===_){var E=i.split("\n");if(E.length>30)for(E[26]="".concat(x,"...").concat(v);E.length>27;)E.pop();return"".concat(w.notIdentical,"\n\n").concat(E.join("\n"),"\n")}s>3&&(r="\n".concat(x,"...").concat(v).concat(r),n=!0),""!==c&&(r="\n ".concat(c).concat(r),c="");var C=0,M=w[t]+"\n".concat(y,"+ actual").concat(v," ").concat(A,"- expected").concat(v),B=" ".concat(x,"...").concat(v," Lines skipped");for(s=0;s<_;s++){var k=s-d;if(b.length1&&s>2&&(k>4?(f+="\n".concat(x,"...").concat(v),n=!0):k>3&&(f+="\n ".concat(o[s-2]),C++),f+="\n ".concat(o[s-1]),C++),d=s,c+="\n".concat(A,"-").concat(v," ").concat(o[s]),C++;else if(o.length1&&s>2&&(k>4?(f+="\n".concat(x,"...").concat(v),n=!0):k>3&&(f+="\n ".concat(b[s-2]),C++),f+="\n ".concat(b[s-1]),C++),d=s,f+="\n".concat(y,"+").concat(v," ").concat(b[s]),C++;else{var L=o[s],S=b[s],T=S!==L&&(!m(S,",")||S.slice(0,-1)!==L);T&&m(L,",")&&L.slice(0,-1)===S&&(T=!1,S+=","),T?(k>1&&s>2&&(k>4?(f+="\n".concat(x,"...").concat(v),n=!0):k>3&&(f+="\n ".concat(b[s-2]),C++),f+="\n ".concat(b[s-1]),C++),d=s,f+="\n".concat(y,"+").concat(v," ").concat(S),c+="\n".concat(A,"-").concat(v," ").concat(L),C+=2):(f+=c,c="",1!==k&&0!==s||(f+="\n ".concat(S),C++))}if(C>20&&s<_-2)return"".concat(M).concat(B,"\n").concat(f,"\n").concat(x,"...").concat(v).concat(c,"\n")+"".concat(x,"...").concat(v)}return"".concat(M).concat(n?B:"","\n").concat(f).concat(c).concat(r).concat(l)}(d,r,c));else if("notDeepStrictEqual"===c||"notStrictEqual"===c){var s=w[c],l=I(d).split("\n");if("notStrictEqual"===c&&"object"===h(d)&&null!==d&&(s=w.notStrictEqualObject),l.length>30)for(l[26]="".concat(x,"...").concat(v);l.length>27;)l.pop();a=1===l.length?o.call(this,"".concat(s," ").concat(l[0])):o.call(this,"".concat(s,"\n\n").concat(l.join("\n"),"\n"))}else{var u=I(d),p="",C=w[c];"notDeepEqual"===c||"notEqual"===c?(u="".concat(w[c],"\n\n").concat(u)).length>1024&&(u="".concat(u.slice(0,1021),"...")):(p="".concat(I(r)),u.length>512&&(u="".concat(u.slice(0,509),"...")),p.length>512&&(p="".concat(p.slice(0,509),"...")),"deepEqual"===c||"equal"===c?u="".concat(C,"\n\n").concat(u,"\n\nshould equal\n\n"):p=" ".concat(c," ").concat(p)),a=o.call(this,"".concat(u).concat(p))}return Error.stackTraceLimit=b,a.generatedMessage=!t,Object.defineProperty(i(a),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),a.code="ERR_ASSERTION",a.actual=d,a.expected=r,a.operator=c,Error.captureStackTrace&&Error.captureStackTrace(i(a),f),a.stack,a.name="AssertionError",n(a)}return r=E,(b=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:a,value:function(e,a){return p(this,f(f({},a),{},{customInspect:!1,depth:0}))}}])&&d(r.prototype,b),Object.defineProperty(r,"prototype",{writable:!1}),E}(b(Error),p.custom);e.exports=E},69597:(e,a,t)=>{"use strict";function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function f(e,a){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,a){return e.__proto__=a,e},f(e,a)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}var r,n,i={};function b(e,a,t){t||(t=Error);var r=function(t){!function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(a&&a.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),a&&f(e,a)}(o,t);var r,n,i,b=(n=o,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=d(n);if(i){var t=d(this).constructor;e=Reflect.construct(a,arguments,t)}else e=a.apply(this,arguments);return function(e,a){if(a&&("object"===c(a)||"function"==typeof a))return a;if(void 0!==a)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function o(t,c,f){var d;return function(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this,o),d=b.call(this,function(e,t,c){return"string"==typeof a?a:a(e,t,c)}(t,c,f)),d.code=e,d}return r=o,Object.defineProperty(r,"prototype",{writable:!1}),r}(t);i[e]=r}function o(e,a){if(Array.isArray(e)){var t=e.length;return e=e.map((function(e){return String(e)})),t>2?"one of ".concat(a," ").concat(e.slice(0,t-1).join(", "),", or ")+e[t-1]:2===t?"one of ".concat(a," ").concat(e[0]," or ").concat(e[1]):"of ".concat(a," ").concat(e[0])}return"of ".concat(a," ").concat(String(e))}b("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),b("ERR_INVALID_ARG_TYPE",(function(e,a,f){var d,n,i,b,s;if(void 0===r&&(r=t(94148)),r("string"==typeof e,"'name' must be a string"),"string"==typeof a&&(n="not ",a.substr(0,4)===n)?(d="must not be",a=a.replace(/^not /,"")):d="must be",function(e,a,t){return(void 0===t||t>e.length)&&(t=e.length),e.substring(t-9,t)===a}(e," argument"))i="The ".concat(e," ").concat(d," ").concat(o(a,"type"));else{var l=("number"!=typeof s&&(s=0),s+1>(b=e).length||-1===b.indexOf(".",s)?"argument":"property");i='The "'.concat(e,'" ').concat(l," ").concat(d," ").concat(o(a,"type"))}return i+". Received type ".concat(c(f))}),TypeError),b("ERR_INVALID_ARG_VALUE",(function(e,a){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===n&&(n=t(40537));var f=n.inspect(a);return f.length>128&&(f="".concat(f.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(c,". Received ").concat(f)}),TypeError,RangeError),b("ERR_INVALID_RETURN_VALUE",(function(e,a,t){var f;return f=t&&t.constructor&&t.constructor.name?"instance of ".concat(t.constructor.name):"type ".concat(c(t)),"Expected ".concat(e,' to be returned from the "').concat(a,'"')+" function but got ".concat(f,".")}),TypeError),b("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,a=new Array(e),c=0;c0,"At least one arg needs to be specified");var f="The ",d=a.length;switch(a=a.map((function(e){return'"'.concat(e,'"')})),d){case 1:f+="".concat(a[0]," argument");break;case 2:f+="".concat(a[0]," and ").concat(a[1]," arguments");break;default:f+=a.slice(0,d-1).join(", "),f+=", and ".concat(a[d-1]," arguments")}return"".concat(f," must be specified")}),TypeError),e.exports.codes=i},82299:(e,a,t)=>{"use strict";function c(e,a){return function(e){if(Array.isArray(e))return e}(e)||function(e,a){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var c,f,d,r,n=[],i=!0,b=!1;try{if(d=(t=t.call(e)).next,0===a){if(Object(t)!==t)return;i=!1}else for(;!(i=(c=d.call(t)).done)&&(n.push(c.value),n.length!==a);i=!0);}catch(e){b=!0,f=e}finally{try{if(!i&&null!=t.return&&(r=t.return(),Object(r)!==r))return}finally{if(b)throw f}}return n}}(e,a)||function(e,a){if(e){if("string"==typeof e)return f(e,a);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?f(e,a):void 0}}(e,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,a){(null==a||a>e.length)&&(a=e.length);for(var t=0,c=new Array(a);t10)return!0;for(var a=0;a57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function N(e){return Object.keys(e).filter(T).concat(o(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function R(e,a){if(e===a)return 0;for(var t=e.length,c=a.length,f=0,d=Math.min(t,c);f{const c=t(36209),f=t(10943),d=t(51847),r=t(86679),n=t(65435),i=255===new Uint8Array(Uint16Array.of(255).buffer)[0];function b(e){switch(e){case"ascii":return c;case"base64":return f;case"hex":return d;case"utf8":case"utf-8":case void 0:return r;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n;default:throw new Error(`Unknown encoding: ${e}`)}}function o(e){return e instanceof Uint8Array}function s(e,a,t){return"string"==typeof e?function(e,a){const t=b(a),c=new Uint8Array(t.byteLength(e));return t.write(c,e,0,c.byteLength),c}(e,a):Array.isArray(e)?function(e){const a=new Uint8Array(e.length);return a.set(e),a}(e):ArrayBuffer.isView(e)?function(e){const a=new Uint8Array(e.byteLength);return a.set(e),a}(e):function(e,a,t){return new Uint8Array(e,a,t)}(e,a,t)}function l(e,a,t,c,f){if(0===e.byteLength)return-1;if("string"==typeof t?(c=t,t=0):void 0===t?t=f?0:e.length-1:t<0&&(t+=e.byteLength),t>=e.byteLength){if(f)return-1;t=e.byteLength-1}else if(t<0){if(!f)return-1;t=0}if("string"==typeof a)a=s(a,c);else if("number"==typeof a)return a&=255,f?e.indexOf(a,t):e.lastIndexOf(a,t);if(0===a.byteLength)return-1;if(f){let c=-1;for(let f=t;fe.byteLength&&(t=e.byteLength-a.byteLength);for(let c=t;c>=0;c--){let t=!0;for(let f=0;ff)return 1}return e.byteLength>a.byteLength?1:e.byteLengthe+a.byteLength),0));const t=new Uint8Array(a);let c=0;for(const a of e){if(c+a.byteLength>t.byteLength){const e=a.subarray(0,t.byteLength-c);return t.set(e,c),t}t.set(a,c),c+=a.byteLength}return t},copy:function(e,a,t=0,c=0,f=e.byteLength){if(f>0&&f=e.byteLength)throw new RangeError("sourceStart is out of range");if(f<0)throw new RangeError("sourceEnd is out of range");t>=a.byteLength&&(t=a.byteLength),f>e.byteLength&&(f=e.byteLength),a.byteLength-t=f||c<=t?"":(t<0&&(t=0),c>f&&(c=f),(0!==t||c{function a(e){return e.length}e.exports={byteLength:a,toString:function(e){const a=e.byteLength;let t="";for(let c=0;c{const a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=new Uint8Array(256);for(let e=0;e<64;e++)t[a.charCodeAt(e)]=e;function c(e){let a=e.length;return 61===e.charCodeAt(a-1)&&a--,a>1&&61===e.charCodeAt(a-1)&&a--,3*a>>>2}t[45]=62,t[95]=63,e.exports={byteLength:c,toString:function(e){const t=e.byteLength;let c="";for(let f=0;f>2]+a[(3&e[f])<<4|e[f+1]>>4]+a[(15&e[f+1])<<2|e[f+2]>>6]+a[63&e[f+2]];return t%3==2?c=c.substring(0,c.length-1)+"=":t%3==1&&(c=c.substring(0,c.length-2)+"=="),c},write:function(e,a,f=0,d=c(a)){const r=Math.min(d,e.byteLength-f);for(let c=0,f=0;f>4,e[f++]=(15&r)<<4|n>>2,e[f++]=(3&n)<<6|63&i}return r}}},51847:e=>{function a(e){return e.length>>>1}function t(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:void 0}e.exports={byteLength:a,toString:function(e){const a=e.byteLength;e=new DataView(e.buffer,e.byteOffset,a);let t="",c=0;for(let f=a-a%4;c{function a(e){return 2*e.length}e.exports={byteLength:a,toString:function(e){const a=e.byteLength;let t="";for(let c=0;c>8,r=f%256;e[c+2*a]=r,e[c+2*a+1]=d}return d}}},86679:e=>{function a(e){let a=0;for(let t=0,c=e.length;t=55296&&f<=56319&&t+1=56320&&c<=57343){a+=4,t++;continue}}a+=f<=127?1:f<=2047?2:3}return a}let t,c;if("undefined"!=typeof TextDecoder){const e=new TextDecoder;t=function(a){return e.decode(a)}}else t=function(e){const a=e.byteLength;let t="",c=0;for(;c0){let a=0;for(;a>c,c-=6;c>=0;)e[n++]=128|a>>c&63,c-=6;r+=a>=65536?2:1}return d};e.exports={byteLength:a,toString:t,write:c}},95364:(e,a,t)=>{"use strict";var c=t(92861).Buffer;e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var a=new Uint8Array(256),t=0;t>>0,o=new Uint8Array(r);t>>0,o[u]=s%256>>>0,s=s/256>>>0;if(0!==s)throw new Error("Non-zero carry");d=l,t++}for(var h=r-d;h!==r&&0===o[h];)h++;var p=c.allocUnsafe(f+(r-h));p.fill(0,0,f);for(var g=f;h!==r;)p[g++]=o[h++];return p}return{encode:function(a){if((Array.isArray(a)||a instanceof Uint8Array)&&(a=c.from(a)),!c.isBuffer(a))throw new TypeError("Expected Buffer");if(0===a.length)return"";for(var t=0,f=0,d=0,r=a.length;d!==r&&0===a[d];)d++,t++;for(var b=(r-d)*o+1>>>0,s=new Uint8Array(b);d!==r;){for(var l=a[d],u=0,h=b-1;(0!==l||u>>0,s[h]=l%n>>>0,l=l/n>>>0;if(0!==l)throw new Error("Non-zero carry");f=u,d++}for(var p=b-f;p!==b&&0===s[p];)p++;for(var g=i.repeat(t);p{"use strict";a.byteLength=function(e){var a=n(e),t=a[0],c=a[1];return 3*(t+c)/4-c},a.toByteArray=function(e){var a,t,d=n(e),r=d[0],i=d[1],b=new f(function(e,a,t){return 3*(a+t)/4-t}(0,r,i)),o=0,s=i>0?r-4:r;for(t=0;t>16&255,b[o++]=a>>8&255,b[o++]=255&a;return 2===i&&(a=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,b[o++]=255&a),1===i&&(a=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,b[o++]=a>>8&255,b[o++]=255&a),b},a.fromByteArray=function(e){for(var a,c=e.length,f=c%3,d=[],r=16383,n=0,b=c-f;nb?b:n+r));return 1===f?(a=e[c-1],d.push(t[a>>2]+t[a<<4&63]+"==")):2===f&&(a=(e[c-2]<<8)+e[c-1],d.push(t[a>>10]+t[a>>4&63]+t[a<<2&63]+"=")),d.join("")};for(var t=[],c=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0;r<64;++r)t[r]=d[r],c[d.charCodeAt(r)]=r;function n(e){var a=e.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");return-1===t&&(t=a),[t,t===a?0:4-t%4]}function i(e,a,c){for(var f,d,r=[],n=a;n>18&63]+t[d>>12&63]+t[d>>6&63]+t[63&d]);return r.join("")}c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},92096:(e,a,t)=>{var c;e=t.nmd(e);var f=function(e){"use strict";var a=1e7,t=9007199254740992,c=l(t),d="0123456789abcdefghijklmnopqrstuvwxyz",r="function"==typeof BigInt;function n(e,a,t,c){return void 0===e?n[0]:void 0===a||10==+a&&!t?Z(e):$(e,a,t,c)}function i(e,a){this.value=e,this.sign=a,this.isSmall=!1}function b(e){this.value=e,this.sign=e<0,this.isSmall=!0}function o(e){this.value=e}function s(e){return-t0?Math.floor(e):Math.ceil(e)}function m(e,t){var c,f,d=e.length,r=t.length,n=new Array(d),i=0,b=a;for(f=0;f=b?1:0,n[f]=c-i*b;for(;f0&&n.push(i),n}function x(e,a){return e.length>=a.length?m(e,a):m(a,e)}function y(e,t){var c,f,d=e.length,r=new Array(d),n=a;for(f=0;f0;)r[f++]=t%n,t=Math.floor(t/n);return r}function A(e,t){var c,f,d=e.length,r=t.length,n=new Array(d),i=0,b=a;for(c=0;c0;)r[f++]=i%n,i=Math.floor(i/n);return r}function I(e,a){for(var t=[];a-- >0;)t.push(0);return t.concat(e)}function E(e,a){var t=Math.max(e.length,a.length);if(t<=30)return w(e,a);t=Math.ceil(t/2);var c=e.slice(t),f=e.slice(0,t),d=a.slice(t),r=a.slice(0,t),n=E(f,r),i=E(c,d),b=E(x(f,c),x(r,d)),o=x(x(n,I(A(A(b,n),i),t)),I(i,2*t));return h(o),o}function C(e,t,c){return new i(e=0;--c)d=(r=d*b+e[c])-(f=g(r/t))*t,i[c]=0|f;return[i,0|d]}function k(e,t){var c,f=Z(t);if(r)return[new o(e.value/f.value),new o(e.value%f.value)];var d,s=e.value,m=f.value;if(0===m)throw new Error("Cannot divide by zero");if(e.isSmall)return f.isSmall?[new b(g(s/m)),new b(s%m)]:[n[0],e];if(f.isSmall){if(1===m)return[e,n[0]];if(-1==m)return[e.negate(),n[0]];var x=Math.abs(m);if(x=0;f--){for(c=l-1,x[f+s]!==g&&(c=Math.floor((x[f+s]*l+x[f+s-1])/g)),d=0,r=0,i=y.length,n=0;nb&&(d=(d+1)*l),c=Math.ceil(d/r);do{if(L(n=_(t,c),s)<=0)break;c--}while(c);o.push(c),s=A(s,n)}return o.reverse(),[u(o),u(s)]}(s,m),d=c[0];var w=e.sign!==f.sign,I=c[1],E=e.sign;return"number"==typeof d?(w&&(d=-d),d=new b(d)):d=new i(d,w),"number"==typeof I?(E&&(I=-I),I=new b(I)):I=new i(I,E),[d,I]}function L(e,a){if(e.length!==a.length)return e.length>a.length?1:-1;for(var t=e.length-1;t>=0;t--)if(e[t]!==a[t])return e[t]>a[t]?1:-1;return 0}function S(e){var a=e.abs();return!a.isUnit()&&(!!(a.equals(2)||a.equals(3)||a.equals(5))||!(a.isEven()||a.isDivisibleBy(3)||a.isDivisibleBy(5))&&(!!a.lesser(49)||void 0))}function T(e,a){for(var t,c,d,r=e.prev(),n=r,i=0;n.isEven();)n=n.divide(2),i++;e:for(c=0;c=0?c=A(e,a):(c=A(a,e),t=!t),"number"==typeof(c=u(c))?(t&&(c=-c),new b(c)):new i(c,t)}(t,c,this.sign)},i.prototype.minus=i.prototype.subtract,b.prototype.subtract=function(e){var a=Z(e),t=this.value;if(t<0!==a.sign)return this.add(a.negate());var c=a.value;return a.isSmall?new b(t-c):v(c,Math.abs(t),t>=0)},b.prototype.minus=b.prototype.subtract,o.prototype.subtract=function(e){return new o(this.value-Z(e).value)},o.prototype.minus=o.prototype.subtract,i.prototype.negate=function(){return new i(this.value,!this.sign)},b.prototype.negate=function(){var e=this.sign,a=new b(-this.value);return a.sign=!e,a},o.prototype.negate=function(){return new o(-this.value)},i.prototype.abs=function(){return new i(this.value,!1)},b.prototype.abs=function(){return new b(Math.abs(this.value))},o.prototype.abs=function(){return new o(this.value>=0?this.value:-this.value)},i.prototype.multiply=function(e){var t,c,f,d=Z(e),r=this.value,b=d.value,o=this.sign!==d.sign;if(d.isSmall){if(0===b)return n[0];if(1===b)return this;if(-1===b)return this.negate();if((t=Math.abs(b))0?E(r,b):w(r,b),o)},i.prototype.times=i.prototype.multiply,b.prototype._multiplyBySmall=function(e){return s(e.value*this.value)?new b(e.value*this.value):C(Math.abs(e.value),l(Math.abs(this.value)),this.sign!==e.sign)},i.prototype._multiplyBySmall=function(e){return 0===e.value?n[0]:1===e.value?this:-1===e.value?this.negate():C(Math.abs(e.value),this.value,this.sign!==e.sign)},b.prototype.multiply=function(e){return Z(e)._multiplyBySmall(this)},b.prototype.times=b.prototype.multiply,o.prototype.multiply=function(e){return new o(this.value*Z(e).value)},o.prototype.times=o.prototype.multiply,i.prototype.square=function(){return new i(M(this.value),!1)},b.prototype.square=function(){var e=this.value*this.value;return s(e)?new b(e):new i(M(l(Math.abs(this.value))),!1)},o.prototype.square=function(e){return new o(this.value*this.value)},i.prototype.divmod=function(e){var a=k(this,e);return{quotient:a[0],remainder:a[1]}},o.prototype.divmod=b.prototype.divmod=i.prototype.divmod,i.prototype.divide=function(e){return k(this,e)[0]},o.prototype.over=o.prototype.divide=function(e){return new o(this.value/Z(e).value)},b.prototype.over=b.prototype.divide=i.prototype.over=i.prototype.divide,i.prototype.mod=function(e){return k(this,e)[1]},o.prototype.mod=o.prototype.remainder=function(e){return new o(this.value%Z(e).value)},b.prototype.remainder=b.prototype.mod=i.prototype.remainder=i.prototype.mod,i.prototype.pow=function(e){var a,t,c,f=Z(e),d=this.value,r=f.value;if(0===r)return n[1];if(0===d)return n[0];if(1===d)return n[1];if(-1===d)return f.isEven()?n[1]:n[-1];if(f.sign)return n[0];if(!f.isSmall)throw new Error("The exponent "+f.toString()+" is too large.");if(this.isSmall&&s(a=Math.pow(d,r)))return new b(g(a));for(t=this,c=n[1];!0&r&&(c=c.times(t),--r),0!==r;)r/=2,t=t.square();return c},b.prototype.pow=i.prototype.pow,o.prototype.pow=function(e){var a=Z(e),t=this.value,c=a.value,f=BigInt(0),d=BigInt(1),r=BigInt(2);if(c===f)return n[1];if(t===f)return n[0];if(t===d)return n[1];if(t===BigInt(-1))return a.isEven()?n[1]:n[-1];if(a.isNegative())return new o(f);for(var i=this,b=n[1];(c&d)===d&&(b=b.times(i),--c),c!==f;)c/=r,i=i.square();return b},i.prototype.modPow=function(e,a){if(e=Z(e),(a=Z(a)).isZero())throw new Error("Cannot take modPow with modulus 0");var t=n[1],c=this.mod(a);for(e.isNegative()&&(e=e.multiply(n[-1]),c=c.modInv(a));e.isPositive();){if(c.isZero())return n[0];e.isOdd()&&(t=t.multiply(c).mod(a)),e=e.divide(2),c=c.square().mod(a)}return t},o.prototype.modPow=b.prototype.modPow=i.prototype.modPow,i.prototype.compareAbs=function(e){var a=Z(e),t=this.value,c=a.value;return a.isSmall?1:L(t,c)},b.prototype.compareAbs=function(e){var a=Z(e),t=Math.abs(this.value),c=a.value;return a.isSmall?t===(c=Math.abs(c))?0:t>c?1:-1:-1},o.prototype.compareAbs=function(e){var a=this.value,t=Z(e).value;return(a=a>=0?a:-a)===(t=t>=0?t:-t)?0:a>t?1:-1},i.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var a=Z(e),t=this.value,c=a.value;return this.sign!==a.sign?a.sign?1:-1:a.isSmall?this.sign?-1:1:L(t,c)*(this.sign?-1:1)},i.prototype.compareTo=i.prototype.compare,b.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var a=Z(e),t=this.value,c=a.value;return a.isSmall?t==c?0:t>c?1:-1:t<0!==a.sign?t<0?-1:1:t<0?1:-1},b.prototype.compareTo=b.prototype.compare,o.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var a=this.value,t=Z(e).value;return a===t?0:a>t?1:-1},o.prototype.compareTo=o.prototype.compare,i.prototype.equals=function(e){return 0===this.compare(e)},o.prototype.eq=o.prototype.equals=b.prototype.eq=b.prototype.equals=i.prototype.eq=i.prototype.equals,i.prototype.notEquals=function(e){return 0!==this.compare(e)},o.prototype.neq=o.prototype.notEquals=b.prototype.neq=b.prototype.notEquals=i.prototype.neq=i.prototype.notEquals,i.prototype.greater=function(e){return this.compare(e)>0},o.prototype.gt=o.prototype.greater=b.prototype.gt=b.prototype.greater=i.prototype.gt=i.prototype.greater,i.prototype.lesser=function(e){return this.compare(e)<0},o.prototype.lt=o.prototype.lesser=b.prototype.lt=b.prototype.lesser=i.prototype.lt=i.prototype.lesser,i.prototype.greaterOrEquals=function(e){return this.compare(e)>=0},o.prototype.geq=o.prototype.greaterOrEquals=b.prototype.geq=b.prototype.greaterOrEquals=i.prototype.geq=i.prototype.greaterOrEquals,i.prototype.lesserOrEquals=function(e){return this.compare(e)<=0},o.prototype.leq=o.prototype.lesserOrEquals=b.prototype.leq=b.prototype.lesserOrEquals=i.prototype.leq=i.prototype.lesserOrEquals,i.prototype.isEven=function(){return!(1&this.value[0])},b.prototype.isEven=function(){return!(1&this.value)},o.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)},i.prototype.isOdd=function(){return!(1&~this.value[0])},b.prototype.isOdd=function(){return!(1&~this.value)},o.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)},i.prototype.isPositive=function(){return!this.sign},b.prototype.isPositive=function(){return this.value>0},o.prototype.isPositive=b.prototype.isPositive,i.prototype.isNegative=function(){return this.sign},b.prototype.isNegative=function(){return this.value<0},o.prototype.isNegative=b.prototype.isNegative,i.prototype.isUnit=function(){return!1},b.prototype.isUnit=function(){return 1===Math.abs(this.value)},o.prototype.isUnit=function(){return this.abs().value===BigInt(1)},i.prototype.isZero=function(){return!1},b.prototype.isZero=function(){return 0===this.value},o.prototype.isZero=function(){return this.value===BigInt(0)},i.prototype.isDivisibleBy=function(e){var a=Z(e);return!a.isZero()&&(!!a.isUnit()||(0===a.compareAbs(2)?this.isEven():this.mod(a).isZero()))},o.prototype.isDivisibleBy=b.prototype.isDivisibleBy=i.prototype.isDivisibleBy,i.prototype.isPrime=function(a){var t=S(this);if(t!==e)return t;var c=this.abs(),d=c.bitLength();if(d<=64)return T(c,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var r=Math.log(2)*d.toJSNumber(),n=Math.ceil(!0===a?2*Math.pow(r,2):r),i=[],b=0;b-t?new b(e-1):new i(c,!0)},o.prototype.prev=function(){return new o(this.value-BigInt(1))};for(var N=[1];2*N[N.length-1]<=a;)N.push(2*N[N.length-1]);var R=N.length,P=N[R-1];function D(e){return Math.abs(e)<=a}function O(e,a,t){a=Z(a);for(var c=e.isNegative(),d=a.isNegative(),r=c?e.not():e,n=d?a.not():a,i=0,b=0,o=null,s=null,l=[];!r.isZero()||!n.isZero();)i=(o=k(r,P))[1].toJSNumber(),c&&(i=P-1-i),b=(s=k(n,P))[1].toJSNumber(),d&&(b=P-1-b),r=o[0],n=s[0],l.push(t(i,b));for(var u=0!==t(c?1:0,d?1:0)?f(-1):f(0),h=l.length-1;h>=0;h-=1)u=u.multiply(P).add(f(l[h]));return u}i.prototype.shiftLeft=function(e){var a=Z(e).toJSNumber();if(!D(a))throw new Error(String(a)+" is too large for shifting.");if(a<0)return this.shiftRight(-a);var t=this;if(t.isZero())return t;for(;a>=R;)t=t.multiply(P),a-=R-1;return t.multiply(N[a])},o.prototype.shiftLeft=b.prototype.shiftLeft=i.prototype.shiftLeft,i.prototype.shiftRight=function(e){var a,t=Z(e).toJSNumber();if(!D(t))throw new Error(String(t)+" is too large for shifting.");if(t<0)return this.shiftLeft(-t);for(var c=this;t>=R;){if(c.isZero()||c.isNegative()&&c.isUnit())return c;c=(a=k(c,P))[1].isNegative()?a[0].prev():a[0],t-=R-1}return(a=k(c,N[t]))[1].isNegative()?a[0].prev():a[0]},o.prototype.shiftRight=b.prototype.shiftRight=i.prototype.shiftRight,i.prototype.not=function(){return this.negate().prev()},o.prototype.not=b.prototype.not=i.prototype.not,i.prototype.and=function(e){return O(this,e,(function(e,a){return e&a}))},o.prototype.and=b.prototype.and=i.prototype.and,i.prototype.or=function(e){return O(this,e,(function(e,a){return e|a}))},o.prototype.or=b.prototype.or=i.prototype.or,i.prototype.xor=function(e){return O(this,e,(function(e,a){return e^a}))},o.prototype.xor=b.prototype.xor=i.prototype.xor;var F=1<<30;function Q(e){var t=e.value,c="number"==typeof t?t|F:"bigint"==typeof t?t|BigInt(F):t[0]+t[1]*a|1073758208;return c&-c}function U(e,a){if(a.compareTo(e)<=0){var t=U(e,a.square(a)),c=t.p,d=t.e,r=c.multiply(a);return r.compareTo(e)<=0?{p:r,e:2*d+1}:{p:c,e:2*d}}return{p:f(1),e:0}}function j(e,a){return e=Z(e),a=Z(a),e.greater(a)?e:a}function H(e,a){return e=Z(e),a=Z(a),e.lesser(a)?e:a}function q(e,a){if(e=Z(e).abs(),a=Z(a).abs(),e.equals(a))return e;if(e.isZero())return a;if(a.isZero())return e;for(var t,c,f=n[1];e.isEven()&&a.isEven();)t=H(Q(e),Q(a)),e=e.divide(t),a=a.divide(t),f=f.multiply(t);for(;e.isEven();)e=e.divide(Q(e));do{for(;a.isEven();)a=a.divide(Q(a));e.greater(a)&&(c=a,a=e,e=c),a=a.subtract(e)}while(!a.isZero());return f.isUnit()?e:e.multiply(f)}i.prototype.bitLength=function(){var e=this;return e.compareTo(f(0))<0&&(e=e.negate().subtract(f(1))),0===e.compareTo(f(0))?f(0):f(U(e,f(2)).e).add(f(1))},o.prototype.bitLength=b.prototype.bitLength=i.prototype.bitLength;var $=function(e,a,t,c){t=t||d,e=String(e),c||(e=e.toLowerCase(),t=t.toLowerCase());var f,r=e.length,n=Math.abs(a),i={};for(f=0;f=n){if("1"===s&&1===n)continue;throw new Error(s+" is not a valid digit in base "+a+".")}a=Z(a);var b=[],o="-"===e[0];for(f=o?1:0;f"!==e[f]&&f=0;c--)f=f.add(e[c].times(d)),d=d.times(a);return t?f.negate():f}function G(e,a){if((a=f(a)).isZero()){if(e.isZero())return{value:[0],isNegative:!1};throw new Error("Cannot convert nonzero numbers to base 0.")}if(a.equals(-1)){if(e.isZero())return{value:[0],isNegative:!1};if(e.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-e.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var t=Array.apply(null,Array(e.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);return t.unshift([1]),{value:[].concat.apply([],t),isNegative:!1}}var c=!1;if(e.isNegative()&&a.isPositive()&&(c=!0,e=e.abs()),a.isUnit())return e.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(e.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:c};for(var d,r=[],n=e;n.isNegative()||n.compareAbs(a)>=0;){d=n.divmod(a),n=d.quotient;var i=d.remainder;i.isNegative()&&(i=a.minus(i).abs(),n=n.next()),r.push(i.toJSNumber())}return r.push(n.toJSNumber()),{value:r.reverse(),isNegative:c}}function K(e,a,t){var c=G(e,a);return(c.isNegative?"-":"")+c.value.map((function(e){return function(e,a){return e<(a=a||d).length?a[e]:"<"+e+">"}(e,t)})).join("")}function V(e){if(s(+e)){var a=+e;if(a===g(a))return r?new o(BigInt(a)):new b(a);throw new Error("Invalid integer: "+e)}var t="-"===e[0];t&&(e=e.slice(1));var c=e.split(/e/i);if(c.length>2)throw new Error("Invalid integer: "+c.join("e"));if(2===c.length){var f=c[1];if("+"===f[0]&&(f=f.slice(1)),(f=+f)!==g(f)||!s(f))throw new Error("Invalid integer: "+f+" is not a valid exponent.");var d=c[0],n=d.indexOf(".");if(n>=0&&(f-=d.length-n-1,d=d.slice(0,n)+d.slice(n+1)),f<0)throw new Error("Cannot include negative exponent part for integers");e=d+=new Array(f+1).join("0")}if(!/^([0-9][0-9]*)$/.test(e))throw new Error("Invalid integer: "+e);if(r)return new o(BigInt(t?"-"+e:e));for(var l=[],u=e.length,p=u-7;u>0;)l.push(+e.slice(p,u)),(p-=7)<0&&(p=0),u-=7;return h(l),new i(l,t)}function Z(e){return"number"==typeof e?function(e){if(r)return new o(BigInt(e));if(s(e)){if(e!==g(e))throw new Error(e+" is not an integer.");return new b(e)}return V(e.toString())}(e):"string"==typeof e?V(e):"bigint"==typeof e?new o(e):e}i.prototype.toArray=function(e){return G(this,e)},b.prototype.toArray=function(e){return G(this,e)},o.prototype.toArray=function(e){return G(this,e)},i.prototype.toString=function(a,t){if(a===e&&(a=10),10!==a||t)return K(this,a,t);for(var c,f=this.value,d=f.length,r=String(f[--d]);--d>=0;)c=String(f[d]),r+="0000000".slice(c.length)+c;return(this.sign?"-":"")+r},b.prototype.toString=function(a,t){return a===e&&(a=10),10!=a||t?K(this,a,t):String(this.value)},o.prototype.toString=b.prototype.toString,o.prototype.toJSON=i.prototype.toJSON=b.prototype.toJSON=function(){return this.toString()},i.prototype.valueOf=function(){return parseInt(this.toString(),10)},i.prototype.toJSNumber=i.prototype.valueOf,b.prototype.valueOf=function(){return this.value},b.prototype.toJSNumber=b.prototype.valueOf,o.prototype.valueOf=o.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};for(var J=0;J<1e3;J++)n[J]=Z(J),J>0&&(n[-J]=Z(-J));return n.one=n[1],n.zero=n[0],n.minusOne=n[-1],n.max=j,n.min=H,n.gcd=q,n.lcm=function(e,a){return e=Z(e).abs(),a=Z(a).abs(),e.divide(q(e,a)).multiply(a)},n.isInstance=function(e){return e instanceof i||e instanceof b||e instanceof o},n.randBetween=function(e,t,c){e=Z(e),t=Z(t);var f=c||Math.random,d=H(e,t),r=j(e,t).subtract(d).add(1);if(r.isSmall)return d.add(Math.floor(f()*r));for(var i=G(r,a).value,b=[],o=!0,s=0;s{e.exports=t(85702)(t(86989))},4315:(e,a,t)=>{var c=t(62045).hp;const f=t(28399).Transform;e.exports=class extends f{constructor(e,a){super(a),this._engine=e,this._finalized=!1}_transform(e,a,t){let c=null;try{this.update(e,a)}catch(e){c=e}t(c)}_flush(e){let a=null;try{this.push(this.digest())}catch(e){a=e}e(a)}update(e,a){if(!c.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return c.isBuffer(e)||(e=c.from(e,a)),this._engine.update(e),this}digest(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;let a=this._engine.digest();return void 0!==e&&(a=a.toString(e)),a}}},85702:(e,a,t)=>{const c=t(4315);e.exports=e=>(a,t)=>{const f=(a=>{switch("string"==typeof a?a.toLowerCase():a){case"blake224":return e.Blake224;case"blake256":return e.Blake256;case"blake384":return e.Blake384;case"blake512":return e.Blake512;default:throw new Error("Invald algorithm: "+a)}})(a);return new c(new f,t)}},34588:(e,a,t)=>{var c=t(62045).hp;class f{_lengthCarry(e){for(let a=0;a=a.length;){for(let c=this._blockOffset;c{var c=t(62045).hp;const f=t(23287),d=c.from([0]),r=c.from([128]);e.exports=class extends f{constructor(){super(),this._h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],this._zo=d,this._oo=r}digest(){this._padding();const e=c.alloc(28);for(let a=0;a<7;++a)e.writeUInt32BE(this._h[a],4*a);return e}}},23287:(e,a,t)=>{var c=t(62045).hp;const f=t(34588),d=c.from([1]),r=c.from([129]),n=(e,a)=>(e<<32-a|e>>>a)>>>0;function i(e,a,t,c,d,r,i,b){const o=f.sigma,s=f.u256;e[c]=e[c]+((a[o[t][b]]^s[o[t][b+1]])>>>0)+e[d]>>>0,e[i]=n(e[i]^e[c],16),e[r]=e[r]+e[i]>>>0,e[d]=n(e[d]^e[r],12),e[c]=e[c]+((a[o[t][b+1]]^s[o[t][b]])>>>0)+e[d]>>>0,e[i]=n(e[i]^e[c],8),e[r]=e[r]+e[i]>>>0,e[d]=n(e[d]^e[r],7)}e.exports=class extends f{constructor(){super(),this._h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this._s=[0,0,0,0],this._block=c.alloc(64),this._blockOffset=0,this._length=[0,0],this._nullt=!1,this._zo=d,this._oo=r}_compress(){const e=f.u256,a=new Array(16),t=new Array(16);let c;for(c=0;c<16;++c)t[c]=this._block.readUInt32BE(4*c);for(c=0;c<8;++c)a[c]=this._h[c]>>>0;for(c=8;c<12;++c)a[c]=(this._s[c-8]^e[c-8])>>>0;for(c=12;c<16;++c)a[c]=e[c-8];for(this._nullt||(a[12]=(a[12]^this._length[0])>>>0,a[13]=(a[13]^this._length[0])>>>0,a[14]=(a[14]^this._length[1])>>>0,a[15]=(a[15]^this._length[1])>>>0),c=0;c<14;++c)i(a,t,c,0,4,8,12,0),i(a,t,c,1,5,9,13,2),i(a,t,c,2,6,10,14,4),i(a,t,c,3,7,11,15,6),i(a,t,c,0,5,10,15,8),i(a,t,c,1,6,11,12,10),i(a,t,c,2,7,8,13,12),i(a,t,c,3,4,9,14,14);for(c=0;c<16;++c)this._h[c%8]=(this._h[c%8]^a[c])>>>0;for(c=0;c<8;++c)this._h[c]=(this._h[c]^this._s[c%4])>>>0}_padding(){let e=this._length[0]+8*this._blockOffset,a=this._length[1];e>=4294967296&&(e-=4294967296,a+=1);const t=c.alloc(8);t.writeUInt32BE(a,0),t.writeUInt32BE(e,4),55===this._blockOffset?(this._length[0]-=8,this.update(this._oo)):(this._blockOffset<55?(0===this._blockOffset&&(this._nullt=!0),this._length[0]-=8*(55-this._blockOffset),this.update(f.padding.slice(0,55-this._blockOffset))):(this._length[0]-=8*(64-this._blockOffset),this.update(f.padding.slice(0,64-this._blockOffset)),this._length[0]-=440,this.update(f.padding.slice(1,56)),this._nullt=!0),this.update(this._zo),this._length[0]-=8),this._length[0]-=64,this.update(t)}digest(){this._padding();const e=c.alloc(32);for(let a=0;a<8;++a)e.writeUInt32BE(this._h[a],4*a);return e}}},399:(e,a,t)=>{var c=t(62045).hp;const f=t(61070),d=c.from([0]),r=c.from([128]);e.exports=class extends f{constructor(){super(),this._h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428],this._zo=d,this._oo=r}digest(){this._padding();const e=c.alloc(48);for(let a=0;a<12;++a)e.writeUInt32BE(this._h[a],4*a);return e}}},61070:(e,a,t)=>{var c=t(62045).hp;const f=t(34588),d=c.from([1]),r=c.from([129]);function n(e,a,t,c){let f=e[2*a]^e[2*t],d=e[2*a+1]^e[2*t+1];c>=32&&(d^=f,f^=d,d^=f,c-=32),0===c?(e[2*a]=f>>>0,e[2*a+1]=d>>>0):(e[2*a]=(f>>>c|d<<32-c)>>>0,e[2*a+1]=(d>>>c|f<<32-c)>>>0)}function i(e,a,t,c,d,r,i,b){const o=f.sigma,s=f.u512;let l;l=e[2*c+1]+((a[2*o[t][b]+1]^s[2*o[t][b+1]+1])>>>0)+e[2*d+1],e[2*c]=e[2*c]+((a[2*o[t][b]]^s[2*o[t][b+1]])>>>0)+e[2*d]+~~(l/4294967296)>>>0,e[2*c+1]=l>>>0,n(e,i,c,32),l=e[2*r+1]+e[2*i+1],e[2*r]=e[2*r]+e[2*i]+~~(l/4294967296)>>>0,e[2*r+1]=l>>>0,n(e,d,r,25),l=e[2*c+1]+((a[2*o[t][b+1]+1]^s[2*o[t][b]+1])>>>0)+e[2*d+1],e[2*c]=e[2*c]+((a[2*o[t][b+1]]^s[2*o[t][b]])>>>0)+e[2*d]+~~(l/4294967296)>>>0,e[2*c+1]=l>>>0,n(e,i,c,16),l=e[2*r+1]+e[2*i+1],e[2*r]=e[2*r]+e[2*i]+~~(l/4294967296)>>>0,e[2*r+1]=l>>>0,n(e,d,r,11)}e.exports=class extends f{constructor(){super(),this._h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this._s=[0,0,0,0,0,0,0,0],this._block=c.alloc(128),this._blockOffset=0,this._length=[0,0,0,0],this._nullt=!1,this._zo=d,this._oo=r}_compress(){const e=f.u512,a=new Array(32),t=new Array(32);let c;for(c=0;c<32;++c)t[c]=this._block.readUInt32BE(4*c);for(c=0;c<16;++c)a[c]=this._h[c]>>>0;for(c=16;c<24;++c)a[c]=(this._s[c-16]^e[c-16])>>>0;for(c=24;c<32;++c)a[c]=e[c-16];for(this._nullt||(a[24]=(a[24]^this._length[1])>>>0,a[25]=(a[25]^this._length[0])>>>0,a[26]=(a[26]^this._length[1])>>>0,a[27]=(a[27]^this._length[0])>>>0,a[28]=(a[28]^this._length[3])>>>0,a[29]=(a[29]^this._length[2])>>>0,a[30]=(a[30]^this._length[3])>>>0,a[31]=(a[31]^this._length[2])>>>0),c=0;c<16;++c)i(a,t,c,0,4,8,12,0),i(a,t,c,1,5,9,13,2),i(a,t,c,2,6,10,14,4),i(a,t,c,3,7,11,15,6),i(a,t,c,0,5,10,15,8),i(a,t,c,1,6,11,12,10),i(a,t,c,2,7,8,13,12),i(a,t,c,3,4,9,14,14);for(c=0;c<16;++c)this._h[c%8*2]=(this._h[c%8*2]^a[2*c])>>>0,this._h[c%8*2+1]=(this._h[c%8*2+1]^a[2*c+1])>>>0;for(c=0;c<8;++c)this._h[2*c]=(this._h[2*c]^this._s[c%4*2])>>>0,this._h[2*c+1]=(this._h[2*c+1]^this._s[c%4*2+1])>>>0}_padding(){const e=this._length.slice();e[0]+=8*this._blockOffset,this._lengthCarry(e);const a=c.alloc(16);for(let t=0;t<4;++t)a.writeUInt32BE(e[3-t],4*t);111===this._blockOffset?(this._length[0]-=8,this.update(this._oo)):(this._blockOffset<111?(0===this._blockOffset&&(this._nullt=!0),this._length[0]-=8*(111-this._blockOffset),this.update(f.padding.slice(0,111-this._blockOffset))):(this._length[0]-=8*(128-this._blockOffset),this.update(f.padding.slice(0,128-this._blockOffset)),this._length[0]-=888,this.update(f.padding.slice(1,112)),this._nullt=!0),this.update(this._zo),this._length[0]-=8),this._length[0]-=128,this.update(a)}digest(){this._padding();const e=c.alloc(64);for(let a=0;a<16;++a)e.writeUInt32BE(this._h[a],4*a);return e}}},86989:(e,a,t)=>{e.exports={Blake224:t(48746),Blake256:t(23287),Blake384:t(399),Blake512:t(61070)}},91892:e=>{var a,t,c=(()=>{for(var e=new Uint8Array(128),a=0;a<64;a++)e[a<26?a+65:a<52?a+71:a<62?a-4:4*a-205]=a;return a=>{for(var t=a.length,c=new Uint8Array(3*(t-("="==a[t-1])-("="==a[t-2]))/4|0),f=0,d=0;f>4,c[d++]=n<<4|i>>2,c[d++]=i<<6|b}return c}})(),f=(a={"wasm-binary:./blake2b.wat"(e,a){a.exports=c("AGFzbQEAAAABEANgAn9/AGADf39/AGABfwADBQQAAQICBQUBAQroBwdNBQZtZW1vcnkCAAxibGFrZTJiX2luaXQAAA5ibGFrZTJiX3VwZGF0ZQABDWJsYWtlMmJfZmluYWwAAhBibGFrZTJiX2NvbXByZXNzAAMKvz8EwAIAIABCADcDACAAQgA3AwggAEIANwMQIABCADcDGCAAQgA3AyAgAEIANwMoIABCADcDMCAAQgA3AzggAEIANwNAIABCADcDSCAAQgA3A1AgAEIANwNYIABCADcDYCAAQgA3A2ggAEIANwNwIABCADcDeCAAQoiS853/zPmE6gBBACkDAIU3A4ABIABCu86qptjQ67O7f0EIKQMAhTcDiAEgAEKr8NP0r+68tzxBECkDAIU3A5ABIABC8e30+KWn/aelf0EYKQMAhTcDmAEgAELRhZrv+s+Uh9EAQSApAwCFNwOgASAAQp/Y+dnCkdqCm39BKCkDAIU3A6gBIABC6/qG2r+19sEfQTApAwCFNwOwASAAQvnC+JuRo7Pw2wBBOCkDAIU3A7gBIABCADcDwAEgAEIANwPIASAAQgA3A9ABC20BA38gAEHAAWohAyAAQcgBaiEEIAQpAwCnIQUCQANAIAEgAkYNASAFQYABRgRAIAMgAykDACAFrXw3AwBBACEFIAAQAwsgACAFaiABLQAAOgAAIAVBAWohBSABQQFqIQEMAAsLIAQgBa03AwALYQEDfyAAQcABaiEBIABByAFqIQIgASABKQMAIAIpAwB8NwMAIABCfzcD0AEgAikDAKchAwJAA0AgA0GAAUYNASAAIANqQQA6AAAgA0EBaiEDDAALCyACIAOtNwMAIAAQAwuqOwIgfgl/IABBgAFqISEgAEGIAWohIiAAQZABaiEjIABBmAFqISQgAEGgAWohJSAAQagBaiEmIABBsAFqIScgAEG4AWohKCAhKQMAIQEgIikDACECICMpAwAhAyAkKQMAIQQgJSkDACEFICYpAwAhBiAnKQMAIQcgKCkDACEIQoiS853/zPmE6gAhCUK7zqqm2NDrs7t/IQpCq/DT9K/uvLc8IQtC8e30+KWn/aelfyEMQtGFmu/6z5SH0QAhDUKf2PnZwpHagpt/IQ5C6/qG2r+19sEfIQ9C+cL4m5Gjs/DbACEQIAApAwAhESAAKQMIIRIgACkDECETIAApAxghFCAAKQMgIRUgACkDKCEWIAApAzAhFyAAKQM4IRggACkDQCEZIAApA0ghGiAAKQNQIRsgACkDWCEcIAApA2AhHSAAKQNoIR4gACkDcCEfIAApA3ghICANIAApA8ABhSENIA8gACkD0AGFIQ8gASAFIBF8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSASfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgE3x8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBR8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAVfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgFnx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBd8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAYfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgGXx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBp8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAbfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgHHx8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIB18fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAefHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgH3x8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFICB8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAffHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgG3x8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBV8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAZfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgGnx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHICB8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAefHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggF3x8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBJ8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAdfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgEXx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBN8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAcfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggGHx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBZ8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAUfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgHHx8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBl8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAdfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgEXx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBZ8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByATfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggIHx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIB58fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAbfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgH3x8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBR8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAXfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggGHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBJ8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAafHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFXx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBh8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAafHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgFHx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBJ8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAefHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgHXx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBx8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAffHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgE3x8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBd8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAWfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgG3x8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBV8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCARfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgIHx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBl8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAafHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgEXx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBZ8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAYfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgE3x8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBV8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAbfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggIHx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIB98fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiASfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgHHx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIB18fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAXfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggGXx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBR8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAefHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgE3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIB18fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAXfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgG3x8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBF8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAcfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggGXx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBR8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAVfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgHnx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBh8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAWfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggIHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIB98fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSASfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgGnx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIB18fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAWfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgEnx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGICB8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAffHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgHnx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBV8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAbfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgEXx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBh8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAXfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgFHx8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBp8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCATfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgGXx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBx8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAefHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgHHx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBh8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAffHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgHXx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBJ8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAUfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggGnx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBZ8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiARfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgIHx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBV8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAZfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggF3x8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBN8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAbfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgF3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFICB8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAffHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgGnx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBx8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAUfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggEXx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBl8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAdfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgE3x8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIB58fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAYfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggEnx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBV8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAbfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFnx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBt8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSATfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgGXx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBV8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAYfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgF3x8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBJ8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAWfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgIHx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBx8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAafHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgH3x8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBR8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAdfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgHnx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBF8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSARfHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgEnx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBN8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAUfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgFXx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBZ8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAXfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggGHx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBl8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAafHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgG3x8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBx8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAdfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggHnx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIB98fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAgfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgH3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBt8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAVfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgGXx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBp8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAgfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggHnx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBd8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiASfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgHXx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBF8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByATfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggHHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBh8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAWfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFHx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgISAhKQMAIAEgCYWFNwMAICIgIikDACACIAqFhTcDACAjICMpAwAgAyALhYU3AwAgJCAkKQMAIAQgDIWFNwMAICUgJSkDACAFIA2FhTcDACAmICYpAwAgBiAOhYU3AwAgJyAnKQMAIAcgD4WFNwMAICggKCkDACAIIBCFhTcDAAs=")}},function(){return t||(0,a[Object.keys(a)[0]])((t={exports:{}}).exports,t),t.exports})(),d=WebAssembly.compile(f);e.exports=async e=>(await WebAssembly.instantiate(await d,e)).exports},51685:(e,a,t)=>{var c=t(86889),f=t(35682),d=null,r="undefined"!=typeof WebAssembly&&t(91892)().then((e=>{d=e})),n=64,i=[];e.exports=p;var b=e.exports.BYTES_MIN=16,o=e.exports.BYTES_MAX=64,s=(e.exports.BYTES=32,e.exports.KEYBYTES_MIN=16),l=e.exports.KEYBYTES_MAX=64,u=(e.exports.KEYBYTES=32,e.exports.SALTBYTES=16),h=e.exports.PERSONALBYTES=16;function p(e,a,t,f,r){if(!(this instanceof p))return new p(e,a,t,f,r);if(!d)throw new Error("WASM not loaded. Wait for Blake2b.ready(cb)");e||(e=32),!0!==r&&(c(e>=b,"digestLength must be at least "+b+", was given "+e),c(e<=o,"digestLength must be at most "+o+", was given "+e),null!=a&&(c(a instanceof Uint8Array,"key must be Uint8Array or Buffer"),c(a.length>=s,"key must be at least "+s+", was given "+a.length),c(a.length<=l,"key must be at least "+l+", was given "+a.length)),null!=t&&(c(t instanceof Uint8Array,"salt must be Uint8Array or Buffer"),c(t.length===u,"salt must be exactly "+u+", was given "+t.length)),null!=f&&(c(f instanceof Uint8Array,"personal must be Uint8Array or Buffer"),c(f.length===h,"personal must be exactly "+h+", was given "+f.length))),i.length||(i.push(n),n+=216),this.digestLength=e,this.finalized=!1,this.pointer=i.pop(),this._memory=new Uint8Array(d.memory.buffer),this._memory.fill(0,0,64),this._memory[0]=this.digestLength,this._memory[1]=a?a.length:0,this._memory[2]=1,this._memory[3]=1,t&&this._memory.set(t,32),f&&this._memory.set(f,48),this.pointer+216>this._memory.length&&this._realloc(this.pointer+216),d.blake2b_init(this.pointer,this.digestLength),a&&(this.update(a),this._memory.fill(0,n,n+a.length),this._memory[this.pointer+200]=128)}function g(){}p.prototype._realloc=function(e){d.memory.grow(Math.max(0,Math.ceil(Math.abs(e-this._memory.length)/65536))),this._memory=new Uint8Array(d.memory.buffer)},p.prototype.update=function(e){return c(!1===this.finalized,"Hash instance finalized"),c(e instanceof Uint8Array,"input must be Uint8Array or Buffer"),n+e.length>this._memory.length&&this._realloc(n+e.length),this._memory.set(e,n),d.blake2b_update(this.pointer,n,n+e.length),this},p.prototype.digest=function(e){if(c(!1===this.finalized,"Hash instance finalized"),this.finalized=!0,i.push(this.pointer),d.blake2b_final(this.pointer),!e||"binary"===e)return this._memory.slice(this.pointer+128,this.pointer+128+this.digestLength);if("string"==typeof e)return f.toString(this._memory,e,this.pointer+128,this.pointer+128+this.digestLength);c(e instanceof Uint8Array&&e.length>=this.digestLength,"input must be Uint8Array or Buffer");for(var a=0;ae()),e):e(new Error("WebAssembly not supported"))},p.prototype.ready=p.ready,p.prototype.getPartialHash=function(){return this._memory.slice(this.pointer,this.pointer+216)},p.prototype.setPartialHash=function(e){this._memory.set(e,this.pointer)}},72206:(e,a,t)=>{var c=t(86889),f=t(51685);function d(e,a,t){var c=e[a]+e[t],f=e[a+1]+e[t+1];c>=4294967296&&f++,e[a]=c,e[a+1]=f}function r(e,a,t,c){var f=e[a]+t;t<0&&(f+=4294967296);var d=e[a+1]+c;f>=4294967296&&d++,e[a]=f,e[a+1]=d}function n(e,a){return e[a]^e[a+1]<<8^e[a+2]<<16^e[a+3]<<24}function i(e,a,t,c,f,n){var i=l[f],b=l[f+1],o=l[n],u=l[n+1];d(s,e,a),r(s,e,i,b);var h=s[c]^s[e],p=s[c+1]^s[e+1];s[c]=p,s[c+1]=h,d(s,t,c),h=s[a]^s[t],p=s[a+1]^s[t+1],s[a]=h>>>24^p<<8,s[a+1]=p>>>24^h<<8,d(s,e,a),r(s,e,o,u),h=s[c]^s[e],p=s[c+1]^s[e+1],s[c]=h>>>16^p<<16,s[c+1]=p>>>16^h<<16,d(s,t,c),h=s[a]^s[t],p=s[a+1]^s[t+1],s[a]=p>>>31^h<<1,s[a+1]=h>>>31^p<<1}var b=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),o=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map((function(e){return 2*e}))),s=new Uint32Array(32),l=new Uint32Array(32);function u(e,a){var t=0;for(t=0;t<16;t++)s[t]=e.h[t],s[t+16]=b[t];for(s[24]=s[24]^e.t,s[25]=s[25]^e.t/4294967296,a&&(s[28]=~s[28],s[29]=~s[29]),t=0;t<32;t++)l[t]=n(e.b,4*t);for(t=0;t<12;t++)i(0,8,16,24,o[16*t+0],o[16*t+1]),i(2,10,18,26,o[16*t+2],o[16*t+3]),i(4,12,20,28,o[16*t+4],o[16*t+5]),i(6,14,22,30,o[16*t+6],o[16*t+7]),i(0,10,20,30,o[16*t+8],o[16*t+9]),i(2,12,22,24,o[16*t+10],o[16*t+11]),i(4,14,16,26,o[16*t+12],o[16*t+13]),i(6,8,18,28,o[16*t+14],o[16*t+15]);for(t=0;t<16;t++)e.h[t]=e.h[t]^s[t]^s[t+16]}var h=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function p(e,a,t,c){h.fill(0),this.b=new Uint8Array(128),this.h=new Uint32Array(16),this.t=0,this.c=0,this.outlen=e,h[0]=e,a&&(h[1]=a.length),h[2]=1,h[3]=1,t&&h.set(t,32),c&&h.set(c,48);for(var f=0;f<16;f++)this.h[f]=b[f]^n(h,4*f);a&&(g(this,a),this.c=128)}function g(e,a){for(var t=0;t=this.outlen,"out must have at least outlen bytes of space"),function(e,a){for(e.t+=e.c;e.c<128;)e.b[e.c++]=0;u(e,!0);for(var t=0;t>2]>>8*(3&t)}(this,a),"hex"===e?function(e){for(var a="",t=0;t=x,"outlen must be at least "+x+", was given "+e),c(e<=y,"outlen must be at most "+y+", was given "+e),null!=a&&(c(a instanceof Uint8Array,"key must be Uint8Array or Buffer"),c(a.length>=A,"key must be at least "+A+", was given "+a.length),c(a.length<=v,"key must be at most "+v+", was given "+a.length)),null!=t&&(c(t instanceof Uint8Array,"salt must be Uint8Array or Buffer"),c(t.length===w,"salt must be exactly "+w+", was given "+t.length)),null!=f&&(c(f instanceof Uint8Array,"personal must be Uint8Array or Buffer"),c(f.length===_,"personal must be exactly "+_+", was given "+f.length))),new m(e,a,t,f)},e.exports.ready=function(e){f.ready((function(){e()}))},e.exports.WASM_SUPPORTED=f.SUPPORTED,e.exports.WASM_LOADED=!1;var x=e.exports.BYTES_MIN=16,y=e.exports.BYTES_MAX=64,A=(e.exports.BYTES=32,e.exports.KEYBYTES_MIN=16),v=e.exports.KEYBYTES_MAX=64,w=(e.exports.KEYBYTES=32,e.exports.SALTBYTES=16),_=e.exports.PERSONALBYTES=16;f.ready((function(a){a||(e.exports.WASM_LOADED=!0,e.exports=f)}))},39404:function(e,a,t){!function(e,a){"use strict";function c(e,a){if(!e)throw new Error(a||"Assertion failed")}function f(e,a){e.super_=a;var t=function(){};t.prototype=a.prototype,e.prototype=new t,e.prototype.constructor=e}function d(e,a,t){if(d.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==a&&"be"!==a||(t=a,a=10),this._init(e||0,a||10,t||"be"))}var r;"object"==typeof e?e.exports=d:a.BN=d,d.BN=d,d.wordSize=26;try{r="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:t(47790).Buffer}catch(e){}function n(e,a){var t=e.charCodeAt(a);return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:void c(!1,"Invalid character in "+e)}function i(e,a,t){var c=n(e,t);return t-1>=a&&(c|=n(e,t-1)<<4),c}function b(e,a,t,f){for(var d=0,r=0,n=Math.min(e.length,t),i=a;i=49?b-49+10:b>=17?b-17+10:b,c(b>=0&&r0?e:a},d.min=function(e,a){return e.cmp(a)<0?e:a},d.prototype._init=function(e,a,t){if("number"==typeof e)return this._initNumber(e,a,t);if("object"==typeof e)return this._initArray(e,a,t);"hex"===a&&(a=16),c(a===(0|a)&&a>=2&&a<=36);var f=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(f++,this.negative=1),f=0;f-=3)r=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[d]|=r<>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);else if("le"===t)for(f=0,d=0;f>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);return this._strip()},d.prototype._parseHex=function(e,a,t){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)f=i(e,a,c)<=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;else for(c=(e.length-a)%2==0?a+1:a;c=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;this._strip()},d.prototype._parseBase=function(e,a,t){this.words=[0],this.length=1;for(var c=0,f=1;f<=67108863;f*=a)c++;c--,f=f/a|0;for(var d=e.length-t,r=d%c,n=Math.min(d,d-r)+t,i=0,o=t;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},d.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{d.prototype[Symbol.for("nodejs.util.inspect.custom")]=s}catch(e){d.prototype.inspect=s}else d.prototype.inspect=s;function s(){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"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(e,a,t){t.negative=a.negative^e.negative;var c=e.length+a.length|0;t.length=c,c=c-1|0;var f=0|e.words[0],d=0|a.words[0],r=f*d,n=67108863&r,i=r/67108864|0;t.words[0]=n;for(var b=1;b>>26,s=67108863&i,l=Math.min(b,a.length-1),u=Math.max(0,b-e.length+1);u<=l;u++){var h=b-u|0;o+=(r=(f=0|e.words[h])*(d=0|a.words[u])+s)/67108864|0,s=67108863&r}t.words[b]=0|s,i=0|o}return 0!==i?t.words[b]=0|i:t.length--,t._strip()}d.prototype.toString=function(e,a){var t;if(a=0|a||1,16===(e=e||10)||"hex"===e){t="";for(var f=0,d=0,r=0;r>>24-f&16777215,(f+=2)>=26&&(f-=26,r--),t=0!==d||r!==this.length-1?l[6-i.length]+i+t:i+t}for(0!==d&&(t=d.toString(16)+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(e===(0|e)&&e>=2&&e<=36){var b=u[e],o=h[e];t="";var s=this.clone();for(s.negative=0;!s.isZero();){var p=s.modrn(o).toString(e);t=(s=s.idivn(o)).isZero()?p+t:l[b-p.length]+p+t}for(this.isZero()&&(t="0"+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}c(!1,"Base should be between 2 and 36")},d.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&c(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},d.prototype.toJSON=function(){return this.toString(16,2)},r&&(d.prototype.toBuffer=function(e,a){return this.toArrayLike(r,e,a)}),d.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},d.prototype.toArrayLike=function(e,a,t){this._strip();var f=this.byteLength(),d=t||Math.max(1,f);c(f<=d,"byte array longer than desired length"),c(d>0,"Requested array length <= 0");var r=function(e,a){return e.allocUnsafe?e.allocUnsafe(a):new e(a)}(e,d);return this["_toArrayLike"+("le"===a?"LE":"BE")](r,f),r},d.prototype._toArrayLikeLE=function(e,a){for(var t=0,c=0,f=0,d=0;f>8&255),t>16&255),6===d?(t>24&255),c=0,d=0):(c=r>>>24,d+=2)}if(t=0&&(e[t--]=r>>8&255),t>=0&&(e[t--]=r>>16&255),6===d?(t>=0&&(e[t--]=r>>24&255),c=0,d=0):(c=r>>>24,d+=2)}if(t>=0)for(e[t--]=c;t>=0;)e[t--]=0},Math.clz32?d.prototype._countBits=function(e){return 32-Math.clz32(e)}:d.prototype._countBits=function(e){var a=e,t=0;return a>=4096&&(t+=13,a>>>=13),a>=64&&(t+=7,a>>>=7),a>=8&&(t+=4,a>>>=4),a>=2&&(t+=2,a>>>=2),t+a},d.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,t=0;return 8191&a||(t+=13,a>>>=13),127&a||(t+=7,a>>>=7),15&a||(t+=4,a>>>=4),3&a||(t+=2,a>>>=2),1&a||t++,t},d.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},d.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},d.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},d.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var t=0;te.length?this.clone().iand(e):e.clone().iand(this)},d.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},d.prototype.iuxor=function(e){var a,t;this.length>e.length?(a=this,t=e):(a=e,t=this);for(var c=0;ce.length?this.clone().ixor(e):e.clone().ixor(this)},d.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},d.prototype.inotn=function(e){c("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),t=e%26;this._expand(a),t>0&&a--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-t),this._strip()},d.prototype.notn=function(e){return this.clone().inotn(e)},d.prototype.setn=function(e,a){c("number"==typeof e&&e>=0);var t=e/26|0,f=e%26;return this._expand(t+1),this.words[t]=a?this.words[t]|1<e.length?(t=this,c=e):(t=e,c=this);for(var f=0,d=0;d>>26;for(;0!==f&&d>>26;if(this.length=t.length,0!==f)this.words[this.length]=f,this.length++;else if(t!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},d.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var t,c,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(t=this,c=e):(t=e,c=this);for(var d=0,r=0;r>26,this.words[r]=67108863&a;for(;0!==d&&r>26,this.words[r]=67108863&a;if(0===d&&r>>13,u=0|r[1],h=8191&u,p=u>>>13,g=0|r[2],m=8191&g,x=g>>>13,y=0|r[3],A=8191&y,v=y>>>13,w=0|r[4],_=8191&w,I=w>>>13,E=0|r[5],C=8191&E,M=E>>>13,B=0|r[6],k=8191&B,L=B>>>13,S=0|r[7],T=8191&S,N=S>>>13,R=0|r[8],P=8191&R,D=R>>>13,O=0|r[9],F=8191&O,Q=O>>>13,U=0|n[0],j=8191&U,H=U>>>13,q=0|n[1],$=8191&q,z=q>>>13,G=0|n[2],K=8191&G,V=G>>>13,Z=0|n[3],J=8191&Z,W=Z>>>13,Y=0|n[4],X=8191&Y,ee=Y>>>13,ae=0|n[5],te=8191&ae,ce=ae>>>13,fe=0|n[6],de=8191&fe,re=fe>>>13,ne=0|n[7],ie=8191&ne,be=ne>>>13,oe=0|n[8],se=8191&oe,le=oe>>>13,ue=0|n[9],he=8191&ue,pe=ue>>>13;t.negative=e.negative^a.negative,t.length=19;var ge=(b+(c=Math.imul(s,j))|0)+((8191&(f=(f=Math.imul(s,H))+Math.imul(l,j)|0))<<13)|0;b=((d=Math.imul(l,H))+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,c=Math.imul(h,j),f=(f=Math.imul(h,H))+Math.imul(p,j)|0,d=Math.imul(p,H);var me=(b+(c=c+Math.imul(s,$)|0)|0)+((8191&(f=(f=f+Math.imul(s,z)|0)+Math.imul(l,$)|0))<<13)|0;b=((d=d+Math.imul(l,z)|0)+(f>>>13)|0)+(me>>>26)|0,me&=67108863,c=Math.imul(m,j),f=(f=Math.imul(m,H))+Math.imul(x,j)|0,d=Math.imul(x,H),c=c+Math.imul(h,$)|0,f=(f=f+Math.imul(h,z)|0)+Math.imul(p,$)|0,d=d+Math.imul(p,z)|0;var xe=(b+(c=c+Math.imul(s,K)|0)|0)+((8191&(f=(f=f+Math.imul(s,V)|0)+Math.imul(l,K)|0))<<13)|0;b=((d=d+Math.imul(l,V)|0)+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,c=Math.imul(A,j),f=(f=Math.imul(A,H))+Math.imul(v,j)|0,d=Math.imul(v,H),c=c+Math.imul(m,$)|0,f=(f=f+Math.imul(m,z)|0)+Math.imul(x,$)|0,d=d+Math.imul(x,z)|0,c=c+Math.imul(h,K)|0,f=(f=f+Math.imul(h,V)|0)+Math.imul(p,K)|0,d=d+Math.imul(p,V)|0;var ye=(b+(c=c+Math.imul(s,J)|0)|0)+((8191&(f=(f=f+Math.imul(s,W)|0)+Math.imul(l,J)|0))<<13)|0;b=((d=d+Math.imul(l,W)|0)+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,c=Math.imul(_,j),f=(f=Math.imul(_,H))+Math.imul(I,j)|0,d=Math.imul(I,H),c=c+Math.imul(A,$)|0,f=(f=f+Math.imul(A,z)|0)+Math.imul(v,$)|0,d=d+Math.imul(v,z)|0,c=c+Math.imul(m,K)|0,f=(f=f+Math.imul(m,V)|0)+Math.imul(x,K)|0,d=d+Math.imul(x,V)|0,c=c+Math.imul(h,J)|0,f=(f=f+Math.imul(h,W)|0)+Math.imul(p,J)|0,d=d+Math.imul(p,W)|0;var Ae=(b+(c=c+Math.imul(s,X)|0)|0)+((8191&(f=(f=f+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;b=((d=d+Math.imul(l,ee)|0)+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,c=Math.imul(C,j),f=(f=Math.imul(C,H))+Math.imul(M,j)|0,d=Math.imul(M,H),c=c+Math.imul(_,$)|0,f=(f=f+Math.imul(_,z)|0)+Math.imul(I,$)|0,d=d+Math.imul(I,z)|0,c=c+Math.imul(A,K)|0,f=(f=f+Math.imul(A,V)|0)+Math.imul(v,K)|0,d=d+Math.imul(v,V)|0,c=c+Math.imul(m,J)|0,f=(f=f+Math.imul(m,W)|0)+Math.imul(x,J)|0,d=d+Math.imul(x,W)|0,c=c+Math.imul(h,X)|0,f=(f=f+Math.imul(h,ee)|0)+Math.imul(p,X)|0,d=d+Math.imul(p,ee)|0;var ve=(b+(c=c+Math.imul(s,te)|0)|0)+((8191&(f=(f=f+Math.imul(s,ce)|0)+Math.imul(l,te)|0))<<13)|0;b=((d=d+Math.imul(l,ce)|0)+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,c=Math.imul(k,j),f=(f=Math.imul(k,H))+Math.imul(L,j)|0,d=Math.imul(L,H),c=c+Math.imul(C,$)|0,f=(f=f+Math.imul(C,z)|0)+Math.imul(M,$)|0,d=d+Math.imul(M,z)|0,c=c+Math.imul(_,K)|0,f=(f=f+Math.imul(_,V)|0)+Math.imul(I,K)|0,d=d+Math.imul(I,V)|0,c=c+Math.imul(A,J)|0,f=(f=f+Math.imul(A,W)|0)+Math.imul(v,J)|0,d=d+Math.imul(v,W)|0,c=c+Math.imul(m,X)|0,f=(f=f+Math.imul(m,ee)|0)+Math.imul(x,X)|0,d=d+Math.imul(x,ee)|0,c=c+Math.imul(h,te)|0,f=(f=f+Math.imul(h,ce)|0)+Math.imul(p,te)|0,d=d+Math.imul(p,ce)|0;var we=(b+(c=c+Math.imul(s,de)|0)|0)+((8191&(f=(f=f+Math.imul(s,re)|0)+Math.imul(l,de)|0))<<13)|0;b=((d=d+Math.imul(l,re)|0)+(f>>>13)|0)+(we>>>26)|0,we&=67108863,c=Math.imul(T,j),f=(f=Math.imul(T,H))+Math.imul(N,j)|0,d=Math.imul(N,H),c=c+Math.imul(k,$)|0,f=(f=f+Math.imul(k,z)|0)+Math.imul(L,$)|0,d=d+Math.imul(L,z)|0,c=c+Math.imul(C,K)|0,f=(f=f+Math.imul(C,V)|0)+Math.imul(M,K)|0,d=d+Math.imul(M,V)|0,c=c+Math.imul(_,J)|0,f=(f=f+Math.imul(_,W)|0)+Math.imul(I,J)|0,d=d+Math.imul(I,W)|0,c=c+Math.imul(A,X)|0,f=(f=f+Math.imul(A,ee)|0)+Math.imul(v,X)|0,d=d+Math.imul(v,ee)|0,c=c+Math.imul(m,te)|0,f=(f=f+Math.imul(m,ce)|0)+Math.imul(x,te)|0,d=d+Math.imul(x,ce)|0,c=c+Math.imul(h,de)|0,f=(f=f+Math.imul(h,re)|0)+Math.imul(p,de)|0,d=d+Math.imul(p,re)|0;var _e=(b+(c=c+Math.imul(s,ie)|0)|0)+((8191&(f=(f=f+Math.imul(s,be)|0)+Math.imul(l,ie)|0))<<13)|0;b=((d=d+Math.imul(l,be)|0)+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,c=Math.imul(P,j),f=(f=Math.imul(P,H))+Math.imul(D,j)|0,d=Math.imul(D,H),c=c+Math.imul(T,$)|0,f=(f=f+Math.imul(T,z)|0)+Math.imul(N,$)|0,d=d+Math.imul(N,z)|0,c=c+Math.imul(k,K)|0,f=(f=f+Math.imul(k,V)|0)+Math.imul(L,K)|0,d=d+Math.imul(L,V)|0,c=c+Math.imul(C,J)|0,f=(f=f+Math.imul(C,W)|0)+Math.imul(M,J)|0,d=d+Math.imul(M,W)|0,c=c+Math.imul(_,X)|0,f=(f=f+Math.imul(_,ee)|0)+Math.imul(I,X)|0,d=d+Math.imul(I,ee)|0,c=c+Math.imul(A,te)|0,f=(f=f+Math.imul(A,ce)|0)+Math.imul(v,te)|0,d=d+Math.imul(v,ce)|0,c=c+Math.imul(m,de)|0,f=(f=f+Math.imul(m,re)|0)+Math.imul(x,de)|0,d=d+Math.imul(x,re)|0,c=c+Math.imul(h,ie)|0,f=(f=f+Math.imul(h,be)|0)+Math.imul(p,ie)|0,d=d+Math.imul(p,be)|0;var Ie=(b+(c=c+Math.imul(s,se)|0)|0)+((8191&(f=(f=f+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;b=((d=d+Math.imul(l,le)|0)+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,c=Math.imul(F,j),f=(f=Math.imul(F,H))+Math.imul(Q,j)|0,d=Math.imul(Q,H),c=c+Math.imul(P,$)|0,f=(f=f+Math.imul(P,z)|0)+Math.imul(D,$)|0,d=d+Math.imul(D,z)|0,c=c+Math.imul(T,K)|0,f=(f=f+Math.imul(T,V)|0)+Math.imul(N,K)|0,d=d+Math.imul(N,V)|0,c=c+Math.imul(k,J)|0,f=(f=f+Math.imul(k,W)|0)+Math.imul(L,J)|0,d=d+Math.imul(L,W)|0,c=c+Math.imul(C,X)|0,f=(f=f+Math.imul(C,ee)|0)+Math.imul(M,X)|0,d=d+Math.imul(M,ee)|0,c=c+Math.imul(_,te)|0,f=(f=f+Math.imul(_,ce)|0)+Math.imul(I,te)|0,d=d+Math.imul(I,ce)|0,c=c+Math.imul(A,de)|0,f=(f=f+Math.imul(A,re)|0)+Math.imul(v,de)|0,d=d+Math.imul(v,re)|0,c=c+Math.imul(m,ie)|0,f=(f=f+Math.imul(m,be)|0)+Math.imul(x,ie)|0,d=d+Math.imul(x,be)|0,c=c+Math.imul(h,se)|0,f=(f=f+Math.imul(h,le)|0)+Math.imul(p,se)|0,d=d+Math.imul(p,le)|0;var Ee=(b+(c=c+Math.imul(s,he)|0)|0)+((8191&(f=(f=f+Math.imul(s,pe)|0)+Math.imul(l,he)|0))<<13)|0;b=((d=d+Math.imul(l,pe)|0)+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,c=Math.imul(F,$),f=(f=Math.imul(F,z))+Math.imul(Q,$)|0,d=Math.imul(Q,z),c=c+Math.imul(P,K)|0,f=(f=f+Math.imul(P,V)|0)+Math.imul(D,K)|0,d=d+Math.imul(D,V)|0,c=c+Math.imul(T,J)|0,f=(f=f+Math.imul(T,W)|0)+Math.imul(N,J)|0,d=d+Math.imul(N,W)|0,c=c+Math.imul(k,X)|0,f=(f=f+Math.imul(k,ee)|0)+Math.imul(L,X)|0,d=d+Math.imul(L,ee)|0,c=c+Math.imul(C,te)|0,f=(f=f+Math.imul(C,ce)|0)+Math.imul(M,te)|0,d=d+Math.imul(M,ce)|0,c=c+Math.imul(_,de)|0,f=(f=f+Math.imul(_,re)|0)+Math.imul(I,de)|0,d=d+Math.imul(I,re)|0,c=c+Math.imul(A,ie)|0,f=(f=f+Math.imul(A,be)|0)+Math.imul(v,ie)|0,d=d+Math.imul(v,be)|0,c=c+Math.imul(m,se)|0,f=(f=f+Math.imul(m,le)|0)+Math.imul(x,se)|0,d=d+Math.imul(x,le)|0;var Ce=(b+(c=c+Math.imul(h,he)|0)|0)+((8191&(f=(f=f+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;b=((d=d+Math.imul(p,pe)|0)+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c=Math.imul(F,K),f=(f=Math.imul(F,V))+Math.imul(Q,K)|0,d=Math.imul(Q,V),c=c+Math.imul(P,J)|0,f=(f=f+Math.imul(P,W)|0)+Math.imul(D,J)|0,d=d+Math.imul(D,W)|0,c=c+Math.imul(T,X)|0,f=(f=f+Math.imul(T,ee)|0)+Math.imul(N,X)|0,d=d+Math.imul(N,ee)|0,c=c+Math.imul(k,te)|0,f=(f=f+Math.imul(k,ce)|0)+Math.imul(L,te)|0,d=d+Math.imul(L,ce)|0,c=c+Math.imul(C,de)|0,f=(f=f+Math.imul(C,re)|0)+Math.imul(M,de)|0,d=d+Math.imul(M,re)|0,c=c+Math.imul(_,ie)|0,f=(f=f+Math.imul(_,be)|0)+Math.imul(I,ie)|0,d=d+Math.imul(I,be)|0,c=c+Math.imul(A,se)|0,f=(f=f+Math.imul(A,le)|0)+Math.imul(v,se)|0,d=d+Math.imul(v,le)|0;var Me=(b+(c=c+Math.imul(m,he)|0)|0)+((8191&(f=(f=f+Math.imul(m,pe)|0)+Math.imul(x,he)|0))<<13)|0;b=((d=d+Math.imul(x,pe)|0)+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,c=Math.imul(F,J),f=(f=Math.imul(F,W))+Math.imul(Q,J)|0,d=Math.imul(Q,W),c=c+Math.imul(P,X)|0,f=(f=f+Math.imul(P,ee)|0)+Math.imul(D,X)|0,d=d+Math.imul(D,ee)|0,c=c+Math.imul(T,te)|0,f=(f=f+Math.imul(T,ce)|0)+Math.imul(N,te)|0,d=d+Math.imul(N,ce)|0,c=c+Math.imul(k,de)|0,f=(f=f+Math.imul(k,re)|0)+Math.imul(L,de)|0,d=d+Math.imul(L,re)|0,c=c+Math.imul(C,ie)|0,f=(f=f+Math.imul(C,be)|0)+Math.imul(M,ie)|0,d=d+Math.imul(M,be)|0,c=c+Math.imul(_,se)|0,f=(f=f+Math.imul(_,le)|0)+Math.imul(I,se)|0,d=d+Math.imul(I,le)|0;var Be=(b+(c=c+Math.imul(A,he)|0)|0)+((8191&(f=(f=f+Math.imul(A,pe)|0)+Math.imul(v,he)|0))<<13)|0;b=((d=d+Math.imul(v,pe)|0)+(f>>>13)|0)+(Be>>>26)|0,Be&=67108863,c=Math.imul(F,X),f=(f=Math.imul(F,ee))+Math.imul(Q,X)|0,d=Math.imul(Q,ee),c=c+Math.imul(P,te)|0,f=(f=f+Math.imul(P,ce)|0)+Math.imul(D,te)|0,d=d+Math.imul(D,ce)|0,c=c+Math.imul(T,de)|0,f=(f=f+Math.imul(T,re)|0)+Math.imul(N,de)|0,d=d+Math.imul(N,re)|0,c=c+Math.imul(k,ie)|0,f=(f=f+Math.imul(k,be)|0)+Math.imul(L,ie)|0,d=d+Math.imul(L,be)|0,c=c+Math.imul(C,se)|0,f=(f=f+Math.imul(C,le)|0)+Math.imul(M,se)|0,d=d+Math.imul(M,le)|0;var ke=(b+(c=c+Math.imul(_,he)|0)|0)+((8191&(f=(f=f+Math.imul(_,pe)|0)+Math.imul(I,he)|0))<<13)|0;b=((d=d+Math.imul(I,pe)|0)+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,c=Math.imul(F,te),f=(f=Math.imul(F,ce))+Math.imul(Q,te)|0,d=Math.imul(Q,ce),c=c+Math.imul(P,de)|0,f=(f=f+Math.imul(P,re)|0)+Math.imul(D,de)|0,d=d+Math.imul(D,re)|0,c=c+Math.imul(T,ie)|0,f=(f=f+Math.imul(T,be)|0)+Math.imul(N,ie)|0,d=d+Math.imul(N,be)|0,c=c+Math.imul(k,se)|0,f=(f=f+Math.imul(k,le)|0)+Math.imul(L,se)|0,d=d+Math.imul(L,le)|0;var Le=(b+(c=c+Math.imul(C,he)|0)|0)+((8191&(f=(f=f+Math.imul(C,pe)|0)+Math.imul(M,he)|0))<<13)|0;b=((d=d+Math.imul(M,pe)|0)+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,c=Math.imul(F,de),f=(f=Math.imul(F,re))+Math.imul(Q,de)|0,d=Math.imul(Q,re),c=c+Math.imul(P,ie)|0,f=(f=f+Math.imul(P,be)|0)+Math.imul(D,ie)|0,d=d+Math.imul(D,be)|0,c=c+Math.imul(T,se)|0,f=(f=f+Math.imul(T,le)|0)+Math.imul(N,se)|0,d=d+Math.imul(N,le)|0;var Se=(b+(c=c+Math.imul(k,he)|0)|0)+((8191&(f=(f=f+Math.imul(k,pe)|0)+Math.imul(L,he)|0))<<13)|0;b=((d=d+Math.imul(L,pe)|0)+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,c=Math.imul(F,ie),f=(f=Math.imul(F,be))+Math.imul(Q,ie)|0,d=Math.imul(Q,be),c=c+Math.imul(P,se)|0,f=(f=f+Math.imul(P,le)|0)+Math.imul(D,se)|0,d=d+Math.imul(D,le)|0;var Te=(b+(c=c+Math.imul(T,he)|0)|0)+((8191&(f=(f=f+Math.imul(T,pe)|0)+Math.imul(N,he)|0))<<13)|0;b=((d=d+Math.imul(N,pe)|0)+(f>>>13)|0)+(Te>>>26)|0,Te&=67108863,c=Math.imul(F,se),f=(f=Math.imul(F,le))+Math.imul(Q,se)|0,d=Math.imul(Q,le);var Ne=(b+(c=c+Math.imul(P,he)|0)|0)+((8191&(f=(f=f+Math.imul(P,pe)|0)+Math.imul(D,he)|0))<<13)|0;b=((d=d+Math.imul(D,pe)|0)+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Re=(b+(c=Math.imul(F,he))|0)+((8191&(f=(f=Math.imul(F,pe))+Math.imul(Q,he)|0))<<13)|0;return b=((d=Math.imul(Q,pe))+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,i[0]=ge,i[1]=me,i[2]=xe,i[3]=ye,i[4]=Ae,i[5]=ve,i[6]=we,i[7]=_e,i[8]=Ie,i[9]=Ee,i[10]=Ce,i[11]=Me,i[12]=Be,i[13]=ke,i[14]=Le,i[15]=Se,i[16]=Te,i[17]=Ne,i[18]=Re,0!==b&&(i[19]=b,t.length++),t};function m(e,a,t){t.negative=a.negative^e.negative,t.length=e.length+a.length;for(var c=0,f=0,d=0;d>>26)|0)>>>26,r&=67108863}t.words[d]=n,c=r,r=f}return 0!==c?t.words[d]=c:t.length--,t._strip()}function x(e,a,t){return m(e,a,t)}function y(e,a){this.x=e,this.y=a}Math.imul||(g=p),d.prototype.mulTo=function(e,a){var t=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,a):t<63?p(this,e,a):t<1024?m(this,e,a):x(this,e,a)},y.prototype.makeRBT=function(e){for(var a=new Array(e),t=d.prototype._countBits(e)-1,c=0;c>=1;return c},y.prototype.permute=function(e,a,t,c,f,d){for(var r=0;r>>=1)f++;return 1<>>=13,t[2*r+1]=8191&d,d>>>=13;for(r=2*a;r>=26,t+=d/67108864|0,t+=r>>>26,this.words[f]=67108863&r}return 0!==t&&(this.words[f]=t,this.length++),a?this.ineg():this},d.prototype.muln=function(e){return this.clone().imuln(e)},d.prototype.sqr=function(){return this.mul(this)},d.prototype.isqr=function(){return this.imul(this.clone())},d.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),t=0;t>>f&1}return a}(e);if(0===a.length)return new d(1);for(var t=this,c=0;c=0);var a,t=e%26,f=(e-t)/26,d=67108863>>>26-t<<26-t;if(0!==t){var r=0;for(a=0;a>>26-t}r&&(this.words[a]=r,this.length++)}if(0!==f){for(a=this.length-1;a>=0;a--)this.words[a+f]=this.words[a];for(a=0;a=0),f=a?(a-a%26)/26:0;var d=e%26,r=Math.min((e-d)/26,this.length),n=67108863^67108863>>>d<r)for(this.length-=r,b=0;b=0&&(0!==o||b>=f);b--){var s=0|this.words[b];this.words[b]=o<<26-d|s>>>d,o=s&n}return i&&0!==o&&(i.words[i.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},d.prototype.ishrn=function(e,a,t){return c(0===this.negative),this.iushrn(e,a,t)},d.prototype.shln=function(e){return this.clone().ishln(e)},d.prototype.ushln=function(e){return this.clone().iushln(e)},d.prototype.shrn=function(e){return this.clone().ishrn(e)},d.prototype.ushrn=function(e){return this.clone().iushrn(e)},d.prototype.testn=function(e){c("number"==typeof e&&e>=0);var a=e%26,t=(e-a)/26,f=1<=0);var a=e%26,t=(e-a)/26;if(c(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==a&&t++,this.length=Math.min(t,this.length),0!==a){var f=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},d.prototype.isubn=function(e){if(c("number"==typeof e),c(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(i/67108864|0),this.words[f+t]=67108863&d}for(;f>26,this.words[f+t]=67108863&d;if(0===n)return this._strip();for(c(-1===n),n=0,f=0;f>26,this.words[f]=67108863&d;return this.negative=1,this._strip()},d.prototype._wordDiv=function(e,a){var t=(this.length,e.length),c=this.clone(),f=e,r=0|f.words[f.length-1];0!=(t=26-this._countBits(r))&&(f=f.ushln(t),c.iushln(t),r=0|f.words[f.length-1]);var n,i=c.length-f.length;if("mod"!==a){(n=new d(null)).length=i+1,n.words=new Array(n.length);for(var b=0;b=0;s--){var l=67108864*(0|c.words[f.length+s])+(0|c.words[f.length+s-1]);for(l=Math.min(l/r|0,67108863),c._ishlnsubmul(f,l,s);0!==c.negative;)l--,c.negative=0,c._ishlnsubmul(f,1,s),c.isZero()||(c.negative^=1);n&&(n.words[s]=l)}return n&&n._strip(),c._strip(),"div"!==a&&0!==t&&c.iushrn(t),{div:n||null,mod:c}},d.prototype.divmod=function(e,a,t){return c(!e.isZero()),this.isZero()?{div:new d(0),mod:new d(0)}:0!==this.negative&&0===e.negative?(n=this.neg().divmod(e,a),"mod"!==a&&(f=n.div.neg()),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.iadd(e)),{div:f,mod:r}):0===this.negative&&0!==e.negative?(n=this.divmod(e.neg(),a),"mod"!==a&&(f=n.div.neg()),{div:f,mod:n.mod}):this.negative&e.negative?(n=this.neg().divmod(e.neg(),a),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.isub(e)),{div:n.div,mod:r}):e.length>this.length||this.cmp(e)<0?{div:new d(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new d(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new d(this.modrn(e.words[0]))}:this._wordDiv(e,a);var f,r,n},d.prototype.div=function(e){return this.divmod(e,"div",!1).div},d.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},d.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},d.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var t=0!==a.div.negative?a.mod.isub(e):a.mod,c=e.ushrn(1),f=e.andln(1),d=t.cmp(c);return d<0||1===f&&0===d?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},d.prototype.modrn=function(e){var a=e<0;a&&(e=-e),c(e<=67108863);for(var t=(1<<26)%e,f=0,d=this.length-1;d>=0;d--)f=(t*f+(0|this.words[d]))%e;return a?-f:f},d.prototype.modn=function(e){return this.modrn(e)},d.prototype.idivn=function(e){var a=e<0;a&&(e=-e),c(e<=67108863);for(var t=0,f=this.length-1;f>=0;f--){var d=(0|this.words[f])+67108864*t;this.words[f]=d/e|0,t=d%e}return this._strip(),a?this.ineg():this},d.prototype.divn=function(e){return this.clone().idivn(e)},d.prototype.egcd=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f=new d(1),r=new d(0),n=new d(0),i=new d(1),b=0;a.isEven()&&t.isEven();)a.iushrn(1),t.iushrn(1),++b;for(var o=t.clone(),s=a.clone();!a.isZero();){for(var l=0,u=1;!(a.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(f.isOdd()||r.isOdd())&&(f.iadd(o),r.isub(s)),f.iushrn(1),r.iushrn(1);for(var h=0,p=1;!(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(o),i.isub(s)),n.iushrn(1),i.iushrn(1);a.cmp(t)>=0?(a.isub(t),f.isub(n),r.isub(i)):(t.isub(a),n.isub(f),i.isub(r))}return{a:n,b:i,gcd:t.iushln(b)}},d.prototype._invmp=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f,r=new d(1),n=new d(0),i=t.clone();a.cmpn(1)>0&&t.cmpn(1)>0;){for(var b=0,o=1;!(a.words[0]&o)&&b<26;++b,o<<=1);if(b>0)for(a.iushrn(b);b-- >0;)r.isOdd()&&r.iadd(i),r.iushrn(1);for(var s=0,l=1;!(t.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(t.iushrn(s);s-- >0;)n.isOdd()&&n.iadd(i),n.iushrn(1);a.cmp(t)>=0?(a.isub(t),r.isub(n)):(t.isub(a),n.isub(r))}return(f=0===a.cmpn(1)?r:n).cmpn(0)<0&&f.iadd(e),f},d.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),t=e.clone();a.negative=0,t.negative=0;for(var c=0;a.isEven()&&t.isEven();c++)a.iushrn(1),t.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;t.isEven();)t.iushrn(1);var f=a.cmp(t);if(f<0){var d=a;a=t,t=d}else if(0===f||0===t.cmpn(1))break;a.isub(t)}return t.iushln(c)},d.prototype.invm=function(e){return this.egcd(e).a.umod(e)},d.prototype.isEven=function(){return!(1&this.words[0])},d.prototype.isOdd=function(){return!(1&~this.words[0])},d.prototype.andln=function(e){return this.words[0]&e},d.prototype.bincn=function(e){c("number"==typeof e);var a=e%26,t=(e-a)/26,f=1<>>26,n&=67108863,this.words[r]=n}return 0!==d&&(this.words[r]=d,this.length++),this},d.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},d.prototype.cmpn=function(e){var a,t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this._strip(),this.length>1)a=1;else{t&&(e=-e),c(e<=67108863,"Number is too big");var f=0|this.words[0];a=f===e?0:fe.length)return 1;if(this.length=0;t--){var c=0|this.words[t],f=0|e.words[t];if(c!==f){cf&&(a=1);break}}return a},d.prototype.gtn=function(e){return 1===this.cmpn(e)},d.prototype.gt=function(e){return 1===this.cmp(e)},d.prototype.gten=function(e){return this.cmpn(e)>=0},d.prototype.gte=function(e){return this.cmp(e)>=0},d.prototype.ltn=function(e){return-1===this.cmpn(e)},d.prototype.lt=function(e){return-1===this.cmp(e)},d.prototype.lten=function(e){return this.cmpn(e)<=0},d.prototype.lte=function(e){return this.cmp(e)<=0},d.prototype.eqn=function(e){return 0===this.cmpn(e)},d.prototype.eq=function(e){return 0===this.cmp(e)},d.red=function(e){return new C(e)},d.prototype.toRed=function(e){return c(!this.red,"Already a number in reduction context"),c(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},d.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},d.prototype._forceRed=function(e){return this.red=e,this},d.prototype.forceRed=function(e){return c(!this.red,"Already a number in reduction context"),this._forceRed(e)},d.prototype.redAdd=function(e){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},d.prototype.redIAdd=function(e){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},d.prototype.redSub=function(e){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},d.prototype.redISub=function(e){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},d.prototype.redShl=function(e){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},d.prototype.redMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},d.prototype.redIMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},d.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},d.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},d.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},d.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},d.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},d.prototype.redPow=function(e){return c(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var A={k256:null,p224:null,p192:null,p25519:null};function v(e,a){this.name=e,this.p=new d(a,16),this.n=this.p.bitLength(),this.k=new d(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function I(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function C(e){if("string"==typeof e){var a=d._prime(e);this.m=a.p,this.prime=a}else c(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){C.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new d(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)}v.prototype._tmp=function(){var e=new d(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var a,t=e;do{this.split(t,this.tmp),a=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(a>this.n);var c=a0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},v.prototype.split=function(e,a){e.iushrn(this.n,0,a)},v.prototype.imulK=function(e){return e.imul(this.k)},f(w,v),w.prototype.split=function(e,a){for(var t=4194303,c=Math.min(e.length,9),f=0;f>>22,d=r}d>>>=22,e.words[f-10]=d,0===d&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,t=0;t>>=26,e.words[t]=f,a=c}return 0!==a&&(e.words[e.length++]=a),e},d._prime=function(e){if(A[e])return A[e];var a;if("k256"===e)a=new w;else if("p224"===e)a=new _;else if("p192"===e)a=new I;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new E}return A[e]=a,a},C.prototype._verify1=function(e){c(0===e.negative,"red works only with positives"),c(e.red,"red works only with red numbers")},C.prototype._verify2=function(e,a){c(!(e.negative|a.negative),"red works only with positives"),c(e.red&&e.red===a.red,"red works only with red numbers")},C.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(o(e,e.umod(this.m)._forceRed(this)),e)},C.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},C.prototype.add=function(e,a){this._verify2(e,a);var t=e.add(a);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},C.prototype.iadd=function(e,a){this._verify2(e,a);var t=e.iadd(a);return t.cmp(this.m)>=0&&t.isub(this.m),t},C.prototype.sub=function(e,a){this._verify2(e,a);var t=e.sub(a);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},C.prototype.isub=function(e,a){this._verify2(e,a);var t=e.isub(a);return t.cmpn(0)<0&&t.iadd(this.m),t},C.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},C.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},C.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},C.prototype.isqr=function(e){return this.imul(e,e.clone())},C.prototype.sqr=function(e){return this.mul(e,e)},C.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(c(a%2==1),3===a){var t=this.m.add(new d(1)).iushrn(2);return this.pow(e,t)}for(var f=this.m.subn(1),r=0;!f.isZero()&&0===f.andln(1);)r++,f.iushrn(1);c(!f.isZero());var n=new d(1).toRed(this),i=n.redNeg(),b=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new d(2*o*o).toRed(this);0!==this.pow(o,b).cmp(i);)o.redIAdd(i);for(var s=this.pow(o,f),l=this.pow(e,f.addn(1).iushrn(1)),u=this.pow(e,f),h=r;0!==u.cmp(n);){for(var p=u,g=0;0!==p.cmp(n);g++)p=p.redSqr();c(g=0;c--){for(var b=a.words[c],o=i-1;o>=0;o--){var s=b>>o&1;f!==t[0]&&(f=this.sqr(f)),0!==s||0!==r?(r<<=1,r|=s,(4==++n||0===c&&0===o)&&(f=this.mul(f,t[r]),n=0,r=0)):n=0}i=26}return f},C.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},C.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},d.mont=function(e){return new M(e)},f(M,C),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},M.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var t=e.imul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),d=f;return f.cmp(this.m)>=0?d=f.isub(this.m):f.cmpn(0)<0&&(d=f.iadd(this.m)),d._forceRed(this)},M.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new d(0)._forceRed(this);var t=e.mul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),r=f;return f.cmp(this.m)>=0?r=f.isub(this.m):f.cmpn(0)<0&&(r=f.iadd(this.m)),r._forceRed(this)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=t.nmd(e),this)},15037:(e,a,t)=>{var c;function f(e){this.rand=e}if(e.exports=function(e){return c||(c=new f(null)),c.generate(e)},e.exports.Rand=f,f.prototype.generate=function(e){return this._rand(e)},f.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var a=new Uint8Array(e),t=0;t{var c=t(92861).Buffer;function f(e){c.isBuffer(e)||(e=c.from(e));for(var a=e.length/4|0,t=new Array(a),f=0;f>>24]^o[h>>>16&255]^s[p>>>8&255]^l[255&g]^a[m++],r=b[h>>>24]^o[p>>>16&255]^s[g>>>8&255]^l[255&u]^a[m++],n=b[p>>>24]^o[g>>>16&255]^s[u>>>8&255]^l[255&h]^a[m++],i=b[g>>>24]^o[u>>>16&255]^s[h>>>8&255]^l[255&p]^a[m++],u=d,h=r,p=n,g=i;return d=(c[u>>>24]<<24|c[h>>>16&255]<<16|c[p>>>8&255]<<8|c[255&g])^a[m++],r=(c[h>>>24]<<24|c[p>>>16&255]<<16|c[g>>>8&255]<<8|c[255&u])^a[m++],n=(c[p>>>24]<<24|c[g>>>16&255]<<16|c[u>>>8&255]<<8|c[255&h])^a[m++],i=(c[g>>>24]<<24|c[u>>>16&255]<<16|c[h>>>8&255]<<8|c[255&p])^a[m++],[d>>>=0,r>>>=0,n>>>=0,i>>>=0]}var n=[0,1,2,4,8,16,32,64,128,27,54],i=function(){for(var e=new Array(256),a=0;a<256;a++)e[a]=a<128?a<<1:a<<1^283;for(var t=[],c=[],f=[[],[],[],[]],d=[[],[],[],[]],r=0,n=0,i=0;i<256;++i){var b=n^n<<1^n<<2^n<<3^n<<4;b=b>>>8^255&b^99,t[r]=b,c[b]=r;var o=e[r],s=e[o],l=e[s],u=257*e[b]^16843008*b;f[0][r]=u<<24|u>>>8,f[1][r]=u<<16|u>>>16,f[2][r]=u<<8|u>>>24,f[3][r]=u,u=16843009*l^65537*s^257*o^16843008*r,d[0][b]=u<<24|u>>>8,d[1][b]=u<<16|u>>>16,d[2][b]=u<<8|u>>>24,d[3][b]=u,0===r?r=n=1:(r=o^e[e[e[l^o]]],n^=e[e[n]])}return{SBOX:t,INV_SBOX:c,SUB_MIX:f,INV_SUB_MIX:d}}();function b(e){this._key=f(e),this._reset()}b.blockSize=16,b.keySize=32,b.prototype.blockSize=b.blockSize,b.prototype.keySize=b.keySize,b.prototype._reset=function(){for(var e=this._key,a=e.length,t=a+6,c=4*(t+1),f=[],d=0;d>>24,r=i.SBOX[r>>>24]<<24|i.SBOX[r>>>16&255]<<16|i.SBOX[r>>>8&255]<<8|i.SBOX[255&r],r^=n[d/a|0]<<24):a>6&&d%a==4&&(r=i.SBOX[r>>>24]<<24|i.SBOX[r>>>16&255]<<16|i.SBOX[r>>>8&255]<<8|i.SBOX[255&r]),f[d]=f[d-a]^r}for(var b=[],o=0;o>>24]]^i.INV_SUB_MIX[1][i.SBOX[l>>>16&255]]^i.INV_SUB_MIX[2][i.SBOX[l>>>8&255]]^i.INV_SUB_MIX[3][i.SBOX[255&l]]}this._nRounds=t,this._keySchedule=f,this._invKeySchedule=b},b.prototype.encryptBlockRaw=function(e){return r(e=f(e),this._keySchedule,i.SUB_MIX,i.SBOX,this._nRounds)},b.prototype.encryptBlock=function(e){var a=this.encryptBlockRaw(e),t=c.allocUnsafe(16);return t.writeUInt32BE(a[0],0),t.writeUInt32BE(a[1],4),t.writeUInt32BE(a[2],8),t.writeUInt32BE(a[3],12),t},b.prototype.decryptBlock=function(e){var a=(e=f(e))[1];e[1]=e[3],e[3]=a;var t=r(e,this._invKeySchedule,i.INV_SUB_MIX,i.INV_SBOX,this._nRounds),d=c.allocUnsafe(16);return d.writeUInt32BE(t[0],0),d.writeUInt32BE(t[3],4),d.writeUInt32BE(t[2],8),d.writeUInt32BE(t[1],12),d},b.prototype.scrub=function(){d(this._keySchedule),d(this._invKeySchedule),d(this._key)},e.exports.AES=b},92356:(e,a,t)=>{var c=t(50462),f=t(92861).Buffer,d=t(56168),r=t(56698),n=t(25892),i=t(30295),b=t(45122);function o(e,a,t,r){d.call(this);var i=f.alloc(4,0);this._cipher=new c.AES(a);var o=this._cipher.encryptBlock(i);this._ghash=new n(o),t=function(e,a,t){if(12===a.length)return e._finID=f.concat([a,f.from([0,0,0,1])]),f.concat([a,f.from([0,0,0,2])]);var c=new n(t),d=a.length,r=d%16;c.update(a),r&&(r=16-r,c.update(f.alloc(r,0))),c.update(f.alloc(8,0));var i=8*d,o=f.alloc(8);o.writeUIntBE(i,0,8),c.update(o),e._finID=c.state;var s=f.from(e._finID);return b(s),s}(this,t,o),this._prev=f.from(t),this._cache=f.allocUnsafe(0),this._secCache=f.allocUnsafe(0),this._decrypt=r,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}r(o,d),o.prototype._update=function(e){if(!this._called&&this._alen){var a=16-this._alen%16;a<16&&(a=f.alloc(a,0),this._ghash.update(a))}this._called=!0;var t=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(t),this._len+=e.length,t},o.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=i(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,a){var t=0;e.length!==a.length&&t++;for(var c=Math.min(e.length,a.length),f=0;f{var c=t(25799),f=t(36171),d=t(3219);a.createCipher=a.Cipher=c.createCipher,a.createCipheriv=a.Cipheriv=c.createCipheriv,a.createDecipher=a.Decipher=f.createDecipher,a.createDecipheriv=a.Decipheriv=f.createDecipheriv,a.listCiphers=a.getCiphers=function(){return Object.keys(d)}},36171:(e,a,t)=>{var c=t(92356),f=t(92861).Buffer,d=t(530),r=t(50650),n=t(56168),i=t(50462),b=t(68078);function o(e,a,t){n.call(this),this._cache=new s,this._last=void 0,this._cipher=new i.AES(a),this._prev=f.from(t),this._mode=e,this._autopadding=!0}function s(){this.cache=f.allocUnsafe(0)}function l(e,a,t){var n=d[e.toLowerCase()];if(!n)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=f.from(t)),"GCM"!==n.mode&&t.length!==n.iv)throw new TypeError("invalid iv length "+t.length);if("string"==typeof a&&(a=f.from(a)),a.length!==n.key/8)throw new TypeError("invalid key length "+a.length);return"stream"===n.type?new r(n.module,a,t,!0):"auth"===n.type?new c(n.module,a,t,!0):new o(n.module,a,t)}t(56698)(o,n),o.prototype._update=function(e){var a,t;this._cache.add(e);for(var c=[];a=this._cache.get(this._autopadding);)t=this._mode.decrypt(this,a),c.push(t);return f.concat(c)},o.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var a=e[15];if(a<1||a>16)throw new Error("unable to decrypt data");for(var t=-1;++t16)return a=this.cache.slice(0,16),this.cache=this.cache.slice(16),a}else if(this.cache.length>=16)return a=this.cache.slice(0,16),this.cache=this.cache.slice(16),a;return null},s.prototype.flush=function(){if(this.cache.length)return this.cache},a.createDecipher=function(e,a){var t=d[e.toLowerCase()];if(!t)throw new TypeError("invalid suite type");var c=b(a,!1,t.key,t.iv);return l(e,c.key,c.iv)},a.createDecipheriv=l},25799:(e,a,t)=>{var c=t(530),f=t(92356),d=t(92861).Buffer,r=t(50650),n=t(56168),i=t(50462),b=t(68078);function o(e,a,t){n.call(this),this._cache=new l,this._cipher=new i.AES(a),this._prev=d.from(t),this._mode=e,this._autopadding=!0}t(56698)(o,n),o.prototype._update=function(e){var a,t;this._cache.add(e);for(var c=[];a=this._cache.get();)t=this._mode.encrypt(this,a),c.push(t);return d.concat(c)};var s=d.alloc(16,16);function l(){this.cache=d.allocUnsafe(0)}function u(e,a,t){var n=c[e.toLowerCase()];if(!n)throw new TypeError("invalid suite type");if("string"==typeof a&&(a=d.from(a)),a.length!==n.key/8)throw new TypeError("invalid key length "+a.length);if("string"==typeof t&&(t=d.from(t)),"GCM"!==n.mode&&t.length!==n.iv)throw new TypeError("invalid iv length "+t.length);return"stream"===n.type?new r(n.module,a,t):"auth"===n.type?new f(n.module,a,t):new o(n.module,a,t)}o.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(s))throw this._cipher.scrub(),new Error("data not multiple of block length")},o.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},l.prototype.add=function(e){this.cache=d.concat([this.cache,e])},l.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},l.prototype.flush=function(){for(var e=16-this.cache.length,a=d.allocUnsafe(e),t=-1;++t{var c=t(92861).Buffer,f=c.alloc(16,0);function d(e){var a=c.allocUnsafe(16);return a.writeUInt32BE(e[0]>>>0,0),a.writeUInt32BE(e[1]>>>0,4),a.writeUInt32BE(e[2]>>>0,8),a.writeUInt32BE(e[3]>>>0,12),a}function r(e){this.h=e,this.state=c.alloc(16,0),this.cache=c.allocUnsafe(0)}r.prototype.ghash=function(e){for(var a=-1;++a0;a--)c[a]=c[a]>>>1|(1&c[a-1])<<31;c[0]=c[0]>>>1,t&&(c[0]=c[0]^225<<24)}this.state=d(f)},r.prototype.update=function(e){var a;for(this.cache=c.concat([this.cache,e]);this.cache.length>=16;)a=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(a)},r.prototype.final=function(e,a){return this.cache.length&&this.ghash(c.concat([this.cache,f],16)),this.ghash(d([0,e,0,a])),this.state},e.exports=r},45122:e=>{e.exports=function(e){for(var a,t=e.length;t--;){if(255!==(a=e.readUInt8(t))){a++,e.writeUInt8(a,t);break}e.writeUInt8(0,t)}}},92884:(e,a,t)=>{var c=t(30295);a.encrypt=function(e,a){var t=c(a,e._prev);return e._prev=e._cipher.encryptBlock(t),e._prev},a.decrypt=function(e,a){var t=e._prev;e._prev=a;var f=e._cipher.decryptBlock(a);return c(f,t)}},46383:(e,a,t)=>{var c=t(92861).Buffer,f=t(30295);function d(e,a,t){var d=a.length,r=f(a,e._cache);return e._cache=e._cache.slice(d),e._prev=c.concat([e._prev,t?a:r]),r}a.encrypt=function(e,a,t){for(var f,r=c.allocUnsafe(0);a.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=c.allocUnsafe(0)),!(e._cache.length<=a.length)){r=c.concat([r,d(e,a,t)]);break}f=e._cache.length,r=c.concat([r,d(e,a.slice(0,f),t)]),a=a.slice(f)}return r}},55264:(e,a,t)=>{var c=t(92861).Buffer;function f(e,a,t){for(var c,f,r=-1,n=0;++r<8;)c=a&1<<7-r?128:0,n+=(128&(f=e._cipher.encryptBlock(e._prev)[0]^c))>>r%8,e._prev=d(e._prev,t?c:f);return n}function d(e,a){var t=e.length,f=-1,d=c.allocUnsafe(e.length);for(e=c.concat([e,c.from([a])]);++f>7;return d}a.encrypt=function(e,a,t){for(var d=a.length,r=c.allocUnsafe(d),n=-1;++n{var c=t(92861).Buffer;function f(e,a,t){var f=e._cipher.encryptBlock(e._prev)[0]^a;return e._prev=c.concat([e._prev.slice(1),c.from([t?a:f])]),f}a.encrypt=function(e,a,t){for(var d=a.length,r=c.allocUnsafe(d),n=-1;++n{var c=t(30295),f=t(92861).Buffer,d=t(45122);function r(e){var a=e._cipher.encryptBlockRaw(e._prev);return d(e._prev),a}a.encrypt=function(e,a){var t=Math.ceil(a.length/16),d=e._cache.length;e._cache=f.concat([e._cache,f.allocUnsafe(16*t)]);for(var n=0;n{a.encrypt=function(e,a){return e._cipher.encryptBlock(a)},a.decrypt=function(e,a){return e._cipher.decryptBlock(a)}},530:(e,a,t)=>{var c={ECB:t(52632),CBC:t(92884),CFB:t(46383),CFB8:t(86975),CFB1:t(55264),OFB:t(46843),CTR:t(63053),GCM:t(63053)},f=t(3219);for(var d in f)f[d].module=c[f[d].mode];e.exports=f},46843:(e,a,t)=>{var c=t(62045).hp,f=t(30295);function d(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}a.encrypt=function(e,a){for(;e._cache.length{var c=t(50462),f=t(92861).Buffer,d=t(56168);function r(e,a,t,r){d.call(this),this._cipher=new c.AES(a),this._prev=f.from(t),this._cache=f.allocUnsafe(0),this._secCache=f.allocUnsafe(0),this._decrypt=r,this._mode=e}t(56698)(r,d),r.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},r.prototype._final=function(){this._cipher.scrub()},e.exports=r},30125:(e,a,t)=>{var c=t(84050),f=t(1241),d=t(530),r=t(32438),n=t(68078);function i(e,a,t){if(e=e.toLowerCase(),d[e])return f.createCipheriv(e,a,t);if(r[e])return new c({key:a,iv:t,mode:e});throw new TypeError("invalid suite type")}function b(e,a,t){if(e=e.toLowerCase(),d[e])return f.createDecipheriv(e,a,t);if(r[e])return new c({key:a,iv:t,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}a.createCipher=a.Cipher=function(e,a){var t,c;if(e=e.toLowerCase(),d[e])t=d[e].key,c=d[e].iv;else{if(!r[e])throw new TypeError("invalid suite type");t=8*r[e].key,c=r[e].iv}var f=n(a,!1,t,c);return i(e,f.key,f.iv)},a.createCipheriv=a.Cipheriv=i,a.createDecipher=a.Decipher=function(e,a){var t,c;if(e=e.toLowerCase(),d[e])t=d[e].key,c=d[e].iv;else{if(!r[e])throw new TypeError("invalid suite type");t=8*r[e].key,c=r[e].iv}var f=n(a,!1,t,c);return b(e,f.key,f.iv)},a.createDecipheriv=a.Decipheriv=b,a.listCiphers=a.getCiphers=function(){return Object.keys(r).concat(f.getCiphers())}},84050:(e,a,t)=>{var c=t(56168),f=t(29560),d=t(56698),r=t(92861).Buffer,n={"des-ede3-cbc":f.CBC.instantiate(f.EDE),"des-ede3":f.EDE,"des-ede-cbc":f.CBC.instantiate(f.EDE),"des-ede":f.EDE,"des-cbc":f.CBC.instantiate(f.DES),"des-ecb":f.DES};function i(e){c.call(this);var a,t=e.mode.toLowerCase(),f=n[t];a=e.decrypt?"decrypt":"encrypt";var d=e.key;r.isBuffer(d)||(d=r.from(d)),"des-ede"!==t&&"des-ede-cbc"!==t||(d=r.concat([d,d.slice(0,8)]));var i=e.iv;r.isBuffer(i)||(i=r.from(i)),this._des=f.create({key:d,iv:i,type:a})}n.des=n["des-cbc"],n.des3=n["des-ede3-cbc"],e.exports=i,d(i,c),i.prototype._update=function(e){return r.from(this._des.update(e))},i.prototype._final=function(){return r.from(this._des.final())}},32438:(e,a)=>{a["des-ecb"]={key:8,iv:0},a["des-cbc"]=a.des={key:8,iv:8},a["des-ede3-cbc"]=a.des3={key:24,iv:8},a["des-ede3"]={key:24,iv:0},a["des-ede-cbc"]={key:16,iv:8},a["des-ede"]={key:16,iv:0}},67332:(e,a,t)=>{var c=t(62045).hp,f=t(39404),d=t(53209);function r(e){var a,t=e.modulus.byteLength();do{a=new f(d(t))}while(a.cmp(e.modulus)>=0||!a.umod(e.prime1)||!a.umod(e.prime2));return a}function n(e,a){var t=function(e){var a=r(e);return{blinder:a.toRed(f.mont(e.modulus)).redPow(new f(e.publicExponent)).fromRed(),unblinder:a.invm(e.modulus)}}(a),d=a.modulus.byteLength(),n=new f(e).mul(t.blinder).umod(a.modulus),i=n.toRed(f.mont(a.prime1)),b=n.toRed(f.mont(a.prime2)),o=a.coefficient,s=a.prime1,l=a.prime2,u=i.redPow(a.exponent1).fromRed(),h=b.redPow(a.exponent2).fromRed(),p=u.isub(h).imul(o).umod(s).imul(l);return h.iadd(p).imul(t.unblinder).umod(a.modulus).toArrayLike(c,"be",d)}n.getr=r,e.exports=n},55715:(e,a,t)=>{"use strict";e.exports=t(62951)},20:(e,a,t)=>{"use strict";var c=t(92861).Buffer,f=t(47108),d=t(46737),r=t(56698),n=t(35359),i=t(74847),b=t(62951);function o(e){d.Writable.call(this);var a=b[e];if(!a)throw new Error("Unknown message digest");this._hashType=a.hash,this._hash=f(a.hash),this._tag=a.id,this._signType=a.sign}function s(e){d.Writable.call(this);var a=b[e];if(!a)throw new Error("Unknown message digest");this._hash=f(a.hash),this._tag=a.id,this._signType=a.sign}function l(e){return new o(e)}function u(e){return new s(e)}Object.keys(b).forEach((function(e){b[e].id=c.from(b[e].id,"hex"),b[e.toLowerCase()]=b[e]})),r(o,d.Writable),o.prototype._write=function(e,a,t){this._hash.update(e),t()},o.prototype.update=function(e,a){return this._hash.update("string"==typeof e?c.from(e,a):e),this},o.prototype.sign=function(e,a){this.end();var t=this._hash.digest(),c=n(t,e,this._hashType,this._signType,this._tag);return a?c.toString(a):c},r(s,d.Writable),s.prototype._write=function(e,a,t){this._hash.update(e),t()},s.prototype.update=function(e,a){return this._hash.update("string"==typeof e?c.from(e,a):e),this},s.prototype.verify=function(e,a,t){var f="string"==typeof a?c.from(a,t):a;this.end();var d=this._hash.digest();return i(f,d,e,this._signType,this._tag)},e.exports={Sign:l,Verify:u,createSign:l,createVerify:u}},35359:(e,a,t)=>{"use strict";var c=t(92861).Buffer,f=t(83507),d=t(67332),r=t(86729).ec,n=t(39404),i=t(78170),b=t(64589);function o(e,a,t,d){if((e=c.from(e.toArray())).length0&&t.ishrn(c),t}function l(e,a,t){var d,r;do{for(d=c.alloc(0);8*d.length{"use strict";var c=t(92861).Buffer,f=t(39404),d=t(86729).ec,r=t(78170),n=t(64589);function i(e,a){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(a)>=0)throw new Error("invalid sig")}e.exports=function(e,a,t,b,o){var s=r(t);if("ec"===s.type){if("ecdsa"!==b&&"ecdsa/rsa"!==b)throw new Error("wrong public key type");return function(e,a,t){var c=n[t.data.algorithm.curve.join(".")];if(!c)throw new Error("unknown curve "+t.data.algorithm.curve.join("."));var f=new d(c),r=t.data.subjectPrivateKey.data;return f.verify(a,e,r)}(e,a,s)}if("dsa"===s.type){if("dsa"!==b)throw new Error("wrong public key type");return function(e,a,t){var c=t.data.p,d=t.data.q,n=t.data.g,b=t.data.pub_key,o=r.signature.decode(e,"der"),s=o.s,l=o.r;i(s,d),i(l,d);var u=f.mont(c),h=s.invm(d);return 0===n.toRed(u).redPow(new f(a).mul(h).mod(d)).fromRed().mul(b.toRed(u).redPow(l.mul(h).mod(d)).fromRed()).mod(c).mod(d).cmp(l)}(e,a,s)}if("rsa"!==b&&"ecdsa/rsa"!==b)throw new Error("wrong public key type");a=c.concat([o,a]);for(var l=s.modulus.byteLength(),u=[1],h=0;a.length+u.length+2{var a={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==a.call(e)}},26248:(e,a,t)=>{"use strict";var c=t(33225),f=Object.keys||function(e){var a=[];for(var t in e)a.push(t);return a};e.exports=s;var d=Object.create(t(15622));d.inherits=t(56698);var r=t(30206),n=t(7314);d.inherits(s,r);for(var i=f(n.prototype),b=0;b{"use strict";e.exports=d;var c=t(81816),f=Object.create(t(15622));function d(e){if(!(this instanceof d))return new d(e);c.call(this,e)}f.inherits=t(56698),f.inherits(d,c),d.prototype._transform=function(e,a,t){t(null,e)}},30206:(e,a,t)=>{"use strict";var c=t(33225);e.exports=x;var f,d=t(32240);x.ReadableState=m,t(37007).EventEmitter;var r=function(e,a){return e.listeners(a).length},n=t(5567),i=t(24116).Buffer,b=(void 0!==t.g?t.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},o=Object.create(t(15622));o.inherits=t(56698);var s=t(92668),l=void 0;l=s&&s.debuglog?s.debuglog("stream"):function(){};var u,h=t(20672),p=t(36278);o.inherits(x,n);var g=["error","close","destroy","pause","resume"];function m(e,a){e=e||{};var c=a instanceof(f=f||t(26248));this.objectMode=!!e.objectMode,c&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var d=e.highWaterMark,r=e.readableHighWaterMark,n=this.objectMode?16:16384;this.highWaterMark=d||0===d?d:c&&(r||0===r)?r:n,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new h,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(u||(u=t(6427).I),this.decoder=new u(e.encoding),this.encoding=e.encoding)}function x(e){if(f=f||t(26248),!(this instanceof x))return new x(e);this._readableState=new m(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),n.call(this)}function y(e,a,t,c,f){var d,r=e._readableState;return null===a?(r.reading=!1,function(e,a){if(!a.ended){if(a.decoder){var t=a.decoder.end();t&&t.length&&(a.buffer.push(t),a.length+=a.objectMode?1:t.length)}a.ended=!0,_(e)}}(e,r)):(f||(d=function(e,a){var t,c;return c=a,i.isBuffer(c)||c instanceof b||"string"==typeof a||void 0===a||e.objectMode||(t=new TypeError("Invalid non-string/buffer chunk")),t}(r,a)),d?e.emit("error",d):r.objectMode||a&&a.length>0?("string"==typeof a||r.objectMode||Object.getPrototypeOf(a)===i.prototype||(a=function(e){return i.from(e)}(a)),c?r.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):A(e,r,a,!0):r.ended?e.emit("error",new Error("stream.push() after EOF")):(r.reading=!1,r.decoder&&!t?(a=r.decoder.write(a),r.objectMode||0!==a.length?A(e,r,a,!1):E(e,r)):A(e,r,a,!1))):c||(r.reading=!1)),function(e){return!e.ended&&(e.needReadable||e.lengtha.highWaterMark&&(a.highWaterMark=function(e){return e>=v?e=v:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=a.length?e:a.ended?a.length:(a.needReadable=!0,0))}function _(e){var a=e._readableState;a.needReadable=!1,a.emittedReadable||(l("emitReadable",a.flowing),a.emittedReadable=!0,a.sync?c.nextTick(I,e):I(e))}function I(e){l("emit readable"),e.emit("readable"),k(e)}function E(e,a){a.readingMore||(a.readingMore=!0,c.nextTick(C,e,a))}function C(e,a){for(var t=a.length;!a.reading&&!a.flowing&&!a.ended&&a.length=a.length?(t=a.decoder?a.buffer.join(""):1===a.buffer.length?a.buffer.head.data:a.buffer.concat(a.length),a.buffer.clear()):t=function(e,a,t){var c;return ed.length?d.length:e;if(r===d.length?f+=d:f+=d.slice(0,e),0==(e-=r)){r===d.length?(++c,t.next?a.head=t.next:a.head=a.tail=null):(a.head=t,t.data=d.slice(r));break}++c}return a.length-=c,f}(e,a):function(e,a){var t=i.allocUnsafe(e),c=a.head,f=1;for(c.data.copy(t),e-=c.data.length;c=c.next;){var d=c.data,r=e>d.length?d.length:e;if(d.copy(t,t.length-e,0,r),0==(e-=r)){r===d.length?(++f,c.next?a.head=c.next:a.head=a.tail=null):(a.head=c,c.data=d.slice(r));break}++f}return a.length-=f,t}(e,a),c}(e,a.buffer,a.decoder),t);var t}function S(e){var a=e._readableState;if(a.length>0)throw new Error('"endReadable()" called on non-empty stream');a.endEmitted||(a.ended=!0,c.nextTick(T,a,e))}function T(e,a){e.endEmitted||0!==e.length||(e.endEmitted=!0,a.readable=!1,a.emit("end"))}function N(e,a){for(var t=0,c=e.length;t=a.highWaterMark||a.ended))return l("read: emitReadable",a.length,a.ended),0===a.length&&a.ended?S(this):_(this),null;if(0===(e=w(e,a))&&a.ended)return 0===a.length&&S(this),null;var c,f=a.needReadable;return l("need readable",f),(0===a.length||a.length-e0?L(e,a):null)?(a.needReadable=!0,e=0):a.length-=e,0===a.length&&(a.ended||(a.needReadable=!0),t!==e&&a.ended&&S(this)),null!==c&&this.emit("data",c),c},x.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},x.prototype.pipe=function(e,a){var t=this,f=this._readableState;switch(f.pipesCount){case 0:f.pipes=e;break;case 1:f.pipes=[f.pipes,e];break;default:f.pipes.push(e)}f.pipesCount+=1,l("pipe count=%d opts=%j",f.pipesCount,a);var n=a&&!1===a.end||e===process.stdout||e===process.stderr?m:i;function i(){l("onend"),e.end()}f.endEmitted?c.nextTick(n):t.once("end",n),e.on("unpipe",(function a(c,d){l("onunpipe"),c===t&&d&&!1===d.hasUnpiped&&(d.hasUnpiped=!0,l("cleanup"),e.removeListener("close",p),e.removeListener("finish",g),e.removeListener("drain",b),e.removeListener("error",h),e.removeListener("unpipe",a),t.removeListener("end",i),t.removeListener("end",m),t.removeListener("data",u),o=!0,!f.awaitDrain||e._writableState&&!e._writableState.needDrain||b())}));var b=function(e){return function(){var a=e._readableState;l("pipeOnDrain",a.awaitDrain),a.awaitDrain&&a.awaitDrain--,0===a.awaitDrain&&r(e,"data")&&(a.flowing=!0,k(e))}}(t);e.on("drain",b);var o=!1,s=!1;function u(a){l("ondata"),s=!1,!1!==e.write(a)||s||((1===f.pipesCount&&f.pipes===e||f.pipesCount>1&&-1!==N(f.pipes,e))&&!o&&(l("false write response, pause",f.awaitDrain),f.awaitDrain++,s=!0),t.pause())}function h(a){l("onerror",a),m(),e.removeListener("error",h),0===r(e,"error")&&e.emit("error",a)}function p(){e.removeListener("finish",g),m()}function g(){l("onfinish"),e.removeListener("close",p),m()}function m(){l("unpipe"),t.unpipe(e)}return t.on("data",u),function(e,a,t){if("function"==typeof e.prependListener)return e.prependListener(a,t);e._events&&e._events[a]?d(e._events[a])?e._events[a].unshift(t):e._events[a]=[t,e._events[a]]:e.on(a,t)}(e,"error",h),e.once("close",p),e.once("finish",g),e.emit("pipe",t),f.flowing||(l("pipe resume"),t.resume()),e},x.prototype.unpipe=function(e){var a=this._readableState,t={hasUnpiped:!1};if(0===a.pipesCount)return this;if(1===a.pipesCount)return e&&e!==a.pipes||(e||(e=a.pipes),a.pipes=null,a.pipesCount=0,a.flowing=!1,e&&e.emit("unpipe",this,t)),this;if(!e){var c=a.pipes,f=a.pipesCount;a.pipes=null,a.pipesCount=0,a.flowing=!1;for(var d=0;d{"use strict";e.exports=r;var c=t(26248),f=Object.create(t(15622));function d(e,a){var t=this._transformState;t.transforming=!1;var c=t.writecb;if(!c)return this.emit("error",new Error("write callback called multiple times"));t.writechunk=null,t.writecb=null,null!=a&&this.push(a),c(e);var f=this._readableState;f.reading=!1,(f.needReadable||f.length{"use strict";var c=t(33225);function f(e){var a=this;this.next=null,this.entry=null,this.finish=function(){!function(e,a){var t=e.entry;for(e.entry=null;t;){var c=t.callback;a.pendingcb--,c(undefined),t=t.next}a.corkedRequestsFree.next=e}(a,e)}}e.exports=g;var d,r=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:c.nextTick;g.WritableState=p;var n=Object.create(t(15622));n.inherits=t(56698);var i,b={deprecate:t(94643)},o=t(5567),s=t(24116).Buffer,l=(void 0!==t.g?t.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},u=t(36278);function h(){}function p(e,a){d=d||t(26248),e=e||{};var n=a instanceof d;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,b=e.writableHighWaterMark,o=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(b||0===b)?b:o,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,a){var t=e._writableState,f=t.sync,d=t.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(t),a)!function(e,a,t,f,d){--a.pendingcb,t?(c.nextTick(d,f),c.nextTick(w,e,a),e._writableState.errorEmitted=!0,e.emit("error",f)):(d(f),e._writableState.errorEmitted=!0,e.emit("error",f),w(e,a))}(e,t,f,a,d);else{var n=A(t);n||t.corked||t.bufferProcessing||!t.bufferedRequest||y(e,t),f?r(x,e,t,n,d):x(e,t,n,d)}}(a,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new f(this)}function g(e){if(d=d||t(26248),!(i.call(g,this)||this instanceof d))return new g(e);this._writableState=new p(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),o.call(this)}function m(e,a,t,c,f,d,r){a.writelen=c,a.writecb=r,a.writing=!0,a.sync=!0,t?e._writev(f,a.onwrite):e._write(f,d,a.onwrite),a.sync=!1}function x(e,a,t,c){t||function(e,a){0===a.length&&a.needDrain&&(a.needDrain=!1,e.emit("drain"))}(e,a),a.pendingcb--,c(),w(e,a)}function y(e,a){a.bufferProcessing=!0;var t=a.bufferedRequest;if(e._writev&&t&&t.next){var c=a.bufferedRequestCount,d=new Array(c),r=a.corkedRequestsFree;r.entry=t;for(var n=0,i=!0;t;)d[n]=t,t.isBuf||(i=!1),t=t.next,n+=1;d.allBuffers=i,m(e,a,!0,a.length,d,"",r.finish),a.pendingcb++,a.lastBufferedRequest=null,r.next?(a.corkedRequestsFree=r.next,r.next=null):a.corkedRequestsFree=new f(a),a.bufferedRequestCount=0}else{for(;t;){var b=t.chunk,o=t.encoding,s=t.callback;if(m(e,a,!1,a.objectMode?1:b.length,b,o,s),t=t.next,a.bufferedRequestCount--,a.writing)break}null===t&&(a.lastBufferedRequest=null)}a.bufferedRequest=t,a.bufferProcessing=!1}function A(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function v(e,a){e._final((function(t){a.pendingcb--,t&&e.emit("error",t),a.prefinished=!0,e.emit("prefinish"),w(e,a)}))}function w(e,a){var t=A(a);return t&&(function(e,a){a.prefinished||a.finalCalled||("function"==typeof e._final?(a.pendingcb++,a.finalCalled=!0,c.nextTick(v,e,a)):(a.prefinished=!0,e.emit("prefinish")))}(e,a),0===a.pendingcb&&(a.finished=!0,e.emit("finish"))),t}n.inherits(g,o),p.prototype.getBuffer=function(){for(var e=this.bufferedRequest,a=[];e;)a.push(e),e=e.next;return a},function(){try{Object.defineProperty(p.prototype,"buffer",{get:b.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(i=Function.prototype[Symbol.hasInstance],Object.defineProperty(g,Symbol.hasInstance,{value:function(e){return!!i.call(this,e)||this===g&&e&&e._writableState instanceof p}})):i=function(e){return e instanceof this},g.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},g.prototype.write=function(e,a,t){var f,d=this._writableState,r=!1,n=!d.objectMode&&(f=e,s.isBuffer(f)||f instanceof l);return n&&!s.isBuffer(e)&&(e=function(e){return s.from(e)}(e)),"function"==typeof a&&(t=a,a=null),n?a="buffer":a||(a=d.defaultEncoding),"function"!=typeof t&&(t=h),d.ended?function(e,a){var t=new Error("write after end");e.emit("error",t),c.nextTick(a,t)}(this,t):(n||function(e,a,t,f){var d=!0,r=!1;return null===t?r=new TypeError("May not write null values to stream"):"string"==typeof t||void 0===t||a.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r&&(e.emit("error",r),c.nextTick(f,r),d=!1),d}(this,d,e,t))&&(d.pendingcb++,r=function(e,a,t,c,f,d){if(!t){var r=function(e,a,t){return e.objectMode||!1===e.decodeStrings||"string"!=typeof a||(a=s.from(a,t)),a}(a,c,f);c!==r&&(t=!0,f="buffer",c=r)}var n=a.objectMode?1:c.length;a.length+=n;var i=a.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(g.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),g.prototype._write=function(e,a,t){t(new Error("_write() is not implemented"))},g.prototype._writev=null,g.prototype.end=function(e,a,t){var f=this._writableState;"function"==typeof e?(t=e,e=null,a=null):"function"==typeof a&&(t=a,a=null),null!=e&&this.write(e,a),f.corked&&(f.corked=1,this.uncork()),f.ending||function(e,a,t){a.ending=!0,w(e,a),t&&(a.finished?c.nextTick(t):e.once("finish",t)),a.ended=!0,e.writable=!1}(this,f,t)},Object.defineProperty(g.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),g.prototype.destroy=u.destroy,g.prototype._undestroy=u.undestroy,g.prototype._destroy=function(e,a){this.end(),a(e)}},20672:(e,a,t)=>{"use strict";var c=t(24116).Buffer,f=t(21638);e.exports=function(){function e(){!function(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var a={data:e,next:null};this.length>0?this.tail.next=a:this.head=a,this.tail=a,++this.length},e.prototype.unshift=function(e){var a={data:e,next:this.head};0===this.length&&(this.tail=a),this.head=a,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var a=this.head,t=""+a.data;a=a.next;)t+=e+a.data;return t},e.prototype.concat=function(e){if(0===this.length)return c.alloc(0);for(var a,t,f=c.allocUnsafe(e>>>0),d=this.head,r=0;d;)a=f,t=r,d.data.copy(a,t),r+=d.data.length,d=d.next;return f},e}(),f&&f.inspect&&f.inspect.custom&&(e.exports.prototype[f.inspect.custom]=function(){var e=f.inspect({length:this.length});return this.constructor.name+" "+e})},36278:(e,a,t)=>{"use strict";var c=t(33225);function f(e,a){e.emit("error",a)}e.exports={destroy:function(e,a){var t=this,d=this._readableState&&this._readableState.destroyed,r=this._writableState&&this._writableState.destroyed;return d||r?(a?a(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,c.nextTick(f,this,e)):c.nextTick(f,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!a&&e?t._writableState?t._writableState.errorEmitted||(t._writableState.errorEmitted=!0,c.nextTick(f,t,e)):c.nextTick(f,t,e):a&&a(e)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},5567:(e,a,t)=>{e.exports=t(37007).EventEmitter},24116:(e,a,t)=>{var c=t(48287),f=c.Buffer;function d(e,a){for(var t in e)a[t]=e[t]}function r(e,a,t){return f(e,a,t)}f.from&&f.alloc&&f.allocUnsafe&&f.allocUnsafeSlow?e.exports=c:(d(c,a),a.Buffer=r),d(f,r),r.from=function(e,a,t){if("number"==typeof e)throw new TypeError("Argument must not be a number");return f(e,a,t)},r.alloc=function(e,a,t){if("number"!=typeof e)throw new TypeError("Argument must be a number");var c=f(e);return void 0!==a?"string"==typeof t?c.fill(a,t):c.fill(a):c.fill(0),c},r.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return f(e)},r.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return c.SlowBuffer(e)}},46737:(e,a,t)=>{(a=e.exports=t(30206)).Stream=a,a.Readable=a,a.Writable=t(7314),a.Duplex=t(26248),a.Transform=t(81816),a.PassThrough=t(75242)},6427:(e,a,t)=>{"use strict";var c=t(88393).Buffer,f=c.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function d(e){var a;switch(this.encoding=function(e){var a=function(e){if(!e)return"utf8";for(var a;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(a)return;e=(""+e).toLowerCase(),a=!0}}(e);if("string"!=typeof a&&(c.isEncoding===f||!f(e)))throw new Error("Unknown encoding: "+e);return a||e}(e),this.encoding){case"utf16le":this.text=i,this.end=b,a=4;break;case"utf8":this.fillLast=n,a=4;break;case"base64":this.text=o,this.end=s,a=3;break;default:return this.write=l,void(this.end=u)}this.lastNeed=0,this.lastTotal=0,this.lastChar=c.allocUnsafe(a)}function r(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function n(e){var a=this.lastTotal-this.lastNeed,t=function(e,a){if(128!=(192&a[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&a.length>1){if(128!=(192&a[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&a.length>2&&128!=(192&a[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==t?t:this.lastNeed<=e.length?(e.copy(this.lastChar,a,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,a,0,e.length),void(this.lastNeed-=e.length))}function i(e,a){if((e.length-a)%2==0){var t=e.toString("utf16le",a);if(t){var c=t.charCodeAt(t.length-1);if(c>=55296&&c<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",a,e.length-1)}function b(e){var a=e&&e.length?this.write(e):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return a+this.lastChar.toString("utf16le",0,t)}return a}function o(e,a){var t=(e.length-a)%3;return 0===t?e.toString("base64",a):(this.lastNeed=3-t,this.lastTotal=3,1===t?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",a,e.length-t))}function s(e){var a=e&&e.length?this.write(e):"";return this.lastNeed?a+this.lastChar.toString("base64",0,3-this.lastNeed):a}function l(e){return e.toString(this.encoding)}function u(e){return e&&e.length?this.write(e):""}a.I=d,d.prototype.write=function(e){if(0===e.length)return"";var a,t;if(this.lastNeed){if(void 0===(a=this.fillLast(e)))return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t=0?(f>0&&(e.lastNeed=f-1),f):--c=0?(f>0&&(e.lastNeed=f-2),f):--c=0?(f>0&&(2===f?f=0:e.lastNeed=f-3),f):0}(this,e,a);if(!this.lastNeed)return e.toString("utf8",a);this.lastTotal=t;var c=e.length-(t-this.lastNeed);return e.copy(this.lastChar,0,c),e.toString("utf8",a,c)},d.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},88393:(e,a,t)=>{var c=t(48287),f=c.Buffer;function d(e,a){for(var t in e)a[t]=e[t]}function r(e,a,t){return f(e,a,t)}f.from&&f.alloc&&f.allocUnsafe&&f.allocUnsafeSlow?e.exports=c:(d(c,a),a.Buffer=r),d(f,r),r.from=function(e,a,t){if("number"==typeof e)throw new TypeError("Argument must not be a number");return f(e,a,t)},r.alloc=function(e,a,t){if("number"!=typeof e)throw new TypeError("Argument must be a number");var c=f(e);return void 0!==a?"string"==typeof t?c.fill(a,t):c.fill(a):c.fill(0),c},r.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return f(e)},r.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return c.SlowBuffer(e)}},5974:(e,a,t)=>{"use strict";var c=t(62045).hp,f=t(94148),d=t(44442),r=t(58411),n=t(71447),i=t(19681);for(var b in i)a[b]=i[b];function o(e){if("number"!=typeof e||ea.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}a.NONE=0,a.DEFLATE=1,a.INFLATE=2,a.GZIP=3,a.GUNZIP=4,a.DEFLATERAW=5,a.INFLATERAW=6,a.UNZIP=7,o.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,f(this.init_done,"close before init"),f(this.mode<=a.UNZIP),this.mode===a.DEFLATE||this.mode===a.GZIP||this.mode===a.DEFLATERAW?r.deflateEnd(this.strm):this.mode!==a.INFLATE&&this.mode!==a.GUNZIP&&this.mode!==a.INFLATERAW&&this.mode!==a.UNZIP||n.inflateEnd(this.strm),this.mode=a.NONE,this.dictionary=null)},o.prototype.write=function(e,a,t,c,f,d,r){return this._write(!0,e,a,t,c,f,d,r)},o.prototype.writeSync=function(e,a,t,c,f,d,r){return this._write(!1,e,a,t,c,f,d,r)},o.prototype._write=function(e,t,d,r,n,i,b,o){if(f.equal(arguments.length,8),f(this.init_done,"write before init"),f(this.mode!==a.NONE,"already finalized"),f.equal(!1,this.write_in_progress,"write already in progress"),f.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,f.equal(!1,void 0===t,"must provide flush value"),this.write_in_progress=!0,t!==a.Z_NO_FLUSH&&t!==a.Z_PARTIAL_FLUSH&&t!==a.Z_SYNC_FLUSH&&t!==a.Z_FULL_FLUSH&&t!==a.Z_FINISH&&t!==a.Z_BLOCK)throw new Error("Invalid flush value");if(null==d&&(d=c.alloc(0),n=0,r=0),this.strm.avail_in=n,this.strm.input=d,this.strm.next_in=r,this.strm.avail_out=o,this.strm.output=i,this.strm.next_out=b,this.flush=t,!e)return this._process(),this._checkError()?this._afterSync():void 0;var s=this;return process.nextTick((function(){s._process(),s._after()})),this},o.prototype._afterSync=function(){var e=this.strm.avail_out,a=this.strm.avail_in;return this.write_in_progress=!1,[a,e]},o.prototype._process=function(){var e=null;switch(this.mode){case a.DEFLATE:case a.GZIP:case a.DEFLATERAW:this.err=r.deflate(this.strm,this.flush);break;case a.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===e)break;if(31!==this.strm.input[e]){this.mode=a.INFLATE;break}if(this.gzip_id_bytes_read=1,e++,1===this.strm.avail_in)break;case 1:if(null===e)break;139===this.strm.input[e]?(this.gzip_id_bytes_read=2,this.mode=a.GUNZIP):this.mode=a.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case a.INFLATE:case a.GUNZIP:case a.INFLATERAW:for(this.err=n.inflate(this.strm,this.flush),this.err===a.Z_NEED_DICT&&this.dictionary&&(this.err=n.inflateSetDictionary(this.strm,this.dictionary),this.err===a.Z_OK?this.err=n.inflate(this.strm,this.flush):this.err===a.Z_DATA_ERROR&&(this.err=a.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===a.GUNZIP&&this.err===a.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=n.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},o.prototype._checkError=function(){switch(this.err){case a.Z_OK:case a.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===a.Z_FINISH)return this._error("unexpected end of file"),!1;break;case a.Z_STREAM_END:break;case a.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},o.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,a=this.strm.avail_in;this.write_in_progress=!1,this.callback(a,e),this.pending_close&&this.close()}},o.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},o.prototype.init=function(e,t,c,d,r){f(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),f(e>=8&&e<=15,"invalid windowBits"),f(t>=-1&&t<=9,"invalid compression level"),f(c>=1&&c<=9,"invalid memlevel"),f(d===a.Z_FILTERED||d===a.Z_HUFFMAN_ONLY||d===a.Z_RLE||d===a.Z_FIXED||d===a.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(t,e,c,d,r),this._setDictionary()},o.prototype.params=function(){throw new Error("deflateParams Not supported")},o.prototype.reset=function(){this._reset(),this._setDictionary()},o.prototype._init=function(e,t,c,f,i){switch(this.level=e,this.windowBits=t,this.memLevel=c,this.strategy=f,this.flush=a.Z_NO_FLUSH,this.err=a.Z_OK,this.mode!==a.GZIP&&this.mode!==a.GUNZIP||(this.windowBits+=16),this.mode===a.UNZIP&&(this.windowBits+=32),this.mode!==a.DEFLATERAW&&this.mode!==a.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new d,this.mode){case a.DEFLATE:case a.GZIP:case a.DEFLATERAW:this.err=r.deflateInit2(this.strm,this.level,a.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case a.INFLATE:case a.GUNZIP:case a.INFLATERAW:case a.UNZIP:this.err=n.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==a.Z_OK&&this._error("Init error"),this.dictionary=i,this.write_in_progress=!1,this.init_done=!0},o.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=a.Z_OK,this.mode){case a.DEFLATE:case a.DEFLATERAW:this.err=r.deflateSetDictionary(this.strm,this.dictionary)}this.err!==a.Z_OK&&this._error("Failed to set dictionary")}},o.prototype._reset=function(){switch(this.err=a.Z_OK,this.mode){case a.DEFLATE:case a.DEFLATERAW:case a.GZIP:this.err=r.deflateReset(this.strm);break;case a.INFLATE:case a.INFLATERAW:case a.GUNZIP:this.err=n.inflateReset(this.strm)}this.err!==a.Z_OK&&this._error("Failed to reset stream")},a.Zlib=o},78559:(e,a,t)=>{"use strict";var c=t(48287).Buffer,f=t(88310).Transform,d=t(5974),r=t(40537),n=t(94148).ok,i=t(48287).kMaxLength,b="Cannot create final Buffer. It would be larger than 0x"+i.toString(16)+" bytes";d.Z_MIN_WINDOWBITS=8,d.Z_MAX_WINDOWBITS=15,d.Z_DEFAULT_WINDOWBITS=15,d.Z_MIN_CHUNK=64,d.Z_MAX_CHUNK=1/0,d.Z_DEFAULT_CHUNK=16384,d.Z_MIN_MEMLEVEL=1,d.Z_MAX_MEMLEVEL=9,d.Z_DEFAULT_MEMLEVEL=8,d.Z_MIN_LEVEL=-1,d.Z_MAX_LEVEL=9,d.Z_DEFAULT_LEVEL=d.Z_DEFAULT_COMPRESSION;for(var o=Object.keys(d),s=0;s=i?r=new RangeError(b):a=c.concat(f,d),f=[],e.close(),t(r,a)}e.on("error",(function(a){e.removeListener("end",n),e.removeListener("readable",r),t(a)})),e.on("end",n),e.end(a),r()}function x(e,a){if("string"==typeof a&&(a=c.from(a)),!c.isBuffer(a))throw new TypeError("Not a string or buffer");var t=e._finishFlushFlag;return e._processChunk(a,t)}function y(e){if(!(this instanceof y))return new y(e);M.call(this,e,d.DEFLATE)}function A(e){if(!(this instanceof A))return new A(e);M.call(this,e,d.INFLATE)}function v(e){if(!(this instanceof v))return new v(e);M.call(this,e,d.GZIP)}function w(e){if(!(this instanceof w))return new w(e);M.call(this,e,d.GUNZIP)}function _(e){if(!(this instanceof _))return new _(e);M.call(this,e,d.DEFLATERAW)}function I(e){if(!(this instanceof I))return new I(e);M.call(this,e,d.INFLATERAW)}function E(e){if(!(this instanceof E))return new E(e);M.call(this,e,d.UNZIP)}function C(e){return e===d.Z_NO_FLUSH||e===d.Z_PARTIAL_FLUSH||e===d.Z_SYNC_FLUSH||e===d.Z_FULL_FLUSH||e===d.Z_FINISH||e===d.Z_BLOCK}function M(e,t){var r=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||a.Z_DEFAULT_CHUNK,f.call(this,e),e.flush&&!C(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!C(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||d.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:d.Z_FINISH,e.chunkSize&&(e.chunkSizea.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsa.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levela.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevela.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=a.Z_FILTERED&&e.strategy!=a.Z_HUFFMAN_ONLY&&e.strategy!=a.Z_RLE&&e.strategy!=a.Z_FIXED&&e.strategy!=a.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!c.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new d.Zlib(t);var n=this;this._hadError=!1,this._handle.onerror=function(e,t){B(n),n._hadError=!0;var c=new Error(e);c.errno=t,c.code=a.codes[t],n.emit("error",c)};var i=a.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(i=e.level);var b=a.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(b=e.strategy),this._handle.init(e.windowBits||a.Z_DEFAULT_WINDOWBITS,i,e.memLevel||a.Z_DEFAULT_MEMLEVEL,b,e.dictionary),this._buffer=c.allocUnsafe(this._chunkSize),this._offset=0,this._level=i,this._strategy=b,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!r._handle},configurable:!0,enumerable:!0})}function B(e,a){a&&process.nextTick(a),e._handle&&(e._handle.close(),e._handle=null)}function k(e){e.emit("close")}Object.defineProperty(a,"codes",{enumerable:!0,value:Object.freeze(u),writable:!1}),a.Deflate=y,a.Inflate=A,a.Gzip=v,a.Gunzip=w,a.DeflateRaw=_,a.InflateRaw=I,a.Unzip=E,a.createDeflate=function(e){return new y(e)},a.createInflate=function(e){return new A(e)},a.createDeflateRaw=function(e){return new _(e)},a.createInflateRaw=function(e){return new I(e)},a.createGzip=function(e){return new v(e)},a.createGunzip=function(e){return new w(e)},a.createUnzip=function(e){return new E(e)},a.deflate=function(e,a,t){return"function"==typeof a&&(t=a,a={}),m(new y(a),e,t)},a.deflateSync=function(e,a){return x(new y(a),e)},a.gzip=function(e,a,t){return"function"==typeof a&&(t=a,a={}),m(new v(a),e,t)},a.gzipSync=function(e,a){return x(new v(a),e)},a.deflateRaw=function(e,a,t){return"function"==typeof a&&(t=a,a={}),m(new _(a),e,t)},a.deflateRawSync=function(e,a){return x(new _(a),e)},a.unzip=function(e,a,t){return"function"==typeof a&&(t=a,a={}),m(new E(a),e,t)},a.unzipSync=function(e,a){return x(new E(a),e)},a.inflate=function(e,a,t){return"function"==typeof a&&(t=a,a={}),m(new A(a),e,t)},a.inflateSync=function(e,a){return x(new A(a),e)},a.gunzip=function(e,a,t){return"function"==typeof a&&(t=a,a={}),m(new w(a),e,t)},a.gunzipSync=function(e,a){return x(new w(a),e)},a.inflateRaw=function(e,a,t){return"function"==typeof a&&(t=a,a={}),m(new I(a),e,t)},a.inflateRawSync=function(e,a){return x(new I(a),e)},r.inherits(M,f),M.prototype.params=function(e,t,c){if(ea.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=a.Z_FILTERED&&t!=a.Z_HUFFMAN_ONLY&&t!=a.Z_RLE&&t!=a.Z_FIXED&&t!=a.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var f=this;this.flush(d.Z_SYNC_FLUSH,(function(){n(f._handle,"zlib binding closed"),f._handle.params(e,t),f._hadError||(f._level=e,f._strategy=t,c&&c())}))}else process.nextTick(c)},M.prototype.reset=function(){return n(this._handle,"zlib binding closed"),this._handle.reset()},M.prototype._flush=function(e){this._transform(c.alloc(0),"",e)},M.prototype.flush=function(e,a){var t=this,f=this._writableState;("function"==typeof e||void 0===e&&!a)&&(a=e,e=d.Z_FULL_FLUSH),f.ended?a&&process.nextTick(a):f.ending?a&&this.once("end",a):f.needDrain?a&&this.once("drain",(function(){return t.flush(e,a)})):(this._flushFlag=e,this.write(c.alloc(0),"",a))},M.prototype.close=function(e){B(this,e),process.nextTick(k,this)},M.prototype._transform=function(e,a,t){var f,r=this._writableState,n=(r.ending||r.ended)&&(!e||r.length===e.length);return null===e||c.isBuffer(e)?this._handle?(n?f=this._finishFlushFlag:(f=this._flushFlag,e.length>=r.length&&(this._flushFlag=this._opts.flush||d.Z_NO_FLUSH)),void this._processChunk(e,f,t)):t(new Error("zlib binding closed")):t(new Error("invalid input"))},M.prototype._processChunk=function(e,a,t){var f=e&&e.length,d=this._chunkSize-this._offset,r=0,o=this,s="function"==typeof t;if(!s){var l,u=[],h=0;this.on("error",(function(e){l=e})),n(this._handle,"zlib binding closed");do{var p=this._handle.writeSync(a,e,r,f,this._buffer,this._offset,d)}while(!this._hadError&&x(p[0],p[1]));if(this._hadError)throw l;if(h>=i)throw B(this),new RangeError(b);var g=c.concat(u,h);return B(this),g}n(this._handle,"zlib binding closed");var m=this._handle.write(a,e,r,f,this._buffer,this._offset,d);function x(i,b){if(this&&(this.buffer=null,this.callback=null),!o._hadError){var l=d-b;if(n(l>=0,"have should not go down"),l>0){var p=o._buffer.slice(o._offset,o._offset+l);o._offset+=l,s?o.push(p):(u.push(p),h+=p.length)}if((0===b||o._offset>=o._chunkSize)&&(d=o._chunkSize,o._offset=0,o._buffer=c.allocUnsafe(o._chunkSize)),0===b){if(r+=f-i,f=i,!s)return!0;var g=o._handle.write(a,e,r,f,o._buffer,o._offset,o._chunkSize);return g.callback=x,void(g.buffer=e)}if(!s)return!1;t()}}m.buffer=e,m.callback=x},r.inherits(y,M),r.inherits(A,M),r.inherits(v,M),r.inherits(w,M),r.inherits(_,M),r.inherits(I,M),r.inherits(E,M)},30295:(e,a,t)=>{var c=t(62045).hp;e.exports=function(e,a){for(var t=Math.min(e.length,a.length),f=new c(t),d=0;d{"use strict";var c=t(67526),f=t(251),d="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;a.Buffer=i,a.SlowBuffer=function(e){return+e!=e&&(e=0),i.alloc(+e)},a.INSPECT_MAX_BYTES=50;var r=2147483647;function n(e){if(e>r)throw new RangeError('The value "'+e+'" is invalid for option "size"');var a=new Uint8Array(e);return Object.setPrototypeOf(a,i.prototype),a}function i(e,a,t){if("number"==typeof e){if("string"==typeof a)throw new TypeError('The "string" argument must be of type string. Received type number');return s(e)}return b(e,a,t)}function b(e,a,t){if("string"==typeof e)return function(e,a){if("string"==typeof a&&""!==a||(a="utf8"),!i.isEncoding(a))throw new TypeError("Unknown encoding: "+a);var t=0|p(e,a),c=n(t),f=c.write(e,a);return f!==t&&(c=c.slice(0,f)),c}(e,a);if(ArrayBuffer.isView(e))return function(e){if(j(e,Uint8Array)){var a=new Uint8Array(e);return u(a.buffer,a.byteOffset,a.byteLength)}return l(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(j(e,ArrayBuffer)||e&&j(e.buffer,ArrayBuffer))return u(e,a,t);if("undefined"!=typeof SharedArrayBuffer&&(j(e,SharedArrayBuffer)||e&&j(e.buffer,SharedArrayBuffer)))return u(e,a,t);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var c=e.valueOf&&e.valueOf();if(null!=c&&c!==e)return i.from(c,a,t);var f=function(e){if(i.isBuffer(e)){var a=0|h(e.length),t=n(a);return 0===t.length||e.copy(t,0,0,a),t}return void 0!==e.length?"number"!=typeof e.length||H(e.length)?n(0):l(e):"Buffer"===e.type&&Array.isArray(e.data)?l(e.data):void 0}(e);if(f)return f;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return i.from(e[Symbol.toPrimitive]("string"),a,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function o(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function s(e){return o(e),n(e<0?0:0|h(e))}function l(e){for(var a=e.length<0?0:0|h(e.length),t=n(a),c=0;c=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function p(e,a){if(i.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||j(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var t=e.length,c=arguments.length>2&&!0===arguments[2];if(!c&&0===t)return 0;for(var f=!1;;)switch(a){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return F(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*t;case"hex":return t>>>1;case"base64":return Q(e).length;default:if(f)return c?-1:F(e).length;a=(""+a).toLowerCase(),f=!0}}function g(e,a,t){var c=!1;if((void 0===a||a<0)&&(a=0),a>this.length)return"";if((void 0===t||t>this.length)&&(t=this.length),t<=0)return"";if((t>>>=0)<=(a>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return L(this,a,t);case"utf8":case"utf-8":return C(this,a,t);case"ascii":return B(this,a,t);case"latin1":case"binary":return k(this,a,t);case"base64":return E(this,a,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,a,t);default:if(c)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),c=!0}}function m(e,a,t){var c=e[a];e[a]=e[t],e[t]=c}function x(e,a,t,c,f){if(0===e.length)return-1;if("string"==typeof t?(c=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),H(t=+t)&&(t=f?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(f)return-1;t=e.length-1}else if(t<0){if(!f)return-1;t=0}if("string"==typeof a&&(a=i.from(a,c)),i.isBuffer(a))return 0===a.length?-1:y(e,a,t,c,f);if("number"==typeof a)return a&=255,"function"==typeof Uint8Array.prototype.indexOf?f?Uint8Array.prototype.indexOf.call(e,a,t):Uint8Array.prototype.lastIndexOf.call(e,a,t):y(e,[a],t,c,f);throw new TypeError("val must be string, number or Buffer")}function y(e,a,t,c,f){var d,r=1,n=e.length,i=a.length;if(void 0!==c&&("ucs2"===(c=String(c).toLowerCase())||"ucs-2"===c||"utf16le"===c||"utf-16le"===c)){if(e.length<2||a.length<2)return-1;r=2,n/=2,i/=2,t/=2}function b(e,a){return 1===r?e[a]:e.readUInt16BE(a*r)}if(f){var o=-1;for(d=t;dn&&(t=n-i),d=t;d>=0;d--){for(var s=!0,l=0;lf&&(c=f):c=f;var d=a.length;c>d/2&&(c=d/2);for(var r=0;r>8,f=t%256,d.push(f),d.push(c);return d}(a,e.length-t),e,t,c)}function E(e,a,t){return 0===a&&t===e.length?c.fromByteArray(e):c.fromByteArray(e.slice(a,t))}function C(e,a,t){t=Math.min(e.length,t);for(var c=[],f=a;f239?4:b>223?3:b>191?2:1;if(f+s<=t)switch(s){case 1:b<128&&(o=b);break;case 2:128==(192&(d=e[f+1]))&&(i=(31&b)<<6|63&d)>127&&(o=i);break;case 3:d=e[f+1],r=e[f+2],128==(192&d)&&128==(192&r)&&(i=(15&b)<<12|(63&d)<<6|63&r)>2047&&(i<55296||i>57343)&&(o=i);break;case 4:d=e[f+1],r=e[f+2],n=e[f+3],128==(192&d)&&128==(192&r)&&128==(192&n)&&(i=(15&b)<<18|(63&d)<<12|(63&r)<<6|63&n)>65535&&i<1114112&&(o=i)}null===o?(o=65533,s=1):o>65535&&(o-=65536,c.push(o>>>10&1023|55296),o=56320|1023&o),c.push(o),f+=s}return function(e){var a=e.length;if(a<=M)return String.fromCharCode.apply(String,e);for(var t="",c=0;cc.length?i.from(d).copy(c,f):Uint8Array.prototype.set.call(c,d,f);else{if(!i.isBuffer(d))throw new TypeError('"list" argument must be an Array of Buffers');d.copy(c,f)}f+=d.length}return c},i.byteLength=p,i.prototype._isBuffer=!0,i.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var a=0;at&&(e+=" ... "),""},d&&(i.prototype[d]=i.prototype.inspect),i.prototype.compare=function(e,a,t,c,f){if(j(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===a&&(a=0),void 0===t&&(t=e?e.length:0),void 0===c&&(c=0),void 0===f&&(f=this.length),a<0||t>e.length||c<0||f>this.length)throw new RangeError("out of range index");if(c>=f&&a>=t)return 0;if(c>=f)return-1;if(a>=t)return 1;if(this===e)return 0;for(var d=(f>>>=0)-(c>>>=0),r=(t>>>=0)-(a>>>=0),n=Math.min(d,r),b=this.slice(c,f),o=e.slice(a,t),s=0;s>>=0,isFinite(t)?(t>>>=0,void 0===c&&(c="utf8")):(c=t,t=void 0)}var f=this.length-a;if((void 0===t||t>f)&&(t=f),e.length>0&&(t<0||a<0)||a>this.length)throw new RangeError("Attempt to write outside buffer bounds");c||(c="utf8");for(var d=!1;;)switch(c){case"hex":return A(this,e,a,t);case"utf8":case"utf-8":return v(this,e,a,t);case"ascii":case"latin1":case"binary":return w(this,e,a,t);case"base64":return _(this,e,a,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,a,t);default:if(d)throw new TypeError("Unknown encoding: "+c);c=(""+c).toLowerCase(),d=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var M=4096;function B(e,a,t){var c="";t=Math.min(e.length,t);for(var f=a;fc)&&(t=c);for(var f="",d=a;dt)throw new RangeError("Trying to access beyond buffer length")}function N(e,a,t,c,f,d){if(!i.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(a>f||ae.length)throw new RangeError("Index out of range")}function R(e,a,t,c,f,d){if(t+c>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function P(e,a,t,c,d){return a=+a,t>>>=0,d||R(e,0,t,4),f.write(e,a,t,c,23,4),t+4}function D(e,a,t,c,d){return a=+a,t>>>=0,d||R(e,0,t,8),f.write(e,a,t,c,52,8),t+8}i.prototype.slice=function(e,a){var t=this.length;(e=~~e)<0?(e+=t)<0&&(e=0):e>t&&(e=t),(a=void 0===a?t:~~a)<0?(a+=t)<0&&(a=0):a>t&&(a=t),a>>=0,a>>>=0,t||T(e,a,this.length);for(var c=this[e],f=1,d=0;++d>>=0,a>>>=0,t||T(e,a,this.length);for(var c=this[e+--a],f=1;a>0&&(f*=256);)c+=this[e+--a]*f;return c},i.prototype.readUint8=i.prototype.readUInt8=function(e,a){return e>>>=0,a||T(e,1,this.length),this[e]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(e,a){return e>>>=0,a||T(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(e,a){return e>>>=0,a||T(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(e,a){return e>>>=0,a||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(e,a){return e>>>=0,a||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readIntLE=function(e,a,t){e>>>=0,a>>>=0,t||T(e,a,this.length);for(var c=this[e],f=1,d=0;++d=(f*=128)&&(c-=Math.pow(2,8*a)),c},i.prototype.readIntBE=function(e,a,t){e>>>=0,a>>>=0,t||T(e,a,this.length);for(var c=a,f=1,d=this[e+--c];c>0&&(f*=256);)d+=this[e+--c]*f;return d>=(f*=128)&&(d-=Math.pow(2,8*a)),d},i.prototype.readInt8=function(e,a){return e>>>=0,a||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,a){e>>>=0,a||T(e,2,this.length);var t=this[e]|this[e+1]<<8;return 32768&t?4294901760|t:t},i.prototype.readInt16BE=function(e,a){e>>>=0,a||T(e,2,this.length);var t=this[e+1]|this[e]<<8;return 32768&t?4294901760|t:t},i.prototype.readInt32LE=function(e,a){return e>>>=0,a||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,a){return e>>>=0,a||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readFloatLE=function(e,a){return e>>>=0,a||T(e,4,this.length),f.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,a){return e>>>=0,a||T(e,4,this.length),f.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,a){return e>>>=0,a||T(e,8,this.length),f.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,a){return e>>>=0,a||T(e,8,this.length),f.read(this,e,!1,52,8)},i.prototype.writeUintLE=i.prototype.writeUIntLE=function(e,a,t,c){e=+e,a>>>=0,t>>>=0,c||N(this,e,a,t,Math.pow(2,8*t)-1,0);var f=1,d=0;for(this[a]=255&e;++d>>=0,t>>>=0,c||N(this,e,a,t,Math.pow(2,8*t)-1,0);var f=t-1,d=1;for(this[a+f]=255&e;--f>=0&&(d*=256);)this[a+f]=e/d&255;return a+t},i.prototype.writeUint8=i.prototype.writeUInt8=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,1,255,0),this[a]=255&e,a+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,2,65535,0),this[a]=255&e,this[a+1]=e>>>8,a+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,2,65535,0),this[a]=e>>>8,this[a+1]=255&e,a+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,4,4294967295,0),this[a+3]=e>>>24,this[a+2]=e>>>16,this[a+1]=e>>>8,this[a]=255&e,a+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,4,4294967295,0),this[a]=e>>>24,this[a+1]=e>>>16,this[a+2]=e>>>8,this[a+3]=255&e,a+4},i.prototype.writeIntLE=function(e,a,t,c){if(e=+e,a>>>=0,!c){var f=Math.pow(2,8*t-1);N(this,e,a,t,f-1,-f)}var d=0,r=1,n=0;for(this[a]=255&e;++d>>=0,!c){var f=Math.pow(2,8*t-1);N(this,e,a,t,f-1,-f)}var d=t-1,r=1,n=0;for(this[a+d]=255&e;--d>=0&&(r*=256);)e<0&&0===n&&0!==this[a+d+1]&&(n=1),this[a+d]=(e/r|0)-n&255;return a+t},i.prototype.writeInt8=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,1,127,-128),e<0&&(e=255+e+1),this[a]=255&e,a+1},i.prototype.writeInt16LE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,2,32767,-32768),this[a]=255&e,this[a+1]=e>>>8,a+2},i.prototype.writeInt16BE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,2,32767,-32768),this[a]=e>>>8,this[a+1]=255&e,a+2},i.prototype.writeInt32LE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,4,2147483647,-2147483648),this[a]=255&e,this[a+1]=e>>>8,this[a+2]=e>>>16,this[a+3]=e>>>24,a+4},i.prototype.writeInt32BE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[a]=e>>>24,this[a+1]=e>>>16,this[a+2]=e>>>8,this[a+3]=255&e,a+4},i.prototype.writeFloatLE=function(e,a,t){return P(this,e,a,!0,t)},i.prototype.writeFloatBE=function(e,a,t){return P(this,e,a,!1,t)},i.prototype.writeDoubleLE=function(e,a,t){return D(this,e,a,!0,t)},i.prototype.writeDoubleBE=function(e,a,t){return D(this,e,a,!1,t)},i.prototype.copy=function(e,a,t,c){if(!i.isBuffer(e))throw new TypeError("argument should be a Buffer");if(t||(t=0),c||0===c||(c=this.length),a>=e.length&&(a=e.length),a||(a=0),c>0&&c=this.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("sourceEnd out of bounds");c>this.length&&(c=this.length),e.length-a>>=0,t=void 0===t?this.length:t>>>0,e||(e=0),"number"==typeof e)for(d=a;d55295&&t<57344){if(!f){if(t>56319){(a-=3)>-1&&d.push(239,191,189);continue}if(r+1===c){(a-=3)>-1&&d.push(239,191,189);continue}f=t;continue}if(t<56320){(a-=3)>-1&&d.push(239,191,189),f=t;continue}t=65536+(f-55296<<10|t-56320)}else f&&(a-=3)>-1&&d.push(239,191,189);if(f=null,t<128){if((a-=1)<0)break;d.push(t)}else if(t<2048){if((a-=2)<0)break;d.push(t>>6|192,63&t|128)}else if(t<65536){if((a-=3)<0)break;d.push(t>>12|224,t>>6&63|128,63&t|128)}else{if(!(t<1114112))throw new Error("Invalid code point");if((a-=4)<0)break;d.push(t>>18|240,t>>12&63|128,t>>6&63|128,63&t|128)}}return d}function Q(e){return c.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(O,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function U(e,a,t,c){for(var f=0;f=a.length||f>=e.length);++f)a[f+t]=e[f];return f}function j(e,a){return e instanceof a||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===a.name}function H(e){return e!=e}var q=function(){for(var e="0123456789abcdef",a=new Array(256),t=0;t<16;++t)for(var c=16*t,f=0;f<16;++f)a[c+f]=e[t]+e[f];return a}()},86866:e=>{e.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},38075:(e,a,t)=>{"use strict";var c=t(70453),f=t(10487),d=f(c("String.prototype.indexOf"));e.exports=function(e,a){var t=c(e,!!a);return"function"==typeof t&&d(e,".prototype.")>-1?f(t):t}},10487:(e,a,t)=>{"use strict";var c=t(66743),f=t(70453),d=t(96897),r=t(69675),n=f("%Function.prototype.apply%"),i=f("%Function.prototype.call%"),b=f("%Reflect.apply%",!0)||c.call(i,n),o=t(30655),s=f("%Math.max%");e.exports=function(e){if("function"!=typeof e)throw new r("a function is required");var a=b(c,i,arguments);return d(a,1+s(0,e.length-(arguments.length-1)),!0)};var l=function(){return b(c,n,arguments)};o?o(e.exports,"apply",{value:l}):e.exports.apply=l},90297:e=>{"use strict";const a=Object.freeze({identity:0,sha1:17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,blake3:30,"murmur3-128":34,"murmur3-32":35,"dbl-sha2-256":86,md4:212,md5:213,bmt:214,"sha2-256-trunc254-padded":4114,"ripemd-128":4178,"ripemd-160":4179,"ripemd-256":4180,"ripemd-320":4181,x11:4352,kangarootwelve:7425,"sm3-256":21325,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46e3,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"poseidon-bls12_381-a2-fc1":46081,"poseidon-bls12_381-a2-fc1-sc":46082});e.exports={names:a}},17684:(e,a,t)=>{"use strict";const c=t(91466),f=t(61203),{names:d}=t(90297),{toString:r}=t(27302),{fromString:n}=t(44117),{concat:i}=t(75007),b={};for(const e in d){const a=e;b[d[a]]=a}function o(e){if(!(e instanceof Uint8Array))throw new Error("multihash must be a Uint8Array");if(e.length<2)throw new Error("multihash too short. must be > 2 bytes.");const a=f.decode(e);if(!u(a))throw new Error(`multihash unknown function code: 0x${a.toString(16)}`);e=e.slice(f.decode.bytes);const t=f.decode(e);if(t<0)throw new Error(`multihash invalid length: ${t}`);if((e=e.slice(f.decode.bytes)).length!==t)throw new Error(`multihash length inconsistent: 0x${r(e,"base16")}`);return{code:a,name:b[a],length:t,digest:e}}function s(e){let a=e;if("string"==typeof e){if(void 0===d[e])throw new Error(`Unrecognized hash function named: ${e}`);a=d[e]}if("number"!=typeof a)throw new Error(`Hash function code should be a number. Got: ${a}`);if(void 0===b[a]&&!l(a))throw new Error(`Unrecognized function code: ${a}`);return a}function l(e){return e>0&&e<16}function u(e){return!!l(e)||!!b[e]}function h(e){o(e)}Object.freeze(b),e.exports={names:d,codes:b,toHexString:function(e){if(!(e instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return r(e,"base16")},fromHexString:function(e){return n(e,"base16")},toB58String:function(e){if(!(e instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return r(c.encode("base58btc",e)).slice(1)},fromB58String:function(e){const a=e instanceof Uint8Array?r(e):e;return c.decode("z"+a)},decode:o,encode:function(e,a,t){if(!e||void 0===a)throw new Error("multihash encode requires at least two args: digest, code");const c=s(a);if(!(e instanceof Uint8Array))throw new Error("digest should be a Uint8Array");if(null==t&&(t=e.length),t&&e.length!==t)throw new Error("digest length should be equal to specified length.");const d=f.encode(c),r=f.encode(t);return i([d,r,e],d.length+r.length+e.length)},coerceCode:s,isAppCode:l,validate:h,prefix:function(e){return h(e),e.subarray(0,2)},isValidCode:u}},64378:(e,a,t)=>{"use strict";const c=t(17684),f={checkCIDComponents:function(e){if(null==e)return"null values are not valid CIDs";if(0!==e.version&&1!==e.version)return"Invalid version, must be a number equal to 1 or 0";if("string"!=typeof e.codec)return"codec must be string";if(0===e.version){if("dag-pb"!==e.codec)return"codec must be 'dag-pb' for CIDv0";if("base58btc"!==e.multibaseName)return"multibaseName must be 'base58btc' for CIDv0"}if(!(e.multihash instanceof Uint8Array))return"multihash must be a Uint8Array";try{c.validate(e.multihash)}catch(e){let a=e.message;return a||(a="Multihash validation failed"),a}}};e.exports=f},26613:(e,a,t)=>{"use strict";const c=t(17684),f=t(91466),d=t(52021),r=t(64378),{concat:n}=t(75007),{toString:i}=t(27302),{equals:b}=t(18402),o=d.nameToCode,s=Object.keys(o).reduce(((e,a)=>(e[o[a]]=a,e)),{}),l=Symbol.for("@ipld/js-cid/CID");class u{constructor(e,a,t,r){if(this.version,this.codec,this.multihash,Object.defineProperty(this,l,{value:!0}),u.isCID(e)){const a=e;return this.version=a.version,this.codec=a.codec,this.multihash=a.multihash,void(this.multibaseName=a.multibaseName||(0===a.version?"base58btc":"base32"))}if("string"==typeof e){const a=f.isEncoded(e);if(a){const t=f.decode(e);this.version=parseInt(t[0].toString(),16),this.codec=d.getCodec(t.slice(1)),this.multihash=d.rmPrefix(t.slice(1)),this.multibaseName=a}else this.version=0,this.codec="dag-pb",this.multihash=c.fromB58String(e),this.multibaseName="base58btc";return u.validateCID(this),void Object.defineProperty(this,"string",{value:e})}if(e instanceof Uint8Array){const a=parseInt(e[0].toString(),16);if(1===a){const t=e;this.version=a,this.codec=d.getCodec(t.slice(1)),this.multihash=d.rmPrefix(t.slice(1)),this.multibaseName="base32"}else this.version=0,this.codec="dag-pb",this.multihash=e,this.multibaseName="base58btc";u.validateCID(this)}else this.version=e,"number"==typeof a&&(a=s[a]),this.codec=a,this.multihash=t,this.multibaseName=r||(0===e?"base58btc":"base32"),u.validateCID(this)}get bytes(){let e=this._bytes;if(!e){if(0===this.version)e=this.multihash;else{if(1!==this.version)throw new Error("unsupported version");{const a=d.getCodeVarint(this.codec);e=n([[1],a,this.multihash],1+a.byteLength+this.multihash.byteLength)}}Object.defineProperty(this,"_bytes",{value:e})}return e}get prefix(){const e=d.getCodeVarint(this.codec),a=c.prefix(this.multihash);return n([[this.version],e,a],1+e.byteLength+a.byteLength)}get code(){return o[this.codec]}toV0(){if("dag-pb"!==this.codec)throw new Error("Cannot convert a non dag-pb CID to CIDv0");const{name:e,length:a}=c.decode(this.multihash);if("sha2-256"!==e)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");if(32!==a)throw new Error("Cannot convert non 32 byte multihash CID to CIDv0");return new u(0,this.codec,this.multihash)}toV1(){return new u(1,this.codec,this.multihash,this.multibaseName)}toBaseEncodedString(e=this.multibaseName){if(this.string&&0!==this.string.length&&e===this.multibaseName)return this.string;let a;if(0===this.version){if("base58btc"!==e)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");a=c.toB58String(this.multihash)}else{if(1!==this.version)throw new Error("unsupported version");a=i(f.encode(e,this.bytes))}return e===this.multibaseName&&Object.defineProperty(this,"string",{value:a}),a}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}toString(e){return this.toBaseEncodedString(e)}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(e){return this.codec===e.codec&&this.version===e.version&&b(this.multihash,e.multihash)}static validateCID(e){const a=r.checkCIDComponents(e);if(a)throw new Error(a)}static isCID(e){return e instanceof u||Boolean(e&&e[l])}}u.codecs=o,e.exports=u},56168:(e,a,t)=>{var c=t(92861).Buffer,f=t(88310).Transform,d=t(83141).I;function r(e){f.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}t(56698)(r,f),r.prototype.update=function(e,a,t){"string"==typeof e&&(e=c.from(e,a));var f=this._update(e);return this.hashMode?this:(t&&(f=this._toString(f,t)),f)},r.prototype.setAutoPadding=function(){},r.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},r.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},r.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},r.prototype._transform=function(e,a,t){var c;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){c=e}finally{t(c)}},r.prototype._flush=function(e){var a;try{this.push(this.__final())}catch(e){a=e}e(a)},r.prototype._finalOrDigest=function(e){var a=this.__final()||c.alloc(0);return e&&(a=this._toString(a,e,!0)),a},r.prototype._toString=function(e,a,t){if(this._decoder||(this._decoder=new d(a),this._encoding=a),this._encoding!==a)throw new Error("can't switch encodings");var c=this._decoder.write(e);return t&&(c+=this._decoder.end()),c},e.exports=r},15622:(e,a,t)=>{function c(e){return Object.prototype.toString.call(e)}a.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===c(e)},a.isBoolean=function(e){return"boolean"==typeof e},a.isNull=function(e){return null===e},a.isNullOrUndefined=function(e){return null==e},a.isNumber=function(e){return"number"==typeof e},a.isString=function(e){return"string"==typeof e},a.isSymbol=function(e){return"symbol"==typeof e},a.isUndefined=function(e){return void 0===e},a.isRegExp=function(e){return"[object RegExp]"===c(e)},a.isObject=function(e){return"object"==typeof e&&null!==e},a.isDate=function(e){return"[object Date]"===c(e)},a.isError=function(e){return"[object Error]"===c(e)||e instanceof Error},a.isFunction=function(e){return"function"==typeof e},a.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},a.isBuffer=t(48287).Buffer.isBuffer},61324:(e,a,t)=>{var c=t(62045).hp,f=t(86729),d=t(92801);e.exports=function(e){return new n(e)};var r={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function n(e){this.curveType=r[e],this.curveType||(this.curveType={name:e}),this.curve=new f.ec(this.curveType.name),this.keys=void 0}function i(e,a,t){Array.isArray(e)||(e=e.toArray());var f=new c(e);if(t&&f.length=65&&t<=70?t-55:t>=97&&t<=102?t-87:t-48&15}function i(e,a,t){var c=n(e,t);return t-1>=a&&(c|=n(e,t-1)<<4),c}function b(e,a,t,c){for(var f=0,d=Math.min(e.length,t),r=a;r=49?n-49+10:n>=17?n-17+10:n}return f}d.isBN=function(e){return e instanceof d||null!==e&&"object"==typeof e&&e.constructor.wordSize===d.wordSize&&Array.isArray(e.words)},d.max=function(e,a){return e.cmp(a)>0?e:a},d.min=function(e,a){return e.cmp(a)<0?e:a},d.prototype._init=function(e,a,t){if("number"==typeof e)return this._initNumber(e,a,t);if("object"==typeof e)return this._initArray(e,a,t);"hex"===a&&(a=16),c(a===(0|a)&&a>=2&&a<=36);var f=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(f++,this.negative=1),f=0;f-=3)r=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[d]|=r<>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);else if("le"===t)for(f=0,d=0;f>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);return this.strip()},d.prototype._parseHex=function(e,a,t){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)f=i(e,a,c)<=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;else for(c=(e.length-a)%2==0?a+1:a;c=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;this.strip()},d.prototype._parseBase=function(e,a,t){this.words=[0],this.length=1;for(var c=0,f=1;f<=67108863;f*=a)c++;c--,f=f/a|0;for(var d=e.length-t,r=d%c,n=Math.min(d,d-r)+t,i=0,o=t;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},d.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},d.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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],l=[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 u(e,a,t){t.negative=a.negative^e.negative;var c=e.length+a.length|0;t.length=c,c=c-1|0;var f=0|e.words[0],d=0|a.words[0],r=f*d,n=67108863&r,i=r/67108864|0;t.words[0]=n;for(var b=1;b>>26,s=67108863&i,l=Math.min(b,a.length-1),u=Math.max(0,b-e.length+1);u<=l;u++){var h=b-u|0;o+=(r=(f=0|e.words[h])*(d=0|a.words[u])+s)/67108864|0,s=67108863&r}t.words[b]=0|s,i=0|o}return 0!==i?t.words[b]=0|i:t.length--,t.strip()}d.prototype.toString=function(e,a){var t;if(a=0|a||1,16===(e=e||10)||"hex"===e){t="";for(var f=0,d=0,r=0;r>>24-f&16777215)||r!==this.length-1?o[6-i.length]+i+t:i+t,(f+=2)>=26&&(f-=26,r--)}for(0!==d&&(t=d.toString(16)+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(e===(0|e)&&e>=2&&e<=36){var b=s[e],u=l[e];t="";var h=this.clone();for(h.negative=0;!h.isZero();){var p=h.modn(u).toString(e);t=(h=h.idivn(u)).isZero()?p+t:o[b-p.length]+p+t}for(this.isZero()&&(t="0"+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}c(!1,"Base should be between 2 and 36")},d.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&c(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},d.prototype.toJSON=function(){return this.toString(16)},d.prototype.toBuffer=function(e,a){return c(void 0!==r),this.toArrayLike(r,e,a)},d.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},d.prototype.toArrayLike=function(e,a,t){var f=this.byteLength(),d=t||Math.max(1,f);c(f<=d,"byte array longer than desired length"),c(d>0,"Requested array length <= 0"),this.strip();var r,n,i="le"===a,b=new e(d),o=this.clone();if(i){for(n=0;!o.isZero();n++)r=o.andln(255),o.iushrn(8),b[n]=r;for(;n=4096&&(t+=13,a>>>=13),a>=64&&(t+=7,a>>>=7),a>=8&&(t+=4,a>>>=4),a>=2&&(t+=2,a>>>=2),t+a},d.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,t=0;return 8191&a||(t+=13,a>>>=13),127&a||(t+=7,a>>>=7),15&a||(t+=4,a>>>=4),3&a||(t+=2,a>>>=2),1&a||t++,t},d.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},d.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},d.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},d.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var t=0;te.length?this.clone().iand(e):e.clone().iand(this)},d.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},d.prototype.iuxor=function(e){var a,t;this.length>e.length?(a=this,t=e):(a=e,t=this);for(var c=0;ce.length?this.clone().ixor(e):e.clone().ixor(this)},d.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},d.prototype.inotn=function(e){c("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),t=e%26;this._expand(a),t>0&&a--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-t),this.strip()},d.prototype.notn=function(e){return this.clone().inotn(e)},d.prototype.setn=function(e,a){c("number"==typeof e&&e>=0);var t=e/26|0,f=e%26;return this._expand(t+1),this.words[t]=a?this.words[t]|1<e.length?(t=this,c=e):(t=e,c=this);for(var f=0,d=0;d>>26;for(;0!==f&&d>>26;if(this.length=t.length,0!==f)this.words[this.length]=f,this.length++;else if(t!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},d.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var t,c,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(t=this,c=e):(t=e,c=this);for(var d=0,r=0;r>26,this.words[r]=67108863&a;for(;0!==d&&r>26,this.words[r]=67108863&a;if(0===d&&r>>13,u=0|r[1],h=8191&u,p=u>>>13,g=0|r[2],m=8191&g,x=g>>>13,y=0|r[3],A=8191&y,v=y>>>13,w=0|r[4],_=8191&w,I=w>>>13,E=0|r[5],C=8191&E,M=E>>>13,B=0|r[6],k=8191&B,L=B>>>13,S=0|r[7],T=8191&S,N=S>>>13,R=0|r[8],P=8191&R,D=R>>>13,O=0|r[9],F=8191&O,Q=O>>>13,U=0|n[0],j=8191&U,H=U>>>13,q=0|n[1],$=8191&q,z=q>>>13,G=0|n[2],K=8191&G,V=G>>>13,Z=0|n[3],J=8191&Z,W=Z>>>13,Y=0|n[4],X=8191&Y,ee=Y>>>13,ae=0|n[5],te=8191&ae,ce=ae>>>13,fe=0|n[6],de=8191&fe,re=fe>>>13,ne=0|n[7],ie=8191&ne,be=ne>>>13,oe=0|n[8],se=8191&oe,le=oe>>>13,ue=0|n[9],he=8191&ue,pe=ue>>>13;t.negative=e.negative^a.negative,t.length=19;var ge=(b+(c=Math.imul(s,j))|0)+((8191&(f=(f=Math.imul(s,H))+Math.imul(l,j)|0))<<13)|0;b=((d=Math.imul(l,H))+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,c=Math.imul(h,j),f=(f=Math.imul(h,H))+Math.imul(p,j)|0,d=Math.imul(p,H);var me=(b+(c=c+Math.imul(s,$)|0)|0)+((8191&(f=(f=f+Math.imul(s,z)|0)+Math.imul(l,$)|0))<<13)|0;b=((d=d+Math.imul(l,z)|0)+(f>>>13)|0)+(me>>>26)|0,me&=67108863,c=Math.imul(m,j),f=(f=Math.imul(m,H))+Math.imul(x,j)|0,d=Math.imul(x,H),c=c+Math.imul(h,$)|0,f=(f=f+Math.imul(h,z)|0)+Math.imul(p,$)|0,d=d+Math.imul(p,z)|0;var xe=(b+(c=c+Math.imul(s,K)|0)|0)+((8191&(f=(f=f+Math.imul(s,V)|0)+Math.imul(l,K)|0))<<13)|0;b=((d=d+Math.imul(l,V)|0)+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,c=Math.imul(A,j),f=(f=Math.imul(A,H))+Math.imul(v,j)|0,d=Math.imul(v,H),c=c+Math.imul(m,$)|0,f=(f=f+Math.imul(m,z)|0)+Math.imul(x,$)|0,d=d+Math.imul(x,z)|0,c=c+Math.imul(h,K)|0,f=(f=f+Math.imul(h,V)|0)+Math.imul(p,K)|0,d=d+Math.imul(p,V)|0;var ye=(b+(c=c+Math.imul(s,J)|0)|0)+((8191&(f=(f=f+Math.imul(s,W)|0)+Math.imul(l,J)|0))<<13)|0;b=((d=d+Math.imul(l,W)|0)+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,c=Math.imul(_,j),f=(f=Math.imul(_,H))+Math.imul(I,j)|0,d=Math.imul(I,H),c=c+Math.imul(A,$)|0,f=(f=f+Math.imul(A,z)|0)+Math.imul(v,$)|0,d=d+Math.imul(v,z)|0,c=c+Math.imul(m,K)|0,f=(f=f+Math.imul(m,V)|0)+Math.imul(x,K)|0,d=d+Math.imul(x,V)|0,c=c+Math.imul(h,J)|0,f=(f=f+Math.imul(h,W)|0)+Math.imul(p,J)|0,d=d+Math.imul(p,W)|0;var Ae=(b+(c=c+Math.imul(s,X)|0)|0)+((8191&(f=(f=f+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;b=((d=d+Math.imul(l,ee)|0)+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,c=Math.imul(C,j),f=(f=Math.imul(C,H))+Math.imul(M,j)|0,d=Math.imul(M,H),c=c+Math.imul(_,$)|0,f=(f=f+Math.imul(_,z)|0)+Math.imul(I,$)|0,d=d+Math.imul(I,z)|0,c=c+Math.imul(A,K)|0,f=(f=f+Math.imul(A,V)|0)+Math.imul(v,K)|0,d=d+Math.imul(v,V)|0,c=c+Math.imul(m,J)|0,f=(f=f+Math.imul(m,W)|0)+Math.imul(x,J)|0,d=d+Math.imul(x,W)|0,c=c+Math.imul(h,X)|0,f=(f=f+Math.imul(h,ee)|0)+Math.imul(p,X)|0,d=d+Math.imul(p,ee)|0;var ve=(b+(c=c+Math.imul(s,te)|0)|0)+((8191&(f=(f=f+Math.imul(s,ce)|0)+Math.imul(l,te)|0))<<13)|0;b=((d=d+Math.imul(l,ce)|0)+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,c=Math.imul(k,j),f=(f=Math.imul(k,H))+Math.imul(L,j)|0,d=Math.imul(L,H),c=c+Math.imul(C,$)|0,f=(f=f+Math.imul(C,z)|0)+Math.imul(M,$)|0,d=d+Math.imul(M,z)|0,c=c+Math.imul(_,K)|0,f=(f=f+Math.imul(_,V)|0)+Math.imul(I,K)|0,d=d+Math.imul(I,V)|0,c=c+Math.imul(A,J)|0,f=(f=f+Math.imul(A,W)|0)+Math.imul(v,J)|0,d=d+Math.imul(v,W)|0,c=c+Math.imul(m,X)|0,f=(f=f+Math.imul(m,ee)|0)+Math.imul(x,X)|0,d=d+Math.imul(x,ee)|0,c=c+Math.imul(h,te)|0,f=(f=f+Math.imul(h,ce)|0)+Math.imul(p,te)|0,d=d+Math.imul(p,ce)|0;var we=(b+(c=c+Math.imul(s,de)|0)|0)+((8191&(f=(f=f+Math.imul(s,re)|0)+Math.imul(l,de)|0))<<13)|0;b=((d=d+Math.imul(l,re)|0)+(f>>>13)|0)+(we>>>26)|0,we&=67108863,c=Math.imul(T,j),f=(f=Math.imul(T,H))+Math.imul(N,j)|0,d=Math.imul(N,H),c=c+Math.imul(k,$)|0,f=(f=f+Math.imul(k,z)|0)+Math.imul(L,$)|0,d=d+Math.imul(L,z)|0,c=c+Math.imul(C,K)|0,f=(f=f+Math.imul(C,V)|0)+Math.imul(M,K)|0,d=d+Math.imul(M,V)|0,c=c+Math.imul(_,J)|0,f=(f=f+Math.imul(_,W)|0)+Math.imul(I,J)|0,d=d+Math.imul(I,W)|0,c=c+Math.imul(A,X)|0,f=(f=f+Math.imul(A,ee)|0)+Math.imul(v,X)|0,d=d+Math.imul(v,ee)|0,c=c+Math.imul(m,te)|0,f=(f=f+Math.imul(m,ce)|0)+Math.imul(x,te)|0,d=d+Math.imul(x,ce)|0,c=c+Math.imul(h,de)|0,f=(f=f+Math.imul(h,re)|0)+Math.imul(p,de)|0,d=d+Math.imul(p,re)|0;var _e=(b+(c=c+Math.imul(s,ie)|0)|0)+((8191&(f=(f=f+Math.imul(s,be)|0)+Math.imul(l,ie)|0))<<13)|0;b=((d=d+Math.imul(l,be)|0)+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,c=Math.imul(P,j),f=(f=Math.imul(P,H))+Math.imul(D,j)|0,d=Math.imul(D,H),c=c+Math.imul(T,$)|0,f=(f=f+Math.imul(T,z)|0)+Math.imul(N,$)|0,d=d+Math.imul(N,z)|0,c=c+Math.imul(k,K)|0,f=(f=f+Math.imul(k,V)|0)+Math.imul(L,K)|0,d=d+Math.imul(L,V)|0,c=c+Math.imul(C,J)|0,f=(f=f+Math.imul(C,W)|0)+Math.imul(M,J)|0,d=d+Math.imul(M,W)|0,c=c+Math.imul(_,X)|0,f=(f=f+Math.imul(_,ee)|0)+Math.imul(I,X)|0,d=d+Math.imul(I,ee)|0,c=c+Math.imul(A,te)|0,f=(f=f+Math.imul(A,ce)|0)+Math.imul(v,te)|0,d=d+Math.imul(v,ce)|0,c=c+Math.imul(m,de)|0,f=(f=f+Math.imul(m,re)|0)+Math.imul(x,de)|0,d=d+Math.imul(x,re)|0,c=c+Math.imul(h,ie)|0,f=(f=f+Math.imul(h,be)|0)+Math.imul(p,ie)|0,d=d+Math.imul(p,be)|0;var Ie=(b+(c=c+Math.imul(s,se)|0)|0)+((8191&(f=(f=f+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;b=((d=d+Math.imul(l,le)|0)+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,c=Math.imul(F,j),f=(f=Math.imul(F,H))+Math.imul(Q,j)|0,d=Math.imul(Q,H),c=c+Math.imul(P,$)|0,f=(f=f+Math.imul(P,z)|0)+Math.imul(D,$)|0,d=d+Math.imul(D,z)|0,c=c+Math.imul(T,K)|0,f=(f=f+Math.imul(T,V)|0)+Math.imul(N,K)|0,d=d+Math.imul(N,V)|0,c=c+Math.imul(k,J)|0,f=(f=f+Math.imul(k,W)|0)+Math.imul(L,J)|0,d=d+Math.imul(L,W)|0,c=c+Math.imul(C,X)|0,f=(f=f+Math.imul(C,ee)|0)+Math.imul(M,X)|0,d=d+Math.imul(M,ee)|0,c=c+Math.imul(_,te)|0,f=(f=f+Math.imul(_,ce)|0)+Math.imul(I,te)|0,d=d+Math.imul(I,ce)|0,c=c+Math.imul(A,de)|0,f=(f=f+Math.imul(A,re)|0)+Math.imul(v,de)|0,d=d+Math.imul(v,re)|0,c=c+Math.imul(m,ie)|0,f=(f=f+Math.imul(m,be)|0)+Math.imul(x,ie)|0,d=d+Math.imul(x,be)|0,c=c+Math.imul(h,se)|0,f=(f=f+Math.imul(h,le)|0)+Math.imul(p,se)|0,d=d+Math.imul(p,le)|0;var Ee=(b+(c=c+Math.imul(s,he)|0)|0)+((8191&(f=(f=f+Math.imul(s,pe)|0)+Math.imul(l,he)|0))<<13)|0;b=((d=d+Math.imul(l,pe)|0)+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,c=Math.imul(F,$),f=(f=Math.imul(F,z))+Math.imul(Q,$)|0,d=Math.imul(Q,z),c=c+Math.imul(P,K)|0,f=(f=f+Math.imul(P,V)|0)+Math.imul(D,K)|0,d=d+Math.imul(D,V)|0,c=c+Math.imul(T,J)|0,f=(f=f+Math.imul(T,W)|0)+Math.imul(N,J)|0,d=d+Math.imul(N,W)|0,c=c+Math.imul(k,X)|0,f=(f=f+Math.imul(k,ee)|0)+Math.imul(L,X)|0,d=d+Math.imul(L,ee)|0,c=c+Math.imul(C,te)|0,f=(f=f+Math.imul(C,ce)|0)+Math.imul(M,te)|0,d=d+Math.imul(M,ce)|0,c=c+Math.imul(_,de)|0,f=(f=f+Math.imul(_,re)|0)+Math.imul(I,de)|0,d=d+Math.imul(I,re)|0,c=c+Math.imul(A,ie)|0,f=(f=f+Math.imul(A,be)|0)+Math.imul(v,ie)|0,d=d+Math.imul(v,be)|0,c=c+Math.imul(m,se)|0,f=(f=f+Math.imul(m,le)|0)+Math.imul(x,se)|0,d=d+Math.imul(x,le)|0;var Ce=(b+(c=c+Math.imul(h,he)|0)|0)+((8191&(f=(f=f+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;b=((d=d+Math.imul(p,pe)|0)+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c=Math.imul(F,K),f=(f=Math.imul(F,V))+Math.imul(Q,K)|0,d=Math.imul(Q,V),c=c+Math.imul(P,J)|0,f=(f=f+Math.imul(P,W)|0)+Math.imul(D,J)|0,d=d+Math.imul(D,W)|0,c=c+Math.imul(T,X)|0,f=(f=f+Math.imul(T,ee)|0)+Math.imul(N,X)|0,d=d+Math.imul(N,ee)|0,c=c+Math.imul(k,te)|0,f=(f=f+Math.imul(k,ce)|0)+Math.imul(L,te)|0,d=d+Math.imul(L,ce)|0,c=c+Math.imul(C,de)|0,f=(f=f+Math.imul(C,re)|0)+Math.imul(M,de)|0,d=d+Math.imul(M,re)|0,c=c+Math.imul(_,ie)|0,f=(f=f+Math.imul(_,be)|0)+Math.imul(I,ie)|0,d=d+Math.imul(I,be)|0,c=c+Math.imul(A,se)|0,f=(f=f+Math.imul(A,le)|0)+Math.imul(v,se)|0,d=d+Math.imul(v,le)|0;var Me=(b+(c=c+Math.imul(m,he)|0)|0)+((8191&(f=(f=f+Math.imul(m,pe)|0)+Math.imul(x,he)|0))<<13)|0;b=((d=d+Math.imul(x,pe)|0)+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,c=Math.imul(F,J),f=(f=Math.imul(F,W))+Math.imul(Q,J)|0,d=Math.imul(Q,W),c=c+Math.imul(P,X)|0,f=(f=f+Math.imul(P,ee)|0)+Math.imul(D,X)|0,d=d+Math.imul(D,ee)|0,c=c+Math.imul(T,te)|0,f=(f=f+Math.imul(T,ce)|0)+Math.imul(N,te)|0,d=d+Math.imul(N,ce)|0,c=c+Math.imul(k,de)|0,f=(f=f+Math.imul(k,re)|0)+Math.imul(L,de)|0,d=d+Math.imul(L,re)|0,c=c+Math.imul(C,ie)|0,f=(f=f+Math.imul(C,be)|0)+Math.imul(M,ie)|0,d=d+Math.imul(M,be)|0,c=c+Math.imul(_,se)|0,f=(f=f+Math.imul(_,le)|0)+Math.imul(I,se)|0,d=d+Math.imul(I,le)|0;var Be=(b+(c=c+Math.imul(A,he)|0)|0)+((8191&(f=(f=f+Math.imul(A,pe)|0)+Math.imul(v,he)|0))<<13)|0;b=((d=d+Math.imul(v,pe)|0)+(f>>>13)|0)+(Be>>>26)|0,Be&=67108863,c=Math.imul(F,X),f=(f=Math.imul(F,ee))+Math.imul(Q,X)|0,d=Math.imul(Q,ee),c=c+Math.imul(P,te)|0,f=(f=f+Math.imul(P,ce)|0)+Math.imul(D,te)|0,d=d+Math.imul(D,ce)|0,c=c+Math.imul(T,de)|0,f=(f=f+Math.imul(T,re)|0)+Math.imul(N,de)|0,d=d+Math.imul(N,re)|0,c=c+Math.imul(k,ie)|0,f=(f=f+Math.imul(k,be)|0)+Math.imul(L,ie)|0,d=d+Math.imul(L,be)|0,c=c+Math.imul(C,se)|0,f=(f=f+Math.imul(C,le)|0)+Math.imul(M,se)|0,d=d+Math.imul(M,le)|0;var ke=(b+(c=c+Math.imul(_,he)|0)|0)+((8191&(f=(f=f+Math.imul(_,pe)|0)+Math.imul(I,he)|0))<<13)|0;b=((d=d+Math.imul(I,pe)|0)+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,c=Math.imul(F,te),f=(f=Math.imul(F,ce))+Math.imul(Q,te)|0,d=Math.imul(Q,ce),c=c+Math.imul(P,de)|0,f=(f=f+Math.imul(P,re)|0)+Math.imul(D,de)|0,d=d+Math.imul(D,re)|0,c=c+Math.imul(T,ie)|0,f=(f=f+Math.imul(T,be)|0)+Math.imul(N,ie)|0,d=d+Math.imul(N,be)|0,c=c+Math.imul(k,se)|0,f=(f=f+Math.imul(k,le)|0)+Math.imul(L,se)|0,d=d+Math.imul(L,le)|0;var Le=(b+(c=c+Math.imul(C,he)|0)|0)+((8191&(f=(f=f+Math.imul(C,pe)|0)+Math.imul(M,he)|0))<<13)|0;b=((d=d+Math.imul(M,pe)|0)+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,c=Math.imul(F,de),f=(f=Math.imul(F,re))+Math.imul(Q,de)|0,d=Math.imul(Q,re),c=c+Math.imul(P,ie)|0,f=(f=f+Math.imul(P,be)|0)+Math.imul(D,ie)|0,d=d+Math.imul(D,be)|0,c=c+Math.imul(T,se)|0,f=(f=f+Math.imul(T,le)|0)+Math.imul(N,se)|0,d=d+Math.imul(N,le)|0;var Se=(b+(c=c+Math.imul(k,he)|0)|0)+((8191&(f=(f=f+Math.imul(k,pe)|0)+Math.imul(L,he)|0))<<13)|0;b=((d=d+Math.imul(L,pe)|0)+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,c=Math.imul(F,ie),f=(f=Math.imul(F,be))+Math.imul(Q,ie)|0,d=Math.imul(Q,be),c=c+Math.imul(P,se)|0,f=(f=f+Math.imul(P,le)|0)+Math.imul(D,se)|0,d=d+Math.imul(D,le)|0;var Te=(b+(c=c+Math.imul(T,he)|0)|0)+((8191&(f=(f=f+Math.imul(T,pe)|0)+Math.imul(N,he)|0))<<13)|0;b=((d=d+Math.imul(N,pe)|0)+(f>>>13)|0)+(Te>>>26)|0,Te&=67108863,c=Math.imul(F,se),f=(f=Math.imul(F,le))+Math.imul(Q,se)|0,d=Math.imul(Q,le);var Ne=(b+(c=c+Math.imul(P,he)|0)|0)+((8191&(f=(f=f+Math.imul(P,pe)|0)+Math.imul(D,he)|0))<<13)|0;b=((d=d+Math.imul(D,pe)|0)+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Re=(b+(c=Math.imul(F,he))|0)+((8191&(f=(f=Math.imul(F,pe))+Math.imul(Q,he)|0))<<13)|0;return b=((d=Math.imul(Q,pe))+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,i[0]=ge,i[1]=me,i[2]=xe,i[3]=ye,i[4]=Ae,i[5]=ve,i[6]=we,i[7]=_e,i[8]=Ie,i[9]=Ee,i[10]=Ce,i[11]=Me,i[12]=Be,i[13]=ke,i[14]=Le,i[15]=Se,i[16]=Te,i[17]=Ne,i[18]=Re,0!==b&&(i[19]=b,t.length++),t};function p(e,a,t){return(new g).mulp(e,a,t)}function g(e,a){this.x=e,this.y=a}Math.imul||(h=u),d.prototype.mulTo=function(e,a){var t,c=this.length+e.length;return t=10===this.length&&10===e.length?h(this,e,a):c<63?u(this,e,a):c<1024?function(e,a,t){t.negative=a.negative^e.negative,t.length=e.length+a.length;for(var c=0,f=0,d=0;d>>26)|0)>>>26,r&=67108863}t.words[d]=n,c=r,r=f}return 0!==c?t.words[d]=c:t.length--,t.strip()}(this,e,a):p(this,e,a),t},g.prototype.makeRBT=function(e){for(var a=new Array(e),t=d.prototype._countBits(e)-1,c=0;c>=1;return c},g.prototype.permute=function(e,a,t,c,f,d){for(var r=0;r>>=1)f++;return 1<>>=13,t[2*r+1]=8191&d,d>>>=13;for(r=2*a;r>=26,a+=f/67108864|0,a+=d>>>26,this.words[t]=67108863&d}return 0!==a&&(this.words[t]=a,this.length++),this},d.prototype.muln=function(e){return this.clone().imuln(e)},d.prototype.sqr=function(){return this.mul(this)},d.prototype.isqr=function(){return this.imul(this.clone())},d.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),t=0;t>>f}return a}(e);if(0===a.length)return new d(1);for(var t=this,c=0;c=0);var a,t=e%26,f=(e-t)/26,d=67108863>>>26-t<<26-t;if(0!==t){var r=0;for(a=0;a>>26-t}r&&(this.words[a]=r,this.length++)}if(0!==f){for(a=this.length-1;a>=0;a--)this.words[a+f]=this.words[a];for(a=0;a=0),f=a?(a-a%26)/26:0;var d=e%26,r=Math.min((e-d)/26,this.length),n=67108863^67108863>>>d<r)for(this.length-=r,b=0;b=0&&(0!==o||b>=f);b--){var s=0|this.words[b];this.words[b]=o<<26-d|s>>>d,o=s&n}return i&&0!==o&&(i.words[i.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},d.prototype.ishrn=function(e,a,t){return c(0===this.negative),this.iushrn(e,a,t)},d.prototype.shln=function(e){return this.clone().ishln(e)},d.prototype.ushln=function(e){return this.clone().iushln(e)},d.prototype.shrn=function(e){return this.clone().ishrn(e)},d.prototype.ushrn=function(e){return this.clone().iushrn(e)},d.prototype.testn=function(e){c("number"==typeof e&&e>=0);var a=e%26,t=(e-a)/26,f=1<=0);var a=e%26,t=(e-a)/26;if(c(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==a&&t++,this.length=Math.min(t,this.length),0!==a){var f=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},d.prototype.isubn=function(e){if(c("number"==typeof e),c(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(i/67108864|0),this.words[f+t]=67108863&d}for(;f>26,this.words[f+t]=67108863&d;if(0===n)return this.strip();for(c(-1===n),n=0,f=0;f>26,this.words[f]=67108863&d;return this.negative=1,this.strip()},d.prototype._wordDiv=function(e,a){var t=(this.length,e.length),c=this.clone(),f=e,r=0|f.words[f.length-1];0!=(t=26-this._countBits(r))&&(f=f.ushln(t),c.iushln(t),r=0|f.words[f.length-1]);var n,i=c.length-f.length;if("mod"!==a){(n=new d(null)).length=i+1,n.words=new Array(n.length);for(var b=0;b=0;s--){var l=67108864*(0|c.words[f.length+s])+(0|c.words[f.length+s-1]);for(l=Math.min(l/r|0,67108863),c._ishlnsubmul(f,l,s);0!==c.negative;)l--,c.negative=0,c._ishlnsubmul(f,1,s),c.isZero()||(c.negative^=1);n&&(n.words[s]=l)}return n&&n.strip(),c.strip(),"div"!==a&&0!==t&&c.iushrn(t),{div:n||null,mod:c}},d.prototype.divmod=function(e,a,t){return c(!e.isZero()),this.isZero()?{div:new d(0),mod:new d(0)}:0!==this.negative&&0===e.negative?(n=this.neg().divmod(e,a),"mod"!==a&&(f=n.div.neg()),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.iadd(e)),{div:f,mod:r}):0===this.negative&&0!==e.negative?(n=this.divmod(e.neg(),a),"mod"!==a&&(f=n.div.neg()),{div:f,mod:n.mod}):this.negative&e.negative?(n=this.neg().divmod(e.neg(),a),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.isub(e)),{div:n.div,mod:r}):e.length>this.length||this.cmp(e)<0?{div:new d(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new d(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new d(this.modn(e.words[0]))}:this._wordDiv(e,a);var f,r,n},d.prototype.div=function(e){return this.divmod(e,"div",!1).div},d.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},d.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},d.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var t=0!==a.div.negative?a.mod.isub(e):a.mod,c=e.ushrn(1),f=e.andln(1),d=t.cmp(c);return d<0||1===f&&0===d?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},d.prototype.modn=function(e){c(e<=67108863);for(var a=(1<<26)%e,t=0,f=this.length-1;f>=0;f--)t=(a*t+(0|this.words[f]))%e;return t},d.prototype.idivn=function(e){c(e<=67108863);for(var a=0,t=this.length-1;t>=0;t--){var f=(0|this.words[t])+67108864*a;this.words[t]=f/e|0,a=f%e}return this.strip()},d.prototype.divn=function(e){return this.clone().idivn(e)},d.prototype.egcd=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f=new d(1),r=new d(0),n=new d(0),i=new d(1),b=0;a.isEven()&&t.isEven();)a.iushrn(1),t.iushrn(1),++b;for(var o=t.clone(),s=a.clone();!a.isZero();){for(var l=0,u=1;!(a.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(f.isOdd()||r.isOdd())&&(f.iadd(o),r.isub(s)),f.iushrn(1),r.iushrn(1);for(var h=0,p=1;!(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(o),i.isub(s)),n.iushrn(1),i.iushrn(1);a.cmp(t)>=0?(a.isub(t),f.isub(n),r.isub(i)):(t.isub(a),n.isub(f),i.isub(r))}return{a:n,b:i,gcd:t.iushln(b)}},d.prototype._invmp=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f,r=new d(1),n=new d(0),i=t.clone();a.cmpn(1)>0&&t.cmpn(1)>0;){for(var b=0,o=1;!(a.words[0]&o)&&b<26;++b,o<<=1);if(b>0)for(a.iushrn(b);b-- >0;)r.isOdd()&&r.iadd(i),r.iushrn(1);for(var s=0,l=1;!(t.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(t.iushrn(s);s-- >0;)n.isOdd()&&n.iadd(i),n.iushrn(1);a.cmp(t)>=0?(a.isub(t),r.isub(n)):(t.isub(a),n.isub(r))}return(f=0===a.cmpn(1)?r:n).cmpn(0)<0&&f.iadd(e),f},d.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),t=e.clone();a.negative=0,t.negative=0;for(var c=0;a.isEven()&&t.isEven();c++)a.iushrn(1),t.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;t.isEven();)t.iushrn(1);var f=a.cmp(t);if(f<0){var d=a;a=t,t=d}else if(0===f||0===t.cmpn(1))break;a.isub(t)}return t.iushln(c)},d.prototype.invm=function(e){return this.egcd(e).a.umod(e)},d.prototype.isEven=function(){return!(1&this.words[0])},d.prototype.isOdd=function(){return!(1&~this.words[0])},d.prototype.andln=function(e){return this.words[0]&e},d.prototype.bincn=function(e){c("number"==typeof e);var a=e%26,t=(e-a)/26,f=1<>>26,n&=67108863,this.words[r]=n}return 0!==d&&(this.words[r]=d,this.length++),this},d.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},d.prototype.cmpn=function(e){var a,t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)a=1;else{t&&(e=-e),c(e<=67108863,"Number is too big");var f=0|this.words[0];a=f===e?0:fe.length)return 1;if(this.length=0;t--){var c=0|this.words[t],f=0|e.words[t];if(c!==f){cf&&(a=1);break}}return a},d.prototype.gtn=function(e){return 1===this.cmpn(e)},d.prototype.gt=function(e){return 1===this.cmp(e)},d.prototype.gten=function(e){return this.cmpn(e)>=0},d.prototype.gte=function(e){return this.cmp(e)>=0},d.prototype.ltn=function(e){return-1===this.cmpn(e)},d.prototype.lt=function(e){return-1===this.cmp(e)},d.prototype.lten=function(e){return this.cmpn(e)<=0},d.prototype.lte=function(e){return this.cmp(e)<=0},d.prototype.eqn=function(e){return 0===this.cmpn(e)},d.prototype.eq=function(e){return 0===this.cmp(e)},d.red=function(e){return new _(e)},d.prototype.toRed=function(e){return c(!this.red,"Already a number in reduction context"),c(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},d.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},d.prototype._forceRed=function(e){return this.red=e,this},d.prototype.forceRed=function(e){return c(!this.red,"Already a number in reduction context"),this._forceRed(e)},d.prototype.redAdd=function(e){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},d.prototype.redIAdd=function(e){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},d.prototype.redSub=function(e){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},d.prototype.redISub=function(e){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},d.prototype.redShl=function(e){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},d.prototype.redMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},d.prototype.redIMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},d.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},d.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},d.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},d.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},d.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},d.prototype.redPow=function(e){return c(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function x(e,a){this.name=e,this.p=new d(a,16),this.n=this.p.bitLength(),this.k=new d(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var a=d._prime(e);this.m=a.p,this.prime=a}else c(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new d(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)}x.prototype._tmp=function(){var e=new d(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var a,t=e;do{this.split(t,this.tmp),a=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(a>this.n);var c=a0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},x.prototype.split=function(e,a){e.iushrn(this.n,0,a)},x.prototype.imulK=function(e){return e.imul(this.k)},f(y,x),y.prototype.split=function(e,a){for(var t=4194303,c=Math.min(e.length,9),f=0;f>>22,d=r}d>>>=22,e.words[f-10]=d,0===d&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,t=0;t>>=26,e.words[t]=f,a=c}return 0!==a&&(e.words[e.length++]=a),e},d._prime=function(e){if(m[e])return m[e];var a;if("k256"===e)a=new y;else if("p224"===e)a=new A;else if("p192"===e)a=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new w}return m[e]=a,a},_.prototype._verify1=function(e){c(0===e.negative,"red works only with positives"),c(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,a){c(!(e.negative|a.negative),"red works only with positives"),c(e.red&&e.red===a.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,a){this._verify2(e,a);var t=e.add(a);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},_.prototype.iadd=function(e,a){this._verify2(e,a);var t=e.iadd(a);return t.cmp(this.m)>=0&&t.isub(this.m),t},_.prototype.sub=function(e,a){this._verify2(e,a);var t=e.sub(a);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},_.prototype.isub=function(e,a){this._verify2(e,a);var t=e.isub(a);return t.cmpn(0)<0&&t.iadd(this.m),t},_.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},_.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},_.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(c(a%2==1),3===a){var t=this.m.add(new d(1)).iushrn(2);return this.pow(e,t)}for(var f=this.m.subn(1),r=0;!f.isZero()&&0===f.andln(1);)r++,f.iushrn(1);c(!f.isZero());var n=new d(1).toRed(this),i=n.redNeg(),b=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new d(2*o*o).toRed(this);0!==this.pow(o,b).cmp(i);)o.redIAdd(i);for(var s=this.pow(o,f),l=this.pow(e,f.addn(1).iushrn(1)),u=this.pow(e,f),h=r;0!==u.cmp(n);){for(var p=u,g=0;0!==p.cmp(n);g++)p=p.redSqr();c(g=0;c--){for(var b=a.words[c],o=i-1;o>=0;o--){var s=b>>o&1;f!==t[0]&&(f=this.sqr(f)),0!==s||0!==r?(r<<=1,r|=s,(4==++n||0===c&&0===o)&&(f=this.mul(f,t[r]),n=0,r=0)):n=0}i=26}return f},_.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},_.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},d.mont=function(e){return new I(e)},f(I,_),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},I.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var t=e.imul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),d=f;return f.cmp(this.m)>=0?d=f.isub(this.m):f.cmpn(0)<0&&(d=f.iadd(this.m)),d._forceRed(this)},I.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new d(0)._forceRed(this);var t=e.mul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),r=f;return f.cmp(this.m)>=0?r=f.isub(this.m):f.cmpn(0)<0&&(r=f.iadd(this.m)),r._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=t.nmd(e),this)},47108:(e,a,t)=>{"use strict";var c=t(56698),f=t(88276),d=t(66011),r=t(62802),n=t(56168);function i(e){n.call(this,"digest"),this._hash=e}c(i,n),i.prototype._update=function(e){this._hash.update(e)},i.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new f:"rmd160"===e||"ripemd160"===e?new d:new i(r(e))}},20320:(e,a,t)=>{var c=t(88276);e.exports=function(e){return(new c).update(e).digest()}},83507:(e,a,t)=>{"use strict";var c=t(56698),f=t(41800),d=t(56168),r=t(92861).Buffer,n=t(20320),i=t(66011),b=t(62802),o=r.alloc(128);function s(e,a){d.call(this,"digest"),"string"==typeof a&&(a=r.from(a));var t="sha512"===e||"sha384"===e?128:64;this._alg=e,this._key=a,a.length>t?a=("rmd160"===e?new i:b(e)).update(a).digest():a.length{"use strict";var c=t(56698),f=t(92861).Buffer,d=t(56168),r=f.alloc(128),n=64;function i(e,a){d.call(this,"digest"),"string"==typeof a&&(a=f.from(a)),this._alg=e,this._key=a,a.length>n?a=e(a):a.length{var c="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==t.g&&t.g,f=function(){function e(){this.fetch=!1,this.DOMException=c.DOMException}return e.prototype=c,new e}();!function(e){!function(a){var t=void 0!==e&&e||"undefined"!=typeof self&&self||void 0!==t&&t,c="URLSearchParams"in t,f="Symbol"in t&&"iterator"in Symbol,d="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(e){return!1}}(),r="FormData"in t,n="ArrayBuffer"in t;if(n)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],b=ArrayBuffer.isView||function(e){return e&&i.indexOf(Object.prototype.toString.call(e))>-1};function o(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function s(e){return"string"!=typeof e&&(e=String(e)),e}function l(e){var a={next:function(){var a=e.shift();return{done:void 0===a,value:a}}};return f&&(a[Symbol.iterator]=function(){return a}),a}function u(e){this.map={},e instanceof u?e.forEach((function(e,a){this.append(a,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(a){this.append(a,e[a])}),this)}function h(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise((function(a,t){e.onload=function(){a(e.result)},e.onerror=function(){t(e.error)}}))}function g(e){var a=new FileReader,t=p(a);return a.readAsArrayBuffer(e),t}function m(e){if(e.slice)return e.slice(0);var a=new Uint8Array(e.byteLength);return a.set(new Uint8Array(e)),a.buffer}function x(){return this.bodyUsed=!1,this._initBody=function(e){var a;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:d&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:r&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:c&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():n&&d&&(a=e)&&DataView.prototype.isPrototypeOf(a)?(this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):n&&(ArrayBuffer.prototype.isPrototypeOf(e)||b(e))?this._bodyArrayBuffer=m(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):c&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},d&&(this.blob=function(){var e=h(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?h(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)):this.blob().then(g)}),this.text=function(){var e,a,t,c=h(this);if(c)return c;if(this._bodyBlob)return e=this._bodyBlob,t=p(a=new FileReader),a.readAsText(e),t;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var a=new Uint8Array(e),t=new Array(a.length),c=0;c-1?c:t),this.mode=a.mode||this.mode||null,this.signal=a.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&f)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(f),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==a.cache&&"no-cache"!==a.cache)){var d=/([?&])_=[^&]*/;d.test(this.url)?this.url=this.url.replace(d,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function v(e){var a=new FormData;return e.trim().split("&").forEach((function(e){if(e){var t=e.split("="),c=t.shift().replace(/\+/g," "),f=t.join("=").replace(/\+/g," ");a.append(decodeURIComponent(c),decodeURIComponent(f))}})),a}function w(e,a){if(!(this instanceof w))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');a||(a={}),this.type="default",this.status=void 0===a.status?200:a.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===a.statusText?"":""+a.statusText,this.headers=new u(a.headers),this.url=a.url||"",this._initBody(e)}A.prototype.clone=function(){return new A(this,{body:this._bodyInit})},x.call(A.prototype),x.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},w.error=function(){var e=new w(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];w.redirect=function(e,a){if(-1===_.indexOf(a))throw new RangeError("Invalid status code");return new w(null,{status:a,headers:{location:e}})},a.DOMException=t.DOMException;try{new a.DOMException}catch(e){a.DOMException=function(e,a){this.message=e,this.name=a;var t=Error(e);this.stack=t.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function I(e,c){return new Promise((function(f,r){var i=new A(e,c);if(i.signal&&i.signal.aborted)return r(new a.DOMException("Aborted","AbortError"));var b=new XMLHttpRequest;function o(){b.abort()}b.onload=function(){var e,a,t={status:b.status,statusText:b.statusText,headers:(e=b.getAllResponseHeaders()||"",a=new u,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var t=e.split(":"),c=t.shift().trim();if(c){var f=t.join(":").trim();a.append(c,f)}})),a)};t.url="responseURL"in b?b.responseURL:t.headers.get("X-Request-URL");var c="response"in b?b.response:b.responseText;setTimeout((function(){f(new w(c,t))}),0)},b.onerror=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},b.ontimeout=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},b.onabort=function(){setTimeout((function(){r(new a.DOMException("Aborted","AbortError"))}),0)},b.open(i.method,function(e){try{return""===e&&t.location.href?t.location.href:e}catch(a){return e}}(i.url),!0),"include"===i.credentials?b.withCredentials=!0:"omit"===i.credentials&&(b.withCredentials=!1),"responseType"in b&&(d?b.responseType="blob":n&&i.headers.get("Content-Type")&&-1!==i.headers.get("Content-Type").indexOf("application/octet-stream")&&(b.responseType="arraybuffer")),!c||"object"!=typeof c.headers||c.headers instanceof u?i.headers.forEach((function(e,a){b.setRequestHeader(a,e)})):Object.getOwnPropertyNames(c.headers).forEach((function(e){b.setRequestHeader(e,s(c.headers[e]))})),i.signal&&(i.signal.addEventListener("abort",o),b.onreadystatechange=function(){4===b.readyState&&i.signal.removeEventListener("abort",o)}),b.send(void 0===i._bodyInit?null:i._bodyInit)}))}I.polyfill=!0,t.fetch||(t.fetch=I,t.Headers=u,t.Request=A,t.Response=w),a.Headers=u,a.Request=A,a.Response=w,a.fetch=I}({})}(f),f.fetch.ponyfill=!0,delete f.fetch.polyfill;var d=c.fetch?c:f;(a=d.fetch).default=d.fetch,a.fetch=d.fetch,a.Headers=d.Headers,a.Request=d.Request,a.Response=d.Response,e.exports=a},91565:(e,a,t)=>{"use strict";a.randomBytes=a.rng=a.pseudoRandomBytes=a.prng=t(53209),a.createHash=a.Hash=t(47108),a.createHmac=a.Hmac=t(83507);var c=t(55715),f=Object.keys(c),d=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(f);a.getHashes=function(){return d};var r=t(78396);a.pbkdf2=r.pbkdf2,a.pbkdf2Sync=r.pbkdf2Sync;var n=t(30125);a.Cipher=n.Cipher,a.createCipher=n.createCipher,a.Cipheriv=n.Cipheriv,a.createCipheriv=n.createCipheriv,a.Decipher=n.Decipher,a.createDecipher=n.createDecipher,a.Decipheriv=n.Decipheriv,a.createDecipheriv=n.createDecipheriv,a.getCiphers=n.getCiphers,a.listCiphers=n.listCiphers;var i=t(15380);a.DiffieHellmanGroup=i.DiffieHellmanGroup,a.createDiffieHellmanGroup=i.createDiffieHellmanGroup,a.getDiffieHellman=i.getDiffieHellman,a.createDiffieHellman=i.createDiffieHellman,a.DiffieHellman=i.DiffieHellman;var b=t(20);a.createSign=b.createSign,a.Sign=b.Sign,a.createVerify=b.createVerify,a.Verify=b.Verify,a.createECDH=t(61324);var o=t(97168);a.publicEncrypt=o.publicEncrypt,a.privateEncrypt=o.privateEncrypt,a.publicDecrypt=o.publicDecrypt,a.privateDecrypt=o.privateDecrypt;var s=t(76983);a.randomFill=s.randomFill,a.randomFillSync=s.randomFillSync,a.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},a.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},17833:(e,a,t)=>{a.formatArgs=function(a){if(a[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+a[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const t="color: "+this.color;a.splice(1,0,t,"color: inherit");let c=0,f=0;a[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(c++,"%c"===e&&(f=c))})),a.splice(f,0,t)},a.save=function(e){try{e?a.storage.setItem("debug",e):a.storage.removeItem("debug")}catch(e){}},a.load=function(){let e;try{e=a.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},a.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},a.storage=function(){try{return localStorage}catch(e){}}(),a.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),a.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],a.log=console.debug||console.log||(()=>{}),e.exports=t(40736)(a);const{formatters:c}=e.exports;c.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},40736:(e,a,t)=>{e.exports=function(e){function a(e){let t,f,d,r=null;function n(...e){if(!n.enabled)return;const c=n,f=Number(new Date),d=f-(t||f);c.diff=d,c.prev=t,c.curr=f,t=f,e[0]=a.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let r=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((t,f)=>{if("%%"===t)return"%";r++;const d=a.formatters[f];if("function"==typeof d){const a=e[r];t=d.call(c,a),e.splice(r,1),r--}return t})),a.formatArgs.call(c,e),(c.log||a.log).apply(c,e)}return n.namespace=e,n.useColors=a.useColors(),n.color=a.selectColor(e),n.extend=c,n.destroy=a.destroy,Object.defineProperty(n,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==r?r:(f!==a.namespaces&&(f=a.namespaces,d=a.enabled(e)),d),set:e=>{r=e}}),"function"==typeof a.init&&a.init(n),n}function c(e,t){const c=a(this.namespace+(void 0===t?":":t)+e);return c.log=this.log,c}function f(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return a.debug=a,a.default=a,a.coerce=function(e){return e instanceof Error?e.stack||e.message:e},a.disable=function(){const e=[...a.names.map(f),...a.skips.map(f).map((e=>"-"+e))].join(",");return a.enable(""),e},a.enable=function(e){let t;a.save(e),a.namespaces=e,a.names=[],a.skips=[];const c=("string"==typeof e?e:"").split(/[\s,]+/),f=c.length;for(t=0;t{a[t]=e[t]})),a.names=[],a.skips=[],a.formatters={},a.selectColor=function(e){let t=0;for(let a=0;a{"use strict";var c=t(30655),f=t(58068),d=t(69675),r=t(75795);e.exports=function(e,a,t){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new d("`obj` must be an object or a function`");if("string"!=typeof a&&"symbol"!=typeof a)throw new d("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new d("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new d("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new d("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new d("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,b=arguments.length>5?arguments[5]:null,o=arguments.length>6&&arguments[6],s=!!r&&r(e,a);if(c)c(e,a,{configurable:null===b&&s?s.configurable:!b,enumerable:null===n&&s?s.enumerable:!n,value:t,writable:null===i&&s?s.writable:!i});else{if(!o&&(n||i||b))throw new f("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[a]=t}}},38452:(e,a,t)=>{"use strict";var c=t(1189),f="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),d=Object.prototype.toString,r=Array.prototype.concat,n=t(30041),i=t(30592)(),b=function(e,a,t,c){if(a in e)if(!0===c){if(e[a]===t)return}else if("function"!=typeof(f=c)||"[object Function]"!==d.call(f)||!c())return;var f;i?n(e,a,t,!0):n(e,a,t)},o=function(e,a){var t=arguments.length>2?arguments[2]:{},d=c(a);f&&(d=r.call(d,Object.getOwnPropertySymbols(a)));for(var n=0;n{"use strict";a.utils=t(87626),a.Cipher=t(82808),a.DES=t(82211),a.CBC=t(3389),a.EDE=t(65279)},3389:(e,a,t)=>{"use strict";var c=t(43349),f=t(56698),d={};function r(e){c.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var a=0;a{"use strict";var c=t(43349);function f(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=!1!==e.padding}e.exports=f,f.prototype._init=function(){},f.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},f.prototype._buffer=function(e,a){for(var t=Math.min(this.buffer.length-this.bufferOff,e.length-a),c=0;c0;c--)a+=this._buffer(e,a),t+=this._flushBuffer(f,t);return a+=this._buffer(e,a),f},f.prototype.final=function(e){var a,t;return e&&(a=this.update(e)),t="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),a?a.concat(t):t},f.prototype._pad=function(e,a){if(0===a)return!1;for(;a{"use strict";var c=t(43349),f=t(56698),d=t(87626),r=t(82808);function n(){this.tmp=new Array(2),this.keys=null}function i(e){r.call(this,e);var a=new n;this._desState=a,this.deriveKeys(a,e.key)}f(i,r),e.exports=i,i.create=function(e){return new i(e)};var b=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];i.prototype.deriveKeys=function(e,a){e.keys=new Array(32),c.equal(a.length,this.blockSize,"Invalid key length");var t=d.readUInt32BE(a,0),f=d.readUInt32BE(a,4);d.pc1(t,f,e.tmp,0),t=e.tmp[0],f=e.tmp[1];for(var r=0;r>>1];t=d.r28shl(t,n),f=d.r28shl(f,n),d.pc2(t,f,e.keys,r)}},i.prototype._update=function(e,a,t,c){var f=this._desState,r=d.readUInt32BE(e,a),n=d.readUInt32BE(e,a+4);d.ip(r,n,f.tmp,0),r=f.tmp[0],n=f.tmp[1],"encrypt"===this.type?this._encrypt(f,r,n,f.tmp,0):this._decrypt(f,r,n,f.tmp,0),r=f.tmp[0],n=f.tmp[1],d.writeUInt32BE(t,r,c),d.writeUInt32BE(t,n,c+4)},i.prototype._pad=function(e,a){if(!1===this.padding)return!1;for(var t=e.length-a,c=a;c>>0,r=l}d.rip(n,r,c,f)},i.prototype._decrypt=function(e,a,t,c,f){for(var r=t,n=a,i=e.keys.length-2;i>=0;i-=2){var b=e.keys[i],o=e.keys[i+1];d.expand(r,e.tmp,0),b^=e.tmp[0],o^=e.tmp[1];var s=d.substitute(b,o),l=r;r=(n^d.permute(s))>>>0,n=l}d.rip(r,n,c,f)}},65279:(e,a,t)=>{"use strict";var c=t(43349),f=t(56698),d=t(82808),r=t(82211);function n(e,a){c.equal(a.length,24,"Invalid key length");var t=a.slice(0,8),f=a.slice(8,16),d=a.slice(16,24);this.ciphers="encrypt"===e?[r.create({type:"encrypt",key:t}),r.create({type:"decrypt",key:f}),r.create({type:"encrypt",key:d})]:[r.create({type:"decrypt",key:d}),r.create({type:"encrypt",key:f}),r.create({type:"decrypt",key:t})]}function i(e){d.call(this,e);var a=new n(this.type,this.options.key);this._edeState=a}f(i,d),e.exports=i,i.create=function(e){return new i(e)},i.prototype._update=function(e,a,t,c){var f=this._edeState;f.ciphers[0]._update(e,a,t,c),f.ciphers[1]._update(t,c,t,c),f.ciphers[2]._update(t,c,t,c)},i.prototype._pad=r.prototype._pad,i.prototype._unpad=r.prototype._unpad},87626:(e,a)=>{"use strict";a.readUInt32BE=function(e,a){return(e[0+a]<<24|e[1+a]<<16|e[2+a]<<8|e[3+a])>>>0},a.writeUInt32BE=function(e,a,t){e[0+t]=a>>>24,e[1+t]=a>>>16&255,e[2+t]=a>>>8&255,e[3+t]=255&a},a.ip=function(e,a,t,c){for(var f=0,d=0,r=6;r>=0;r-=2){for(var n=0;n<=24;n+=8)f<<=1,f|=a>>>n+r&1;for(n=0;n<=24;n+=8)f<<=1,f|=e>>>n+r&1}for(r=6;r>=0;r-=2){for(n=1;n<=25;n+=8)d<<=1,d|=a>>>n+r&1;for(n=1;n<=25;n+=8)d<<=1,d|=e>>>n+r&1}t[c+0]=f>>>0,t[c+1]=d>>>0},a.rip=function(e,a,t,c){for(var f=0,d=0,r=0;r<4;r++)for(var n=24;n>=0;n-=8)f<<=1,f|=a>>>n+r&1,f<<=1,f|=e>>>n+r&1;for(r=4;r<8;r++)for(n=24;n>=0;n-=8)d<<=1,d|=a>>>n+r&1,d<<=1,d|=e>>>n+r&1;t[c+0]=f>>>0,t[c+1]=d>>>0},a.pc1=function(e,a,t,c){for(var f=0,d=0,r=7;r>=5;r--){for(var n=0;n<=24;n+=8)f<<=1,f|=a>>n+r&1;for(n=0;n<=24;n+=8)f<<=1,f|=e>>n+r&1}for(n=0;n<=24;n+=8)f<<=1,f|=a>>n+r&1;for(r=1;r<=3;r++){for(n=0;n<=24;n+=8)d<<=1,d|=a>>n+r&1;for(n=0;n<=24;n+=8)d<<=1,d|=e>>n+r&1}for(n=0;n<=24;n+=8)d<<=1,d|=e>>n+r&1;t[c+0]=f>>>0,t[c+1]=d>>>0},a.r28shl=function(e,a){return e<>>28-a};var t=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];a.pc2=function(e,a,c,f){for(var d=0,r=0,n=t.length>>>1,i=0;i>>t[i]&1;for(i=n;i>>t[i]&1;c[f+0]=d>>>0,c[f+1]=r>>>0},a.expand=function(e,a,t){var c=0,f=0;c=(1&e)<<5|e>>>27;for(var d=23;d>=15;d-=4)c<<=6,c|=e>>>d&63;for(d=11;d>=3;d-=4)f|=e>>>d&63,f<<=6;f|=(31&e)<<1|e>>>31,a[t+0]=c>>>0,a[t+1]=f>>>0};var c=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];a.substitute=function(e,a){for(var t=0,f=0;f<4;f++)t<<=4,t|=c[64*f+(e>>>18-6*f&63)];for(f=0;f<4;f++)t<<=4,t|=c[256+64*f+(a>>>18-6*f&63)];return t>>>0};var f=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];a.permute=function(e){for(var a=0,t=0;t>>f[t]&1;return a>>>0},a.padSplit=function(e,a,t){for(var c=e.toString(2);c.length{var c=t(62045).hp,f=t(4934),d=t(23241),r=t(14910),n={binary:!0,hex:!0,base64:!0};a.DiffieHellmanGroup=a.createDiffieHellmanGroup=a.getDiffieHellman=function(e){var a=new c(d[e].prime,"hex"),t=new c(d[e].gen,"hex");return new r(a,t)},a.createDiffieHellman=a.DiffieHellman=function e(a,t,d,i){return c.isBuffer(t)||void 0===n[t]?e(a,"binary",t,d):(t=t||"binary",i=i||"binary",d=d||new c([2]),c.isBuffer(d)||(d=new c(d,i)),"number"==typeof a?new r(f(a,d),d,!0):(c.isBuffer(a)||(a=new c(a,t)),new r(a,d,!0)))}},14910:(e,a,t)=>{var c=t(62045).hp,f=t(66473),d=new(t(52244)),r=new f(24),n=new f(11),i=new f(10),b=new f(3),o=new f(7),s=t(4934),l=t(53209);function u(e,a){return a=a||"utf8",c.isBuffer(e)||(e=new c(e,a)),this._pub=new f(e),this}function h(e,a){return a=a||"utf8",c.isBuffer(e)||(e=new c(e,a)),this._priv=new f(e),this}e.exports=g;var p={};function g(e,a,t){this.setGenerator(a),this.__prime=new f(e),this._prime=f.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,t?(this.setPublicKey=u,this.setPrivateKey=h):this._primeCode=8}function m(e,a){var t=new c(e.toArray());return a?t.toString(a):t}Object.defineProperty(g.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,a){var t=a.toString("hex"),c=[t,e.toString(16)].join("_");if(c in p)return p[c];var f,l=0;if(e.isEven()||!s.simpleSieve||!s.fermatTest(e)||!d.test(e))return l+=1,l+="02"===t||"05"===t?8:4,p[c]=l,l;switch(d.test(e.shrn(1))||(l+=2),t){case"02":e.mod(r).cmp(n)&&(l+=8);break;case"05":(f=e.mod(i)).cmp(b)&&f.cmp(o)&&(l+=8);break;default:l+=4}return p[c]=l,l}(this.__prime,this.__gen)),this._primeCode}}),g.prototype.generateKeys=function(){return this._priv||(this._priv=new f(l(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},g.prototype.computeSecret=function(e){var a=(e=(e=new f(e)).toRed(this._prime)).redPow(this._priv).fromRed(),t=new c(a.toArray()),d=this.getPrime();if(t.length{var c=t(53209);e.exports=x,x.simpleSieve=g,x.fermatTest=m;var f=t(66473),d=new f(24),r=new(t(52244)),n=new f(1),i=new f(2),b=new f(5),o=(new f(16),new f(8),new f(10)),s=new f(3),l=(new f(7),new f(11)),u=new f(4),h=(new f(12),null);function p(){if(null!==h)return h;var e=[];e[0]=2;for(var a=1,t=3;t<1048576;t+=2){for(var c=Math.ceil(Math.sqrt(t)),f=0;fe;)t.ishrn(1);if(t.isEven()&&t.iadd(n),t.testn(1)||t.iadd(i),a.cmp(i)){if(!a.cmp(b))for(;t.mod(o).cmp(s);)t.iadd(u)}else for(;t.mod(d).cmp(l);)t.iadd(u);if(g(h=t.shrn(1))&&g(t)&&m(h)&&m(t)&&r.test(h)&&r.test(t))return t}}},66473:function(e,a,t){!function(e,a){"use strict";function c(e,a){if(!e)throw new Error(a||"Assertion failed")}function f(e,a){e.super_=a;var t=function(){};t.prototype=a.prototype,e.prototype=new t,e.prototype.constructor=e}function d(e,a,t){if(d.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==a&&"be"!==a||(t=a,a=10),this._init(e||0,a||10,t||"be"))}var r;"object"==typeof e?e.exports=d:a.BN=d,d.BN=d,d.wordSize=26;try{r="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:t(66089).Buffer}catch(e){}function n(e,a){var t=e.charCodeAt(a);return t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:t-48&15}function i(e,a,t){var c=n(e,t);return t-1>=a&&(c|=n(e,t-1)<<4),c}function b(e,a,t,c){for(var f=0,d=Math.min(e.length,t),r=a;r=49?n-49+10:n>=17?n-17+10:n}return f}d.isBN=function(e){return e instanceof d||null!==e&&"object"==typeof e&&e.constructor.wordSize===d.wordSize&&Array.isArray(e.words)},d.max=function(e,a){return e.cmp(a)>0?e:a},d.min=function(e,a){return e.cmp(a)<0?e:a},d.prototype._init=function(e,a,t){if("number"==typeof e)return this._initNumber(e,a,t);if("object"==typeof e)return this._initArray(e,a,t);"hex"===a&&(a=16),c(a===(0|a)&&a>=2&&a<=36);var f=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(f++,this.negative=1),f=0;f-=3)r=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[d]|=r<>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);else if("le"===t)for(f=0,d=0;f>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);return this.strip()},d.prototype._parseHex=function(e,a,t){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)f=i(e,a,c)<=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;else for(c=(e.length-a)%2==0?a+1:a;c=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;this.strip()},d.prototype._parseBase=function(e,a,t){this.words=[0],this.length=1;for(var c=0,f=1;f<=67108863;f*=a)c++;c--,f=f/a|0;for(var d=e.length-t,r=d%c,n=Math.min(d,d-r)+t,i=0,o=t;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},d.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},d.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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],l=[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 u(e,a,t){t.negative=a.negative^e.negative;var c=e.length+a.length|0;t.length=c,c=c-1|0;var f=0|e.words[0],d=0|a.words[0],r=f*d,n=67108863&r,i=r/67108864|0;t.words[0]=n;for(var b=1;b>>26,s=67108863&i,l=Math.min(b,a.length-1),u=Math.max(0,b-e.length+1);u<=l;u++){var h=b-u|0;o+=(r=(f=0|e.words[h])*(d=0|a.words[u])+s)/67108864|0,s=67108863&r}t.words[b]=0|s,i=0|o}return 0!==i?t.words[b]=0|i:t.length--,t.strip()}d.prototype.toString=function(e,a){var t;if(a=0|a||1,16===(e=e||10)||"hex"===e){t="";for(var f=0,d=0,r=0;r>>24-f&16777215)||r!==this.length-1?o[6-i.length]+i+t:i+t,(f+=2)>=26&&(f-=26,r--)}for(0!==d&&(t=d.toString(16)+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(e===(0|e)&&e>=2&&e<=36){var b=s[e],u=l[e];t="";var h=this.clone();for(h.negative=0;!h.isZero();){var p=h.modn(u).toString(e);t=(h=h.idivn(u)).isZero()?p+t:o[b-p.length]+p+t}for(this.isZero()&&(t="0"+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}c(!1,"Base should be between 2 and 36")},d.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&c(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},d.prototype.toJSON=function(){return this.toString(16)},d.prototype.toBuffer=function(e,a){return c(void 0!==r),this.toArrayLike(r,e,a)},d.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},d.prototype.toArrayLike=function(e,a,t){var f=this.byteLength(),d=t||Math.max(1,f);c(f<=d,"byte array longer than desired length"),c(d>0,"Requested array length <= 0"),this.strip();var r,n,i="le"===a,b=new e(d),o=this.clone();if(i){for(n=0;!o.isZero();n++)r=o.andln(255),o.iushrn(8),b[n]=r;for(;n=4096&&(t+=13,a>>>=13),a>=64&&(t+=7,a>>>=7),a>=8&&(t+=4,a>>>=4),a>=2&&(t+=2,a>>>=2),t+a},d.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,t=0;return 8191&a||(t+=13,a>>>=13),127&a||(t+=7,a>>>=7),15&a||(t+=4,a>>>=4),3&a||(t+=2,a>>>=2),1&a||t++,t},d.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},d.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},d.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},d.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var t=0;te.length?this.clone().iand(e):e.clone().iand(this)},d.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},d.prototype.iuxor=function(e){var a,t;this.length>e.length?(a=this,t=e):(a=e,t=this);for(var c=0;ce.length?this.clone().ixor(e):e.clone().ixor(this)},d.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},d.prototype.inotn=function(e){c("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),t=e%26;this._expand(a),t>0&&a--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-t),this.strip()},d.prototype.notn=function(e){return this.clone().inotn(e)},d.prototype.setn=function(e,a){c("number"==typeof e&&e>=0);var t=e/26|0,f=e%26;return this._expand(t+1),this.words[t]=a?this.words[t]|1<e.length?(t=this,c=e):(t=e,c=this);for(var f=0,d=0;d>>26;for(;0!==f&&d>>26;if(this.length=t.length,0!==f)this.words[this.length]=f,this.length++;else if(t!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},d.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var t,c,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(t=this,c=e):(t=e,c=this);for(var d=0,r=0;r>26,this.words[r]=67108863&a;for(;0!==d&&r>26,this.words[r]=67108863&a;if(0===d&&r>>13,u=0|r[1],h=8191&u,p=u>>>13,g=0|r[2],m=8191&g,x=g>>>13,y=0|r[3],A=8191&y,v=y>>>13,w=0|r[4],_=8191&w,I=w>>>13,E=0|r[5],C=8191&E,M=E>>>13,B=0|r[6],k=8191&B,L=B>>>13,S=0|r[7],T=8191&S,N=S>>>13,R=0|r[8],P=8191&R,D=R>>>13,O=0|r[9],F=8191&O,Q=O>>>13,U=0|n[0],j=8191&U,H=U>>>13,q=0|n[1],$=8191&q,z=q>>>13,G=0|n[2],K=8191&G,V=G>>>13,Z=0|n[3],J=8191&Z,W=Z>>>13,Y=0|n[4],X=8191&Y,ee=Y>>>13,ae=0|n[5],te=8191&ae,ce=ae>>>13,fe=0|n[6],de=8191&fe,re=fe>>>13,ne=0|n[7],ie=8191&ne,be=ne>>>13,oe=0|n[8],se=8191&oe,le=oe>>>13,ue=0|n[9],he=8191&ue,pe=ue>>>13;t.negative=e.negative^a.negative,t.length=19;var ge=(b+(c=Math.imul(s,j))|0)+((8191&(f=(f=Math.imul(s,H))+Math.imul(l,j)|0))<<13)|0;b=((d=Math.imul(l,H))+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,c=Math.imul(h,j),f=(f=Math.imul(h,H))+Math.imul(p,j)|0,d=Math.imul(p,H);var me=(b+(c=c+Math.imul(s,$)|0)|0)+((8191&(f=(f=f+Math.imul(s,z)|0)+Math.imul(l,$)|0))<<13)|0;b=((d=d+Math.imul(l,z)|0)+(f>>>13)|0)+(me>>>26)|0,me&=67108863,c=Math.imul(m,j),f=(f=Math.imul(m,H))+Math.imul(x,j)|0,d=Math.imul(x,H),c=c+Math.imul(h,$)|0,f=(f=f+Math.imul(h,z)|0)+Math.imul(p,$)|0,d=d+Math.imul(p,z)|0;var xe=(b+(c=c+Math.imul(s,K)|0)|0)+((8191&(f=(f=f+Math.imul(s,V)|0)+Math.imul(l,K)|0))<<13)|0;b=((d=d+Math.imul(l,V)|0)+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,c=Math.imul(A,j),f=(f=Math.imul(A,H))+Math.imul(v,j)|0,d=Math.imul(v,H),c=c+Math.imul(m,$)|0,f=(f=f+Math.imul(m,z)|0)+Math.imul(x,$)|0,d=d+Math.imul(x,z)|0,c=c+Math.imul(h,K)|0,f=(f=f+Math.imul(h,V)|0)+Math.imul(p,K)|0,d=d+Math.imul(p,V)|0;var ye=(b+(c=c+Math.imul(s,J)|0)|0)+((8191&(f=(f=f+Math.imul(s,W)|0)+Math.imul(l,J)|0))<<13)|0;b=((d=d+Math.imul(l,W)|0)+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,c=Math.imul(_,j),f=(f=Math.imul(_,H))+Math.imul(I,j)|0,d=Math.imul(I,H),c=c+Math.imul(A,$)|0,f=(f=f+Math.imul(A,z)|0)+Math.imul(v,$)|0,d=d+Math.imul(v,z)|0,c=c+Math.imul(m,K)|0,f=(f=f+Math.imul(m,V)|0)+Math.imul(x,K)|0,d=d+Math.imul(x,V)|0,c=c+Math.imul(h,J)|0,f=(f=f+Math.imul(h,W)|0)+Math.imul(p,J)|0,d=d+Math.imul(p,W)|0;var Ae=(b+(c=c+Math.imul(s,X)|0)|0)+((8191&(f=(f=f+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;b=((d=d+Math.imul(l,ee)|0)+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,c=Math.imul(C,j),f=(f=Math.imul(C,H))+Math.imul(M,j)|0,d=Math.imul(M,H),c=c+Math.imul(_,$)|0,f=(f=f+Math.imul(_,z)|0)+Math.imul(I,$)|0,d=d+Math.imul(I,z)|0,c=c+Math.imul(A,K)|0,f=(f=f+Math.imul(A,V)|0)+Math.imul(v,K)|0,d=d+Math.imul(v,V)|0,c=c+Math.imul(m,J)|0,f=(f=f+Math.imul(m,W)|0)+Math.imul(x,J)|0,d=d+Math.imul(x,W)|0,c=c+Math.imul(h,X)|0,f=(f=f+Math.imul(h,ee)|0)+Math.imul(p,X)|0,d=d+Math.imul(p,ee)|0;var ve=(b+(c=c+Math.imul(s,te)|0)|0)+((8191&(f=(f=f+Math.imul(s,ce)|0)+Math.imul(l,te)|0))<<13)|0;b=((d=d+Math.imul(l,ce)|0)+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,c=Math.imul(k,j),f=(f=Math.imul(k,H))+Math.imul(L,j)|0,d=Math.imul(L,H),c=c+Math.imul(C,$)|0,f=(f=f+Math.imul(C,z)|0)+Math.imul(M,$)|0,d=d+Math.imul(M,z)|0,c=c+Math.imul(_,K)|0,f=(f=f+Math.imul(_,V)|0)+Math.imul(I,K)|0,d=d+Math.imul(I,V)|0,c=c+Math.imul(A,J)|0,f=(f=f+Math.imul(A,W)|0)+Math.imul(v,J)|0,d=d+Math.imul(v,W)|0,c=c+Math.imul(m,X)|0,f=(f=f+Math.imul(m,ee)|0)+Math.imul(x,X)|0,d=d+Math.imul(x,ee)|0,c=c+Math.imul(h,te)|0,f=(f=f+Math.imul(h,ce)|0)+Math.imul(p,te)|0,d=d+Math.imul(p,ce)|0;var we=(b+(c=c+Math.imul(s,de)|0)|0)+((8191&(f=(f=f+Math.imul(s,re)|0)+Math.imul(l,de)|0))<<13)|0;b=((d=d+Math.imul(l,re)|0)+(f>>>13)|0)+(we>>>26)|0,we&=67108863,c=Math.imul(T,j),f=(f=Math.imul(T,H))+Math.imul(N,j)|0,d=Math.imul(N,H),c=c+Math.imul(k,$)|0,f=(f=f+Math.imul(k,z)|0)+Math.imul(L,$)|0,d=d+Math.imul(L,z)|0,c=c+Math.imul(C,K)|0,f=(f=f+Math.imul(C,V)|0)+Math.imul(M,K)|0,d=d+Math.imul(M,V)|0,c=c+Math.imul(_,J)|0,f=(f=f+Math.imul(_,W)|0)+Math.imul(I,J)|0,d=d+Math.imul(I,W)|0,c=c+Math.imul(A,X)|0,f=(f=f+Math.imul(A,ee)|0)+Math.imul(v,X)|0,d=d+Math.imul(v,ee)|0,c=c+Math.imul(m,te)|0,f=(f=f+Math.imul(m,ce)|0)+Math.imul(x,te)|0,d=d+Math.imul(x,ce)|0,c=c+Math.imul(h,de)|0,f=(f=f+Math.imul(h,re)|0)+Math.imul(p,de)|0,d=d+Math.imul(p,re)|0;var _e=(b+(c=c+Math.imul(s,ie)|0)|0)+((8191&(f=(f=f+Math.imul(s,be)|0)+Math.imul(l,ie)|0))<<13)|0;b=((d=d+Math.imul(l,be)|0)+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,c=Math.imul(P,j),f=(f=Math.imul(P,H))+Math.imul(D,j)|0,d=Math.imul(D,H),c=c+Math.imul(T,$)|0,f=(f=f+Math.imul(T,z)|0)+Math.imul(N,$)|0,d=d+Math.imul(N,z)|0,c=c+Math.imul(k,K)|0,f=(f=f+Math.imul(k,V)|0)+Math.imul(L,K)|0,d=d+Math.imul(L,V)|0,c=c+Math.imul(C,J)|0,f=(f=f+Math.imul(C,W)|0)+Math.imul(M,J)|0,d=d+Math.imul(M,W)|0,c=c+Math.imul(_,X)|0,f=(f=f+Math.imul(_,ee)|0)+Math.imul(I,X)|0,d=d+Math.imul(I,ee)|0,c=c+Math.imul(A,te)|0,f=(f=f+Math.imul(A,ce)|0)+Math.imul(v,te)|0,d=d+Math.imul(v,ce)|0,c=c+Math.imul(m,de)|0,f=(f=f+Math.imul(m,re)|0)+Math.imul(x,de)|0,d=d+Math.imul(x,re)|0,c=c+Math.imul(h,ie)|0,f=(f=f+Math.imul(h,be)|0)+Math.imul(p,ie)|0,d=d+Math.imul(p,be)|0;var Ie=(b+(c=c+Math.imul(s,se)|0)|0)+((8191&(f=(f=f+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;b=((d=d+Math.imul(l,le)|0)+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,c=Math.imul(F,j),f=(f=Math.imul(F,H))+Math.imul(Q,j)|0,d=Math.imul(Q,H),c=c+Math.imul(P,$)|0,f=(f=f+Math.imul(P,z)|0)+Math.imul(D,$)|0,d=d+Math.imul(D,z)|0,c=c+Math.imul(T,K)|0,f=(f=f+Math.imul(T,V)|0)+Math.imul(N,K)|0,d=d+Math.imul(N,V)|0,c=c+Math.imul(k,J)|0,f=(f=f+Math.imul(k,W)|0)+Math.imul(L,J)|0,d=d+Math.imul(L,W)|0,c=c+Math.imul(C,X)|0,f=(f=f+Math.imul(C,ee)|0)+Math.imul(M,X)|0,d=d+Math.imul(M,ee)|0,c=c+Math.imul(_,te)|0,f=(f=f+Math.imul(_,ce)|0)+Math.imul(I,te)|0,d=d+Math.imul(I,ce)|0,c=c+Math.imul(A,de)|0,f=(f=f+Math.imul(A,re)|0)+Math.imul(v,de)|0,d=d+Math.imul(v,re)|0,c=c+Math.imul(m,ie)|0,f=(f=f+Math.imul(m,be)|0)+Math.imul(x,ie)|0,d=d+Math.imul(x,be)|0,c=c+Math.imul(h,se)|0,f=(f=f+Math.imul(h,le)|0)+Math.imul(p,se)|0,d=d+Math.imul(p,le)|0;var Ee=(b+(c=c+Math.imul(s,he)|0)|0)+((8191&(f=(f=f+Math.imul(s,pe)|0)+Math.imul(l,he)|0))<<13)|0;b=((d=d+Math.imul(l,pe)|0)+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,c=Math.imul(F,$),f=(f=Math.imul(F,z))+Math.imul(Q,$)|0,d=Math.imul(Q,z),c=c+Math.imul(P,K)|0,f=(f=f+Math.imul(P,V)|0)+Math.imul(D,K)|0,d=d+Math.imul(D,V)|0,c=c+Math.imul(T,J)|0,f=(f=f+Math.imul(T,W)|0)+Math.imul(N,J)|0,d=d+Math.imul(N,W)|0,c=c+Math.imul(k,X)|0,f=(f=f+Math.imul(k,ee)|0)+Math.imul(L,X)|0,d=d+Math.imul(L,ee)|0,c=c+Math.imul(C,te)|0,f=(f=f+Math.imul(C,ce)|0)+Math.imul(M,te)|0,d=d+Math.imul(M,ce)|0,c=c+Math.imul(_,de)|0,f=(f=f+Math.imul(_,re)|0)+Math.imul(I,de)|0,d=d+Math.imul(I,re)|0,c=c+Math.imul(A,ie)|0,f=(f=f+Math.imul(A,be)|0)+Math.imul(v,ie)|0,d=d+Math.imul(v,be)|0,c=c+Math.imul(m,se)|0,f=(f=f+Math.imul(m,le)|0)+Math.imul(x,se)|0,d=d+Math.imul(x,le)|0;var Ce=(b+(c=c+Math.imul(h,he)|0)|0)+((8191&(f=(f=f+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;b=((d=d+Math.imul(p,pe)|0)+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c=Math.imul(F,K),f=(f=Math.imul(F,V))+Math.imul(Q,K)|0,d=Math.imul(Q,V),c=c+Math.imul(P,J)|0,f=(f=f+Math.imul(P,W)|0)+Math.imul(D,J)|0,d=d+Math.imul(D,W)|0,c=c+Math.imul(T,X)|0,f=(f=f+Math.imul(T,ee)|0)+Math.imul(N,X)|0,d=d+Math.imul(N,ee)|0,c=c+Math.imul(k,te)|0,f=(f=f+Math.imul(k,ce)|0)+Math.imul(L,te)|0,d=d+Math.imul(L,ce)|0,c=c+Math.imul(C,de)|0,f=(f=f+Math.imul(C,re)|0)+Math.imul(M,de)|0,d=d+Math.imul(M,re)|0,c=c+Math.imul(_,ie)|0,f=(f=f+Math.imul(_,be)|0)+Math.imul(I,ie)|0,d=d+Math.imul(I,be)|0,c=c+Math.imul(A,se)|0,f=(f=f+Math.imul(A,le)|0)+Math.imul(v,se)|0,d=d+Math.imul(v,le)|0;var Me=(b+(c=c+Math.imul(m,he)|0)|0)+((8191&(f=(f=f+Math.imul(m,pe)|0)+Math.imul(x,he)|0))<<13)|0;b=((d=d+Math.imul(x,pe)|0)+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,c=Math.imul(F,J),f=(f=Math.imul(F,W))+Math.imul(Q,J)|0,d=Math.imul(Q,W),c=c+Math.imul(P,X)|0,f=(f=f+Math.imul(P,ee)|0)+Math.imul(D,X)|0,d=d+Math.imul(D,ee)|0,c=c+Math.imul(T,te)|0,f=(f=f+Math.imul(T,ce)|0)+Math.imul(N,te)|0,d=d+Math.imul(N,ce)|0,c=c+Math.imul(k,de)|0,f=(f=f+Math.imul(k,re)|0)+Math.imul(L,de)|0,d=d+Math.imul(L,re)|0,c=c+Math.imul(C,ie)|0,f=(f=f+Math.imul(C,be)|0)+Math.imul(M,ie)|0,d=d+Math.imul(M,be)|0,c=c+Math.imul(_,se)|0,f=(f=f+Math.imul(_,le)|0)+Math.imul(I,se)|0,d=d+Math.imul(I,le)|0;var Be=(b+(c=c+Math.imul(A,he)|0)|0)+((8191&(f=(f=f+Math.imul(A,pe)|0)+Math.imul(v,he)|0))<<13)|0;b=((d=d+Math.imul(v,pe)|0)+(f>>>13)|0)+(Be>>>26)|0,Be&=67108863,c=Math.imul(F,X),f=(f=Math.imul(F,ee))+Math.imul(Q,X)|0,d=Math.imul(Q,ee),c=c+Math.imul(P,te)|0,f=(f=f+Math.imul(P,ce)|0)+Math.imul(D,te)|0,d=d+Math.imul(D,ce)|0,c=c+Math.imul(T,de)|0,f=(f=f+Math.imul(T,re)|0)+Math.imul(N,de)|0,d=d+Math.imul(N,re)|0,c=c+Math.imul(k,ie)|0,f=(f=f+Math.imul(k,be)|0)+Math.imul(L,ie)|0,d=d+Math.imul(L,be)|0,c=c+Math.imul(C,se)|0,f=(f=f+Math.imul(C,le)|0)+Math.imul(M,se)|0,d=d+Math.imul(M,le)|0;var ke=(b+(c=c+Math.imul(_,he)|0)|0)+((8191&(f=(f=f+Math.imul(_,pe)|0)+Math.imul(I,he)|0))<<13)|0;b=((d=d+Math.imul(I,pe)|0)+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,c=Math.imul(F,te),f=(f=Math.imul(F,ce))+Math.imul(Q,te)|0,d=Math.imul(Q,ce),c=c+Math.imul(P,de)|0,f=(f=f+Math.imul(P,re)|0)+Math.imul(D,de)|0,d=d+Math.imul(D,re)|0,c=c+Math.imul(T,ie)|0,f=(f=f+Math.imul(T,be)|0)+Math.imul(N,ie)|0,d=d+Math.imul(N,be)|0,c=c+Math.imul(k,se)|0,f=(f=f+Math.imul(k,le)|0)+Math.imul(L,se)|0,d=d+Math.imul(L,le)|0;var Le=(b+(c=c+Math.imul(C,he)|0)|0)+((8191&(f=(f=f+Math.imul(C,pe)|0)+Math.imul(M,he)|0))<<13)|0;b=((d=d+Math.imul(M,pe)|0)+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,c=Math.imul(F,de),f=(f=Math.imul(F,re))+Math.imul(Q,de)|0,d=Math.imul(Q,re),c=c+Math.imul(P,ie)|0,f=(f=f+Math.imul(P,be)|0)+Math.imul(D,ie)|0,d=d+Math.imul(D,be)|0,c=c+Math.imul(T,se)|0,f=(f=f+Math.imul(T,le)|0)+Math.imul(N,se)|0,d=d+Math.imul(N,le)|0;var Se=(b+(c=c+Math.imul(k,he)|0)|0)+((8191&(f=(f=f+Math.imul(k,pe)|0)+Math.imul(L,he)|0))<<13)|0;b=((d=d+Math.imul(L,pe)|0)+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,c=Math.imul(F,ie),f=(f=Math.imul(F,be))+Math.imul(Q,ie)|0,d=Math.imul(Q,be),c=c+Math.imul(P,se)|0,f=(f=f+Math.imul(P,le)|0)+Math.imul(D,se)|0,d=d+Math.imul(D,le)|0;var Te=(b+(c=c+Math.imul(T,he)|0)|0)+((8191&(f=(f=f+Math.imul(T,pe)|0)+Math.imul(N,he)|0))<<13)|0;b=((d=d+Math.imul(N,pe)|0)+(f>>>13)|0)+(Te>>>26)|0,Te&=67108863,c=Math.imul(F,se),f=(f=Math.imul(F,le))+Math.imul(Q,se)|0,d=Math.imul(Q,le);var Ne=(b+(c=c+Math.imul(P,he)|0)|0)+((8191&(f=(f=f+Math.imul(P,pe)|0)+Math.imul(D,he)|0))<<13)|0;b=((d=d+Math.imul(D,pe)|0)+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Re=(b+(c=Math.imul(F,he))|0)+((8191&(f=(f=Math.imul(F,pe))+Math.imul(Q,he)|0))<<13)|0;return b=((d=Math.imul(Q,pe))+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,i[0]=ge,i[1]=me,i[2]=xe,i[3]=ye,i[4]=Ae,i[5]=ve,i[6]=we,i[7]=_e,i[8]=Ie,i[9]=Ee,i[10]=Ce,i[11]=Me,i[12]=Be,i[13]=ke,i[14]=Le,i[15]=Se,i[16]=Te,i[17]=Ne,i[18]=Re,0!==b&&(i[19]=b,t.length++),t};function p(e,a,t){return(new g).mulp(e,a,t)}function g(e,a){this.x=e,this.y=a}Math.imul||(h=u),d.prototype.mulTo=function(e,a){var t,c=this.length+e.length;return t=10===this.length&&10===e.length?h(this,e,a):c<63?u(this,e,a):c<1024?function(e,a,t){t.negative=a.negative^e.negative,t.length=e.length+a.length;for(var c=0,f=0,d=0;d>>26)|0)>>>26,r&=67108863}t.words[d]=n,c=r,r=f}return 0!==c?t.words[d]=c:t.length--,t.strip()}(this,e,a):p(this,e,a),t},g.prototype.makeRBT=function(e){for(var a=new Array(e),t=d.prototype._countBits(e)-1,c=0;c>=1;return c},g.prototype.permute=function(e,a,t,c,f,d){for(var r=0;r>>=1)f++;return 1<>>=13,t[2*r+1]=8191&d,d>>>=13;for(r=2*a;r>=26,a+=f/67108864|0,a+=d>>>26,this.words[t]=67108863&d}return 0!==a&&(this.words[t]=a,this.length++),this},d.prototype.muln=function(e){return this.clone().imuln(e)},d.prototype.sqr=function(){return this.mul(this)},d.prototype.isqr=function(){return this.imul(this.clone())},d.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),t=0;t>>f}return a}(e);if(0===a.length)return new d(1);for(var t=this,c=0;c=0);var a,t=e%26,f=(e-t)/26,d=67108863>>>26-t<<26-t;if(0!==t){var r=0;for(a=0;a>>26-t}r&&(this.words[a]=r,this.length++)}if(0!==f){for(a=this.length-1;a>=0;a--)this.words[a+f]=this.words[a];for(a=0;a=0),f=a?(a-a%26)/26:0;var d=e%26,r=Math.min((e-d)/26,this.length),n=67108863^67108863>>>d<r)for(this.length-=r,b=0;b=0&&(0!==o||b>=f);b--){var s=0|this.words[b];this.words[b]=o<<26-d|s>>>d,o=s&n}return i&&0!==o&&(i.words[i.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},d.prototype.ishrn=function(e,a,t){return c(0===this.negative),this.iushrn(e,a,t)},d.prototype.shln=function(e){return this.clone().ishln(e)},d.prototype.ushln=function(e){return this.clone().iushln(e)},d.prototype.shrn=function(e){return this.clone().ishrn(e)},d.prototype.ushrn=function(e){return this.clone().iushrn(e)},d.prototype.testn=function(e){c("number"==typeof e&&e>=0);var a=e%26,t=(e-a)/26,f=1<=0);var a=e%26,t=(e-a)/26;if(c(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==a&&t++,this.length=Math.min(t,this.length),0!==a){var f=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},d.prototype.isubn=function(e){if(c("number"==typeof e),c(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(i/67108864|0),this.words[f+t]=67108863&d}for(;f>26,this.words[f+t]=67108863&d;if(0===n)return this.strip();for(c(-1===n),n=0,f=0;f>26,this.words[f]=67108863&d;return this.negative=1,this.strip()},d.prototype._wordDiv=function(e,a){var t=(this.length,e.length),c=this.clone(),f=e,r=0|f.words[f.length-1];0!=(t=26-this._countBits(r))&&(f=f.ushln(t),c.iushln(t),r=0|f.words[f.length-1]);var n,i=c.length-f.length;if("mod"!==a){(n=new d(null)).length=i+1,n.words=new Array(n.length);for(var b=0;b=0;s--){var l=67108864*(0|c.words[f.length+s])+(0|c.words[f.length+s-1]);for(l=Math.min(l/r|0,67108863),c._ishlnsubmul(f,l,s);0!==c.negative;)l--,c.negative=0,c._ishlnsubmul(f,1,s),c.isZero()||(c.negative^=1);n&&(n.words[s]=l)}return n&&n.strip(),c.strip(),"div"!==a&&0!==t&&c.iushrn(t),{div:n||null,mod:c}},d.prototype.divmod=function(e,a,t){return c(!e.isZero()),this.isZero()?{div:new d(0),mod:new d(0)}:0!==this.negative&&0===e.negative?(n=this.neg().divmod(e,a),"mod"!==a&&(f=n.div.neg()),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.iadd(e)),{div:f,mod:r}):0===this.negative&&0!==e.negative?(n=this.divmod(e.neg(),a),"mod"!==a&&(f=n.div.neg()),{div:f,mod:n.mod}):this.negative&e.negative?(n=this.neg().divmod(e.neg(),a),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.isub(e)),{div:n.div,mod:r}):e.length>this.length||this.cmp(e)<0?{div:new d(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new d(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new d(this.modn(e.words[0]))}:this._wordDiv(e,a);var f,r,n},d.prototype.div=function(e){return this.divmod(e,"div",!1).div},d.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},d.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},d.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var t=0!==a.div.negative?a.mod.isub(e):a.mod,c=e.ushrn(1),f=e.andln(1),d=t.cmp(c);return d<0||1===f&&0===d?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},d.prototype.modn=function(e){c(e<=67108863);for(var a=(1<<26)%e,t=0,f=this.length-1;f>=0;f--)t=(a*t+(0|this.words[f]))%e;return t},d.prototype.idivn=function(e){c(e<=67108863);for(var a=0,t=this.length-1;t>=0;t--){var f=(0|this.words[t])+67108864*a;this.words[t]=f/e|0,a=f%e}return this.strip()},d.prototype.divn=function(e){return this.clone().idivn(e)},d.prototype.egcd=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f=new d(1),r=new d(0),n=new d(0),i=new d(1),b=0;a.isEven()&&t.isEven();)a.iushrn(1),t.iushrn(1),++b;for(var o=t.clone(),s=a.clone();!a.isZero();){for(var l=0,u=1;!(a.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(f.isOdd()||r.isOdd())&&(f.iadd(o),r.isub(s)),f.iushrn(1),r.iushrn(1);for(var h=0,p=1;!(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(o),i.isub(s)),n.iushrn(1),i.iushrn(1);a.cmp(t)>=0?(a.isub(t),f.isub(n),r.isub(i)):(t.isub(a),n.isub(f),i.isub(r))}return{a:n,b:i,gcd:t.iushln(b)}},d.prototype._invmp=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f,r=new d(1),n=new d(0),i=t.clone();a.cmpn(1)>0&&t.cmpn(1)>0;){for(var b=0,o=1;!(a.words[0]&o)&&b<26;++b,o<<=1);if(b>0)for(a.iushrn(b);b-- >0;)r.isOdd()&&r.iadd(i),r.iushrn(1);for(var s=0,l=1;!(t.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(t.iushrn(s);s-- >0;)n.isOdd()&&n.iadd(i),n.iushrn(1);a.cmp(t)>=0?(a.isub(t),r.isub(n)):(t.isub(a),n.isub(r))}return(f=0===a.cmpn(1)?r:n).cmpn(0)<0&&f.iadd(e),f},d.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),t=e.clone();a.negative=0,t.negative=0;for(var c=0;a.isEven()&&t.isEven();c++)a.iushrn(1),t.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;t.isEven();)t.iushrn(1);var f=a.cmp(t);if(f<0){var d=a;a=t,t=d}else if(0===f||0===t.cmpn(1))break;a.isub(t)}return t.iushln(c)},d.prototype.invm=function(e){return this.egcd(e).a.umod(e)},d.prototype.isEven=function(){return!(1&this.words[0])},d.prototype.isOdd=function(){return!(1&~this.words[0])},d.prototype.andln=function(e){return this.words[0]&e},d.prototype.bincn=function(e){c("number"==typeof e);var a=e%26,t=(e-a)/26,f=1<>>26,n&=67108863,this.words[r]=n}return 0!==d&&(this.words[r]=d,this.length++),this},d.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},d.prototype.cmpn=function(e){var a,t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)a=1;else{t&&(e=-e),c(e<=67108863,"Number is too big");var f=0|this.words[0];a=f===e?0:fe.length)return 1;if(this.length=0;t--){var c=0|this.words[t],f=0|e.words[t];if(c!==f){cf&&(a=1);break}}return a},d.prototype.gtn=function(e){return 1===this.cmpn(e)},d.prototype.gt=function(e){return 1===this.cmp(e)},d.prototype.gten=function(e){return this.cmpn(e)>=0},d.prototype.gte=function(e){return this.cmp(e)>=0},d.prototype.ltn=function(e){return-1===this.cmpn(e)},d.prototype.lt=function(e){return-1===this.cmp(e)},d.prototype.lten=function(e){return this.cmpn(e)<=0},d.prototype.lte=function(e){return this.cmp(e)<=0},d.prototype.eqn=function(e){return 0===this.cmpn(e)},d.prototype.eq=function(e){return 0===this.cmp(e)},d.red=function(e){return new _(e)},d.prototype.toRed=function(e){return c(!this.red,"Already a number in reduction context"),c(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},d.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},d.prototype._forceRed=function(e){return this.red=e,this},d.prototype.forceRed=function(e){return c(!this.red,"Already a number in reduction context"),this._forceRed(e)},d.prototype.redAdd=function(e){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},d.prototype.redIAdd=function(e){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},d.prototype.redSub=function(e){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},d.prototype.redISub=function(e){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},d.prototype.redShl=function(e){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},d.prototype.redMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},d.prototype.redIMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},d.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},d.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},d.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},d.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},d.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},d.prototype.redPow=function(e){return c(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function x(e,a){this.name=e,this.p=new d(a,16),this.n=this.p.bitLength(),this.k=new d(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var a=d._prime(e);this.m=a.p,this.prime=a}else c(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new d(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)}x.prototype._tmp=function(){var e=new d(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var a,t=e;do{this.split(t,this.tmp),a=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(a>this.n);var c=a0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},x.prototype.split=function(e,a){e.iushrn(this.n,0,a)},x.prototype.imulK=function(e){return e.imul(this.k)},f(y,x),y.prototype.split=function(e,a){for(var t=4194303,c=Math.min(e.length,9),f=0;f>>22,d=r}d>>>=22,e.words[f-10]=d,0===d&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,t=0;t>>=26,e.words[t]=f,a=c}return 0!==a&&(e.words[e.length++]=a),e},d._prime=function(e){if(m[e])return m[e];var a;if("k256"===e)a=new y;else if("p224"===e)a=new A;else if("p192"===e)a=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new w}return m[e]=a,a},_.prototype._verify1=function(e){c(0===e.negative,"red works only with positives"),c(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,a){c(!(e.negative|a.negative),"red works only with positives"),c(e.red&&e.red===a.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,a){this._verify2(e,a);var t=e.add(a);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},_.prototype.iadd=function(e,a){this._verify2(e,a);var t=e.iadd(a);return t.cmp(this.m)>=0&&t.isub(this.m),t},_.prototype.sub=function(e,a){this._verify2(e,a);var t=e.sub(a);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},_.prototype.isub=function(e,a){this._verify2(e,a);var t=e.isub(a);return t.cmpn(0)<0&&t.iadd(this.m),t},_.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},_.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},_.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(c(a%2==1),3===a){var t=this.m.add(new d(1)).iushrn(2);return this.pow(e,t)}for(var f=this.m.subn(1),r=0;!f.isZero()&&0===f.andln(1);)r++,f.iushrn(1);c(!f.isZero());var n=new d(1).toRed(this),i=n.redNeg(),b=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new d(2*o*o).toRed(this);0!==this.pow(o,b).cmp(i);)o.redIAdd(i);for(var s=this.pow(o,f),l=this.pow(e,f.addn(1).iushrn(1)),u=this.pow(e,f),h=r;0!==u.cmp(n);){for(var p=u,g=0;0!==p.cmp(n);g++)p=p.redSqr();c(g=0;c--){for(var b=a.words[c],o=i-1;o>=0;o--){var s=b>>o&1;f!==t[0]&&(f=this.sqr(f)),0!==s||0!==r?(r<<=1,r|=s,(4==++n||0===c&&0===o)&&(f=this.mul(f,t[r]),n=0,r=0)):n=0}i=26}return f},_.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},_.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},d.mont=function(e){return new I(e)},f(I,_),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},I.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var t=e.imul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),d=f;return f.cmp(this.m)>=0?d=f.isub(this.m):f.cmpn(0)<0&&(d=f.iadd(this.m)),d._forceRed(this)},I.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new d(0)._forceRed(this);var t=e.mul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),r=f;return f.cmp(this.m)>=0?r=f.isub(this.m):f.cmpn(0)<0&&(r=f.iadd(this.m)),r._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=t.nmd(e),this)},86729:(e,a,t)=>{"use strict";var c=a;c.version=t(1636).rE,c.utils=t(47011),c.rand=t(15037),c.curve=t(894),c.curves=t(60480),c.ec=t(57447),c.eddsa=t(8650)},36677:(e,a,t)=>{"use strict";var c=t(28490),f=t(47011),d=f.getNAF,r=f.getJSF,n=f.assert;function i(e,a){this.type=e,this.p=new c(a.p,16),this.red=a.prime?c.red(a.prime):c.mont(this.p),this.zero=new c(0).toRed(this.red),this.one=new c(1).toRed(this.red),this.two=new c(2).toRed(this.red),this.n=a.n&&new c(a.n,16),this.g=a.g&&this.pointFromJSON(a.g,a.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 t=this.n&&this.p.div(this.n);!t||t.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function b(e,a){this.curve=e,this.type=a,this.precomputed=null}e.exports=i,i.prototype.point=function(){throw new Error("Not implemented")},i.prototype.validate=function(){throw new Error("Not implemented")},i.prototype._fixedNafMul=function(e,a){n(e.precomputed);var t=e._getDoubles(),c=d(a,1,this._bitLength),f=(1<=r;o--)i=(i<<1)+c[o];b.push(i)}for(var s=this.jpoint(null,null,null),l=this.jpoint(null,null,null),u=f;u>0;u--){for(r=0;r=0;b--){for(var o=0;b>=0&&0===r[b];b--)o++;if(b>=0&&o++,i=i.dblp(o),b<0)break;var s=r[b];n(0!==s),i="affine"===e.type?s>0?i.mixedAdd(f[s-1>>1]):i.mixedAdd(f[-s-1>>1].neg()):s>0?i.add(f[s-1>>1]):i.add(f[-s-1>>1].neg())}return"affine"===e.type?i.toP():i},i.prototype._wnafMulAdd=function(e,a,t,c,f){var n,i,b,o=this._wnafT1,s=this._wnafT2,l=this._wnafT3,u=0;for(n=0;n=1;n-=2){var p=n-1,g=n;if(1===o[p]&&1===o[g]){var m=[a[p],null,null,a[g]];0===a[p].y.cmp(a[g].y)?(m[1]=a[p].add(a[g]),m[2]=a[p].toJ().mixedAdd(a[g].neg())):0===a[p].y.cmp(a[g].y.redNeg())?(m[1]=a[p].toJ().mixedAdd(a[g]),m[2]=a[p].add(a[g].neg())):(m[1]=a[p].toJ().mixedAdd(a[g]),m[2]=a[p].toJ().mixedAdd(a[g].neg()));var x=[-3,-1,-5,-7,0,7,5,1,3],y=r(t[p],t[g]);for(u=Math.max(y[0].length,u),l[p]=new Array(u),l[g]=new Array(u),i=0;i=0;n--){for(var I=0;n>=0;){var E=!0;for(i=0;i=0&&I++,w=w.dblp(I),n<0)break;for(i=0;i0?b=s[i][C-1>>1]:C<0&&(b=s[i][-C-1>>1].neg()),w="affine"===b.type?w.mixedAdd(b):w.add(b))}}for(n=0;n=Math.ceil((e.bitLength()+1)/a.step)},b.prototype._getDoubles=function(e,a){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var t=[this],c=this,f=0;f{"use strict";var c=t(47011),f=t(28490),d=t(56698),r=t(36677),n=c.assert;function i(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,r.call(this,"edwards",e),this.a=new f(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new f(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new f(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),n(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function b(e,a,t,c,d){r.BasePoint.call(this,e,"projective"),null===a&&null===t&&null===c?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new f(a,16),this.y=new f(t,16),this.z=c?new f(c,16):this.curve.one,this.t=d&&new f(d,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}d(i,r),e.exports=i,i.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},i.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},i.prototype.jpoint=function(e,a,t,c){return this.point(e,a,t,c)},i.prototype.pointFromX=function(e,a){(e=new f(e,16)).red||(e=e.toRed(this.red));var t=e.redSqr(),c=this.c2.redSub(this.a.redMul(t)),d=this.one.redSub(this.c2.redMul(this.d).redMul(t)),r=c.redMul(d.redInvm()),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(a&&!i||!a&&i)&&(n=n.redNeg()),this.point(e,n)},i.prototype.pointFromY=function(e,a){(e=new f(e,16)).red||(e=e.toRed(this.red));var t=e.redSqr(),c=t.redSub(this.c2),d=t.redMul(this.d).redMul(this.c2).redSub(this.a),r=c.redMul(d.redInvm());if(0===r.cmp(this.zero)){if(a)throw new Error("invalid point");return this.point(this.zero,e)}var n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");return n.fromRed().isOdd()!==a&&(n=n.redNeg()),this.point(n,e)},i.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var a=e.x.redSqr(),t=e.y.redSqr(),c=a.redMul(this.a).redAdd(t),f=this.c2.redMul(this.one.redAdd(this.d.redMul(a).redMul(t)));return 0===c.cmp(f)},d(b,r.BasePoint),i.prototype.pointFromJSON=function(e){return b.fromJSON(this,e)},i.prototype.point=function(e,a,t,c){return new b(this,e,a,t,c)},b.fromJSON=function(e,a){return new b(e,a[0],a[1],a[2])},b.prototype.inspect=function(){return this.isInfinity()?"":""},b.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},b.prototype._extDbl=function(){var e=this.x.redSqr(),a=this.y.redSqr(),t=this.z.redSqr();t=t.redIAdd(t);var c=this.curve._mulA(e),f=this.x.redAdd(this.y).redSqr().redISub(e).redISub(a),d=c.redAdd(a),r=d.redSub(t),n=c.redSub(a),i=f.redMul(r),b=d.redMul(n),o=f.redMul(n),s=r.redMul(d);return this.curve.point(i,b,s,o)},b.prototype._projDbl=function(){var e,a,t,c,f,d,r=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),i=this.y.redSqr();if(this.curve.twisted){var b=(c=this.curve._mulA(n)).redAdd(i);this.zOne?(e=r.redSub(n).redSub(i).redMul(b.redSub(this.curve.two)),a=b.redMul(c.redSub(i)),t=b.redSqr().redSub(b).redSub(b)):(f=this.z.redSqr(),d=b.redSub(f).redISub(f),e=r.redSub(n).redISub(i).redMul(d),a=b.redMul(c.redSub(i)),t=b.redMul(d))}else c=n.redAdd(i),f=this.curve._mulC(this.z).redSqr(),d=c.redSub(f).redSub(f),e=this.curve._mulC(r.redISub(c)).redMul(d),a=this.curve._mulC(c).redMul(n.redISub(i)),t=c.redMul(d);return this.curve.point(e,a,t)},b.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},b.prototype._extAdd=function(e){var a=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),t=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),c=this.t.redMul(this.curve.dd).redMul(e.t),f=this.z.redMul(e.z.redAdd(e.z)),d=t.redSub(a),r=f.redSub(c),n=f.redAdd(c),i=t.redAdd(a),b=d.redMul(r),o=n.redMul(i),s=d.redMul(i),l=r.redMul(n);return this.curve.point(b,o,l,s)},b.prototype._projAdd=function(e){var a,t,c=this.z.redMul(e.z),f=c.redSqr(),d=this.x.redMul(e.x),r=this.y.redMul(e.y),n=this.curve.d.redMul(d).redMul(r),i=f.redSub(n),b=f.redAdd(n),o=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(d).redISub(r),s=c.redMul(i).redMul(o);return this.curve.twisted?(a=c.redMul(b).redMul(r.redSub(this.curve._mulA(d))),t=i.redMul(b)):(a=c.redMul(b).redMul(r.redSub(d)),t=this.curve._mulC(i).redMul(b)),this.curve.point(s,a,t)},b.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},b.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},b.prototype.mulAdd=function(e,a,t){return this.curve._wnafMulAdd(1,[this,a],[e,t],2,!1)},b.prototype.jmulAdd=function(e,a,t){return this.curve._wnafMulAdd(1,[this,a],[e,t],2,!0)},b.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},b.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},b.prototype.getX=function(){return this.normalize(),this.x.fromRed()},b.prototype.getY=function(){return this.normalize(),this.y.fromRed()},b.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},b.prototype.eqXToP=function(e){var a=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(a))return!0;for(var t=e.clone(),c=this.curve.redN.redMul(this.z);;){if(t.iadd(this.curve.n),t.cmp(this.curve.p)>=0)return!1;if(a.redIAdd(c),0===this.x.cmp(a))return!0}},b.prototype.toP=b.prototype.normalize,b.prototype.mixedAdd=b.prototype.add},894:(e,a,t)=>{"use strict";var c=a;c.base=t(36677),c.short=t(39188),c.mont=t(30370),c.edwards=t(31298)},30370:(e,a,t)=>{"use strict";var c=t(28490),f=t(56698),d=t(36677),r=t(47011);function n(e){d.call(this,"mont",e),this.a=new c(e.a,16).toRed(this.red),this.b=new c(e.b,16).toRed(this.red),this.i4=new c(4).toRed(this.red).redInvm(),this.two=new c(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function i(e,a,t){d.BasePoint.call(this,e,"projective"),null===a&&null===t?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new c(a,16),this.z=new c(t,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}f(n,d),e.exports=n,n.prototype.validate=function(e){var a=e.normalize().x,t=a.redSqr(),c=t.redMul(a).redAdd(t.redMul(this.a)).redAdd(a);return 0===c.redSqrt().redSqr().cmp(c)},f(i,d.BasePoint),n.prototype.decodePoint=function(e,a){return this.point(r.toArray(e,a),1)},n.prototype.point=function(e,a){return new i(this,e,a)},n.prototype.pointFromJSON=function(e){return i.fromJSON(this,e)},i.prototype.precompute=function(){},i.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},i.fromJSON=function(e,a){return new i(e,a[0],a[1]||e.one)},i.prototype.inspect=function(){return this.isInfinity()?"":""},i.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},i.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),a=this.x.redSub(this.z).redSqr(),t=e.redSub(a),c=e.redMul(a),f=t.redMul(a.redAdd(this.curve.a24.redMul(t)));return this.curve.point(c,f)},i.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.diffAdd=function(e,a){var t=this.x.redAdd(this.z),c=this.x.redSub(this.z),f=e.x.redAdd(e.z),d=e.x.redSub(e.z).redMul(t),r=f.redMul(c),n=a.z.redMul(d.redAdd(r).redSqr()),i=a.x.redMul(d.redISub(r).redSqr());return this.curve.point(n,i)},i.prototype.mul=function(e){for(var a=e.clone(),t=this,c=this.curve.point(null,null),f=[];0!==a.cmpn(0);a.iushrn(1))f.push(a.andln(1));for(var d=f.length-1;d>=0;d--)0===f[d]?(t=t.diffAdd(c,this),c=c.dbl()):(c=t.diffAdd(c,this),t=t.dbl());return c},i.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},i.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},i.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},39188:(e,a,t)=>{"use strict";var c=t(47011),f=t(28490),d=t(56698),r=t(36677),n=c.assert;function i(e){r.call(this,"short",e),this.a=new f(e.a,16).toRed(this.red),this.b=new f(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function b(e,a,t,c){r.BasePoint.call(this,e,"affine"),null===a&&null===t?(this.x=null,this.y=null,this.inf=!0):(this.x=new f(a,16),this.y=new f(t,16),c&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function o(e,a,t,c){r.BasePoint.call(this,e,"jacobian"),null===a&&null===t&&null===c?(this.x=this.curve.one,this.y=this.curve.one,this.z=new f(0)):(this.x=new f(a,16),this.y=new f(t,16),this.z=new f(c,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}d(i,r),e.exports=i,i.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var a,t;if(e.beta)a=new f(e.beta,16).toRed(this.red);else{var c=this._getEndoRoots(this.p);a=(a=c[0].cmp(c[1])<0?c[0]:c[1]).toRed(this.red)}if(e.lambda)t=new f(e.lambda,16);else{var d=this._getEndoRoots(this.n);0===this.g.mul(d[0]).x.cmp(this.g.x.redMul(a))?t=d[0]:(t=d[1],n(0===this.g.mul(t).x.cmp(this.g.x.redMul(a))))}return{beta:a,lambda:t,basis:e.basis?e.basis.map((function(e){return{a:new f(e.a,16),b:new f(e.b,16)}})):this._getEndoBasis(t)}}},i.prototype._getEndoRoots=function(e){var a=e===this.p?this.red:f.mont(e),t=new f(2).toRed(a).redInvm(),c=t.redNeg(),d=new f(3).toRed(a).redNeg().redSqrt().redMul(t);return[c.redAdd(d).fromRed(),c.redSub(d).fromRed()]},i.prototype._getEndoBasis=function(e){for(var a,t,c,d,r,n,i,b,o,s=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=e,u=this.n.clone(),h=new f(1),p=new f(0),g=new f(0),m=new f(1),x=0;0!==l.cmpn(0);){var y=u.div(l);b=u.sub(y.mul(l)),o=g.sub(y.mul(h));var A=m.sub(y.mul(p));if(!c&&b.cmp(s)<0)a=i.neg(),t=h,c=b.neg(),d=o;else if(c&&2==++x)break;i=b,u=l,l=b,g=h,h=o,m=p,p=A}r=b.neg(),n=o;var v=c.sqr().add(d.sqr());return r.sqr().add(n.sqr()).cmp(v)>=0&&(r=a,n=t),c.negative&&(c=c.neg(),d=d.neg()),r.negative&&(r=r.neg(),n=n.neg()),[{a:c,b:d},{a:r,b:n}]},i.prototype._endoSplit=function(e){var a=this.endo.basis,t=a[0],c=a[1],f=c.b.mul(e).divRound(this.n),d=t.b.neg().mul(e).divRound(this.n),r=f.mul(t.a),n=d.mul(c.a),i=f.mul(t.b),b=d.mul(c.b);return{k1:e.sub(r).sub(n),k2:i.add(b).neg()}},i.prototype.pointFromX=function(e,a){(e=new f(e,16)).red||(e=e.toRed(this.red));var t=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),c=t.redSqrt();if(0!==c.redSqr().redSub(t).cmp(this.zero))throw new Error("invalid point");var d=c.fromRed().isOdd();return(a&&!d||!a&&d)&&(c=c.redNeg()),this.point(e,c)},i.prototype.validate=function(e){if(e.inf)return!0;var a=e.x,t=e.y,c=this.a.redMul(a),f=a.redSqr().redMul(a).redIAdd(c).redIAdd(this.b);return 0===t.redSqr().redISub(f).cmpn(0)},i.prototype._endoWnafMulAdd=function(e,a,t){for(var c=this._endoWnafT1,f=this._endoWnafT2,d=0;d":""},b.prototype.isInfinity=function(){return this.inf},b.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var a=this.y.redSub(e.y);0!==a.cmpn(0)&&(a=a.redMul(this.x.redSub(e.x).redInvm()));var t=a.redSqr().redISub(this.x).redISub(e.x),c=a.redMul(this.x.redSub(t)).redISub(this.y);return this.curve.point(t,c)},b.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var a=this.curve.a,t=this.x.redSqr(),c=e.redInvm(),f=t.redAdd(t).redIAdd(t).redIAdd(a).redMul(c),d=f.redSqr().redISub(this.x.redAdd(this.x)),r=f.redMul(this.x.redSub(d)).redISub(this.y);return this.curve.point(d,r)},b.prototype.getX=function(){return this.x.fromRed()},b.prototype.getY=function(){return this.y.fromRed()},b.prototype.mul=function(e){return e=new f(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},b.prototype.mulAdd=function(e,a,t){var c=[this,a],f=[e,t];return this.curve.endo?this.curve._endoWnafMulAdd(c,f):this.curve._wnafMulAdd(1,c,f,2)},b.prototype.jmulAdd=function(e,a,t){var c=[this,a],f=[e,t];return this.curve.endo?this.curve._endoWnafMulAdd(c,f,!0):this.curve._wnafMulAdd(1,c,f,2,!0)},b.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},b.prototype.neg=function(e){if(this.inf)return this;var a=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var t=this.precomputed,c=function(e){return e.neg()};a.precomputed={naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(c)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(c)}}}return a},b.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},d(o,r.BasePoint),i.prototype.jpoint=function(e,a,t){return new o(this,e,a,t)},o.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),a=e.redSqr(),t=this.x.redMul(a),c=this.y.redMul(a).redMul(e);return this.curve.point(t,c)},o.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},o.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var a=e.z.redSqr(),t=this.z.redSqr(),c=this.x.redMul(a),f=e.x.redMul(t),d=this.y.redMul(a.redMul(e.z)),r=e.y.redMul(t.redMul(this.z)),n=c.redSub(f),i=d.redSub(r);if(0===n.cmpn(0))return 0!==i.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var b=n.redSqr(),o=b.redMul(n),s=c.redMul(b),l=i.redSqr().redIAdd(o).redISub(s).redISub(s),u=i.redMul(s.redISub(l)).redISub(d.redMul(o)),h=this.z.redMul(e.z).redMul(n);return this.curve.jpoint(l,u,h)},o.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var a=this.z.redSqr(),t=this.x,c=e.x.redMul(a),f=this.y,d=e.y.redMul(a).redMul(this.z),r=t.redSub(c),n=f.redSub(d);if(0===r.cmpn(0))return 0!==n.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var i=r.redSqr(),b=i.redMul(r),o=t.redMul(i),s=n.redSqr().redIAdd(b).redISub(o).redISub(o),l=n.redMul(o.redISub(s)).redISub(f.redMul(b)),u=this.z.redMul(r);return this.curve.jpoint(s,l,u)},o.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var a;if(this.curve.zeroA||this.curve.threeA){var t=this;for(a=0;a=0)return!1;if(t.redIAdd(f),0===this.x.cmp(t))return!0}},o.prototype.inspect=function(){return this.isInfinity()?"":""},o.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},60480:(e,a,t)=>{"use strict";var c,f=a,d=t(77952),r=t(894),n=t(47011).assert;function i(e){"short"===e.type?this.curve=new r.short(e):"edwards"===e.type?this.curve=new r.edwards(e):this.curve=new r.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function b(e,a){Object.defineProperty(f,e,{configurable:!0,enumerable:!0,get:function(){var t=new i(a);return Object.defineProperty(f,e,{configurable:!0,enumerable:!0,value:t}),t}})}f.PresetCurve=i,b("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:d.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),b("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:d.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),b("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:d.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),b("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:d.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"]}),b("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:d.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"]}),b("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:d.sha256,gRed:!1,g:["9"]}),b("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:d.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{c=t(74011)}catch(e){c=void 0}b("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:d.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})},57447:(e,a,t)=>{"use strict";var c=t(28490),f=t(32723),d=t(47011),r=t(60480),n=t(15037),i=d.assert,b=t(61200),o=t(28545);function s(e){if(!(this instanceof s))return new s(e);"string"==typeof e&&(i(Object.prototype.hasOwnProperty.call(r,e),"Unknown curve "+e),e=r[e]),e instanceof r.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=s,s.prototype.keyPair=function(e){return new b(this,e)},s.prototype.keyFromPrivate=function(e,a){return b.fromPrivate(this,e,a)},s.prototype.keyFromPublic=function(e,a){return b.fromPublic(this,e,a)},s.prototype.genKeyPair=function(e){e||(e={});for(var a=new f({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||n(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),t=this.n.byteLength(),d=this.n.sub(new c(2));;){var r=new c(a.generate(t));if(!(r.cmp(d)>0))return r.iaddn(1),this.keyFromPrivate(r)}},s.prototype._truncateToN=function(e,a){var t=8*e.byteLength()-this.n.bitLength();return t>0&&(e=e.ushrn(t)),!a&&e.cmp(this.n)>=0?e.sub(this.n):e},s.prototype.sign=function(e,a,t,d){"object"==typeof t&&(d=t,t=null),d||(d={}),a=this.keyFromPrivate(a,t),e=this._truncateToN(new c(e,16));for(var r=this.n.byteLength(),n=a.getPrivate().toArray("be",r),i=e.toArray("be",r),b=new f({hash:this.hash,entropy:n,nonce:i,pers:d.pers,persEnc:d.persEnc||"utf8"}),s=this.n.sub(new c(1)),l=0;;l++){var u=d.k?d.k(l):new c(b.generate(this.n.byteLength()));if(!((u=this._truncateToN(u,!0)).cmpn(1)<=0||u.cmp(s)>=0)){var h=this.g.mul(u);if(!h.isInfinity()){var p=h.getX(),g=p.umod(this.n);if(0!==g.cmpn(0)){var m=u.invm(this.n).mul(g.mul(a.getPrivate()).iadd(e));if(0!==(m=m.umod(this.n)).cmpn(0)){var x=(h.getY().isOdd()?1:0)|(0!==p.cmp(g)?2:0);return d.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),x^=1),new o({r:g,s:m,recoveryParam:x})}}}}}},s.prototype.verify=function(e,a,t,f){e=this._truncateToN(new c(e,16)),t=this.keyFromPublic(t,f);var d=(a=new o(a,"hex")).r,r=a.s;if(d.cmpn(1)<0||d.cmp(this.n)>=0)return!1;if(r.cmpn(1)<0||r.cmp(this.n)>=0)return!1;var n,i=r.invm(this.n),b=i.mul(e).umod(this.n),s=i.mul(d).umod(this.n);return this.curve._maxwellTrick?!(n=this.g.jmulAdd(b,t.getPublic(),s)).isInfinity()&&n.eqXToP(d):!(n=this.g.mulAdd(b,t.getPublic(),s)).isInfinity()&&0===n.getX().umod(this.n).cmp(d)},s.prototype.recoverPubKey=function(e,a,t,f){i((3&t)===t,"The recovery param is more than two bits"),a=new o(a,f);var d=this.n,r=new c(e),n=a.r,b=a.s,s=1&t,l=t>>1;if(n.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");n=l?this.curve.pointFromX(n.add(this.curve.n),s):this.curve.pointFromX(n,s);var u=a.r.invm(d),h=d.sub(r).mul(u).umod(d),p=b.mul(u).umod(d);return this.g.mulAdd(h,n,p)},s.prototype.getKeyRecoveryParam=function(e,a,t,c){if(null!==(a=new o(a,c)).recoveryParam)return a.recoveryParam;for(var f=0;f<4;f++){var d;try{d=this.recoverPubKey(e,a,f)}catch(e){continue}if(d.eq(t))return f}throw new Error("Unable to find valid recovery factor")}},61200:(e,a,t)=>{"use strict";var c=t(28490),f=t(47011).assert;function d(e,a){this.ec=e,this.priv=null,this.pub=null,a.priv&&this._importPrivate(a.priv,a.privEnc),a.pub&&this._importPublic(a.pub,a.pubEnc)}e.exports=d,d.fromPublic=function(e,a,t){return a instanceof d?a:new d(e,{pub:a,pubEnc:t})},d.fromPrivate=function(e,a,t){return a instanceof d?a:new d(e,{priv:a,privEnc:t})},d.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},d.prototype.getPublic=function(e,a){return"string"==typeof e&&(a=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),a?this.pub.encode(a,e):this.pub},d.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},d.prototype._importPrivate=function(e,a){this.priv=new c(e,a||16),this.priv=this.priv.umod(this.ec.curve.n)},d.prototype._importPublic=function(e,a){if(e.x||e.y)return"mont"===this.ec.curve.type?f(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||f(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,a)},d.prototype.derive=function(e){return e.validate()||f(e.validate(),"public point not validated"),e.mul(this.priv).getX()},d.prototype.sign=function(e,a,t){return this.ec.sign(e,this,a,t)},d.prototype.verify=function(e,a){return this.ec.verify(e,a,this)},d.prototype.inspect=function(){return""}},28545:(e,a,t)=>{"use strict";var c=t(28490),f=t(47011),d=f.assert;function r(e,a){if(e instanceof r)return e;this._importDER(e,a)||(d(e.r&&e.s,"Signature without r or s"),this.r=new c(e.r,16),this.s=new c(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function n(){this.place=0}function i(e,a){var t=e[a.place++];if(!(128&t))return t;var c=15&t;if(0===c||c>4)return!1;if(0===e[a.place])return!1;for(var f=0,d=0,r=a.place;d>>=0;return!(f<=127)&&(a.place=r,f)}function b(e){for(var a=0,t=e.length-1;!e[a]&&!(128&e[a+1])&&a>>3);for(e.push(128|t);--t;)e.push(a>>>(t<<3)&255);e.push(a)}}e.exports=r,r.prototype._importDER=function(e,a){e=f.toArray(e,a);var t=new n;if(48!==e[t.place++])return!1;var d=i(e,t);if(!1===d)return!1;if(d+t.place!==e.length)return!1;if(2!==e[t.place++])return!1;var r=i(e,t);if(!1===r)return!1;if(128&e[t.place])return!1;var b=e.slice(t.place,r+t.place);if(t.place+=r,2!==e[t.place++])return!1;var o=i(e,t);if(!1===o)return!1;if(e.length!==o+t.place)return!1;if(128&e[t.place])return!1;var s=e.slice(t.place,o+t.place);if(0===b[0]){if(!(128&b[1]))return!1;b=b.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new c(b),this.s=new c(s),this.recoveryParam=null,!0},r.prototype.toDER=function(e){var a=this.r.toArray(),t=this.s.toArray();for(128&a[0]&&(a=[0].concat(a)),128&t[0]&&(t=[0].concat(t)),a=b(a),t=b(t);!(t[0]||128&t[1]);)t=t.slice(1);var c=[2];o(c,a.length),(c=c.concat(a)).push(2),o(c,t.length);var d=c.concat(t),r=[48];return o(r,d.length),r=r.concat(d),f.encode(r,e)}},8650:(e,a,t)=>{"use strict";var c=t(77952),f=t(60480),d=t(47011),r=d.assert,n=d.parseBytes,i=t(46661),b=t(90220);function o(e){if(r("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof o))return new o(e);e=f[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=c.sha512}e.exports=o,o.prototype.sign=function(e,a){e=n(e);var t=this.keyFromSecret(a),c=this.hashInt(t.messagePrefix(),e),f=this.g.mul(c),d=this.encodePoint(f),r=this.hashInt(d,t.pubBytes(),e).mul(t.priv()),i=c.add(r).umod(this.curve.n);return this.makeSignature({R:f,S:i,Rencoded:d})},o.prototype.verify=function(e,a,t){if(e=n(e),(a=this.makeSignature(a)).S().gte(a.eddsa.curve.n)||a.S().isNeg())return!1;var c=this.keyFromPublic(t),f=this.hashInt(a.Rencoded(),c.pubBytes(),e),d=this.g.mul(a.S());return a.R().add(c.pub().mul(f)).eq(d)},o.prototype.hashInt=function(){for(var e=this.hash(),a=0;a{"use strict";var c=t(47011),f=c.assert,d=c.parseBytes,r=c.cachedProperty;function n(e,a){this.eddsa=e,this._secret=d(a.secret),e.isPoint(a.pub)?this._pub=a.pub:this._pubBytes=d(a.pub)}n.fromPublic=function(e,a){return a instanceof n?a:new n(e,{pub:a})},n.fromSecret=function(e,a){return a instanceof n?a:new n(e,{secret:a})},n.prototype.secret=function(){return this._secret},r(n,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),r(n,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),r(n,"privBytes",(function(){var e=this.eddsa,a=this.hash(),t=e.encodingLength-1,c=a.slice(0,e.encodingLength);return c[0]&=248,c[t]&=127,c[t]|=64,c})),r(n,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),r(n,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),r(n,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),n.prototype.sign=function(e){return f(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},n.prototype.verify=function(e,a){return this.eddsa.verify(e,a,this)},n.prototype.getSecret=function(e){return f(this._secret,"KeyPair is public only"),c.encode(this.secret(),e)},n.prototype.getPublic=function(e){return c.encode(this.pubBytes(),e)},e.exports=n},90220:(e,a,t)=>{"use strict";var c=t(28490),f=t(47011),d=f.assert,r=f.cachedProperty,n=f.parseBytes;function i(e,a){this.eddsa=e,"object"!=typeof a&&(a=n(a)),Array.isArray(a)&&(d(a.length===2*e.encodingLength,"Signature has invalid size"),a={R:a.slice(0,e.encodingLength),S:a.slice(e.encodingLength)}),d(a.R&&a.S,"Signature without R or S"),e.isPoint(a.R)&&(this._R=a.R),a.S instanceof c&&(this._S=a.S),this._Rencoded=Array.isArray(a.R)?a.R:a.Rencoded,this._Sencoded=Array.isArray(a.S)?a.S:a.Sencoded}r(i,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),r(i,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),r(i,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),r(i,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),i.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},i.prototype.toHex=function(){return f.encode(this.toBytes(),"hex").toUpperCase()},e.exports=i},74011:e=>{e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},47011:(e,a,t)=>{"use strict";var c=a,f=t(28490),d=t(43349),r=t(64367);c.assert=d,c.toArray=r.toArray,c.zero2=r.zero2,c.toHex=r.toHex,c.encode=r.encode,c.getNAF=function(e,a,t){var c,f=new Array(Math.max(e.bitLength(),t)+1);for(c=0;c(d>>1)-1?(d>>1)-i:i,r.isubn(n)):n=0,f[c]=n,r.iushrn(1)}return f},c.getJSF=function(e,a){var t=[[],[]];e=e.clone(),a=a.clone();for(var c,f=0,d=0;e.cmpn(-f)>0||a.cmpn(-d)>0;){var r,n,i=e.andln(3)+f&3,b=a.andln(3)+d&3;3===i&&(i=-1),3===b&&(b=-1),r=1&i?3!=(c=e.andln(7)+f&7)&&5!==c||2!==b?i:-i:0,t[0].push(r),n=1&b?3!=(c=a.andln(7)+d&7)&&5!==c||2!==i?b:-b:0,t[1].push(n),2*f===r+1&&(f=1-f),2*d===n+1&&(d=1-d),e.iushrn(1),a.iushrn(1)}return t},c.cachedProperty=function(e,a,t){var c="_"+a;e.prototype[a]=function(){return void 0!==this[c]?this[c]:this[c]=t.call(this)}},c.parseBytes=function(e){return"string"==typeof e?c.toArray(e,"hex"):e},c.intFromLE=function(e){return new f(e,"hex","le")}},28490:function(e,a,t){!function(e,a){"use strict";function c(e,a){if(!e)throw new Error(a||"Assertion failed")}function f(e,a){e.super_=a;var t=function(){};t.prototype=a.prototype,e.prototype=new t,e.prototype.constructor=e}function d(e,a,t){if(d.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==a&&"be"!==a||(t=a,a=10),this._init(e||0,a||10,t||"be"))}var r;"object"==typeof e?e.exports=d:a.BN=d,d.BN=d,d.wordSize=26;try{r="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:t(79368).Buffer}catch(e){}function n(e,a){var t=e.charCodeAt(a);return t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:t-48&15}function i(e,a,t){var c=n(e,t);return t-1>=a&&(c|=n(e,t-1)<<4),c}function b(e,a,t,c){for(var f=0,d=Math.min(e.length,t),r=a;r=49?n-49+10:n>=17?n-17+10:n}return f}d.isBN=function(e){return e instanceof d||null!==e&&"object"==typeof e&&e.constructor.wordSize===d.wordSize&&Array.isArray(e.words)},d.max=function(e,a){return e.cmp(a)>0?e:a},d.min=function(e,a){return e.cmp(a)<0?e:a},d.prototype._init=function(e,a,t){if("number"==typeof e)return this._initNumber(e,a,t);if("object"==typeof e)return this._initArray(e,a,t);"hex"===a&&(a=16),c(a===(0|a)&&a>=2&&a<=36);var f=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(f++,this.negative=1),f=0;f-=3)r=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[d]|=r<>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);else if("le"===t)for(f=0,d=0;f>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);return this.strip()},d.prototype._parseHex=function(e,a,t){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)f=i(e,a,c)<=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;else for(c=(e.length-a)%2==0?a+1:a;c=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;this.strip()},d.prototype._parseBase=function(e,a,t){this.words=[0],this.length=1;for(var c=0,f=1;f<=67108863;f*=a)c++;c--,f=f/a|0;for(var d=e.length-t,r=d%c,n=Math.min(d,d-r)+t,i=0,o=t;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},d.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},d.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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],l=[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 u(e,a,t){t.negative=a.negative^e.negative;var c=e.length+a.length|0;t.length=c,c=c-1|0;var f=0|e.words[0],d=0|a.words[0],r=f*d,n=67108863&r,i=r/67108864|0;t.words[0]=n;for(var b=1;b>>26,s=67108863&i,l=Math.min(b,a.length-1),u=Math.max(0,b-e.length+1);u<=l;u++){var h=b-u|0;o+=(r=(f=0|e.words[h])*(d=0|a.words[u])+s)/67108864|0,s=67108863&r}t.words[b]=0|s,i=0|o}return 0!==i?t.words[b]=0|i:t.length--,t.strip()}d.prototype.toString=function(e,a){var t;if(a=0|a||1,16===(e=e||10)||"hex"===e){t="";for(var f=0,d=0,r=0;r>>24-f&16777215)||r!==this.length-1?o[6-i.length]+i+t:i+t,(f+=2)>=26&&(f-=26,r--)}for(0!==d&&(t=d.toString(16)+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(e===(0|e)&&e>=2&&e<=36){var b=s[e],u=l[e];t="";var h=this.clone();for(h.negative=0;!h.isZero();){var p=h.modn(u).toString(e);t=(h=h.idivn(u)).isZero()?p+t:o[b-p.length]+p+t}for(this.isZero()&&(t="0"+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}c(!1,"Base should be between 2 and 36")},d.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&c(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},d.prototype.toJSON=function(){return this.toString(16)},d.prototype.toBuffer=function(e,a){return c(void 0!==r),this.toArrayLike(r,e,a)},d.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},d.prototype.toArrayLike=function(e,a,t){var f=this.byteLength(),d=t||Math.max(1,f);c(f<=d,"byte array longer than desired length"),c(d>0,"Requested array length <= 0"),this.strip();var r,n,i="le"===a,b=new e(d),o=this.clone();if(i){for(n=0;!o.isZero();n++)r=o.andln(255),o.iushrn(8),b[n]=r;for(;n=4096&&(t+=13,a>>>=13),a>=64&&(t+=7,a>>>=7),a>=8&&(t+=4,a>>>=4),a>=2&&(t+=2,a>>>=2),t+a},d.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,t=0;return 8191&a||(t+=13,a>>>=13),127&a||(t+=7,a>>>=7),15&a||(t+=4,a>>>=4),3&a||(t+=2,a>>>=2),1&a||t++,t},d.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},d.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},d.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},d.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var t=0;te.length?this.clone().iand(e):e.clone().iand(this)},d.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},d.prototype.iuxor=function(e){var a,t;this.length>e.length?(a=this,t=e):(a=e,t=this);for(var c=0;ce.length?this.clone().ixor(e):e.clone().ixor(this)},d.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},d.prototype.inotn=function(e){c("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),t=e%26;this._expand(a),t>0&&a--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-t),this.strip()},d.prototype.notn=function(e){return this.clone().inotn(e)},d.prototype.setn=function(e,a){c("number"==typeof e&&e>=0);var t=e/26|0,f=e%26;return this._expand(t+1),this.words[t]=a?this.words[t]|1<e.length?(t=this,c=e):(t=e,c=this);for(var f=0,d=0;d>>26;for(;0!==f&&d>>26;if(this.length=t.length,0!==f)this.words[this.length]=f,this.length++;else if(t!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},d.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var t,c,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(t=this,c=e):(t=e,c=this);for(var d=0,r=0;r>26,this.words[r]=67108863&a;for(;0!==d&&r>26,this.words[r]=67108863&a;if(0===d&&r>>13,u=0|r[1],h=8191&u,p=u>>>13,g=0|r[2],m=8191&g,x=g>>>13,y=0|r[3],A=8191&y,v=y>>>13,w=0|r[4],_=8191&w,I=w>>>13,E=0|r[5],C=8191&E,M=E>>>13,B=0|r[6],k=8191&B,L=B>>>13,S=0|r[7],T=8191&S,N=S>>>13,R=0|r[8],P=8191&R,D=R>>>13,O=0|r[9],F=8191&O,Q=O>>>13,U=0|n[0],j=8191&U,H=U>>>13,q=0|n[1],$=8191&q,z=q>>>13,G=0|n[2],K=8191&G,V=G>>>13,Z=0|n[3],J=8191&Z,W=Z>>>13,Y=0|n[4],X=8191&Y,ee=Y>>>13,ae=0|n[5],te=8191&ae,ce=ae>>>13,fe=0|n[6],de=8191&fe,re=fe>>>13,ne=0|n[7],ie=8191&ne,be=ne>>>13,oe=0|n[8],se=8191&oe,le=oe>>>13,ue=0|n[9],he=8191&ue,pe=ue>>>13;t.negative=e.negative^a.negative,t.length=19;var ge=(b+(c=Math.imul(s,j))|0)+((8191&(f=(f=Math.imul(s,H))+Math.imul(l,j)|0))<<13)|0;b=((d=Math.imul(l,H))+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,c=Math.imul(h,j),f=(f=Math.imul(h,H))+Math.imul(p,j)|0,d=Math.imul(p,H);var me=(b+(c=c+Math.imul(s,$)|0)|0)+((8191&(f=(f=f+Math.imul(s,z)|0)+Math.imul(l,$)|0))<<13)|0;b=((d=d+Math.imul(l,z)|0)+(f>>>13)|0)+(me>>>26)|0,me&=67108863,c=Math.imul(m,j),f=(f=Math.imul(m,H))+Math.imul(x,j)|0,d=Math.imul(x,H),c=c+Math.imul(h,$)|0,f=(f=f+Math.imul(h,z)|0)+Math.imul(p,$)|0,d=d+Math.imul(p,z)|0;var xe=(b+(c=c+Math.imul(s,K)|0)|0)+((8191&(f=(f=f+Math.imul(s,V)|0)+Math.imul(l,K)|0))<<13)|0;b=((d=d+Math.imul(l,V)|0)+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,c=Math.imul(A,j),f=(f=Math.imul(A,H))+Math.imul(v,j)|0,d=Math.imul(v,H),c=c+Math.imul(m,$)|0,f=(f=f+Math.imul(m,z)|0)+Math.imul(x,$)|0,d=d+Math.imul(x,z)|0,c=c+Math.imul(h,K)|0,f=(f=f+Math.imul(h,V)|0)+Math.imul(p,K)|0,d=d+Math.imul(p,V)|0;var ye=(b+(c=c+Math.imul(s,J)|0)|0)+((8191&(f=(f=f+Math.imul(s,W)|0)+Math.imul(l,J)|0))<<13)|0;b=((d=d+Math.imul(l,W)|0)+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,c=Math.imul(_,j),f=(f=Math.imul(_,H))+Math.imul(I,j)|0,d=Math.imul(I,H),c=c+Math.imul(A,$)|0,f=(f=f+Math.imul(A,z)|0)+Math.imul(v,$)|0,d=d+Math.imul(v,z)|0,c=c+Math.imul(m,K)|0,f=(f=f+Math.imul(m,V)|0)+Math.imul(x,K)|0,d=d+Math.imul(x,V)|0,c=c+Math.imul(h,J)|0,f=(f=f+Math.imul(h,W)|0)+Math.imul(p,J)|0,d=d+Math.imul(p,W)|0;var Ae=(b+(c=c+Math.imul(s,X)|0)|0)+((8191&(f=(f=f+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;b=((d=d+Math.imul(l,ee)|0)+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,c=Math.imul(C,j),f=(f=Math.imul(C,H))+Math.imul(M,j)|0,d=Math.imul(M,H),c=c+Math.imul(_,$)|0,f=(f=f+Math.imul(_,z)|0)+Math.imul(I,$)|0,d=d+Math.imul(I,z)|0,c=c+Math.imul(A,K)|0,f=(f=f+Math.imul(A,V)|0)+Math.imul(v,K)|0,d=d+Math.imul(v,V)|0,c=c+Math.imul(m,J)|0,f=(f=f+Math.imul(m,W)|0)+Math.imul(x,J)|0,d=d+Math.imul(x,W)|0,c=c+Math.imul(h,X)|0,f=(f=f+Math.imul(h,ee)|0)+Math.imul(p,X)|0,d=d+Math.imul(p,ee)|0;var ve=(b+(c=c+Math.imul(s,te)|0)|0)+((8191&(f=(f=f+Math.imul(s,ce)|0)+Math.imul(l,te)|0))<<13)|0;b=((d=d+Math.imul(l,ce)|0)+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,c=Math.imul(k,j),f=(f=Math.imul(k,H))+Math.imul(L,j)|0,d=Math.imul(L,H),c=c+Math.imul(C,$)|0,f=(f=f+Math.imul(C,z)|0)+Math.imul(M,$)|0,d=d+Math.imul(M,z)|0,c=c+Math.imul(_,K)|0,f=(f=f+Math.imul(_,V)|0)+Math.imul(I,K)|0,d=d+Math.imul(I,V)|0,c=c+Math.imul(A,J)|0,f=(f=f+Math.imul(A,W)|0)+Math.imul(v,J)|0,d=d+Math.imul(v,W)|0,c=c+Math.imul(m,X)|0,f=(f=f+Math.imul(m,ee)|0)+Math.imul(x,X)|0,d=d+Math.imul(x,ee)|0,c=c+Math.imul(h,te)|0,f=(f=f+Math.imul(h,ce)|0)+Math.imul(p,te)|0,d=d+Math.imul(p,ce)|0;var we=(b+(c=c+Math.imul(s,de)|0)|0)+((8191&(f=(f=f+Math.imul(s,re)|0)+Math.imul(l,de)|0))<<13)|0;b=((d=d+Math.imul(l,re)|0)+(f>>>13)|0)+(we>>>26)|0,we&=67108863,c=Math.imul(T,j),f=(f=Math.imul(T,H))+Math.imul(N,j)|0,d=Math.imul(N,H),c=c+Math.imul(k,$)|0,f=(f=f+Math.imul(k,z)|0)+Math.imul(L,$)|0,d=d+Math.imul(L,z)|0,c=c+Math.imul(C,K)|0,f=(f=f+Math.imul(C,V)|0)+Math.imul(M,K)|0,d=d+Math.imul(M,V)|0,c=c+Math.imul(_,J)|0,f=(f=f+Math.imul(_,W)|0)+Math.imul(I,J)|0,d=d+Math.imul(I,W)|0,c=c+Math.imul(A,X)|0,f=(f=f+Math.imul(A,ee)|0)+Math.imul(v,X)|0,d=d+Math.imul(v,ee)|0,c=c+Math.imul(m,te)|0,f=(f=f+Math.imul(m,ce)|0)+Math.imul(x,te)|0,d=d+Math.imul(x,ce)|0,c=c+Math.imul(h,de)|0,f=(f=f+Math.imul(h,re)|0)+Math.imul(p,de)|0,d=d+Math.imul(p,re)|0;var _e=(b+(c=c+Math.imul(s,ie)|0)|0)+((8191&(f=(f=f+Math.imul(s,be)|0)+Math.imul(l,ie)|0))<<13)|0;b=((d=d+Math.imul(l,be)|0)+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,c=Math.imul(P,j),f=(f=Math.imul(P,H))+Math.imul(D,j)|0,d=Math.imul(D,H),c=c+Math.imul(T,$)|0,f=(f=f+Math.imul(T,z)|0)+Math.imul(N,$)|0,d=d+Math.imul(N,z)|0,c=c+Math.imul(k,K)|0,f=(f=f+Math.imul(k,V)|0)+Math.imul(L,K)|0,d=d+Math.imul(L,V)|0,c=c+Math.imul(C,J)|0,f=(f=f+Math.imul(C,W)|0)+Math.imul(M,J)|0,d=d+Math.imul(M,W)|0,c=c+Math.imul(_,X)|0,f=(f=f+Math.imul(_,ee)|0)+Math.imul(I,X)|0,d=d+Math.imul(I,ee)|0,c=c+Math.imul(A,te)|0,f=(f=f+Math.imul(A,ce)|0)+Math.imul(v,te)|0,d=d+Math.imul(v,ce)|0,c=c+Math.imul(m,de)|0,f=(f=f+Math.imul(m,re)|0)+Math.imul(x,de)|0,d=d+Math.imul(x,re)|0,c=c+Math.imul(h,ie)|0,f=(f=f+Math.imul(h,be)|0)+Math.imul(p,ie)|0,d=d+Math.imul(p,be)|0;var Ie=(b+(c=c+Math.imul(s,se)|0)|0)+((8191&(f=(f=f+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;b=((d=d+Math.imul(l,le)|0)+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,c=Math.imul(F,j),f=(f=Math.imul(F,H))+Math.imul(Q,j)|0,d=Math.imul(Q,H),c=c+Math.imul(P,$)|0,f=(f=f+Math.imul(P,z)|0)+Math.imul(D,$)|0,d=d+Math.imul(D,z)|0,c=c+Math.imul(T,K)|0,f=(f=f+Math.imul(T,V)|0)+Math.imul(N,K)|0,d=d+Math.imul(N,V)|0,c=c+Math.imul(k,J)|0,f=(f=f+Math.imul(k,W)|0)+Math.imul(L,J)|0,d=d+Math.imul(L,W)|0,c=c+Math.imul(C,X)|0,f=(f=f+Math.imul(C,ee)|0)+Math.imul(M,X)|0,d=d+Math.imul(M,ee)|0,c=c+Math.imul(_,te)|0,f=(f=f+Math.imul(_,ce)|0)+Math.imul(I,te)|0,d=d+Math.imul(I,ce)|0,c=c+Math.imul(A,de)|0,f=(f=f+Math.imul(A,re)|0)+Math.imul(v,de)|0,d=d+Math.imul(v,re)|0,c=c+Math.imul(m,ie)|0,f=(f=f+Math.imul(m,be)|0)+Math.imul(x,ie)|0,d=d+Math.imul(x,be)|0,c=c+Math.imul(h,se)|0,f=(f=f+Math.imul(h,le)|0)+Math.imul(p,se)|0,d=d+Math.imul(p,le)|0;var Ee=(b+(c=c+Math.imul(s,he)|0)|0)+((8191&(f=(f=f+Math.imul(s,pe)|0)+Math.imul(l,he)|0))<<13)|0;b=((d=d+Math.imul(l,pe)|0)+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,c=Math.imul(F,$),f=(f=Math.imul(F,z))+Math.imul(Q,$)|0,d=Math.imul(Q,z),c=c+Math.imul(P,K)|0,f=(f=f+Math.imul(P,V)|0)+Math.imul(D,K)|0,d=d+Math.imul(D,V)|0,c=c+Math.imul(T,J)|0,f=(f=f+Math.imul(T,W)|0)+Math.imul(N,J)|0,d=d+Math.imul(N,W)|0,c=c+Math.imul(k,X)|0,f=(f=f+Math.imul(k,ee)|0)+Math.imul(L,X)|0,d=d+Math.imul(L,ee)|0,c=c+Math.imul(C,te)|0,f=(f=f+Math.imul(C,ce)|0)+Math.imul(M,te)|0,d=d+Math.imul(M,ce)|0,c=c+Math.imul(_,de)|0,f=(f=f+Math.imul(_,re)|0)+Math.imul(I,de)|0,d=d+Math.imul(I,re)|0,c=c+Math.imul(A,ie)|0,f=(f=f+Math.imul(A,be)|0)+Math.imul(v,ie)|0,d=d+Math.imul(v,be)|0,c=c+Math.imul(m,se)|0,f=(f=f+Math.imul(m,le)|0)+Math.imul(x,se)|0,d=d+Math.imul(x,le)|0;var Ce=(b+(c=c+Math.imul(h,he)|0)|0)+((8191&(f=(f=f+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;b=((d=d+Math.imul(p,pe)|0)+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c=Math.imul(F,K),f=(f=Math.imul(F,V))+Math.imul(Q,K)|0,d=Math.imul(Q,V),c=c+Math.imul(P,J)|0,f=(f=f+Math.imul(P,W)|0)+Math.imul(D,J)|0,d=d+Math.imul(D,W)|0,c=c+Math.imul(T,X)|0,f=(f=f+Math.imul(T,ee)|0)+Math.imul(N,X)|0,d=d+Math.imul(N,ee)|0,c=c+Math.imul(k,te)|0,f=(f=f+Math.imul(k,ce)|0)+Math.imul(L,te)|0,d=d+Math.imul(L,ce)|0,c=c+Math.imul(C,de)|0,f=(f=f+Math.imul(C,re)|0)+Math.imul(M,de)|0,d=d+Math.imul(M,re)|0,c=c+Math.imul(_,ie)|0,f=(f=f+Math.imul(_,be)|0)+Math.imul(I,ie)|0,d=d+Math.imul(I,be)|0,c=c+Math.imul(A,se)|0,f=(f=f+Math.imul(A,le)|0)+Math.imul(v,se)|0,d=d+Math.imul(v,le)|0;var Me=(b+(c=c+Math.imul(m,he)|0)|0)+((8191&(f=(f=f+Math.imul(m,pe)|0)+Math.imul(x,he)|0))<<13)|0;b=((d=d+Math.imul(x,pe)|0)+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,c=Math.imul(F,J),f=(f=Math.imul(F,W))+Math.imul(Q,J)|0,d=Math.imul(Q,W),c=c+Math.imul(P,X)|0,f=(f=f+Math.imul(P,ee)|0)+Math.imul(D,X)|0,d=d+Math.imul(D,ee)|0,c=c+Math.imul(T,te)|0,f=(f=f+Math.imul(T,ce)|0)+Math.imul(N,te)|0,d=d+Math.imul(N,ce)|0,c=c+Math.imul(k,de)|0,f=(f=f+Math.imul(k,re)|0)+Math.imul(L,de)|0,d=d+Math.imul(L,re)|0,c=c+Math.imul(C,ie)|0,f=(f=f+Math.imul(C,be)|0)+Math.imul(M,ie)|0,d=d+Math.imul(M,be)|0,c=c+Math.imul(_,se)|0,f=(f=f+Math.imul(_,le)|0)+Math.imul(I,se)|0,d=d+Math.imul(I,le)|0;var Be=(b+(c=c+Math.imul(A,he)|0)|0)+((8191&(f=(f=f+Math.imul(A,pe)|0)+Math.imul(v,he)|0))<<13)|0;b=((d=d+Math.imul(v,pe)|0)+(f>>>13)|0)+(Be>>>26)|0,Be&=67108863,c=Math.imul(F,X),f=(f=Math.imul(F,ee))+Math.imul(Q,X)|0,d=Math.imul(Q,ee),c=c+Math.imul(P,te)|0,f=(f=f+Math.imul(P,ce)|0)+Math.imul(D,te)|0,d=d+Math.imul(D,ce)|0,c=c+Math.imul(T,de)|0,f=(f=f+Math.imul(T,re)|0)+Math.imul(N,de)|0,d=d+Math.imul(N,re)|0,c=c+Math.imul(k,ie)|0,f=(f=f+Math.imul(k,be)|0)+Math.imul(L,ie)|0,d=d+Math.imul(L,be)|0,c=c+Math.imul(C,se)|0,f=(f=f+Math.imul(C,le)|0)+Math.imul(M,se)|0,d=d+Math.imul(M,le)|0;var ke=(b+(c=c+Math.imul(_,he)|0)|0)+((8191&(f=(f=f+Math.imul(_,pe)|0)+Math.imul(I,he)|0))<<13)|0;b=((d=d+Math.imul(I,pe)|0)+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,c=Math.imul(F,te),f=(f=Math.imul(F,ce))+Math.imul(Q,te)|0,d=Math.imul(Q,ce),c=c+Math.imul(P,de)|0,f=(f=f+Math.imul(P,re)|0)+Math.imul(D,de)|0,d=d+Math.imul(D,re)|0,c=c+Math.imul(T,ie)|0,f=(f=f+Math.imul(T,be)|0)+Math.imul(N,ie)|0,d=d+Math.imul(N,be)|0,c=c+Math.imul(k,se)|0,f=(f=f+Math.imul(k,le)|0)+Math.imul(L,se)|0,d=d+Math.imul(L,le)|0;var Le=(b+(c=c+Math.imul(C,he)|0)|0)+((8191&(f=(f=f+Math.imul(C,pe)|0)+Math.imul(M,he)|0))<<13)|0;b=((d=d+Math.imul(M,pe)|0)+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,c=Math.imul(F,de),f=(f=Math.imul(F,re))+Math.imul(Q,de)|0,d=Math.imul(Q,re),c=c+Math.imul(P,ie)|0,f=(f=f+Math.imul(P,be)|0)+Math.imul(D,ie)|0,d=d+Math.imul(D,be)|0,c=c+Math.imul(T,se)|0,f=(f=f+Math.imul(T,le)|0)+Math.imul(N,se)|0,d=d+Math.imul(N,le)|0;var Se=(b+(c=c+Math.imul(k,he)|0)|0)+((8191&(f=(f=f+Math.imul(k,pe)|0)+Math.imul(L,he)|0))<<13)|0;b=((d=d+Math.imul(L,pe)|0)+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,c=Math.imul(F,ie),f=(f=Math.imul(F,be))+Math.imul(Q,ie)|0,d=Math.imul(Q,be),c=c+Math.imul(P,se)|0,f=(f=f+Math.imul(P,le)|0)+Math.imul(D,se)|0,d=d+Math.imul(D,le)|0;var Te=(b+(c=c+Math.imul(T,he)|0)|0)+((8191&(f=(f=f+Math.imul(T,pe)|0)+Math.imul(N,he)|0))<<13)|0;b=((d=d+Math.imul(N,pe)|0)+(f>>>13)|0)+(Te>>>26)|0,Te&=67108863,c=Math.imul(F,se),f=(f=Math.imul(F,le))+Math.imul(Q,se)|0,d=Math.imul(Q,le);var Ne=(b+(c=c+Math.imul(P,he)|0)|0)+((8191&(f=(f=f+Math.imul(P,pe)|0)+Math.imul(D,he)|0))<<13)|0;b=((d=d+Math.imul(D,pe)|0)+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Re=(b+(c=Math.imul(F,he))|0)+((8191&(f=(f=Math.imul(F,pe))+Math.imul(Q,he)|0))<<13)|0;return b=((d=Math.imul(Q,pe))+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,i[0]=ge,i[1]=me,i[2]=xe,i[3]=ye,i[4]=Ae,i[5]=ve,i[6]=we,i[7]=_e,i[8]=Ie,i[9]=Ee,i[10]=Ce,i[11]=Me,i[12]=Be,i[13]=ke,i[14]=Le,i[15]=Se,i[16]=Te,i[17]=Ne,i[18]=Re,0!==b&&(i[19]=b,t.length++),t};function p(e,a,t){return(new g).mulp(e,a,t)}function g(e,a){this.x=e,this.y=a}Math.imul||(h=u),d.prototype.mulTo=function(e,a){var t,c=this.length+e.length;return t=10===this.length&&10===e.length?h(this,e,a):c<63?u(this,e,a):c<1024?function(e,a,t){t.negative=a.negative^e.negative,t.length=e.length+a.length;for(var c=0,f=0,d=0;d>>26)|0)>>>26,r&=67108863}t.words[d]=n,c=r,r=f}return 0!==c?t.words[d]=c:t.length--,t.strip()}(this,e,a):p(this,e,a),t},g.prototype.makeRBT=function(e){for(var a=new Array(e),t=d.prototype._countBits(e)-1,c=0;c>=1;return c},g.prototype.permute=function(e,a,t,c,f,d){for(var r=0;r>>=1)f++;return 1<>>=13,t[2*r+1]=8191&d,d>>>=13;for(r=2*a;r>=26,a+=f/67108864|0,a+=d>>>26,this.words[t]=67108863&d}return 0!==a&&(this.words[t]=a,this.length++),this},d.prototype.muln=function(e){return this.clone().imuln(e)},d.prototype.sqr=function(){return this.mul(this)},d.prototype.isqr=function(){return this.imul(this.clone())},d.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),t=0;t>>f}return a}(e);if(0===a.length)return new d(1);for(var t=this,c=0;c=0);var a,t=e%26,f=(e-t)/26,d=67108863>>>26-t<<26-t;if(0!==t){var r=0;for(a=0;a>>26-t}r&&(this.words[a]=r,this.length++)}if(0!==f){for(a=this.length-1;a>=0;a--)this.words[a+f]=this.words[a];for(a=0;a=0),f=a?(a-a%26)/26:0;var d=e%26,r=Math.min((e-d)/26,this.length),n=67108863^67108863>>>d<r)for(this.length-=r,b=0;b=0&&(0!==o||b>=f);b--){var s=0|this.words[b];this.words[b]=o<<26-d|s>>>d,o=s&n}return i&&0!==o&&(i.words[i.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},d.prototype.ishrn=function(e,a,t){return c(0===this.negative),this.iushrn(e,a,t)},d.prototype.shln=function(e){return this.clone().ishln(e)},d.prototype.ushln=function(e){return this.clone().iushln(e)},d.prototype.shrn=function(e){return this.clone().ishrn(e)},d.prototype.ushrn=function(e){return this.clone().iushrn(e)},d.prototype.testn=function(e){c("number"==typeof e&&e>=0);var a=e%26,t=(e-a)/26,f=1<=0);var a=e%26,t=(e-a)/26;if(c(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==a&&t++,this.length=Math.min(t,this.length),0!==a){var f=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},d.prototype.isubn=function(e){if(c("number"==typeof e),c(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(i/67108864|0),this.words[f+t]=67108863&d}for(;f>26,this.words[f+t]=67108863&d;if(0===n)return this.strip();for(c(-1===n),n=0,f=0;f>26,this.words[f]=67108863&d;return this.negative=1,this.strip()},d.prototype._wordDiv=function(e,a){var t=(this.length,e.length),c=this.clone(),f=e,r=0|f.words[f.length-1];0!=(t=26-this._countBits(r))&&(f=f.ushln(t),c.iushln(t),r=0|f.words[f.length-1]);var n,i=c.length-f.length;if("mod"!==a){(n=new d(null)).length=i+1,n.words=new Array(n.length);for(var b=0;b=0;s--){var l=67108864*(0|c.words[f.length+s])+(0|c.words[f.length+s-1]);for(l=Math.min(l/r|0,67108863),c._ishlnsubmul(f,l,s);0!==c.negative;)l--,c.negative=0,c._ishlnsubmul(f,1,s),c.isZero()||(c.negative^=1);n&&(n.words[s]=l)}return n&&n.strip(),c.strip(),"div"!==a&&0!==t&&c.iushrn(t),{div:n||null,mod:c}},d.prototype.divmod=function(e,a,t){return c(!e.isZero()),this.isZero()?{div:new d(0),mod:new d(0)}:0!==this.negative&&0===e.negative?(n=this.neg().divmod(e,a),"mod"!==a&&(f=n.div.neg()),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.iadd(e)),{div:f,mod:r}):0===this.negative&&0!==e.negative?(n=this.divmod(e.neg(),a),"mod"!==a&&(f=n.div.neg()),{div:f,mod:n.mod}):this.negative&e.negative?(n=this.neg().divmod(e.neg(),a),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.isub(e)),{div:n.div,mod:r}):e.length>this.length||this.cmp(e)<0?{div:new d(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new d(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new d(this.modn(e.words[0]))}:this._wordDiv(e,a);var f,r,n},d.prototype.div=function(e){return this.divmod(e,"div",!1).div},d.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},d.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},d.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var t=0!==a.div.negative?a.mod.isub(e):a.mod,c=e.ushrn(1),f=e.andln(1),d=t.cmp(c);return d<0||1===f&&0===d?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},d.prototype.modn=function(e){c(e<=67108863);for(var a=(1<<26)%e,t=0,f=this.length-1;f>=0;f--)t=(a*t+(0|this.words[f]))%e;return t},d.prototype.idivn=function(e){c(e<=67108863);for(var a=0,t=this.length-1;t>=0;t--){var f=(0|this.words[t])+67108864*a;this.words[t]=f/e|0,a=f%e}return this.strip()},d.prototype.divn=function(e){return this.clone().idivn(e)},d.prototype.egcd=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f=new d(1),r=new d(0),n=new d(0),i=new d(1),b=0;a.isEven()&&t.isEven();)a.iushrn(1),t.iushrn(1),++b;for(var o=t.clone(),s=a.clone();!a.isZero();){for(var l=0,u=1;!(a.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(f.isOdd()||r.isOdd())&&(f.iadd(o),r.isub(s)),f.iushrn(1),r.iushrn(1);for(var h=0,p=1;!(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(o),i.isub(s)),n.iushrn(1),i.iushrn(1);a.cmp(t)>=0?(a.isub(t),f.isub(n),r.isub(i)):(t.isub(a),n.isub(f),i.isub(r))}return{a:n,b:i,gcd:t.iushln(b)}},d.prototype._invmp=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f,r=new d(1),n=new d(0),i=t.clone();a.cmpn(1)>0&&t.cmpn(1)>0;){for(var b=0,o=1;!(a.words[0]&o)&&b<26;++b,o<<=1);if(b>0)for(a.iushrn(b);b-- >0;)r.isOdd()&&r.iadd(i),r.iushrn(1);for(var s=0,l=1;!(t.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(t.iushrn(s);s-- >0;)n.isOdd()&&n.iadd(i),n.iushrn(1);a.cmp(t)>=0?(a.isub(t),r.isub(n)):(t.isub(a),n.isub(r))}return(f=0===a.cmpn(1)?r:n).cmpn(0)<0&&f.iadd(e),f},d.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),t=e.clone();a.negative=0,t.negative=0;for(var c=0;a.isEven()&&t.isEven();c++)a.iushrn(1),t.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;t.isEven();)t.iushrn(1);var f=a.cmp(t);if(f<0){var d=a;a=t,t=d}else if(0===f||0===t.cmpn(1))break;a.isub(t)}return t.iushln(c)},d.prototype.invm=function(e){return this.egcd(e).a.umod(e)},d.prototype.isEven=function(){return!(1&this.words[0])},d.prototype.isOdd=function(){return!(1&~this.words[0])},d.prototype.andln=function(e){return this.words[0]&e},d.prototype.bincn=function(e){c("number"==typeof e);var a=e%26,t=(e-a)/26,f=1<>>26,n&=67108863,this.words[r]=n}return 0!==d&&(this.words[r]=d,this.length++),this},d.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},d.prototype.cmpn=function(e){var a,t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)a=1;else{t&&(e=-e),c(e<=67108863,"Number is too big");var f=0|this.words[0];a=f===e?0:fe.length)return 1;if(this.length=0;t--){var c=0|this.words[t],f=0|e.words[t];if(c!==f){cf&&(a=1);break}}return a},d.prototype.gtn=function(e){return 1===this.cmpn(e)},d.prototype.gt=function(e){return 1===this.cmp(e)},d.prototype.gten=function(e){return this.cmpn(e)>=0},d.prototype.gte=function(e){return this.cmp(e)>=0},d.prototype.ltn=function(e){return-1===this.cmpn(e)},d.prototype.lt=function(e){return-1===this.cmp(e)},d.prototype.lten=function(e){return this.cmpn(e)<=0},d.prototype.lte=function(e){return this.cmp(e)<=0},d.prototype.eqn=function(e){return 0===this.cmpn(e)},d.prototype.eq=function(e){return 0===this.cmp(e)},d.red=function(e){return new _(e)},d.prototype.toRed=function(e){return c(!this.red,"Already a number in reduction context"),c(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},d.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},d.prototype._forceRed=function(e){return this.red=e,this},d.prototype.forceRed=function(e){return c(!this.red,"Already a number in reduction context"),this._forceRed(e)},d.prototype.redAdd=function(e){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},d.prototype.redIAdd=function(e){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},d.prototype.redSub=function(e){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},d.prototype.redISub=function(e){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},d.prototype.redShl=function(e){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},d.prototype.redMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},d.prototype.redIMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},d.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},d.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},d.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},d.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},d.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},d.prototype.redPow=function(e){return c(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function x(e,a){this.name=e,this.p=new d(a,16),this.n=this.p.bitLength(),this.k=new d(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var a=d._prime(e);this.m=a.p,this.prime=a}else c(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new d(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)}x.prototype._tmp=function(){var e=new d(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var a,t=e;do{this.split(t,this.tmp),a=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(a>this.n);var c=a0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},x.prototype.split=function(e,a){e.iushrn(this.n,0,a)},x.prototype.imulK=function(e){return e.imul(this.k)},f(y,x),y.prototype.split=function(e,a){for(var t=4194303,c=Math.min(e.length,9),f=0;f>>22,d=r}d>>>=22,e.words[f-10]=d,0===d&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,t=0;t>>=26,e.words[t]=f,a=c}return 0!==a&&(e.words[e.length++]=a),e},d._prime=function(e){if(m[e])return m[e];var a;if("k256"===e)a=new y;else if("p224"===e)a=new A;else if("p192"===e)a=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new w}return m[e]=a,a},_.prototype._verify1=function(e){c(0===e.negative,"red works only with positives"),c(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,a){c(!(e.negative|a.negative),"red works only with positives"),c(e.red&&e.red===a.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,a){this._verify2(e,a);var t=e.add(a);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},_.prototype.iadd=function(e,a){this._verify2(e,a);var t=e.iadd(a);return t.cmp(this.m)>=0&&t.isub(this.m),t},_.prototype.sub=function(e,a){this._verify2(e,a);var t=e.sub(a);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},_.prototype.isub=function(e,a){this._verify2(e,a);var t=e.isub(a);return t.cmpn(0)<0&&t.iadd(this.m),t},_.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},_.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},_.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(c(a%2==1),3===a){var t=this.m.add(new d(1)).iushrn(2);return this.pow(e,t)}for(var f=this.m.subn(1),r=0;!f.isZero()&&0===f.andln(1);)r++,f.iushrn(1);c(!f.isZero());var n=new d(1).toRed(this),i=n.redNeg(),b=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new d(2*o*o).toRed(this);0!==this.pow(o,b).cmp(i);)o.redIAdd(i);for(var s=this.pow(o,f),l=this.pow(e,f.addn(1).iushrn(1)),u=this.pow(e,f),h=r;0!==u.cmp(n);){for(var p=u,g=0;0!==p.cmp(n);g++)p=p.redSqr();c(g=0;c--){for(var b=a.words[c],o=i-1;o>=0;o--){var s=b>>o&1;f!==t[0]&&(f=this.sqr(f)),0!==s||0!==r?(r<<=1,r|=s,(4==++n||0===c&&0===o)&&(f=this.mul(f,t[r]),n=0,r=0)):n=0}i=26}return f},_.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},_.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},d.mont=function(e){return new I(e)},f(I,_),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},I.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var t=e.imul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),d=f;return f.cmp(this.m)>=0?d=f.isub(this.m):f.cmpn(0)<0&&(d=f.iadd(this.m)),d._forceRed(this)},I.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new d(0)._forceRed(this);var t=e.mul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),r=f;return f.cmp(this.m)>=0?r=f.isub(this.m):f.cmpn(0)<0&&(r=f.iadd(this.m)),r._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=t.nmd(e),this)},30655:(e,a,t)=>{"use strict";var c=t(70453)("%Object.defineProperty%",!0)||!1;if(c)try{c({},"a",{value:1})}catch(e){c=!1}e.exports=c},41237:e=>{"use strict";e.exports=EvalError},69383:e=>{"use strict";e.exports=Error},79290:e=>{"use strict";e.exports=RangeError},79538:e=>{"use strict";e.exports=ReferenceError},58068:e=>{"use strict";e.exports=SyntaxError},69675:e=>{"use strict";e.exports=TypeError},35345:e=>{"use strict";e.exports=URIError},9723:(e,a,t)=>{"use strict";t.d(a,{AF:()=>s,B3:()=>o,JY:()=>l,QL:()=>b,vS:()=>i});var c=t(36212),f=t(57339),d=t(24359),r=t(43948),n=t(67418);async function i(e,a){let t,d=null;if(Array.isArray(a)){const d=function(a){if((0,c.Lo)(a,32))return a;const t=e.getEvent(a);return(0,f.MR)(t,"unknown fragment","name",a),t.topicHash};t=a.map((e=>null==e?null:Array.isArray(e)?e.map(d):d(e)))}else"*"===a?t=[null]:"string"==typeof a?(0,c.Lo)(a,32)?t=[a]:(d=e.getEvent(a),(0,f.MR)(d,"unknown fragment","event",a),t=[d.topicHash]):(r=a)&&"object"==typeof r&&"getTopicFilter"in r&&"function"==typeof r.getTopicFilter&&r.fragment?t=await a.getTopicFilter():"fragment"in a?(d=a.fragment,t=[d.topicHash]):(0,f.MR)(!1,"unknown event name","event",a);var r;return t=t.map((e=>{if(null==e)return null;if(Array.isArray(e)){const a=Array.from(new Set(e.map((e=>e.toLowerCase()))).values());return 1===a.length?a[0]:(a.sort(),a)}return e.toLowerCase()})),{fragment:d,tag:t.map((e=>null==e?"null":Array.isArray(e)?e.join("|"):e)).join("&"),topics:t}}async function b(e,a,t,c,n){null==c&&(c=0),null==n&&(n="latest");const{fragment:b,topics:o}=await i(a.interface,t),s={address:"*"===e?void 0:e,topics:o,fromBlock:c,toBlock:n},l=a.runner;return(0,f.vA)(l,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await l.getLogs(s)).map((e=>{let t=b;if(null==t)try{t=a.interface.getEvent(e.topics[0])}catch{}if(t)try{return new d.vu(e,a.interface,t)}catch(a){return new d.AA(e,a)}return new r.tG(e,l)}))}class o{provider;onProgress;concurrencySize;batchSize;shouldRetry;retryMax;retryOn;constructor({provider:e,onProgress:a,concurrencySize:t=10,batchSize:c=10,shouldRetry:f=!0,retryMax:d=5,retryOn:r=500}){this.provider=e,this.onProgress=a,this.concurrencySize=t,this.batchSize=c,this.shouldRetry=f,this.retryMax=d,this.retryOn=r}async getBlock(e){const a=await this.provider.getBlock(e);if(!a)throw new Error(`No block for ${e}`);return a}createBatchRequest(e){return e.map((async(e,a)=>(await(0,n.yy)(40*a),(async()=>{let a,t=0;for(;!this.shouldRetry&&0===t||this.shouldRetry&&tthis.getBlock(e))))}catch(e){t++,a=e,await(0,n.yy)(this.retryOn)}throw a})())))}async getBatchBlocks(e){let a=0;const t=[];for(const c of(0,n.iv)(e,this.concurrencySize*this.batchSize)){const f=(await Promise.all(this.createBatchRequest((0,n.iv)(c,this.batchSize)))).flat();t.push(...f),a+=c.length,"function"==typeof this.onProgress&&this.onProgress({percentage:a/e.length,currentIndex:a,totalIndex:e.length})}return t}}class s{provider;onProgress;concurrencySize;batchSize;shouldRetry;retryMax;retryOn;constructor({provider:e,onProgress:a,concurrencySize:t=10,batchSize:c=10,shouldRetry:f=!0,retryMax:d=5,retryOn:r=500}){this.provider=e,this.onProgress=a,this.concurrencySize=t,this.batchSize=c,this.shouldRetry=f,this.retryMax=d,this.retryOn=r}async getTransaction(e){const a=await this.provider.getTransaction(e);if(!a)throw new Error(`No transaction for ${e}`);return a}async getTransactionReceipt(e){const a=await this.provider.getTransactionReceipt(e);if(!a)throw new Error(`No transaction receipt for ${e}`);return a}createBatchRequest(e,a){return e.map((async(e,t)=>(await(0,n.yy)(40*t),(async()=>{let t,c=0;for(;!this.shouldRetry&&0===c||this.shouldRetry&&cthis.getTransactionReceipt(e)))):await Promise.all(e.map((e=>this.getTransaction(e))))}catch(e){c++,t=e,await(0,n.yy)(this.retryOn)}throw t})())))}async getBatchTransactions(e){let a=0;const t=[];for(const c of(0,n.iv)(e,this.concurrencySize*this.batchSize)){const f=(await Promise.all(this.createBatchRequest((0,n.iv)(c,this.batchSize)))).flat();t.push(...f),a+=c.length,"function"==typeof this.onProgress&&this.onProgress({percentage:a/e.length,currentIndex:a,totalIndex:e.length})}return t}async getBatchReceipt(e){let a=0;const t=[];for(const c of(0,n.iv)(e,this.concurrencySize*this.batchSize)){const f=(await Promise.all(this.createBatchRequest((0,n.iv)(c,this.batchSize),!0))).flat();t.push(...f),a+=c.length,"function"==typeof this.onProgress&&this.onProgress({percentage:a/e.length,currentIndex:a,totalIndex:e.length})}return t}}class l{provider;contract;address;onProgress;concurrencySize;blocksPerRequest;shouldRetry;retryMax;retryOn;constructor({provider:e,contract:a,address:t,onProgress:c,concurrencySize:f=10,blocksPerRequest:d=5e3,shouldRetry:r=!0,retryMax:n=5,retryOn:i=500}){this.provider=e,this.contract=a,this.address=t,this.onProgress=c,this.concurrencySize=f,this.blocksPerRequest=d,this.shouldRetry=r,this.retryMax=n,this.retryOn=i}async getPastEvents({fromBlock:e,toBlock:a,type:t}){let c,f=0;for(;!this.shouldRetry&&0===f||this.shouldRetry&&f(await(0,n.yy)(10*a),this.getPastEvents(e))))}async getBatchEvents({fromBlock:e,toBlock:a,type:t="*"}){a||(a=await this.provider.getBlockNumber());const c=[];for(let f=e;fa?a:f+this.blocksPerRequest-1;c.push({fromBlock:f,toBlock:e,type:t})}const f=[],d=(0,n.iv)(c,this.concurrencySize);let r=0;for(const e of d){r++;const a=(await Promise.all(this.createBatchRequest(e))).flat();f.push(...a),"function"==typeof this.onProgress&&this.onProgress({percentage:r/d.length,type:t,fromBlock:e[0].fromBlock,toBlock:e[e.length-1].toBlock,count:a.length})}return f}}},7240:(e,a,t)=>{"use strict";t.d(a,{Hr:()=>n,Ps:()=>r,dA:()=>i,qO:()=>b,wd:()=>d});var c=t(67418),f=t(85111);function d(e){const a=/tornado-(?\w+)-(?[\d.]+)-(?\d+)-0x(?[0-9a-fA-F]{124})/g.exec(e);if(!a)return;const{currency:t,amount:c,netId:f,noteHex:d}=a.groups;return{currency:t.toLowerCase(),amount:c,netId:Number(f),noteHex:"0x"+d,note:e}}function r(e){const a=/tornadoInvoice-(?\w+)-(?[\d.]+)-(?\d+)-0x(?[0-9a-fA-F]{64})/g.exec(e);if(!a)return;const{currency:t,amount:c,netId:f,commitmentHex:d}=a.groups;return{currency:t.toLowerCase(),amount:c,netId:Number(f),commitmentHex:"0x"+d,invoice:e}}async function n({nullifier:e,secret:a}){const t=new Uint8Array([...(0,c.EI)(e),...(0,c.EI)(a)]),d=(0,c.$W)((0,c.Ju)(t),62),r=BigInt(await(0,f.UB)(t)),n=(0,c.$W)(r),i=BigInt(await(0,f.UB)((0,c.EI)(e)));return{preimage:t,noteHex:d,commitment:r,commitmentHex:n,nullifierHash:i,nullifierHex:(0,c.$W)(i)}}class i{currency;amount;netId;nullifier;secret;note;noteHex;invoice;commitmentHex;nullifierHex;constructor({currency:e,amount:a,netId:t,nullifier:c,secret:f,note:d,noteHex:r,invoice:n,commitmentHex:i,nullifierHex:b}){this.currency=e,this.amount=a,this.netId=t,this.nullifier=c,this.secret=f,this.note=d,this.noteHex=r,this.invoice=n,this.commitmentHex=i,this.nullifierHex=b}toString(){return JSON.stringify({currency:this.currency,amount:this.amount,netId:this.netId,nullifier:this.nullifier,secret:this.secret,note:this.note,noteHex:this.noteHex,invoice:this.invoice,commitmentHex:this.commitmentHex,nullifierHex:this.nullifierHex},null,2)}static async createNote({currency:e,amount:a,netId:t,nullifier:f,secret:d}){f||(f=(0,c.ib)(31)),d||(d=(0,c.ib)(31));const r=await n({nullifier:f,secret:d});return new i({currency:e.toLowerCase(),amount:a,netId:t,note:`tornado-${e.toLowerCase()}-${a}-${t}-${r.noteHex}`,noteHex:r.noteHex,invoice:`tornadoInvoice-${e.toLowerCase()}-${a}-${t}-${r.commitmentHex}`,nullifier:f,secret:d,commitmentHex:r.commitmentHex,nullifierHex:r.nullifierHex})}static async parseNote(e){const a=d(e);if(!a)throw new Error("The note has invalid format");const{currency:t,amount:f,netId:r,note:b,noteHex:o}=a,s=(0,c.jm)(o),l=BigInt((0,c.ae)(s.slice(0,31)).toString()),u=BigInt((0,c.ae)(s.slice(31,62)).toString()),{noteHex:h,commitmentHex:p,nullifierHex:g}=await n({nullifier:l,secret:u});return new i({currency:t,amount:f,netId:r,note:b,noteHex:h,invoice:`tornadoInvoice-${t}-${f}-${r}-${p}`,nullifier:l,secret:u,commitmentHex:p,nullifierHex:g})}}class b{currency;amount;netId;commitmentHex;invoice;constructor(e){const a=r(e);if(!a)throw new Error("The invoice has invalid format");const{currency:t,amount:c,netId:f,invoice:d,commitmentHex:n}=a;this.currency=t,this.amount=c,this.netId=f,this.commitmentHex=n,this.invoice=d}toString(){return JSON.stringify({currency:this.currency,amount:this.amount,netId:this.netId,commitmentHex:this.commitmentHex,invoice:this.invoice},null,2)}}},33298:(e,a,t)=>{"use strict";t.d(a,{Ad:()=>b,Fr:()=>n,ol:()=>i});var c=t(51594),f=t(20415),d=t(30031),r=t(67418);function n({nonce:e,ephemPublicKey:a,ciphertext:t}){const c=(0,r.$W)((0,r.My)((0,r.Kp)(e)),24),f=(0,r.$W)((0,r.My)((0,r.Kp)(a)),32),d=(0,r.My)((0,r.Kp)(t)),n=(0,r.Id)((0,r.aT)(c),(0,r.aT)(f),(0,r.aT)(d));return(0,r.My)(n)}function i(e){const a=(0,r.aT)(e),t=(0,r.if)(a.slice(0,24)),c=(0,r.if)(a.slice(24,56)),f=(0,r.if)(a.slice(56));return{messageBuff:(0,r.My)(a),version:"x25519-xsalsa20-poly1305",nonce:t,ephemPublicKey:c,ciphertext:f}}class b{blockNumber;recoveryKey;recoveryAddress;recoveryPublicKey;constructor({blockNumber:e,recoveryKey:a}){a||(a=(0,r.G9)(32).slice(2)),this.blockNumber=e,this.recoveryKey=a,this.recoveryAddress=(0,f.K)("0x"+a),this.recoveryPublicKey=(0,c.getEncryptionPublicKey)(a)}static async getSignerPublicKey(e){if(e.privateKey){const a=e,t="0x"===a.privateKey.slice(0,2)?a.privateKey.slice(2):a.privateKey;return(0,c.getEncryptionPublicKey)(t)}const a=e.provider;return await a.send("eth_getEncryptionPublicKey",[e.address])}getEncryptedAccount(e){const a=(0,c.encrypt)({publicKey:e,data:this.recoveryKey,version:"x25519-xsalsa20-poly1305"});return{encryptedData:a,data:n(a)}}static async decryptSignerNoteAccounts(e,a){const t=e.address,f=[];for(const d of a)if(d.address===t)try{const a=i(d.encryptedAccount);let n;if(e.privateKey){const t=e,f="0x"===t.privateKey.slice(0,2)?t.privateKey.slice(2):t.privateKey;n=(0,c.decrypt)({encryptedData:a,privateKey:f})}else{const{version:c,nonce:f,ephemPublicKey:d,ciphertext:i}=a,b=(0,r.My)((new TextEncoder).encode(JSON.stringify({version:c,nonce:f,ephemPublicKey:d,ciphertext:i}))),o=e.provider;n=await o.send("eth_decrypt",[b,t])}f.push(new b({blockNumber:d.blockNumber,recoveryKey:n}))}catch{continue}return f}decryptNotes(e){const a=[];for(const t of e)try{const e=i(t.encryptedNote),[f,r]=(0,c.decrypt)({encryptedData:e,privateKey:this.recoveryKey}).split("-");a.push({blockNumber:t.blockNumber,address:(0,d.b)(f),noteHex:r})}catch{continue}return a}encryptNote({address:e,noteHex:a}){return n((0,c.encrypt)({publicKey:this.recoveryPublicKey,data:`${e}-${a}`,version:"x25519-xsalsa20-poly1305"}))}}},16795:(e,a,t)=>{"use strict";t.d(a,{A6:()=>l,Lr:()=>o,QP:()=>s,gH:()=>u,qX:()=>b});var c=t(2011),f=t(64563),d=t(97876),r=t(62463),n=t(67418),i=t(59499);function b(e){if(66!==e.length)return null;if(0!==e.indexOf("["))return null;if(65!==e.indexOf("]"))return null;const a=`0x${e.slice(1,65)}`;return(0,n.qv)(a)?a:null}function o(e){return e?b(e)||(0,c.S)((new TextEncoder).encode(e)):(0,n.My)(new Uint8Array(32).fill(0))}function s(e){const a=e.split("."),t=a.shift(),c=(0,f.kM)(a.join("."));return{label:t,labelhash:o(t),parentNode:c}}const l={[i.zr.MAINNET]:{ensRegistry:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",ensPublicResolver:"0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63",ensNameWrapper:"0xD4416b13d2b3a9aBae7AcD5D6C2BbDBE25686401"},[i.zr.SEPOLIA]:{ensRegistry:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",ensPublicResolver:"0x8FADE66B79cC9f707aB26799354482EB93a5B7dD",ensNameWrapper:"0x0635513f179D50A207757E05759CbD106d7dFcE8"}};class u{ENSRegistry;ENSResolver;ENSNameWrapper;provider;constructor(e){this.provider=e}async getContracts(){const{chainId:e}=await this.provider.getNetwork(),{ensRegistry:a,ensPublicResolver:t,ensNameWrapper:c}=l[Number(e)];this.ENSRegistry=r.S4.connect(a,this.provider),this.ENSResolver=r.BB.connect(t,this.provider),this.ENSNameWrapper=r.rZ.connect(c,this.provider)}async getOwner(e){return this.ENSRegistry||await this.getContracts(),this.ENSRegistry.owner((0,f.kM)(e))}async unwrap(e,a){this.ENSNameWrapper||await this.getContracts();const t=e.address,c=this.ENSNameWrapper.connect(e),{labelhash:f}=s(a);return c.unwrapETH2LD(f,t,t)}async setSubnodeRecord(e,a){this.ENSResolver||await this.getContracts();const t=this.ENSResolver,c=this.ENSRegistry.connect(e),f=e.address,{labelhash:d,parentNode:r}=s(a);return c.setSubnodeRecord(r,d,f,t.target,BigInt(0))}getResolver(e){return d.Pz.fromName(this.provider,e)}async getText(e,a){const t=await this.getResolver(e);return t?await t.getText(a)||"":t}async setText(e,a,t,c){return r.BB.connect((await this.getResolver(a))?.address,e).setText((0,f.kM)(a),t,c)}}},96221:(e,a,t)=>{"use strict";t.d(a,{GS:()=>y,O_:()=>A,uw:()=>g,JJ:()=>_,lG:()=>x,cE:()=>C,Do:()=>M,e0:()=>m,EU:()=>I,sf:()=>w});var c=t(30031),f=t(35273),d=t(36212),r=t(99770),n=t(64563),i=t(73622),b=t(13269);t(7040),t(88081),t(57339);const o=[{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"commitment",type:"bytes32"},{indexed:!1,internalType:"uint32",name:"leafIndex",type:"uint32"},{indexed:!1,internalType:"uint256",name:"timestamp",type:"uint256"}],name:"Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"bytes32",name:"nullifierHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"relayer",type:"address"},{indexed:!1,internalType:"uint256",name:"fee",type:"uint256"}],name:"Withdrawal",type:"event"},{inputs:[],name:"FIELD_SIZE",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"ROOT_HISTORY_SIZE",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[],name:"ZERO_VALUE",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"commitments",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"currentRootIndex",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[],name:"denomination",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"_commitment",type:"bytes32"}],name:"deposit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"filledSubtrees",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"getLastRoot",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IHasher",name:"_hasher",type:"address"},{internalType:"bytes32",name:"_left",type:"bytes32"},{internalType:"bytes32",name:"_right",type:"bytes32"}],name:"hashLeftRight",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"pure",type:"function"},{inputs:[],name:"hasher",outputs:[{internalType:"contract IHasher",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"_root",type:"bytes32"}],name:"isKnownRoot",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"_nullifierHash",type:"bytes32"}],name:"isSpent",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32[]",name:"_nullifierHashes",type:"bytes32[]"}],name:"isSpentArray",outputs:[{internalType:"bool[]",name:"spent",type:"bool[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"levels",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[],name:"nextIndex",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"nullifierHashes",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"roots",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"verifier",outputs:[{internalType:"contract IVerifier",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"_proof",type:"bytes"},{internalType:"bytes32",name:"_root",type:"bytes32"},{internalType:"bytes32",name:"_nullifierHash",type:"bytes32"},{internalType:"address payable",name:"_recipient",type:"address"},{internalType:"address payable",name:"_relayer",type:"address"},{internalType:"uint256",name:"_fee",type:"uint256"},{internalType:"uint256",name:"_refund",type:"uint256"}],name:"withdraw",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"zeros",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"}];class s{static abi=o;static createInterface(){return new i.KA(o)}static connect(e,a){return new b.NZ(e,o,a)}}var l=t(9723),u=t(46170),h=t(59499),p=t(57194);class g{netId;provider;contract;type;deployedBlock;batchEventsService;fetchDataOptions;tovarishClient;constructor({netId:e,provider:a,contract:t,type:c="",deployedBlock:f=0,fetchDataOptions:d,tovarishClient:r}){this.netId=e,this.provider=a,this.fetchDataOptions=d,this.contract=t,this.type=c,this.deployedBlock=f,this.batchEventsService=new l.JY({provider:a,contract:t,onProgress:this.updateEventProgress}),this.tovarishClient=r}getInstanceName(){return""}getType(){return this.type||""}getTovarishType(){return String(this.getType()||"").toLowerCase()}updateEventProgress({percentage:e,type:a,fromBlock:t,toBlock:c,count:f}){}updateBlockProgress({percentage:e,currentIndex:a,totalIndex:t}){}updateTransactionProgress({percentage:e,currentIndex:a,totalIndex:t}){}async formatEvents(e){return await new Promise((a=>a(e)))}async getEventsFromDB(){return{events:[],lastBlock:0}}async getEventsFromCache(){return{events:[],lastBlock:0,fromCache:!0}}async getSavedEvents(){let e=await this.getEventsFromDB();return e.lastBlock||(e=await this.getEventsFromCache()),e}async getEventsFromRpc({fromBlock:e,toBlock:a}){try{return a||(a=await this.provider.getBlockNumber()),e>=a?{events:[],lastBlock:a}:(this.updateEventProgress({percentage:0,type:this.getType()}),{events:await this.formatEvents(await this.batchEventsService.getBatchEvents({fromBlock:e,toBlock:a,type:this.getType()})),lastBlock:a})}catch(a){return console.log(a),{events:[],lastBlock:e}}}async getLatestEvents({fromBlock:e}){if(this.tovarishClient?.selectedRelayer){const{events:a,lastSyncBlock:t}=await this.tovarishClient.getEvents({type:this.getTovarishType(),fromBlock:e});return{events:a,lastBlock:t}}return await this.getEventsFromRpc({fromBlock:e})}async validateEvents({events:e,newEvents:a,lastBlock:t}){}async saveEvents({events:e,newEvents:a,lastBlock:t}){}async updateEvents(){const e=await this.getSavedEvents();let a=this.deployedBlock;e&&e.lastBlock&&(a=e.lastBlock+1);const t=await this.getLatestEvents({fromBlock:a}),c=new Set,f=[...e.events,...t.events].sort(((e,a)=>e.blockNumber===a.blockNumber?e.logIndex-a.logIndex:e.blockNumber-a.blockNumber)).filter((({transactionHash:e,logIndex:a})=>{const t=`${e}_${a}`,f=c.has(t);return c.add(t),!f})),d=t.lastBlock||f[f.length-1]?.blockNumber,r=await this.validateEvents({events:f,newEvents:t.events,lastBlock:d});return(e.fromCache||t.events.length)&&await this.saveEvents({events:f,newEvents:t.events,lastBlock:d}),{events:f,lastBlock:d,validateResult:r}}}class m extends g{amount;currency;optionalTree;merkleTreeService;batchTransactionService;batchBlockService;constructor(e){const{Tornado:a,amount:t,currency:c,provider:f,optionalTree:d,merkleTreeService:r}=e;super({...e,contract:a}),this.amount=t,this.currency=c,this.optionalTree=d,this.merkleTreeService=r,this.batchTransactionService=new l.AF({provider:f,onProgress:this.updateTransactionProgress}),this.batchBlockService=new l.B3({provider:f,onProgress:this.updateBlockProgress})}getInstanceName(){return`${this.getType().toLowerCase()}s_${this.netId}_${this.currency}_${this.amount}`}async formatEvents(e){if("Deposit"===this.getType()){const a=await this.batchTransactionService.getBatchTransactions([...new Set(e.map((({transactionHash:e})=>e)))]);return e.map((({blockNumber:e,index:t,transactionHash:c,args:f})=>{const{commitment:d,leafIndex:r,timestamp:n}=f;return{blockNumber:e,logIndex:t,transactionHash:c,commitment:d,leafIndex:Number(r),timestamp:Number(n),from:a.find((({hash:e})=>e===c))?.from||""}}))}{const a=await this.batchBlockService.getBatchBlocks([...new Set(e.map((({blockNumber:e})=>e)))]);return e.map((({blockNumber:e,index:t,transactionHash:f,args:d})=>{const{nullifierHash:r,to:n,fee:i}=d;return{blockNumber:e,logIndex:t,transactionHash:f,nullifierHash:String(r),to:(0,c.b)(n),fee:String(i),timestamp:a.find((({number:a})=>a===e))?.timestamp||0}}))}}async validateEvents({events:e,newEvents:a}){if(e.length&&"Deposit"===this.getType()){const t=e,c=t[t.length-1];if(c.leafIndex!==t.length-1){const e=`Deposit events invalid wants ${t.length-1} leafIndex have ${c.leafIndex}`;throw new Error(e)}if(this.merkleTreeService&&(!this.optionalTree||a.length))return await this.merkleTreeService.verifyTree(t)}}async getLatestEvents({fromBlock:e}){if(this.tovarishClient?.selectedRelayer){const{events:a,lastSyncBlock:t}=await this.tovarishClient.getEvents({type:this.getTovarishType(),currency:this.currency,amount:this.amount,fromBlock:e});return{events:a,lastBlock:t}}return await this.getEventsFromRpc({fromBlock:e})}}class x extends g{instances;optionalTree;merkleTreeService;batchTransactionService;batchBlockService;constructor(e){const{instances:a,provider:t,optionalTree:c,merkleTreeService:f}=e,d=f?.Tornado||s.connect(Object.keys(a)[0],t);super({...e,contract:d,type:"*"}),this.batchEventsService=new l.JY({provider:t,contract:d,address:Object.keys(a),onProgress:this.updateEventProgress}),this.instances=a,this.optionalTree=c,this.merkleTreeService=f,this.batchTransactionService=new l.AF({provider:t,onProgress:this.updateTransactionProgress}),this.batchBlockService=new l.B3({provider:t,onProgress:this.updateBlockProgress})}getInstanceName(){return`tornado_${this.netId}`}getTovarishType(){return"tornado"}async formatEvents(e){const a=await this.batchTransactionService.getBatchTransactions([...new Set(e.filter((({eventName:e})=>"Deposit"===e)).map((({transactionHash:e})=>e)))]),t=await this.batchBlockService.getBatchBlocks([...new Set(e.filter((({eventName:e})=>"Withdrawal"===e)).map((({blockNumber:e})=>e)))]);return e.map((({address:e,blockNumber:c,index:f,transactionHash:d,args:r,eventName:n})=>{const i={blockNumber:c,logIndex:f,transactionHash:d,event:n,instanceAddress:e};if("Deposit"===n){const{commitment:e,leafIndex:t,timestamp:c}=r;return{...i,commitment:e,leafIndex:Number(t),timestamp:Number(c),from:a.find((({hash:e})=>e===d))?.from||""}}if("Withdrawal"===n){const{nullifierHash:e,to:a,relayer:n,fee:b}=r;return{...i,logIndex:f,transactionHash:d,nullifierHash:String(e),to:a,relayerAddress:n,fee:String(b),timestamp:t.find((({number:e})=>e===c))?.timestamp||0}}})).filter((e=>e))}async validateEvents({events:e,newEvents:a}){const t=[...new Set(a.filter((({event:e})=>"Deposit"===e)).map((({instanceAddress:e})=>e)))];let c;const f=this.merkleTreeService?.Tornado?.target;f&&!t.includes(f)&&t.push(f);for(const a of t){const t=e.filter((({instanceAddress:e,event:t})=>e===a&&"Deposit"===t)),d=t[t.length-1];if(d.leafIndex!==t.length-1){const e=`Invalid deposit events for ${a} wants ${t.length-1} leafIndex have ${d.leafIndex}`;throw new Error(e)}f!==a||this.optionalTree||(c=await(this.merkleTreeService?.verifyTree(t)))}return c}async getEvents(e){const{events:a,validateResult:t,lastBlock:c}=await this.updateEvents(),{depositEvents:f,withdrawalEvents:d}=a.reduce(((a,t)=>(t.instanceAddress===e&&("Deposit"===t.event?a.depositEvents.push(t):"Withdrawal"===t.event&&a.withdrawalEvents.push(t)),a)),{});return{depositEvents:f,withdrawalEvents:d,tree:t,lastBlock:c}}}class y extends g{constructor(e){super({...e,contract:e.Echoer,type:"Echo"})}getInstanceName(){return`echo_${this.netId}`}async formatEvents(e){return e.map((({blockNumber:e,index:a,transactionHash:t,args:c})=>{const{who:f,data:d}=c;if(f&&d)return{blockNumber:e,logIndex:a,transactionHash:t,address:f,encryptedAccount:d}})).filter((e=>e))}}class A extends g{constructor(e){super({...e,contract:e.Router,type:"EncryptedNote"})}getInstanceName(){return`encrypted_notes_${this.netId}`}getTovarishType(){return"encrypted_notes"}async formatEvents(e){return e.map((({blockNumber:e,index:a,transactionHash:t,args:c})=>{const{encryptedNote:f}=c;if(f&&"0x"!==f)return{blockNumber:e,logIndex:a,transactionHash:t,encryptedNote:f}})).filter((e=>e))}}const v=f.y.defaultAbiCoder(),w={0:"Pending",1:"Active",2:"Defeated",3:"Timelocked",4:"AwaitingExecution",5:"Executed",6:"Expired"};class _ extends g{Governance;Aggregator;ReverseRecords;batchTransactionService;constructor(e){const{Governance:a,Aggregator:t,ReverseRecords:c,provider:f}=e;super({...e,contract:a,type:"*"}),this.Governance=a,this.Aggregator=t,this.ReverseRecords=c,this.batchTransactionService=new l.AF({provider:f,onProgress:this.updateTransactionProgress})}getInstanceName(){return`governance_${this.netId}`}getTovarishType(){return"governance"}async formatEvents(e){const a=[],t=[],c=[],f=[];if(e.forEach((({blockNumber:e,index:d,transactionHash:r,args:n,eventName:i})=>{const b={blockNumber:e,logIndex:d,transactionHash:r,event:i};if("ProposalCreated"===i){const{id:e,proposer:t,target:c,startTime:f,endTime:d,description:r}=n;a.push({...b,id:Number(e),proposer:t,target:c,startTime:Number(f),endTime:Number(d),description:r})}if("Voted"===i){const{proposalId:e,voter:a,support:c,votes:f}=n;t.push({...b,proposalId:Number(e),voter:a,support:c,votes:f,from:"",input:""})}if("Delegated"===i){const{account:e,to:a}=n;c.push({...b,account:e,delegateTo:a})}if("Undelegated"===i){const{account:e,from:a}=n;f.push({...b,account:e,delegateFrom:a})}})),t.length){this.updateTransactionProgress({percentage:0});const e=await this.batchTransactionService.getBatchTransactions([...new Set(t.map((({transactionHash:e})=>e)))]);t.forEach(((a,c)=>{let{data:f,from:d}=e.find((e=>e.hash===a.transactionHash));(!f||f.length>2048)&&(f=""),t[c].from=d,t[c].input=f}))}return[...a,...t,...c,...f]}async getAllProposals(){const{events:e}=await this.updateEvents(),a=e.filter((e=>"ProposalCreated"===e.event)),t=[...new Set(a.map((e=>[e.proposer])).flat())],[c,f,d]=await Promise.all([this.Governance.QUORUM_VOTES(),this.Aggregator.getAllProposals(this.Governance.target),this.ReverseRecords.getNames(t)]),r=t.reduce(((e,a,t)=>(d[t]&&(e[a]=d[t]),e)),{});return a.map(((e,a)=>{const{id:t,proposer:d,description:n}=e,i=f[a],{forVotes:b,againstVotes:o,executed:s,extended:l,state:u}=i,{title:h,description:p}=function(e,a){switch(e){case 1:return{title:a,description:"See: https://torn.community/t/proposal-1-enable-torn-transfers/38"};case 10:a=a.replace("\n","\\n\\n");break;case 11:a=a.replace('"description"',',"description"');break;case 13:a=a.replace(/\\\\n\\\\n(\s)?(\\n)?/g,"\\n");break;case 15:a=(a=a.replaceAll("'",'"')).replace('"description"',',"description"');break;case 16:a=a.replace("#16: ","");break;case 21:return{title:"Proposal #21: Restore Governance",description:""}}let t,c,f;try{({title:t,description:c}=JSON.parse(a))}catch{[t,...f]=a.split("\n",2),c=f.join("\n")}return{title:t,description:c}}(t,n),g=(Number(b+o)/Number(c)*100).toFixed(0)+"%";return{...e,title:h,proposerName:r[d]||void 0,description:p,forVotes:b,againstVotes:o,executed:s,extended:l,quorum:g,state:w[String(u)]}}))}async getVotes(e){const{events:a}=await this.getSavedEvents(),t=a.filter((a=>"Voted"===a.event&&a.proposalId===e)),c=[...new Set(t.map((e=>[e.from,e.voter])).flat())],f=await this.ReverseRecords.getNames(c),r=c.reduce(((e,a,t)=>(f[t]&&(e[a]=f[t]),e)),{});return t.map((e=>{const{from:a,voter:t}=e,{contact:c,message:f}=function(e,a){try{const t=4,c=v.decode(["address[]","uint256","bool"],(0,d.ZG)(a,t)),f=e.interface.encodeFunctionData("castDelegatedVote",c),r=(0,d.pO)(f),n=v.decode(["string"],(0,d.ZG)(a,r))[0],[i,b]=JSON.parse(n);return{contact:i,message:b}}catch{return{contact:"",message:""}}}(this.Governance,e.input);return{...e,contact:c,message:f,fromName:r[a]||void 0,voterName:r[t]||void 0}}))}async getDelegatedBalance(e){const{events:a}=await this.getSavedEvents(),t=a.filter((a=>"Delegated"===a.event&&a.delegateTo===e)).map((e=>e.account)),c=a.filter((a=>"Undelegated"===a.event&&a.delegateFrom===e)).map((e=>e.account)),f=[...c],d=t.filter((e=>{const a=f.indexOf(e);return-1===a||(f.splice(a,1),!1)})),[r,n]=await Promise.all([this.Aggregator.getGovernanceBalances(this.Governance.target,d),this.ReverseRecords.getNames(d)]),i=d.reduce(((e,a,t)=>(n[t]&&(e[a]=n[t]),e)),{});return{delegatedAccs:t,undelegatedAccs:c,uniq:d,uniqNames:i,balances:r,balance:r.reduce(((e,a)=>e+a),BigInt(0))}}}async function I(e,a){await Promise.all(a.filter((e=>e.tovarishHost)).map((async a=>{try{a.tovarishNetworks=await(0,u.Fd)(a.tovarishHost,{...e.fetchDataOptions,headers:{"Content-Type":"application/json"},timeout:3e4,maxRetry:e.fetchDataOptions?.torPort?2:0})}catch{a.tovarishNetworks=[]}})))}const E=[{ensName:"tornadowithdraw.eth",relayerAddress:"0x40c3d1656a26C9266f4A10fed0D87EFf79F54E64",hostnames:{},tovarishHost:"tornadowithdraw.com",tovarishNetworks:h.Af}];class C extends g{Aggregator;relayerEnsSubdomains;updateInterval;constructor(e){const{RelayerRegistry:a,Aggregator:t,relayerEnsSubdomains:c}=e;super({...e,contract:a,type:"*"}),this.Aggregator=t,this.relayerEnsSubdomains=c,this.updateInterval=86400}getInstanceName(){return`registry_${this.netId}`}getTovarishType(){return"registry"}async formatEvents(e){const a=[],t=[],c=[],f=[];return e.forEach((({blockNumber:e,index:d,transactionHash:n,args:i,eventName:b})=>{const o={blockNumber:e,logIndex:d,transactionHash:n,event:b};if("RelayerRegistered"===b){const{relayer:e,ensName:t,relayerAddress:c,stakedAmount:f}=i;a.push({...o,ensName:t,relayerAddress:c,ensHash:e,stakedAmount:(0,r.ck)(f)})}if("RelayerUnregistered"===b){const{relayer:e}=i;t.push({...o,relayerAddress:e})}if("WorkerRegistered"===b){const{relayer:e,worker:a}=i;c.push({...o,relayerAddress:e,workerAddress:a})}if("WorkerUnregistered"===b){const{relayer:e,worker:a}=i;f.push({...o,relayerAddress:e,workerAddress:a})}})),[...a,...t,...c,...f]}async getRelayersFromDB(){return{lastBlock:0,timestamp:0,relayers:[]}}async getRelayersFromCache(){return{lastBlock:0,timestamp:0,relayers:[],fromCache:!0}}async getSavedRelayers(){let e=await this.getRelayersFromDB();return e&&e.relayers.length||(e=await this.getRelayersFromCache()),e}async getLatestRelayers(){const{events:e,lastBlock:a}=await this.updateEvents(),t=e.filter((e=>"RelayerRegistered"===e.event)),c=Object.values(this.relayerEnsSubdomains),f=new Set,d=t.filter((({ensName:e})=>!f.has(e)&&(f.add(e),!0))),i=d.map((e=>(0,n.kM)(e.ensName))),[b,o]=await Promise.all([this.Aggregator.relayersData.staticCall(i,c.concat("tovarish-relayer")),this.provider.getBlock(a).then((e=>Number(e?.timestamp)))]),s=b.map((({owner:e,balance:a,records:t,isRegistered:c},f)=>{const{ensName:n,relayerAddress:i}=d[f];let b;const o=t.reduce(((e,a,c)=>{if(a){if(c===t.length-1)return b=a,e;e[Number(Object.keys(this.relayerEnsSubdomains)[c])]=a}return e}),{}),s=a>=p.pO;if(Object.keys(o).length&&c&&s)return{ensName:n,relayerAddress:e,registeredAddress:e!==i?i:void 0,isRegistered:c,stakeBalance:(0,r.ck)(a),hostnames:o,tovarishHost:b}})).filter((e=>e));await I(this,s);const l=[...E,...s];return{lastBlock:a,timestamp:o,relayers:[...l.filter((e=>e.tovarishHost)),...l.filter((e=>!e.tovarishHost))]}}async saveRelayers({lastBlock:e,timestamp:a,relayers:t}){}async updateRelayers(){let{lastBlock:e,timestamp:a,relayers:t,fromCache:c}=await this.getSavedRelayers(),f=c??!1;return(!t.length||a+this.updateIntervale)))]),t=await this.batchTransactionService.getBatchReceipt([...new Set(e.map((({transactionHash:e})=>e)))]),c=new Set(e.map((({args:e})=>e.relayer))),f=s.createInterface(),d=f.getEvent("Withdrawal").topicHash,r=t.map((e=>e.logs.map((t=>{if(t.topics[0]===d){const d=a.find((e=>e.number===t.blockNumber)),r=f.parseLog(t);if(r&&c.has(r.args.relayer))return{instanceAddress:t.address,gasFee:(e.cumulativeGasUsed*e.gasPrice).toString(),relayerFee:r.args.fee.toString(),timestamp:d?.timestamp||0}}})).filter((e=>e)))).flat();return r.length!==e.length&&console.log(`\nRevenueService: Mismatch on withdrawal logs (${r.length} ) and events logs (${e.length})\n`),e.map((({blockNumber:e,index:a,transactionHash:t,args:c},f)=>{const d={blockNumber:e,logIndex:a,transactionHash:t},{relayer:n,amountBurned:i}=c,{instanceAddress:b,gasFee:o,relayerFee:s,timestamp:l}=r[f];return{...d,relayerAddress:n,amountBurned:i.toString(),instanceAddress:b,gasFee:o,relayerFee:s,timestamp:l}}))}}},12591:(e,a,t)=>{"use strict";t.d(a,{$B:()=>l,Aq:()=>u,Fb:()=>n,Oz:()=>b,f8:()=>o,hD:()=>h,w8:()=>i,wV:()=>p,xc:()=>s});var c=t(18995),f=t(67418),d=t(46170),r=t(96221);async function n({idb:e,instanceName:a,events:t,lastBlock:c}){try{const f=t.map((e=>({eid:`${e.transactionHash}_${e.logIndex}`,...e})));await e.createMultipleTransactions({data:f,storeName:a}),await e.putItem({data:{blockNumber:c,name:a},storeName:"lastEvents"})}catch(e){console.log("Method saveDBEvents has error"),console.log(e)}}async function i({idb:e,instanceName:a}){try{const t=await e.getItem({storeName:"lastEvents",key:a});return t?.blockNumber?{events:(await e.getAll({storeName:a})).map((e=>(delete e.eid,e))),lastBlock:t.blockNumber}:{events:[],lastBlock:0}}catch(e){return console.log("Method loadDBEvents has error"),console.log(e),{events:[],lastBlock:0}}}async function b({staticUrl:e,instanceName:a,deployedBlock:t,zipDigest:f}){try{const d=`${a}.json`.toLowerCase(),r=await(0,c._6)({staticUrl:e,zipName:d,zipDigest:f});if(!Array.isArray(r)){const a=`Invalid events from ${e}/${d}`;throw new Error(a)}return{events:r,lastBlock:r[r.length-1]?.blockNumber||t,fromCache:!0}}catch(e){return console.log("Method loadRemoteEvents has error"),console.log(e),{events:[],lastBlock:t,fromCache:!0}}}class o extends r.e0{staticUrl;idb;zipDigest;constructor(e){super(e),this.staticUrl=e.staticUrl,this.idb=e.idb}async getEventsFromDB(){return await i({idb:this.idb,instanceName:this.getInstanceName()})}async getEventsFromCache(){return await b({staticUrl:this.staticUrl,instanceName:this.getInstanceName(),deployedBlock:this.deployedBlock,zipDigest:this.zipDigest})}async saveEvents({events:e,lastBlock:a}){await n({idb:this.idb,instanceName:this.getInstanceName(),events:e,lastBlock:a})}}class s extends r.GS{staticUrl;idb;zipDigest;constructor(e){super(e),this.staticUrl=e.staticUrl,this.idb=e.idb}async getEventsFromDB(){return await i({idb:this.idb,instanceName:this.getInstanceName()})}async getEventsFromCache(){return await b({staticUrl:this.staticUrl,instanceName:this.getInstanceName(),deployedBlock:this.deployedBlock,zipDigest:this.zipDigest})}async saveEvents({events:e,lastBlock:a}){await n({idb:this.idb,instanceName:this.getInstanceName(),events:e,lastBlock:a})}}class l extends r.O_{staticUrl;idb;zipDigest;constructor(e){super(e),this.staticUrl=e.staticUrl,this.idb=e.idb}async getEventsFromDB(){return await i({idb:this.idb,instanceName:this.getInstanceName()})}async getEventsFromCache(){return await b({staticUrl:this.staticUrl,instanceName:this.getInstanceName(),deployedBlock:this.deployedBlock,zipDigest:this.zipDigest})}async saveEvents({events:e,lastBlock:a}){await n({idb:this.idb,instanceName:this.getInstanceName(),events:e,lastBlock:a})}}class u extends r.JJ{staticUrl;idb;zipDigest;constructor(e){super(e),this.staticUrl=e.staticUrl,this.idb=e.idb}async getEventsFromDB(){return await i({idb:this.idb,instanceName:this.getInstanceName()})}async getEventsFromCache(){return await b({staticUrl:this.staticUrl,instanceName:this.getInstanceName(),deployedBlock:this.deployedBlock,zipDigest:this.zipDigest})}async saveEvents({events:e,lastBlock:a}){await n({idb:this.idb,instanceName:this.getInstanceName(),events:e,lastBlock:a})}}class h extends r.cE{staticUrl;idb;zipDigest;relayerJsonDigest;constructor(e){super(e),this.staticUrl=e.staticUrl,this.idb=e.idb}async getEventsFromDB(){return await i({idb:this.idb,instanceName:this.getInstanceName()})}async getEventsFromCache(){return await b({staticUrl:this.staticUrl,instanceName:this.getInstanceName(),deployedBlock:this.deployedBlock,zipDigest:this.zipDigest})}async saveEvents({events:e,lastBlock:a}){await n({idb:this.idb,instanceName:this.getInstanceName(),events:e,lastBlock:a})}async getRelayersFromDB(){try{const e=await this.idb.getAll({storeName:`relayers_${this.netId}`});return e?.length?e.slice(-1)[0]:{lastBlock:0,timestamp:0,relayers:[]}}catch(e){return console.log("Method getRelayersFromDB has error"),console.log(e),{lastBlock:0,timestamp:0,relayers:[]}}}async getRelayersFromCache(){const e=`${this.staticUrl}/relayers.json`;try{const a=await(0,d.Fd)(e,{method:"GET",returnResponse:!0}),t=new Uint8Array(await a.arrayBuffer());if(this.relayerJsonDigest){const a="sha384-"+(0,f.if)(await(0,f.br)(t));if(a!==this.relayerJsonDigest){const t=`Invalid digest hash for ${e}, wants ${this.relayerJsonDigest} has ${a}`;throw new Error(t)}}return JSON.parse((new TextDecoder).decode(t))}catch(e){return console.log("Method getRelayersFromCache has error"),console.log(e),{lastBlock:0,timestamp:0,relayers:[]}}}async saveRelayers(e){try{await this.idb.putItem({data:e,storeName:`relayers_${this.netId}`})}catch(e){console.log("Method saveRelayers has error"),console.log(e)}}}class p extends r.Do{staticUrl;idb;zipDigest;relayerJsonDigest;constructor(e){super(e),this.staticUrl=e.staticUrl,this.idb=e.idb}async getEventsFromDB(){return await i({idb:this.idb,instanceName:this.getInstanceName()})}async getEventsFromCache(){return await b({staticUrl:this.staticUrl,instanceName:this.getInstanceName(),deployedBlock:this.deployedBlock,zipDigest:this.zipDigest})}async saveEvents({events:e,lastBlock:a}){await n({idb:this.idb,instanceName:this.getInstanceName(),events:e,lastBlock:a})}}},94513:(e,a,t)=>{"use strict";t.r(a),t.d(a,{BaseEchoService:()=>d.GS,BaseEncryptedNotesService:()=>d.O_,BaseEventsService:()=>d.uw,BaseGovernanceService:()=>d.JJ,BaseMultiTornadoService:()=>d.lG,BaseRegistryService:()=>d.cE,BaseRevenueService:()=>d.Do,BaseTornadoService:()=>d.e0,DBEchoService:()=>r.xc,DBEncryptedNotesService:()=>r.$B,DBGovernanceService:()=>r.Aq,DBRegistryService:()=>r.hD,DBRevenueService:()=>r.wV,DBTornadoService:()=>r.f8,getTovarishNetworks:()=>d.EU,loadDBEvents:()=>r.w8,loadRemoteEvents:()=>r.Oz,proposalState:()=>d.sf,saveDBEvents:()=>r.Fb});var c=t(61060),f={};for(const e in c)"default"!==e&&(f[e]=()=>c[e]);t.d(a,f);var d=t(96221),r=t(12591)},61060:()=>{},37182:(e,a,t)=>{"use strict";t.d(a,{N:()=>d,o:()=>r});var c=t(99770),f=t(79453);function d(e,a,t=18){const c=BigInt(10**Number(t));return BigInt(e)*c/BigInt(a)}class r{provider;ovmGasPriceOracle;constructor(e,a){this.provider=e,a&&(this.ovmGasPriceOracle=a)}async gasPrice(){const[e,a,t]=await Promise.all([this.provider.getBlock("latest"),(async()=>{try{return BigInt(await this.provider.send("eth_gasPrice",[]))}catch{return(0,c.XS)("1","gwei")}})(),(async()=>{try{return BigInt(await this.provider.send("eth_maxPriorityFeePerGas",[]))}catch{return BigInt(0)}})()]);return e?.baseFeePerGas?e.baseFeePerGas*BigInt(15)/BigInt(10)+t:a}fetchL1OptimismFee(e){return this.ovmGasPriceOracle?(e||(e={type:0,gasLimit:1e6,nonce:1024,data:"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111",gasPrice:(0,c.XS)("1","gwei"),to:"0x1111111111111111111111111111111111111111"}),this.ovmGasPriceOracle.getL1Fee.staticCall(f.Z.from(e).unsignedSerialized)):new Promise((e=>e(BigInt(0))))}defaultEthRefund(e,a){return(e?BigInt(e):(0,c.XS)("30","gwei"))*BigInt(a||1e6)}calculateTokenAmount(e,a,t){return d(e,a,t)}calculateRelayerFee({gasPrice:e,gasLimit:a=6e5,l1Fee:t=0,denomination:c,ethRefund:f=BigInt(0),tokenPriceInWei:r,tokenDecimals:n=18,relayerFeePercent:i=.33,isEth:b=!0,premiumPercent:o=20}){const s=BigInt(e)*BigInt(a)+BigInt(t),l=BigInt(c)*BigInt(Math.floor(1e4*i))/BigInt(1e6);return b?(s+l)*BigInt(o?100+o:100)/BigInt(100):(d(s+BigInt(f),r,n)+l)*BigInt(o?100+o:100)/BigInt(100)}}},56079:(e,a,t)=>{"use strict";t.d(a,{Qx:()=>r,X:()=>i,dT:()=>d,x5:()=>n});var c=t(41442),f=t(59499);const d={[f.zr.MAINNET]:"0x391E7C679d29bD940d63be94AD22A25d25b5A604",[f.zr.BSC]:"0x391E7C679d29bD940d63be94AD22A25d25b5A604",[f.zr.POLYGON]:"0x391E7C679d29bD940d63be94AD22A25d25b5A604",[f.zr.OPTIMISM]:"0x391E7C679d29bD940d63be94AD22A25d25b5A604",[f.zr.ARBITRUM]:"0x391E7C679d29bD940d63be94AD22A25d25b5A604",[f.zr.GNOSIS]:"0x391E7C679d29bD940d63be94AD22A25d25b5A604",[f.zr.AVALANCHE]:"0x391E7C679d29bD940d63be94AD22A25d25b5A604"},r={[f.zr.MAINNET]:255,[f.zr.BSC]:14,[f.zr.POLYGON]:17,[f.zr.OPTIMISM]:55,[f.zr.ARBITRUM]:57,[f.zr.GNOSIS]:16,[f.zr.AVALANCHE]:15,[f.zr.SEPOLIA]:102};function n(e,a){let t="0x";if((0,c.PW)(e)){if(42!==e.length)return null;t+="02",t+=e.slice(2)}else t+="01";for(const e in a)t+=Number(a[e]).toString(16).padStart(4,"0");return t}function i(e){return{min:1/e,max:50/e,ethUsd:e}}},49540:(e,a,t)=>{"use strict";t.d(a,{B:()=>c,l:()=>f});const c="0x38600c600039612b1b6000f3606460006000377c01000000000000000000000000000000000000000000000000000000006000510463f47d33b5146200003557fe5b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000016004518160245181838180828009800909089082827f0fbe43c36a80e36d7c7c584d4f8f3759fb51f0d66065d8a227b688d12488c5d408839081808280098009098391089082827f9c48cd3e00a6195a253fc009e60f249456f802ff9baf6549210d201321efc1cc08839081808280098009098391089082827f27c0849dba2643077c13eb42ffb97663cdcecd669bf10f756be30bab71b86cf808839081808280098009098391089082827f2bf76744736132e5c68f7dfdd5b792681d415098554fd8280f00d11b172b80d208839081808280098009098391089082827f33133eb4a1a1ab45037c8bdf9adbb2999baf06f20a9c95180dc4ccdcbec5856808839081808280098009098391089082827f588bb66012356dbc9b059ef1d792b563d6c18624dddecc3fe4583fd3551e9b3008839081808280098009098391089082827f71bc3e244e1b92911fe7f53cf523e491fd6ff487d59337a1d92f92668c4f4c3608839081808280098009098391089082827fd1808e2b039fd010c489768f78d7499938ccc0858f3295151787cfe8b7e40be108839081808280098009098391089082827f76978af3ded437cf41b3faa40cd6bcfce94f27f4abcc3ed34be19abd2c4537d008839081808280098009098391089082827f0a9baee798a320b0ca5b1cf888386d1dc12c13b38e10225aa4e9f03069a099f508839081808280098009098391089082827fb79dbf6050a03b16c3ade8d77e11c767d2251af9cdbd6cdf9a8a0ee921b32c7908839081808280098009098391089082827fa74bbcf5067f067faec2cce4b98d130d7927456f5c5f6c00e0f5406a24eb8b1908839081808280098009098391089082827fab7ab080d4c4018bda6ecc8bd67468bc4619ba12f25b0da879a639c758c8855d08839081808280098009098391089082827fe6a5b797c2bba7e9a873b37f5c41adc47765e9be4a1f0e0650e6a24ad226876308839081808280098009098391089082827f6270ae87cf3d82cf9c0b5f428466c429d7b7cbe234cecff39969171af006016c08839081808280098009098391089082827f9951c9f6e76d636b52f7600d979ca9f3b643dfbe9551c83b31542830321b2a6608839081808280098009098391089082827f4119469e44229cc40c4ff555a2b6f6b39961088e741e3c20a3c9b47f130c555008839081808280098009098391089082827f5d795e02bbaf90ff1f384741e5f18f8b644a0080441315d0e5b3c8123452a0b008839081808280098009098391089082827f281e90a515e6409e9177b4f297f8049ce3d4c3659423c48b3fd64e83596ff10108839081808280098009098391089082827f424185c60a21e84970f7d32cacaa2725aa8a844caea7ed760d2b965af1bf3e7d08839081808280098009098391089082827fd96fcbc3960614ea887da609187a5dada2e1b829f23309a6375212cea1f25c0908839081808280098009098391089082827ffde84026d7c294300af18f7712fc3662f43387ae8cf7fdda1f9a810f4b24bcf208839081808280098009098391089082827f3a9d568575846aa6b8a890b3c237fd0447426db878e6e25333b8eb9b386195c108839081808280098009098391089082827f55a2aa32c84a4cae196dd4094b685dd11757470a3be094d98eea73f02452aa3608839081808280098009098391089082827fcbc9481380978d29ebc5b0a8d4481cd2ef654ee800907adb3d38dc2fd9265fab08839081808280098009098391089082827f24e53af71ef06bacb76d3294c11223911e9d177ff09b7009febc484add0beb7408839081808280098009098391089082827fdbd44e16108225766dac3e5fe7acbe9df519bbba97380e5e9437a90658f2139308839081808280098009098391089082827fc6f434863c79013bb2c202331e04bccea2251c1ff6f191dc2afa23e6f6d28e4e08839081808280098009098391089082827f3490eeb39a733c0e8062d87f981ae65a8fccf25c448f4455d27db3915351b06608839081808280098009098391089082827f30b89830ff7ade3558a5361a24869130ce1fcce97211602962e34859525dac4f08839081808280098009098391089082827f29bae21b579d080a75c1694da628d0ecfd83efc9c8468704f410300062f64ca908839081808280098009098391089082827fe326499de0476e719915dd1c661ef4550723d4aee9ee9af224edd208790fce4408839081808280098009098391089082827f8c45208b8baa6f473821415957088c0b7e72a465f460b09ece2d270aee2f184108839081808280098009098391089082827ffe2ad454f451348f26ce2cc7e7914aef3eb96e8f89a4619a1dc7d11f8401c35208839081808280098009098391089082827f0929db368ef2af2d29bca38845325b0b7a820a4889e44b5829bbe1ed47fd4d5208839081808280098009098391089082827f16531d424b0cbaf9abbf2d2acde698462ea4555bf32ccf1bbd26697e905066f608839081808280098009098391089082827ff5c30d247f045ff6d05cf0dd0a49c9823e7a24b0d751d3c721353b96f29d76f608839081808280098009098391089082827f6eb7a3614056c230c6f171370fdd9d1048bb00b2cdd1b2721d11bdda5023f48608839081808280098009098391089082827f0ee9c4621642a272f710908707557498d25a6fdd51866da5d9f0d205355a618908839081808280098009098391089082827f78ca1cb1c7f6c6894d1cf94f327b8763be173151b6b06f99dfc6a944bb5a72f008839081808280098009098391089082827f5d24d0b1b304d05311ce0f274b0d93746a4860ed5cdd8d4348de557ea7a5ee7a08839081808280098009098391089082827f77423dabd1a3cddc8691438fc5891e3fd49ac0f3e21aaf249791bfde1303d2f308839081808280098009098391089082827f0642e8800a48cc04c0168232c6f542396597a67cf395ad622d947e98bb68697a08839081808280098009098391089082827fc1e7d3cbbc4c35b7490647d8402e56d334336943bda91fe2d34ca9727c0e3df508839081808280098009098391089082827f8d6fb1730335204f38f85e408ac861e76f24349ab6ee0469c22e19350bb24fe108839081808280098009098391089082827f67d0faf5f0db32a1b60e13dc4914246b9edac7990fb4990b19aa86815586441a08839081808280098009098391089082827f2605b9b909ded1b04971eae979027c4e0de57f3b6a60d5ed58aba619c34749ce08839081808280098009098391089082827fd276890b2c205db85f000d1f5111ed8f177e279cae3e52862780f04e846228d008839081808280098009098391089082827f2ac5905f9450a21ef6905ed5951a91b3730e3a2e2d62b50bdeb810015d50376b08839081808280098009098391089082827f7a366839f0291ca54da674ac3f0e1e9aa8b687ba533926cb40268039e57b967a08839081808280098009098391089082827f67ab0f3466989c3dbbe209c37ec272ba83984ba6e445be6d472b63e3ca7270e308839081808280098009098391089082827f0e786007d0ce7e28a90e31d3263887d40c556dec88fcb8b56bc9e9c05ecc0c2908839081808280098009098391089082827f0b814ed99bd00eca389b0022663dbfddfbfa15e321c19abcf1eaf9556075fb6808839081808280098009098391089082827f65c0321ba26fcee4fdc35b4999b78ceb54dcaf9fec2e3bdea98e9f82925c093208839081808280098009098391089082827fab2d2a929601f9c3520e0b14aaa6ba9f1e79821a5b768919670a4ea970722bf408839081808280098009098391089082827fcdd2e0744d4af1a81918de69ec12128a5871367303ff83ed764771cbbdf6502308839081808280098009098391089082827f74527d0c0868f2ec628086b874fa66a7347d3d3b918d2e07a5f33e1067e8ac5808839081808280098009098391089082827f1c6bf6ac0314caead23e357bfcbbaa17d670672ae3a475f80934c716f10aca2508839081808280098009098391089082827f3c4007e286f8dc7efd5d0eeb0e95d7aa6589361d128a0cccb17b554c851a643208839081808280098009098391089082827fae468a86a5a7db7c763a053eb09ac1a02809ce095258c88101ee319e12b0697e08839081808280098009098391089082827f9333e3d052b7c77fcac1eb366f610f6f97852242b1317a87b80f3bbc5c8c2d1d08839081808280098009098391089082827f52ec1d675cf5353153f6b628414783ca6b7fc0fe01948ca206daad712296e39508839081808280098009098391089082827f13ceeeb301572b4991076750e11ea7e7fcbfee454d90dc1763989004a1894f9308839081808280098009098391089082827f8505737e7e94939a08d8cda10b6fbbbf879b2141ae7eabc30fcd22405135fe6408839081808280098009098391089082827f6127db7ac5200a212092b66ec2bfc63653f4dc8ac66c76008fef885258a258b508839081808280098009098391089082827f12692a7d808f44e31d628dbcfea377eb073fb918d7beb8136ea47f8cf094c88c08839081808280098009098391089082827f260e384b1268e3a347c91d6987fd280fa0a275541a7c5be34bf126af35c962e008839081808280098009098391089082827fd88c3b01966d90e713aee8d482ceaa6925311d2342e1a5aca4fcd2f44b6daddc08839081808280098009098391089082827fb87e868affd91b078a87fa75ac9332a6cf23587d94e20c3262db5e91f30bf04b08839081808280098009098391089082827fb5ba5f8acad1a950a3bbf2201055cd3ea27056c0c53f0c4c97f33cda8dbfe90908839081808280098009098391089082827f59ca814b49e00d7b3118c53a2986ded128584acd7428735e08ade6661c457f7508839081808280098009098391089082827f0fc4c0bea813a223fd510c07f7bbe337badd4bcf28649a0d378970c2a15b3aa508839081808280098009098391089082827f0053f1ea6dd60e7a6db09a00be77549ff3d4ee3737be7fb42052ae1321f667c308839081808280098009098391089082827feb937077bb10c8fe38716d4e38edc1f9e7b18c6414fef85fe7e9c5567baa4a0408839081808280098009098391089082827fbacb14c0f1508d828f7fd048d716b8044aec7f0fb48e85e717bf532db972520708839081808280098009098391089082827f4ca0abb8beb7cff572a0c1e6f58e080e1bb243d497a3e74538442a4555ad40be08839081808280098009098391089082827fda9eefd411e590d7e44592cce298af87b2c62aa3cc8bb137aa99ca8d4aa551b508839081808280098009098391089082827f153dae43cef763e7a2fc9846f09a2973b0ad9c35894c220699bcc2954501c6bd08839081808280098009098391089082827fd4ed2a09375813b4fb504c7a9ba13110bdd8549a47349db82c15a434c090e87b08839081808280098009098391089082827f0063a5c4c9c12dcf4bae72c69f3a225664469503d61d9eae5d9553bfb006095b08839081808280098009098391089082827fdc8a4d35ad28e59dd3713b45985cd3b70e37ccc2be42086f1ea078fe2dc9d82d08839081808280098009098391089082827f486ba219308f0c847b22fcb4449f8855192536c01b8057904e81c1c7814f483b08839081808280098009098391089082827f34d9604140a1ac9fdb204285b9fe1b303c281af2fc5fb362f6577282b423bcf308839081808280098009098391089082827fc1681959ec4bc3656911db2b2f56aa4db709c26f1a0a25c879286e37f437465d08839081808280098009098391089082827ffcd849f3b5f9e4368af75619fb27f2e335adbb9b44988f17c4d389fa751ad47a08839081808280098009098391089082827ff5f7fc22ad64c8e7c1e005110e13f4f1c6b1f8f8cc59000db0e3bb38f99554a508839081808280098009098391089082827fa9133b8a20fbae4633ec5f82cb47a38ae1877d12d1febb23982c7c808aa5317508839081808280098009098391089082827ff4827c5c7b61141cc31b75984bb3ed16ed579e5b72e32a1289b63ab55eaf8c1208839081808280098009098391089082827fcca361819ffefe3e50fe34c91a322c9405f4e5a168c1fc0a0a1883993e32c9f408839081808280098009098391089082827f6656088842bfc9e325a532784d3362cecfa86f9c7b208a6b499836ebe48ff15708839081808280098009098391089082827f00129c7cd00e42ed05a37dbceb80d47b65e1d750ef2148278a54723fdf42c4cc08839081808280098009098391089082827fa85b235631b786f85cd46f7768f6c71ae004ad267ae59bdf929ada149b19588808839081808280098009098391089082827f34df65a82686be09c5b237911abf237a9887c1a418f279ac79b446d7d311f5ea08839081808280098009098391089082827f815a850c3989df9ca6231e0bdd9916fc0e076f2c6c7f0f260a846d0179f9c32d08839081808280098009098391089082827f50fb0940848a67aee83d348421fadd79aefc7a2adabeec6e64904ebe1bf63e7d08839081808280098009098391089082827fbab63a16273599f8b66895461e62a19ff0d103693be771d93e3691bba89cdd8d08839081808280098009098391089082827f6931a091756e0bc709ebecfffba5038634c5b3d5d0c5876dd72aac67452db8a208839081808280098009098391089082827f55559b8bb79db8809c46ee627f1b5ce1d8e6d89bf94a9987a1407759d1ba896308839081808280098009098391089082827fa9a1a11b2979018cb155914d09f1df19b7ffec241e8b2487b6f6272a56a44a0a08839081808280098009098391089082827ff83293400e7bccea4bb86dcb0d5ca57fa2466e13a572d7d3531c6fa491cb0f1b08839081808280098009098391089082827fb7cb5742b6bc5339624d3568a33c21f31b877f8396972582028da999abf249f208839081808280098009098391089082827ff56efb400f8500b5c5bf811c65c86c7ed2e965f14f1a69bca436c0c60b79f46508839081808280098009098391089082827fd7c4427998d9c440f849dcd75b7157996eaad1b9a1d58cc2441931300e26eb2208839081808280098009098391089082827fca5ed18ad53e33fdc3ae8cf353ff3f6dd315f60060442b74f6b614b24ebd4cc308839081808280098009098391089082827f9ad3e9376c97b194a0fbf43e22a3616981d777365c765ead09a1d033fdf536b708839081808280098009098391089082827fc6daeff5769a06b26fe3b8fef30df07b1387373a7814cef364fe1d6059eaf54a08839081808280098009098391089082827fc20a78398345c6b8cf439643dab96223bf879c302648293eaf496fee5c978c6608839081808280098009098391089082827f589ca65b6cf0e90653c06dddc057dc61ba2839974569051c98b43e8618716efb08839081808280098009098391089082827f83064161f127d8c59fc73625957e21630dc6dc99e5443f6ce37ecd6bf28e69b708839081808280098009098391089082827f46d0ba662b50100b9a3af52052f68932feec1d12290b2033c4f49148893d8ba308839081808280098009098391089082827f18dd55b4a83a53f2ee578eb3e6d26f594824d44670fc3f4de80642344d15c09a08839081808280098009098391089082827f9fb5b594f48bc58b345ab90ded705920a7274b8e070eee8ce8cf90c72c3604b608839081808280098009098391089082827f1901d8f4f2c8449128e00663978f2050f2eb1cd6acb60d9d09c57c5d46ee54fe08839081808280098009098391089082827f5ec56789beab24ef7ee32f594d5fc561ec59dfeb93606dc7dcc6fe65133a7db408839081808280098009098391089082827f01c0b2cbe4fa9877a3d08eb67c510e8630da0a8beda94a6d9283e6f70d268bc508839081808280098009098391089082827f0b1d85acd9031a9107350eed946a25734e974799c5ba7cff13b15a5a623a25f008839081808280098009098391089082827f204497d1d359552905a2fe655f3d6f94926ea92d12cdaa6556ec26362f239f6408839081808280098009098391089082827fe075f7edc6631a8d7ffe33019f44fc91f286236d5a5f90f16de4791b72a2a5f008839081808280098009098391089082827f243f46e353354256ab8fe0ca4e9230dfc330bc163e602dfeaf307c1d1a7264b908839081808280098009098391089082827fd448ae5e09625fa1fcfd732fc9cd8f06e4c33b81f0a9240c83da56f41e9ecceb08839081808280098009098391089082827f2f312eef69a33d9fa753c08840275692a03432b3e6da67f9c59b9f9f4971cd5608839081808280098009098391089082827f5f333996af231bd5a293137da91801e191a6f24eb532ad1a7e6e9a2ad0efbc0008839081808280098009098391089082827fa8f771e0383a832dc8e2eaa8efabda300947acaf0684fabddf8b4abb0abd8a6208839081808280098009098391089082827f9ff0b3d7a4643596f651b70c1963cc4fa6c46018d78f05cb2c5f187e25df83a908839081808280098009098391089082827f9c373b704838325648273734dcdf962d7c156f431f70380ba4855832c4a238b808839081808280098009098391089082827fea2afa02604b8afeeb570f48a0e97a5e6bfe9613394b9a6b0026ecd6cec8c33a08839081808280098009098391089082827f68892258cd8eb43b71caa6d6837ec9959bfdfd72f25c9005ebaffc4011f8a7bf08839081808280098009098391089082827ff2824f561f6f82e3c1232836b0d268fa3b1b5489edd39a5fe1503bfc7ca91f4908839081808280098009098391089082827f164eda75fda2861f9d812f24e37ac938844fbe383c243b32b9f66ae2e76be71908839081808280098009098391089082827ff0a6fc431f5bf0dd1cca93b8b65b3f72c91f0693e2c74be9243b15abb31afcc008839081808280098009098391089082827fe68db66ba891ef0cd527f09ec6fff3ec0a269cf3d891a35ec13c902f70334b4f08839081808280098009098391089082827f3a44a5b102f7883a2b8630a3cae6e6db2e6e483bb7cfeb3492cbd91793ef598e08839081808280098009098391089082827f43939fe8ef789acb33cbf129ba8a3aa1bd61510a178022a05177c9c5a1c59bf108839081808280098009098391089082827f936fe3b66dfda1bc5a7aae241b4db442858bd720c1d579c0c869f273cd55d77408839081808280098009098391089082827f3490fcaa8ffa37f35dc67ae006e81352c7103945417b8e4b142afcaefa344b8508839081808280098009098391089082827fcae66096cff344caca53ffe0e58aafeb468bd174f00d8abc425b2099c088187408839081808280098009098391089082827fc7d05783a41bc14f3c9a45384b6d5e2547c5b6a224c8316910b208f2718a70ab08839081808280098009098391089082827f5ac6b9ba94040d5692b865b6677b60ef3201b5c2121699f70beb9f9b2528a02608839081808280098009098391089082827fa902a3d4d9ecbfb9b2c76fddf780554bf93cad97b244e805d3adb94e1816290008839081808280098009098391089082827fe9df91ffeeb086a4d26041c29dac6fca1d56a4d022fe34b38831267395b98d2708839081808280098009098391089082827f862646f851d91a8840ad9ee711f12ec13b3e8f980ff5ef5ee43ca4520d57def708839081808280098009098391089082827f30b7381c9725b9db07816baf8524943a79cea135807c84cce0833485c11e0c2e08839081808280098009098391089082827f96afc10c5cedaddbda99df79387397c9be74a5b50f3a0c04ccb68d4e0f3a989f08839081808280098009098391089082827f3543da80d10da251c548776fe907c4ef89993d62e0062ae5c0496fcb851c366108839081808280098009098391089082827fe5140fe26d8b008430fccd50a68e3e11c1163d63b6d8b7cc40bc6f3c1d0b1b0608839081808280098009098391089082827ffefdf1872e4475e8bbb0ef6fab7f561bff121314695c433bd4c29ec118060c9608839081808280098009098391089082827f6bb8c9f3d57b18e002df059db1e6a5d42ad566f153f18460774f68ac2650940008839081808280098009098391089082827f5415122d50b26f4fab5784004c56cf03f128f825ad2236f4b3d51f74737bd97308839081808280098009098391089082827f00e115c4a98efae6a3a5ecc873b0cef63ccd5b515710a3ab03ec52218f784dc908839081808280098009098391089082827fda7d525427bad87b88238657c21331245578bc76aa6240b7f972382537a202ab08839081808280098009098391089082827f83332e8b34505b83010270dc795290a2f515b8f89c163acecdf4799df04c62f808839081808280098009098391089082827fb09ecb6033d1a065f17a61066cd737d0c3c5873b51c3ab0a285e26939e62aa1808839081808280098009098391089082827f24e65c718938c2b937378e7435332174329730bde85a4185e37875824eb4985908839081808280098009098391089082827f68e41430ccd41cc5e92a9f9acd2e955c1385b9f5ed8d3f133d767429484a8eba08839081808280098009098391089082827fc038fe9d0125ab8be54545276f841274e414c596ed4c9eaa6919604603d1ffa908839081808280098009098391089082827f23248698612cd8e83234fcf5db9b6b225f4b0ba78d72ef13ea1edff5f0fb029808839081808280098009098391089082827fd2a9fa3d39c1ba91eefa666a1db71c6e0e4e3b707626b0197a4e59e7110cf0d408839081808280098009098391089082827fc28931ee7dfa02b62872e0d937ba3dc5c637118273a1f1f0c4fc880905c82efc08839081808280098009098391089082827f01cd399556445e3d7b201d6c5e56a5794e60be2cfd9a4643e7ead79bb4f60f7908839081808280098009098391089082827fac855cc58d5fbb0dff91a79683eb0e914c1b7d8d0a540d416838a89f83a8312f08839081808280098009098391089082827ff7798af7ccf36b836705849f7dd40328bf9346657255b431446ec75a6817181608839081808280098009098391089082827fe52a24c92d3f067bf551eeaf98c62ba525e84882d7adad835fad8de72986b2b108839081808280098009098391089082827fffc8682759a2bf1dd67c87a77c285467801f1c44fd78fa4eb5957a4832c9d72d08839081808280098009098391089082827f1482ac3e7e4f321627850d95a13942aea6d2923402b913046856ff7e8aaf9aff08839081808280098009098391089082827f17332b4c7aac2a07ccfe954de7ad22ccf6fcb4c5fa15c130ed22a40ae9398f4708839081808280098009098391089082827fd4be0546013f84a0d1e118b37589723b58e323983263616d1b036f8b3fdd858308839081808280098009098391089082827fa64ec737d31dddf939b184438ccdd3e1d3e667572857cd6c9c31a0d1d9b7b08508839081808280098009098391089082827f8ad12fbc74117cff4743d674539c86548c6758710a07a6abe3715e4b53526d3408839081808280098009098391089082827f15a16435a2300b27a337561401f06682ba85019aa0af61b264a1177d38b5c13c08839081808280098009098391089082827f22616f306e76352293a22ab6ee15509d9b108d4136b32fa7f9ed259793f392a108839081808280098009098391089082827f519727b25560caf00ce0d3f911bd4356f907160ab5186da10a629c7ccae1851e08839081808280098009098391089082827fcff39e77928ce9310118d50e29bc87e7f78b53ad51366359aa17f07902ae639208839081808280098009098391089082827f17dead3bfa1968c744118023dead77cdbee22c5b7c2414f5a6bdf82fd94cf3ad08839081808280098009098391089082827f2bef0f8b22a1cfb90100f4a552a9d02b772130123de8144a00c4d57497e1d7f408839081808280098009098391089082827fbf5188713fef90b31c35243f92cfa4331ab076e30e24b355c79b01f41d152a1108839081808280098009098391089082827f3baadd2fd92e3e12fb371be0578941dc0a108fbca0a7d81b88316fb94d6b4dfe08839081808280098009098391089082827fd4f955742e20a28d38611bf9fc4a478c97b673a7cd40d0113a58a1efe338d9aa08839081808280098009098391089082827f3c1c3fe9a5f7ccd54ad5a51a224b3f94775266d19c3733017e4920d7391ad64508839081808280098009098391089082827f6372df6148abeed66fda5461779a9651130c6c525df733852bcd929016768a7a08839081808280098009098391089082827f6d098e848fb853f95adb5a6364b5ab33c79fb08877f2cf3e0e160d9fcb3ebcc508839081808280098009098391089082827f48c5fc90f27431fabfe496dfba14bb0dba71141eb5472a365fd13023f4fe629608839081808280098009098391089082827fbb988dfc0c4dfe53999bd34840adcb63fdbf501ccd622ca2ddf5064ad8cdebf408839081808280098009098391089082827f25b068c942724c424ed5851c9575c22752c9bd25f91ebfa589de3d88ee7627f908839081808280098009098391089082827fed98a1931e361add218de11ff7879bd7114cda19c24ddbe15b3b0190ce01e1aa08839081808280098009098391089082827fc80b5a7d63f6c43542ad612023d3ffd6c684ce2eab837180addcb4decf51854408839081808280098009098391089082827fe2ef24bf47c5203118c6ff96657dd3c6fdff7212d5c798d826455de77b4b70cd08839081808280098009098391089082827f907da812fd5a8375587e4860f87691d0a8d61d454c507d09e5562e1a5d0fcc7608839081808280098009098391089082827fc459abbc62bc6070cacdff597e97990de56edc51cc6643afb0f6789fef1bad6308839081808280098009098391089082827f38d61f5e566855d70d36ef0f0f1fefcd7c829bdd60d95e0ef1fb5b98856280a408839081808280098009098391089082827f13218626665c420d3aa2b0fa49224a3dce8e08b8b56f8851bd9cb5e25cb3042d08839081808280098009098391089082827f6f685fb152dba21b4d02422e237e246df73d7d711ae6d7d33983bae0f873e31008839081808280098009098391089082827f5ade34719e2498dde70e4571c40474475a4af706a3cb82ac18a7fa44c22d1c4708839081808280098009098391089082827f8a0c3dc7a496adca059cb95d9b173812a00f3c4d435e0b9e8116e0c4b5f56acb08839081808280098009098391089082827f196bc98252f63169ed79073ee091a0e8ed0b5af51017da143940c00bdb86370908839081808280098009098391089082827fd979bf70695d93f8efb552a413701918afec9e12dfe213f4d0c27cfa68fad6c208839081808280098009098391089082827fb803072d02f54d237a3c6c4cc18eda6dce87a03c6819df54e4ed8aed6dc56d4608839081808280098009098391089082827f1efcda9d986cddcf431af4d59c6a7709d650885b7886cba70f0e7cd92b331cdc08839081808280098009098391089082827fd3ca5f7859b82ac50b63da06d43aa68a6b685f0a60397638bbea173b3f60419208839081808280098009098391089082827fa59d392c0667316ad37a06be2d51aabe9e79bdef0013bc109985648a14c7e41f08839081808280098009098391089082827fac2f5f0d2146791b396e2bed6cf15a20bc22cc4c8cf7dd4b3514ac00148dd0a708839081808280098009098391089082827f17a993a6af068d72bc36f0e814d29fef3f97d7a72aa963889b16a8457409861a08839081808280098009098391089082827f6f1bf99686550e0396f7f4e2df6fdaa090fbc272c8c76eb32a3c6791de5a07b508839081808280098009098391089082827f8234d705e1ecdc59cc6ed40749069d4b45e63deb49b5b7d7f527abd31c072b1b08839081808280098009098391089082827f6fe929a1fd6aacba5c4012c45dd727d2c816119567450003913d882cb97bc47e08839081808280098009098391089082827fad5371215f2aba49026b2e48739c11b4d8ffbb24dd4a6e41b9763862af96787a08839081808280098009098391089082827fd0e704566c49e1a11edc2c128b2e07f36dc0c755468268f8fe4c4859b9fa595b08839081808280098009098391089082827f263e1195090d00be1d8fb37de17ccf3b66d180645efa0d831865cfaa8797769e08839081808280098009098391089082827fe65c090eebde2cfa7f9c92cf75641c7683fb8e81f4a48f5b7a9c7eb26a85029f08839081808280098009098391089082827fa18971781c6855f6a9752912780bb9b719c14a677a4c6393d62d6e046b97a2ac08839081808280098009098391089082827ff6fc1ef1bca8bec055cc66edecc5dc99030fe78311a3f21d8cd624df4f89e62508839081808280098009098391089082827f824e4e2838501516d3296542cb47a59a1ca4326e947c9c874d88dccc8e37b99a08839081808280098009098391089082827f3cd5a9e7353a50e454c9c1381b556b543897cc89153c3e3749f2021d8237226308839081808280098009098391089082827fb4bcedbd54d0c917a315cc7ca785e3c5995abbeeb3deb3ebaf02c7a9bf6cc83f08839081808280098009098391089082827f1f7476211105b3039cef009c51155ae93526c53a74973ecfce40754b3df1052108839081808280098009098391089082827f58aefbd978440c94b4b9fbd36e00e6e36caeacf82b0da0a6161d34c541a5a6e308839081808280098009098391089082827fc22cd6d61be780a33c77677bc6ba40307b597ed981db57cb485313eec2a5a49708839081808280098009098391089082827fd9ffc4fe0dc5f835c8dcdc1e60b8f0b1637f32a809175371b94a057272b0748d08839081808280098009098391089082827ff6a5268541bc4c64ad0ade8f55dda3492604857a71c923662a214dd7e9c20c1008839081808280098009098391089082826000088390818082800980090983910860205260005260406000f3";function f(e){return e.sendTransaction({data:c})}},83968:(e,a,t)=>{"use strict";t.d(a,{Fl:()=>C,mc:()=>M,W7:()=>B});const c=(e,a)=>a.some((a=>e instanceof a));let f,d;const r=new WeakMap,n=new WeakMap,i=new WeakMap;let b={get(e,a,t){if(e instanceof IDBTransaction){if("done"===a)return r.get(e);if("store"===a)return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return l(e[a])},set:(e,a,t)=>(e[a]=t,!0),has:(e,a)=>e instanceof IDBTransaction&&("done"===a||"store"===a)||a in e};function o(e){b=e(b)}function s(e){return"function"==typeof e?(a=e,(d||(d=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(a)?function(...e){return a.apply(u(this),e),l(this.request)}:function(...e){return l(a.apply(u(this),e))}):(e instanceof IDBTransaction&&function(e){if(r.has(e))return;const a=new Promise(((a,t)=>{const c=()=>{e.removeEventListener("complete",f),e.removeEventListener("error",d),e.removeEventListener("abort",d)},f=()=>{a(),c()},d=()=>{t(e.error||new DOMException("AbortError","AbortError")),c()};e.addEventListener("complete",f),e.addEventListener("error",d),e.addEventListener("abort",d)}));r.set(e,a)}(e),c(e,f||(f=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,b):e);var a}function l(e){if(e instanceof IDBRequest)return function(e){const a=new Promise(((a,t)=>{const c=()=>{e.removeEventListener("success",f),e.removeEventListener("error",d)},f=()=>{a(l(e.result)),c()},d=()=>{t(e.error),c()};e.addEventListener("success",f),e.addEventListener("error",d)}));return i.set(a,e),a}(e);if(n.has(e))return n.get(e);const a=s(e);return a!==e&&(n.set(e,a),i.set(a,e)),a}const u=e=>i.get(e),h=["get","getKey","getAll","getAllKeys","count"],p=["put","add","delete","clear"],g=new Map;function m(e,a){if(!(e instanceof IDBDatabase)||a in e||"string"!=typeof a)return;if(g.get(a))return g.get(a);const t=a.replace(/FromIndex$/,""),c=a!==t,f=p.includes(t);if(!(t in(c?IDBIndex:IDBObjectStore).prototype)||!f&&!h.includes(t))return;const d=async function(e,...a){const d=this.transaction(e,f?"readwrite":"readonly");let r=d.store;return c&&(r=r.index(a.shift())),(await Promise.all([r[t](...a),f&&d.done]))[0]};return g.set(a,d),d}o((e=>({...e,get:(a,t,c)=>m(a,t)||e.get(a,t,c),has:(a,t)=>!!m(a,t)||e.has(a,t)})));const x=["continue","continuePrimaryKey","advance"],y={},A=new WeakMap,v=new WeakMap,w={get(e,a){if(!x.includes(a))return e[a];let t=y[a];return t||(t=y[a]=function(...e){A.set(this,v.get(this)[a](...e))}),t}};async function*_(...e){let a=this;if(a instanceof IDBCursor||(a=await a.openCursor(...e)),!a)return;const t=new Proxy(a,w);for(v.set(t,a),i.set(t,u(a));a;)yield t,a=await(A.get(t)||a.continue()),A.delete(t)}function I(e,a){return a===Symbol.asyncIterator&&c(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===a&&c(e,[IDBIndex,IDBObjectStore])}o((e=>({...e,get:(a,t,c)=>I(a,t)?_:e.get(a,t,c),has:(a,t)=>I(a,t)||e.has(a,t)})));var E=t(59499);const C="A mutation operation was attempted on a database that did not allow mutations.";class M{dbExists;isBlocked;options;dbName;dbVersion;db;constructor({dbName:e,stores:a}){this.dbExists=!1,this.isBlocked=!1,this.options={upgrade(e){Object.values(e.objectStoreNames).forEach((a=>{e.deleteObjectStore(a)})),[{name:"keyval"},...a||[]].forEach((({name:a,keyPath:t,indexes:c})=>{const f=e.createObjectStore(a,{keyPath:t,autoIncrement:!0});Array.isArray(c)&&c.forEach((({name:e,unique:a=!1})=>{f.createIndex(e,e,{unique:a})}))}))}},this.dbName=e,this.dbVersion=35}async initDB(){try{if(this.dbExists||this.isBlocked)return;this.db=await function(e,a,{blocked:t,upgrade:c,blocking:f,terminated:d}={}){const r=indexedDB.open(e,a),n=l(r);return c&&r.addEventListener("upgradeneeded",(e=>{c(l(r.result),e.oldVersion,e.newVersion,l(r.transaction),e)})),t&&r.addEventListener("blocked",(e=>t(e.oldVersion,e.newVersion,e))),n.then((e=>{d&&e.addEventListener("close",(()=>d())),f&&e.addEventListener("versionchange",(e=>f(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),n}(this.dbName,this.dbVersion,this.options),this.db.addEventListener("onupgradeneeded",(async()=>{await this._removeExist()})),this.dbExists=!0}catch(e){if(e.message.includes(C))return console.log("This browser does not support IndexedDB!"),void(this.isBlocked=!0);if(e.message.includes("less than the existing version"))return console.log(`Upgrading DB ${this.dbName} to ${this.dbVersion}`),void await this._removeExist();console.error(`Method initDB has error: ${e.message}`)}}async _removeExist(){await function(e,{blocked:a}={}){const t=indexedDB.deleteDatabase(e);return a&&t.addEventListener("blocked",(e=>a(e.oldVersion,e))),l(t).then((()=>{}))}(this.dbName),this.dbExists=!1,await this.initDB()}async getFromIndex({storeName:e,indexName:a,key:t}){if(await this.initDB(),this.db)try{return await this.db.getFromIndex(e,a,t)}catch(e){throw new Error(`Method getFromIndex has error: ${e.message}`)}}async getAllFromIndex({storeName:e,indexName:a,key:t,count:c}){if(await this.initDB(),!this.db)return[];try{return await this.db.getAllFromIndex(e,a,t,c)}catch(e){throw new Error(`Method getAllFromIndex has error: ${e.message}`)}}async getItem({storeName:e,key:a}){if(await this.initDB(),this.db)try{const t=this.db.transaction(e).objectStore(e);return await t.get(a)}catch(e){throw new Error(`Method getItem has error: ${e.message}`)}}async addItem({storeName:e,data:a,key:t=""}){if(await this.initDB(),this.db)try{const c=this.db.transaction(e,"readwrite");await c.objectStore(e).get(t)||await c.objectStore(e).add(a)}catch(e){throw new Error(`Method addItem has error: ${e.message}`)}}async putItem({storeName:e,data:a,key:t}){if(await this.initDB(),this.db)try{const c=this.db.transaction(e,"readwrite");await c.objectStore(e).put(a,t)}catch(e){throw new Error(`Method putItem has error: ${e.message}`)}}async deleteItem({storeName:e,key:a}){if(await this.initDB(),this.db)try{const t=this.db.transaction(e,"readwrite");await t.objectStore(e).delete(a)}catch(e){throw new Error(`Method deleteItem has error: ${e.message}`)}}async getAll({storeName:e}){if(await this.initDB(),!this.db)return[];try{const a=this.db.transaction(e,"readonly");return await a.objectStore(e).getAll()}catch(e){throw new Error(`Method getAll has error: ${e.message}`)}}getValue(e){return this.getItem({storeName:"keyval",key:e})}setValue(e,a){return this.putItem({storeName:"keyval",key:e,data:a})}delValue(e){return this.deleteItem({storeName:"keyval",key:e})}async clearStore({storeName:e,mode:a="readwrite"}){if(await this.initDB(),this.db)try{const t=this.db.transaction(e,a);await t.objectStore(e).clear()}catch(e){throw new Error(`Method clearStore has error: ${e.message}`)}}async createTransactions({storeName:e,data:a,mode:t="readwrite"}){if(await this.initDB(),this.db)try{const c=this.db.transaction(e,t);await c.objectStore(e).add(a),await c.done}catch(e){throw new Error(`Method createTransactions has error: ${e.message}`)}}async createMultipleTransactions({storeName:e,data:a,index:t,mode:c="readwrite"}){if(await this.initDB(),this.db)try{const f=this.db.transaction(e,c);for(const e of a)e&&await f.store.put({...e,...t})}catch(e){throw new Error(`Method createMultipleTransactions has error: ${e.message}`)}}}async function B(e){if(!e){const e=new M({dbName:"tornado-core"});return await e.initDB(),e}const a=[{name:"blockNumber",unique:!1},{name:"transactionHash",unique:!1}],t=[{name:`echo_${e}`,keyPath:"eid",indexes:[...a,{name:"address",unique:!1}]},{name:`encrypted_notes_${e}`,keyPath:"eid",indexes:a},{name:"lastEvents",keyPath:"name",indexes:[{name:"name",unique:!1}]}],c=(0,E.zj)(e),{tokens:f,nativeCurrency:d,registryContract:r,governanceContract:n}=c,i=[...t];r&&(i.push({name:`registry_${e}`,keyPath:"ensName",indexes:[...a,{name:"event",unique:!1}]}),i.push({name:`relayers_${e}`,keyPath:"timestamp",indexes:[{name:"timestamp",unique:!0}]}),i.push({name:`revenue_${e}`,keyPath:"timestamp",indexes:[{name:"timestamp",unique:!0}]})),n&&i.push({name:`governance_${e}`,keyPath:"eid",indexes:[...a,{name:"event",unique:!1}]}),Object.entries(f).forEach((([t,{instanceAddress:c}])=>{Object.keys(c).forEach((c=>{d===t&&i.push({name:`stringify_bloom_${e}_${t}_${c}`,keyPath:"hashBloom",indexes:[]},{name:`stringify_tree_${e}_${t}_${c}`,keyPath:"hashTree",indexes:[]}),i.push({name:`deposits_${e}_${t}_${c}`,keyPath:"leafIndex",indexes:[...a,{name:"commitment",unique:!0}]},{name:`withdrawals_${e}_${t}_${c}`,keyPath:"eid",indexes:[...a,{name:"nullifierHash",unique:!0}]})}))}));const b=new M({dbName:`tornado_core_${e}`,stores:i});return await b.initDB(),b}},57390:(e,a,t)=>{"use strict";t.d(a,{W:()=>f});var c=t(46170);async function f(e){return await(0,c.Fd)(e,{method:"GET",timeout:3e4})}},5217:(e,a,t)=>{"use strict";t.d(a,{s:()=>n});var c=t(47882),f=t(41217),d=t(67418),r=t(22901);class n{currency;amount;netId;Tornado;commitmentHex;instanceName;merkleTreeHeight;emptyElement;merkleWorkerPath;constructor({netId:e,amount:a,currency:t,Tornado:c,commitmentHex:f,merkleTreeHeight:d=20,emptyElement:r="21663839004416932945382355908790599225266501822907911457504978515578255421292",merkleWorkerPath:n}){const i=`${e}_${t}_${a}`;this.currency=t,this.amount=a,this.netId=Number(e),this.Tornado=c,this.instanceName=i,this.commitmentHex=f,this.merkleTreeHeight=d,this.emptyElement=r,this.merkleWorkerPath=n}async createTree(e){const{hash:a}=await r.f.getHash();if(this.merkleWorkerPath){console.log("Using merkleWorker\n");try{if(d.Ll){const t=new Promise(((a,t)=>{const f=new c.Worker(this.merkleWorkerPath,{workerData:{merkleTreeHeight:this.merkleTreeHeight,elements:e,zeroElement:this.emptyElement}});f.on("message",a),f.on("error",t),f.on("exit",(e=>{0!==e&&t(new Error(`Worker stopped with exit code ${e}`))}))}));return f.MerkleTree.deserialize(JSON.parse(await t),a)}{const t=new Promise(((a,t)=>{const c=new Worker(this.merkleWorkerPath);c.onmessage=e=>{a(e.data)},c.onerror=e=>{t(e)},c.postMessage({merkleTreeHeight:this.merkleTreeHeight,elements:e,zeroElement:this.emptyElement})}));return f.MerkleTree.deserialize(JSON.parse(await t),a)}}catch(e){console.log("merkleWorker failed, falling back to synchronous merkle tree"),console.log(e)}}return new f.MerkleTree(this.merkleTreeHeight,e,{zeroElement:this.emptyElement,hashFunction:a})}async createPartialTree({edge:e,elements:a}){const{hash:t}=await r.f.getHash();if(this.merkleWorkerPath){console.log("Using merkleWorker\n");try{if(d.Ll){const d=new Promise(((t,f)=>{const d=new c.Worker(this.merkleWorkerPath,{workerData:{merkleTreeHeight:this.merkleTreeHeight,edge:e,elements:a,zeroElement:this.emptyElement}});d.on("message",t),d.on("error",f),d.on("exit",(e=>{0!==e&&f(new Error(`Worker stopped with exit code ${e}`))}))}));return f.PartialMerkleTree.deserialize(JSON.parse(await d),t)}{const c=new Promise(((t,c)=>{const f=new Worker(this.merkleWorkerPath);f.onmessage=e=>{t(e.data)},f.onerror=e=>{c(e)},f.postMessage({merkleTreeHeight:this.merkleTreeHeight,edge:e,elements:a,zeroElement:this.emptyElement})}));return f.PartialMerkleTree.deserialize(JSON.parse(await c),t)}}catch(e){console.log("merkleWorker failed, falling back to synchronous merkle tree"),console.log(e)}}return new f.PartialMerkleTree(this.merkleTreeHeight,e,a,{zeroElement:this.emptyElement,hashFunction:t})}async verifyTree(e){console.log(`\nCreating deposit tree for ${this.netId} ${this.amount} ${this.currency.toUpperCase()} would take a while\n`);const a=Date.now(),t=await this.createTree(e.map((({commitment:e})=>e)));if(!await this.Tornado.isKnownRoot((0,d.$W)(BigInt(t.root)))){const e=`Deposit Event ${this.netId} ${this.amount} ${this.currency} is invalid`;throw new Error(e)}return console.log(`\nCreated ${this.netId} ${this.amount} ${this.currency.toUpperCase()} tree in ${Date.now()-a}ms\n`),t}}},22901:(e,a,t)=>{"use strict";t.d(a,{f:()=>d,p:()=>f});var c=t(90294);class f{sponge;hash;mimcPromise;constructor(){this.mimcPromise=this.initMimc()}async initMimc(){this.sponge=await(0,c.HI)(),this.hash=(e,a)=>this.sponge?.F.toString(this.sponge?.multiHash([BigInt(e),BigInt(a)]))}async getHash(){return await this.mimcPromise,{sponge:this.sponge,hash:this.hash}}}const d=new f},48486:(e,a,t)=>{"use strict";async function c(e,a){const t=a.map((e=>({target:e.contract?.target||e.address,callData:(e.contract?.interface||e.interface).encodeFunctionData(e.name,e.params),allowFailure:e.allowFailure??!1})));return(await e.aggregate3.staticCall(t)).map(((e,t)=>{const c=a[t].contract?.interface||a[t].interface,[f,d]=e,r=f&&d&&"0x"!==d?c.decodeFunctionResult(a[t].name,d):null;return r?1===r.length?r[0]:r:null}))}t.d(a,{C:()=>c})},59499:(e,a,t)=>{"use strict";t.d(a,{AE:()=>n,Af:()=>d,RY:()=>i,Zh:()=>l,cX:()=>r,h9:()=>o,o2:()=>u,oY:()=>s,sX:()=>h,sb:()=>f,zj:()=>b,zr:()=>c});var c=(e=>(e[e.MAINNET=1]="MAINNET",e[e.BSC=56]="BSC",e[e.POLYGON=137]="POLYGON",e[e.OPTIMISM=10]="OPTIMISM",e[e.ARBITRUM=42161]="ARBITRUM",e[e.GNOSIS=100]="GNOSIS",e[e.AVALANCHE=43114]="AVALANCHE",e[e.SEPOLIA=11155111]="SEPOLIA",e))(c||{});const f={1:{rpcCallRetryAttempt:15,gasPrices:{instant:80,fast:50,standard:25,low:8},nativeCurrency:"eth",currencyName:"ETH",explorerUrl:"https://etherscan.io",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Ethereum Mainnet",deployedBlock:9116966,rpcUrls:{mevblockerRPC:{name:"MEV Blocker",url:"https://rpc.mevblocker.io"},keydonix:{name:"Horswap ( Keydonix )",url:"https://ethereum.keydonix.com/v1/mainnet"},SecureRpc:{name:"SecureRpc",url:"https://api.securerpc.com/v1"},stackup:{name:"Stackup",url:"https://public.stackup.sh/api/v1/node/ethereum-mainnet"},oneRpc:{name:"1RPC",url:"https://1rpc.io/eth"}},stablecoin:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0xd90e2f925DA726b50C4Ed8D0Fb90Ad053324F31b",echoContract:"0x9B27DD5Bb15d42DC224FCD0B7caEbBe16161Df42",offchainOracleContract:"0x00000000000D6FFc74A8feb35aF5827bf57f6786",tornContract:"0x77777FeDdddFfC19Ff86DB637967013e6C6A116C",governanceContract:"0x5efda50f22d34F262c29268506C5Fa42cB56A1Ce",stakingRewardsContract:"0x5B3f656C80E8ddb9ec01Dd9018815576E9238c29",registryContract:"0x58E8dCC13BE9780fC42E8723D8EaD4CF46943dF2",aggregatorContract:"0xE8F47A78A6D52D317D0D2FFFac56739fE14D1b49",reverseRecordsContract:"0x3671aE578E63FdF66ad4F3E12CC0c0d71Ac7510C",tornadoSubgraph:"tornadocash/mainnet-tornado-subgraph",registrySubgraph:"tornadocash/tornado-relayer-registry",governanceSubgraph:"tornadocash/tornado-governance",subgraphs:{},tokens:{eth:{instanceAddress:{.1:"0x12D66f87A04A9E220743712cE6d9bB1B5616B8Fc",1:"0x47CE0C6eD5B0Ce3d3A51fdb1C52DC66a7c3c2936",10:"0x910Cbd523D972eb0a6f4cAe4618aD62622b39DbF",100:"0xA160cdAB225685dA1d56aa342Ad8841c3b53f291"},symbol:"ETH",decimals:18},dai:{instanceAddress:{100:"0xD4B88Df4D29F5CedD6857912842cff3b20C8Cfa3",1e3:"0xFD8610d20aA15b7B2E3Be39B396a1bC3516c7144",1e4:"0x07687e702b410Fa43f4cB4Af7FA097918ffD2730",1e5:"0x23773E65ed146A459791799d01336DB287f25334"},tokenAddress:"0x6B175474E89094C44Da98b954EedeAC495271d0F",tokenGasLimit:7e4,symbol:"DAI",decimals:18,gasLimit:7e5},cdai:{instanceAddress:{5e3:"0x22aaA7720ddd5388A3c0A3333430953C68f1849b",5e4:"0x03893a7c7463AE47D46bc7f091665f1893656003",5e5:"0x2717c5e28cf931547B621a5dddb772Ab6A35B701",5e6:"0xD21be7248e0197Ee08E0c20D4a96DEBdaC3D20Af"},tokenAddress:"0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643",tokenGasLimit:2e5,symbol:"cDAI",decimals:8,gasLimit:7e5},usdc:{instanceAddress:{100:"0xd96f2B1c14Db8458374d9Aca76E26c3D18364307",1e3:"0x4736dCf1b7A3d580672CcE6E7c65cd5cc9cFBa9D"},tokenAddress:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",tokenGasLimit:7e4,symbol:"USDC",decimals:6,gasLimit:7e5},usdt:{instanceAddress:{100:"0x169AD27A470D064DEDE56a2D3ff727986b15D52B",1e3:"0x0836222F2B2B24A3F36f98668Ed8F0B38D1a872f"},tokenAddress:"0xdAC17F958D2ee523a2206206994597C13D831ec7",tokenGasLimit:7e4,symbol:"USDT",decimals:6,gasLimit:7e5},wbtc:{instanceAddress:{.1:"0x178169B423a011fff22B9e3F3abeA13414dDD0F1",1:"0x610B717796ad172B316836AC95a2ffad065CeaB4",10:"0xbB93e510BbCD0B7beb5A853875f9eC60275CF498"},tokenAddress:"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",tokenGasLimit:7e4,symbol:"WBTC",decimals:8,gasLimit:7e5}},disabledTokens:["cdai","usdt","usdc"],relayerEnsSubdomain:"mainnet-tornado",pollInterval:15,constants:{GOVERNANCE_BLOCK:11474695,NOTE_ACCOUNT_BLOCK:11842486,ENCRYPTED_NOTES_BLOCK:12143762,REGISTRY_BLOCK:14173129,MINING_BLOCK_TIME:15}},56:{rpcCallRetryAttempt:15,gasPrices:{instant:5,fast:5,standard:5,low:5},nativeCurrency:"bnb",currencyName:"BNB",explorerUrl:"https://bscscan.com",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Binance Smart Chain",deployedBlock:8158799,stablecoin:"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0x0D5550d52428E7e3175bfc9550207e4ad3859b17",echoContract:"0xa75BF2815618872f155b7C4B0C81bF990f5245E4",offchainOracleContract:"0x00000000000D6FFc74A8feb35aF5827bf57f6786",tornadoSubgraph:"tornadocash/bsc-tornado-subgraph",subgraphs:{},rpcUrls:{bnbchain:{name:"BNB Chain",url:"https://bsc-dataseed.bnbchain.org"},ninicoin:{name:"BNB Chain 2",url:"https://bsc-dataseed1.ninicoin.io"},nodereal:{name:"NodeReal",url:"https://binance.nodereal.io"},stackup:{name:"Stackup",url:"https://public.stackup.sh/api/v1/node/bsc-mainnet"},oneRpc:{name:"1RPC",url:"https://1rpc.io/bnb"}},tokens:{bnb:{instanceAddress:{.1:"0x84443CFd09A48AF6eF360C6976C5392aC5023a1F",1:"0xd47438C816c9E7f2E2888E060936a499Af9582b3",10:"0x330bdFADE01eE9bF63C209Ee33102DD334618e0a",100:"0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD"},symbol:"BNB",decimals:18}},relayerEnsSubdomain:"bsc-tornado",pollInterval:10,constants:{NOTE_ACCOUNT_BLOCK:8159269,ENCRYPTED_NOTES_BLOCK:8159269}},137:{rpcCallRetryAttempt:15,gasPrices:{instant:100,fast:75,standard:50,low:30},nativeCurrency:"matic",currencyName:"MATIC",explorerUrl:"https://polygonscan.com",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Polygon (Matic) Network",deployedBlock:16257962,stablecoin:"0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0x0D5550d52428E7e3175bfc9550207e4ad3859b17",echoContract:"0xa75BF2815618872f155b7C4B0C81bF990f5245E4",offchainOracleContract:"0x00000000000D6FFc74A8feb35aF5827bf57f6786",tornadoSubgraph:"tornadocash/matic-tornado-subgraph",subgraphs:{},rpcUrls:{oneRpc:{name:"1RPC",url:"https://1rpc.io/matic"},stackup:{name:"Stackup",url:"https://public.stackup.sh/api/v1/node/polygon-mainnet"}},tokens:{matic:{instanceAddress:{100:"0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD",1e3:"0xdf231d99Ff8b6c6CBF4E9B9a945CBAcEF9339178",1e4:"0xaf4c0B70B2Ea9FB7487C7CbB37aDa259579fe040",1e5:"0xa5C2254e4253490C54cef0a4347fddb8f75A4998"},symbol:"MATIC",decimals:18}},relayerEnsSubdomain:"polygon-tornado",pollInterval:10,constants:{NOTE_ACCOUNT_BLOCK:16257996,ENCRYPTED_NOTES_BLOCK:16257996}},10:{rpcCallRetryAttempt:15,gasPrices:{instant:.001,fast:.001,standard:.001,low:.001},nativeCurrency:"eth",currencyName:"ETH",explorerUrl:"https://optimistic.etherscan.io",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Optimism",deployedBlock:2243689,stablecoin:"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0x0D5550d52428E7e3175bfc9550207e4ad3859b17",echoContract:"0xa75BF2815618872f155b7C4B0C81bF990f5245E4",offchainOracleContract:"0x00000000000D6FFc74A8feb35aF5827bf57f6786",ovmGasPriceOracleContract:"0x420000000000000000000000000000000000000F",tornadoSubgraph:"tornadocash/optimism-tornado-subgraph",subgraphs:{},rpcUrls:{oneRpc:{name:"1RPC",url:"https://1rpc.io/op"},stackup:{name:"Stackup",url:"https://public.stackup.sh/api/v1/node/optimism-mainnet"}},tokens:{eth:{instanceAddress:{.1:"0x84443CFd09A48AF6eF360C6976C5392aC5023a1F",1:"0xd47438C816c9E7f2E2888E060936a499Af9582b3",10:"0x330bdFADE01eE9bF63C209Ee33102DD334618e0a",100:"0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD"},symbol:"ETH",decimals:18}},relayerEnsSubdomain:"optimism-tornado",pollInterval:15,constants:{NOTE_ACCOUNT_BLOCK:2243694,ENCRYPTED_NOTES_BLOCK:2243694}},42161:{rpcCallRetryAttempt:15,gasPrices:{instant:4,fast:3,standard:2.52,low:2.29},nativeCurrency:"eth",currencyName:"ETH",explorerUrl:"https://arbiscan.io",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Arbitrum One",deployedBlock:3430648,stablecoin:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0x0D5550d52428E7e3175bfc9550207e4ad3859b17",echoContract:"0xa75BF2815618872f155b7C4B0C81bF990f5245E4",offchainOracleContract:"0x00000000000D6FFc74A8feb35aF5827bf57f6786",tornadoSubgraph:"tornadocash/arbitrum-tornado-subgraph",subgraphs:{},rpcUrls:{Arbitrum:{name:"Arbitrum",url:"https://arb1.arbitrum.io/rpc"},stackup:{name:"Stackup",url:"https://public.stackup.sh/api/v1/node/arbitrum-one"},oneRpc:{name:"1RPC",url:"https://1rpc.io/arb"}},tokens:{eth:{instanceAddress:{.1:"0x84443CFd09A48AF6eF360C6976C5392aC5023a1F",1:"0xd47438C816c9E7f2E2888E060936a499Af9582b3",10:"0x330bdFADE01eE9bF63C209Ee33102DD334618e0a",100:"0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD"},symbol:"ETH",decimals:18}},relayerEnsSubdomain:"arbitrum-tornado",pollInterval:15,constants:{NOTE_ACCOUNT_BLOCK:3430605,ENCRYPTED_NOTES_BLOCK:3430605}},100:{rpcCallRetryAttempt:15,gasPrices:{instant:6,fast:5,standard:4,low:1},nativeCurrency:"xdai",currencyName:"xDAI",explorerUrl:"https://gnosisscan.io",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Gnosis Chain",deployedBlock:17754561,stablecoin:"0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83",multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0x0D5550d52428E7e3175bfc9550207e4ad3859b17",echoContract:"0xa75BF2815618872f155b7C4B0C81bF990f5245E4",offchainOracleContract:"0x00000000000D6FFc74A8feb35aF5827bf57f6786",tornadoSubgraph:"tornadocash/xdai-tornado-subgraph",subgraphs:{},rpcUrls:{gnosis:{name:"Gnosis",url:"https://rpc.gnosischain.com"},oneRpc:{name:"1RPC",url:"https://1rpc.io/gnosis"}},tokens:{xdai:{instanceAddress:{100:"0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD",1e3:"0xdf231d99Ff8b6c6CBF4E9B9a945CBAcEF9339178",1e4:"0xaf4c0B70B2Ea9FB7487C7CbB37aDa259579fe040",1e5:"0xa5C2254e4253490C54cef0a4347fddb8f75A4998"},symbol:"xDAI",decimals:18}},relayerEnsSubdomain:"gnosis-tornado",pollInterval:15,constants:{NOTE_ACCOUNT_BLOCK:17754564,ENCRYPTED_NOTES_BLOCK:17754564}},43114:{rpcCallRetryAttempt:15,gasPrices:{instant:225,fast:35,standard:25,low:25},nativeCurrency:"avax",currencyName:"AVAX",explorerUrl:"https://snowtrace.io",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Avalanche Mainnet",deployedBlock:4429818,stablecoin:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0x0D5550d52428E7e3175bfc9550207e4ad3859b17",echoContract:"0xa75BF2815618872f155b7C4B0C81bF990f5245E4",offchainOracleContract:"0x00000000000D6FFc74A8feb35aF5827bf57f6786",tornadoSubgraph:"tornadocash/avalanche-tornado-subgraph",subgraphs:{},rpcUrls:{oneRpc:{name:"1RPC",url:"https://1rpc.io/avax/c"},stackup:{name:"Stackup",url:"https://public.stackup.sh/api/v1/node/avalanche-mainnet"}},tokens:{avax:{instanceAddress:{10:"0x330bdFADE01eE9bF63C209Ee33102DD334618e0a",100:"0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD",500:"0xaf8d1839c3c67cf571aa74B5c12398d4901147B3"},symbol:"AVAX",decimals:18}},relayerEnsSubdomain:"avalanche-tornado",pollInterval:10,constants:{NOTE_ACCOUNT_BLOCK:4429813,ENCRYPTED_NOTES_BLOCK:4429813}},11155111:{rpcCallRetryAttempt:15,gasPrices:{instant:2,fast:2,standard:2,low:2},nativeCurrency:"eth",currencyName:"SepoliaETH",explorerUrl:"https://sepolia.etherscan.io",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Ethereum Sepolia",deployedBlock:5594395,stablecoin:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0x1572AFE6949fdF51Cb3E0856216670ae9Ee160Ee",echoContract:"0xcDD1fc3F5ac2782D83449d3AbE80D6b7B273B0e5",offchainOracleContract:"0x1f89EAF03E5b260Bc6D4Ae3c3334b1B750F3e127",tornContract:"0x3AE6667167C0f44394106E197904519D808323cA",governanceContract:"0xe5324cD7602eeb387418e594B87aCADee08aeCAD",stakingRewardsContract:"0x6d0018890751Efd31feb8166711B16732E2b496b",registryContract:"0x1428e5d2356b13778A13108b10c440C83011dfB8",aggregatorContract:"0x4088712AC9fad39ea133cdb9130E465d235e9642",reverseRecordsContract:"0xEc29700C0283e5Be64AcdFe8077d6cC95dE23C23",tornadoSubgraph:"tornadocash/sepolia-tornado-subgraph",subgraphs:{},rpcUrls:{sepolia:{name:"Sepolia RPC",url:"https://rpc.sepolia.org"},stackup:{name:"Stackup",url:"https://public.stackup.sh/api/v1/node/ethereum-sepolia"},oneRpc:{name:"1RPC",url:"https://1rpc.io/sepolia"},ethpandaops:{name:"ethpandaops",url:"https://rpc.sepolia.ethpandaops.io"}},tokens:{eth:{instanceAddress:{.1:"0x8C4A04d872a6C1BE37964A21ba3a138525dFF50b",1:"0x8cc930096B4Df705A007c4A039BDFA1320Ed2508",10:"0x8D10d506D29Fc62ABb8A290B99F66dB27Fc43585",100:"0x44c5C92ed73dB43888210264f0C8b36Fd68D8379"},symbol:"ETH",decimals:18},dai:{instanceAddress:{100:"0x6921fd1a97441dd603a997ED6DDF388658daf754",1e3:"0x50a637770F5d161999420F7d70d888DE47207145",1e4:"0xecD649870407cD43923A816Cc6334a5bdf113621",1e5:"0x73B4BD04bF83206B6e979BE2507098F92EDf4F90"},tokenAddress:"0xFF34B3d4Aee8ddCd6F9AFFFB6Fe49bD371b8a357",tokenGasLimit:7e4,symbol:"DAI",decimals:18,gasLimit:7e5}},relayerEnsSubdomain:"sepolia-tornado",pollInterval:15,constants:{GOVERNANCE_BLOCK:5594395,NOTE_ACCOUNT_BLOCK:5594395,ENCRYPTED_NOTES_BLOCK:5594395,REGISTRY_BLOCK:5594395,MINING_BLOCK_TIME:15}}},d=Object.values(c).filter((e=>"number"==typeof e));let r={};function n(e){d.push(...Object.keys(e).map((e=>Number(e))).filter((e=>!d.includes(e)))),r={...r,...e}}function i(){const e={...f,...r};return d.reduce(((a,t)=>(a[t]=e[t],a)),{})}function b(e){const a=i()[e];if(!a)throw new Error(`No config found for network ${e}!`);return a}function o(e){const{tokens:a,disabledTokens:t}=e;return Object.keys(a).filter((e=>!t?.includes(e)))}function s(e){const{tokens:a,disabledTokens:t}=e;return Object.entries(a).reduce(((e,[a,c])=>(t?.includes(a)||(e[a]=c),e)),{})}function l(e,a){const{tokens:t,disabledTokens:c}=e;for(const[e,{instanceAddress:f,tokenAddress:d,symbol:r,decimals:n}]of Object.entries(t))if(!c?.includes(e))for(const[t,c]of Object.entries(f))if(c===a)return{amount:t,currency:e,symbol:r,decimals:n,tokenAddress:d}}function u(){const e=i();return d.reduce(((a,t)=>(a[t]=e[t].relayerEnsSubdomain,a)),{})}function h(e,a){return Object.entries(a.tokens).reduce(((a,[t,{instanceAddress:c}])=>(Object.entries(c).forEach((([c,f])=>{a[f]={currency:t,amount:c,netId:e}})),a)),{})}},85111:(e,a,t)=>{"use strict";t.d(a,{Hr:()=>f,NO:()=>d,UB:()=>r});var c=t(90294);class f{pedersenHash;babyJub;pedersenPromise;constructor(){this.pedersenPromise=this.initPedersen()}async initPedersen(){this.pedersenHash=await(0,c.vu)(),this.babyJub=this.pedersenHash.babyJub}async unpackPoint(e){return await this.pedersenPromise,this.babyJub?.unpackPoint(this.pedersenHash?.hash(e))}toStringBuffer(e){return this.babyJub?.F.toString(e)}}const d=new f;async function r(e){const[a]=await d.unpackPoint(e);return d.toStringBuffer(a)}},1180:(e,a,t)=>{"use strict";t.d(a,{Sl:()=>_,KM:()=>w,sx:()=>v,id:()=>A,CS:()=>y});var c=t(20260);BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),BigInt("1000000000000000000");const f=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");BigInt("0x8000000000000000000000000000000000000000000000000000000000000000"),BigInt(-1),BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var d=t(30031),r=t(2011),n=t(36212),i=t(87303),b=t(57339),o=t(27033);const s=new RegExp("^bytes([0-9]+)$"),l=new RegExp("^(u?int)([0-9]*)$"),u=new RegExp("^(.*)\\[([0-9]*)\\]$");function h(e,a,t){switch(e){case"address":return t?(0,n.q5)((0,n.nx)(a,32)):(0,n.q5)((0,d.b)(a));case"string":return(0,i.YW)(a);case"bytes":return(0,n.q5)(a);case"bool":return a=a?"0x01":"0x00",t?(0,n.q5)((0,n.nx)(a,32)):(0,n.q5)(a)}let c=e.match(l);if(c){let f="int"===c[1],d=parseInt(c[2]||"256");return(0,b.MR)((!c[2]||c[2]===String(d))&&d%8==0&&0!==d&&d<=256,"invalid number type","type",e),t&&(d=256),f&&(a=(0,o.JJ)(a,d)),(0,n.q5)((0,n.nx)((0,o.c4)(a),d/8))}if(c=e.match(s),c){const f=parseInt(c[1]);return(0,b.MR)(String(f)===c[1]&&0!==f&&f<=32,"invalid bytes type","type",e),(0,b.MR)((0,n.pO)(a)===f,`invalid value for ${e}`,"value",a),t?(0,n.q5)((0,n.X_)(a,32)):a}if(c=e.match(u),c&&Array.isArray(a)){const t=c[1],f=parseInt(c[2]||String(a.length));(0,b.MR)(f===a.length,`invalid array length for ${e}`,"value",a);const d=[];return a.forEach((function(e){d.push(h(t,e,!0))})),(0,n.q5)((0,n.xW)(d))}(0,b.MR)(!1,"invalid type","type",e)}function p(e,a){(0,b.MR)(e.length===a.length,"wrong number of values; expected ${ types.length }","values",a);const t=[];return e.forEach((function(e,c){t.push(h(e,a[c]))})),(0,n.c$)((0,n.xW)(t))}function g(e,a){return(0,r.S)(p(e,a))}var m=t(82314),x=t(67418);const y="0x000000000022D473030F116dDEE9F6B43aC78BA3";async function A({Token:e,signer:a,spender:t,value:d,nonce:r,deadline:n}){const i=a||e.runner,b=i.provider,[o,s,{chainId:l}]=await Promise.all([e.name(),e.nonces(i.address),b.getNetwork()]),u={name:o,version:"1",chainId:l,verifyingContract:e.target};return c.t.from(await i.signTypedData(u,{Permit:[{name:"owner",type:"address"},{name:"spender",type:"address"},{name:"value",type:"uint256"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]},{owner:i.address,spender:t,value:d,nonce:r||s,deadline:n||f}))}async function v({PermitTornado:e,Token:a,signer:t,denomination:c,commitments:f,nonce:d}){const r=BigInt(f.length)*c,n=g(["bytes32[]"],[f]);return await A({Token:a,signer:t,spender:e.target,value:r,nonce:d,deadline:BigInt(n)})}async function w({Token:e,signer:a,spender:t,value:d,nonce:r,deadline:n,witness:i}){const b=a||e.runner,o=b.provider,s={name:"Permit2",chainId:(await o.getNetwork()).chainId,verifyingContract:y},l=i?{PermitWitnessTransferFrom:[{name:"permitted",type:"TokenPermissions"},{name:"spender",type:"address"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"},{name:"witness",type:i.witnessTypeName}],TokenPermissions:[{name:"token",type:"address"},{name:"amount",type:"uint256"}],...i.witnessType}:{PermitTransferFrom:[{name:"permitted",type:"TokenPermissions"},{name:"spender",type:"address"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}],TokenPermissions:[{name:"token",type:"address"},{name:"amount",type:"uint256"}]},u={permitted:{token:e.target,amount:d},spender:t,nonce:r||(0,x.ib)(16),deadline:n||f};return i&&(u.witness=i.witness),{domain:s,types:l,values:u,hash:new m.z(l).hash(u),signature:c.t.from(await b.signTypedData(s,l,u))}}async function _({PermitTornado:e,Token:a,signer:t,denomination:c,commitments:f,nonce:d,deadline:r}){const n=BigInt(f.length)*c,i=g(["bytes32[]"],[f]);return await w({Token:a,signer:t,spender:e.target,value:n,nonce:d,deadline:r,witness:{witnessTypeName:"PermitCommitments",witnessType:{PermitCommitments:[{name:"instance",type:"address"},{name:"commitmentsHash",type:"bytes32"}]},witness:{instance:e.target,commitmentsHash:i}}})}},34525:(e,a,t)=>{"use strict";t.d(a,{T:()=>r});var c=t(99770),f=t(62463),d=t(48486);class r{oracle;multicall;provider;fallbackPrice;constructor(e,a,t){this.provider=e,this.multicall=a,this.oracle=t,this.fallbackPrice=(0,c.g5)("0.0001")}buildCalls(e){return e.map((({tokenAddress:e})=>({contract:this.oracle,name:"getRateToEth",params:[e,!0],allowFailure:!0})))}buildStable(e){const a=f.Xc.connect(e,this.provider);return[{contract:a,name:"decimals"},{contract:this.oracle,name:"getRateToEth",params:[a.target,!0],allowFailure:!0}]}async fetchPrice(e,a){if(!this.oracle)return new Promise((e=>e(this.fallbackPrice)));try{return await this.oracle.getRateToEth(e,!0)*BigInt(10**a)/BigInt(10**18)}catch(a){return console.log(`Failed to fetch oracle price for ${e}, will use fallback price ${this.fallbackPrice}`),console.log(a),this.fallbackPrice}}async fetchPrices(e){return this.oracle?(await(0,d.C)(this.multicall,this.buildCalls(e))).map(((a,t)=>(a||(a=this.fallbackPrice),a*BigInt(10**e[t].decimals)/BigInt(10**18)))):new Promise((a=>a(e.map((()=>this.fallbackPrice)))))}async fetchEthUSD(e){if(!this.oracle)return new Promise((e=>e(10**18/Number(this.fallbackPrice))));const[a,t]=await(0,d.C)(this.multicall,this.buildStable(e)),f=(t||this.fallbackPrice)*BigInt(10n**a)/BigInt(10**18);return 1/Number((0,c.ck)(f))}}},46170:(e,a,t)=>{"use strict";t.d(a,{D2:()=>pc,Vr:()=>hc,Gd:()=>uc,nA:()=>lc,mJ:()=>dc,Fd:()=>nc,uY:()=>ic,WU:()=>rc,sO:()=>bc,MF:()=>oc,zr:()=>sc});var c=t(74945),f=t.n(c),d=t(26976),r=t(35273),n=t(30031),i=t(41442),b=t(82314),o=t(8177),s=t(88081),l=t(57339),u=t(87303),h=t(36212),p=t(27033),g=t(98982),m=t(13269),x=t(64563),y=t(79453),A=t(99381),v=t(97876),w=t(7040),_=t(20260);const I=BigInt(0);function E(e,a){return function(t){return null==t?a:e(t)}}function C(e,a){return t=>{if(a&&null==t)return null;if(!Array.isArray(t))throw new Error("not an array");return t.map((a=>e(a)))}}function M(e,a){return t=>{const c={};for(const f in e){let d=f;if(a&&f in a&&!(d in t))for(const e of a[f])if(e in t){d=e;break}try{const a=e[f](t[d]);void 0!==a&&(c[f]=a)}catch(e){const a=e instanceof Error?e.message:"not-an-error";(0,l.vA)(!1,`invalid value for value.${f} (${a})`,"BAD_DATA",{value:t})}}return c}}function B(e){return(0,l.MR)((0,h.Lo)(e,!0),"invalid data","value",e),e}function k(e){return(0,l.MR)((0,h.Lo)(e,32),"invalid hash","value",e),e}const L=M({address:n.b,blockHash:k,blockNumber:p.WZ,data:B,index:p.WZ,removed:E((function(e){switch(e){case!0:case"true":return!0;case!1:case"false":return!1}(0,l.MR)(!1,`invalid boolean; ${JSON.stringify(e)}`,"value",e)}),!1),topics:C(k),transactionHash:k,transactionIndex:p.WZ},{index:["logIndex"]}),S=M({hash:E(k),parentHash:k,parentBeaconBlockRoot:E(k,null),number:p.WZ,timestamp:p.WZ,nonce:E(B),difficulty:p.Ab,gasLimit:p.Ab,gasUsed:p.Ab,stateRoot:E(k,null),receiptsRoot:E(k,null),blobGasUsed:E(p.Ab,null),excessBlobGas:E(p.Ab,null),miner:E(n.b),prevRandao:E(k,null),extraData:B,baseFeePerGas:E(p.Ab)},{prevRandao:["mixHash"]}),T=M({transactionIndex:p.WZ,blockNumber:p.WZ,transactionHash:k,address:n.b,topics:C(k),data:B,index:p.WZ,blockHash:k},{index:["logIndex"]}),N=M({to:E(n.b,null),from:E(n.b,null),contractAddress:E(n.b,null),index:p.WZ,root:E(h.c$),gasUsed:p.Ab,blobGasUsed:E(p.Ab,null),logsBloom:E(B),blockHash:k,hash:k,logs:C((function(e){return T(e)})),blockNumber:p.WZ,cumulativeGasUsed:p.Ab,effectiveGasPrice:E(p.Ab),blobGasPrice:E(p.Ab,null),status:E(p.WZ),type:E(p.WZ,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function R(e){e.to&&(0,p.Ab)(e.to)===I&&(e.to="0x0000000000000000000000000000000000000000");const a=M({hash:k,index:E(p.WZ,void 0),type:e=>"0x"===e||null==e?0:(0,p.WZ)(e),accessList:E(o.$,null),blobVersionedHashes:E(C(k,!0),null),blockHash:E(k,null),blockNumber:E(p.WZ,null),transactionIndex:E(p.WZ,null),from:n.b,gasPrice:E(p.Ab),maxPriorityFeePerGas:E(p.Ab),maxFeePerGas:E(p.Ab),maxFeePerBlobGas:E(p.Ab,null),gasLimit:p.Ab,to:E(n.b,null),value:p.Ab,nonce:p.WZ,data:B,creates:E(n.b,null),chainId:E(p.Ab,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(e);if(null==a.to&&null==a.creates&&(a.creates=(0,w.t)(a)),1!==e.type&&2!==e.type||null!=e.accessList||(a.accessList=[]),e.signature?a.signature=_.t.from(e.signature):a.signature=_.t.from(e),null==a.chainId){const e=a.signature.legacyChainId;null!=e&&(a.chainId=e)}return a.blockHash&&(0,p.Ab)(a.blockHash)===I&&(a.blockHash=null),a}class P{name;constructor(e){(0,s.n)(this,{name:e})}clone(){return new P(this.name)}}class D extends P{effectiveBlock;txBase;txCreate;txDataZero;txDataNonzero;txAccessListStorageKey;txAccessListAddress;constructor(e,a){null==e&&(e=0),super(`org.ethers.network.plugins.GasCost#${e||0}`);const t={effectiveBlock:e};function c(e,c){let f=(a||{})[e];null==f&&(f=c),(0,l.MR)("number"==typeof f,`invalud value for ${e}`,"costs",a),t[e]=f}c("txBase",21e3),c("txCreate",32e3),c("txDataZero",4),c("txDataNonzero",16),c("txAccessListStorageKey",1900),c("txAccessListAddress",2400),(0,s.n)(this,t)}clone(){return new D(this.effectiveBlock,this)}}class O extends P{address;targetNetwork;constructor(e,a){super("org.ethers.plugins.network.Ens"),(0,s.n)(this,{address:e||"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",targetNetwork:null==a?1:a})}clone(){return new O(this.address,this.targetNetwork)}}class F extends P{#e;#a;get url(){return this.#e}get processFunc(){return this.#a}constructor(e,a){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"),this.#e=e,this.#a=a}clone(){return this}}const Q=new Map;class U{#t;#c;#f;constructor(e,a){this.#t=e,this.#c=(0,p.Ab)(a),this.#f=new Map}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return this.#t}set name(e){this.#t=e}get chainId(){return this.#c}set chainId(e){this.#c=(0,p.Ab)(e,"chainId")}matches(e){if(null==e)return!1;if("string"==typeof e){try{return this.chainId===(0,p.Ab)(e)}catch(e){}return this.name===e}if("number"==typeof e||"bigint"==typeof e){try{return this.chainId===(0,p.Ab)(e)}catch(e){}return!1}if("object"==typeof e){if(null!=e.chainId){try{return this.chainId===(0,p.Ab)(e.chainId)}catch(e){}return!1}return null!=e.name&&this.name===e.name}return!1}get plugins(){return Array.from(this.#f.values())}attachPlugin(e){if(this.#f.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#f.set(e.name,e.clone()),this}getPlugin(e){return this.#f.get(e)||null}getPlugins(e){return this.plugins.filter((a=>a.name.split("#")[0]===e))}clone(){const e=new U(this.name,this.chainId);return this.plugins.forEach((a=>{e.attachPlugin(a.clone())})),e}computeIntrinsicGas(e){const a=this.getPlugin("org.ethers.plugins.network.GasCost")||new D;let t=a.txBase;if(null==e.to&&(t+=a.txCreate),e.data)for(let c=2;c{c.attachPlugin(e)})),c};U.register(e,c),U.register(a,c),t.altNames&&t.altNames.forEach((e=>{U.register(e,c)}))}q||(q=!0,e("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),e("ropsten",3,{ensNetwork:3}),e("rinkeby",4,{ensNetwork:4}),e("goerli",5,{ensNetwork:5}),e("kovan",42,{ensNetwork:42}),e("sepolia",11155111,{ensNetwork:11155111}),e("holesky",17e3,{ensNetwork:17e3}),e("classic",61,{}),e("classicKotti",6,{}),e("arbitrum",42161,{ensNetwork:1}),e("arbitrum-goerli",421613,{}),e("arbitrum-sepolia",421614,{}),e("base",8453,{ensNetwork:1}),e("base-goerli",84531,{}),e("base-sepolia",84532,{}),e("bnb",56,{ensNetwork:1}),e("bnbt",97,{}),e("linea",59144,{ensNetwork:1}),e("linea-goerli",59140,{}),e("linea-sepolia",59141,{}),e("matic",137,{ensNetwork:1,plugins:[H("https://gasstation.polygon.technology/v2")]}),e("matic-amoy",80002,{}),e("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[H("https://gasstation-testnet.polygon.technology/v2")]}),e("optimism",10,{ensNetwork:1,plugins:[]}),e("optimism-goerli",420,{}),e("optimism-sepolia",11155420,{}),e("xdai",100,{ensNetwork:1}))}(),null==e)return U.from("mainnet");if("number"==typeof e&&(e=BigInt(e)),"string"==typeof e||"bigint"==typeof e){const a=Q.get(e);if(a)return a();if("bigint"==typeof e)return new U("unknown",e);(0,l.MR)(!1,"unknown network","network",e)}if("function"==typeof e.clone)return e.clone();if("object"==typeof e){(0,l.MR)("string"==typeof e.name&&"number"==typeof e.chainId,"invalid network object name or chainId","network",e);const a=new U(e.name,e.chainId);return(e.ensAddress||null!=e.ensNetwork)&&a.attachPlugin(new O(e.ensAddress,e.ensNetwork)),a}(0,l.MR)(!1,"invalid network","network",e)}static register(e,a){"number"==typeof e&&(e=BigInt(e));const t=Q.get(e);t&&(0,l.MR)(!1,`conflicting network for ${JSON.stringify(t.name)}`,"nameOrChainId",e),Q.set(e,a)}}function j(e,a){const t=String(e);if(!t.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${e}`);const c=t.split(".");if(1===c.length&&c.push(""),2!==c.length)throw new Error(`invalid gwei value: ${e}`);for(;c[1].length9){let e=BigInt(c[1].substring(0,9));c[1].substring(9).match(/^0+$/)||e++,c[1]=e.toString()}return BigInt(c[0]+c[1])}function H(e){return new F(e,(async(e,a,t)=>{let c;t.setHeader("User-Agent","ethers");try{const[a,f]=await Promise.all([t.send(),e()]);c=a;const d=c.bodyJson.standard;return{gasPrice:f.gasPrice,maxFeePerGas:j(d.maxFee,9),maxPriorityFeePerGas:j(d.maxPriorityFee,9)}}catch(e){(0,l.vA)(!1,`error encountered with polygon gas station (${JSON.stringify(t.url)})`,"SERVER_ERROR",{request:t,response:c,error:e})}}))}let q=!1;var $=t(43948);function z(e){return JSON.parse(JSON.stringify(e))}class G{#d;#r;#n;#i;constructor(e){this.#d=e,this.#r=null,this.#n=4e3,this.#i=-2}get pollingInterval(){return this.#n}set pollingInterval(e){this.#n=e}async#b(){try{const e=await this.#d.getBlockNumber();if(-2===this.#i)return void(this.#i=e);if(e!==this.#i){for(let a=this.#i+1;a<=e;a++){if(null==this.#r)return;await this.#d.emit("block",a)}this.#i=e}}catch(e){}null!=this.#r&&(this.#r=this.#d._setTimeout(this.#b.bind(this),this.#n))}start(){this.#r||(this.#r=this.#d._setTimeout(this.#b.bind(this),this.#n),this.#b())}stop(){this.#r&&(this.#d._clearTimeout(this.#r),this.#r=null)}pause(e){this.stop(),e&&(this.#i=-2)}resume(){this.start()}}class K{#d;#b;#o;constructor(e){this.#d=e,this.#o=!1,this.#b=e=>{this._poll(e,this.#d)}}async _poll(e,a){throw new Error("sub-classes must override this")}start(){this.#o||(this.#o=!0,this.#b(-2),this.#d.on("block",this.#b))}stop(){this.#o&&(this.#o=!1,this.#d.off("block",this.#b))}pause(e){this.stop()}resume(){this.start()}}class V extends K{#s;#l;constructor(e,a){super(e),this.#s=a,this.#l=-2}pause(e){e&&(this.#l=-2),super.pause(e)}async _poll(e,a){const t=await a.getBlock(this.#s);null!=t&&(-2===this.#l?this.#l=t.number:t.number>this.#l&&(a.emit(this.#s,t.number),this.#l=t.number))}}class Z extends K{#u;constructor(e,a){super(e),this.#u=z(a)}async _poll(e,a){throw new Error("@TODO")}}class J extends K{#h;constructor(e,a){super(e),this.#h=a}async _poll(e,a){const t=await a.getTransactionReceipt(this.#h);t&&a.emit(this.#h,t)}}class W{#d;#u;#r;#o;#i;constructor(e,a){this.#d=e,this.#u=z(a),this.#r=this.#b.bind(this),this.#o=!1,this.#i=-2}async#b(e){if(-2===this.#i)return;const a=z(this.#u);a.fromBlock=this.#i+1,a.toBlock=e;const t=await this.#d.getLogs(a);if(0!==t.length)for(const e of t)this.#d.emit(this.#u,e),this.#i=e.blockNumber;else this.#i{this.#i=e})),this.#d.on("block",this.#r))}stop(){this.#o&&(this.#o=!1,this.#d.off("block",this.#r))}pause(e){this.stop(),e&&(this.#i=-2)}resume(){this.start()}}const Y=BigInt(2);function X(e){return e&&"function"==typeof e.then}function ee(e,a){return e+":"+JSON.stringify(a,((e,a)=>{if(null==a)return"null";if("bigint"==typeof a)return`bigint:${a.toString()}`;if("string"==typeof a)return a.toLowerCase();if("object"==typeof a&&!Array.isArray(a)){const e=Object.keys(a);return e.sort(),e.reduce(((e,t)=>(e[t]=a[t],e)),{})}return a}))}class ae{name;constructor(e){(0,s.n)(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function te(e){return(e=Array.from(new Set(e).values())).sort(),e}async function ce(e,a){if(null==e)throw new Error("invalid event");if(Array.isArray(e)&&(e={topics:e}),"string"==typeof e)switch(e){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:e,tag:e}}if((0,h.Lo)(e,32)){const a=e.toLowerCase();return{type:"transaction",tag:ee("tx",{hash:a}),hash:a}}if(e.orphan){const a=e;return{type:"orphan",tag:ee("orphan",a),filter:(t=a,JSON.parse(JSON.stringify(t)))}}var t;if(e.address||e.topics){const t=e,c={topics:(t.topics||[]).map((e=>null==e?null:Array.isArray(e)?te(e.map((e=>e.toLowerCase()))):e.toLowerCase()))};if(t.address){const e=[],f=[],d=t=>{(0,h.Lo)(t)?e.push(t):f.push((async()=>{e.push(await(0,i.tG)(t,a))})())};Array.isArray(t.address)?t.address.forEach(d):d(t.address),f.length&&await Promise.all(f),c.address=te(e.map((e=>e.toLowerCase())))}return{filter:c,tag:ee("event",c),type:"event"}}(0,l.MR)(!1,"unknown ProviderEvent","event",e)}function fe(){return(new Date).getTime()}const de={cacheTimeout:250,pollingInterval:4e3};class re{#p;#f;#g;#m;#x;#y;#A;#v;#w;#_;#I;#E;constructor(e,a){if(this.#E=Object.assign({},de,a||{}),"any"===e)this.#y=!0,this.#x=null;else if(e){const a=U.from(e);this.#y=!1,this.#x=Promise.resolve(a),setTimeout((()=>{this.emit("network",a,null)}),0)}else this.#y=!1,this.#x=null;this.#v=-1,this.#A=new Map,this.#p=new Map,this.#f=new Map,this.#g=null,this.#m=!1,this.#w=1,this.#_=new Map,this.#I=!1}get pollingInterval(){return this.#E.pollingInterval}get provider(){return this}get plugins(){return Array.from(this.#f.values())}attachPlugin(e){if(this.#f.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#f.set(e.name,e.connect(this)),this}getPlugin(e){return this.#f.get(e)||null}get disableCcipRead(){return this.#I}set disableCcipRead(e){this.#I=!!e}async#C(e){const a=this.#E.cacheTimeout;if(a<0)return await this._perform(e);const t=ee(e.method,e);let c=this.#A.get(t);return c||(c=this._perform(e),this.#A.set(t,c),setTimeout((()=>{this.#A.get(t)===c&&this.#A.delete(t)}),a)),await c}async ccipReadFetch(e,a,t){if(this.disableCcipRead||0===t.length||null==e.to)return null;const c=e.to.toLowerCase(),f=a.toLowerCase(),r=[];for(let a=0;a=500,`response not found during CCIP fetch: ${s}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:n,errorMessage:s}}),r.push(s)}(0,l.vA)(!1,`error encountered during CCIP fetch: ${r.map((e=>JSON.stringify(e))).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:t,errorMessages:r}})}_wrapBlock(e,a){return new $.eB(function(e){const a=S(e);return a.transactions=e.transactions.map((e=>"string"==typeof e?e:R(e))),a}(e),this)}_wrapLog(e,a){return new $.tG(function(e){return L(e)}(e),this)}_wrapTransactionReceipt(e,a){return new $.z5(function(e){return N(e)}(e),this)}_wrapTransactionResponse(e,a){return new $.uI(R(e),this)}_detectNetwork(){(0,l.vA)(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){(0,l.vA)(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=(0,p.WZ)(await this.#C({method:"getBlockNumber"}),"%response");return this.#v>=0&&(this.#v=e),e}_getAddress(e){return(0,i.tG)(e,this)}_getBlockTag(e){if(null==e)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}return(0,h.Lo)(e)?(0,h.Lo)(e,32)?e:(0,p.nD)(e):("bigint"==typeof e&&(e=(0,p.WZ)(e,"blockTag")),"number"==typeof e?e>=0?(0,p.nD)(e):this.#v>=0?(0,p.nD)(this.#v+e):this.getBlockNumber().then((a=>(0,p.nD)(a+e))):void(0,l.MR)(!1,"invalid blockTag","blockTag",e))}_getFilter(e){const a=(e.topics||[]).map((e=>null==e?null:Array.isArray(e)?te(e.map((e=>e.toLowerCase()))):e.toLowerCase())),t="blockHash"in e?e.blockHash:void 0,c=(e,c,f)=>{let d;switch(e.length){case 0:break;case 1:d=e[0];break;default:e.sort(),d=e}if(t&&(null!=c||null!=f))throw new Error("invalid filter");const r={};return d&&(r.address=d),a.length&&(r.topics=a),c&&(r.fromBlock=c),f&&(r.toBlock=f),t&&(r.blockHash=t),r};let f,d,r=[];if(e.address)if(Array.isArray(e.address))for(const a of e.address)r.push(this._getAddress(a));else r.push(this._getAddress(e.address));return"fromBlock"in e&&(f=this._getBlockTag(e.fromBlock)),"toBlock"in e&&(d=this._getBlockTag(e.toBlock)),r.filter((e=>"string"!=typeof e)).length||null!=f&&"string"!=typeof f||null!=d&&"string"!=typeof d?Promise.all([Promise.all(r),f,d]).then((e=>c(e[0],e[1],e[2]))):c(r,f,d)}_getTransactionRequest(e){const a=(0,$.VS)(e),t=[];if(["to","from"].forEach((e=>{if(null==a[e])return;const c=(0,i.tG)(a[e],this);X(c)?t.push(async function(){a[e]=await c}()):a[e]=c})),null!=a.blockTag){const e=this._getBlockTag(a.blockTag);X(e)?t.push(async function(){a.blockTag=await e}()):a.blockTag=e}return t.length?async function(){return await Promise.all(t),a}():a}async getNetwork(){if(null==this.#x){const e=(async()=>{try{const e=await this._detectNetwork();return this.emit("network",e,null),e}catch(a){throw this.#x===e&&(this.#x=null),a}})();return this.#x=e,(await e).clone()}const e=this.#x,[a,t]=await Promise.all([e,this._detectNetwork()]);return a.chainId!==t.chainId&&(this.#y?(this.emit("network",t,a),this.#x===e&&(this.#x=Promise.resolve(t))):(0,l.vA)(!1,`network changed: ${a.chainId} => ${t.chainId} `,"NETWORK_ERROR",{event:"changed"})),a.clone()}async getFeeData(){const e=await this.getNetwork(),a=async()=>{const{_block:a,gasPrice:t,priorityFee:c}=await(0,s.k)({_block:this.#M("latest",!1),gasPrice:(async()=>{try{const e=await this.#C({method:"getGasPrice"});return(0,p.Ab)(e,"%response")}catch(e){}return null})(),priorityFee:(async()=>{try{const e=await this.#C({method:"getPriorityFee"});return(0,p.Ab)(e,"%response")}catch(e){}return null})()});let f=null,d=null;const r=this._wrapBlock(a,e);return r&&r.baseFeePerGas&&(d=null!=c?c:BigInt("1000000000"),f=r.baseFeePerGas*Y+d),new $.J9(t,f,d)},t=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(t){const e=new d.ui(t.url),c=await t.processFunc(a,this,e);return new $.J9(c.gasPrice,c.maxFeePerGas,c.maxPriorityFeePerGas)}return await a()}async estimateGas(e){let a=this._getTransactionRequest(e);return X(a)&&(a=await a),(0,p.Ab)(await this.#C({method:"estimateGas",transaction:a}),"%response")}async#B(e,a,t){(0,l.vA)(t<10,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:a,enableCcipRead:!0})});const c=(0,$.VS)(e);try{return(0,h.c$)(await this._perform({method:"call",transaction:c,blockTag:a}))}catch(e){if(!this.disableCcipRead&&(0,l.E)(e)&&e.data&&t>=0&&"latest"===a&&null!=c.to&&"0x556f1830"===(0,h.ZG)(e.data,0,4)){const f=e.data,d=await(0,i.tG)(c.to,this);let r;try{r=function(e){const a={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};(0,l.vA)((0,h.pO)(e)>=160,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const t=(0,h.ZG)(e,0,32);(0,l.vA)((0,h.ZG)(t,0,12)===(0,h.ZG)(ue,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),a.sender=(0,h.ZG)(t,12);try{const t=[],c=(0,p.WZ)((0,h.ZG)(e,32,64)),f=(0,p.WZ)((0,h.ZG)(e,c,c+32)),d=(0,h.ZG)(e,c+32);for(let e=0;ea[e])),a}((0,h.ZG)(e.data,4))}catch(e){(0,l.vA)(!1,e.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:c,info:{data:f}})}(0,l.vA)(r.sender.toLowerCase()===d.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:f,reason:"OffchainLookup",transaction:c,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:r.errorArgs}});const n=await this.ccipReadFetch(c,r.calldata,r.urls);(0,l.vA)(null!=n,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:c,info:{data:e.data,errorArgs:r.errorArgs}});const b={to:d,data:(0,h.xW)([r.selector,le([n,r.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:b});try{const e=await this.#B(b,a,t+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},b),result:e}),e}catch(e){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},b),error:e}),e}}throw e}}async#k(e){const{value:a}=await(0,s.k)({network:this.getNetwork(),value:e});return a}async call(e){const{tx:a,blockTag:t}=await(0,s.k)({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await this.#k(this.#B(a,t,e.enableCcipRead?0:-1))}async#L(e,a,t){let c=this._getAddress(a),f=this._getBlockTag(t);return"string"==typeof c&&"string"==typeof f||([c,f]=await Promise.all([c,f])),await this.#k(this.#C(Object.assign(e,{address:c,blockTag:f})))}async getBalance(e,a){return(0,p.Ab)(await this.#L({method:"getBalance"},e,a),"%response")}async getTransactionCount(e,a){return(0,p.WZ)(await this.#L({method:"getTransactionCount"},e,a),"%response")}async getCode(e,a){return(0,h.c$)(await this.#L({method:"getCode"},e,a))}async getStorage(e,a,t){const c=(0,p.Ab)(a,"position");return(0,h.c$)(await this.#L({method:"getStorage",position:c},e,t))}async broadcastTransaction(e){const{blockNumber:a,hash:t,network:c}=await(0,s.k)({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),f=y.Z.from(e);if(f.hash!==t)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(f,c).replaceableTransaction(a)}async#M(e,a){if((0,h.Lo)(e,32))return await this.#C({method:"getBlock",blockHash:e,includeTransactions:a});let t=this._getBlockTag(e);return"string"!=typeof t&&(t=await t),await this.#C({method:"getBlock",blockTag:t,includeTransactions:a})}async getBlock(e,a){const{network:t,params:c}=await(0,s.k)({network:this.getNetwork(),params:this.#M(e,!!a)});return null==c?null:this._wrapBlock(c,t)}async getTransaction(e){const{network:a,params:t}=await(0,s.k)({network:this.getNetwork(),params:this.#C({method:"getTransaction",hash:e})});return null==t?null:this._wrapTransactionResponse(t,a)}async getTransactionReceipt(e){const{network:a,params:t}=await(0,s.k)({network:this.getNetwork(),params:this.#C({method:"getTransactionReceipt",hash:e})});if(null==t)return null;if(null==t.gasPrice&&null==t.effectiveGasPrice){const a=await this.#C({method:"getTransaction",hash:e});if(null==a)throw new Error("report this; could not find tx or effectiveGasPrice");t.effectiveGasPrice=a.gasPrice}return this._wrapTransactionReceipt(t,a)}async getTransactionResult(e){const{result:a}=await(0,s.k)({network:this.getNetwork(),result:this.#C({method:"getTransactionResult",hash:e})});return null==a?null:(0,h.c$)(a)}async getLogs(e){let a=this._getFilter(e);X(a)&&(a=await a);const{network:t,params:c}=await(0,s.k)({network:this.getNetwork(),params:this.#C({method:"getLogs",filter:a})});return c.map((e=>this._wrapLog(e,t)))}_getProvider(e){(0,l.vA)(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await v.Pz.fromName(this,e)}async getAvatar(e){const a=await this.getResolver(e);return a?await a.getAvatar():null}async resolveName(e){const a=await this.getResolver(e);return a?await a.getAddress():null}async lookupAddress(e){e=(0,n.b)(e);const a=(0,x.kM)(e.substring(2).toLowerCase()+".addr.reverse");try{const t=await v.Pz.getEnsAddress(this),c=new m.NZ(t,["function resolver(bytes32) view returns (address)"],this),f=await c.resolver(a);if(null==f||f===g.j)return null;const d=new m.NZ(f,["function name(bytes32) view returns (string)"],this),r=await d.name(a);return await this.resolveName(r)!==e?null:r}catch(e){if((0,l.bJ)(e,"BAD_DATA")&&"0x"===e.value)return null;if((0,l.bJ)(e,"CALL_EXCEPTION"))return null;throw e}return null}async waitForTransaction(e,a,t){const c=null!=a?a:1;return 0===c?this.getTransactionReceipt(e):new Promise((async(a,f)=>{let d=null;const r=async t=>{try{const f=await this.getTransactionReceipt(e);if(null!=f&&t-f.blockNumber+1>=c)return a(f),void(d&&(clearTimeout(d),d=null))}catch(e){console.log("EEE",e)}this.once("block",r)};null!=t&&(d=setTimeout((()=>{null!=d&&(d=null,this.off("block",r),f((0,l.xz)("timeout","TIMEOUT",{reason:"timeout"})))}),t)),r(await this.getBlockNumber())}))}async waitForBlock(e){(0,l.vA)(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const a=this.#_.get(e);a&&(a.timer&&clearTimeout(a.timer),this.#_.delete(e))}_setTimeout(e,a){null==a&&(a=0);const t=this.#w++,c=()=>{this.#_.delete(t),e()};if(this.paused)this.#_.set(t,{timer:null,func:c,time:a});else{const e=setTimeout(c,a);this.#_.set(t,{timer:e,func:c,time:fe()})}return t}_forEachSubscriber(e){for(const a of this.#p.values())e(a.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new ae(e.type);case"block":{const e=new G(this);return e.pollingInterval=this.pollingInterval,e}case"safe":case"finalized":return new V(this,e.type);case"event":return new W(this,e.filter);case"transaction":return new J(this,e.hash);case"orphan":return new Z(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,a){for(const t of this.#p.values())if(t.subscriber===e){t.started&&t.subscriber.stop(),t.subscriber=a,t.started&&a.start(),null!=this.#g&&a.pause(this.#g);break}}async#S(e,a){let t=await ce(e,this);return"event"===t.type&&a&&a.length>0&&!0===a[0].removed&&(t=await ce({orphan:"drop-log",log:a[0]},this)),this.#p.get(t.tag)||null}async#T(e){const a=await ce(e,this),t=a.tag;let c=this.#p.get(t);return c||(c={subscriber:this._getSubscriber(a),tag:t,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},this.#p.set(t,c)),c}async on(e,a){const t=await this.#T(e);return t.listeners.push({listener:a,once:!1}),t.started||(t.subscriber.start(),t.started=!0,null!=this.#g&&t.subscriber.pause(this.#g)),this}async once(e,a){const t=await this.#T(e);return t.listeners.push({listener:a,once:!0}),t.started||(t.subscriber.start(),t.started=!0,null!=this.#g&&t.subscriber.pause(this.#g)),this}async emit(e,...a){const t=await this.#S(e,a);if(!t||0===t.listeners.length)return!1;const c=t.listeners.length;return t.listeners=t.listeners.filter((({listener:t,once:c})=>{const f=new A.z(this,c?null:t,e);try{t.call(this,...a,f)}catch(e){}return!c})),0===t.listeners.length&&(t.started&&t.subscriber.stop(),this.#p.delete(t.tag)),c>0}async listenerCount(e){if(e){const a=await this.#S(e);return a?a.listeners.length:0}let a=0;for(const{listeners:e}of this.#p.values())a+=e.length;return a}async listeners(e){if(e){const a=await this.#S(e);return a?a.listeners.map((({listener:e})=>e)):[]}let a=[];for(const{listeners:e}of this.#p.values())a=a.concat(e.map((({listener:e})=>e)));return a}async off(e,a){const t=await this.#S(e);if(!t)return this;if(a){const e=t.listeners.map((({listener:e})=>e)).indexOf(a);e>=0&&t.listeners.splice(e,1)}return a&&0!==t.listeners.length||(t.started&&t.subscriber.stop(),this.#p.delete(t.tag)),this}async removeAllListeners(e){if(e){const{tag:a,started:t,subscriber:c}=await this.#T(e);t&&c.stop(),this.#p.delete(a)}else for(const[e,{started:a,subscriber:t}]of this.#p)a&&t.stop(),this.#p.delete(e);return this}async addListener(e,a){return await this.on(e,a)}async removeListener(e,a){return this.off(e,a)}get destroyed(){return this.#m}destroy(){this.removeAllListeners();for(const e of this.#_.keys())this._clearTimeout(e);this.#m=!0}get paused(){return null!=this.#g}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(this.#v=-1,null!=this.#g){if(this.#g==!!e)return;(0,l.vA)(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber((a=>a.pause(e))),this.#g=!!e;for(const e of this.#_.values())e.timer&&clearTimeout(e.timer),e.time=fe()-e.time}resume(){if(null!=this.#g){this._forEachSubscriber((e=>e.resume())),this.#g=null;for(const e of this.#_.values()){let a=e.time;a<0&&(a=0),e.time=fe(),setTimeout(e.func,a)}}}}function ne(e,a){try{const t=ie(e,a);if(t)return(0,u._v)(t)}catch(e){}return null}function ie(e,a){if("0x"===e)return null;try{const t=(0,p.WZ)((0,h.ZG)(e,a,a+32)),c=(0,p.WZ)((0,h.ZG)(e,t,t+32));return(0,h.ZG)(e,t+32,t+32+c)}catch(e){}return null}function be(e){const a=(0,p.c4)(e);if(a.length>32)throw new Error("internal; should not happen");const t=new Uint8Array(32);return t.set(a,32-a.length),t}function oe(e){if(e.length%32==0)return e;const a=new Uint8Array(32*Math.ceil(e.length/32));return a.set(e),a}const se=new Uint8Array([]);function le(e){const a=[];let t=0;for(let c=0;c((0,l.MR)(e.toLowerCase()===a.toLowerCase(),"transaction from mismatch","tx.from",a),e)))}else t.from=e.getAddress();return await(0,s.k)(t)}class ge{provider;constructor(e){(0,s.n)(this,{provider:e||null})}async getNonce(e){return he(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await pe(this,e)}async populateTransaction(e){const a=he(this,"populateTransaction"),t=await pe(this,e);null==t.nonce&&(t.nonce=await this.getNonce("pending")),null==t.gasLimit&&(t.gasLimit=await this.estimateGas(t));const c=await this.provider.getNetwork();if(null!=t.chainId){const a=(0,p.Ab)(t.chainId);(0,l.MR)(a===c.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else t.chainId=c.chainId;const f=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!f?0!==t.type&&1!==t.type||!f||(0,l.MR)(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e):(0,l.MR)(!1,"eip-1559 transaction do not support gasPrice","tx",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type){const e=await a.getFeeData();(0,l.vA)(null!=e.gasPrice,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice)}else{const e=await a.getFeeData();if(null==t.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(t.type=2,null!=t.gasPrice){const e=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=e,t.maxPriorityFeePerGas=e}else null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?((0,l.vA)(!f,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):(0,l.vA)(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else 2!==t.type&&3!==t.type||(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else t.type=2;return await(0,s.k)(t)}async estimateGas(e){return he(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return he(this,"call").call(await this.populateCall(e))}async resolveName(e){const a=he(this,"resolveName");return await a.resolveName(e)}async sendTransaction(e){const a=he(this,"sendTransaction"),t=await this.populateTransaction(e);delete t.from;const c=y.Z.from(t);return await a.broadcastTransaction(await this.signTransaction(c))}}class me extends ge{address;constructor(e,a){super(a),(0,s.n)(this,{address:e})}async getAddress(){return this.address}connect(e){return new me(this.address,e)}#N(e,a){(0,l.vA)(!1,`VoidSigner cannot sign ${e}`,"UNSUPPORTED_OPERATION",{operation:a})}async signTransaction(e){this.#N("transactions","signTransaction")}async signMessage(e){this.#N("messages","signMessage")}async signTypedData(e,a,t){this.#N("typed-data","signTypedData")}}class xe{#d;#R;#r;#o;#P;#D;constructor(e){this.#d=e,this.#R=null,this.#r=this.#b.bind(this),this.#o=!1,this.#P=null,this.#D=!1}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,a){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}async#b(e){try{null==this.#R&&(this.#R=this._subscribe(this.#d));let e=null;try{e=await this.#R}catch(e){if(!(0,l.bJ)(e,"UNSUPPORTED_OPERATION")||"eth_newFilter"!==e.operation)throw e}if(null==e)return this.#R=null,void this.#d._recoverSubscriber(this,this._recover(this.#d));const a=await this.#d.getNetwork();if(this.#P||(this.#P=a),this.#P.chainId!==a.chainId)throw new Error("chaid changed");if(this.#D)return;const t=await this.#d.send("eth_getFilterChanges",[e]);await this._emitResults(this.#d,t)}catch(e){console.log("@TODO",e)}this.#d.once("block",this.#r)}#O(){const e=this.#R;e&&(this.#R=null,e.then((e=>{this.#d.destroyed||this.#d.send("eth_uninstallFilter",[e])})))}start(){this.#o||(this.#o=!0,this.#b(-2))}stop(){this.#o&&(this.#o=!1,this.#D=!0,this.#O(),this.#d.off("block",this.#r))}pause(e){e&&this.#O(),this.#d.off("block",this.#r)}resume(){this.start()}}class ye extends xe{#F;constructor(e,a){var t;super(e),this.#F=(t=a,JSON.parse(JSON.stringify(t)))}_recover(e){return new W(e,this.#F)}async _subscribe(e){return await e.send("eth_newFilter",[this.#F])}async _emitResults(e,a){for(const t of a)e.emit(this.#F,e._wrapLog(t,e._network))}}class Ae extends xe{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,a){for(const t of a)e.emit("pending",t)}}const ve="bigint,boolean,function,number,string,symbol".split(/,/g);function we(e){if(null==e||ve.indexOf(typeof e)>=0)return e;if("function"==typeof e.getAddress)return e;if(Array.isArray(e))return e.map(we);if("object"==typeof e)return Object.keys(e).reduce(((a,t)=>(a[t]=e[t],a)),{});throw new Error(`should not happen: ${e} (${typeof e})`)}function _e(e){return new Promise((a=>{setTimeout(a,e)}))}function Ie(e){return e?e.toLowerCase():e}function Ee(e){return e&&"number"==typeof e.pollingInterval}const Ce={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class Me extends ge{address;constructor(e,a){super(e),a=(0,n.b)(a),(0,s.n)(this,{address:a})}connect(e){(0,l.vA)(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(e){return await this.populateCall(e)}async sendUncheckedTransaction(e){const a=we(e),t=[];if(a.from){const c=a.from;t.push((async()=>{const t=await(0,i.tG)(c,this.provider);(0,l.MR)(null!=t&&t.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),a.from=t})())}else a.from=this.address;if(null==a.gasLimit&&t.push((async()=>{a.gasLimit=await this.provider.estimateGas({...a,from:this.address})})()),null!=a.to){const e=a.to;t.push((async()=>{a.to=await(0,i.tG)(e,this.provider)})())}t.length&&await Promise.all(t);const c=this.provider.getRpcTransaction(a);return this.provider.send("eth_sendTransaction",[c])}async sendTransaction(e){const a=await this.provider.getBlockNumber(),t=await this.sendUncheckedTransaction(e);return await new Promise(((e,c)=>{const f=[1e3,100];let d=0;const r=async()=>{try{const c=await this.provider.getTransaction(t);if(null!=c)return void e(c.replaceableTransaction(a))}catch(e){if((0,l.bJ)(e,"CANCELLED")||(0,l.bJ)(e,"BAD_DATA")||(0,l.bJ)(e,"NETWORK_ERROR")||(0,l.bJ)(e,"UNSUPPORTED_OPERATION"))return null==e.info&&(e.info={}),e.info.sendTransactionHash=t,void c(e);if((0,l.bJ)(e,"INVALID_ARGUMENT")&&(d++,null==e.info&&(e.info={}),e.info.sendTransactionHash=t,d>10))return void c(e);this.provider.emit("error",(0,l.xz)("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:e}))}this.provider._setTimeout((()=>{r()}),f.pop()||4e3)};r()}))}async signTransaction(e){const a=we(e);if(a.from){const t=await(0,i.tG)(a.from,this.provider);(0,l.MR)(null!=t&&t.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),a.from=t}else a.from=this.address;const t=this.provider.getRpcTransaction(a);return await this.provider.send("eth_signTransaction",[t])}async signMessage(e){const a="string"==typeof e?(0,u.YW)(e):e;return await this.provider.send("personal_sign",[(0,h.c$)(a),this.address.toLowerCase()])}async signTypedData(e,a,t){const c=we(t),f=await b.z.resolveNames(e,a,c,(async e=>{const a=await(0,i.tG)(e);return(0,l.MR)(null!=a,"TypedData does not support null address","value",e),a}));return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(b.z.getPayload(f.domain,a,f.value))])}async unlock(e){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),e,null])}async _legacySignMessage(e){const a="string"==typeof e?(0,u.YW)(e):e;return await this.provider.send("eth_sign",[this.address.toLowerCase(),(0,h.c$)(a)])}}class Be extends re{#E;#Q;#U;#j;#H;#P;#q;#$(){if(this.#j)return;const e=1===this._getOption("batchMaxCount")?0:this._getOption("batchStallTime");this.#j=setTimeout((()=>{this.#j=null;const e=this.#U;for(this.#U=[];e.length;){const a=[e.shift()];for(;e.length&&a.length!==this.#E.batchMaxCount;)if(a.push(e.shift()),JSON.stringify(a.map((e=>e.payload))).length>this.#E.batchMaxSize){e.unshift(a.pop());break}(async()=>{const e=1===a.length?a[0].payload:a.map((e=>e.payload));this.emit("debug",{action:"sendRpcPayload",payload:e});try{const t=await this._send(e);this.emit("debug",{action:"receiveRpcResult",result:t});for(const{resolve:e,reject:c,payload:f}of a){if(this.destroyed){c((0,l.xz)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:f.method}));continue}const a=t.filter((e=>e.id===f.id))[0];if(null!=a)"error"in a?c(this.getRpcError(f,a)):e(a.result);else{const e=(0,l.xz)("missing response for request","BAD_DATA",{value:t,info:{payload:f}});this.emit("error",e),c(e)}}}catch(e){this.emit("debug",{action:"receiveRpcError",error:e});for(const{reject:t}of a)t(e)}})()}}),e)}constructor(e,a){super(e,a),this.#Q=1,this.#E=Object.assign({},Ce,a||{}),this.#U=[],this.#j=null,this.#P=null,this.#q=null;{let e=null;const a=new Promise((a=>{e=a}));this.#H={promise:a,resolve:e}}const t=this._getOption("staticNetwork");"boolean"==typeof t?((0,l.MR)(!t||"any"!==e,"staticNetwork cannot be used on special network 'any'","options",a),t&&null!=e&&(this.#P=U.from(e))):t&&((0,l.MR)(null==e||t.matches(e),"staticNetwork MUST match network object","options",a),this.#P=t)}_getOption(e){return this.#E[e]}get _network(){return(0,l.vA)(this.#P,"network is not available yet","NETWORK_ERROR"),this.#P}async _perform(e){if("call"===e.method||"estimateGas"===e.method){let a=e.transaction;if(a&&null!=a.type&&(0,p.Ab)(a.type)&&null==a.maxFeePerGas&&null==a.maxPriorityFeePerGas){const t=await this.getFeeData();null==t.maxFeePerGas&&null==t.maxPriorityFeePerGas&&(e=Object.assign({},e,{transaction:Object.assign({},a,{type:void 0})}))}}const a=this.getRpcRequest(e);return null!=a?await this.send(a.method,a.args):super._perform(e)}async _detectNetwork(){const e=this._getOption("staticNetwork");if(e){if(!0!==e)return e;if(this.#P)return this.#P}return this.#q?await this.#q:this.ready?(this.#q=(async()=>{try{const e=U.from((0,p.Ab)(await this.send("eth_chainId",[])));return this.#q=null,e}catch(e){throw this.#q=null,e}})(),await this.#q):(this.#q=(async()=>{const e={id:this.#Q++,method:"eth_chainId",params:[],jsonrpc:"2.0"};let a;this.emit("debug",{action:"sendRpcPayload",payload:e});try{a=(await this._send(e))[0],this.#q=null}catch(e){throw this.#q=null,this.emit("debug",{action:"receiveRpcError",error:e}),e}if(this.emit("debug",{action:"receiveRpcResult",result:a}),"result"in a)return U.from((0,p.Ab)(a.result));throw this.getRpcError(e,a)})(),await this.#q)}_start(){null!=this.#H&&null!=this.#H.resolve&&(this.#H.resolve(),this.#H=null,(async()=>{for(;null==this.#P&&!this.destroyed;)try{this.#P=await this._detectNetwork()}catch(e){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",(0,l.xz)("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:e}})),await _e(1e3)}this.#$()})())}async _waitUntilReady(){if(null!=this.#H)return await this.#H.promise}_getSubscriber(e){return"pending"===e.type?new Ae(this):"event"===e.type?this._getOption("polling")?new W(this,e.filter):new ye(this,e.filter):"orphan"===e.type&&"drop-log"===e.filter.orphan?new ae("orphan"):super._getSubscriber(e)}get ready(){return null==this.#H}getRpcTransaction(e){const a={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((t=>{if(null==e[t])return;let c=t;"gasLimit"===t&&(c="gas"),a[c]=(0,p.nD)((0,p.Ab)(e[t],`tx.${t}`))})),["from","to","data"].forEach((t=>{null!=e[t]&&(a[t]=(0,h.c$)(e[t]))})),e.accessList&&(a.accessList=(0,o.$)(e.accessList)),e.blobVersionedHashes&&(a.blobVersionedHashes=e.blobVersionedHashes.map((e=>e.toLowerCase()))),a}getRpcRequest(e){switch(e.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[Ie(e.address),e.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[Ie(e.address),e.blockTag]};case"getCode":return{method:"eth_getCode",args:[Ie(e.address),e.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[Ie(e.address),"0x"+e.position.toString(16),e.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[e.signedTransaction]};case"getBlock":if("blockTag"in e)return{method:"eth_getBlockByNumber",args:[e.blockTag,!!e.includeTransactions]};if("blockHash"in e)return{method:"eth_getBlockByHash",args:[e.blockHash,!!e.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[e.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[e.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(e.transaction),e.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(e.transaction)]};case"getLogs":return e.filter&&null!=e.filter.address&&(Array.isArray(e.filter.address)?e.filter.address=e.filter.address.map(Ie):e.filter.address=Ie(e.filter.address)),{method:"eth_getLogs",args:[e.filter]}}return null}getRpcError(e,a){const{method:t}=e,{error:c}=a;if("eth_estimateGas"===t&&c.message){const a=c.message;if(!a.match(/revert/i)&&a.match(/insufficient funds/i))return(0,l.xz)("insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.params[0],info:{payload:e,error:c}})}if("eth_call"===t||"eth_estimateGas"===t){const a=Se(c),f=r.y.getBuiltinCallException("eth_call"===t?"call":"estimateGas",e.params[0],a?a.data:null);return f.info={error:c,payload:e},f}const f=JSON.stringify(function(e){const a=[];return Te(e,a),a}(c));if("string"==typeof c.message&&c.message.match(/user denied|ethers-user-denied/i)){const a={eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"};return(0,l.xz)("user rejected action","ACTION_REJECTED",{action:a[t]||"unknown",reason:"rejected",info:{payload:e,error:c}})}if("eth_sendRawTransaction"===t||"eth_sendTransaction"===t){const a=e.params[0];if(f.match(/insufficient funds|base fee exceeds gas limit/i))return(0,l.xz)("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:a,info:{error:c}});if(f.match(/nonce/i)&&f.match(/too low/i))return(0,l.xz)("nonce has already been used","NONCE_EXPIRED",{transaction:a,info:{error:c}});if(f.match(/replacement transaction/i)&&f.match(/underpriced/i))return(0,l.xz)("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:a,info:{error:c}});if(f.match(/only replay-protected/i))return(0,l.xz)("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:t,info:{transaction:a,info:{error:c}}})}let d=!!f.match(/the method .* does not exist/i);return d||c&&c.details&&c.details.startsWith("Unauthorized method:")&&(d=!0),d?(0,l.xz)("unsupported operation","UNSUPPORTED_OPERATION",{operation:e.method,info:{error:c,payload:e}}):(0,l.xz)("could not coalesce error","UNKNOWN_ERROR",{error:c,payload:e})}send(e,a){if(this.destroyed)return Promise.reject((0,l.xz)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e}));const t=this.#Q++,c=new Promise(((c,f)=>{this.#U.push({resolve:c,reject:f,payload:{method:e,params:a,id:t,jsonrpc:"2.0"}})}));return this.#$(),c}async getSigner(e){null==e&&(e=0);const a=this.send("eth_accounts",[]);if("number"==typeof e){const t=await a;if(e>=t.length)throw new Error("no such account");return new Me(this,t[e])}const{accounts:t}=await(0,s.k)({network:this.getNetwork(),accounts:a});e=(0,n.b)(e);for(const a of t)if((0,n.b)(a)===e)return new Me(this,e);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map((e=>new Me(this,e)))}destroy(){this.#j&&(clearTimeout(this.#j),this.#j=null);for(const{payload:e,reject:a}of this.#U)a((0,l.xz)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e.method}));this.#U=[],super.destroy()}}class ke extends Be{#z;constructor(e,a){super(e,a);let t=this._getOption("pollingInterval");null==t&&(t=Ce.pollingInterval),this.#z=t}_getSubscriber(e){const a=super._getSubscriber(e);return Ee(a)&&(a.pollingInterval=this.#z),a}get pollingInterval(){return this.#z}set pollingInterval(e){if(!Number.isInteger(e)||e<0)throw new Error("invalid interval");this.#z=e,this._forEachSubscriber((e=>{Ee(e)&&(e.pollingInterval=this.#z)}))}}class Le extends ke{#G;constructor(e,a,t){null==e&&(e="http://localhost:8545"),super(a,t),this.#G="string"==typeof e?new d.ui(e):e.clone()}_getConnection(){return this.#G.clone()}async send(e,a){return await this._start(),await super.send(e,a)}async _send(e){const a=this._getConnection();a.body=JSON.stringify(e),a.setHeader("content-type","application/json");const t=await a.send();t.assertOk();let c=t.bodyJson;return Array.isArray(c)||(c=[c]),c}}function Se(e){if(null==e)return null;if("string"==typeof e.message&&e.message.match(/revert/i)&&(0,h.Lo)(e.data))return{message:e.message,data:e.data};if("object"==typeof e){for(const a in e){const t=Se(e[a]);if(t)return t}return null}if("string"==typeof e)try{return Se(JSON.parse(e))}catch(e){}return null}function Te(e,a){if(null!=e){if("string"==typeof e.message&&a.push(e.message),"object"==typeof e)for(const t in e)Te(e[t],a);if("string"==typeof e)try{return Te(JSON.parse(e),a)}catch(e){}}}var Ne=t(72588),Re=t(2011);var Pe=t(20415);class De extends ge{address;#K;constructor(e,a){super(a),(0,l.MR)(e&&"function"==typeof e.sign,"invalid private key","privateKey","[ REDACTED ]"),this.#K=e;const t=(0,Pe.K)(this.signingKey.publicKey);(0,s.n)(this,{address:t})}get signingKey(){return this.#K}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(e){return new De(this.#K,e)}async signTransaction(e){e=(0,$.VS)(e);const{to:a,from:t}=await(0,s.k)({to:e.to?(0,i.tG)(e.to,this.provider):void 0,from:e.from?(0,i.tG)(e.from,this.provider):void 0});null!=a&&(e.to=a),null!=t&&(e.from=t),null!=e.from&&((0,l.MR)((0,n.b)(e.from)===this.address,"transaction from address mismatch","tx.from",e.from),delete e.from);const c=y.Z.from(e);return c.signature=this.signingKey.sign(c.unsignedHash),c.serialized}async signMessage(e){return this.signMessageSync(e)}signMessageSync(e){return this.signingKey.sign(function(e){return"string"==typeof e&&(e=(0,u.YW)(e)),(0,Re.S)((0,h.xW)([(0,u.YW)("Ethereum Signed Message:\n"),(0,u.YW)(String(e.length)),e]))}(e)).serialized}async signTypedData(e,a,t){const c=await b.z.resolveNames(e,a,t,(async e=>{(0,l.vA)(null!=this.provider,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:e}});const a=await this.provider.resolveName(e);return(0,l.vA)(null!=a,"unconfigured ENS name","UNCONFIGURED_NAME",{value:e}),a}));return this.signingKey.sign(b.z.hash(c.domain,a,c.value)).serialized}}var Oe=t(68650),Fe=t(68682);let Qe=!1;const Ue=function(e,a,t){return(0,Fe.Gz)(e,a).update(t).digest()};let je=Ue;function He(e,a,t){const c=(0,h.q5)(a,"key"),f=(0,h.q5)(t,"data");return(0,h.c$)(je(e,c,f))}He._=Ue,He.lock=function(){Qe=!0},He.register=function(e){if(Qe)throw new Error("computeHmac is locked");je=e},Object.freeze(He);var qe=t(6800),$e=t(32531);const ze=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Ge=Uint8Array.from({length:16},((e,a)=>a));let Ke=[Ge],Ve=[Ge.map((e=>(9*e+5)%16))];for(let e=0;e<4;e++)for(let a of[Ke,Ve])a.push(a[e].map((e=>ze[e])));const Ze=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map((e=>new Uint8Array(e))),Je=Ke.map(((e,a)=>e.map((e=>Ze[a][e])))),We=Ve.map(((e,a)=>e.map((e=>Ze[a][e])))),Ye=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),Xe=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),ea=(e,a)=>e<>>32-a;function aa(e,a,t,c){return 0===e?a^t^c:1===e?a&t|~a&c:2===e?(a|~t)^c:3===e?a&c|t&~c:a^(t|~c)}const ta=new Uint32Array(16);class ca extends qe.D{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:a,h2:t,h3:c,h4:f}=this;return[e,a,t,c,f]}set(e,a,t,c,f){this.h0=0|e,this.h1=0|a,this.h2=0|t,this.h3=0|c,this.h4=0|f}process(e,a){for(let t=0;t<16;t++,a+=4)ta[t]=e.getUint32(a,!0);let t=0|this.h0,c=t,f=0|this.h1,d=f,r=0|this.h2,n=r,i=0|this.h3,b=i,o=0|this.h4,s=o;for(let e=0;e<5;e++){const a=4-e,l=Ye[e],u=Xe[e],h=Ke[e],p=Ve[e],g=Je[e],m=We[e];for(let a=0;a<16;a++){const c=ea(t+aa(e,f,r,i)+ta[h[a]]+l,g[a])+o|0;t=o,o=i,i=0|ea(r,10),r=f,f=c}for(let e=0;e<16;e++){const t=ea(c+aa(a,d,n,b)+ta[p[e]]+u,m[e])+s|0;c=s,s=b,b=0|ea(n,10),n=d,d=t}}this.set(this.h1+r+b|0,this.h2+i+s|0,this.h3+o+c|0,this.h4+t+d|0,this.h0+f+n|0)}roundClean(){ta.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const fa=(0,$e.ld)((()=>new ca));let da=!1;const ra=function(e){return fa(e)};let na=ra;function ia(e){const a=(0,h.q5)(e,"data");return(0,h.c$)(na(a))}ia._=ra,ia.lock=function(){da=!0},ia.register=function(e){if(da)throw new TypeError("ripemd160 is locked");na=e},Object.freeze(ia);let ba=!1;const oa=function(e){return new Uint8Array((0,Fe.po)(e))};let sa=oa;function la(e){return sa(e)}la._=oa,la.lock=function(){ba=!0},la.register=function(e){if(ba)throw new Error("randomBytes is locked");sa=e},Object.freeze(la);var ua=t(14132),ha=t(38264);const pa=/^[a-z]*$/i;function ga(e,a){let t=97;return e.reduce(((e,c)=>(c===a?t++:c.match(pa)?e.push(String.fromCharCode(t)+c):(t=97,e.push(c)),e)),[])}class ma{locale;constructor(e){(0,s.n)(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(" ")}}class xa extends ma{#V;#Z;constructor(e,a,t){super(e),this.#V=a,this.#Z=t,this.#J=null}get _data(){return this.#V}_decodeWords(){return e=this.#V,(0,l.MR)("0"===e[0],"unsupported auwl data","data",e),function(e,a){for(let t=28;t>=0;t--)e=e.split(" !#$%&'()*+,-./<=>?@[]^_`{|}~"[t]).join(a.substring(2*t,2*t+2));const t=[],c=e.replace(/(:|([0-9])|([A-Z][a-z]*))/g,((e,a,c,f)=>{if(c)for(let e=parseInt(c);e>=0;e--)t.push(";");else t.push(a.toLowerCase());return""}));if(c)throw new Error(`leftovers: ${JSON.stringify(c)}`);return ga(ga(t,";"),":")}(e.substring(59),e.substring(1,59));var e}#J;#W(){if(null==this.#J){const e=this._decodeWords();if((0,ha.id)(e.join("\n")+"\n")!==this.#Z)throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);this.#J=e}return this.#J}getWord(e){const a=this.#W();return(0,l.MR)(e>=0&&eurAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-EgSe0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-PM&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryFN Noc|PutQuirySSue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurEAyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO","0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60")}static wordlist(){return null==ya&&(ya=new Aa),ya}}let va=!1;const wa=function(e,a,t,c,f){return(0,Fe.T_)(e,a,t,c,f)};let _a=wa;function Ia(e,a,t,c,f){const d=(0,h.q5)(e,"password"),r=(0,h.q5)(a,"salt");return(0,h.c$)(_a(d,r,t,c,f))}function Ea(e){return(1<=12&&t.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const c=new Uint8Array(Math.ceil(11*t.length/8));let f=0;for(let e=0;e=0,`invalid mnemonic word at index ${e}`,"mnemonic","[ REDACTED ]");for(let e=0;e<11;e++)d&1<<10-e&&(c[f>>3]|=1<<7-f%8),f++}const d=32*t.length/3,r=Ea(t.length/3),n=(0,h.q5)((0,Oe.s)(c.slice(0,d/8)))[0]&r;return(0,l.MR)(n===(c[c.length-1]&r),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),(0,h.c$)(c.slice(0,d/8))}function Ma(e,a){(0,l.MR)(e.length%4==0&&e.length>=16&&e.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),null==a&&(a=Aa.wordlist());const t=[0];let c=11;for(let a=0;a8?(t[t.length-1]<<=8,t[t.length-1]|=e[a],c-=8):(t[t.length-1]<<=c,t[t.length-1]|=e[a]>>8-c,t.push(e[a]&(1<<8-c)-1&255),c+=3);const f=e.length/4,d=parseInt((0,Oe.s)(e).substring(2,4),16)&Ea(f);return t[t.length-1]<<=f,t[t.length-1]|=d>>8-f,a.join(t.map((e=>a.getWord(e))))}Ia._=wa,Ia.lock=function(){va=!0},Ia.register=function(e){if(va)throw new Error("pbkdf2 is locked");_a=e},Object.freeze(Ia);const Ba={};class ka{phrase;password;wordlist;entropy;constructor(e,a,t,c,f){null==c&&(c=""),null==f&&(f=Aa.wordlist()),(0,l.gk)(e,Ba,"Mnemonic"),(0,s.n)(this,{phrase:t,password:c,wordlist:f,entropy:a})}computeSeed(){const e=(0,u.YW)("mnemonic"+this.password,"NFKD");return Ia((0,u.YW)(this.phrase,"NFKD"),e,2048,64,"sha512")}static fromPhrase(e,a,t){const c=Ca(e,t);return e=Ma((0,h.q5)(c),t),new ka(Ba,c,e,a,t)}static fromEntropy(e,a,t){const c=(0,h.q5)(e,"entropy"),f=Ma(c,t);return new ka(Ba,(0,h.c$)(c),f,a,t)}static entropyToPhrase(e,a){return Ma((0,h.q5)(e,"entropy"),a)}static phraseToEntropy(e,a){return Ca(e,a)}static isValidMnemonic(e,a){try{return Ca(e,a),!0}catch(e){}return!1}}var La,Sa,Ta,Na=function(e,a,t,c){if("a"===t&&!c)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof a?e!==a||!c:!a.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?c:"a"===t?c.call(e):c?c.value:a.get(e)},Ra=function(e,a,t,c,f){if("m"===c)throw new TypeError("Private method is not writable");if("a"===c&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof a?e!==a||!f:!a.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===c?f.call(e,t):f?f.value=t:a.set(e,t),t};const Pa={16:10,24:12,32:14},Da=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],Oa=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],Fa=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],Qa=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],Ua=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],ja=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],Ha=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],qa=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],$a=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],za=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],Ga=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],Ka=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],Va=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],Za=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],Ja=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function Wa(e){const a=[];for(let t=0;t>2,Na(this,Ta,"f")[d][e%4]=f[e],Na(this,Sa,"f")[a-d][e%4]=f[e];let r,n=0,i=c;for(;i>16&255]<<24^Oa[r>>8&255]<<16^Oa[255&r]<<8^Oa[r>>24&255]^Da[n]<<24,n+=1,8!=c)for(let e=1;e>8&255]<<8^Oa[r>>16&255]<<16^Oa[r>>24&255]<<24;for(let e=c/2+1;e>2,d=i%4,Na(this,Ta,"f")[e][d]=f[b],Na(this,Sa,"f")[a-e][d]=f[b++],i++}for(let e=1;e>24&255]^Va[r>>16&255]^Za[r>>8&255]^Ja[255&r]}encrypt(e){if(16!=e.length)throw new TypeError("invalid plaintext size (must be 16 bytes)");const a=Na(this,Ta,"f").length-1,t=[0,0,0,0];let c=Wa(e);for(let e=0;e<4;e++)c[e]^=Na(this,Ta,"f")[0][e];for(let e=1;e>24&255]^Ua[c[(a+1)%4]>>16&255]^ja[c[(a+2)%4]>>8&255]^Ha[255&c[(a+3)%4]]^Na(this,Ta,"f")[e][a];c=t.slice()}const f=new Uint8Array(16);let d=0;for(let e=0;e<4;e++)d=Na(this,Ta,"f")[a][e],f[4*e]=255&(Oa[c[e]>>24&255]^d>>24),f[4*e+1]=255&(Oa[c[(e+1)%4]>>16&255]^d>>16),f[4*e+2]=255&(Oa[c[(e+2)%4]>>8&255]^d>>8),f[4*e+3]=255&(Oa[255&c[(e+3)%4]]^d);return f}decrypt(e){if(16!=e.length)throw new TypeError("invalid ciphertext size (must be 16 bytes)");const a=Na(this,Sa,"f").length-1,t=[0,0,0,0];let c=Wa(e);for(let e=0;e<4;e++)c[e]^=Na(this,Sa,"f")[0][e];for(let e=1;e>24&255]^$a[c[(a+3)%4]>>16&255]^za[c[(a+2)%4]>>8&255]^Ga[255&c[(a+1)%4]]^Na(this,Sa,"f")[e][a];c=t.slice()}const f=new Uint8Array(16);let d=0;for(let e=0;e<4;e++)d=Na(this,Sa,"f")[a][e],f[4*e]=255&(Fa[c[e]>>24&255]^d>>24),f[4*e+1]=255&(Fa[c[(e+3)%4]>>16&255]^d>>16),f[4*e+2]=255&(Fa[c[(e+2)%4]>>8&255]^d>>8),f[4*e+3]=255&(Fa[255&c[(e+1)%4]]^d);return f}}La=new WeakMap,Sa=new WeakMap,Ta=new WeakMap;class Xa{constructor(e,a,t){if(t&&!(this instanceof t))throw new Error(`${e} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new Ya(a)},name:{enumerable:!0,value:e}})}}var et,at,tt=function(e,a,t,c,f){if("m"===c)throw new TypeError("Private method is not writable");if("a"===c&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof a?e!==a||!f:!a.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===c?f.call(e,t):f?f.value=t:a.set(e,t),t},ct=function(e,a,t,c){if("a"===t&&!c)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof a?e!==a||!c:!a.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?c:"a"===t?c.call(e):c?c.value:a.get(e)};class ft extends Xa{constructor(e,a){if(super("ECC",e,ft),et.set(this,void 0),at.set(this,void 0),a){if(a.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");tt(this,et,new Uint8Array(a),"f")}else tt(this,et,new Uint8Array(16),"f");tt(this,at,this.iv,"f")}get iv(){return new Uint8Array(ct(this,et,"f"))}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const a=new Uint8Array(e.length);for(let t=0;tNumber.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let a=15;a>=0;--a)bt(this,nt,"f")[a]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(16!==e.length)throw new TypeError("invalid counter initial Uint8Array value length");bt(this,nt,"f").set(e)}increment(){for(let e=15;e>=0;e--){if(255!==bt(this,nt,"f")[e]){bt(this,nt,"f")[e]++;break}bt(this,nt,"f")[e]=0}}encrypt(e){var a,t;const c=new Uint8Array(e);for(let e=0;ee<>>32-a;function pt(e,a,t,c,f,d){let r=e[a++]^t[c++],n=e[a++]^t[c++],i=e[a++]^t[c++],b=e[a++]^t[c++],o=e[a++]^t[c++],s=e[a++]^t[c++],l=e[a++]^t[c++],u=e[a++]^t[c++],h=e[a++]^t[c++],p=e[a++]^t[c++],g=e[a++]^t[c++],m=e[a++]^t[c++],x=e[a++]^t[c++],y=e[a++]^t[c++],A=e[a++]^t[c++],v=e[a++]^t[c++],w=r,_=n,I=i,E=b,C=o,M=s,B=l,k=u,L=h,S=p,T=g,N=m,R=x,P=y,D=A,O=v;for(let e=0;e<8;e+=2)C^=ht(w+R|0,7),L^=ht(C+w|0,9),R^=ht(L+C|0,13),w^=ht(R+L|0,18),S^=ht(M+_|0,7),P^=ht(S+M|0,9),_^=ht(P+S|0,13),M^=ht(_+P|0,18),D^=ht(T+B|0,7),I^=ht(D+T|0,9),B^=ht(I+D|0,13),T^=ht(B+I|0,18),E^=ht(O+N|0,7),k^=ht(E+O|0,9),N^=ht(k+E|0,13),O^=ht(N+k|0,18),_^=ht(w+E|0,7),I^=ht(_+w|0,9),E^=ht(I+_|0,13),w^=ht(E+I|0,18),B^=ht(M+C|0,7),k^=ht(B+M|0,9),C^=ht(k+B|0,13),M^=ht(C+k|0,18),N^=ht(T+S|0,7),L^=ht(N+T|0,9),S^=ht(L+N|0,13),T^=ht(S+L|0,18),R^=ht(O+D|0,7),P^=ht(R+O|0,9),D^=ht(P+R|0,13),O^=ht(D+P|0,18);f[d++]=r+w|0,f[d++]=n+_|0,f[d++]=i+I|0,f[d++]=b+E|0,f[d++]=o+C|0,f[d++]=s+M|0,f[d++]=l+B|0,f[d++]=u+k|0,f[d++]=h+L|0,f[d++]=p+S|0,f[d++]=g+T|0,f[d++]=m+N|0,f[d++]=x+R|0,f[d++]=y+P|0,f[d++]=A+D|0,f[d++]=v+O|0}function gt(e,a,t,c,f){let d=c+0,r=c+16*f;for(let c=0;c<16;c++)t[r+c]=e[a+16*(2*f-1)+c];for(let c=0;c0&&(r+=16),pt(t,d,e,a+=16,t,r)}function mt(e,a,t){const c=(0,$e.tY)({dkLen:32,asyncTick:10,maxmem:1073742848},t),{N:f,r:d,p:r,dkLen:n,asyncTick:i,maxmem:b,onProgress:o}=c;if((0,st.ai)(f),(0,st.ai)(d),(0,st.ai)(r),(0,st.ai)(n),(0,st.ai)(i),(0,st.ai)(b),void 0!==o&&"function"!=typeof o)throw new Error("progressCb should be function");const s=128*d,l=s/4;if(f<=1||f&f-1||f>=2**(s/8)||f>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(r<0||r>137438953440/s)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(n<0||n>137438953440)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const u=s*(f+r);if(u>b)throw new Error(`Scrypt: parameters too large, ${u} (128 * r * (N + p)) > ${b} (maxmem)`);const h=(0,ut.A)(lt.s,e,a,{c:1,dkLen:s*r}),p=(0,$e.DH)(h),g=(0,$e.DH)(new Uint8Array(s*f)),m=(0,$e.DH)(new Uint8Array(s));let x=()=>{};if(o){const e=2*f*r,a=Math.max(Math.floor(e/1e4),1);let t=0;x=()=>{t++,!o||t%a&&t!==e||o(t/e)}}return{N:f,r:d,p:r,dkLen:n,blockSize32:l,V:g,B32:p,B:h,tmp:m,blockMixCb:x,asyncTick:i}}function xt(e,a,t,c,f){const d=(0,ut.A)(lt.s,e,t,{c:1,dkLen:a});return t.fill(0),c.fill(0),f.fill(0),d}let yt=!1,At=!1;const vt=async function(e,a,t,c,f,d,r){return await async function(e,a,t){const{N:c,r:f,p:d,dkLen:r,blockSize32:n,V:i,B32:b,B:o,tmp:s,blockMixCb:l,asyncTick:u}=mt(e,a,t);for(let e=0;e{gt(i,t,i,t+=n,f),l()})),gt(i,(c-1)*n,b,a,f),l(),await(0,$e.$h)(c,u,(()=>{const e=b[a+n-16]%c;for(let t=0;t0&&!(c&c-1),"invalid kdf.N","kdf.N",c),(0,l.MR)(f>0&&d>0,"invalid kdf","kdf",a);const r=St(e,"crypto.kdfparams.dklen:int!");return(0,l.MR)(32===r,"invalid kdf.dklen","kdf.dflen",r),{name:"scrypt",salt:t,N:c,r:f,p:d,dkLen:64}}if("pbkdf2"===a.toLowerCase()){const a=St(e,"crypto.kdfparams.salt:data!"),t=St(e,"crypto.kdfparams.prf:string!"),c=t.split("-").pop();(0,l.MR)("sha256"===c||"sha512"===c,"invalid kdf.pdf","kdf.pdf",t);const f=St(e,"crypto.kdfparams.c:int!"),d=St(e,"crypto.kdfparams.dklen:int!");return(0,l.MR)(32===d,"invalid kdf.dklen","kdf.dklen",d),{name:"pbkdf2",salt:a,count:f,dkLen:d,algorithm:c}}}(0,l.MR)(!1,"unsupported key-derivation function","kdf",a)}function Ot(e){return new Promise((a=>{setTimeout((()=>{a()}),e)}))}function Ft(e){const a=null!=e.salt?(0,h.q5)(e.salt,"options.salt"):la(32);let t=1<<17,c=8,f=1;return e.scrypt&&(e.scrypt.N&&(t=e.scrypt.N),e.scrypt.r&&(c=e.scrypt.r),e.scrypt.p&&(f=e.scrypt.p)),(0,l.MR)("number"==typeof t&&t>0&&Number.isSafeInteger(t)&&(BigInt(t)&BigInt(t-1))===BigInt(0),"invalid scrypt N parameter","options.N",t),(0,l.MR)("number"==typeof c&&c>0&&Number.isSafeInteger(c),"invalid scrypt r parameter","options.r",c),(0,l.MR)("number"==typeof f&&f>0&&Number.isSafeInteger(f),"invalid scrypt p parameter","options.p",f),{name:"scrypt",dkLen:32,salt:a,N:t,r:c,p:f}}function Qt(e,a,t,c){const f=(0,h.q5)(t.privateKey,"privateKey"),d=null!=c.iv?(0,h.q5)(c.iv,"options.iv"):la(16);(0,l.MR)(16===d.length,"invalid options.iv length","options.iv",c.iv);const r=null!=c.uuid?(0,h.q5)(c.uuid,"options.uuid"):la(16);(0,l.MR)(16===r.length,"invalid options.uuid length","options.uuid",c.iv);const n=e.slice(0,16),i=e.slice(16,32),b=new ot(n,d),o=(0,h.q5)(b.encrypt(f)),s=(0,Re.S)((0,h.xW)([i,o])),u={address:t.address.substring(2).toLowerCase(),id:Mt(r),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,h.c$)(d).substring(2)},ciphertext:(0,h.c$)(o).substring(2),kdf:"scrypt",kdfparams:{salt:(0,h.c$)(a.salt).substring(2),n:a.N,dklen:32,p:a.p,r:a.r},mac:s.substring(2)}};if(t.mnemonic){const a=null!=c.client?c.client:`ethers/${Tt.r}`,f=t.mnemonic.path||Nt,d=t.mnemonic.locale||"en",r=e.slice(32,64),n=(0,h.q5)(t.mnemonic.entropy,"account.mnemonic.entropy"),i=la(16),b=new ot(r,i),o=(0,h.q5)(b.encrypt(n)),s=new Date,l="UTC--"+s.getUTCFullYear()+"-"+kt(s.getUTCMonth()+1,2)+"-"+kt(s.getUTCDate(),2)+"T"+kt(s.getUTCHours(),2)+"-"+kt(s.getUTCMinutes(),2)+"-"+kt(s.getUTCSeconds(),2)+".0Z--"+u.address;u["x-ethers"]={client:a,gethFilename:l,path:f,locale:d,mnemonicCounter:(0,h.c$)(i).substring(2),mnemonicCiphertext:(0,h.c$)(o).substring(2),version:"0.1"}}return JSON.stringify(u)}function Ut(e,a,t){null==t&&(t={});const c=Lt(a),f=Ft(t),d=Ct(c,f.salt,f.N,f.r,f.p,64);return Qt((0,h.q5)(d),f,e,t)}async function jt(e,a,t){null==t&&(t={});const c=Lt(a),f=Ft(t),d=await Et(c,f.salt,f.N,f.r,f.p,64,t.progressCallback);return Qt((0,h.q5)(d),f,e,t)}const Ht="m/44'/60'/0'/0/0",qt=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),$t=2147483648,zt=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");function Gt(e,a){let t="";for(;e;)t="0123456789abcdef"[e%16]+t,e=Math.trunc(e/16);for(;t.length<2*a;)t="0"+t;return"0x"+t}function Kt(e){const a=(0,h.q5)(e),t=(0,h.ZG)((0,Oe.s)((0,Oe.s)(a)),0,4),c=(0,h.xW)([a,t]);return(0,ua.R)(c)}const Vt={};function Zt(e,a,t,c){const f=new Uint8Array(37);e&$t?((0,l.vA)(null!=c,"cannot derive child of neutered node","UNSUPPORTED_OPERATION",{operation:"deriveChild"}),f.set((0,h.q5)(c),1)):f.set((0,h.q5)(t));for(let a=24;a>=0;a-=8)f[33+(a>>3)]=e>>24-a&255;const d=(0,h.q5)(He("sha512",a,f));return{IL:d.slice(0,32),IR:d.slice(32)}}function Jt(e,a){const t=a.split("/");(0,l.MR)(t.length>0,"invalid path","path",a),"m"===t[0]&&((0,l.MR)(0===e.depth,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${e.depth}`,"path",a),t.shift());let c=e;for(let e=0;e=16&&t.length<=64,"invalid seed","seed","[REDACTED]");const c=(0,h.q5)(He("sha512",qt,t)),f=new Ne.h((0,h.c$)(c.slice(0,32)));return new Wt(Vt,f,"0x00000000",(0,h.c$)(c.slice(32)),"m",0,0,a,null)}static fromExtendedKey(e){const a=(0,p.c4)((0,ua.H)(e));(0,l.MR)(82===a.length||Kt(a.slice(0,78))===e,"invalid extended key","extendedKey","[ REDACTED ]");const t=a[4],c=(0,h.c$)(a.slice(5,9)),f=parseInt((0,h.c$)(a.slice(9,13)).substring(2),16),d=(0,h.c$)(a.slice(13,45)),r=a.slice(45,78);switch((0,h.c$)(a.slice(0,4))){case"0x0488b21e":case"0x043587cf":{const e=(0,h.c$)(r);return new Yt(Vt,(0,Pe.K)(e),e,c,d,null,f,t,null)}case"0x0488ade4":case"0x04358394 ":if(0!==r[0])break;return new Wt(Vt,new Ne.h(r.slice(1)),c,d,null,f,t,null,null)}(0,l.MR)(!1,"invalid extended key prefix","extendedKey","[ REDACTED ]")}static createRandom(e,a,t){null==e&&(e=""),null==a&&(a=Ht),null==t&&(t=Aa.wordlist());const c=ka.fromEntropy(la(16),e,t);return Wt.#X(c.computeSeed(),c).derivePath(a)}static fromMnemonic(e,a){return a||(a=Ht),Wt.#X(e.computeSeed(),e).derivePath(a)}static fromPhrase(e,a,t,c){null==a&&(a=""),null==t&&(t=Ht),null==c&&(c=Aa.wordlist());const f=ka.fromPhrase(e,a,c);return Wt.#X(f.computeSeed(),f).derivePath(t)}static fromSeed(e){return Wt.#X(e,null)}}class Yt extends me{publicKey;fingerprint;parentFingerprint;chainCode;path;index;depth;constructor(e,a,t,c,f,d,r,n,i){super(a,i),(0,l.gk)(e,Vt,"HDNodeVoidWallet"),(0,s.n)(this,{publicKey:t});const b=(0,h.ZG)(ia((0,Oe.s)(t)),0,4);(0,s.n)(this,{publicKey:t,fingerprint:b,parentFingerprint:c,chainCode:f,path:d,index:r,depth:n})}connect(e){return new Yt(Vt,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,e)}get extendedKey(){return(0,l.vA)(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),Kt((0,h.xW)(["0x0488B21E",Gt(this.depth,1),this.parentFingerprint,Gt(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return null!=this.path}deriveChild(e){const a=(0,p.WZ)(e,"index");(0,l.MR)(a<=4294967295,"invalid index","index",a);let t=this.path;t&&(t+="/"+(2147483647&a),a&$t&&(t+="'"));const{IR:c,IL:f}=Zt(a,this.chainCode,this.publicKey,null),d=Ne.h.addPoints(f,this.publicKey,!0),r=(0,Pe.K)(d);return new Yt(Vt,r,d,this.fingerprint,(0,h.c$)(c),t,a,this.depth+1,this.provider)}derivePath(e){return Jt(this,e)}}function Xt(e){try{if(JSON.parse(e).encseed)return!0}catch(e){}return!1}function ec(e,a){const t=JSON.parse(e),c=Lt(a),f=(0,n.b)(St(t,"ethaddr:string!")),d=Bt(St(t,"encseed:string!"));(0,l.MR)(d&&d.length%16==0,"invalid encseed","json",e);const r=(0,h.q5)(Ia(c,c,2e3,32,"sha256")).slice(0,16),i=d.slice(0,16),b=d.slice(16),o=new ft(r,i),s=function(e){if(e.length<16)throw new TypeError("PKCS#7 invalid length");const a=e[e.length-1];if(a>16)throw new TypeError("PKCS#7 padding byte out of range");const t=e.length-a;for(let c=0;c{setTimeout((()=>{a()}),e)}))}class tc extends De{constructor(e,a){"string"!=typeof e||e.startsWith("0x")||(e="0x"+e),super("string"==typeof e?new Ne.h(e):e,a)}connect(e){return new tc(this.signingKey,e)}async encrypt(e,a){const t={address:this.address,privateKey:this.privateKey};return await jt(t,e,{progressCallback:a})}encryptSync(e){return Ut({address:this.address,privateKey:this.privateKey},e)}static#ee(e){if((0,l.MR)(e,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in e&&e.mnemonic&&"en"===e.mnemonic.locale){const a=ka.fromEntropy(e.mnemonic.entropy),t=Wt.fromMnemonic(a,e.mnemonic.path);if(t.address===e.address&&t.privateKey===e.privateKey)return t;console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const a=new tc(e.privateKey);return(0,l.MR)(a.address===e.address,"address/privateKey mismatch","json","[ REDACTED ]"),a}static async fromEncryptedJson(e,a,t){let c=null;return Rt(e)?c=await async function(e,a,t){const c=JSON.parse(e),f=Lt(a),d=Dt(c);if("pbkdf2"===d.name){t&&(t(0),await Ot(0));const{salt:e,count:a,dkLen:r,algorithm:n}=d,i=Ia(f,e,a,r,n);return t&&(t(1),await Ot(0)),Pt(c,i)}(0,l.vA)("scrypt"===d.name,"cannot be reached","UNKNOWN_ERROR",{params:d});const{salt:r,N:n,r:i,p:b,dkLen:o}=d;return Pt(c,await Et(f,r,n,i,b,o,t))}(e,a,t):Xt(e)&&(t&&(t(0),await ac(0)),c=ec(e,a),t&&(t(1),await ac(0))),tc.#ee(c)}static fromEncryptedJsonSync(e,a){let t=null;return Rt(e)?t=function(e,a){const t=JSON.parse(e),c=Lt(a),f=Dt(t);if("pbkdf2"===f.name){const{salt:e,count:a,dkLen:d,algorithm:r}=f;return Pt(t,Ia(c,e,a,d,r))}(0,l.vA)("scrypt"===f.name,"cannot be reached","UNKNOWN_ERROR",{params:f});const{salt:d,N:r,r:n,p:i,dkLen:b}=f;return Pt(t,Ct(c,d,r,n,i,b))}(e,a):Xt(e)?t=ec(e,a):(0,l.MR)(!1,"invalid JSON wallet","json","[ REDACTED ]"),tc.#ee(t)}static createRandom(e){const a=Wt.createRandom();return e?a.connect(e):a}static fromPhrase(e,a){const t=Wt.fromPhrase(e);return a?t.connect(a):t}}class cc extends ke{#ae;constructor(e,a,t){const c=Object.assign({},null!=t?t:{},{batchMaxCount:1});(0,l.MR)(e&&e.request,"invalid EIP-1193 provider","ethereum",e),super(a,c),this.#ae=async(a,t)=>{const c={method:a,params:t};this.emit("debug",{action:"sendEip1193Request",payload:c});try{const a=await e.request(c);return this.emit("debug",{action:"receiveEip1193Result",result:a}),a}catch(e){const a=new Error(e.message);throw a.code=e.code,a.data=e.data,a.payload=c,this.emit("debug",{action:"receiveEip1193Error",error:a}),a}}}async send(e,a){return await this._start(),await super.send(e,a)}async _send(e){(0,l.MR)(!Array.isArray(e),"EIP-1193 does not support batch request","payload",e);try{const a=await this.#ae(e.method,e.params||[]);return[{id:e.id,result:a}]}catch(a){return[{id:e.id,error:{code:a.code,data:a.data,message:a.message}}]}}getRpcError(e,a){switch((a=JSON.parse(JSON.stringify(a))).error.code||-1){case 4001:a.error.message=`ethers-user-denied: ${a.error.message}`;break;case 4200:a.error.message=`ethers-unsupported: ${a.error.message}`}return super.getRpcError(e,a)}async hasSigner(e){null==e&&(e=0);const a=await this.send("eth_accounts",[]);return"number"==typeof e?a.length>e:(e=e.toLowerCase(),0!==a.filter((a=>a.toLowerCase()===e)).length)}async getSigner(e){if(null==e&&(e=0),!await this.hasSigner(e))try{await this.#ae("eth_requestAccounts",[])}catch(e){const a=e.payload;throw this.getRpcError(a,{id:a.id,error:e})}return await super.getSigner(e)}}var fc=t(67418);const dc="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0";function rc({fetchUrl:e,proxyUrl:a,torPort:c,retry:f}){const{HttpProxyAgent:d}=t(60513),{HttpsProxyAgent:r}=t(2378),{SocksProxyAgent:n}=t(60290);if(c)return new n(`socks5h://tor${f}@127.0.0.1:${c}`);if(!a)return;const i=e.includes("https://");return a.includes("socks://")||a.includes("socks4://")||a.includes("socks5://")?new n(a):a.includes("http://")||a.includes("https://")?i?new r(a):new d(a):void 0}async function nc(e,a={}){const t=a.maxRetry??3,c=a.retryOn??500,d=a.userAgent??dc,r=globalThis.useGlobalFetch?globalThis.fetch:f();let n,i=0;for(a.method||(a.body?a.method="POST":a.method="GET"),a.headers||(a.headers={}),fc.Ll&&!a.headers["User-Agent"]&&(a.headers["User-Agent"]=d);i{e.abort()}),a.timeout),a.cancelSignal){if(a.cancelSignal.cancelled)throw new Error("request cancelled before sending");a.cancelSignal.addListener((()=>{e.abort()}))}}!a.agent&&fc.Ll&&(a.proxy||a.torPort)&&(a.agent=rc({fetchUrl:e,proxyUrl:a.proxy,torPort:a.torPort,retry:i})),a.debug&&"function"==typeof a.debug&&a.debug("request",{url:e,retry:i,errorObject:n,options:a});try{const t=await r(e,{method:a.method,headers:a.headers,body:a.body,redirect:a.redirect,signal:a.signal,agent:a.agent});if(a.debug&&"function"==typeof a.debug&&a.debug("response",t),!t.ok){const a=`Request to ${e} failed with error code ${t.status}:\n`+await t.text();throw new Error(a)}if(a.returnResponse)return t;const c=t.headers.get("content-type");return c?.includes("application/json")?await t.json():c?.includes("text")?await t.text():t}catch(e){t&&clearTimeout(t),n=e,i++,await(0,fc.yy)(c)}finally{t&&clearTimeout(t)}}throw a.debug&&"function"==typeof a.debug&&a.debug("error",n),n}const ic=(e={})=>async(a,t)=>{const c={...e,method:a.method||"POST",headers:a.headers,body:a.body||void 0,timeout:e.timeout||a.timeout,cancelSignal:t,returnResponse:!0},f=await nc(a.url,c),d={};f.headers.forEach(((e,a)=>{d[a.toLowerCase()]=e}));const r=await f.arrayBuffer(),n=null==r?null:new Uint8Array(r);return{statusCode:f.status,statusMessage:f.statusText,headers:d,body:n}};async function bc(e,a){const t=new d.ui(e);t.getUrlFunc=ic(a);const c=await new Le(t).getNetwork(),f=Number(c.chainId);if(a?.netId&&a.netId!==f){const t=`Wrong network for ${e}, wants ${a.netId} got ${f}`;throw new Error(t)}return new Le(t,c,{staticNetwork:c,pollingInterval:a?.pollingInterval||1e3})}function oc(e,a,t,c){const{networkName:f,reverseRecordsContract:r,pollInterval:n}=t,i=Boolean(r),b=new d.ui(a);b.getUrlFunc=ic(c);const o=new U(f,e);return i&&o.attachPlugin(new O(null,Number(e))),o.attachPlugin(new D),new Le(b,o,{staticNetwork:o,pollingInterval:c?.pollingInterval||1e3*n})}const sc=async(e,a)=>{const t=e.provider;if(a.from){if(a.from!==e.address){const t=`populateTransaction: signer mismatch for tx, wants ${a.from} have ${e.address}`;throw new Error(t)}}else a.from=e.address;const[c,f]=await Promise.all([a.maxFeePerGas||a.gasPrice?void 0:t.getFeeData(),a.nonce?void 0:t.getTransactionCount(e.address,"pending")]);if(c&&(c.maxFeePerGas?(a.type||(a.type=2),a.maxFeePerGas=c.maxFeePerGas*(BigInt(1e4)+BigInt(e.gasPriceBump))/BigInt(1e4),a.maxPriorityFeePerGas=c.maxPriorityFeePerGas,delete a.gasPrice):c.gasPrice&&(a.type||(a.type=0),a.gasPrice=c.gasPrice,delete a.maxFeePerGas,delete a.maxPriorityFeePerGas)),f&&(a.nonce=f),!a.gasLimit)try{const c=await t.estimateGas(a);a.gasLimit=c===BigInt(21e3)?c:c*(BigInt(1e4)+BigInt(e.gasLimitBump))/BigInt(1e4)}catch(t){if(!e.gasFailover)throw t;console.log("populateTransaction: warning gas estimation failed falling back to 3M gas"),a.gasLimit=BigInt("3000000")}return a};class lc extends tc{nonce;gasPriceBump;gasLimitBump;gasFailover;bumpNonce;constructor(e,a,{gasPriceBump:t,gasLimitBump:c,gasFailover:f,bumpNonce:d}={}){super(e,a),this.gasPriceBump=t??0,this.gasLimitBump=c??3e3,this.gasFailover=f??!1,this.bumpNonce=d??!1}static fromMnemonic(e,a,t=0,c){const f=`m/44'/60'/0'/0/${t}`,{privateKey:d}=Wt.fromPhrase(e,void 0,f);return new lc(d,a,c)}async populateTransaction(e){const a=await sc(this,e);return this.nonce=Number(a.nonce),super.populateTransaction(a)}}class uc extends me{nonce;gasPriceBump;gasLimitBump;gasFailover;bumpNonce;constructor(e,a,{gasPriceBump:t,gasLimitBump:c,gasFailover:f,bumpNonce:d}={}){super(e,a),this.gasPriceBump=t??0,this.gasLimitBump=c??3e3,this.gasFailover=f??!1,this.bumpNonce=d??!1}async populateTransaction(e){const a=await sc(this,e);return this.nonce=Number(a.nonce),super.populateTransaction(a)}}class hc extends Me{nonce;gasPriceBump;gasLimitBump;gasFailover;bumpNonce;constructor(e,a,{gasPriceBump:t,gasLimitBump:c,gasFailover:f,bumpNonce:d}={}){super(e,a),this.gasPriceBump=t??0,this.gasLimitBump=c??3e3,this.gasFailover=f??!1,this.bumpNonce=d??!1}async sendUncheckedTransaction(e){return super.sendUncheckedTransaction(await sc(this,e))}}class pc extends cc{options;constructor(e,a,t){super(e,a),this.options=t}async getSigner(e){const a=(await super.getSigner(e)).address;return this.options?.netId&&this.options?.connectWallet&&Number(await super.send("net_version",[]))!==this.options?.netId&&await this.options.connectWallet(this.options?.netId),this.options?.handleNetworkChanges&&window?.ethereum?.on("chainChanged",this.options.handleNetworkChanges),this.options?.handleAccountChanges&&window?.ethereum?.on("accountsChanged",this.options.handleAccountChanges),this.options?.handleAccountDisconnect&&window?.ethereum?.on("disconnect",this.options.handleAccountDisconnect),new hc(this,a,this.options)}}},57194:(e,a,t)=>{"use strict";t.d(a,{KN:()=>o,OR:()=>g,Ss:()=>b,XF:()=>h,c$:()=>u,pO:()=>s,sN:()=>p,zy:()=>l});var c=t(99770),f=t(30031),d=t(67418),r=t(59499),n=t(46170),i=t(59511);const b=.1,o=.9,s=(0,c.g5)("500");function l({stakeBalance:e,tornadoServiceFee:a}){if(a=o)return BigInt(0);const t=1-1/(o-b)**2*(a-b)**2;return BigInt(Math.floor(Number(e||"0")*t))}function u(e,a){for(let t=0;tObject.values(e))).flat().map((e=>(0,f.b)(e)))}function p(e){const a=e.map((e=>l(e))),t=a.reduce(((e,a)=>e+a),BigInt("0"));return e[u(a,BigInt(Math.floor(Number(t)*Math.random())))]}class g{netId;config;selectedRelayer;fetchDataOptions;tovarish;constructor({netId:e,config:a,fetchDataOptions:t}){this.netId=e,this.config=a,this.fetchDataOptions=t,this.tovarish=!1}async askRelayerStatus({hostname:e,url:a,relayerAddress:t}){!a&&e?a=`https://${e.endsWith("/")?e:e+"/"}`:a&&!a.endsWith("/")?a+="/":a="";const c=await(0,n.Fd)(`${a}status`,{...this.fetchDataOptions,headers:{"Content-Type":"application/json, application/x-www-form-urlencoded"},timeout:3e4,maxRetry:this.fetchDataOptions?.torPort?2:0});if(!i.SS.compile((0,i.c_)(this.netId,this.config,this.tovarish))(c))throw new Error("Invalid status schema");const f={...c,url:a};if(f.currentQueue>5)throw new Error("Withdrawal queue is overloaded");if(f.netId!==this.netId)throw new Error("This relayer serves a different network");if(t&&this.netId===r.zr.MAINNET&&f.rewardAccount!==t)throw new Error("The Relayer reward address must match registered address");return f}async filterRelayer(e){const a=e.hostnames[this.netId],{ensName:t,relayerAddress:c}=e;if(a)try{const d=await this.askRelayerStatus({hostname:a,relayerAddress:c});return{netId:d.netId,url:d.url,hostname:a,ensName:t,relayerAddress:c,rewardAccount:(0,f.b)(d.rewardAccount),instances:h(d.instances),stakeBalance:e.stakeBalance,gasPrice:d.gasPrices?.fast,ethPrices:d.ethPrices,currentQueue:d.currentQueue,tornadoServiceFee:d.tornadoServiceFee}}catch(e){return{hostname:a,relayerAddress:c,errorMessage:e.message,hasError:!0}}}async getValidRelayers(e){const a=[];return{validRelayers:(await Promise.all(e.map((e=>this.filterRelayer(e))))).filter((e=>!(!e||e.hasError&&(a.push(e),1)))),invalidRelayers:a}}pickWeightedRandomRelayer(e){return p(e)}async tornadoWithdraw({contract:e,proof:a,args:t},c){const{url:f}=this.selectedRelayer,r=await(0,n.Fd)(`${f}v1/tornadoWithdraw`,{...this.fetchDataOptions,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({contract:e,proof:a,args:t})}),{id:b,error:o}=r;if(o)throw new Error(o);if(!i.SS.compile(i.Yq)(r))throw new Error(`${f}v1/tornadoWithdraw has an invalid job response`);let s;"function"==typeof c&&c(r);const l=`${f}v1/jobs/${b}`;for(console.log(`Job submitted: ${l}\n`);!s||!["FAILED","CONFIRMED"].includes(s);){const e=await(0,n.Fd)(l,{...this.fetchDataOptions,method:"GET",headers:{"Content-Type":"application/json"}});if(e.error)throw new Error(o);if(!i.SS.compile(i.Us)(e))throw new Error(`${l} has an invalid job response`);const{status:a,txHash:t,confirmations:f,failedReason:r}=e;if(s!==a){if("FAILED"===a)throw new Error(`Job ${a}: ${l} failed reason: ${r}`);"SENT"===a?console.log(`Job ${a}: ${l}, txhash: ${t}\n`):"MINED"===a||"CONFIRMED"===a?console.log(`Job ${a}: ${l}, txhash: ${t}, confirmations: ${f}\n`):console.log(`Job ${a}: ${l}\n`),s=a,"function"==typeof c&&c(e)}await(0,d.yy)(3e3)}}}},59511:(e,a,t)=>{"use strict";t.d(a,{SC:()=>n,SS:()=>r,iL:()=>i,i1:()=>s,yF:()=>o,CI:()=>m,ME:()=>A,XW:()=>v,ZC:()=>w,c_:()=>E,FR:()=>h,Yq:()=>M,Us:()=>C,Y6:()=>b,cl:()=>p,Fz:()=>g,U7:()=>y,$j:()=>x});var c=t(63282),f=t.n(c),d=t(41442);const r=new(f())({allErrors:!0});r.addKeyword({keyword:"BN",validate:(e,a)=>{try{return BigInt(a),!0}catch{return!1}},errors:!0}),r.addKeyword({keyword:"isAddress",validate:(e,a)=>{try{return(0,d.PW)(a)}catch{return!1}},errors:!0});const n={type:"string",pattern:"^0x[a-fA-F0-9]{40}$",isAddress:!0},i={type:"string",BN:!0},b={type:"string",pattern:"^0x[a-fA-F0-9]{512}$"},o={type:"string",pattern:"^0x[a-fA-F0-9]{64}$"},s={...o,BN:!0},l={blockNumber:{type:"number"},logIndex:{type:"number"},transactionHash:o},u=Object.keys(l),h={type:"array",items:{anyOf:[{type:"object",properties:{...l,event:{type:"string"},id:{type:"number"},proposer:n,target:n,startTime:{type:"number"},endTime:{type:"number"},description:{type:"string"}},required:[...u,"event","id","proposer","target","startTime","endTime","description"],additionalProperties:!1},{type:"object",properties:{...l,event:{type:"string"},proposalId:{type:"number"},voter:n,support:{type:"boolean"},votes:{type:"string"},from:n,input:{type:"string"}},required:[...u,"event","proposalId","voter","support","votes","from","input"],additionalProperties:!1},{type:"object",properties:{...l,event:{type:"string"},account:n,delegateTo:n},required:[...u,"account","delegateTo"],additionalProperties:!1},{type:"object",properties:{...l,event:{type:"string"},account:n,delegateFrom:n},required:[...u,"account","delegateFrom"],additionalProperties:!1}]}},p={type:"array",items:{anyOf:[{type:"object",properties:{...l,event:{type:"string"},ensName:{type:"string"},relayerAddress:n,ensHash:{type:"string"},stakedAmount:{type:"string"}},required:[...u,"event","ensName","relayerAddress","ensHash","stakedAmount"],additionalProperties:!1},{type:"object",properties:{...l,event:{type:"string"},relayerAddress:n},required:[...u,"event","relayerAddress"],additionalProperties:!1},{type:"object",properties:{...l,event:{type:"string"},relayerAddress:n,workerAddress:n},required:[...u,"event","relayerAddress","workerAddress"],additionalProperties:!1}]}},g={type:"array",items:{type:"object",properties:{...l,relayerAddress:n,amountBurned:i,instanceAddress:n,gasFee:i,relayerFee:i,timestamp:{type:"number"}},required:[...u,"relayerAddress","amountBurned","instanceAddress","gasFee","relayerFee","timestamp"],additionalProperties:!1}},m={type:"array",items:{type:"object",properties:{...l,commitment:o,leafIndex:{type:"number"},timestamp:{type:"number"},from:n},required:[...u,"commitment","leafIndex","timestamp","from"],additionalProperties:!1}},x={type:"array",items:{type:"object",properties:{...l,nullifierHash:o,to:n,fee:i,timestamp:{type:"number"}},required:[...u,"nullifierHash","to","fee","timestamp"],additionalProperties:!1}},y={type:"array",items:{anyOf:[{type:"object",properties:{...l,event:{type:"string"},instanceAddress:{type:"string"},commitment:o,leafIndex:{type:"number"},timestamp:{type:"number"},from:n},required:[...u,"event","instanceAddress","commitment","leafIndex","timestamp","from"],additionalProperties:!1},{type:"object",properties:{...l,event:{type:"string"},instanceAddress:{type:"string"},nullifierHash:o,to:n,relayerAddress:n,fee:i,timestamp:{type:"number"}},required:[...u,"event","instanceAddress","nullifierHash","to","relayerAddress","fee","timestamp"],additionalProperties:!1}]}},A={type:"array",items:{type:"object",properties:{...l,address:n,encryptedAccount:{type:"string"}},required:[...u,"address","encryptedAccount"],additionalProperties:!1}},v={type:"array",items:{type:"object",properties:{...l,encryptedNote:{type:"string"}},required:[...u,"encryptedNote"],additionalProperties:!1}};function w(e){if("tornado"===e)return r.compile(y);if("deposit"===e)return r.compile(m);if("withdrawal"===e)return r.compile(x);if("governance"===e)return r.compile(h);if("registry"===e)return r.compile(p);if("revenue"===e)return r.compile(g);if("echo"===e)return r.compile(A);if("encrypted_notes"===e)return r.compile(v);throw new Error("Unsupported event type for schema validation")}var _=t(59499);const I={type:"object",properties:{rewardAccount:n,gasPrices:{type:"object",properties:{fast:{type:"number"},additionalProperties:{type:"number"}},required:["fast"]},netId:{type:"integer"},tornadoServiceFee:{type:"number",maximum:20,minimum:0},latestBlock:{type:"number"},latestBalance:i,version:{type:"string"},health:{type:"object",properties:{status:{const:"true"},error:{type:"string"}},required:["status"]},syncStatus:{type:"object",properties:{events:{type:"boolean"},tokenPrice:{type:"boolean"},gasPrice:{type:"boolean"}},required:["events","tokenPrice","gasPrice"]},onSyncEvents:{type:"boolean"},currentQueue:{type:"number"}},required:["rewardAccount","instances","netId","tornadoServiceFee","version","health","currentQueue"]};function E(e,a,t){const{tokens:c,optionalTokens:f,disabledTokens:d,nativeCurrency:r}=a,b=JSON.parse(JSON.stringify(I)),o=Object.keys(c).reduce(((e,a)=>{const{instanceAddress:t,tokenAddress:r,symbol:i,decimals:b,optionalInstances:o=[]}=c[a],s=Object.keys(t),l={type:"object",properties:{instanceAddress:{type:"object",properties:s.reduce(((e,a)=>(e[a]=n,e)),{}),required:s.filter((e=>!o.includes(e)))},decimals:{enum:[b]}},required:["instanceAddress","decimals"].concat(r?["tokenAddress"]:[],i?["symbol"]:[])};return r&&(l.properties.tokenAddress=n),i&&(l.properties.symbol={enum:[i]}),e.properties[a]=l,f?.includes(a)||d?.includes(a)||e.required.push(a),e}),{type:"object",properties:{},required:[]});b.properties.instances=o;const s=Object.keys(c).filter((e=>e!==r&&!a.optionalTokens?.includes(e)&&!a.disabledTokens?.includes(e)));if(e===_.zr.MAINNET&&s.push("torn"),s.length){const e={type:"object",properties:s.reduce(((e,a)=>(e[a]=i,e)),{}),required:s};b.properties.ethPrices=e,b.required.push("ethPrices")}return t&&b.required.push("gasPrices","latestBlock","latestBalance","syncStatus","onSyncEvents"),b}const C={type:"object",properties:{error:{type:"string"},id:{type:"string"},type:{type:"string"},status:{type:"string"},contract:{type:"string"},proof:{type:"string"},args:{type:"array",items:{type:"string"}},txHash:{type:"string"},confirmations:{type:"number"},failedReason:{type:"string"}},required:["id","status"]},M={...C,required:["id"]}},7393:(e,a,t)=>{"use strict";t.d(a,{H:()=>n});var c=t(98982),f=t(62463),d=t(67418),r=t(48486);async function n({provider:e,Multicall:a,currencyName:t,userAddress:n,tokenAddresses:i=[]}){const b=i.map((a=>{const t=f.Xc.connect(a,e);return[{contract:t,name:"balanceOf",params:[n]},{contract:t,name:"name"},{contract:t,name:"symbol"},{contract:t,name:"decimals"}]})).flat(),o=await(0,r.C)(a,[{contract:a,name:"getEthBalance",params:[n]},...b.length?b:[]]),s=o[0],l=(o.slice(1).length?(0,d.iv)(o.slice(1),b.length/i.length):[]).map(((e,a)=>{const[t,c,f,d]=e;return{address:i[a],name:c,symbol:f,decimals:Number(d),balance:t}}));return[{address:c.j,name:t,symbol:t,decimals:18,balance:s},...l]}},96838:(e,a,t)=>{"use strict";t.d(a,{E:()=>b,o:()=>i});var c=t(30031),f=t(57194),d=t(46170),r=t(59511),n=t(59499);const i=5e3;class b extends f.OR{constructor(e){super(e),this.tovarish=!0}async askRelayerStatus({hostname:e,url:a,relayerAddress:t}){const c=await super.askRelayerStatus({hostname:e,url:a,relayerAddress:t});if(!c.version.includes("tovarish"))throw new Error("Not a tovarish relayer!");return c}async askAllStatus({hostname:e,url:a,relayerAddress:t}){!a&&e?a=`https://${e.endsWith("/")?e:e+"/"}`:a&&!a.endsWith("/")?a+="/":a="";const c=await(0,d.Fd)(`${a}status`,{...this.fetchDataOptions,headers:{"Content-Type":"application/json, application/x-www-form-urlencoded"},timeout:3e4,maxRetry:this.fetchDataOptions?.torPort?2:0});if(!Array.isArray(c))return[];const f=[];for(const e of c){const c=e.netId,d=(0,n.zj)(c);if(!r.SS.compile((0,r.c_)(e.netId,d,this.tovarish)))continue;const i={...e,url:`${a}${c}/`};if(i.currentQueue>5)throw new Error("Withdrawal queue is overloaded");if(!n.Af.includes(i.netId))throw new Error("This relayer serves a different network");if(t&&i.netId===n.zr.MAINNET&&i.rewardAccount!==t)throw new Error("The Relayer reward address must match registered address");if(!i.version.includes("tovarish"))throw new Error("Not a tovarish relayer!");f.push(i)}return f}async filterRelayer(e){const{ensName:a,relayerAddress:t,tovarishHost:d,tovarishNetworks:r}=e;if(!d||!r?.includes(this.netId))return;const n=`${d}/${this.netId}`;try{const d=await this.askRelayerStatus({hostname:n,relayerAddress:t});return{netId:d.netId,url:d.url,hostname:n,ensName:a,relayerAddress:t,rewardAccount:(0,c.b)(d.rewardAccount),instances:(0,f.XF)(d.instances),stakeBalance:e.stakeBalance,gasPrice:d.gasPrices?.fast,ethPrices:d.ethPrices,currentQueue:d.currentQueue,tornadoServiceFee:d.tornadoServiceFee,latestBlock:Number(d.latestBlock),latestBalance:d.latestBalance,version:d.version,events:d.events,syncStatus:d.syncStatus}}catch(e){return{hostname:n,relayerAddress:t,errorMessage:e.message,hasError:!0}}}async getValidRelayers(e){const a=[];return{validRelayers:(await Promise.all(e.map((e=>this.filterRelayer(e))))).filter((e=>!(!e||e.hasError&&(a.push(e),1)))),invalidRelayers:a}}async getTovarishRelayers(e){const a=[],t=[];return await Promise.all(e.filter((e=>e.tovarishHost&&e.tovarishNetworks?.length)).map((async e=>{const{ensName:d,relayerAddress:r,tovarishHost:n}=e;try{const t=await this.askAllStatus({hostname:n,relayerAddress:r});for(const i of t)a.push({netId:i.netId,url:i.url,hostname:n,ensName:d,relayerAddress:r,rewardAccount:(0,c.b)(i.rewardAccount),instances:(0,f.XF)(i.instances),stakeBalance:e.stakeBalance,gasPrice:i.gasPrices?.fast,ethPrices:i.ethPrices,currentQueue:i.currentQueue,tornadoServiceFee:i.tornadoServiceFee,latestBlock:Number(i.latestBlock),latestBalance:i.latestBalance,version:i.version,events:i.events,syncStatus:i.syncStatus})}catch(e){t.push({hostname:n,relayerAddress:r,errorMessage:e.message,hasError:!0})}}))),{validRelayers:a,invalidRelayers:t}}async getEvents({type:e,currency:a,amount:t,fromBlock:c,recent:f}){const n=`${this.selectedRelayer?.url}events`,b=(0,r.ZC)(e);try{const r=[];let o=c;for(;;){let{events:s,lastSyncBlock:l}=await(0,d.Fd)(n,{...this.fetchDataOptions,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:e,currency:a,amount:t,fromBlock:c,recent:f})});if(!b(s)){const a=`Schema validation failed for ${e} events`;throw new Error(a)}if(f)return{events:s,lastSyncBlock:l};if(o=l,!Array.isArray(s)||!s.length)break;s=s.sort(((e,a)=>e.blockNumber===a.blockNumber?e.logIndex-a.logIndex:e.blockNumber-a.blockNumber));const[u]=s.slice(-1);if(s.lengthe.blockNumber!==u.blockNumber)),c=Number(u.blockNumber),r.push(...s)}return{events:r,lastSyncBlock:o}}catch(e){return console.log("Error from TovarishClient events endpoint"),console.log(e),{events:[],lastSyncBlock:c}}}}},62463:(e,a,t)=>{"use strict";t.d(a,{rZ:()=>b,S4:()=>s,BB:()=>u,p2:()=>n,Xc:()=>p,Q2:()=>m,Hk:()=>y,Ld:()=>v,Rp:()=>_,XB:()=>c});var c={};t.r(c),t.d(c,{ENSNameWrapper__factory:()=>b,ENSRegistry__factory:()=>s,ENSResolver__factory:()=>u,ENS__factory:()=>n,ERC20__factory:()=>p,Multicall__factory:()=>m,OffchainOracle__factory:()=>y,OvmGasPriceOracle__factory:()=>v,ReverseRecords__factory:()=>_});var f=t(73622),d=t(13269);const r=[{constant:!0,inputs:[{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"pure",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"key",type:"string"},{internalType:"string",name:"value",type:"string"}],name:"setText",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"interfaceImplementer",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"contentTypes",type:"uint256"}],name:"ABI",outputs:[{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"x",type:"bytes32"},{internalType:"bytes32",name:"y",type:"bytes32"}],name:"setPubkey",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes",name:"hash",type:"bytes"}],name:"setContenthash",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"addr",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"target",type:"address"},{internalType:"bool",name:"isAuthorised",type:"bool"}],name:"setAuthorisation",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"key",type:"string"}],name:"text",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"contentType",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"setABI",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"name",type:"string"}],name:"setName",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"coinType",type:"uint256"},{internalType:"bytes",name:"a",type:"bytes"}],name:"setAddr",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"contenthash",outputs:[{internalType:"bytes",name:"",type:"bytes"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"pubkey",outputs:[{internalType:"bytes32",name:"x",type:"bytes32"},{internalType:"bytes32",name:"y",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"a",type:"address"}],name:"setAddr",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes4",name:"interfaceID",type:"bytes4"},{internalType:"address",name:"implementer",type:"address"}],name:"setInterface",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"coinType",type:"uint256"}],name:"addr",outputs:[{internalType:"bytes",name:"",type:"bytes"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"authorisations",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{inputs:[{internalType:"contract ENS",name:"_ens",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"target",type:"address"},{indexed:!1,internalType:"bool",name:"isAuthorised",type:"bool"}],name:"AuthorisationChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"string",name:"indexedKey",type:"string"},{indexed:!1,internalType:"string",name:"key",type:"string"}],name:"TextChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"x",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"y",type:"bytes32"}],name:"PubkeyChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"string",name:"name",type:"string"}],name:"NameChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"bytes4",name:"interfaceID",type:"bytes4"},{indexed:!1,internalType:"address",name:"implementer",type:"address"}],name:"InterfaceChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"hash",type:"bytes"}],name:"ContenthashChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"a",type:"address"}],name:"AddrChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"coinType",type:"uint256"},{indexed:!1,internalType:"bytes",name:"newAddress",type:"bytes"}],name:"AddressChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"uint256",name:"contentType",type:"uint256"}],name:"ABIChanged",type:"event"}];class n{static abi=r;static createInterface(){return new f.KA(r)}static connect(e,a){return new d.NZ(e,r,a)}}const i=[{inputs:[{internalType:"contract ENS",name:"_ens",type:"address"},{internalType:"contract IBaseRegistrar",name:"_registrar",type:"address"},{internalType:"contract IMetadataService",name:"_metadataService",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"CannotUpgrade",type:"error"},{inputs:[],name:"IncompatibleParent",type:"error"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"IncorrectTargetOwner",type:"error"},{inputs:[],name:"IncorrectTokenType",type:"error"},{inputs:[{internalType:"bytes32",name:"labelHash",type:"bytes32"},{internalType:"bytes32",name:"expectedLabelhash",type:"bytes32"}],name:"LabelMismatch",type:"error"},{inputs:[{internalType:"string",name:"label",type:"string"}],name:"LabelTooLong",type:"error"},{inputs:[],name:"LabelTooShort",type:"error"},{inputs:[],name:"NameIsNotWrapped",type:"error"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"OperationProhibited",type:"error"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"addr",type:"address"}],name:"Unauthorised",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"controller",type:"address"},{indexed:!1,internalType:"bool",name:"active",type:"bool"}],name:"ControllerChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"uint64",name:"expiry",type:"uint64"}],name:"ExpiryExtended",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"uint32",name:"fuses",type:"uint32"}],name:"FusesSet",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"owner",type:"address"}],name:"NameUnwrapped",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"name",type:"bytes"},{indexed:!1,internalType:"address",name:"owner",type:"address"},{indexed:!1,internalType:"uint32",name:"fuses",type:"uint32"},{indexed:!1,internalType:"uint64",name:"expiry",type:"uint64"}],name:"NameWrapped",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256[]",name:"ids",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"}],name:"TransferBatch",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"TransferSingle",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"value",type:"string"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"URI",type:"event"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"_tokens",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint32",name:"fuseMask",type:"uint32"}],name:"allFusesBurned",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"accounts",type:"address[]"},{internalType:"uint256[]",name:"ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"addr",type:"address"}],name:"canExtendSubnames",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"addr",type:"address"}],name:"canModifyName",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"controllers",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"ens",outputs:[{internalType:"contract ENS",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"parentNode",type:"bytes32"},{internalType:"bytes32",name:"labelhash",type:"bytes32"},{internalType:"uint64",name:"expiry",type:"uint64"}],name:"extendExpiry",outputs:[{internalType:"uint64",name:"",type:"uint64"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"operator",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"getData",outputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint32",name:"fuses",type:"uint32"},{internalType:"uint64",name:"expiry",type:"uint64"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"parentNode",type:"bytes32"},{internalType:"bytes32",name:"labelhash",type:"bytes32"}],name:"isWrapped",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"isWrapped",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"metadataService",outputs:[{internalType:"contract IMetadataService",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"names",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"onERC721Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"owner",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_token",type:"address"},{internalType:"address",name:"_to",type:"address"},{internalType:"uint256",name:"_amount",type:"uint256"}],name:"recoverFunds",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"label",type:"string"},{internalType:"address",name:"wrappedOwner",type:"address"},{internalType:"uint256",name:"duration",type:"uint256"},{internalType:"address",name:"resolver",type:"address"},{internalType:"uint16",name:"ownerControlledFuses",type:"uint16"}],name:"registerAndWrapETH2LD",outputs:[{internalType:"uint256",name:"registrarExpiry",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"registrar",outputs:[{internalType:"contract IBaseRegistrar",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"duration",type:"uint256"}],name:"renew",outputs:[{internalType:"uint256",name:"expires",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"parentNode",type:"bytes32"},{internalType:"bytes32",name:"labelhash",type:"bytes32"},{internalType:"uint32",name:"fuses",type:"uint32"},{internalType:"uint64",name:"expiry",type:"uint64"}],name:"setChildFuses",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"controller",type:"address"},{internalType:"bool",name:"active",type:"bool"}],name:"setController",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint16",name:"ownerControlledFuses",type:"uint16"}],name:"setFuses",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IMetadataService",name:"_metadataService",type:"address"}],name:"setMetadataService",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"resolver",type:"address"},{internalType:"uint64",name:"ttl",type:"uint64"}],name:"setRecord",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"resolver",type:"address"}],name:"setResolver",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"parentNode",type:"bytes32"},{internalType:"string",name:"label",type:"string"},{internalType:"address",name:"owner",type:"address"},{internalType:"uint32",name:"fuses",type:"uint32"},{internalType:"uint64",name:"expiry",type:"uint64"}],name:"setSubnodeOwner",outputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"parentNode",type:"bytes32"},{internalType:"string",name:"label",type:"string"},{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"resolver",type:"address"},{internalType:"uint64",name:"ttl",type:"uint64"},{internalType:"uint32",name:"fuses",type:"uint32"},{internalType:"uint64",name:"expiry",type:"uint64"}],name:"setSubnodeRecord",outputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint64",name:"ttl",type:"uint64"}],name:"setTTL",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract INameWrapperUpgrade",name:"_upgradeAddress",type:"address"}],name:"setUpgradeContract",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"parentNode",type:"bytes32"},{internalType:"bytes32",name:"labelhash",type:"bytes32"},{internalType:"address",name:"controller",type:"address"}],name:"unwrap",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"labelhash",type:"bytes32"},{internalType:"address",name:"registrant",type:"address"},{internalType:"address",name:"controller",type:"address"}],name:"unwrapETH2LD",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"name",type:"bytes"},{internalType:"bytes",name:"extraData",type:"bytes"}],name:"upgrade",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"upgradeContract",outputs:[{internalType:"contract INameWrapperUpgrade",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"uri",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"name",type:"bytes"},{internalType:"address",name:"wrappedOwner",type:"address"},{internalType:"address",name:"resolver",type:"address"}],name:"wrap",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"label",type:"string"},{internalType:"address",name:"wrappedOwner",type:"address"},{internalType:"uint16",name:"ownerControlledFuses",type:"uint16"},{internalType:"address",name:"resolver",type:"address"}],name:"wrapETH2LD",outputs:[{internalType:"uint64",name:"expiry",type:"uint64"}],stateMutability:"nonpayable",type:"function"}];class b{static abi=i;static createInterface(){return new f.KA(i)}static connect(e,a){return new d.NZ(e,i,a)}}const o=[{inputs:[{internalType:"contract ENS",name:"_old",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"label",type:"bytes32"},{indexed:!1,internalType:"address",name:"owner",type:"address"}],name:"NewOwner",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"resolver",type:"address"}],name:"NewResolver",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"uint64",name:"ttl",type:"uint64"}],name:"NewTTL",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"owner",type:"address"}],name:"Transfer",type:"event"},{constant:!0,inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"old",outputs:[{internalType:"contract ENS",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"recordExists",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"resolver",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"owner",type:"address"}],name:"setOwner",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"resolver",type:"address"},{internalType:"uint64",name:"ttl",type:"uint64"}],name:"setRecord",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"resolver",type:"address"}],name:"setResolver",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"label",type:"bytes32"},{internalType:"address",name:"owner",type:"address"}],name:"setSubnodeOwner",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"label",type:"bytes32"},{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"resolver",type:"address"},{internalType:"uint64",name:"ttl",type:"uint64"}],name:"setSubnodeRecord",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint64",name:"ttl",type:"uint64"}],name:"setTTL",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"ttl",outputs:[{internalType:"uint64",name:"",type:"uint64"}],payable:!1,stateMutability:"view",type:"function"}];class s{static abi=o;static createInterface(){return new f.KA(o)}static connect(e,a){return new d.NZ(e,o,a)}}const l=[{inputs:[{internalType:"contract ENS",name:"_ens",type:"address"},{internalType:"contract INameWrapper",name:"wrapperAddress",type:"address"},{internalType:"address",name:"_trustedETHController",type:"address"},{internalType:"address",name:"_trustedReverseRegistrar",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"uint256",name:"contentType",type:"uint256"}],name:"ABIChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"a",type:"address"}],name:"AddrChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"coinType",type:"uint256"},{indexed:!1,internalType:"bytes",name:"newAddress",type:"bytes"}],name:"AddressChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"address",name:"delegate",type:"address"},{indexed:!0,internalType:"bool",name:"approved",type:"bool"}],name:"Approved",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"hash",type:"bytes"}],name:"ContenthashChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"name",type:"bytes"},{indexed:!1,internalType:"uint16",name:"resource",type:"uint16"},{indexed:!1,internalType:"bytes",name:"record",type:"bytes"}],name:"DNSRecordChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"name",type:"bytes"},{indexed:!1,internalType:"uint16",name:"resource",type:"uint16"}],name:"DNSRecordDeleted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"lastzonehash",type:"bytes"},{indexed:!1,internalType:"bytes",name:"zonehash",type:"bytes"}],name:"DNSZonehashChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"bytes4",name:"interfaceID",type:"bytes4"},{indexed:!1,internalType:"address",name:"implementer",type:"address"}],name:"InterfaceChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"string",name:"name",type:"string"}],name:"NameChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"x",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"y",type:"bytes32"}],name:"PubkeyChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"string",name:"indexedKey",type:"string"},{indexed:!1,internalType:"string",name:"key",type:"string"},{indexed:!1,internalType:"string",name:"value",type:"string"}],name:"TextChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"uint64",name:"newVersion",type:"uint64"}],name:"VersionChanged",type:"event"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"contentTypes",type:"uint256"}],name:"ABI",outputs:[{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"addr",outputs:[{internalType:"address payable",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"coinType",type:"uint256"}],name:"addr",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"delegate",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"clearRecords",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"contenthash",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"},{internalType:"uint16",name:"resource",type:"uint16"}],name:"dnsRecord",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"}],name:"hasDNSRecords",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"interfaceImplementer",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"delegate",type:"address"}],name:"isApprovedFor",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicall",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"nodehash",type:"bytes32"},{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicallWithNodeCheck",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"pubkey",outputs:[{internalType:"bytes32",name:"x",type:"bytes32"},{internalType:"bytes32",name:"y",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"recordVersions",outputs:[{internalType:"uint64",name:"",type:"uint64"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"contentType",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"setABI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"coinType",type:"uint256"},{internalType:"bytes",name:"a",type:"bytes"}],name:"setAddr",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"a",type:"address"}],name:"setAddr",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes",name:"hash",type:"bytes"}],name:"setContenthash",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes",name:"data",type:"bytes"}],name:"setDNSRecords",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes4",name:"interfaceID",type:"bytes4"},{internalType:"address",name:"implementer",type:"address"}],name:"setInterface",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"newName",type:"string"}],name:"setName",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"x",type:"bytes32"},{internalType:"bytes32",name:"y",type:"bytes32"}],name:"setPubkey",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"key",type:"string"},{internalType:"string",name:"value",type:"string"}],name:"setText",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes",name:"hash",type:"bytes"}],name:"setZonehash",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"key",type:"string"}],name:"text",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"zonehash",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"}];class u{static abi=l;static createInterface(){return new f.KA(l)}static connect(e,a){return new d.NZ(e,l,a)}}const h=[{constant:!0,inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"_totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"who",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{constant:!0,inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"}];class p{static abi=h;static createInterface(){return new f.KA(h)}static connect(e,a){return new d.NZ(e,h,a)}}const g=[{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call[]",name:"calls",type:"tuple[]"}],name:"aggregate",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"},{internalType:"bytes[]",name:"returnData",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bool",name:"allowFailure",type:"bool"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call3[]",name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bool",name:"allowFailure",type:"bool"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call3Value[]",name:"calls",type:"tuple[]"}],name:"aggregate3Value",outputs:[{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call[]",name:"calls",type:"tuple[]"}],name:"blockAndAggregate",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"},{internalType:"bytes32",name:"blockHash",type:"bytes32"},{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[],name:"getBasefee",outputs:[{internalType:"uint256",name:"basefee",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"getBlockHash",outputs:[{internalType:"bytes32",name:"blockHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"getBlockNumber",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getChainId",outputs:[{internalType:"uint256",name:"chainid",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockCoinbase",outputs:[{internalType:"address",name:"coinbase",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockDifficulty",outputs:[{internalType:"uint256",name:"difficulty",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockGasLimit",outputs:[{internalType:"uint256",name:"gaslimit",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"addr",type:"address"}],name:"getEthBalance",outputs:[{internalType:"uint256",name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getLastBlockHash",outputs:[{internalType:"bytes32",name:"blockHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bool",name:"requireSuccess",type:"bool"},{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call[]",name:"calls",type:"tuple[]"}],name:"tryAggregate",outputs:[{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bool",name:"requireSuccess",type:"bool"},{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call[]",name:"calls",type:"tuple[]"}],name:"tryBlockAndAggregate",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"},{internalType:"bytes32",name:"blockHash",type:"bytes32"},{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"}];class m{static abi=g;static createInterface(){return new f.KA(g)}static connect(e,a){return new d.NZ(e,g,a)}}const x=[{inputs:[{internalType:"contract MultiWrapper",name:"_multiWrapper",type:"address"},{internalType:"contract IOracle[]",name:"existingOracles",type:"address[]"},{internalType:"enum OffchainOracle.OracleType[]",name:"oracleTypes",type:"uint8[]"},{internalType:"contract IERC20[]",name:"existingConnectors",type:"address[]"},{internalType:"contract IERC20",name:"wBase",type:"address"},{internalType:"address",name:"owner",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"ArraysLengthMismatch",type:"error"},{inputs:[],name:"ConnectorAlreadyAdded",type:"error"},{inputs:[],name:"InvalidOracleTokenKind",type:"error"},{inputs:[],name:"OracleAlreadyAdded",type:"error"},{inputs:[],name:"SameTokens",type:"error"},{inputs:[],name:"TooBigThreshold",type:"error"},{inputs:[],name:"UnknownConnector",type:"error"},{inputs:[],name:"UnknownOracle",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"contract IERC20",name:"connector",type:"address"}],name:"ConnectorAdded",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"contract IERC20",name:"connector",type:"address"}],name:"ConnectorRemoved",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"contract MultiWrapper",name:"multiWrapper",type:"address"}],name:"MultiWrapperUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"contract IOracle",name:"oracle",type:"address"},{indexed:!1,internalType:"enum OffchainOracle.OracleType",name:"oracleType",type:"uint8"}],name:"OracleAdded",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"contract IOracle",name:"oracle",type:"address"},{indexed:!1,internalType:"enum OffchainOracle.OracleType",name:"oracleType",type:"uint8"}],name:"OracleRemoved",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{inputs:[{internalType:"contract IERC20",name:"connector",type:"address"}],name:"addConnector",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IOracle",name:"oracle",type:"address"},{internalType:"enum OffchainOracle.OracleType",name:"oracleKind",type:"uint8"}],name:"addOracle",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"connectors",outputs:[{internalType:"contract IERC20[]",name:"allConnectors",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC20",name:"srcToken",type:"address"},{internalType:"contract IERC20",name:"dstToken",type:"address"},{internalType:"bool",name:"useWrappers",type:"bool"}],name:"getRate",outputs:[{internalType:"uint256",name:"weightedRate",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC20",name:"srcToken",type:"address"},{internalType:"bool",name:"useSrcWrappers",type:"bool"}],name:"getRateToEth",outputs:[{internalType:"uint256",name:"weightedRate",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC20",name:"srcToken",type:"address"},{internalType:"bool",name:"useSrcWrappers",type:"bool"},{internalType:"contract IERC20[]",name:"customConnectors",type:"address[]"},{internalType:"uint256",name:"thresholdFilter",type:"uint256"}],name:"getRateToEthWithCustomConnectors",outputs:[{internalType:"uint256",name:"weightedRate",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC20",name:"srcToken",type:"address"},{internalType:"bool",name:"useSrcWrappers",type:"bool"},{internalType:"uint256",name:"thresholdFilter",type:"uint256"}],name:"getRateToEthWithThreshold",outputs:[{internalType:"uint256",name:"weightedRate",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC20",name:"srcToken",type:"address"},{internalType:"contract IERC20",name:"dstToken",type:"address"},{internalType:"bool",name:"useWrappers",type:"bool"},{internalType:"contract IERC20[]",name:"customConnectors",type:"address[]"},{internalType:"uint256",name:"thresholdFilter",type:"uint256"}],name:"getRateWithCustomConnectors",outputs:[{internalType:"uint256",name:"weightedRate",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC20",name:"srcToken",type:"address"},{internalType:"contract IERC20",name:"dstToken",type:"address"},{internalType:"bool",name:"useWrappers",type:"bool"},{internalType:"uint256",name:"thresholdFilter",type:"uint256"}],name:"getRateWithThreshold",outputs:[{internalType:"uint256",name:"weightedRate",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"multiWrapper",outputs:[{internalType:"contract MultiWrapper",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"oracles",outputs:[{internalType:"contract IOracle[]",name:"allOracles",type:"address[]"},{internalType:"enum OffchainOracle.OracleType[]",name:"oracleTypes",type:"uint8[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC20",name:"connector",type:"address"}],name:"removeConnector",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IOracle",name:"oracle",type:"address"},{internalType:"enum OffchainOracle.OracleType",name:"oracleKind",type:"uint8"}],name:"removeOracle",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract MultiWrapper",name:"_multiWrapper",type:"address"}],name:"setMultiWrapper",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}];class y{static abi=x;static createInterface(){return new f.KA(x)}static connect(e,a){return new d.NZ(e,x,a)}}const A=[{inputs:[{internalType:"address",name:"_owner",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"DecimalsUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"GasPriceUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"L1BaseFeeUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"OverheadUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"ScalarUpdated",type:"event"},{inputs:[],name:"decimals",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"gasPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"_data",type:"bytes"}],name:"getL1Fee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"_data",type:"bytes"}],name:"getL1GasUsed",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"l1BaseFee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"overhead",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"scalar",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_decimals",type:"uint256"}],name:"setDecimals",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_gasPrice",type:"uint256"}],name:"setGasPrice",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_baseFee",type:"uint256"}],name:"setL1BaseFee",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_overhead",type:"uint256"}],name:"setOverhead",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_scalar",type:"uint256"}],name:"setScalar",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}];class v{static abi=A;static createInterface(){return new f.KA(A)}static connect(e,a){return new d.NZ(e,A,a)}}const w=[{inputs:[{internalType:"contract ENS",name:"_ens",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{internalType:"address[]",name:"addresses",type:"address[]"}],name:"getNames",outputs:[{internalType:"string[]",name:"r",type:"string[]"}],stateMutability:"view",type:"function"}];class _{static abi=w;static createInterface(){return new f.KA(w)}static connect(e,a){return new d.NZ(e,w,a)}}},67418:(e,a,t)=>{"use strict";t.d(a,{$W:()=>w,EI:()=>v,Eg:()=>k,Et:()=>i,G9:()=>E,Id:()=>l,Ju:()=>x,Kp:()=>p,Ll:()=>n,My:()=>g,aT:()=>m,ae:()=>A,br:()=>B,gn:()=>C,ib:()=>I,if:()=>h,iv:()=>b,jm:()=>y,lY:()=>u,qv:()=>L,sY:()=>_,uU:()=>M,vd:()=>S,wv:()=>s,yp:()=>T,yy:()=>o});var c=t(91565),f=t(39404),d=t.n(f),r=t(81810);BigInt.prototype.toJSON=function(){return this.toString()};const n=!process.browser&&void 0===globalThis.window,i=n?c.webcrypto:globalThis.crypto,b=(e,a)=>[...Array(Math.ceil(e.length/a))].map(((t,c)=>e.slice(a*c,a+a*c)));function o(e){return new Promise((a=>setTimeout(a,e)))}function s(e,a){try{const t=new URL(e);return!a||!a.length||a.map((e=>e.toLowerCase())).includes(t.protocol)}catch{return!1}}function l(...e){const a=e.reduce(((e,a)=>e+a.length),0),t=new Uint8Array(a);return e.forEach(((e,a,c)=>{const f=c.slice(0,a).reduce(((e,a)=>e+a.length),0);t.set(e,f)})),t}function u(e){return new Uint8Array(e.buffer)}function h(e){return btoa(e.reduce(((e,a)=>e+String.fromCharCode(a)),""))}function p(e){return Uint8Array.from(atob(e),(e=>e.charCodeAt(0)))}function g(e){return"0x"+Array.from(e).map((e=>e.toString(16).padStart(2,"0"))).join("")}function m(e){return"0x"===e.slice(0,2)&&(e=e.slice(2)),e.length%2!=0&&(e="0"+e),Uint8Array.from(e.match(/.{1,2}/g).map((e=>parseInt(e,16))))}function x(e){return BigInt(g(e))}function y(e){let a="bigint"==typeof e?e.toString(16):e;return"0x"===a.slice(0,2)&&(a=a.slice(2)),a.length%2!=0&&(a="0"+a),Uint8Array.from(a.match(/.{1,2}/g).map((e=>parseInt(e,16))))}function A(e){return new(d())(e,16,"le")}function v(e){return Uint8Array.from(new(d())(e).toArray("le",31))}function w(e,a=32){return"0x"+BigInt(e).toString(16).padStart(2*a,"0")}function _(e,a=32){return"0x"+(e=e.replace("0x","")).padStart(2*a,"0")}function I(e=31){return x(i.getRandomValues(new Uint8Array(e)))}function E(e=32){return g(i.getRandomValues(new Uint8Array(e)))}function C(e,a){return"bigint"==typeof a?a.toString():a}function M(e,a=10){return e.length<2*a?e:`${e.substring(0,a)}...${e.substring(e.length-a)}`}async function B(e,a="SHA-384"){return new Uint8Array(await i.subtle.digest(a,e))}function k(e,a=3){const t=[{value:1,symbol:""},{value:1e3,symbol:"K"},{value:1e6,symbol:"M"},{value:1e9,symbol:"G"},{value:1e12,symbol:"T"},{value:1e15,symbol:"P"},{value:1e18,symbol:"E"}].slice().reverse().find((a=>Number(e)>=a.value));return t?(Number(e)/t.value).toFixed(a).replace(/\.0+$|(?<=\.[0-9]*[1-9])0+$/,"").concat(t.symbol):"0"}function L(e){return/^0x[0-9a-fA-F]*$/.test(e)}function S(e){return r.fromIpfs(e)}function T(e){return r.decode(e)}},26746:(e,a,t)=>{"use strict";t.d(a,{O:()=>i,i:()=>b});var c=t(84276),f=t(36336),d=t.n(f),r=t(67418);let n;async function i(){n||(n=await d()({wasmInitialMemory:2e3}))}async function b(e,a,t){n||await i();const f={root:e.root,nullifierHash:BigInt(e.nullifierHex).toString(),recipient:BigInt(e.recipient),relayer:BigInt(e.relayer),fee:e.fee,refund:e.refund,nullifier:e.nullifier,secret:e.secret,pathElements:e.pathElements,pathIndices:e.pathIndices};console.log("Start generating SNARK proof",f),console.time("SNARK proof time");const d=await c.genWitnessAndProve(await n,f,a,t),b=c.toSolidityInput(d).proof;return console.timeEnd("SNARK proof time"),{proof:b,args:[(0,r.$W)(e.root,32),(0,r.$W)(e.nullifierHex,32),e.recipient,e.relayer,(0,r.$W)(e.fee,32),(0,r.$W)(e.refund,32)]}}},18995:(e,a,t)=>{"use strict";t.d(a,{_6:()=>Ee,fY:()=>Ie,a8:()=>_e});var c={},f=Uint8Array,d=Uint16Array,r=Int32Array,n=new f([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new f([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),b=new f([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=function(e,a){for(var t=new d(31),c=0;c<31;++c)t[c]=a+=1<>1|(21845&x)<<1;y=(61680&(y=(52428&y)>>2|(13107&y)<<2))>>4|(3855&y)<<4,m[x]=((65280&y)>>8|(255&y)<<8)>>1}var A=function(e,a,t){for(var c=e.length,f=0,r=new d(a);f>b]=o}else for(n=new d(c),f=0;f>15-e[f]);return n},v=new f(288);for(x=0;x<144;++x)v[x]=8;for(x=144;x<256;++x)v[x]=9;for(x=256;x<280;++x)v[x]=7;for(x=280;x<288;++x)v[x]=8;var w=new f(32);for(x=0;x<32;++x)w[x]=5;var _=A(v,9,0),I=A(v,9,1),E=A(w,5,0),C=A(w,5,1),M=function(e){for(var a=e[0],t=1;ta&&(a=e[t]);return a},B=function(e,a,t){var c=a/8|0;return(e[c]|e[c+1]<<8)>>(7&a)&t},k=function(e,a){var t=a/8|0;return(e[t]|e[t+1]<<8|e[t+2]<<16)>>(7&a)},L=function(e){return(e+7)/8|0},S=function(e,a,t){return(null==a||a<0)&&(a=0),(null==t||t>e.length)&&(t=e.length),new f(e.subarray(a,t))},T=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],N=function(e,a,t){var c=new Error(a||T[e]);if(c.code=e,Error.captureStackTrace&&Error.captureStackTrace(c,N),!t)throw c;return c},R=function(e,a,t,c){var d=e.length,r=c?c.length:0;if(!d||a.f&&!a.l)return t||new f(0);var o=!t,s=o||2!=a.i,u=a.i;o&&(t=new f(3*d));var h=function(e){var a=t.length;if(e>a){var c=new f(Math.max(2*a,e));c.set(t),t=c}},g=a.f||0,m=a.p||0,x=a.b||0,y=a.l,v=a.d,w=a.m,_=a.n,E=8*d;do{if(!y){g=B(e,m,1);var T=B(e,m+1,3);if(m+=3,!T){var R=e[(z=L(m)+4)-4]|e[z-3]<<8,P=z+R;if(P>d){u&&N(0);break}s&&h(x+R),t.set(e.subarray(z,P),x),a.b=x+=R,a.p=m=8*P,a.f=g;continue}if(1==T)y=I,v=C,w=9,_=5;else if(2==T){var D=B(e,m,31)+257,O=B(e,m+10,15)+4,F=D+B(e,m+5,31)+1;m+=14;for(var Q=new f(F),U=new f(19),j=0;j>4)<16)Q[j++]=z;else{var K=0,V=0;for(16==z?(V=3+B(e,m,3),m+=2,K=Q[j-1]):17==z?(V=3+B(e,m,7),m+=3):18==z&&(V=11+B(e,m,127),m+=7);V--;)Q[j++]=K}}var Z=Q.subarray(0,D),J=Q.subarray(D);w=M(Z),_=M(J),y=A(Z,w,1),v=A(J,_,1)}else N(1);if(m>E){u&&N(0);break}}s&&h(x+131072);for(var W=(1<>4;if((m+=15&K)>E){u&&N(0);break}if(K||N(2),ee<256)t[x++]=ee;else{if(256==ee){X=m,y=null;break}var ae=ee-254;if(ee>264){var te=n[j=ee-257];ae=B(e,m,(1<>4;if(ce||N(3),m+=15&ce,J=p[fe],fe>3&&(te=i[fe],J+=k(e,m)&(1<E){u&&N(0);break}s&&h(x+131072);var de=x+ae;if(x>8},D=function(e,a,t){t<<=7&a;var c=a/8|0;e[c]|=t,e[c+1]|=t>>8,e[c+2]|=t>>16},O=function(e,a){for(var t=[],c=0;ch&&(h=n[c].s);var p=new d(h+1),g=F(t[l-1],p,0);if(g>a){c=0;var m=0,x=g-a,y=1<a))break;m+=y-(1<>=x;m>0;){var v=n[c].s;p[v]=0&&m;--c){var w=n[c].s;p[w]==a&&(--p[w],++m)}g=a}return{t:new f(p),l:g}},F=function(e,a,t){return-1==e.s?Math.max(F(e.l,a,t+1),F(e.r,a,t+1)):a[e.s]=t},Q=function(e){for(var a=e.length;a&&!e[--a];);for(var t=new d(++a),c=0,f=e[0],r=1,n=function(e){t[c++]=e},i=1;i<=a;++i)if(e[i]==f&&i!=a)++r;else{if(!f&&r>2){for(;r>138;r-=138)n(32754);r>2&&(n(r>10?r-11<<5|28690:r-3<<5|12305),r=0)}else if(r>3){for(n(f),--r;r>6;r-=6)n(8304);r>2&&(n(r-3<<5|8208),r=0)}for(;r--;)n(f);r=1,f=e[i]}return{c:t.subarray(0,c),n:a}},U=function(e,a){for(var t=0,c=0;c>8,e[f+2]=255^e[f],e[f+3]=255^e[f+1];for(var d=0;d4&&!F[b[q-1]];--q);var $,z,G,K,V=u+5<<3,Z=U(f,v)+U(r,w)+o,J=U(f,g)+U(r,y)+o+14+3*q+U(T,F)+2*T[16]+3*T[17]+7*T[18];if(l>=0&&V<=Z&&V<=J)return j(a,h,e.subarray(l,l+u));if(P(a,h,1+(J15&&(P(a,h,ee[N]>>5&127),h+=ee[N]>>12)}}}else $=_,z=v,G=E,K=w;for(N=0;N255){D(a,h,$[257+(ae=te>>18&31)]),h+=z[ae+257],ae>7&&(P(a,h,te>>23&31),h+=n[ae]);var ce=31&te;D(a,h,G[ce]),h+=K[ce],ce>3&&(D(a,h,te>>5&8191),h+=i[ce])}else D(a,h,$[te]),h+=z[te]}return D(a,h,$[256]),h+z[256]},q=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),$=new f(0),z=function(e,a,t,c,b,o){var s=o.z||e.length,l=new f(c+s+5*(1+Math.ceil(s/7e3))+b),h=l.subarray(c,l.length-b),p=o.l,m=7&(o.r||0);if(a){m&&(h[0]=o.r>>3);for(var x=q[a-1],y=x>>13,A=8191&x,v=(1<7e3||P>24576)&&($>423||!p)){m=H(e,h,0,M,B,k,N,P,O,R-O,m),P=T=N=0,O=R;for(var z=0;z<286;++z)B[z]=0;for(z=0;z<30;++z)k[z]=0}var G=2,K=0,V=A,Z=Q-U&32767;if($>2&&F==C(R-Z))for(var J=Math.min(y,$)-1,W=Math.min(32767,R),Y=Math.min(258,$);Z<=W&&--V&&Q!=U;){if(e[R+G]==e[R+G-Z]){for(var X=0;XG){if(G=X,K=Z,X>J)break;var ee=Math.min(Z,X-2),ae=0;for(z=0;zae&&(ae=ce,U=te)}}}Z+=(Q=U)-(U=w[Q])&32767}if(K){M[P++]=268435456|u[G]<<18|g[K];var fe=31&u[G],de=31&g[K];N+=n[fe]+i[de],++B[257+fe],++k[de],D=R+G,++T}else M[P++]=e[R],++B[e[R]]}}for(R=Math.max(R,D);R=s&&(h[m/8|0]=p,re=s),m=j(h,m+1,e.subarray(R,re))}o.i=s}return S(l,0,c+L(m)+b)},G=function(){for(var e=new Int32Array(256),a=0;a<256;++a){for(var t=a,c=9;--c;)t=(1&t&&-306674912)^t>>>1;e[a]=t}return e}(),K=function(){var e=-1;return{p:function(a){for(var t=e,c=0;c>>8;e=t},d:function(){return~e}}},V=function(e,a,t,c,d){if(!d&&(d={l:1},a.dictionary)){var r=a.dictionary.subarray(-32768),n=new f(r.length+e.length);n.set(r),n.set(e,r.length),e=n,d.w=r.length}return z(e,null==a.level?6:a.level,null==a.mem?d.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+a.mem,t,c,d)},Z=function(e,a){var t={};for(var c in e)t[c]=e[c];for(var c in a)t[c]=a[c];return t},J=function(e,a,t){for(var c=e(),f=e.toString(),d=f.slice(f.indexOf("[")+1,f.lastIndexOf("]")).replace(/\s+/g,"").split(","),r=0;r>>0},de=function(e,a){return fe(e,a)+4294967296*fe(e,a+4)},re=function(e,a,t){for(;t;++a)e[a]=t,t>>>=8};function ne(e,a){return V(e,a||{},0,0)}function ie(e,a){return R(e,{i:2},a&&a.out,a&&a.dictionary)}var be=function(e,a,t,c){for(var d in e){var r=e[d],n=a+d,i=c;Array.isArray(r)&&(i=Z(c,r[1]),r=r[0]),r instanceof f?t[n]=[r,i]:(t[n+="/"]=[new f(0),i],be(r,n,t,c))}},oe="undefined"!=typeof TextEncoder&&new TextEncoder,se="undefined"!=typeof TextDecoder&&new TextDecoder;try{se.decode($,{stream:!0})}catch(e){}function le(e,a){if(a){for(var t=new f(e.length),c=0;c>1)),n=0,i=function(e){r[n++]=e};for(c=0;cr.length){var b=new f(n+8+(d-c<<1));b.set(r),r=b}var o=e.charCodeAt(c);o<128||a?i(o):o<2048?(i(192|o>>6),i(128|63&o)):o>55295&&o<57344?(i(240|(o=65536+(1047552&o)|1023&e.charCodeAt(++c))>>18),i(128|o>>12&63),i(128|o>>6&63),i(128|63&o)):(i(224|o>>12),i(128|o>>6&63),i(128|63&o))}return S(r,0,n)}function ue(e,a){if(a){for(var t="",c=0;c127)+(c>223)+(c>239);if(t+f>e.length)return{s:a,r:S(e,t-1)};f?3==f?(c=((15&c)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,a+=String.fromCharCode(55296|c>>10,56320|1023&c)):a+=1&f?String.fromCharCode((31&c)<<6|63&e[t++]):String.fromCharCode((15&c)<<12|(63&e[t++])<<6|63&e[t++]):a+=String.fromCharCode(c)}}(e),d=f.s;return(t=f.r).length&&N(8),d}var he=function(e,a){return a+30+ce(e,a+26)+ce(e,a+28)},pe=function(e,a,t){var c=ce(e,a+28),f=ue(e.subarray(a+46,a+46+c),!(2048&ce(e,a+8))),d=a+46+c,r=fe(e,a+20),n=t&&4294967295==r?ge(e,d):[r,fe(e,a+24),fe(e,a+42)],i=n[0],b=n[1],o=n[2];return[ce(e,a+10),i,b,f,d+ce(e,a+30)+ce(e,a+32),o]},ge=function(e,a){for(;1!=ce(e,a);a+=4+ce(e,a+2));return[de(e,a+12),de(e,a+4),de(e,a+20)]},me=function(e){var a=0;if(e)for(var t in e){var c=e[t].length;c>65535&&N(9),a+=c+4}return a},xe=function(e,a,t,c,f,d,r,n){var i=c.length,b=t.extra,o=n&&n.length,s=me(b);re(e,a,null!=r?33639248:67324752),a+=4,null!=r&&(e[a++]=20,e[a++]=t.os),e[a]=20,a+=2,e[a++]=t.flag<<1|(d<0&&8),e[a++]=f&&8,e[a++]=255&t.compression,e[a++]=t.compression>>8;var l=new Date(null==t.mtime?Date.now():t.mtime),u=l.getFullYear()-1980;if((u<0||u>119)&&N(10),re(e,a,u<<25|l.getMonth()+1<<21|l.getDate()<<16|l.getHours()<<11|l.getMinutes()<<5|l.getSeconds()>>1),a+=4,-1!=d&&(re(e,a,t.crc),re(e,a+4,d<0?-d-2:d),re(e,a+8,t.size)),re(e,a+12,i),re(e,a+14,s),a+=16,null!=r&&(re(e,a,o),re(e,a+6,t.attrs),re(e,a+10,r),a+=14),e.set(c,a),a+=i,s)for(var h in b){var p=b[h],g=p.length;re(e,a,+h),re(e,a+2,g),e.set(p,a+4),a+=4+g}return o&&(e.set(n,a),a+=o),a},ye=function(e,a,t,c,f){re(e,a,101010256),re(e,a+8,t),re(e,a+10,t),re(e,a+12,c),re(e,a+16,f)};var Ae="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(e){e()},ve=t(46170),we=t(67418);function _e(e,a){return new Promise(((t,c)=>{!function(e,a,t){t||(t=a,a={}),"function"!=typeof t&&N(7);var c={};be(e,"",c,a);var d=Object.keys(c),r=d.length,n=0,i=0,b=r,o=new Array(r),s=[],l=function(){for(var e=0;e65535&&I(N(11,0,1),null),_)if(g<16e4)try{I(null,ne(f,b))}catch(e){I(e,null)}else s.push(function(e,a,t){return t||(t=a,a={}),"function"!=typeof t&&N(7),te(e,a,[X],(function(e){return ee(ne(e.data[0],e.data[1]))}),0,t)}(f,b,I));else I(null,f)},g=0;g{e?c(e):t(a)}))}))}function Ie(e){return new Promise(((a,t)=>{!function(e,a,t){t||(t=a,a={}),"function"!=typeof t&&N(7);var c=[],d=function(){for(var e=0;e65558)return n(N(13,0,1),null),d;var b=ce(e,i+8);if(b){var o=b,s=fe(e,i+16),l=4294967295==s||65535==o;if(l){var u=fe(e,i-12);(l=101075792==fe(e,u))&&(o=b=fe(e,u+32),s=fe(e,u+48))}for(var h=a&&a.filter,p=function(a){var t=pe(e,s,l),i=t[0],o=t[1],u=t[2],p=t[3],g=t[4],m=t[5],x=he(e,m);s=g;var y=function(e,a){e?(d(),n(e,null)):(a&&(r[p]=a),--b||n(null,r))};if(!h||h({name:p,size:o,originalSize:u,compression:i}))if(i)if(8==i){var A=e.subarray(x,x+o);if(u<524288||o>.8*u)try{y(null,ie(A,{out:new f(u)}))}catch(e){y(e,null)}else c.push(function(e,a,t){return t||(t=a,a={}),"function"!=typeof t&&N(7),te(e,a,[Y],(function(e){return ee(ie(e.data[0],ae(e.data[1])))}),1,t)}(A,{size:u},y))}else y(N(14,"unknown compression type "+i,1),null);else y(null,S(e,x,x+o));else y(null,null)},g=0;g{e?t(e):a(c)}))}))}async function Ee({staticUrl:e="",zipName:a,zipDigest:t,parseJson:c=!0}){const f=`${e}/${a}.zip`,d=await(0,ve.Fd)(f,{method:"GET",returnResponse:!0}),r=new Uint8Array(await d.arrayBuffer());if(t){const e="sha384-"+(0,we.if)(await(0,we.br)(r));if(t!==e)throw new Error(`Invalid digest hash for file ${f}, wants ${t} has ${e}`)}const{[a]:n}=await Ie(r);return console.log(`Downloaded ${f}${t?` ( Digest: ${t} )`:""}`),c?JSON.parse((new TextDecoder).decode(n)):n}},32019:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.keccak512=a.keccak384=a.keccak256=a.keccak224=void 0;const c=t(32955),f=t(82672);a.keccak224=(0,f.wrapHash)(c.keccak_224),a.keccak256=(()=>{const e=(0,f.wrapHash)(c.keccak_256);return e.create=c.keccak_256.create,e})(),a.keccak384=(0,f.wrapHash)(c.keccak_384),a.keccak512=(0,f.wrapHash)(c.keccak_512)},26513:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.secp256k1=void 0;var c=t(8510);Object.defineProperty(a,"secp256k1",{enumerable:!0,get:function(){return c.secp256k1}})},82672:function(e,a,t){"use strict";e=t.nmd(e);var c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0}),a.crypto=a.utf8ToBytes=a.createView=a.concatBytes=a.toHex=a.bytesToHex=a.assertBytes=a.assertBool=void 0,a.bytesToUtf8=function(e){if(!(e instanceof Uint8Array))throw new TypeError("bytesToUtf8 expected Uint8Array, got "+typeof e);return(new TextDecoder).decode(e)},a.hexToBytes=function(e){const a=e.startsWith("0x")?e.substring(2):e;return(0,d.hexToBytes)(a)},a.equalsBytes=function(e,a){if(e.length!==a.length)return!1;for(let t=0;t(f.default.bytes(a),e(a))};const f=c(t(67557)),d=t(99175),r=f.default.bool;a.assertBool=r;const n=f.default.bytes;a.assertBytes=n;var i=t(99175);Object.defineProperty(a,"bytesToHex",{enumerable:!0,get:function(){return i.bytesToHex}}),Object.defineProperty(a,"toHex",{enumerable:!0,get:function(){return i.bytesToHex}}),Object.defineProperty(a,"concatBytes",{enumerable:!0,get:function(){return i.concatBytes}}),Object.defineProperty(a,"createView",{enumerable:!0,get:function(){return i.createView}}),Object.defineProperty(a,"utf8ToBytes",{enumerable:!0,get:function(){return i.utf8ToBytes}}),a.crypto=(()=>{const a="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,t="function"==typeof e.require&&e.require.bind(e);return{node:t&&!a?t("crypto"):void 0,web:a}})()},37007:e=>{"use strict";var a,t="object"==typeof Reflect?Reflect:null,c=t&&"function"==typeof t.apply?t.apply:function(e,a,t){return Function.prototype.apply.call(e,a,t)};a=t&&"function"==typeof t.ownKeys?t.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var f=Number.isNaN||function(e){return e!=e};function d(){d.init.call(this)}e.exports=d,e.exports.once=function(e,a){return new Promise((function(t,c){function f(t){e.removeListener(a,d),c(t)}function d(){"function"==typeof e.removeListener&&e.removeListener("error",f),t([].slice.call(arguments))}p(e,a,d,{once:!0}),"error"!==a&&function(e,a){"function"==typeof e.on&&p(e,"error",a,{once:!0})}(e,f)}))},d.EventEmitter=d,d.prototype._events=void 0,d.prototype._eventsCount=0,d.prototype._maxListeners=void 0;var r=10;function n(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function i(e){return void 0===e._maxListeners?d.defaultMaxListeners:e._maxListeners}function b(e,a,t,c){var f,d,r,b;if(n(t),void 0===(d=e._events)?(d=e._events=Object.create(null),e._eventsCount=0):(void 0!==d.newListener&&(e.emit("newListener",a,t.listener?t.listener:t),d=e._events),r=d[a]),void 0===r)r=d[a]=t,++e._eventsCount;else if("function"==typeof r?r=d[a]=c?[t,r]:[r,t]:c?r.unshift(t):r.push(t),(f=i(e))>0&&r.length>f&&!r.warned){r.warned=!0;var o=new Error("Possible EventEmitter memory leak detected. "+r.length+" "+String(a)+" listeners added. Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning",o.emitter=e,o.type=a,o.count=r.length,b=o,console&&console.warn&&console.warn(b)}return e}function o(){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 s(e,a,t){var c={fired:!1,wrapFn:void 0,target:e,type:a,listener:t},f=o.bind(c);return f.listener=t,c.wrapFn=f,f}function l(e,a,t){var c=e._events;if(void 0===c)return[];var f=c[a];return void 0===f?[]:"function"==typeof f?t?[f.listener||f]:[f]:t?function(e){for(var a=new Array(e.length),t=0;t0&&(r=a[0]),r instanceof Error)throw r;var n=new Error("Unhandled error."+(r?" ("+r.message+")":""));throw n.context=r,n}var i=d[e];if(void 0===i)return!1;if("function"==typeof i)c(i,this,a);else{var b=i.length,o=h(i,b);for(t=0;t=0;d--)if(t[d]===a||t[d].listener===a){r=t[d].listener,f=d;break}if(f<0)return this;0===f?t.shift():function(e,a){for(;a+1=0;c--)this.removeListener(e,a[c]);return this},d.prototype.listeners=function(e){return l(this,e,!0)},d.prototype.rawListeners=function(e){return l(this,e,!1)},d.listenerCount=function(e,a){return"function"==typeof e.listenerCount?e.listenerCount(a):u.call(e,a)},d.prototype.listenerCount=u,d.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]}},68078:(e,a,t)=>{var c=t(92861).Buffer,f=t(88276);e.exports=function(e,a,t,d){if(c.isBuffer(e)||(e=c.from(e,"binary")),a&&(c.isBuffer(a)||(a=c.from(a,"binary")),8!==a.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var r=t/8,n=c.alloc(r),i=c.alloc(d||0),b=c.alloc(0);r>0||d>0;){var o=new f;o.update(b),o.update(e),a&&o.update(a),b=o.digest();var s=0;if(r>0){var l=n.length-r;s=Math.min(r,b.length),b.copy(n,l,0,s),r-=s}if(s0){var u=i.length-d,h=Math.min(d,b.length-s);b.copy(i,u,s,s+h),d-=h}}return b.fill(0),{key:n,iv:i}}},32017:e=>{"use strict";e.exports=function e(a,t){if(a===t)return!0;if(a&&t&&"object"==typeof a&&"object"==typeof t){if(a.constructor!==t.constructor)return!1;var c,f,d;if(Array.isArray(a)){if((c=a.length)!=t.length)return!1;for(f=c;0!=f--;)if(!e(a[f],t[f]))return!1;return!0}if(a.constructor===RegExp)return a.source===t.source&&a.flags===t.flags;if(a.valueOf!==Object.prototype.valueOf)return a.valueOf()===t.valueOf();if(a.toString!==Object.prototype.toString)return a.toString()===t.toString();if((c=(d=Object.keys(a)).length)!==Object.keys(t).length)return!1;for(f=c;0!=f--;)if(!Object.prototype.hasOwnProperty.call(t,d[f]))return!1;for(f=c;0!=f--;){var r=d[f];if(!e(a[r],t[r]))return!1}return!0}return a!=a&&t!=t}},82682:(e,a,t)=>{"use strict";var c=t(69600),f=Object.prototype.toString,d=Object.prototype.hasOwnProperty;e.exports=function(e,a,t){if(!c(a))throw new TypeError("iterator must be a function");var r;arguments.length>=3&&(r=t),"[object Array]"===f.call(e)?function(e,a,t){for(var c=0,f=e.length;c{"use strict";var a=Object.prototype.toString,t=Math.max,c=function(e,a){for(var t=[],c=0;c{"use strict";var c=t(89353);e.exports=Function.prototype.bind||c},70453:(e,a,t)=>{"use strict";var c,f=t(69383),d=t(41237),r=t(79290),n=t(79538),i=t(58068),b=t(69675),o=t(35345),s=Function,l=function(e){try{return s('"use strict"; return ('+e+").constructor;")()}catch(e){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(e){u=null}var h=function(){throw new b},p=u?function(){try{return h}catch(e){try{return u(arguments,"callee").get}catch(e){return h}}}():h,g=t(64039)(),m=t(80024)(),x=Object.getPrototypeOf||(m?function(e){return e.__proto__}:null),y={},A="undefined"!=typeof Uint8Array&&x?x(Uint8Array):c,v={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?c:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?c:ArrayBuffer,"%ArrayIteratorPrototype%":g&&x?x([][Symbol.iterator]()):c,"%AsyncFromSyncIteratorPrototype%":c,"%AsyncFunction%":y,"%AsyncGenerator%":y,"%AsyncGeneratorFunction%":y,"%AsyncIteratorPrototype%":y,"%Atomics%":"undefined"==typeof Atomics?c:Atomics,"%BigInt%":"undefined"==typeof BigInt?c:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?c:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?c:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?c:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":f,"%eval%":eval,"%EvalError%":d,"%Float32Array%":"undefined"==typeof Float32Array?c:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?c:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?c:FinalizationRegistry,"%Function%":s,"%GeneratorFunction%":y,"%Int8Array%":"undefined"==typeof Int8Array?c:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?c:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?c:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&x?x(x([][Symbol.iterator]())):c,"%JSON%":"object"==typeof JSON?JSON:c,"%Map%":"undefined"==typeof Map?c:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&x?x((new Map)[Symbol.iterator]()):c,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?c:Promise,"%Proxy%":"undefined"==typeof Proxy?c:Proxy,"%RangeError%":r,"%ReferenceError%":n,"%Reflect%":"undefined"==typeof Reflect?c:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?c:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&x?x((new Set)[Symbol.iterator]()):c,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?c:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&x?x(""[Symbol.iterator]()):c,"%Symbol%":g?Symbol:c,"%SyntaxError%":i,"%ThrowTypeError%":p,"%TypedArray%":A,"%TypeError%":b,"%Uint8Array%":"undefined"==typeof Uint8Array?c:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?c:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?c:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?c:Uint32Array,"%URIError%":o,"%WeakMap%":"undefined"==typeof WeakMap?c:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?c:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?c:WeakSet};if(x)try{null.error}catch(e){var w=x(x(e));v["%Error.prototype%"]=w}var _=function e(a){var t;if("%AsyncFunction%"===a)t=l("async function () {}");else if("%GeneratorFunction%"===a)t=l("function* () {}");else if("%AsyncGeneratorFunction%"===a)t=l("async function* () {}");else if("%AsyncGenerator%"===a){var c=e("%AsyncGeneratorFunction%");c&&(t=c.prototype)}else if("%AsyncIteratorPrototype%"===a){var f=e("%AsyncGenerator%");f&&x&&(t=x(f.prototype))}return v[a]=t,t},I={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},E=t(66743),C=t(9957),M=E.call(Function.call,Array.prototype.concat),B=E.call(Function.apply,Array.prototype.splice),k=E.call(Function.call,String.prototype.replace),L=E.call(Function.call,String.prototype.slice),S=E.call(Function.call,RegExp.prototype.exec),T=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,N=/\\(\\)?/g,R=function(e,a){var t,c=e;if(C(I,c)&&(c="%"+(t=I[c])[0]+"%"),C(v,c)){var f=v[c];if(f===y&&(f=_(c)),void 0===f&&!a)throw new b("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:t,name:c,value:f}}throw new i("intrinsic "+e+" does not exist!")};e.exports=function(e,a){if("string"!=typeof e||0===e.length)throw new b("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof a)throw new b('"allowMissing" argument must be a boolean');if(null===S(/^%?[^%]*%?$/,e))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var t=function(e){var a=L(e,0,1),t=L(e,-1);if("%"===a&&"%"!==t)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===t&&"%"!==a)throw new i("invalid intrinsic syntax, expected opening `%`");var c=[];return k(e,T,(function(e,a,t,f){c[c.length]=t?k(f,N,"$1"):a||e})),c}(e),c=t.length>0?t[0]:"",f=R("%"+c+"%",a),d=f.name,r=f.value,n=!1,o=f.alias;o&&(c=o[0],B(t,M([0,1],o)));for(var s=1,l=!0;s=t.length){var m=u(r,h);r=(l=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:r[h]}else l=C(r,h),r=r[h];l&&!n&&(v[d]=r)}}return r}},75795:(e,a,t)=>{"use strict";var c=t(70453)("%Object.getOwnPropertyDescriptor%",!0);if(c)try{c([],"length")}catch(e){c=null}e.exports=c},30592:(e,a,t)=>{"use strict";var c=t(30655),f=function(){return!!c};f.hasArrayLengthDefineBug=function(){if(!c)return null;try{return 1!==c([],"length",{value:1}).length}catch(e){return!0}},e.exports=f},80024:e=>{"use strict";var a={__proto__:null,foo:{}},t=Object;e.exports=function(){return{__proto__:a}.foo===a.foo&&!(a instanceof t)}},64039:(e,a,t)=>{"use strict";var c="undefined"!=typeof Symbol&&Symbol,f=t(41333);e.exports=function(){return"function"==typeof c&&"function"==typeof Symbol&&"symbol"==typeof c("foo")&&"symbol"==typeof Symbol("bar")&&f()}},41333:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},a=Symbol("test"),t=Object(a);if("string"==typeof a)return!1;if("[object Symbol]"!==Object.prototype.toString.call(a))return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;for(a in e[a]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var c=Object.getOwnPropertySymbols(e);if(1!==c.length||c[0]!==a)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,a))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var f=Object.getOwnPropertyDescriptor(e,a);if(42!==f.value||!0!==f.enumerable)return!1}return!0}},49092:(e,a,t)=>{"use strict";var c=t(41333);e.exports=function(){return c()&&!!Symbol.toStringTag}},77952:(e,a,t)=>{var c=a;c.utils=t(67426),c.common=t(66166),c.sha=t(46229),c.ripemd=t(46784),c.hmac=t(28948),c.sha1=c.sha.sha1,c.sha256=c.sha.sha256,c.sha224=c.sha.sha224,c.sha384=c.sha.sha384,c.sha512=c.sha.sha512,c.ripemd160=c.ripemd.ripemd160},66166:(e,a,t)=>{"use strict";var c=t(67426),f=t(43349);function d(){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}a.BlockHash=d,d.prototype.update=function(e,a){if(e=c.toArray(e,a),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var t=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-t,e.length),0===this.pending.length&&(this.pending=null),e=c.join32(e,0,e.length-t,this.endian);for(var f=0;f>>24&255,c[f++]=e>>>16&255,c[f++]=e>>>8&255,c[f++]=255&e}else for(c[f++]=255&e,c[f++]=e>>>8&255,c[f++]=e>>>16&255,c[f++]=e>>>24&255,c[f++]=0,c[f++]=0,c[f++]=0,c[f++]=0,d=8;d{"use strict";var c=t(67426),f=t(43349);function d(e,a,t){if(!(this instanceof d))return new d(e,a,t);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(c.toArray(a,t))}e.exports=d,d.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),f(e.length<=this.blockSize);for(var a=e.length;a{"use strict";var c=t(67426),f=t(66166),d=c.rotl32,r=c.sum32,n=c.sum32_3,i=c.sum32_4,b=f.BlockHash;function o(){if(!(this instanceof o))return new o;b.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function s(e,a,t,c){return e<=15?a^t^c:e<=31?a&t|~a&c:e<=47?(a|~t)^c:e<=63?a&c|t&~c:a^(t|~c)}function l(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function u(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}c.inherits(o,b),a.ripemd160=o,o.blockSize=512,o.outSize=160,o.hmacStrength=192,o.padLength=64,o.prototype._update=function(e,a){for(var t=this.h[0],c=this.h[1],f=this.h[2],b=this.h[3],o=this.h[4],x=t,y=c,A=f,v=b,w=o,_=0;_<80;_++){var I=r(d(i(t,s(_,c,f,b),e[h[_]+a],l(_)),g[_]),o);t=o,o=b,b=d(f,10),f=c,c=I,I=r(d(i(x,s(79-_,y,A,v),e[p[_]+a],u(_)),m[_]),w),x=w,w=v,v=d(A,10),A=y,y=I}I=n(this.h[1],f,v),this.h[1]=n(this.h[2],b,w),this.h[2]=n(this.h[3],o,x),this.h[3]=n(this.h[4],t,y),this.h[4]=n(this.h[0],c,A),this.h[0]=I},o.prototype._digest=function(e){return"hex"===e?c.toHex32(this.h,"little"):c.split32(this.h,"little")};var h=[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],p=[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],g=[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],m=[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]},46229:(e,a,t)=>{"use strict";a.sha1=t(43917),a.sha224=t(47714),a.sha256=t(2287),a.sha384=t(21911),a.sha512=t(57766)},43917:(e,a,t)=>{"use strict";var c=t(67426),f=t(66166),d=t(66225),r=c.rotl32,n=c.sum32,i=c.sum32_5,b=d.ft_1,o=f.BlockHash,s=[1518500249,1859775393,2400959708,3395469782];function l(){if(!(this instanceof l))return new l;o.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}c.inherits(l,o),e.exports=l,l.blockSize=512,l.outSize=160,l.hmacStrength=80,l.padLength=64,l.prototype._update=function(e,a){for(var t=this.W,c=0;c<16;c++)t[c]=e[a+c];for(;c{"use strict";var c=t(67426),f=t(2287);function d(){if(!(this instanceof d))return new d;f.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}c.inherits(d,f),e.exports=d,d.blockSize=512,d.outSize=224,d.hmacStrength=192,d.padLength=64,d.prototype._digest=function(e){return"hex"===e?c.toHex32(this.h.slice(0,7),"big"):c.split32(this.h.slice(0,7),"big")}},2287:(e,a,t)=>{"use strict";var c=t(67426),f=t(66166),d=t(66225),r=t(43349),n=c.sum32,i=c.sum32_4,b=c.sum32_5,o=d.ch32,s=d.maj32,l=d.s0_256,u=d.s1_256,h=d.g0_256,p=d.g1_256,g=f.BlockHash,m=[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 x(){if(!(this instanceof x))return new x;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}c.inherits(x,g),e.exports=x,x.blockSize=512,x.outSize=256,x.hmacStrength=192,x.padLength=64,x.prototype._update=function(e,a){for(var t=this.W,c=0;c<16;c++)t[c]=e[a+c];for(;c{"use strict";var c=t(67426),f=t(57766);function d(){if(!(this instanceof d))return new d;f.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}c.inherits(d,f),e.exports=d,d.blockSize=1024,d.outSize=384,d.hmacStrength=192,d.padLength=128,d.prototype._digest=function(e){return"hex"===e?c.toHex32(this.h.slice(0,12),"big"):c.split32(this.h.slice(0,12),"big")}},57766:(e,a,t)=>{"use strict";var c=t(67426),f=t(66166),d=t(43349),r=c.rotr64_hi,n=c.rotr64_lo,i=c.shr64_hi,b=c.shr64_lo,o=c.sum64,s=c.sum64_hi,l=c.sum64_lo,u=c.sum64_4_hi,h=c.sum64_4_lo,p=c.sum64_5_hi,g=c.sum64_5_lo,m=f.BlockHash,x=[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 y(){if(!(this instanceof y))return new y;m.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=x,this.W=new Array(160)}function A(e,a,t,c,f){var d=e&t^~e&f;return d<0&&(d+=4294967296),d}function v(e,a,t,c,f,d){var r=a&c^~a&d;return r<0&&(r+=4294967296),r}function w(e,a,t,c,f){var d=e&t^e&f^t&f;return d<0&&(d+=4294967296),d}function _(e,a,t,c,f,d){var r=a&c^a&d^c&d;return r<0&&(r+=4294967296),r}function I(e,a){var t=r(e,a,28)^r(a,e,2)^r(a,e,7);return t<0&&(t+=4294967296),t}function E(e,a){var t=n(e,a,28)^n(a,e,2)^n(a,e,7);return t<0&&(t+=4294967296),t}function C(e,a){var t=n(e,a,14)^n(e,a,18)^n(a,e,9);return t<0&&(t+=4294967296),t}function M(e,a){var t=r(e,a,1)^r(e,a,8)^i(e,a,7);return t<0&&(t+=4294967296),t}function B(e,a){var t=n(e,a,1)^n(e,a,8)^b(e,a,7);return t<0&&(t+=4294967296),t}function k(e,a){var t=n(e,a,19)^n(a,e,29)^b(e,a,6);return t<0&&(t+=4294967296),t}c.inherits(y,m),e.exports=y,y.blockSize=1024,y.outSize=512,y.hmacStrength=192,y.padLength=128,y.prototype._prepareBlock=function(e,a){for(var t=this.W,c=0;c<32;c++)t[c]=e[a+c];for(;c{"use strict";var c=t(67426).rotr32;function f(e,a,t){return e&a^~e&t}function d(e,a,t){return e&a^e&t^a&t}function r(e,a,t){return e^a^t}a.ft_1=function(e,a,t,c){return 0===e?f(a,t,c):1===e||3===e?r(a,t,c):2===e?d(a,t,c):void 0},a.ch32=f,a.maj32=d,a.p32=r,a.s0_256=function(e){return c(e,2)^c(e,13)^c(e,22)},a.s1_256=function(e){return c(e,6)^c(e,11)^c(e,25)},a.g0_256=function(e){return c(e,7)^c(e,18)^e>>>3},a.g1_256=function(e){return c(e,17)^c(e,19)^e>>>10}},67426:(e,a,t)=>{"use strict";var c=t(43349),f=t(56698);function d(e,a){return 55296==(64512&e.charCodeAt(a))&&!(a<0||a+1>=e.length)&&56320==(64512&e.charCodeAt(a+1))}function r(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function n(e){return 1===e.length?"0"+e:e}function i(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}a.inherits=f,a.toArray=function(e,a){if(Array.isArray(e))return e.slice();if(!e)return[];var t=[];if("string"==typeof e)if(a){if("hex"===a)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),f=0;f>6|192,t[c++]=63&r|128):d(e,f)?(r=65536+((1023&r)<<10)+(1023&e.charCodeAt(++f)),t[c++]=r>>18|240,t[c++]=r>>12&63|128,t[c++]=r>>6&63|128,t[c++]=63&r|128):(t[c++]=r>>12|224,t[c++]=r>>6&63|128,t[c++]=63&r|128)}else for(f=0;f>>0}return r},a.split32=function(e,a){for(var t=new Array(4*e.length),c=0,f=0;c>>24,t[f+1]=d>>>16&255,t[f+2]=d>>>8&255,t[f+3]=255&d):(t[f+3]=d>>>24,t[f+2]=d>>>16&255,t[f+1]=d>>>8&255,t[f]=255&d)}return t},a.rotr32=function(e,a){return e>>>a|e<<32-a},a.rotl32=function(e,a){return e<>>32-a},a.sum32=function(e,a){return e+a>>>0},a.sum32_3=function(e,a,t){return e+a+t>>>0},a.sum32_4=function(e,a,t,c){return e+a+t+c>>>0},a.sum32_5=function(e,a,t,c,f){return e+a+t+c+f>>>0},a.sum64=function(e,a,t,c){var f=e[a],d=c+e[a+1]>>>0,r=(d>>0,e[a+1]=d},a.sum64_hi=function(e,a,t,c){return(a+c>>>0>>0},a.sum64_lo=function(e,a,t,c){return a+c>>>0},a.sum64_4_hi=function(e,a,t,c,f,d,r,n){var i=0,b=a;return i+=(b=b+c>>>0)>>0)>>0)>>0},a.sum64_4_lo=function(e,a,t,c,f,d,r,n){return a+c+d+n>>>0},a.sum64_5_hi=function(e,a,t,c,f,d,r,n,i,b){var o=0,s=a;return o+=(s=s+c>>>0)>>0)>>0)>>0)>>0},a.sum64_5_lo=function(e,a,t,c,f,d,r,n,i,b){return a+c+d+n+b>>>0},a.rotr64_hi=function(e,a,t){return(a<<32-t|e>>>t)>>>0},a.rotr64_lo=function(e,a,t){return(e<<32-t|a>>>t)>>>0},a.shr64_hi=function(e,a,t){return e>>>t},a.shr64_lo=function(e,a,t){return(e<<32-t|a>>>t)>>>0}},9957:(e,a,t)=>{"use strict";var c=Function.prototype.call,f=Object.prototype.hasOwnProperty,d=t(66743);e.exports=d.call(c,f)},32723:(e,a,t)=>{"use strict";var c=t(77952),f=t(64367),d=t(43349);function r(e){if(!(this instanceof r))return new r(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 a=f.toArray(e.entropy,e.entropyEnc||"hex"),t=f.toArray(e.nonce,e.nonceEnc||"hex"),c=f.toArray(e.pers,e.persEnc||"hex");d(a.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(a,t,c)}e.exports=r,r.prototype._init=function(e,a,t){var c=e.concat(a).concat(t);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var f=0;f=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(t||[])),this._reseed=1},r.prototype.generate=function(e,a,t,c){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof a&&(c=t,t=a,a=null),t&&(t=f.toArray(t,c||"hex"),this._update(t));for(var d=[];d.length{var c=t(11568),f=t(23276),d=e.exports;for(var r in c)c.hasOwnProperty(r)&&(d[r]=c[r]);function n(e){if("string"==typeof e&&(e=f.parse(e)),e.protocol||(e.protocol="https:"),"https:"!==e.protocol)throw new Error('Protocol "'+e.protocol+'" not supported. Expected "https:"');return e}d.request=function(e,a){return e=n(e),c.request.call(this,e,a)},d.get=function(e,a){return e=n(e),c.get.call(this,e,a)}},251:(e,a)=>{a.read=function(e,a,t,c,f){var d,r,n=8*f-c-1,i=(1<>1,o=-7,s=t?f-1:0,l=t?-1:1,u=e[a+s];for(s+=l,d=u&(1<<-o)-1,u>>=-o,o+=n;o>0;d=256*d+e[a+s],s+=l,o-=8);for(r=d&(1<<-o)-1,d>>=-o,o+=c;o>0;r=256*r+e[a+s],s+=l,o-=8);if(0===d)d=1-b;else{if(d===i)return r?NaN:1/0*(u?-1:1);r+=Math.pow(2,c),d-=b}return(u?-1:1)*r*Math.pow(2,d-c)},a.write=function(e,a,t,c,f,d){var r,n,i,b=8*d-f-1,o=(1<>1,l=23===f?Math.pow(2,-24)-Math.pow(2,-77):0,u=c?0:d-1,h=c?1:-1,p=a<0||0===a&&1/a<0?1:0;for(a=Math.abs(a),isNaN(a)||a===1/0?(n=isNaN(a)?1:0,r=o):(r=Math.floor(Math.log(a)/Math.LN2),a*(i=Math.pow(2,-r))<1&&(r--,i*=2),(a+=r+s>=1?l/i:l*Math.pow(2,1-s))*i>=2&&(r++,i/=2),r+s>=o?(n=0,r=o):r+s>=1?(n=(a*i-1)*Math.pow(2,f),r+=s):(n=a*Math.pow(2,s-1)*Math.pow(2,f),r=0));f>=8;e[t+u]=255&n,u+=h,n/=256,f-=8);for(r=r<0;e[t+u]=255&r,u+=h,r/=256,b-=8);e[t+u-h]|=128*p}},56698:e=>{"function"==typeof Object.create?e.exports=function(e,a){a&&(e.super_=a,e.prototype=Object.create(a.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,a){if(a){e.super_=a;var t=function(){};t.prototype=a.prototype,e.prototype=new t,e.prototype.constructor=e}}},47244:(e,a,t)=>{"use strict";var c=t(49092)(),f=t(38075)("Object.prototype.toString"),d=function(e){return!(c&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===f(e)},r=function(e){return!!d(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==f(e)&&"[object Function]"===f(e.callee)},n=function(){return d(arguments)}();d.isLegacyArguments=r,e.exports=n?d:r},69600:e=>{"use strict";var a,t,c=Function.prototype.toString,f="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof f&&"function"==typeof Object.defineProperty)try{a=Object.defineProperty({},"length",{get:function(){throw t}}),t={},f((function(){throw 42}),null,a)}catch(e){e!==t&&(f=null)}else f=null;var d=/^\s*class\b/,r=function(e){try{var a=c.call(e);return d.test(a)}catch(e){return!1}},n=function(e){try{return!r(e)&&(c.call(e),!0)}catch(e){return!1}},i=Object.prototype.toString,b="function"==typeof Symbol&&!!Symbol.toStringTag,o=!(0 in[,]),s=function(){return!1};if("object"==typeof document){var l=document.all;i.call(l)===i.call(document.all)&&(s=function(e){if((o||!e)&&(void 0===e||"object"==typeof e))try{var a=i.call(e);return("[object HTMLAllCollection]"===a||"[object HTML document.all class]"===a||"[object HTMLCollection]"===a||"[object Object]"===a)&&null==e("")}catch(e){}return!1})}e.exports=f?function(e){if(s(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{f(e,null,a)}catch(e){if(e!==t)return!1}return!r(e)&&n(e)}:function(e){if(s(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(b)return n(e);if(r(e))return!1;var a=i.call(e);return!("[object Function]"!==a&&"[object GeneratorFunction]"!==a&&!/^\[object HTML/.test(a))&&n(e)}},48184:(e,a,t)=>{"use strict";var c,f=Object.prototype.toString,d=Function.prototype.toString,r=/^\s*(?:function)?\*/,n=t(49092)(),i=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(r.test(d.call(e)))return!0;if(!n)return"[object GeneratorFunction]"===f.call(e);if(!i)return!1;if(void 0===c){var a=function(){if(!n)return!1;try{return Function("return function*() {}")()}catch(e){}}();c=!!a&&i(a)}return i(e)===c}},13003:e=>{"use strict";e.exports=function(e){return e!=e}},24133:(e,a,t)=>{"use strict";var c=t(10487),f=t(38452),d=t(13003),r=t(76642),n=t(92464),i=c(r(),Number);f(i,{getPolyfill:r,implementation:d,shim:n}),e.exports=i},76642:(e,a,t)=>{"use strict";var c=t(13003);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:c}},92464:(e,a,t)=>{"use strict";var c=t(38452),f=t(76642);e.exports=function(){var e=f();return c(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},35680:(e,a,t)=>{"use strict";var c=t(25767);e.exports=function(e){return!!c(e)}},8127:function(e,a,t){var c=t(62045).hp;"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t.g&&t.g,e.exports=function(){"use strict";var e,a="3.7.7",t=a,f="function"==typeof c,d="function"==typeof TextDecoder?new TextDecoder:void 0,r="function"==typeof TextEncoder?new TextEncoder:void 0,n=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),i=(e={},n.forEach((function(a,t){return e[a]=t})),e),b=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,o=String.fromCharCode.bind(String),s="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):function(e){return new Uint8Array(Array.prototype.slice.call(e,0))},l=function(e){return e.replace(/=/g,"").replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"}))},u=function(e){return e.replace(/[^A-Za-z0-9\+\/]/g,"")},h=function(e){for(var a,t,c,f,d="",r=e.length%3,i=0;i255||(c=e.charCodeAt(i++))>255||(f=e.charCodeAt(i++))>255)throw new TypeError("invalid character found");d+=n[(a=t<<16|c<<8|f)>>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]}return r?d.slice(0,r-3)+"===".substring(r):d},p="function"==typeof btoa?function(e){return btoa(e)}:f?function(e){return c.from(e,"binary").toString("base64")}:h,g=f?function(e){return c.from(e).toString("base64")}:function(e){for(var a=[],t=0,c=e.length;t>>6)+o(128|63&a):o(224|a>>>12&15)+o(128|a>>>6&63)+o(128|63&a);var a=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return o(240|a>>>18&7)+o(128|a>>>12&63)+o(128|a>>>6&63)+o(128|63&a)},y=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,A=function(e){return e.replace(y,x)},v=f?function(e){return c.from(e,"utf8").toString("base64")}:r?function(e){return g(r.encode(e))}:function(e){return p(A(e))},w=function(e,a){return void 0===a&&(a=!1),a?l(v(e)):v(e)},_=function(e){return w(e,!0)},I=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,E=function(e){switch(e.length){case 4:var a=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return o(55296+(a>>>10))+o(56320+(1023&a));case 3:return o((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return o((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},C=function(e){return e.replace(I,E)},M=function(e){if(e=e.replace(/\s+/g,""),!b.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));for(var a,t,c,f="",d=0;d>16&255):64===c?o(a>>16&255,a>>8&255):o(a>>16&255,a>>8&255,255&a);return f},B="function"==typeof atob?function(e){return atob(u(e))}:f?function(e){return c.from(e,"base64").toString("binary")}:M,k=f?function(e){return s(c.from(e,"base64"))}:function(e){return s(B(e).split("").map((function(e){return e.charCodeAt(0)})))},L=function(e){return k(T(e))},S=f?function(e){return c.from(e,"base64").toString("utf8")}:d?function(e){return d.decode(k(e))}:function(e){return C(B(e))},T=function(e){return u(e.replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})))},N=function(e){return S(T(e))},R=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}},P=function(){var e=function(e,a){return Object.defineProperty(String.prototype,e,R(a))};e("fromBase64",(function(){return N(this)})),e("toBase64",(function(e){return w(this,e)})),e("toBase64URI",(function(){return w(this,!0)})),e("toBase64URL",(function(){return w(this,!0)})),e("toUint8Array",(function(){return L(this)}))},D=function(){var e=function(e,a){return Object.defineProperty(Uint8Array.prototype,e,R(a))};e("toBase64",(function(e){return m(this,e)})),e("toBase64URI",(function(){return m(this,!0)})),e("toBase64URL",(function(){return m(this,!0)}))},O={version:a,VERSION:t,atob:B,atobPolyfill:M,btoa:p,btoaPolyfill:h,fromBase64:N,toBase64:w,encode:w,encodeURI:_,encodeURL:_,utob:A,btou:C,decode:N,isValid:function(e){if("string"!=typeof e)return!1;var a=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(a)||!/[^\s0-9a-zA-Z\-_]/.test(a)},fromUint8Array:m,toUint8Array:L,extendString:P,extendUint8Array:D,extendBuiltins:function(){P(),D()},Base64:{}};return Object.keys(O).forEach((function(e){return O.Base64[e]=O[e]})),O}()},31176:(e,a,t)=>{var c;!function(){"use strict";var f="input is invalid type",d="object"==typeof window,r=d?window:{};r.JS_SHA3_NO_WINDOW&&(d=!1);var n=!d&&"object"==typeof self;!r.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?r=t.g:n&&(r=self);var i=!r.JS_SHA3_NO_COMMON_JS&&e.exports,b=t.amdO,o=!r.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,s="0123456789abcdef".split(""),l=[4,1024,262144,67108864],u=[0,8,16,24],h=[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],p=[224,256,384,512],g=[128,256],m=["hex","buffer","arrayBuffer","array","digest"],x={128:168,256:136};!r.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!o||!r.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var y=function(e,a,t){return function(c){return new R(e,a,e).update(c)[t]()}},A=function(e,a,t){return function(c,f){return new R(e,a,f).update(c)[t]()}},v=function(e,a,t){return function(a,c,f,d){return C["cshake"+e].update(a,c,f,d)[t]()}},w=function(e,a,t){return function(a,c,f,d){return C["kmac"+e].update(a,c,f,d)[t]()}},_=function(e,a,t,c){for(var f=0;f>5,this.byteCount=this.blockCount<<2,this.outputBlocks=t>>5,this.extraBytes=(31&t)>>3;for(var c=0;c<50;++c)this.s[c]=0}function P(e,a,t){R.call(this,e,a,t)}R.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var a,t=typeof e;if("string"!==t){if("object"!==t)throw new Error(f);if(null===e)throw new Error(f);if(o&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||o&&ArrayBuffer.isView(e)))throw new Error(f);a=!0}for(var c,d,r=this.blocks,n=this.byteCount,i=e.length,b=this.blockCount,s=0,l=this.s;s>2]|=e[s]<>2]|=d<>2]|=(192|d>>6)<>2]|=(128|63&d)<=57344?(r[c>>2]|=(224|d>>12)<>2]|=(128|d>>6&63)<>2]|=(128|63&d)<>2]|=(240|d>>18)<>2]|=(128|d>>12&63)<>2]|=(128|d>>6&63)<>2]|=(128|63&d)<=n){for(this.start=c-n,this.block=r[b],c=0;c>=8);t>0;)f.unshift(t),t=255&(e>>=8),++c;return a?f.push(c):f.unshift(c),this.update(f),f.length},R.prototype.encodeString=function(e){var a,t=typeof e;if("string"!==t){if("object"!==t)throw new Error(f);if(null===e)throw new Error(f);if(o&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||o&&ArrayBuffer.isView(e)))throw new Error(f);a=!0}var c=0,d=e.length;if(a)c=d;else for(var r=0;r=57344?c+=3:(n=65536+((1023&n)<<10|1023&e.charCodeAt(++r)),c+=4)}return c+=this.encode(8*c),this.update(e),c},R.prototype.bytepad=function(e,a){for(var t=this.encode(a),c=0;c>2]|=this.padding[3&a],this.lastByteIndex===this.byteCount)for(e[0]=e[t],a=1;a>4&15]+s[15&e]+s[e>>12&15]+s[e>>8&15]+s[e>>20&15]+s[e>>16&15]+s[e>>28&15]+s[e>>24&15];r%a==0&&(D(t),d=0)}return f&&(e=t[d],n+=s[e>>4&15]+s[15&e],f>1&&(n+=s[e>>12&15]+s[e>>8&15]),f>2&&(n+=s[e>>20&15]+s[e>>16&15])),n},R.prototype.arrayBuffer=function(){this.finalize();var e,a=this.blockCount,t=this.s,c=this.outputBlocks,f=this.extraBytes,d=0,r=0,n=this.outputBits>>3;e=f?new ArrayBuffer(c+1<<2):new ArrayBuffer(n);for(var i=new Uint32Array(e);r>8&255,i[e+2]=a>>16&255,i[e+3]=a>>24&255;n%t==0&&D(c)}return d&&(e=n<<2,a=c[r],i[e]=255&a,d>1&&(i[e+1]=a>>8&255),d>2&&(i[e+2]=a>>16&255)),i},P.prototype=new R,P.prototype.finalize=function(){return this.encode(this.outputBits,!0),R.prototype.finalize.call(this)};var D=function(e){var a,t,c,f,d,r,n,i,b,o,s,l,u,p,g,m,x,y,A,v,w,_,I,E,C,M,B,k,L,S,T,N,R,P,D,O,F,Q,U,j,H,q,$,z,G,K,V,Z,J,W,Y,X,ee,ae,te,ce,fe,de,re,ne,ie,be,oe;for(c=0;c<48;c+=2)f=e[0]^e[10]^e[20]^e[30]^e[40],d=e[1]^e[11]^e[21]^e[31]^e[41],r=e[2]^e[12]^e[22]^e[32]^e[42],n=e[3]^e[13]^e[23]^e[33]^e[43],i=e[4]^e[14]^e[24]^e[34]^e[44],b=e[5]^e[15]^e[25]^e[35]^e[45],o=e[6]^e[16]^e[26]^e[36]^e[46],s=e[7]^e[17]^e[27]^e[37]^e[47],a=(l=e[8]^e[18]^e[28]^e[38]^e[48])^(r<<1|n>>>31),t=(u=e[9]^e[19]^e[29]^e[39]^e[49])^(n<<1|r>>>31),e[0]^=a,e[1]^=t,e[10]^=a,e[11]^=t,e[20]^=a,e[21]^=t,e[30]^=a,e[31]^=t,e[40]^=a,e[41]^=t,a=f^(i<<1|b>>>31),t=d^(b<<1|i>>>31),e[2]^=a,e[3]^=t,e[12]^=a,e[13]^=t,e[22]^=a,e[23]^=t,e[32]^=a,e[33]^=t,e[42]^=a,e[43]^=t,a=r^(o<<1|s>>>31),t=n^(s<<1|o>>>31),e[4]^=a,e[5]^=t,e[14]^=a,e[15]^=t,e[24]^=a,e[25]^=t,e[34]^=a,e[35]^=t,e[44]^=a,e[45]^=t,a=i^(l<<1|u>>>31),t=b^(u<<1|l>>>31),e[6]^=a,e[7]^=t,e[16]^=a,e[17]^=t,e[26]^=a,e[27]^=t,e[36]^=a,e[37]^=t,e[46]^=a,e[47]^=t,a=o^(f<<1|d>>>31),t=s^(d<<1|f>>>31),e[8]^=a,e[9]^=t,e[18]^=a,e[19]^=t,e[28]^=a,e[29]^=t,e[38]^=a,e[39]^=t,e[48]^=a,e[49]^=t,p=e[0],g=e[1],K=e[11]<<4|e[10]>>>28,V=e[10]<<4|e[11]>>>28,k=e[20]<<3|e[21]>>>29,L=e[21]<<3|e[20]>>>29,ne=e[31]<<9|e[30]>>>23,ie=e[30]<<9|e[31]>>>23,q=e[40]<<18|e[41]>>>14,$=e[41]<<18|e[40]>>>14,P=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,m=e[13]<<12|e[12]>>>20,x=e[12]<<12|e[13]>>>20,Z=e[22]<<10|e[23]>>>22,J=e[23]<<10|e[22]>>>22,S=e[33]<<13|e[32]>>>19,T=e[32]<<13|e[33]>>>19,be=e[42]<<2|e[43]>>>30,oe=e[43]<<2|e[42]>>>30,ae=e[5]<<30|e[4]>>>2,te=e[4]<<30|e[5]>>>2,O=e[14]<<6|e[15]>>>26,F=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,A=e[24]<<11|e[25]>>>21,W=e[34]<<15|e[35]>>>17,Y=e[35]<<15|e[34]>>>17,N=e[45]<<29|e[44]>>>3,R=e[44]<<29|e[45]>>>3,E=e[6]<<28|e[7]>>>4,C=e[7]<<28|e[6]>>>4,ce=e[17]<<23|e[16]>>>9,fe=e[16]<<23|e[17]>>>9,Q=e[26]<<25|e[27]>>>7,U=e[27]<<25|e[26]>>>7,v=e[36]<<21|e[37]>>>11,w=e[37]<<21|e[36]>>>11,X=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,z=e[8]<<27|e[9]>>>5,G=e[9]<<27|e[8]>>>5,M=e[18]<<20|e[19]>>>12,B=e[19]<<20|e[18]>>>12,de=e[29]<<7|e[28]>>>25,re=e[28]<<7|e[29]>>>25,j=e[38]<<8|e[39]>>>24,H=e[39]<<8|e[38]>>>24,_=e[48]<<14|e[49]>>>18,I=e[49]<<14|e[48]>>>18,e[0]=p^~m&y,e[1]=g^~x&A,e[10]=E^~M&k,e[11]=C^~B&L,e[20]=P^~O&Q,e[21]=D^~F&U,e[30]=z^~K&Z,e[31]=G^~V&J,e[40]=ae^~ce&de,e[41]=te^~fe&re,e[2]=m^~y&v,e[3]=x^~A&w,e[12]=M^~k&S,e[13]=B^~L&T,e[22]=O^~Q&j,e[23]=F^~U&H,e[32]=K^~Z&W,e[33]=V^~J&Y,e[42]=ce^~de&ne,e[43]=fe^~re&ie,e[4]=y^~v&_,e[5]=A^~w&I,e[14]=k^~S&N,e[15]=L^~T&R,e[24]=Q^~j&q,e[25]=U^~H&$,e[34]=Z^~W&X,e[35]=J^~Y&ee,e[44]=de^~ne&be,e[45]=re^~ie&oe,e[6]=v^~_&p,e[7]=w^~I&g,e[16]=S^~N&E,e[17]=T^~R&C,e[26]=j^~q&P,e[27]=H^~$&D,e[36]=W^~X&z,e[37]=Y^~ee&G,e[46]=ne^~be&ae,e[47]=ie^~oe&te,e[8]=_^~p&m,e[9]=I^~g&x,e[18]=N^~E&M,e[19]=R^~C&B,e[28]=q^~P&O,e[29]=$^~D&F,e[38]=X^~z&K,e[39]=ee^~G&V,e[48]=be^~ae&ce,e[49]=oe^~te&fe,e[0]^=h[c],e[1]^=h[c+1]};if(i)e.exports=C;else{for(B=0;B{"use strict";var a=e.exports=function(e,a,c){"function"==typeof a&&(c=a,a={}),t(a,"function"==typeof(c=a.cb||c)?c:c.pre||function(){},c.post||function(){},e,"",e)};function t(e,c,f,d,r,n,i,b,o,s){if(d&&"object"==typeof d&&!Array.isArray(d)){for(var l in c(d,r,n,i,b,o,s),d){var u=d[l];if(Array.isArray(u)){if(l in a.arrayKeywords)for(var h=0;h{"use strict";var c=t(56698),f=t(73726),d=t(92861).Buffer,r=new Array(16);function n(){f.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function i(e,a){return e<>>32-a}function b(e,a,t,c,f,d,r){return i(e+(a&t|~a&c)+f+d|0,r)+a|0}function o(e,a,t,c,f,d,r){return i(e+(a&c|t&~c)+f+d|0,r)+a|0}function s(e,a,t,c,f,d,r){return i(e+(a^t^c)+f+d|0,r)+a|0}function l(e,a,t,c,f,d,r){return i(e+(t^(a|~c))+f+d|0,r)+a|0}c(n,f),n.prototype._update=function(){for(var e=r,a=0;a<16;++a)e[a]=this._block.readInt32LE(4*a);var t=this._a,c=this._b,f=this._c,d=this._d;t=b(t,c,f,d,e[0],3614090360,7),d=b(d,t,c,f,e[1],3905402710,12),f=b(f,d,t,c,e[2],606105819,17),c=b(c,f,d,t,e[3],3250441966,22),t=b(t,c,f,d,e[4],4118548399,7),d=b(d,t,c,f,e[5],1200080426,12),f=b(f,d,t,c,e[6],2821735955,17),c=b(c,f,d,t,e[7],4249261313,22),t=b(t,c,f,d,e[8],1770035416,7),d=b(d,t,c,f,e[9],2336552879,12),f=b(f,d,t,c,e[10],4294925233,17),c=b(c,f,d,t,e[11],2304563134,22),t=b(t,c,f,d,e[12],1804603682,7),d=b(d,t,c,f,e[13],4254626195,12),f=b(f,d,t,c,e[14],2792965006,17),t=o(t,c=b(c,f,d,t,e[15],1236535329,22),f,d,e[1],4129170786,5),d=o(d,t,c,f,e[6],3225465664,9),f=o(f,d,t,c,e[11],643717713,14),c=o(c,f,d,t,e[0],3921069994,20),t=o(t,c,f,d,e[5],3593408605,5),d=o(d,t,c,f,e[10],38016083,9),f=o(f,d,t,c,e[15],3634488961,14),c=o(c,f,d,t,e[4],3889429448,20),t=o(t,c,f,d,e[9],568446438,5),d=o(d,t,c,f,e[14],3275163606,9),f=o(f,d,t,c,e[3],4107603335,14),c=o(c,f,d,t,e[8],1163531501,20),t=o(t,c,f,d,e[13],2850285829,5),d=o(d,t,c,f,e[2],4243563512,9),f=o(f,d,t,c,e[7],1735328473,14),t=s(t,c=o(c,f,d,t,e[12],2368359562,20),f,d,e[5],4294588738,4),d=s(d,t,c,f,e[8],2272392833,11),f=s(f,d,t,c,e[11],1839030562,16),c=s(c,f,d,t,e[14],4259657740,23),t=s(t,c,f,d,e[1],2763975236,4),d=s(d,t,c,f,e[4],1272893353,11),f=s(f,d,t,c,e[7],4139469664,16),c=s(c,f,d,t,e[10],3200236656,23),t=s(t,c,f,d,e[13],681279174,4),d=s(d,t,c,f,e[0],3936430074,11),f=s(f,d,t,c,e[3],3572445317,16),c=s(c,f,d,t,e[6],76029189,23),t=s(t,c,f,d,e[9],3654602809,4),d=s(d,t,c,f,e[12],3873151461,11),f=s(f,d,t,c,e[15],530742520,16),t=l(t,c=s(c,f,d,t,e[2],3299628645,23),f,d,e[0],4096336452,6),d=l(d,t,c,f,e[7],1126891415,10),f=l(f,d,t,c,e[14],2878612391,15),c=l(c,f,d,t,e[5],4237533241,21),t=l(t,c,f,d,e[12],1700485571,6),d=l(d,t,c,f,e[3],2399980690,10),f=l(f,d,t,c,e[10],4293915773,15),c=l(c,f,d,t,e[1],2240044497,21),t=l(t,c,f,d,e[8],1873313359,6),d=l(d,t,c,f,e[15],4264355552,10),f=l(f,d,t,c,e[6],2734768916,15),c=l(c,f,d,t,e[13],1309151649,21),t=l(t,c,f,d,e[4],4149444226,6),d=l(d,t,c,f,e[11],3174756917,10),f=l(f,d,t,c,e[2],718787259,15),c=l(c,f,d,t,e[9],3951481745,21),this._a=this._a+t|0,this._b=this._b+c|0,this._c=this._c+f|0,this._d=this._d+d|0},n.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=d.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=n},73726:(e,a,t)=>{"use strict";var c=t(92861).Buffer,f=t(28399).Transform;function d(e){f.call(this),this._block=c.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}t(56698)(d,f),d.prototype._transform=function(e,a,t){var c=null;try{this.update(e,a)}catch(e){c=e}t(c)},d.prototype._flush=function(e){var a=null;try{this.push(this.digest())}catch(e){a=e}e(a)},d.prototype.update=function(e,a){if(function(e){if(!c.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer")}(e),this._finalized)throw new Error("Digest already called");c.isBuffer(e)||(e=c.from(e,a));for(var t=this._block,f=0;this._blockOffset+e.length-f>=this._blockSize;){for(var d=this._blockOffset;d0;++r)this._length[r]+=n,(n=this._length[r]/4294967296|0)>0&&(this._length[r]-=4294967296*n);return this},d.prototype._update=function(){throw new Error("_update is not implemented")},d.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var a=this._digest();void 0!==e&&(a=a.toString(e)),this._block.fill(0),this._blockOffset=0;for(var t=0;t<4;++t)this._length[t]=0;return a},d.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=d},6215:(e,a,t)=>{"use strict";var c=t(62045).hp;Object.defineProperty(a,"__esModule",{value:!0}),a.InvalidStatusCodeError=a.InvalidCertError=void 0;const f=Object.freeze({redirect:!0,expectStatusCode:200,headers:{},full:!1,keepAlive:!0,cors:!1,referrer:!1,sslAllowSelfSigned:!1,_redirectCount:0});class d extends Error{constructor(e,a){super(e),this.fingerprint256=a}}a.InvalidCertError=d;class r extends Error{constructor(e){super(`Request Failed. Status Code: ${e}`),this.statusCode=e}}function n(e,a){if(!a||"text"===a||"json"===a)try{let t=new TextDecoder("utf8",{fatal:!0}).decode(e);if("text"===a)return t;try{return JSON.parse(t)}catch(e){if("json"===a)throw e;return t}}catch(e){if("text"===a||"json"===a)throw e}return e}a.InvalidStatusCodeError=r;let i={};function b(e,a){let o={...f,...a};const s=t(11568),l=t(11083),u=t(78559),{promisify:h}=t(40537),{resolve:p}=t(59676),g=!!/^https/.test(e);let m={method:o.method||"GET",headers:{"Accept-Encoding":"gzip, deflate, br"}};const x=e=>e.replace(/:| /g,"").toLowerCase();if(o.keepAlive){const e={keepAlive:!0,keepAliveMsecs:3e4,maxFreeSockets:1024,maxCachedSessions:1024},a=[g,g&&o.sslPinnedCertificates?.map((e=>x(e))).sort()].join();m.agent=i[a]||(i[a]=new(g?l:s).Agent(e))}return"json"===o.type&&(m.headers["Content-Type"]="application/json"),o.data&&(o.method||(m.method="POST"),m.body="json"===o.type?JSON.stringify(o.data):o.data),m.headers={...m.headers,...o.headers},o.sslAllowSelfSigned&&(m.rejectUnauthorized=!1),new Promise(((a,t)=>{const f=async a=>{if(a&&"DEPTH_ZERO_SELF_SIGNED_CERT"===a.code)try{await b(e,{...o,sslAllowSelfSigned:!0,sslPinnedCertificates:[]})}catch(e){e&&e.fingerprint256&&(a=new d(`Self-signed SSL certificate: ${e.fingerprint256}`,e.fingerprint256))}t(a)},i=(g?l:s).request(e,m,(d=>{d.on("error",f),(async()=>{try{a(await(async a=>{const t=a.statusCode;if(o.redirect&&300<=t&&t<400&&a.headers.location){if(10==o._redirectCount)throw new Error("Request failed. Too much redirects.");return o._redirectCount+=1,await b(p(e,a.headers.location),o)}if(o.expectStatusCode&&t!==o.expectStatusCode)throw a.resume(),new r(t);let f=[];for await(const e of a)f.push(e);let d=c.concat(f);const i=a.headers["content-encoding"];"br"===i&&(d=await h(u.brotliDecompress)(d)),"gzip"!==i&&"deflate"!==i||(d=await h(u.unzip)(d));const s=n(d,o.type);return o.full?{headers:a.headers,status:t,body:s}:s})(d))}catch(e){t(e)}})()}));i.on("error",f);const y=o.sslPinnedCertificates?.map((e=>x(e))),A=e=>{const a=x(e.getPeerCertificate()?.fingerprint256||"");if((a||!e.isSessionReused())&&!y.includes(a))return i.emit("error",new d(`Invalid SSL certificate: ${a} Expected: ${y}`,a)),i.abort()};o.sslPinnedCertificates&&i.on("socket",(e=>{e.listeners("secureConnect").map((e=>(e.name||"").replace("bound ",""))).includes("mfetchSecureConnect")||e.on("secureConnect",A.bind(null,e))})),o.keepAlive&&i.setNoDelay(!0),m.body&&i.write(m.body),i.end()}))}const o=new Set(["Accept","Accept-Language","Content-Language","Content-Type"].map((e=>e.toLowerCase()))),s=new Set(["Accept-Charset","Accept-Encoding","Access-Control-Request-Headers","Access-Control-Request-Method","Connection","Content-Length","Cookie","Cookie2","Date","DNT","Expect","Host","Keep-Alive","Origin","Referer","TE","Trailer","Transfer-Encoding","Upgrade","Via"].map((e=>e.toLowerCase())));async function l(e,a){let t={...f,...a};const c=new Headers;"json"===t.type&&c.set("Content-Type","application/json");let d=new URL(e);if(d.username){const e=btoa(`${d.username}:${d.password}`);c.set("Authorization",`Basic ${e}`),d.username="",d.password=""}e=""+d;for(let e in t.headers){const a=e.toLowerCase();(o.has(a)||t.cors&&!s.has(a))&&c.set(e,t.headers[e])}let i={headers:c,redirect:t.redirect?"follow":"manual"};t.referrer||(i.referrerPolicy="no-referrer"),t.cors&&(i.mode="cors"),t.data&&(t.method||(i.method="POST"),i.body="json"===t.type?JSON.stringify(t.data):t.data);const b=await fetch(e,i);if(t.expectStatusCode&&b.status!==t.expectStatusCode)throw new r(b.status);const l=n(new Uint8Array(await b.arrayBuffer()),t.type);return t.full?{headers:Object.fromEntries(b.headers.entries()),status:b.status,body:l}:l}const u=!!("object"==typeof process&&process.versions&&process.versions.node&&process.versions.v8);a.default=function(e,a){return(u?b:l)(e,a)}},52244:(e,a,t)=>{var c=t(61158),f=t(15037);function d(e){this.rand=e||new f.Rand}e.exports=d,d.create=function(e){return new d(e)},d.prototype._randbelow=function(e){var a=e.bitLength(),t=Math.ceil(a/8);do{var f=new c(this.rand.generate(t))}while(f.cmp(e)>=0);return f},d.prototype._randrange=function(e,a){var t=a.sub(e);return e.add(this._randbelow(t))},d.prototype.test=function(e,a,t){var f=e.bitLength(),d=c.mont(e),r=new c(1).toRed(d);a||(a=Math.max(1,f/48|0));for(var n=e.subn(1),i=0;!n.testn(i);i++);for(var b=e.shrn(i),o=n.toRed(d);a>0;a--){var s=this._randrange(new c(2),n);t&&t(s);var l=s.toRed(d).redPow(b);if(0!==l.cmp(r)&&0!==l.cmp(o)){for(var u=1;u0;a--){var o=this._randrange(new c(2),r),s=e.gcd(o);if(0!==s.cmpn(1))return s;var l=o.toRed(f).redPow(i);if(0!==l.cmp(d)&&0!==l.cmp(b)){for(var u=1;u=65&&t<=70?t-55:t>=97&&t<=102?t-87:t-48&15}function i(e,a,t){var c=n(e,t);return t-1>=a&&(c|=n(e,t-1)<<4),c}function b(e,a,t,c){for(var f=0,d=Math.min(e.length,t),r=a;r=49?n-49+10:n>=17?n-17+10:n}return f}d.isBN=function(e){return e instanceof d||null!==e&&"object"==typeof e&&e.constructor.wordSize===d.wordSize&&Array.isArray(e.words)},d.max=function(e,a){return e.cmp(a)>0?e:a},d.min=function(e,a){return e.cmp(a)<0?e:a},d.prototype._init=function(e,a,t){if("number"==typeof e)return this._initNumber(e,a,t);if("object"==typeof e)return this._initArray(e,a,t);"hex"===a&&(a=16),c(a===(0|a)&&a>=2&&a<=36);var f=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(f++,this.negative=1),f=0;f-=3)r=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[d]|=r<>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);else if("le"===t)for(f=0,d=0;f>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);return this.strip()},d.prototype._parseHex=function(e,a,t){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)f=i(e,a,c)<=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;else for(c=(e.length-a)%2==0?a+1:a;c=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;this.strip()},d.prototype._parseBase=function(e,a,t){this.words=[0],this.length=1;for(var c=0,f=1;f<=67108863;f*=a)c++;c--,f=f/a|0;for(var d=e.length-t,r=d%c,n=Math.min(d,d-r)+t,i=0,o=t;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},d.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},d.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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],l=[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 u(e,a,t){t.negative=a.negative^e.negative;var c=e.length+a.length|0;t.length=c,c=c-1|0;var f=0|e.words[0],d=0|a.words[0],r=f*d,n=67108863&r,i=r/67108864|0;t.words[0]=n;for(var b=1;b>>26,s=67108863&i,l=Math.min(b,a.length-1),u=Math.max(0,b-e.length+1);u<=l;u++){var h=b-u|0;o+=(r=(f=0|e.words[h])*(d=0|a.words[u])+s)/67108864|0,s=67108863&r}t.words[b]=0|s,i=0|o}return 0!==i?t.words[b]=0|i:t.length--,t.strip()}d.prototype.toString=function(e,a){var t;if(a=0|a||1,16===(e=e||10)||"hex"===e){t="";for(var f=0,d=0,r=0;r>>24-f&16777215)||r!==this.length-1?o[6-i.length]+i+t:i+t,(f+=2)>=26&&(f-=26,r--)}for(0!==d&&(t=d.toString(16)+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(e===(0|e)&&e>=2&&e<=36){var b=s[e],u=l[e];t="";var h=this.clone();for(h.negative=0;!h.isZero();){var p=h.modn(u).toString(e);t=(h=h.idivn(u)).isZero()?p+t:o[b-p.length]+p+t}for(this.isZero()&&(t="0"+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}c(!1,"Base should be between 2 and 36")},d.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&c(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},d.prototype.toJSON=function(){return this.toString(16)},d.prototype.toBuffer=function(e,a){return c(void 0!==r),this.toArrayLike(r,e,a)},d.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},d.prototype.toArrayLike=function(e,a,t){var f=this.byteLength(),d=t||Math.max(1,f);c(f<=d,"byte array longer than desired length"),c(d>0,"Requested array length <= 0"),this.strip();var r,n,i="le"===a,b=new e(d),o=this.clone();if(i){for(n=0;!o.isZero();n++)r=o.andln(255),o.iushrn(8),b[n]=r;for(;n=4096&&(t+=13,a>>>=13),a>=64&&(t+=7,a>>>=7),a>=8&&(t+=4,a>>>=4),a>=2&&(t+=2,a>>>=2),t+a},d.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,t=0;return 8191&a||(t+=13,a>>>=13),127&a||(t+=7,a>>>=7),15&a||(t+=4,a>>>=4),3&a||(t+=2,a>>>=2),1&a||t++,t},d.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},d.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},d.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},d.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var t=0;te.length?this.clone().iand(e):e.clone().iand(this)},d.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},d.prototype.iuxor=function(e){var a,t;this.length>e.length?(a=this,t=e):(a=e,t=this);for(var c=0;ce.length?this.clone().ixor(e):e.clone().ixor(this)},d.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},d.prototype.inotn=function(e){c("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),t=e%26;this._expand(a),t>0&&a--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-t),this.strip()},d.prototype.notn=function(e){return this.clone().inotn(e)},d.prototype.setn=function(e,a){c("number"==typeof e&&e>=0);var t=e/26|0,f=e%26;return this._expand(t+1),this.words[t]=a?this.words[t]|1<e.length?(t=this,c=e):(t=e,c=this);for(var f=0,d=0;d>>26;for(;0!==f&&d>>26;if(this.length=t.length,0!==f)this.words[this.length]=f,this.length++;else if(t!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},d.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var t,c,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(t=this,c=e):(t=e,c=this);for(var d=0,r=0;r>26,this.words[r]=67108863&a;for(;0!==d&&r>26,this.words[r]=67108863&a;if(0===d&&r>>13,u=0|r[1],h=8191&u,p=u>>>13,g=0|r[2],m=8191&g,x=g>>>13,y=0|r[3],A=8191&y,v=y>>>13,w=0|r[4],_=8191&w,I=w>>>13,E=0|r[5],C=8191&E,M=E>>>13,B=0|r[6],k=8191&B,L=B>>>13,S=0|r[7],T=8191&S,N=S>>>13,R=0|r[8],P=8191&R,D=R>>>13,O=0|r[9],F=8191&O,Q=O>>>13,U=0|n[0],j=8191&U,H=U>>>13,q=0|n[1],$=8191&q,z=q>>>13,G=0|n[2],K=8191&G,V=G>>>13,Z=0|n[3],J=8191&Z,W=Z>>>13,Y=0|n[4],X=8191&Y,ee=Y>>>13,ae=0|n[5],te=8191&ae,ce=ae>>>13,fe=0|n[6],de=8191&fe,re=fe>>>13,ne=0|n[7],ie=8191&ne,be=ne>>>13,oe=0|n[8],se=8191&oe,le=oe>>>13,ue=0|n[9],he=8191&ue,pe=ue>>>13;t.negative=e.negative^a.negative,t.length=19;var ge=(b+(c=Math.imul(s,j))|0)+((8191&(f=(f=Math.imul(s,H))+Math.imul(l,j)|0))<<13)|0;b=((d=Math.imul(l,H))+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,c=Math.imul(h,j),f=(f=Math.imul(h,H))+Math.imul(p,j)|0,d=Math.imul(p,H);var me=(b+(c=c+Math.imul(s,$)|0)|0)+((8191&(f=(f=f+Math.imul(s,z)|0)+Math.imul(l,$)|0))<<13)|0;b=((d=d+Math.imul(l,z)|0)+(f>>>13)|0)+(me>>>26)|0,me&=67108863,c=Math.imul(m,j),f=(f=Math.imul(m,H))+Math.imul(x,j)|0,d=Math.imul(x,H),c=c+Math.imul(h,$)|0,f=(f=f+Math.imul(h,z)|0)+Math.imul(p,$)|0,d=d+Math.imul(p,z)|0;var xe=(b+(c=c+Math.imul(s,K)|0)|0)+((8191&(f=(f=f+Math.imul(s,V)|0)+Math.imul(l,K)|0))<<13)|0;b=((d=d+Math.imul(l,V)|0)+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,c=Math.imul(A,j),f=(f=Math.imul(A,H))+Math.imul(v,j)|0,d=Math.imul(v,H),c=c+Math.imul(m,$)|0,f=(f=f+Math.imul(m,z)|0)+Math.imul(x,$)|0,d=d+Math.imul(x,z)|0,c=c+Math.imul(h,K)|0,f=(f=f+Math.imul(h,V)|0)+Math.imul(p,K)|0,d=d+Math.imul(p,V)|0;var ye=(b+(c=c+Math.imul(s,J)|0)|0)+((8191&(f=(f=f+Math.imul(s,W)|0)+Math.imul(l,J)|0))<<13)|0;b=((d=d+Math.imul(l,W)|0)+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,c=Math.imul(_,j),f=(f=Math.imul(_,H))+Math.imul(I,j)|0,d=Math.imul(I,H),c=c+Math.imul(A,$)|0,f=(f=f+Math.imul(A,z)|0)+Math.imul(v,$)|0,d=d+Math.imul(v,z)|0,c=c+Math.imul(m,K)|0,f=(f=f+Math.imul(m,V)|0)+Math.imul(x,K)|0,d=d+Math.imul(x,V)|0,c=c+Math.imul(h,J)|0,f=(f=f+Math.imul(h,W)|0)+Math.imul(p,J)|0,d=d+Math.imul(p,W)|0;var Ae=(b+(c=c+Math.imul(s,X)|0)|0)+((8191&(f=(f=f+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;b=((d=d+Math.imul(l,ee)|0)+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,c=Math.imul(C,j),f=(f=Math.imul(C,H))+Math.imul(M,j)|0,d=Math.imul(M,H),c=c+Math.imul(_,$)|0,f=(f=f+Math.imul(_,z)|0)+Math.imul(I,$)|0,d=d+Math.imul(I,z)|0,c=c+Math.imul(A,K)|0,f=(f=f+Math.imul(A,V)|0)+Math.imul(v,K)|0,d=d+Math.imul(v,V)|0,c=c+Math.imul(m,J)|0,f=(f=f+Math.imul(m,W)|0)+Math.imul(x,J)|0,d=d+Math.imul(x,W)|0,c=c+Math.imul(h,X)|0,f=(f=f+Math.imul(h,ee)|0)+Math.imul(p,X)|0,d=d+Math.imul(p,ee)|0;var ve=(b+(c=c+Math.imul(s,te)|0)|0)+((8191&(f=(f=f+Math.imul(s,ce)|0)+Math.imul(l,te)|0))<<13)|0;b=((d=d+Math.imul(l,ce)|0)+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,c=Math.imul(k,j),f=(f=Math.imul(k,H))+Math.imul(L,j)|0,d=Math.imul(L,H),c=c+Math.imul(C,$)|0,f=(f=f+Math.imul(C,z)|0)+Math.imul(M,$)|0,d=d+Math.imul(M,z)|0,c=c+Math.imul(_,K)|0,f=(f=f+Math.imul(_,V)|0)+Math.imul(I,K)|0,d=d+Math.imul(I,V)|0,c=c+Math.imul(A,J)|0,f=(f=f+Math.imul(A,W)|0)+Math.imul(v,J)|0,d=d+Math.imul(v,W)|0,c=c+Math.imul(m,X)|0,f=(f=f+Math.imul(m,ee)|0)+Math.imul(x,X)|0,d=d+Math.imul(x,ee)|0,c=c+Math.imul(h,te)|0,f=(f=f+Math.imul(h,ce)|0)+Math.imul(p,te)|0,d=d+Math.imul(p,ce)|0;var we=(b+(c=c+Math.imul(s,de)|0)|0)+((8191&(f=(f=f+Math.imul(s,re)|0)+Math.imul(l,de)|0))<<13)|0;b=((d=d+Math.imul(l,re)|0)+(f>>>13)|0)+(we>>>26)|0,we&=67108863,c=Math.imul(T,j),f=(f=Math.imul(T,H))+Math.imul(N,j)|0,d=Math.imul(N,H),c=c+Math.imul(k,$)|0,f=(f=f+Math.imul(k,z)|0)+Math.imul(L,$)|0,d=d+Math.imul(L,z)|0,c=c+Math.imul(C,K)|0,f=(f=f+Math.imul(C,V)|0)+Math.imul(M,K)|0,d=d+Math.imul(M,V)|0,c=c+Math.imul(_,J)|0,f=(f=f+Math.imul(_,W)|0)+Math.imul(I,J)|0,d=d+Math.imul(I,W)|0,c=c+Math.imul(A,X)|0,f=(f=f+Math.imul(A,ee)|0)+Math.imul(v,X)|0,d=d+Math.imul(v,ee)|0,c=c+Math.imul(m,te)|0,f=(f=f+Math.imul(m,ce)|0)+Math.imul(x,te)|0,d=d+Math.imul(x,ce)|0,c=c+Math.imul(h,de)|0,f=(f=f+Math.imul(h,re)|0)+Math.imul(p,de)|0,d=d+Math.imul(p,re)|0;var _e=(b+(c=c+Math.imul(s,ie)|0)|0)+((8191&(f=(f=f+Math.imul(s,be)|0)+Math.imul(l,ie)|0))<<13)|0;b=((d=d+Math.imul(l,be)|0)+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,c=Math.imul(P,j),f=(f=Math.imul(P,H))+Math.imul(D,j)|0,d=Math.imul(D,H),c=c+Math.imul(T,$)|0,f=(f=f+Math.imul(T,z)|0)+Math.imul(N,$)|0,d=d+Math.imul(N,z)|0,c=c+Math.imul(k,K)|0,f=(f=f+Math.imul(k,V)|0)+Math.imul(L,K)|0,d=d+Math.imul(L,V)|0,c=c+Math.imul(C,J)|0,f=(f=f+Math.imul(C,W)|0)+Math.imul(M,J)|0,d=d+Math.imul(M,W)|0,c=c+Math.imul(_,X)|0,f=(f=f+Math.imul(_,ee)|0)+Math.imul(I,X)|0,d=d+Math.imul(I,ee)|0,c=c+Math.imul(A,te)|0,f=(f=f+Math.imul(A,ce)|0)+Math.imul(v,te)|0,d=d+Math.imul(v,ce)|0,c=c+Math.imul(m,de)|0,f=(f=f+Math.imul(m,re)|0)+Math.imul(x,de)|0,d=d+Math.imul(x,re)|0,c=c+Math.imul(h,ie)|0,f=(f=f+Math.imul(h,be)|0)+Math.imul(p,ie)|0,d=d+Math.imul(p,be)|0;var Ie=(b+(c=c+Math.imul(s,se)|0)|0)+((8191&(f=(f=f+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;b=((d=d+Math.imul(l,le)|0)+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,c=Math.imul(F,j),f=(f=Math.imul(F,H))+Math.imul(Q,j)|0,d=Math.imul(Q,H),c=c+Math.imul(P,$)|0,f=(f=f+Math.imul(P,z)|0)+Math.imul(D,$)|0,d=d+Math.imul(D,z)|0,c=c+Math.imul(T,K)|0,f=(f=f+Math.imul(T,V)|0)+Math.imul(N,K)|0,d=d+Math.imul(N,V)|0,c=c+Math.imul(k,J)|0,f=(f=f+Math.imul(k,W)|0)+Math.imul(L,J)|0,d=d+Math.imul(L,W)|0,c=c+Math.imul(C,X)|0,f=(f=f+Math.imul(C,ee)|0)+Math.imul(M,X)|0,d=d+Math.imul(M,ee)|0,c=c+Math.imul(_,te)|0,f=(f=f+Math.imul(_,ce)|0)+Math.imul(I,te)|0,d=d+Math.imul(I,ce)|0,c=c+Math.imul(A,de)|0,f=(f=f+Math.imul(A,re)|0)+Math.imul(v,de)|0,d=d+Math.imul(v,re)|0,c=c+Math.imul(m,ie)|0,f=(f=f+Math.imul(m,be)|0)+Math.imul(x,ie)|0,d=d+Math.imul(x,be)|0,c=c+Math.imul(h,se)|0,f=(f=f+Math.imul(h,le)|0)+Math.imul(p,se)|0,d=d+Math.imul(p,le)|0;var Ee=(b+(c=c+Math.imul(s,he)|0)|0)+((8191&(f=(f=f+Math.imul(s,pe)|0)+Math.imul(l,he)|0))<<13)|0;b=((d=d+Math.imul(l,pe)|0)+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,c=Math.imul(F,$),f=(f=Math.imul(F,z))+Math.imul(Q,$)|0,d=Math.imul(Q,z),c=c+Math.imul(P,K)|0,f=(f=f+Math.imul(P,V)|0)+Math.imul(D,K)|0,d=d+Math.imul(D,V)|0,c=c+Math.imul(T,J)|0,f=(f=f+Math.imul(T,W)|0)+Math.imul(N,J)|0,d=d+Math.imul(N,W)|0,c=c+Math.imul(k,X)|0,f=(f=f+Math.imul(k,ee)|0)+Math.imul(L,X)|0,d=d+Math.imul(L,ee)|0,c=c+Math.imul(C,te)|0,f=(f=f+Math.imul(C,ce)|0)+Math.imul(M,te)|0,d=d+Math.imul(M,ce)|0,c=c+Math.imul(_,de)|0,f=(f=f+Math.imul(_,re)|0)+Math.imul(I,de)|0,d=d+Math.imul(I,re)|0,c=c+Math.imul(A,ie)|0,f=(f=f+Math.imul(A,be)|0)+Math.imul(v,ie)|0,d=d+Math.imul(v,be)|0,c=c+Math.imul(m,se)|0,f=(f=f+Math.imul(m,le)|0)+Math.imul(x,se)|0,d=d+Math.imul(x,le)|0;var Ce=(b+(c=c+Math.imul(h,he)|0)|0)+((8191&(f=(f=f+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;b=((d=d+Math.imul(p,pe)|0)+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c=Math.imul(F,K),f=(f=Math.imul(F,V))+Math.imul(Q,K)|0,d=Math.imul(Q,V),c=c+Math.imul(P,J)|0,f=(f=f+Math.imul(P,W)|0)+Math.imul(D,J)|0,d=d+Math.imul(D,W)|0,c=c+Math.imul(T,X)|0,f=(f=f+Math.imul(T,ee)|0)+Math.imul(N,X)|0,d=d+Math.imul(N,ee)|0,c=c+Math.imul(k,te)|0,f=(f=f+Math.imul(k,ce)|0)+Math.imul(L,te)|0,d=d+Math.imul(L,ce)|0,c=c+Math.imul(C,de)|0,f=(f=f+Math.imul(C,re)|0)+Math.imul(M,de)|0,d=d+Math.imul(M,re)|0,c=c+Math.imul(_,ie)|0,f=(f=f+Math.imul(_,be)|0)+Math.imul(I,ie)|0,d=d+Math.imul(I,be)|0,c=c+Math.imul(A,se)|0,f=(f=f+Math.imul(A,le)|0)+Math.imul(v,se)|0,d=d+Math.imul(v,le)|0;var Me=(b+(c=c+Math.imul(m,he)|0)|0)+((8191&(f=(f=f+Math.imul(m,pe)|0)+Math.imul(x,he)|0))<<13)|0;b=((d=d+Math.imul(x,pe)|0)+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,c=Math.imul(F,J),f=(f=Math.imul(F,W))+Math.imul(Q,J)|0,d=Math.imul(Q,W),c=c+Math.imul(P,X)|0,f=(f=f+Math.imul(P,ee)|0)+Math.imul(D,X)|0,d=d+Math.imul(D,ee)|0,c=c+Math.imul(T,te)|0,f=(f=f+Math.imul(T,ce)|0)+Math.imul(N,te)|0,d=d+Math.imul(N,ce)|0,c=c+Math.imul(k,de)|0,f=(f=f+Math.imul(k,re)|0)+Math.imul(L,de)|0,d=d+Math.imul(L,re)|0,c=c+Math.imul(C,ie)|0,f=(f=f+Math.imul(C,be)|0)+Math.imul(M,ie)|0,d=d+Math.imul(M,be)|0,c=c+Math.imul(_,se)|0,f=(f=f+Math.imul(_,le)|0)+Math.imul(I,se)|0,d=d+Math.imul(I,le)|0;var Be=(b+(c=c+Math.imul(A,he)|0)|0)+((8191&(f=(f=f+Math.imul(A,pe)|0)+Math.imul(v,he)|0))<<13)|0;b=((d=d+Math.imul(v,pe)|0)+(f>>>13)|0)+(Be>>>26)|0,Be&=67108863,c=Math.imul(F,X),f=(f=Math.imul(F,ee))+Math.imul(Q,X)|0,d=Math.imul(Q,ee),c=c+Math.imul(P,te)|0,f=(f=f+Math.imul(P,ce)|0)+Math.imul(D,te)|0,d=d+Math.imul(D,ce)|0,c=c+Math.imul(T,de)|0,f=(f=f+Math.imul(T,re)|0)+Math.imul(N,de)|0,d=d+Math.imul(N,re)|0,c=c+Math.imul(k,ie)|0,f=(f=f+Math.imul(k,be)|0)+Math.imul(L,ie)|0,d=d+Math.imul(L,be)|0,c=c+Math.imul(C,se)|0,f=(f=f+Math.imul(C,le)|0)+Math.imul(M,se)|0,d=d+Math.imul(M,le)|0;var ke=(b+(c=c+Math.imul(_,he)|0)|0)+((8191&(f=(f=f+Math.imul(_,pe)|0)+Math.imul(I,he)|0))<<13)|0;b=((d=d+Math.imul(I,pe)|0)+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,c=Math.imul(F,te),f=(f=Math.imul(F,ce))+Math.imul(Q,te)|0,d=Math.imul(Q,ce),c=c+Math.imul(P,de)|0,f=(f=f+Math.imul(P,re)|0)+Math.imul(D,de)|0,d=d+Math.imul(D,re)|0,c=c+Math.imul(T,ie)|0,f=(f=f+Math.imul(T,be)|0)+Math.imul(N,ie)|0,d=d+Math.imul(N,be)|0,c=c+Math.imul(k,se)|0,f=(f=f+Math.imul(k,le)|0)+Math.imul(L,se)|0,d=d+Math.imul(L,le)|0;var Le=(b+(c=c+Math.imul(C,he)|0)|0)+((8191&(f=(f=f+Math.imul(C,pe)|0)+Math.imul(M,he)|0))<<13)|0;b=((d=d+Math.imul(M,pe)|0)+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,c=Math.imul(F,de),f=(f=Math.imul(F,re))+Math.imul(Q,de)|0,d=Math.imul(Q,re),c=c+Math.imul(P,ie)|0,f=(f=f+Math.imul(P,be)|0)+Math.imul(D,ie)|0,d=d+Math.imul(D,be)|0,c=c+Math.imul(T,se)|0,f=(f=f+Math.imul(T,le)|0)+Math.imul(N,se)|0,d=d+Math.imul(N,le)|0;var Se=(b+(c=c+Math.imul(k,he)|0)|0)+((8191&(f=(f=f+Math.imul(k,pe)|0)+Math.imul(L,he)|0))<<13)|0;b=((d=d+Math.imul(L,pe)|0)+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,c=Math.imul(F,ie),f=(f=Math.imul(F,be))+Math.imul(Q,ie)|0,d=Math.imul(Q,be),c=c+Math.imul(P,se)|0,f=(f=f+Math.imul(P,le)|0)+Math.imul(D,se)|0,d=d+Math.imul(D,le)|0;var Te=(b+(c=c+Math.imul(T,he)|0)|0)+((8191&(f=(f=f+Math.imul(T,pe)|0)+Math.imul(N,he)|0))<<13)|0;b=((d=d+Math.imul(N,pe)|0)+(f>>>13)|0)+(Te>>>26)|0,Te&=67108863,c=Math.imul(F,se),f=(f=Math.imul(F,le))+Math.imul(Q,se)|0,d=Math.imul(Q,le);var Ne=(b+(c=c+Math.imul(P,he)|0)|0)+((8191&(f=(f=f+Math.imul(P,pe)|0)+Math.imul(D,he)|0))<<13)|0;b=((d=d+Math.imul(D,pe)|0)+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Re=(b+(c=Math.imul(F,he))|0)+((8191&(f=(f=Math.imul(F,pe))+Math.imul(Q,he)|0))<<13)|0;return b=((d=Math.imul(Q,pe))+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,i[0]=ge,i[1]=me,i[2]=xe,i[3]=ye,i[4]=Ae,i[5]=ve,i[6]=we,i[7]=_e,i[8]=Ie,i[9]=Ee,i[10]=Ce,i[11]=Me,i[12]=Be,i[13]=ke,i[14]=Le,i[15]=Se,i[16]=Te,i[17]=Ne,i[18]=Re,0!==b&&(i[19]=b,t.length++),t};function p(e,a,t){return(new g).mulp(e,a,t)}function g(e,a){this.x=e,this.y=a}Math.imul||(h=u),d.prototype.mulTo=function(e,a){var t,c=this.length+e.length;return t=10===this.length&&10===e.length?h(this,e,a):c<63?u(this,e,a):c<1024?function(e,a,t){t.negative=a.negative^e.negative,t.length=e.length+a.length;for(var c=0,f=0,d=0;d>>26)|0)>>>26,r&=67108863}t.words[d]=n,c=r,r=f}return 0!==c?t.words[d]=c:t.length--,t.strip()}(this,e,a):p(this,e,a),t},g.prototype.makeRBT=function(e){for(var a=new Array(e),t=d.prototype._countBits(e)-1,c=0;c>=1;return c},g.prototype.permute=function(e,a,t,c,f,d){for(var r=0;r>>=1)f++;return 1<>>=13,t[2*r+1]=8191&d,d>>>=13;for(r=2*a;r>=26,a+=f/67108864|0,a+=d>>>26,this.words[t]=67108863&d}return 0!==a&&(this.words[t]=a,this.length++),this},d.prototype.muln=function(e){return this.clone().imuln(e)},d.prototype.sqr=function(){return this.mul(this)},d.prototype.isqr=function(){return this.imul(this.clone())},d.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),t=0;t>>f}return a}(e);if(0===a.length)return new d(1);for(var t=this,c=0;c=0);var a,t=e%26,f=(e-t)/26,d=67108863>>>26-t<<26-t;if(0!==t){var r=0;for(a=0;a>>26-t}r&&(this.words[a]=r,this.length++)}if(0!==f){for(a=this.length-1;a>=0;a--)this.words[a+f]=this.words[a];for(a=0;a=0),f=a?(a-a%26)/26:0;var d=e%26,r=Math.min((e-d)/26,this.length),n=67108863^67108863>>>d<r)for(this.length-=r,b=0;b=0&&(0!==o||b>=f);b--){var s=0|this.words[b];this.words[b]=o<<26-d|s>>>d,o=s&n}return i&&0!==o&&(i.words[i.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},d.prototype.ishrn=function(e,a,t){return c(0===this.negative),this.iushrn(e,a,t)},d.prototype.shln=function(e){return this.clone().ishln(e)},d.prototype.ushln=function(e){return this.clone().iushln(e)},d.prototype.shrn=function(e){return this.clone().ishrn(e)},d.prototype.ushrn=function(e){return this.clone().iushrn(e)},d.prototype.testn=function(e){c("number"==typeof e&&e>=0);var a=e%26,t=(e-a)/26,f=1<=0);var a=e%26,t=(e-a)/26;if(c(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==a&&t++,this.length=Math.min(t,this.length),0!==a){var f=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},d.prototype.isubn=function(e){if(c("number"==typeof e),c(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(i/67108864|0),this.words[f+t]=67108863&d}for(;f>26,this.words[f+t]=67108863&d;if(0===n)return this.strip();for(c(-1===n),n=0,f=0;f>26,this.words[f]=67108863&d;return this.negative=1,this.strip()},d.prototype._wordDiv=function(e,a){var t=(this.length,e.length),c=this.clone(),f=e,r=0|f.words[f.length-1];0!=(t=26-this._countBits(r))&&(f=f.ushln(t),c.iushln(t),r=0|f.words[f.length-1]);var n,i=c.length-f.length;if("mod"!==a){(n=new d(null)).length=i+1,n.words=new Array(n.length);for(var b=0;b=0;s--){var l=67108864*(0|c.words[f.length+s])+(0|c.words[f.length+s-1]);for(l=Math.min(l/r|0,67108863),c._ishlnsubmul(f,l,s);0!==c.negative;)l--,c.negative=0,c._ishlnsubmul(f,1,s),c.isZero()||(c.negative^=1);n&&(n.words[s]=l)}return n&&n.strip(),c.strip(),"div"!==a&&0!==t&&c.iushrn(t),{div:n||null,mod:c}},d.prototype.divmod=function(e,a,t){return c(!e.isZero()),this.isZero()?{div:new d(0),mod:new d(0)}:0!==this.negative&&0===e.negative?(n=this.neg().divmod(e,a),"mod"!==a&&(f=n.div.neg()),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.iadd(e)),{div:f,mod:r}):0===this.negative&&0!==e.negative?(n=this.divmod(e.neg(),a),"mod"!==a&&(f=n.div.neg()),{div:f,mod:n.mod}):this.negative&e.negative?(n=this.neg().divmod(e.neg(),a),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.isub(e)),{div:n.div,mod:r}):e.length>this.length||this.cmp(e)<0?{div:new d(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new d(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new d(this.modn(e.words[0]))}:this._wordDiv(e,a);var f,r,n},d.prototype.div=function(e){return this.divmod(e,"div",!1).div},d.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},d.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},d.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var t=0!==a.div.negative?a.mod.isub(e):a.mod,c=e.ushrn(1),f=e.andln(1),d=t.cmp(c);return d<0||1===f&&0===d?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},d.prototype.modn=function(e){c(e<=67108863);for(var a=(1<<26)%e,t=0,f=this.length-1;f>=0;f--)t=(a*t+(0|this.words[f]))%e;return t},d.prototype.idivn=function(e){c(e<=67108863);for(var a=0,t=this.length-1;t>=0;t--){var f=(0|this.words[t])+67108864*a;this.words[t]=f/e|0,a=f%e}return this.strip()},d.prototype.divn=function(e){return this.clone().idivn(e)},d.prototype.egcd=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f=new d(1),r=new d(0),n=new d(0),i=new d(1),b=0;a.isEven()&&t.isEven();)a.iushrn(1),t.iushrn(1),++b;for(var o=t.clone(),s=a.clone();!a.isZero();){for(var l=0,u=1;!(a.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(f.isOdd()||r.isOdd())&&(f.iadd(o),r.isub(s)),f.iushrn(1),r.iushrn(1);for(var h=0,p=1;!(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(o),i.isub(s)),n.iushrn(1),i.iushrn(1);a.cmp(t)>=0?(a.isub(t),f.isub(n),r.isub(i)):(t.isub(a),n.isub(f),i.isub(r))}return{a:n,b:i,gcd:t.iushln(b)}},d.prototype._invmp=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f,r=new d(1),n=new d(0),i=t.clone();a.cmpn(1)>0&&t.cmpn(1)>0;){for(var b=0,o=1;!(a.words[0]&o)&&b<26;++b,o<<=1);if(b>0)for(a.iushrn(b);b-- >0;)r.isOdd()&&r.iadd(i),r.iushrn(1);for(var s=0,l=1;!(t.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(t.iushrn(s);s-- >0;)n.isOdd()&&n.iadd(i),n.iushrn(1);a.cmp(t)>=0?(a.isub(t),r.isub(n)):(t.isub(a),n.isub(r))}return(f=0===a.cmpn(1)?r:n).cmpn(0)<0&&f.iadd(e),f},d.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),t=e.clone();a.negative=0,t.negative=0;for(var c=0;a.isEven()&&t.isEven();c++)a.iushrn(1),t.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;t.isEven();)t.iushrn(1);var f=a.cmp(t);if(f<0){var d=a;a=t,t=d}else if(0===f||0===t.cmpn(1))break;a.isub(t)}return t.iushln(c)},d.prototype.invm=function(e){return this.egcd(e).a.umod(e)},d.prototype.isEven=function(){return!(1&this.words[0])},d.prototype.isOdd=function(){return!(1&~this.words[0])},d.prototype.andln=function(e){return this.words[0]&e},d.prototype.bincn=function(e){c("number"==typeof e);var a=e%26,t=(e-a)/26,f=1<>>26,n&=67108863,this.words[r]=n}return 0!==d&&(this.words[r]=d,this.length++),this},d.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},d.prototype.cmpn=function(e){var a,t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)a=1;else{t&&(e=-e),c(e<=67108863,"Number is too big");var f=0|this.words[0];a=f===e?0:fe.length)return 1;if(this.length=0;t--){var c=0|this.words[t],f=0|e.words[t];if(c!==f){cf&&(a=1);break}}return a},d.prototype.gtn=function(e){return 1===this.cmpn(e)},d.prototype.gt=function(e){return 1===this.cmp(e)},d.prototype.gten=function(e){return this.cmpn(e)>=0},d.prototype.gte=function(e){return this.cmp(e)>=0},d.prototype.ltn=function(e){return-1===this.cmpn(e)},d.prototype.lt=function(e){return-1===this.cmp(e)},d.prototype.lten=function(e){return this.cmpn(e)<=0},d.prototype.lte=function(e){return this.cmp(e)<=0},d.prototype.eqn=function(e){return 0===this.cmpn(e)},d.prototype.eq=function(e){return 0===this.cmp(e)},d.red=function(e){return new _(e)},d.prototype.toRed=function(e){return c(!this.red,"Already a number in reduction context"),c(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},d.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},d.prototype._forceRed=function(e){return this.red=e,this},d.prototype.forceRed=function(e){return c(!this.red,"Already a number in reduction context"),this._forceRed(e)},d.prototype.redAdd=function(e){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},d.prototype.redIAdd=function(e){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},d.prototype.redSub=function(e){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},d.prototype.redISub=function(e){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},d.prototype.redShl=function(e){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},d.prototype.redMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},d.prototype.redIMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},d.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},d.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},d.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},d.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},d.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},d.prototype.redPow=function(e){return c(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function x(e,a){this.name=e,this.p=new d(a,16),this.n=this.p.bitLength(),this.k=new d(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var a=d._prime(e);this.m=a.p,this.prime=a}else c(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new d(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)}x.prototype._tmp=function(){var e=new d(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var a,t=e;do{this.split(t,this.tmp),a=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(a>this.n);var c=a0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},x.prototype.split=function(e,a){e.iushrn(this.n,0,a)},x.prototype.imulK=function(e){return e.imul(this.k)},f(y,x),y.prototype.split=function(e,a){for(var t=4194303,c=Math.min(e.length,9),f=0;f>>22,d=r}d>>>=22,e.words[f-10]=d,0===d&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,t=0;t>>=26,e.words[t]=f,a=c}return 0!==a&&(e.words[e.length++]=a),e},d._prime=function(e){if(m[e])return m[e];var a;if("k256"===e)a=new y;else if("p224"===e)a=new A;else if("p192"===e)a=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new w}return m[e]=a,a},_.prototype._verify1=function(e){c(0===e.negative,"red works only with positives"),c(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,a){c(!(e.negative|a.negative),"red works only with positives"),c(e.red&&e.red===a.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,a){this._verify2(e,a);var t=e.add(a);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},_.prototype.iadd=function(e,a){this._verify2(e,a);var t=e.iadd(a);return t.cmp(this.m)>=0&&t.isub(this.m),t},_.prototype.sub=function(e,a){this._verify2(e,a);var t=e.sub(a);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},_.prototype.isub=function(e,a){this._verify2(e,a);var t=e.isub(a);return t.cmpn(0)<0&&t.iadd(this.m),t},_.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},_.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},_.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(c(a%2==1),3===a){var t=this.m.add(new d(1)).iushrn(2);return this.pow(e,t)}for(var f=this.m.subn(1),r=0;!f.isZero()&&0===f.andln(1);)r++,f.iushrn(1);c(!f.isZero());var n=new d(1).toRed(this),i=n.redNeg(),b=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new d(2*o*o).toRed(this);0!==this.pow(o,b).cmp(i);)o.redIAdd(i);for(var s=this.pow(o,f),l=this.pow(e,f.addn(1).iushrn(1)),u=this.pow(e,f),h=r;0!==u.cmp(n);){for(var p=u,g=0;0!==p.cmp(n);g++)p=p.redSqr();c(g=0;c--){for(var b=a.words[c],o=i-1;o>=0;o--){var s=b>>o&1;f!==t[0]&&(f=this.sqr(f)),0!==s||0!==r?(r<<=1,r|=s,(4==++n||0===c&&0===o)&&(f=this.mul(f,t[r]),n=0,r=0)):n=0}i=26}return f},_.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},_.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},d.mont=function(e){return new I(e)},f(I,_),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},I.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var t=e.imul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),d=f;return f.cmp(this.m)>=0?d=f.isub(this.m):f.cmpn(0)<0&&(d=f.iadd(this.m)),d._forceRed(this)},I.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new d(0)._forceRed(this);var t=e.mul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),r=f;return f.cmp(this.m)>=0?r=f.isub(this.m):f.cmpn(0)<0&&(r=f.iadd(this.m)),r._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=t.nmd(e),this)},43349:e=>{function a(e,a){if(!e)throw new Error(a||"Assertion failed")}e.exports=a,a.equal=function(e,a,t){if(e!=a)throw new Error(t||"Assertion failed: "+e+" != "+a)}},64367:(e,a)=>{"use strict";var t=a;function c(e){return 1===e.length?"0"+e:e}function f(e){for(var a="",t=0;t>8,r=255&f;d?t.push(d,r):t.push(r)}return t},t.zero2=c,t.toHex=f,t.encode=function(e,a){return"hex"===a?f(e):e}},6585:e=>{var a=1e3,t=60*a,c=60*t,f=24*c,d=7*f;function r(e,a,t,c){var f=a>=1.5*t;return Math.round(e/t)+" "+c+(f?"s":"")}e.exports=function(e,n){n=n||{};var i,b,o=typeof e;if("string"===o&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(r){var n=parseFloat(r[1]);switch((r[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*n;case"weeks":case"week":case"w":return n*d;case"days":case"day":case"d":return n*f;case"hours":case"hour":case"hrs":case"hr":case"h":return n*c;case"minutes":case"minute":case"mins":case"min":case"m":return n*t;case"seconds":case"second":case"secs":case"sec":case"s":return n*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}(e);if("number"===o&&isFinite(e))return n.long?(i=e,(b=Math.abs(i))>=f?r(i,b,f,"day"):b>=c?r(i,b,c,"hour"):b>=t?r(i,b,t,"minute"):b>=a?r(i,b,a,"second"):i+" ms"):function(e){var d=Math.abs(e);return d>=f?Math.round(e/f)+"d":d>=c?Math.round(e/c)+"h":d>=t?Math.round(e/t)+"m":d>=a?Math.round(e/a)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},18633:(e,a,t)=>{"use strict";const{encodeText:c}=t(24084);e.exports=class{constructor(e,a,t,f){this.name=e,this.code=a,this.codeBuf=c(this.code),this.alphabet=f,this.codec=t(f)}encode(e){return this.codec.encode(e)}decode(e){for(const a of e)if(this.alphabet&&this.alphabet.indexOf(a)<0)throw new Error(`invalid character '${a}' in '${e}'`);return this.codec.decode(e)}}},67579:(e,a,t)=>{"use strict";const c=t(25084),f=t(18633),{rfc4648:d}=t(99417),{decodeText:r,encodeText:n}=t(24084),i=[["identity","\0",()=>({encode:r,decode:n}),""],["base2","0",d(1),"01"],["base8","7",d(3),"01234567"],["base10","9",c,"0123456789"],["base16","f",d(4),"0123456789abcdef"],["base16upper","F",d(4),"0123456789ABCDEF"],["base32hex","v",d(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",d(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",d(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",d(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",d(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",d(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",d(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",d(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",d(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",c,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",c,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",c,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",c,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",d(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",d(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",d(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",d(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],b=i.reduce(((e,a)=>(e[a[0]]=new f(a[0],a[1],a[2],a[3]),e)),{}),o=i.reduce(((e,a)=>(e[a[1]]=b[a[0]],e)),{});e.exports={names:b,codes:o}},91466:(e,a,t)=>{"use strict";const c=t(67579),{encodeText:f,decodeText:d,concat:r}=t(24084);function n(e){if(Object.prototype.hasOwnProperty.call(c.names,e))return c.names[e];if(Object.prototype.hasOwnProperty.call(c.codes,e))return c.codes[e];throw new Error(`Unsupported encoding: ${e}`)}(a=e.exports=function(e,a){if(!a)throw new Error("requires an encoded Uint8Array");const{name:t,codeBuf:c}=n(e);return function(e,a){n(e).decode(d(a))}(t,a),r([c,a],c.length+a.length)}).encode=function(e,a){const t=n(e),c=f(t.encode(a));return r([t.codeBuf,c],t.codeBuf.length+c.length)},a.decode=function(e){e instanceof Uint8Array&&(e=d(e));const a=e[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(a)&&(e=e.toLowerCase()),n(e[0]).decode(e.substring(1))},a.isEncoded=function(e){if(e instanceof Uint8Array&&(e=d(e)),"[object String]"!==Object.prototype.toString.call(e))return!1;try{return n(e[0]).name}catch(e){return!1}},a.encoding=n,a.encodingFromData=function(e){return e instanceof Uint8Array&&(e=d(e)),n(e[0])};const i=Object.freeze(c.names),b=Object.freeze(c.codes);a.names=i,a.codes=b},99417:e=>{"use strict";e.exports={rfc4648:e=>a=>({encode:t=>((e,a,t)=>{const c="="===a[a.length-1],f=(1<t;)r-=t,d+=a[f&n>>r];if(r&&(d+=a[f&n<((e,a,t)=>{const c={};for(let e=0;e=8&&(r-=8,d[i++]=255&n>>r)}if(r>=t||255&n<<8-r)throw new SyntaxError("Unexpected end of data");return d})(t,a,e)})}},24084:e=>{"use strict";const a=new TextDecoder,t=new TextEncoder;e.exports={decodeText:e=>a.decode(e),encodeText:e=>t.encode(e),concat:function(e,a){const t=new Uint8Array(a);let c=0;for(const a of e)t.set(a,c),c+=a.length;return t}}},35194:e=>{e.exports=function e(c,f){var d,r=0,n=0,i=f=f||0,b=c.length;do{if(i>=b||n>49)throw e.bytes=0,new RangeError("Could not decode varint");d=c[i++],r+=n<28?(d&t)<=a);return e.bytes=i-f,r};var a=128,t=127},25134:e=>{e.exports=function e(f,d,r){if(Number.MAX_SAFE_INTEGER&&f>Number.MAX_SAFE_INTEGER)throw e.bytes=0,new RangeError("Could not encode varint");d=d||[];for(var n=r=r||0;f>=c;)d[r++]=255&f|a,f/=128;for(;f&t;)d[r++]=255&f|a,f>>>=7;return d[r]=0|f,e.bytes=r-n+1,d};var a=128,t=-128,c=Math.pow(2,31)},20038:(e,a,t)=>{e.exports={encode:t(25134),decode:t(35194),encodingLength:t(36516)}},36516:e=>{var a=Math.pow(2,7),t=Math.pow(2,14),c=Math.pow(2,21),f=Math.pow(2,28),d=Math.pow(2,35),r=Math.pow(2,42),n=Math.pow(2,49),i=Math.pow(2,56),b=Math.pow(2,63);e.exports=function(e){return e{"use strict";const a=Object.freeze({identity:0,cidv1:1,cidv2:2,cidv3:3,ip4:4,tcp:6,sha1:17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,blake3:30,dccp:33,"murmur3-128":34,"murmur3-32":35,ip6:41,ip6zone:42,path:47,multicodec:48,multihash:49,multiaddr:50,multibase:51,dns:53,dns4:54,dns6:55,dnsaddr:56,protobuf:80,cbor:81,raw:85,"dbl-sha2-256":86,rlp:96,bencode:99,"dag-pb":112,"dag-cbor":113,"libp2p-key":114,"git-raw":120,"torrent-info":123,"torrent-file":124,"leofcoin-block":129,"leofcoin-tx":130,"leofcoin-pr":131,sctp:132,"dag-jose":133,"dag-cose":134,"eth-block":144,"eth-block-list":145,"eth-tx-trie":146,"eth-tx":147,"eth-tx-receipt-trie":148,"eth-tx-receipt":149,"eth-state-trie":150,"eth-account-snapshot":151,"eth-storage-trie":152,"eth-receipt-log-trie":153,"eth-reciept-log":154,"bitcoin-block":176,"bitcoin-tx":177,"bitcoin-witness-commitment":178,"zcash-block":192,"zcash-tx":193,"caip-50":202,streamid:206,"stellar-block":208,"stellar-tx":209,md4:212,md5:213,bmt:214,"decred-block":224,"decred-tx":225,"ipld-ns":226,"ipfs-ns":227,"swarm-ns":228,"ipns-ns":229,zeronet:230,"secp256k1-pub":231,"bls12_381-g1-pub":234,"bls12_381-g2-pub":235,"x25519-pub":236,"ed25519-pub":237,"bls12_381-g1g2-pub":238,"dash-block":240,"dash-tx":241,"swarm-manifest":250,"swarm-feed":251,udp:273,"p2p-webrtc-star":275,"p2p-webrtc-direct":276,"p2p-stardust":277,"p2p-circuit":290,"dag-json":297,udt:301,utp:302,unix:400,thread:406,p2p:421,ipfs:421,https:443,onion:444,onion3:445,garlic64:446,garlic32:447,tls:448,noise:454,quic:460,ws:477,wss:478,"p2p-websocket-star":479,http:480,"swhid-1-snp":496,json:512,messagepack:513,"libp2p-peer-record":769,"libp2p-relay-rsvp":770,"car-index-sorted":1024,"sha2-256-trunc254-padded":4114,"ripemd-128":4178,"ripemd-160":4179,"ripemd-256":4180,"ripemd-320":4181,x11:4352,"p256-pub":4608,"p384-pub":4609,"p521-pub":4610,"ed448-pub":4611,"x448-pub":4612,"ed25519-priv":4864,"secp256k1-priv":4865,"x25519-priv":4866,kangarootwelve:7425,"sm3-256":21325,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46e3,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"poseidon-bls12_381-a2-fc1":46081,"poseidon-bls12_381-a2-fc1-sc":46082,"zeroxcert-imprint-256":52753,"fil-commitment-unsealed":61697,"fil-commitment-sealed":61698,"holochain-adr-v0":8417572,"holochain-adr-v1":8483108,"holochain-key-v0":9728292,"holochain-key-v1":9793828,"holochain-sig-v0":10645796,"holochain-sig-v1":10711332,"skynet-ns":11639056,"arweave-ns":11704592});e.exports={baseTable:a}},52021:(e,a,t)=>{"use strict";const c=t(20038),{concat:f}=t(75007),d=t(82693),{nameToVarint:r,constantToCode:n,nameToCode:i,codeToName:b}=t(90482);function o(e){const a=c.decode(e),t=b[a];if(void 0===t)throw new Error(`Code "${a}" not found`);return t}function s(e){return b[e]}function l(e){const a=i[e];if(void 0===a)throw new Error(`Codec "${e}" not found`);return a}function u(e){return c.decode(e)}function h(e){const a=r[e];if(void 0===a)throw new Error(`Codec "${e}" not found`);return a}function p(e){return d.varintEncode(e)}e.exports={addPrefix:function(e,a){let t;if(e instanceof Uint8Array)t=d.varintUint8ArrayEncode(e);else{if(!r[e])throw new Error("multicodec not recognized");t=r[e]}return f([t,a],t.length+a.length)},rmPrefix:function(e){return c.decode(e),e.slice(c.decode.bytes)},getNameFromData:o,getNameFromCode:s,getCodeFromName:l,getCodeFromData:u,getVarintFromName:h,getVarintFromCode:p,getCodec:function(e){return o(e)},getName:function(e){return s(e)},getNumber:function(e){return l(e)},getCode:function(e){return u(e)},getCodeVarint:function(e){return h(e)},getVarint:function(e){return Array.from(p(e))},...n,nameToVarint:r,nameToCode:i,codeToName:b}},90482:(e,a,t)=>{"use strict";const{baseTable:c}=t(15661),f=t(82693).varintEncode,d={},r={},n={};for(const e in c){const a=e,t=c[a];d[a]=f(t),r[a.toUpperCase().replace(/-/g,"_")]=t,n[t]||(n[t]=a)}Object.freeze(d),Object.freeze(r),Object.freeze(n);const i=Object.freeze(c);e.exports={nameToVarint:d,constantToCode:r,nameToCode:i,codeToName:n}},82693:(e,a,t)=>{"use strict";const c=t(20038),{toString:f}=t(27302),{fromString:d}=t(44117);function r(e){return parseInt(f(e,"base16"),16)}e.exports={numberToUint8Array:function(e){let a=e.toString(16);return a.length%2==1&&(a="0"+a),d(a,"base16")},uint8ArrayToNumber:r,varintUint8ArrayEncode:function(e){return Uint8Array.from(c.encode(r(e)))},varintEncode:function(e){return Uint8Array.from(c.encode(e))}}},76994:(e,a,t)=>{"use strict";const{Buffer:c}=t(48287);e.exports=class{constructor(e,a,t,f){this.name=e,this.code=a,this.codeBuf=c.from(this.code),this.alphabet=f,this.engine=t(f)}encode(e){return this.engine.encode(e)}decode(e){for(const a of e)if(this.alphabet&&this.alphabet.indexOf(a)<0)throw new Error(`invalid character '${a}' in '${e}'`);return this.engine.decode(e)}}},46082:(e,a,t)=>{"use strict";const c=t(95364),f=t(76994),d=t(15920),{decodeText:r,encodeText:n}=t(40639),i=[["identity","\0",()=>({encode:r,decode:n}),""],["base2","0",d(1),"01"],["base8","7",d(3),"01234567"],["base10","9",c,"0123456789"],["base16","f",d(4),"0123456789abcdef"],["base16upper","F",d(4),"0123456789ABCDEF"],["base32hex","v",d(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",d(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",d(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",d(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",d(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",d(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",d(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",d(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",d(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",c,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",c,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",c,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",c,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",d(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",d(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",d(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",d(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],b=i.reduce(((e,a)=>(e[a[0]]=new f(a[0],a[1],a[2],a[3]),e)),{}),o=i.reduce(((e,a)=>(e[a[1]]=b[a[0]],e)),{});e.exports={names:b,codes:o}},42879:(e,a,t)=>{"use strict";const{Buffer:c}=t(48287),f=t(46082),{decodeText:d,asBuffer:r}=t(40639);function n(e){if(f.names[e])return f.names[e];if(f.codes[e])return f.codes[e];throw new Error(`Unsupported encoding: ${e}`)}(a=e.exports=function(e,a){if(!a)throw new Error("requires an encoded buffer");const{name:t,codeBuf:f}=n(e);!function(e,a){n(e).decode(d(a))}(t,a);const r=c.alloc(f.length+a.length);return r.set(f,0),r.set(a,f.length),r}).encode=function(e,a){const t=n(e);return c.concat([t.codeBuf,c.from(t.encode(a))])},a.decode=function(e){ArrayBuffer.isView(e)&&(e=d(e));const a=e[0];["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(a)&&(e=e.toLowerCase());const t=n(e[0]);return r(t.decode(e.substring(1)))},a.isEncoded=function(e){if(e instanceof Uint8Array&&(e=d(e)),"[object String]"!==Object.prototype.toString.call(e))return!1;try{return n(e[0]).name}catch(e){return!1}},a.encoding=n,a.encodingFromData=function(e){return e instanceof Uint8Array&&(e=d(e)),n(e[0])},a.names=Object.freeze(f.names),a.codes=Object.freeze(f.codes)},15920:e=>{"use strict";e.exports=e=>a=>({encode:t=>((e,a,t)=>{const c="="===a[a.length-1],f=(1<t;)r-=t,d+=a[f&n>>r];if(r&&(d+=a[f&n<((e,a,t)=>{const c={};for(let e=0;e=8&&(r-=8,d[i++]=255&n>>r)}if(r>=t||255&n<<8-r)throw new SyntaxError("Unexpected end of data");return d})(t,a,e)})},40639:(e,a,t)=>{"use strict";const{Buffer:c}=t(48287),{TextEncoder:f,TextDecoder:d}=t(67019),r=new d,n=new f;e.exports={decodeText:e=>r.decode(e),encodeText:e=>n.encode(e),asBuffer:({buffer:e,byteLength:a,byteOffset:t})=>c.from(e,t,a)}},53702:e=>{"use strict";const a=Object.freeze({identity:0,sha1:17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,blake3:30,"murmur3-128":34,"murmur3-32":35,"dbl-sha2-256":86,md4:212,md5:213,bmt:214,"sha2-256-trunc254-padded":4114,"ripemd-128":4178,"ripemd-160":4179,"ripemd-256":4180,"ripemd-320":4181,x11:4352,"sm3-256":21325,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46e3,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"poseidon-bls12_381-a2-fc1":46081,"poseidon-bls12_381-a2-fc1-sc":46082});e.exports={names:a}},14243:(e,a,t)=>{"use strict";const{Buffer:c}=t(48287),f=t(42879),d=t(61203),{names:r}=t(53702),{TextDecoder:n}=t(67019),i=new n,b={};for(const e in r)b[r[e]]=e;function o(e){a.decode(e)}a.names=r,a.codes=Object.freeze(b),a.toHexString=function(e){if(!(e instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return(c.isBuffer(e)?e:c.from(e.buffer,e.byteOffset,e.byteLength)).toString("hex")},a.fromHexString=function(e){return c.from(e,"hex")},a.toB58String=function(e){if(!(e instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return i.decode(f.encode("base58btc",e)).slice(1)},a.fromB58String=function(e){const a=e instanceof Uint8Array?i.decode(e):e;return f.decode("z"+a)},a.decode=function(e){if(!(e instanceof Uint8Array))throw new Error("multihash must be a Uint8Array");let t=c.isBuffer(e)?e:c.from(e.buffer,e.byteOffset,e.byteLength);if(t.length<2)throw new Error("multihash too short. must be > 2 bytes.");const f=d.decode(t);if(!a.isValidCode(f))throw new Error(`multihash unknown function code: 0x${f.toString(16)}`);t=t.slice(d.decode.bytes);const r=d.decode(t);if(r<0)throw new Error(`multihash invalid length: ${r}`);if(t=t.slice(d.decode.bytes),t.length!==r)throw new Error(`multihash length inconsistent: 0x${t.toString("hex")}`);return{code:f,name:b[f],length:r,digest:t}},a.encode=function(e,t,f){if(!e||void 0===t)throw new Error("multihash encode requires at least two args: digest, code");const r=a.coerceCode(t);if(!(e instanceof Uint8Array))throw new Error("digest should be a Uint8Array");if(null==f&&(f=e.length),f&&e.length!==f)throw new Error("digest length should be equal to specified length.");const n=d.encode(r),i=d.encode(f),b=c.alloc(n.length+i.length+e.length);return b.set(n,0),b.set(i,n.length),b.set(e,n.length+i.length),b},a.coerceCode=function(e){let t=e;if("string"==typeof e){if(void 0===r[e])throw new Error(`Unrecognized hash function named: ${e}`);t=r[e]}if("number"!=typeof t)throw new Error(`Hash function code should be a number. Got: ${t}`);if(void 0===b[t]&&!a.isAppCode(t))throw new Error(`Unrecognized function code: ${t}`);return t},a.isAppCode=function(e){return e>0&&e<16},a.isValidCode=function(e){return!!a.isAppCode(e)||!!b[e]},a.validate=o,a.prefix=function(e){return o(e),c.from(e.buffer,e.byteOffset,2)}},86889:e=>{e.exports=function e(t,c){if(!t){var f=new a(c);throw Error.captureStackTrace&&Error.captureStackTrace(f,e),f}};class a extends Error{}a.prototype.name="AssertionError"},62045:(e,a,t)=>{"use strict";const c=t(67526),f=t(251),d="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;a.hp=i,a.IS=50;const r=2147483647;function n(e){if(e>r)throw new RangeError('The value "'+e+'" is invalid for option "size"');const a=new Uint8Array(e);return Object.setPrototypeOf(a,i.prototype),a}function i(e,a,t){if("number"==typeof e){if("string"==typeof a)throw new TypeError('The "string" argument must be of type string. Received type number');return s(e)}return b(e,a,t)}function b(e,a,t){if("string"==typeof e)return function(e,a){if("string"==typeof a&&""!==a||(a="utf8"),!i.isEncoding(a))throw new TypeError("Unknown encoding: "+a);const t=0|p(e,a);let c=n(t);const f=c.write(e,a);return f!==t&&(c=c.slice(0,f)),c}(e,a);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){const a=new Uint8Array(e);return u(a.buffer,a.byteOffset,a.byteLength)}return l(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return u(e,a,t);if("undefined"!=typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return u(e,a,t);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const c=e.valueOf&&e.valueOf();if(null!=c&&c!==e)return i.from(c,a,t);const f=function(e){if(i.isBuffer(e)){const a=0|h(e.length),t=n(a);return 0===t.length||e.copy(t,0,0,a),t}return void 0!==e.length?"number"!=typeof e.length||J(e.length)?n(0):l(e):"Buffer"===e.type&&Array.isArray(e.data)?l(e.data):void 0}(e);if(f)return f;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return i.from(e[Symbol.toPrimitive]("string"),a,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function o(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function s(e){return o(e),n(e<0?0:0|h(e))}function l(e){const a=e.length<0?0:0|h(e.length),t=n(a);for(let c=0;c=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function p(e,a){if(i.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const t=e.length,c=arguments.length>2&&!0===arguments[2];if(!c&&0===t)return 0;let f=!1;for(;;)switch(a){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*t;case"hex":return t>>>1;case"base64":return K(e).length;default:if(f)return c?-1:G(e).length;a=(""+a).toLowerCase(),f=!0}}function g(e,a,t){let c=!1;if((void 0===a||a<0)&&(a=0),a>this.length)return"";if((void 0===t||t>this.length)&&(t=this.length),t<=0)return"";if((t>>>=0)<=(a>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return L(this,a,t);case"utf8":case"utf-8":return C(this,a,t);case"ascii":return B(this,a,t);case"latin1":case"binary":return k(this,a,t);case"base64":return E(this,a,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,a,t);default:if(c)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),c=!0}}function m(e,a,t){const c=e[a];e[a]=e[t],e[t]=c}function x(e,a,t,c,f){if(0===e.length)return-1;if("string"==typeof t?(c=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),J(t=+t)&&(t=f?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(f)return-1;t=e.length-1}else if(t<0){if(!f)return-1;t=0}if("string"==typeof a&&(a=i.from(a,c)),i.isBuffer(a))return 0===a.length?-1:y(e,a,t,c,f);if("number"==typeof a)return a&=255,"function"==typeof Uint8Array.prototype.indexOf?f?Uint8Array.prototype.indexOf.call(e,a,t):Uint8Array.prototype.lastIndexOf.call(e,a,t):y(e,[a],t,c,f);throw new TypeError("val must be string, number or Buffer")}function y(e,a,t,c,f){let d,r=1,n=e.length,i=a.length;if(void 0!==c&&("ucs2"===(c=String(c).toLowerCase())||"ucs-2"===c||"utf16le"===c||"utf-16le"===c)){if(e.length<2||a.length<2)return-1;r=2,n/=2,i/=2,t/=2}function b(e,a){return 1===r?e[a]:e.readUInt16BE(a*r)}if(f){let c=-1;for(d=t;dn&&(t=n-i),d=t;d>=0;d--){let t=!0;for(let c=0;cf&&(c=f):c=f;const d=a.length;let r;for(c>d/2&&(c=d/2),r=0;r>8,f=t%256,d.push(f),d.push(c);return d}(a,e.length-t),e,t,c)}function E(e,a,t){return 0===a&&t===e.length?c.fromByteArray(e):c.fromByteArray(e.slice(a,t))}function C(e,a,t){t=Math.min(e.length,t);const c=[];let f=a;for(;f239?4:a>223?3:a>191?2:1;if(f+r<=t){let t,c,n,i;switch(r){case 1:a<128&&(d=a);break;case 2:t=e[f+1],128==(192&t)&&(i=(31&a)<<6|63&t,i>127&&(d=i));break;case 3:t=e[f+1],c=e[f+2],128==(192&t)&&128==(192&c)&&(i=(15&a)<<12|(63&t)<<6|63&c,i>2047&&(i<55296||i>57343)&&(d=i));break;case 4:t=e[f+1],c=e[f+2],n=e[f+3],128==(192&t)&&128==(192&c)&&128==(192&n)&&(i=(15&a)<<18|(63&t)<<12|(63&c)<<6|63&n,i>65535&&i<1114112&&(d=i))}}null===d?(d=65533,r=1):d>65535&&(d-=65536,c.push(d>>>10&1023|55296),d=56320|1023&d),c.push(d),f+=r}return function(e){const a=e.length;if(a<=M)return String.fromCharCode.apply(String,e);let t="",c=0;for(;cc.length?(i.isBuffer(a)||(a=i.from(a)),a.copy(c,f)):Uint8Array.prototype.set.call(c,a,f);else{if(!i.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(c,f)}f+=a.length}return c},i.byteLength=p,i.prototype._isBuffer=!0,i.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let a=0;at&&(e+=" ... "),""},d&&(i.prototype[d]=i.prototype.inspect),i.prototype.compare=function(e,a,t,c,f){if(Z(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===a&&(a=0),void 0===t&&(t=e?e.length:0),void 0===c&&(c=0),void 0===f&&(f=this.length),a<0||t>e.length||c<0||f>this.length)throw new RangeError("out of range index");if(c>=f&&a>=t)return 0;if(c>=f)return-1;if(a>=t)return 1;if(this===e)return 0;let d=(f>>>=0)-(c>>>=0),r=(t>>>=0)-(a>>>=0);const n=Math.min(d,r),b=this.slice(c,f),o=e.slice(a,t);for(let e=0;e>>=0,isFinite(t)?(t>>>=0,void 0===c&&(c="utf8")):(c=t,t=void 0)}const f=this.length-a;if((void 0===t||t>f)&&(t=f),e.length>0&&(t<0||a<0)||a>this.length)throw new RangeError("Attempt to write outside buffer bounds");c||(c="utf8");let d=!1;for(;;)switch(c){case"hex":return A(this,e,a,t);case"utf8":case"utf-8":return v(this,e,a,t);case"ascii":case"latin1":case"binary":return w(this,e,a,t);case"base64":return _(this,e,a,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,a,t);default:if(d)throw new TypeError("Unknown encoding: "+c);c=(""+c).toLowerCase(),d=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const M=4096;function B(e,a,t){let c="";t=Math.min(e.length,t);for(let f=a;fc)&&(t=c);let f="";for(let c=a;ct)throw new RangeError("Trying to access beyond buffer length")}function N(e,a,t,c,f,d){if(!i.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(a>f||ae.length)throw new RangeError("Index out of range")}function R(e,a,t,c,f){H(a,c,f,e,t,7);let d=Number(a&BigInt(4294967295));e[t++]=d,d>>=8,e[t++]=d,d>>=8,e[t++]=d,d>>=8,e[t++]=d;let r=Number(a>>BigInt(32)&BigInt(4294967295));return e[t++]=r,r>>=8,e[t++]=r,r>>=8,e[t++]=r,r>>=8,e[t++]=r,t}function P(e,a,t,c,f){H(a,c,f,e,t,7);let d=Number(a&BigInt(4294967295));e[t+7]=d,d>>=8,e[t+6]=d,d>>=8,e[t+5]=d,d>>=8,e[t+4]=d;let r=Number(a>>BigInt(32)&BigInt(4294967295));return e[t+3]=r,r>>=8,e[t+2]=r,r>>=8,e[t+1]=r,r>>=8,e[t]=r,t+8}function D(e,a,t,c,f,d){if(t+c>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function O(e,a,t,c,d){return a=+a,t>>>=0,d||D(e,0,t,4),f.write(e,a,t,c,23,4),t+4}function F(e,a,t,c,d){return a=+a,t>>>=0,d||D(e,0,t,8),f.write(e,a,t,c,52,8),t+8}i.prototype.slice=function(e,a){const t=this.length;(e=~~e)<0?(e+=t)<0&&(e=0):e>t&&(e=t),(a=void 0===a?t:~~a)<0?(a+=t)<0&&(a=0):a>t&&(a=t),a>>=0,a>>>=0,t||T(e,a,this.length);let c=this[e],f=1,d=0;for(;++d>>=0,a>>>=0,t||T(e,a,this.length);let c=this[e+--a],f=1;for(;a>0&&(f*=256);)c+=this[e+--a]*f;return c},i.prototype.readUint8=i.prototype.readUInt8=function(e,a){return e>>>=0,a||T(e,1,this.length),this[e]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(e,a){return e>>>=0,a||T(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(e,a){return e>>>=0,a||T(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(e,a){return e>>>=0,a||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(e,a){return e>>>=0,a||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readBigUInt64LE=Y((function(e){q(e>>>=0,"offset");const a=this[e],t=this[e+7];void 0!==a&&void 0!==t||$(e,this.length-8);const c=a+256*this[++e]+65536*this[++e]+this[++e]*2**24,f=this[++e]+256*this[++e]+65536*this[++e]+t*2**24;return BigInt(c)+(BigInt(f)<>>=0,"offset");const a=this[e],t=this[e+7];void 0!==a&&void 0!==t||$(e,this.length-8);const c=a*2**24+65536*this[++e]+256*this[++e]+this[++e],f=this[++e]*2**24+65536*this[++e]+256*this[++e]+t;return(BigInt(c)<>>=0,a>>>=0,t||T(e,a,this.length);let c=this[e],f=1,d=0;for(;++d=f&&(c-=Math.pow(2,8*a)),c},i.prototype.readIntBE=function(e,a,t){e>>>=0,a>>>=0,t||T(e,a,this.length);let c=a,f=1,d=this[e+--c];for(;c>0&&(f*=256);)d+=this[e+--c]*f;return f*=128,d>=f&&(d-=Math.pow(2,8*a)),d},i.prototype.readInt8=function(e,a){return e>>>=0,a||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,a){e>>>=0,a||T(e,2,this.length);const t=this[e]|this[e+1]<<8;return 32768&t?4294901760|t:t},i.prototype.readInt16BE=function(e,a){e>>>=0,a||T(e,2,this.length);const t=this[e+1]|this[e]<<8;return 32768&t?4294901760|t:t},i.prototype.readInt32LE=function(e,a){return e>>>=0,a||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,a){return e>>>=0,a||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readBigInt64LE=Y((function(e){q(e>>>=0,"offset");const a=this[e],t=this[e+7];void 0!==a&&void 0!==t||$(e,this.length-8);const c=this[e+4]+256*this[e+5]+65536*this[e+6]+(t<<24);return(BigInt(c)<>>=0,"offset");const a=this[e],t=this[e+7];void 0!==a&&void 0!==t||$(e,this.length-8);const c=(a<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(c)<>>=0,a||T(e,4,this.length),f.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,a){return e>>>=0,a||T(e,4,this.length),f.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,a){return e>>>=0,a||T(e,8,this.length),f.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,a){return e>>>=0,a||T(e,8,this.length),f.read(this,e,!1,52,8)},i.prototype.writeUintLE=i.prototype.writeUIntLE=function(e,a,t,c){e=+e,a>>>=0,t>>>=0,c||N(this,e,a,t,Math.pow(2,8*t)-1,0);let f=1,d=0;for(this[a]=255&e;++d>>=0,t>>>=0,c||N(this,e,a,t,Math.pow(2,8*t)-1,0);let f=t-1,d=1;for(this[a+f]=255&e;--f>=0&&(d*=256);)this[a+f]=e/d&255;return a+t},i.prototype.writeUint8=i.prototype.writeUInt8=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,1,255,0),this[a]=255&e,a+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,2,65535,0),this[a]=255&e,this[a+1]=e>>>8,a+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,2,65535,0),this[a]=e>>>8,this[a+1]=255&e,a+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,4,4294967295,0),this[a+3]=e>>>24,this[a+2]=e>>>16,this[a+1]=e>>>8,this[a]=255&e,a+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,4,4294967295,0),this[a]=e>>>24,this[a+1]=e>>>16,this[a+2]=e>>>8,this[a+3]=255&e,a+4},i.prototype.writeBigUInt64LE=Y((function(e,a=0){return R(this,e,a,BigInt(0),BigInt("0xffffffffffffffff"))})),i.prototype.writeBigUInt64BE=Y((function(e,a=0){return P(this,e,a,BigInt(0),BigInt("0xffffffffffffffff"))})),i.prototype.writeIntLE=function(e,a,t,c){if(e=+e,a>>>=0,!c){const c=Math.pow(2,8*t-1);N(this,e,a,t,c-1,-c)}let f=0,d=1,r=0;for(this[a]=255&e;++f>>=0,!c){const c=Math.pow(2,8*t-1);N(this,e,a,t,c-1,-c)}let f=t-1,d=1,r=0;for(this[a+f]=255&e;--f>=0&&(d*=256);)e<0&&0===r&&0!==this[a+f+1]&&(r=1),this[a+f]=(e/d|0)-r&255;return a+t},i.prototype.writeInt8=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,1,127,-128),e<0&&(e=255+e+1),this[a]=255&e,a+1},i.prototype.writeInt16LE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,2,32767,-32768),this[a]=255&e,this[a+1]=e>>>8,a+2},i.prototype.writeInt16BE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,2,32767,-32768),this[a]=e>>>8,this[a+1]=255&e,a+2},i.prototype.writeInt32LE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,4,2147483647,-2147483648),this[a]=255&e,this[a+1]=e>>>8,this[a+2]=e>>>16,this[a+3]=e>>>24,a+4},i.prototype.writeInt32BE=function(e,a,t){return e=+e,a>>>=0,t||N(this,e,a,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[a]=e>>>24,this[a+1]=e>>>16,this[a+2]=e>>>8,this[a+3]=255&e,a+4},i.prototype.writeBigInt64LE=Y((function(e,a=0){return R(this,e,a,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),i.prototype.writeBigInt64BE=Y((function(e,a=0){return P(this,e,a,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),i.prototype.writeFloatLE=function(e,a,t){return O(this,e,a,!0,t)},i.prototype.writeFloatBE=function(e,a,t){return O(this,e,a,!1,t)},i.prototype.writeDoubleLE=function(e,a,t){return F(this,e,a,!0,t)},i.prototype.writeDoubleBE=function(e,a,t){return F(this,e,a,!1,t)},i.prototype.copy=function(e,a,t,c){if(!i.isBuffer(e))throw new TypeError("argument should be a Buffer");if(t||(t=0),c||0===c||(c=this.length),a>=e.length&&(a=e.length),a||(a=0),c>0&&c=this.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("sourceEnd out of bounds");c>this.length&&(c=this.length),e.length-a>>=0,t=void 0===t?this.length:t>>>0,e||(e=0),"number"==typeof e)for(f=a;f=c+4;t-=3)a=`_${e.slice(t-3,t)}${a}`;return`${e.slice(0,t)}${a}`}function H(e,a,t,c,f,d){if(e>t||e3?0===a||a===BigInt(0)?`>= 0${c} and < 2${c} ** ${8*(d+1)}${c}`:`>= -(2${c} ** ${8*(d+1)-1}${c}) and < 2 ** ${8*(d+1)-1}${c}`:`>= ${a}${c} and <= ${t}${c}`,new Q.ERR_OUT_OF_RANGE("value",f,e)}!function(e,a,t){q(a,"offset"),void 0!==e[a]&&void 0!==e[a+t]||$(a,e.length-(t+1))}(c,f,d)}function q(e,a){if("number"!=typeof e)throw new Q.ERR_INVALID_ARG_TYPE(a,"number",e)}function $(e,a,t){if(Math.floor(e)!==e)throw q(e,t),new Q.ERR_OUT_OF_RANGE(t||"offset","an integer",e);if(a<0)throw new Q.ERR_BUFFER_OUT_OF_BOUNDS;throw new Q.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${a}`,e)}U("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),U("ERR_INVALID_ARG_TYPE",(function(e,a){return`The "${e}" argument must be of type number. Received type ${typeof a}`}),TypeError),U("ERR_OUT_OF_RANGE",(function(e,a,t){let c=`The value of "${e}" is out of range.`,f=t;return Number.isInteger(t)&&Math.abs(t)>2**32?f=j(String(t)):"bigint"==typeof t&&(f=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(f=j(f)),f+="n"),c+=` It must be ${a}. Received ${f}`,c}),RangeError);const z=/[^+/0-9A-Za-z-_]/g;function G(e,a){let t;a=a||1/0;const c=e.length;let f=null;const d=[];for(let r=0;r55295&&t<57344){if(!f){if(t>56319){(a-=3)>-1&&d.push(239,191,189);continue}if(r+1===c){(a-=3)>-1&&d.push(239,191,189);continue}f=t;continue}if(t<56320){(a-=3)>-1&&d.push(239,191,189),f=t;continue}t=65536+(f-55296<<10|t-56320)}else f&&(a-=3)>-1&&d.push(239,191,189);if(f=null,t<128){if((a-=1)<0)break;d.push(t)}else if(t<2048){if((a-=2)<0)break;d.push(t>>6|192,63&t|128)}else if(t<65536){if((a-=3)<0)break;d.push(t>>12|224,t>>6&63|128,63&t|128)}else{if(!(t<1114112))throw new Error("Invalid code point");if((a-=4)<0)break;d.push(t>>18|240,t>>12&63|128,t>>6&63|128,63&t|128)}}return d}function K(e){return c.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,a,t,c){let f;for(f=0;f=a.length||f>=e.length);++f)a[f+t]=e[f];return f}function Z(e,a){return e instanceof a||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===a.name}function J(e){return e!=e}const W=function(){const e="0123456789abcdef",a=new Array(256);for(let t=0;t<16;++t){const c=16*t;for(let f=0;f<16;++f)a[c+f]=e[t]+e[f]}return a}();function Y(e){return"undefined"==typeof BigInt?X:e}function X(){throw new Error("BigInt not supported")}},89211:e=>{"use strict";var a=function(e){return e!=e};e.exports=function(e,t){return 0===e&&0===t?1/e==1/t:e===t||!(!a(e)||!a(t))}},37653:(e,a,t)=>{"use strict";var c=t(38452),f=t(10487),d=t(89211),r=t(9394),n=t(36576),i=f(r(),Object);c(i,{getPolyfill:r,implementation:d,shim:n}),e.exports=i},9394:(e,a,t)=>{"use strict";var c=t(89211);e.exports=function(){return"function"==typeof Object.is?Object.is:c}},36576:(e,a,t)=>{"use strict";var c=t(9394),f=t(38452);e.exports=function(){var e=c();return f(Object,{is:e},{is:function(){return Object.is!==e}}),e}},28875:(e,a,t)=>{"use strict";var c;if(!Object.keys){var f=Object.prototype.hasOwnProperty,d=Object.prototype.toString,r=t(1093),n=Object.prototype.propertyIsEnumerable,i=!n.call({toString:null},"toString"),b=n.call((function(){}),"prototype"),o=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],s=function(e){var a=e.constructor;return a&&a.prototype===e},l={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},u=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!l["$"+e]&&f.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{s(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();c=function(e){var a=null!==e&&"object"==typeof e,t="[object Function]"===d.call(e),c=r(e),n=a&&"[object String]"===d.call(e),l=[];if(!a&&!t&&!c)throw new TypeError("Object.keys called on a non-object");var h=b&&t;if(n&&e.length>0&&!f.call(e,0))for(var p=0;p0)for(var g=0;g{"use strict";var c=Array.prototype.slice,f=t(1093),d=Object.keys,r=d?function(e){return d(e)}:t(28875),n=Object.keys;r.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return f(e)?n(c.call(e)):n(e)})}else Object.keys=r;return Object.keys||r},e.exports=r},1093:e=>{"use strict";var a=Object.prototype.toString;e.exports=function(e){var t=a.call(e),c="[object Arguments]"===t;return c||(c="[object Array]"!==t&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===a.call(e.callee)),c}},38403:(e,a,t)=>{"use strict";var c=t(1189),f=t(41333)(),d=t(38075),r=Object,n=d("Array.prototype.push"),i=d("Object.prototype.propertyIsEnumerable"),b=f?Object.getOwnPropertySymbols:null;e.exports=function(e,a){if(null==e)throw new TypeError("target must be an object");var t=r(e);if(1===arguments.length)return t;for(var d=1;d{"use strict";var c=t(38403);e.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",a=e.split(""),t={},c=0;c{"use strict";var t="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function c(e,a){return Object.prototype.hasOwnProperty.call(e,a)}a.assign=function(e){for(var a=Array.prototype.slice.call(arguments,1);a.length;){var t=a.shift();if(t){if("object"!=typeof t)throw new TypeError(t+"must be non-object");for(var f in t)c(t,f)&&(e[f]=t[f])}}return e},a.shrinkBuf=function(e,a){return e.length===a?e:e.subarray?e.subarray(0,a):(e.length=a,e)};var f={arraySet:function(e,a,t,c,f){if(a.subarray&&e.subarray)e.set(a.subarray(t,t+c),f);else for(var d=0;d{"use strict";e.exports=function(e,a,t,c){for(var f=65535&e,d=e>>>16&65535,r=0;0!==t;){t-=r=t>2e3?2e3:t;do{d=d+(f=f+a[c++]|0)|0}while(--r);f%=65521,d%=65521}return f|d<<16}},19681:e=>{"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},14823:e=>{"use strict";var a=function(){for(var e,a=[],t=0;t<256;t++){e=t;for(var c=0;c<8;c++)e=1&e?3988292384^e>>>1:e>>>1;a[t]=e}return a}();e.exports=function(e,t,c,f){var d=a,r=f+c;e^=-1;for(var n=f;n>>8^d[255&(e^t[n])];return~e}},58411:(e,a,t)=>{"use strict";var c,f=t(9805),d=t(23665),r=t(53269),n=t(14823),i=t(54674),b=-2,o=258,s=262,l=103,u=113,h=666;function p(e,a){return e.msg=i[a],a}function g(e){return(e<<1)-(e>4?9:0)}function m(e){for(var a=e.length;--a>=0;)e[a]=0}function x(e){var a=e.state,t=a.pending;t>e.avail_out&&(t=e.avail_out),0!==t&&(f.arraySet(e.output,a.pending_buf,a.pending_out,t,e.next_out),e.next_out+=t,a.pending_out+=t,e.total_out+=t,e.avail_out-=t,a.pending-=t,0===a.pending&&(a.pending_out=0))}function y(e,a){d._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,a),e.block_start=e.strstart,x(e.strm)}function A(e,a){e.pending_buf[e.pending++]=a}function v(e,a){e.pending_buf[e.pending++]=a>>>8&255,e.pending_buf[e.pending++]=255&a}function w(e,a){var t,c,f=e.max_chain_length,d=e.strstart,r=e.prev_length,n=e.nice_match,i=e.strstart>e.w_size-s?e.strstart-(e.w_size-s):0,b=e.window,l=e.w_mask,u=e.prev,h=e.strstart+o,p=b[d+r-1],g=b[d+r];e.prev_length>=e.good_match&&(f>>=2),n>e.lookahead&&(n=e.lookahead);do{if(b[(t=a)+r]===g&&b[t+r-1]===p&&b[t]===b[d]&&b[++t]===b[d+1]){d+=2,t++;do{}while(b[++d]===b[++t]&&b[++d]===b[++t]&&b[++d]===b[++t]&&b[++d]===b[++t]&&b[++d]===b[++t]&&b[++d]===b[++t]&&b[++d]===b[++t]&&b[++d]===b[++t]&&dr){if(e.match_start=a,r=c,c>=n)break;p=b[d+r-1],g=b[d+r]}}}while((a=u[a&l])>i&&0!=--f);return r<=e.lookahead?r:e.lookahead}function _(e){var a,t,c,d,i,b,o,l,u,h,p=e.w_size;do{if(d=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-s)){f.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,a=t=e.hash_size;do{c=e.head[--a],e.head[a]=c>=p?c-p:0}while(--t);a=t=p;do{c=e.prev[--a],e.prev[a]=c>=p?c-p:0}while(--t);d+=p}if(0===e.strm.avail_in)break;if(b=e.strm,o=e.window,l=e.strstart+e.lookahead,u=d,h=void 0,(h=b.avail_in)>u&&(h=u),t=0===h?0:(b.avail_in-=h,f.arraySet(o,b.input,b.next_in,h,l),1===b.state.wrap?b.adler=r(b.adler,o,h,l):2===b.state.wrap&&(b.adler=n(b.adler,o,h,l)),b.next_in+=h,b.total_in+=h,h),e.lookahead+=t,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<=3)if(c=d._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){f=e.strstart+e.lookahead-3,c=d._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=f&&(e.ins_h=(e.ins_h<15&&(n=2,c-=16),d<1||d>9||8!==t||c<8||c>15||a<0||a>9||r<0||r>4)return p(e,b);8===c&&(c=9);var i=new M;return e.state=i,i.strm=e,i.wrap=n,i.gzhead=null,i.w_bits=c,i.w_size=1<e.pending_buf_size-5&&(t=e.pending_buf_size-5);;){if(e.lookahead<=1){if(_(e),0===e.lookahead&&0===a)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var c=e.block_start+t;if((0===e.strstart||e.strstart>=c)&&(e.lookahead=e.strstart-c,e.strstart=c,y(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-s&&(y(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===a?(y(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(y(e,!1),e.strm.avail_out),1)})),new C(4,4,8,4,I),new C(4,5,16,8,I),new C(4,6,32,32,I),new C(4,4,16,16,E),new C(8,16,32,32,E),new C(8,16,128,128,E),new C(8,32,128,256,E),new C(32,128,258,1024,E),new C(32,258,258,4096,E)],a.deflateInit=function(e,a){return L(e,a,8,15,8,0)},a.deflateInit2=L,a.deflateReset=k,a.deflateResetKeep=B,a.deflateSetHeader=function(e,a){return e&&e.state?2!==e.state.wrap?b:(e.state.gzhead=a,0):b},a.deflate=function(e,a){var t,f,r,i;if(!e||!e.state||a>5||a<0)return e?p(e,b):b;if(f=e.state,!e.output||!e.input&&0!==e.avail_in||f.status===h&&4!==a)return p(e,0===e.avail_out?-5:b);if(f.strm=e,t=f.last_flush,f.last_flush=a,42===f.status)if(2===f.wrap)e.adler=0,A(f,31),A(f,139),A(f,8),f.gzhead?(A(f,(f.gzhead.text?1:0)+(f.gzhead.hcrc?2:0)+(f.gzhead.extra?4:0)+(f.gzhead.name?8:0)+(f.gzhead.comment?16:0)),A(f,255&f.gzhead.time),A(f,f.gzhead.time>>8&255),A(f,f.gzhead.time>>16&255),A(f,f.gzhead.time>>24&255),A(f,9===f.level?2:f.strategy>=2||f.level<2?4:0),A(f,255&f.gzhead.os),f.gzhead.extra&&f.gzhead.extra.length&&(A(f,255&f.gzhead.extra.length),A(f,f.gzhead.extra.length>>8&255)),f.gzhead.hcrc&&(e.adler=n(e.adler,f.pending_buf,f.pending,0)),f.gzindex=0,f.status=69):(A(f,0),A(f,0),A(f,0),A(f,0),A(f,0),A(f,9===f.level?2:f.strategy>=2||f.level<2?4:0),A(f,3),f.status=u);else{var s=8+(f.w_bits-8<<4)<<8;s|=(f.strategy>=2||f.level<2?0:f.level<6?1:6===f.level?2:3)<<6,0!==f.strstart&&(s|=32),s+=31-s%31,f.status=u,v(f,s),0!==f.strstart&&(v(f,e.adler>>>16),v(f,65535&e.adler)),e.adler=1}if(69===f.status)if(f.gzhead.extra){for(r=f.pending;f.gzindex<(65535&f.gzhead.extra.length)&&(f.pending!==f.pending_buf_size||(f.gzhead.hcrc&&f.pending>r&&(e.adler=n(e.adler,f.pending_buf,f.pending-r,r)),x(e),r=f.pending,f.pending!==f.pending_buf_size));)A(f,255&f.gzhead.extra[f.gzindex]),f.gzindex++;f.gzhead.hcrc&&f.pending>r&&(e.adler=n(e.adler,f.pending_buf,f.pending-r,r)),f.gzindex===f.gzhead.extra.length&&(f.gzindex=0,f.status=73)}else f.status=73;if(73===f.status)if(f.gzhead.name){r=f.pending;do{if(f.pending===f.pending_buf_size&&(f.gzhead.hcrc&&f.pending>r&&(e.adler=n(e.adler,f.pending_buf,f.pending-r,r)),x(e),r=f.pending,f.pending===f.pending_buf_size)){i=1;break}i=f.gzindexr&&(e.adler=n(e.adler,f.pending_buf,f.pending-r,r)),0===i&&(f.gzindex=0,f.status=91)}else f.status=91;if(91===f.status)if(f.gzhead.comment){r=f.pending;do{if(f.pending===f.pending_buf_size&&(f.gzhead.hcrc&&f.pending>r&&(e.adler=n(e.adler,f.pending_buf,f.pending-r,r)),x(e),r=f.pending,f.pending===f.pending_buf_size)){i=1;break}i=f.gzindexr&&(e.adler=n(e.adler,f.pending_buf,f.pending-r,r)),0===i&&(f.status=l)}else f.status=l;if(f.status===l&&(f.gzhead.hcrc?(f.pending+2>f.pending_buf_size&&x(e),f.pending+2<=f.pending_buf_size&&(A(f,255&e.adler),A(f,e.adler>>8&255),e.adler=0,f.status=u)):f.status=u),0!==f.pending){if(x(e),0===e.avail_out)return f.last_flush=-1,0}else if(0===e.avail_in&&g(a)<=g(t)&&4!==a)return p(e,-5);if(f.status===h&&0!==e.avail_in)return p(e,-5);if(0!==e.avail_in||0!==f.lookahead||0!==a&&f.status!==h){var w=2===f.strategy?function(e,a){for(var t;;){if(0===e.lookahead&&(_(e),0===e.lookahead)){if(0===a)return 1;break}if(e.match_length=0,t=d._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,t&&(y(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===a?(y(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(y(e,!1),0===e.strm.avail_out)?1:2}(f,a):3===f.strategy?function(e,a){for(var t,c,f,r,n=e.window;;){if(e.lookahead<=o){if(_(e),e.lookahead<=o&&0===a)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(c=n[f=e.strstart-1])===n[++f]&&c===n[++f]&&c===n[++f]){r=e.strstart+o;do{}while(c===n[++f]&&c===n[++f]&&c===n[++f]&&c===n[++f]&&c===n[++f]&&c===n[++f]&&c===n[++f]&&c===n[++f]&&fe.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(t=d._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(t=d._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),t&&(y(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===a?(y(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(y(e,!1),0===e.strm.avail_out)?1:2}(f,a):c[f.level].func(f,a);if(3!==w&&4!==w||(f.status=h),1===w||3===w)return 0===e.avail_out&&(f.last_flush=-1),0;if(2===w&&(1===a?d._tr_align(f):5!==a&&(d._tr_stored_block(f,0,0,!1),3===a&&(m(f.head),0===f.lookahead&&(f.strstart=0,f.block_start=0,f.insert=0))),x(e),0===e.avail_out))return f.last_flush=-1,0}return 4!==a?0:f.wrap<=0?1:(2===f.wrap?(A(f,255&e.adler),A(f,e.adler>>8&255),A(f,e.adler>>16&255),A(f,e.adler>>24&255),A(f,255&e.total_in),A(f,e.total_in>>8&255),A(f,e.total_in>>16&255),A(f,e.total_in>>24&255)):(v(f,e.adler>>>16),v(f,65535&e.adler)),x(e),f.wrap>0&&(f.wrap=-f.wrap),0!==f.pending?0:1)},a.deflateEnd=function(e){var a;return e&&e.state?42!==(a=e.state.status)&&69!==a&&73!==a&&91!==a&&a!==l&&a!==u&&a!==h?p(e,b):(e.state=null,a===u?p(e,-3):0):b},a.deflateSetDictionary=function(e,a){var t,c,d,n,i,o,s,l,u=a.length;if(!e||!e.state)return b;if(2===(n=(t=e.state).wrap)||1===n&&42!==t.status||t.lookahead)return b;for(1===n&&(e.adler=r(e.adler,a,u,0)),t.wrap=0,u>=t.w_size&&(0===n&&(m(t.head),t.strstart=0,t.block_start=0,t.insert=0),l=new f.Buf8(t.w_size),f.arraySet(l,a,u-t.w_size,t.w_size,0),a=l,u=t.w_size),i=e.avail_in,o=e.next_in,s=e.input,e.avail_in=u,e.next_in=0,e.input=a,_(t);t.lookahead>=3;){c=t.strstart,d=t.lookahead-2;do{t.ins_h=(t.ins_h<{"use strict";e.exports=function(e,a){var t,c,f,d,r,n,i,b,o,s,l,u,h,p,g,m,x,y,A,v,w,_,I,E,C;t=e.state,c=e.next_in,E=e.input,f=c+(e.avail_in-5),d=e.next_out,C=e.output,r=d-(a-e.avail_out),n=d+(e.avail_out-257),i=t.dmax,b=t.wsize,o=t.whave,s=t.wnext,l=t.window,u=t.hold,h=t.bits,p=t.lencode,g=t.distcode,m=(1<>>=A=y>>>24,h-=A,0==(A=y>>>16&255))C[d++]=65535&y;else{if(!(16&A)){if(64&A){if(32&A){t.mode=12;break e}e.msg="invalid literal/length code",t.mode=30;break e}y=p[(65535&y)+(u&(1<>>=A,h-=A),h<15&&(u+=E[c++]<>>=A=y>>>24,h-=A,16&(A=y>>>16&255)){if(w=65535&y,h<(A&=15)&&(u+=E[c++]<i){e.msg="invalid distance too far back",t.mode=30;break e}if(u>>>=A,h-=A,w>(A=d-r)){if((A=w-A)>o&&t.sane){e.msg="invalid distance too far back",t.mode=30;break e}if(_=0,I=l,0===s){if(_+=b-A,A2;)C[d++]=I[_++],C[d++]=I[_++],C[d++]=I[_++],v-=3;v&&(C[d++]=I[_++],v>1&&(C[d++]=I[_++]))}else{_=d-w;do{C[d++]=C[_++],C[d++]=C[_++],C[d++]=C[_++],v-=3}while(v>2);v&&(C[d++]=C[_++],v>1&&(C[d++]=C[_++]))}break}if(64&A){e.msg="invalid distance code",t.mode=30;break e}y=g[(65535&y)+(u&(1<>3,u&=(1<<(h-=v<<3))-1,e.next_in=c,e.next_out=d,e.avail_in=c{"use strict";var c=t(9805),f=t(53269),d=t(14823),r=t(47293),n=t(21998),i=-2,b=12,o=30;function s(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function l(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new c.Buf16(320),this.work=new c.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function u(e){var a;return e&&e.state?(a=e.state,e.total_in=e.total_out=a.total=0,e.msg="",a.wrap&&(e.adler=1&a.wrap),a.mode=1,a.last=0,a.havedict=0,a.dmax=32768,a.head=null,a.hold=0,a.bits=0,a.lencode=a.lendyn=new c.Buf32(852),a.distcode=a.distdyn=new c.Buf32(592),a.sane=1,a.back=-1,0):i}function h(e){var a;return e&&e.state?((a=e.state).wsize=0,a.whave=0,a.wnext=0,u(e)):i}function p(e,a){var t,c;return e&&e.state?(c=e.state,a<0?(t=0,a=-a):(t=1+(a>>4),a<48&&(a&=15)),a&&(a<8||a>15)?i:(null!==c.window&&c.wbits!==a&&(c.window=null),c.wrap=t,c.wbits=a,h(e))):i}function g(e,a){var t,c;return e?(c=new l,e.state=c,c.window=null,0!==(t=p(e,a))&&(e.state=null),t):i}var m,x,y=!0;function A(e){if(y){var a;for(m=new c.Buf32(512),x=new c.Buf32(32),a=0;a<144;)e.lens[a++]=8;for(;a<256;)e.lens[a++]=9;for(;a<280;)e.lens[a++]=7;for(;a<288;)e.lens[a++]=8;for(n(1,e.lens,0,288,m,0,e.work,{bits:9}),a=0;a<32;)e.lens[a++]=5;n(2,e.lens,0,32,x,0,e.work,{bits:5}),y=!1}e.lencode=m,e.lenbits=9,e.distcode=x,e.distbits=5}function v(e,a,t,f){var d,r=e.state;return null===r.window&&(r.wsize=1<=r.wsize?(c.arraySet(r.window,a,t-r.wsize,r.wsize,0),r.wnext=0,r.whave=r.wsize):((d=r.wsize-r.wnext)>f&&(d=f),c.arraySet(r.window,a,t-f,d,r.wnext),(f-=d)?(c.arraySet(r.window,a,t-f,f,0),r.wnext=f,r.whave=r.wsize):(r.wnext+=d,r.wnext===r.wsize&&(r.wnext=0),r.whave>>8&255,t.check=d(t.check,F,2,0),x=0,y=0,t.mode=2;break}if(t.flags=0,t.head&&(t.head.done=!1),!(1&t.wrap)||(((255&x)<<8)+(x>>8))%31){e.msg="incorrect header check",t.mode=o;break}if(8!=(15&x)){e.msg="unknown compression method",t.mode=o;break}if(y-=4,N=8+(15&(x>>>=4)),0===t.wbits)t.wbits=N;else if(N>t.wbits){e.msg="invalid window size",t.mode=o;break}t.dmax=1<>8&1),512&t.flags&&(F[0]=255&x,F[1]=x>>>8&255,t.check=d(t.check,F,2,0)),x=0,y=0,t.mode=3;case 3:for(;y<32;){if(0===g)break e;g--,x+=l[h++]<>>8&255,F[2]=x>>>16&255,F[3]=x>>>24&255,t.check=d(t.check,F,4,0)),x=0,y=0,t.mode=4;case 4:for(;y<16;){if(0===g)break e;g--,x+=l[h++]<>8),512&t.flags&&(F[0]=255&x,F[1]=x>>>8&255,t.check=d(t.check,F,2,0)),x=0,y=0,t.mode=5;case 5:if(1024&t.flags){for(;y<16;){if(0===g)break e;g--,x+=l[h++]<>>8&255,t.check=d(t.check,F,2,0)),x=0,y=0}else t.head&&(t.head.extra=null);t.mode=6;case 6:if(1024&t.flags&&((I=t.length)>g&&(I=g),I&&(t.head&&(N=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Array(t.head.extra_len)),c.arraySet(t.head.extra,l,h,I,N)),512&t.flags&&(t.check=d(t.check,l,I,h)),g-=I,h+=I,t.length-=I),t.length))break e;t.length=0,t.mode=7;case 7:if(2048&t.flags){if(0===g)break e;I=0;do{N=l[h+I++],t.head&&N&&t.length<65536&&(t.head.name+=String.fromCharCode(N))}while(N&&I>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=b;break;case 10:for(;y<32;){if(0===g)break e;g--,x+=l[h++]<>>=7&y,y-=7&y,t.mode=27;break}for(;y<3;){if(0===g)break e;g--,x+=l[h++]<>>=1)){case 0:t.mode=14;break;case 1:if(A(t),t.mode=20,6===a){x>>>=2,y-=2;break e}break;case 2:t.mode=17;break;case 3:e.msg="invalid block type",t.mode=o}x>>>=2,y-=2;break;case 14:for(x>>>=7&y,y-=7&y;y<32;){if(0===g)break e;g--,x+=l[h++]<>>16^65535)){e.msg="invalid stored block lengths",t.mode=o;break}if(t.length=65535&x,x=0,y=0,t.mode=15,6===a)break e;case 15:t.mode=16;case 16:if(I=t.length){if(I>g&&(I=g),I>m&&(I=m),0===I)break e;c.arraySet(u,l,h,I,p),g-=I,h+=I,m-=I,p+=I,t.length-=I;break}t.mode=b;break;case 17:for(;y<14;){if(0===g)break e;g--,x+=l[h++]<>>=5,y-=5,t.ndist=1+(31&x),x>>>=5,y-=5,t.ncode=4+(15&x),x>>>=4,y-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=o;break}t.have=0,t.mode=18;case 18:for(;t.have>>=3,y-=3}for(;t.have<19;)t.lens[Q[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,P={bits:t.lenbits},R=n(0,t.lens,0,19,t.lencode,0,t.work,P),t.lenbits=P.bits,R){e.msg="invalid code lengths set",t.mode=o;break}t.have=0,t.mode=19;case 19:for(;t.have>>16&255,k=65535&O,!((M=O>>>24)<=y);){if(0===g)break e;g--,x+=l[h++]<>>=M,y-=M,t.lens[t.have++]=k;else{if(16===k){for(D=M+2;y>>=M,y-=M,0===t.have){e.msg="invalid bit length repeat",t.mode=o;break}N=t.lens[t.have-1],I=3+(3&x),x>>>=2,y-=2}else if(17===k){for(D=M+3;y>>=M)),x>>>=3,y-=3}else{for(D=M+7;y>>=M)),x>>>=7,y-=7}if(t.have+I>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=o;break}for(;I--;)t.lens[t.have++]=N}}if(t.mode===o)break;if(0===t.lens[256]){e.msg="invalid code -- missing end-of-block",t.mode=o;break}if(t.lenbits=9,P={bits:t.lenbits},R=n(1,t.lens,0,t.nlen,t.lencode,0,t.work,P),t.lenbits=P.bits,R){e.msg="invalid literal/lengths set",t.mode=o;break}if(t.distbits=6,t.distcode=t.distdyn,P={bits:t.distbits},R=n(2,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,P),t.distbits=P.bits,R){e.msg="invalid distances set",t.mode=o;break}if(t.mode=20,6===a)break e;case 20:t.mode=21;case 21:if(g>=6&&m>=258){e.next_out=p,e.avail_out=m,e.next_in=h,e.avail_in=g,t.hold=x,t.bits=y,r(e,_),p=e.next_out,u=e.output,m=e.avail_out,h=e.next_in,l=e.input,g=e.avail_in,x=t.hold,y=t.bits,t.mode===b&&(t.back=-1);break}for(t.back=0;B=(O=t.lencode[x&(1<>>16&255,k=65535&O,!((M=O>>>24)<=y);){if(0===g)break e;g--,x+=l[h++]<>L)])>>>16&255,k=65535&O,!(L+(M=O>>>24)<=y);){if(0===g)break e;g--,x+=l[h++]<>>=L,y-=L,t.back+=L}if(x>>>=M,y-=M,t.back+=M,t.length=k,0===B){t.mode=26;break}if(32&B){t.back=-1,t.mode=b;break}if(64&B){e.msg="invalid literal/length code",t.mode=o;break}t.extra=15&B,t.mode=22;case 22:if(t.extra){for(D=t.extra;y>>=t.extra,y-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=23;case 23:for(;B=(O=t.distcode[x&(1<>>16&255,k=65535&O,!((M=O>>>24)<=y);){if(0===g)break e;g--,x+=l[h++]<>L)])>>>16&255,k=65535&O,!(L+(M=O>>>24)<=y);){if(0===g)break e;g--,x+=l[h++]<>>=L,y-=L,t.back+=L}if(x>>>=M,y-=M,t.back+=M,64&B){e.msg="invalid distance code",t.mode=o;break}t.offset=k,t.extra=15&B,t.mode=24;case 24:if(t.extra){for(D=t.extra;y>>=t.extra,y-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=o;break}t.mode=25;case 25:if(0===m)break e;if(I=_-m,t.offset>I){if((I=t.offset-I)>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=o;break}I>t.wnext?(I-=t.wnext,E=t.wsize-I):E=t.wnext-I,I>t.length&&(I=t.length),C=t.window}else C=u,E=p-t.offset,I=t.length;I>m&&(I=m),m-=I,t.length-=I;do{u[p++]=C[E++]}while(--I);0===t.length&&(t.mode=21);break;case 26:if(0===m)break e;u[p++]=t.length,m--,t.mode=21;break;case 27:if(t.wrap){for(;y<32;){if(0===g)break e;g--,x|=l[h++]<{"use strict";var c=t(9805),f=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],d=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],r=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],n=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(e,a,t,i,b,o,s,l){var u,h,p,g,m,x,y,A,v,w=l.bits,_=0,I=0,E=0,C=0,M=0,B=0,k=0,L=0,S=0,T=0,N=null,R=0,P=new c.Buf16(16),D=new c.Buf16(16),O=null,F=0;for(_=0;_<=15;_++)P[_]=0;for(I=0;I=1&&0===P[C];C--);if(M>C&&(M=C),0===C)return b[o++]=20971520,b[o++]=20971520,l.bits=1,0;for(E=1;E0&&(0===e||1!==C))return-1;for(D[1]=0,_=1;_<15;_++)D[_+1]=D[_]+P[_];for(I=0;I852||2===e&&S>592)return 1;for(;;){y=_-k,s[I]x?(A=O[F+s[I]],v=N[R+s[I]]):(A=96,v=0),u=1<<_-k,E=h=1<>k)+(h-=u)]=y<<24|A<<16|v}while(0!==h);for(u=1<<_-1;T&u;)u>>=1;if(0!==u?(T&=u-1,T+=u):T=0,I++,0==--P[_]){if(_===C)break;_=a[t+s[I]]}if(_>M&&(T&g)!==p){for(0===k&&(k=M),m+=E,L=1<<(B=_-k);B+k852||2===e&&S>592)return 1;b[p=T&g]=M<<24|B<<16|m-o}}return 0!==T&&(b[m+T]=_-k<<24|64<<16),l.bits=M,0}},54674:e=>{"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},23665:(e,a,t)=>{"use strict";var c=t(9805);function f(e){for(var a=e.length;--a>=0;)e[a]=0}var d=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],r=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],i=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],b=new Array(576);f(b);var o=new Array(60);f(o);var s=new Array(512);f(s);var l=new Array(256);f(l);var u=new Array(29);f(u);var h,p,g,m=new Array(30);function x(e,a,t,c,f){this.static_tree=e,this.extra_bits=a,this.extra_base=t,this.elems=c,this.max_length=f,this.has_stree=e&&e.length}function y(e,a){this.dyn_tree=e,this.max_code=0,this.stat_desc=a}function A(e){return e<256?s[e]:s[256+(e>>>7)]}function v(e,a){e.pending_buf[e.pending++]=255&a,e.pending_buf[e.pending++]=a>>>8&255}function w(e,a,t){e.bi_valid>16-t?(e.bi_buf|=a<>16-e.bi_valid,e.bi_valid+=t-16):(e.bi_buf|=a<>>=1,t<<=1}while(--a>0);return t>>>1}function E(e,a,t){var c,f,d=new Array(16),r=0;for(c=1;c<=15;c++)d[c]=r=r+t[c-1]<<1;for(f=0;f<=a;f++){var n=e[2*f+1];0!==n&&(e[2*f]=I(d[n]++,n))}}function C(e){var a;for(a=0;a<286;a++)e.dyn_ltree[2*a]=0;for(a=0;a<30;a++)e.dyn_dtree[2*a]=0;for(a=0;a<19;a++)e.bl_tree[2*a]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function M(e){e.bi_valid>8?v(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function B(e,a,t,c){var f=2*a,d=2*t;return e[f]>1;t>=1;t--)k(e,d,t);f=i;do{t=e.heap[1],e.heap[1]=e.heap[e.heap_len--],k(e,d,1),c=e.heap[1],e.heap[--e.heap_max]=t,e.heap[--e.heap_max]=c,d[2*f]=d[2*t]+d[2*c],e.depth[f]=(e.depth[t]>=e.depth[c]?e.depth[t]:e.depth[c])+1,d[2*t+1]=d[2*c+1]=f,e.heap[1]=f++,k(e,d,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,a){var t,c,f,d,r,n,i=a.dyn_tree,b=a.max_code,o=a.stat_desc.static_tree,s=a.stat_desc.has_stree,l=a.stat_desc.extra_bits,u=a.stat_desc.extra_base,h=a.stat_desc.max_length,p=0;for(d=0;d<=15;d++)e.bl_count[d]=0;for(i[2*e.heap[e.heap_max]+1]=0,t=e.heap_max+1;t<573;t++)(d=i[2*i[2*(c=e.heap[t])+1]+1]+1)>h&&(d=h,p++),i[2*c+1]=d,c>b||(e.bl_count[d]++,r=0,c>=u&&(r=l[c-u]),n=i[2*c],e.opt_len+=n*(d+r),s&&(e.static_len+=n*(o[2*c+1]+r)));if(0!==p){do{for(d=h-1;0===e.bl_count[d];)d--;e.bl_count[d]--,e.bl_count[d+1]+=2,e.bl_count[h]--,p-=2}while(p>0);for(d=h;0!==d;d--)for(c=e.bl_count[d];0!==c;)(f=e.heap[--t])>b||(i[2*f+1]!==d&&(e.opt_len+=(d-i[2*f+1])*i[2*f],i[2*f+1]=d),c--)}}(e,a),E(d,b,e.bl_count)}function T(e,a,t){var c,f,d=-1,r=a[1],n=0,i=7,b=4;for(0===r&&(i=138,b=3),a[2*(t+1)+1]=65535,c=0;c<=t;c++)f=r,r=a[2*(c+1)+1],++n>=7;c<30;c++)for(m[c]=f<<7,e=0;e<1<0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var a,t=4093624447;for(a=0;a<=31;a++,t>>>=1)if(1&t&&0!==e.dyn_ltree[2*a])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(a=32;a<256;a++)if(0!==e.dyn_ltree[2*a])return 1;return 0}(e)),S(e,e.l_desc),S(e,e.d_desc),r=function(e){var a;for(T(e,e.dyn_ltree,e.l_desc.max_code),T(e,e.dyn_dtree,e.d_desc.max_code),S(e,e.bl_desc),a=18;a>=3&&0===e.bl_tree[2*i[a]+1];a--);return e.opt_len+=3*(a+1)+5+5+4,a}(e),f=e.opt_len+3+7>>>3,(d=e.static_len+3+7>>>3)<=f&&(f=d)):f=d=t+5,t+4<=f&&-1!==a?P(e,a,t,c):4===e.strategy||d===f?(w(e,2+(c?1:0),3),L(e,b,o)):(w(e,4+(c?1:0),3),function(e,a,t,c){var f;for(w(e,a-257,5),w(e,t-1,5),w(e,c-4,4),f=0;f>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&a,e.pending_buf[e.l_buf+e.last_lit]=255&t,e.last_lit++,0===a?e.dyn_ltree[2*t]++:(e.matches++,a--,e.dyn_ltree[2*(l[t]+256+1)]++,e.dyn_dtree[2*A(a)]++),e.last_lit===e.lit_bufsize-1},a._tr_align=function(e){w(e,2,3),_(e,256,b),function(e){16===e.bi_valid?(v(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},44442:e=>{"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},21137:(e,a,t)=>{"use strict";var c=t(87568);a.certificate=t(36413);var f=c.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));a.RSAPrivateKey=f;var d=c.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));a.RSAPublicKey=d;var r=c.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),n=c.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(r),this.key("subjectPublicKey").bitstr())}));a.PublicKey=n;var i=c.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(r),this.key("subjectPrivateKey").octstr())}));a.PrivateKey=i;var b=c.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));a.EncryptedPrivateKey=b;var o=c.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));a.DSAPrivateKey=o,a.DSAparam=c.define("DSAparam",(function(){this.int()}));var s=c.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})})),l=c.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(s),this.key("publicKey").optional().explicit(1).bitstr())}));a.ECPrivateKey=l,a.signature=c.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},36413:(e,a,t)=>{"use strict";var c=t(87568),f=c.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),d=c.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),r=c.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),n=c.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(r),this.key("subjectPublicKey").bitstr())})),i=c.define("RelativeDistinguishedName",(function(){this.setof(d)})),b=c.define("RDNSequence",(function(){this.seqof(i)})),o=c.define("Name",(function(){this.choice({rdnSequence:this.use(b)})})),s=c.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(f),this.key("notAfter").use(f))})),l=c.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),u=c.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(r),this.key("issuer").use(o),this.key("validity").use(s),this.key("subject").use(o),this.key("subjectPublicKeyInfo").use(n),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(l).optional())})),h=c.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(u),this.key("signatureAlgorithm").use(r),this.key("signatureValue").bitstr())}));e.exports=h},24101:(e,a,t)=>{"use strict";var c=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,f=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,d=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,r=t(68078),n=t(1241),i=t(92861).Buffer;e.exports=function(e,a){var t,b=e.toString(),o=b.match(c);if(o){var s="aes"+o[1],l=i.from(o[2],"hex"),u=i.from(o[3].replace(/[\r\n]/g,""),"base64"),h=r(a,l.slice(0,8),parseInt(o[1],10)).key,p=[],g=n.createDecipheriv(s,h,l);p.push(g.update(u)),p.push(g.final()),t=i.concat(p)}else{var m=b.match(d);t=i.from(m[2].replace(/[\r\n]/g,""),"base64")}return{tag:b.match(f)[1],data:t}}},78170:(e,a,t)=>{"use strict";var c=t(21137),f=t(15579),d=t(24101),r=t(1241),n=t(78396),i=t(92861).Buffer;function b(e){var a;"object"!=typeof e||i.isBuffer(e)||(a=e.passphrase,e=e.key),"string"==typeof e&&(e=i.from(e));var t,b,o=d(e,a),s=o.tag,l=o.data;switch(s){case"CERTIFICATE":b=c.certificate.decode(l,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(b||(b=c.PublicKey.decode(l,"der")),t=b.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return c.RSAPublicKey.decode(b.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return b.subjectPrivateKey=b.subjectPublicKey,{type:"ec",data:b};case"1.2.840.10040.4.1":return b.algorithm.params.pub_key=c.DSAparam.decode(b.subjectPublicKey.data,"der"),{type:"dsa",data:b.algorithm.params};default:throw new Error("unknown key id "+t)}case"ENCRYPTED PRIVATE KEY":l=function(e,a){var t=e.algorithm.decrypt.kde.kdeparams.salt,c=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),d=f[e.algorithm.decrypt.cipher.algo.join(".")],b=e.algorithm.decrypt.cipher.iv,o=e.subjectPrivateKey,s=parseInt(d.split("-")[1],10)/8,l=n.pbkdf2Sync(a,t,c,s,"sha1"),u=r.createDecipheriv(d,l,b),h=[];return h.push(u.update(o)),h.push(u.final()),i.concat(h)}(l=c.EncryptedPrivateKey.decode(l,"der"),a);case"PRIVATE KEY":switch(t=(b=c.PrivateKey.decode(l,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return c.RSAPrivateKey.decode(b.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:b.algorithm.curve,privateKey:c.ECPrivateKey.decode(b.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return b.algorithm.params.priv_key=c.DSAparam.decode(b.subjectPrivateKey,"der"),{type:"dsa",params:b.algorithm.params};default:throw new Error("unknown key id "+t)}case"RSA PUBLIC KEY":return c.RSAPublicKey.decode(l,"der");case"RSA PRIVATE KEY":return c.RSAPrivateKey.decode(l,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:c.DSAPrivateKey.decode(l,"der")};case"EC PRIVATE KEY":return{curve:(l=c.ECPrivateKey.decode(l,"der")).parameters.value,privateKey:l.privateKey};default:throw new Error("unknown key type "+s)}}b.signature=c.signature,e.exports=b},78396:(e,a,t)=>{a.pbkdf2=t(43832),a.pbkdf2Sync=t(21352)},43832:(e,a,t)=>{var c,f,d=t(92861).Buffer,r=t(64196),n=t(2455),i=t(21352),b=t(93382),o=t.g.crypto&&t.g.crypto.subtle,s={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},l=[];function u(){return f||(f=t.g.process&&t.g.process.nextTick?t.g.process.nextTick:t.g.queueMicrotask?t.g.queueMicrotask:t.g.setImmediate?t.g.setImmediate:t.g.setTimeout)}function h(e,a,t,c,f){return o.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then((function(e){return o.deriveBits({name:"PBKDF2",salt:a,iterations:t,hash:{name:f}},e,c<<3)})).then((function(e){return d.from(e)}))}e.exports=function(e,a,f,p,g,m){"function"==typeof g&&(m=g,g=void 0);var x=s[(g=g||"sha1").toLowerCase()];if(x&&"function"==typeof t.g.Promise){if(r(f,p),e=b(e,n,"Password"),a=b(a,n,"Salt"),"function"!=typeof m)throw new Error("No callback provided to pbkdf2");!function(e,a){e.then((function(e){u()((function(){a(null,e)}))}),(function(e){u()((function(){a(e)}))}))}(function(e){if(t.g.process&&!t.g.process.browser)return Promise.resolve(!1);if(!o||!o.importKey||!o.deriveBits)return Promise.resolve(!1);if(void 0!==l[e])return l[e];var a=h(c=c||d.alloc(8),c,10,128,e).then((function(){return!0})).catch((function(){return!1}));return l[e]=a,a}(x).then((function(t){return t?h(e,a,f,p,x):i(e,a,f,p,g)})),m)}else u()((function(){var t;try{t=i(e,a,f,p,g)}catch(e){return m(e)}m(null,t)}))}},2455:(e,a,t)=>{var c;c=t.g.process&&t.g.process.browser?"utf-8":t.g.process&&t.g.process.version?parseInt(process.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary":"utf-8",e.exports=c},64196:e=>{var a=Math.pow(2,30)-1;e.exports=function(e,t){if("number"!=typeof e)throw new TypeError("Iterations not a number");if(e<0)throw new TypeError("Bad iterations");if("number"!=typeof t)throw new TypeError("Key length not a number");if(t<0||t>a||t!=t)throw new TypeError("Bad key length")}},21352:(e,a,t)=>{var c=t(20320),f=t(66011),d=t(62802),r=t(92861).Buffer,n=t(64196),i=t(2455),b=t(93382),o=r.alloc(128),s={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function l(e,a,t){var n=function(e){return"rmd160"===e||"ripemd160"===e?function(e){return(new f).update(e).digest()}:"md5"===e?c:function(a){return d(e).update(a).digest()}}(e),i="sha512"===e||"sha384"===e?128:64;a.length>i?a=n(a):a.length{var c=t(92861).Buffer;e.exports=function(e,a,t){if(c.isBuffer(e))return e;if("string"==typeof e)return c.from(e,a);if(ArrayBuffer.isView(e))return c.from(e.buffer);throw new TypeError(t+" must be a string, a Buffer, a typed array or a DataView")}},71843:(e,a,t)=>{"use strict";const{ErrorWithCause:c}=t(75832),{findCauseByReference:f,getErrorCause:d,messageWithCauses:r,stackWithCauses:n}=t(94306);e.exports={ErrorWithCause:c,findCauseByReference:f,getErrorCause:d,stackWithCauses:n,messageWithCauses:r}},75832:e=>{"use strict";class a extends Error{constructor(e,{cause:t}={}){super(e),this.name=a.name,t&&(this.cause=t),this.message=e}}e.exports={ErrorWithCause:a}},94306:e=>{"use strict";const a=e=>{if(e&&"object"==typeof e&&"cause"in e){if("function"==typeof e.cause){const a=e.cause();return a instanceof Error?a:void 0}return e.cause instanceof Error?e.cause:void 0}},t=(e,c)=>{if(!(e instanceof Error))return"";const f=e.stack||"";if(c.has(e))return f+"\ncauses have become circular...";const d=a(e);return d?(c.add(e),f+"\ncaused by: "+t(d,c)):f},c=(e,t,f)=>{if(!(e instanceof Error))return"";const d=f?"":e.message||"";if(t.has(e))return d+": ...";const r=a(e);if(r){t.add(e);const a="cause"in e&&"function"==typeof e.cause;return d+(a?"":": ")+c(r,t,a)}return d};e.exports={findCauseByReference:(e,t)=>{if(!e||!t)return;if(!(e instanceof Error))return;if(!(t.prototype instanceof Error)&&t!==Error)return;const c=new Set;let f=e;for(;f&&!c.has(f);){if(c.add(f),f instanceof t)return f;f=a(f)}},getErrorCause:a,stackWithCauses:e=>t(e,new Set),messageWithCauses:e=>c(e,new Set)}},76578:e=>{"use strict";e.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},33225:e=>{"use strict";"undefined"==typeof process||!process.version||0===process.version.indexOf("v0.")||0===process.version.indexOf("v1.")&&0!==process.version.indexOf("v1.8.")?e.exports={nextTick:function(e,a,t,c){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var f,d,r=arguments.length;switch(r){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick((function(){e.call(null,a)}));case 3:return process.nextTick((function(){e.call(null,a,t)}));case 4:return process.nextTick((function(){e.call(null,a,t,c)}));default:for(f=new Array(r-1),d=0;d{a.publicEncrypt=t(28902),a.privateDecrypt=t(77362),a.privateEncrypt=function(e,t){return a.publicEncrypt(e,t,!0)},a.publicDecrypt=function(e,t){return a.privateDecrypt(e,t,!0)}},48206:(e,a,t)=>{var c=t(47108),f=t(92861).Buffer;function d(e){var a=f.allocUnsafe(4);return a.writeUInt32BE(e,0),a}e.exports=function(e,a){for(var t,r=f.alloc(0),n=0;r.length=65&&t<=70?t-55:t>=97&&t<=102?t-87:t-48&15}function i(e,a,t){var c=n(e,t);return t-1>=a&&(c|=n(e,t-1)<<4),c}function b(e,a,t,c){for(var f=0,d=Math.min(e.length,t),r=a;r=49?n-49+10:n>=17?n-17+10:n}return f}d.isBN=function(e){return e instanceof d||null!==e&&"object"==typeof e&&e.constructor.wordSize===d.wordSize&&Array.isArray(e.words)},d.max=function(e,a){return e.cmp(a)>0?e:a},d.min=function(e,a){return e.cmp(a)<0?e:a},d.prototype._init=function(e,a,t){if("number"==typeof e)return this._initNumber(e,a,t);if("object"==typeof e)return this._initArray(e,a,t);"hex"===a&&(a=16),c(a===(0|a)&&a>=2&&a<=36);var f=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(f++,this.negative=1),f=0;f-=3)r=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[d]|=r<>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);else if("le"===t)for(f=0,d=0;f>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);return this.strip()},d.prototype._parseHex=function(e,a,t){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)f=i(e,a,c)<=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;else for(c=(e.length-a)%2==0?a+1:a;c=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;this.strip()},d.prototype._parseBase=function(e,a,t){this.words=[0],this.length=1;for(var c=0,f=1;f<=67108863;f*=a)c++;c--,f=f/a|0;for(var d=e.length-t,r=d%c,n=Math.min(d,d-r)+t,i=0,o=t;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},d.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},d.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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],l=[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 u(e,a,t){t.negative=a.negative^e.negative;var c=e.length+a.length|0;t.length=c,c=c-1|0;var f=0|e.words[0],d=0|a.words[0],r=f*d,n=67108863&r,i=r/67108864|0;t.words[0]=n;for(var b=1;b>>26,s=67108863&i,l=Math.min(b,a.length-1),u=Math.max(0,b-e.length+1);u<=l;u++){var h=b-u|0;o+=(r=(f=0|e.words[h])*(d=0|a.words[u])+s)/67108864|0,s=67108863&r}t.words[b]=0|s,i=0|o}return 0!==i?t.words[b]=0|i:t.length--,t.strip()}d.prototype.toString=function(e,a){var t;if(a=0|a||1,16===(e=e||10)||"hex"===e){t="";for(var f=0,d=0,r=0;r>>24-f&16777215)||r!==this.length-1?o[6-i.length]+i+t:i+t,(f+=2)>=26&&(f-=26,r--)}for(0!==d&&(t=d.toString(16)+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(e===(0|e)&&e>=2&&e<=36){var b=s[e],u=l[e];t="";var h=this.clone();for(h.negative=0;!h.isZero();){var p=h.modn(u).toString(e);t=(h=h.idivn(u)).isZero()?p+t:o[b-p.length]+p+t}for(this.isZero()&&(t="0"+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}c(!1,"Base should be between 2 and 36")},d.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&c(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},d.prototype.toJSON=function(){return this.toString(16)},d.prototype.toBuffer=function(e,a){return c(void 0!==r),this.toArrayLike(r,e,a)},d.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},d.prototype.toArrayLike=function(e,a,t){var f=this.byteLength(),d=t||Math.max(1,f);c(f<=d,"byte array longer than desired length"),c(d>0,"Requested array length <= 0"),this.strip();var r,n,i="le"===a,b=new e(d),o=this.clone();if(i){for(n=0;!o.isZero();n++)r=o.andln(255),o.iushrn(8),b[n]=r;for(;n=4096&&(t+=13,a>>>=13),a>=64&&(t+=7,a>>>=7),a>=8&&(t+=4,a>>>=4),a>=2&&(t+=2,a>>>=2),t+a},d.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,t=0;return 8191&a||(t+=13,a>>>=13),127&a||(t+=7,a>>>=7),15&a||(t+=4,a>>>=4),3&a||(t+=2,a>>>=2),1&a||t++,t},d.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},d.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},d.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},d.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var t=0;te.length?this.clone().iand(e):e.clone().iand(this)},d.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},d.prototype.iuxor=function(e){var a,t;this.length>e.length?(a=this,t=e):(a=e,t=this);for(var c=0;ce.length?this.clone().ixor(e):e.clone().ixor(this)},d.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},d.prototype.inotn=function(e){c("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),t=e%26;this._expand(a),t>0&&a--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-t),this.strip()},d.prototype.notn=function(e){return this.clone().inotn(e)},d.prototype.setn=function(e,a){c("number"==typeof e&&e>=0);var t=e/26|0,f=e%26;return this._expand(t+1),this.words[t]=a?this.words[t]|1<e.length?(t=this,c=e):(t=e,c=this);for(var f=0,d=0;d>>26;for(;0!==f&&d>>26;if(this.length=t.length,0!==f)this.words[this.length]=f,this.length++;else if(t!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},d.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var t,c,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(t=this,c=e):(t=e,c=this);for(var d=0,r=0;r>26,this.words[r]=67108863&a;for(;0!==d&&r>26,this.words[r]=67108863&a;if(0===d&&r>>13,u=0|r[1],h=8191&u,p=u>>>13,g=0|r[2],m=8191&g,x=g>>>13,y=0|r[3],A=8191&y,v=y>>>13,w=0|r[4],_=8191&w,I=w>>>13,E=0|r[5],C=8191&E,M=E>>>13,B=0|r[6],k=8191&B,L=B>>>13,S=0|r[7],T=8191&S,N=S>>>13,R=0|r[8],P=8191&R,D=R>>>13,O=0|r[9],F=8191&O,Q=O>>>13,U=0|n[0],j=8191&U,H=U>>>13,q=0|n[1],$=8191&q,z=q>>>13,G=0|n[2],K=8191&G,V=G>>>13,Z=0|n[3],J=8191&Z,W=Z>>>13,Y=0|n[4],X=8191&Y,ee=Y>>>13,ae=0|n[5],te=8191&ae,ce=ae>>>13,fe=0|n[6],de=8191&fe,re=fe>>>13,ne=0|n[7],ie=8191&ne,be=ne>>>13,oe=0|n[8],se=8191&oe,le=oe>>>13,ue=0|n[9],he=8191&ue,pe=ue>>>13;t.negative=e.negative^a.negative,t.length=19;var ge=(b+(c=Math.imul(s,j))|0)+((8191&(f=(f=Math.imul(s,H))+Math.imul(l,j)|0))<<13)|0;b=((d=Math.imul(l,H))+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,c=Math.imul(h,j),f=(f=Math.imul(h,H))+Math.imul(p,j)|0,d=Math.imul(p,H);var me=(b+(c=c+Math.imul(s,$)|0)|0)+((8191&(f=(f=f+Math.imul(s,z)|0)+Math.imul(l,$)|0))<<13)|0;b=((d=d+Math.imul(l,z)|0)+(f>>>13)|0)+(me>>>26)|0,me&=67108863,c=Math.imul(m,j),f=(f=Math.imul(m,H))+Math.imul(x,j)|0,d=Math.imul(x,H),c=c+Math.imul(h,$)|0,f=(f=f+Math.imul(h,z)|0)+Math.imul(p,$)|0,d=d+Math.imul(p,z)|0;var xe=(b+(c=c+Math.imul(s,K)|0)|0)+((8191&(f=(f=f+Math.imul(s,V)|0)+Math.imul(l,K)|0))<<13)|0;b=((d=d+Math.imul(l,V)|0)+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,c=Math.imul(A,j),f=(f=Math.imul(A,H))+Math.imul(v,j)|0,d=Math.imul(v,H),c=c+Math.imul(m,$)|0,f=(f=f+Math.imul(m,z)|0)+Math.imul(x,$)|0,d=d+Math.imul(x,z)|0,c=c+Math.imul(h,K)|0,f=(f=f+Math.imul(h,V)|0)+Math.imul(p,K)|0,d=d+Math.imul(p,V)|0;var ye=(b+(c=c+Math.imul(s,J)|0)|0)+((8191&(f=(f=f+Math.imul(s,W)|0)+Math.imul(l,J)|0))<<13)|0;b=((d=d+Math.imul(l,W)|0)+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,c=Math.imul(_,j),f=(f=Math.imul(_,H))+Math.imul(I,j)|0,d=Math.imul(I,H),c=c+Math.imul(A,$)|0,f=(f=f+Math.imul(A,z)|0)+Math.imul(v,$)|0,d=d+Math.imul(v,z)|0,c=c+Math.imul(m,K)|0,f=(f=f+Math.imul(m,V)|0)+Math.imul(x,K)|0,d=d+Math.imul(x,V)|0,c=c+Math.imul(h,J)|0,f=(f=f+Math.imul(h,W)|0)+Math.imul(p,J)|0,d=d+Math.imul(p,W)|0;var Ae=(b+(c=c+Math.imul(s,X)|0)|0)+((8191&(f=(f=f+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;b=((d=d+Math.imul(l,ee)|0)+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,c=Math.imul(C,j),f=(f=Math.imul(C,H))+Math.imul(M,j)|0,d=Math.imul(M,H),c=c+Math.imul(_,$)|0,f=(f=f+Math.imul(_,z)|0)+Math.imul(I,$)|0,d=d+Math.imul(I,z)|0,c=c+Math.imul(A,K)|0,f=(f=f+Math.imul(A,V)|0)+Math.imul(v,K)|0,d=d+Math.imul(v,V)|0,c=c+Math.imul(m,J)|0,f=(f=f+Math.imul(m,W)|0)+Math.imul(x,J)|0,d=d+Math.imul(x,W)|0,c=c+Math.imul(h,X)|0,f=(f=f+Math.imul(h,ee)|0)+Math.imul(p,X)|0,d=d+Math.imul(p,ee)|0;var ve=(b+(c=c+Math.imul(s,te)|0)|0)+((8191&(f=(f=f+Math.imul(s,ce)|0)+Math.imul(l,te)|0))<<13)|0;b=((d=d+Math.imul(l,ce)|0)+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,c=Math.imul(k,j),f=(f=Math.imul(k,H))+Math.imul(L,j)|0,d=Math.imul(L,H),c=c+Math.imul(C,$)|0,f=(f=f+Math.imul(C,z)|0)+Math.imul(M,$)|0,d=d+Math.imul(M,z)|0,c=c+Math.imul(_,K)|0,f=(f=f+Math.imul(_,V)|0)+Math.imul(I,K)|0,d=d+Math.imul(I,V)|0,c=c+Math.imul(A,J)|0,f=(f=f+Math.imul(A,W)|0)+Math.imul(v,J)|0,d=d+Math.imul(v,W)|0,c=c+Math.imul(m,X)|0,f=(f=f+Math.imul(m,ee)|0)+Math.imul(x,X)|0,d=d+Math.imul(x,ee)|0,c=c+Math.imul(h,te)|0,f=(f=f+Math.imul(h,ce)|0)+Math.imul(p,te)|0,d=d+Math.imul(p,ce)|0;var we=(b+(c=c+Math.imul(s,de)|0)|0)+((8191&(f=(f=f+Math.imul(s,re)|0)+Math.imul(l,de)|0))<<13)|0;b=((d=d+Math.imul(l,re)|0)+(f>>>13)|0)+(we>>>26)|0,we&=67108863,c=Math.imul(T,j),f=(f=Math.imul(T,H))+Math.imul(N,j)|0,d=Math.imul(N,H),c=c+Math.imul(k,$)|0,f=(f=f+Math.imul(k,z)|0)+Math.imul(L,$)|0,d=d+Math.imul(L,z)|0,c=c+Math.imul(C,K)|0,f=(f=f+Math.imul(C,V)|0)+Math.imul(M,K)|0,d=d+Math.imul(M,V)|0,c=c+Math.imul(_,J)|0,f=(f=f+Math.imul(_,W)|0)+Math.imul(I,J)|0,d=d+Math.imul(I,W)|0,c=c+Math.imul(A,X)|0,f=(f=f+Math.imul(A,ee)|0)+Math.imul(v,X)|0,d=d+Math.imul(v,ee)|0,c=c+Math.imul(m,te)|0,f=(f=f+Math.imul(m,ce)|0)+Math.imul(x,te)|0,d=d+Math.imul(x,ce)|0,c=c+Math.imul(h,de)|0,f=(f=f+Math.imul(h,re)|0)+Math.imul(p,de)|0,d=d+Math.imul(p,re)|0;var _e=(b+(c=c+Math.imul(s,ie)|0)|0)+((8191&(f=(f=f+Math.imul(s,be)|0)+Math.imul(l,ie)|0))<<13)|0;b=((d=d+Math.imul(l,be)|0)+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,c=Math.imul(P,j),f=(f=Math.imul(P,H))+Math.imul(D,j)|0,d=Math.imul(D,H),c=c+Math.imul(T,$)|0,f=(f=f+Math.imul(T,z)|0)+Math.imul(N,$)|0,d=d+Math.imul(N,z)|0,c=c+Math.imul(k,K)|0,f=(f=f+Math.imul(k,V)|0)+Math.imul(L,K)|0,d=d+Math.imul(L,V)|0,c=c+Math.imul(C,J)|0,f=(f=f+Math.imul(C,W)|0)+Math.imul(M,J)|0,d=d+Math.imul(M,W)|0,c=c+Math.imul(_,X)|0,f=(f=f+Math.imul(_,ee)|0)+Math.imul(I,X)|0,d=d+Math.imul(I,ee)|0,c=c+Math.imul(A,te)|0,f=(f=f+Math.imul(A,ce)|0)+Math.imul(v,te)|0,d=d+Math.imul(v,ce)|0,c=c+Math.imul(m,de)|0,f=(f=f+Math.imul(m,re)|0)+Math.imul(x,de)|0,d=d+Math.imul(x,re)|0,c=c+Math.imul(h,ie)|0,f=(f=f+Math.imul(h,be)|0)+Math.imul(p,ie)|0,d=d+Math.imul(p,be)|0;var Ie=(b+(c=c+Math.imul(s,se)|0)|0)+((8191&(f=(f=f+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;b=((d=d+Math.imul(l,le)|0)+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,c=Math.imul(F,j),f=(f=Math.imul(F,H))+Math.imul(Q,j)|0,d=Math.imul(Q,H),c=c+Math.imul(P,$)|0,f=(f=f+Math.imul(P,z)|0)+Math.imul(D,$)|0,d=d+Math.imul(D,z)|0,c=c+Math.imul(T,K)|0,f=(f=f+Math.imul(T,V)|0)+Math.imul(N,K)|0,d=d+Math.imul(N,V)|0,c=c+Math.imul(k,J)|0,f=(f=f+Math.imul(k,W)|0)+Math.imul(L,J)|0,d=d+Math.imul(L,W)|0,c=c+Math.imul(C,X)|0,f=(f=f+Math.imul(C,ee)|0)+Math.imul(M,X)|0,d=d+Math.imul(M,ee)|0,c=c+Math.imul(_,te)|0,f=(f=f+Math.imul(_,ce)|0)+Math.imul(I,te)|0,d=d+Math.imul(I,ce)|0,c=c+Math.imul(A,de)|0,f=(f=f+Math.imul(A,re)|0)+Math.imul(v,de)|0,d=d+Math.imul(v,re)|0,c=c+Math.imul(m,ie)|0,f=(f=f+Math.imul(m,be)|0)+Math.imul(x,ie)|0,d=d+Math.imul(x,be)|0,c=c+Math.imul(h,se)|0,f=(f=f+Math.imul(h,le)|0)+Math.imul(p,se)|0,d=d+Math.imul(p,le)|0;var Ee=(b+(c=c+Math.imul(s,he)|0)|0)+((8191&(f=(f=f+Math.imul(s,pe)|0)+Math.imul(l,he)|0))<<13)|0;b=((d=d+Math.imul(l,pe)|0)+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,c=Math.imul(F,$),f=(f=Math.imul(F,z))+Math.imul(Q,$)|0,d=Math.imul(Q,z),c=c+Math.imul(P,K)|0,f=(f=f+Math.imul(P,V)|0)+Math.imul(D,K)|0,d=d+Math.imul(D,V)|0,c=c+Math.imul(T,J)|0,f=(f=f+Math.imul(T,W)|0)+Math.imul(N,J)|0,d=d+Math.imul(N,W)|0,c=c+Math.imul(k,X)|0,f=(f=f+Math.imul(k,ee)|0)+Math.imul(L,X)|0,d=d+Math.imul(L,ee)|0,c=c+Math.imul(C,te)|0,f=(f=f+Math.imul(C,ce)|0)+Math.imul(M,te)|0,d=d+Math.imul(M,ce)|0,c=c+Math.imul(_,de)|0,f=(f=f+Math.imul(_,re)|0)+Math.imul(I,de)|0,d=d+Math.imul(I,re)|0,c=c+Math.imul(A,ie)|0,f=(f=f+Math.imul(A,be)|0)+Math.imul(v,ie)|0,d=d+Math.imul(v,be)|0,c=c+Math.imul(m,se)|0,f=(f=f+Math.imul(m,le)|0)+Math.imul(x,se)|0,d=d+Math.imul(x,le)|0;var Ce=(b+(c=c+Math.imul(h,he)|0)|0)+((8191&(f=(f=f+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;b=((d=d+Math.imul(p,pe)|0)+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c=Math.imul(F,K),f=(f=Math.imul(F,V))+Math.imul(Q,K)|0,d=Math.imul(Q,V),c=c+Math.imul(P,J)|0,f=(f=f+Math.imul(P,W)|0)+Math.imul(D,J)|0,d=d+Math.imul(D,W)|0,c=c+Math.imul(T,X)|0,f=(f=f+Math.imul(T,ee)|0)+Math.imul(N,X)|0,d=d+Math.imul(N,ee)|0,c=c+Math.imul(k,te)|0,f=(f=f+Math.imul(k,ce)|0)+Math.imul(L,te)|0,d=d+Math.imul(L,ce)|0,c=c+Math.imul(C,de)|0,f=(f=f+Math.imul(C,re)|0)+Math.imul(M,de)|0,d=d+Math.imul(M,re)|0,c=c+Math.imul(_,ie)|0,f=(f=f+Math.imul(_,be)|0)+Math.imul(I,ie)|0,d=d+Math.imul(I,be)|0,c=c+Math.imul(A,se)|0,f=(f=f+Math.imul(A,le)|0)+Math.imul(v,se)|0,d=d+Math.imul(v,le)|0;var Me=(b+(c=c+Math.imul(m,he)|0)|0)+((8191&(f=(f=f+Math.imul(m,pe)|0)+Math.imul(x,he)|0))<<13)|0;b=((d=d+Math.imul(x,pe)|0)+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,c=Math.imul(F,J),f=(f=Math.imul(F,W))+Math.imul(Q,J)|0,d=Math.imul(Q,W),c=c+Math.imul(P,X)|0,f=(f=f+Math.imul(P,ee)|0)+Math.imul(D,X)|0,d=d+Math.imul(D,ee)|0,c=c+Math.imul(T,te)|0,f=(f=f+Math.imul(T,ce)|0)+Math.imul(N,te)|0,d=d+Math.imul(N,ce)|0,c=c+Math.imul(k,de)|0,f=(f=f+Math.imul(k,re)|0)+Math.imul(L,de)|0,d=d+Math.imul(L,re)|0,c=c+Math.imul(C,ie)|0,f=(f=f+Math.imul(C,be)|0)+Math.imul(M,ie)|0,d=d+Math.imul(M,be)|0,c=c+Math.imul(_,se)|0,f=(f=f+Math.imul(_,le)|0)+Math.imul(I,se)|0,d=d+Math.imul(I,le)|0;var Be=(b+(c=c+Math.imul(A,he)|0)|0)+((8191&(f=(f=f+Math.imul(A,pe)|0)+Math.imul(v,he)|0))<<13)|0;b=((d=d+Math.imul(v,pe)|0)+(f>>>13)|0)+(Be>>>26)|0,Be&=67108863,c=Math.imul(F,X),f=(f=Math.imul(F,ee))+Math.imul(Q,X)|0,d=Math.imul(Q,ee),c=c+Math.imul(P,te)|0,f=(f=f+Math.imul(P,ce)|0)+Math.imul(D,te)|0,d=d+Math.imul(D,ce)|0,c=c+Math.imul(T,de)|0,f=(f=f+Math.imul(T,re)|0)+Math.imul(N,de)|0,d=d+Math.imul(N,re)|0,c=c+Math.imul(k,ie)|0,f=(f=f+Math.imul(k,be)|0)+Math.imul(L,ie)|0,d=d+Math.imul(L,be)|0,c=c+Math.imul(C,se)|0,f=(f=f+Math.imul(C,le)|0)+Math.imul(M,se)|0,d=d+Math.imul(M,le)|0;var ke=(b+(c=c+Math.imul(_,he)|0)|0)+((8191&(f=(f=f+Math.imul(_,pe)|0)+Math.imul(I,he)|0))<<13)|0;b=((d=d+Math.imul(I,pe)|0)+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,c=Math.imul(F,te),f=(f=Math.imul(F,ce))+Math.imul(Q,te)|0,d=Math.imul(Q,ce),c=c+Math.imul(P,de)|0,f=(f=f+Math.imul(P,re)|0)+Math.imul(D,de)|0,d=d+Math.imul(D,re)|0,c=c+Math.imul(T,ie)|0,f=(f=f+Math.imul(T,be)|0)+Math.imul(N,ie)|0,d=d+Math.imul(N,be)|0,c=c+Math.imul(k,se)|0,f=(f=f+Math.imul(k,le)|0)+Math.imul(L,se)|0,d=d+Math.imul(L,le)|0;var Le=(b+(c=c+Math.imul(C,he)|0)|0)+((8191&(f=(f=f+Math.imul(C,pe)|0)+Math.imul(M,he)|0))<<13)|0;b=((d=d+Math.imul(M,pe)|0)+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,c=Math.imul(F,de),f=(f=Math.imul(F,re))+Math.imul(Q,de)|0,d=Math.imul(Q,re),c=c+Math.imul(P,ie)|0,f=(f=f+Math.imul(P,be)|0)+Math.imul(D,ie)|0,d=d+Math.imul(D,be)|0,c=c+Math.imul(T,se)|0,f=(f=f+Math.imul(T,le)|0)+Math.imul(N,se)|0,d=d+Math.imul(N,le)|0;var Se=(b+(c=c+Math.imul(k,he)|0)|0)+((8191&(f=(f=f+Math.imul(k,pe)|0)+Math.imul(L,he)|0))<<13)|0;b=((d=d+Math.imul(L,pe)|0)+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,c=Math.imul(F,ie),f=(f=Math.imul(F,be))+Math.imul(Q,ie)|0,d=Math.imul(Q,be),c=c+Math.imul(P,se)|0,f=(f=f+Math.imul(P,le)|0)+Math.imul(D,se)|0,d=d+Math.imul(D,le)|0;var Te=(b+(c=c+Math.imul(T,he)|0)|0)+((8191&(f=(f=f+Math.imul(T,pe)|0)+Math.imul(N,he)|0))<<13)|0;b=((d=d+Math.imul(N,pe)|0)+(f>>>13)|0)+(Te>>>26)|0,Te&=67108863,c=Math.imul(F,se),f=(f=Math.imul(F,le))+Math.imul(Q,se)|0,d=Math.imul(Q,le);var Ne=(b+(c=c+Math.imul(P,he)|0)|0)+((8191&(f=(f=f+Math.imul(P,pe)|0)+Math.imul(D,he)|0))<<13)|0;b=((d=d+Math.imul(D,pe)|0)+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Re=(b+(c=Math.imul(F,he))|0)+((8191&(f=(f=Math.imul(F,pe))+Math.imul(Q,he)|0))<<13)|0;return b=((d=Math.imul(Q,pe))+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,i[0]=ge,i[1]=me,i[2]=xe,i[3]=ye,i[4]=Ae,i[5]=ve,i[6]=we,i[7]=_e,i[8]=Ie,i[9]=Ee,i[10]=Ce,i[11]=Me,i[12]=Be,i[13]=ke,i[14]=Le,i[15]=Se,i[16]=Te,i[17]=Ne,i[18]=Re,0!==b&&(i[19]=b,t.length++),t};function p(e,a,t){return(new g).mulp(e,a,t)}function g(e,a){this.x=e,this.y=a}Math.imul||(h=u),d.prototype.mulTo=function(e,a){var t,c=this.length+e.length;return t=10===this.length&&10===e.length?h(this,e,a):c<63?u(this,e,a):c<1024?function(e,a,t){t.negative=a.negative^e.negative,t.length=e.length+a.length;for(var c=0,f=0,d=0;d>>26)|0)>>>26,r&=67108863}t.words[d]=n,c=r,r=f}return 0!==c?t.words[d]=c:t.length--,t.strip()}(this,e,a):p(this,e,a),t},g.prototype.makeRBT=function(e){for(var a=new Array(e),t=d.prototype._countBits(e)-1,c=0;c>=1;return c},g.prototype.permute=function(e,a,t,c,f,d){for(var r=0;r>>=1)f++;return 1<>>=13,t[2*r+1]=8191&d,d>>>=13;for(r=2*a;r>=26,a+=f/67108864|0,a+=d>>>26,this.words[t]=67108863&d}return 0!==a&&(this.words[t]=a,this.length++),this},d.prototype.muln=function(e){return this.clone().imuln(e)},d.prototype.sqr=function(){return this.mul(this)},d.prototype.isqr=function(){return this.imul(this.clone())},d.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),t=0;t>>f}return a}(e);if(0===a.length)return new d(1);for(var t=this,c=0;c=0);var a,t=e%26,f=(e-t)/26,d=67108863>>>26-t<<26-t;if(0!==t){var r=0;for(a=0;a>>26-t}r&&(this.words[a]=r,this.length++)}if(0!==f){for(a=this.length-1;a>=0;a--)this.words[a+f]=this.words[a];for(a=0;a=0),f=a?(a-a%26)/26:0;var d=e%26,r=Math.min((e-d)/26,this.length),n=67108863^67108863>>>d<r)for(this.length-=r,b=0;b=0&&(0!==o||b>=f);b--){var s=0|this.words[b];this.words[b]=o<<26-d|s>>>d,o=s&n}return i&&0!==o&&(i.words[i.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},d.prototype.ishrn=function(e,a,t){return c(0===this.negative),this.iushrn(e,a,t)},d.prototype.shln=function(e){return this.clone().ishln(e)},d.prototype.ushln=function(e){return this.clone().iushln(e)},d.prototype.shrn=function(e){return this.clone().ishrn(e)},d.prototype.ushrn=function(e){return this.clone().iushrn(e)},d.prototype.testn=function(e){c("number"==typeof e&&e>=0);var a=e%26,t=(e-a)/26,f=1<=0);var a=e%26,t=(e-a)/26;if(c(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==a&&t++,this.length=Math.min(t,this.length),0!==a){var f=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},d.prototype.isubn=function(e){if(c("number"==typeof e),c(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(i/67108864|0),this.words[f+t]=67108863&d}for(;f>26,this.words[f+t]=67108863&d;if(0===n)return this.strip();for(c(-1===n),n=0,f=0;f>26,this.words[f]=67108863&d;return this.negative=1,this.strip()},d.prototype._wordDiv=function(e,a){var t=(this.length,e.length),c=this.clone(),f=e,r=0|f.words[f.length-1];0!=(t=26-this._countBits(r))&&(f=f.ushln(t),c.iushln(t),r=0|f.words[f.length-1]);var n,i=c.length-f.length;if("mod"!==a){(n=new d(null)).length=i+1,n.words=new Array(n.length);for(var b=0;b=0;s--){var l=67108864*(0|c.words[f.length+s])+(0|c.words[f.length+s-1]);for(l=Math.min(l/r|0,67108863),c._ishlnsubmul(f,l,s);0!==c.negative;)l--,c.negative=0,c._ishlnsubmul(f,1,s),c.isZero()||(c.negative^=1);n&&(n.words[s]=l)}return n&&n.strip(),c.strip(),"div"!==a&&0!==t&&c.iushrn(t),{div:n||null,mod:c}},d.prototype.divmod=function(e,a,t){return c(!e.isZero()),this.isZero()?{div:new d(0),mod:new d(0)}:0!==this.negative&&0===e.negative?(n=this.neg().divmod(e,a),"mod"!==a&&(f=n.div.neg()),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.iadd(e)),{div:f,mod:r}):0===this.negative&&0!==e.negative?(n=this.divmod(e.neg(),a),"mod"!==a&&(f=n.div.neg()),{div:f,mod:n.mod}):this.negative&e.negative?(n=this.neg().divmod(e.neg(),a),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.isub(e)),{div:n.div,mod:r}):e.length>this.length||this.cmp(e)<0?{div:new d(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new d(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new d(this.modn(e.words[0]))}:this._wordDiv(e,a);var f,r,n},d.prototype.div=function(e){return this.divmod(e,"div",!1).div},d.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},d.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},d.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var t=0!==a.div.negative?a.mod.isub(e):a.mod,c=e.ushrn(1),f=e.andln(1),d=t.cmp(c);return d<0||1===f&&0===d?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},d.prototype.modn=function(e){c(e<=67108863);for(var a=(1<<26)%e,t=0,f=this.length-1;f>=0;f--)t=(a*t+(0|this.words[f]))%e;return t},d.prototype.idivn=function(e){c(e<=67108863);for(var a=0,t=this.length-1;t>=0;t--){var f=(0|this.words[t])+67108864*a;this.words[t]=f/e|0,a=f%e}return this.strip()},d.prototype.divn=function(e){return this.clone().idivn(e)},d.prototype.egcd=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f=new d(1),r=new d(0),n=new d(0),i=new d(1),b=0;a.isEven()&&t.isEven();)a.iushrn(1),t.iushrn(1),++b;for(var o=t.clone(),s=a.clone();!a.isZero();){for(var l=0,u=1;!(a.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(f.isOdd()||r.isOdd())&&(f.iadd(o),r.isub(s)),f.iushrn(1),r.iushrn(1);for(var h=0,p=1;!(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(o),i.isub(s)),n.iushrn(1),i.iushrn(1);a.cmp(t)>=0?(a.isub(t),f.isub(n),r.isub(i)):(t.isub(a),n.isub(f),i.isub(r))}return{a:n,b:i,gcd:t.iushln(b)}},d.prototype._invmp=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f,r=new d(1),n=new d(0),i=t.clone();a.cmpn(1)>0&&t.cmpn(1)>0;){for(var b=0,o=1;!(a.words[0]&o)&&b<26;++b,o<<=1);if(b>0)for(a.iushrn(b);b-- >0;)r.isOdd()&&r.iadd(i),r.iushrn(1);for(var s=0,l=1;!(t.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(t.iushrn(s);s-- >0;)n.isOdd()&&n.iadd(i),n.iushrn(1);a.cmp(t)>=0?(a.isub(t),r.isub(n)):(t.isub(a),n.isub(r))}return(f=0===a.cmpn(1)?r:n).cmpn(0)<0&&f.iadd(e),f},d.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),t=e.clone();a.negative=0,t.negative=0;for(var c=0;a.isEven()&&t.isEven();c++)a.iushrn(1),t.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;t.isEven();)t.iushrn(1);var f=a.cmp(t);if(f<0){var d=a;a=t,t=d}else if(0===f||0===t.cmpn(1))break;a.isub(t)}return t.iushln(c)},d.prototype.invm=function(e){return this.egcd(e).a.umod(e)},d.prototype.isEven=function(){return!(1&this.words[0])},d.prototype.isOdd=function(){return!(1&~this.words[0])},d.prototype.andln=function(e){return this.words[0]&e},d.prototype.bincn=function(e){c("number"==typeof e);var a=e%26,t=(e-a)/26,f=1<>>26,n&=67108863,this.words[r]=n}return 0!==d&&(this.words[r]=d,this.length++),this},d.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},d.prototype.cmpn=function(e){var a,t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)a=1;else{t&&(e=-e),c(e<=67108863,"Number is too big");var f=0|this.words[0];a=f===e?0:fe.length)return 1;if(this.length=0;t--){var c=0|this.words[t],f=0|e.words[t];if(c!==f){cf&&(a=1);break}}return a},d.prototype.gtn=function(e){return 1===this.cmpn(e)},d.prototype.gt=function(e){return 1===this.cmp(e)},d.prototype.gten=function(e){return this.cmpn(e)>=0},d.prototype.gte=function(e){return this.cmp(e)>=0},d.prototype.ltn=function(e){return-1===this.cmpn(e)},d.prototype.lt=function(e){return-1===this.cmp(e)},d.prototype.lten=function(e){return this.cmpn(e)<=0},d.prototype.lte=function(e){return this.cmp(e)<=0},d.prototype.eqn=function(e){return 0===this.cmpn(e)},d.prototype.eq=function(e){return 0===this.cmp(e)},d.red=function(e){return new _(e)},d.prototype.toRed=function(e){return c(!this.red,"Already a number in reduction context"),c(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},d.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},d.prototype._forceRed=function(e){return this.red=e,this},d.prototype.forceRed=function(e){return c(!this.red,"Already a number in reduction context"),this._forceRed(e)},d.prototype.redAdd=function(e){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},d.prototype.redIAdd=function(e){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},d.prototype.redSub=function(e){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},d.prototype.redISub=function(e){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},d.prototype.redShl=function(e){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},d.prototype.redMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},d.prototype.redIMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},d.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},d.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},d.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},d.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},d.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},d.prototype.redPow=function(e){return c(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function x(e,a){this.name=e,this.p=new d(a,16),this.n=this.p.bitLength(),this.k=new d(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var a=d._prime(e);this.m=a.p,this.prime=a}else c(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new d(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)}x.prototype._tmp=function(){var e=new d(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var a,t=e;do{this.split(t,this.tmp),a=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(a>this.n);var c=a0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},x.prototype.split=function(e,a){e.iushrn(this.n,0,a)},x.prototype.imulK=function(e){return e.imul(this.k)},f(y,x),y.prototype.split=function(e,a){for(var t=4194303,c=Math.min(e.length,9),f=0;f>>22,d=r}d>>>=22,e.words[f-10]=d,0===d&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,t=0;t>>=26,e.words[t]=f,a=c}return 0!==a&&(e.words[e.length++]=a),e},d._prime=function(e){if(m[e])return m[e];var a;if("k256"===e)a=new y;else if("p224"===e)a=new A;else if("p192"===e)a=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new w}return m[e]=a,a},_.prototype._verify1=function(e){c(0===e.negative,"red works only with positives"),c(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,a){c(!(e.negative|a.negative),"red works only with positives"),c(e.red&&e.red===a.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,a){this._verify2(e,a);var t=e.add(a);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},_.prototype.iadd=function(e,a){this._verify2(e,a);var t=e.iadd(a);return t.cmp(this.m)>=0&&t.isub(this.m),t},_.prototype.sub=function(e,a){this._verify2(e,a);var t=e.sub(a);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},_.prototype.isub=function(e,a){this._verify2(e,a);var t=e.isub(a);return t.cmpn(0)<0&&t.iadd(this.m),t},_.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},_.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},_.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(c(a%2==1),3===a){var t=this.m.add(new d(1)).iushrn(2);return this.pow(e,t)}for(var f=this.m.subn(1),r=0;!f.isZero()&&0===f.andln(1);)r++,f.iushrn(1);c(!f.isZero());var n=new d(1).toRed(this),i=n.redNeg(),b=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new d(2*o*o).toRed(this);0!==this.pow(o,b).cmp(i);)o.redIAdd(i);for(var s=this.pow(o,f),l=this.pow(e,f.addn(1).iushrn(1)),u=this.pow(e,f),h=r;0!==u.cmp(n);){for(var p=u,g=0;0!==p.cmp(n);g++)p=p.redSqr();c(g=0;c--){for(var b=a.words[c],o=i-1;o>=0;o--){var s=b>>o&1;f!==t[0]&&(f=this.sqr(f)),0!==s||0!==r?(r<<=1,r|=s,(4==++n||0===c&&0===o)&&(f=this.mul(f,t[r]),n=0,r=0)):n=0}i=26}return f},_.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},_.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},d.mont=function(e){return new I(e)},f(I,_),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},I.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var t=e.imul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),d=f;return f.cmp(this.m)>=0?d=f.isub(this.m):f.cmpn(0)<0&&(d=f.iadd(this.m)),d._forceRed(this)},I.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new d(0)._forceRed(this);var t=e.mul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),r=f;return f.cmp(this.m)>=0?r=f.isub(this.m):f.cmpn(0)<0&&(r=f.iadd(this.m)),r._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=t.nmd(e),this)},77362:(e,a,t)=>{var c=t(78170),f=t(48206),d=t(52061),r=t(82509),n=t(67332),i=t(47108),b=t(99247),o=t(92861).Buffer;e.exports=function(e,a,t){var s;s=e.padding?e.padding:t?1:4;var l,u=c(e),h=u.modulus.byteLength();if(a.length>h||new r(a).cmp(u.modulus)>=0)throw new Error("decryption error");l=t?b(new r(a),u):n(a,u);var p=o.alloc(h-l.length);if(l=o.concat([p,l],h),4===s)return function(e,a){var t=e.modulus.byteLength(),c=i("sha1").update(o.alloc(0)).digest(),r=c.length;if(0!==a[0])throw new Error("decryption error");var n=a.slice(1,r+1),b=a.slice(r+1),s=d(n,f(b,r)),l=d(b,f(s,t-r-1));if(function(e,a){e=o.from(e),a=o.from(a);var t=0,c=e.length;e.length!==a.length&&(t++,c=Math.min(e.length,a.length));for(var f=-1;++f=a.length){d++;break}var r=a.slice(2,f-1);if(("0002"!==c.toString("hex")&&!t||"0001"!==c.toString("hex")&&t)&&d++,r.length<8&&d++,d)throw new Error("decryption error");return a.slice(f)}(0,l,t);if(3===s)return l;throw new Error("unknown padding")}},28902:(e,a,t)=>{var c=t(78170),f=t(53209),d=t(47108),r=t(48206),n=t(52061),i=t(82509),b=t(99247),o=t(67332),s=t(92861).Buffer;e.exports=function(e,a,t){var l;l=e.padding?e.padding:t?1:4;var u,h=c(e);if(4===l)u=function(e,a){var t=e.modulus.byteLength(),c=a.length,b=d("sha1").update(s.alloc(0)).digest(),o=b.length,l=2*o;if(c>t-l-2)throw new Error("message too long");var u=s.alloc(t-c-l-2),h=t-o-1,p=f(o),g=n(s.concat([b,u,s.alloc(1,1),a],h),r(p,h)),m=n(p,r(g,o));return new i(s.concat([s.alloc(1),m,g],t))}(h,a);else if(1===l)u=function(e,a,t){var c,d=a.length,r=e.modulus.byteLength();if(d>r-11)throw new Error("message too long");return c=t?s.alloc(r-d-3,255):function(e){for(var a,t=s.allocUnsafe(e),c=0,d=f(2*e),r=0;c=0)throw new Error("data too long for modulus")}return t?o(u,h):b(u,h)}},99247:(e,a,t)=>{var c=t(82509),f=t(92861).Buffer;e.exports=function(e,a){return f.from(e.toRed(c.mont(a.modulus)).redPow(new c(a.publicExponent)).fromRed().toArray())}},52061:e=>{e.exports=function(e,a){for(var t=e.length,c=-1;++c{"use strict";var c=65536,f=t(92861).Buffer,d=t.g.crypto||t.g.msCrypto;d&&d.getRandomValues?e.exports=function(e,a){if(e>4294967295)throw new RangeError("requested too many random bytes");var t=f.allocUnsafe(e);if(e>0)if(e>c)for(var r=0;r{"use strict";function c(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var f=t(92861),d=t(53209),r=f.Buffer,n=f.kMaxLength,i=t.g.crypto||t.g.msCrypto,b=Math.pow(2,32)-1;function o(e,a){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>b||e<0)throw new TypeError("offset must be a uint32");if(e>n||e>a)throw new RangeError("offset out of range")}function s(e,a,t){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>b||e<0)throw new TypeError("size must be a uint32");if(e+a>t||e>n)throw new RangeError("buffer too small")}function l(e,a,t,c){if(process.browser){var f=e.buffer,r=new Uint8Array(f,a,t);return i.getRandomValues(r),c?void process.nextTick((function(){c(null,e)})):e}if(!c)return d(t).copy(e,a),e;d(t,(function(t,f){if(t)return c(t);f.copy(e,a),c(null,e)}))}i&&i.getRandomValues||!process.browser?(a.randomFill=function(e,a,c,f){if(!(r.isBuffer(e)||e instanceof t.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof a)f=a,a=0,c=e.length;else if("function"==typeof c)f=c,c=e.length-a;else if("function"!=typeof f)throw new TypeError('"cb" argument must be a function');return o(a,e.length),s(c,a,e.length),l(e,a,c,f)},a.randomFillSync=function(e,a,c){if(void 0===a&&(a=0),!(r.isBuffer(e)||e instanceof t.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return o(a,e.length),void 0===c&&(c=e.length-a),s(c,a,e.length),l(e,a,c)}):(a.randomFill=c,a.randomFillSync=c)},86048:e=>{"use strict";var a={};function t(e,t,c){c||(c=Error);var f=function(e){var a,c;function f(a,c,f){return e.call(this,function(e,a,c){return"string"==typeof t?t:t(e,a,c)}(a,c,f))||this}return c=e,(a=f).prototype=Object.create(c.prototype),a.prototype.constructor=a,a.__proto__=c,f}(c);f.prototype.name=c.name,f.prototype.code=e,a[e]=f}function c(e,a){if(Array.isArray(e)){var t=e.length;return e=e.map((function(e){return String(e)})),t>2?"one of ".concat(a," ").concat(e.slice(0,t-1).join(", "),", or ")+e[t-1]:2===t?"one of ".concat(a," ").concat(e[0]," or ").concat(e[1]):"of ".concat(a," ").concat(e[0])}return"of ".concat(a," ").concat(String(e))}t("ERR_INVALID_OPT_VALUE",(function(e,a){return'The value "'+a+'" is invalid for option "'+e+'"'}),TypeError),t("ERR_INVALID_ARG_TYPE",(function(e,a,t){var f,d,r,n,i;if("string"==typeof a&&(d="not ",a.substr(0,4)===d)?(f="must not be",a=a.replace(/^not /,"")):f="must be",function(e,a,t){return(void 0===t||t>e.length)&&(t=e.length),e.substring(t-9,t)===a}(e," argument"))r="The ".concat(e," ").concat(f," ").concat(c(a,"type"));else{var b=("number"!=typeof i&&(i=0),i+1>(n=e).length||-1===n.indexOf(".",i)?"argument":"property");r='The "'.concat(e,'" ').concat(b," ").concat(f," ").concat(c(a,"type"))}return r+". Received type ".concat(typeof t)}),TypeError),t("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),t("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),t("ERR_STREAM_PREMATURE_CLOSE","Premature close"),t("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),t("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),t("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),t("ERR_STREAM_WRITE_AFTER_END","write after end"),t("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),t("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),t("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=a},25382:(e,a,t)=>{"use strict";var c=Object.keys||function(e){var a=[];for(var t in e)a.push(t);return a};e.exports=b;var f=t(45412),d=t(16708);t(56698)(b,f);for(var r=c(d.prototype),n=0;n{"use strict";e.exports=f;var c=t(74610);function f(e){if(!(this instanceof f))return new f(e);c.call(this,e)}t(56698)(f,c),f.prototype._transform=function(e,a,t){t(null,e)}},45412:(e,a,t)=>{"use strict";var c;e.exports=I,I.ReadableState=_,t(37007).EventEmitter;var f,d=function(e,a){return e.listeners(a).length},r=t(40345),n=t(48287).Buffer,i=(void 0!==t.g?t.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},b=t(79838);f=b&&b.debuglog?b.debuglog("stream"):function(){};var o,s,l,u=t(80345),h=t(75896),p=t(65291).getHighWaterMark,g=t(86048).F,m=g.ERR_INVALID_ARG_TYPE,x=g.ERR_STREAM_PUSH_AFTER_EOF,y=g.ERR_METHOD_NOT_IMPLEMENTED,A=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;t(56698)(I,r);var v=h.errorOrDestroy,w=["error","close","destroy","pause","resume"];function _(e,a,f){c=c||t(25382),e=e||{},"boolean"!=typeof f&&(f=a instanceof c),this.objectMode=!!e.objectMode,f&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=p(this,e,"readableHighWaterMark",f),this.buffer=new u,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(o||(o=t(83141).I),this.decoder=new o(e.encoding),this.encoding=e.encoding)}function I(e){if(c=c||t(25382),!(this instanceof I))return new I(e);var a=this instanceof c;this._readableState=new _(e,this,a),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),r.call(this)}function E(e,a,t,c,d){f("readableAddChunk",a);var r,b=e._readableState;if(null===a)b.reading=!1,function(e,a){if(f("onEofChunk"),!a.ended){if(a.decoder){var t=a.decoder.end();t&&t.length&&(a.buffer.push(t),a.length+=a.objectMode?1:t.length)}a.ended=!0,a.sync?k(e):(a.needReadable=!1,a.emittedReadable||(a.emittedReadable=!0,L(e)))}}(e,b);else if(d||(r=function(e,a){var t,c;return c=a,n.isBuffer(c)||c instanceof i||"string"==typeof a||void 0===a||e.objectMode||(t=new m("chunk",["string","Buffer","Uint8Array"],a)),t}(b,a)),r)v(e,r);else if(b.objectMode||a&&a.length>0)if("string"==typeof a||b.objectMode||Object.getPrototypeOf(a)===n.prototype||(a=function(e){return n.from(e)}(a)),c)b.endEmitted?v(e,new A):C(e,b,a,!0);else if(b.ended)v(e,new x);else{if(b.destroyed)return!1;b.reading=!1,b.decoder&&!t?(a=b.decoder.write(a),b.objectMode||0!==a.length?C(e,b,a,!1):S(e,b)):C(e,b,a,!1)}else c||(b.reading=!1,S(e,b));return!b.ended&&(b.lengtha.highWaterMark&&(a.highWaterMark=function(e){return e>=M?e=M:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=a.length?e:a.ended?a.length:(a.needReadable=!0,0))}function k(e){var a=e._readableState;f("emitReadable",a.needReadable,a.emittedReadable),a.needReadable=!1,a.emittedReadable||(f("emitReadable",a.flowing),a.emittedReadable=!0,process.nextTick(L,e))}function L(e){var a=e._readableState;f("emitReadable_",a.destroyed,a.length,a.ended),a.destroyed||!a.length&&!a.ended||(e.emit("readable"),a.emittedReadable=!1),a.needReadable=!a.flowing&&!a.ended&&a.length<=a.highWaterMark,D(e)}function S(e,a){a.readingMore||(a.readingMore=!0,process.nextTick(T,e,a))}function T(e,a){for(;!a.reading&&!a.ended&&(a.length0,a.resumeScheduled&&!a.paused?a.flowing=!0:e.listenerCount("data")>0&&e.resume()}function R(e){f("readable nexttick read 0"),e.read(0)}function P(e,a){f("resume",a.reading),a.reading||e.read(0),a.resumeScheduled=!1,e.emit("resume"),D(e),a.flowing&&!a.reading&&e.read(0)}function D(e){var a=e._readableState;for(f("flow",a.flowing);a.flowing&&null!==e.read(););}function O(e,a){return 0===a.length?null:(a.objectMode?t=a.buffer.shift():!e||e>=a.length?(t=a.decoder?a.buffer.join(""):1===a.buffer.length?a.buffer.first():a.buffer.concat(a.length),a.buffer.clear()):t=a.buffer.consume(e,a.decoder),t);var t}function F(e){var a=e._readableState;f("endReadable",a.endEmitted),a.endEmitted||(a.ended=!0,process.nextTick(Q,a,e))}function Q(e,a){if(f("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,a.readable=!1,a.emit("end"),e.autoDestroy)){var t=a._writableState;(!t||t.autoDestroy&&t.finished)&&a.destroy()}}function U(e,a){for(var t=0,c=e.length;t=a.highWaterMark:a.length>0)||a.ended))return f("read: emitReadable",a.length,a.ended),0===a.length&&a.ended?F(this):k(this),null;if(0===(e=B(e,a))&&a.ended)return 0===a.length&&F(this),null;var c,d=a.needReadable;return f("need readable",d),(0===a.length||a.length-e0?O(e,a):null)?(a.needReadable=a.length<=a.highWaterMark,e=0):(a.length-=e,a.awaitDrain=0),0===a.length&&(a.ended||(a.needReadable=!0),t!==e&&a.ended&&F(this)),null!==c&&this.emit("data",c),c},I.prototype._read=function(e){v(this,new y("_read()"))},I.prototype.pipe=function(e,a){var t=this,c=this._readableState;switch(c.pipesCount){case 0:c.pipes=e;break;case 1:c.pipes=[c.pipes,e];break;default:c.pipes.push(e)}c.pipesCount+=1,f("pipe count=%d opts=%j",c.pipesCount,a);var r=a&&!1===a.end||e===process.stdout||e===process.stderr?h:n;function n(){f("onend"),e.end()}c.endEmitted?process.nextTick(r):t.once("end",r),e.on("unpipe",(function a(d,r){f("onunpipe"),d===t&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,f("cleanup"),e.removeListener("close",l),e.removeListener("finish",u),e.removeListener("drain",i),e.removeListener("error",s),e.removeListener("unpipe",a),t.removeListener("end",n),t.removeListener("end",h),t.removeListener("data",o),b=!0,!c.awaitDrain||e._writableState&&!e._writableState.needDrain||i())}));var i=function(e){return function(){var a=e._readableState;f("pipeOnDrain",a.awaitDrain),a.awaitDrain&&a.awaitDrain--,0===a.awaitDrain&&d(e,"data")&&(a.flowing=!0,D(e))}}(t);e.on("drain",i);var b=!1;function o(a){f("ondata");var d=e.write(a);f("dest.write",d),!1===d&&((1===c.pipesCount&&c.pipes===e||c.pipesCount>1&&-1!==U(c.pipes,e))&&!b&&(f("false write response, pause",c.awaitDrain),c.awaitDrain++),t.pause())}function s(a){f("onerror",a),h(),e.removeListener("error",s),0===d(e,"error")&&v(e,a)}function l(){e.removeListener("finish",u),h()}function u(){f("onfinish"),e.removeListener("close",l),h()}function h(){f("unpipe"),t.unpipe(e)}return t.on("data",o),function(e,a,t){if("function"==typeof e.prependListener)return e.prependListener(a,t);e._events&&e._events[a]?Array.isArray(e._events[a])?e._events[a].unshift(t):e._events[a]=[t,e._events[a]]:e.on(a,t)}(e,"error",s),e.once("close",l),e.once("finish",u),e.emit("pipe",t),c.flowing||(f("pipe resume"),t.resume()),e},I.prototype.unpipe=function(e){var a=this._readableState,t={hasUnpiped:!1};if(0===a.pipesCount)return this;if(1===a.pipesCount)return e&&e!==a.pipes||(e||(e=a.pipes),a.pipes=null,a.pipesCount=0,a.flowing=!1,e&&e.emit("unpipe",this,t)),this;if(!e){var c=a.pipes,f=a.pipesCount;a.pipes=null,a.pipesCount=0,a.flowing=!1;for(var d=0;d0,!1!==c.flowing&&this.resume()):"readable"===e&&(c.endEmitted||c.readableListening||(c.readableListening=c.needReadable=!0,c.flowing=!1,c.emittedReadable=!1,f("on readable",c.length,c.reading),c.length?k(this):c.reading||process.nextTick(R,this))),t},I.prototype.addListener=I.prototype.on,I.prototype.removeListener=function(e,a){var t=r.prototype.removeListener.call(this,e,a);return"readable"===e&&process.nextTick(N,this),t},I.prototype.removeAllListeners=function(e){var a=r.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(N,this),a},I.prototype.resume=function(){var e=this._readableState;return e.flowing||(f("resume"),e.flowing=!e.readableListening,function(e,a){a.resumeScheduled||(a.resumeScheduled=!0,process.nextTick(P,e,a))}(this,e)),e.paused=!1,this},I.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},I.prototype.wrap=function(e){var a=this,t=this._readableState,c=!1;for(var d in e.on("end",(function(){if(f("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&a.push(e)}a.push(null)})),e.on("data",(function(d){f("wrapped data"),t.decoder&&(d=t.decoder.write(d)),t.objectMode&&null==d||(t.objectMode||d&&d.length)&&(a.push(d)||(c=!0,e.pause()))})),e)void 0===this[d]&&"function"==typeof e[d]&&(this[d]=function(a){return function(){return e[a].apply(e,arguments)}}(d));for(var r=0;r{"use strict";e.exports=o;var c=t(86048).F,f=c.ERR_METHOD_NOT_IMPLEMENTED,d=c.ERR_MULTIPLE_CALLBACK,r=c.ERR_TRANSFORM_ALREADY_TRANSFORMING,n=c.ERR_TRANSFORM_WITH_LENGTH_0,i=t(25382);function b(e,a){var t=this._transformState;t.transforming=!1;var c=t.writecb;if(null===c)return this.emit("error",new d);t.writechunk=null,t.writecb=null,null!=a&&this.push(a),c(e);var f=this._readableState;f.reading=!1,(f.needReadable||f.length{"use strict";function c(e){var a=this;this.next=null,this.entry=null,this.finish=function(){!function(e,a){var t=e.entry;for(e.entry=null;t;){var c=t.callback;a.pendingcb--,c(undefined),t=t.next}a.corkedRequestsFree.next=e}(a,e)}}var f;e.exports=I,I.WritableState=_;var d,r={deprecate:t(94643)},n=t(40345),i=t(48287).Buffer,b=(void 0!==t.g?t.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},o=t(75896),s=t(65291).getHighWaterMark,l=t(86048).F,u=l.ERR_INVALID_ARG_TYPE,h=l.ERR_METHOD_NOT_IMPLEMENTED,p=l.ERR_MULTIPLE_CALLBACK,g=l.ERR_STREAM_CANNOT_PIPE,m=l.ERR_STREAM_DESTROYED,x=l.ERR_STREAM_NULL_VALUES,y=l.ERR_STREAM_WRITE_AFTER_END,A=l.ERR_UNKNOWN_ENCODING,v=o.errorOrDestroy;function w(){}function _(e,a,d){f=f||t(25382),e=e||{},"boolean"!=typeof d&&(d=a instanceof f),this.objectMode=!!e.objectMode,d&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=s(this,e,"writableHighWaterMark",d),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var r=!1===e.decodeStrings;this.decodeStrings=!r,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,a){var t=e._writableState,c=t.sync,f=t.writecb;if("function"!=typeof f)throw new p;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(t),a)!function(e,a,t,c,f){--a.pendingcb,t?(process.nextTick(f,c),process.nextTick(L,e,a),e._writableState.errorEmitted=!0,v(e,c)):(f(c),e._writableState.errorEmitted=!0,v(e,c),L(e,a))}(e,t,c,a,f);else{var d=B(t)||e.destroyed;d||t.corked||t.bufferProcessing||!t.bufferedRequest||M(e,t),c?process.nextTick(C,e,t,d,f):C(e,t,d,f)}}(a,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new c(this)}function I(e){var a=this instanceof(f=f||t(25382));if(!a&&!d.call(I,this))return new I(e);this._writableState=new _(e,this,a),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),n.call(this)}function E(e,a,t,c,f,d,r){a.writelen=c,a.writecb=r,a.writing=!0,a.sync=!0,a.destroyed?a.onwrite(new m("write")):t?e._writev(f,a.onwrite):e._write(f,d,a.onwrite),a.sync=!1}function C(e,a,t,c){t||function(e,a){0===a.length&&a.needDrain&&(a.needDrain=!1,e.emit("drain"))}(e,a),a.pendingcb--,c(),L(e,a)}function M(e,a){a.bufferProcessing=!0;var t=a.bufferedRequest;if(e._writev&&t&&t.next){var f=a.bufferedRequestCount,d=new Array(f),r=a.corkedRequestsFree;r.entry=t;for(var n=0,i=!0;t;)d[n]=t,t.isBuf||(i=!1),t=t.next,n+=1;d.allBuffers=i,E(e,a,!0,a.length,d,"",r.finish),a.pendingcb++,a.lastBufferedRequest=null,r.next?(a.corkedRequestsFree=r.next,r.next=null):a.corkedRequestsFree=new c(a),a.bufferedRequestCount=0}else{for(;t;){var b=t.chunk,o=t.encoding,s=t.callback;if(E(e,a,!1,a.objectMode?1:b.length,b,o,s),t=t.next,a.bufferedRequestCount--,a.writing)break}null===t&&(a.lastBufferedRequest=null)}a.bufferedRequest=t,a.bufferProcessing=!1}function B(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function k(e,a){e._final((function(t){a.pendingcb--,t&&v(e,t),a.prefinished=!0,e.emit("prefinish"),L(e,a)}))}function L(e,a){var t=B(a);if(t&&(function(e,a){a.prefinished||a.finalCalled||("function"!=typeof e._final||a.destroyed?(a.prefinished=!0,e.emit("prefinish")):(a.pendingcb++,a.finalCalled=!0,process.nextTick(k,e,a)))}(e,a),0===a.pendingcb&&(a.finished=!0,e.emit("finish"),a.autoDestroy))){var c=e._readableState;(!c||c.autoDestroy&&c.endEmitted)&&e.destroy()}return t}t(56698)(I,n),_.prototype.getBuffer=function(){for(var e=this.bufferedRequest,a=[];e;)a.push(e),e=e.next;return a},function(){try{Object.defineProperty(_.prototype,"buffer",{get:r.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(I,Symbol.hasInstance,{value:function(e){return!!d.call(this,e)||this===I&&e&&e._writableState instanceof _}})):d=function(e){return e instanceof this},I.prototype.pipe=function(){v(this,new g)},I.prototype.write=function(e,a,t){var c,f=this._writableState,d=!1,r=!f.objectMode&&(c=e,i.isBuffer(c)||c instanceof b);return r&&!i.isBuffer(e)&&(e=function(e){return i.from(e)}(e)),"function"==typeof a&&(t=a,a=null),r?a="buffer":a||(a=f.defaultEncoding),"function"!=typeof t&&(t=w),f.ending?function(e,a){var t=new y;v(e,t),process.nextTick(a,t)}(this,t):(r||function(e,a,t,c){var f;return null===t?f=new x:"string"==typeof t||a.objectMode||(f=new u("chunk",["string","Buffer"],t)),!f||(v(e,f),process.nextTick(c,f),!1)}(this,f,e,t))&&(f.pendingcb++,d=function(e,a,t,c,f,d){if(!t){var r=function(e,a,t){return e.objectMode||!1===e.decodeStrings||"string"!=typeof a||(a=i.from(a,t)),a}(a,c,f);c!==r&&(t=!0,f="buffer",c=r)}var n=a.objectMode?1:c.length;a.length+=n;var b=a.length-1))throw new A(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(I.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(I.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),I.prototype._write=function(e,a,t){t(new h("_write()"))},I.prototype._writev=null,I.prototype.end=function(e,a,t){var c=this._writableState;return"function"==typeof e?(t=e,e=null,a=null):"function"==typeof a&&(t=a,a=null),null!=e&&this.write(e,a),c.corked&&(c.corked=1,this.uncork()),c.ending||function(e,a,t){a.ending=!0,L(e,a),t&&(a.finished?process.nextTick(t):e.once("finish",t)),a.ended=!0,e.writable=!1}(this,c,t),this},Object.defineProperty(I.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),I.prototype.destroy=o.destroy,I.prototype._undestroy=o.undestroy,I.prototype._destroy=function(e,a){a(e)}},2955:(e,a,t)=>{"use strict";var c;function f(e,a,t){return(a=function(e){var a=function(e){if("object"!=typeof e||null===e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var t=a.call(e,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof a?a:String(a)}(a))in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}var d=t(86238),r=Symbol("lastResolve"),n=Symbol("lastReject"),i=Symbol("error"),b=Symbol("ended"),o=Symbol("lastPromise"),s=Symbol("handlePromise"),l=Symbol("stream");function u(e,a){return{value:e,done:a}}function h(e){var a=e[r];if(null!==a){var t=e[l].read();null!==t&&(e[o]=null,e[r]=null,e[n]=null,a(u(t,!1)))}}function p(e){process.nextTick(h,e)}var g=Object.getPrototypeOf((function(){})),m=Object.setPrototypeOf((f(c={get stream(){return this[l]},next:function(){var e=this,a=this[i];if(null!==a)return Promise.reject(a);if(this[b])return Promise.resolve(u(void 0,!0));if(this[l].destroyed)return new Promise((function(a,t){process.nextTick((function(){e[i]?t(e[i]):a(u(void 0,!0))}))}));var t,c=this[o];if(c)t=new Promise(function(e,a){return function(t,c){e.then((function(){a[b]?t(u(void 0,!0)):a[s](t,c)}),c)}}(c,this));else{var f=this[l].read();if(null!==f)return Promise.resolve(u(f,!1));t=new Promise(this[s])}return this[o]=t,t}},Symbol.asyncIterator,(function(){return this})),f(c,"return",(function(){var e=this;return new Promise((function(a,t){e[l].destroy(null,(function(e){e?t(e):a(u(void 0,!0))}))}))})),c),g);e.exports=function(e){var a,t=Object.create(m,(f(a={},l,{value:e,writable:!0}),f(a,r,{value:null,writable:!0}),f(a,n,{value:null,writable:!0}),f(a,i,{value:null,writable:!0}),f(a,b,{value:e._readableState.endEmitted,writable:!0}),f(a,s,{value:function(e,a){var c=t[l].read();c?(t[o]=null,t[r]=null,t[n]=null,e(u(c,!1))):(t[r]=e,t[n]=a)},writable:!0}),a));return t[o]=null,d(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var a=t[n];return null!==a&&(t[o]=null,t[r]=null,t[n]=null,a(e)),void(t[i]=e)}var c=t[r];null!==c&&(t[o]=null,t[r]=null,t[n]=null,c(u(void 0,!0))),t[b]=!0})),e.on("readable",p.bind(null,t)),t}},80345:(e,a,t)=>{"use strict";function c(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);a&&(c=c.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),t.push.apply(t,c)}return t}function f(e){for(var a=1;a0?this.tail.next=a:this.head=a,this.tail=a,++this.length}},{key:"unshift",value:function(e){var a={data:e,next:this.head};0===this.length&&(this.tail=a),this.head=a,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var a=this.head,t=""+a.data;a=a.next;)t+=e+a.data;return t}},{key:"concat",value:function(e){if(0===this.length)return i.alloc(0);for(var a,t,c,f=i.allocUnsafe(e>>>0),d=this.head,r=0;d;)a=d.data,t=f,c=r,i.prototype.copy.call(a,t,c),r+=d.data.length,d=d.next;return f}},{key:"consume",value:function(e,a){var t;return ef.length?f.length:e;if(d===f.length?c+=f:c+=f.slice(0,e),0==(e-=d)){d===f.length?(++t,a.next?this.head=a.next:this.head=this.tail=null):(this.head=a,a.data=f.slice(d));break}++t}return this.length-=t,c}},{key:"_getBuffer",value:function(e){var a=i.allocUnsafe(e),t=this.head,c=1;for(t.data.copy(a),e-=t.data.length;t=t.next;){var f=t.data,d=e>f.length?f.length:e;if(f.copy(a,a.length-e,0,d),0==(e-=d)){d===f.length?(++c,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=f.slice(d));break}++c}return this.length-=c,a}},{key:o,value:function(e,a){return b(this,f(f({},a),{},{depth:0,customInspect:!1}))}}])&&r(a.prototype,t),Object.defineProperty(a,"prototype",{writable:!1}),e}()},75896:e=>{"use strict";function a(e,a){c(e,a),t(e)}function t(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function c(e,a){e.emit("error",a)}e.exports={destroy:function(e,f){var d=this,r=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return r||n?(f?f(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(c,this,e)):process.nextTick(c,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!f&&e?d._writableState?d._writableState.errorEmitted?process.nextTick(t,d):(d._writableState.errorEmitted=!0,process.nextTick(a,d,e)):process.nextTick(a,d,e):f?(process.nextTick(t,d),f(e)):process.nextTick(t,d)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,a){var t=e._readableState,c=e._writableState;t&&t.autoDestroy||c&&c.autoDestroy?e.destroy(a):e.emit("error",a)}}},86238:(e,a,t)=>{"use strict";var c=t(86048).F.ERR_STREAM_PREMATURE_CLOSE;function f(){}e.exports=function e(a,t,d){if("function"==typeof t)return e(a,null,t);t||(t={}),d=function(e){var a=!1;return function(){if(!a){a=!0;for(var t=arguments.length,c=new Array(t),f=0;f{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},57758:(e,a,t)=>{"use strict";var c,f=t(86048).F,d=f.ERR_MISSING_ARGS,r=f.ERR_STREAM_DESTROYED;function n(e){if(e)throw e}function i(e){e()}function b(e,a){return e.pipe(a)}e.exports=function(){for(var e=arguments.length,a=new Array(e),f=0;f0,(function(e){o||(o=e),e&&l.forEach(i),d||(l.forEach(i),s(o))}))}));return a.reduce(b)}},65291:(e,a,t)=>{"use strict";var c=t(86048).F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,a,t,f){var d=function(e,a,t){return null!=e.highWaterMark?e.highWaterMark:a?e[t]:null}(a,f,t);if(null!=d){if(!isFinite(d)||Math.floor(d)!==d||d<0)throw new c(f?t:"highWaterMark",d);return Math.floor(d)}return e.objectMode?16:16384}}},40345:(e,a,t)=>{e.exports=t(37007).EventEmitter},28399:(e,a,t)=>{(a=e.exports=t(45412)).Stream=a,a.Readable=a,a.Writable=t(16708),a.Duplex=t(25382),a.Transform=t(74610),a.PassThrough=t(63600),a.finished=t(86238),a.pipeline=t(57758)},66011:(e,a,t)=>{"use strict";var c=t(48287).Buffer,f=t(56698),d=t(51147),r=new Array(16),n=[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],i=[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],b=[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],o=[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],s=[0,1518500249,1859775393,2400959708,2840853838],l=[1352829926,1548603684,1836072691,2053994217,0];function u(){d.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function h(e,a){return e<>>32-a}function p(e,a,t,c,f,d,r,n){return h(e+(a^t^c)+d+r|0,n)+f|0}function g(e,a,t,c,f,d,r,n){return h(e+(a&t|~a&c)+d+r|0,n)+f|0}function m(e,a,t,c,f,d,r,n){return h(e+((a|~t)^c)+d+r|0,n)+f|0}function x(e,a,t,c,f,d,r,n){return h(e+(a&c|t&~c)+d+r|0,n)+f|0}function y(e,a,t,c,f,d,r,n){return h(e+(a^(t|~c))+d+r|0,n)+f|0}f(u,d),u.prototype._update=function(){for(var e=r,a=0;a<16;++a)e[a]=this._block.readInt32LE(4*a);for(var t=0|this._a,c=0|this._b,f=0|this._c,d=0|this._d,u=0|this._e,A=0|this._a,v=0|this._b,w=0|this._c,_=0|this._d,I=0|this._e,E=0;E<80;E+=1){var C,M;E<16?(C=p(t,c,f,d,u,e[n[E]],s[0],b[E]),M=y(A,v,w,_,I,e[i[E]],l[0],o[E])):E<32?(C=g(t,c,f,d,u,e[n[E]],s[1],b[E]),M=x(A,v,w,_,I,e[i[E]],l[1],o[E])):E<48?(C=m(t,c,f,d,u,e[n[E]],s[2],b[E]),M=m(A,v,w,_,I,e[i[E]],l[2],o[E])):E<64?(C=x(t,c,f,d,u,e[n[E]],s[3],b[E]),M=g(A,v,w,_,I,e[i[E]],l[3],o[E])):(C=y(t,c,f,d,u,e[n[E]],s[4],b[E]),M=p(A,v,w,_,I,e[i[E]],l[4],o[E])),t=u,u=d,d=h(f,10),f=c,c=C,A=I,I=_,_=h(w,10),w=v,v=M}var B=this._b+f+_|0;this._b=this._c+d+I|0,this._c=this._d+u+A|0,this._d=this._e+t+v|0,this._e=this._a+c+w|0,this._a=B},u.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=c.alloc?c.alloc(20):new c(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=u},51147:(e,a,t)=>{"use strict";var c=t(92861).Buffer,f=t(28399).Transform;function d(e){f.call(this),this._block=c.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}t(56698)(d,f),d.prototype._transform=function(e,a,t){var c=null;try{this.update(e,a)}catch(e){c=e}t(c)},d.prototype._flush=function(e){var a=null;try{this.push(this.digest())}catch(e){a=e}e(a)},d.prototype.update=function(e,a){if(function(e){if(!c.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer")}(e),this._finalized)throw new Error("Digest already called");c.isBuffer(e)||(e=c.from(e,a));for(var t=this._block,f=0;this._blockOffset+e.length-f>=this._blockSize;){for(var d=this._blockOffset;d0;++r)this._length[r]+=n,(n=this._length[r]/4294967296|0)>0&&(this._length[r]-=4294967296*n);return this},d.prototype._update=function(){throw new Error("_update is not implemented")},d.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var a=this._digest();void 0!==e&&(a=a.toString(e)),this._block.fill(0),this._blockOffset=0;for(var t=0;t<4;++t)this._length[t]=0;return a},d.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=d},92861:(e,a,t)=>{var c=t(48287),f=c.Buffer;function d(e,a){for(var t in e)a[t]=e[t]}function r(e,a,t){return f(e,a,t)}f.from&&f.alloc&&f.allocUnsafe&&f.allocUnsafeSlow?e.exports=c:(d(c,a),a.Buffer=r),r.prototype=Object.create(f.prototype),d(f,r),r.from=function(e,a,t){if("number"==typeof e)throw new TypeError("Argument must not be a number");return f(e,a,t)},r.alloc=function(e,a,t){if("number"!=typeof e)throw new TypeError("Argument must be a number");var c=f(e);return void 0!==a?"string"==typeof t?c.fill(a,t):c.fill(a):c.fill(0),c},r.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return f(e)},r.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return c.SlowBuffer(e)}},96897:(e,a,t)=>{"use strict";var c=t(70453),f=t(30041),d=t(30592)(),r=t(75795),n=t(69675),i=c("%Math.floor%");e.exports=function(e,a){if("function"!=typeof e)throw new n("`fn` is not a function");if("number"!=typeof a||a<0||a>4294967295||i(a)!==a)throw new n("`length` must be a positive 32-bit integer");var t=arguments.length>2&&!!arguments[2],c=!0,b=!0;if("length"in e&&r){var o=r(e,"length");o&&!o.configurable&&(c=!1),o&&!o.writable&&(b=!1)}return(c||b||!t)&&(d?f(e,"length",a,!0,!0):f(e,"length",a)),e}},90392:(e,a,t)=>{var c=t(92861).Buffer;function f(e,a){this._block=c.alloc(e),this._finalSize=a,this._blockSize=e,this._len=0}f.prototype.update=function(e,a){"string"==typeof e&&(a=a||"utf8",e=c.from(e,a));for(var t=this._block,f=this._blockSize,d=e.length,r=this._len,n=0;n=this._finalSize&&(this._update(this._block),this._block.fill(0));var t=8*this._len;if(t<=4294967295)this._block.writeUInt32BE(t,this._blockSize-4);else{var c=(4294967295&t)>>>0,f=(t-c)/4294967296;this._block.writeUInt32BE(f,this._blockSize-8),this._block.writeUInt32BE(c,this._blockSize-4)}this._update(this._block);var d=this._hash();return e?d.toString(e):d},f.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=f},62802:(e,a,t)=>{var c=e.exports=function(e){e=e.toLowerCase();var a=c[e];if(!a)throw new Error(e+" is not supported (we accept pull requests)");return new a};c.sha=t(27816),c.sha1=t(63737),c.sha224=t(26710),c.sha256=t(24107),c.sha384=t(32827),c.sha512=t(82890)},27816:(e,a,t)=>{var c=t(56698),f=t(90392),d=t(92861).Buffer,r=[1518500249,1859775393,-1894007588,-899497514],n=new Array(80);function i(){this.init(),this._w=n,f.call(this,64,56)}function b(e){return e<<30|e>>>2}function o(e,a,t,c){return 0===e?a&t|~a&c:2===e?a&t|a&c|t&c:a^t^c}c(i,f),i.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},i.prototype._update=function(e){for(var a,t=this._w,c=0|this._a,f=0|this._b,d=0|this._c,n=0|this._d,i=0|this._e,s=0;s<16;++s)t[s]=e.readInt32BE(4*s);for(;s<80;++s)t[s]=t[s-3]^t[s-8]^t[s-14]^t[s-16];for(var l=0;l<80;++l){var u=~~(l/20),h=0|((a=c)<<5|a>>>27)+o(u,f,d,n)+i+t[l]+r[u];i=n,n=d,d=b(f),f=c,c=h}this._a=c+this._a|0,this._b=f+this._b|0,this._c=d+this._c|0,this._d=n+this._d|0,this._e=i+this._e|0},i.prototype._hash=function(){var e=d.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=i},63737:(e,a,t)=>{var c=t(56698),f=t(90392),d=t(92861).Buffer,r=[1518500249,1859775393,-1894007588,-899497514],n=new Array(80);function i(){this.init(),this._w=n,f.call(this,64,56)}function b(e){return e<<5|e>>>27}function o(e){return e<<30|e>>>2}function s(e,a,t,c){return 0===e?a&t|~a&c:2===e?a&t|a&c|t&c:a^t^c}c(i,f),i.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},i.prototype._update=function(e){for(var a,t=this._w,c=0|this._a,f=0|this._b,d=0|this._c,n=0|this._d,i=0|this._e,l=0;l<16;++l)t[l]=e.readInt32BE(4*l);for(;l<80;++l)t[l]=(a=t[l-3]^t[l-8]^t[l-14]^t[l-16])<<1|a>>>31;for(var u=0;u<80;++u){var h=~~(u/20),p=b(c)+s(h,f,d,n)+i+t[u]+r[h]|0;i=n,n=d,d=o(f),f=c,c=p}this._a=c+this._a|0,this._b=f+this._b|0,this._c=d+this._c|0,this._d=n+this._d|0,this._e=i+this._e|0},i.prototype._hash=function(){var e=d.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=i},26710:(e,a,t)=>{var c=t(56698),f=t(24107),d=t(90392),r=t(92861).Buffer,n=new Array(64);function i(){this.init(),this._w=n,d.call(this,64,56)}c(i,f),i.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},i.prototype._hash=function(){var e=r.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=i},24107:(e,a,t)=>{var c=t(56698),f=t(90392),d=t(92861).Buffer,r=[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],n=new Array(64);function i(){this.init(),this._w=n,f.call(this,64,56)}function b(e,a,t){return t^e&(a^t)}function o(e,a,t){return e&a|t&(e|a)}function s(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function l(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function u(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}c(i,f),i.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},i.prototype._update=function(e){for(var a,t=this._w,c=0|this._a,f=0|this._b,d=0|this._c,n=0|this._d,i=0|this._e,h=0|this._f,p=0|this._g,g=0|this._h,m=0;m<16;++m)t[m]=e.readInt32BE(4*m);for(;m<64;++m)t[m]=0|(((a=t[m-2])>>>17|a<<15)^(a>>>19|a<<13)^a>>>10)+t[m-7]+u(t[m-15])+t[m-16];for(var x=0;x<64;++x){var y=g+l(i)+b(i,h,p)+r[x]+t[x]|0,A=s(c)+o(c,f,d)|0;g=p,p=h,h=i,i=n+y|0,n=d,d=f,f=c,c=y+A|0}this._a=c+this._a|0,this._b=f+this._b|0,this._c=d+this._c|0,this._d=n+this._d|0,this._e=i+this._e|0,this._f=h+this._f|0,this._g=p+this._g|0,this._h=g+this._h|0},i.prototype._hash=function(){var e=d.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=i},32827:(e,a,t)=>{var c=t(56698),f=t(82890),d=t(90392),r=t(92861).Buffer,n=new Array(160);function i(){this.init(),this._w=n,d.call(this,128,112)}c(i,f),i.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},i.prototype._hash=function(){var e=r.allocUnsafe(48);function a(a,t,c){e.writeInt32BE(a,c),e.writeInt32BE(t,c+4)}return a(this._ah,this._al,0),a(this._bh,this._bl,8),a(this._ch,this._cl,16),a(this._dh,this._dl,24),a(this._eh,this._el,32),a(this._fh,this._fl,40),e},e.exports=i},82890:(e,a,t)=>{var c=t(56698),f=t(90392),d=t(92861).Buffer,r=[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],n=new Array(160);function i(){this.init(),this._w=n,f.call(this,128,112)}function b(e,a,t){return t^e&(a^t)}function o(e,a,t){return e&a|t&(e|a)}function s(e,a){return(e>>>28|a<<4)^(a>>>2|e<<30)^(a>>>7|e<<25)}function l(e,a){return(e>>>14|a<<18)^(e>>>18|a<<14)^(a>>>9|e<<23)}function u(e,a){return(e>>>1|a<<31)^(e>>>8|a<<24)^e>>>7}function h(e,a){return(e>>>1|a<<31)^(e>>>8|a<<24)^(e>>>7|a<<25)}function p(e,a){return(e>>>19|a<<13)^(a>>>29|e<<3)^e>>>6}function g(e,a){return(e>>>19|a<<13)^(a>>>29|e<<3)^(e>>>6|a<<26)}function m(e,a){return e>>>0>>0?1:0}c(i,f),i.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},i.prototype._update=function(e){for(var a=this._w,t=0|this._ah,c=0|this._bh,f=0|this._ch,d=0|this._dh,n=0|this._eh,i=0|this._fh,x=0|this._gh,y=0|this._hh,A=0|this._al,v=0|this._bl,w=0|this._cl,_=0|this._dl,I=0|this._el,E=0|this._fl,C=0|this._gl,M=0|this._hl,B=0;B<32;B+=2)a[B]=e.readInt32BE(4*B),a[B+1]=e.readInt32BE(4*B+4);for(;B<160;B+=2){var k=a[B-30],L=a[B-30+1],S=u(k,L),T=h(L,k),N=p(k=a[B-4],L=a[B-4+1]),R=g(L,k),P=a[B-14],D=a[B-14+1],O=a[B-32],F=a[B-32+1],Q=T+D|0,U=S+P+m(Q,T)|0;U=(U=U+N+m(Q=Q+R|0,R)|0)+O+m(Q=Q+F|0,F)|0,a[B]=U,a[B+1]=Q}for(var j=0;j<160;j+=2){U=a[j],Q=a[j+1];var H=o(t,c,f),q=o(A,v,w),$=s(t,A),z=s(A,t),G=l(n,I),K=l(I,n),V=r[j],Z=r[j+1],J=b(n,i,x),W=b(I,E,C),Y=M+K|0,X=y+G+m(Y,M)|0;X=(X=(X=X+J+m(Y=Y+W|0,W)|0)+V+m(Y=Y+Z|0,Z)|0)+U+m(Y=Y+Q|0,Q)|0;var ee=z+q|0,ae=$+H+m(ee,z)|0;y=x,M=C,x=i,C=E,i=n,E=I,n=d+X+m(I=_+Y|0,_)|0,d=f,_=w,f=c,w=v,c=t,v=A,t=X+ae+m(A=Y+ee|0,Y)|0}this._al=this._al+A|0,this._bl=this._bl+v|0,this._cl=this._cl+w|0,this._dl=this._dl+_|0,this._el=this._el+I|0,this._fl=this._fl+E|0,this._gl=this._gl+C|0,this._hl=this._hl+M|0,this._ah=this._ah+t+m(this._al,A)|0,this._bh=this._bh+c+m(this._bl,v)|0,this._ch=this._ch+f+m(this._cl,w)|0,this._dh=this._dh+d+m(this._dl,_)|0,this._eh=this._eh+n+m(this._el,I)|0,this._fh=this._fh+i+m(this._fl,E)|0,this._gh=this._gh+x+m(this._gl,C)|0,this._hh=this._hh+y+m(this._hl,M)|0},i.prototype._hash=function(){var e=d.allocUnsafe(64);function a(a,t,c){e.writeInt32BE(a,c),e.writeInt32BE(t,c+4)}return a(this._ah,this._al,0),a(this._bh,this._bl,8),a(this._ch,this._cl,16),a(this._dh,this._dl,24),a(this._eh,this._el,32),a(this._fh,this._fl,40),a(this._gh,this._gl,48),a(this._hh,this._hl,56),e},e.exports=i},88310:(e,a,t)=>{e.exports=f;var c=t(37007).EventEmitter;function f(){c.call(this)}t(56698)(f,c),f.Readable=t(45412),f.Writable=t(16708),f.Duplex=t(25382),f.Transform=t(74610),f.PassThrough=t(63600),f.finished=t(86238),f.pipeline=t(57758),f.Stream=f,f.prototype.pipe=function(e,a){var t=this;function f(a){e.writable&&!1===e.write(a)&&t.pause&&t.pause()}function d(){t.readable&&t.resume&&t.resume()}t.on("data",f),e.on("drain",d),e._isStdio||a&&!1===a.end||(t.on("end",n),t.on("close",i));var r=!1;function n(){r||(r=!0,e.end())}function i(){r||(r=!0,"function"==typeof e.destroy&&e.destroy())}function b(e){if(o(),0===c.listenerCount(this,"error"))throw e}function o(){t.removeListener("data",f),e.removeListener("drain",d),t.removeListener("end",n),t.removeListener("close",i),t.removeListener("error",b),e.removeListener("error",b),t.removeListener("end",o),t.removeListener("close",o),e.removeListener("close",o)}return t.on("error",b),e.on("error",b),t.on("end",o),t.on("close",o),e.on("close",o),e.emit("pipe",t),e}},11568:(e,a,t)=>{var c=t(55537),f=t(6917),d=t(57510),r=t(86866),n=t(59817),i=a;i.request=function(e,a){e="string"==typeof e?n.parse(e):d(e);var f=-1===t.g.location.protocol.search(/^https?:$/)?"http:":"",r=e.protocol||f,i=e.hostname||e.host,b=e.port,o=e.path||"/";i&&-1!==i.indexOf(":")&&(i="["+i+"]"),e.url=(i?r+"//"+i:"")+(b?":"+b:"")+o,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var s=new c(e);return a&&s.on("response",a),s},i.get=function(e,a){var t=i.request(e,a);return t.end(),t},i.ClientRequest=c,i.IncomingMessage=f.IncomingMessage,i.Agent=function(){},i.Agent.defaultMaxSockets=4,i.globalAgent=new i.Agent,i.STATUS_CODES=r,i.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]},6688:(e,a,t)=>{var c;function f(){if(void 0!==c)return c;if(t.g.XMLHttpRequest){c=new t.g.XMLHttpRequest;try{c.open("GET",t.g.XDomainRequest?"/":"https://example.com")}catch(e){c=null}}else c=null;return c}function d(e){var a=f();if(!a)return!1;try{return a.responseType=e,a.responseType===e}catch(e){}return!1}function r(e){return"function"==typeof e}a.fetch=r(t.g.fetch)&&r(t.g.ReadableStream),a.writableStream=r(t.g.WritableStream),a.abortController=r(t.g.AbortController),a.arraybuffer=a.fetch||d("arraybuffer"),a.msstream=!a.fetch&&d("ms-stream"),a.mozchunkedarraybuffer=!a.fetch&&d("moz-chunked-arraybuffer"),a.overrideMimeType=a.fetch||!!f()&&r(f().overrideMimeType),c=null},55537:(e,a,t)=>{var c=t(62045).hp,f=t(6688),d=t(56698),r=t(6917),n=t(28399),i=r.IncomingMessage,b=r.readyStates,o=e.exports=function(e){var a,t=this;n.Writable.call(t),t._opts=e,t._body=[],t._headers={},e.auth&&t.setHeader("Authorization","Basic "+c.from(e.auth).toString("base64")),Object.keys(e.headers).forEach((function(a){t.setHeader(a,e.headers[a])}));var d=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!f.abortController)d=!1,a=!0;else if("prefer-streaming"===e.mode)a=!1;else if("allow-wrong-content-type"===e.mode)a=!f.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");a=!0}t._mode=function(e,a){return f.fetch&&a?"fetch":f.mozchunkedarraybuffer?"moz-chunked-arraybuffer":f.msstream?"ms-stream":f.arraybuffer&&e?"arraybuffer":"text"}(a,d),t._fetchTimer=null,t._socketTimeout=null,t._socketTimer=null,t.on("finish",(function(){t._onFinish()}))};d(o,n.Writable),o.prototype.setHeader=function(e,a){var t=e.toLowerCase();-1===s.indexOf(t)&&(this._headers[t]={name:e,value:a})},o.prototype.getHeader=function(e){var a=this._headers[e.toLowerCase()];return a?a.value:null},o.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},o.prototype._onFinish=function(){var e=this;if(!e._destroyed){var a=e._opts;"timeout"in a&&0!==a.timeout&&e.setTimeout(a.timeout);var c=e._headers,d=null;"GET"!==a.method&&"HEAD"!==a.method&&(d=new Blob(e._body,{type:(c["content-type"]||{}).value||""}));var r=[];if(Object.keys(c).forEach((function(e){var a=c[e].name,t=c[e].value;Array.isArray(t)?t.forEach((function(e){r.push([a,e])})):r.push([a,t])})),"fetch"===e._mode){var n=null;if(f.abortController){var i=new AbortController;n=i.signal,e._fetchAbortController=i,"requestTimeout"in a&&0!==a.requestTimeout&&(e._fetchTimer=t.g.setTimeout((function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()}),a.requestTimeout))}t.g.fetch(e._opts.url,{method:e._opts.method,headers:r,body:d||void 0,mode:"cors",credentials:a.withCredentials?"include":"same-origin",signal:n}).then((function(a){e._fetchResponse=a,e._resetTimers(!1),e._connect()}),(function(a){e._resetTimers(!0),e._destroyed||e.emit("error",a)}))}else{var o=e._xhr=new t.g.XMLHttpRequest;try{o.open(e._opts.method,e._opts.url,!0)}catch(a){return void process.nextTick((function(){e.emit("error",a)}))}"responseType"in o&&(o.responseType=e._mode),"withCredentials"in o&&(o.withCredentials=!!a.withCredentials),"text"===e._mode&&"overrideMimeType"in o&&o.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in a&&(o.timeout=a.requestTimeout,o.ontimeout=function(){e.emit("requestTimeout")}),r.forEach((function(e){o.setRequestHeader(e[0],e[1])})),e._response=null,o.onreadystatechange=function(){switch(o.readyState){case b.LOADING:case b.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(o.onprogress=function(){e._onXHRProgress()}),o.onerror=function(){e._destroyed||(e._resetTimers(!0),e.emit("error",new Error("XHR error")))};try{o.send(d)}catch(a){return void process.nextTick((function(){e.emit("error",a)}))}}}},o.prototype._onXHRProgress=function(){var e=this;e._resetTimers(!1),function(e){try{var a=e.status;return null!==a&&0!==a}catch(e){return!1}}(e._xhr)&&!e._destroyed&&(e._response||e._connect(),e._response._onXHRProgress(e._resetTimers.bind(e)))},o.prototype._connect=function(){var e=this;e._destroyed||(e._response=new i(e._xhr,e._fetchResponse,e._mode,e._resetTimers.bind(e)),e._response.on("error",(function(a){e.emit("error",a)})),e.emit("response",e._response))},o.prototype._write=function(e,a,t){this._body.push(e),t()},o.prototype._resetTimers=function(e){var a=this;t.g.clearTimeout(a._socketTimer),a._socketTimer=null,e?(t.g.clearTimeout(a._fetchTimer),a._fetchTimer=null):a._socketTimeout&&(a._socketTimer=t.g.setTimeout((function(){a.emit("timeout")}),a._socketTimeout))},o.prototype.abort=o.prototype.destroy=function(e){var a=this;a._destroyed=!0,a._resetTimers(!0),a._response&&(a._response._destroyed=!0),a._xhr?a._xhr.abort():a._fetchAbortController&&a._fetchAbortController.abort(),e&&a.emit("error",e)},o.prototype.end=function(e,a,t){"function"==typeof e&&(t=e,e=void 0),n.Writable.prototype.end.call(this,e,a,t)},o.prototype.setTimeout=function(e,a){var t=this;a&&t.once("timeout",a),t._socketTimeout=e,t._resetTimers(!1)},o.prototype.flushHeaders=function(){},o.prototype.setNoDelay=function(){},o.prototype.setSocketKeepAlive=function(){};var s=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]},6917:(e,a,t)=>{var c=t(62045).hp,f=t(6688),d=t(56698),r=t(28399),n=a.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},i=a.IncomingMessage=function(e,a,t,d){var n=this;if(r.Readable.call(n),n._mode=t,n.headers={},n.rawHeaders=[],n.trailers={},n.rawTrailers=[],n.on("end",(function(){process.nextTick((function(){n.emit("close")}))})),"fetch"===t){if(n._fetchResponse=a,n.url=a.url,n.statusCode=a.status,n.statusMessage=a.statusText,a.headers.forEach((function(e,a){n.headers[a.toLowerCase()]=e,n.rawHeaders.push(a,e)})),f.writableStream){var i=new WritableStream({write:function(e){return d(!1),new Promise((function(a,t){n._destroyed?t():n.push(c.from(e))?a():n._resumeFetch=a}))},close:function(){d(!0),n._destroyed||n.push(null)},abort:function(e){d(!0),n._destroyed||n.emit("error",e)}});try{return void a.body.pipeTo(i).catch((function(e){d(!0),n._destroyed||n.emit("error",e)}))}catch(e){}}var b=a.body.getReader();!function e(){b.read().then((function(a){n._destroyed||(d(a.done),a.done?n.push(null):(n.push(c.from(a.value)),e()))})).catch((function(e){d(!0),n._destroyed||n.emit("error",e)}))}()}else if(n._xhr=e,n._pos=0,n.url=e.responseURL,n.statusCode=e.status,n.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach((function(e){var a=e.match(/^([^:]+):\s*(.*)/);if(a){var t=a[1].toLowerCase();"set-cookie"===t?(void 0===n.headers[t]&&(n.headers[t]=[]),n.headers[t].push(a[2])):void 0!==n.headers[t]?n.headers[t]+=", "+a[2]:n.headers[t]=a[2],n.rawHeaders.push(a[1],a[2])}})),n._charset="x-user-defined",!f.overrideMimeType){var o=n.rawHeaders["mime-type"];if(o){var s=o.match(/;\s*charset=([^;])(;|$)/);s&&(n._charset=s[1].toLowerCase())}n._charset||(n._charset="utf-8")}};d(i,r.Readable),i.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},i.prototype._onXHRProgress=function(e){var a=this,f=a._xhr,d=null;switch(a._mode){case"text":if((d=f.responseText).length>a._pos){var r=d.substr(a._pos);if("x-user-defined"===a._charset){for(var i=c.alloc(r.length),b=0;ba._pos&&(a.push(c.from(new Uint8Array(o.result.slice(a._pos)))),a._pos=o.result.byteLength)},o.onload=function(){e(!0),a.push(null)},o.readAsArrayBuffer(d)}a._xhr.readyState===n.DONE&&"ms-stream"!==a._mode&&(e(!0),a.push(null))}},83141:(e,a,t)=>{"use strict";var c=t(92861).Buffer,f=c.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function d(e){var a;switch(this.encoding=function(e){var a=function(e){if(!e)return"utf8";for(var a;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(a)return;e=(""+e).toLowerCase(),a=!0}}(e);if("string"!=typeof a&&(c.isEncoding===f||!f(e)))throw new Error("Unknown encoding: "+e);return a||e}(e),this.encoding){case"utf16le":this.text=i,this.end=b,a=4;break;case"utf8":this.fillLast=n,a=4;break;case"base64":this.text=o,this.end=s,a=3;break;default:return this.write=l,void(this.end=u)}this.lastNeed=0,this.lastTotal=0,this.lastChar=c.allocUnsafe(a)}function r(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function n(e){var a=this.lastTotal-this.lastNeed,t=function(e,a){if(128!=(192&a[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&a.length>1){if(128!=(192&a[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&a.length>2&&128!=(192&a[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==t?t:this.lastNeed<=e.length?(e.copy(this.lastChar,a,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,a,0,e.length),void(this.lastNeed-=e.length))}function i(e,a){if((e.length-a)%2==0){var t=e.toString("utf16le",a);if(t){var c=t.charCodeAt(t.length-1);if(c>=55296&&c<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",a,e.length-1)}function b(e){var a=e&&e.length?this.write(e):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return a+this.lastChar.toString("utf16le",0,t)}return a}function o(e,a){var t=(e.length-a)%3;return 0===t?e.toString("base64",a):(this.lastNeed=3-t,this.lastTotal=3,1===t?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",a,e.length-t))}function s(e){var a=e&&e.length?this.write(e):"";return this.lastNeed?a+this.lastChar.toString("base64",0,3-this.lastNeed):a}function l(e){return e.toString(this.encoding)}function u(e){return e&&e.length?this.write(e):""}a.I=d,d.prototype.write=function(e){if(0===e.length)return"";var a,t;if(this.lastNeed){if(void 0===(a=this.fillLast(e)))return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t=0?(f>0&&(e.lastNeed=f-1),f):--c=0?(f>0&&(e.lastNeed=f-2),f):--c=0?(f>0&&(2===f?f=0:e.lastNeed=f-3),f):0}(this,e,a);if(!this.lastNeed)return e.toString("utf8",a);this.lastTotal=t;var c=e.length-(t-this.lastNeed);return e.copy(this.lastChar,0,c),e.toString("utf8",a,c)},d.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},88947:(e,a,t)=>{!function(e){"use strict";var a=function(e){var a,t=new Float64Array(16);if(e)for(a=0;a>24&255,e[a+1]=t>>16&255,e[a+2]=t>>8&255,e[a+3]=255&t,e[a+4]=c>>24&255,e[a+5]=c>>16&255,e[a+6]=c>>8&255,e[a+7]=255&c}function p(e,a,t,c,f){var d,r=0;for(d=0;d>>8)-1}function g(e,a,t,c){return p(e,a,t,c,16)}function m(e,a,t,c){return p(e,a,t,c,32)}function x(e,a,t,c){!function(e,a,t,c){for(var f,d=255&c[0]|(255&c[1])<<8|(255&c[2])<<16|(255&c[3])<<24,r=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,n=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,i=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,b=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,o=255&c[4]|(255&c[5])<<8|(255&c[6])<<16|(255&c[7])<<24,s=255&a[0]|(255&a[1])<<8|(255&a[2])<<16|(255&a[3])<<24,l=255&a[4]|(255&a[5])<<8|(255&a[6])<<16|(255&a[7])<<24,u=255&a[8]|(255&a[9])<<8|(255&a[10])<<16|(255&a[11])<<24,h=255&a[12]|(255&a[13])<<8|(255&a[14])<<16|(255&a[15])<<24,p=255&c[8]|(255&c[9])<<8|(255&c[10])<<16|(255&c[11])<<24,g=255&t[16]|(255&t[17])<<8|(255&t[18])<<16|(255&t[19])<<24,m=255&t[20]|(255&t[21])<<8|(255&t[22])<<16|(255&t[23])<<24,x=255&t[24]|(255&t[25])<<8|(255&t[26])<<16|(255&t[27])<<24,y=255&t[28]|(255&t[29])<<8|(255&t[30])<<16|(255&t[31])<<24,A=255&c[12]|(255&c[13])<<8|(255&c[14])<<16|(255&c[15])<<24,v=d,w=r,_=n,I=i,E=b,C=o,M=s,B=l,k=u,L=h,S=p,T=g,N=m,R=x,P=y,D=A,O=0;O<20;O+=2)v^=(f=(N^=(f=(k^=(f=(E^=(f=v+N|0)<<7|f>>>25)+v|0)<<9|f>>>23)+E|0)<<13|f>>>19)+k|0)<<18|f>>>14,C^=(f=(w^=(f=(R^=(f=(L^=(f=C+w|0)<<7|f>>>25)+C|0)<<9|f>>>23)+L|0)<<13|f>>>19)+R|0)<<18|f>>>14,S^=(f=(M^=(f=(_^=(f=(P^=(f=S+M|0)<<7|f>>>25)+S|0)<<9|f>>>23)+P|0)<<13|f>>>19)+_|0)<<18|f>>>14,D^=(f=(T^=(f=(B^=(f=(I^=(f=D+T|0)<<7|f>>>25)+D|0)<<9|f>>>23)+I|0)<<13|f>>>19)+B|0)<<18|f>>>14,v^=(f=(I^=(f=(_^=(f=(w^=(f=v+I|0)<<7|f>>>25)+v|0)<<9|f>>>23)+w|0)<<13|f>>>19)+_|0)<<18|f>>>14,C^=(f=(E^=(f=(B^=(f=(M^=(f=C+E|0)<<7|f>>>25)+C|0)<<9|f>>>23)+M|0)<<13|f>>>19)+B|0)<<18|f>>>14,S^=(f=(L^=(f=(k^=(f=(T^=(f=S+L|0)<<7|f>>>25)+S|0)<<9|f>>>23)+T|0)<<13|f>>>19)+k|0)<<18|f>>>14,D^=(f=(P^=(f=(R^=(f=(N^=(f=D+P|0)<<7|f>>>25)+D|0)<<9|f>>>23)+N|0)<<13|f>>>19)+R|0)<<18|f>>>14;v=v+d|0,w=w+r|0,_=_+n|0,I=I+i|0,E=E+b|0,C=C+o|0,M=M+s|0,B=B+l|0,k=k+u|0,L=L+h|0,S=S+p|0,T=T+g|0,N=N+m|0,R=R+x|0,P=P+y|0,D=D+A|0,e[0]=v>>>0&255,e[1]=v>>>8&255,e[2]=v>>>16&255,e[3]=v>>>24&255,e[4]=w>>>0&255,e[5]=w>>>8&255,e[6]=w>>>16&255,e[7]=w>>>24&255,e[8]=_>>>0&255,e[9]=_>>>8&255,e[10]=_>>>16&255,e[11]=_>>>24&255,e[12]=I>>>0&255,e[13]=I>>>8&255,e[14]=I>>>16&255,e[15]=I>>>24&255,e[16]=E>>>0&255,e[17]=E>>>8&255,e[18]=E>>>16&255,e[19]=E>>>24&255,e[20]=C>>>0&255,e[21]=C>>>8&255,e[22]=C>>>16&255,e[23]=C>>>24&255,e[24]=M>>>0&255,e[25]=M>>>8&255,e[26]=M>>>16&255,e[27]=M>>>24&255,e[28]=B>>>0&255,e[29]=B>>>8&255,e[30]=B>>>16&255,e[31]=B>>>24&255,e[32]=k>>>0&255,e[33]=k>>>8&255,e[34]=k>>>16&255,e[35]=k>>>24&255,e[36]=L>>>0&255,e[37]=L>>>8&255,e[38]=L>>>16&255,e[39]=L>>>24&255,e[40]=S>>>0&255,e[41]=S>>>8&255,e[42]=S>>>16&255,e[43]=S>>>24&255,e[44]=T>>>0&255,e[45]=T>>>8&255,e[46]=T>>>16&255,e[47]=T>>>24&255,e[48]=N>>>0&255,e[49]=N>>>8&255,e[50]=N>>>16&255,e[51]=N>>>24&255,e[52]=R>>>0&255,e[53]=R>>>8&255,e[54]=R>>>16&255,e[55]=R>>>24&255,e[56]=P>>>0&255,e[57]=P>>>8&255,e[58]=P>>>16&255,e[59]=P>>>24&255,e[60]=D>>>0&255,e[61]=D>>>8&255,e[62]=D>>>16&255,e[63]=D>>>24&255}(e,a,t,c)}function y(e,a,t,c){!function(e,a,t,c){for(var f,d=255&c[0]|(255&c[1])<<8|(255&c[2])<<16|(255&c[3])<<24,r=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,n=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,i=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,b=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,o=255&c[4]|(255&c[5])<<8|(255&c[6])<<16|(255&c[7])<<24,s=255&a[0]|(255&a[1])<<8|(255&a[2])<<16|(255&a[3])<<24,l=255&a[4]|(255&a[5])<<8|(255&a[6])<<16|(255&a[7])<<24,u=255&a[8]|(255&a[9])<<8|(255&a[10])<<16|(255&a[11])<<24,h=255&a[12]|(255&a[13])<<8|(255&a[14])<<16|(255&a[15])<<24,p=255&c[8]|(255&c[9])<<8|(255&c[10])<<16|(255&c[11])<<24,g=255&t[16]|(255&t[17])<<8|(255&t[18])<<16|(255&t[19])<<24,m=255&t[20]|(255&t[21])<<8|(255&t[22])<<16|(255&t[23])<<24,x=255&t[24]|(255&t[25])<<8|(255&t[26])<<16|(255&t[27])<<24,y=255&t[28]|(255&t[29])<<8|(255&t[30])<<16|(255&t[31])<<24,A=255&c[12]|(255&c[13])<<8|(255&c[14])<<16|(255&c[15])<<24,v=0;v<20;v+=2)d^=(f=(m^=(f=(u^=(f=(b^=(f=d+m|0)<<7|f>>>25)+d|0)<<9|f>>>23)+b|0)<<13|f>>>19)+u|0)<<18|f>>>14,o^=(f=(r^=(f=(x^=(f=(h^=(f=o+r|0)<<7|f>>>25)+o|0)<<9|f>>>23)+h|0)<<13|f>>>19)+x|0)<<18|f>>>14,p^=(f=(s^=(f=(n^=(f=(y^=(f=p+s|0)<<7|f>>>25)+p|0)<<9|f>>>23)+y|0)<<13|f>>>19)+n|0)<<18|f>>>14,A^=(f=(g^=(f=(l^=(f=(i^=(f=A+g|0)<<7|f>>>25)+A|0)<<9|f>>>23)+i|0)<<13|f>>>19)+l|0)<<18|f>>>14,d^=(f=(i^=(f=(n^=(f=(r^=(f=d+i|0)<<7|f>>>25)+d|0)<<9|f>>>23)+r|0)<<13|f>>>19)+n|0)<<18|f>>>14,o^=(f=(b^=(f=(l^=(f=(s^=(f=o+b|0)<<7|f>>>25)+o|0)<<9|f>>>23)+s|0)<<13|f>>>19)+l|0)<<18|f>>>14,p^=(f=(h^=(f=(u^=(f=(g^=(f=p+h|0)<<7|f>>>25)+p|0)<<9|f>>>23)+g|0)<<13|f>>>19)+u|0)<<18|f>>>14,A^=(f=(y^=(f=(x^=(f=(m^=(f=A+y|0)<<7|f>>>25)+A|0)<<9|f>>>23)+m|0)<<13|f>>>19)+x|0)<<18|f>>>14;e[0]=d>>>0&255,e[1]=d>>>8&255,e[2]=d>>>16&255,e[3]=d>>>24&255,e[4]=o>>>0&255,e[5]=o>>>8&255,e[6]=o>>>16&255,e[7]=o>>>24&255,e[8]=p>>>0&255,e[9]=p>>>8&255,e[10]=p>>>16&255,e[11]=p>>>24&255,e[12]=A>>>0&255,e[13]=A>>>8&255,e[14]=A>>>16&255,e[15]=A>>>24&255,e[16]=s>>>0&255,e[17]=s>>>8&255,e[18]=s>>>16&255,e[19]=s>>>24&255,e[20]=l>>>0&255,e[21]=l>>>8&255,e[22]=l>>>16&255,e[23]=l>>>24&255,e[24]=u>>>0&255,e[25]=u>>>8&255,e[26]=u>>>16&255,e[27]=u>>>24&255,e[28]=h>>>0&255,e[29]=h>>>8&255,e[30]=h>>>16&255,e[31]=h>>>24&255}(e,a,t,c)}var A=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function v(e,a,t,c,f,d,r){var n,i,b=new Uint8Array(16),o=new Uint8Array(64);for(i=0;i<16;i++)b[i]=0;for(i=0;i<8;i++)b[i]=d[i];for(;f>=64;){for(x(o,b,r,A),i=0;i<64;i++)e[a+i]=t[c+i]^o[i];for(n=1,i=8;i<16;i++)n=n+(255&b[i])|0,b[i]=255&n,n>>>=8;f-=64,a+=64,c+=64}if(f>0)for(x(o,b,r,A),i=0;i=64;){for(x(i,n,f,A),r=0;r<64;r++)e[a+r]=i[r];for(d=1,r=8;r<16;r++)d=d+(255&n[r])|0,n[r]=255&d,d>>>=8;t-=64,a+=64}if(t>0)for(x(i,n,f,A),r=0;r>>13|t<<3),c=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(t>>>10|c<<6),f=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(c>>>7|f<<9),d=255&e[8]|(255&e[9])<<8,this.r[4]=255&(f>>>4|d<<12),this.r[5]=d>>>1&8190,r=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(d>>>14|r<<2),n=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(r>>>11|n<<5),i=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(n>>>8|i<<8),this.r[9]=i>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function C(e,a,t,c,f,d){var r=new E(d);return r.update(t,c,f),r.finish(e,a),0}function M(e,a,t,c,f,d){var r=new Uint8Array(16);return C(r,0,t,c,f,d),g(e,a,r,0)}function B(e,a,t,c,f){var d;if(t<32)return-1;for(I(e,0,a,0,t,c,f),C(e,16,e,32,t-32,e),d=0;d<16;d++)e[d]=0;return 0}function k(e,a,t,c,f){var d,r=new Uint8Array(32);if(t<32)return-1;if(_(r,0,32,c,f),0!==M(a,16,a,32,t-32,r))return-1;for(I(e,0,a,0,t,c,f),d=0;d<32;d++)e[d]=0;return 0}function L(e,a){var t;for(t=0;t<16;t++)e[t]=0|a[t]}function S(e){var a,t,c=1;for(a=0;a<16;a++)t=e[a]+c+65535,c=Math.floor(t/65536),e[a]=t-65536*c;e[0]+=c-1+37*(c-1)}function T(e,a,t){for(var c,f=~(t-1),d=0;d<16;d++)c=f&(e[d]^a[d]),e[d]^=c,a[d]^=c}function N(e,t){var c,f,d,r=a(),n=a();for(c=0;c<16;c++)n[c]=t[c];for(S(n),S(n),S(n),f=0;f<2;f++){for(r[0]=n[0]-65517,c=1;c<15;c++)r[c]=n[c]-65535-(r[c-1]>>16&1),r[c-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1),d=r[15]>>16&1,r[14]&=65535,T(n,r,1-d)}for(c=0;c<16;c++)e[2*c]=255&n[c],e[2*c+1]=n[c]>>8}function R(e,a){var t=new Uint8Array(32),c=new Uint8Array(32);return N(t,e),N(c,a),m(t,0,c,0)}function P(e){var a=new Uint8Array(32);return N(a,e),1&a[0]}function D(e,a){var t;for(t=0;t<16;t++)e[t]=a[2*t]+(a[2*t+1]<<8);e[15]&=32767}function O(e,a,t){for(var c=0;c<16;c++)e[c]=a[c]+t[c]}function F(e,a,t){for(var c=0;c<16;c++)e[c]=a[c]-t[c]}function Q(e,a,t){var c,f,d=0,r=0,n=0,i=0,b=0,o=0,s=0,l=0,u=0,h=0,p=0,g=0,m=0,x=0,y=0,A=0,v=0,w=0,_=0,I=0,E=0,C=0,M=0,B=0,k=0,L=0,S=0,T=0,N=0,R=0,P=0,D=t[0],O=t[1],F=t[2],Q=t[3],U=t[4],j=t[5],H=t[6],q=t[7],$=t[8],z=t[9],G=t[10],K=t[11],V=t[12],Z=t[13],J=t[14],W=t[15];d+=(c=a[0])*D,r+=c*O,n+=c*F,i+=c*Q,b+=c*U,o+=c*j,s+=c*H,l+=c*q,u+=c*$,h+=c*z,p+=c*G,g+=c*K,m+=c*V,x+=c*Z,y+=c*J,A+=c*W,r+=(c=a[1])*D,n+=c*O,i+=c*F,b+=c*Q,o+=c*U,s+=c*j,l+=c*H,u+=c*q,h+=c*$,p+=c*z,g+=c*G,m+=c*K,x+=c*V,y+=c*Z,A+=c*J,v+=c*W,n+=(c=a[2])*D,i+=c*O,b+=c*F,o+=c*Q,s+=c*U,l+=c*j,u+=c*H,h+=c*q,p+=c*$,g+=c*z,m+=c*G,x+=c*K,y+=c*V,A+=c*Z,v+=c*J,w+=c*W,i+=(c=a[3])*D,b+=c*O,o+=c*F,s+=c*Q,l+=c*U,u+=c*j,h+=c*H,p+=c*q,g+=c*$,m+=c*z,x+=c*G,y+=c*K,A+=c*V,v+=c*Z,w+=c*J,_+=c*W,b+=(c=a[4])*D,o+=c*O,s+=c*F,l+=c*Q,u+=c*U,h+=c*j,p+=c*H,g+=c*q,m+=c*$,x+=c*z,y+=c*G,A+=c*K,v+=c*V,w+=c*Z,_+=c*J,I+=c*W,o+=(c=a[5])*D,s+=c*O,l+=c*F,u+=c*Q,h+=c*U,p+=c*j,g+=c*H,m+=c*q,x+=c*$,y+=c*z,A+=c*G,v+=c*K,w+=c*V,_+=c*Z,I+=c*J,E+=c*W,s+=(c=a[6])*D,l+=c*O,u+=c*F,h+=c*Q,p+=c*U,g+=c*j,m+=c*H,x+=c*q,y+=c*$,A+=c*z,v+=c*G,w+=c*K,_+=c*V,I+=c*Z,E+=c*J,C+=c*W,l+=(c=a[7])*D,u+=c*O,h+=c*F,p+=c*Q,g+=c*U,m+=c*j,x+=c*H,y+=c*q,A+=c*$,v+=c*z,w+=c*G,_+=c*K,I+=c*V,E+=c*Z,C+=c*J,M+=c*W,u+=(c=a[8])*D,h+=c*O,p+=c*F,g+=c*Q,m+=c*U,x+=c*j,y+=c*H,A+=c*q,v+=c*$,w+=c*z,_+=c*G,I+=c*K,E+=c*V,C+=c*Z,M+=c*J,B+=c*W,h+=(c=a[9])*D,p+=c*O,g+=c*F,m+=c*Q,x+=c*U,y+=c*j,A+=c*H,v+=c*q,w+=c*$,_+=c*z,I+=c*G,E+=c*K,C+=c*V,M+=c*Z,B+=c*J,k+=c*W,p+=(c=a[10])*D,g+=c*O,m+=c*F,x+=c*Q,y+=c*U,A+=c*j,v+=c*H,w+=c*q,_+=c*$,I+=c*z,E+=c*G,C+=c*K,M+=c*V,B+=c*Z,k+=c*J,L+=c*W,g+=(c=a[11])*D,m+=c*O,x+=c*F,y+=c*Q,A+=c*U,v+=c*j,w+=c*H,_+=c*q,I+=c*$,E+=c*z,C+=c*G,M+=c*K,B+=c*V,k+=c*Z,L+=c*J,S+=c*W,m+=(c=a[12])*D,x+=c*O,y+=c*F,A+=c*Q,v+=c*U,w+=c*j,_+=c*H,I+=c*q,E+=c*$,C+=c*z,M+=c*G,B+=c*K,k+=c*V,L+=c*Z,S+=c*J,T+=c*W,x+=(c=a[13])*D,y+=c*O,A+=c*F,v+=c*Q,w+=c*U,_+=c*j,I+=c*H,E+=c*q,C+=c*$,M+=c*z,B+=c*G,k+=c*K,L+=c*V,S+=c*Z,T+=c*J,N+=c*W,y+=(c=a[14])*D,A+=c*O,v+=c*F,w+=c*Q,_+=c*U,I+=c*j,E+=c*H,C+=c*q,M+=c*$,B+=c*z,k+=c*G,L+=c*K,S+=c*V,T+=c*Z,N+=c*J,R+=c*W,A+=(c=a[15])*D,r+=38*(w+=c*F),n+=38*(_+=c*Q),i+=38*(I+=c*U),b+=38*(E+=c*j),o+=38*(C+=c*H),s+=38*(M+=c*q),l+=38*(B+=c*$),u+=38*(k+=c*z),h+=38*(L+=c*G),p+=38*(S+=c*K),g+=38*(T+=c*V),m+=38*(N+=c*Z),x+=38*(R+=c*J),y+=38*(P+=c*W),d=(c=(d+=38*(v+=c*O))+(f=1)+65535)-65536*(f=Math.floor(c/65536)),r=(c=r+f+65535)-65536*(f=Math.floor(c/65536)),n=(c=n+f+65535)-65536*(f=Math.floor(c/65536)),i=(c=i+f+65535)-65536*(f=Math.floor(c/65536)),b=(c=b+f+65535)-65536*(f=Math.floor(c/65536)),o=(c=o+f+65535)-65536*(f=Math.floor(c/65536)),s=(c=s+f+65535)-65536*(f=Math.floor(c/65536)),l=(c=l+f+65535)-65536*(f=Math.floor(c/65536)),u=(c=u+f+65535)-65536*(f=Math.floor(c/65536)),h=(c=h+f+65535)-65536*(f=Math.floor(c/65536)),p=(c=p+f+65535)-65536*(f=Math.floor(c/65536)),g=(c=g+f+65535)-65536*(f=Math.floor(c/65536)),m=(c=m+f+65535)-65536*(f=Math.floor(c/65536)),x=(c=x+f+65535)-65536*(f=Math.floor(c/65536)),y=(c=y+f+65535)-65536*(f=Math.floor(c/65536)),A=(c=A+f+65535)-65536*(f=Math.floor(c/65536)),d=(c=(d+=f-1+37*(f-1))+(f=1)+65535)-65536*(f=Math.floor(c/65536)),r=(c=r+f+65535)-65536*(f=Math.floor(c/65536)),n=(c=n+f+65535)-65536*(f=Math.floor(c/65536)),i=(c=i+f+65535)-65536*(f=Math.floor(c/65536)),b=(c=b+f+65535)-65536*(f=Math.floor(c/65536)),o=(c=o+f+65535)-65536*(f=Math.floor(c/65536)),s=(c=s+f+65535)-65536*(f=Math.floor(c/65536)),l=(c=l+f+65535)-65536*(f=Math.floor(c/65536)),u=(c=u+f+65535)-65536*(f=Math.floor(c/65536)),h=(c=h+f+65535)-65536*(f=Math.floor(c/65536)),p=(c=p+f+65535)-65536*(f=Math.floor(c/65536)),g=(c=g+f+65535)-65536*(f=Math.floor(c/65536)),m=(c=m+f+65535)-65536*(f=Math.floor(c/65536)),x=(c=x+f+65535)-65536*(f=Math.floor(c/65536)),y=(c=y+f+65535)-65536*(f=Math.floor(c/65536)),A=(c=A+f+65535)-65536*(f=Math.floor(c/65536)),d+=f-1+37*(f-1),e[0]=d,e[1]=r,e[2]=n,e[3]=i,e[4]=b,e[5]=o,e[6]=s,e[7]=l,e[8]=u,e[9]=h,e[10]=p,e[11]=g,e[12]=m,e[13]=x,e[14]=y,e[15]=A}function U(e,a){Q(e,a,a)}function j(e,t){var c,f=a();for(c=0;c<16;c++)f[c]=t[c];for(c=253;c>=0;c--)U(f,f),2!==c&&4!==c&&Q(f,f,t);for(c=0;c<16;c++)e[c]=f[c]}function H(e,t){var c,f=a();for(c=0;c<16;c++)f[c]=t[c];for(c=250;c>=0;c--)U(f,f),1!==c&&Q(f,f,t);for(c=0;c<16;c++)e[c]=f[c]}function q(e,t,c){var f,d,r=new Uint8Array(32),n=new Float64Array(80),b=a(),o=a(),s=a(),l=a(),u=a(),h=a();for(d=0;d<31;d++)r[d]=t[d];for(r[31]=127&t[31]|64,r[0]&=248,D(n,c),d=0;d<16;d++)o[d]=n[d],l[d]=b[d]=s[d]=0;for(b[0]=l[0]=1,d=254;d>=0;--d)T(b,o,f=r[d>>>3]>>>(7&d)&1),T(s,l,f),O(u,b,s),F(b,b,s),O(s,o,l),F(o,o,l),U(l,u),U(h,b),Q(b,s,b),Q(s,o,u),O(u,b,s),F(b,b,s),U(o,b),F(s,l,h),Q(b,s,i),O(b,b,l),Q(s,s,b),Q(b,l,h),Q(l,o,n),U(o,u),T(b,o,f),T(s,l,f);for(d=0;d<16;d++)n[d+16]=b[d],n[d+32]=s[d],n[d+48]=o[d],n[d+64]=l[d];var p=n.subarray(32),g=n.subarray(16);return j(p,p),Q(g,g,p),N(e,g),0}function $(e,a){return q(e,a,d)}function z(e,a){return c(a,32),$(e,a)}function G(e,a,t){var c=new Uint8Array(32);return q(c,t,a),y(e,f,c,A)}E.prototype.blocks=function(e,a,t){for(var c,f,d,r,n,i,b,o,s,l,u,h,p,g,m,x,y,A,v,w=this.fin?0:2048,_=this.h[0],I=this.h[1],E=this.h[2],C=this.h[3],M=this.h[4],B=this.h[5],k=this.h[6],L=this.h[7],S=this.h[8],T=this.h[9],N=this.r[0],R=this.r[1],P=this.r[2],D=this.r[3],O=this.r[4],F=this.r[5],Q=this.r[6],U=this.r[7],j=this.r[8],H=this.r[9];t>=16;)l=s=0,l+=(_+=8191&(c=255&e[a+0]|(255&e[a+1])<<8))*N,l+=(I+=8191&(c>>>13|(f=255&e[a+2]|(255&e[a+3])<<8)<<3))*(5*H),l+=(E+=8191&(f>>>10|(d=255&e[a+4]|(255&e[a+5])<<8)<<6))*(5*j),l+=(C+=8191&(d>>>7|(r=255&e[a+6]|(255&e[a+7])<<8)<<9))*(5*U),s=(l+=(M+=8191&(r>>>4|(n=255&e[a+8]|(255&e[a+9])<<8)<<12))*(5*Q))>>>13,l&=8191,l+=(B+=n>>>1&8191)*(5*F),l+=(k+=8191&(n>>>14|(i=255&e[a+10]|(255&e[a+11])<<8)<<2))*(5*O),l+=(L+=8191&(i>>>11|(b=255&e[a+12]|(255&e[a+13])<<8)<<5))*(5*D),l+=(S+=8191&(b>>>8|(o=255&e[a+14]|(255&e[a+15])<<8)<<8))*(5*P),u=s+=(l+=(T+=o>>>5|w)*(5*R))>>>13,u+=_*R,u+=I*N,u+=E*(5*H),u+=C*(5*j),s=(u+=M*(5*U))>>>13,u&=8191,u+=B*(5*Q),u+=k*(5*F),u+=L*(5*O),u+=S*(5*D),s+=(u+=T*(5*P))>>>13,u&=8191,h=s,h+=_*P,h+=I*R,h+=E*N,h+=C*(5*H),s=(h+=M*(5*j))>>>13,h&=8191,h+=B*(5*U),h+=k*(5*Q),h+=L*(5*F),h+=S*(5*O),p=s+=(h+=T*(5*D))>>>13,p+=_*D,p+=I*P,p+=E*R,p+=C*N,s=(p+=M*(5*H))>>>13,p&=8191,p+=B*(5*j),p+=k*(5*U),p+=L*(5*Q),p+=S*(5*F),g=s+=(p+=T*(5*O))>>>13,g+=_*O,g+=I*D,g+=E*P,g+=C*R,s=(g+=M*N)>>>13,g&=8191,g+=B*(5*H),g+=k*(5*j),g+=L*(5*U),g+=S*(5*Q),m=s+=(g+=T*(5*F))>>>13,m+=_*F,m+=I*O,m+=E*D,m+=C*P,s=(m+=M*R)>>>13,m&=8191,m+=B*N,m+=k*(5*H),m+=L*(5*j),m+=S*(5*U),x=s+=(m+=T*(5*Q))>>>13,x+=_*Q,x+=I*F,x+=E*O,x+=C*D,s=(x+=M*P)>>>13,x&=8191,x+=B*R,x+=k*N,x+=L*(5*H),x+=S*(5*j),y=s+=(x+=T*(5*U))>>>13,y+=_*U,y+=I*Q,y+=E*F,y+=C*O,s=(y+=M*D)>>>13,y&=8191,y+=B*P,y+=k*R,y+=L*N,y+=S*(5*H),A=s+=(y+=T*(5*j))>>>13,A+=_*j,A+=I*U,A+=E*Q,A+=C*F,s=(A+=M*O)>>>13,A&=8191,A+=B*D,A+=k*P,A+=L*R,A+=S*N,v=s+=(A+=T*(5*H))>>>13,v+=_*H,v+=I*j,v+=E*U,v+=C*Q,s=(v+=M*F)>>>13,v&=8191,v+=B*O,v+=k*D,v+=L*P,v+=S*R,_=l=8191&(s=(s=((s+=(v+=T*N)>>>13)<<2)+s|0)+(l&=8191)|0),I=u+=s>>>=13,E=h&=8191,C=p&=8191,M=g&=8191,B=m&=8191,k=x&=8191,L=y&=8191,S=A&=8191,T=v&=8191,a+=16,t-=16;this.h[0]=_,this.h[1]=I,this.h[2]=E,this.h[3]=C,this.h[4]=M,this.h[5]=B,this.h[6]=k,this.h[7]=L,this.h[8]=S,this.h[9]=T},E.prototype.finish=function(e,a){var t,c,f,d,r=new Uint16Array(10);if(this.leftover){for(d=this.leftover,this.buffer[d++]=1;d<16;d++)this.buffer[d]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(t=this.h[1]>>>13,this.h[1]&=8191,d=2;d<10;d++)this.h[d]+=t,t=this.h[d]>>>13,this.h[d]&=8191;for(this.h[0]+=5*t,t=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=t,t=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=t,r[0]=this.h[0]+5,t=r[0]>>>13,r[0]&=8191,d=1;d<10;d++)r[d]=this.h[d]+t,t=r[d]>>>13,r[d]&=8191;for(r[9]-=8192,c=(1^t)-1,d=0;d<10;d++)r[d]&=c;for(c=~c,d=0;d<10;d++)this.h[d]=this.h[d]&c|r[d];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),f=this.h[0]+this.pad[0],this.h[0]=65535&f,d=1;d<8;d++)f=(this.h[d]+this.pad[d]|0)+(f>>>16)|0,this.h[d]=65535&f;e[a+0]=this.h[0]>>>0&255,e[a+1]=this.h[0]>>>8&255,e[a+2]=this.h[1]>>>0&255,e[a+3]=this.h[1]>>>8&255,e[a+4]=this.h[2]>>>0&255,e[a+5]=this.h[2]>>>8&255,e[a+6]=this.h[3]>>>0&255,e[a+7]=this.h[3]>>>8&255,e[a+8]=this.h[4]>>>0&255,e[a+9]=this.h[4]>>>8&255,e[a+10]=this.h[5]>>>0&255,e[a+11]=this.h[5]>>>8&255,e[a+12]=this.h[6]>>>0&255,e[a+13]=this.h[6]>>>8&255,e[a+14]=this.h[7]>>>0&255,e[a+15]=this.h[7]>>>8&255},E.prototype.update=function(e,a,t){var c,f;if(this.leftover){for((f=16-this.leftover)>t&&(f=t),c=0;c=16&&(f=t-t%16,this.blocks(e,a,f),a+=f,t-=f),t){for(c=0;c=128;){for(w=0;w<16;w++)_=8*w+V,L[w]=t[_+0]<<24|t[_+1]<<16|t[_+2]<<8|t[_+3],S[w]=t[_+4]<<24|t[_+5]<<16|t[_+6]<<8|t[_+7];for(w=0;w<80;w++)if(f=T,d=N,r=R,n=P,i=D,b=O,o=F,l=U,u=j,h=H,p=q,g=$,m=z,x=G,C=65535&(E=K),M=E>>>16,B=65535&(I=Q),k=I>>>16,C+=65535&(E=($>>>14|D<<18)^($>>>18|D<<14)^(D>>>9|$<<23)),M+=E>>>16,B+=65535&(I=(D>>>14|$<<18)^(D>>>18|$<<14)^($>>>9|D<<23)),k+=I>>>16,C+=65535&(E=$&z^~$&G),M+=E>>>16,B+=65535&(I=D&O^~D&F),k+=I>>>16,C+=65535&(E=Z[2*w+1]),M+=E>>>16,B+=65535&(I=Z[2*w]),k+=I>>>16,I=L[w%16],M+=(E=S[w%16])>>>16,B+=65535&I,k+=I>>>16,B+=(M+=(C+=65535&E)>>>16)>>>16,C=65535&(E=v=65535&C|M<<16),M=E>>>16,B=65535&(I=A=65535&B|(k+=B>>>16)<<16),k=I>>>16,C+=65535&(E=(U>>>28|T<<4)^(T>>>2|U<<30)^(T>>>7|U<<25)),M+=E>>>16,B+=65535&(I=(T>>>28|U<<4)^(U>>>2|T<<30)^(U>>>7|T<<25)),k+=I>>>16,M+=(E=U&j^U&H^j&H)>>>16,B+=65535&(I=T&N^T&R^N&R),k+=I>>>16,s=65535&(B+=(M+=(C+=65535&E)>>>16)>>>16)|(k+=B>>>16)<<16,y=65535&C|M<<16,C=65535&(E=p),M=E>>>16,B=65535&(I=n),k=I>>>16,M+=(E=v)>>>16,B+=65535&(I=A),k+=I>>>16,N=f,R=d,P=r,D=n=65535&(B+=(M+=(C+=65535&E)>>>16)>>>16)|(k+=B>>>16)<<16,O=i,F=b,Q=o,T=s,j=l,H=u,q=h,$=p=65535&C|M<<16,z=g,G=m,K=x,U=y,w%16==15)for(_=0;_<16;_++)I=L[_],C=65535&(E=S[_]),M=E>>>16,B=65535&I,k=I>>>16,I=L[(_+9)%16],C+=65535&(E=S[(_+9)%16]),M+=E>>>16,B+=65535&I,k+=I>>>16,A=L[(_+1)%16],C+=65535&(E=((v=S[(_+1)%16])>>>1|A<<31)^(v>>>8|A<<24)^(v>>>7|A<<25)),M+=E>>>16,B+=65535&(I=(A>>>1|v<<31)^(A>>>8|v<<24)^A>>>7),k+=I>>>16,A=L[(_+14)%16],M+=(E=((v=S[(_+14)%16])>>>19|A<<13)^(A>>>29|v<<3)^(v>>>6|A<<26))>>>16,B+=65535&(I=(A>>>19|v<<13)^(v>>>29|A<<3)^A>>>6),k+=I>>>16,k+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,L[_]=65535&B|k<<16,S[_]=65535&C|M<<16;C=65535&(E=U),M=E>>>16,B=65535&(I=T),k=I>>>16,I=e[0],M+=(E=a[0])>>>16,B+=65535&I,k+=I>>>16,k+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[0]=T=65535&B|k<<16,a[0]=U=65535&C|M<<16,C=65535&(E=j),M=E>>>16,B=65535&(I=N),k=I>>>16,I=e[1],M+=(E=a[1])>>>16,B+=65535&I,k+=I>>>16,k+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[1]=N=65535&B|k<<16,a[1]=j=65535&C|M<<16,C=65535&(E=H),M=E>>>16,B=65535&(I=R),k=I>>>16,I=e[2],M+=(E=a[2])>>>16,B+=65535&I,k+=I>>>16,k+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[2]=R=65535&B|k<<16,a[2]=H=65535&C|M<<16,C=65535&(E=q),M=E>>>16,B=65535&(I=P),k=I>>>16,I=e[3],M+=(E=a[3])>>>16,B+=65535&I,k+=I>>>16,k+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[3]=P=65535&B|k<<16,a[3]=q=65535&C|M<<16,C=65535&(E=$),M=E>>>16,B=65535&(I=D),k=I>>>16,I=e[4],M+=(E=a[4])>>>16,B+=65535&I,k+=I>>>16,k+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[4]=D=65535&B|k<<16,a[4]=$=65535&C|M<<16,C=65535&(E=z),M=E>>>16,B=65535&(I=O),k=I>>>16,I=e[5],M+=(E=a[5])>>>16,B+=65535&I,k+=I>>>16,k+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[5]=O=65535&B|k<<16,a[5]=z=65535&C|M<<16,C=65535&(E=G),M=E>>>16,B=65535&(I=F),k=I>>>16,I=e[6],M+=(E=a[6])>>>16,B+=65535&I,k+=I>>>16,k+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[6]=F=65535&B|k<<16,a[6]=G=65535&C|M<<16,C=65535&(E=K),M=E>>>16,B=65535&(I=Q),k=I>>>16,I=e[7],M+=(E=a[7])>>>16,B+=65535&I,k+=I>>>16,k+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[7]=Q=65535&B|k<<16,a[7]=K=65535&C|M<<16,V+=128,c-=128}return c}function W(e,a,t){var c,f=new Int32Array(8),d=new Int32Array(8),r=new Uint8Array(256),n=t;for(f[0]=1779033703,f[1]=3144134277,f[2]=1013904242,f[3]=2773480762,f[4]=1359893119,f[5]=2600822924,f[6]=528734635,f[7]=1541459225,d[0]=4089235720,d[1]=2227873595,d[2]=4271175723,d[3]=1595750129,d[4]=2917565137,d[5]=725511199,d[6]=4215389547,d[7]=327033209,J(f,d,a,t),t%=128,c=0;c=0;--f)X(e,a,c=t[f/8|0]>>(7&f)&1),Y(a,e),Y(e,e),X(e,a,c)}function te(e,t){var c=[a(),a(),a(),a()];L(c[0],s),L(c[1],l),L(c[2],n),Q(c[3],s,l),ae(e,c,t)}function ce(e,t,f){var d,r=new Uint8Array(64),n=[a(),a(),a(),a()];for(f||c(t,32),W(r,t,32),r[0]&=248,r[31]&=127,r[31]|=64,te(n,r),ee(e,n),d=0;d<32;d++)t[d+32]=e[d];return 0}var fe=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 de(e,a){var t,c,f,d;for(c=63;c>=32;--c){for(t=0,f=c-32,d=c-12;f>4)*fe[f],t=a[f]>>8,a[f]&=255;for(f=0;f<32;f++)a[f]-=t*fe[f];for(c=0;c<32;c++)a[c+1]+=a[c]>>8,e[c]=255&a[c]}function re(e){var a,t=new Float64Array(64);for(a=0;a<64;a++)t[a]=e[a];for(a=0;a<64;a++)e[a]=0;de(e,t)}function ne(e,t,c,f){var d,r,n=new Uint8Array(64),i=new Uint8Array(64),b=new Uint8Array(64),o=new Float64Array(64),s=[a(),a(),a(),a()];W(n,f,32),n[0]&=248,n[31]&=127,n[31]|=64;var l=c+64;for(d=0;d>7&&F(e[0],r,e[0]),Q(e[3],e[0],e[1]),0)}(l,f))return-1;for(d=0;d=0},e.sign.keyPair=function(){var e=new Uint8Array(oe),a=new Uint8Array(se);return ce(e,a),{publicKey:e,secretKey:a}},e.sign.keyPair.fromSecretKey=function(e){if(ue(e),e.length!==se)throw new Error("bad secret key size");for(var a=new Uint8Array(oe),t=0;t{function c(e){try{if(!t.g.localStorage)return!1}catch(e){return!1}var a=t.g.localStorage[e];return null!=a&&"true"===String(a).toLowerCase()}e.exports=function(e,a){if(c("noDeprecation"))return e;var t=!1;return function(){if(!t){if(c("throwDeprecation"))throw new Error(a);c("traceDeprecation")?console.trace(a):console.warn(a),t=!0}return e.apply(this,arguments)}}},81135:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},49032:(e,a,t)=>{"use strict";var c=t(47244),f=t(48184),d=t(25767),r=t(35680);function n(e){return e.call.bind(e)}var i="undefined"!=typeof BigInt,b="undefined"!=typeof Symbol,o=n(Object.prototype.toString),s=n(Number.prototype.valueOf),l=n(String.prototype.valueOf),u=n(Boolean.prototype.valueOf);if(i)var h=n(BigInt.prototype.valueOf);if(b)var p=n(Symbol.prototype.valueOf);function g(e,a){if("object"!=typeof e)return!1;try{return a(e),!0}catch(e){return!1}}function m(e){return"[object Map]"===o(e)}function x(e){return"[object Set]"===o(e)}function y(e){return"[object WeakMap]"===o(e)}function A(e){return"[object WeakSet]"===o(e)}function v(e){return"[object ArrayBuffer]"===o(e)}function w(e){return"undefined"!=typeof ArrayBuffer&&(v.working?v(e):e instanceof ArrayBuffer)}function _(e){return"[object DataView]"===o(e)}function I(e){return"undefined"!=typeof DataView&&(_.working?_(e):e instanceof DataView)}a.isArgumentsObject=c,a.isGeneratorFunction=f,a.isTypedArray=r,a.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},a.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):r(e)||I(e)},a.isUint8Array=function(e){return"Uint8Array"===d(e)},a.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===d(e)},a.isUint16Array=function(e){return"Uint16Array"===d(e)},a.isUint32Array=function(e){return"Uint32Array"===d(e)},a.isInt8Array=function(e){return"Int8Array"===d(e)},a.isInt16Array=function(e){return"Int16Array"===d(e)},a.isInt32Array=function(e){return"Int32Array"===d(e)},a.isFloat32Array=function(e){return"Float32Array"===d(e)},a.isFloat64Array=function(e){return"Float64Array"===d(e)},a.isBigInt64Array=function(e){return"BigInt64Array"===d(e)},a.isBigUint64Array=function(e){return"BigUint64Array"===d(e)},m.working="undefined"!=typeof Map&&m(new Map),a.isMap=function(e){return"undefined"!=typeof Map&&(m.working?m(e):e instanceof Map)},x.working="undefined"!=typeof Set&&x(new Set),a.isSet=function(e){return"undefined"!=typeof Set&&(x.working?x(e):e instanceof Set)},y.working="undefined"!=typeof WeakMap&&y(new WeakMap),a.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(y.working?y(e):e instanceof WeakMap)},A.working="undefined"!=typeof WeakSet&&A(new WeakSet),a.isWeakSet=function(e){return A(e)},v.working="undefined"!=typeof ArrayBuffer&&v(new ArrayBuffer),a.isArrayBuffer=w,_.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&_(new DataView(new ArrayBuffer(1),0,1)),a.isDataView=I;var E="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function C(e){return"[object SharedArrayBuffer]"===o(e)}function M(e){return void 0!==E&&(void 0===C.working&&(C.working=C(new E)),C.working?C(e):e instanceof E)}function B(e){return g(e,s)}function k(e){return g(e,l)}function L(e){return g(e,u)}function S(e){return i&&g(e,h)}function T(e){return b&&g(e,p)}a.isSharedArrayBuffer=M,a.isAsyncFunction=function(e){return"[object AsyncFunction]"===o(e)},a.isMapIterator=function(e){return"[object Map Iterator]"===o(e)},a.isSetIterator=function(e){return"[object Set Iterator]"===o(e)},a.isGeneratorObject=function(e){return"[object Generator]"===o(e)},a.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===o(e)},a.isNumberObject=B,a.isStringObject=k,a.isBooleanObject=L,a.isBigIntObject=S,a.isSymbolObject=T,a.isBoxedPrimitive=function(e){return B(e)||k(e)||L(e)||S(e)||T(e)},a.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(w(e)||M(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(a,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},40537:(e,a,t)=>{var c=Object.getOwnPropertyDescriptors||function(e){for(var a=Object.keys(e),t={},c=0;c=d)return e;switch(e){case"%s":return String(c[t++]);case"%d":return Number(c[t++]);case"%j":try{return JSON.stringify(c[t++])}catch(e){return"[Circular]"}default:return e}})),n=c[t];t=3&&(c.depth=arguments[2]),arguments.length>=4&&(c.colors=arguments[3]),p(t)?c.showHidden=t:t&&a._extend(c,t),y(c.showHidden)&&(c.showHidden=!1),y(c.depth)&&(c.depth=2),y(c.colors)&&(c.colors=!1),y(c.customInspect)&&(c.customInspect=!0),c.colors&&(c.stylize=b),s(c,e,c.depth)}function b(e,a){var t=i.styles[a];return t?"["+i.colors[t][0]+"m"+e+"["+i.colors[t][1]+"m":e}function o(e,a){return e}function s(e,t,c){if(e.customInspect&&t&&I(t.inspect)&&t.inspect!==a.inspect&&(!t.constructor||t.constructor.prototype!==t)){var f=t.inspect(c,e);return x(f)||(f=s(e,f,c)),f}var d=function(e,a){if(y(a))return e.stylize("undefined","undefined");if(x(a)){var t="'"+JSON.stringify(a).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(t,"string")}return m(a)?e.stylize(""+a,"number"):p(a)?e.stylize(""+a,"boolean"):g(a)?e.stylize("null","null"):void 0}(e,t);if(d)return d;var r=Object.keys(t),n=function(e){var a={};return e.forEach((function(e,t){a[e]=!0})),a}(r);if(e.showHidden&&(r=Object.getOwnPropertyNames(t)),_(t)&&(r.indexOf("message")>=0||r.indexOf("description")>=0))return l(t);if(0===r.length){if(I(t)){var i=t.name?": "+t.name:"";return e.stylize("[Function"+i+"]","special")}if(A(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(w(t))return e.stylize(Date.prototype.toString.call(t),"date");if(_(t))return l(t)}var b,o="",v=!1,E=["{","}"];return h(t)&&(v=!0,E=["[","]"]),I(t)&&(o=" [Function"+(t.name?": "+t.name:"")+"]"),A(t)&&(o=" "+RegExp.prototype.toString.call(t)),w(t)&&(o=" "+Date.prototype.toUTCString.call(t)),_(t)&&(o=" "+l(t)),0!==r.length||v&&0!=t.length?c<0?A(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),b=v?function(e,a,t,c,f){for(var d=[],r=0,n=a.length;r60?t[0]+(""===a?"":a+"\n ")+" "+e.join(",\n ")+" "+t[1]:t[0]+a+" "+e.join(", ")+" "+t[1]}(b,o,E)):E[0]+o+E[1]}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function u(e,a,t,c,f,d){var r,n,i;if((i=Object.getOwnPropertyDescriptor(a,f)||{value:a[f]}).get?n=i.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):i.set&&(n=e.stylize("[Setter]","special")),B(c,f)||(r="["+f+"]"),n||(e.seen.indexOf(i.value)<0?(n=g(t)?s(e,i.value,null):s(e,i.value,t-1)).indexOf("\n")>-1&&(n=d?n.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+n.split("\n").map((function(e){return" "+e})).join("\n")):n=e.stylize("[Circular]","special")),y(r)){if(d&&f.match(/^\d+$/))return n;(r=JSON.stringify(""+f)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(r=r.slice(1,-1),r=e.stylize(r,"name")):(r=r.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),r=e.stylize(r,"string"))}return r+": "+n}function h(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function g(e){return null===e}function m(e){return"number"==typeof e}function x(e){return"string"==typeof e}function y(e){return void 0===e}function A(e){return v(e)&&"[object RegExp]"===E(e)}function v(e){return"object"==typeof e&&null!==e}function w(e){return v(e)&&"[object Date]"===E(e)}function _(e){return v(e)&&("[object Error]"===E(e)||e instanceof Error)}function I(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function C(e){return e<10?"0"+e.toString(10):e.toString(10)}a.debuglog=function(e){if(e=e.toUpperCase(),!d[e])if(r.test(e)){var t=process.pid;d[e]=function(){var c=a.format.apply(a,arguments);console.error("%s %d: %s",e,t,c)}}else d[e]=function(){};return d[e]},a.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},a.types=t(49032),a.isArray=h,a.isBoolean=p,a.isNull=g,a.isNullOrUndefined=function(e){return null==e},a.isNumber=m,a.isString=x,a.isSymbol=function(e){return"symbol"==typeof e},a.isUndefined=y,a.isRegExp=A,a.types.isRegExp=A,a.isObject=v,a.isDate=w,a.types.isDate=w,a.isError=_,a.types.isNativeError=_,a.isFunction=I,a.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},a.isBuffer=t(81135);var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function B(e,a){return Object.prototype.hasOwnProperty.call(e,a)}a.log=function(){var e,t;console.log("%s - %s",(t=[C((e=new Date).getHours()),C(e.getMinutes()),C(e.getSeconds())].join(":"),[e.getDate(),M[e.getMonth()],t].join(" ")),a.format.apply(a,arguments))},a.inherits=t(56698),a._extend=function(e,a){if(!a||!v(a))return e;for(var t=Object.keys(a),c=t.length;c--;)e[t[c]]=a[t[c]];return e};var k="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function L(e,a){if(!e){var t=new Error("Promise was rejected with a falsy value");t.reason=e,e=t}return a(e)}a.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(k&&e[k]){var a;if("function"!=typeof(a=e[k]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(a,k,{value:a,enumerable:!1,writable:!1,configurable:!0}),a}function a(){for(var a,t,c=new Promise((function(e,c){a=e,t=c})),f=[],d=0;d{e.exports=function e(c,f){var d,r=0,n=0,i=f=f||0,b=c.length;do{if(i>=b)throw e.bytes=0,new RangeError("Could not decode varint");d=c[i++],r+=n<28?(d&t)<=a);return e.bytes=i-f,r};var a=128,t=127},81877:e=>{e.exports=function e(f,d,r){d=d||[];for(var n=r=r||0;f>=c;)d[r++]=255&f|a,f/=128;for(;f&t;)d[r++]=255&f|a,f>>>=7;return d[r]=0|f,e.bytes=r-n+1,d};var a=128,t=-128,c=Math.pow(2,31)},61203:(e,a,t)=>{e.exports={encode:t(81877),decode:t(26797),encodingLength:t(37867)}},37867:e=>{var a=Math.pow(2,7),t=Math.pow(2,14),c=Math.pow(2,21),f=Math.pow(2,28),d=Math.pow(2,35),r=Math.pow(2,42),n=Math.pow(2,49),i=Math.pow(2,56),b=Math.pow(2,63);e.exports=function(e){return e{var indexOf=function(e,a){if(e.indexOf)return e.indexOf(a);for(var t=0;t{"use strict";a.TextEncoder="undefined"!=typeof TextEncoder?TextEncoder:t(40537).TextEncoder,a.TextDecoder="undefined"!=typeof TextDecoder?TextDecoder:t(40537).TextDecoder},25767:(e,a,t)=>{"use strict";var c=t(82682),f=t(39209),d=t(10487),r=t(38075),n=t(75795),i=r("Object.prototype.toString"),b=t(49092)(),o="undefined"==typeof globalThis?t.g:globalThis,s=f(),l=r("String.prototype.slice"),u=Object.getPrototypeOf,h=r("Array.prototype.indexOf",!0)||function(e,a){for(var t=0;t-1?a:"Object"===a&&function(e){var a=!1;return c(p,(function(t,c){if(!a)try{t(e),a=l(c,1)}catch(e){}})),a}(e)}return n?function(e){var a=!1;return c(p,(function(t,c){if(!a)try{"$"+t(e)===c&&(a=l(c,1))}catch(e){}})),a}(e):null}},57510:e=>{e.exports=function(){for(var e={},t=0;t{},78982:()=>{},47790:()=>{},73776:()=>{},21638:()=>{},92668:()=>{},77965:()=>{},66089:()=>{},79368:()=>{},23276:()=>{},59676:()=>{},64688:()=>{},51069:()=>{},15340:()=>{},79838:()=>{},59817:()=>{},71281:()=>{},60513:()=>{},2378:()=>{},60290:()=>{},47882:()=>{},27754:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.StructError=void 0;class t extends TypeError{constructor(e,a){let t;const{message:c,explanation:f,...d}=e,{path:r}=e,n=0===r.length?c:`At path: ${r.join(".")} -- ${c}`;super(f??n),null!=f&&(this.cause=n),Object.assign(this,d),this.name=this.constructor.name,this.failures=()=>t??(t=[e,...a()])}}a.StructError=t},35620:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),f(t(27754),a),f(t(99067),a),f(t(91704),a),f(t(50401),a),f(t(67792),a),f(t(65991),a)},99067:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.validate=a.is=a.mask=a.create=a.assert=a.Struct=void 0;const c=t(27754),f=t(70639);function d(e,a,t){const c=b(e,a,{message:t});if(c[0])throw c[0]}function r(e,a,t){const c=b(e,a,{coerce:!0,message:t});if(c[0])throw c[0];return c[1]}function n(e,a,t){const c=b(e,a,{coerce:!0,mask:!0,message:t});if(c[0])throw c[0];return c[1]}function i(e,a){return!b(e,a)[0]}function b(e,a,t={}){const d=(0,f.run)(e,a,t),r=(0,f.shiftIterator)(d);return r[0]?[new c.StructError(r[0],(function*(){for(const e of d)e[0]&&(yield e[0])})),void 0]:[void 0,r[1]]}a.Struct=class{constructor(e){const{type:a,schema:t,validator:c,refiner:d,coercer:r=e=>e,entries:n=function*(){}}=e;this.type=a,this.schema=t,this.entries=n,this.coercer=r,this.validator=c?(e,a)=>{const t=c(e,a);return(0,f.toFailures)(t,a,this,e)}:()=>[],this.refiner=d?(e,a)=>{const t=d(e,a);return(0,f.toFailures)(t,a,this,e)}:()=>[]}assert(e,a){return d(e,this,a)}create(e,a){return r(e,this,a)}is(e){return i(e,this)}mask(e,a){return n(e,this,a)}validate(e,a={}){return b(e,this,a)}},a.assert=d,a.create=r,a.mask=n,a.is=i,a.validate=b},91704:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.trimmed=a.defaulted=a.coerce=void 0;const c=t(99067),f=t(70639),d=t(67792);function r(e,a,t){return new c.Struct({...e,coercer:(f,d)=>(0,c.is)(f,a)?e.coercer(t(f,d),d):e.coercer(f,d)})}a.coerce=r,a.defaulted=function(e,a,t={}){return r(e,(0,d.unknown)(),(e=>{const c="function"==typeof a?a():a;if(void 0===e)return c;if(!t.strict&&(0,f.isPlainObject)(e)&&(0,f.isPlainObject)(c)){const a={...e};let t=!1;for(const e in c)void 0===a[e]&&(a[e]=c[e],t=!0);if(t)return a}return e}))},a.trimmed=function(e){return r(e,(0,d.string)(),(e=>e.trim()))}},50401:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.refine=a.size=a.pattern=a.nonempty=a.min=a.max=a.empty=void 0;const c=t(99067),f=t(70639);function d(e){return e instanceof Map||e instanceof Set?e.size:e.length}function r(e,a,t){return new c.Struct({...e,*refiner(c,d){yield*e.refiner(c,d);const r=t(c,d),n=(0,f.toFailures)(r,d,e,c);for(const e of n)yield{...e,refinement:a}}})}a.empty=function(e){return r(e,"empty",(a=>{const t=d(a);return 0===t||`Expected an empty ${e.type} but received one with a size of \`${t}\``}))},a.max=function(e,a,t={}){const{exclusive:c}=t;return r(e,"max",(t=>c?tc?t>a:t>=a||`Expected a ${e.type} greater than ${c?"":"or equal to "}${a} but received \`${t}\``))},a.nonempty=function(e){return r(e,"nonempty",(a=>d(a)>0||`Expected a nonempty ${e.type} but received an empty one`))},a.pattern=function(e,a){return r(e,"pattern",(t=>a.test(t)||`Expected a ${e.type} matching \`/${a.source}/\` but received "${t}"`))},a.size=function(e,a,t=a){const c=`Expected a ${e.type}`,f=a===t?`of \`${a}\``:`between \`${a}\` and \`${t}\``;return r(e,"size",(e=>{if("number"==typeof e||e instanceof Date)return a<=e&&e<=t||`${c} ${f} but received \`${e}\``;if(e instanceof Map||e instanceof Set){const{size:d}=e;return a<=d&&d<=t||`${c} with a size ${f} but received one with a size of \`${d}\``}const{length:d}=e;return a<=d&&d<=t||`${c} with a length ${f} but received one with a length of \`${d}\``}))},a.refine=r},67792:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.unknown=a.union=a.type=a.tuple=a.string=a.set=a.regexp=a.record=a.optional=a.object=a.number=a.nullable=a.never=a.map=a.literal=a.intersection=a.integer=a.instance=a.func=a.enums=a.date=a.boolean=a.bigint=a.array=a.any=void 0;const c=t(99067),f=t(70639),d=t(65991);function r(){return(0,d.define)("never",(()=>!1))}a.any=function(){return(0,d.define)("any",(()=>!0))},a.array=function(e){return new c.Struct({type:"array",schema:e,*entries(a){if(e&&Array.isArray(a))for(const[t,c]of a.entries())yield[t,c,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||`Expected an array value, but received: ${(0,f.print)(e)}`})},a.bigint=function(){return(0,d.define)("bigint",(e=>"bigint"==typeof e))},a.boolean=function(){return(0,d.define)("boolean",(e=>"boolean"==typeof e))},a.date=function(){return(0,d.define)("date",(e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${(0,f.print)(e)}`))},a.enums=function(e){const a={},t=e.map((e=>(0,f.print)(e))).join();for(const t of e)a[t]=t;return new c.Struct({type:"enums",schema:a,validator:a=>e.includes(a)||`Expected one of \`${t}\`, but received: ${(0,f.print)(a)}`})},a.func=function(){return(0,d.define)("func",(e=>"function"==typeof e||`Expected a function, but received: ${(0,f.print)(e)}`))},a.instance=function(e){return(0,d.define)("instance",(a=>a instanceof e||`Expected a \`${e.name}\` instance, but received: ${(0,f.print)(a)}`))},a.integer=function(){return(0,d.define)("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${(0,f.print)(e)}`))},a.intersection=function(e){return new c.Struct({type:"intersection",schema:null,*entries(a,t){for(const{entries:c}of e)yield*c(a,t)},*validator(a,t){for(const{validator:c}of e)yield*c(a,t)},*refiner(a,t){for(const{refiner:c}of e)yield*c(a,t)}})},a.literal=function(e){const a=(0,f.print)(e),t=typeof e;return new c.Struct({type:"literal",schema:"string"===t||"number"===t||"boolean"===t?e:null,validator:t=>t===e||`Expected the literal \`${a}\`, but received: ${(0,f.print)(t)}`})},a.map=function(e,a){return new c.Struct({type:"map",schema:null,*entries(t){if(e&&a&&t instanceof Map)for(const[c,f]of t.entries())yield[c,c,e],yield[c,f,a]},coercer:e=>e instanceof Map?new Map(e):e,validator:e=>e instanceof Map||`Expected a \`Map\` object, but received: ${(0,f.print)(e)}`})},a.never=r,a.nullable=function(e){return new c.Struct({...e,validator:(a,t)=>null===a||e.validator(a,t),refiner:(a,t)=>null===a||e.refiner(a,t)})},a.number=function(){return(0,d.define)("number",(e=>"number"==typeof e&&!isNaN(e)||`Expected a number, but received: ${(0,f.print)(e)}`))},a.object=function(e){const a=e?Object.keys(e):[],t=r();return new c.Struct({type:"object",schema:e??null,*entries(c){if(e&&(0,f.isObject)(c)){const f=new Set(Object.keys(c));for(const t of a)f.delete(t),yield[t,c[t],e[t]];for(const e of f)yield[e,c[e],t]}},validator:e=>(0,f.isObject)(e)||`Expected an object, but received: ${(0,f.print)(e)}`,coercer:e=>(0,f.isObject)(e)?{...e}:e})},a.optional=function(e){return new c.Struct({...e,validator:(a,t)=>void 0===a||e.validator(a,t),refiner:(a,t)=>void 0===a||e.refiner(a,t)})},a.record=function(e,a){return new c.Struct({type:"record",schema:null,*entries(t){if((0,f.isObject)(t))for(const c in t){const f=t[c];yield[c,c,e],yield[c,f,a]}},validator:e=>(0,f.isObject)(e)||`Expected an object, but received: ${(0,f.print)(e)}`})},a.regexp=function(){return(0,d.define)("regexp",(e=>e instanceof RegExp))},a.set=function(e){return new c.Struct({type:"set",schema:null,*entries(a){if(e&&a instanceof Set)for(const t of a)yield[t,t,e]},coercer:e=>e instanceof Set?new Set(e):e,validator:e=>e instanceof Set||`Expected a \`Set\` object, but received: ${(0,f.print)(e)}`})},a.string=function(){return(0,d.define)("string",(e=>"string"==typeof e||`Expected a string, but received: ${(0,f.print)(e)}`))},a.tuple=function(e){const a=r();return new c.Struct({type:"tuple",schema:null,*entries(t){if(Array.isArray(t)){const c=Math.max(e.length,t.length);for(let f=0;fArray.isArray(e)||`Expected an array, but received: ${(0,f.print)(e)}`})},a.type=function(e){const a=Object.keys(e);return new c.Struct({type:"type",schema:e,*entries(t){if((0,f.isObject)(t))for(const c of a)yield[c,t[c],e[c]]},validator:e=>(0,f.isObject)(e)||`Expected an object, but received: ${(0,f.print)(e)}`,coercer:e=>(0,f.isObject)(e)?{...e}:e})},a.union=function(e){const a=e.map((e=>e.type)).join(" | ");return new c.Struct({type:"union",schema:null,coercer(a){for(const t of e){const[e,c]=t.validate(a,{coerce:!0});if(!e)return c}return a},validator(t,c){const d=[];for(const a of e){const[...e]=(0,f.run)(t,a,c),[r]=e;if(!r?.[0])return[];for(const[a]of e)a&&d.push(a)}return[`Expected the value to satisfy a union of \`${a}\`, but received: ${(0,f.print)(t)}`,...d]}})},a.unknown=function(){return(0,d.define)("unknown",(()=>!0))}},65991:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.pick=a.partial=a.omit=a.lazy=a.dynamic=a.deprecated=a.define=a.assign=void 0;const c=t(99067),f=t(67792);a.assign=function(...e){const a="type"===e[0]?.type,t=e.map((({schema:e})=>e)),c=Object.assign({},...t);return a?(0,f.type)(c):(0,f.object)(c)},a.define=function(e,a){return new c.Struct({type:e,schema:null,validator:a})},a.deprecated=function(e,a){return new c.Struct({...e,refiner:(a,t)=>void 0===a||e.refiner(a,t),validator:(t,c)=>void 0===t||(a(t,c),e.validator(t,c))})},a.dynamic=function(e){return new c.Struct({type:"dynamic",schema:null,*entries(a,t){const c=e(a,t);yield*c.entries(a,t)},validator:(a,t)=>e(a,t).validator(a,t),coercer:(a,t)=>e(a,t).coercer(a,t),refiner:(a,t)=>e(a,t).refiner(a,t)})},a.lazy=function(e){let a;return new c.Struct({type:"lazy",schema:null,*entries(t,c){a??(a=e()),yield*a.entries(t,c)},validator:(t,c)=>(a??(a=e()),a.validator(t,c)),coercer:(t,c)=>(a??(a=e()),a.coercer(t,c)),refiner:(t,c)=>(a??(a=e()),a.refiner(t,c))})},a.omit=function(e,a){const{schema:t}=e,c={...t};for(const e of a)delete c[e];return"type"===e.type?(0,f.type)(c):(0,f.object)(c)},a.partial=function(e){const a=e instanceof c.Struct,t=a?{...e.schema}:{...e};for(const e in t)t[e]=(0,f.optional)(t[e]);return a&&"type"===e.type?(0,f.type)(t):(0,f.object)(t)},a.pick=function(e,a){const{schema:t}=e,c={};for(const e of a)c[e]=t[e];return"type"===e.type?(0,f.type)(c):(0,f.object)(c)}},70639:(e,a)=>{"use strict";function t(e){return"object"==typeof e&&null!==e}function c(e){return"symbol"==typeof e?e.toString():"string"==typeof e?JSON.stringify(e):`${e}`}function f(e,a,t,f){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:d,branch:r}=a,{type:n}=t,{refinement:i,message:b=`Expected a value of type \`${n}\`${i?` with refinement \`${i}\``:""}, but received: \`${c(f)}\``}=e;return{value:f,type:n,refinement:i,key:d[d.length-1],path:d,branch:r,...e,message:b}}Object.defineProperty(a,"__esModule",{value:!0}),a.run=a.toFailures=a.toFailure=a.shiftIterator=a.print=a.isPlainObject=a.isObject=void 0,a.isObject=t,a.isPlainObject=function(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;const a=Object.getPrototypeOf(e);return null===a||a===Object.prototype},a.print=c,a.shiftIterator=function(e){const{done:a,value:t}=e.next();return a?void 0:t},a.toFailure=f,a.toFailures=function*(e,a,c,d){(function(e){return t(e)&&"function"==typeof e[Symbol.iterator]})(e)||(e=[e]);for(const t of e){const e=f(t,a,c,d);e&&(yield e)}},a.run=function*e(a,c,f={}){const{path:d=[],branch:r=[a],coerce:n=!1,mask:i=!1}=f,b={path:d,branch:r};if(n&&(a=c.coercer(a,b),i&&"type"!==c.type&&t(c.schema)&&t(a)&&!Array.isArray(a)))for(const e in a)void 0===c.schema[e]&&delete a[e];let o="valid";for(const e of c.validator(a,b))e.explanation=f.message,o="not_valid",yield[e,void 0];for(let[s,l,u]of c.entries(a,b)){const c=e(l,u,{path:void 0===s?d:[...d,s],branch:void 0===s?r:[...r,l],coerce:n,mask:i,message:f.message});for(const e of c)e[0]?(o=null===e[0].refinement||void 0===e[0].refinement?"not_valid":"not_refined",yield[e[0],void 0]):n&&(l=e[1],void 0===s?a=l:a instanceof Map?a.set(s,l):a instanceof Set?a.add(l):t(a)&&(void 0!==l||s in a)&&(a[s]=l))}if("not_valid"!==o)for(const e of c.refiner(a,b))e.explanation=f.message,o="not_refined",yield[e,void 0];"valid"===o&&(yield[void 0,a])}},22011:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.assertExhaustive=a.assertStruct=a.assert=a.AssertionError=void 0;const c=t(35620),f=t(75940);function d(e,a){return t=e,Boolean("string"==typeof t?.prototype?.constructor?.name)?new e({message:a}):e({message:a});var t}class r extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}a.AssertionError=r,a.assert=function(e,a="Assertion failed.",t=r){if(!e){if(a instanceof Error)throw a;throw d(t,a)}},a.assertStruct=function(e,a,t="Assertion failed",n=r){try{(0,c.assert)(e,a)}catch(e){throw d(n,`${t}: ${function(e){return(0,f.getErrorMessage)(e).replace(/\.$/u,"")}(e)}.`)}},a.assertExhaustive=function(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}},20472:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.base64=void 0;const c=t(35620),f=t(22011);a.base64=(e,a={})=>{const t=a.paddingRequired??!1,d=a.characterSet??"base64";let r,n;return"base64"===d?r=String.raw`[A-Za-z0-9+\/]`:((0,f.assert)("base64url"===d),r=String.raw`[-_A-Za-z0-9]`),n=t?new RegExp(`^(?:${r}{4})*(?:${r}{3}=|${r}{2}==)?$`,"u"):new RegExp(`^(?:${r}{4})*(?:${r}{2,3}|${r}{3}=|${r}{2}==)?$`,"u"),(0,c.pattern)(e,n)}},77862:(e,a,t)=>{"use strict";var c=t(62045).hp;Object.defineProperty(a,"__esModule",{value:!0}),a.createDataView=a.concatBytes=a.valueToBytes=a.base64ToBytes=a.stringToBytes=a.numberToBytes=a.signedBigIntToBytes=a.bigIntToBytes=a.hexToBytes=a.bytesToBase64=a.bytesToString=a.bytesToNumber=a.bytesToSignedBigInt=a.bytesToBigInt=a.bytesToHex=a.assertIsBytes=a.isBytes=void 0;const f=t(63203),d=t(22011),r=t(93976),n=function(){const e=[];return()=>{if(0===e.length)for(let a=0;a<256;a++)e.push(a.toString(16).padStart(2,"0"));return e}}();function i(e){return e instanceof Uint8Array}function b(e){(0,d.assert)(i(e),"Value must be a Uint8Array.")}function o(e){if(b(e),0===e.length)return"0x";const a=n(),t=new Array(e.length);for(let c=0;c=BigInt(0),"Value must be a non-negative bigint."),l(e.toString(16))}function h(e){return(0,d.assert)("number"==typeof e,"Value must be a number."),(0,d.assert)(e>=0,"Value must be a non-negative number."),(0,d.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead."),l(e.toString(16))}function p(e){return(0,d.assert)("string"==typeof e,"Value must be a string."),(new TextEncoder).encode(e)}function g(e){if("bigint"==typeof e)return u(e);if("number"==typeof e)return h(e);if("string"==typeof e)return e.startsWith("0x")?l(e):p(e);if(i(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}a.isBytes=i,a.assertIsBytes=b,a.bytesToHex=o,a.bytesToBigInt=s,a.bytesToSignedBigInt=function(e){b(e);let a=BigInt(0);for(const t of e)a=(a<0,"Byte length must be greater than 0."),(0,d.assert)(function(e,a){(0,d.assert)(a>0);const t=e>>BigInt(31);return!((~e&t)+(e&~t)>>BigInt(8*a-1))}(e,a),"Byte length is too small to represent the given value.");let t=e;const c=new Uint8Array(a);for(let e=0;e>=BigInt(8);return c.reverse()},a.numberToBytes=h,a.stringToBytes=p,a.base64ToBytes=function(e){return(0,d.assert)("string"==typeof e,"Value must be a string."),f.base64.decode(e)},a.valueToBytes=g,a.concatBytes=function(e){const a=new Array(e.length);let t=0;for(let c=0;c{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.toCaipChainId=a.parseCaipAccountId=a.parseCaipChainId=a.isCaipAccountAddress=a.isCaipAccountId=a.isCaipReference=a.isCaipNamespace=a.isCaipChainId=a.KnownCaipNamespace=a.CaipAccountAddressStruct=a.CaipAccountIdStruct=a.CaipReferenceStruct=a.CaipNamespaceStruct=a.CaipChainIdStruct=a.CAIP_ACCOUNT_ADDRESS_REGEX=a.CAIP_ACCOUNT_ID_REGEX=a.CAIP_REFERENCE_REGEX=a.CAIP_NAMESPACE_REGEX=a.CAIP_CHAIN_ID_REGEX=void 0;const c=t(35620);function f(e){return(0,c.is)(e,a.CaipNamespaceStruct)}function d(e){return(0,c.is)(e,a.CaipReferenceStruct)}var r;a.CAIP_CHAIN_ID_REGEX=/^(?[-a-z0-9]{3,8}):(?[-_a-zA-Z0-9]{1,32})$/u,a.CAIP_NAMESPACE_REGEX=/^[-a-z0-9]{3,8}$/u,a.CAIP_REFERENCE_REGEX=/^[-_a-zA-Z0-9]{1,32}$/u,a.CAIP_ACCOUNT_ID_REGEX=/^(?(?[-a-z0-9]{3,8}):(?[-_a-zA-Z0-9]{1,32})):(?[-.%a-zA-Z0-9]{1,128})$/u,a.CAIP_ACCOUNT_ADDRESS_REGEX=/^[-.%a-zA-Z0-9]{1,128}$/u,a.CaipChainIdStruct=(0,c.pattern)((0,c.string)(),a.CAIP_CHAIN_ID_REGEX),a.CaipNamespaceStruct=(0,c.pattern)((0,c.string)(),a.CAIP_NAMESPACE_REGEX),a.CaipReferenceStruct=(0,c.pattern)((0,c.string)(),a.CAIP_REFERENCE_REGEX),a.CaipAccountIdStruct=(0,c.pattern)((0,c.string)(),a.CAIP_ACCOUNT_ID_REGEX),a.CaipAccountAddressStruct=(0,c.pattern)((0,c.string)(),a.CAIP_ACCOUNT_ADDRESS_REGEX),(r=a.KnownCaipNamespace||(a.KnownCaipNamespace={})).Eip155="eip155",r.Wallet="wallet",a.isCaipChainId=function(e){return(0,c.is)(e,a.CaipChainIdStruct)},a.isCaipNamespace=f,a.isCaipReference=d,a.isCaipAccountId=function(e){return(0,c.is)(e,a.CaipAccountIdStruct)},a.isCaipAccountAddress=function(e){return(0,c.is)(e,a.CaipAccountAddressStruct)},a.parseCaipChainId=function(e){const t=a.CAIP_CHAIN_ID_REGEX.exec(e);if(!t?.groups)throw new Error("Invalid CAIP chain ID.");return{namespace:t.groups.namespace,reference:t.groups.reference}},a.parseCaipAccountId=function(e){const t=a.CAIP_ACCOUNT_ID_REGEX.exec(e);if(!t?.groups)throw new Error("Invalid CAIP account ID.");return{address:t.groups.accountAddress,chainId:t.groups.chainId,chain:{namespace:t.groups.namespace,reference:t.groups.reference}}},a.toCaipChainId=function(e,t){if(!f(e))throw new Error(`Invalid "namespace", must match: ${a.CAIP_NAMESPACE_REGEX.toString()}`);if(!d(t))throw new Error(`Invalid "reference", must match: ${a.CAIP_REFERENCE_REGEX.toString()}`);return`${e}:${t}`}},98860:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.ChecksumStruct=void 0;const c=t(35620),f=t(20472);a.ChecksumStruct=(0,c.size)((0,f.base64)((0,c.string)(),{paddingRequired:!0}),44,44)},65211:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.createHex=a.createBytes=a.createBigInt=a.createNumber=void 0;const c=t(35620),f=t(22011),d=t(77862),r=t(93976),n=(0,c.union)([(0,c.number)(),(0,c.bigint)(),(0,c.string)(),r.StrictHexStruct]),i=(0,c.coerce)((0,c.number)(),n,Number),b=(0,c.coerce)((0,c.bigint)(),n,BigInt),o=((0,c.union)([r.StrictHexStruct,(0,c.instance)(Uint8Array)]),(0,c.coerce)((0,c.instance)(Uint8Array),(0,c.union)([r.StrictHexStruct]),d.hexToBytes)),s=(0,c.coerce)(r.StrictHexStruct,(0,c.instance)(Uint8Array),d.bytesToHex);a.createNumber=function(e){try{const a=(0,c.create)(e,i);return(0,f.assert)(Number.isFinite(a),`Expected a number-like value, got "${e}".`),a}catch(a){if(a instanceof c.StructError)throw new Error(`Expected a number-like value, got "${e}".`);throw a}},a.createBigInt=function(e){try{return(0,c.create)(e,b)}catch(e){if(e instanceof c.StructError)throw new Error(`Expected a number-like value, got "${String(e.value)}".`);throw e}},a.createBytes=function(e){if("string"==typeof e&&"0x"===e.toLowerCase())return new Uint8Array;try{return(0,c.create)(e,o)}catch(e){if(e instanceof c.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}},a.createHex=function(e){if(e instanceof Uint8Array&&0===e.length||"string"==typeof e&&"0x"===e.toLowerCase())return"0x";try{return(0,c.create)(e,s)}catch(e){if(e instanceof c.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}}},44180:function(e,a){"use strict";var t,c,f=this&&this.__classPrivateFieldGet||function(e,a,t,c){if("a"===t&&!c)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof a?e!==a||!c:!a.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?c:"a"===t?c.call(e):c?c.value:a.get(e)},d=this&&this.__classPrivateFieldSet||function(e,a,t,c,f){if("m"===c)throw new TypeError("Private method is not writable");if("a"===c&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof a?e!==a||!f:!a.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===c?f.call(e,t):f?f.value=t:a.set(e,t),t};Object.defineProperty(a,"__esModule",{value:!0}),a.FrozenSet=a.FrozenMap=void 0;class r{get size(){return f(this,t,"f").size}[(t=new WeakMap,Symbol.iterator)](){return f(this,t,"f")[Symbol.iterator]()}constructor(e){t.set(this,void 0),d(this,t,new Map(e),"f"),Object.freeze(this)}entries(){return f(this,t,"f").entries()}forEach(e,a){return f(this,t,"f").forEach(((t,c,f)=>e.call(a,t,c,this)))}get(e){return f(this,t,"f").get(e)}has(e){return f(this,t,"f").has(e)}keys(){return f(this,t,"f").keys()}values(){return f(this,t,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map((([e,a])=>`${String(e)} => ${String(a)}`)).join(", ")} `:""}}`}}a.FrozenMap=r;class n{get size(){return f(this,c,"f").size}[(c=new WeakMap,Symbol.iterator)](){return f(this,c,"f")[Symbol.iterator]()}constructor(e){c.set(this,void 0),d(this,c,new Set(e),"f"),Object.freeze(this)}entries(){return f(this,c,"f").entries()}forEach(e,a){return f(this,c,"f").forEach(((t,c,f)=>e.call(a,t,c,this)))}has(e){return f(this,c,"f").has(e)}keys(){return f(this,c,"f").keys()}values(){return f(this,c,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map((e=>String(e))).join(", ")} `:""}}`}}a.FrozenSet=n,Object.freeze(r),Object.freeze(r.prototype),Object.freeze(n),Object.freeze(n.prototype)},91630:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0})},75940:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.wrapError=a.getErrorMessage=a.isErrorWithStack=a.isErrorWithMessage=a.isErrorWithCode=void 0;const c=t(71843),f=t(33745);function d(e){return"object"==typeof e&&null!==e&&"code"in e}function r(e){return"object"==typeof e&&null!==e&&"message"in e}a.isErrorWithCode=d,a.isErrorWithMessage=r,a.isErrorWithStack=function(e){return"object"==typeof e&&null!==e&&"stack"in e},a.getErrorMessage=function(e){return r(e)&&"string"==typeof e.message?e.message:(0,f.isNullOrUndefined)(e)?"":String(e)},a.wrapError=function(e,a){if((t=e)instanceof Error||(0,f.isObject)(t)&&"Error"===t.constructor.name){let t;return t=2===Error.length?new Error(a,{cause:e}):new c.ErrorWithCause(a,{cause:e}),d(e)&&(t.code=e.code),t}var t;return a.length>0?new Error(`${String(e)}: ${a}`):new Error(String(e))}},93976:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.remove0x=a.add0x=a.isValidChecksumAddress=a.getChecksumAddress=a.isValidHexAddress=a.assertIsStrictHexString=a.assertIsHexString=a.isStrictHexString=a.isHexString=a.HexChecksumAddressStruct=a.HexAddressStruct=a.StrictHexStruct=a.HexStruct=void 0;const c=t(35620),f=t(32955),d=t(22011),r=t(77862);function n(e){return(0,c.is)(e,a.HexStruct)}function i(e){return(0,c.is)(e,a.StrictHexStruct)}function b(e){(0,d.assert)((0,c.is)(e,a.HexChecksumAddressStruct),"Invalid hex address.");const t=s(e.toLowerCase()),n=s((0,r.bytesToHex)((0,f.keccak_256)(t)));return`0x${t.split("").map(((e,a)=>{const t=n[a];return(0,d.assert)((0,c.is)(t,(0,c.string)()),"Hash shorter than address."),parseInt(t,16)>7?e.toUpperCase():e})).join("")}`}function o(e){return!!(0,c.is)(e,a.HexChecksumAddressStruct)&&b(e)===e}function s(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}a.HexStruct=(0,c.pattern)((0,c.string)(),/^(?:0x)?[0-9a-f]+$/iu),a.StrictHexStruct=(0,c.pattern)((0,c.string)(),/^0x[0-9a-f]+$/iu),a.HexAddressStruct=(0,c.pattern)((0,c.string)(),/^0x[0-9a-f]{40}$/u),a.HexChecksumAddressStruct=(0,c.pattern)((0,c.string)(),/^0x[0-9a-fA-F]{40}$/u),a.isHexString=n,a.isStrictHexString=i,a.assertIsHexString=function(e){(0,d.assert)(n(e),"Value must be a hexadecimal string.")},a.assertIsStrictHexString=function(e){(0,d.assert)(i(e),'Value must be a hexadecimal string, starting with "0x".')},a.isValidHexAddress=function(e){return(0,c.is)(e,a.HexAddressStruct)||o(e)},a.getChecksumAddress=b,a.isValidChecksumAddress=o,a.add0x=function(e){return e.startsWith("0x")?e:e.startsWith("0X")?`0x${e.substring(2)}`:`0x${e}`},a.remove0x=s},52367:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),f(t(22011),a),f(t(20472),a),f(t(77862),a),f(t(87690),a),f(t(98860),a),f(t(65211),a),f(t(44180),a),f(t(91630),a),f(t(75940),a),f(t(93976),a),f(t(60087),a),f(t(24956),a),f(t(98912),a),f(t(33745),a),f(t(5770),a),f(t(3028),a),f(t(2812),a),f(t(32954),a),f(t(16871),a),f(t(49266),a)},60087:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.getJsonRpcIdValidator=a.assertIsJsonRpcError=a.isJsonRpcError=a.assertIsJsonRpcFailure=a.isJsonRpcFailure=a.assertIsJsonRpcSuccess=a.isJsonRpcSuccess=a.assertIsJsonRpcResponse=a.isJsonRpcResponse=a.assertIsPendingJsonRpcResponse=a.isPendingJsonRpcResponse=a.JsonRpcResponseStruct=a.JsonRpcFailureStruct=a.JsonRpcSuccessStruct=a.PendingJsonRpcResponseStruct=a.assertIsJsonRpcRequest=a.isJsonRpcRequest=a.assertIsJsonRpcNotification=a.isJsonRpcNotification=a.JsonRpcNotificationStruct=a.JsonRpcRequestStruct=a.JsonRpcParamsStruct=a.JsonRpcErrorStruct=a.JsonRpcIdStruct=a.JsonRpcVersionStruct=a.jsonrpc2=a.getJsonSize=a.getSafeJson=a.isValidJson=a.JsonStruct=a.UnsafeJsonStruct=a.exactOptional=a.object=void 0;const c=t(35620),f=t(22011),d=t(33745);function r({path:e,branch:a}){const t=e[e.length-1];return(0,d.hasProperty)(a[a.length-2],t)}function n(e){return new c.Struct({...e,type:`optional ${e.type}`,validator:(a,t)=>!r(t)||e.validator(a,t),refiner:(a,t)=>!r(t)||e.refiner(a,t)})}function i(e){return(0,c.create)(e,a.JsonStruct)}a.object=e=>(0,c.object)(e),a.exactOptional=n,a.UnsafeJsonStruct=(0,c.union)([(0,c.literal)(null),(0,c.boolean)(),(0,c.define)("finite number",(e=>(0,c.is)(e,(0,c.number)())&&Number.isFinite(e))),(0,c.string)(),(0,c.array)((0,c.lazy)((()=>a.UnsafeJsonStruct))),(0,c.record)((0,c.string)(),(0,c.lazy)((()=>a.UnsafeJsonStruct)))]),a.JsonStruct=(0,c.coerce)(a.UnsafeJsonStruct,(0,c.any)(),(e=>((0,f.assertStruct)(e,a.UnsafeJsonStruct),JSON.parse(JSON.stringify(e,((e,a)=>{if("__proto__"!==e&&"constructor"!==e)return a})))))),a.isValidJson=function(e){try{return i(e),!0}catch{return!1}},a.getSafeJson=i,a.getJsonSize=function(e){(0,f.assertStruct)(e,a.JsonStruct,"Invalid JSON value");const t=JSON.stringify(e);return(new TextEncoder).encode(t).byteLength},a.jsonrpc2="2.0",a.JsonRpcVersionStruct=(0,c.literal)(a.jsonrpc2),a.JsonRpcIdStruct=(0,c.nullable)((0,c.union)([(0,c.number)(),(0,c.string)()])),a.JsonRpcErrorStruct=(0,a.object)({code:(0,c.integer)(),message:(0,c.string)(),data:n(a.JsonStruct),stack:n((0,c.string)())}),a.JsonRpcParamsStruct=(0,c.union)([(0,c.record)((0,c.string)(),a.JsonStruct),(0,c.array)(a.JsonStruct)]),a.JsonRpcRequestStruct=(0,a.object)({id:a.JsonRpcIdStruct,jsonrpc:a.JsonRpcVersionStruct,method:(0,c.string)(),params:n(a.JsonRpcParamsStruct)}),a.JsonRpcNotificationStruct=(0,a.object)({jsonrpc:a.JsonRpcVersionStruct,method:(0,c.string)(),params:n(a.JsonRpcParamsStruct)}),a.isJsonRpcNotification=function(e){return(0,c.is)(e,a.JsonRpcNotificationStruct)},a.assertIsJsonRpcNotification=function(e,t){(0,f.assertStruct)(e,a.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",t)},a.isJsonRpcRequest=function(e){return(0,c.is)(e,a.JsonRpcRequestStruct)},a.assertIsJsonRpcRequest=function(e,t){(0,f.assertStruct)(e,a.JsonRpcRequestStruct,"Invalid JSON-RPC request",t)},a.PendingJsonRpcResponseStruct=(0,c.object)({id:a.JsonRpcIdStruct,jsonrpc:a.JsonRpcVersionStruct,result:(0,c.optional)((0,c.unknown)()),error:(0,c.optional)(a.JsonRpcErrorStruct)}),a.JsonRpcSuccessStruct=(0,a.object)({id:a.JsonRpcIdStruct,jsonrpc:a.JsonRpcVersionStruct,result:a.JsonStruct}),a.JsonRpcFailureStruct=(0,a.object)({id:a.JsonRpcIdStruct,jsonrpc:a.JsonRpcVersionStruct,error:a.JsonRpcErrorStruct}),a.JsonRpcResponseStruct=(0,c.union)([a.JsonRpcSuccessStruct,a.JsonRpcFailureStruct]),a.isPendingJsonRpcResponse=function(e){return(0,c.is)(e,a.PendingJsonRpcResponseStruct)},a.assertIsPendingJsonRpcResponse=function(e,t){(0,f.assertStruct)(e,a.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",t)},a.isJsonRpcResponse=function(e){return(0,c.is)(e,a.JsonRpcResponseStruct)},a.assertIsJsonRpcResponse=function(e,t){(0,f.assertStruct)(e,a.JsonRpcResponseStruct,"Invalid JSON-RPC response",t)},a.isJsonRpcSuccess=function(e){return(0,c.is)(e,a.JsonRpcSuccessStruct)},a.assertIsJsonRpcSuccess=function(e,t){(0,f.assertStruct)(e,a.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",t)},a.isJsonRpcFailure=function(e){return(0,c.is)(e,a.JsonRpcFailureStruct)},a.assertIsJsonRpcFailure=function(e,t){(0,f.assertStruct)(e,a.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",t)},a.isJsonRpcError=function(e){return(0,c.is)(e,a.JsonRpcErrorStruct)},a.assertIsJsonRpcError=function(e,t){(0,f.assertStruct)(e,a.JsonRpcErrorStruct,"Invalid JSON-RPC error",t)},a.getJsonRpcIdValidator=function(e){const{permitEmptyString:a,permitFractions:t,permitNull:c}={permitEmptyString:!0,permitFractions:!1,permitNull:!0,...e};return e=>Boolean("number"==typeof e&&(t||Number.isInteger(e))||"string"==typeof e&&(a||e.length>0)||c&&null===e)}},24956:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0})},98912:function(e,a,t){"use strict";var c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0}),a.createModuleLogger=a.createProjectLogger=void 0;const f=(0,c(t(17833)).default)("metamask");a.createProjectLogger=function(e){return f.extend(e)},a.createModuleLogger=function(e,a){return e.extend(a)}},33745:(e,a)=>{"use strict";function t(e){return e.charCodeAt(0)<=127}var c;Object.defineProperty(a,"__esModule",{value:!0}),a.calculateNumberSize=a.calculateStringSize=a.isASCII=a.isPlainObject=a.ESCAPE_CHARACTERS_REGEXP=a.JsonSize=a.getKnownPropertyNames=a.hasProperty=a.isObject=a.isNullOrUndefined=a.isNonEmptyArray=void 0,a.isNonEmptyArray=function(e){return Array.isArray(e)&&e.length>0},a.isNullOrUndefined=function(e){return null==e},a.isObject=function(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)},a.hasProperty=(e,a)=>Object.hasOwnProperty.call(e,a),a.getKnownPropertyNames=function(e){return Object.getOwnPropertyNames(e)},(c=a.JsonSize||(a.JsonSize={}))[c.Null=4]="Null",c[c.Comma=1]="Comma",c[c.Wrapper=1]="Wrapper",c[c.True=4]="True",c[c.False=5]="False",c[c.Quote=1]="Quote",c[c.Colon=1]="Colon",c[c.Date=24]="Date",a.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu,a.isPlainObject=function(e){if("object"!=typeof e||null===e)return!1;try{let a=e;for(;null!==Object.getPrototypeOf(a);)a=Object.getPrototypeOf(a);return Object.getPrototypeOf(e)===a}catch(e){return!1}},a.isASCII=t,a.calculateStringSize=function(e){return e.split("").reduce(((e,a)=>t(a)?e+1:e+2),0)+(e.match(a.ESCAPE_CHARACTERS_REGEXP)??[]).length},a.calculateNumberSize=function(e){return e.toString().length}},5770:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.hexToBigInt=a.hexToNumber=a.bigIntToHex=a.numberToHex=void 0;const c=t(22011),f=t(93976);a.numberToHex=e=>((0,c.assert)("number"==typeof e,"Value must be a number."),(0,c.assert)(e>=0,"Value must be a non-negative number."),(0,c.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,f.add0x)(e.toString(16))),a.bigIntToHex=e=>((0,c.assert)("bigint"==typeof e,"Value must be a bigint."),(0,c.assert)(e>=0,"Value must be a non-negative bigint."),(0,f.add0x)(e.toString(16))),a.hexToNumber=e=>{(0,f.assertIsHexString)(e);const a=parseInt(e,16);return(0,c.assert)(Number.isSafeInteger(a),"Value is not a safe integer. Use `hexToBigInt` instead."),a},a.hexToBigInt=e=>((0,f.assertIsHexString)(e),BigInt((0,f.add0x)(e)))},3028:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0})},2812:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.createDeferredPromise=void 0,a.createDeferredPromise=function({suppressUnhandledRejection:e=!1}={}){let a,t;const c=new Promise(((e,c)=>{a=e,t=c}));return e&&c.catch((e=>{})),{promise:c,resolve:a,reject:t}}},32954:(e,a)=>{"use strict";var t;Object.defineProperty(a,"__esModule",{value:!0}),a.timeSince=a.inMilliseconds=a.Duration=void 0,(t=a.Duration||(a.Duration={}))[t.Millisecond=1]="Millisecond",t[t.Second=1e3]="Second",t[t.Minute=6e4]="Minute",t[t.Hour=36e5]="Hour",t[t.Day=864e5]="Day",t[t.Week=6048e5]="Week",t[t.Year=31536e6]="Year";const c=(e,a)=>{if(!(e=>Number.isInteger(e)&&e>=0)(e))throw new Error(`"${a}" must be a non-negative integer. Received: "${e}".`)};a.inMilliseconds=function(e,a){return c(e,"count"),e*a},a.timeSince=function(e){return c(e,"timestamp"),Date.now()-e}},16871:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0})},49266:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.satisfiesVersionRange=a.gtRange=a.gtVersion=a.assertIsSemVerRange=a.assertIsSemVerVersion=a.isValidSemVerRange=a.isValidSemVerVersion=a.VersionRangeStruct=a.VersionStruct=void 0;const c=t(35620),f=t(56864),d=t(22011);a.VersionStruct=(0,c.refine)((0,c.string)(),"Version",(e=>null!==(0,f.valid)(e)||`Expected SemVer version, got "${e}"`)),a.VersionRangeStruct=(0,c.refine)((0,c.string)(),"Version range",(e=>null!==(0,f.validRange)(e)||`Expected SemVer range, got "${e}"`)),a.isValidSemVerVersion=function(e){return(0,c.is)(e,a.VersionStruct)},a.isValidSemVerRange=function(e){return(0,c.is)(e,a.VersionRangeStruct)},a.assertIsSemVerVersion=function(e){(0,d.assertStruct)(e,a.VersionStruct)},a.assertIsSemVerRange=function(e){(0,d.assertStruct)(e,a.VersionRangeStruct)},a.gtVersion=function(e,a){return(0,f.gt)(e,a)},a.gtRange=function(e,a){return(0,f.gtr)(e,a)},a.satisfiesVersionRange=function(e,a){return(0,f.satisfies)(e,a,{includePrerelease:!0})}},39209:(e,a,t)=>{"use strict";var c=t(76578),f="undefined"==typeof globalThis?t.g:globalThis;e.exports=function(){for(var e=[],a=0;a{"use strict";const{normalizeIPv6:c,normalizeIPv4:f,removeDotSegments:d,recomposeAuthority:r,normalizeComponentEncoding:n}=t(34834),i=t(343);function b(e,a,t,c){const f={};return c||(e=u(o(e,t),t),a=u(o(a,t),t)),!(t=t||{}).tolerant&&a.scheme?(f.scheme=a.scheme,f.userinfo=a.userinfo,f.host=a.host,f.port=a.port,f.path=d(a.path||""),f.query=a.query):(void 0!==a.userinfo||void 0!==a.host||void 0!==a.port?(f.userinfo=a.userinfo,f.host=a.host,f.port=a.port,f.path=d(a.path||""),f.query=a.query):(a.path?("/"===a.path.charAt(0)?f.path=d(a.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?f.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+a.path:f.path=a.path:f.path="/"+a.path,f.path=d(f.path)),f.query=a.query):(f.path=e.path,void 0!==a.query?f.query=a.query:f.query=e.query),f.userinfo=e.userinfo,f.host=e.host,f.port=e.port),f.scheme=e.scheme),f.fragment=a.fragment,f}function o(e,a){const t={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},c=Object.assign({},a),f=[],n=i[(c.scheme||t.scheme||"").toLowerCase()];n&&n.serialize&&n.serialize(t,c),void 0!==t.path&&(c.skipEscape?t.path=unescape(t.path):(t.path=escape(t.path),void 0!==t.scheme&&(t.path=t.path.split("%3A").join(":")))),"suffix"!==c.reference&&t.scheme&&(f.push(t.scheme),f.push(":"));const b=r(t,c);if(void 0!==b&&("suffix"!==c.reference&&f.push("//"),f.push(b),t.path&&"/"!==t.path.charAt(0)&&f.push("/")),void 0!==t.path){let e=t.path;c.absolutePath||n&&n.absolutePath||(e=d(e)),void 0===b&&(e=e.replace(/^\/\//u,"/%2F")),f.push(e)}return void 0!==t.query&&(f.push("?"),f.push(t.query)),void 0!==t.fragment&&(f.push("#"),f.push(t.fragment)),f.join("")}const s=Array.from({length:127},((e,a)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(a)))),l=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function u(e,a){const t=Object.assign({},a),d={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},r=-1!==e.indexOf("%");let n=!1;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);const b=e.match(l);if(b){if(d.scheme=b[1],d.userinfo=b[3],d.host=b[4],d.port=parseInt(b[5],10),d.path=b[6]||"",d.query=b[7],d.fragment=b[8],isNaN(d.port)&&(d.port=b[5]),d.host){const e=f(d.host);if(!1===e.isIPV4){const a=c(e.host,{isIPV4:!1});d.host=a.host.toLowerCase(),n=a.isIPV6}else d.host=e.host,n=!0}void 0!==d.scheme||void 0!==d.userinfo||void 0!==d.host||void 0!==d.port||d.path||void 0!==d.query?void 0===d.scheme?d.reference="relative":void 0===d.fragment?d.reference="absolute":d.reference="uri":d.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==d.reference&&(d.error=d.error||"URI is not a "+t.reference+" reference.");const e=i[(t.scheme||d.scheme||"").toLowerCase()];if(!(t.unicodeSupport||e&&e.unicodeSupport)&&d.host&&(t.domainHost||e&&e.domainHost)&&!1===n&&function(e){let a=0;for(let t=0,c=e.length;t126||s[a])return!0;return!1}(d.host))try{d.host=URL.domainToASCII(d.host.toLowerCase())}catch(e){d.error=d.error||"Host's domain name can not be converted to ASCII: "+e}(!e||e&&!e.skipNormalize)&&(r&&void 0!==d.scheme&&(d.scheme=unescape(d.scheme)),r&&void 0!==d.userinfo&&(d.userinfo=unescape(d.userinfo)),r&&void 0!==d.host&&(d.host=unescape(d.host)),void 0!==d.path&&d.path.length&&(d.path=escape(unescape(d.path))),void 0!==d.fragment&&d.fragment.length&&(d.fragment=encodeURI(decodeURIComponent(d.fragment)))),e&&e.parse&&e.parse(d,t)}else d.error=d.error||"URI can not be parsed.";return d}const h={SCHEMES:i,normalize:function(e,a){return"string"==typeof e?e=o(u(e,a),a):"object"==typeof e&&(e=u(o(e,a),a)),e},resolve:function(e,a,t){const c=Object.assign({scheme:"null"},t);return o(b(u(e,c),u(a,c),c,!0),{...c,skipEscape:!0})},resolveComponents:b,equal:function(e,a,t){return"string"==typeof e?(e=unescape(e),e=o(n(u(e,t),!0),{...t,skipEscape:!0})):"object"==typeof e&&(e=o(n(e,!0),{...t,skipEscape:!0})),"string"==typeof a?(a=unescape(a),a=o(n(u(a,t),!0),{...t,skipEscape:!0})):"object"==typeof a&&(a=o(n(a,!0),{...t,skipEscape:!0})),e.toLowerCase()===a.toLowerCase()},serialize:o,parse:u};e.exports=h,e.exports.default=h,e.exports.fastUri=h},343:e=>{"use strict";const a=/^[\da-f]{8}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{12}$/iu,t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function c(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}function f(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function d(e){const a="https"===String(e.scheme).toLowerCase();return e.port!==(a?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}const r={scheme:"http",domainHost:!0,parse:f,serialize:d},n={scheme:"ws",domainHost:!0,parse:function(e){return e.secure=c(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e},serialize:function(e){if(e.port!==(c(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[a,t]=e.resourceName.split("?");e.path=a&&"/"!==a?a:void 0,e.query=t,e.resourceName=void 0}return e.fragment=void 0,e}},i={http:r,https:{scheme:"https",domainHost:r.domainHost,parse:f,serialize:d},ws:n,wss:{scheme:"wss",domainHost:n.domainHost,parse:n.parse,serialize:n.serialize},urn:{scheme:"urn",parse:function(e,a){if(!e.path)return e.error="URN can not be parsed",e;const c=e.path.match(t);if(c){const t=a.scheme||e.scheme||"urn";e.nid=c[1].toLowerCase(),e.nss=c[2];const f=`${t}:${a.nid||e.nid}`,d=i[f];e.path=void 0,d&&(e=d.parse(e,a))}else e.error=e.error||"URN can not be parsed.";return e},serialize:function(e,a){const t=a.scheme||e.scheme||"urn",c=e.nid.toLowerCase(),f=`${t}:${a.nid||c}`,d=i[f];d&&(e=d.serialize(e,a));const r=e,n=e.nss;return r.path=`${c||a.nid}:${n}`,a.skipEscape=!0,r},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(e,t){const c=e;return c.uuid=c.nss,c.nss=void 0,t.tolerant||c.uuid&&a.test(c.uuid)||(c.error=c.error||"UUID is not valid."),c},serialize:function(e){const a=e;return a.nss=(e.uuid||"").toLowerCase(),a},skipNormalize:!0}};e.exports=i},64914:e=>{"use strict";e.exports={HEX:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15}}},34834:(e,a,t)=>{"use strict";const{HEX:c}=t(64914);function f(e){if(i(e,".")<3)return{host:e,isIPV4:!1};const a=e.match(/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/u)||[],[t]=a;return t?{host:n(t,"."),isIPV4:!0}:{host:e,isIPV4:!1}}function d(e,a=!1){let t="",f=!0;for(const a of e){if(void 0===c[a])return;"0"!==a&&!0===f&&(f=!1),f||(t+=a)}return a&&0===t.length&&(t="0"),t}function r(e,a={}){if(i(e,":")<2)return{host:e,isIPV6:!1};const t=function(e){let a=0;const t={error:!1,address:"",zone:""},c=[],f=[];let r=!1,n=!1,i=!1;function b(){if(f.length){if(!1===r){const e=d(f);if(void 0===e)return t.error=!0,!1;c.push(e)}f.length=0}return!0}for(let d=0;d7){t.error=!0;break}d-1>=0&&":"===e[d-1]&&(n=!0)}}return f.length&&(r?t.zone=f.join(""):i?c.push(f.join("")):c.push(d(f))),t.address=c.join(""),t}(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,a=t.address;return t.zone&&(e+="%"+t.zone,a+="%25"+t.zone),{host:e,escapedHost:a,isIPV6:!0}}}function n(e,a){let t="",c=!0;const f=e.length;for(let d=0;d{"use strict";function c(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function f(e,...a){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(a.length>0&&!a.includes(e.length))throw new Error(`Expected Uint8Array of length ${a}, not of length=${e.length}`)}function d(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");c(e.outputLen),c(e.blockLen)}function r(e,a=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(a&&e.finished)throw new Error("Hash#digest() has already been called")}function n(e,a){f(e);const t=a.outputLen;if(e.lengthn,ai:()=>c,ee:()=>f,t2:()=>r,tW:()=>d})},6800:(e,a,t)=>{"use strict";t.d(a,{D:()=>d});var c=t(89190),f=t(32531);class d extends f.Vw{constructor(e,a,t,c){super(),this.blockLen=e,this.outputLen=a,this.padOffset=t,this.isLE=c,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,f.O8)(this.buffer)}update(e){(0,c.t2)(this);const{view:a,buffer:t,blockLen:d}=this,r=(e=(0,f.ZJ)(e)).length;for(let c=0;cd-n&&(this.process(t,0),n=0);for(let e=n;e>f&d),n=Number(t&d),i=c?4:0,b=c?0:4;e.setUint32(a+i,r,c),e.setUint32(a+b,n,c)}(t,d-8,BigInt(8*this.length),r),this.process(t,0);const i=(0,f.O8)(e),b=this.outputLen;if(b%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const o=b/4,s=this.get();if(o>s.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e{"use strict";t.d(a,{Ay:()=>s,B4:()=>i,P5:()=>n,WM:()=>b,im:()=>o,lD:()=>r});const c=BigInt(2**32-1),f=BigInt(32);function d(e,a=!1){return a?{h:Number(e&c),l:Number(e>>f&c)}:{h:0|Number(e>>f&c),l:0|Number(e&c)}}function r(e,a=!1){let t=new Uint32Array(e.length),c=new Uint32Array(e.length);for(let f=0;fe<>>32-t,i=(e,a,t)=>a<>>32-t,b=(e,a,t)=>a<>>64-t,o=(e,a,t)=>e<>>64-t,s={fromBig:d,split:r,toBig:(e,a)=>BigInt(e>>>0)<>>0),shrSH:(e,a,t)=>e>>>t,shrSL:(e,a,t)=>e<<32-t|a>>>t,rotrSH:(e,a,t)=>e>>>t|a<<32-t,rotrSL:(e,a,t)=>e<<32-t|a>>>t,rotrBH:(e,a,t)=>e<<64-t|a>>>t-32,rotrBL:(e,a,t)=>e>>>t-32|a<<64-t,rotr32H:(e,a)=>a,rotr32L:(e,a)=>e,rotlSH:n,rotlSL:i,rotlBH:b,rotlBL:o,add:function(e,a,t,c){const f=(a>>>0)+(c>>>0);return{h:e+t+(f/2**32|0)|0,l:0|f}},add3L:(e,a,t)=>(e>>>0)+(a>>>0)+(t>>>0),add3H:(e,a,t,c)=>a+t+c+(e/2**32|0)|0,add4L:(e,a,t,c)=>(e>>>0)+(a>>>0)+(t>>>0)+(c>>>0),add4H:(e,a,t,c,f)=>a+t+c+f+(e/2**32|0)|0,add5H:(e,a,t,c,f,d)=>a+t+c+f+d+(e/2**32|0)|0,add5L:(e,a,t,c,f)=>(e>>>0)+(a>>>0)+(t>>>0)+(c>>>0)+(f>>>0)}},21454:(e,a,t)=>{"use strict";t.d(a,{w:()=>r});var c=t(89190),f=t(32531);class d extends f.Vw{constructor(e,a){super(),this.finished=!1,this.destroyed=!1,(0,c.tW)(e);const t=(0,f.ZJ)(a);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const d=this.blockLen,r=new Uint8Array(d);r.set(t.length>d?e.create().update(t).digest():t);for(let e=0;enew d(e,a).update(t).digest();r.create=(e,a)=>new d(e,a)},2200:(e,a,t)=>{"use strict";t.d(a,{A:()=>r});var c=t(89190),f=t(21454),d=t(32531);function r(e,a,t,r){const{c:n,dkLen:i,DK:b,PRF:o,PRFSalt:s}=function(e,a,t,r){(0,c.tW)(e);const n=(0,d.tY)({dkLen:32,asyncTick:10},r),{c:i,dkLen:b,asyncTick:o}=n;if((0,c.ai)(i),(0,c.ai)(b),(0,c.ai)(o),i<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const s=(0,d.ZJ)(a),l=(0,d.ZJ)(t),u=new Uint8Array(b),h=f.w.create(e,s),p=h._cloneInto().update(l);return{c:i,dkLen:b,asyncTick:o,DK:u,PRF:h,PRFSalt:p}}(e,a,t,r);let l;const u=new Uint8Array(4),h=(0,d.O8)(u),p=new Uint8Array(o.outputLen);for(let e=1,a=0;a{"use strict";t.d(a,{s:()=>o});var c=t(6800),f=t(32531);const d=(e,a,t)=>e&a^e&t^a&t,r=new Uint32Array([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]),n=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),i=new Uint32Array(64);class b extends c.D{constructor(){super(64,32,8,!1),this.A=0|n[0],this.B=0|n[1],this.C=0|n[2],this.D=0|n[3],this.E=0|n[4],this.F=0|n[5],this.G=0|n[6],this.H=0|n[7]}get(){const{A:e,B:a,C:t,D:c,E:f,F:d,G:r,H:n}=this;return[e,a,t,c,f,d,r,n]}set(e,a,t,c,f,d,r,n){this.A=0|e,this.B=0|a,this.C=0|t,this.D=0|c,this.E=0|f,this.F=0|d,this.G=0|r,this.H=0|n}process(e,a){for(let t=0;t<16;t++,a+=4)i[t]=e.getUint32(a,!1);for(let e=16;e<64;e++){const a=i[e-15],t=i[e-2],c=(0,f.Ow)(a,7)^(0,f.Ow)(a,18)^a>>>3,d=(0,f.Ow)(t,17)^(0,f.Ow)(t,19)^t>>>10;i[e]=d+i[e-7]+c+i[e-16]|0}let{A:t,B:c,C:n,D:b,E:o,F:s,G:l,H:u}=this;for(let e=0;e<64;e++){const a=u+((0,f.Ow)(o,6)^(0,f.Ow)(o,11)^(0,f.Ow)(o,25))+((h=o)&s^~h&l)+r[e]+i[e]|0,p=((0,f.Ow)(t,2)^(0,f.Ow)(t,13)^(0,f.Ow)(t,22))+d(t,c,n)|0;u=l,l=s,s=o,o=b+a|0,b=n,n=c,c=t,t=a+p|0}var h;t=t+this.A|0,c=c+this.B|0,n=n+this.C|0,b=b+this.D|0,o=o+this.E|0,s=s+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(t,c,n,b,o,s,l,u)}roundClean(){i.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const o=(0,f.ld)((()=>new b))},32531:(e,a,t)=>{"use strict";t.d(a,{Vw:()=>l,$h:()=>b,tY:()=>h,Id:()=>s,O8:()=>r,po:()=>g,Ow:()=>n,ZJ:()=>o,DH:()=>d,ld:()=>p});const c="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,f=e=>e instanceof Uint8Array,d=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),r=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),n=(e,a)=>e<<32-a|e>>>a;if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");const i=async()=>{};async function b(e,a,t){let c=Date.now();for(let f=0;f=0&&ee+a.length),0));let t=0;return e.forEach((e=>{if(!f(e))throw new Error("Uint8Array expected");a.set(e,t),t+=e.length})),a}class l{clone(){return this._cloneInto()}}const u={}.toString;function h(e,a){if(void 0!==a&&"[object Object]"!==u.call(a))throw new Error("Options should be object or undefined");return Object.assign(e,a)}function p(e){const a=a=>e().update(o(a)).digest(),t=e();return a.outputLen=t.outputLen,a.blockLen=t.blockLen,a.create=()=>e(),a}function g(e=32){if(c&&"function"==typeof c.getRandomValues)return c.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}},90294:(e,a,t)=>{"use strict";t.d(a,{HI:()=>Bt,vu:()=>ct});const c=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];function f(e,a){return a&&10!=a?16==a?"0x"==e.slice(0,2)?BigInt(e):BigInt("0x"+e):void 0:BigInt(e)}const d=f;function r(e){const a=e.toString(16);return 4*(a.length-1)+c[parseInt(a[0],16)]}function n(e){return BigInt(e)>BigInt(a)}const o=i,s=b;function l(e){return(BigInt(e)&BigInt(1))==BigInt(1)}function u(e){if(e>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("Number too big");return Number(e)}function h(e,a){return BigInt(e)+BigInt(a)}function p(e,a){return BigInt(e)-BigInt(a)}function g(e){return-BigInt(e)}function m(e,a){return BigInt(e)*BigInt(a)}function x(e,a){return BigInt(e)%BigInt(a)}function y(e,a){return BigInt(e)>BigInt(a)}function A(e,a){return BigInt(e)>=BigInt(a)}function v(e,a){return BigInt(e)&BigInt(a)}function w(e,a,t,c){const f="0000000"+t.toString(16),d=new Uint32Array(e.buffer,e.byteOffset+a,c/4),r=1+(4*(f.length-7)-1>>5);for(let e=0;ed[d.length-a-1]=e.toString(16).padStart(8,"0"))),f(d.join(""),16)}function I(e,a){return e.toString(a)}function E(e){const a=new Uint8Array(Math.floor((r(e)-1)/8)+1);return w(a,0,e,a.byteLength),a}const C=d(0),M=d(1);var B=Object.freeze({__proto__:null,abs:function(e){return BigInt(e)>=0?BigInt(e):-BigInt(e)},add:h,band:v,bitLength:r,bits:function(e){let a=BigInt(e);const t=[];for(;a;)a&BigInt(1)?t.push(1):t.push(0),a>>=BigInt(1);return t},bor:function(e,a){return BigInt(e)|BigInt(a)},bxor:function(e,a){return BigInt(e)^BigInt(a)},div:function(e,a){return BigInt(e)/BigInt(a)},e:d,eq:function(e,a){return BigInt(e)==BigInt(a)},exp:function(e,a){return BigInt(e)**BigInt(a)},fromArray:function(e,a){let t=BigInt(0);a=BigInt(a);for(let c=0;c>=BigInt(1)}return t},neg:g,neq:function(e,a){return BigInt(e)!=BigInt(a)},one:M,pow:function(e,a){return BigInt(e)**BigInt(a)},shiftLeft:i,shiftRight:b,shl:o,shr:s,square:function(e){return BigInt(e)*BigInt(e)},sub:p,toArray:function(e,a){const t=[];let c=BigInt(e);for(a=BigInt(a);c;)t.unshift(Number(c%a)),c/=a;return t},toLEBuff:E,toNumber:u,toRprBE:function(e,a,t,c){const f="0000000"+t.toString(16),d=new DataView(e.buffer,e.byteOffset+a,c),r=1+(4*(f.length-7)-1>>5);for(let e=0;e>=1;return t}function S(e,a,t,c,f){e[a]=e[a]+e[t]>>>0,e[f]=(e[f]^e[a])>>>0,e[f]=(e[f]<<16|e[f]>>>16&65535)>>>0,e[c]=e[c]+e[f]>>>0,e[t]=(e[t]^e[c])>>>0,e[t]=(e[t]<<12|e[t]>>>20&4095)>>>0,e[a]=e[a]+e[t]>>>0,e[f]=(e[f]^e[a])>>>0,e[f]=(e[f]<<8|e[f]>>>24&255)>>>0,e[c]=e[c]+e[f]>>>0,e[t]=(e[t]^e[c])>>>0,e[t]=(e[t]<<7|e[t]>>>25&127)>>>0}class T{constructor(e){e=e||[0,0,0,0,0,0,0,0],this.state=[1634760805,857760878,2036477234,1797285236,e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],0,0,0,0],this.idx=16,this.buff=new Array(16)}nextU32(){return 16==this.idx&&this.update(),this.buff[this.idx++]}nextU64(){return h(m(this.nextU32(),4294967296),this.nextU32())}nextBool(){return!(1&~this.nextU32())}update(){for(let e=0;e<16;e++)this.buff[e]=this.state[e];for(let a=0;a<10;a++)S(e=this.buff,0,4,8,12),S(e,1,5,9,13),S(e,2,6,10,14),S(e,3,7,11,15),S(e,0,5,10,15),S(e,1,6,11,12),S(e,2,7,8,13),S(e,3,4,9,14);var e;for(let e=0;e<16;e++)this.buff[e]=this.buff[e]+this.state[e]>>>0;this.idx=0,this.state[12]=this.state[12]+1>>>0,0==this.state[12]&&(this.state[13]=this.state[13]+1>>>0,0==this.state[13]&&(this.state[14]=this.state[14]+1>>>0,0==this.state[14]&&(this.state[15]=this.state[15]+1>>>0)))}}let N=null;function R(){return N||(N=new T(function(){const e=function(e){let a=new Uint8Array(e);if(void 0!==globalThis.crypto)globalThis.crypto.getRandomValues(a);else for(let t=0;t>>0;return a}(32),a=new Uint32Array(e.buffer),t=[];for(let e=0;e<8;e++)t.push(a[e]);return t}()),N)}function P(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var D={bigInt2BytesLE:function(e,a){const t=Array(a);let c=BigInt(e);for(let e=0;e>=8n;return t},bigInt2U32LE:function(e,a){const t=Array(a);let c=BigInt(e);for(let e=0;e>=32n;return t},isOcamNum:function(e){return!!Array.isArray(e)&&3==e.length&&"number"==typeof e[0]&&"number"==typeof e[1]&&!!Array.isArray(e[2])}},O=function(e,a,t,c,f,d,r){const n=e.addFunction(a);n.addParam("base","i32"),n.addParam("scalar","i32"),n.addParam("scalarLength","i32"),n.addParam("r","i32"),n.addLocal("i","i32"),n.addLocal("b","i32");const i=n.getCodeBuilder(),b=i.i32_const(e.alloc(t));n.addCode(i.if(i.i32_eqz(i.getLocal("scalarLength")),[...i.call(r,i.getLocal("r")),...i.ret([])])),n.addCode(i.call(d,i.getLocal("base"),b)),n.addCode(i.call(r,i.getLocal("r"))),n.addCode(i.setLocal("i",i.getLocal("scalarLength"))),n.addCode(i.block(i.loop(i.setLocal("i",i.i32_sub(i.getLocal("i"),i.i32_const(1))),i.setLocal("b",i.i32_load8_u(i.i32_add(i.getLocal("scalar"),i.getLocal("i")))),...function(){const e=[];for(let a=0;a<8;a++)e.push(...i.call(f,i.getLocal("r"),i.getLocal("r")),...i.if(i.i32_ge_u(i.getLocal("b"),i.i32_const(128>>a)),[...i.setLocal("b",i.i32_sub(i.getLocal("b"),i.i32_const(128>>a))),...i.call(c,i.getLocal("r"),b,i.getLocal("r"))]));return e}(),i.br_if(1,i.i32_eqz(i.getLocal("i"))),i.br(0))))},F=function(e,a){const t=8*e.modules[a].n64,c=e.addFunction(a+"_batchInverse");c.addParam("pIn","i32"),c.addParam("inStep","i32"),c.addParam("n","i32"),c.addParam("pOut","i32"),c.addParam("outStep","i32"),c.addLocal("itAux","i32"),c.addLocal("itIn","i32"),c.addLocal("itOut","i32"),c.addLocal("i","i32");const f=c.getCodeBuilder(),d=f.i32_const(e.alloc(t));c.addCode(f.setLocal("itAux",f.i32_load(f.i32_const(0))),f.i32_store(f.i32_const(0),f.i32_add(f.getLocal("itAux"),f.i32_mul(f.i32_add(f.getLocal("n"),f.i32_const(1)),f.i32_const(t))))),c.addCode(f.call(a+"_one",f.getLocal("itAux")),f.setLocal("itIn",f.getLocal("pIn")),f.setLocal("itAux",f.i32_add(f.getLocal("itAux"),f.i32_const(t))),f.setLocal("i",f.i32_const(0)),f.block(f.loop(f.br_if(1,f.i32_eq(f.getLocal("i"),f.getLocal("n"))),f.if(f.call(a+"_isZero",f.getLocal("itIn")),f.call(a+"_copy",f.i32_sub(f.getLocal("itAux"),f.i32_const(t)),f.getLocal("itAux")),f.call(a+"_mul",f.getLocal("itIn"),f.i32_sub(f.getLocal("itAux"),f.i32_const(t)),f.getLocal("itAux"))),f.setLocal("itIn",f.i32_add(f.getLocal("itIn"),f.getLocal("inStep"))),f.setLocal("itAux",f.i32_add(f.getLocal("itAux"),f.i32_const(t))),f.setLocal("i",f.i32_add(f.getLocal("i"),f.i32_const(1))),f.br(0))),f.setLocal("itIn",f.i32_sub(f.getLocal("itIn"),f.getLocal("inStep"))),f.setLocal("itAux",f.i32_sub(f.getLocal("itAux"),f.i32_const(t))),f.setLocal("itOut",f.i32_add(f.getLocal("pOut"),f.i32_mul(f.i32_sub(f.getLocal("n"),f.i32_const(1)),f.getLocal("outStep")))),f.call(a+"_inverse",f.getLocal("itAux"),f.getLocal("itAux")),f.block(f.loop(f.br_if(1,f.i32_eqz(f.getLocal("i"))),f.if(f.call(a+"_isZero",f.getLocal("itIn")),[...f.call(a+"_copy",f.getLocal("itAux"),f.i32_sub(f.getLocal("itAux"),f.i32_const(t))),...f.call(a+"_zero",f.getLocal("itOut"))],[...f.call(a+"_copy",f.i32_sub(f.getLocal("itAux"),f.i32_const(t)),d),...f.call(a+"_mul",f.getLocal("itAux"),f.getLocal("itIn"),f.i32_sub(f.getLocal("itAux"),f.i32_const(t))),...f.call(a+"_mul",f.getLocal("itAux"),d,f.getLocal("itOut"))]),f.setLocal("itIn",f.i32_sub(f.getLocal("itIn"),f.getLocal("inStep"))),f.setLocal("itOut",f.i32_sub(f.getLocal("itOut"),f.getLocal("outStep"))),f.setLocal("itAux",f.i32_sub(f.getLocal("itAux"),f.i32_const(t))),f.setLocal("i",f.i32_sub(f.getLocal("i"),f.i32_const(1))),f.br(0)))),c.addCode(f.i32_store(f.i32_const(0),f.getLocal("itAux")))},Q=function(e,a,t,c,f,d){void 0===d&&(d=ca?1:-1}function H(e){return e*e}function q(e){return e%2n!==0n}function $(e){return e%2n===0n}function z(e){return e<0n}function G(e){return e>0n}function K(e){return z(e)?e.toString(2).length-1:e.toString(2).length}function V(e){return e<0n?-e:e}function Z(e){return 1n===V(e)}function J(e,a){for(var t,c,f,d=0n,r=1n,n=a,i=V(e);0n!==i;)t=n/i,c=d,f=n,d=r,n=i,r=c-t*r,i=f-t*i;if(!Z(n))throw new Error(e.toString()+" and "+a.toString()+" are not co-prime");return-1===j(d,0n)&&(d+=a),z(e)?-d:d}function W(e,a,t){if(0n===t)throw new Error("Cannot take modPow with modulus 0");var c=1n,f=e%t;for(z(a)&&(a*=-1n,f=J(f,t));G(a);){if(0n===f)return 0n;q(a)&&(c=c*f%t),a/=2n,f=H(f)%t}return c}function Y(e,a){return 0n!==a&&(!!Z(a)||(0===function(e,a){return(e=e>=0n?e:-e)===(a=a>=0n?a:-a)?0:e>a?1:-1}(a,2n)?$(e):e%a===0n))}function X(e,a){for(var t,c,f,d=function(e){return e-1n}(e),r=d,n=0;$(r);)r/=2n,n++;e:for(c=0;c>1&&c>1,e>>1)))),a.addCode(t.setLocal(i,t.i64_add(t.getLocal(i),t.i64_shr_u(t.getLocal(n),t.i64_const(32)))))),e>0&&(a.addCode(t.setLocal(n,t.i64_add(t.i64_and(t.getLocal(n),t.i64_const(4294967295)),t.i64_and(t.getLocal(b),t.i64_const(4294967295))))),a.addCode(t.setLocal(i,t.i64_add(t.i64_add(t.getLocal(i),t.i64_shr_u(t.getLocal(n),t.i64_const(32))),t.getLocal(o))))),a.addCode(t.i64_store32(t.getLocal("r"),4*e,t.getLocal(n))),a.addCode(t.setLocal(b,t.getLocal(i)),t.setLocal(o,t.i64_shr_u(t.getLocal(b),t.i64_const(32))))}a.addCode(t.i64_store32(t.getLocal("r"),4*f*2-4,t.getLocal(b)))}(),function(){const a=e.addFunction(c+"_squareOld");a.addParam("x","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.call(c+"_mul",t.getLocal("x"),t.getLocal("x"),t.getLocal("r")))}(),function(){!function(){const a=e.addFunction(c+"__mul1");a.addParam("px","i32"),a.addParam("y","i64"),a.addParam("pr","i32"),a.addLocal("c","i64");const t=a.getCodeBuilder();a.addCode(t.setLocal("c",t.i64_mul(t.i64_load32_u(t.getLocal("px"),0,0),t.getLocal("y")))),a.addCode(t.i64_store32(t.getLocal("pr"),0,0,t.getLocal("c")));for(let e=1;e>1n,g=e.alloc(n,ee.bigInt2BytesLE(p,n)),m=p+1n,x=e.alloc(n,ee.bigInt2BytesLE(m,n));e.modules[i]={pq:o,pR2:s,n64:d,q:f,pOne:l,pZero:u,pePlusOne:x};let y=2n;if(ie(f))for(;ne(y,p,f)!==h;)y+=1n;let A=0,v=h;for(;!be(v)&&0n!==v;)A++,v>>=1n;const w=e.alloc(n,ee.bigInt2BytesLE(v,n)),_=ne(y,v,f),I=e.alloc(ee.bigInt2BytesLE((_<>1n,C=e.alloc(n,ee.bigInt2BytesLE(E,n));return e.exportFunction(b+"_copy",i+"_copy"),e.exportFunction(b+"_zero",i+"_zero"),e.exportFunction(b+"_isZero",i+"_isZero"),e.exportFunction(b+"_eq",i+"_eq"),function(){const a=e.addFunction(i+"_isOne");a.addParam("x","i32"),a.setReturnType("i32");const t=a.getCodeBuilder();a.addCode(t.ret(t.call(b+"_eq",t.getLocal("x"),t.i32_const(l))))}(),function(){const a=e.addFunction(i+"_add");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.if(t.call(b+"_add",t.getLocal("x"),t.getLocal("y"),t.getLocal("r")),t.drop(t.call(b+"_sub",t.getLocal("r"),t.i32_const(o),t.getLocal("r"))),t.if(t.call(b+"_gte",t.getLocal("r"),t.i32_const(o)),t.drop(t.call(b+"_sub",t.getLocal("r"),t.i32_const(o),t.getLocal("r"))))))}(),function(){const a=e.addFunction(i+"_sub");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.if(t.call(b+"_sub",t.getLocal("x"),t.getLocal("y"),t.getLocal("r")),t.drop(t.call(b+"_add",t.getLocal("r"),t.i32_const(o),t.getLocal("r")))))}(),function(){const a=e.addFunction(i+"_neg");a.addParam("x","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.call(i+"_sub",t.i32_const(u),t.getLocal("x"),t.getLocal("r")))}(),function(){const a=e.alloc(r*r*8),t=e.addFunction(i+"_mReduct");t.addParam("t","i32"),t.addParam("r","i32"),t.addLocal("np32","i64"),t.addLocal("c","i64"),t.addLocal("m","i64");const c=t.getCodeBuilder(),d=Number(0x100000000n-re(f,0x100000000n));t.addCode(c.setLocal("np32",c.i64_const(d)));for(let e=0;e=r&&a.addCode(t.i64_store32(t.getLocal("r"),4*(e-r),t.getLocal(h))),[h,p]=[p,h],a.addCode(t.setLocal(p,t.i64_shr_u(t.getLocal(h),t.i64_const(32))))}a.addCode(t.i64_store32(t.getLocal("r"),4*r-4,t.getLocal(h))),a.addCode(t.if(t.i32_wrap_i64(t.getLocal(p)),t.drop(t.call(b+"_sub",t.getLocal("r"),t.i32_const(o),t.getLocal("r"))),t.if(t.call(b+"_gte",t.getLocal("r"),t.i32_const(o)),t.drop(t.call(b+"_sub",t.getLocal("r"),t.i32_const(o),t.getLocal("r"))))))}(),function(){const a=e.addFunction(i+"_square");a.addParam("x","i32"),a.addParam("r","i32"),a.addLocal("c0","i64"),a.addLocal("c1","i64"),a.addLocal("c0_old","i64"),a.addLocal("c1_old","i64"),a.addLocal("np32","i64");for(let e=0;e>1&&c>1,e>>1)))),a.addCode(t.setLocal(h,t.i64_add(t.getLocal(h),t.i64_shr_u(t.getLocal(u),t.i64_const(32)))))),e>0&&(a.addCode(t.setLocal(u,t.i64_add(t.i64_and(t.getLocal(u),t.i64_const(4294967295)),t.i64_and(t.getLocal(p),t.i64_const(4294967295))))),a.addCode(t.setLocal(h,t.i64_add(t.i64_add(t.getLocal(h),t.i64_shr_u(t.getLocal(u),t.i64_const(32))),t.getLocal(g)))));for(let c=Math.max(1,e-r+1);c<=e&&c=r&&a.addCode(t.i64_store32(t.getLocal("r"),4*(e-r),t.getLocal(u))),a.addCode(t.setLocal(p,t.getLocal(h)),t.setLocal(g,t.i64_shr_u(t.getLocal(p),t.i64_const(32))))}a.addCode(t.i64_store32(t.getLocal("r"),4*r-4,t.getLocal(p))),a.addCode(t.if(t.i32_wrap_i64(t.getLocal(g)),t.drop(t.call(b+"_sub",t.getLocal("r"),t.i32_const(o),t.getLocal("r"))),t.if(t.call(b+"_gte",t.getLocal("r"),t.i32_const(o)),t.drop(t.call(b+"_sub",t.getLocal("r"),t.i32_const(o),t.getLocal("r"))))))}(),function(){const a=e.addFunction(i+"_squareOld");a.addParam("x","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.call(i+"_mul",t.getLocal("x"),t.getLocal("x"),t.getLocal("r")))}(),function(){const a=e.addFunction(i+"_toMontgomery");a.addParam("x","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.call(i+"_mul",t.getLocal("x"),t.i32_const(s),t.getLocal("r")))}(),function(){const a=e.alloc(2*n),t=e.addFunction(i+"_fromMontgomery");t.addParam("x","i32"),t.addParam("r","i32");const c=t.getCodeBuilder();t.addCode(c.call(b+"_copy",c.getLocal("x"),c.i32_const(a))),t.addCode(c.call(b+"_zero",c.i32_const(a+n))),t.addCode(c.call(i+"_mReduct",c.i32_const(a),c.getLocal("r")))}(),function(){const a=e.addFunction(i+"_isNegative");a.addParam("x","i32"),a.setReturnType("i32");const t=a.getCodeBuilder(),c=t.i32_const(e.alloc(n));a.addCode(t.call(i+"_fromMontgomery",t.getLocal("x"),c),t.call(b+"_gte",c,t.i32_const(x)))}(),function(){const a=e.addFunction(i+"_sign");a.addParam("x","i32"),a.setReturnType("i32");const t=a.getCodeBuilder(),c=t.i32_const(e.alloc(n));a.addCode(t.if(t.call(b+"_isZero",t.getLocal("x")),t.ret(t.i32_const(0))),t.call(i+"_fromMontgomery",t.getLocal("x"),c),t.if(t.call(b+"_gte",c,t.i32_const(x)),t.ret(t.i32_const(-1))),t.ret(t.i32_const(1)))}(),function(){const a=e.addFunction(i+"_inverse");a.addParam("x","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.call(i+"_fromMontgomery",t.getLocal("x"),t.getLocal("r"))),a.addCode(t.call(b+"_inverseMod",t.getLocal("r"),t.i32_const(o),t.getLocal("r"))),a.addCode(t.call(i+"_toMontgomery",t.getLocal("r"),t.getLocal("r")))}(),function(){const a=e.addFunction(i+"_one");a.addParam("pr","i32");const t=a.getCodeBuilder();a.addCode(t.call(b+"_copy",t.i32_const(l),t.getLocal("pr")))}(),function(){const a=e.addFunction(i+"_load");a.addParam("scalar","i32"),a.addParam("scalarLen","i32"),a.addParam("r","i32"),a.addLocal("p","i32"),a.addLocal("l","i32"),a.addLocal("i","i32"),a.addLocal("j","i32");const t=a.getCodeBuilder(),c=t.i32_const(e.alloc(n)),f=e.alloc(n),d=t.i32_const(f);a.addCode(t.call(b+"_zero",t.getLocal("r")),t.setLocal("i",t.i32_const(n)),t.setLocal("p",t.getLocal("scalar")),t.block(t.loop(t.br_if(1,t.i32_gt_u(t.getLocal("i"),t.getLocal("scalarLen"))),t.if(t.i32_eq(t.getLocal("i"),t.i32_const(n)),t.call(i+"_one",c),t.call(i+"_mul",c,t.i32_const(s),c)),t.call(i+"_mul",t.getLocal("p"),c,d),t.call(i+"_add",t.getLocal("r"),d,t.getLocal("r")),t.setLocal("p",t.i32_add(t.getLocal("p"),t.i32_const(n))),t.setLocal("i",t.i32_add(t.getLocal("i"),t.i32_const(n))),t.br(0))),t.setLocal("l",t.i32_rem_u(t.getLocal("scalarLen"),t.i32_const(n))),t.if(t.i32_eqz(t.getLocal("l")),t.ret([])),t.call(b+"_zero",d),t.setLocal("j",t.i32_const(0)),t.block(t.loop(t.br_if(1,t.i32_eq(t.getLocal("j"),t.getLocal("l"))),t.i32_store8(t.getLocal("j"),f,t.i32_load8_u(t.getLocal("p"))),t.setLocal("p",t.i32_add(t.getLocal("p"),t.i32_const(1))),t.setLocal("j",t.i32_add(t.getLocal("j"),t.i32_const(1))),t.br(0))),t.if(t.i32_eq(t.getLocal("i"),t.i32_const(n)),t.call(i+"_one",c),t.call(i+"_mul",c,t.i32_const(s),c)),t.call(i+"_mul",d,c,d),t.call(i+"_add",t.getLocal("r"),d,t.getLocal("r")))}(),function(){const a=e.addFunction(i+"_timesScalar");a.addParam("x","i32"),a.addParam("scalar","i32"),a.addParam("scalarLen","i32"),a.addParam("r","i32");const t=a.getCodeBuilder(),c=t.i32_const(e.alloc(n));a.addCode(t.call(i+"_load",t.getLocal("scalar"),t.getLocal("scalarLen"),c),t.call(i+"_toMontgomery",c,c),t.call(i+"_mul",t.getLocal("x"),c,t.getLocal("r")))}(),te(e,i),ce(e,i+"_batchToMontgomery",i+"_toMontgomery",n,n),ce(e,i+"_batchFromMontgomery",i+"_fromMontgomery",n,n),ce(e,i+"_batchNeg",i+"_neg",n,n),fe(e,i+"_batchAdd",i+"_add",n,n),fe(e,i+"_batchSub",i+"_sub",n,n),fe(e,i+"_batchMul",i+"_mul",n,n),e.exportFunction(i+"_add"),e.exportFunction(i+"_sub"),e.exportFunction(i+"_neg"),e.exportFunction(i+"_isNegative"),e.exportFunction(i+"_isOne"),e.exportFunction(i+"_sign"),e.exportFunction(i+"_mReduct"),e.exportFunction(i+"_mul"),e.exportFunction(i+"_square"),e.exportFunction(i+"_squareOld"),e.exportFunction(i+"_fromMontgomery"),e.exportFunction(i+"_toMontgomery"),e.exportFunction(i+"_inverse"),e.exportFunction(i+"_one"),e.exportFunction(i+"_load"),e.exportFunction(i+"_timesScalar"),ae(e,i+"_exp",n,i+"_mul",i+"_square",b+"_copy",i+"_one"),e.exportFunction(i+"_exp"),e.exportFunction(i+"_batchInverse"),ie(f)&&(function(){const a=e.addFunction(i+"_sqrt");a.addParam("n","i32"),a.addParam("r","i32"),a.addLocal("m","i32"),a.addLocal("i","i32"),a.addLocal("j","i32");const t=a.getCodeBuilder(),c=t.i32_const(l),f=t.i32_const(e.alloc(n)),d=t.i32_const(e.alloc(n)),r=t.i32_const(e.alloc(n)),b=t.i32_const(e.alloc(n)),o=t.i32_const(e.alloc(n));a.addCode(t.if(t.call(i+"_isZero",t.getLocal("n")),t.ret(t.call(i+"_zero",t.getLocal("r")))),t.setLocal("m",t.i32_const(A)),t.call(i+"_copy",t.i32_const(I),f),t.call(i+"_exp",t.getLocal("n"),t.i32_const(w),t.i32_const(n),d),t.call(i+"_exp",t.getLocal("n"),t.i32_const(C),t.i32_const(n),r),t.block(t.loop(t.br_if(1,t.call(i+"_eq",d,c)),t.call(i+"_square",d,b),t.setLocal("i",t.i32_const(1)),t.block(t.loop(t.br_if(1,t.call(i+"_eq",b,c)),t.call(i+"_square",b,b),t.setLocal("i",t.i32_add(t.getLocal("i"),t.i32_const(1))),t.br(0))),t.call(i+"_copy",f,o),t.setLocal("j",t.i32_sub(t.i32_sub(t.getLocal("m"),t.getLocal("i")),t.i32_const(1))),t.block(t.loop(t.br_if(1,t.i32_eqz(t.getLocal("j"))),t.call(i+"_square",o,o),t.setLocal("j",t.i32_sub(t.getLocal("j"),t.i32_const(1))),t.br(0))),t.setLocal("m",t.getLocal("i")),t.call(i+"_square",o,f),t.call(i+"_mul",d,f,d),t.call(i+"_mul",r,o,r),t.br(0))),t.if(t.call(i+"_isNegative",r),t.call(i+"_neg",r,t.getLocal("r")),t.call(i+"_copy",r,t.getLocal("r"))))}(),function(){const a=e.addFunction(i+"_isSquare");a.addParam("n","i32"),a.setReturnType("i32");const t=a.getCodeBuilder(),c=t.i32_const(l),f=t.i32_const(e.alloc(n));a.addCode(t.if(t.call(i+"_isZero",t.getLocal("n")),t.ret(t.i32_const(1))),t.call(i+"_exp",t.getLocal("n"),t.i32_const(g),t.i32_const(n),f),t.call(i+"_eq",f,c))}(),e.exportFunction(i+"_sqrt"),e.exportFunction(i+"_isSquare")),e.exportFunction(i+"_batchToMontgomery"),e.exportFunction(i+"_batchFromMontgomery"),i};const le=se,{bitLength:ue}=U;var he=function(e,a,t,c,f){const d=BigInt(a),r=Math.floor((ue(d-1n)-1)/64)+1,n=8*r,i=t||"f1";if(e.modules[i])return i;e.modules[i]={n64:r};const b=f||"int",o=le(e,d,c,b),s=e.modules[o].pR2,l=e.modules[o].pq,u=e.modules[o].pePlusOne;return function(){const a=e.alloc(n),t=e.addFunction(i+"_mul");t.addParam("x","i32"),t.addParam("y","i32"),t.addParam("r","i32");const c=t.getCodeBuilder();t.addCode(c.call(o+"_mul",c.getLocal("x"),c.getLocal("y"),c.i32_const(a))),t.addCode(c.call(o+"_mul",c.i32_const(a),c.i32_const(s),c.getLocal("r")))}(),function(){const a=e.addFunction(i+"_square");a.addParam("x","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.call(i+"_mul",t.getLocal("x"),t.getLocal("x"),t.getLocal("r")))}(),function(){const a=e.addFunction(i+"_inverse");a.addParam("x","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.call(b+"_inverseMod",t.getLocal("x"),t.i32_const(l),t.getLocal("r")))}(),function(){const a=e.addFunction(i+"_isNegative");a.addParam("x","i32"),a.setReturnType("i32");const t=a.getCodeBuilder();a.addCode(t.call(b+"_gte",t.getLocal("x"),t.i32_const(u)))}(),e.exportFunction(o+"_add",i+"_add"),e.exportFunction(o+"_sub",i+"_sub"),e.exportFunction(o+"_neg",i+"_neg"),e.exportFunction(i+"_mul"),e.exportFunction(i+"_square"),e.exportFunction(i+"_inverse"),e.exportFunction(i+"_isNegative"),e.exportFunction(o+"_copy",i+"_copy"),e.exportFunction(o+"_zero",i+"_zero"),e.exportFunction(o+"_one",i+"_one"),e.exportFunction(o+"_isZero",i+"_isZero"),e.exportFunction(o+"_eq",i+"_eq"),i};const pe=O,ge=F,me=D;var xe=function(e,a,t,c){if(e.modules[t])return t;const f=8*e.modules[c].n64,d=e.modules[c].q;return e.modules[t]={n64:2*e.modules[c].n64},function(){const a=e.addFunction(t+"_isZero");a.addParam("x","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f));a.addCode(d.i32_and(d.call(c+"_isZero",r),d.call(c+"_isZero",n)))}(),function(){const a=e.addFunction(t+"_isOne");a.addParam("x","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f));a.addCode(d.ret(d.i32_and(d.call(c+"_isOne",r),d.call(c+"_isZero",n))))}(),function(){const a=e.addFunction(t+"_zero");a.addParam("x","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f));a.addCode(d.call(c+"_zero",r),d.call(c+"_zero",n))}(),function(){const a=e.addFunction(t+"_one");a.addParam("x","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f));a.addCode(d.call(c+"_one",r),d.call(c+"_zero",n))}(),function(){const a=e.addFunction(t+"_copy");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("r"),b=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_copy",r,i),d.call(c+"_copy",n,b))}(),function(){const d=e.addFunction(t+"_mul");d.addParam("x","i32"),d.addParam("y","i32"),d.addParam("r","i32");const r=d.getCodeBuilder(),n=r.getLocal("x"),i=r.i32_add(r.getLocal("x"),r.i32_const(f)),b=r.getLocal("y"),o=r.i32_add(r.getLocal("y"),r.i32_const(f)),s=r.getLocal("r"),l=r.i32_add(r.getLocal("r"),r.i32_const(f)),u=r.i32_const(e.alloc(f)),h=r.i32_const(e.alloc(f)),p=r.i32_const(e.alloc(f)),g=r.i32_const(e.alloc(f));d.addCode(r.call(c+"_mul",n,b,u),r.call(c+"_mul",i,o,h),r.call(c+"_add",n,i,p),r.call(c+"_add",b,o,g),r.call(c+"_mul",p,g,p),r.call(a,h,s),r.call(c+"_add",u,s,s),r.call(c+"_add",u,h,l),r.call(c+"_sub",p,l,l))}(),function(){const a=e.addFunction(t+"_mul1");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("y"),b=d.getLocal("r"),o=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_mul",r,i,b),d.call(c+"_mul",n,i,o))}(),function(){const d=e.addFunction(t+"_square");d.addParam("x","i32"),d.addParam("r","i32");const r=d.getCodeBuilder(),n=r.getLocal("x"),i=r.i32_add(r.getLocal("x"),r.i32_const(f)),b=r.getLocal("r"),o=r.i32_add(r.getLocal("r"),r.i32_const(f)),s=r.i32_const(e.alloc(f)),l=r.i32_const(e.alloc(f)),u=r.i32_const(e.alloc(f)),h=r.i32_const(e.alloc(f));d.addCode(r.call(c+"_mul",n,i,s),r.call(c+"_add",n,i,l),r.call(a,i,u),r.call(c+"_add",n,u,u),r.call(a,s,h),r.call(c+"_add",h,s,h),r.call(c+"_mul",l,u,b),r.call(c+"_sub",b,h,b),r.call(c+"_add",s,s,o))}(),function(){const a=e.addFunction(t+"_add");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("y"),b=d.i32_add(d.getLocal("y"),d.i32_const(f)),o=d.getLocal("r"),s=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_add",r,i,o),d.call(c+"_add",n,b,s))}(),function(){const a=e.addFunction(t+"_sub");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("y"),b=d.i32_add(d.getLocal("y"),d.i32_const(f)),o=d.getLocal("r"),s=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_sub",r,i,o),d.call(c+"_sub",n,b,s))}(),function(){const a=e.addFunction(t+"_neg");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("r"),b=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_neg",r,i),d.call(c+"_neg",n,b))}(),function(){const a=e.addFunction(t+"_conjugate");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("r"),b=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_copy",r,i),d.call(c+"_neg",n,b))}(),function(){const a=e.addFunction(t+"_toMontgomery");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("r"),b=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_toMontgomery",r,i),d.call(c+"_toMontgomery",n,b))}(),function(){const a=e.addFunction(t+"_fromMontgomery");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("r"),b=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_fromMontgomery",r,i),d.call(c+"_fromMontgomery",n,b))}(),function(){const a=e.addFunction(t+"_eq");a.addParam("x","i32"),a.addParam("y","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("y"),b=d.i32_add(d.getLocal("y"),d.i32_const(f));a.addCode(d.i32_and(d.call(c+"_eq",r,i),d.call(c+"_eq",n,b)))}(),function(){const d=e.addFunction(t+"_inverse");d.addParam("x","i32"),d.addParam("r","i32");const r=d.getCodeBuilder(),n=r.getLocal("x"),i=r.i32_add(r.getLocal("x"),r.i32_const(f)),b=r.getLocal("r"),o=r.i32_add(r.getLocal("r"),r.i32_const(f)),s=r.i32_const(e.alloc(f)),l=r.i32_const(e.alloc(f)),u=r.i32_const(e.alloc(f)),h=r.i32_const(e.alloc(f));d.addCode(r.call(c+"_square",n,s),r.call(c+"_square",i,l),r.call(a,l,u),r.call(c+"_sub",s,u,u),r.call(c+"_inverse",u,h),r.call(c+"_mul",n,h,b),r.call(c+"_mul",i,h,o),r.call(c+"_neg",o,o))}(),function(){const a=e.addFunction(t+"_timesScalar");a.addParam("x","i32"),a.addParam("scalar","i32"),a.addParam("scalarLen","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("r"),b=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_timesScalar",r,d.getLocal("scalar"),d.getLocal("scalarLen"),i),d.call(c+"_timesScalar",n,d.getLocal("scalar"),d.getLocal("scalarLen"),b))}(),function(){const a=e.addFunction(t+"_sign");a.addParam("x","i32"),a.addLocal("s","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f));a.addCode(d.setLocal("s",d.call(c+"_sign",n)),d.if(d.getLocal("s"),d.ret(d.getLocal("s"))),d.ret(d.call(c+"_sign",r)))}(),function(){const a=e.addFunction(t+"_isNegative");a.addParam("x","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f));a.addCode(d.if(d.call(c+"_isZero",n),d.ret(d.call(c+"_isNegative",r))),d.ret(d.call(c+"_isNegative",n)))}(),e.exportFunction(t+"_isZero"),e.exportFunction(t+"_isOne"),e.exportFunction(t+"_zero"),e.exportFunction(t+"_one"),e.exportFunction(t+"_copy"),e.exportFunction(t+"_mul"),e.exportFunction(t+"_mul1"),e.exportFunction(t+"_square"),e.exportFunction(t+"_add"),e.exportFunction(t+"_sub"),e.exportFunction(t+"_neg"),e.exportFunction(t+"_sign"),e.exportFunction(t+"_conjugate"),e.exportFunction(t+"_fromMontgomery"),e.exportFunction(t+"_toMontgomery"),e.exportFunction(t+"_eq"),e.exportFunction(t+"_inverse"),ge(e,t),pe(e,t+"_exp",2*f,t+"_mul",t+"_square",t+"_copy",t+"_one"),function(){const a=e.addFunction(t+"_sqrt");a.addParam("a","i32"),a.addParam("pr","i32");const r=a.getCodeBuilder(),n=r.i32_const(e.alloc(me.bigInt2BytesLE((BigInt(d||0)-3n)/4n,f))),i=r.i32_const(e.alloc(me.bigInt2BytesLE((BigInt(d||0)-1n)/2n,f))),b=r.getLocal("a"),o=r.i32_const(e.alloc(2*f)),s=r.i32_const(e.alloc(2*f)),l=r.i32_const(e.alloc(2*f)),u=e.alloc(2*f),h=r.i32_const(u),p=r.i32_const(u),g=r.i32_const(u+f),m=r.i32_const(e.alloc(2*f)),x=r.i32_const(e.alloc(2*f));a.addCode(r.call(t+"_one",h),r.call(t+"_neg",h,h),r.call(t+"_exp",b,n,r.i32_const(f),o),r.call(t+"_square",o,s),r.call(t+"_mul",b,s,s),r.call(t+"_conjugate",s,l),r.call(t+"_mul",l,s,l),r.if(r.call(t+"_eq",l,h),r.unreachable()),r.call(t+"_mul",o,b,m),r.if(r.call(t+"_eq",s,h),[...r.call(c+"_zero",p),...r.call(c+"_one",g),...r.call(t+"_mul",h,m,r.getLocal("pr"))],[...r.call(t+"_one",x),...r.call(t+"_add",x,s,x),...r.call(t+"_exp",x,i,r.i32_const(f),x),...r.call(t+"_mul",x,m,r.getLocal("pr"))]))}(),function(){const a=e.addFunction(t+"_isSquare");a.addParam("a","i32"),a.setReturnType("i32");const c=a.getCodeBuilder(),r=c.i32_const(e.alloc(me.bigInt2BytesLE((BigInt(d||0)-3n)/4n,f))),n=c.getLocal("a"),i=c.i32_const(e.alloc(2*f)),b=c.i32_const(e.alloc(2*f)),o=c.i32_const(e.alloc(2*f)),s=e.alloc(2*f),l=c.i32_const(s);a.addCode(c.call(t+"_one",l),c.call(t+"_neg",l,l),c.call(t+"_exp",n,r,c.i32_const(f),i),c.call(t+"_square",i,b),c.call(t+"_mul",n,b,b),c.call(t+"_conjugate",b,o),c.call(t+"_mul",o,b,o),c.if(c.call(t+"_eq",o,l),c.ret(c.i32_const(0))),c.ret(c.i32_const(1)))}(),e.exportFunction(t+"_exp"),e.exportFunction(t+"_timesScalar"),e.exportFunction(t+"_batchInverse"),e.exportFunction(t+"_sqrt"),e.exportFunction(t+"_isSquare"),e.exportFunction(t+"_isNegative"),t};const ye=O,Ae=F;var ve=function(e,a,t,c){if(e.modules[t])return t;const f=8*e.modules[c].n64;return e.modules[t]={n64:3*e.modules[c].n64},function(){const a=e.addFunction(t+"_isZero");a.addParam("x","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f));a.addCode(d.i32_and(d.i32_and(d.call(c+"_isZero",r),d.call(c+"_isZero",n)),d.call(c+"_isZero",i)))}(),function(){const a=e.addFunction(t+"_isOne");a.addParam("x","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f));a.addCode(d.ret(d.i32_and(d.i32_and(d.call(c+"_isOne",r),d.call(c+"_isZero",n)),d.call(c+"_isZero",i))))}(),function(){const a=e.addFunction(t+"_zero");a.addParam("x","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f));a.addCode(d.call(c+"_zero",r),d.call(c+"_zero",n),d.call(c+"_zero",i))}(),function(){const a=e.addFunction(t+"_one");a.addParam("x","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f));a.addCode(d.call(c+"_one",r),d.call(c+"_zero",n),d.call(c+"_zero",i))}(),function(){const a=e.addFunction(t+"_copy");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("r"),o=d.i32_add(d.getLocal("r"),d.i32_const(f)),s=d.i32_add(d.getLocal("r"),d.i32_const(2*f));a.addCode(d.call(c+"_copy",r,b),d.call(c+"_copy",n,o),d.call(c+"_copy",i,s))}(),function(){const d=e.addFunction(t+"_mul");d.addParam("x","i32"),d.addParam("y","i32"),d.addParam("r","i32");const r=d.getCodeBuilder(),n=r.getLocal("x"),i=r.i32_add(r.getLocal("x"),r.i32_const(f)),b=r.i32_add(r.getLocal("x"),r.i32_const(2*f)),o=r.getLocal("y"),s=r.i32_add(r.getLocal("y"),r.i32_const(f)),l=r.i32_add(r.getLocal("y"),r.i32_const(2*f)),u=r.getLocal("r"),h=r.i32_add(r.getLocal("r"),r.i32_const(f)),p=r.i32_add(r.getLocal("r"),r.i32_const(2*f)),g=r.i32_const(e.alloc(f)),m=r.i32_const(e.alloc(f)),x=r.i32_const(e.alloc(f)),y=r.i32_const(e.alloc(f)),A=r.i32_const(e.alloc(f)),v=r.i32_const(e.alloc(f)),w=r.i32_const(e.alloc(f)),_=r.i32_const(e.alloc(f)),I=r.i32_const(e.alloc(f)),E=r.i32_const(e.alloc(f)),C=r.i32_const(e.alloc(f)),M=r.i32_const(e.alloc(f)),B=r.i32_const(e.alloc(f));d.addCode(r.call(c+"_mul",n,o,g),r.call(c+"_mul",i,s,m),r.call(c+"_mul",b,l,x),r.call(c+"_add",n,i,y),r.call(c+"_add",o,s,A),r.call(c+"_add",n,b,v),r.call(c+"_add",o,l,w),r.call(c+"_add",i,b,_),r.call(c+"_add",s,l,I),r.call(c+"_add",g,m,E),r.call(c+"_add",g,x,C),r.call(c+"_add",m,x,M),r.call(c+"_mul",_,I,u),r.call(c+"_sub",u,M,u),r.call(a,u,u),r.call(c+"_add",g,u,u),r.call(c+"_mul",y,A,h),r.call(c+"_sub",h,E,h),r.call(a,x,B),r.call(c+"_add",h,B,h),r.call(c+"_mul",v,w,p),r.call(c+"_sub",p,C,p),r.call(c+"_add",p,m,p))}(),function(){const d=e.addFunction(t+"_square");d.addParam("x","i32"),d.addParam("r","i32");const r=d.getCodeBuilder(),n=r.getLocal("x"),i=r.i32_add(r.getLocal("x"),r.i32_const(f)),b=r.i32_add(r.getLocal("x"),r.i32_const(2*f)),o=r.getLocal("r"),s=r.i32_add(r.getLocal("r"),r.i32_const(f)),l=r.i32_add(r.getLocal("r"),r.i32_const(2*f)),u=r.i32_const(e.alloc(f)),h=r.i32_const(e.alloc(f)),p=r.i32_const(e.alloc(f)),g=r.i32_const(e.alloc(f)),m=r.i32_const(e.alloc(f)),x=r.i32_const(e.alloc(f)),y=r.i32_const(e.alloc(f));d.addCode(r.call(c+"_square",n,u),r.call(c+"_mul",n,i,h),r.call(c+"_add",h,h,p),r.call(c+"_sub",n,i,g),r.call(c+"_add",g,b,g),r.call(c+"_square",g,g),r.call(c+"_mul",i,b,m),r.call(c+"_add",m,m,x),r.call(c+"_square",b,y),r.call(a,x,o),r.call(c+"_add",u,o,o),r.call(a,y,s),r.call(c+"_add",p,s,s),r.call(c+"_add",u,y,l),r.call(c+"_sub",x,l,l),r.call(c+"_add",g,l,l),r.call(c+"_add",p,l,l))}(),function(){const a=e.addFunction(t+"_add");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("y"),o=d.i32_add(d.getLocal("y"),d.i32_const(f)),s=d.i32_add(d.getLocal("y"),d.i32_const(2*f)),l=d.getLocal("r"),u=d.i32_add(d.getLocal("r"),d.i32_const(f)),h=d.i32_add(d.getLocal("r"),d.i32_const(2*f));a.addCode(d.call(c+"_add",r,b,l),d.call(c+"_add",n,o,u),d.call(c+"_add",i,s,h))}(),function(){const a=e.addFunction(t+"_sub");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("y"),o=d.i32_add(d.getLocal("y"),d.i32_const(f)),s=d.i32_add(d.getLocal("y"),d.i32_const(2*f)),l=d.getLocal("r"),u=d.i32_add(d.getLocal("r"),d.i32_const(f)),h=d.i32_add(d.getLocal("r"),d.i32_const(2*f));a.addCode(d.call(c+"_sub",r,b,l),d.call(c+"_sub",n,o,u),d.call(c+"_sub",i,s,h))}(),function(){const a=e.addFunction(t+"_neg");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("r"),o=d.i32_add(d.getLocal("r"),d.i32_const(f)),s=d.i32_add(d.getLocal("r"),d.i32_const(2*f));a.addCode(d.call(c+"_neg",r,b),d.call(c+"_neg",n,o),d.call(c+"_neg",i,s))}(),function(){const a=e.addFunction(t+"_sign");a.addParam("x","i32"),a.addLocal("s","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f));a.addCode(d.setLocal("s",d.call(c+"_sign",i)),d.if(d.getLocal("s"),d.ret(d.getLocal("s"))),d.setLocal("s",d.call(c+"_sign",n)),d.if(d.getLocal("s"),d.ret(d.getLocal("s"))),d.ret(d.call(c+"_sign",r)))}(),function(){const a=e.addFunction(t+"_toMontgomery");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("r"),o=d.i32_add(d.getLocal("r"),d.i32_const(f)),s=d.i32_add(d.getLocal("r"),d.i32_const(2*f));a.addCode(d.call(c+"_toMontgomery",r,b),d.call(c+"_toMontgomery",n,o),d.call(c+"_toMontgomery",i,s))}(),function(){const a=e.addFunction(t+"_fromMontgomery");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("r"),o=d.i32_add(d.getLocal("r"),d.i32_const(f)),s=d.i32_add(d.getLocal("r"),d.i32_const(2*f));a.addCode(d.call(c+"_fromMontgomery",r,b),d.call(c+"_fromMontgomery",n,o),d.call(c+"_fromMontgomery",i,s))}(),function(){const a=e.addFunction(t+"_eq");a.addParam("x","i32"),a.addParam("y","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("y"),o=d.i32_add(d.getLocal("y"),d.i32_const(f)),s=d.i32_add(d.getLocal("y"),d.i32_const(2*f));a.addCode(d.i32_and(d.i32_and(d.call(c+"_eq",r,b),d.call(c+"_eq",n,o)),d.call(c+"_eq",i,s)))}(),function(){const d=e.addFunction(t+"_inverse");d.addParam("x","i32"),d.addParam("r","i32");const r=d.getCodeBuilder(),n=r.getLocal("x"),i=r.i32_add(r.getLocal("x"),r.i32_const(f)),b=r.i32_add(r.getLocal("x"),r.i32_const(2*f)),o=r.getLocal("r"),s=r.i32_add(r.getLocal("r"),r.i32_const(f)),l=r.i32_add(r.getLocal("r"),r.i32_const(2*f)),u=r.i32_const(e.alloc(f)),h=r.i32_const(e.alloc(f)),p=r.i32_const(e.alloc(f)),g=r.i32_const(e.alloc(f)),m=r.i32_const(e.alloc(f)),x=r.i32_const(e.alloc(f)),y=r.i32_const(e.alloc(f)),A=r.i32_const(e.alloc(f)),v=r.i32_const(e.alloc(f)),w=r.i32_const(e.alloc(f)),_=r.i32_const(e.alloc(f));d.addCode(r.call(c+"_square",n,u),r.call(c+"_square",i,h),r.call(c+"_square",b,p),r.call(c+"_mul",n,i,g),r.call(c+"_mul",n,b,m),r.call(c+"_mul",i,b,x),r.call(a,x,y),r.call(c+"_sub",u,y,y),r.call(a,p,A),r.call(c+"_sub",A,g,A),r.call(c+"_sub",h,m,v),r.call(c+"_mul",b,A,w),r.call(c+"_mul",i,v,_),r.call(c+"_add",w,_,w),r.call(a,w,w),r.call(c+"_mul",n,y,_),r.call(c+"_add",_,w,w),r.call(c+"_inverse",w,w),r.call(c+"_mul",w,y,o),r.call(c+"_mul",w,A,s),r.call(c+"_mul",w,v,l))}(),function(){const a=e.addFunction(t+"_timesScalar");a.addParam("x","i32"),a.addParam("scalar","i32"),a.addParam("scalarLen","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("r"),o=d.i32_add(d.getLocal("r"),d.i32_const(f)),s=d.i32_add(d.getLocal("r"),d.i32_const(2*f));a.addCode(d.call(c+"_timesScalar",r,d.getLocal("scalar"),d.getLocal("scalarLen"),b),d.call(c+"_timesScalar",n,d.getLocal("scalar"),d.getLocal("scalarLen"),o),d.call(c+"_timesScalar",i,d.getLocal("scalar"),d.getLocal("scalarLen"),s))}(),function(){const a=e.addFunction(t+"_isNegative");a.addParam("x","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f));a.addCode(d.if(d.call(c+"_isZero",i),d.if(d.call(c+"_isZero",n),d.ret(d.call(c+"_isNegative",r)),d.ret(d.call(c+"_isNegative",n)))),d.ret(d.call(c+"_isNegative",i)))}(),e.exportFunction(t+"_isZero"),e.exportFunction(t+"_isOne"),e.exportFunction(t+"_zero"),e.exportFunction(t+"_one"),e.exportFunction(t+"_copy"),e.exportFunction(t+"_mul"),e.exportFunction(t+"_square"),e.exportFunction(t+"_add"),e.exportFunction(t+"_sub"),e.exportFunction(t+"_neg"),e.exportFunction(t+"_sign"),e.exportFunction(t+"_fromMontgomery"),e.exportFunction(t+"_toMontgomery"),e.exportFunction(t+"_eq"),e.exportFunction(t+"_inverse"),Ae(e,t),ye(e,t+"_exp",3*f,t+"_mul",t+"_square",t+"_copy",t+"_one"),e.exportFunction(t+"_exp"),e.exportFunction(t+"_timesScalar"),e.exportFunction(t+"_batchInverse"),e.exportFunction(t+"_isNegative"),t};const we=function(e,a,t,c,f,d,r,n){const i=e.addFunction(a);i.addParam("base","i32"),i.addParam("scalar","i32"),i.addParam("scalarLength","i32"),i.addParam("r","i32"),i.addLocal("old0","i32"),i.addLocal("nbits","i32"),i.addLocal("i","i32"),i.addLocal("last","i32"),i.addLocal("cur","i32"),i.addLocal("carry","i32"),i.addLocal("p","i32");const b=i.getCodeBuilder(),o=b.i32_const(e.alloc(t));function s(e){return b.i32_and(b.i32_shr_u(b.i32_load(b.i32_add(b.getLocal("scalar"),b.i32_and(b.i32_shr_u(e,b.i32_const(3)),b.i32_const(4294967292)))),b.i32_and(e,b.i32_const(31))),b.i32_const(1))}function l(e){return[...b.i32_store8(b.getLocal("p"),b.i32_const(e)),...b.setLocal("p",b.i32_add(b.getLocal("p"),b.i32_const(1)))]}i.addCode(b.if(b.i32_eqz(b.getLocal("scalarLength")),[...b.call(n,b.getLocal("r")),...b.ret([])]),b.setLocal("nbits",b.i32_shl(b.getLocal("scalarLength"),b.i32_const(3))),b.setLocal("old0",b.i32_load(b.i32_const(0))),b.setLocal("p",b.getLocal("old0")),b.i32_store(b.i32_const(0),b.i32_and(b.i32_add(b.i32_add(b.getLocal("old0"),b.i32_const(32)),b.getLocal("nbits")),b.i32_const(4294967288))),b.setLocal("i",b.i32_const(1)),b.setLocal("last",s(b.i32_const(0))),b.setLocal("carry",b.i32_const(0)),b.block(b.loop(b.br_if(1,b.i32_eq(b.getLocal("i"),b.getLocal("nbits"))),b.setLocal("cur",s(b.getLocal("i"))),b.if(b.getLocal("last"),b.if(b.getLocal("cur"),b.if(b.getLocal("carry"),[...b.setLocal("last",b.i32_const(0)),...b.setLocal("carry",b.i32_const(1)),...l(1)],[...b.setLocal("last",b.i32_const(0)),...b.setLocal("carry",b.i32_const(1)),...l(255)]),b.if(b.getLocal("carry"),[...b.setLocal("last",b.i32_const(0)),...b.setLocal("carry",b.i32_const(1)),...l(255)],[...b.setLocal("last",b.i32_const(0)),...b.setLocal("carry",b.i32_const(0)),...l(1)])),b.if(b.getLocal("cur"),b.if(b.getLocal("carry"),[...b.setLocal("last",b.i32_const(0)),...b.setLocal("carry",b.i32_const(1)),...l(0)],[...b.setLocal("last",b.i32_const(1)),...b.setLocal("carry",b.i32_const(0)),...l(0)]),b.if(b.getLocal("carry"),[...b.setLocal("last",b.i32_const(1)),...b.setLocal("carry",b.i32_const(0)),...l(0)],[...b.setLocal("last",b.i32_const(0)),...b.setLocal("carry",b.i32_const(0)),...l(0)]))),b.setLocal("i",b.i32_add(b.getLocal("i"),b.i32_const(1))),b.br(0))),b.if(b.getLocal("last"),b.if(b.getLocal("carry"),[...l(255),...l(0),...l(1)],[...l(1)]),b.if(b.getLocal("carry"),[...l(0),...l(1)])),b.setLocal("p",b.i32_sub(b.getLocal("p"),b.i32_const(1))),b.call(r,b.getLocal("base"),o),b.call(n,b.getLocal("r")),b.block(b.loop(b.call(f,b.getLocal("r"),b.getLocal("r")),b.setLocal("cur",b.i32_load8_u(b.getLocal("p"))),b.if(b.getLocal("cur"),b.if(b.i32_eq(b.getLocal("cur"),b.i32_const(1)),b.call(c,b.getLocal("r"),o,b.getLocal("r")),b.call(d,b.getLocal("r"),o,b.getLocal("r")))),b.br_if(1,b.i32_eq(b.getLocal("old0"),b.getLocal("p"))),b.setLocal("p",b.i32_sub(b.getLocal("p"),b.i32_const(1))),b.br(0))),b.i32_store(b.i32_const(0),b.getLocal("old0")))},_e=Q,Ie=function(e,a,t,c,f){const d=8*e.modules[a].n64;!function(){const a=e.addFunction(t+"_getChunk");a.addParam("pScalar","i32"),a.addParam("scalarSize","i32"),a.addParam("startBit","i32"),a.addParam("chunkSize","i32"),a.addLocal("bitsToEnd","i32"),a.addLocal("mask","i32"),a.setReturnType("i32");const c=a.getCodeBuilder();a.addCode(c.setLocal("bitsToEnd",c.i32_sub(c.i32_mul(c.getLocal("scalarSize"),c.i32_const(8)),c.getLocal("startBit"))),c.if(c.i32_gt_s(c.getLocal("chunkSize"),c.getLocal("bitsToEnd")),c.setLocal("mask",c.i32_sub(c.i32_shl(c.i32_const(1),c.getLocal("bitsToEnd")),c.i32_const(1))),c.setLocal("mask",c.i32_sub(c.i32_shl(c.i32_const(1),c.getLocal("chunkSize")),c.i32_const(1)))),c.i32_and(c.i32_shr_u(c.i32_load(c.i32_add(c.getLocal("pScalar"),c.i32_shr_u(c.getLocal("startBit"),c.i32_const(3))),0,0),c.i32_and(c.getLocal("startBit"),c.i32_const(7))),c.getLocal("mask")))}(),function(){const c=e.addFunction(t+"_reduceTable");c.addParam("pTable","i32"),c.addParam("p","i32"),c.addLocal("half","i32"),c.addLocal("it1","i32"),c.addLocal("it2","i32"),c.addLocal("pAcc","i32");const f=c.getCodeBuilder();c.addCode(f.if(f.i32_eq(f.getLocal("p"),f.i32_const(1)),f.ret([])),f.setLocal("half",f.i32_shl(f.i32_const(1),f.i32_sub(f.getLocal("p"),f.i32_const(1)))),f.setLocal("it1",f.getLocal("pTable")),f.setLocal("it2",f.i32_add(f.getLocal("pTable"),f.i32_mul(f.getLocal("half"),f.i32_const(d)))),f.setLocal("pAcc",f.i32_sub(f.getLocal("it2"),f.i32_const(d))),f.block(f.loop(f.br_if(1,f.i32_eq(f.getLocal("it1"),f.getLocal("pAcc"))),f.call(a+"_add",f.getLocal("it1"),f.getLocal("it2"),f.getLocal("it1")),f.call(a+"_add",f.getLocal("pAcc"),f.getLocal("it2"),f.getLocal("pAcc")),f.setLocal("it1",f.i32_add(f.getLocal("it1"),f.i32_const(d))),f.setLocal("it2",f.i32_add(f.getLocal("it2"),f.i32_const(d))),f.br(0))),f.call(t+"_reduceTable",f.getLocal("pTable"),f.i32_sub(f.getLocal("p"),f.i32_const(1))),f.setLocal("p",f.i32_sub(f.getLocal("p"),f.i32_const(1))),f.block(f.loop(f.br_if(1,f.i32_eqz(f.getLocal("p"))),f.call(a+"_double",f.getLocal("pAcc"),f.getLocal("pAcc")),f.setLocal("p",f.i32_sub(f.getLocal("p"),f.i32_const(1))),f.br(0))),f.call(a+"_add",f.getLocal("pTable"),f.getLocal("pAcc"),f.getLocal("pTable")))}(),function(){const r=e.addFunction(t+"_chunk");r.addParam("pBases","i32"),r.addParam("pScalars","i32"),r.addParam("scalarSize","i32"),r.addParam("n","i32"),r.addParam("startBit","i32"),r.addParam("chunkSize","i32"),r.addParam("pr","i32"),r.addLocal("nChunks","i32"),r.addLocal("itScalar","i32"),r.addLocal("endScalar","i32"),r.addLocal("itBase","i32"),r.addLocal("i","i32"),r.addLocal("j","i32"),r.addLocal("nTable","i32"),r.addLocal("pTable","i32"),r.addLocal("idx","i32"),r.addLocal("pIdxTable","i32");const n=r.getCodeBuilder();r.addCode(n.if(n.i32_eqz(n.getLocal("n")),[...n.call(a+"_zero",n.getLocal("pr")),...n.ret([])]),n.setLocal("nTable",n.i32_shl(n.i32_const(1),n.getLocal("chunkSize"))),n.setLocal("pTable",n.i32_load(n.i32_const(0))),n.i32_store(n.i32_const(0),n.i32_add(n.getLocal("pTable"),n.i32_mul(n.getLocal("nTable"),n.i32_const(d)))),n.setLocal("j",n.i32_const(0)),n.block(n.loop(n.br_if(1,n.i32_eq(n.getLocal("j"),n.getLocal("nTable"))),n.call(a+"_zero",n.i32_add(n.getLocal("pTable"),n.i32_mul(n.getLocal("j"),n.i32_const(d)))),n.setLocal("j",n.i32_add(n.getLocal("j"),n.i32_const(1))),n.br(0))),n.setLocal("itBase",n.getLocal("pBases")),n.setLocal("itScalar",n.getLocal("pScalars")),n.setLocal("endScalar",n.i32_add(n.getLocal("pScalars"),n.i32_mul(n.getLocal("n"),n.getLocal("scalarSize")))),n.block(n.loop(n.br_if(1,n.i32_eq(n.getLocal("itScalar"),n.getLocal("endScalar"))),n.setLocal("idx",n.call(t+"_getChunk",n.getLocal("itScalar"),n.getLocal("scalarSize"),n.getLocal("startBit"),n.getLocal("chunkSize"))),n.if(n.getLocal("idx"),[...n.setLocal("pIdxTable",n.i32_add(n.getLocal("pTable"),n.i32_mul(n.i32_sub(n.getLocal("idx"),n.i32_const(1)),n.i32_const(d)))),...n.call(c,n.getLocal("pIdxTable"),n.getLocal("itBase"),n.getLocal("pIdxTable"))]),n.setLocal("itScalar",n.i32_add(n.getLocal("itScalar"),n.getLocal("scalarSize"))),n.setLocal("itBase",n.i32_add(n.getLocal("itBase"),n.i32_const(f))),n.br(0))),n.call(t+"_reduceTable",n.getLocal("pTable"),n.getLocal("chunkSize")),n.call(a+"_copy",n.getLocal("pTable"),n.getLocal("pr")),n.i32_store(n.i32_const(0),n.getLocal("pTable")))}(),function(){const c=e.addFunction(t);c.addParam("pBases","i32"),c.addParam("pScalars","i32"),c.addParam("scalarSize","i32"),c.addParam("n","i32"),c.addParam("pr","i32"),c.addLocal("chunkSize","i32"),c.addLocal("nChunks","i32"),c.addLocal("itScalar","i32"),c.addLocal("endScalar","i32"),c.addLocal("itBase","i32"),c.addLocal("itBit","i32"),c.addLocal("i","i32"),c.addLocal("j","i32"),c.addLocal("nTable","i32"),c.addLocal("pTable","i32"),c.addLocal("idx","i32"),c.addLocal("pIdxTable","i32");const f=c.getCodeBuilder(),r=f.i32_const(e.alloc(d)),n=e.alloc([17,17,17,17,17,17,17,17,17,17,16,16,15,14,13,13,12,11,10,9,8,7,7,6,5,4,3,2,1,1,1,1]);c.addCode(f.call(a+"_zero",f.getLocal("pr")),f.if(f.i32_eqz(f.getLocal("n")),f.ret([])),f.setLocal("chunkSize",f.i32_load8_u(f.i32_clz(f.getLocal("n")),n)),f.setLocal("nChunks",f.i32_add(f.i32_div_u(f.i32_sub(f.i32_shl(f.getLocal("scalarSize"),f.i32_const(3)),f.i32_const(1)),f.getLocal("chunkSize")),f.i32_const(1))),f.setLocal("itBit",f.i32_mul(f.i32_sub(f.getLocal("nChunks"),f.i32_const(1)),f.getLocal("chunkSize"))),f.block(f.loop(f.br_if(1,f.i32_lt_s(f.getLocal("itBit"),f.i32_const(0))),f.if(f.i32_eqz(f.call(a+"_isZero",f.getLocal("pr"))),[...f.setLocal("j",f.i32_const(0)),...f.block(f.loop(f.br_if(1,f.i32_eq(f.getLocal("j"),f.getLocal("chunkSize"))),f.call(a+"_double",f.getLocal("pr"),f.getLocal("pr")),f.setLocal("j",f.i32_add(f.getLocal("j"),f.i32_const(1))),f.br(0)))]),f.call(t+"_chunk",f.getLocal("pBases"),f.getLocal("pScalars"),f.getLocal("scalarSize"),f.getLocal("n"),f.getLocal("itBit"),f.getLocal("chunkSize"),r),f.call(a+"_add",f.getLocal("pr"),r,f.getLocal("pr")),f.setLocal("itBit",f.i32_sub(f.getLocal("itBit"),f.getLocal("chunkSize"))),f.br(0))))}(),e.exportFunction(t),e.exportFunction(t+"_chunk")};var Ee=function(e,a,t,c){const f=e.modules[t].n64,d=8*f;return e.modules[a]||(e.modules[a]={n64:3*f},function(){const c=e.addFunction(a+"_isZeroAffine");c.addParam("p1","i32"),c.setReturnType("i32");const f=c.getCodeBuilder();c.addCode(f.i32_and(f.call(t+"_isZero",f.getLocal("p1")),f.call(t+"_isZero",f.i32_add(f.getLocal("p1"),f.i32_const(d)))))}(),function(){const c=e.addFunction(a+"_isZero");c.addParam("p1","i32"),c.setReturnType("i32");const f=c.getCodeBuilder();c.addCode(f.call(t+"_isZero",f.i32_add(f.getLocal("p1"),f.i32_const(2*d))))}(),function(){const c=e.addFunction(a+"_zeroAffine");c.addParam("pr","i32");const f=c.getCodeBuilder();c.addCode(f.call(t+"_zero",f.getLocal("pr"))),c.addCode(f.call(t+"_zero",f.i32_add(f.getLocal("pr"),f.i32_const(d))))}(),function(){const c=e.addFunction(a+"_zero");c.addParam("pr","i32");const f=c.getCodeBuilder();c.addCode(f.call(t+"_zero",f.getLocal("pr"))),c.addCode(f.call(t+"_one",f.i32_add(f.getLocal("pr"),f.i32_const(d)))),c.addCode(f.call(t+"_zero",f.i32_add(f.getLocal("pr"),f.i32_const(2*d))))}(),function(){const t=e.addFunction(a+"_copyAffine");t.addParam("ps","i32"),t.addParam("pd","i32");const c=t.getCodeBuilder();for(let e=0;e<2*f;e++)t.addCode(c.i64_store(c.getLocal("pd"),8*e,c.i64_load(c.getLocal("ps"),8*e)))}(),function(){const t=e.addFunction(a+"_copy");t.addParam("ps","i32"),t.addParam("pd","i32");const c=t.getCodeBuilder();for(let e=0;e<3*f;e++)t.addCode(c.i64_store(c.getLocal("pd"),8*e,c.i64_load(c.getLocal("ps"),8*e)))}(),function(){const c=e.addFunction(a+"_toJacobian");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d)),i=f.getLocal("pr"),b=f.i32_add(f.getLocal("pr"),f.i32_const(d)),o=f.i32_add(f.getLocal("pr"),f.i32_const(2*d));c.addCode(f.if(f.call(a+"_isZeroAffine",f.getLocal("p1")),f.call(a+"_zero",f.getLocal("pr")),[...f.call(t+"_one",o),...f.call(t+"_copy",n,b),...f.call(t+"_copy",r,i)]))}(),function(){const c=e.addFunction(a+"_eqAffine");c.addParam("p1","i32"),c.addParam("p2","i32"),c.setReturnType("i32"),c.addLocal("z1","i32");const f=c.getCodeBuilder();c.addCode(f.ret(f.i32_and(f.call(t+"_eq",f.getLocal("p1"),f.getLocal("p2")),f.call(t+"_eq",f.i32_add(f.getLocal("p1"),f.i32_const(d)),f.i32_add(f.getLocal("p2"),f.i32_const(d))))))}(),function(){const c=e.addFunction(a+"_eqMixed");c.addParam("p1","i32"),c.addParam("p2","i32"),c.setReturnType("i32"),c.addLocal("z1","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d));c.addCode(f.setLocal("z1",f.i32_add(f.getLocal("p1"),f.i32_const(2*d))));const i=f.getLocal("z1"),b=f.getLocal("p2"),o=f.i32_add(f.getLocal("p2"),f.i32_const(d)),s=f.i32_const(e.alloc(d)),l=f.i32_const(e.alloc(d)),u=f.i32_const(e.alloc(d)),h=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZero",f.getLocal("p1")),f.ret(f.call(a+"_isZeroAffine",f.getLocal("p2")))),f.if(f.call(a+"_isZeroAffine",f.getLocal("p2")),f.ret(f.i32_const(0))),f.if(f.call(t+"_isOne",i),f.ret(f.call(a+"_eqAffine",f.getLocal("p1"),f.getLocal("p2")))),f.call(t+"_square",i,s),f.call(t+"_mul",b,s,l),f.call(t+"_mul",i,s,u),f.call(t+"_mul",o,u,h),f.if(f.call(t+"_eq",r,l),f.if(f.call(t+"_eq",n,h),f.ret(f.i32_const(1)))),f.ret(f.i32_const(0)))}(),function(){const c=e.addFunction(a+"_eq");c.addParam("p1","i32"),c.addParam("p2","i32"),c.setReturnType("i32"),c.addLocal("z1","i32"),c.addLocal("z2","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d));c.addCode(f.setLocal("z1",f.i32_add(f.getLocal("p1"),f.i32_const(2*d))));const i=f.getLocal("z1"),b=f.getLocal("p2"),o=f.i32_add(f.getLocal("p2"),f.i32_const(d));c.addCode(f.setLocal("z2",f.i32_add(f.getLocal("p2"),f.i32_const(2*d))));const s=f.getLocal("z2"),l=f.i32_const(e.alloc(d)),u=f.i32_const(e.alloc(d)),h=f.i32_const(e.alloc(d)),p=f.i32_const(e.alloc(d)),g=f.i32_const(e.alloc(d)),m=f.i32_const(e.alloc(d)),x=f.i32_const(e.alloc(d)),y=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZero",f.getLocal("p1")),f.ret(f.call(a+"_isZero",f.getLocal("p2")))),f.if(f.call(a+"_isZero",f.getLocal("p2")),f.ret(f.i32_const(0))),f.if(f.call(t+"_isOne",i),f.ret(f.call(a+"_eqMixed",f.getLocal("p2"),f.getLocal("p1")))),f.if(f.call(t+"_isOne",s),f.ret(f.call(a+"_eqMixed",f.getLocal("p1"),f.getLocal("p2")))),f.call(t+"_square",i,l),f.call(t+"_square",s,u),f.call(t+"_mul",r,u,h),f.call(t+"_mul",b,l,p),f.call(t+"_mul",i,l,g),f.call(t+"_mul",s,u,m),f.call(t+"_mul",n,m,x),f.call(t+"_mul",o,g,y),f.if(f.call(t+"_eq",h,p),f.if(f.call(t+"_eq",x,y),f.ret(f.i32_const(1)))),f.ret(f.i32_const(0)))}(),function(){const c=e.addFunction(a+"_doubleAffine");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d)),i=f.getLocal("pr"),b=f.i32_add(f.getLocal("pr"),f.i32_const(d)),o=f.i32_add(f.getLocal("pr"),f.i32_const(2*d)),s=f.i32_const(e.alloc(d)),l=f.i32_const(e.alloc(d)),u=f.i32_const(e.alloc(d)),h=f.i32_const(e.alloc(d)),p=f.i32_const(e.alloc(d)),g=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZeroAffine",f.getLocal("p1")),[...f.call(a+"_toJacobian",f.getLocal("p1"),f.getLocal("pr")),...f.ret([])]),f.call(t+"_square",r,s),f.call(t+"_square",n,l),f.call(t+"_square",l,u),f.call(t+"_add",r,l,h),f.call(t+"_square",h,h),f.call(t+"_sub",h,s,h),f.call(t+"_sub",h,u,h),f.call(t+"_add",h,h,h),f.call(t+"_add",s,s,p),f.call(t+"_add",p,s,p),f.call(t+"_add",n,n,o),f.call(t+"_square",p,i),f.call(t+"_sub",i,h,i),f.call(t+"_sub",i,h,i),f.call(t+"_add",u,u,g),f.call(t+"_add",g,g,g),f.call(t+"_add",g,g,g),f.call(t+"_sub",h,i,b),f.call(t+"_mul",b,p,b),f.call(t+"_sub",b,g,b))}(),function(){const c=e.addFunction(a+"_double");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d)),i=f.i32_add(f.getLocal("p1"),f.i32_const(2*d)),b=f.getLocal("pr"),o=f.i32_add(f.getLocal("pr"),f.i32_const(d)),s=f.i32_add(f.getLocal("pr"),f.i32_const(2*d)),l=f.i32_const(e.alloc(d)),u=f.i32_const(e.alloc(d)),h=f.i32_const(e.alloc(d)),p=f.i32_const(e.alloc(d)),g=f.i32_const(e.alloc(d)),m=f.i32_const(e.alloc(d)),x=f.i32_const(e.alloc(d)),y=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZero",f.getLocal("p1")),[...f.call(a+"_copy",f.getLocal("p1"),f.getLocal("pr")),...f.ret([])]),f.if(f.call(t+"_isOne",i),[...f.ret(f.call(a+"_doubleAffine",f.getLocal("p1"),f.getLocal("pr"))),...f.ret([])]),f.call(t+"_square",r,l),f.call(t+"_square",n,u),f.call(t+"_square",u,h),f.call(t+"_add",r,u,p),f.call(t+"_square",p,p),f.call(t+"_sub",p,l,p),f.call(t+"_sub",p,h,p),f.call(t+"_add",p,p,p),f.call(t+"_add",l,l,g),f.call(t+"_add",g,l,g),f.call(t+"_square",g,m),f.call(t+"_mul",n,i,x),f.call(t+"_add",p,p,b),f.call(t+"_sub",m,b,b),f.call(t+"_add",h,h,y),f.call(t+"_add",y,y,y),f.call(t+"_add",y,y,y),f.call(t+"_sub",p,b,o),f.call(t+"_mul",o,g,o),f.call(t+"_sub",o,y,o),f.call(t+"_add",x,x,s))}(),function(){const c=e.addFunction(a+"_addAffine");c.addParam("p1","i32"),c.addParam("p2","i32"),c.addParam("pr","i32"),c.addLocal("z1","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d));c.addCode(f.setLocal("z1",f.i32_add(f.getLocal("p1"),f.i32_const(2*d))));const i=f.getLocal("p2"),b=f.i32_add(f.getLocal("p2"),f.i32_const(d)),o=f.getLocal("pr"),s=f.i32_add(f.getLocal("pr"),f.i32_const(d)),l=f.i32_add(f.getLocal("pr"),f.i32_const(2*d)),u=f.i32_const(e.alloc(d)),h=f.i32_const(e.alloc(d)),p=f.i32_const(e.alloc(d)),g=f.i32_const(e.alloc(d)),m=f.i32_const(e.alloc(d)),x=f.i32_const(e.alloc(d)),y=f.i32_const(e.alloc(d)),A=f.i32_const(e.alloc(d)),v=f.i32_const(e.alloc(d)),w=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZeroAffine",f.getLocal("p1")),[...f.call(a+"_copyAffine",f.getLocal("p2"),f.getLocal("pr")),...f.call(t+"_one",f.i32_add(f.getLocal("pr"),f.i32_const(2*d))),...f.ret([])]),f.if(f.call(a+"_isZeroAffine",f.getLocal("p2")),[...f.call(a+"_copyAffine",f.getLocal("p1"),f.getLocal("pr")),...f.call(t+"_one",f.i32_add(f.getLocal("pr"),f.i32_const(2*d))),...f.ret([])]),f.if(f.call(t+"_eq",r,i),f.if(f.call(t+"_eq",n,b),[...f.call(a+"_doubleAffine",f.getLocal("p2"),f.getLocal("pr")),...f.ret([])])),f.call(t+"_sub",i,r,u),f.call(t+"_sub",b,n,p),f.call(t+"_square",u,h),f.call(t+"_add",h,h,g),f.call(t+"_add",g,g,g),f.call(t+"_mul",u,g,m),f.call(t+"_add",p,p,x),f.call(t+"_mul",r,g,A),f.call(t+"_square",x,y),f.call(t+"_add",A,A,v),f.call(t+"_sub",y,m,o),f.call(t+"_sub",o,v,o),f.call(t+"_mul",n,m,w),f.call(t+"_add",w,w,w),f.call(t+"_sub",A,o,s),f.call(t+"_mul",s,x,s),f.call(t+"_sub",s,w,s),f.call(t+"_add",u,u,l))}(),function(){const c=e.addFunction(a+"_addMixed");c.addParam("p1","i32"),c.addParam("p2","i32"),c.addParam("pr","i32"),c.addLocal("z1","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d));c.addCode(f.setLocal("z1",f.i32_add(f.getLocal("p1"),f.i32_const(2*d))));const i=f.getLocal("z1"),b=f.getLocal("p2"),o=f.i32_add(f.getLocal("p2"),f.i32_const(d)),s=f.getLocal("pr"),l=f.i32_add(f.getLocal("pr"),f.i32_const(d)),u=f.i32_add(f.getLocal("pr"),f.i32_const(2*d)),h=f.i32_const(e.alloc(d)),p=f.i32_const(e.alloc(d)),g=f.i32_const(e.alloc(d)),m=f.i32_const(e.alloc(d)),x=f.i32_const(e.alloc(d)),y=f.i32_const(e.alloc(d)),A=f.i32_const(e.alloc(d)),v=f.i32_const(e.alloc(d)),w=f.i32_const(e.alloc(d)),_=f.i32_const(e.alloc(d)),I=f.i32_const(e.alloc(d)),E=f.i32_const(e.alloc(d)),C=f.i32_const(e.alloc(d)),M=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZero",f.getLocal("p1")),[...f.call(a+"_copyAffine",f.getLocal("p2"),f.getLocal("pr")),...f.call(t+"_one",f.i32_add(f.getLocal("pr"),f.i32_const(2*d))),...f.ret([])]),f.if(f.call(a+"_isZeroAffine",f.getLocal("p2")),[...f.call(a+"_copy",f.getLocal("p1"),f.getLocal("pr")),...f.ret([])]),f.if(f.call(t+"_isOne",i),[...f.call(a+"_addAffine",r,b,s),...f.ret([])]),f.call(t+"_square",i,h),f.call(t+"_mul",b,h,p),f.call(t+"_mul",i,h,g),f.call(t+"_mul",o,g,m),f.if(f.call(t+"_eq",r,p),f.if(f.call(t+"_eq",n,m),[...f.call(a+"_doubleAffine",f.getLocal("p2"),f.getLocal("pr")),...f.ret([])])),f.call(t+"_sub",p,r,x),f.call(t+"_sub",m,n,A),f.call(t+"_square",x,y),f.call(t+"_add",y,y,v),f.call(t+"_add",v,v,v),f.call(t+"_mul",x,v,w),f.call(t+"_add",A,A,_),f.call(t+"_mul",r,v,E),f.call(t+"_square",_,I),f.call(t+"_add",E,E,C),f.call(t+"_sub",I,w,s),f.call(t+"_sub",s,C,s),f.call(t+"_mul",n,w,M),f.call(t+"_add",M,M,M),f.call(t+"_sub",E,s,l),f.call(t+"_mul",l,_,l),f.call(t+"_sub",l,M,l),f.call(t+"_add",i,x,u),f.call(t+"_square",u,u),f.call(t+"_sub",u,h,u),f.call(t+"_sub",u,y,u))}(),function(){const c=e.addFunction(a+"_add");c.addParam("p1","i32"),c.addParam("p2","i32"),c.addParam("pr","i32"),c.addLocal("z1","i32"),c.addLocal("z2","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d));c.addCode(f.setLocal("z1",f.i32_add(f.getLocal("p1"),f.i32_const(2*d))));const i=f.getLocal("z1"),b=f.getLocal("p2"),o=f.i32_add(f.getLocal("p2"),f.i32_const(d));c.addCode(f.setLocal("z2",f.i32_add(f.getLocal("p2"),f.i32_const(2*d))));const s=f.getLocal("z2"),l=f.getLocal("pr"),u=f.i32_add(f.getLocal("pr"),f.i32_const(d)),h=f.i32_add(f.getLocal("pr"),f.i32_const(2*d)),p=f.i32_const(e.alloc(d)),g=f.i32_const(e.alloc(d)),m=f.i32_const(e.alloc(d)),x=f.i32_const(e.alloc(d)),y=f.i32_const(e.alloc(d)),A=f.i32_const(e.alloc(d)),v=f.i32_const(e.alloc(d)),w=f.i32_const(e.alloc(d)),_=f.i32_const(e.alloc(d)),I=f.i32_const(e.alloc(d)),E=f.i32_const(e.alloc(d)),C=f.i32_const(e.alloc(d)),M=f.i32_const(e.alloc(d)),B=f.i32_const(e.alloc(d)),k=f.i32_const(e.alloc(d)),L=f.i32_const(e.alloc(d)),S=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZero",f.getLocal("p1")),[...f.call(a+"_copy",f.getLocal("p2"),f.getLocal("pr")),...f.ret([])]),f.if(f.call(a+"_isZero",f.getLocal("p2")),[...f.call(a+"_copy",f.getLocal("p1"),f.getLocal("pr")),...f.ret([])]),f.if(f.call(t+"_isOne",i),[...f.call(a+"_addMixed",b,r,l),...f.ret([])]),f.if(f.call(t+"_isOne",s),[...f.call(a+"_addMixed",r,b,l),...f.ret([])]),f.call(t+"_square",i,p),f.call(t+"_square",s,g),f.call(t+"_mul",r,g,m),f.call(t+"_mul",b,p,x),f.call(t+"_mul",i,p,y),f.call(t+"_mul",s,g,A),f.call(t+"_mul",n,A,v),f.call(t+"_mul",o,y,w),f.if(f.call(t+"_eq",m,x),f.if(f.call(t+"_eq",v,w),[...f.call(a+"_double",f.getLocal("p1"),f.getLocal("pr")),...f.ret([])])),f.call(t+"_sub",x,m,_),f.call(t+"_sub",w,v,I),f.call(t+"_add",_,_,E),f.call(t+"_square",E,E),f.call(t+"_mul",_,E,C),f.call(t+"_add",I,I,M),f.call(t+"_mul",m,E,k),f.call(t+"_square",M,B),f.call(t+"_add",k,k,L),f.call(t+"_sub",B,C,l),f.call(t+"_sub",l,L,l),f.call(t+"_mul",v,C,S),f.call(t+"_add",S,S,S),f.call(t+"_sub",k,l,u),f.call(t+"_mul",u,M,u),f.call(t+"_sub",u,S,u),f.call(t+"_add",i,s,h),f.call(t+"_square",h,h),f.call(t+"_sub",h,p,h),f.call(t+"_sub",h,g,h),f.call(t+"_mul",h,_,h))}(),function(){const c=e.addFunction(a+"_negAffine");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d)),i=f.getLocal("pr"),b=f.i32_add(f.getLocal("pr"),f.i32_const(d));c.addCode(f.call(t+"_copy",r,i),f.call(t+"_neg",n,b))}(),function(){const c=e.addFunction(a+"_neg");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d)),i=f.i32_add(f.getLocal("p1"),f.i32_const(2*d)),b=f.getLocal("pr"),o=f.i32_add(f.getLocal("pr"),f.i32_const(d)),s=f.i32_add(f.getLocal("pr"),f.i32_const(2*d));c.addCode(f.call(t+"_copy",r,b),f.call(t+"_neg",n,o),f.call(t+"_copy",i,s))}(),function(){const t=e.addFunction(a+"_subAffine");t.addParam("p1","i32"),t.addParam("p2","i32"),t.addParam("pr","i32");const c=t.getCodeBuilder(),f=c.i32_const(e.alloc(3*d));t.addCode(c.call(a+"_negAffine",c.getLocal("p2"),f),c.call(a+"_addAffine",c.getLocal("p1"),f,c.getLocal("pr")))}(),function(){const t=e.addFunction(a+"_subMixed");t.addParam("p1","i32"),t.addParam("p2","i32"),t.addParam("pr","i32");const c=t.getCodeBuilder(),f=c.i32_const(e.alloc(3*d));t.addCode(c.call(a+"_negAffine",c.getLocal("p2"),f),c.call(a+"_addMixed",c.getLocal("p1"),f,c.getLocal("pr")))}(),function(){const t=e.addFunction(a+"_sub");t.addParam("p1","i32"),t.addParam("p2","i32"),t.addParam("pr","i32");const c=t.getCodeBuilder(),f=c.i32_const(e.alloc(3*d));t.addCode(c.call(a+"_neg",c.getLocal("p2"),f),c.call(a+"_add",c.getLocal("p1"),f,c.getLocal("pr")))}(),function(){const c=e.addFunction(a+"_fromMontgomeryAffine");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder();c.addCode(f.call(t+"_fromMontgomery",f.getLocal("p1"),f.getLocal("pr")));for(let e=1;e<2;e++)c.addCode(f.call(t+"_fromMontgomery",f.i32_add(f.getLocal("p1"),f.i32_const(e*d)),f.i32_add(f.getLocal("pr"),f.i32_const(e*d))))}(),function(){const c=e.addFunction(a+"_fromMontgomery");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder();c.addCode(f.call(t+"_fromMontgomery",f.getLocal("p1"),f.getLocal("pr")));for(let e=1;e<3;e++)c.addCode(f.call(t+"_fromMontgomery",f.i32_add(f.getLocal("p1"),f.i32_const(e*d)),f.i32_add(f.getLocal("pr"),f.i32_const(e*d))))}(),function(){const c=e.addFunction(a+"_toMontgomeryAffine");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder();c.addCode(f.call(t+"_toMontgomery",f.getLocal("p1"),f.getLocal("pr")));for(let e=1;e<2;e++)c.addCode(f.call(t+"_toMontgomery",f.i32_add(f.getLocal("p1"),f.i32_const(e*d)),f.i32_add(f.getLocal("pr"),f.i32_const(e*d))))}(),function(){const c=e.addFunction(a+"_toMontgomery");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder();c.addCode(f.call(t+"_toMontgomery",f.getLocal("p1"),f.getLocal("pr")));for(let e=1;e<3;e++)c.addCode(f.call(t+"_toMontgomery",f.i32_add(f.getLocal("p1"),f.i32_const(e*d)),f.i32_add(f.getLocal("pr"),f.i32_const(e*d))))}(),function(){const c=e.addFunction(a+"_toAffine");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d)),i=f.i32_add(f.getLocal("p1"),f.i32_const(2*d)),b=f.getLocal("pr"),o=f.i32_add(f.getLocal("pr"),f.i32_const(d)),s=f.i32_const(e.alloc(d)),l=f.i32_const(e.alloc(d)),u=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZero",f.getLocal("p1")),[...f.call(t+"_zero",b),...f.call(t+"_zero",o)],[...f.call(t+"_inverse",i,s),...f.call(t+"_square",s,l),...f.call(t+"_mul",s,l,u),...f.call(t+"_mul",r,l,b),...f.call(t+"_mul",n,u,o)]))}(),function(){const f=e.addFunction(a+"_inCurveAffine");f.addParam("pIn","i32"),f.setReturnType("i32");const r=f.getCodeBuilder(),n=r.getLocal("pIn"),i=r.i32_add(r.getLocal("pIn"),r.i32_const(d)),b=r.i32_const(e.alloc(d)),o=r.i32_const(e.alloc(d));f.addCode(r.call(t+"_square",i,b),r.call(t+"_square",n,o),r.call(t+"_mul",n,o,o),r.call(t+"_add",o,r.i32_const(c),o),r.ret(r.call(t+"_eq",b,o)))}(),function(){const t=e.addFunction(a+"_inCurve");t.addParam("pIn","i32"),t.setReturnType("i32");const c=t.getCodeBuilder(),f=c.i32_const(e.alloc(2*d));t.addCode(c.call(a+"_toAffine",c.getLocal("pIn"),f),c.ret(c.call(a+"_inCurveAffine",f)))}(),function(){const c=e.addFunction(a+"_batchToAffine");c.addParam("pIn","i32"),c.addParam("n","i32"),c.addParam("pOut","i32"),c.addLocal("pAux","i32"),c.addLocal("itIn","i32"),c.addLocal("itAux","i32"),c.addLocal("itOut","i32"),c.addLocal("i","i32");const f=c.getCodeBuilder(),r=f.i32_const(e.alloc(d));c.addCode(f.setLocal("pAux",f.i32_load(f.i32_const(0))),f.i32_store(f.i32_const(0),f.i32_add(f.getLocal("pAux"),f.i32_mul(f.getLocal("n"),f.i32_const(d)))),f.call(t+"_batchInverse",f.i32_add(f.getLocal("pIn"),f.i32_const(2*d)),f.i32_const(3*d),f.getLocal("n"),f.getLocal("pAux"),f.i32_const(d)),f.setLocal("itIn",f.getLocal("pIn")),f.setLocal("itAux",f.getLocal("pAux")),f.setLocal("itOut",f.getLocal("pOut")),f.setLocal("i",f.i32_const(0)),f.block(f.loop(f.br_if(1,f.i32_eq(f.getLocal("i"),f.getLocal("n"))),f.if(f.call(t+"_isZero",f.getLocal("itAux")),[...f.call(t+"_zero",f.getLocal("itOut")),...f.call(t+"_zero",f.i32_add(f.getLocal("itOut"),f.i32_const(d)))],[...f.call(t+"_mul",f.getLocal("itAux"),f.i32_add(f.getLocal("itIn"),f.i32_const(d)),r),...f.call(t+"_square",f.getLocal("itAux"),f.getLocal("itAux")),...f.call(t+"_mul",f.getLocal("itAux"),f.getLocal("itIn"),f.getLocal("itOut")),...f.call(t+"_mul",f.getLocal("itAux"),r,f.i32_add(f.getLocal("itOut"),f.i32_const(d)))]),f.setLocal("itIn",f.i32_add(f.getLocal("itIn"),f.i32_const(3*d))),f.setLocal("itOut",f.i32_add(f.getLocal("itOut"),f.i32_const(2*d))),f.setLocal("itAux",f.i32_add(f.getLocal("itAux"),f.i32_const(d))),f.setLocal("i",f.i32_add(f.getLocal("i"),f.i32_const(1))),f.br(0))),f.i32_store(f.i32_const(0),f.getLocal("pAux")))}(),function(){const c=e.addFunction(a+"_normalize");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d)),i=f.i32_add(f.getLocal("p1"),f.i32_const(2*d)),b=f.getLocal("pr"),o=f.i32_add(f.getLocal("pr"),f.i32_const(d)),s=f.i32_add(f.getLocal("pr"),f.i32_const(2*d)),l=f.i32_const(e.alloc(d)),u=f.i32_const(e.alloc(d)),h=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZero",f.getLocal("p1")),f.call(a+"_zero",f.getLocal("pr")),[...f.call(t+"_inverse",i,l),...f.call(t+"_square",l,u),...f.call(t+"_mul",l,u,h),...f.call(t+"_mul",r,u,b),...f.call(t+"_mul",n,h,o),...f.call(t+"_one",s)]))}(),function(){const t=e.addFunction(a+"__reverseBytes");t.addParam("pIn","i32"),t.addParam("n","i32"),t.addParam("pOut","i32"),t.addLocal("itOut","i32"),t.addLocal("itIn","i32");const c=t.getCodeBuilder();t.addCode(c.setLocal("itOut",c.i32_sub(c.i32_add(c.getLocal("pOut"),c.getLocal("n")),c.i32_const(1))),c.setLocal("itIn",c.getLocal("pIn")),c.block(c.loop(c.br_if(1,c.i32_lt_s(c.getLocal("itOut"),c.getLocal("pOut"))),c.i32_store8(c.getLocal("itOut"),c.i32_load8_u(c.getLocal("itIn"))),c.setLocal("itOut",c.i32_sub(c.getLocal("itOut"),c.i32_const(1))),c.setLocal("itIn",c.i32_add(c.getLocal("itIn"),c.i32_const(1))),c.br(0))))}(),function(){const t=e.addFunction(a+"_LEMtoU");t.addParam("pIn","i32"),t.addParam("pOut","i32");const c=t.getCodeBuilder(),f=e.alloc(2*d),r=c.i32_const(f),n=c.i32_const(f),i=c.i32_const(f+d);t.addCode(c.if(c.call(a+"_isZeroAffine",c.getLocal("pIn")),[...c.call(a+"_zeroAffine",c.getLocal("pOut")),...c.ret([])]),c.call(a+"_fromMontgomeryAffine",c.getLocal("pIn"),r),c.call(a+"__reverseBytes",n,c.i32_const(d),c.getLocal("pOut")),c.call(a+"__reverseBytes",i,c.i32_const(d),c.i32_add(c.getLocal("pOut"),c.i32_const(d))))}(),function(){const c=e.addFunction(a+"_LEMtoC");c.addParam("pIn","i32"),c.addParam("pOut","i32");const f=c.getCodeBuilder(),r=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZeroAffine",f.getLocal("pIn")),[...f.call(t+"_zero",f.getLocal("pOut")),...f.i32_store8(f.getLocal("pOut"),f.i32_const(64)),...f.ret([])]),f.call(t+"_fromMontgomery",f.getLocal("pIn"),r),f.call(a+"__reverseBytes",r,f.i32_const(d),f.getLocal("pOut")),f.if(f.i32_eq(f.call(t+"_sign",f.i32_add(f.getLocal("pIn"),f.i32_const(d))),f.i32_const(-1)),f.i32_store8(f.getLocal("pOut"),f.i32_or(f.i32_load8_u(f.getLocal("pOut")),f.i32_const(128)))))}(),function(){const t=e.addFunction(a+"_UtoLEM");t.addParam("pIn","i32"),t.addParam("pOut","i32");const c=t.getCodeBuilder(),f=e.alloc(2*d),r=c.i32_const(f),n=c.i32_const(f),i=c.i32_const(f+d);t.addCode(c.if(c.i32_and(c.i32_load8_u(c.getLocal("pIn")),c.i32_const(64)),[...c.call(a+"_zeroAffine",c.getLocal("pOut")),...c.ret([])]),c.call(a+"__reverseBytes",c.getLocal("pIn"),c.i32_const(d),n),c.call(a+"__reverseBytes",c.i32_add(c.getLocal("pIn"),c.i32_const(d)),c.i32_const(d),i),c.call(a+"_toMontgomeryAffine",r,c.getLocal("pOut")))}(),function(){const f=e.addFunction(a+"_CtoLEM");f.addParam("pIn","i32"),f.addParam("pOut","i32"),f.addLocal("firstByte","i32"),f.addLocal("greatest","i32");const r=f.getCodeBuilder(),n=e.alloc(2*d),i=r.i32_const(n),b=r.i32_const(n+d);f.addCode(r.setLocal("firstByte",r.i32_load8_u(r.getLocal("pIn"))),r.if(r.i32_and(r.getLocal("firstByte"),r.i32_const(64)),[...r.call(a+"_zeroAffine",r.getLocal("pOut")),...r.ret([])]),r.setLocal("greatest",r.i32_and(r.getLocal("firstByte"),r.i32_const(128))),r.call(t+"_copy",r.getLocal("pIn"),b),r.i32_store8(b,r.i32_and(r.getLocal("firstByte"),r.i32_const(63))),r.call(a+"__reverseBytes",b,r.i32_const(d),i),r.call(t+"_toMontgomery",i,r.getLocal("pOut")),r.call(t+"_square",r.getLocal("pOut"),b),r.call(t+"_mul",r.getLocal("pOut"),b,b),r.call(t+"_add",b,r.i32_const(c),b),r.call(t+"_sqrt",b,b),r.call(t+"_neg",b,i),r.if(r.i32_eq(r.call(t+"_sign",b),r.i32_const(-1)),r.if(r.getLocal("greatest"),r.call(t+"_copy",b,r.i32_add(r.getLocal("pOut"),r.i32_const(d))),r.call(t+"_neg",b,r.i32_add(r.getLocal("pOut"),r.i32_const(d)))),r.if(r.getLocal("greatest"),r.call(t+"_neg",b,r.i32_add(r.getLocal("pOut"),r.i32_const(d))),r.call(t+"_copy",b,r.i32_add(r.getLocal("pOut"),r.i32_const(d))))))}(),_e(e,a+"_batchLEMtoU",a+"_LEMtoU",2*d,2*d),_e(e,a+"_batchLEMtoC",a+"_LEMtoC",2*d,d),_e(e,a+"_batchUtoLEM",a+"_UtoLEM",2*d,2*d),_e(e,a+"_batchCtoLEM",a+"_CtoLEM",d,2*d,!0),_e(e,a+"_batchToJacobian",a+"_toJacobian",2*d,3*d,!0),Ie(e,a,a+"_multiexp",a+"_add",3*d),Ie(e,a,a+"_multiexpAffine",a+"_addMixed",2*d),we(e,a+"_timesScalar",3*d,a+"_add",a+"_double",a+"_sub",a+"_copy",a+"_zero"),we(e,a+"_timesScalarAffine",2*d,a+"_addMixed",a+"_double",a+"_subMixed",a+"_copyAffine",a+"_zero"),e.exportFunction(a+"_isZero"),e.exportFunction(a+"_isZeroAffine"),e.exportFunction(a+"_eq"),e.exportFunction(a+"_eqMixed"),e.exportFunction(a+"_eqAffine"),e.exportFunction(a+"_copy"),e.exportFunction(a+"_copyAffine"),e.exportFunction(a+"_zero"),e.exportFunction(a+"_zeroAffine"),e.exportFunction(a+"_double"),e.exportFunction(a+"_doubleAffine"),e.exportFunction(a+"_add"),e.exportFunction(a+"_addMixed"),e.exportFunction(a+"_addAffine"),e.exportFunction(a+"_neg"),e.exportFunction(a+"_negAffine"),e.exportFunction(a+"_sub"),e.exportFunction(a+"_subMixed"),e.exportFunction(a+"_subAffine"),e.exportFunction(a+"_fromMontgomery"),e.exportFunction(a+"_fromMontgomeryAffine"),e.exportFunction(a+"_toMontgomery"),e.exportFunction(a+"_toMontgomeryAffine"),e.exportFunction(a+"_timesScalar"),e.exportFunction(a+"_timesScalarAffine"),e.exportFunction(a+"_normalize"),e.exportFunction(a+"_LEMtoU"),e.exportFunction(a+"_LEMtoC"),e.exportFunction(a+"_UtoLEM"),e.exportFunction(a+"_CtoLEM"),e.exportFunction(a+"_batchLEMtoU"),e.exportFunction(a+"_batchLEMtoC"),e.exportFunction(a+"_batchUtoLEM"),e.exportFunction(a+"_batchCtoLEM"),e.exportFunction(a+"_toAffine"),e.exportFunction(a+"_toJacobian"),e.exportFunction(a+"_batchToAffine"),e.exportFunction(a+"_batchToJacobian"),e.exportFunction(a+"_inCurve"),e.exportFunction(a+"_inCurveAffine")),a};const{isOdd:Ce,modInv:Me,modPow:Be}=U,ke=D;var Le=function(e,a,t,c,f){const d=8*e.modules[c].n64,r=8*e.modules[t].n64,n=e.modules[c].q;let i=n-1n,b=0;for(;!Ce(i);)b++,i>>=1n;let o=2n;for(;1n===Be(o,n>>1n,n);)o+=1n;const s=new Array(b+1);s[b]=Be(o,i,n);let l=b-1;for(;l>=0;)s[l]=Be(s[l+1],2n,n),l--;const u=[],h=(1n<>t);return a}const E=Array(256);for(let e=0;e<256;e++)E[e]=I(e);const C=e.alloc(E);!function(){const t=e.addFunction(a+"__rev");t.addParam("x","i32"),t.addParam("bits","i32"),t.setReturnType("i32");const c=t.getCodeBuilder();t.addCode(c.i32_rotl(c.i32_add(c.i32_add(c.i32_shl(c.i32_load8_u(c.i32_and(c.getLocal("x"),c.i32_const(255)),C,0),c.i32_const(24)),c.i32_shl(c.i32_load8_u(c.i32_and(c.i32_shr_u(c.getLocal("x"),c.i32_const(8)),c.i32_const(255)),C,0),c.i32_const(16))),c.i32_add(c.i32_shl(c.i32_load8_u(c.i32_and(c.i32_shr_u(c.getLocal("x"),c.i32_const(16)),c.i32_const(255)),C,0),c.i32_const(8)),c.i32_load8_u(c.i32_and(c.i32_shr_u(c.getLocal("x"),c.i32_const(24)),c.i32_const(255)),C,0))),c.getLocal("bits")))}(),function(){const c=e.addFunction(a+"__reversePermutation");c.addParam("px","i32"),c.addParam("bits","i32"),c.addLocal("n","i32"),c.addLocal("i","i32"),c.addLocal("ri","i32"),c.addLocal("idx1","i32"),c.addLocal("idx2","i32");const f=c.getCodeBuilder(),d=f.i32_const(e.alloc(r));c.addCode(f.setLocal("n",f.i32_shl(f.i32_const(1),f.getLocal("bits"))),f.setLocal("i",f.i32_const(0)),f.block(f.loop(f.br_if(1,f.i32_eq(f.getLocal("i"),f.getLocal("n"))),f.setLocal("idx1",f.i32_add(f.getLocal("px"),f.i32_mul(f.getLocal("i"),f.i32_const(r)))),f.setLocal("ri",f.call(a+"__rev",f.getLocal("i"),f.getLocal("bits"))),f.setLocal("idx2",f.i32_add(f.getLocal("px"),f.i32_mul(f.getLocal("ri"),f.i32_const(r)))),f.if(f.i32_lt_u(f.getLocal("i"),f.getLocal("ri")),[...f.call(t+"_copy",f.getLocal("idx1"),d),...f.call(t+"_copy",f.getLocal("idx2"),f.getLocal("idx1")),...f.call(t+"_copy",d,f.getLocal("idx2"))]),f.setLocal("i",f.i32_add(f.getLocal("i"),f.i32_const(1))),f.br(0))))}(),function(){const d=e.addFunction(a+"__fftFinal");d.addParam("px","i32"),d.addParam("bits","i32"),d.addParam("reverse","i32"),d.addParam("mulFactor","i32"),d.addLocal("n","i32"),d.addLocal("ndiv2","i32"),d.addLocal("pInv2","i32"),d.addLocal("i","i32"),d.addLocal("mask","i32"),d.addLocal("idx1","i32"),d.addLocal("idx2","i32");const n=d.getCodeBuilder(),i=n.i32_const(e.alloc(r));d.addCode(n.if(n.i32_and(n.i32_eqz(n.getLocal("reverse")),n.call(c+"_isOne",n.getLocal("mulFactor"))),n.ret([])),n.setLocal("n",n.i32_shl(n.i32_const(1),n.getLocal("bits"))),n.setLocal("mask",n.i32_sub(n.getLocal("n"),n.i32_const(1))),n.setLocal("i",n.i32_const(1)),n.setLocal("ndiv2",n.i32_shr_u(n.getLocal("n"),n.i32_const(1))),n.block(n.loop(n.br_if(1,n.i32_ge_u(n.getLocal("i"),n.getLocal("ndiv2"))),n.setLocal("idx1",n.i32_add(n.getLocal("px"),n.i32_mul(n.getLocal("i"),n.i32_const(r)))),n.setLocal("idx2",n.i32_add(n.getLocal("px"),n.i32_mul(n.i32_sub(n.getLocal("n"),n.getLocal("i")),n.i32_const(r)))),n.if(n.getLocal("reverse"),n.if(n.call(c+"_isOne",n.getLocal("mulFactor")),[...n.call(t+"_copy",n.getLocal("idx1"),i),...n.call(t+"_copy",n.getLocal("idx2"),n.getLocal("idx1")),...n.call(t+"_copy",i,n.getLocal("idx2"))],[...n.call(t+"_copy",n.getLocal("idx1"),i),...n.call(f,n.getLocal("idx2"),n.getLocal("mulFactor"),n.getLocal("idx1")),...n.call(f,i,n.getLocal("mulFactor"),n.getLocal("idx2"))]),n.if(n.call(c+"_isOne",n.getLocal("mulFactor")),[],[...n.call(f,n.getLocal("idx1"),n.getLocal("mulFactor"),n.getLocal("idx1")),...n.call(f,n.getLocal("idx2"),n.getLocal("mulFactor"),n.getLocal("idx2"))])),n.setLocal("i",n.i32_add(n.getLocal("i"),n.i32_const(1))),n.br(0))),n.if(n.call(c+"_isOne",n.getLocal("mulFactor")),[],[...n.call(f,n.getLocal("px"),n.getLocal("mulFactor"),n.getLocal("px")),...n.setLocal("idx2",n.i32_add(n.getLocal("px"),n.i32_mul(n.getLocal("ndiv2"),n.i32_const(r)))),...n.call(f,n.getLocal("idx2"),n.getLocal("mulFactor"),n.getLocal("idx2"))]))}(),function(){const n=e.addFunction(a+"_rawfft");n.addParam("px","i32"),n.addParam("bits","i32"),n.addParam("reverse","i32"),n.addParam("mulFactor","i32"),n.addLocal("s","i32"),n.addLocal("k","i32"),n.addLocal("j","i32"),n.addLocal("m","i32"),n.addLocal("mdiv2","i32"),n.addLocal("n","i32"),n.addLocal("pwm","i32"),n.addLocal("idx1","i32"),n.addLocal("idx2","i32");const i=n.getCodeBuilder(),b=i.i32_const(e.alloc(d)),o=i.i32_const(e.alloc(r)),s=i.i32_const(e.alloc(r));n.addCode(i.call(a+"__reversePermutation",i.getLocal("px"),i.getLocal("bits")),i.setLocal("n",i.i32_shl(i.i32_const(1),i.getLocal("bits"))),i.setLocal("s",i.i32_const(1)),i.block(i.loop(i.br_if(1,i.i32_gt_u(i.getLocal("s"),i.getLocal("bits"))),i.setLocal("m",i.i32_shl(i.i32_const(1),i.getLocal("s"))),i.setLocal("pwm",i.i32_add(i.i32_const(p),i.i32_mul(i.getLocal("s"),i.i32_const(d)))),i.setLocal("k",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_ge_u(i.getLocal("k"),i.getLocal("n"))),i.call(c+"_one",b),i.setLocal("mdiv2",i.i32_shr_u(i.getLocal("m"),i.i32_const(1))),i.setLocal("j",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_ge_u(i.getLocal("j"),i.getLocal("mdiv2"))),i.setLocal("idx1",i.i32_add(i.getLocal("px"),i.i32_mul(i.i32_add(i.getLocal("k"),i.getLocal("j")),i.i32_const(r)))),i.setLocal("idx2",i.i32_add(i.getLocal("idx1"),i.i32_mul(i.getLocal("mdiv2"),i.i32_const(r)))),i.call(f,i.getLocal("idx2"),b,o),i.call(t+"_copy",i.getLocal("idx1"),s),i.call(t+"_add",s,o,i.getLocal("idx1")),i.call(t+"_sub",s,o,i.getLocal("idx2")),i.call(c+"_mul",b,i.getLocal("pwm"),b),i.setLocal("j",i.i32_add(i.getLocal("j"),i.i32_const(1))),i.br(0))),i.setLocal("k",i.i32_add(i.getLocal("k"),i.getLocal("m"))),i.br(0))),i.setLocal("s",i.i32_add(i.getLocal("s"),i.i32_const(1))),i.br(0))),i.call(a+"__fftFinal",i.getLocal("px"),i.getLocal("bits"),i.getLocal("reverse"),i.getLocal("mulFactor")))}(),function(){const t=e.addFunction(a+"__log2");t.addParam("n","i32"),t.setReturnType("i32"),t.addLocal("bits","i32"),t.addLocal("aux","i32");const c=t.getCodeBuilder();t.addCode(c.setLocal("aux",c.i32_shr_u(c.getLocal("n"),c.i32_const(1)))),t.addCode(c.setLocal("bits",c.i32_const(0))),t.addCode(c.block(c.loop(c.br_if(1,c.i32_eqz(c.getLocal("aux"))),c.setLocal("aux",c.i32_shr_u(c.getLocal("aux"),c.i32_const(1))),c.setLocal("bits",c.i32_add(c.getLocal("bits"),c.i32_const(1))),c.br(0)))),t.addCode(c.if(c.i32_ne(c.getLocal("n"),c.i32_shl(c.i32_const(1),c.getLocal("bits"))),c.unreachable())),t.addCode(c.if(c.i32_gt_u(c.getLocal("bits"),c.i32_const(b)),c.unreachable())),t.addCode(c.getLocal("bits"))}(),function(){const t=e.addFunction(a+"_fft");t.addParam("px","i32"),t.addParam("n","i32"),t.addLocal("bits","i32");const f=t.getCodeBuilder(),r=f.i32_const(e.alloc(d));t.addCode(f.setLocal("bits",f.call(a+"__log2",f.getLocal("n"))),f.call(c+"_one",r),f.call(a+"_rawfft",f.getLocal("px"),f.getLocal("bits"),f.i32_const(0),r))}(),function(){const t=e.addFunction(a+"_ifft");t.addParam("px","i32"),t.addParam("n","i32"),t.addLocal("bits","i32"),t.addLocal("pInv2","i32");const c=t.getCodeBuilder();t.addCode(c.setLocal("bits",c.call(a+"__log2",c.getLocal("n"))),c.setLocal("pInv2",c.i32_add(c.i32_const(x),c.i32_mul(c.getLocal("bits"),c.i32_const(d)))),c.call(a+"_rawfft",c.getLocal("px"),c.getLocal("bits"),c.i32_const(1),c.getLocal("pInv2")))}(),function(){const n=e.addFunction(a+"_fftJoin");n.addParam("pBuff1","i32"),n.addParam("pBuff2","i32"),n.addParam("n","i32"),n.addParam("first","i32"),n.addParam("inc","i32"),n.addLocal("idx1","i32"),n.addLocal("idx2","i32"),n.addLocal("i","i32");const i=n.getCodeBuilder(),b=i.i32_const(e.alloc(d)),o=i.i32_const(e.alloc(r)),s=i.i32_const(e.alloc(r));n.addCode(i.call(c+"_copy",i.getLocal("first"),b),i.setLocal("i",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("i"),i.getLocal("n"))),i.setLocal("idx1",i.i32_add(i.getLocal("pBuff1"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.setLocal("idx2",i.i32_add(i.getLocal("pBuff2"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.call(f,i.getLocal("idx2"),b,o),i.call(t+"_copy",i.getLocal("idx1"),s),i.call(t+"_add",s,o,i.getLocal("idx1")),i.call(t+"_sub",s,o,i.getLocal("idx2")),i.call(c+"_mul",b,i.getLocal("inc"),b),i.setLocal("i",i.i32_add(i.getLocal("i"),i.i32_const(1))),i.br(0))))}(),function(){const n=e.addFunction(a+"_fftJoinExt");n.addParam("pBuff1","i32"),n.addParam("pBuff2","i32"),n.addParam("n","i32"),n.addParam("first","i32"),n.addParam("inc","i32"),n.addParam("totalBits","i32"),n.addLocal("idx1","i32"),n.addLocal("idx2","i32"),n.addLocal("i","i32"),n.addLocal("pShiftToM","i32");const i=n.getCodeBuilder(),b=i.i32_const(e.alloc(d)),o=i.i32_const(e.alloc(r));n.addCode(i.setLocal("pShiftToM",i.i32_add(i.i32_const(w),i.i32_mul(i.getLocal("totalBits"),i.i32_const(d)))),i.call(c+"_copy",i.getLocal("first"),b),i.setLocal("i",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("i"),i.getLocal("n"))),i.setLocal("idx1",i.i32_add(i.getLocal("pBuff1"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.setLocal("idx2",i.i32_add(i.getLocal("pBuff2"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.call(t+"_add",i.getLocal("idx1"),i.getLocal("idx2"),o),i.call(f,i.getLocal("idx2"),i.getLocal("pShiftToM"),i.getLocal("idx2")),i.call(t+"_add",i.getLocal("idx1"),i.getLocal("idx2"),i.getLocal("idx2")),i.call(f,i.getLocal("idx2"),b,i.getLocal("idx2")),i.call(t+"_copy",o,i.getLocal("idx1")),i.call(c+"_mul",b,i.getLocal("inc"),b),i.setLocal("i",i.i32_add(i.getLocal("i"),i.i32_const(1))),i.br(0))))}(),function(){const n=e.addFunction(a+"_fftJoinExtInv");n.addParam("pBuff1","i32"),n.addParam("pBuff2","i32"),n.addParam("n","i32"),n.addParam("first","i32"),n.addParam("inc","i32"),n.addParam("totalBits","i32"),n.addLocal("idx1","i32"),n.addLocal("idx2","i32"),n.addLocal("i","i32"),n.addLocal("pShiftToM","i32"),n.addLocal("pSConst","i32");const i=n.getCodeBuilder(),b=i.i32_const(e.alloc(d)),o=i.i32_const(e.alloc(r));n.addCode(i.setLocal("pShiftToM",i.i32_add(i.i32_const(w),i.i32_mul(i.getLocal("totalBits"),i.i32_const(d)))),i.setLocal("pSConst",i.i32_add(i.i32_const(_),i.i32_mul(i.getLocal("totalBits"),i.i32_const(d)))),i.call(c+"_copy",i.getLocal("first"),b),i.setLocal("i",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("i"),i.getLocal("n"))),i.setLocal("idx1",i.i32_add(i.getLocal("pBuff1"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.setLocal("idx2",i.i32_add(i.getLocal("pBuff2"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.call(f,i.getLocal("idx2"),b,o),i.call(t+"_sub",i.getLocal("idx1"),o,i.getLocal("idx2")),i.call(f,i.getLocal("idx2"),i.getLocal("pSConst"),i.getLocal("idx2")),i.call(f,i.getLocal("idx1"),i.getLocal("pShiftToM"),i.getLocal("idx1")),i.call(t+"_sub",o,i.getLocal("idx1"),i.getLocal("idx1")),i.call(f,i.getLocal("idx1"),i.getLocal("pSConst"),i.getLocal("idx1")),i.call(c+"_mul",b,i.getLocal("inc"),b),i.setLocal("i",i.i32_add(i.getLocal("i"),i.i32_const(1))),i.br(0))))}(),function(){const n=e.addFunction(a+"_fftMix");n.addParam("pBuff","i32"),n.addParam("n","i32"),n.addParam("exp","i32"),n.addLocal("nGroups","i32"),n.addLocal("nPerGroup","i32"),n.addLocal("nPerGroupDiv2","i32"),n.addLocal("pairOffset","i32"),n.addLocal("idx1","i32"),n.addLocal("idx2","i32"),n.addLocal("i","i32"),n.addLocal("j","i32"),n.addLocal("pwm","i32");const i=n.getCodeBuilder(),b=i.i32_const(e.alloc(d)),o=i.i32_const(e.alloc(r)),s=i.i32_const(e.alloc(r));n.addCode(i.setLocal("nPerGroup",i.i32_shl(i.i32_const(1),i.getLocal("exp"))),i.setLocal("nPerGroupDiv2",i.i32_shr_u(i.getLocal("nPerGroup"),i.i32_const(1))),i.setLocal("nGroups",i.i32_shr_u(i.getLocal("n"),i.getLocal("exp"))),i.setLocal("pairOffset",i.i32_mul(i.getLocal("nPerGroupDiv2"),i.i32_const(r))),i.setLocal("pwm",i.i32_add(i.i32_const(p),i.i32_mul(i.getLocal("exp"),i.i32_const(d)))),i.setLocal("i",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("i"),i.getLocal("nGroups"))),i.call(c+"_one",b),i.setLocal("j",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("j"),i.getLocal("nPerGroupDiv2"))),i.setLocal("idx1",i.i32_add(i.getLocal("pBuff"),i.i32_mul(i.i32_add(i.i32_mul(i.getLocal("i"),i.getLocal("nPerGroup")),i.getLocal("j")),i.i32_const(r)))),i.setLocal("idx2",i.i32_add(i.getLocal("idx1"),i.getLocal("pairOffset"))),i.call(f,i.getLocal("idx2"),b,o),i.call(t+"_copy",i.getLocal("idx1"),s),i.call(t+"_add",s,o,i.getLocal("idx1")),i.call(t+"_sub",s,o,i.getLocal("idx2")),i.call(c+"_mul",b,i.getLocal("pwm"),b),i.setLocal("j",i.i32_add(i.getLocal("j"),i.i32_const(1))),i.br(0))),i.setLocal("i",i.i32_add(i.getLocal("i"),i.i32_const(1))),i.br(0))))}(),function(){const c=e.addFunction(a+"_fftFinal");c.addParam("pBuff","i32"),c.addParam("n","i32"),c.addParam("factor","i32"),c.addLocal("idx1","i32"),c.addLocal("idx2","i32"),c.addLocal("i","i32"),c.addLocal("ndiv2","i32");const d=c.getCodeBuilder(),n=d.i32_const(e.alloc(r));c.addCode(d.setLocal("ndiv2",d.i32_shr_u(d.getLocal("n"),d.i32_const(1))),d.if(d.i32_and(d.getLocal("n"),d.i32_const(1)),d.call(f,d.i32_add(d.getLocal("pBuff"),d.i32_mul(d.getLocal("ndiv2"),d.i32_const(r))),d.getLocal("factor"),d.i32_add(d.getLocal("pBuff"),d.i32_mul(d.getLocal("ndiv2"),d.i32_const(r))))),d.setLocal("i",d.i32_const(0)),d.block(d.loop(d.br_if(1,d.i32_ge_u(d.getLocal("i"),d.getLocal("ndiv2"))),d.setLocal("idx1",d.i32_add(d.getLocal("pBuff"),d.i32_mul(d.getLocal("i"),d.i32_const(r)))),d.setLocal("idx2",d.i32_add(d.getLocal("pBuff"),d.i32_mul(d.i32_sub(d.i32_sub(d.getLocal("n"),d.i32_const(1)),d.getLocal("i")),d.i32_const(r)))),d.call(f,d.getLocal("idx2"),d.getLocal("factor"),n),d.call(f,d.getLocal("idx1"),d.getLocal("factor"),d.getLocal("idx2")),d.call(t+"_copy",n,d.getLocal("idx1")),d.setLocal("i",d.i32_add(d.getLocal("i"),d.i32_const(1))),d.br(0))))}(),function(){const n=e.addFunction(a+"_prepareLagrangeEvaluation");n.addParam("pBuff1","i32"),n.addParam("pBuff2","i32"),n.addParam("n","i32"),n.addParam("first","i32"),n.addParam("inc","i32"),n.addParam("totalBits","i32"),n.addLocal("idx1","i32"),n.addLocal("idx2","i32"),n.addLocal("i","i32"),n.addLocal("pShiftToM","i32"),n.addLocal("pSConst","i32");const i=n.getCodeBuilder(),b=i.i32_const(e.alloc(d)),o=i.i32_const(e.alloc(r));n.addCode(i.setLocal("pShiftToM",i.i32_add(i.i32_const(w),i.i32_mul(i.getLocal("totalBits"),i.i32_const(d)))),i.setLocal("pSConst",i.i32_add(i.i32_const(_),i.i32_mul(i.getLocal("totalBits"),i.i32_const(d)))),i.call(c+"_copy",i.getLocal("first"),b),i.setLocal("i",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("i"),i.getLocal("n"))),i.setLocal("idx1",i.i32_add(i.getLocal("pBuff1"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.setLocal("idx2",i.i32_add(i.getLocal("pBuff2"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.call(f,i.getLocal("idx1"),i.getLocal("pShiftToM"),o),i.call(t+"_sub",i.getLocal("idx2"),o,o),i.call(t+"_sub",i.getLocal("idx1"),i.getLocal("idx2"),i.getLocal("idx2")),i.call(f,o,i.getLocal("pSConst"),i.getLocal("idx1")),i.call(f,i.getLocal("idx2"),b,i.getLocal("idx2")),i.call(c+"_mul",b,i.getLocal("inc"),b),i.setLocal("i",i.i32_add(i.getLocal("i"),i.i32_const(1))),i.br(0))))}(),e.exportFunction(a+"_fft"),e.exportFunction(a+"_ifft"),e.exportFunction(a+"_rawfft"),e.exportFunction(a+"_fftJoin"),e.exportFunction(a+"_fftJoinExt"),e.exportFunction(a+"_fftJoinExtInv"),e.exportFunction(a+"_fftMix"),e.exportFunction(a+"_fftFinal"),e.exportFunction(a+"_prepareLagrangeEvaluation")},Se=function(e,a,t){const c=8*e.modules[t].n64;return function(){const f=e.addFunction(a+"_zero");f.addParam("px","i32"),f.addParam("n","i32"),f.addLocal("lastp","i32"),f.addLocal("p","i32");const d=f.getCodeBuilder();f.addCode(d.setLocal("p",d.getLocal("px")),d.setLocal("lastp",d.i32_add(d.getLocal("px"),d.i32_mul(d.getLocal("n"),d.i32_const(c)))),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("p"),d.getLocal("lastp"))),d.call(t+"_zero",d.getLocal("p")),d.setLocal("p",d.i32_add(d.getLocal("p"),d.i32_const(c))),d.br(0))))}(),function(){const f=e.addFunction(a+"_constructLC");f.addParam("ppolynomials","i32"),f.addParam("psignals","i32"),f.addParam("nSignals","i32"),f.addParam("pres","i32"),f.addLocal("i","i32"),f.addLocal("j","i32"),f.addLocal("pp","i32"),f.addLocal("ps","i32"),f.addLocal("pd","i32"),f.addLocal("ncoefs","i32");const d=f.getCodeBuilder(),r=d.i32_const(e.alloc(c));f.addCode(d.setLocal("i",d.i32_const(0)),d.setLocal("pp",d.getLocal("ppolynomials")),d.setLocal("ps",d.getLocal("psignals")),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("i"),d.getLocal("nSignals"))),d.setLocal("ncoefs",d.i32_load(d.getLocal("pp"))),d.setLocal("pp",d.i32_add(d.getLocal("pp"),d.i32_const(4))),d.setLocal("j",d.i32_const(0)),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("j"),d.getLocal("ncoefs"))),d.setLocal("pd",d.i32_add(d.getLocal("pres"),d.i32_mul(d.i32_load(d.getLocal("pp")),d.i32_const(c)))),d.setLocal("pp",d.i32_add(d.getLocal("pp"),d.i32_const(4))),d.call(t+"_mul",d.getLocal("ps"),d.getLocal("pp"),r),d.call(t+"_add",r,d.getLocal("pd"),d.getLocal("pd")),d.setLocal("pp",d.i32_add(d.getLocal("pp"),d.i32_const(c))),d.setLocal("j",d.i32_add(d.getLocal("j"),d.i32_const(1))),d.br(0))),d.setLocal("ps",d.i32_add(d.getLocal("ps"),d.i32_const(c))),d.setLocal("i",d.i32_add(d.getLocal("i"),d.i32_const(1))),d.br(0))))}(),e.exportFunction(a+"_zero"),e.exportFunction(a+"_constructLC"),a},Te=function(e,a,t){const c=8*e.modules[t].n64;return function(){const f=e.addFunction(a+"_buildABC");f.addParam("pCoefs","i32"),f.addParam("nCoefs","i32"),f.addParam("pWitness","i32"),f.addParam("pA","i32"),f.addParam("pB","i32"),f.addParam("pC","i32"),f.addParam("offsetOut","i32"),f.addParam("nOut","i32"),f.addParam("offsetWitness","i32"),f.addParam("nWitness","i32"),f.addLocal("it","i32"),f.addLocal("ita","i32"),f.addLocal("itb","i32"),f.addLocal("last","i32"),f.addLocal("m","i32"),f.addLocal("c","i32"),f.addLocal("s","i32"),f.addLocal("pOut","i32");const d=f.getCodeBuilder(),r=d.i32_const(e.alloc(c));f.addCode(d.setLocal("ita",d.getLocal("pA")),d.setLocal("itb",d.getLocal("pB")),d.setLocal("last",d.i32_add(d.getLocal("pA"),d.i32_mul(d.getLocal("nOut"),d.i32_const(c)))),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("ita"),d.getLocal("last"))),d.call(t+"_zero",d.getLocal("ita")),d.call(t+"_zero",d.getLocal("itb")),d.setLocal("ita",d.i32_add(d.getLocal("ita"),d.i32_const(c))),d.setLocal("itb",d.i32_add(d.getLocal("itb"),d.i32_const(c))),d.br(0))),d.setLocal("it",d.getLocal("pCoefs")),d.setLocal("last",d.i32_add(d.getLocal("pCoefs"),d.i32_mul(d.getLocal("nCoefs"),d.i32_const(c+12)))),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("it"),d.getLocal("last"))),d.setLocal("s",d.i32_load(d.getLocal("it"),8)),d.if(d.i32_or(d.i32_lt_u(d.getLocal("s"),d.getLocal("offsetWitness")),d.i32_ge_u(d.getLocal("s"),d.i32_add(d.getLocal("offsetWitness"),d.getLocal("nWitness")))),[...d.setLocal("it",d.i32_add(d.getLocal("it"),d.i32_const(c+12))),...d.br(1)]),d.setLocal("m",d.i32_load(d.getLocal("it"))),d.if(d.i32_eq(d.getLocal("m"),d.i32_const(0)),d.setLocal("pOut",d.getLocal("pA")),d.if(d.i32_eq(d.getLocal("m"),d.i32_const(1)),d.setLocal("pOut",d.getLocal("pB")),[...d.setLocal("it",d.i32_add(d.getLocal("it"),d.i32_const(c+12))),...d.br(1)])),d.setLocal("c",d.i32_load(d.getLocal("it"),4)),d.if(d.i32_or(d.i32_lt_u(d.getLocal("c"),d.getLocal("offsetOut")),d.i32_ge_u(d.getLocal("c"),d.i32_add(d.getLocal("offsetOut"),d.getLocal("nOut")))),[...d.setLocal("it",d.i32_add(d.getLocal("it"),d.i32_const(c+12))),...d.br(1)]),d.setLocal("pOut",d.i32_add(d.getLocal("pOut"),d.i32_mul(d.i32_sub(d.getLocal("c"),d.getLocal("offsetOut")),d.i32_const(c)))),d.call(t+"_mul",d.i32_add(d.getLocal("pWitness"),d.i32_mul(d.i32_sub(d.getLocal("s"),d.getLocal("offsetWitness")),d.i32_const(c))),d.i32_add(d.getLocal("it"),d.i32_const(12)),r),d.call(t+"_add",d.getLocal("pOut"),r,d.getLocal("pOut")),d.setLocal("it",d.i32_add(d.getLocal("it"),d.i32_const(c+12))),d.br(0))),d.setLocal("ita",d.getLocal("pA")),d.setLocal("itb",d.getLocal("pB")),d.setLocal("it",d.getLocal("pC")),d.setLocal("last",d.i32_add(d.getLocal("pA"),d.i32_mul(d.getLocal("nOut"),d.i32_const(c)))),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("ita"),d.getLocal("last"))),d.call(t+"_mul",d.getLocal("ita"),d.getLocal("itb"),d.getLocal("it")),d.setLocal("ita",d.i32_add(d.getLocal("ita"),d.i32_const(c))),d.setLocal("itb",d.i32_add(d.getLocal("itb"),d.i32_const(c))),d.setLocal("it",d.i32_add(d.getLocal("it"),d.i32_const(c))),d.br(0))))}(),function(){const f=e.addFunction(a+"_joinABC");f.addParam("pA","i32"),f.addParam("pB","i32"),f.addParam("pC","i32"),f.addParam("n","i32"),f.addParam("pP","i32"),f.addLocal("ita","i32"),f.addLocal("itb","i32"),f.addLocal("itc","i32"),f.addLocal("itp","i32"),f.addLocal("last","i32");const d=f.getCodeBuilder(),r=d.i32_const(e.alloc(c));f.addCode(d.setLocal("ita",d.getLocal("pA")),d.setLocal("itb",d.getLocal("pB")),d.setLocal("itc",d.getLocal("pC")),d.setLocal("itp",d.getLocal("pP")),d.setLocal("last",d.i32_add(d.getLocal("pA"),d.i32_mul(d.getLocal("n"),d.i32_const(c)))),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("ita"),d.getLocal("last"))),d.call(t+"_mul",d.getLocal("ita"),d.getLocal("itb"),r),d.call(t+"_sub",r,d.getLocal("itc"),d.getLocal("itp")),d.setLocal("ita",d.i32_add(d.getLocal("ita"),d.i32_const(c))),d.setLocal("itb",d.i32_add(d.getLocal("itb"),d.i32_const(c))),d.setLocal("itc",d.i32_add(d.getLocal("itc"),d.i32_const(c))),d.setLocal("itp",d.i32_add(d.getLocal("itp"),d.i32_const(c))),d.br(0))))}(),function(){const f=e.addFunction(a+"_batchAdd");f.addParam("pa","i32"),f.addParam("pb","i32"),f.addParam("n","i32"),f.addParam("pr","i32"),f.addLocal("ita","i32"),f.addLocal("itb","i32"),f.addLocal("itr","i32"),f.addLocal("last","i32");const d=f.getCodeBuilder();f.addCode(d.setLocal("ita",d.getLocal("pa")),d.setLocal("itb",d.getLocal("pb")),d.setLocal("itr",d.getLocal("pr")),d.setLocal("last",d.i32_add(d.getLocal("pa"),d.i32_mul(d.getLocal("n"),d.i32_const(c)))),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("ita"),d.getLocal("last"))),d.call(t+"_add",d.getLocal("ita"),d.getLocal("itb"),d.getLocal("itr")),d.setLocal("ita",d.i32_add(d.getLocal("ita"),d.i32_const(c))),d.setLocal("itb",d.i32_add(d.getLocal("itb"),d.i32_const(c))),d.setLocal("itr",d.i32_add(d.getLocal("itr"),d.i32_const(c))),d.br(0))))}(),e.exportFunction(a+"_buildABC"),e.exportFunction(a+"_joinABC"),e.exportFunction(a+"_batchAdd"),a},Ne=function(e,a,t,c,f,d,r,n){const i=e.addFunction(a);i.addParam("pIn","i32"),i.addParam("n","i32"),i.addParam("pFirst","i32"),i.addParam("pInc","i32"),i.addParam("pOut","i32"),i.addLocal("pOldFree","i32"),i.addLocal("i","i32"),i.addLocal("pFrom","i32"),i.addLocal("pTo","i32");const b=i.getCodeBuilder(),o=b.i32_const(e.alloc(r));i.addCode(b.setLocal("pFrom",b.getLocal("pIn")),b.setLocal("pTo",b.getLocal("pOut"))),i.addCode(b.call(c+"_copy",b.getLocal("pFirst"),o)),i.addCode(b.setLocal("i",b.i32_const(0)),b.block(b.loop(b.br_if(1,b.i32_eq(b.getLocal("i"),b.getLocal("n"))),b.call(n,b.getLocal("pFrom"),o,b.getLocal("pTo")),b.setLocal("pFrom",b.i32_add(b.getLocal("pFrom"),b.i32_const(f))),b.setLocal("pTo",b.i32_add(b.getLocal("pTo"),b.i32_const(d))),b.call(c+"_mul",o,b.getLocal("pInc"),o),b.setLocal("i",b.i32_add(b.getLocal("i"),b.i32_const(1))),b.br(0)))),e.exportFunction(a)};const Re=D,Pe=se,De=he,Oe=xe,Fe=ve,Qe=Ee,Ue=Le,je=Se,He=Te,qe=Ne,{bitLength:$e,modInv:ze,isOdd:Ge,isNegative:Ke}=U,Ve=D,Ze=se,Je=he,We=xe,Ye=ve,Xe=Ee,ea=Le,aa=Se,ta=Te,ca=Ne,{bitLength:fa,isOdd:da,isNegative:ra}=U;var na=function(e,a){const t=a||"bn128";if(e.modules[t])return t;const c=21888242871839275222246405745257275088696311157297823662689037894645226208583n,f=21888242871839275222246405745257275088548364400416034343698204186575808495617n,d=Math.floor(($e(c-1n)-1)/64)+1,r=8*d,n=r,i=r,b=2*i,o=12*i,s=e.alloc(Re.bigInt2BytesLE(f,n)),l=Pe(e,c,"f1m");De(e,f,"fr","frm");const u=e.alloc(Re.bigInt2BytesLE(y(3n),i)),h=Qe(e,"g1m","f1m",u);Ue(e,"frm","frm","frm","frm_mul"),je(e,"pol","frm"),He(e,"qap","frm");const p=Oe(e,"f1m_neg","f2m","f1m"),g=e.alloc([...Re.bigInt2BytesLE(y(19485874751759354771024239261021720505790618469301721065564631296452457478373n),i),...Re.bigInt2BytesLE(y(266929791119991161246907387137283842545076965332900288569378510910307636690n),i)]),m=Qe(e,"g2m","f2m",g);function x(a,t){const c=e.addFunction(a);c.addParam("pG","i32"),c.addParam("pFr","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),d=f.i32_const(e.alloc(r));c.addCode(f.call("frm_fromMontgomery",f.getLocal("pFr"),d),f.call(t,f.getLocal("pG"),d,f.i32_const(r),f.getLocal("pr"))),e.exportFunction(a)}function y(e){return BigInt(e)*(1n<0n;)Ge(e)?a.push(1):a.push(0),e>>=1n;return a}(),D=e.alloc(P),O=3*b,F=P.length-1,Q=P.reduce(((e,a)=>e+(0!=a?1:0)),0),U=6*r,j=3*r*2+(Q+F+1)*O;function H(a){const f=[[[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n]],[[1n,0n],[8376118865763821496583973867626364092589906065868298776909617916018768340080n,16469823323077808223889137241176536799009286646108169935659301613961712198316n],[21888242871839275220042445260109153167277707414472061641714758635765020556617n,0n],[11697423496358154304825782922584725312912383441159505038794027105778954184319n,303847389135065887422783454877609941456349188919719272345083954437860409601n],[21888242871839275220042445260109153167277707414472061641714758635765020556616n,0n],[3321304630594332808241809054958361220322477375291206261884409189760185844239n,5722266937896532885780051958958348231143373700109372999374820235121374419868n],[21888242871839275222246405745257275088696311157297823662689037894645226208582n,0n],[13512124006075453725662431877630910996106405091429524885779419978626457868503n,5418419548761466998357268504080738289687024511189653727029736280683514010267n],[2203960485148121921418603742825762020974279258880205651966n,0n],[10190819375481120917420622822672549775783927716138318623895010788866272024264n,21584395482704209334823622290379665147239961968378104390343953940207365798982n],[2203960485148121921418603742825762020974279258880205651967n,0n],[18566938241244942414004596690298913868373833782006617400804628704885040364344n,16165975933942742336466353786298926857552937457188450663314217659523851788715n]]],d=[[[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n]],[[1n,0n],[21575463638280843010398324269430826099269044274347216827212613867836435027261n,10307601595873709700152284273816112264069230130616436755625194854815875713954n],[21888242871839275220042445260109153167277707414472061641714758635765020556616n,0n],[3772000881919853776433695186713858239009073593817195771773381919316419345261n,2236595495967245188281701248203181795121068902605861227855261137820944008926n],[2203960485148121921418603742825762020974279258880205651966n,0n],[18429021223477853657660792034369865839114504446431234726392080002137598044644n,9344045779998320333812420223237981029506012124075525679208581902008406485703n]],[[1n,0n],[2581911344467009335267311115468803099551665605076196740867805258568234346338n,19937756971775647987995932169929341994314640652964949448313374472400716661030n],[2203960485148121921418603742825762020974279258880205651966n,0n],[5324479202449903542726783395506214481928257762400643279780343368557297135718n,16208900380737693084919495127334387981393726419856888799917914180988844123039n],[21888242871839275220042445260109153167277707414472061641714758635765020556616n,0n],[13981852324922362344252311234282257507216387789820983642040889267519694726527n,7629828391165209371577384193250820201684255241773809077146787135900891633097n]]],r=e.addFunction(t+"__frobeniusMap"+a);r.addParam("x","i32"),r.addParam("r","i32");const n=r.getCodeBuilder();for(let t=0;t<6;t++){const c=0==t?n.getLocal("x"):n.i32_add(n.getLocal("x"),n.i32_const(t*b)),s=c,u=n.i32_add(n.getLocal("x"),n.i32_const(t*b+i)),h=0==t?n.getLocal("r"):n.i32_add(n.getLocal("r"),n.i32_const(t*b)),g=h,m=n.i32_add(n.getLocal("r"),n.i32_const(t*b+i)),x=o(f[Math.floor(t/3)][a%12],d[t%3][a%6]),A=e.alloc([...Re.bigInt2BytesLE(y(x[0]),32),...Re.bigInt2BytesLE(y(x[1]),32)]);a%2==1?r.addCode(n.call(l+"_copy",s,g),n.call(l+"_neg",u,m),n.call(p+"_mul",h,n.i32_const(A),h)):r.addCode(n.call(p+"_mul",c,n.i32_const(A),h))}function o(e,a){const t=BigInt(e[0]),f=BigInt(e[1]),d=BigInt(a[0]),r=BigInt(a[1]),n=[(t*d-f*r)%c,(t*r+f*d)%c];return Ke(n[0])&&(n[0]=n[0]+c),n}}function q(){!function(){const a=e.addFunction(t+"__cyclotomicSquare");a.addParam("x","i32"),a.addParam("r","i32");const c=a.getCodeBuilder(),f=c.getLocal("x"),d=c.i32_add(c.getLocal("x"),c.i32_const(b)),r=c.i32_add(c.getLocal("x"),c.i32_const(2*b)),n=c.i32_add(c.getLocal("x"),c.i32_const(3*b)),i=c.i32_add(c.getLocal("x"),c.i32_const(4*b)),o=c.i32_add(c.getLocal("x"),c.i32_const(5*b)),s=c.getLocal("r"),l=c.i32_add(c.getLocal("r"),c.i32_const(b)),u=c.i32_add(c.getLocal("r"),c.i32_const(2*b)),h=c.i32_add(c.getLocal("r"),c.i32_const(3*b)),g=c.i32_add(c.getLocal("r"),c.i32_const(4*b)),m=c.i32_add(c.getLocal("r"),c.i32_const(5*b)),x=c.i32_const(e.alloc(b)),y=c.i32_const(e.alloc(b)),A=c.i32_const(e.alloc(b)),v=c.i32_const(e.alloc(b)),w=c.i32_const(e.alloc(b)),_=c.i32_const(e.alloc(b)),I=c.i32_const(e.alloc(b)),E=c.i32_const(e.alloc(b));a.addCode(c.call(p+"_mul",f,i,I),c.call(p+"_mul",i,c.i32_const(k),x),c.call(p+"_add",f,x,x),c.call(p+"_add",f,i,E),c.call(p+"_mul",E,x,x),c.call(p+"_mul",c.i32_const(k),I,E),c.call(p+"_add",I,E,E),c.call(p+"_sub",x,E,x),c.call(p+"_add",I,I,y),c.call(p+"_mul",n,r,I),c.call(p+"_mul",r,c.i32_const(k),A),c.call(p+"_add",n,A,A),c.call(p+"_add",n,r,E),c.call(p+"_mul",E,A,A),c.call(p+"_mul",c.i32_const(k),I,E),c.call(p+"_add",I,E,E),c.call(p+"_sub",A,E,A),c.call(p+"_add",I,I,v),c.call(p+"_mul",d,o,I),c.call(p+"_mul",o,c.i32_const(k),w),c.call(p+"_add",d,w,w),c.call(p+"_add",d,o,E),c.call(p+"_mul",E,w,w),c.call(p+"_mul",c.i32_const(k),I,E),c.call(p+"_add",I,E,E),c.call(p+"_sub",w,E,w),c.call(p+"_add",I,I,_),c.call(p+"_sub",x,f,s),c.call(p+"_add",s,s,s),c.call(p+"_add",x,s,s),c.call(p+"_add",y,i,g),c.call(p+"_add",g,g,g),c.call(p+"_add",y,g,g),c.call(p+"_mul",_,c.i32_const(S),E),c.call(p+"_add",E,n,h),c.call(p+"_add",h,h,h),c.call(p+"_add",E,h,h),c.call(p+"_sub",w,r,u),c.call(p+"_add",u,u,u),c.call(p+"_add",w,u,u),c.call(p+"_sub",A,d,l),c.call(p+"_add",l,l,l),c.call(p+"_add",A,l,l),c.call(p+"_add",v,o,m),c.call(p+"_add",m,m,m),c.call(p+"_add",v,m,m))}(),function(a,c){const f=function(e){let a=e;const t=[];for(;a>0n;){if(Ge(a)){const e=2-Number(a%4n);t.push(e),a-=BigInt(e)}else t.push(0);a>>=1n}return t}(a).map((e=>-1==e?255:e)),d=e.alloc(f),r=e.addFunction(t+"__cyclotomicExp_"+c);r.addParam("x","i32"),r.addParam("r","i32"),r.addLocal("bit","i32"),r.addLocal("i","i32");const n=r.getCodeBuilder(),i=n.getLocal("x"),b=n.getLocal("r"),s=n.i32_const(e.alloc(o));r.addCode(n.call(R+"_conjugate",i,s),n.call(R+"_one",b),n.if(n.teeLocal("bit",n.i32_load8_s(n.i32_const(f.length-1),d)),n.if(n.i32_eq(n.getLocal("bit"),n.i32_const(1)),n.call(R+"_mul",b,i,b),n.call(R+"_mul",b,s,b))),n.setLocal("i",n.i32_const(f.length-2)),n.block(n.loop(n.call(t+"__cyclotomicSquare",b,b),n.if(n.teeLocal("bit",n.i32_load8_s(n.getLocal("i"),d)),n.if(n.i32_eq(n.getLocal("bit"),n.i32_const(1)),n.call(R+"_mul",b,i,b),n.call(R+"_mul",b,s,b))),n.br_if(1,n.i32_eqz(n.getLocal("i"))),n.setLocal("i",n.i32_sub(n.getLocal("i"),n.i32_const(1))),n.br(0))))}(4965661367192848881n,"w0");const a=e.addFunction(t+"__finalExponentiationLastChunk");a.addParam("x","i32"),a.addParam("r","i32");const c=a.getCodeBuilder(),f=c.getLocal("x"),d=c.getLocal("r"),r=c.i32_const(e.alloc(o)),n=c.i32_const(e.alloc(o)),i=c.i32_const(e.alloc(o)),s=c.i32_const(e.alloc(o)),l=c.i32_const(e.alloc(o)),u=c.i32_const(e.alloc(o)),h=c.i32_const(e.alloc(o)),g=c.i32_const(e.alloc(o)),m=c.i32_const(e.alloc(o)),x=c.i32_const(e.alloc(o)),y=c.i32_const(e.alloc(o)),A=c.i32_const(e.alloc(o)),v=c.i32_const(e.alloc(o)),w=c.i32_const(e.alloc(o)),_=c.i32_const(e.alloc(o)),I=c.i32_const(e.alloc(o)),E=c.i32_const(e.alloc(o)),C=c.i32_const(e.alloc(o)),M=c.i32_const(e.alloc(o)),B=c.i32_const(e.alloc(o)),L=c.i32_const(e.alloc(o));a.addCode(c.call(t+"__cyclotomicExp_w0",f,r),c.call(R+"_conjugate",r,r),c.call(t+"__cyclotomicSquare",r,n),c.call(t+"__cyclotomicSquare",n,i),c.call(R+"_mul",i,n,s),c.call(t+"__cyclotomicExp_w0",s,l),c.call(R+"_conjugate",l,l),c.call(t+"__cyclotomicSquare",l,u),c.call(t+"__cyclotomicExp_w0",u,h),c.call(R+"_conjugate",h,h),c.call(R+"_conjugate",s,g),c.call(R+"_conjugate",h,m),c.call(R+"_mul",m,l,x),c.call(R+"_mul",x,g,y),c.call(R+"_mul",y,n,A),c.call(R+"_mul",y,l,v),c.call(R+"_mul",v,f,w),c.call(t+"__frobeniusMap1",A,_),c.call(R+"_mul",_,w,I),c.call(t+"__frobeniusMap2",y,E),c.call(R+"_mul",E,I,C),c.call(R+"_conjugate",f,M),c.call(R+"_mul",M,A,B),c.call(t+"__frobeniusMap3",B,L),c.call(R+"_mul",L,C,d))}e.modules[t]={n64:d,pG1gen:v,pG1zero:_,pG1b:u,pG2gen:E,pG2zero:M,pG2b:g,pq:e.modules.f1m.pq,pr:s,pOneT:B,prePSize:U,preQSize:j,r:f.toString(),q:c.toString()};const $=e.alloc(U),z=e.alloc(j);function G(a){const c=e.addFunction(t+"_pairingEq"+a);for(let e=0;e0n;)da(e)?a.push(1):a.push(0),e>>=1n;return a}(),P=e.alloc(R),D=3*i,O=R.length-1,F=R.reduce(((e,a)=>e+(0!=a?1:0)),0),Q=6*r,U=3*r*2+(F+O+1)*D,j=15132376222941642752n;function H(a){const t=[[[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n]],[[1n,0n],[3850754370037169011952147076051364057158807420970682438676050522613628423219637725072182697113062777891589506424760n,151655185184498381465642749684540099398075398968325446656007613510403227271200139370504932015952886146304766135027n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620351n,0n],[2973677408986561043442465346520108879172042883009249989176415018091420807192182638567116318576472649347015917690530n,1028732146235106349975324479215795277384839936929757896155643118032610843298655225875571310552543014690878354869257n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350n,0n],[3125332594171059424908108096204648978570118281977575435832422631601824034463382777937621250592425535493320683825557n,877076961050607968509681729531255177986764537961432449499635504522207616027455086505066378536590128544573588734230n],[4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559786n,0n],[151655185184498381465642749684540099398075398968325446656007613510403227271200139370504932015952886146304766135027n,3850754370037169011952147076051364057158807420970682438676050522613628423219637725072182697113062777891589506424760n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n,0n],[1028732146235106349975324479215795277384839936929757896155643118032610843298655225875571310552543014690878354869257n,2973677408986561043442465346520108879172042883009249989176415018091420807192182638567116318576472649347015917690530n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939437n,0n],[877076961050607968509681729531255177986764537961432449499635504522207616027455086505066378536590128544573588734230n,3125332594171059424908108096204648978570118281977575435832422631601824034463382777937621250592425535493320683825557n]]],f=[[[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n]],[[1n,0n],[0n,4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350n,0n],[0n,1n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n,0n],[0n,793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350n]],[[1n,0n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939437n,0n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n,0n],[4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559786n,0n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350n,0n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620351n,0n]]],d=e.addFunction(N+"_frobeniusMap"+a);d.addParam("x","i32"),d.addParam("r","i32");const b=d.getCodeBuilder();for(let c=0;c<6;c++){const s=0==c?b.getLocal("x"):b.i32_add(b.getLocal("x"),b.i32_const(c*i)),l=s,u=b.i32_add(b.getLocal("x"),b.i32_const(c*i+n)),p=0==c?b.getLocal("r"):b.i32_add(b.getLocal("r"),b.i32_const(c*i)),g=p,x=b.i32_add(b.getLocal("r"),b.i32_const(c*i+n)),y=o(t[Math.floor(c/3)][a%12],f[c%3][a%6]),A=e.alloc([...Ve.bigInt2BytesLE(v(y[0]),r),...Ve.bigInt2BytesLE(v(y[1]),r)]);a%2==1?d.addCode(b.call(h+"_copy",l,g),b.call(h+"_neg",u,x),b.call(m+"_mul",p,b.i32_const(A),p)):d.addCode(b.call(m+"_mul",s,b.i32_const(A),p))}function o(e,a){const t=e[0],f=e[1],d=a[0],r=a[1],n=[(t*d-f*r)%c,(t*r+f*d)%c];return ra(n[0])&&(n[0]=n[0]+c),n}}e.modules[t]={n64q:d,n64r:o,n8q:r,n8r:s,pG1gen:_,pG1zero:E,pG1b:p,pG2gen:M,pG2zero:k,pG2b:x,pq:e.modules.f1m.pq,pr:u,pOneT:L,r:f,q:c,prePSize:Q,preQSize:U},function(){const a=e.addFunction(T+"_mul1");a.addParam("pA","i32"),a.addParam("pC1","i32"),a.addParam("pR","i32");const t=a.getCodeBuilder(),c=t.getLocal("pA"),f=t.i32_add(t.getLocal("pA"),t.i32_const(2*n)),d=t.i32_add(t.getLocal("pA"),t.i32_const(4*n)),r=t.getLocal("pC1"),i=t.getLocal("pR"),b=t.i32_add(t.getLocal("pR"),t.i32_const(2*n)),o=t.i32_add(t.getLocal("pR"),t.i32_const(4*n)),s=t.i32_const(e.alloc(2*n)),l=t.i32_const(e.alloc(2*n));a.addCode(t.call(m+"_add",c,f,s),t.call(m+"_add",f,d,l),t.call(m+"_mul",f,r,o),t.call(m+"_mul",l,r,i),t.call(m+"_sub",i,o,i),t.call(m+"_mulNR",i,i),t.call(m+"_mul",s,r,b),t.call(m+"_sub",b,o,b))}(),function(){const a=e.addFunction(T+"_mul01");a.addParam("pA","i32"),a.addParam("pC0","i32"),a.addParam("pC1","i32"),a.addParam("pR","i32");const t=a.getCodeBuilder(),c=t.getLocal("pA"),f=t.i32_add(t.getLocal("pA"),t.i32_const(2*n)),d=t.i32_add(t.getLocal("pA"),t.i32_const(4*n)),r=t.getLocal("pC0"),i=t.getLocal("pC1"),b=t.getLocal("pR"),o=t.i32_add(t.getLocal("pR"),t.i32_const(2*n)),s=t.i32_add(t.getLocal("pR"),t.i32_const(4*n)),l=t.i32_const(e.alloc(2*n)),u=t.i32_const(e.alloc(2*n)),h=t.i32_const(e.alloc(2*n)),p=t.i32_const(e.alloc(2*n));a.addCode(t.call(m+"_mul",c,r,l),t.call(m+"_mul",f,i,u),t.call(m+"_add",c,f,h),t.call(m+"_add",c,d,p),t.call(m+"_add",f,d,b),t.call(m+"_mul",b,i,b),t.call(m+"_sub",b,u,b),t.call(m+"_mulNR",b,b),t.call(m+"_add",b,l,b),t.call(m+"_add",r,i,o),t.call(m+"_mul",o,h,o),t.call(m+"_sub",o,l,o),t.call(m+"_sub",o,u,o),t.call(m+"_mul",p,r,s),t.call(m+"_sub",s,l,s),t.call(m+"_add",s,u,s))}(),function(){const a=e.addFunction(N+"_mul014");a.addParam("pA","i32"),a.addParam("pC0","i32"),a.addParam("pC1","i32"),a.addParam("pC4","i32"),a.addParam("pR","i32");const t=a.getCodeBuilder(),c=t.getLocal("pA"),f=t.i32_add(t.getLocal("pA"),t.i32_const(6*n)),d=t.getLocal("pC0"),r=t.getLocal("pC1"),i=t.getLocal("pC4"),b=t.i32_const(e.alloc(6*n)),o=t.i32_const(e.alloc(6*n)),s=t.i32_const(e.alloc(2*n)),l=t.getLocal("pR"),u=t.i32_add(t.getLocal("pR"),t.i32_const(6*n));a.addCode(t.call(T+"_mul01",c,d,r,b),t.call(T+"_mul1",f,i,o),t.call(m+"_add",r,i,s),t.call(T+"_add",f,c,u),t.call(T+"_mul01",u,d,s,u),t.call(T+"_sub",u,b,u),t.call(T+"_sub",u,o,u),t.call(T+"_copy",o,l),t.call(T+"_mulNR",l,l),t.call(T+"_add",l,b,l))}(),function(){const a=e.addFunction(t+"_ell");a.addParam("pP","i32"),a.addParam("pCoefs","i32"),a.addParam("pF","i32");const c=a.getCodeBuilder(),f=c.getLocal("pP"),d=c.i32_add(c.getLocal("pP"),c.i32_const(r)),i=c.getLocal("pF"),b=c.getLocal("pCoefs"),o=c.i32_add(c.getLocal("pCoefs"),c.i32_const(n)),s=c.i32_add(c.getLocal("pCoefs"),c.i32_const(2*n)),l=c.i32_add(c.getLocal("pCoefs"),c.i32_const(3*n)),u=c.i32_add(c.getLocal("pCoefs"),c.i32_const(4*n)),p=e.alloc(2*n),g=c.i32_const(p),m=c.i32_const(p),x=c.i32_const(p+n),y=e.alloc(2*n),A=c.i32_const(y),v=c.i32_const(y),w=c.i32_const(y+n);a.addCode(c.call(h+"_mul",b,d,m),c.call(h+"_mul",o,d,x),c.call(h+"_mul",s,f,v),c.call(h+"_mul",l,f,w),c.call(N+"_mul014",i,u,A,g,i))}();const q=e.alloc(Q),$=e.alloc(U);function z(a){const c=e.addFunction(t+"_pairingEq"+a);for(let e=0;e0n;){if(da(a)){const e=2-Number(a%4n);t.push(e),a-=BigInt(e)}else t.push(0);a>>=1n}return t}(a).map((e=>-1==e?255:e)),r=e.alloc(d),n=e.addFunction(t+"__cyclotomicExp_"+f);n.addParam("x","i32"),n.addParam("r","i32"),n.addLocal("bit","i32"),n.addLocal("i","i32");const i=n.getCodeBuilder(),o=i.getLocal("x"),s=i.getLocal("r"),l=i.i32_const(e.alloc(b));n.addCode(i.call(N+"_conjugate",o,l),i.call(N+"_one",s),i.if(i.teeLocal("bit",i.i32_load8_s(i.i32_const(d.length-1),r)),i.if(i.i32_eq(i.getLocal("bit"),i.i32_const(1)),i.call(N+"_mul",s,o,s),i.call(N+"_mul",s,l,s))),i.setLocal("i",i.i32_const(d.length-2)),i.block(i.loop(i.call(t+"__cyclotomicSquare",s,s),i.if(i.teeLocal("bit",i.i32_load8_s(i.getLocal("i"),r)),i.if(i.i32_eq(i.getLocal("bit"),i.i32_const(1)),i.call(N+"_mul",s,o,s),i.call(N+"_mul",s,l,s))),i.br_if(1,i.i32_eqz(i.getLocal("i"))),i.setLocal("i",i.i32_sub(i.getLocal("i"),i.i32_const(1))),i.br(0)))),c&&n.addCode(i.call(N+"_conjugate",s,s))}(j,!0,"w0");const a=e.addFunction(t+"_finalExponentiation");a.addParam("x","i32"),a.addParam("r","i32");const c=a.getCodeBuilder(),f=c.getLocal("x"),d=c.getLocal("r"),r=c.i32_const(e.alloc(b)),n=c.i32_const(e.alloc(b)),o=c.i32_const(e.alloc(b)),s=c.i32_const(e.alloc(b)),l=c.i32_const(e.alloc(b)),u=c.i32_const(e.alloc(b)),h=c.i32_const(e.alloc(b));a.addCode(c.call(N+"_frobeniusMap6",f,r),c.call(N+"_inverse",f,n),c.call(N+"_mul",r,n,o),c.call(N+"_copy",o,n),c.call(N+"_frobeniusMap2",o,o),c.call(N+"_mul",o,n,o),c.call(t+"__cyclotomicSquare",o,n),c.call(N+"_conjugate",n,n),c.call(t+"__cyclotomicExp_w0",o,s),c.call(t+"__cyclotomicSquare",s,l),c.call(N+"_mul",n,s,u),c.call(t+"__cyclotomicExp_w0",u,n),c.call(t+"__cyclotomicExp_w0",n,r),c.call(t+"__cyclotomicExp_w0",r,h),c.call(N+"_mul",h,l,h),c.call(t+"__cyclotomicExp_w0",h,l),c.call(N+"_conjugate",u,u),c.call(N+"_mul",l,u,l),c.call(N+"_mul",l,o,l),c.call(N+"_conjugate",o,u),c.call(N+"_mul",n,o,n),c.call(N+"_frobeniusMap3",n,n),c.call(N+"_mul",h,u,h),c.call(N+"_frobeniusMap1",h,h),c.call(N+"_mul",s,r,s),c.call(N+"_frobeniusMap2",s,s),c.call(N+"_mul",s,n,s),c.call(N+"_mul",s,h,s),c.call(N+"_mul",s,l,d))}();for(let a=1;a<=5;a++)z(a),e.exportFunction(t+"_pairingEq"+a);!function(){const a=e.addFunction(t+"_pairing");a.addParam("p","i32"),a.addParam("q","i32"),a.addParam("r","i32");const c=a.getCodeBuilder(),f=c.i32_const(e.alloc(b));a.addCode(c.call(t+"_prepareG1",c.getLocal("p"),c.i32_const(q))),a.addCode(c.call(t+"_prepareG2",c.getLocal("q"),c.i32_const($))),a.addCode(c.call(t+"_millerLoop",c.i32_const(q),c.i32_const($),f)),a.addCode(c.call(t+"_finalExponentiation",f,c.getLocal("r")))}(),e.exportFunction(t+"_pairing"),e.exportFunction(t+"_prepareG1"),e.exportFunction(t+"_prepareG2"),e.exportFunction(t+"_millerLoop"),e.exportFunction(t+"_finalExponentiation"),e.exportFunction(t+"_finalExponentiationOld"),e.exportFunction(t+"__cyclotomicSquare"),e.exportFunction(t+"__cyclotomicExp_w0"),e.exportFunction(T+"_mul1"),e.exportFunction(T+"_mul01"),e.exportFunction(N+"_mul014"),e.exportFunction(g+"_inGroupAffine"),e.exportFunction(g+"_inGroup"),e.exportFunction(y+"_inGroupAffine"),e.exportFunction(y+"_inGroup")};function ba(e,a){let t=e;void 0===a&&0==(a=Math.floor((r(e)-1)/8)+1)&&(a=1);const c=new Uint8Array(a),f=new DataView(c.buffer);let d=0;for(;d>=BigInt(32)):d+2<=a?(f.setUint16(d,Number(t&BigInt(65535)),!0),d+=2,t>>=BigInt(16)):(f.setUint8(d,Number(t&BigInt(255)),!0),d+=1,t>>=BigInt(8));if(t)throw new Error("Number does not fit in this length");return c}const oa=[];for(let e=0;e<256;e++)oa[e]=sa(e,8);function sa(e,a){let t=0,c=e;for(let e=0;e>=1;return t}function la(e,a){return(oa[e>>>24]|oa[e>>>16&255]<<8|oa[e>>>8&255]<<16|oa[255&e]<<24)>>>32-a}function ua(e){return(4294901760&e?(e&=4294901760,16):0)|(4278255360&e?(e&=4278255360,8):0)|(4042322160&e?(e&=4042322160,4):0)|(3435973836&e?(e&=3435973836,2):0)|!!(2863311530&e)}function ha(e,a){const t=e.byteLength/a,c=ua(t);if(t!=1<t){const c=e.slice(f*a,(f+1)*a);e.set(e.slice(t*a,(t+1)*a),f*a),e.set(c,t*a)}}}function pa(e,a){const t=new Uint8Array(a*e.length);for(let c=0;c0;)t>=4?(t-=4,a+=BigInt(f.getUint32(t))<=2?(t-=2,a+=BigInt(f.getUint16(t))<0;)d-4>=0?(d-=4,f.setUint32(d,Number(t&BigInt(4294967295))),t>>=BigInt(32)):d-2>=0?(d-=2,f.setUint16(d,Number(t&BigInt(65535))),t>>=BigInt(16)):(d-=1,f.setUint8(d,Number(t&BigInt(255))),t>>=BigInt(8));if(t)throw new Error("Number does not fit in this length");return c},bitReverse:la,buffReverseBits:ha,buffer2array:ga,leBuff2int:function(e){let a=BigInt(0),t=0;const c=new DataView(e.buffer,e.byteOffset,e.byteLength);for(;t{t[c]=e(a[c])})),t}return a},stringifyFElements:function e(a,t){if("bigint"==typeof t||void 0!==t.eq)return t.toString(10);if(t instanceof Uint8Array)return a.toString(a.e(t));if(Array.isArray(t))return t.map(e.bind(this,a));if("object"==typeof t){const c={};return Object.keys(t).forEach((f=>{c[f]=e(a,t[f])})),c}return t},unstringifyBigInts:function e(a){if("string"==typeof a&&/^[0-9]+$/.test(a))return BigInt(a);if("string"==typeof a&&/^0x[0-9a-fA-F]+$/.test(a))return BigInt(a);if(Array.isArray(a))return a.map(e);if("object"==typeof a){if(null===a)return null;const t={};return Object.keys(a).forEach((c=>{t[c]=e(a[c])})),t}return a},unstringifyFElements:function e(a,t){if("string"==typeof t&&/^[0-9]+$/.test(t))return a.e(t);if("string"==typeof t&&/^0x[0-9a-fA-F]+$/.test(t))return a.e(t);if(Array.isArray(t))return t.map(e.bind(this,a));if("object"==typeof t){if(null===t)return null;const c={};return Object.keys(t).forEach((f=>{c[f]=e(a,t[f])})),c}return t}});const xa=1<<30;class ya{constructor(e){this.buffers=[],this.byteLength=e;for(let a=0;a0;){const e=r+n>xa?xa-r:n,a=new Uint8Array(this.buffers[d].buffer,this.buffers[d].byteOffset+r,e);if(e==t)return a.slice();f||(f=t<=xa?new Uint8Array(t):new ya(t)),f.set(a,t-n),n-=e,d++,r=0}return f}set(e,a){void 0===a&&(a=0);const t=e.byteLength;if(0==t)return;const c=Math.floor(a/xa);if(c==Math.floor((a+t-1)/xa))return e instanceof ya&&1==e.buffers.length?this.buffers[c].set(e.buffers[0],a%xa):this.buffers[c].set(e,a%xa);let f=c,d=a%xa,r=t;for(;r>0;){const a=d+r>xa?xa-d:r,c=e.slice(t-r,t-r+a);new Uint8Array(this.buffers[f].buffer,this.buffers[f].byteOffset+d,a).set(c),r-=a,f++,d=0}}}function Aa(e,a,t,c){return async function(f){const d=Math.floor(f.byteLength/t);if(d*t!==f.byteLength)throw new Error("Invalid buffer size");const r=Math.floor(d/e.concurrency),n=[];for(let i=0;i=0;e--)this.w[e]=this.square(this.w[e+1]);if(!this.eq(this.w[0],this.one))throw new Error("Error calculating roots of unity");this.batchToMontgomery=Aa(e,a+"_batchToMontgomery",this.n8,this.n8),this.batchFromMontgomery=Aa(e,a+"_batchFromMontgomery",this.n8,this.n8)}op2(e,a,t){return this.tm.setBuff(this.pOp1,a),this.tm.setBuff(this.pOp2,t),this.tm.instance.exports[this.prefix+e](this.pOp1,this.pOp2,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}op2Bool(e,a,t){return this.tm.setBuff(this.pOp1,a),this.tm.setBuff(this.pOp2,t),!!this.tm.instance.exports[this.prefix+e](this.pOp1,this.pOp2)}op1(e,a){return this.tm.setBuff(this.pOp1,a),this.tm.instance.exports[this.prefix+e](this.pOp1,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}op1Bool(e,a){return this.tm.setBuff(this.pOp1,a),!!this.tm.instance.exports[this.prefix+e](this.pOp1,this.pOp3)}add(e,a){return this.op2("_add",e,a)}eq(e,a){return this.op2Bool("_eq",e,a)}isZero(e){return this.op1Bool("_isZero",e)}sub(e,a){return this.op2("_sub",e,a)}neg(e){return this.op1("_neg",e)}inv(e){return this.op1("_inverse",e)}toMontgomery(e){return this.op1("_toMontgomery",e)}fromMontgomery(e){return this.op1("_fromMontgomery",e)}mul(e,a){return this.op2("_mul",e,a)}div(e,a){return this.tm.setBuff(this.pOp1,e),this.tm.setBuff(this.pOp2,a),this.tm.instance.exports[this.prefix+"_inverse"](this.pOp2,this.pOp2),this.tm.instance.exports[this.prefix+"_mul"](this.pOp1,this.pOp2,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}square(e){return this.op1("_square",e)}isSquare(e){return this.op1Bool("_isSquare",e)}sqrt(e){return this.op1("_sqrt",e)}exp(e,a){return a instanceof Uint8Array||(a=E(d(a))),this.tm.setBuff(this.pOp1,e),this.tm.setBuff(this.pOp2,a),this.tm.instance.exports[this.prefix+"_exp"](this.pOp1,this.pOp2,a.byteLength,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}isNegative(e){return this.op1Bool("_isNegative",e)}e(e,a){if(e instanceof Uint8Array)return e;let t=d(e,a);n(t)?(t=g(t),y(t,this.p)&&(t=x(t,this.p)),t=p(this.p,t)):y(t,this.p)&&(t=x(t,this.p));const c=ba(t,this.n8);return this.toMontgomery(c)}toString(e,a){return I(_(this.fromMontgomery(e),0),a)}fromRng(e){let a;const t=new Uint8Array(this.n8);do{a=C;for(let t=0;t{this.reject=a,this.resolve=e}))}}const Ba="data:application/javascript;base64,"+globalThis.btoa('(function thread(self) {\n const MAXMEM = 32767;\n let instance;\n let memory;\n\n if (self) {\n self.onmessage = function(e) {\n let data;\n if (e.data) {\n data = e.data;\n } else {\n data = e;\n }\n\n if (data[0].cmd == "INIT") {\n init(data[0]).then(function() {\n self.postMessage(data.result);\n });\n } else if (data[0].cmd == "TERMINATE") {\n self.close();\n } else {\n const res = runTask(data);\n self.postMessage(res);\n }\n };\n }\n\n async function init(data) {\n const code = new Uint8Array(data.code);\n const wasmModule = await WebAssembly.compile(code);\n memory = new WebAssembly.Memory({initial:data.init, maximum: MAXMEM});\n\n instance = await WebAssembly.instantiate(wasmModule, {\n env: {\n "memory": memory\n }\n });\n }\n\n\n\n function alloc(length) {\n const u32 = new Uint32Array(memory.buffer, 0, 1);\n while (u32[0] & 3) u32[0]++; // Return always aligned pointers\n const res = u32[0];\n u32[0] += length;\n if (u32[0] + length > memory.buffer.byteLength) {\n const currentPages = memory.buffer.byteLength / 0x10000;\n let requiredPages = Math.floor((u32[0] + length) / 0x10000)+1;\n if (requiredPages>MAXMEM) requiredPages=MAXMEM;\n memory.grow(requiredPages-currentPages);\n }\n return res;\n }\n\n function allocBuffer(buffer) {\n const p = alloc(buffer.byteLength);\n setBuffer(p, buffer);\n return p;\n }\n\n function getBuffer(pointer, length) {\n const u8 = new Uint8Array(memory.buffer);\n return new Uint8Array(u8.buffer, u8.byteOffset + pointer, length);\n }\n\n function setBuffer(pointer, buffer) {\n const u8 = new Uint8Array(memory.buffer);\n u8.set(new Uint8Array(buffer), pointer);\n }\n\n function runTask(task) {\n if (task[0].cmd == "INIT") {\n return init(task[0]);\n }\n const ctx = {\n vars: [],\n out: []\n };\n const u32a = new Uint32Array(memory.buffer, 0, 1);\n const oldAlloc = u32a[0];\n for (let i=0; i0;e++)if(0==this.working[e]){const a=this.actionQueue.shift();this.postAction(e,a.data,a.transfers,a.deferred)}}queueAction(e,a){const t=new Ma;if(this.singleThread){const a=this.taskManager(e);t.resolve(a)}else this.actionQueue.push({data:e,transfers:a,deferred:t}),this.processWorks();return t.promise}resetMemory(){this.u32[0]=this.initalPFree}allocBuff(e){const a=this.alloc(e.byteLength);return this.setBuff(a,e),a}getBuff(e,a){return this.u8.slice(e,e+a)}setBuff(e,a){this.u8.set(new Uint8Array(a),e)}alloc(e){for(;3&this.u32[0];)this.u32[0]++;const a=this.u32[0];return this.u32[0]+=e,a}async terminate(){for(let e=0;esetTimeout(e,200)))}}function La(e,a){const t=e[a],c=e.Fr,f=e.tm;e[a].batchApplyKey=async function(e,d,r,n,i){let b,o,s,l,u;if(n=n||"affine",i=i||"affine","G1"==a)"jacobian"==n?(s=3*t.F.n8,b="g1m_batchApplyKey"):(s=2*t.F.n8,b="g1m_batchApplyKeyMixed"),l=3*t.F.n8,"jacobian"==i?u=3*t.F.n8:(o="g1m_batchToAffine",u=2*t.F.n8);else if("G2"==a)"jacobian"==n?(s=3*t.F.n8,b="g2m_batchApplyKey"):(s=2*t.F.n8,b="g2m_batchApplyKeyMixed"),l=3*t.F.n8,"jacobian"==i?u=3*t.F.n8:(o="g2m_batchToAffine",u=2*t.F.n8);else{if("Fr"!=a)throw new Error("Invalid group: "+a);b="frm_batchApplyKey",s=t.n8,l=t.n8,u=t.n8}const h=Math.floor(e.byteLength/s),p=Math.floor(h/f.concurrency),g=[];r=c.e(r);let m=c.e(d);for(let a=0;a=0;e--){if(!t.isZero(p))for(let e=0;eb&&(p=b),p<1024&&(p=1024);const g=[];for(let a=0;a(n&&n.debug(`Multiexp end: ${i}: ${a}/${s}`),e))))}const m=await Promise.all(g);let x=t.zero;for(let e=m.length-1;e>=0;e--)x=t.add(x,m[e]);return x}t.multiExp=async function(e,a,t,c){return await d(e,a,"jacobian",t,c)},t.multiExpAffine=async function(e,a,t,c){return await d(e,a,"affine",t,c)}}function Na(e,a){const t=e[a],c=e.Fr,f=t.tm;async function d(e,n,i,b,o,s){let l,u,h,p,g,m,x,y;i=i||"affine",b=b||"affine","G1"==a?("affine"==i?(l=2*t.F.n8,p="g1m_batchToJacobian"):l=3*t.F.n8,u=3*t.F.n8,n&&(y="g1m_fftFinal"),x="g1m_fftJoin",m="g1m_fftMix","affine"==b?(h=2*t.F.n8,g="g1m_batchToAffine"):h=3*t.F.n8):"G2"==a?("affine"==i?(l=2*t.F.n8,p="g2m_batchToJacobian"):l=3*t.F.n8,u=3*t.F.n8,n&&(y="g2m_fftFinal"),x="g2m_fftJoin",m="g2m_fftMix","affine"==b?(h=2*t.F.n8,g="g2m_batchToAffine"):h=3*t.F.n8):"Fr"==a&&(l=t.n8,u=t.n8,h=t.n8,n&&(y="frm_fftFinal"),m="frm_fftMix",x="frm_fftJoin");let A=!1;Array.isArray(e)?(e=pa(e,l),A=!0):e=e.slice(0,e.byteLength);const v=e.byteLength/l,w=ua(v);if(1<1<<28?new ya(2*s[0].byteLength):new Uint8Array(2*s[0].byteLength),l.set(s[0]),l.set(s[1],s[0].byteLength),l}(e,i,b,o,s):await async function(e,a,t,f,n){let i,b;i=e.slice(0,e.byteLength/2),b=e.slice(e.byteLength/2,e.byteLength);const o=[];[i,b]=await r(i,b,"fftJoinExt",c.one,c.shift,a,"jacobian",f,n),o.push(d(i,!1,"jacobian",t,f,n)),o.push(d(b,!1,"jacobian",t,f,n));const s=await Promise.all(o);let l;return l=s[0].byteLength>1<<28?new ya(2*s[0].byteLength):new Uint8Array(2*s[0].byteLength),l.set(s[0]),l.set(s[1],s[0].byteLength),l}(e,i,b,o,s),A?ga(a,h):a}let _,I,E;n&&(_=c.inv(c.e(v))),ha(e,l);let C=Math.min(16384,v),M=v/C;for(;M=16;)M*=2,C/=2;const B=ua(C),k=[];for(let a=0;a(o&&o.debug(`${s}: fft ${w} mix end: ${a}/${M}`),e))))}E=await Promise.all(k);for(let e=0;e(o&&o.debug(`${s}: fft ${w} join ${e}/${w} ${r+1}/${a} ${n}/${t/2}`),c))))}const r=await Promise.all(d);for(let e=0;e0;a--)I.set(E[a],e),e+=C*h,delete E[a];I.set(E[0].slice(0,(C-1)*h),e),delete E[0]}else for(let e=0;e65536&&(A=65536);const v=[];for(let a=0;a(s&&s.debug(`${l}: fftJoinExt End: ${a}/${y}`),e))))}const w=await Promise.all(v);let _,I;y*g>1<<28?(_=new ya(y*g),I=new ya(y*g)):(_=new Uint8Array(y*g),I=new Uint8Array(y*g));let E=0;for(let e=0;ec.s+1)throw i&&i.error("lagrangeEvaluations input too big"),new Error("lagrangeEvaluations input too big");let u=e.slice(0,e.byteLength/2),h=e.slice(e.byteLength/2,e.byteLength);const p=c.exp(c.shift,s/2),g=c.inv(c.sub(c.one,p));[u,h]=await r(u,h,"prepareLagrangeEvaluation",g,c.shiftInv,f,"jacobian",i,b+" prep");const m=[];let x;return m.push(d(u,!0,"jacobian",n,i,b+" t0")),m.push(d(h,!0,"jacobian",n,i,b+" t1")),[u,h]=await Promise.all(m),x=u.byteLength>1<<28?new ya(2*u.byteLength):new Uint8Array(2*u.byteLength),x.set(u),x.set(h,u.byteLength),x},t.fftMix=async function(e){const d=3*t.F.n8;let r,n;if("G1"==a)r="g1m_fftMix",n="g1m_fftJoin";else if("G2"==a)r="g2m_fftMix",n="g2m_fftJoin";else{if("Fr"!=a)throw new Error("Invalid group");r="frm_fftMix",n="frm_fftJoin"}const i=Math.floor(e.byteLength/d),b=ua(i);let o=1<=0;e--)u.set(l[e][0],h),h+=l[e][0].byteLength;return u}}async function Ra(e){const a=await async function(e,a){const t=new ka;t.memory=new WebAssembly.Memory({initial:Ca}),t.u8=new Uint8Array(t.memory.buffer),t.u32=new Uint32Array(t.memory.buffer);const c=await WebAssembly.compile(e.code);if(t.instance=await WebAssembly.instantiate(c,{env:{memory:t.memory}}),t.singleThread=a,t.initalPFree=t.u32[0],t.pq=e.pq,t.pr=e.pr,t.pG1gen=e.pG1gen,t.pG1zero=e.pG1zero,t.pG2gen=e.pG2gen,t.pG2zero=e.pG2zero,t.pOneT=e.pOneT,a)t.code=e.code,t.taskManager=function(){const e=32767;let a,t;async function c(c){const f=new Uint8Array(c.code),d=await WebAssembly.compile(f);t=new WebAssembly.Memory({initial:c.init,maximum:e}),a=await WebAssembly.instantiate(d,{env:{memory:t}})}function f(a){const c=new Uint32Array(t.buffer,0,1);for(;3&c[0];)c[0]++;const f=c[0];if(c[0]+=a,c[0]+a>t.buffer.byteLength){const f=t.buffer.byteLength/65536;let d=Math.floor((c[0]+a)/65536)+1;d>e&&(d=e),t.grow(d-f)}return f}function d(e){const a=f(e.byteLength);return n(a,e),a}function r(e,a){const c=new Uint8Array(t.buffer);return new Uint8Array(c.buffer,c.byteOffset+e,a)}function n(e,a){new Uint8Array(t.buffer).set(new Uint8Array(a),e)}function i(e){if("INIT"==e[0].cmd)return c(e[0]);const i={vars:[],out:[]},b=new Uint32Array(t.buffer,0,1)[0];for(let t=0;t64&&(a=64),t.concurrency=a;for(let e=0;e>8n&0xFFn)),a.push(Number(t>>16n&0xFFn)),a.push(Number(t>>24n&0xFFn)),a}function Qa(e){const a=function(e){for(var a=[],t=0;t>6,128|63&c):c<55296||c>=57344?a.push(224|c>>12,128|c>>6&63,128|63&c):(t++,c=65536+((1023&c)<<10|1023&e.charCodeAt(t)),a.push(240|c>>18,128|c>>12&63,128|c>>6&63,128|63&c))}return a}(e);return[...$a(a.length),...a]}function Ua(e){const a=[];let t=Pa(e);if(Da(t))throw new Error("Number cannot be negative");for(;!Oa(t);)a.push(Number(0x7Fn&t)),t>>=7n;0==a.length&&a.push(0);for(let e=0;e0xFFFFFFFFn)throw new Error("Number too big");if(a>0x7FFFFFFFn&&(a-=0x100000000n),a<-2147483648n)throw new Error("Number too small");return ja(a)}function qa(e){let a=Pa(e);if(a>0xFFFFFFFFFFFFFFFFn)throw new Error("Number too big");if(a>0x7FFFFFFFFFFFFFFFn&&(a-=0x10000000000000000n),a<-9223372036854775808n)throw new Error("Number too small");return ja(a)}function $a(e){let a=Pa(e);if(a>0xFFFFFFFFn)throw new Error("Number too big");return Ua(a)}function za(e){return Array.from(e,(function(e){return("0"+(255&e).toString(16)).slice(-2)})).join("")}class Ga{constructor(e){this.func=e,this.functionName=e.functionName,this.module=e.module}setLocal(e,a){const t=this.func.localIdxByName[e];if(void 0===t)throw new Error(`Local Variable not defined: Function: ${this.functionName} local: ${e} `);return[...a,33,...$a(t)]}teeLocal(e,a){const t=this.func.localIdxByName[e];if(void 0===t)throw new Error(`Local Variable not defined: Function: ${this.functionName} local: ${e} `);return[...a,34,...$a(t)]}getLocal(e){const a=this.func.localIdxByName[e];if(void 0===a)throw new Error(`Local Variable not defined: Function: ${this.functionName} local: ${e} `);return[32,...$a(a)]}i64_load8_s(e,a,t){return[...e,48,void 0===t?0:t,...$a(a||0)]}i64_load8_u(e,a,t){return[...e,49,void 0===t?0:t,...$a(a||0)]}i64_load16_s(e,a,t){return[...e,50,void 0===t?1:t,...$a(a||0)]}i64_load16_u(e,a,t){return[...e,51,void 0===t?1:t,...$a(a||0)]}i64_load32_s(e,a,t){return[...e,52,void 0===t?2:t,...$a(a||0)]}i64_load32_u(e,a,t){return[...e,53,void 0===t?2:t,...$a(a||0)]}i64_load(e,a,t){return[...e,41,void 0===t?3:t,...$a(a||0)]}i64_store(e,a,t,c){let f,d,r;return Array.isArray(a)?(f=0,d=3,r=a):Array.isArray(t)?(f=a,d=3,r=t):Array.isArray(c)&&(f=a,d=t,r=c),[...e,...r,55,d,...$a(f)]}i64_store32(e,a,t,c){let f,d,r;return Array.isArray(a)?(f=0,d=2,r=a):Array.isArray(t)?(f=a,d=2,r=t):Array.isArray(c)&&(f=a,d=t,r=c),[...e,...r,62,d,...$a(f)]}i64_store16(e,a,t,c){let f,d,r;return Array.isArray(a)?(f=0,d=1,r=a):Array.isArray(t)?(f=a,d=1,r=t):Array.isArray(c)&&(f=a,d=t,r=c),[...e,...r,61,d,...$a(f)]}i64_store8(e,a,t,c){let f,d,r;return Array.isArray(a)?(f=0,d=0,r=a):Array.isArray(t)?(f=a,d=0,r=t):Array.isArray(c)&&(f=a,d=t,r=c),[...e,...r,60,d,...$a(f)]}i32_load8_s(e,a,t){return[...e,44,void 0===t?0:t,...$a(a||0)]}i32_load8_u(e,a,t){return[...e,45,void 0===t?0:t,...$a(a||0)]}i32_load16_s(e,a,t){return[...e,46,void 0===t?1:t,...$a(a||0)]}i32_load16_u(e,a,t){return[...e,47,void 0===t?1:t,...$a(a||0)]}i32_load(e,a,t){return[...e,40,void 0===t?2:t,...$a(a||0)]}i32_store(e,a,t,c){let f,d,r;return Array.isArray(a)?(f=0,d=2,r=a):Array.isArray(t)?(f=a,d=2,r=t):Array.isArray(c)&&(f=a,d=t,r=c),[...e,...r,54,d,...$a(f)]}i32_store16(e,a,t,c){let f,d,r;return Array.isArray(a)?(f=0,d=1,r=a):Array.isArray(t)?(f=a,d=1,r=t):Array.isArray(c)&&(f=a,d=t,r=c),[...e,...r,59,d,...$a(f)]}i32_store8(e,a,t,c){let f,d,r;return Array.isArray(a)?(f=0,d=0,r=a):Array.isArray(t)?(f=a,d=0,r=t):Array.isArray(c)&&(f=a,d=t,r=c),[...e,...r,58,d,...$a(f)]}call(e,...a){const t=this.module.functionIdxByName[e];if(void 0===t)throw new Error(`Function not defined: Function: ${e}`);return[...[].concat(...a),16,...$a(t)]}call_indirect(e,...a){return[...[].concat(...a),...e,17,0,0]}if(e,a,t){return t?[...e,4,64,...a,5,...t,11]:[...e,4,64,...a,11]}block(e){return[2,64,...e,11]}loop(...e){return[3,64,...[].concat(...e),11]}br_if(e,a){return[...a,13,...$a(e)]}br(e){return[12,...$a(e)]}ret(e){return[...e,15]}drop(e){return[...e,26]}i64_const(e){return[66,...qa(e)]}i32_const(e){return[65,...Ha(e)]}i64_eqz(e){return[...e,80]}i64_eq(e,a){return[...e,...a,81]}i64_ne(e,a){return[...e,...a,82]}i64_lt_s(e,a){return[...e,...a,83]}i64_lt_u(e,a){return[...e,...a,84]}i64_gt_s(e,a){return[...e,...a,85]}i64_gt_u(e,a){return[...e,...a,86]}i64_le_s(e,a){return[...e,...a,87]}i64_le_u(e,a){return[...e,...a,88]}i64_ge_s(e,a){return[...e,...a,89]}i64_ge_u(e,a){return[...e,...a,90]}i64_add(e,a){return[...e,...a,124]}i64_sub(e,a){return[...e,...a,125]}i64_mul(e,a){return[...e,...a,126]}i64_div_s(e,a){return[...e,...a,127]}i64_div_u(e,a){return[...e,...a,128]}i64_rem_s(e,a){return[...e,...a,129]}i64_rem_u(e,a){return[...e,...a,130]}i64_and(e,a){return[...e,...a,131]}i64_or(e,a){return[...e,...a,132]}i64_xor(e,a){return[...e,...a,133]}i64_shl(e,a){return[...e,...a,134]}i64_shr_s(e,a){return[...e,...a,135]}i64_shr_u(e,a){return[...e,...a,136]}i64_extend_i32_s(e){return[...e,172]}i64_extend_i32_u(e){return[...e,173]}i64_clz(e){return[...e,121]}i64_ctz(e){return[...e,122]}i32_eqz(e){return[...e,69]}i32_eq(e,a){return[...e,...a,70]}i32_ne(e,a){return[...e,...a,71]}i32_lt_s(e,a){return[...e,...a,72]}i32_lt_u(e,a){return[...e,...a,73]}i32_gt_s(e,a){return[...e,...a,74]}i32_gt_u(e,a){return[...e,...a,75]}i32_le_s(e,a){return[...e,...a,76]}i32_le_u(e,a){return[...e,...a,77]}i32_ge_s(e,a){return[...e,...a,78]}i32_ge_u(e,a){return[...e,...a,79]}i32_add(e,a){return[...e,...a,106]}i32_sub(e,a){return[...e,...a,107]}i32_mul(e,a){return[...e,...a,108]}i32_div_s(e,a){return[...e,...a,109]}i32_div_u(e,a){return[...e,...a,110]}i32_rem_s(e,a){return[...e,...a,111]}i32_rem_u(e,a){return[...e,...a,112]}i32_and(e,a){return[...e,...a,113]}i32_or(e,a){return[...e,...a,114]}i32_xor(e,a){return[...e,...a,115]}i32_shl(e,a){return[...e,...a,116]}i32_shr_s(e,a){return[...e,...a,117]}i32_shr_u(e,a){return[...e,...a,118]}i32_rotl(e,a){return[...e,...a,119]}i32_rotr(e,a){return[...e,...a,120]}i32_wrap_i64(e){return[...e,167]}i32_clz(e){return[...e,103]}i32_ctz(e){return[...e,104]}unreachable(){return[0]}current_memory(){return[63,0]}comment(){return[]}}const Ka={i32:127,i64:126,f32:125,f64:124,anyfunc:112,func:96,emptyblock:64};class Va{constructor(e,a,t,c,f){if("import"==t)this.fnType="import",this.moduleName=c,this.fieldName=f;else{if("internal"!=t)throw new Error("Invalid function fnType: "+t);this.fnType="internal"}this.module=e,this.fnName=a,this.params=[],this.locals=[],this.localIdxByName={},this.code=[],this.returnType=null,this.nextLocal=0}addParam(e,a){if(this.localIdxByName[e])throw new Error(`param already exists. Function: ${this.fnName}, Param: ${e} `);const t=this.nextLocal++;this.localIdxByName[e]=t,this.params.push({type:a})}addLocal(e,a,t){const c=t||1;if(this.localIdxByName[e])throw new Error(`local already exists. Function: ${this.fnName}, Param: ${e} `);const f=this.nextLocal++;this.localIdxByName[e]=f,this.locals.push({type:a,length:c})}setReturnType(e){if(this.returnType)throw new Error(`returnType already defined. Function: ${this.fnName}`);this.returnType=e}getSignature(){return[96,...$a(this.params.length),...this.params.map((e=>Ka[e.type])),...this.returnType?[1,Ka[this.returnType]]:[0]]}getBody(){const e=this.locals.map((e=>[...$a(e.length),Ka[e.type]])),a=[...$a(this.locals.length),...[].concat(...e),...this.code,11];return[...$a(a.length),...a]}addCode(...e){this.code.push(...[].concat(...e))}getCodeBuilder(){return new Ga(this)}}class Za{constructor(){this.functions=[],this.functionIdxByName={},this.nImportFunctions=0,this.nInternalFunctions=0,this.memory={pagesSize:1,moduleName:"env",fieldName:"memory"},this.free=8,this.datas=[],this.modules={},this.exports=[],this.functionsTable=[]}build(){return this._setSignatures(),new Uint8Array([...Fa(1836278016),...Fa(1),...this._buildType(),...this._buildImport(),...this._buildFunctionDeclarations(),...this._buildFunctionsTable(),...this._buildExports(),...this._buildElements(),...this._buildCode(),...this._buildData()])}addFunction(e){if(void 0!==this.functionIdxByName[e])throw new Error(`Function already defined: ${e}`);const a=this.functions.length;return this.functionIdxByName[e]=a,this.functions.push(new Va(this,e,"internal")),this.nInternalFunctions++,this.functions[a]}addIimportFunction(e,a,t){if(void 0!==this.functionIdxByName[e])throw new Error(`Function already defined: ${e}`);if(this.functions.length>0&&"internal"==this.functions[this.functions.length-1].type)throw new Error(`Import functions must be declared before internal: ${e}`);let c=t||e;const f=this.functions.length;return this.functionIdxByName[e]=f,this.functions.push(new Va(this,e,"import",a,c)),this.nImportFunctions++,this.functions[f]}setMemory(e,a,t){this.memory={pagesSize:e,moduleName:a||"env",fieldName:t||"memory"}}exportFunction(e,a){const t=a||e;if(void 0===this.functionIdxByName[e])throw new Error(`Function not defined: ${e}`);const c=this.functionIdxByName[e];t!=e&&(this.functionIdxByName[t]=c),this.exports.push({exportName:t,idx:c})}addFunctionToTable(e){const a=this.functionIdxByName[e];this.functionsTable.push(a)}addData(e,a){this.datas.push({offset:e,bytes:a})}alloc(e,a){let t,c;(Array.isArray(e)||ArrayBuffer.isView(e))&&void 0===a?(t=e.length,c=e):(t=e,c=a),t=1+(t-1>>3)<<3;const f=this.free;return this.free+=t,c&&this.addData(f,c),f}allocString(e){const a=(new globalThis.TextEncoder).encode(e);return this.alloc([...a,0])}_setSignatures(){this.signatures=[];const e={};if(this.functionsTable.length>0){const a=this.functions[this.functionsTable[0]].getSignature();e["s_"+za(a)]=0,this.signatures.push(a)}for(let a=0;a=0)c=await async function(e,a){if(!e&&globalThis.curve_bn128)return globalThis.curve_bn128;const t=new Za;t.setMemory(25),na(t),a&&a(t);const c={};c.code=t.build(),c.pq=t.modules.f1m.pq,c.pr=t.modules.frm.pq,c.pG1gen=t.modules.bn128.pG1gen,c.pG1zero=t.modules.bn128.pG1zero,c.pG1b=t.modules.bn128.pG1b,c.pG2gen=t.modules.bn128.pG2gen,c.pG2zero=t.modules.bn128.pG2zero,c.pG2b=t.modules.bn128.pG2b,c.pOneT=t.modules.bn128.pOneT,c.prePSize=t.modules.bn128.prePSize,c.preQSize=t.modules.bn128.preQSize,c.n8q=32,c.n8r=32,c.q=t.modules.bn128.q,c.r=t.modules.bn128.r;const f={name:"bn128",wasm:c,q:d("21888242871839275222246405745257275088696311157297823662689037894645226208583"),r:d("21888242871839275222246405745257275088548364400416034343698204186575808495617"),n8q:32,n8r:32,cofactorG2:d("30644e72e131a029b85045b68181585e06ceecda572a2489345f2299c0f9fa8d",16),singleThread:!!e},r=await Ra(f);return r.terminate=async function(){f.singleThread||(globalThis.curve_bn128=null,await this.tm.terminate())},e||(globalThis.curve_bn128=r),r}(a,t);else{if(!(["BLS12381"].indexOf(f)>=0))throw new Error(`Curve not supported: ${e}`);c=await async function(e,a){if(!e&&globalThis.curve_bls12381)return globalThis.curve_bls12381;const t=new Za;t.setMemory(25),ia(t),a&&a(t);const c={};c.code=t.build(),c.pq=t.modules.f1m.pq,c.pr=t.modules.frm.pq,c.pG1gen=t.modules.bls12381.pG1gen,c.pG1zero=t.modules.bls12381.pG1zero,c.pG1b=t.modules.bls12381.pG1b,c.pG2gen=t.modules.bls12381.pG2gen,c.pG2zero=t.modules.bls12381.pG2zero,c.pG2b=t.modules.bls12381.pG2b,c.pOneT=t.modules.bls12381.pOneT,c.prePSize=t.modules.bls12381.prePSize,c.preQSize=t.modules.bls12381.preQSize,c.n8q=48,c.n8r=32,c.q=t.modules.bls12381.q,c.r=t.modules.bls12381.r;const f={name:"bls12381",wasm:c,q:d("1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab",16),r:d("73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001",16),n8q:48,n8r:32,cofactorG1:d("0x396c8c005555e1568c00aaab0000aaab",16),cofactorG2:d("0x5d543a95414e7f1091d50792876a202cd91de4547085abaa68a205b2e5a7ddfa628f1cb4d9e82ef21537e293a6691ae1616ec6e786f0c70cf1c38e31c7238e5",16),singleThread:!!e},r=await Ra(f);return r.terminate=async function(){f.singleThread||(globalThis.curve_bls12381=null,await this.tm.terminate())},e||(globalThis.curve_bls12381=r),r}(a,t)}return c}globalThis.curve_bn128=null,globalThis.curve_bls12381=null,d("73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001",16),d("21888242871839275222246405745257275088548364400416034343698204186575808495617"),d("1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab",16),d("21888242871839275222246405745257275088696311157297823662689037894645226208583");const Wa=B,Ya=ma;class Xa{constructor(e){this.F=e,this.p=Wa.fromString("21888242871839275222246405745257275088548364400416034343698204186575808495617"),this.pm1d2=Wa.div(Wa.sub(this.p,Wa.e(1)),Wa.e(2)),this.Generator=[e.e("995203441582195749578291179787384436505546430278305826713579947235728471134"),e.e("5472060717959818805561601436314318772137091100104008585924551046643952123905")],this.Base8=[e.e("5299619240641551281634865583518297030282874472190772894086521144482721001553"),e.e("16950150798460657717958625567821834550301663161624707787222815936182638968203")],this.order=Wa.fromString("21888242871839275222246405745257275088614511777268538073601725287587578984328"),this.subOrder=Wa.shiftRight(this.order,3),this.A=e.e("168700"),this.D=e.e("168696")}addPoint(e,a){const t=this.F,c=[],f=t.mul(e[0],a[1]),d=t.mul(e[1],a[0]),r=t.mul(t.sub(e[1],t.mul(this.A,e[0])),t.add(a[0],a[1])),n=t.mul(f,d),i=t.mul(this.D,n);return c[0]=t.div(t.add(f,d),t.add(t.one,i)),c[1]=t.div(t.add(r,t.sub(t.mul(this.A,f),d)),t.sub(t.one,i)),c}mulPointEscalar(e,a){const t=this.F;let c=[t.e("0"),t.e("1")],f=a,d=e;for(;!Wa.isZero(f);)Wa.isOdd(f)&&(c=this.addPoint(c,d)),d=this.addPoint(d,d),f=Wa.shiftRight(f,1);return c}inSubgroup(e){const a=this.F;if(!this.inCurve(e))return!1;const t=this.mulPointEscalar(e,this.subOrder);return a.isZero(t[0])&&a.eq(t[1],a.one)}inCurve(e){const a=this.F,t=a.square(e[0]),c=a.square(e[1]);return!!a.eq(a.add(a.mul(this.A,t),c),a.add(a.one,a.mul(a.mul(t,c),this.D)))}packPoint(e){const a=this.F,t=new Uint8Array(32);a.toRprLE(t,0,e[1]);const c=a.toObject(e[0]);return Wa.gt(c,this.pm1d2)&&(t[31]=128|t[31]),t}unpackPoint(e){const a=this.F;let t=!1;const c=new Array(2);if(128&e[31]&&(t=!0,e[31]=127&e[31]),c[1]=a.fromRprLE(e,0),Wa.gt(a.toObject(c[1]),this.p))return null;const f=a.square(c[1]),d=a.div(a.sub(a.one,f),a.sub(this.A,a.mul(this.D,f))),r=a.exp(d,a.half);if(!a.eq(a.one,r))return null;let n=a.sqrt(d);return null==n?null:(t&&(n=a.neg(n)),c[0]=n,c)}}var et=t(72206),at=t(60654),tt=t(62045).hp;async function ct(){const e=await async function(){const e=await Ja("bn128",!0);return new Xa(e.Fr)}();return new ft(e)}class ft{constructor(e){this.babyJub=e,this.bases=[]}baseHash(e,a){return"blake"==e?at("blake256").update(a).digest():"blake2b"==e?tt.from(et(32).update(tt.from(a)).digest()):void 0}hash(e,a){(a=a||{}).baseHash=a.baseHash||"blake";const t=this.babyJub,c=this.buffer2bits(e),f=Math.floor((c.length-1)/200)+1;let d=[t.F.zero,t.F.one];for(let e=0;e>1,a[8*t+2]=(4&c)>>2,a[8*t+3]=(8&c)>>3,a[8*t+4]=(16&c)>>4,a[8*t+5]=(32&c)>>5,a[8*t+6]=(64&c)>>6,a[8*t+7]=(128&c)>>7}return a}}var dt=t(31176),rt=t.n(dt);let nt=!1,it=!1;const bt={debug:1,default:2,info:2,warning:3,error:4,off:5};let ot=bt.default,st=null;const lt=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((a=>{try{if("test"!=="test".normalize(a))throw new Error("bad normalize")}catch(t){e.push(a)}})),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}();var ut,ht;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(ut||(ut={})),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"}(ht||(ht={}));const pt="0123456789abcdef";class gt{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,a){const t=e.toLowerCase();null==bt[t]&&this.throwArgumentError("invalid log level name","logLevel",e),ot>bt[t]||console.log.apply(console,a)}debug(...e){this._log(gt.levels.DEBUG,e)}info(...e){this._log(gt.levels.INFO,e)}warn(...e){this._log(gt.levels.WARNING,e)}makeError(e,a,t){if(it)return this.makeError("censored error",a,{});a||(a=gt.errors.UNKNOWN_ERROR),t||(t={});const c=[];Object.keys(t).forEach((e=>{const a=t[e];try{if(a instanceof Uint8Array){let t="";for(let e=0;e>4],t+=pt[15&a[e]];c.push(e+"=Uint8Array(0x"+t+")")}else c.push(e+"="+JSON.stringify(a))}catch(a){c.push(e+"="+JSON.stringify(t[e].toString()))}})),c.push(`code=${a}`),c.push(`version=${this.version}`);const f=e;let d="";switch(a){case ht.NUMERIC_FAULT:{d="NUMERIC_FAULT";const a=e;switch(a){case"overflow":case"underflow":case"division-by-zero":d+="-"+a;break;case"negative-power":case"negative-width":d+="-unsupported";break;case"unbound-bitwise-result":d+="-unbound-result"}break}case ht.CALL_EXCEPTION:case ht.INSUFFICIENT_FUNDS:case ht.MISSING_NEW:case ht.NONCE_EXPIRED:case ht.REPLACEMENT_UNDERPRICED:case ht.TRANSACTION_REPLACED:case ht.UNPREDICTABLE_GAS_LIMIT:d=a}d&&(e+=" [ See: https://links.ethers.org/v5-errors-"+d+" ]"),c.length&&(e+=" ("+c.join(", ")+")");const r=new Error(e);return r.reason=f,r.code=a,Object.keys(t).forEach((function(e){r[e]=t[e]})),r}throwError(e,a,t){throw this.makeError(e,a,t)}throwArgumentError(e,a,t){return this.throwError(e,gt.errors.INVALID_ARGUMENT,{argument:a,value:t})}assert(e,a,t,c){e||this.throwError(a,t,c)}assertArgument(e,a,t,c){e||this.throwArgumentError(a,t,c)}checkNormalize(e){null==e&&(e="platform missing String.prototype.normalize"),lt&&this.throwError("platform missing String.prototype.normalize",gt.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:lt})}checkSafeUint53(e,a){"number"==typeof e&&(null==a&&(a="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(a,gt.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(a,gt.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,a,t){t=t?": "+t:"",ea&&this.throwError("too many arguments"+t,gt.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:a})}checkNew(e,a){e!==Object&&null!=e||this.throwError("missing new",gt.errors.MISSING_NEW,{name:a.name})}checkAbstract(e,a){e===a?this.throwError("cannot instantiate abstract class "+JSON.stringify(a.name)+" directly; use a sub-class",gt.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",gt.errors.MISSING_NEW,{name:a.name})}static globalLogger(){return st||(st=new gt("logger/5.7.0")),st}static setCensorship(e,a){if(!e&&a&&this.globalLogger().throwError("cannot permanently disable censorship",gt.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),nt){if(!e)return;this.globalLogger().throwError("error censorship permanent",gt.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}it=!!e,nt=!!a}static setLogLevel(e){const a=bt[e.toLowerCase()];null!=a?ot=a:gt.globalLogger().warn("invalid log level - "+e)}static from(e){return new gt(e)}}gt.errors=ht,gt.levels=ut;const mt=new gt("bytes/5.7.0");function xt(e){return e.slice||(e.slice=function(){const a=Array.prototype.slice.call(arguments);return xt(new Uint8Array(Array.prototype.slice.apply(e,a)))}),e}function yt(e){return"number"==typeof e&&e==e&&e%1==0}function At(e,a){if(a||(a={}),"number"==typeof e){mt.checkSafeUint53(e,"invalid arrayify value");const a=[];for(;e;)a.unshift(255&e),e=parseInt(String(e/256));return 0===a.length&&a.push(0),xt(new Uint8Array(a))}if(a.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),function(e){return!!e.toHexString}(e)&&(e=e.toHexString()),function(e,a){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||a&&e.length!==2+2*a)}(e)){let t=e.substring(2);t.length%2&&("left"===a.hexPad?t="0"+t:"right"===a.hexPad?t+="0":mt.throwArgumentError("hex data is odd-length","value",e));const c=[];for(let e=0;e=256)return!1}return!0}(e)?xt(new Uint8Array(e)):mt.throwArgumentError("invalid arrayify value","value",e)}function vt(e){return"0x"+rt().keccak_256(At(e))}const wt=new gt("strings/5.7.0");var _t,It;function Et(e,a,t,c,f){if(e===It.BAD_PREFIX||e===It.UNEXPECTED_CONTINUE){let e=0;for(let c=a+1;c>6==2;c++)e++;return e}return e===It.OVERRUN?t.length-a-1:0}function Ct(e,a=_t.current){a!=_t.current&&(wt.checkNormalize(),e=e.normalize(a));let t=[];for(let a=0;a>6|192),t.push(63&c|128);else if(55296==(64512&c)){a++;const f=e.charCodeAt(a);if(a>=e.length||56320!=(64512&f))throw new Error("invalid utf-8 string");const d=65536+((1023&c)<<10)+(1023&f);t.push(d>>18|240),t.push(d>>12&63|128),t.push(d>>6&63|128),t.push(63&d|128)}else t.push(c>>12|224),t.push(c>>6&63|128),t.push(63&c|128)}return At(t)}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(_t||(_t={})),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"}(It||(It={})),Object.freeze({error:function(e,a,t,c,f){return wt.throwArgumentError(`invalid codepoint at offset ${a}; ${e}`,"bytes",t)},ignore:Et,replace:function(e,a,t,c,f){return e===It.OVERLONG?(c.push(f),0):(c.push(65533),Et(e,a,t))}});const Mt="mimcsponge";async function Bt(){const e=await Ja("bn128",!0);return new kt(e.Fr)}class kt{constructor(e){this.F=e,this.cts=this.getConstants(Mt,220)}getIV(e){const a=this.F;void 0===e&&(e=Mt);const t=vt(Ct(e+"_iv"));return Wa.e(t).mod(a.p)}getConstants(e,a){const t=this.F;void 0===e&&(e=Mt),void 0===a&&(a=220);const c=new Array(a);let f=vt(Ct(Mt));for(let e=1;e{"use strict";t.d(a,{r:()=>c});const c="6.13.4"},35273:(e,a,t)=>{"use strict";t.d(a,{y:()=>R});var c=t(57339),f=t(21228),d=t(30031),r=t(27033),n=t(19353);class i extends f.Ue{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,a){let t=n.V.dereference(a,"string");try{t=(0,d.b)(t)}catch(e){return this._throwError(e.message,a)}return e.writeValue(t)}decode(e){return(0,d.b)((0,r.up)(e.readValue(),20))}}var b=t(88081);class o extends f.Ue{coder;constructor(e){super(e.name,e.type,"_",e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,a){return this.coder.encode(e,a)}decode(e){return this.coder.decode(e)}}function s(e,a,t){let d=[];if(Array.isArray(t))d=t;else if(t&&"object"==typeof t){let e={};d=a.map((a=>{const f=a.localName;return(0,c.vA)(f,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:a},value:t}),(0,c.vA)(!e[f],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:a},value:t}),e[f]=!0,t[f]}))}else(0,c.MR)(!1,"invalid tuple value","tuple",t);(0,c.MR)(a.length===d.length,"types/value length mismatch","tuple",t);let r=new f.AU,n=new f.AU,i=[];a.forEach(((e,a)=>{let t=d[a];if(e.dynamic){let a=n.length;e.encode(n,t);let c=r.writeUpdatableValue();i.push((e=>{c(e+a)}))}else e.encode(r,t)})),i.forEach((e=>{e(r.length)}));let b=e.appendWriter(r);return b+=e.appendWriter(n),b}function l(e,a){let t=[],d=[],r=e.subReader(0);return a.forEach((a=>{let f=null;if(a.dynamic){let t=e.readIndex(),d=r.subReader(t);try{f=a.decode(d)}catch(e){if((0,c.bJ)(e,"BUFFER_OVERRUN"))throw e;f=e,f.baseType=a.name,f.name=a.localName,f.type=a.type}}else try{f=a.decode(e)}catch(e){if((0,c.bJ)(e,"BUFFER_OVERRUN"))throw e;f=e,f.baseType=a.name,f.name=a.localName,f.type=a.type}if(null==f)throw new Error("investigate");t.push(f),d.push(a.localName||null)})),f.Q7.fromItems(t,d)}class u extends f.Ue{coder;length;constructor(e,a,t){super("array",e.type+"["+(a>=0?a:"")+"]",t,-1===a||e.dynamic),(0,b.n)(this,{coder:e,length:a})}defaultValue(){const e=this.coder.defaultValue(),a=[];for(let t=0;te||t<-(e+w))&&this._throwError("value out-of-bounds",a),t=(0,r.JJ)(t,8*f.Yx)}else(t(0,r.dK)(c,8*this.size))&&this._throwError("value out-of-bounds",a);return e.writeValue(t)}decode(e){let a=(0,r.dK)(e.readValue(),8*this.size);return this.signed&&(a=(0,r.ST)(a,8*this.size)),a}}var E=t(87303);class C extends g{constructor(e){super("string",e)}defaultValue(){return""}encode(e,a){return super.encode(e,(0,E.YW)(n.V.dereference(a,"string")))}decode(e){return(0,E._v)(super.decode(e))}}class M extends f.Ue{coders;constructor(e,a){let t=!1;const c=[];e.forEach((e=>{e.dynamic&&(t=!0),c.push(e.type)})),super("tuple","tuple("+c.join(",")+")",a,t),(0,b.n)(this,{coders:Object.freeze(e.slice())})}defaultValue(){const e=[];this.coders.forEach((a=>{e.push(a.defaultValue())}));const a=this.coders.reduce(((e,a)=>{const t=a.localName;return t&&(e[t]||(e[t]=0),e[t]++),e}),{});return this.coders.forEach(((t,c)=>{let f=t.localName;f&&1===a[f]&&("length"===f&&(f="_length"),null==e[f]&&(e[f]=e[c]))})),Object.freeze(e)}encode(e,a){const t=n.V.dereference(a,"tuple");return s(e,this.coders,t)}decode(e){return l(e,this.coders)}}var B=t(76124);const k=new Map;k.set(0,"GENERIC_PANIC"),k.set(1,"ASSERT_FALSE"),k.set(17,"OVERFLOW"),k.set(18,"DIVIDE_BY_ZERO"),k.set(33,"ENUM_RANGE_ERROR"),k.set(34,"BAD_STORAGE_DATA"),k.set(49,"STACK_UNDERFLOW"),k.set(50,"ARRAY_RANGE_ERROR"),k.set(65,"OUT_OF_MEMORY"),k.set(81,"UNINITIALIZED_FUNCTION_CALL");const L=new RegExp(/^bytes([0-9]*)$/),S=new RegExp(/^(u?int)([0-9]*)$/);let T=null,N=1024;class R{#te(e){if(e.isArray())return new u(this.#te(e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new M(e.components.map((e=>this.#te(e))),e.name);switch(e.baseType){case"address":return new i(e.name);case"bool":return new h(e.name);case"string":return new C(e.name);case"bytes":return new m(e.name);case"":return new A(e.name)}let a=e.type.match(S);if(a){let t=parseInt(a[2]||"256");return(0,c.MR)(0!==t&&t<=256&&t%8==0,"invalid "+a[1]+" bit length","param",e),new I(t/8,"int"===a[1],e.name)}if(a=e.type.match(L),a){let t=parseInt(a[1]);return(0,c.MR)(0!==t&&t<=32,"invalid bytes length","param",e),new x(t,e.name)}(0,c.MR)(!1,"invalid type","type",e.type)}getDefaultValue(e){const a=e.map((e=>this.#te(B.aX.from(e))));return new M(a,"_").defaultValue()}encode(e,a){(0,c.dd)(a.length,e.length,"types/values length mismatch");const t=e.map((e=>this.#te(B.aX.from(e)))),d=new M(t,"_"),r=new f.AU;return d.encode(r,a),r.data}decode(e,a,t){const c=e.map((e=>this.#te(B.aX.from(e))));return new M(c,"_").decode(new f.mP(a,t,N))}static _setDefaultMaxInflation(e){(0,c.MR)("number"==typeof e&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),N=e}static defaultAbiCoder(){return null==T&&(T=new R),T}static getBuiltinCallException(e,a,t){return function(e,a,t,f){let r="missing revert data",n=null,i=null;if(t){r="execution reverted";const e=(0,p.q5)(t);if(t=(0,p.c$)(t),0===e.length)r+=" (no data present; likely require(false) occurred",n="require(false)";else if(e.length%32!=4)r+=" (could not decode reason; invalid data length)";else if("0x08c379a0"===(0,p.c$)(e.slice(0,4)))try{n=f.decode(["string"],e.slice(4))[0],i={signature:"Error(string)",name:"Error",args:[n]},r+=`: ${JSON.stringify(n)}`}catch(e){r+=" (could not decode reason; invalid string data)"}else if("0x4e487b71"===(0,p.c$)(e.slice(0,4)))try{const a=Number(f.decode(["uint256"],e.slice(4))[0]);i={signature:"Panic(uint256)",name:"Panic",args:[a]},n=`Panic due to ${k.get(a)||"UNKNOWN"}(${a})`,r+=`: ${n}`}catch(e){r+=" (could not decode panic code)"}else r+=" (unknown custom error)"}const b={to:a.to?(0,d.b)(a.to):null,data:a.data||"0x"};return a.from&&(b.from=(0,d.b)(a.from)),(0,c.xz)(r,"CALL_EXCEPTION",{action:e,data:t,reason:n,transaction:b,invocation:null,revert:i})}(e,a,t,R.defaultAbiCoder())}}},21228:(e,a,t)=>{"use strict";t.d(a,{AU:()=>y,Q7:()=>g,Ue:()=>x,Yx:()=>n,mP:()=>A});var c=t(27033),f=t(57339),d=t(36212),r=t(88081);const n=32,i=new Uint8Array(n),b=["then"],o={},s=new WeakMap;function l(e){return s.get(e)}function u(e,a){s.set(e,a)}function h(e,a){const t=new Error(`deferred error during ABI decoding triggered accessing ${e}`);throw t.error=a,t}function p(e,a,t){return e.indexOf(null)>=0?a.map(((e,a)=>e instanceof g?p(l(e),e,t):e)):e.reduce(((e,c,f)=>{let d=a.getValue(c);return c in e||(t&&d instanceof g&&(d=p(l(d),d,t)),e[c]=d),e}),{})}class g extends Array{#ce;constructor(...e){const a=e[0];let t=e[1],f=(e[2]||[]).slice(),d=!0;a!==o&&(t=e,f=[],d=!1),super(t.length),t.forEach(((e,a)=>{this[a]=e}));const r=f.reduce(((e,a)=>("string"==typeof a&&e.set(a,(e.get(a)||0)+1),e)),new Map);if(u(this,Object.freeze(t.map(((e,a)=>{const t=f[a];return null!=t&&1===r.get(t)?t:null})))),this.#ce=[],null==this.#ce&&this.#ce,!d)return;Object.freeze(this);const n=new Proxy(this,{get:(e,a,t)=>{if("string"==typeof a){if(a.match(/^[0-9]+$/)){const t=(0,c.WZ)(a,"%index");if(t<0||t>=this.length)throw new RangeError("out of result range");const f=e[t];return f instanceof Error&&h(`index ${t}`,f),f}if(b.indexOf(a)>=0)return Reflect.get(e,a,t);const f=e[a];if(f instanceof Function)return function(...a){return f.apply(this===t?e:this,a)};if(!(a in e))return e.getValue.apply(this===t?e:this,[a])}return Reflect.get(e,a,t)}});return u(n,l(this)),n}toArray(e){const a=[];return this.forEach(((t,c)=>{t instanceof Error&&h(`index ${c}`,t),e&&t instanceof g&&(t=t.toArray(e)),a.push(t)})),a}toObject(e){const a=l(this);return a.reduce(((t,c,d)=>((0,f.vA)(null!=c,`value at index ${d} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),p(a,this,e))),{})}slice(e,a){null==e&&(e=0),e<0&&(e+=this.length)<0&&(e=0),null==a&&(a=this.length),a<0&&(a+=this.length)<0&&(a=0),a>this.length&&(a=this.length);const t=l(this),c=[],f=[];for(let d=e;d{this.#V[e]=m(a)}}}class A{allowLoose;#V;#re;#ne;#ie;#be;constructor(e,a,t){(0,r.n)(this,{allowLoose:!!a}),this.#V=(0,d.Lm)(e),this.#ne=0,this.#ie=null,this.#be=null!=t?t:1024,this.#re=0}get data(){return(0,d.c$)(this.#V)}get dataLength(){return this.#V.length}get consumed(){return this.#re}get bytes(){return new Uint8Array(this.#V)}#oe(e){if(this.#ie)return this.#ie.#oe(e);this.#ne+=e,(0,f.vA)(this.#be<1||this.#ne<=this.#be*this.dataLength,`compressed ABI data exceeds inflation ratio of ${this.#be} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:(0,d.Lm)(this.#V),offset:this.#re,length:e,info:{bytesRead:this.#ne,dataLength:this.dataLength}})}#se(e,a,t){let c=Math.ceil(a/n)*n;return this.#re+c>this.#V.length&&(this.allowLoose&&t&&this.#re+a<=this.#V.length?c=a:(0,f.vA)(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:(0,d.Lm)(this.#V),length:this.#V.length,offset:this.#re+c})),this.#V.slice(this.#re,this.#re+c)}subReader(e){const a=new A(this.#V.slice(this.#re+e),this.allowLoose,this.#be);return a.#ie=this,a}readBytes(e,a){let t=this.#se(0,e,!!a);return this.#oe(e),this.#re+=t.length,t.slice(0,e)}readValue(){return(0,c.Dg)(this.readBytes(n))}readIndex(){return(0,c.Ro)(this.readBytes(n))}}},76124:(e,a,t)=>{"use strict";t.d(a,{FK:()=>q,Pw:()=>V,Zp:()=>K,aX:()=>H,bp:()=>G,hc:()=>J});var c=t(27033),f=t(57339),d=t(88081),r=t(38264);function n(e){const a=new Set;return e.forEach((e=>a.add(e))),Object.freeze(a)}const i=n("external public payable override".split(" ")),b="constant external internal payable private public pure view override",o=n(b.split(" ")),s="constructor error event fallback function receive struct",l=n(s.split(" ")),u="calldata memory storage payable indexed",h=n(u.split(" ")),p=n([s,u,"tuple returns",b].join(" ").split(" ")),g={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},m=new RegExp("^(\\s*)"),x=new RegExp("^([0-9]+)"),y=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),A=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),v=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");class w{#re;#le;get offset(){return this.#re}get length(){return this.#le.length-this.#re}constructor(e){this.#re=0,this.#le=e.slice()}clone(){return new w(this.#le)}reset(){this.#re=0}#ue(e=0,a=0){return new w(this.#le.slice(e,a).map((a=>Object.freeze(Object.assign({},a,{match:a.match-e,linkBack:a.linkBack-e,linkNext:a.linkNext-e})))))}popKeyword(e){const a=this.peek();if("KEYWORD"!==a.type||!e.has(a.text))throw new Error(`expected keyword ${a.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const a=this.peek();throw new Error(`expected ${e}; got ${a.type} ${JSON.stringify(a.text)}`)}return this.pop().text}popParen(){const e=this.peek();if("OPEN_PAREN"!==e.type)throw new Error("bad start");const a=this.#ue(this.#re+1,e.match+1);return this.#re=e.match+1,a}popParams(){const e=this.peek();if("OPEN_PAREN"!==e.type)throw new Error("bad start");const a=[];for(;this.#re=this.#le.length)throw new Error("out-of-bounds");return this.#le[this.#re]}peekKeyword(e){const a=this.peekType("KEYWORD");return null!=a&&e.has(a)?a:null}peekType(e){if(0===this.length)return null;const a=this.peek();return a.type===e?a.text:null}pop(){const e=this.peek();return this.#re++,e}toString(){const e=[];for(let a=this.#re;a`}}function _(e){const a=[],t=a=>{const t=r0&&"NUMBER"===a[a.length-1].type){const t=a.pop().text;e=t+e,a[a.length-1].value=(0,c.WZ)(t)}if(0===a.length||"BRACKET"!==a[a.length-1].type)throw new Error("missing opening bracket");a[a.length-1].text+=e}}else if(i=n.match(y),i){if(b.text=i[1],r+=b.text.length,p.has(b.text)){b.type="KEYWORD";continue}if(b.text.match(v)){b.type="TYPE";continue}b.type="ID"}else{if(i=n.match(x),!i)throw new Error(`unexpected token ${JSON.stringify(n[0])} at position ${r}`);b.text=i[1],b.type="NUMBER",r+=b.text.length}}return new w(a.map((e=>Object.freeze(e))))}function I(e,a){let t=[];for(const c in a.keys())e.has(c)&&t.push(c);if(t.length>1)throw new Error(`conflicting types: ${t.join(", ")}`)}function E(e,a){if(a.peekKeyword(l)){const t=a.pop().text;if(t!==e)throw new Error(`expected ${e}, got ${t}`)}return a.popType("ID")}function C(e,a){const t=new Set;for(;;){const c=e.peekType("KEYWORD");if(null==c||a&&!a.has(c))break;if(e.pop(),t.has(c))throw new Error(`duplicate keywords: ${JSON.stringify(c)}`);t.add(c)}return Object.freeze(t)}function M(e){let a=C(e,o);return I(a,n("constant payable nonpayable".split(" "))),I(a,n("pure view payable nonpayable".split(" "))),a.has("view")?"view":a.has("pure")?"pure":a.has("payable")?"payable":a.has("nonpayable")?"nonpayable":a.has("constant")?"view":"nonpayable"}function B(e,a){return e.popParams().map((e=>H.from(e,a)))}function k(e){if(e.peekType("AT")){if(e.pop(),e.peekType("NUMBER"))return(0,c.Ab)(e.pop().text);throw new Error("invalid gas")}return null}function L(e){if(e.length)throw new Error(`unexpected tokens at offset ${e.offset}: ${e.toString()}`)}const S=new RegExp(/^(.*)\[([0-9]*)\]$/);function T(e){const a=e.match(v);if((0,f.MR)(a,"invalid type","type",e),"uint"===e)return"uint256";if("int"===e)return"int256";if(a[2]){const t=parseInt(a[2]);(0,f.MR)(0!==t&&t<=32,"invalid bytes length","type",e)}else if(a[3]){const t=parseInt(a[3]);(0,f.MR)(0!==t&&t<=256&&t%8==0,"invalid numeric width","type",e)}return e}const N={},R=Symbol.for("_ethers_internal"),P="_ParamTypeInternal",D="_ErrorInternal",O="_EventInternal",F="_ConstructorInternal",Q="_FallbackInternal",U="_FunctionInternal",j="_StructInternal";class H{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(e,a,t,c,r,n,i,b){if((0,f.gk)(e,N,"ParamType"),Object.defineProperty(this,R,{value:P}),n&&(n=Object.freeze(n.slice())),"array"===c){if(null==i||null==b)throw new Error("")}else if(null!=i||null!=b)throw new Error("");if("tuple"===c){if(null==n)throw new Error("")}else if(null!=n)throw new Error("");(0,d.n)(this,{name:a,type:t,baseType:c,indexed:r,components:n,arrayLength:i,arrayChildren:b})}format(e){if(null==e&&(e="sighash"),"json"===e){const a=this.name||"";if(this.isArray()){const e=JSON.parse(this.arrayChildren.format("json"));return e.name=a,e.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(e)}const t={type:"tuple"===this.baseType?"tuple":this.type,name:a};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.isTuple()&&(t.components=this.components.map((a=>JSON.parse(a.format(e))))),JSON.stringify(t)}let a="";return this.isArray()?(a+=this.arrayChildren.format(e),a+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?a+="("+this.components.map((a=>a.format(e))).join("full"===e?", ":",")+")":a+=this.type,"sighash"!==e&&(!0===this.indexed&&(a+=" indexed"),"full"===e&&this.name&&(a+=" "+this.name)),a}isArray(){return"array"===this.baseType}isTuple(){return"tuple"===this.baseType}isIndexable(){return null!=this.indexed}walk(e,a){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(-1!==this.arrayLength&&e.length!==this.arrayLength)throw new Error("array is wrong length");const t=this;return e.map((e=>t.arrayChildren.walk(e,a)))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const t=this;return e.map(((e,c)=>t.components[c].walk(e,a)))}return a(this.type,e)}#he(e,a,t,c){if(this.isArray()){if(!Array.isArray(a))throw new Error("invalid array value");if(-1!==this.arrayLength&&a.length!==this.arrayLength)throw new Error("array is wrong length");const f=this.arrayChildren,d=a.slice();return d.forEach(((a,c)=>{f.#he(e,a,t,(e=>{d[c]=e}))})),void c(d)}if(this.isTuple()){const f=this.components;let d;if(Array.isArray(a))d=a.slice();else{if(null==a||"object"!=typeof a)throw new Error("invalid tuple value");d=f.map((e=>{if(!e.name)throw new Error("cannot use object value with unnamed components");if(!(e.name in a))throw new Error(`missing value for component ${e.name}`);return a[e.name]}))}if(d.length!==this.components.length)throw new Error("array is wrong length");return d.forEach(((a,c)=>{f[c].#he(e,a,t,(e=>{d[c]=e}))})),void c(d)}const f=t(this.type,a);f.then?e.push(async function(){c(await f)}()):c(f)}async walkAsync(e,a){const t=[],c=[e];return this.#he(t,e,a,(e=>{c[0]=e})),t.length&&await Promise.all(t),c[0]}static from(e,a){if(H.isParamType(e))return e;if("string"==typeof e)try{return H.from(_(e),a)}catch(a){(0,f.MR)(!1,"invalid param type","obj",e)}else if(e instanceof w){let t="",c="",f=null;C(e,n(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(c="tuple",f=e.popParams().map((e=>H.from(e))),t=`tuple(${f.map((e=>e.format())).join(",")})`):(t=T(e.popType("TYPE")),c=t);let d=null,r=null;for(;e.length&&e.peekType("BRACKET");){const a=e.pop();d=new H(N,"",t,c,null,f,r,d),r=a.value,t+=a.text,c="array",f=null}let i=null;if(C(e,h).has("indexed")){if(!a)throw new Error("");i=!0}const b=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new H(N,b,t,c,i,f,r,d)}const t=e.name;(0,f.MR)(!t||"string"==typeof t&&t.match(A),"invalid name","obj.name",t);let c=e.indexed;null!=c&&((0,f.MR)(a,"parameter cannot be indexed","obj.indexed",e.indexed),c=!!c);let d=e.type,r=d.match(S);if(r){const a=parseInt(r[2]||"-1"),f=H.from({type:r[1],components:e.components});return new H(N,t||"",d,"array",c,null,a,f)}if("tuple"===d||d.startsWith("tuple(")||d.startsWith("(")){const a=null!=e.components?e.components.map((e=>H.from(e))):null;return new H(N,t||"",d,"tuple",c,a,null,null)}return d=T(e.type),new H(N,t||"",d,d,c,null,null,null)}static isParamType(e){return e&&e[R]===P}}class q{type;inputs;constructor(e,a,t){(0,f.gk)(e,N,"Fragment"),t=Object.freeze(t.slice()),(0,d.n)(this,{type:a,inputs:t})}static from(e){if("string"==typeof e){try{q.from(JSON.parse(e))}catch(e){}return q.from(_(e))}if(e instanceof w)switch(e.peekKeyword(l)){case"constructor":return V.from(e);case"error":return G.from(e);case"event":return K.from(e);case"fallback":case"receive":return Z.from(e);case"function":return J.from(e);case"struct":return W.from(e)}else if("object"==typeof e){switch(e.type){case"constructor":return V.from(e);case"error":return G.from(e);case"event":return K.from(e);case"fallback":case"receive":return Z.from(e);case"function":return J.from(e);case"struct":return W.from(e)}(0,f.vA)(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}(0,f.MR)(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return V.isFragment(e)}static isError(e){return G.isFragment(e)}static isEvent(e){return K.isFragment(e)}static isFunction(e){return J.isFragment(e)}static isStruct(e){return W.isFragment(e)}}class $ extends q{name;constructor(e,a,t,c){super(e,a,c),(0,f.MR)("string"==typeof t&&t.match(A),"invalid identifier","name",t),c=Object.freeze(c.slice()),(0,d.n)(this,{name:t})}}function z(e,a){return"("+a.map((a=>a.format(e))).join("full"===e?", ":",")+")"}class G extends ${constructor(e,a,t){super(e,"error",a,t),Object.defineProperty(this,R,{value:D})}get selector(){return(0,r.id)(this.format("sighash")).substring(0,10)}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((a=>JSON.parse(a.format(e))))});const a=[];return"sighash"!==e&&a.push("error"),a.push(this.name+z(e,this.inputs)),a.join(" ")}static from(e){if(G.isFragment(e))return e;if("string"==typeof e)return G.from(_(e));if(e instanceof w){const a=E("error",e),t=B(e);return L(e),new G(N,a,t)}return new G(N,e.name,e.inputs?e.inputs.map(H.from):[])}static isFragment(e){return e&&e[R]===D}}class K extends ${anonymous;constructor(e,a,t,c){super(e,"event",a,t),Object.defineProperty(this,R,{value:O}),(0,d.n)(this,{anonymous:c})}get topicHash(){return(0,r.id)(this.format("sighash"))}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((a=>JSON.parse(a.format(e))))});const a=[];return"sighash"!==e&&a.push("event"),a.push(this.name+z(e,this.inputs)),"sighash"!==e&&this.anonymous&&a.push("anonymous"),a.join(" ")}static getTopicHash(e,a){return a=(a||[]).map((e=>H.from(e))),new K(N,e,a,!1).topicHash}static from(e){if(K.isFragment(e))return e;if("string"==typeof e)try{return K.from(_(e))}catch(a){(0,f.MR)(!1,"invalid event fragment","obj",e)}else if(e instanceof w){const a=E("event",e),t=B(e,!0),c=!!C(e,n(["anonymous"])).has("anonymous");return L(e),new K(N,a,t,c)}return new K(N,e.name,e.inputs?e.inputs.map((e=>H.from(e,!0))):[],!!e.anonymous)}static isFragment(e){return e&&e[R]===O}}class V extends q{payable;gas;constructor(e,a,t,c,f){super(e,a,t),Object.defineProperty(this,R,{value:F}),(0,d.n)(this,{payable:c,gas:f})}format(e){if((0,f.vA)(null!=e&&"sighash"!==e,"cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),"json"===e)return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map((a=>JSON.parse(a.format(e))))});const a=[`constructor${z(e,this.inputs)}`];return this.payable&&a.push("payable"),null!=this.gas&&a.push(`@${this.gas.toString()}`),a.join(" ")}static from(e){if(V.isFragment(e))return e;if("string"==typeof e)try{return V.from(_(e))}catch(a){(0,f.MR)(!1,"invalid constuctor fragment","obj",e)}else if(e instanceof w){C(e,n(["constructor"]));const a=B(e),t=!!C(e,i).has("payable"),c=k(e);return L(e),new V(N,"constructor",a,t,c)}return new V(N,"constructor",e.inputs?e.inputs.map(H.from):[],!!e.payable,null!=e.gas?e.gas:null)}static isFragment(e){return e&&e[R]===F}}class Z extends q{payable;constructor(e,a,t){super(e,"fallback",a),Object.defineProperty(this,R,{value:Q}),(0,d.n)(this,{payable:t})}format(e){const a=0===this.inputs.length?"receive":"fallback";if("json"===e){const e=this.payable?"payable":"nonpayable";return JSON.stringify({type:a,stateMutability:e})}return`${a}()${this.payable?" payable":""}`}static from(e){if(Z.isFragment(e))return e;if("string"==typeof e)try{return Z.from(_(e))}catch(a){(0,f.MR)(!1,"invalid fallback fragment","obj",e)}else if(e instanceof w){const a=e.toString(),t=e.peekKeyword(n(["fallback","receive"]));if((0,f.MR)(t,"type must be fallback or receive","obj",a),"receive"===e.popKeyword(n(["fallback","receive"]))){const a=B(e);return(0,f.MR)(0===a.length,"receive cannot have arguments","obj.inputs",a),C(e,n(["payable"])),L(e),new Z(N,[],!0)}let c=B(e);c.length?(0,f.MR)(1===c.length&&"bytes"===c[0].type,"invalid fallback inputs","obj.inputs",c.map((e=>e.format("minimal"))).join(", ")):c=[H.from("bytes")];const d=M(e);if((0,f.MR)("nonpayable"===d||"payable"===d,"fallback cannot be constants","obj.stateMutability",d),C(e,n(["returns"])).has("returns")){const a=B(e);(0,f.MR)(1===a.length&&"bytes"===a[0].type,"invalid fallback outputs","obj.outputs",a.map((e=>e.format("minimal"))).join(", "))}return L(e),new Z(N,c,"payable"===d)}if("receive"===e.type)return new Z(N,[],!0);if("fallback"===e.type){const a=[H.from("bytes")],t="payable"===e.stateMutability;return new Z(N,a,t)}(0,f.MR)(!1,"invalid fallback description","obj",e)}static isFragment(e){return e&&e[R]===Q}}class J extends ${constant;outputs;stateMutability;payable;gas;constructor(e,a,t,c,f,r){super(e,"function",a,c),Object.defineProperty(this,R,{value:U}),f=Object.freeze(f.slice());const n="view"===t||"pure"===t,i="payable"===t;(0,d.n)(this,{constant:n,gas:r,outputs:f,payable:i,stateMutability:t})}get selector(){return(0,r.id)(this.format("sighash")).substring(0,10)}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map((a=>JSON.parse(a.format(e)))),outputs:this.outputs.map((a=>JSON.parse(a.format(e))))});const a=[];return"sighash"!==e&&a.push("function"),a.push(this.name+z(e,this.inputs)),"sighash"!==e&&("nonpayable"!==this.stateMutability&&a.push(this.stateMutability),this.outputs&&this.outputs.length&&(a.push("returns"),a.push(z(e,this.outputs))),null!=this.gas&&a.push(`@${this.gas.toString()}`)),a.join(" ")}static getSelector(e,a){return a=(a||[]).map((e=>H.from(e))),new J(N,e,"view",a,[],null).selector}static from(e){if(J.isFragment(e))return e;if("string"==typeof e)try{return J.from(_(e))}catch(a){(0,f.MR)(!1,"invalid function fragment","obj",e)}else if(e instanceof w){const a=E("function",e),t=B(e),c=M(e);let f=[];C(e,n(["returns"])).has("returns")&&(f=B(e));const d=k(e);return L(e),new J(N,a,c,t,f,d)}let a=e.stateMutability;return null==a&&(a="payable","boolean"==typeof e.constant?(a="view",e.constant||(a="payable","boolean"!=typeof e.payable||e.payable||(a="nonpayable"))):"boolean"!=typeof e.payable||e.payable||(a="nonpayable")),new J(N,e.name,a,e.inputs?e.inputs.map(H.from):[],e.outputs?e.outputs.map(H.from):[],null!=e.gas?e.gas:null)}static isFragment(e){return e&&e[R]===U}}class W extends ${constructor(e,a,t){super(e,"struct",a,t),Object.defineProperty(this,R,{value:j})}format(){throw new Error("@TODO")}static from(e){if("string"==typeof e)try{return W.from(_(e))}catch(a){(0,f.MR)(!1,"invalid struct fragment","obj",e)}else if(e instanceof w){const a=E("struct",e),t=B(e);return L(e),new W(N,a,t)}return new W(N,e.name,e.inputs?e.inputs.map(H.from):[])}static isFragment(e){return e&&e[R]===j}}},73622:(e,a,t)=>{"use strict";t.d(a,{KA:()=>y});var c=t(2011),f=t(38264),d=t(88081),r=t(57339),n=t(36212),i=t(27033),b=t(35273),o=t(21228),s=t(76124),l=t(19353);class u{fragment;name;signature;topic;args;constructor(e,a,t){const c=e.name,f=e.format();(0,d.n)(this,{fragment:e,name:c,signature:f,topic:a,args:t})}}class h{fragment;name;args;signature;selector;value;constructor(e,a,t,c){const f=e.name,r=e.format();(0,d.n)(this,{fragment:e,name:f,args:t,signature:r,selector:a,value:c})}}class p{fragment;name;args;signature;selector;constructor(e,a,t){const c=e.name,f=e.format();(0,d.n)(this,{fragment:e,name:c,args:t,signature:f,selector:a})}}class g{hash;_isIndexed;static isIndexed(e){return!(!e||!e._isIndexed)}constructor(e){(0,d.n)(this,{hash:e,_isIndexed:!0})}}const m={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},x={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:e=>`reverted with reason string ${JSON.stringify(e)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:e=>{let a="unknown panic code";return e>=0&&e<=255&&m[e.toString()]&&(a=m[e.toString()]),`reverted with panic code 0x${e.toString(16)} (${a})`}}};class y{fragments;deploy;fallback;receive;#pe;#ge;#me;#xe;constructor(e){let a=[];a="string"==typeof e?JSON.parse(e):e,this.#me=new Map,this.#pe=new Map,this.#ge=new Map;const t=[];for(const e of a)try{t.push(s.FK.from(e))}catch(a){console.log(`[Warning] Invalid Fragment ${JSON.stringify(e)}:`,a.message)}(0,d.n)(this,{fragments:Object.freeze(t)});let c=null,f=!1;this.#xe=this.getAbiCoder(),this.fragments.forEach(((e,a)=>{let t;switch(e.type){case"constructor":return this.deploy?void console.log("duplicate definition - constructor"):void(0,d.n)(this,{deploy:e});case"fallback":return void(0===e.inputs.length?f=!0:((0,r.MR)(!c||e.payable!==c.payable,"conflicting fallback fragments",`fragments[${a}]`,e),c=e,f=c.payable));case"function":t=this.#me;break;case"event":t=this.#ge;break;case"error":t=this.#pe;break;default:return}const n=e.format();t.has(n)||t.set(n,e)})),this.deploy||(0,d.n)(this,{deploy:s.Pw.from("constructor()")}),(0,d.n)(this,{fallback:c,receive:f})}format(e){const a=e?"minimal":"full";return this.fragments.map((e=>e.format(a)))}formatJson(){const e=this.fragments.map((e=>e.format("json")));return JSON.stringify(e.map((e=>JSON.parse(e))))}getAbiCoder(){return b.y.defaultAbiCoder()}#ye(e,a,t){if((0,n.Lo)(e)){const a=e.toLowerCase();for(const e of this.#me.values())if(a===e.selector)return e;return null}if(-1===e.indexOf("(")){const c=[];for(const[a,t]of this.#me)a.split("(")[0]===e&&c.push(t);if(a){const e=a.length>0?a[a.length-1]:null;let t=a.length,f=!0;l.V.isTyped(e)&&"overrides"===e.type&&(f=!1,t--);for(let e=c.length-1;e>=0;e--){const a=c[e].inputs.length;a===t||f&&a===t-1||c.splice(e,1)}for(let e=c.length-1;e>=0;e--){const t=c[e].inputs;for(let f=0;f=t.length){if("overrides"===a[f].type)continue;c.splice(e,1);break}if(a[f].type!==t[f].baseType){c.splice(e,1);break}}}}if(1===c.length&&a&&a.length!==c[0].inputs.length){const e=a[a.length-1];(null==e||Array.isArray(e)||"object"!=typeof e)&&c.splice(0,1)}if(0===c.length)return null;if(c.length>1&&t){const a=c.map((e=>JSON.stringify(e.format()))).join(", ");(0,r.MR)(!1,`ambiguous function description (i.e. matches ${a})`,"key",e)}return c[0]}return this.#me.get(s.hc.from(e).format())||null}getFunctionName(e){const a=this.#ye(e,null,!1);return(0,r.MR)(a,"no matching function","key",e),a.name}hasFunction(e){return!!this.#ye(e,null,!1)}getFunction(e,a){return this.#ye(e,a||null,!0)}forEachFunction(e){const a=Array.from(this.#me.keys());a.sort(((e,a)=>e.localeCompare(a)));for(let t=0;t=0;e--)c[e].inputs.length=0;e--){const t=c[e].inputs;for(let f=0;f1&&t){const a=c.map((e=>JSON.stringify(e.format()))).join(", ");(0,r.MR)(!1,`ambiguous event description (i.e. matches ${a})`,"key",e)}return c[0]}return this.#ge.get(s.Zp.from(e).format())||null}getEventName(e){const a=this.#Ae(e,null,!1);return(0,r.MR)(a,"no matching event","key",e),a.name}hasEvent(e){return!!this.#Ae(e,null,!1)}getEvent(e,a){return this.#Ae(e,a||null,!0)}forEachEvent(e){const a=Array.from(this.#ge.keys());a.sort(((e,a)=>e.localeCompare(a)));for(let t=0;t1){const t=a.map((e=>JSON.stringify(e.format()))).join(", ");(0,r.MR)(!1,`ambiguous error description (i.e. ${t})`,"name",e)}return a[0]}if("Error(string)"===(e=s.bp.from(e).format()))return s.bp.from("error Error(string)");if("Panic(uint256)"===e)return s.bp.from("error Panic(uint256)");return this.#pe.get(e)||null}forEachError(e){const a=Array.from(this.#pe.keys());a.sort(((e,a)=>e.localeCompare(a)));for(let t=0;t"string"===e.type?(0,f.id)(a):"bytes"===e.type?(0,c.S)((0,n.c$)(a)):("bool"===e.type&&"boolean"==typeof a?a=a?"0x01":"0x00":e.type.match(/^u?int/)?a=(0,i.up)(a):e.type.match(/^bytes/)?a=(0,n.X_)(a,32):"address"===e.type&&this.#xe.encode(["address"],[a]),(0,n.nx)((0,n.c$)(a),32));for(a.forEach(((a,c)=>{const f=e.inputs[c];f.indexed?null==a?t.push(null):"array"===f.baseType||"tuple"===f.baseType?(0,r.MR)(!1,"filtering with tuples or arrays not supported","contract."+f.name,a):Array.isArray(a)?t.push(a.map((e=>d(f,e)))):t.push(d(f,a)):(0,r.MR)(null==a,"cannot filter non-indexed parameters; must be null","contract."+f.name,a)}));t.length&&null===t[t.length-1];)t.pop();return t}encodeEventLog(e,a){if("string"==typeof e){const a=this.getEvent(e);(0,r.MR)(a,"unknown event","eventFragment",e),e=a}const t=[],d=[],n=[];return e.anonymous||t.push(e.topicHash),(0,r.MR)(a.length===e.inputs.length,"event arguments/values mismatch","values",a),e.inputs.forEach(((e,r)=>{const i=a[r];if(e.indexed)if("string"===e.type)t.push((0,f.id)(i));else if("bytes"===e.type)t.push((0,c.S)(i));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");t.push(this.#xe.encode([e.type],[i]))}else d.push(e),n.push(i)})),{data:this.#xe.encode(d,n),topics:t}}decodeEventLog(e,a,t){if("string"==typeof e){const a=this.getEvent(e);(0,r.MR)(a,"unknown event","eventFragment",e),e=a}if(null!=t&&!e.anonymous){const a=e.topicHash;(0,r.MR)((0,n.Lo)(t[0],32)&&t[0].toLowerCase()===a,"fragment/topic mismatch","topics[0]",t[0]),t=t.slice(1)}const c=[],f=[],d=[];e.inputs.forEach(((e,a)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(c.push(s.aX.from({type:"bytes32",name:e.name})),d.push(!0)):(c.push(e),d.push(!1)):(f.push(e),d.push(!1))}));const i=null!=t?this.#xe.decode(c,(0,n.xW)(t)):null,b=this.#xe.decode(f,a,!0),l=[],u=[];let h=0,p=0;return e.inputs.forEach(((e,a)=>{let t=null;if(e.indexed)if(null==i)t=new g(null);else if(d[a])t=new g(i[p++]);else try{t=i[p++]}catch(e){t=e}else try{t=b[h++]}catch(e){t=e}l.push(t),u.push(e.name||null)})),o.Q7.fromItems(l,u)}parseTransaction(e){const a=(0,n.q5)(e.data,"tx.data"),t=(0,i.Ab)(null!=e.value?e.value:0,"tx.value"),c=this.getFunction((0,n.c$)(a.slice(0,4)));if(!c)return null;const f=this.#xe.decode(c.inputs,a.slice(4));return new h(c,c.selector,f,t)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const a=this.getEvent(e.topics[0]);return!a||a.anonymous?null:new u(a,a.topicHash,this.decodeEventLog(a,e.data,e.topics))}parseError(e){const a=(0,n.c$)(e),t=this.getError((0,n.ZG)(a,0,4));if(!t)return null;const c=this.#xe.decode(t.inputs,(0,n.ZG)(a,4));return new p(t,t.selector,c)}static from(e){return e instanceof y?e:"string"==typeof e?new y(JSON.parse(e)):"function"==typeof e.formatJson?new y(e.formatJson()):"function"==typeof e.format?new y(e.format("json")):new y(e)}}},19353:(e,a,t)=>{"use strict";t.d(a,{V:()=>b});var c=t(57339),f=t(88081);const d={};function r(e,a){let t=!1;return a<0&&(t=!0,a*=-1),new b(d,`${t?"":"u"}int${a}`,e,{signed:t,width:a})}function n(e,a){return new b(d,`bytes${a||""}`,e,{size:a})}const i=Symbol.for("_ethers_typed");class b{type;value;#E;_typedSymbol;constructor(e,a,t,r){null==r&&(r=null),(0,c.gk)(d,e,"Typed"),(0,f.n)(this,{_typedSymbol:i,type:a,value:t}),this.#E=r,this.format()}format(){if("array"===this.type)throw new Error("");if("dynamicArray"===this.type)throw new Error("");return"tuple"===this.type?`tuple(${this.value.map((e=>e.format())).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return"string"===this.type}get tupleName(){if("tuple"!==this.type)throw TypeError("not a tuple");return this.#E}get arrayLength(){if("array"!==this.type)throw TypeError("not an array");return!0===this.#E?-1:!1===this.#E?this.value.length:null}static from(e,a){return new b(d,e,a)}static uint8(e){return r(e,8)}static uint16(e){return r(e,16)}static uint24(e){return r(e,24)}static uint32(e){return r(e,32)}static uint40(e){return r(e,40)}static uint48(e){return r(e,48)}static uint56(e){return r(e,56)}static uint64(e){return r(e,64)}static uint72(e){return r(e,72)}static uint80(e){return r(e,80)}static uint88(e){return r(e,88)}static uint96(e){return r(e,96)}static uint104(e){return r(e,104)}static uint112(e){return r(e,112)}static uint120(e){return r(e,120)}static uint128(e){return r(e,128)}static uint136(e){return r(e,136)}static uint144(e){return r(e,144)}static uint152(e){return r(e,152)}static uint160(e){return r(e,160)}static uint168(e){return r(e,168)}static uint176(e){return r(e,176)}static uint184(e){return r(e,184)}static uint192(e){return r(e,192)}static uint200(e){return r(e,200)}static uint208(e){return r(e,208)}static uint216(e){return r(e,216)}static uint224(e){return r(e,224)}static uint232(e){return r(e,232)}static uint240(e){return r(e,240)}static uint248(e){return r(e,248)}static uint256(e){return r(e,256)}static uint(e){return r(e,256)}static int8(e){return r(e,-8)}static int16(e){return r(e,-16)}static int24(e){return r(e,-24)}static int32(e){return r(e,-32)}static int40(e){return r(e,-40)}static int48(e){return r(e,-48)}static int56(e){return r(e,-56)}static int64(e){return r(e,-64)}static int72(e){return r(e,-72)}static int80(e){return r(e,-80)}static int88(e){return r(e,-88)}static int96(e){return r(e,-96)}static int104(e){return r(e,-104)}static int112(e){return r(e,-112)}static int120(e){return r(e,-120)}static int128(e){return r(e,-128)}static int136(e){return r(e,-136)}static int144(e){return r(e,-144)}static int152(e){return r(e,-152)}static int160(e){return r(e,-160)}static int168(e){return r(e,-168)}static int176(e){return r(e,-176)}static int184(e){return r(e,-184)}static int192(e){return r(e,-192)}static int200(e){return r(e,-200)}static int208(e){return r(e,-208)}static int216(e){return r(e,-216)}static int224(e){return r(e,-224)}static int232(e){return r(e,-232)}static int240(e){return r(e,-240)}static int248(e){return r(e,-248)}static int256(e){return r(e,-256)}static int(e){return r(e,-256)}static bytes1(e){return n(e,1)}static bytes2(e){return n(e,2)}static bytes3(e){return n(e,3)}static bytes4(e){return n(e,4)}static bytes5(e){return n(e,5)}static bytes6(e){return n(e,6)}static bytes7(e){return n(e,7)}static bytes8(e){return n(e,8)}static bytes9(e){return n(e,9)}static bytes10(e){return n(e,10)}static bytes11(e){return n(e,11)}static bytes12(e){return n(e,12)}static bytes13(e){return n(e,13)}static bytes14(e){return n(e,14)}static bytes15(e){return n(e,15)}static bytes16(e){return n(e,16)}static bytes17(e){return n(e,17)}static bytes18(e){return n(e,18)}static bytes19(e){return n(e,19)}static bytes20(e){return n(e,20)}static bytes21(e){return n(e,21)}static bytes22(e){return n(e,22)}static bytes23(e){return n(e,23)}static bytes24(e){return n(e,24)}static bytes25(e){return n(e,25)}static bytes26(e){return n(e,26)}static bytes27(e){return n(e,27)}static bytes28(e){return n(e,28)}static bytes29(e){return n(e,29)}static bytes30(e){return n(e,30)}static bytes31(e){return n(e,31)}static bytes32(e){return n(e,32)}static address(e){return new b(d,"address",e)}static bool(e){return new b(d,"bool",!!e)}static bytes(e){return new b(d,"bytes",e)}static string(e){return new b(d,"string",e)}static array(e,a){throw new Error("not implemented yet")}static tuple(e,a){throw new Error("not implemented yet")}static overrides(e){return new b(d,"overrides",Object.assign({},e))}static isTyped(e){return e&&"object"==typeof e&&"_typedSymbol"in e&&e._typedSymbol===i}static dereference(e,a){if(b.isTyped(e)){if(e.type!==a)throw new Error(`invalid type: expecetd ${a}, got ${e.type}`);return e.value}return e}}},30031:(e,a,t)=>{"use strict";t.d(a,{b:()=>l});var c=t(2011),f=t(36212),d=t(57339);const r=BigInt(0),n=BigInt(36);function i(e){const a=(e=e.toLowerCase()).substring(2).split(""),t=new Uint8Array(40);for(let e=0;e<40;e++)t[e]=a[e].charCodeAt(0);const d=(0,f.q5)((0,c.S)(t));for(let e=0;e<40;e+=2)d[e>>1]>>4>=8&&(a[e]=a[e].toUpperCase()),(15&d[e>>1])>=8&&(a[e+1]=a[e+1].toUpperCase());return"0x"+a.join("")}const b={};for(let e=0;e<10;e++)b[String(e)]=String(e);for(let e=0;e<26;e++)b[String.fromCharCode(65+e)]=String(10+e);const o=15;const s=function(){const e={};for(let a=0;a<36;a++)e["0123456789abcdefghijklmnopqrstuvwxyz"[a]]=BigInt(a);return e}();function l(e){if((0,d.MR)("string"==typeof e,"invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/)){e.startsWith("0x")||(e="0x"+e);const a=i(e);return(0,d.MR)(!e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||a===e,"bad address checksum","address",e),a}if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){(0,d.MR)(e.substring(2,4)===function(e){let a=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>b[e])).join("");for(;a.length>=o;){let e=a.substring(0,o);a=parseInt(e,10)%97+a.substring(e.length)}let t=String(98-parseInt(a,10)%97);for(;t.length<2;)t="0"+t;return t}(e),"bad icap checksum","address",e);let a=function(e){e=e.toLowerCase();let a=r;for(let t=0;t{"use strict";t.d(a,{$C:()=>d,PW:()=>r,tG:()=>i});var c=t(57339),f=t(30031);function d(e){return e&&"function"==typeof e.getAddress}function r(e){try{return(0,f.b)(e),!0}catch(e){}return!1}async function n(e,a){const t=await a;return null!=t&&"0x0000000000000000000000000000000000000000"!==t||((0,c.vA)("string"!=typeof e,"unconfigured name","UNCONFIGURED_NAME",{value:e}),(0,c.MR)(!1,"invalid AddressLike value; did not resolve to a value address","target",e)),(0,f.b)(t)}function i(e,a){return"string"==typeof e?e.match(/^0x[0-9a-f]{40}$/i)?(0,f.b)(e):((0,c.vA)(null!=a,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),n(e,a.resolveName(e))):d(e)?n(e,e.getAddress()):e&&"function"==typeof e.then?n(e,e):void(0,c.MR)(!1,"unsupported addressable value","target",e)}},7040:(e,a,t)=>{"use strict";t.d(a,{t:()=>i});var c=t(2011),f=t(27033),d=t(36212),r=t(65735),n=t(30031);function i(e){const a=(0,n.b)(e.from);let t=(0,f.Ab)(e.nonce,"tx.nonce").toString(16);return t="0"===t?"0x":t.length%2?"0x0"+t:"0x"+t,(0,n.b)((0,d.ZG)((0,c.S)((0,r.R)([a,t])),12))}},98982:(e,a,t)=>{"use strict";t.d(a,{j:()=>c});const c="0x0000000000000000000000000000000000000000"},13269:(e,a,t)=>{"use strict";t.d(a,{FC:()=>v,NZ:()=>R,Uq:()=>N,yN:()=>w});var c=t(19353),f=t(73622),d=t(41442),r=t(43948),n=t(88081),i=t(57339),b=t(27033),o=t(36212),s=t(24359);const l=BigInt(0);function u(e){return e&&"function"==typeof e.call}function h(e){return e&&"function"==typeof e.estimateGas}function p(e){return e&&"function"==typeof e.resolveName}function g(e){return e&&"function"==typeof e.sendTransaction}function m(e){if(null!=e){if(p(e))return e;if(e.provider)return e.provider}}class x{#u;fragment;constructor(e,a,t){if((0,n.n)(this,{fragment:a}),a.inputs.lengthnull==t[a]?null:e.walkAsync(t[a],((e,a)=>"address"===e?Array.isArray(a)?Promise.all(a.map((e=>(0,d.tG)(e,f)))):(0,d.tG)(a,f):a)))));return e.interface.encodeFilterTopics(a,c)}()}getTopicFilter(){return this.#u}}function y(e,a){return null==e?null:"function"==typeof e[a]?e:e.provider&&"function"==typeof e.provider[a]?e.provider:null}function A(e){return null==e?null:e.provider||null}async function v(e,a){const t=c.V.dereference(e,"overrides");(0,i.MR)("object"==typeof t,"invalid overrides parameter","overrides",e);const f=(0,r.VS)(t);return(0,i.MR)(null==f.to||(a||[]).indexOf("to")>=0,"cannot override to","overrides.to",f.to),(0,i.MR)(null==f.data||(a||[]).indexOf("data")>=0,"cannot override data","overrides.data",f.data),f.from&&(f.from=f.from),f}async function w(e,a,t){const f=y(e,"resolveName"),r=p(f)?f:null;return await Promise.all(a.map(((e,a)=>e.walkAsync(t[a],((e,a)=>(a=c.V.dereference(a,e),"address"===e?(0,d.tG)(a,r):a))))))}function _(e){const a=async function(a){const t=await v(a,["data"]);t.to=await e.getAddress(),t.from&&(t.from=await(0,d.tG)(t.from,m(e.runner)));const c=e.interface,f=(0,b.Ab)(t.value||l,"overrides.value")===l,r="0x"===(t.data||"0x");!c.fallback||c.fallback.payable||!c.receive||r||f||(0,i.MR)(!1,"cannot send data to receive or send value to non-payable fallback","overrides",a),(0,i.MR)(c.fallback||r,"cannot send data to receive-only contract","overrides.data",t.data);const n=c.receive||c.fallback&&c.fallback.payable;return(0,i.MR)(n||f,"cannot send value to non-payable fallback","overrides.value",t.value),(0,i.MR)(c.fallback||r,"cannot send data to receive-only contract","overrides.data",t.data),t},t=async function(t){const c=e.runner;(0,i.vA)(g(c),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const f=await c.sendTransaction(await a(t)),d=A(e.runner);return new s.Cn(e.interface,d,f)},c=async e=>await t(e);return(0,n.n)(c,{_contract:e,estimateGas:async function(t){const c=y(e.runner,"estimateGas");return(0,i.vA)(h(c),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await c.estimateGas(await a(t))},populateTransaction:a,send:t,staticCall:async function(t){const c=y(e.runner,"call");(0,i.vA)(u(c),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const f=await a(t);try{return await c.call(f)}catch(a){if((0,i.E)(a)&&a.data)throw e.interface.makeError(a.data,f);throw a}}}),c}const I=Symbol.for("_ethersInternal_contract"),E=new WeakMap;function C(e){return E.get(e[I])}async function M(e,a){let t,c=null;if(Array.isArray(a)){const c=function(a){if((0,o.Lo)(a,32))return a;const t=e.interface.getEvent(a);return(0,i.MR)(t,"unknown fragment","name",a),t.topicHash};t=a.map((e=>null==e?null:Array.isArray(e)?e.map(c):c(e)))}else"*"===a?t=[null]:"string"==typeof a?(0,o.Lo)(a,32)?t=[a]:(c=e.interface.getEvent(a),(0,i.MR)(c,"unknown fragment","event",a),t=[c.topicHash]):(f=a)&&"object"==typeof f&&"getTopicFilter"in f&&"function"==typeof f.getTopicFilter&&f.fragment?t=await a.getTopicFilter():"fragment"in a?(c=a.fragment,t=[c.topicHash]):(0,i.MR)(!1,"unknown event name","event",a);var f;return t=t.map((e=>{if(null==e)return null;if(Array.isArray(e)){const a=Array.from(new Set(e.map((e=>e.toLowerCase()))).values());return 1===a.length?a[0]:(a.sort(),a)}return e.toLowerCase()})),{fragment:c,tag:t.map((e=>null==e?"null":Array.isArray(e)?e.join("|"):e)).join("&"),topics:t}}async function B(e,a){const{subs:t}=C(e);return t.get((await M(e,a)).tag)||null}async function k(e,a,t){const c=A(e.runner);(0,i.vA)(c,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:a});const{fragment:f,tag:d,topics:r}=await M(e,t),{addr:n,subs:b}=C(e);let o=b.get(d);if(!o){const a={address:n||e,topics:r},i=a=>{let c=f;if(null==c)try{c=e.interface.getEvent(a.topics[0])}catch(e){}if(c){const d=c,r=f?e.interface.decodeEventLog(f,a.data,a.topics):[];S(e,t,r,(c=>new s.HZ(e,c,t,d,a)))}else S(e,t,[],(c=>new s._k(e,c,t,a)))};let l=[];o={tag:d,listeners:[],start:()=>{l.length||l.push(c.on(a,i))},stop:async()=>{if(0==l.length)return;let e=l;l=[],await Promise.all(e),c.off(a,i)}},b.set(d,o)}return o}let L=Promise.resolve();async function S(e,a,t,c){try{await L}catch(e){}const f=async function(e,a,t,c){await L;const f=await B(e,a);if(!f)return!1;const d=f.listeners.length;return f.listeners=f.listeners.filter((({listener:a,once:f})=>{const d=Array.from(t);c&&d.push(c(f?null:a));try{a.call(e,...d)}catch(e){}return!f})),0===f.listeners.length&&(f.stop(),C(e).subs.delete(f.tag)),d>0}(e,a,t,c);return L=f,await f}const T=["then"];class N{target;interface;runner;filters;[I];fallback;constructor(e,a,t,c){(0,i.MR)("string"==typeof e||(0,d.$C)(e),"invalid value for Contract target","target",e),null==t&&(t=null);const r=f.KA.from(a);let b;(0,n.n)(this,{target:e,runner:t,interface:r}),Object.defineProperty(this,I,{value:{}});let l=null,u=null;if(c){const e=A(t);u=new s.Cn(this.interface,e,c)}let h=new Map;if("string"==typeof e)if((0,o.Lo)(e))l=e,b=Promise.resolve(e);else{const a=y(t,"resolveName");if(!p(a))throw(0,i.xz)("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});b=a.resolveName(e).then((a=>{if(null==a)throw(0,i.xz)("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return C(this).addr=a,a}))}else b=e.getAddress().then((e=>{if(null==e)throw new Error("TODO");return C(this).addr=e,e}));var g;g={addrPromise:b,addr:l,deployTx:u,subs:h},E.set(this[I],g);const m=new Proxy({},{get:(e,a,t)=>{if("symbol"==typeof a||T.indexOf(a)>=0)return Reflect.get(e,a,t);try{return this.getEvent(a)}catch(e){if(!(0,i.bJ)(e,"INVALID_ARGUMENT")||"key"!==e.argument)throw e}},has:(e,a)=>T.indexOf(a)>=0?Reflect.has(e,a):Reflect.has(e,a)||this.interface.hasEvent(String(a))});return(0,n.n)(this,{filters:m}),(0,n.n)(this,{fallback:r.receive||r.fallback?_(this):null}),new Proxy(this,{get:(e,a,t)=>{if("symbol"==typeof a||a in e||T.indexOf(a)>=0)return Reflect.get(e,a,t);try{return e.getFunction(a)}catch(e){if(!(0,i.bJ)(e,"INVALID_ARGUMENT")||"key"!==e.argument)throw e}},has:(e,a)=>"symbol"==typeof a||a in e||T.indexOf(a)>=0?Reflect.has(e,a):e.interface.hasFunction(a)})}connect(e){return new N(this.target,this.interface,e)}attach(e){return new N(e,this.interface,this.runner)}async getAddress(){return await C(this).addrPromise}async getDeployedCode(){const e=A(this.runner);(0,i.vA)(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const a=await e.getCode(await this.getAddress());return"0x"===a?null:a}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(null!=await this.getDeployedCode())return this;const a=A(this.runner);return(0,i.vA)(null!=a,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise(((e,t)=>{const c=async()=>{try{if(null!=await this.getDeployedCode())return e(this);a.once("block",c)}catch(e){t(e)}};c()}))}deploymentTransaction(){return C(this).deployTx}getFunction(e){"string"!=typeof e&&(e=e.format());const a=function(e,a){const t=function(...t){const c=e.interface.getFunction(a,t);return(0,i.vA)(c,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:a,args:t}}),c},c=async function(...a){const c=t(...a);let f={};if(c.inputs.length+1===a.length&&(f=await v(a.pop()),f.from&&(f.from=await(0,d.tG)(f.from,m(e.runner)))),c.inputs.length!==a.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const r=await w(e.runner,c.inputs,a);return Object.assign({},f,await(0,n.k)({to:e.getAddress(),data:e.interface.encodeFunctionData(c,r)}))},f=async function(...e){const a=await b(...e);return 1===a.length?a[0]:a},r=async function(...a){const t=e.runner;(0,i.vA)(g(t),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const f=await t.sendTransaction(await c(...a)),d=A(e.runner);return new s.Cn(e.interface,d,f)},b=async function(...a){const f=y(e.runner,"call");(0,i.vA)(u(f),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const d=await c(...a);let r="0x";try{r=await f.call(d)}catch(a){if((0,i.E)(a)&&a.data)throw e.interface.makeError(a.data,d);throw a}const n=t(...a);return e.interface.decodeFunctionResult(n,r)},o=async(...e)=>t(...e).constant?await f(...e):await r(...e);return(0,n.n)(o,{name:e.interface.getFunctionName(a),_contract:e,_key:a,getFragment:t,estimateGas:async function(...a){const t=y(e.runner,"estimateGas");return(0,i.vA)(h(t),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await t.estimateGas(await c(...a))},populateTransaction:c,send:r,staticCall:f,staticCallResult:b}),Object.defineProperty(o,"fragment",{configurable:!1,enumerable:!0,get:()=>{const t=e.interface.getFunction(a);return(0,i.vA)(t,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:a}}),t}}),o}(this,e);return a}getEvent(e){return"string"!=typeof e&&(e=e.format()),function(e,a){const t=function(...t){const c=e.interface.getEvent(a,t);return(0,i.vA)(c,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:a,args:t}}),c},c=function(...a){return new x(e,t(...a),a)};return(0,n.n)(c,{name:e.interface.getEventName(a),_contract:e,_key:a,getFragment:t}),Object.defineProperty(c,"fragment",{configurable:!1,enumerable:!0,get:()=>{const t=e.interface.getEvent(a);return(0,i.vA)(t,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:a}}),t}}),c}(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,a,t){null==a&&(a=0),null==t&&(t="latest");const{addr:c,addrPromise:f}=C(this),d=c||await f,{fragment:n,topics:b}=await M(this,e),o={address:d,topics:b,fromBlock:a,toBlock:t},l=A(this.runner);return(0,i.vA)(l,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await l.getLogs(o)).map((e=>{let a=n;if(null==a)try{a=this.interface.getEvent(e.topics[0])}catch(e){}if(a)try{return new s.vu(e,this.interface,a)}catch(a){return new s.AA(e,a)}return new r.tG(e,l)}))}async on(e,a){const t=await k(this,"on",e);return t.listeners.push({listener:a,once:!1}),t.start(),this}async once(e,a){const t=await k(this,"once",e);return t.listeners.push({listener:a,once:!0}),t.start(),this}async emit(e,...a){return await S(this,e,a,null)}async listenerCount(e){if(e){const a=await B(this,e);return a?a.listeners.length:0}const{subs:a}=C(this);let t=0;for(const{listeners:e}of a.values())t+=e.length;return t}async listeners(e){if(e){const a=await B(this,e);return a?a.listeners.map((({listener:e})=>e)):[]}const{subs:a}=C(this);let t=[];for(const{listeners:e}of a.values())t=t.concat(e.map((({listener:e})=>e)));return t}async off(e,a){const t=await B(this,e);if(!t)return this;if(a){const e=t.listeners.map((({listener:e})=>e)).indexOf(a);e>=0&&t.listeners.splice(e,1)}return null!=a&&0!==t.listeners.length||(t.stop(),C(this).subs.delete(t.tag)),this}async removeAllListeners(e){if(e){const a=await B(this,e);if(!a)return this;a.stop(),C(this).subs.delete(a.tag)}else{const{subs:e}=C(this);for(const{tag:a,stop:t}of e.values())t(),e.delete(a)}return this}async addListener(e,a){return await this.on(e,a)}async removeListener(e,a){return await this.off(e,a)}static buildClass(e){return class extends N{constructor(a,t=null){super(a,e,t)}}}static from(e,a,t){return null==t&&(t=null),new this(e,a,t)}}class R extends(function(){return N}()){}},24359:(e,a,t)=>{"use strict";t.d(a,{AA:()=>n,Cn:()=>b,HZ:()=>s,_k:()=>o,vu:()=>r});var c=t(43948),f=t(88081),d=t(99381);class r extends c.tG{interface;fragment;args;constructor(e,a,t){super(e,e.provider);const c=a.decodeEventLog(t,e.data,e.topics);(0,f.n)(this,{args:c,fragment:t,interface:a})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class n extends c.tG{error;constructor(e,a){super(e,e.provider),(0,f.n)(this,{error:a})}}class i extends c.z5{#ve;constructor(e,a,t){super(t,a),this.#ve=e}get logs(){return super.logs.map((e=>{const a=e.topics.length?this.#ve.getEvent(e.topics[0]):null;if(a)try{return new r(e,this.#ve,a)}catch(a){return new n(e,a)}return e}))}}class b extends c.uI{#ve;constructor(e,a,t){super(t,a),this.#ve=e}async wait(e,a){const t=await super.wait(e,a);return null==t?null:new i(this.#ve,this.provider,t)}}class o extends d.z{log;constructor(e,a,t,c){super(e,a,t),(0,f.n)(this,{log:c})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class s extends o{constructor(e,a,t,c,d){super(e,a,t,new r(d,e.interface,c));const n=e.interface.decodeEventLog(c,this.log.data,this.log.topics);(0,f.n)(this,{args:n,fragment:c})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}},68682:(e,a,t)=>{"use strict";t.d(a,{n1:()=>x,Gz:()=>y,T_:()=>A,po:()=>v});var c=t(21454),f=t(2200),d=t(78226),r=t(6800),n=t(79271),i=t(32531);const[b,o]=(()=>n.Ay.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((e=>BigInt(e)))))(),s=new Uint32Array(80),l=new Uint32Array(80);class u extends r.D{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:a,Bh:t,Bl:c,Ch:f,Cl:d,Dh:r,Dl:n,Eh:i,El:b,Fh:o,Fl:s,Gh:l,Gl:u,Hh:h,Hl:p}=this;return[e,a,t,c,f,d,r,n,i,b,o,s,l,u,h,p]}set(e,a,t,c,f,d,r,n,i,b,o,s,l,u,h,p){this.Ah=0|e,this.Al=0|a,this.Bh=0|t,this.Bl=0|c,this.Ch=0|f,this.Cl=0|d,this.Dh=0|r,this.Dl=0|n,this.Eh=0|i,this.El=0|b,this.Fh=0|o,this.Fl=0|s,this.Gh=0|l,this.Gl=0|u,this.Hh=0|h,this.Hl=0|p}process(e,a){for(let t=0;t<16;t++,a+=4)s[t]=e.getUint32(a),l[t]=e.getUint32(a+=4);for(let e=16;e<80;e++){const a=0|s[e-15],t=0|l[e-15],c=n.Ay.rotrSH(a,t,1)^n.Ay.rotrSH(a,t,8)^n.Ay.shrSH(a,t,7),f=n.Ay.rotrSL(a,t,1)^n.Ay.rotrSL(a,t,8)^n.Ay.shrSL(a,t,7),d=0|s[e-2],r=0|l[e-2],i=n.Ay.rotrSH(d,r,19)^n.Ay.rotrBH(d,r,61)^n.Ay.shrSH(d,r,6),b=n.Ay.rotrSL(d,r,19)^n.Ay.rotrBL(d,r,61)^n.Ay.shrSL(d,r,6),o=n.Ay.add4L(f,b,l[e-7],l[e-16]),u=n.Ay.add4H(o,c,i,s[e-7],s[e-16]);s[e]=0|u,l[e]=0|o}let{Ah:t,Al:c,Bh:f,Bl:d,Ch:r,Cl:i,Dh:u,Dl:h,Eh:p,El:g,Fh:m,Fl:x,Gh:y,Gl:A,Hh:v,Hl:w}=this;for(let e=0;e<80;e++){const a=n.Ay.rotrSH(p,g,14)^n.Ay.rotrSH(p,g,18)^n.Ay.rotrBH(p,g,41),_=n.Ay.rotrSL(p,g,14)^n.Ay.rotrSL(p,g,18)^n.Ay.rotrBL(p,g,41),I=p&m^~p&y,E=g&x^~g&A,C=n.Ay.add5L(w,_,E,o[e],l[e]),M=n.Ay.add5H(C,v,a,I,b[e],s[e]),B=0|C,k=n.Ay.rotrSH(t,c,28)^n.Ay.rotrBH(t,c,34)^n.Ay.rotrBH(t,c,39),L=n.Ay.rotrSL(t,c,28)^n.Ay.rotrBL(t,c,34)^n.Ay.rotrBL(t,c,39),S=t&f^t&r^f&r,T=c&d^c&i^d&i;v=0|y,w=0|A,y=0|m,A=0|x,m=0|p,x=0|g,({h:p,l:g}=n.Ay.add(0|u,0|h,0|M,0|B)),u=0|r,h=0|i,r=0|f,i=0|d,f=0|t,d=0|c;const N=n.Ay.add3L(B,L,T);t=n.Ay.add3H(N,M,k,S),c=0|N}({h:t,l:c}=n.Ay.add(0|this.Ah,0|this.Al,0|t,0|c)),({h:f,l:d}=n.Ay.add(0|this.Bh,0|this.Bl,0|f,0|d)),({h:r,l:i}=n.Ay.add(0|this.Ch,0|this.Cl,0|r,0|i)),({h:u,l:h}=n.Ay.add(0|this.Dh,0|this.Dl,0|u,0|h)),({h:p,l:g}=n.Ay.add(0|this.Eh,0|this.El,0|p,0|g)),({h:m,l:x}=n.Ay.add(0|this.Fh,0|this.Fl,0|m,0|x)),({h:y,l:A}=n.Ay.add(0|this.Gh,0|this.Gl,0|y,0|A)),({h:v,l:w}=n.Ay.add(0|this.Hh,0|this.Hl,0|v,0|w)),this.set(t,c,f,d,r,i,u,h,p,g,m,x,y,A,v,w)}roundClean(){s.fill(0),l.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const h=(0,i.ld)((()=>new u));var p=t(57339);const g=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}(),m=g.crypto||g.msCrypto;function x(e){switch(e){case"sha256":return d.s.create();case"sha512":return h.create()}(0,p.MR)(!1,"invalid hashing algorithm name","algorithm",e)}function y(e,a){const t={sha256:d.s,sha512:h}[e];return(0,p.MR)(null!=t,"invalid hmac algorithm","algorithm",e),c.w.create(t,a)}function A(e,a,t,c,r){const n={sha256:d.s,sha512:h}[r];return(0,p.MR)(null!=n,"invalid pbkdf2 algorithm","algorithm",r),(0,f.A)(n,e,a,{c:t,dkLen:c})}function v(e){(0,p.vA)(null!=m,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),(0,p.MR)(Number.isInteger(e)&&e>0&&e<=1024,"invalid length","length",e);const a=new Uint8Array(e);return m.getRandomValues(a),a}},2011:(e,a,t)=>{"use strict";t.d(a,{S:()=>E});var c=t(89190),f=t(79271),d=t(32531);const[r,n,i]=[[],[],[]],b=BigInt(0),o=BigInt(1),s=BigInt(2),l=BigInt(7),u=BigInt(256),h=BigInt(113);for(let e=0,a=o,t=1,c=0;e<24;e++){[t,c]=[c,(2*t+3*c)%5],r.push(2*(5*c+t)),n.push((e+1)*(e+2)/2%64);let f=b;for(let e=0;e<7;e++)a=(a<>l)*h)%u,a&s&&(f^=o<<(o<t>32?(0,f.WM)(e,a,t):(0,f.P5)(e,a,t),x=(e,a,t)=>t>32?(0,f.im)(e,a,t):(0,f.B4)(e,a,t);class y extends d.Vw{constructor(e,a,t,f=!1,r=24){if(super(),this.blockLen=e,this.suffix=a,this.outputLen=t,this.enableXOF=f,this.rounds=r,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,c.ai)(t),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,d.DH)(this.state)}keccak(){!function(e,a=24){const t=new Uint32Array(10);for(let c=24-a;c<24;c++){for(let a=0;a<10;a++)t[a]=e[a]^e[a+10]^e[a+20]^e[a+30]^e[a+40];for(let a=0;a<10;a+=2){const c=(a+8)%10,f=(a+2)%10,d=t[f],r=t[f+1],n=m(d,r,1)^t[c],i=x(d,r,1)^t[c+1];for(let t=0;t<50;t+=10)e[a+t]^=n,e[a+t+1]^=i}let a=e[2],f=e[3];for(let t=0;t<24;t++){const c=n[t],d=m(a,f,c),i=x(a,f,c),b=r[t];a=e[b],f=e[b+1],e[b]=d,e[b+1]=i}for(let a=0;a<50;a+=10){for(let c=0;c<10;c++)t[c]=e[a+c];for(let c=0;c<10;c++)e[a+c]^=~t[(c+2)%10]&t[(c+4)%10]}e[0]^=p[c],e[1]^=g[c]}t.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){(0,c.t2)(this);const{blockLen:a,state:t}=this,f=(e=(0,d.ZJ)(e)).length;for(let c=0;c=t&&this.keccak();const d=Math.min(t-this.posOut,f-c);e.set(a.subarray(this.posOut,this.posOut+d),c),this.posOut+=d,c+=d}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,c.ai)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,c.CG)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:a,suffix:t,outputLen:c,rounds:f,enableXOF:d}=this;return e||(e=new y(a,t,c,d,f)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=f,e.suffix=t,e.outputLen=c,e.enableXOF=d,e.destroyed=this.destroyed,e}}const A=((e,a,t)=>(0,d.ld)((()=>new y(a,e,t))))(1,136,32);var v=t(36212);let w=!1;const _=function(e){return A(e)};let I=_;function E(e){const a=(0,v.q5)(e,"data");return(0,v.c$)(I(a))}E._=_,E.lock=function(){w=!0},E.register=function(e){if(w)throw new TypeError("keccak256 is locked");I=e},Object.freeze(E)},68650:(e,a,t)=>{"use strict";t.d(a,{s:()=>s});var c=t(68682),f=t(36212);const d=function(e){return(0,c.n1)("sha256").update(e).digest()},r=function(e){return(0,c.n1)("sha512").update(e).digest()};let n=d,i=r,b=!1,o=!1;function s(e){const a=(0,f.q5)(e,"data");return(0,f.c$)(n(a))}function l(e){const a=(0,f.q5)(e,"data");return(0,f.c$)(i(a))}s._=d,s.lock=function(){b=!0},s.register=function(e){if(b)throw new Error("sha256 is locked");n=e},Object.freeze(s),l._=r,l.lock=function(){o=!0},l.register=function(e){if(o)throw new Error("sha512 is locked");i=e},Object.freeze(s)},20260:(e,a,t)=>{"use strict";t.d(a,{t:()=>p});const c="0x0000000000000000000000000000000000000000000000000000000000000000";var f=t(36212),d=t(27033),r=t(57339);const n=BigInt(0),i=BigInt(1),b=BigInt(2),o=BigInt(27),s=BigInt(28),l=BigInt(35),u={};function h(e){return(0,f.nx)((0,d.c4)(e),32)}class p{#we;#_e;#Ie;#Ee;get r(){return this.#we}set r(e){(0,r.MR)(32===(0,f.pO)(e),"invalid r","value",e),this.#we=(0,f.c$)(e)}get s(){return this.#_e}set s(e){(0,r.MR)(32===(0,f.pO)(e),"invalid s","value",e);const a=(0,f.c$)(e);(0,r.MR)(parseInt(a.substring(0,3))<8,"non-canonical s","value",a),this.#_e=a}get v(){return this.#Ie}set v(e){const a=(0,d.WZ)(e,"value");(0,r.MR)(27===a||28===a,"invalid v","v",e),this.#Ie=a}get networkV(){return this.#Ee}get legacyChainId(){const e=this.networkV;return null==e?null:p.getChainId(e)}get yParity(){return 27===this.v?0:1}get yParityAndS(){const e=(0,f.q5)(this.s);return this.yParity&&(e[0]|=128),(0,f.c$)(e)}get compactSerialized(){return(0,f.xW)([this.r,this.yParityAndS])}get serialized(){return(0,f.xW)([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(e,a,t,c){(0,r.gk)(e,u,"Signature"),this.#we=a,this.#_e=t,this.#Ie=c,this.#Ee=null}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new p(u,this.r,this.s,this.v);return this.networkV&&(e.#Ee=this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:null!=e?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const a=(0,d.Ab)(e,"v");return a==o||a==s?n:((0,r.MR)(a>=l,"invalid EIP-155 v","v",e),(a-l)/b)}static getChainIdV(e,a){return(0,d.Ab)(e)*b+BigInt(35+a-27)}static getNormalizedV(e){const a=(0,d.Ab)(e);return a===n||a===o?27:a===i||a===s?28:((0,r.MR)(a>=l,"invalid v","v",e),a&i?27:28)}static from(e){function a(a,t){(0,r.MR)(a,t,"signature",e)}if(null==e)return new p(u,c,c,27);if("string"==typeof e){const t=(0,f.q5)(e,"signature");if(64===t.length){const e=(0,f.c$)(t.slice(0,32)),a=t.slice(32,64),c=128&a[0]?28:27;return a[0]&=127,new p(u,e,(0,f.c$)(a),c)}if(65===t.length){const e=(0,f.c$)(t.slice(0,32)),c=t.slice(32,64);a(!(128&c[0]),"non-canonical s");const d=p.getNormalizedV(t[64]);return new p(u,e,(0,f.c$)(c),d)}a(!1,"invalid raw signature length")}if(e instanceof p)return e.clone();const t=e.r;a(null!=t,"missing r");const n=h(t),i=function(e,t){if(null!=e)return h(e);if(null!=t){a((0,f.Lo)(t,32),"invalid yParityAndS");const e=(0,f.q5)(t);return e[0]&=127,(0,f.c$)(e)}a(!1,"missing s")}(e.s,e.yParityAndS);a(!(128&(0,f.q5)(i)[0]),"non-canonical s");const{networkV:b,v:o}=function(e,t,c){if(null!=e){const a=(0,d.Ab)(e);return{networkV:a>=l?a:void 0,v:p.getNormalizedV(a)}}if(null!=t)return a((0,f.Lo)(t,32),"invalid yParityAndS"),{v:128&(0,f.q5)(t)[0]?28:27};if(null!=c){switch((0,d.WZ)(c,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}a(!1,"invalid yParity")}a(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),s=new p(u,n,i,o);return b&&(s.#Ee=b),a(null==e.yParity||(0,d.WZ)(e.yParity,"sig.yParity")===s.yParity,"yParity mismatch"),a(null==e.yParityAndS||e.yParityAndS===s.yParityAndS,"yParityAndS mismatch"),s}}},72588:(e,a,t)=>{"use strict";t.d(a,{h:()=>be});var c={};t.r(c),t.d(c,{OG:()=>x,My:()=>b,Ph:()=>l,lX:()=>u,Id:()=>m,fg:()=>v,qj:()=>g,aT:()=>s,lq:()=>h,z:()=>p,Q5:()=>_});var f=t(78226);BigInt(0);const d=BigInt(1),r=BigInt(2),n=e=>e instanceof Uint8Array,i=Array.from({length:256},((e,a)=>a.toString(16).padStart(2,"0")));function b(e){if(!n(e))throw new Error("Uint8Array expected");let a="";for(let t=0;te+a.length),0));let t=0;return e.forEach((e=>{if(!n(e))throw new Error("Uint8Array expected");a.set(e,t),t+=e.length})),a}const x=e=>(r<new Uint8Array(e),A=e=>Uint8Array.from(e);function v(e,a,t){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof a||a<2)throw new Error("qByteLen must be a number");if("function"!=typeof t)throw new Error("hmacFn must be a function");let c=y(e),f=y(e),d=0;const r=()=>{c.fill(1),f.fill(0),d=0},n=(...e)=>t(f,c,...e),i=(e=y())=>{f=n(A([0]),e),c=n(),0!==e.length&&(f=n(A([1]),e),c=n())},b=()=>{if(d++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const t=[];for(;e{let t;for(r(),i(e);!(t=a(b()));)i();return r(),t}}const w={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,a)=>a.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function _(e,a,t={}){const c=(a,t,c)=>{const f=w[t];if("function"!=typeof f)throw new Error(`Invalid validator "${t}", expected function`);const d=e[a];if(!(c&&void 0===d||f(d,e)))throw new Error(`Invalid param ${String(a)}=${d} (${typeof d}), expected ${t}`)};for(const[e,t]of Object.entries(a))c(e,t,!1);for(const[e,a]of Object.entries(t))c(e,a,!0);return e}const I=BigInt(0),E=BigInt(1),C=BigInt(2),M=BigInt(3),B=BigInt(4),k=BigInt(5),L=BigInt(8);function S(e,a){const t=e%a;return t>=I?t:a+t}function T(e,a,t){if(t<=I||a 0");if(t===E)return I;let c=E;for(;a>I;)a&E&&(c=c*e%t),e=e*e%t,a>>=E;return c}function N(e,a,t){let c=e;for(;a-- >I;)c*=c,c%=t;return c}function R(e,a){if(e===I||a<=I)throw new Error(`invert: expected positive integers, got n=${e} mod=${a}`);let t=S(e,a),c=a,f=I,d=E,r=E,n=I;for(;t!==I;){const e=c/t,a=c%t,i=f-r*e,b=d-n*e;c=t,t=a,f=r,d=n,r=i,n=b}if(c!==E)throw new Error("invert: does not exist");return S(f,a)}BigInt(9),BigInt(16);const P=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function D(e,a){const t=void 0!==a?a:e.toString(2).length;return{nBitLength:t,nByteLength:Math.ceil(t/8)}}function O(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const a=e.toString(2).length;return Math.ceil(a/8)}function F(e){const a=O(e);return a+Math.ceil(a/2)}var Q=t(21454),U=t(32531);const j=BigInt(0),H=BigInt(1);function q(e){return _(e.Fp,P.reduce(((e,a)=>(e[a]="function",e)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"})),_(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...D(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const{Ph:$,aT:z}=c,G={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(e){const{Err:a}=G;if(e.length<2||2!==e[0])throw new a("Invalid signature integer tag");const t=e[1],c=e.subarray(2,t+2);if(!t||c.length!==t)throw new a("Invalid signature integer: wrong length");if(128&c[0])throw new a("Invalid signature integer: negative");if(0===c[0]&&!(128&c[1]))throw new a("Invalid signature integer: unnecessary leading zero");return{d:$(c),l:e.subarray(t+2)}},toSig(e){const{Err:a}=G,t="string"==typeof e?z(e):e;if(!(t instanceof Uint8Array))throw new Error("ui8a expected");let c=t.length;if(c<2||48!=t[0])throw new a("Invalid signature tag");if(t[1]!==c-2)throw new a("Invalid signature: incorrect length");const{d:f,l:d}=G._parseInt(t.subarray(2)),{d:r,l:n}=G._parseInt(d);if(n.length)throw new a("Invalid signature: left bytes after parsing");return{r:f,s:r}},hexFromSig(e){const a=e=>8&Number.parseInt(e[0],16)?"00"+e:e,t=e=>{const a=e.toString(16);return 1&a.length?`0${a}`:a},c=a(t(e.s)),f=a(t(e.r)),d=c.length/2,r=f.length/2,n=t(d),i=t(r);return`30${t(r+d+4)}02${i}${f}02${n}${c}`}},K=BigInt(0),V=BigInt(1),Z=(BigInt(2),BigInt(3));function J(e){const a=function(e){const a=q(e);return _(a,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...a})}(e),{Fp:t,n:c}=a,f=t.BYTES+1,d=2*t.BYTES+1;function r(e){return S(e,c)}function n(e){return R(e,c)}const{ProjectivePoint:i,normPrivateKeyToScalar:o,weierstrassEquation:y,isWithinCurveOrder:A}=function(e){const a=function(e){const a=q(e);_(a,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:t,Fp:c,a:f}=a;if(t){if(!c.eql(f,c.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof t||"bigint"!=typeof t.beta||"function"!=typeof t.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...a})}(e),{Fp:t}=a,c=a.toBytes||((e,a,c)=>{const f=a.toAffine();return m(Uint8Array.from([4]),t.toBytes(f.x),t.toBytes(f.y))}),f=a.fromBytes||(e=>{const a=e.subarray(1);return{x:t.fromBytes(a.subarray(0,t.BYTES)),y:t.fromBytes(a.subarray(t.BYTES,2*t.BYTES))}});function d(e){const{a:c,b:f}=a,d=t.sqr(e),r=t.mul(d,e);return t.add(t.add(r,t.mul(e,c)),f)}if(!t.eql(t.sqr(a.Gy),d(a.Gx)))throw new Error("bad generator point: equation left != right");function r(e){return"bigint"==typeof e&&Kt.eql(e,t.ZERO);return f(a)&&f(c)?u.ZERO:new u(a,c,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const a=t.invertBatch(e.map((e=>e.pz)));return e.map(((e,t)=>e.toAffine(a[t]))).map(u.fromAffine)}static fromHex(e){const a=u.fromAffine(f(g("pointHex",e)));return a.assertValidity(),a}static fromPrivateKey(e){return u.BASE.multiply(i(e))}_setWindowSize(e){this._WINDOW_SIZE=e,o.delete(this)}assertValidity(){if(this.is0()){if(a.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:e,y:c}=this.toAffine();if(!t.isValid(e)||!t.isValid(c))throw new Error("bad point: x or y not FE");const f=t.sqr(c),r=d(e);if(!t.eql(f,r))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:e}=this.toAffine();if(t.isOdd)return!t.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){s(e);const{px:a,py:c,pz:f}=this,{px:d,py:r,pz:n}=e,i=t.eql(t.mul(a,n),t.mul(d,f)),b=t.eql(t.mul(c,n),t.mul(r,f));return i&&b}negate(){return new u(this.px,t.neg(this.py),this.pz)}double(){const{a:e,b:c}=a,f=t.mul(c,Z),{px:d,py:r,pz:n}=this;let i=t.ZERO,b=t.ZERO,o=t.ZERO,s=t.mul(d,d),l=t.mul(r,r),h=t.mul(n,n),p=t.mul(d,r);return p=t.add(p,p),o=t.mul(d,n),o=t.add(o,o),i=t.mul(e,o),b=t.mul(f,h),b=t.add(i,b),i=t.sub(l,b),b=t.add(l,b),b=t.mul(i,b),i=t.mul(p,i),o=t.mul(f,o),h=t.mul(e,h),p=t.sub(s,h),p=t.mul(e,p),p=t.add(p,o),o=t.add(s,s),s=t.add(o,s),s=t.add(s,h),s=t.mul(s,p),b=t.add(b,s),h=t.mul(r,n),h=t.add(h,h),s=t.mul(h,p),i=t.sub(i,s),o=t.mul(h,l),o=t.add(o,o),o=t.add(o,o),new u(i,b,o)}add(e){s(e);const{px:c,py:f,pz:d}=this,{px:r,py:n,pz:i}=e;let b=t.ZERO,o=t.ZERO,l=t.ZERO;const h=a.a,p=t.mul(a.b,Z);let g=t.mul(c,r),m=t.mul(f,n),x=t.mul(d,i),y=t.add(c,f),A=t.add(r,n);y=t.mul(y,A),A=t.add(g,m),y=t.sub(y,A),A=t.add(c,d);let v=t.add(r,i);return A=t.mul(A,v),v=t.add(g,x),A=t.sub(A,v),v=t.add(f,d),b=t.add(n,i),v=t.mul(v,b),b=t.add(m,x),v=t.sub(v,b),l=t.mul(h,A),b=t.mul(p,x),l=t.add(b,l),b=t.sub(m,l),l=t.add(m,l),o=t.mul(b,l),m=t.add(g,g),m=t.add(m,g),x=t.mul(h,x),A=t.mul(p,A),m=t.add(m,x),x=t.sub(g,x),x=t.mul(h,x),A=t.add(A,x),g=t.mul(m,A),o=t.add(o,g),g=t.mul(v,A),b=t.mul(y,b),b=t.sub(b,g),g=t.mul(y,m),l=t.mul(v,l),l=t.add(l,g),new u(b,o,l)}subtract(e){return this.add(e.negate())}is0(){return this.equals(u.ZERO)}wNAF(e){return p.wNAFCached(this,o,e,(e=>{const a=t.invertBatch(e.map((e=>e.pz)));return e.map(((e,t)=>e.toAffine(a[t]))).map(u.fromAffine)}))}multiplyUnsafe(e){const c=u.ZERO;if(e===K)return c;if(n(e),e===V)return this;const{endo:f}=a;if(!f)return p.unsafeLadder(this,e);let{k1neg:d,k1:r,k2neg:i,k2:b}=f.splitScalar(e),o=c,s=c,l=this;for(;r>K||b>K;)r&V&&(o=o.add(l)),b&V&&(s=s.add(l)),l=l.double(),r>>=V,b>>=V;return d&&(o=o.negate()),i&&(s=s.negate()),s=new u(t.mul(s.px,f.beta),s.py,s.pz),o.add(s)}multiply(e){n(e);let c,f,d=e;const{endo:r}=a;if(r){const{k1neg:e,k1:a,k2neg:n,k2:i}=r.splitScalar(d);let{p:b,f:o}=this.wNAF(a),{p:s,f:l}=this.wNAF(i);b=p.constTimeNegate(e,b),s=p.constTimeNegate(n,s),s=new u(t.mul(s.px,r.beta),s.py,s.pz),c=b.add(s),f=o.add(l)}else{const{p:e,f:a}=this.wNAF(d);c=e,f=a}return u.normalizeZ([c,f])[0]}multiplyAndAddUnsafe(e,a,t){const c=u.BASE,f=(e,a)=>a!==K&&a!==V&&e.equals(c)?e.multiply(a):e.multiplyUnsafe(a),d=f(this,a).add(f(e,t));return d.is0()?void 0:d}toAffine(e){const{px:a,py:c,pz:f}=this,d=this.is0();null==e&&(e=d?t.ONE:t.inv(f));const r=t.mul(a,e),n=t.mul(c,e),i=t.mul(f,e);if(d)return{x:t.ZERO,y:t.ZERO};if(!t.eql(i,t.ONE))throw new Error("invZ was invalid");return{x:r,y:n}}isTorsionFree(){const{h:e,isTorsionFree:t}=a;if(e===V)return!0;if(t)return t(u,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:t}=a;return e===V?this:t?t(u,this):this.multiplyUnsafe(a.h)}toRawBytes(e=!0){return this.assertValidity(),c(u,this,e)}toHex(e=!0){return b(this.toRawBytes(e))}}u.BASE=new u(a.Gx,a.Gy,t.ONE),u.ZERO=new u(t.ZERO,t.ONE,t.ZERO);const h=a.nBitLength,p=function(e,a){const t=(e,a)=>{const t=a.negate();return e?t:a},c=e=>({windows:Math.ceil(a/e)+1,windowSize:2**(e-1)});return{constTimeNegate:t,unsafeLadder(a,t){let c=e.ZERO,f=a;for(;t>j;)t&H&&(c=c.add(f)),f=f.double(),t>>=H;return c},precomputeWindow(e,a){const{windows:t,windowSize:f}=c(a),d=[];let r=e,n=r;for(let e=0;e>=l,c>n&&(c-=s,d+=H);const r=a,u=a+Math.abs(c)-1,h=e%2!=0,p=c<0;0===c?b=b.add(t(h,f[r])):i=i.add(t(p,f[u]))}return{p:i,f:b}},wNAFCached(e,a,t,c){const f=e._WINDOW_SIZE||1;let d=a.get(e);return d||(d=this.precomputeWindow(e,f),1!==f&&a.set(e,c(d))),this.wNAF(f,d,t)}}}(u,a.endo?Math.ceil(h/2):h);return{CURVE:a,ProjectivePoint:u,normPrivateKeyToScalar:i,weierstrassEquation:d,isWithinCurveOrder:r}}({...a,toBytes(e,a,c){const f=a.toAffine(),d=t.toBytes(f.x),r=m;return c?r(Uint8Array.from([a.hasEvenY()?2:3]),d):r(Uint8Array.from([4]),d,t.toBytes(f.y))},fromBytes(e){const a=e.length,c=e[0],r=e.subarray(1);if(a!==f||2!==c&&3!==c){if(a===d&&4===c)return{x:t.fromBytes(r.subarray(0,t.BYTES)),y:t.fromBytes(r.subarray(t.BYTES,2*t.BYTES))};throw new Error(`Point of length ${a} was invalid. Expected ${f} compressed bytes or ${d} uncompressed bytes`)}{const e=l(r);if(!(K<(n=e)&&nb(h(e,a.nByteLength));function I(e){return e>c>>V}const C=(e,a,t)=>l(e.slice(a,t));class M{constructor(e,a,t){this.r=e,this.s=a,this.recovery=t,this.assertValidity()}static fromCompact(e){const t=a.nByteLength;return e=g("compactSignature",e,2*t),new M(C(e,0,t),C(e,t,2*t))}static fromDER(e){const{r:a,s:t}=G.toSig(g("DER",e));return new M(a,t)}assertValidity(){if(!A(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!A(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new M(this.r,this.s,e)}recoverPublicKey(e){const{r:c,s:f,recovery:d}=this,b=T(g("msgHash",e));if(null==d||![0,1,2,3].includes(d))throw new Error("recovery id invalid");const o=2===d||3===d?c+a.n:c;if(o>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");const s=1&d?"03":"02",l=i.fromHex(s+w(o)),u=n(o),h=r(-b*u),p=r(f*u),m=i.BASE.multiplyAndAddUnsafe(l,h,p);if(!m)throw new Error("point at infinify");return m.assertValidity(),m}hasHighS(){return I(this.s)}normalizeS(){return this.hasHighS()?new M(this.r,r(-this.s),this.recovery):this}toDERRawBytes(){return s(this.toDERHex())}toDERHex(){return G.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return s(this.toCompactHex())}toCompactHex(){return w(this.r)+w(this.s)}}const B={isValidPrivateKey(e){try{return o(e),!0}catch(e){return!1}},normPrivateKeyToScalar:o,randomPrivateKey:()=>{const e=F(a.n);return function(e,a,t=!1){const c=e.length,f=O(a),d=F(a);if(c<16||c1024)throw new Error(`expected ${d}-1024 bytes of input, got ${c}`);const r=S(t?l(e):u(e),a-E)+E;return t?p(r,f):h(r,f)}(a.randomBytes(e),a.n)},precompute:(e=8,a=i.BASE)=>(a._setWindowSize(e),a.multiply(BigInt(3)),a)};function k(e){const a=e instanceof Uint8Array,t="string"==typeof e,c=(a||t)&&e.length;return a?c===f||c===d:t?c===2*f||c===2*d:e instanceof i}const L=a.bits2int||function(e){const t=l(e),c=8*e.length-a.nBitLength;return c>0?t>>BigInt(c):t},T=a.bits2int_modN||function(e){return r(L(e))},N=x(a.nBitLength);function P(e){if("bigint"!=typeof e)throw new Error("bigint expected");if(!(K<=e&&ee in f)))throw new Error("sign() legacy options not supported");const{hash:d,randomBytes:b}=a;let{lowS:s,prehash:l,extraEntropy:u}=f;null==s&&(s=!0),e=g("msgHash",e),l&&(e=g("prehashed msgHash",d(e)));const h=T(e),p=o(c),x=[P(p),P(h)];if(null!=u){const e=!0===u?b(t.BYTES):u;x.push(g("extraEntropy",e))}const y=m(...x),v=h;return{seed:y,k2sig:function(e){const a=L(e);if(!A(a))return;const t=n(a),c=i.BASE.multiply(a).toAffine(),f=r(c.x);if(f===K)return;const d=r(t*r(v+f*p));if(d===K)return;let b=(c.x===f?0:2)|Number(c.y&V),o=d;return s&&I(d)&&(o=function(e){return I(e)?r(-e):e}(d),b^=1),new M(f,o,b)}}}(e,c,f),s=a;return v(s.hash.outputLen,s.nByteLength,s.hmac)(d,b)},verify:function(e,t,c,f=Q){const d=e;if(t=g("msgHash",t),c=g("publicKey",c),"strict"in f)throw new Error("options.strict was renamed to lowS");const{lowS:b,prehash:o}=f;let s,l;try{if("string"==typeof d||d instanceof Uint8Array)try{s=M.fromDER(d)}catch(e){if(!(e instanceof G.Err))throw e;s=M.fromCompact(d)}else{if("object"!=typeof d||"bigint"!=typeof d.r||"bigint"!=typeof d.s)throw new Error("PARSE");{const{r:e,s:a}=d;s=new M(e,a)}}l=i.fromHex(c)}catch(e){if("PARSE"===e.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(b&&s.hasHighS())return!1;o&&(t=a.hash(t));const{r:u,s:h}=s,p=T(t),m=n(h),x=r(p*m),y=r(u*m),A=i.BASE.multiplyAndAddUnsafe(l,x,y)?.toAffine();return!!A&&r(A.x)===u},ProjectivePoint:i,Signature:M,utils:B}}function W(e){return{hash:e,hmac:(a,...t)=>(0,Q.w)(e,a,(0,U.Id)(...t)),randomBytes:U.po}}BigInt(4);const Y=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),X=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),ee=BigInt(1),ae=BigInt(2),te=(e,a)=>(e+a/ae)/a;const ce=function(e,a,t=!1,c={}){if(e<=I)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:f,nByteLength:d}=D(e,a);if(d>2048)throw new Error("Field lengths over 2048 bytes are not supported");const r=function(e){if(e%B===M){const a=(e+E)/B;return function(e,t){const c=e.pow(t,a);if(!e.eql(e.sqr(c),t))throw new Error("Cannot find square root");return c}}if(e%L===k){const a=(e-k)/L;return function(e,t){const c=e.mul(t,C),f=e.pow(c,a),d=e.mul(t,f),r=e.mul(e.mul(d,C),f),n=e.mul(d,e.sub(r,e.ONE));if(!e.eql(e.sqr(n),t))throw new Error("Cannot find square root");return n}}return function(e){const a=(e-E)/C;let t,c,f;for(t=e-E,c=0;t%C===I;t/=C,c++);for(f=C;fS(a,e),isValid:a=>{if("bigint"!=typeof a)throw new Error("Invalid field element: expected bigint, got "+typeof a);return I<=a&&ae===I,isOdd:e=>(e&E)===E,neg:a=>S(-a,e),eql:(e,a)=>e===a,sqr:a=>S(a*a,e),add:(a,t)=>S(a+t,e),sub:(a,t)=>S(a-t,e),mul:(a,t)=>S(a*t,e),pow:(e,a)=>function(e,a,t){if(t 0");if(t===I)return e.ONE;if(t===E)return a;let c=e.ONE,f=a;for(;t>I;)t&E&&(c=e.mul(c,f)),f=e.sqr(f),t>>=E;return c}(n,e,a),div:(a,t)=>S(a*R(t,e),e),sqrN:e=>e*e,addN:(e,a)=>e+a,subN:(e,a)=>e-a,mulN:(e,a)=>e*a,inv:a=>R(a,e),sqrt:c.sqrt||(e=>r(n,e)),invertBatch:e=>function(e,a){const t=new Array(a.length),c=a.reduce(((a,c,f)=>e.is0(c)?a:(t[f]=a,e.mul(a,c))),e.ONE),f=e.inv(c);return a.reduceRight(((a,c,f)=>e.is0(c)?a:(t[f]=e.mul(a,t[f]),e.mul(a,c))),f),t}(n,e),cmov:(e,a,t)=>t?a:e,toBytes:e=>t?p(e,d):h(e,d),fromBytes:e=>{if(e.length!==d)throw new Error(`Fp.fromBytes: expected ${d}, got ${e.length}`);return t?u(e):l(e)}});return Object.freeze(n)}(Y,void 0,void 0,{sqrt:function(e){const a=Y,t=BigInt(3),c=BigInt(6),f=BigInt(11),d=BigInt(22),r=BigInt(23),n=BigInt(44),i=BigInt(88),b=e*e*e%a,o=b*b*e%a,s=N(o,t,a)*o%a,l=N(s,t,a)*o%a,u=N(l,ae,a)*b%a,h=N(u,f,a)*u%a,p=N(h,d,a)*h%a,g=N(p,n,a)*p%a,m=N(g,i,a)*g%a,x=N(m,n,a)*p%a,y=N(x,t,a)*o%a,A=N(y,r,a)*h%a,v=N(A,c,a)*b%a,w=N(v,ae,a);if(!ce.eql(ce.sqr(w),e))throw new Error("Cannot find square root");return w}}),fe=function(e,a){const t=a=>J({...e,...W(a)});return Object.freeze({...t(a),create:t})}({a:BigInt(0),b:BigInt(7),Fp:ce,n:X,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const a=X,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),c=-ee*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),f=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),d=t,r=BigInt("0x100000000000000000000000000000000"),n=te(d*e,a),i=te(-c*e,a);let b=S(e-n*t-i*f,a),o=S(-n*c-i*d,a);const s=b>r,l=o>r;if(s&&(b=a-b),l&&(o=a-o),b>r||o>r)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:s,k1:b,k2neg:l,k2:o}}}},f.s);BigInt(0),fe.ProjectivePoint;var de=t(57339),re=t(36212),ne=t(27033),ie=t(20260);class be{#Ce;constructor(e){(0,de.MR)(32===(0,re.pO)(e),"invalid private key","privateKey","[REDACTED]"),this.#Ce=(0,re.c$)(e)}get privateKey(){return this.#Ce}get publicKey(){return be.computePublicKey(this.#Ce)}get compressedPublicKey(){return be.computePublicKey(this.#Ce,!0)}sign(e){(0,de.MR)(32===(0,re.pO)(e),"invalid digest length","digest",e);const a=fe.sign((0,re.Lm)(e),(0,re.Lm)(this.#Ce),{lowS:!0});return ie.t.from({r:(0,ne.up)(a.r,32),s:(0,ne.up)(a.s,32),v:a.recovery?28:27})}computeSharedSecret(e){const a=be.computePublicKey(e);return(0,re.c$)(fe.getSharedSecret((0,re.Lm)(this.#Ce),(0,re.q5)(a),!1))}static computePublicKey(e,a){let t=(0,re.q5)(e,"key");if(32===t.length){const e=fe.getPublicKey(t,!!a);return(0,re.c$)(e)}if(64===t.length){const e=new Uint8Array(65);e[0]=4,e.set(t,1),t=e}const c=fe.ProjectivePoint.fromHex(t);return(0,re.c$)(c.toRawBytes(a))}static recoverPublicKey(e,a){(0,de.MR)(32===(0,re.pO)(e),"invalid digest length","digest",e);const t=ie.t.from(a);let c=fe.Signature.fromCompact((0,re.Lm)((0,re.xW)([t.r,t.s])));c=c.addRecoveryBit(t.yParity);const f=c.recoverPublicKey((0,re.Lm)(e));return(0,de.MR)(null!=f,"invalid signautre for digest","signature",a),"0x"+f.toHex(!1)}static addPoints(e,a,t){const c=fe.ProjectivePoint.fromHex(be.computePublicKey(e).substring(2)),f=fe.ProjectivePoint.fromHex(be.computePublicKey(a).substring(2));return"0x"+c.add(f).toHex(!!t)}}},38264:(e,a,t)=>{"use strict";t.d(a,{id:()=>d});var c=t(2011),f=t(87303);function d(e){return(0,c.S)((0,f.YW)(e))}},64563:(e,a,t)=>{"use strict";t.d(a,{Wh:()=>Ee,kM:()=>Ie});var c=t(2011),f=t(57339),d=t(87303),r=t(36212),n="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const i=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),b=4;function o(e){return function(e){let a=0;return()=>e[a++]}(function(e){let a=0;function t(){return e[a++]<<8|e[a++]}let c=t(),f=1,d=[0,1];for(let e=1;e>--i&1}const s=2**31,l=s>>>1,u=l>>1,h=s-1;let p=0;for(let e=0;e<31;e++)p=p<<1|o();let g=[],m=0,x=s;for(;;){let e=Math.floor(((p-m+1)*f-1)/x),a=0,t=c;for(;t-a>1;){let c=a+t>>>1;e>>1|o(),r=r<<1^l,n=(n^l)<<1|l|1;m=r,x=1+n-r}let y=c-4;return g.map((a=>{switch(a-y){case 3:return y+65792+(e[n++]<<16|e[n++]<<8|e[n++]);case 2:return y+256+(e[n++]<<8|e[n++]);case 1:return y+e[n++];default:return a-1}}))}(function(e){let a=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach(((e,t)=>a[e.charCodeAt(0)]=t));let t=e.length,c=new Uint8Array(6*t>>3);for(let f=0,d=0,r=0,n=0;f=8&&(c[d++]=n>>(r-=8));return c}(e)))}function s(e){return 1&e?~e>>1:e>>1}function l(e,a){let t=Array(e);for(let c=0,f=0;c{let a=u(e);if(a.length)return a}))}function p(e){let a=[];for(;;){let t=e();if(0==t)break;a.push(x(t,e))}for(;;){let t=e()-1;if(t<0)break;a.push(y(t,e))}return a.flat()}function g(e){let a=[];for(;;){let t=e(a.length);if(!t)break;a.push(t)}return a}function m(e,a,t){let c=Array(e).fill().map((()=>[]));for(let f=0;fc[a].push(e)));return c}function x(e,a){let t=1+a(),c=a(),f=g(a);return m(f.length,1+e,a).flatMap(((e,a)=>{let[d,...r]=e;return Array(f[a]).fill().map(((e,a)=>{let f=a*c;return[d+a*t,r.map((e=>e+f))]}))}))}function y(e,a){return m(1+a(),1+e,a).map((e=>[e[0],e.slice(1)]))}function A(e){return`{${function(e){return e.toString(16).toUpperCase().padStart(2,"0")}(e)}}`}function v(e){let a=e.length;if(a<4096)return String.fromCodePoint(...e);let t=[];for(let c=0;c>24&255}function P(e){return 16777215&e}let D,O,F,Q;function U(e){return e>=I&&e=E&&e=C&&aM&&ae.map((e=>[e,a+1<<24]))))),O=new Set(u(e)),F=new Map,Q=new Map;for(let[a,t]of p(e)){if(!O.has(a)&&2==t.length){let[e,c]=t,f=Q.get(e);f||(f=new Map,Q.set(e,f)),f.set(c,a)}F.set(a,t.reverse())}}();let a=[],t=[],c=!1;function f(e){let t=D.get(e);t&&(c=!0,e|=t),a.push(e)}for(let c of e)for(;;){if(c<128)a.push(c);else if(U(c)){let e=c-I,a=e%k/B|0,t=e%B;f(E+(e/k|0)),f(C+a),t>0&&f(M+t)}else{let e=F.get(c);e?t.push(...e):f(c)}if(!t.length)break;c=t.pop()}if(c&&a.length>1){let e=R(a[0]);for(let t=1;t0&&f>=e)0==e?(a.push(c,...t),t.length=0,c=r):t.push(r),f=e;else{let d=j(c,r);d>=0?c=d:0==f&&0==e?(a.push(c),c=r):(t.push(r),f=e)}}return c>=0&&a.push(c,...t),a}(H(e))}const z=45,G=".",K=65039,V=1,Z=e=>Array.from(e);function J(e,a){return e.P.has(a)||e.Q.has(a)}class W extends Array{get is_emoji(){return!0}}let Y,X,ee,ae,te,ce,fe,de,re,ne,ie,be;function oe(){if(Y)return;let e=o(n);const a=()=>u(e),t=()=>new Set(a()),c=(e,a)=>a.forEach((a=>e.add(a)));Y=new Map(p(e)),X=t(),ee=a(),ae=new Set(a().map((e=>ee[e]))),ee=new Set(ee),te=t(),ce=t();let f=h(e),d=e();const r=()=>{let e=new Set;return a().forEach((a=>c(e,f[a]))),c(e,a()),e};fe=g((a=>{let t=g(e).map((e=>e+96));if(t.length){let c=a>=d;return t[0]-=32,t=v(t),c&&(t=`Restricted[${t}]`),{N:t,P:r(),Q:r(),M:!e(),R:c}}})),de=t(),re=new Map;let i=a().concat(Z(de)).sort(((e,a)=>e-a));i.forEach(((a,t)=>{let c=e(),f=i[t]=c?i[t-c]:{V:[],M:new Map};f.V.push(a),de.has(a)||re.set(a,f)}));for(let{V:e,M:a}of new Set(re.values())){let t=[];for(let a of e){let e=fe.filter((e=>J(e,a))),f=t.find((({G:a})=>e.some((e=>a.has(e)))));f||(f={G:new Set,V:[]},t.push(f)),f.V.push(a),c(f.G,e)}let f=t.flatMap((e=>Z(e.G)));for(let{G:e,V:c}of t){let t=new Set(f.filter((a=>!e.has(a))));for(let e of c)a.set(e,t)}}ne=new Set;let b=new Set;const s=e=>ne.has(e)?b.add(e):ne.add(e);for(let e of fe){for(let a of e.P)s(a);for(let a of e.Q)s(a)}for(let e of ne)re.has(e)||b.has(e)||re.set(e,V);c(ne,q(ne)),ie=function(e){let a=[],t=u(e);return function e({S:t,B:c},f,d){if(!(4&t&&d===f[f.length-1])){2&t&&(d=f[f.length-1]),1&t&&a.push(f);for(let a of c)for(let t of a.Q)e(a,[...f,t],d)}}(function a(c){return{S:e(),B:g((()=>{let c=u(e).map((e=>t[e]));if(c.length)return a(c)})),Q:c}}([]),[]),a}(e).map((e=>W.from(e))).sort(w),be=new Map;for(let e of ie){let a=[be];for(let t of e){let e=a.map((e=>{let a=e.get(t);return a||(a=new Map,e.set(t,a)),a}));t===K?a.push(...e):a=e}for(let t of a)t.V=e}}function se(e){return(he(e)?"":`${le(ue([e]))} `)+A(e)}function le(e){return`"${e}"‎`}function ue(e,a=1/0,t=A){let c=[];var f;f=e[0],oe(),ee.has(f)&&c.push("◌"),e.length>a&&(a>>=1,e=[...e.slice(0,a),8230,...e.slice(-a)]);let d=0,r=e.length;for(let a=0;a{let f=function(e){let a=[];for(let t=0,c=e.length;t0;)if(95!==e[--a])throw new Error("underscore allowed only at start")}(n),!(d.emoji=r>1||c[0].is_emoji)&&n.every((e=>e<128)))!function(e){if(e.length>=4&&e[2]==z&&e[3]==z)throw new Error(`invalid label extension: "${v(e.slice(0,4))}"`)}(n),e="ASCII";else{let a=c.flatMap((e=>e.is_emoji?[]:e));if(a.length){if(ee.has(n[0]))throw xe("leading combining mark");for(let e=1;eJ(e,t)));if(!e.length)throw fe.some((e=>J(e,t)))?me(a[0],t):ge(t);if(a=e,1==e.length)break}return a}(t);!function(e,a){for(let t of a)if(!J(e,t))throw me(e,t);if(e.M){let e=q(a);for(let a=1,t=e.length;ab)throw new Error(`excessive non-spacing marks: ${le(ue(e.slice(a-1,c)))} (${c-a}/${b})`);a=c}}}(f,a),function(e,a){let t,c=[];for(let e of a){let a=re.get(e);if(a===V)return;if(a){let c=a.M.get(e);if(t=t?t.filter((e=>c.has(e))):Z(c),!t.length)return}else c.push(e)}if(t)for(let a of t)if(c.every((e=>J(a,e))))throw new Error(`whole-script confusable: ${e.N}/${a.N}`)}(f,t),e=f.N}else e="Emoji"}d.type=e}catch(e){d.error=e}return d}))}function ge(e){return new Error(`disallowed character: ${se(e)}`)}function me(e,a){let t=se(a),c=fe.find((e=>e.P.has(a)));return c&&(t=`${c.N} ${t}`),new Error(`illegal mixture: ${e.N} + ${t}`)}function xe(e){return new Error(`illegal placement: ${e}`)}function ye(e){return e.filter((e=>e!=K))}function Ae(e,a){let t,c=be,f=e.length;for(;f&&(c=c.get(e[--f]),c);){let{V:d}=c;d&&(t=d,a&&a.push(...e.slice(f).reverse()),e.length=f)}return t}const ve=new Uint8Array(32);function we(e){return(0,f.MR)(0!==e.length,"invalid ENS name; empty component","comp",e),e}function _e(e){const a=(0,d.YW)(function(e){try{if(0===e.length)throw new Error("empty label");return function(e){return function(e){return e.map((({input:a,error:t,output:c})=>{if(t){let c=t.message;throw new Error(1==e.length?c:`Invalid label ${le(ue(a,63))}: ${c}`)}return v(c)})).join(G)}(pe(e,$,ye))}(e)}catch(a){(0,f.MR)(!1,`invalid ENS name (${a.message})`,"name",e)}}(e)),t=[];if(0===e.length)return t;let c=0;for(let e=0;e{(0,f.MR)(a.length<=t,`label ${JSON.stringify(e)} exceeds ${t} bytes`,"name",e);const c=new Uint8Array(a.length+1);return c.set(a,1),c[0]=c.length-1,c}))))+"00"}ve.fill(0)},82314:(e,a,t)=>{"use strict";t.d(a,{z:()=>I});var c=t(30031),f=t(2011),d=t(36212),r=t(27033),n=t(57339),i=t(88081),b=t(38264);const o=new Uint8Array(32);o.fill(0);const s=BigInt(-1),l=BigInt(0),u=BigInt(1),h=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),p=(0,r.up)(u,32),g=(0,r.up)(l,32),m={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},x=["name","version","chainId","verifyingContract","salt"];function y(e){return function(a){return(0,n.MR)("string"==typeof a,`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,a),a}}const A={name:y("name"),version:y("version"),chainId:function(e){const a=(0,r.Ab)(e,"domain.chainId");return(0,n.MR)(a>=0,"invalid chain ID","domain.chainId",e),Number.isSafeInteger(a)?Number(a):(0,r.nD)(a)},verifyingContract:function(e){try{return(0,c.b)(e).toLowerCase()}catch(e){}(0,n.MR)(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){const a=(0,d.q5)(e,"domain.salt");return(0,n.MR)(32===a.length,'invalid domain value "salt"',"domain.salt",e),(0,d.c$)(a)}};function v(e){{const a=e.match(/^(u?)int(\d+)$/);if(a){const t=""===a[1],c=parseInt(a[2]);(0,n.MR)(c%8==0&&0!==c&&c<=256&&a[2]===String(c),"invalid numeric width","type",e);const f=(0,r.dK)(h,t?c-1:c),d=t?(f+u)*s:l;return function(a){const c=(0,r.Ab)(a,"value");return(0,n.MR)(c>=d&&c<=f,`value out-of-bounds for ${e}`,"value",c),(0,r.up)(t?(0,r.JJ)(c,256):c,32)}}}{const a=e.match(/^bytes(\d+)$/);if(a){const t=parseInt(a[1]);return(0,n.MR)(0!==t&&t<=32&&a[1]===String(t),"invalid bytes width","type",e),function(a){const c=(0,d.q5)(a);return(0,n.MR)(c.length===t,`invalid length for ${e}`,"value",a),function(e){const a=(0,d.q5)(e),t=a.length%32;return t?(0,d.xW)([a,o.slice(t)]):(0,d.c$)(a)}(a)}}}switch(e){case"address":return function(e){return(0,d.nx)((0,c.b)(e),32)};case"bool":return function(e){return e?p:g};case"bytes":return function(e){return(0,f.S)(e)};case"string":return function(e){return(0,b.id)(e)}}return null}function w(e,a){return`${e}(${a.map((({name:e,type:a})=>a+" "+e)).join(",")})`}function _(e){const a=e.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return a?{base:a[1],index:a[2]+a[4],array:{base:a[1],prefix:a[1]+a[2],count:a[5]?parseInt(a[5]):-1}}:{base:e}}class I{primaryType;#Me;get types(){return JSON.parse(this.#Me)}#Be;#ke;constructor(e){this.#Be=new Map,this.#ke=new Map;const a=new Map,t=new Map,c=new Map,f={};Object.keys(e).forEach((d=>{f[d]=e[d].map((({name:a,type:t})=>{let{base:c,index:f}=_(t);return"int"!==c||e.int||(c="int256"),"uint"!==c||e.uint||(c="uint256"),{name:a,type:c+(f||"")}})),a.set(d,new Set),t.set(d,[]),c.set(d,new Set)})),this.#Me=JSON.stringify(f);for(const c in f){const d=new Set;for(const r of f[c]){(0,n.MR)(!d.has(r.name),`duplicate variable name ${JSON.stringify(r.name)} in ${JSON.stringify(c)}`,"types",e),d.add(r.name);const f=_(r.type).base;(0,n.MR)(f!==c,`circular type reference to ${JSON.stringify(f)}`,"types",e),v(f)||((0,n.MR)(t.has(f),`unknown type ${JSON.stringify(f)}`,"types",e),t.get(f).push(c),a.get(c).add(f))}}const d=Array.from(t.keys()).filter((e=>0===t.get(e).length));(0,n.MR)(0!==d.length,"missing primary type","types",e),(0,n.MR)(1===d.length,`ambiguous primary types or unused types: ${d.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),(0,i.n)(this,{primaryType:d[0]}),function f(d,r){(0,n.MR)(!r.has(d),`circular type reference to ${JSON.stringify(d)}`,"types",e),r.add(d);for(const e of a.get(d))if(t.has(e)){f(e,r);for(const a of r)c.get(a).add(e)}r.delete(d)}(this.primaryType,new Set);for(const[e,a]of c){const t=Array.from(a);t.sort(),this.#Be.set(e,w(e,f[e])+t.map((e=>w(e,f[e]))).join(""))}}getEncoder(e){let a=this.#ke.get(e);return a||(a=this.#Le(e),this.#ke.set(e,a)),a}#Le(e){{const a=v(e);if(a)return a}const a=_(e).array;if(a){const e=a.prefix,t=this.getEncoder(e);return c=>{(0,n.MR)(-1===a.count||a.count===c.length,`array length mismatch; expected length ${a.count}`,"value",c);let r=c.map(t);return this.#Be.has(e)&&(r=r.map(f.S)),(0,f.S)((0,d.xW)(r))}}const t=this.types[e];if(t){const a=(0,b.id)(this.#Be.get(e));return e=>{const c=t.map((({name:a,type:t})=>{const c=this.getEncoder(t)(e[a]);return this.#Be.has(t)?(0,f.S)(c):c}));return c.unshift(a),(0,d.xW)(c)}}(0,n.MR)(!1,`unknown type: ${e}`,"type",e)}encodeType(e){const a=this.#Be.get(e);return(0,n.MR)(a,`unknown type: ${JSON.stringify(e)}`,"name",e),a}encodeData(e,a){return this.getEncoder(e)(a)}hashStruct(e,a){return(0,f.S)(this.encodeData(e,a))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,a,t){if(v(e))return t(e,a);const c=_(e).array;if(c)return(0,n.MR)(-1===c.count||c.count===a.length,`array length mismatch; expected length ${c.count}`,"value",a),a.map((e=>this._visit(c.prefix,e,t)));const f=this.types[e];if(f)return f.reduce(((e,{name:c,type:f})=>(e[c]=this._visit(f,a[c],t),e)),{});(0,n.MR)(!1,`unknown type: ${e}`,"type",e)}visit(e,a){return this._visit(this.primaryType,e,a)}static from(e){return new I(e)}static getPrimaryType(e){return I.from(e).primaryType}static hashStruct(e,a,t){return I.from(a).hashStruct(e,t)}static hashDomain(e){const a=[];for(const t in e){if(null==e[t])continue;const c=m[t];(0,n.MR)(c,`invalid typed-data domain key: ${JSON.stringify(t)}`,"domain",e),a.push({name:t,type:c})}return a.sort(((e,a)=>x.indexOf(e.name)-x.indexOf(a.name))),I.hashStruct("EIP712Domain",{EIP712Domain:a},e)}static encode(e,a,t){return(0,d.xW)(["0x1901",I.hashDomain(e),I.from(a).hash(t)])}static hash(e,a,t){return(0,f.S)(I.encode(e,a,t))}static async resolveNames(e,a,t,c){e=Object.assign({},e);for(const a in e)null==e[a]&&delete e[a];const f={};e.verifyingContract&&!(0,d.Lo)(e.verifyingContract,20)&&(f[e.verifyingContract]="0x");const r=I.from(a);r.visit(t,((e,a)=>("address"!==e||(0,d.Lo)(a,20)||(f[a]="0x"),a)));for(const e in f)f[e]=await c(e);return e.verifyingContract&&f[e.verifyingContract]&&(e.verifyingContract=f[e.verifyingContract]),{domain:e,value:t=r.visit(t,((e,a)=>"address"===e&&f[a]?f[a]:a))}}static getPayload(e,a,t){I.hashDomain(e);const c={},f=[];x.forEach((a=>{const t=e[a];null!=t&&(c[a]=A[a](t),f.push({name:a,type:m[a]}))}));const i=I.from(a);a=i.types;const b=Object.assign({},a);return(0,n.MR)(null==b.EIP712Domain,"types must not contain EIP712Domain type","types.EIP712Domain",a),b.EIP712Domain=f,i.encode(t),{types:b,domain:c,primaryType:i.primaryType,message:i.visit(t,((e,a)=>{if(e.match(/^bytes(\d*)/))return(0,d.c$)((0,d.q5)(a));if(e.match(/^u?int/))return(0,r.Ab)(a).toString();switch(e){case"address":return a.toLowerCase();case"bool":return!!a;case"string":return(0,n.MR)("string"==typeof a,"invalid string","value",a),a}(0,n.MR)(!1,"unsupported type","type",e)}))}}}},97876:(e,a,t)=>{"use strict";t.d(a,{Pz:()=>m});var c=t(30031),f=t(98982),d=t(13269),r=t(64563),n=t(57339),i=t(88081),b=t(36212),o=t(14132),s=t(27033),l=t(26976);function u(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):(0,n.MR)(!1,"unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}class h{name;constructor(e){(0,i.n)(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,a){throw new Error("unsupported coin")}async decodeAddress(e,a){throw new Error("unsupported coin")}}const p=new RegExp("^(ipfs)://(.*)$","i"),g=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),p,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];class m{provider;address;name;#Se;#Te;constructor(e,a,t){(0,i.n)(this,{provider:e,address:a,name:t}),this.#Se=null,this.#Te=new d.NZ(a,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e)}async supportsWildcard(){return null==this.#Se&&(this.#Se=(async()=>{try{return await this.#Te.supportsInterface("0x9061b923")}catch(e){if((0,n.bJ)(e,"CALL_EXCEPTION"))return!1;throw this.#Se=null,e}})()),await this.#Se}async#Ne(e,a){a=(a||[]).slice();const t=this.#Te.interface;a.unshift((0,r.kM)(this.name));let c=null;await this.supportsWildcard()&&(c=t.getFunction(e),(0,n.vA)(c,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),a=[(0,r.Wh)(this.name,255),t.encodeFunctionData(c,a)],e="resolve(bytes,bytes)"),a.push({enableCcipRead:!0});try{const f=await this.#Te[e](...a);return c?t.decodeFunctionResult(c,f)[0]:f}catch(e){if(!(0,n.bJ)(e,"CALL_EXCEPTION"))throw e}return null}async getAddress(e){if(null==e&&(e=60),60===e)try{const e=await this.#Ne("addr(bytes32)");return null==e||e===f.j?null:e}catch(e){if((0,n.bJ)(e,"CALL_EXCEPTION"))return null;throw e}if(e>=0&&e<2147483648){let a=e+2147483648;const t=await this.#Ne("addr(bytes32,uint)",[a]);if((0,b.Lo)(t,20))return(0,c.b)(t)}let a=null;for(const t of this.provider.plugins)if(t instanceof h&&t.supportsCoinType(e)){a=t;break}if(null==a)return null;const t=await this.#Ne("addr(bytes32,uint)",[e]);if(null==t||"0x"===t)return null;const d=await a.decodeAddress(e,t);if(null!=d)return d;(0,n.vA)(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:t}})}async getText(e){const a=await this.#Ne("text(bytes32,string)",[e]);return null==a||"0x"===a?null:a}async getContentHash(){const e=await this.#Ne("contenthash(bytes32)");if(null==e||"0x"===e)return null;const a=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(a){const e="e3010170"===a[1]?"ipfs":"ipns",t=parseInt(a[4],16);if(a[5].length===2*t)return`${e}://${(0,o.R)("0x"+a[2])}`}const t=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(t&&64===t[1].length)return`bzz://${t[1]}`;(0,n.vA)(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const a=await this.getText("avatar");if(null==a)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:a});for(let t=0;t{"use strict";t.d(a,{J9:()=>s,VS:()=>l,eB:()=>u,tG:()=>h,uI:()=>g,z5:()=>p});var c=t(88081),f=t(36212),d=t(27033),r=t(57339),n=t(8177);const i=BigInt(0);function b(e){return null==e?null:e}function o(e){return null==e?null:e.toString()}class s{gasPrice;maxFeePerGas;maxPriorityFeePerGas;constructor(e,a,t){(0,c.n)(this,{gasPrice:b(e),maxFeePerGas:b(a),maxPriorityFeePerGas:b(t)})}toJSON(){const{gasPrice:e,maxFeePerGas:a,maxPriorityFeePerGas:t}=this;return{_type:"FeeData",gasPrice:o(e),maxFeePerGas:o(a),maxPriorityFeePerGas:o(t)}}}function l(e){const a={};e.to&&(a.to=e.to),e.from&&(a.from=e.from),e.data&&(a.data=(0,f.c$)(e.data));const t="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const c of t)c in e&&null!=e[c]&&(a[c]=(0,d.Ab)(e[c],`request.${c}`));const c="type,nonce".split(/,/);for(const t of c)t in e&&null!=e[t]&&(a[t]=(0,d.WZ)(e[t],`request.${t}`));return e.accessList&&(a.accessList=(0,n.$)(e.accessList)),"blockTag"in e&&(a.blockTag=e.blockTag),"enableCcipRead"in e&&(a.enableCcipRead=!!e.enableCcipRead),"customData"in e&&(a.customData=e.customData),"blobVersionedHashes"in e&&e.blobVersionedHashes&&(a.blobVersionedHashes=e.blobVersionedHashes.slice()),"kzg"in e&&(a.kzg=e.kzg),"blobs"in e&&e.blobs&&(a.blobs=e.blobs.map((e=>(0,f.f)(e)?(0,f.c$)(e):Object.assign({},e)))),a}class u{provider;number;hash;timestamp;parentHash;parentBeaconBlockRoot;nonce;difficulty;gasLimit;gasUsed;stateRoot;receiptsRoot;blobGasUsed;excessBlobGas;miner;prevRandao;extraData;baseFeePerGas;#Pe;constructor(e,a){this.#Pe=e.transactions.map((e=>"string"!=typeof e?new g(e,a):e)),(0,c.n)(this,{provider:a,hash:b(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:b(e.prevRandao),extraData:e.extraData,baseFeePerGas:b(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return this.#Pe.map((e=>"string"==typeof e?e:e.hash))}get prefetchedTransactions(){const e=this.#Pe.slice();return 0===e.length?[]:((0,r.vA)("object"==typeof e[0],"transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:a,extraData:t,gasLimit:c,gasUsed:f,hash:d,miner:r,prevRandao:n,nonce:i,number:b,parentHash:s,parentBeaconBlockRoot:l,stateRoot:u,receiptsRoot:h,timestamp:p,transactions:g}=this;return{_type:"Block",baseFeePerGas:o(e),difficulty:o(a),extraData:t,gasLimit:o(c),gasUsed:o(f),blobGasUsed:o(this.blobGasUsed),excessBlobGas:o(this.excessBlobGas),hash:d,miner:r,prevRandao:n,nonce:i,number:b,parentHash:s,timestamp:p,parentBeaconBlockRoot:l,stateRoot:u,receiptsRoot:h,transactions:g}}[Symbol.iterator](){let e=0;const a=this.transactions;return{next:()=>enew h(e,a))));let t=i;null!=e.effectiveGasPrice?t=e.effectiveGasPrice:null!=e.gasPrice&&(t=e.gasPrice),(0,c.n)(this,{provider:a,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:t,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return this.#De}toJSON(){const{to:e,from:a,contractAddress:t,hash:c,index:f,blockHash:d,blockNumber:r,logsBloom:n,logs:i,status:b,root:s}=this;return{_type:"TransactionReceipt",blockHash:d,blockNumber:r,contractAddress:t,cumulativeGasUsed:o(this.cumulativeGasUsed),from:a,gasPrice:o(this.gasPrice),blobGasUsed:o(this.blobGasUsed),blobGasPrice:o(this.blobGasPrice),gasUsed:o(this.gasUsed),hash:c,index:f,logs:i,logsBloom:n,root:s,status:b,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e{if(b)return null;const{blockNumber:e,nonce:a}=await(0,c.k)({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(a{if(null==e||0!==e.status)return e;(0,r.vA)(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:e.to,from:e.from,data:""},receipt:e})},l=await this.provider.getTransactionReceipt(this.hash);if(0===t)return s(l);if(l){if(await l.confirmations()>=t)return s(l)}else if(await o(),0===t)return null;const u=new Promise(((e,a)=>{const c=[],n=()=>{c.forEach((e=>e()))};if(c.push((()=>{b=!0})),f>0){const e=setTimeout((()=>{n(),a((0,r.xz)("wait for transaction timeout","TIMEOUT"))}),f);c.push((()=>{clearTimeout(e)}))}const i=async c=>{if(await c.confirmations()>=t){n();try{e(s(c))}catch(e){a(e)}}};if(c.push((()=>{this.provider.off(this.hash,i)})),this.provider.on(this.hash,i),d>=0){const e=async()=>{try{await o()}catch(e){if((0,r.bJ)(e,"TRANSACTION_REPLACED"))return n(),void a(e)}b||this.provider.once("block",e)};c.push((()=>{this.provider.off("block",e)})),this.provider.once("block",e)}}));return await u}isMined(){return null!=this.blockHash}isLegacy(){return 0===this.type}isBerlin(){return 1===this.type}isLondon(){return 2===this.type}isCancun(){return 3===this.type}removedEvent(){return(0,r.vA)(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),x(this)}reorderedEvent(e){return(0,r.vA)(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),(0,r.vA)(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),m(this,e)}replaceableTransaction(e){(0,r.MR)(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const a=new g(this,this.provider);return a.#Oe=e,a}}function m(e,a){return{orphan:"reorder-transaction",tx:e,other:a}}function x(e){return{orphan:"drop-transaction",tx:e}}},8177:(e,a,t)=>{"use strict";t.d(a,{$:()=>n});var c=t(30031),f=t(57339),d=t(36212);function r(e,a){return{address:(0,c.b)(e),storageKeys:a.map(((e,a)=>((0,f.MR)((0,d.Lo)(e,32),"invalid slot",`storageKeys[${a}]`,e),e.toLowerCase())))}}function n(e){if(Array.isArray(e))return e.map(((a,t)=>Array.isArray(a)?((0,f.MR)(2===a.length,"invalid slot set",`value[${t}]`,a),r(a[0],a[1])):((0,f.MR)(null!=a&&"object"==typeof a,"invalid address-slot set","value",e),r(a.address,a.storageKeys))));(0,f.MR)(null!=e&&"object"==typeof e,"invalid access list","value",e);const a=Object.keys(e).map((a=>{const t=e[a].reduce(((e,a)=>(e[a]=!0,e)),{});return r(a,Object.keys(t).sort())}));return a.sort(((e,a)=>e.address.localeCompare(a.address))),a}},20415:(e,a,t)=>{"use strict";t.d(a,{K:()=>r,x:()=>n});var c=t(30031),f=t(72588),d=t(2011);function r(e){let a;return a="string"==typeof e?f.h.computePublicKey(e,!1):e.publicKey,(0,c.b)((0,d.S)("0x"+a.substring(4)).substring(26))}function n(e,a){return r(f.h.recoverPublicKey(e,a))}},79453:(e,a,t)=>{"use strict";t.d(a,{Z:()=>D});var c=t(30031),f=t(98982),d=t(68650),r=t(20260),n=t(2011),i=t(72588),b=t(57339),o=t(27033),s=t(36212);function l(e){let a=e.toString(16);for(;a.length<2;)a="0"+a;return"0x"+a}function u(e,a,t){let c=0;for(let f=0;f{(0,b.vA)(a<=e.length,"data short segment too short","BUFFER_OVERRUN",{buffer:e,length:e.length,offset:a})};if(e[a]>=248){const c=e[a]-247;t(a+1+c);const f=u(e,a+1,c);return t(a+1+c+f),h(e,a,a+1+c,c+f)}if(e[a]>=192){const c=e[a]-192;return t(a+1+c),h(e,a,a+1,c)}if(e[a]>=184){const c=e[a]-183;t(a+1+c);const f=u(e,a+1,c);return t(a+1+c+f),{consumed:1+c+f,result:(0,s.c$)(e.slice(a+1+c,a+1+c+f))}}if(e[a]>=128){const c=e[a]-128;return t(a+1+c),{consumed:1+c,result:(0,s.c$)(e.slice(a+1,a+1+c))}}return{consumed:1,result:l(e[a])}}function g(e){const a=(0,s.q5)(e,"data"),t=p(a,0);return(0,b.MR)(t.consumed===a.length,"unexpected junk after rlp payload","data",e),t.result}var m=t(65735),x=t(8177),y=t(20415);const A=BigInt(0),v=BigInt(2),w=BigInt(27),_=BigInt(28),I=BigInt(35),E=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),C=131072;function M(e,a){let t=e.toString(16);for(;t.length<2;)t="0"+t;return t+=(0,d.s)(a).substring(4),"0x"+t}function B(e){return"0x"===e?null:(0,c.b)(e)}function k(e,a){try{return(0,x.$)(e)}catch(t){(0,b.MR)(!1,t.message,a,e)}}function L(e,a){return"0x"===e?0:(0,o.WZ)(e,a)}function S(e,a){if("0x"===e)return A;const t=(0,o.Ab)(e,a);return(0,b.MR)(t<=E,"value exceeds uint size",a,t),t}function T(e,a){const t=(0,o.Ab)(e,"value"),c=(0,o.c4)(t);return(0,b.MR)(c.length<=32,"value too large",`tx.${a}`,t),c}function N(e){return(0,x.$)(e).map((e=>[e.address,e.storageKeys]))}function R(e,a){(0,b.MR)(Array.isArray(e),`invalid ${a}`,"value",e);for(let a=0;aObject.assign({},e)))}set blobs(e){if(null==e)return void(this.#We=null);const a=[],t=[];for(let c=0;ce.data)),t.map((e=>e.commitment)),t.map((e=>e.proof))])]):(0,s.xW)(["0x03",(0,m.R)(c)])}(this,t,a?this.blobs:null)}(0,b.vA)(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get serialized(){return this.#Ye(!0,!0)}get unsignedSerialized(){return this.#Ye(!1,!1)}inferType(){const e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){const e=null!=this.gasPrice,a=null!=this.maxFeePerGas||null!=this.maxPriorityFeePerGas,t=null!=this.accessList,c=null!=this.#Ve||this.#Ze;null!=this.maxFeePerGas&&null!=this.maxPriorityFeePerGas&&(0,b.vA)(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),(0,b.vA)(!a||0!==this.type&&1!==this.type,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),(0,b.vA)(0!==this.type||!t,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const f=[];return null!=this.type?f.push(this.type):a?f.push(2):e?(f.push(1),t||f.push(0)):t?(f.push(1),f.push(2)):(c&&this.to||(f.push(0),f.push(1),f.push(2)),f.push(3)),f.sort(),f}isLegacy(){return 0===this.type}isBerlin(){return 1===this.type}isLondon(){return 2===this.type}isCancun(){return 3===this.type}clone(){return D.from(this)}toJSON(){const e=e=>null==e?null:e.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(null==e)return new D;if("string"==typeof e){const a=(0,s.q5)(e);if(a[0]>=127)return D.from(function(e){const a=g(e);(0,b.MR)(Array.isArray(a)&&(9===a.length||6===a.length),"invalid field count for legacy transaction","data",e);const t={type:0,nonce:L(a[0],"nonce"),gasPrice:S(a[1],"gasPrice"),gasLimit:S(a[2],"gasLimit"),to:B(a[3]),value:S(a[4],"value"),data:(0,s.c$)(a[5]),chainId:A};if(6===a.length)return t;const c=S(a[6],"v"),f=S(a[7],"r"),d=S(a[8],"s");if(f===A&&d===A)t.chainId=c;else{let e=(c-I)/v;e{"use strict";t.d(a,{H:()=>l,R:()=>s});var c=t(36212),f=t(57339),d=t(27033);const r="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";let n=null;function i(e){if(null==n){n={};for(let e=0;e{"use strict";t.d(a,{Lm:()=>r,Lo:()=>n,X_:()=>g,ZG:()=>u,c$:()=>o,f:()=>i,nx:()=>p,pO:()=>l,q5:()=>d,xW:()=>s});var c=t(57339);function f(e,a,t){if(e instanceof Uint8Array)return t?new Uint8Array(e):e;if("string"==typeof e&&e.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const a=new Uint8Array((e.length-2)/2);let t=2;for(let c=0;c>4]+b[15&c]}return t}function s(e){return"0x"+e.map((e=>o(e).substring(2))).join("")}function l(e){return n(e,!0)?(e.length-2)/2:d(e).length}function u(e,a,t){const f=d(e);return null!=t&&t>f.length&&(0,c.vA)(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:f,length:f.length,offset:t}),o(f.slice(null==a?0:a,null==t?f.length:t))}function h(e,a,t){const f=d(e);(0,c.vA)(a>=f.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(f),length:a,offset:a+1});const r=new Uint8Array(a);return r.fill(0),t?r.set(f,a-f.length):r.set(f,0),o(r)}function p(e,a){return h(e,a,!0)}function g(e,a){return h(e,a,!1)}},57339:(e,a,t)=>{"use strict";t.d(a,{E:()=>n,MR:()=>o,SP:()=>u,bJ:()=>r,dd:()=>s,gk:()=>h,vA:()=>b,xz:()=>i});var c=t(99529),f=t(88081);function d(e){if(null==e)return"null";if(Array.isArray(e))return"[ "+e.map(d).join(", ")+" ]";if(e instanceof Uint8Array){const a="0123456789abcdef";let t="0x";for(let c=0;c>4],t+=a[15&e[c]];return t}if("object"==typeof e&&"function"==typeof e.toJSON)return d(e.toJSON());switch(typeof e){case"boolean":case"symbol":case"number":return e.toString();case"bigint":return BigInt(e).toString();case"string":return JSON.stringify(e);case"object":{const a=Object.keys(e);return a.sort(),"{ "+a.map((a=>`${d(a)}: ${d(e[a])}`)).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function r(e,a){return e&&e.code===a}function n(e){return r(e,"CALL_EXCEPTION")}function i(e,a,t){let r,n=e;{const f=[];if(t){if("message"in t||"code"in t||"name"in t)throw new Error(`value will overwrite populated values: ${d(t)}`);for(const e in t){if("shortMessage"===e)continue;const a=t[e];f.push(e+"="+d(a))}}f.push(`code=${a}`),f.push(`version=${c.r}`),f.length&&(e+=" ("+f.join(", ")+")")}switch(a){case"INVALID_ARGUMENT":r=new TypeError(e);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":r=new RangeError(e);break;default:r=new Error(e)}return(0,f.n)(r,{code:a}),t&&Object.assign(r,t),null==r.shortMessage&&(0,f.n)(r,{shortMessage:n}),r}function b(e,a,t,c){if(!e)throw i(a,t,c)}function o(e,a,t,c){b(e,a,"INVALID_ARGUMENT",{argument:t,value:c})}function s(e,a,t){null==t&&(t=""),t&&(t=": "+t),b(e>=a,"missing arguemnt"+t,"MISSING_ARGUMENT",{count:e,expectedCount:a}),b(e<=a,"too many arguments"+t,"UNEXPECTED_ARGUMENT",{count:e,expectedCount:a})}const l=["NFD","NFC","NFKD","NFKC"].reduce(((e,a)=>{try{if("test"!=="test".normalize(a))throw new Error("bad");if("NFD"===a){if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken")}e.push(a)}catch(e){}return e}),[]);function u(e){b(l.indexOf(e)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:e}})}function h(e,a,t){if(null==t&&(t=""),e!==a){let e=t,a="new";t&&(e+=".",a+=" "+t),b(!1,`private constructor; use ${e}from* methods`,"UNSUPPORTED_OPERATION",{operation:a})}}},99381:(e,a,t)=>{"use strict";t.d(a,{z:()=>f});var c=t(88081);class f{filter;emitter;#Xe;constructor(e,a,t){this.#Xe=a,(0,c.n)(this,{emitter:e,filter:t})}async removeListener(){null!=this.#Xe&&await this.emitter.off(this.filter,this.#Xe)}}},26976:(e,a,t)=>{"use strict";t.d(a,{ui:()=>x});var c=t(36212),f=t(57339),d=t(88081),r=t(87303);function n(e){return async function(e,a){(0,f.vA)(null==a||!a.cancelled,"request cancelled before sending","CANCELLED");const t=e.url.split(":")[0].toLowerCase();(0,f.vA)("http"===t||"https"===t,`unsupported protocol ${t}`,"UNSUPPORTED_OPERATION",{info:{protocol:t},operation:"request"}),(0,f.vA)("https"===t||!e.credentials||e.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let c=null;const d=new AbortController,r=setTimeout((()=>{c=(0,f.xz)("request timeout","TIMEOUT"),d.abort()}),e.timeout);a&&a.addListener((()=>{c=(0,f.xz)("request cancelled","CANCELLED"),d.abort()}));const n={method:e.method,headers:new Headers(Array.from(e)),body:e.body||void 0,signal:d.signal};let i;try{i=await fetch(e.url,n)}catch(e){if(clearTimeout(r),c)throw c;throw e}clearTimeout(r);const b={};i.headers.forEach(((e,a)=>{b[a.toLowerCase()]=e}));const o=await i.arrayBuffer(),s=null==o?null:new Uint8Array(o);return{statusCode:i.status,statusMessage:i.statusText,headers:b,body:s}}}n();let i=n();const b=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),o=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let s=!1;async function l(e,a){try{const a=e.match(b);if(!a)throw new Error("invalid data");return new y(200,"OK",{"content-type":a[1]||"text/plain"},a[2]?function(e){e=atob(e);const a=new Uint8Array(e.length);for(let t=0;tString.fromCharCode(parseInt(a,16)))))))}catch(a){return new y(599,"BAD REQUEST (invalid data: URI)",{},null,new x(e))}var t}function u(e){return async function(a,t){try{const t=a.match(o);if(!t)throw new Error("invalid link");return new x(`${e}${t[2]}`)}catch(e){return new y(599,"BAD REQUEST (invalid IPFS URI)",{},null,new x(a))}}}const h={data:l,ipfs:u("https://gateway.ipfs.io/ipfs/")},p=new WeakMap;class g{#ea;#aa;constructor(e){this.#ea=[],this.#aa=!1,p.set(e,(()=>{if(!this.#aa){this.#aa=!0;for(const e of this.#ea)setTimeout((()=>{e()}),0);this.#ea=[]}}))}addListener(e){(0,f.vA)(!this.#aa,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),this.#ea.push(e)}get cancelled(){return this.#aa}checkSignal(){(0,f.vA)(!this.cancelled,"cancelled","CANCELLED",{})}}function m(e){if(null==e)throw new Error("missing signal; should not happen");return e.checkSignal(),e}class x{#ta;#ca;#fa;#da;#ra;#e;#na;#ia;#ba;#oa;#sa;#la;#ua;#ha;#pa;get url(){return this.#e}set url(e){this.#e=String(e)}get body(){return null==this.#na?null:new Uint8Array(this.#na)}set body(e){if(null==e)this.#na=void 0,this.#ia=void 0;else if("string"==typeof e)this.#na=(0,r.YW)(e),this.#ia="text/plain";else if(e instanceof Uint8Array)this.#na=e,this.#ia="application/octet-stream";else{if("object"!=typeof e)throw new Error("invalid body");this.#na=(0,r.YW)(JSON.stringify(e)),this.#ia="application/json"}}hasBody(){return null!=this.#na}get method(){return this.#da?this.#da:this.hasBody()?"POST":"GET"}set method(e){null==e&&(e=""),this.#da=String(e).toUpperCase()}get headers(){const e=Object.assign({},this.#fa);return this.#ba&&(e.authorization=`Basic ${function(e){const a=(0,c.q5)(e);let t="";for(let e=0;e{if(t=0,"timeout must be non-zero","timeout",e),this.#ra=e}get preflightFunc(){return this.#oa||null}set preflightFunc(e){this.#oa=e}get processFunc(){return this.#sa||null}set processFunc(e){this.#sa=e}get retryFunc(){return this.#la||null}set retryFunc(e){this.#la=e}get getUrlFunc(){return this.#pa||i}set getUrlFunc(e){this.#pa=e}constructor(e){this.#e=String(e),this.#ta=!1,this.#ca=!0,this.#fa={},this.#da="",this.#ra=3e5,this.#ha={slotInterval:250,maxAttempts:12},this.#pa=null}toString(){return``}setThrottleParams(e){null!=e.slotInterval&&(this.#ha.slotInterval=e.slotInterval),null!=e.maxAttempts&&(this.#ha.maxAttempts=e.maxAttempts)}async#ga(e,a,t,c,d){if(e>=this.#ha.maxAttempts)return d.makeServerError("exceeded maximum retry limit");(0,f.vA)(A()<=a,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:c}),t>0&&await function(e){return new Promise((a=>setTimeout(a,e)))}(t);let r=this.clone();const n=(r.url.split(":")[0]||"").toLowerCase();if(n in h){const e=await h[n](r.url,m(c.#ua));if(e instanceof y){let a=e;if(this.processFunc){m(c.#ua);try{a=await this.processFunc(r,a)}catch(e){null!=e.throttle&&"number"==typeof e.stall||a.makeServerError("error in post-processing function",e).assertOk()}}return a}r=e}this.preflightFunc&&(r=await this.preflightFunc(r));const i=await this.getUrlFunc(r,m(c.#ua));let b=new y(i.statusCode,i.statusMessage,i.headers,i.body,c);if(301===b.statusCode||302===b.statusCode){try{const t=b.headers.location||"";return r.redirect(t).#ga(e+1,a,0,c,b)}catch(e){}return b}if(429===b.statusCode&&(null==this.retryFunc||await this.retryFunc(r,b,e))){const t=b.headers["retry-after"];let f=this.#ha.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return"string"==typeof t&&t.match(/^[1-9][0-9]*$/)&&(f=parseInt(t)),r.clone().#ga(e+1,a,f,c,b)}if(this.processFunc){m(c.#ua);try{b=await this.processFunc(r,b)}catch(t){null!=t.throttle&&"number"==typeof t.stall||b.makeServerError("error in post-processing function",t).assertOk();let f=this.#ha.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return t.stall>=0&&(f=t.stall),r.clone().#ga(e+1,a,f,c,b)}}return b}send(){return(0,f.vA)(null==this.#ua,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),this.#ua=new g(this),this.#ga(0,A()+this.timeout,0,this,new y(0,"",{},null,this))}cancel(){(0,f.vA)(null!=this.#ua,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=p.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const a=this.url.split(":")[0].toLowerCase(),t=e.split(":")[0].toLowerCase();(0,f.vA)("GET"===this.method&&("https"!==a||"http"!==t)&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const c=new x(e);return c.method="GET",c.allowGzip=this.allowGzip,c.timeout=this.timeout,c.#fa=Object.assign({},this.#fa),this.#na&&(c.#na=new Uint8Array(this.#na)),c.#ia=this.#ia,c}clone(){const e=new x(this.url);return e.#da=this.#da,this.#na&&(e.#na=this.#na),e.#ia=this.#ia,e.#fa=Object.assign({},this.#fa),e.#ba=this.#ba,this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),e.#oa=this.#oa,e.#sa=this.#sa,e.#la=this.#la,e.#ha=Object.assign({},this.#ha),e.#pa=this.#pa,e}static lockConfig(){s=!0}static getGateway(e){return h[e.toLowerCase()]||null}static registerGateway(e,a){if("http"===(e=e.toLowerCase())||"https"===e)throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(s)throw new Error("gateways locked");h[e]=a}static registerGetUrl(e){if(s)throw new Error("gateways locked");i=e}static createGetUrlFunc(e){return n()}static createDataGateway(){return l}static createIpfsGatewayFunc(e){return u(e)}}class y{#ma;#xa;#fa;#na;#ae;#ya;toString(){return``}get statusCode(){return this.#ma}get statusMessage(){return this.#xa}get headers(){return Object.assign({},this.#fa)}get body(){return null==this.#na?null:new Uint8Array(this.#na)}get bodyText(){try{return null==this.#na?"":(0,r._v)(this.#na)}catch(e){(0,f.vA)(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch(e){(0,f.vA)(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,a=Object.keys(e);let t=0;return{next:()=>{if(t(e[a.toLowerCase()]=String(t[a]),e)),{}),this.#na=null==c?null:new Uint8Array(c),this.#ae=f||null,this.#ya={message:""}}makeServerError(e,a){let t;t=e?`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${e})`:`CLIENT ESCALATED SERVER ERROR (${e=`${this.statusCode} ${this.statusMessage}`})`;const c=new y(599,t,this.headers,this.body,this.#ae||void 0);return c.#ya={message:e,error:a},c}throwThrottleError(e,a){null==a?a=-1:(0,f.MR)(Number.isInteger(a)&&a>=0,"invalid stall timeout","stall",a);const t=new Error(e||"throttling requests");throw(0,d.n)(t,{stall:a,throttle:!0}),t}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return null!=this.#na}get request(){return this.#ae}ok(){return""===this.#ya.message&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:a}=this.#ya;""===e&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let t=null;this.request&&(t=this.request.url);let c=null;try{this.#na&&(c=(0,r._v)(this.#na))}catch(e){}(0,f.vA)(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:a,info:{requestUrl:t,responseBody:c,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}}function A(){return(new Date).getTime()}},27033:(e,a,t)=>{"use strict";t.d(a,{Ab:()=>s,Dg:()=>h,JJ:()=>b,Ro:()=>g,ST:()=>i,WZ:()=>p,c4:()=>x,dK:()=>o,nD:()=>y,up:()=>m});var c=t(36212),f=t(57339);const d=BigInt(0),r=BigInt(1),n=9007199254740991;function i(e,a){const t=l(e,"value"),c=BigInt(p(a,"width"));return(0,f.vA)(t>>c===d,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:e}),t>>c-r?-((~t&(r<=-n&&e<=n,"overflow",a||"value",e),BigInt(e);case"string":try{if(""===e)throw new Error("empty string");return"-"===e[0]&&"-"!==e[1]?-BigInt(e.substring(1)):BigInt(e)}catch(t){(0,f.MR)(!1,`invalid BigNumberish string: ${t.message}`,a||"value",e)}}(0,f.MR)(!1,"invalid BigNumberish value",a||"value",e)}function l(e,a){const t=s(e,a);return(0,f.vA)(t>=d,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:e}),t}const u="0123456789abcdef";function h(e){if(e instanceof Uint8Array){let a="0x0";for(const t of e)a+=u[t>>4],a+=u[15&t];return BigInt(a)}return s(e)}function p(e,a){switch(typeof e){case"bigint":return(0,f.MR)(e>=-n&&e<=n,"overflow",a||"value",e),Number(e);case"number":return(0,f.MR)(Number.isInteger(e),"underflow",a||"value",e),(0,f.MR)(e>=-n&&e<=n,"overflow",a||"value",e),e;case"string":try{if(""===e)throw new Error("empty string");return p(BigInt(e),a)}catch(t){(0,f.MR)(!1,`invalid numeric string: ${t.message}`,a||"value",e)}}(0,f.MR)(!1,"invalid numeric value",a||"value",e)}function g(e){return p(h(e))}function m(e,a){let t=l(e,"value").toString(16);if(null==a)t.length%2&&(t="0"+t);else{const c=p(a,"width");for((0,f.vA)(2*c>=t.length,`value exceeds width (${c} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:e});t.length<2*c;)t="0"+t}return"0x"+t}function x(e){const a=l(e,"value");if(a===d)return new Uint8Array([]);let t=a.toString(16);t.length%2&&(t="0"+t);const c=new Uint8Array(t.length/2);for(let e=0;e{"use strict";function c(e,a,t){const c=a.split("|").map((e=>e.trim()));for(let t=0;tPromise.resolve(e[a]))))).reduce(((e,t,c)=>(e[a[c]]=t,e)),{})}function d(e,a,t){for(let f in a){let d=a[f];const r=t?t[f]:null;r&&c(d,r,f),Object.defineProperty(e,f,{enumerable:!0,value:d,writable:!1})}}t.d(a,{k:()=>f,n:()=>d})},65735:(e,a,t)=>{"use strict";t.d(a,{R:()=>n});var c=t(36212);function f(e){const a=[];for(;e;)a.unshift(255&e),e>>=8;return a}function d(e){if(Array.isArray(e)){let a=[];if(e.forEach((function(e){a=a.concat(d(e))})),a.length<=55)return a.unshift(192+a.length),a;const t=f(a.length);return t.unshift(247+t.length),t.concat(a)}const a=Array.prototype.slice.call((0,c.q5)(e,"object"));if(1===a.length&&a[0]<=127)return a;if(a.length<=55)return a.unshift(128+a.length),a;const t=f(a.length);return t.unshift(183+t.length),t.concat(a)}const r="0123456789abcdef";function n(e){let a="0x";for(const t of d(e))a+=r[t>>4],a+=r[15&t];return a}},99770:(e,a,t)=>{"use strict";t.d(a,{ck:()=>y,g5:()=>A,XS:()=>x});var c=t(57339),f=t(36212),d=t(27033),r=t(88081);const n=BigInt(-1),i=BigInt(0),b=BigInt(1),o=BigInt(5),s={};let l="0000";for(;l.length<80;)l+=l;function u(e){let a=l;for(;a.length=-a&&ei?(0,d.ST)((0,d.dK)(e,f),f):-(0,d.ST)((0,d.dK)(-e,f),f)}else{const a=b<=0&&enull==d[e]?t:((0,c.MR)(typeof d[e]===a,"invalid fixed format ("+e+" not "+a+")","format."+e,d[e]),d[e]);a=r("signed","boolean",a),t=r("width","number",t),f=r("decimals","number",f)}return(0,c.MR)(t%8==0,"invalid FixedNumber width (not byte aligned)","format.width",t),(0,c.MR)(f<=80,"invalid FixedNumber decimals (too large)","format.decimals",f),{signed:a,width:t,decimals:f,name:(a?"":"u")+"fixed"+String(t)+"x"+String(f)}}class g{format;#Aa;#va;#wa;_value;constructor(e,a,t){(0,c.gk)(e,s,"FixedNumber"),this.#va=a,this.#Aa=t;const f=function(e,a){let t="";e0?t*=u(c):c<0&&(a*=u(-c)),at?1:0}eq(e){return 0===this.cmp(e)}lt(e){return this.cmp(e)<0}lte(e){return this.cmp(e)<=0}gt(e){return this.cmp(e)>0}gte(e){return this.cmp(e)>=0}floor(){let e=this.#va;return this.#vai&&(e+=this.#wa-b),e=this.#va/this.#wa*this.#wa,this.#Ia(e,"ceiling")}round(e){if(null==e&&(e=0),e>=this.decimals)return this;const a=this.decimals-e,t=o*u(a-1);let c=this.value+t;const f=u(a);return c=c/f*f,h(c,this.#Aa,"round"),new g(s,c,this.#Aa)}isZero(){return this.#va===i}isNegative(){return this.#va0){const a=u(b);(0,c.vA)(n%a===i,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:e}),n/=a}else b<0&&(n*=u(-b));return h(n,r,"fromValue"),new g(s,n,r)}static fromString(e,a){const t=e.match(/^(-?)([0-9]*)\.?([0-9]*)$/);(0,c.MR)(t&&t[2].length+t[3].length>0,"invalid FixedNumber string value","value",e);const f=p(a);let d=t[2]||"0",r=t[3]||"";for(;r.length=0,"invalid unit","unit",a),t=3*e}else null!=a&&(t=(0,d.WZ)(a,"unit"));return g.fromString(e,{decimals:t,width:512}).value}function y(e){return function(e){let a=18;return a=(0,d.WZ)(18,"unit"),g.fromValue(e,a,{decimals:a,width:512}).toString()}(e)}function A(e){return x(e,18)}},87303:(e,a,t)=>{"use strict";t.d(a,{YW:()=>n,_v:()=>i});var c=t(36212),f=t(57339);function d(e,a,t,c,f){if("BAD_PREFIX"===e||"UNEXPECTED_CONTINUE"===e){let e=0;for(let c=a+1;c>6==2;c++)e++;return e}return"OVERRUN"===e?t.length-a-1:0}const r=Object.freeze({error:function(e,a,t,c,d){(0,f.MR)(!1,`invalid codepoint at offset ${a}; ${e}`,"bytes",t)},ignore:d,replace:function(e,a,t,c,r){return"OVERLONG"===e?((0,f.MR)("number"==typeof r,"invalid bad code point for replacement","badCodepoint",r),c.push(r),0):(c.push(65533),d(e,a,t))}});function n(e,a){(0,f.MR)("string"==typeof e,"invalid string value","str",e),null!=a&&((0,f.SP)(a),e=e.normalize(a));let t=[];for(let a=0;a>6|192),t.push(63&c|128);else if(55296==(64512&c)){a++;const d=e.charCodeAt(a);(0,f.MR)(a>18|240),t.push(r>>12&63|128),t.push(r>>6&63|128),t.push(63&r|128)}else t.push(c>>12|224),t.push(c>>6&63|128),t.push(63&c|128)}return new Uint8Array(t)}function i(e,a){return function(e,a){null==a&&(a=r.error);const t=(0,c.q5)(e,"bytes"),f=[];let d=0;for(;d>7)){f.push(e);continue}let c=null,r=null;if(192==(224&e))c=1,r=127;else if(224==(240&e))c=2,r=2047;else{if(240!=(248&e)){d+=a(128==(192&e)?"UNEXPECTED_CONTINUE":"BAD_PREFIX",d-1,t,f);continue}c=3,r=65535}if(d-1+c>=t.length){d+=a("OVERRUN",d-1,t,f);continue}let n=e&(1<<8-c-1)-1;for(let e=0;e1114111?d+=a("OUT_OF_RANGE",d-1-c,t,f,n):n>=55296&&n<=57343?d+=a("UTF16_SURROGATE",d-1-c,t,f,n):n<=r?d+=a("OVERLONG",d-1-c,t,f,n):f.push(n))}return f}(e,a).map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}},45238:(e,a,t)=>{"use strict";t.d(a,{K:()=>f});var c=t(75930);function f(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?(0,c.o)(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}},75007:(e,a,t)=>{"use strict";t.r(a),t.d(a,{concat:()=>d});var c=t(45238),f=t(75930);function d(e,a){a||(a=e.reduce(((e,a)=>e+a.length),0));const t=(0,c.K)(a);let d=0;for(const a of e)t.set(a,d),d+=a.length;return(0,f.o)(t)}},18402:(e,a,t)=>{"use strict";function c(e,a){if(e===a)return!0;if(e.byteLength!==a.byteLength)return!1;for(let t=0;tc})},44117:(e,a,t)=>{"use strict";t.r(a),t.d(a,{fromString:()=>d});var c=t(50040),f=t(75930);function d(e,a="utf8"){const t=c.A[a];if(!t)throw new Error(`Unsupported encoding "${a}"`);return"utf8"!==a&&"utf-8"!==a||null==globalThis.Buffer||null==globalThis.Buffer.from?t.decoder.decode(`${t.prefix}${e}`):(0,f.o)(globalThis.Buffer.from(e,"utf-8"))}},27302:(e,a,t)=>{"use strict";t.r(a),t.d(a,{toString:()=>f});var c=t(50040);function f(e,a="utf8"){const t=c.A[a];if(!t)throw new Error(`Unsupported encoding "${a}"`);return"utf8"!==a&&"utf-8"!==a||null==globalThis.Buffer||null==globalThis.Buffer.from?t.encoder.encode(e).substring(1):globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8")}},75930:(e,a,t)=>{"use strict";function c(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}t.d(a,{o:()=>c})},50040:(e,a,t)=>{"use strict";t.d(a,{A:()=>Ue});var c={};t.r(c),t.d(c,{identity:()=>M});var f={};t.r(f),t.d(f,{base2:()=>B});var d={};t.r(d),t.d(d,{base8:()=>k});var r={};t.r(r),t.d(r,{base10:()=>L});var n={};t.r(n),t.d(n,{base16:()=>S,base16upper:()=>T});var i={};t.r(i),t.d(i,{base32:()=>N,base32hex:()=>O,base32hexpad:()=>Q,base32hexpadupper:()=>U,base32hexupper:()=>F,base32pad:()=>P,base32padupper:()=>D,base32upper:()=>R,base32z:()=>j});var b={};t.r(b),t.d(b,{base36:()=>H,base36upper:()=>q});var o={};t.r(o),t.d(o,{base58btc:()=>$,base58flickr:()=>z});var s={};t.r(s),t.d(s,{base64:()=>G,base64pad:()=>K,base64url:()=>V,base64urlpad:()=>Z});var l={};t.r(l),t.d(l,{base256emoji:()=>X});var u={};t.r(u),t.d(u,{sha256:()=>ve,sha512:()=>we});var h={};t.r(h),t.d(h,{identity:()=>Ie});var p={};t.r(p),t.d(p,{code:()=>Ce,decode:()=>Be,encode:()=>Me,name:()=>Ee});var g={};t.r(g),t.d(g,{code:()=>Te,decode:()=>Re,encode:()=>Ne,name:()=>Se});const m=function(e,a){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),c=0;c>>0,r=new Uint8Array(d);e[a];){var o=t[e.charCodeAt(a)];if(255===o)return;for(var s=0,l=d-1;(0!==o||s>>0,r[l]=o%256>>>0,o=o/256>>>0;if(0!==o)throw new Error("Non-zero carry");f=s,a++}if(" "!==e[a]){for(var u=d-f;u!==d&&0===r[u];)u++;for(var h=new Uint8Array(c+(d-u)),p=c;u!==d;)h[p++]=r[u++];return h}}}return{encode:function(a){if(a instanceof Uint8Array||(ArrayBuffer.isView(a)?a=new Uint8Array(a.buffer,a.byteOffset,a.byteLength):Array.isArray(a)&&(a=Uint8Array.from(a))),!(a instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===a.length)return"";for(var t=0,c=0,f=0,d=a.length;f!==d&&0===a[f];)f++,t++;for(var r=(d-f)*o+1>>>0,b=new Uint8Array(r);f!==d;){for(var s=a[f],l=0,u=r-1;(0!==s||l>>0,b[u]=s%n>>>0,s=s/n>>>0;if(0!==s)throw new Error("Non-zero carry");c=l,f++}for(var h=r-c;h!==r&&0===b[h];)h++;for(var p=i.repeat(t);h{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")});class y{constructor(e,a,t){this.name=e,this.prefix=a,this.baseEncode=t}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class A{constructor(e,a,t){if(this.name=e,this.prefix=a,void 0===a.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=a.codePointAt(0),this.baseDecode=t}decode(e){if("string"==typeof e){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))}throw Error("Can only multibase decode strings")}or(e){return w(this,e)}}class v{constructor(e){this.decoders=e}or(e){return w(this,e)}decode(e){const a=e[0],t=this.decoders[a];if(t)return t.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const w=(e,a)=>new v({...e.decoders||{[e.prefix]:e},...a.decoders||{[a.prefix]:a}});class _{constructor(e,a,t,c){this.name=e,this.prefix=a,this.baseEncode=t,this.baseDecode=c,this.encoder=new y(e,a,t),this.decoder=new A(e,a,c)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const I=({name:e,prefix:a,encode:t,decode:c})=>new _(e,a,t,c),E=({prefix:e,name:a,alphabet:t})=>{const{encode:c,decode:f}=m(t,a);return I({prefix:e,name:a,encode:c,decode:e=>x(f(e))})},C=({name:e,prefix:a,bitsPerChar:t,alphabet:c})=>I({prefix:a,name:e,encode:e=>((e,a,t)=>{const c="="===a[a.length-1],f=(1<t;)r-=t,d+=a[f&n>>r];if(r&&(d+=a[f&n<((e,a,t,c)=>{const f={};for(let e=0;e=8&&(n-=8,r[b++]=255&i>>n)}if(n>=t||255&i<<8-n)throw new SyntaxError("Unexpected end of data");return r})(a,c,t,e)}),M=I({prefix:"\0",name:"identity",encode:e=>{return a=e,(new TextDecoder).decode(a);var a},decode:e=>(e=>(new TextEncoder).encode(e))(e)}),B=C({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),k=C({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),L=E({prefix:"9",name:"base10",alphabet:"0123456789"}),S=C({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),T=C({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),N=C({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),R=C({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),P=C({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),D=C({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),O=C({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),F=C({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Q=C({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),U=C({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),j=C({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),H=E({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),q=E({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),$=E({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),z=E({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),G=C({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),K=C({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),V=C({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Z=C({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),J=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),W=J.reduce(((e,a,t)=>(e[t]=a,e)),[]),Y=J.reduce(((e,a,t)=>(e[a.codePointAt(0)]=t,e)),[]),X=I({prefix:"🚀",name:"base256emoji",encode:function(e){return e.reduce(((e,a)=>e+W[a]),"")},decode:function(e){const a=[];for(const t of e){const e=Y[t.codePointAt(0)];if(void 0===e)throw new Error(`Non-base256emoji character: ${t}`);a.push(e)}return new Uint8Array(a)}});var ee=128,ae=-128,te=Math.pow(2,31),ce=Math.pow(2,7),fe=Math.pow(2,14),de=Math.pow(2,21),re=Math.pow(2,28),ne=Math.pow(2,35),ie=Math.pow(2,42),be=Math.pow(2,49),oe=Math.pow(2,56),se=Math.pow(2,63);const le=function e(a,t,c){t=t||[];for(var f=c=c||0;a>=te;)t[c++]=255&a|ee,a/=128;for(;a&ae;)t[c++]=255&a|ee,a>>>=7;return t[c]=0|a,e.bytes=c-f+1,t},ue=function(e){return e(le(e,a,t),a),pe=e=>ue(e),ge=(e,a)=>{const t=a.byteLength,c=pe(e),f=c+pe(t),d=new Uint8Array(f+t);return he(e,d,0),he(t,d,c),d.set(a,f),new me(e,t,a,d)};class me{constructor(e,a,t,c){this.code=e,this.size=a,this.digest=t,this.bytes=c}}const xe=({name:e,code:a,encode:t})=>new ye(e,a,t);class ye{constructor(e,a,t){this.name=e,this.code=a,this.encode=t}digest(e){if(e instanceof Uint8Array){const a=this.encode(e);return a instanceof Uint8Array?ge(this.code,a):a.then((e=>ge(this.code,e)))}throw Error("Unknown type, must be binary type")}}const Ae=e=>async a=>new Uint8Array(await crypto.subtle.digest(e,a)),ve=xe({name:"sha2-256",code:18,encode:Ae("SHA-256")}),we=xe({name:"sha2-512",code:19,encode:Ae("SHA-512")}),_e=x,Ie={code:0,name:"identity",encode:_e,digest:e=>ge(0,_e(e))},Ee="raw",Ce=85,Me=e=>x(e),Be=e=>x(e),ke=new TextEncoder,Le=new TextDecoder,Se="json",Te=512,Ne=e=>ke.encode(JSON.stringify(e)),Re=e=>JSON.parse(Le.decode(e));Symbol.toStringTag,Symbol.for("nodejs.util.inspect.custom"),Symbol.for("@ipld/js-cid/CID");const Pe={...c,...f,...d,...r,...n,...i,...b,...o,...s,...l};var De=t(45238);function Oe(e,a,t,c){return{name:e,prefix:a,encoder:{name:e,prefix:a,encode:t},decoder:{decode:c}}}const Fe=Oe("utf8","u",(e=>"u"+new TextDecoder("utf8").decode(e)),(e=>(new TextEncoder).encode(e.substring(1)))),Qe=Oe("ascii","a",(e=>{let a="a";for(let t=0;t{e=e.substring(1);const a=(0,De.K)(e.length);for(let t=0;t{"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},72079:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},3219:e=>{"use strict";e.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},62951:e=>{"use strict";e.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')},64589:e=>{"use strict";e.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},23241:e=>{"use strict";e.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},1636:e=>{"use strict";e.exports={rE:"6.5.7"}},15579:e=>{"use strict";e.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')}},__webpack_module_cache__={};function __webpack_require__(e){var a=__webpack_module_cache__[e];if(void 0!==a)return a.exports;var t=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(t.exports,t,t.exports,__webpack_require__),t.loaded=!0,t.exports}__webpack_require__.amdO={},__webpack_require__.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(a,{a}),a},__webpack_require__.d=(e,a)=>{for(var t in a)__webpack_require__.o(a,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{BatchBlockService:()=>f.B3,BatchEventsService:()=>f.JY,BatchTransactionService:()=>f.AF,Deposit:()=>d.dA,ENSNameWrapper__factory:()=>c.rZ,ENSRegistry__factory:()=>c.S4,ENSResolver__factory:()=>c.BB,ENSUtils:()=>n.gH,ENS__factory:()=>c.p2,ERC20__factory:()=>c.Xc,EnsContracts:()=>n.A6,INDEX_DB_ERROR:()=>s.Fl,IndexedDB:()=>s.mc,Invoice:()=>d.qO,MAX_FEE:()=>v.KN,MAX_TOVARISH_EVENTS:()=>_.o,MIN_FEE:()=>v.Ss,MIN_STAKE_BALANCE:()=>v.pO,MerkleTreeService:()=>u.s,Mimc:()=>h.p,Multicall__factory:()=>c.Q2,NetId:()=>g.zr,NoteAccount:()=>r.Ad,OffchainOracle__factory:()=>c.Hk,OvmGasPriceOracle__factory:()=>c.Ld,Pedersen:()=>m.Hr,RelayerClient:()=>v.OR,ReverseRecords__factory:()=>c.Rp,TokenPriceOracle:()=>y.T,TornadoBrowserProvider:()=>A.D2,TornadoFeeOracle:()=>i.o,TornadoRpcSigner:()=>A.Vr,TornadoVoidSigner:()=>A.Gd,TornadoWallet:()=>A.nA,TovarishClient:()=>_.E,addNetwork:()=>g.AE,addressSchemaType:()=>t.SC,ajv:()=>t.SS,base64ToBytes:()=>I.Kp,bigIntReplacer:()=>I.gn,bnSchemaType:()=>t.iL,bnToBytes:()=>I.jm,buffPedersenHash:()=>m.UB,bufferToBytes:()=>I.lY,bytes32BNSchemaType:()=>t.i1,bytes32SchemaType:()=>t.yF,bytesToBN:()=>I.Ju,bytesToBase64:()=>I.if,bytesToHex:()=>I.My,calculateScore:()=>v.zy,calculateSnarkProof:()=>E.i,chunk:()=>I.iv,concatBytes:()=>I.Id,convertETHToTokenAmount:()=>i.N,createDeposit:()=>d.Hr,crypto:()=>I.Et,customConfig:()=>g.cX,defaultConfig:()=>g.sb,defaultUserAgent:()=>A.mJ,deployHasher:()=>o.l,depositsEventsSchema:()=>t.CI,digest:()=>I.br,downloadZip:()=>C._6,echoEventsSchema:()=>t.ME,enabledChains:()=>g.Af,encodedLabelToLabelhash:()=>n.qX,encryptedNotesSchema:()=>t.XW,factories:()=>c.XB,fetchData:()=>A.Fd,fetchGetUrlFunc:()=>A.uY,fetchIp:()=>l.W,fromContentHash:()=>I.yp,gasZipID:()=>b.Qx,gasZipInbounds:()=>b.dT,gasZipInput:()=>b.x5,gasZipMinMax:()=>b.X,getActiveTokenInstances:()=>g.oY,getActiveTokens:()=>g.h9,getConfig:()=>g.zj,getEventsSchemaValidator:()=>t.ZC,getHttpAgent:()=>A.WU,getIndexedDB:()=>s.W7,getInstanceByAddress:()=>g.Zh,getMultiInstances:()=>g.sX,getNetworkConfig:()=>g.RY,getPermit2CommitmentsSignature:()=>x.Sl,getPermit2Signature:()=>x.KM,getPermitCommitmentsSignature:()=>x.sx,getPermitSignature:()=>x.id,getProvider:()=>A.sO,getProviderWithNetId:()=>A.MF,getRelayerEnsSubdomains:()=>g.o2,getStatusSchema:()=>t.c_,getSubInfo:()=>f.vS,getSupportedInstances:()=>v.XF,getTokenBalances:()=>w.H,getWeightRandom:()=>v.c$,governanceEventsSchema:()=>t.FR,hasherBytecode:()=>o.B,hexToBytes:()=>I.aT,initGroth16:()=>E.O,isHex:()=>I.qv,isNode:()=>I.Ll,jobRequestSchema:()=>t.Yq,jobsSchema:()=>t.Us,labelhash:()=>n.Lr,leBuff2Int:()=>I.ae,leInt2Buff:()=>I.EI,makeLabelNodeAndParent:()=>n.QP,mimc:()=>h.f,multiQueryFilter:()=>f.QL,multicall:()=>p.C,numberFormatter:()=>I.Eg,packEncryptedMessage:()=>r.Fr,parseInvoice:()=>d.Ps,parseNote:()=>d.wd,pedersen:()=>m.NO,permit2Address:()=>x.CS,pickWeightedRandomRelayer:()=>v.sN,populateTransaction:()=>A.zr,proofSchemaType:()=>t.Y6,rBigInt:()=>I.ib,rHex:()=>I.G9,relayerRegistryEventsSchema:()=>t.cl,sleep:()=>I.yy,stakeBurnedEventsSchema:()=>t.Fz,substring:()=>I.uU,toContentHash:()=>I.vd,toFixedHex:()=>I.$W,toFixedLength:()=>I.sY,tornadoEventsSchema:()=>t.U7,unpackEncryptedMessage:()=>r.ol,unzipAsync:()=>C.fY,validateUrl:()=>I.wv,withdrawalsEventsSchema:()=>t.$j,zipAsync:()=>C.a8});var e=__webpack_require__(94513),a={};for(const t in e)"default"!==t&&(a[t]=()=>e[t]);__webpack_require__.d(__webpack_exports__,a);var t=__webpack_require__(59511),c=__webpack_require__(62463),f=__webpack_require__(9723),d=__webpack_require__(7240),r=__webpack_require__(33298),n=__webpack_require__(16795),i=__webpack_require__(37182),b=__webpack_require__(56079),o=__webpack_require__(49540),s=__webpack_require__(83968),l=__webpack_require__(57390),u=__webpack_require__(5217),h=__webpack_require__(22901),p=__webpack_require__(48486),g=__webpack_require__(59499),m=__webpack_require__(85111),x=__webpack_require__(1180),y=__webpack_require__(34525),A=__webpack_require__(46170),v=__webpack_require__(57194),w=__webpack_require__(7393),_=__webpack_require__(96838),I=__webpack_require__(67418),E=__webpack_require__(26746),C=__webpack_require__(18995)})(),__webpack_exports__})())); \ No newline at end of file diff --git a/dist/tornadoContracts.umd.js b/dist/tornadoContracts.umd.js index 069dfdf..5d84f2b 100644 --- a/dist/tornadoContracts.umd.js +++ b/dist/tornadoContracts.umd.js @@ -195,7 +195,7 @@ __webpack_require__.d(typechain_namespaceObject, { Rp: () => (ReverseRecords__factory) }); -;// ./node_modules/ethers/node_modules/@noble/hashes/esm/_assert.js +;// ./node_modules/@noble/hashes/esm/_assert.js function number(n) { if (!Number.isSafeInteger(n) || n < 0) throw new Error(`Wrong positive integer: ${n}`); @@ -233,7 +233,7 @@ function output(out, instance) { const assert = { number, bool, bytes, hash, exists, output }; /* harmony default export */ const _assert = ((/* unused pure expression or super */ null && (assert))); //# sourceMappingURL=_assert.js.map -;// ./node_modules/ethers/node_modules/@noble/hashes/esm/_u64.js +;// ./node_modules/@noble/hashes/esm/_u64.js const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1); const _32n = /* @__PURE__ */ BigInt(32); // We are not using BigUint64Array, because they are extremely slow as per 2022 @@ -296,7 +296,7 @@ const u64 = { }; /* harmony default export */ const _u64 = ((/* unused pure expression or super */ null && (u64))); //# sourceMappingURL=_u64.js.map -;// ./node_modules/ethers/node_modules/@noble/hashes/esm/utils.js +;// ./node_modules/@noble/hashes/esm/utils.js /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ // We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. // node.js versions earlier than v19 don't declare it in global scope. @@ -451,7 +451,7 @@ function randomBytes(bytesLength = 32) { throw new Error('crypto.getRandomValues must be defined'); } //# sourceMappingURL=utils.js.map -;// ./node_modules/ethers/node_modules/@noble/hashes/esm/sha3.js +;// ./node_modules/@noble/hashes/esm/sha3.js diff --git a/package.json b/package.json index bf9912f..7e7a52e 100644 --- a/package.json +++ b/package.json @@ -91,5 +91,11 @@ "typescript": "^5.6.3", "webpack": "^5.95.0", "webpack-cli": "^5.1.4" + }, + "resolutions": { + "strip-ansi": "6.0.1", + "@adraffy/ens-normalize": "1.10.1", + "@noble/curves": "1.2.0", + "@noble/hashes": "1.3.2" } } diff --git a/yarn.lock b/yarn.lock index 99f221b..9cb0d24 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,12 +2,7 @@ # yarn lockfile v1 -"@adraffy/ens-normalize@1.10.0": - version "1.10.0" - resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.10.0.tgz#d2a39395c587e092d77cbbc80acf956a54f38bf7" - integrity sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q== - -"@adraffy/ens-normalize@1.10.1": +"@adraffy/ens-normalize@1.10.0", "@adraffy/ens-normalize@1.10.1": version "1.10.1" resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz#63430d04bd8c5e74f8d7d049338f1cd9d4f02069" integrity sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw== @@ -892,45 +887,18 @@ resolved "https://registry.yarnpkg.com/@multiformats/base-x/-/base-x-4.0.1.tgz#95ff0fa58711789d53aefb2590a8b7a4e715d121" integrity sha512-eMk0b9ReBbV23xXU693TAIrLyeO5iTgBZGSJfpqriG8UkYvr/hC9u9pyMlAakDNHWmbhMZCDs6KQO0jzKD8OTw== -"@noble/curves@1.2.0", "@noble/curves@~1.2.0": +"@noble/curves@1.2.0", "@noble/curves@1.4.2", "@noble/curves@~1.2.0", "@noble/curves@~1.4.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.2.0.tgz#92d7e12e4e49b23105a2555c6984d41733d65c35" integrity sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw== dependencies: "@noble/hashes" "1.3.2" -"@noble/curves@1.4.2", "@noble/curves@~1.4.0": - version "1.4.2" - resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.4.2.tgz#40309198c76ed71bc6dbf7ba24e81ceb4d0d1fe9" - integrity sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw== - dependencies: - "@noble/hashes" "1.4.0" - -"@noble/hashes@1.2.0", "@noble/hashes@~1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.2.0.tgz#a3150eeb09cc7ab207ebf6d7b9ad311a9bdbed12" - integrity sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ== - -"@noble/hashes@1.3.2": +"@noble/hashes@1.2.0", "@noble/hashes@1.3.2", "@noble/hashes@1.4.0", "@noble/hashes@^1.3.1", "@noble/hashes@^1.4.0", "@noble/hashes@~1.2.0", "@noble/hashes@~1.3.0", "@noble/hashes@~1.3.2", "@noble/hashes@~1.4.0": version "1.3.2" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== -"@noble/hashes@1.4.0", "@noble/hashes@~1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.4.0.tgz#45814aa329f30e4fe0ba49426f49dfccdd066426" - integrity sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg== - -"@noble/hashes@^1.3.1", "@noble/hashes@^1.4.0": - version "1.5.0" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.5.0.tgz#abadc5ca20332db2b1b2aa3e496e9af1213570b0" - integrity sha512-1j6kQFb7QRru7eKN3ZDvRcP13rugwdxZqCjbiAVZfIJwgj2A65UmT4TgARXGlXgnRkORLTDTrO19ZErt7+QXgA== - -"@noble/hashes@~1.3.0", "@noble/hashes@~1.3.2": - version "1.3.3" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.3.tgz#39908da56a4adc270147bb07968bf3b16cfe1699" - integrity sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA== - "@noble/secp256k1@1.7.1", "@noble/secp256k1@~1.7.0": version "1.7.1" resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.7.1.tgz#b251c70f824ce3ca7f8dc3df08d58f005cc0507c" @@ -2032,31 +2000,11 @@ ansi-escapes@^4.3.0: dependencies: type-fest "^0.21.3" -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA== - -ansi-regex@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.1.tgz#123d6479e92ad45ad897d4054e3c7ca7db4944e1" - integrity sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw== - -ansi-regex@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.1.tgz#164daac87ab2d6f6db3a29875e2d1766582dabed" - integrity sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g== - ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== -ansi-regex@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.1.0.tgz#95ec409c69619d6cb1b8b34f14b660ef28ebd654" - integrity sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA== - ansi-styles@^3.2.0, ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" @@ -7068,41 +7016,13 @@ string_decoder@~1.1.1: dependencies: ansi-regex "^5.0.1" -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg== - dependencies: - ansi-regex "^2.0.0" - -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow== - dependencies: - ansi-regex "^3.0.0" - -strip-ansi@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" - integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== - dependencies: - ansi-regex "^4.1.0" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: +strip-ansi@6.0.1, strip-ansi@^3.0.0, strip-ansi@^3.0.1, strip-ansi@^4.0.0, strip-ansi@^5.1.0, strip-ansi@^6.0.0, strip-ansi@^6.0.1, strip-ansi@^7.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== dependencies: ansi-regex "^5.0.1" -strip-ansi@^7.0.1: - version "7.1.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" - integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== - dependencies: - ansi-regex "^6.0.1" - strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3"